27 Base = PciData->u.type1.IOLimit;
30 Is32Bit = (
Base & 0xF) == 1;
31 IoBase = (
Base & 0xF0) << 8;
37 IoBase |= PciData->u.type1.IOBaseUpper16 << 16;
38 ASSERT(PciData->u.type1.IOLimit & 0x1);
54 Limit = PciData->u.type1.IOLimit;
57 Is32Bit = (
Limit & 0xF) == 1;
58 IoLimit = (
Limit & 0xF0) << 8;
64 IoLimit |= PciData->u.type1.IOLimitUpper16 << 16;
65 ASSERT(PciData->u.type1.IOBase & 0x1);
69 return IoLimit | 0xFFF;
79 return (PciData->u.type1.MemoryBase << 16);
89 return (PciData->u.type1.MemoryLimit << 16) | 0xFFFFF;
102 PrefetchBase = PciData->u.type1.PrefetchBase;
105 Is64Bit = (PrefetchBase & 0xF) == 1;
106 Base.LowPart = ((PrefetchBase & 0xFFF0) << 16);
112 Base.HighPart = PciData->u.type1.PrefetchBaseUpper32;
129 PrefetchLimit = PciData->u.type1.PrefetchLimit;
132 Is64Bit = (PrefetchLimit & 0xF) == 1;
133 Limit.LowPart = (PrefetchLimit << 16) | 0xFFFFF;
139 Limit.HighPart = PciData->u.type1.PrefetchLimitUpper32;
189 (Current->ProgIf != 1) &&
190 ((PciData->u.type1.IOLimit & 0xF0) == 0xF0))
193 DPRINT(
"Subtractive decode does not seem to be enabled\n");
212 DPRINT1(
"Putting bridge in positive decode because of PDEC\n");
218 DPRINT1(
"PCI : Subtractive decode on 0x%x\n", Current->u.type1.SecondaryBus);
254 BarArray = Current->u.type1.BaseAddresses;
255 for (
i = 0;
i < 6;
i++)
262 CmDescriptor->
Type = IoDescriptor->
Type;
277 Bar = Current->u.type1.ROMBaseAddress;
307 Base.HighPart = BarArray[
i + 1];
329 DPRINT1(
"Bridge I/O Base and Limit: %lx %lx\n",
333 if (!(
Base.LowPart) && (Current->u.type1.IOLimit))
346 DPRINT1(
"Bridge MEM Base and Limit: %lx %lx\n",
372 if (!(
Base.LowPart) && !(HaveIoLimit))
389 IoDescriptor->
u.
Memory.Alignment =
399 PdoExtension->Dependent.type1.PrimaryBus = Current->u.type1.PrimaryBus;
400 PdoExtension->Dependent.type1.SecondaryBus = Current->u.type1.SecondaryBus;
401 PdoExtension->Dependent.type1.SubordinateBus = Current->u.type1.SubordinateBus;
407 DPRINT1(
"Subtractive decode bridge\n");
455 DPRINT1(
"apply config save hack to ICH subtractive decode\n");
457 PdoExtension->ParentFdoExtension->PreservedConfig = SavedConfig;
479 BarArray =
Working->u.type1.BaseAddresses;
516 (&
Limit[
i])->
u.Port.MinimumAddress.QuadPart = 0;
530 (&
Limit[
i])->
u.Port.Alignment = 0x1000;
531 (&
Limit[
i])->u.Port.MinimumAddress.QuadPart = 0;
532 (&
Limit[
i])->
u.Port.MaximumAddress = MemoryLimit;
533 (&
Limit[
i])->
u.Port.Length = 0;
544 (&
Limit[
i])->
u.Memory.Alignment = 0x100000;
545 (&
Limit[
i])->u.Memory.MinimumAddress.QuadPart = 0;
546 (&
Limit[
i])->
u.Memory.MaximumAddress = MemoryLimit;
547 (&
Limit[
i])->
u.Memory.Length = 0;
549 else if (
Working->u.type1.PrefetchLimit)
557 (&
Limit[
i])->
u.Memory.Alignment = 0x100000;
558 (&
Limit[
i])->u.Memory.MinimumAddress.QuadPart = 0;
559 (&
Limit[
i])->
u.Memory.MaximumAddress = MemoryLimit;
560 (&
Limit[
i])->
u.Memory.Length = 0;
575 &
Working->u.type1.ROMBaseAddress,
601 PciData->u.type1.PrimaryBus = Current->u.type1.PrimaryBus;
602 PciData->u.type1.SecondaryBus = Current->u.type1.SecondaryBus;
603 PciData->u.type1.SubordinateBus = Current->u.type1.SubordinateBus;
604 PciData->u.type1.SecondaryLatency = Current->u.type1.SecondaryLatency;
607 PciData->u.type1.IOBaseUpper16 = 0xFFFE;
608 PciData->u.type1.IOLimitUpper16 = 0xFFFF;
611 Context->SecondaryStatus = Current->u.type1.SecondaryStatus;
614 Current->u.type1.SecondaryStatus = 0;
615 PciData->u.type1.SecondaryStatus = 0;
623 Context->Current->u.type1.SecondaryStatus =
Context->SecondaryStatus;
640 IoDescriptor->u.DevicePrivate.Data[0] = 3;
641 IoDescriptor->u.DevicePrivate.Data[1] = 3;
646 IoDescriptor[1].u.Port.Length = 0x20000;
647 IoDescriptor[1].u.Port.Alignment = 1;
648 IoDescriptor[1].u.Port.MinimumAddress.QuadPart = 0xA0000;
649 IoDescriptor[1].u.Port.MaximumAddress.QuadPart = 0xBFFFF;
655 IoDescriptor[2].u.Port.Length = 12;
656 IoDescriptor[2].u.Port.Alignment = 1;
657 IoDescriptor[2].u.Port.MinimumAddress.QuadPart = 0x3B0;
658 IoDescriptor[2].u.Port.MaximumAddress.QuadPart = 0x3BB;
664 IoDescriptor[3].u.Port.Length = 32;
665 IoDescriptor[3].u.Port.Alignment = 1;
666 IoDescriptor[3].u.Port.MinimumAddress.QuadPart = 0x3C0;
667 IoDescriptor[3].u.Port.MaximumAddress.QuadPart = 0x3DF;
710 PciData->u.type1.MemoryBase = 0xFFFF;
711 PciData->u.type1.PrefetchBase = 0xFFFF;
712 PciData->u.type1.IOBase = 0xFF;
713 PciData->u.type1.IOLimit = 0;
714 PciData->u.type1.MemoryLimit = 0;
715 PciData->u.type1.PrefetchLimit = 0;
716 PciData->u.type1.PrefetchBaseUpper32 = 0;
717 PciData->u.type1.PrefetchLimitUpper32 = 0;
718 PciData->u.type1.IOBaseUpper16 = 0;
719 PciData->u.type1.IOLimitUpper16 = 0;
731 PciData->u.type1.IOBase =
FdoExtension->PreservedConfig->u.type1.IOBase;
732 PciData->u.type1.IOLimit =
FdoExtension->PreservedConfig->u.type1.IOLimit;
733 PciData->u.type1.MemoryBase =
FdoExtension->PreservedConfig->u.type1.MemoryBase;
734 PciData->u.type1.MemoryLimit =
FdoExtension->PreservedConfig->u.type1.MemoryLimit;
735 PciData->u.type1.PrefetchBase =
FdoExtension->PreservedConfig->u.type1.PrefetchBase;
736 PciData->u.type1.PrefetchLimit =
FdoExtension->PreservedConfig->u.type1.PrefetchLimit;
737 PciData->u.type1.PrefetchBaseUpper32 =
FdoExtension->PreservedConfig->u.type1.PrefetchBaseUpper32;
738 PciData->u.type1.PrefetchLimitUpper32 =
FdoExtension->PreservedConfig->u.type1.PrefetchLimitUpper32;
739 PciData->u.type1.IOBaseUpper16 =
FdoExtension->PreservedConfig->u.type1.IOBaseUpper16;
740 PciData->u.type1.IOLimitUpper16 =
FdoExtension->PreservedConfig->u.type1.IOLimitUpper16;
748 for (
i = 0;
i < 6;
i++)
755 PciData->u.type1.PrimaryBus =
PdoExtension->Dependent.type1.PrimaryBus;
756 PciData->u.type1.SecondaryBus =
PdoExtension->Dependent.type1.SecondaryBus;
757 PciData->u.type1.SubordinateBus =
PdoExtension->Dependent.type1.SubordinateBus;
#define NT_SUCCESS(StatCode)
BOOLEAN NTAPI PciIsSlotPresentInParentMethod(IN PPCI_PDO_EXTENSION PdoExtension, IN ULONG Method)
NTSTATUS NTAPI PciGetBiosConfig(IN PPCI_PDO_EXTENSION DeviceExtension, OUT PPCI_COMMON_HEADER PciData)
BOOLEAN NTAPI PciCreateIoDescriptorFromBarLimit(PIO_RESOURCE_DESCRIPTOR ResourceDescriptor, IN PULONG BarArray, IN BOOLEAN Rom)
#define UNIMPLEMENTED_DBGBREAK(...)
#define ExAllocatePoolWithTag(hernya, size, tag)
union Alignment_ Alignment
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
#define CmResourceTypeNull
#define CmResourceTypeMemory
#define CmResourceTypeDevicePrivate
#define CmResourceTypePort
#define RtlFillMemory(Dest, Length, Fill)
#define CM_RESOURCE_PORT_POSITIVE_DECODE
#define CM_RESOURCE_MEMORY_PREFETCHABLE
#define CM_RESOURCE_PORT_WINDOW_DECODE
#define CM_RESOURCE_MEMORY_READ_WRITE
#define CM_RESOURCE_PORT_10_BIT_DECODE
#define UNREFERENCED_PARAMETER(P)
_In_ ULONG _In_ ULONG _In_ ULONG Length
VOID NTAPI PPBridge_SaveCurrentSettings(IN PPCI_CONFIGURATOR_CONTEXT Context)
PHYSICAL_ADDRESS NTAPI PciBridgePrefetchMemoryBase(IN PPCI_COMMON_HEADER PciData)
VOID NTAPI PPBridge_GetAdditionalResourceDescriptors(IN PPCI_CONFIGURATOR_CONTEXT Context, IN PPCI_COMMON_HEADER PciData, IN PIO_RESOURCE_DESCRIPTOR IoDescriptor)
BOOLEAN NTAPI PciBridgeIsSubtractiveDecode(IN PPCI_CONFIGURATOR_CONTEXT Context)
ULONG NTAPI PciBridgeMemoryWorstCaseAlignment(IN ULONG Length)
PHYSICAL_ADDRESS NTAPI PciBridgePrefetchMemoryLimit(IN PPCI_COMMON_HEADER PciData)
VOID NTAPI PPBridge_RestoreCurrent(IN PPCI_CONFIGURATOR_CONTEXT Context)
VOID NTAPI PPBridge_MassageHeaderForLimitsDetermination(IN PPCI_CONFIGURATOR_CONTEXT Context)
VOID NTAPI PPBridge_ChangeResourceSettings(IN PPCI_PDO_EXTENSION PdoExtension, IN PPCI_COMMON_HEADER PciData)
BOOLEAN NTAPI PciBridgeIsPositiveDecode(IN PPCI_PDO_EXTENSION PdoExtension)
VOID NTAPI PPBridge_SaveLimits(IN PPCI_CONFIGURATOR_CONTEXT Context)
ULONG NTAPI PciBridgeIoBase(IN PPCI_COMMON_HEADER PciData)
ULONG NTAPI PciBridgeMemoryLimit(IN PPCI_COMMON_HEADER PciData)
VOID NTAPI PPBridge_ResetDevice(IN PPCI_PDO_EXTENSION PdoExtension, IN PPCI_COMMON_HEADER PciData)
ULONG NTAPI PciBridgeIoLimit(IN PPCI_COMMON_HEADER PciData)
ULONG NTAPI PciBridgeMemoryBase(IN PPCI_COMMON_HEADER PciData)
#define PCI_ENABLE_BRIDGE_VGA
#define PCI_HACK_SUBTRACTIVE_DECODE
#define PCI_ENABLE_BRIDGE_ISA
#define PCI_HACK_BROKEN_SUBTRACTIVE_DECODE
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391::@396 Memory
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391 u
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391::@392 Generic
struct _IO_RESOURCE_DESCRIPTOR::@2055::@2060 Generic
union _IO_RESOURCE_DESCRIPTOR::@2055 u
struct _IO_RESOURCE_DESCRIPTOR::@2055::@2057 Memory
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
struct _LARGE_INTEGER::@2303 u
_Must_inspect_result_ _In_ ULONG Flags
#define PCI_ADDRESS_IO_ADDRESS_MASK
#define PCI_ENABLE_IO_SPACE
#define PCI_SUBCLASS_BR_PCI_TO_PCI
#define PCI_ADDRESS_IO_SPACE
#define PCI_CONFIGURATION_TYPE(PciData)
#define PCI_ENABLE_MEMORY_SPACE
#define PCI_TYPE1_ADDRESSES
#define PCI_ADDRESS_ROM_ADDRESS_MASK
#define PCI_ADDRESS_MEMORY_ADDRESS_MASK
#define PCI_COMMON_HDR_LENGTH
#define PCI_CLASS_BRIDGE_DEV
#define PCI_ROMADDRESS_ENABLED
#define PCI_ADDRESS_MEMORY_TYPE_MASK
_In_ LONG _In_ LONG Limit