ReactOS  0.4.13-dev-241-g63286c6
bus.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _PCIPBUSDATA
 
struct  _PCI_CONFIG_HANDLER
 
struct  _PCI_REGISTRY_INFO_INTERNAL
 
struct  _PCI_TYPE1_CFG_BITS
 
struct  _PCI_TYPE2_CSE_BITS
 
struct  _PCI_TYPE2_ADDRESS_BITS
 
struct  _PCI_TYPE0_CFG_CYCLE_BITS
 
struct  _PCI_TYPE1_CFG_CYCLE_BITS
 
struct  _ARRAY
 
struct  _HAL_BUS_HANDLER
 

Macros

#define PCI_ADDRESS_MEMORY_SPACE   0x00000000
 
#define PASTE2(x, y)   x ## y
 
#define POINTER_TO_(x)   PASTE2(P,x)
 
#define READ_FROM(x)   PASTE2(READ_PORT_, x)
 
#define WRITE_TO(x)   PASTE2(WRITE_PORT_, x)
 
#define TYPE_DEFINE(x, y)
 
#define TYPE1_DEFINE(x)   TYPE_DEFINE(x, PPCI_TYPE1_CFG_BITS);
 
#define TYPE2_DEFINE(x)   TYPE_DEFINE(x, PPCI_TYPE2_ADDRESS_BITS);
 
#define TYPE1_START(x, y)
 
#define TYPE1_END(y)   return sizeof(y); }
 
#define TYPE2_END   TYPE1_END
 
#define TYPE1_READ(x, y)
 
#define TYPE1_WRITE(x, y)
 
#define TYPE2_START(x, y)
 
#define TYPE2_READ(x, y)
 
#define TYPE2_WRITE(x, y)
 
#define PCI_TYPE1_ADDRESS_PORT   (PULONG)0xCF8
 
#define PCI_TYPE1_DATA_PORT   0xCFC
 
#define PCI_TYPE2_CSE_PORT   (PUCHAR)0xCF8
 
#define PCI_TYPE2_FORWARD_PORT   (PUCHAR)0xCFA
 
#define PCI_TYPE2_ADDRESS_BASE   0xC
 

Typedefs

typedef NTSTATUS(NTAPIPciIrqRange) (IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN PCI_SLOT_NUMBER PciSlot, OUT PSUPPORTED_RANGE *Interrupt)
 
typedef struct _PCIPBUSDATA PCIPBUSDATA
 
typedef struct _PCIPBUSDATAPPCIPBUSDATA
 
typedef ULONG(NTAPIFncConfigIO) (IN PPCIPBUSDATA BusData, IN PVOID State, IN PUCHAR Buffer, IN ULONG Offset)
 
typedef VOID(NTAPIFncSync) (IN PBUS_HANDLER BusHandler, IN PCI_SLOT_NUMBER Slot, IN PKIRQL Irql, IN PVOID State)
 
typedef VOID(NTAPIFncReleaseSync) (IN PBUS_HANDLER BusHandler, IN KIRQL Irql)
 
typedef struct _PCI_CONFIG_HANDLER PCI_CONFIG_HANDLER
 
typedef struct _PCI_CONFIG_HANDLERPPCI_CONFIG_HANDLER
 
typedef struct _PCI_REGISTRY_INFO_INTERNAL PCI_REGISTRY_INFO_INTERNAL
 
typedef struct _PCI_REGISTRY_INFO_INTERNALPPCI_REGISTRY_INFO_INTERNAL
 
typedef struct _PCI_TYPE1_CFG_BITS PCI_TYPE1_CFG_BITS
 
typedef struct _PCI_TYPE1_CFG_BITSPPCI_TYPE1_CFG_BITS
 
typedef struct _PCI_TYPE2_CSE_BITS PCI_TYPE2_CSE_BITS
 
typedef struct _PCI_TYPE2_CSE_BITS PPCI_TYPE2_CSE_BITS
 
typedef struct _PCI_TYPE2_ADDRESS_BITS PCI_TYPE2_ADDRESS_BITS
 
typedef struct _PCI_TYPE2_ADDRESS_BITSPPCI_TYPE2_ADDRESS_BITS
 
typedef struct _PCI_TYPE0_CFG_CYCLE_BITS PCI_TYPE0_CFG_CYCLE_BITS
 
typedef struct _PCI_TYPE0_CFG_CYCLE_BITSPPCI_TYPE0_CFG_CYCLE_BITS
 
typedef struct _PCI_TYPE1_CFG_CYCLE_BITS PCI_TYPE1_CFG_CYCLE_BITS
 
typedef struct _PCI_TYPE1_CFG_CYCLE_BITSPPCI_TYPE1_CFG_CYCLE_BITS
 
typedef struct _ARRAY ARRAY
 
typedef struct _ARRAYPARRAY
 
typedef struct _HAL_BUS_HANDLER HAL_BUS_HANDLER
 
typedef struct _HAL_BUS_HANDLERPHAL_BUS_HANDLER
 

Functions

INIT_FUNCTION PPCI_REGISTRY_INFO_INTERNAL NTAPI HalpQueryPciRegistryInfo (VOID)
 
VOID NTAPI HalpPCISynchronizeType1 (IN PBUS_HANDLER BusHandler, IN PCI_SLOT_NUMBER Slot, IN PKIRQL Irql, IN PPCI_TYPE1_CFG_BITS PciCfg)
 
VOID NTAPI HalpPCIReleaseSynchronzationType1 (IN PBUS_HANDLER BusHandler, IN KIRQL Irql)
 
VOID NTAPI HalpPCISynchronizeType2 (IN PBUS_HANDLER BusHandler, IN PCI_SLOT_NUMBER Slot, IN PKIRQL Irql, IN PPCI_TYPE2_ADDRESS_BITS PciCfg)
 
VOID NTAPI HalpPCIReleaseSynchronizationType2 (IN PBUS_HANDLER BusHandler, IN KIRQL Irql)
 
 TYPE1_DEFINE (HalpPCIReadUcharType1)
 
 TYPE1_DEFINE (HalpPCIReadUshortType1)
 
 TYPE1_DEFINE (HalpPCIReadUlongType1)
 
 TYPE2_DEFINE (HalpPCIReadUcharType2)
 
 TYPE2_DEFINE (HalpPCIReadUshortType2)
 
 TYPE2_DEFINE (HalpPCIReadUlongType2)
 
 TYPE1_DEFINE (HalpPCIWriteUcharType1)
 
 TYPE1_DEFINE (HalpPCIWriteUshortType1)
 
 TYPE1_DEFINE (HalpPCIWriteUlongType1)
 
 TYPE2_DEFINE (HalpPCIWriteUcharType2)
 
 TYPE2_DEFINE (HalpPCIWriteUshortType2)
 
 TYPE2_DEFINE (HalpPCIWriteUlongType2)
 
BOOLEAN NTAPI HalpValidPCISlot (IN PBUS_HANDLER BusHandler, IN PCI_SLOT_NUMBER Slot)
 
VOID NTAPI HalpReadPCIConfig (IN PBUS_HANDLER BusHandler, IN PCI_SLOT_NUMBER Slot, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
 
VOID NTAPI HalpWritePCIConfig (IN PBUS_HANDLER BusHandler, IN PCI_SLOT_NUMBER Slot, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
 
ULONG NTAPI HalpGetPCIData (IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootBusHandler, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
 
ULONG NTAPI HalpSetPCIData (IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootBusHandler, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
 
NTSTATUS NTAPI HalpAssignPCISlotResources (IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN PUNICODE_STRING RegistryPath, IN PUNICODE_STRING DriverClassName OPTIONAL, IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT DeviceObject OPTIONAL, IN ULONG Slot, IN OUT PCM_RESOURCE_LIST *pAllocatedResources)
 
ULONG NTAPI HalpGetSystemInterruptVector_Acpi (ULONG BusNumber, ULONG BusInterruptLevel, ULONG BusInterruptVector, PKIRQL Irql, PKAFFINITY Affinity)
 
ULONG NTAPI HalpGetCmosData (IN ULONG BusNumber, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Length)
 
ULONG NTAPI HalpSetCmosData (IN ULONG BusNumber, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Length)
 
INIT_FUNCTION VOID NTAPI HalpInitializePciBus (VOID)
 
INIT_FUNCTION VOID NTAPI HalpInitializePciStubs (VOID)
 
BOOLEAN NTAPI HalpTranslateBusAddress (IN INTERFACE_TYPE InterfaceType, IN ULONG BusNumber, IN PHYSICAL_ADDRESS BusAddress, IN OUT PULONG AddressSpace, OUT PPHYSICAL_ADDRESS TranslatedAddress)
 
NTSTATUS NTAPI HalpAssignSlotResources (IN PUNICODE_STRING RegistryPath, IN PUNICODE_STRING DriverClassName, IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT DeviceObject, IN INTERFACE_TYPE BusType, IN ULONG BusNumber, IN ULONG SlotNumber, IN OUT PCM_RESOURCE_LIST *AllocatedResources)
 
BOOLEAN NTAPI HalpFindBusAddressTranslation (IN PHYSICAL_ADDRESS BusAddress, IN OUT PULONG AddressSpace, OUT PPHYSICAL_ADDRESS TranslatedAddress, IN OUT PULONG_PTR Context, IN BOOLEAN NextBus)
 
INIT_FUNCTION VOID NTAPI HalpRegisterPciDebuggingDeviceInfo (VOID)
 
BOOLEAN NTAPI HaliTranslateBusAddress (IN INTERFACE_TYPE InterfaceType, IN ULONG BusNumber, IN PHYSICAL_ADDRESS BusAddress, IN OUT PULONG AddressSpace, OUT PPHYSICAL_ADDRESS TranslatedAddress)
 
BOOLEAN NTAPI HaliFindBusAddressTranslation (IN PHYSICAL_ADDRESS BusAddress, IN OUT PULONG AddressSpace, OUT PPHYSICAL_ADDRESS TranslatedAddress, IN OUT PULONG_PTR Context, IN BOOLEAN NextBus)
 
NTSTATUS NTAPI HalpAdjustPCIResourceList (IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN OUT PIO_RESOURCE_REQUIREMENTS_LIST *pResourceList)
 
ULONG NTAPI HalpGetPCIIntOnISABus (IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN ULONG BusInterruptLevel, IN ULONG BusInterruptVector, OUT PKIRQL Irql, OUT PKAFFINITY Affinity)
 
VOID NTAPI HalpPCIPin2ISALine (IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN PCI_SLOT_NUMBER SlotNumber, IN PPCI_COMMON_CONFIG PciData)
 
VOID NTAPI HalpPCIISALine2Pin (IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN PCI_SLOT_NUMBER SlotNumber, IN PPCI_COMMON_CONFIG PciNewData, IN PPCI_COMMON_CONFIG PciOldData)
 
NTSTATUS NTAPI HalpGetISAFixedPCIIrq (IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN PCI_SLOT_NUMBER PciSlot, OUT PSUPPORTED_RANGE *Range)
 
VOID NTAPI HalpInitBusHandler (VOID)
 
PBUS_HANDLER NTAPI HalpContextToBusHandler (IN ULONG_PTR ContextValue)
 
PBUS_HANDLER FASTCALL HaliReferenceHandlerForConfigSpace (IN BUS_DATA_TYPE ConfigType, IN ULONG BusNumber)
 
ULONG NTAPI HalpNoBusData (IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
 
ULONG NTAPI HalpcGetCmosData (IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
 
ULONG NTAPI HalpcSetCmosData (IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
 
BOOLEAN NTAPI HalpTranslateSystemBusAddress (IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN PHYSICAL_ADDRESS BusAddress, IN OUT PULONG AddressSpace, OUT PPHYSICAL_ADDRESS TranslatedAddress)
 
BOOLEAN NTAPI HalpTranslateIsaBusAddress (IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN PHYSICAL_ADDRESS BusAddress, IN OUT PULONG AddressSpace, OUT PPHYSICAL_ADDRESS TranslatedAddress)
 
ULONG NTAPI HalpGetSystemInterruptVector (IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN ULONG BusInterruptLevel, IN ULONG BusInterruptVector, OUT PKIRQL Irql, OUT PKAFFINITY Affinity)
 

Variables

PCI_CONFIG_HANDLER PCIConfigHandler
 
PCI_CONFIG_HANDLER PCIConfigHandlerType1
 
PCI_CONFIG_HANDLER PCIConfigHandlerType2
 
ULONG HalpBusType
 
BOOLEAN HalpPCIConfigInitialized
 
BUS_HANDLER HalpFakePciBusHandler
 
ULONG HalpMinPciBus
 
ULONG HalpMaxPciBus
 
LIST_ENTRY HalpAllBusHandlers
 

Macro Definition Documentation

◆ PASTE2

#define PASTE2 (   x,
  y 
)    x ## y

Definition at line 8 of file bus.h.

◆ PCI_ADDRESS_MEMORY_SPACE

#define PCI_ADDRESS_MEMORY_SPACE   0x00000000

Definition at line 3 of file bus.h.

◆ PCI_TYPE1_ADDRESS_PORT

#define PCI_TYPE1_ADDRESS_PORT   (PULONG)0xCF8

Definition at line 164 of file bus.h.

◆ PCI_TYPE1_DATA_PORT

#define PCI_TYPE1_DATA_PORT   0xCFC

Definition at line 165 of file bus.h.

◆ PCI_TYPE2_ADDRESS_BASE

#define PCI_TYPE2_ADDRESS_BASE   0xC

Definition at line 172 of file bus.h.

◆ PCI_TYPE2_CSE_PORT

#define PCI_TYPE2_CSE_PORT   (PUCHAR)0xCF8

Definition at line 170 of file bus.h.

◆ PCI_TYPE2_FORWARD_PORT

#define PCI_TYPE2_FORWARD_PORT   (PUCHAR)0xCFA

Definition at line 171 of file bus.h.

◆ POINTER_TO_

#define POINTER_TO_ (   x)    PASTE2(P,x)

Definition at line 9 of file bus.h.

◆ READ_FROM

#define READ_FROM (   x)    PASTE2(READ_PORT_, x)

Definition at line 10 of file bus.h.

◆ TYPE1_DEFINE

#define TYPE1_DEFINE (   x)    TYPE_DEFINE(x, PPCI_TYPE1_CFG_BITS);

Definition at line 25 of file bus.h.

◆ TYPE1_END

#define TYPE1_END (   y)    return sizeof(y); }

Definition at line 37 of file bus.h.

◆ TYPE1_READ

#define TYPE1_READ (   x,
  y 
)
Value:
*((POINTER_TO_(y))Buffer) = \
READ_FROM(y)((POINTER_TO_(y))(ULONG_PTR)(BusData->Config.Type1.Data + i)); \
TYPE1_END(y)
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
uint32_t ULONG_PTR
Definition: typedefs.h:63
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
Definition: glfuncs.h:248
Definition: bufpool.h:45
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define POINTER_TO_(x)
Definition: bus.h:9
#define TYPE1_START(x, y)
Definition: bus.h:31

Definition at line 44 of file bus.h.

◆ TYPE1_START

#define TYPE1_START (   x,
  y 
)
Value:
{ \
ULONG i = Offset % sizeof(ULONG); \
PciCfg->u.bits.RegisterNumber = Offset / sizeof(ULONG); \
WRITE_PORT_ULONG(BusData->Config.Type1.Address, PciCfg->u.AsULONG);
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define TYPE_DEFINE(x, y)
Definition: bus.h:16
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
Definition: glfuncs.h:248
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
unsigned int ULONG
Definition: retypes.h:1

Definition at line 31 of file bus.h.

◆ TYPE1_WRITE

#define TYPE1_WRITE (   x,
  y 
)
Value:
WRITE_TO(y)((POINTER_TO_(y))(ULONG_PTR)(BusData->Config.Type1.Data + i), \
*((POINTER_TO_(y))Buffer)); \
TYPE1_END(y)
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
uint32_t ULONG_PTR
Definition: typedefs.h:63
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
Definition: glfuncs.h:248
Definition: bufpool.h:45
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define POINTER_TO_(x)
Definition: bus.h:9
#define TYPE1_START(x, y)
Definition: bus.h:31

Definition at line 53 of file bus.h.

◆ TYPE2_DEFINE

#define TYPE2_DEFINE (   x)    TYPE_DEFINE(x, PPCI_TYPE2_ADDRESS_BITS);

Definition at line 26 of file bus.h.

◆ TYPE2_END

#define TYPE2_END   TYPE1_END

Definition at line 39 of file bus.h.

◆ TYPE2_READ

#define TYPE2_READ (   x,
  y 
)
Value:
*((POINTER_TO_(y))Buffer) = \
READ_FROM(y)((POINTER_TO_(y))(ULONG_PTR)PciCfg->u.AsUSHORT); \
TYPE2_END(y)
#define TYPE2_START(x, y)
Definition: bus.h:62
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
uint32_t ULONG_PTR
Definition: typedefs.h:63
Definition: bufpool.h:45
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define POINTER_TO_(x)
Definition: bus.h:9

Definition at line 70 of file bus.h.

◆ TYPE2_START

#define TYPE2_START (   x,
  y 
)
Value:
{ \
PciCfg->u.bits.RegisterNumber = (USHORT)Offset;
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define TYPE_DEFINE(x, y)
Definition: bus.h:16
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
unsigned short USHORT
Definition: pedump.c:61

Definition at line 62 of file bus.h.

◆ TYPE2_WRITE

#define TYPE2_WRITE (   x,
  y 
)
Value:
WRITE_TO(y)((POINTER_TO_(y))(ULONG_PTR)PciCfg->u.AsUSHORT, \
*((POINTER_TO_(y))Buffer)); \
TYPE2_END(y)
#define TYPE2_START(x, y)
Definition: bus.h:62
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
uint32_t ULONG_PTR
Definition: typedefs.h:63
Definition: bufpool.h:45
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define POINTER_TO_(x)
Definition: bus.h:9

Definition at line 79 of file bus.h.

◆ TYPE_DEFINE

#define TYPE_DEFINE (   x,
  y 
)
Value:
x( \
IN PPCIPBUSDATA BusData, \
IN y PciCfg, \
)
#define IN
Definition: typedefs.h:38
unsigned char * PUCHAR
Definition: retypes.h:3
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
Definition: bufpool.h:45
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
unsigned int ULONG
Definition: retypes.h:1

Definition at line 16 of file bus.h.

◆ WRITE_TO

#define WRITE_TO (   x)    PASTE2(WRITE_PORT_, x)

Definition at line 11 of file bus.h.

Typedef Documentation

◆ ARRAY

typedef struct _ARRAY ARRAY

◆ FncConfigIO

typedef ULONG(NTAPI * FncConfigIO) (IN PPCIPBUSDATA BusData, IN PVOID State, IN PUCHAR Buffer, IN ULONG Offset)

Definition at line 122 of file bus.h.

◆ FncReleaseSync

typedef VOID(NTAPI * FncReleaseSync) (IN PBUS_HANDLER BusHandler, IN KIRQL Irql)

Definition at line 138 of file bus.h.

◆ FncSync

typedef VOID(NTAPI * FncSync) (IN PBUS_HANDLER BusHandler, IN PCI_SLOT_NUMBER Slot, IN PKIRQL Irql, IN PVOID State)

Definition at line 130 of file bus.h.

◆ HAL_BUS_HANDLER

◆ PARRAY

typedef struct _ARRAY * PARRAY

◆ PCI_CONFIG_HANDLER

◆ PCI_REGISTRY_INFO_INTERNAL

◆ PCI_TYPE0_CFG_CYCLE_BITS

◆ PCI_TYPE1_CFG_BITS

◆ PCI_TYPE1_CFG_CYCLE_BITS

◆ PCI_TYPE2_ADDRESS_BITS

◆ PCI_TYPE2_CSE_BITS

◆ PciIrqRange

typedef NTSTATUS(NTAPI * PciIrqRange) (IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN PCI_SLOT_NUMBER PciSlot, OUT PSUPPORTED_RANGE *Interrupt)

Definition at line 86 of file bus.h.

◆ PCIPBUSDATA

◆ PHAL_BUS_HANDLER

◆ PPCI_CONFIG_HANDLER

◆ PPCI_REGISTRY_INFO_INTERNAL

◆ PPCI_TYPE0_CFG_CYCLE_BITS

◆ PPCI_TYPE1_CFG_BITS

◆ PPCI_TYPE1_CFG_CYCLE_BITS

◆ PPCI_TYPE2_ADDRESS_BITS

◆ PPCI_TYPE2_CSE_BITS

◆ PPCIPBUSDATA

Function Documentation

◆ HaliFindBusAddressTranslation()

BOOLEAN NTAPI HaliFindBusAddressTranslation ( IN PHYSICAL_ADDRESS  BusAddress,
IN OUT PULONG  AddressSpace,
OUT PPHYSICAL_ADDRESS  TranslatedAddress,
IN OUT PULONG_PTR  Context,
IN BOOLEAN  NextBus 
)

Definition at line 1266 of file bussupp.c.

1271 {
1272  PHAL_BUS_HANDLER BusHandler;
1274  PLIST_ENTRY NextEntry;
1275  ULONG ContextValue;
1276 
1277  /* Make sure we have a context */
1278  if (!Context) return FALSE;
1279  ASSERT((*Context) || (NextBus == TRUE));
1280 
1281  /* Read the context */
1282  ContextValue = *Context;
1283 
1284  /* Find the bus handler */
1285  Handler = HalpContextToBusHandler(ContextValue);
1286  if (!Handler) return FALSE;
1287 
1288  /* Check if this is an ongoing lookup */
1289  if (NextBus)
1290  {
1291  /* Get the HAL bus handler */
1293  NextEntry = &BusHandler->AllHandlers;
1294 
1295  /* Get the next one if we were already with one */
1296  if (ContextValue) NextEntry = NextEntry->Flink;
1297 
1298  /* Start scanning */
1299  while (TRUE)
1300  {
1301  /* Check if this is the last one */
1302  if (NextEntry == &HalpAllBusHandlers)
1303  {
1304  /* Quit */
1305  *Context = 1;
1306  return FALSE;
1307  }
1308 
1309  /* Call this translator */
1310  BusHandler = CONTAINING_RECORD(NextEntry, HAL_BUS_HANDLER, AllHandlers);
1312  BusHandler->Handler.BusNumber,
1313  BusAddress,
1314  AddressSpace,
1315  TranslatedAddress)) break;
1316 
1317  /* Try the next one */
1318  NextEntry = NextEntry->Flink;
1319  }
1320 
1321  /* If we made it, we're done */
1323  return TRUE;
1324  }
1325 
1326  /* Try the first one through */
1327  if (!HalTranslateBusAddress(Handler->InterfaceType,
1328  Handler->BusNumber,
1329  BusAddress,
1330  AddressSpace,
1331  TranslatedAddress)) return FALSE;
1332 
1333  /* Remember for next time */
1335  return TRUE;
1336 }
#define TRUE
Definition: types.h:120
_In_ ULONG _In_ PHYSICAL_ADDRESS BusAddress
Definition: iofuncs.h:2268
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
Definition: iofuncs.h:2268
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG _Out_ PPHYSICAL_ADDRESS TranslatedAddress
Definition: iofuncs.h:2268
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
ULONG BusNumber
Definition: haltypes.h:226
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
Definition: typedefs.h:117
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER Handler
Definition: acpixf.h:656
BUS_HANDLER Handler
Definition: bus.h:274
BOOLEAN NTAPI HalTranslateBusAddress(IN INTERFACE_TYPE InterfaceType, IN ULONG BusNumber, IN PHYSICAL_ADDRESS BusAddress, IN OUT PULONG AddressSpace, OUT PPHYSICAL_ADDRESS TranslatedAddress)
Definition: bussupp.c:1595
PBUS_HANDLER NTAPI HalpContextToBusHandler(IN ULONG_PTR ContextValue)
Definition: bushndlr.c:206
INTERFACE_TYPE InterfaceType
Definition: haltypes.h:224
struct tagContext Context
Definition: acpixf.h:1012
unsigned int ULONG
Definition: retypes.h:1
LIST_ENTRY HalpAllBusHandlers
Definition: bushndlr.c:19
#define ULONG_PTR
Definition: config.h:101
LIST_ENTRY AllHandlers
Definition: bus.h:272

Referenced by HalpInitBusHandler().

◆ HaliReferenceHandlerForConfigSpace()

PBUS_HANDLER FASTCALL HaliReferenceHandlerForConfigSpace ( IN BUS_DATA_TYPE  ConfigType,
IN ULONG  BusNumber 
)

Definition at line 197 of file bushndlr.c.

199 {
200  /* Lookup the configuration in the configuration table and add a reference */
201  return HalpLookupHandler(HalpConfigTable, ConfigType, BusNumber, TRUE);
202 }
#define TRUE
Definition: types.h:120
PARRAY HalpConfigTable
Definition: bushndlr.c:21
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
PBUS_HANDLER FASTCALL HalpLookupHandler(IN PARRAY Array, IN ULONG Type, IN ULONG Number, IN BOOLEAN AddReference)
Definition: bushndlr.c:76

Referenced by HalGetBusDataByOffset(), and HalSetBusDataByOffset().

◆ HaliTranslateBusAddress()

BOOLEAN NTAPI HaliTranslateBusAddress ( IN INTERFACE_TYPE  InterfaceType,
IN ULONG  BusNumber,
IN PHYSICAL_ADDRESS  BusAddress,
IN OUT PULONG  AddressSpace,
OUT PPHYSICAL_ADDRESS  TranslatedAddress 
)

Definition at line 1340 of file bussupp.c.

1345 {
1347  BOOLEAN Status;
1348 
1349  /* Find the handler */
1350  Handler = HalReferenceHandlerForBus(InterfaceType, BusNumber);
1351  if (!(Handler) || !(Handler->TranslateBusAddress))
1352  {
1353  DPRINT1("No translator Interface: %x, Bus: %x, Handler: %p, BusAddress: %x!\n", InterfaceType, BusNumber, Handler, BusAddress);
1354  return FALSE;
1355  }
1356 
1357  /* Do the assignment */
1358  Status = Handler->TranslateBusAddress(Handler,
1359  Handler,
1360  BusAddress,
1361  AddressSpace,
1363 
1364  /* Dereference the handler and return */
1366  return Status;
1367 }
#define HalReferenceHandlerForBus
Definition: haltypes.h:286
_In_ ULONG _In_ PHYSICAL_ADDRESS BusAddress
Definition: iofuncs.h:2268
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
Definition: iofuncs.h:2268
#define HalDereferenceBusHandler
Definition: haltypes.h:288
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG _Out_ PPHYSICAL_ADDRESS TranslatedAddress
Definition: iofuncs.h:2268
unsigned char BOOLEAN
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER Handler
Definition: acpixf.h:656
Status
Definition: gdiplustypes.h:24
#define DPRINT1
Definition: precomp.h:8

Referenced by HalpInitBusHandler(), and HalTranslateBusAddress().

◆ HalpAdjustPCIResourceList()

NTSTATUS NTAPI HalpAdjustPCIResourceList ( IN PBUS_HANDLER  BusHandler,
IN PBUS_HANDLER  RootHandler,
IN OUT PIO_RESOURCE_REQUIREMENTS_LIST pResourceList 
)

Definition at line 668 of file pcibus.c.

671 {
672  PPCIPBUSDATA BusData;
674  PSUPPORTED_RANGE Interrupt;
676 
677  /* Get PCI bus data */
678  BusData = BusHandler->BusData;
679  SlotNumber.u.AsULONG = (*pResourceList)->SlotNumber;
680 
681  /* Get the IRQ supported range */
682  Status = BusData->GetIrqRange(BusHandler, RootHandler, SlotNumber, &Interrupt);
683  if (!NT_SUCCESS(Status)) return Status;
684 #ifndef _MINIHAL_
685  /* Handle the /PCILOCK feature */
687  {
688  /* /PCILOCK is not yet supported */
689  UNIMPLEMENTED_DBGBREAK("/PCILOCK boot switch is not yet supported.");
690  }
691 #endif
692  /* Now create the correct resource list based on the supported bus ranges */
693 #if 0
694  Status = HaliAdjustResourceListRange(BusHandler->BusAddresses,
695  Interrupt,
696  pResourceList);
697 #else
698  DPRINT1("HAL: No PCI Resource Adjustment done! Hardware may malfunction\n");
700 #endif
701 
702  /* Return to caller */
703  ExFreePool(Interrupt);
704  return Status;
705 }
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN HalpPciLockSettings
Definition: halinit.c:18
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG SlotNumber
Definition: halfuncs.h:156
Status
Definition: gdiplustypes.h:24
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57
#define DPRINT1
Definition: precomp.h:8
return STATUS_SUCCESS
Definition: btrfs.c:2745
PciIrqRange GetIrqRange
Definition: bus.h:111
#define ExFreePool(addr)
Definition: env_spec_w32.h:352

Referenced by HalpAllocateAndInitPciBusHandler().

◆ HalpAssignPCISlotResources()

NTSTATUS NTAPI HalpAssignPCISlotResources ( IN PBUS_HANDLER  BusHandler,
IN PBUS_HANDLER  RootHandler,
IN PUNICODE_STRING  RegistryPath,
IN PUNICODE_STRING DriverClassName  OPTIONAL,
IN PDRIVER_OBJECT  DriverObject,
IN PDEVICE_OBJECT DeviceObject  OPTIONAL,
IN ULONG  Slot,
IN OUT PCM_RESOURCE_LIST pAllocatedResources 
)

Definition at line 490 of file pci.c.

498 {
499  KeBugCheck(0);
500  return STATUS_SUCCESS;
501 }
VOID NTAPI KeBugCheck(ULONG BugCheckCode)
Definition: bug.c:1469
return STATUS_SUCCESS
Definition: btrfs.c:2745

Referenced by HalpAllocateAndInitPciBusHandler(), and HalpAssignSlotResources().

◆ HalpAssignSlotResources()

NTSTATUS NTAPI HalpAssignSlotResources ( IN PUNICODE_STRING  RegistryPath,
IN PUNICODE_STRING  DriverClassName,
IN PDRIVER_OBJECT  DriverObject,
IN PDEVICE_OBJECT  DeviceObject,
IN INTERFACE_TYPE  BusType,
IN ULONG  BusNumber,
IN ULONG  SlotNumber,
IN OUT PCM_RESOURCE_LIST AllocatedResources 
)

Definition at line 39 of file bus.c.

47 {
48  BUS_HANDLER BusHandler;
49  PAGED_CODE();
50 
51  /* Only PCI is supported */
52  if (BusType != PCIBus) return STATUS_NOT_IMPLEMENTED;
53 
54  /* Setup fake PCI Bus handler */
55  RtlCopyMemory(&BusHandler, &HalpFakePciBusHandler, sizeof(BUS_HANDLER));
56  BusHandler.BusNumber = BusNumber;
57 
58  /* Call the PCI function */
59  return HalpAssignPCISlotResources(&BusHandler,
60  &BusHandler,
65  SlotNumber,
67 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
_Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PCM_RESOURCE_LIST * AllocatedResources
Definition: ndis.h:4640
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE BusType
Definition: halfuncs.h:156
#define PAGED_CODE()
Definition: video.h:57
_In_opt_ PUNICODE_STRING DriverClassName
Definition: halfuncs.h:156
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
ULONG BusNumber
Definition: haltypes.h:226
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG SlotNumber
Definition: halfuncs.h:156
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
NTSTATUS NTAPI HalpAssignPCISlotResources(IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN PUNICODE_STRING RegistryPath, IN PUNICODE_STRING DriverClassName OPTIONAL, IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT DeviceObject OPTIONAL, IN ULONG Slot, IN OUT PCM_RESOURCE_LIST *pAllocatedResources)
Definition: pci.c:490
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:27
BUS_HANDLER HalpFakePciBusHandler
Definition: pci.c:91

Referenced by HalAssignSlotResources(), HalpInitBusHandler(), and HalpInitNonBusHandler().

◆ HalpcGetCmosData()

ULONG NTAPI HalpcGetCmosData ( IN PBUS_HANDLER  BusHandler,
IN PBUS_HANDLER  RootHandler,
IN ULONG  SlotNumber,
IN PVOID  Buffer,
IN ULONG  Offset,
IN ULONG  Length 
)

Definition at line 21 of file cmosbus.c.

27 {
28  UNIMPLEMENTED_DBGBREAK("CMOS GetData\n");
29  return 0;
30 }
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

Referenced by HalpRegisterInternalBusHandlers().

◆ HalpContextToBusHandler()

PBUS_HANDLER NTAPI HalpContextToBusHandler ( IN ULONG_PTR  ContextValue)

Definition at line 206 of file bushndlr.c.

207 {
208  PLIST_ENTRY NextEntry;
209  PHAL_BUS_HANDLER BusHandler, ThisHandler;
210 
211  /* Start lookup */
212  NextEntry = HalpAllBusHandlers.Flink;
213  ThisHandler = CONTAINING_RECORD(NextEntry, HAL_BUS_HANDLER, AllHandlers);
214  if (ContextValue)
215  {
216  /* If the list is empty, quit */
217  if (IsListEmpty(&HalpAllBusHandlers)) return NULL;
218 
219  /* Otherwise, scan the list */
220  BusHandler = CONTAINING_RECORD(ContextValue, HAL_BUS_HANDLER, Handler);
221  do
222  {
223  /* Check if we've reached the right one */
224  ThisHandler = CONTAINING_RECORD(NextEntry, HAL_BUS_HANDLER, AllHandlers);
225  if (ThisHandler == BusHandler) break;
226 
227  /* Try the next one */
228  NextEntry = NextEntry->Flink;
229  } while (NextEntry != &HalpAllBusHandlers);
230  }
231 
232  /* If we looped back to the end, we didn't find anything */
233  if (NextEntry == &HalpAllBusHandlers) return NULL;
234 
235  /* Otherwise return the handler */
236  return &ThisHandler->Handler;
237 }
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
smooth NULL
Definition: ftsmooth.c:416
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
Definition: typedefs.h:117
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER Handler
Definition: acpixf.h:656
BUS_HANDLER Handler
Definition: bus.h:274
LIST_ENTRY HalpAllBusHandlers
Definition: bushndlr.c:19

Referenced by HaliFindBusAddressTranslation().

◆ HalpcSetCmosData()

ULONG NTAPI HalpcSetCmosData ( IN PBUS_HANDLER  BusHandler,
IN PBUS_HANDLER  RootHandler,
IN ULONG  SlotNumber,
IN PVOID  Buffer,
IN ULONG  Offset,
IN ULONG  Length 
)

Definition at line 34 of file cmosbus.c.

40 {
41  UNIMPLEMENTED_DBGBREAK("CMOS SetData\n");
42  return 0;
43 }
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

Referenced by HalpRegisterInternalBusHandlers().

◆ HalpFindBusAddressTranslation()

BOOLEAN NTAPI HalpFindBusAddressTranslation ( IN PHYSICAL_ADDRESS  BusAddress,
IN OUT PULONG  AddressSpace,
OUT PPHYSICAL_ADDRESS  TranslatedAddress,
IN OUT PULONG_PTR  Context,
IN BOOLEAN  NextBus 
)

Definition at line 98 of file bus.c.

103 {
104  /* Make sure we have a context */
105  if (!Context) return FALSE;
106 
107  /* If we have data in the context, then this shouldn't be a new lookup */
108  if ((*Context != 0) && (NextBus != FALSE)) return FALSE;
109 
110  /* Return bus data */
112 
113  /* Set context value and return success */
114  *Context = 1;
115  return TRUE;
116 }
#define TRUE
Definition: types.h:120
_In_ ULONG _In_ PHYSICAL_ADDRESS BusAddress
Definition: iofuncs.h:2268
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG _Out_ PPHYSICAL_ADDRESS TranslatedAddress
Definition: iofuncs.h:2268
LONGLONG QuadPart
Definition: typedefs.h:112

Referenced by HalpInitNonBusHandler().

◆ HalpGetCmosData()

ULONG NTAPI HalpGetCmosData ( IN ULONG  BusNumber,
IN ULONG  SlotNumber,
IN PVOID  Buffer,
IN ULONG  Length 
)

Definition at line 47 of file cmos.c.

51 {
54  ULONG Len = Length;
55 
56  /* FIXME: Acquire CMOS Lock */
57 
58  /* Do nothing if we don't have a length */
59  if (!Length) return 0;
60 
61  /* Check if this is simple CMOS */
62  if (!BusNumber)
63  {
64  /* Loop the buffer up to 0xFF */
65  while ((Len > 0) && (Address < 0x100))
66  {
67  /* Read the data */
69 
70  /* Update position and length */
71  Ptr++;
72  Address++;
73  Len--;
74  }
75  }
76  else if (BusNumber == 1)
77  {
78  /* Loop the buffer up to 0xFFFF */
79  while ((Len > 0) && (Address < 0x10000))
80  {
81  /* Write the data */
83 
84  /* Update position and length */
85  Ptr++;
86  Address++;
87  Len--;
88  }
89  }
90 
91  /* FIXME: Release the CMOS Lock */
92 
93  /* Return length read */
94  return Length - Len;
95 }
unsigned char * PUCHAR
Definition: retypes.h:3
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
static WCHAR Address[46]
Definition: ping.c:68
UCHAR FORCEINLINE HalpReadCmos(IN UCHAR Reg)
Definition: cmos.c:24
Definition: bufpool.h:45
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
#define Len
Definition: deflate.h:82
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG SlotNumber
Definition: halfuncs.h:156
unsigned char UCHAR
Definition: xmlstorage.h:181
unsigned int ULONG
Definition: retypes.h:1

Referenced by HalGetBusDataByOffset().

◆ HalpGetISAFixedPCIIrq()

NTSTATUS NTAPI HalpGetISAFixedPCIIrq ( IN PBUS_HANDLER  BusHandler,
IN PBUS_HANDLER  RootHandler,
IN PCI_SLOT_NUMBER  PciSlot,
OUT PSUPPORTED_RANGE Range 
)

Definition at line 567 of file pcibus.c.

571 {
572  PCI_COMMON_HEADER PciData;
573 
574  /* Read PCI configuration data */
576  BusHandler->BusNumber,
577  PciSlot.u.AsULONG,
578  &PciData,
580 
581  /* Make sure it's a real device */
582  if (PciData.VendorID == PCI_INVALID_VENDORID) return STATUS_UNSUCCESSFUL;
583 
584  /* Allocate the supported range structure */
586  if (!*Range) return STATUS_INSUFFICIENT_RESOURCES;
587 
588  /* Set it up */
590  (*Range)->Base = 1;
591 
592  /* If the PCI device has no IRQ, nothing to do */
593  if (!PciData.u.type0.InterruptPin) return STATUS_SUCCESS;
594 
595  /* FIXME: The PCI IRQ Routing Miniport should be called */
596 
597  /* Also if the INT# seems bogus, nothing to do either */
598  if ((PciData.u.type0.InterruptLine == 0) ||
599  (PciData.u.type0.InterruptLine == 255))
600  {
601  /* Fake success */
602  return STATUS_SUCCESS;
603  }
604 
605  /* Otherwise, the INT# should be valid, return it to the caller */
606  (*Range)->Base = PciData.u.type0.InterruptLine;
607  (*Range)->Limit = PciData.u.type0.InterruptLine;
608  return STATUS_SUCCESS;
609 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define PCI_INVALID_VENDORID
Definition: iotypes.h:3244
NTHALAPI ULONG NTAPI HalGetBusData(BUS_DATA_TYPE, ULONG, ULONG, PVOID, ULONG)
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define TAG_HAL
Definition: hal.h:55
Definition: range.c:43
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
return STATUS_SUCCESS
Definition: btrfs.c:2745
#define PCI_COMMON_HDR_LENGTH
Definition: iotypes.h:3237

Referenced by HalpAllocateAndInitPciBusHandler().

◆ HalpGetPCIData()

ULONG NTAPI HalpGetPCIData ( IN PBUS_HANDLER  BusHandler,
IN PBUS_HANDLER  RootBusHandler,
IN ULONG  SlotNumber,
IN PVOID  Buffer,
IN ULONG  Offset,
IN ULONG  Length 
)

Definition at line 352 of file pcibus.c.

358 {
359  PCI_SLOT_NUMBER Slot;
360  UCHAR PciBuffer[PCI_COMMON_HDR_LENGTH];
361  PPCI_COMMON_CONFIG PciConfig = (PPCI_COMMON_CONFIG)PciBuffer;
362  ULONG Len = 0;
363 
364  Slot.u.AsULONG = SlotNumber;
365 #ifdef SARCH_XBOX
366  /* Trying to get PCI config data from devices 0:0:1 and 0:0:2 will completely
367  * hang the Xbox. Also, the device number doesn't seem to be decoded for the
368  * video card, so it appears to be present on 1:0:0 - 1:31:0.
369  * We hack around these problems by indicating "device not present" for devices
370  * 0:0:1, 0:0:2, 1:1:0, 1:2:0, 1:3:0, ...., 1:31:0 */
371  if ((0 == BusHandler->BusNumber && 0 == Slot.u.bits.DeviceNumber &&
372  (1 == Slot.u.bits.FunctionNumber || 2 == Slot.u.bits.FunctionNumber)) ||
373  (1 == BusHandler->BusNumber && 0 != Slot.u.bits.DeviceNumber))
374  {
375  DPRINT("Blacklisted PCI slot\n");
376  if (0 == Offset && sizeof(USHORT) <= Length)
377  {
379  return sizeof(USHORT);
380  }
381  return 0;
382  }
383 #endif
384 
385  /* Normalize the length */
386  if (Length > sizeof(PCI_COMMON_CONFIG)) Length = sizeof(PCI_COMMON_CONFIG);
387 
388  /* Check if this is a vendor-specific read */
390  {
391  /* Read the header */
392  HalpReadPCIConfig(BusHandler, Slot, PciConfig, 0, sizeof(ULONG));
393 
394  /* Make sure the vendor is valid */
395  if (PciConfig->VendorID == PCI_INVALID_VENDORID) return 0;
396  }
397  else
398  {
399  /* Read the entire header */
401  HalpReadPCIConfig(BusHandler, Slot, PciConfig, 0, Len);
402 
403  /* Validate the vendor ID */
404  if (PciConfig->VendorID == PCI_INVALID_VENDORID)
405  {
406  /* It's invalid, but we want to return this much */
407  Len = sizeof(USHORT);
408  }
409 
410  /* Now check if there's space left */
411  if (Len < Offset) return 0;
412 
413  /* There is, so return what's after the offset and normalize */
414  Len -= Offset;
415  if (Len > Length) Len = Length;
416 
417  /* Copy the data into the caller's buffer */
418  RtlMoveMemory(Buffer, PciBuffer + Offset, Len);
419 
420  /* Update buffer and offset, decrement total length */
421  Offset += Len;
422  Buffer = (PVOID)((ULONG_PTR)Buffer + Len);
423  Length -= Len;
424  }
425 
426  /* Now we still have something to copy */
427  if (Length)
428  {
429  /* Check if it's vendor-specific data */
431  {
432  /* Read it now */
433  HalpReadPCIConfig(BusHandler, Slot, Buffer, Offset, Length);
434  Len += Length;
435  }
436  }
437 
438  /* Update the total length read */
439  return Len;
440 }
struct _PCI_COMMON_CONFIG * PPCI_COMMON_CONFIG
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:263
uint32_t ULONG_PTR
Definition: typedefs.h:63
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
void DPRINT(...)
Definition: polytest.cpp:61
Definition: bufpool.h:45
void * PVOID
Definition: retypes.h:9
union _PCI_SLOT_NUMBER::@3627 u
#define PCI_INVALID_VENDORID
Definition: iotypes.h:3244
struct _PCI_SLOT_NUMBER::@3627::@3628 bits
#define Len
Definition: deflate.h:82
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG SlotNumber
Definition: halfuncs.h:156
unsigned char UCHAR
Definition: xmlstorage.h:181
unsigned short USHORT
Definition: pedump.c:61
unsigned int ULONG
Definition: retypes.h:1
VOID NTAPI HalpReadPCIConfig(IN PBUS_HANDLER BusHandler, IN PCI_SLOT_NUMBER Slot, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
Definition: pcibus.c:269
unsigned short * PUSHORT
Definition: retypes.h:2
#define PCI_COMMON_HDR_LENGTH
Definition: iotypes.h:3237

◆ HalpGetPCIIntOnISABus()

ULONG NTAPI HalpGetPCIIntOnISABus ( IN PBUS_HANDLER  BusHandler,
IN PBUS_HANDLER  RootHandler,
IN ULONG  BusInterruptLevel,
IN ULONG  BusInterruptVector,
OUT PKIRQL  Irql,
OUT PKAFFINITY  Affinity 
)

Definition at line 525 of file pcibus.c.

531 {
532  /* Validate the level first */
533  if (BusInterruptLevel < 1) return 0;
534 
535  /* PCI has its IRQs on top of ISA IRQs, so pass it on to the ISA handler */
536  return HalGetInterruptVector(Isa,
537  0,
539  0,
540  Irql,
541  Affinity);
542 }
_In_ ULONG _In_ ULONG BusInterruptLevel
Definition: halfuncs.h:170
NTHALAPI ULONG NTAPI HalGetInterruptVector(INTERFACE_TYPE, ULONG, ULONG, ULONG, PKIRQL, PKAFFINITY)
_Out_ PKIRQL Irql
Definition: csq.h:179
_In_ ULONG _In_ ULONG _In_ ULONG _Out_ PKIRQL _Out_ PKAFFINITY Affinity
Definition: halfuncs.h:170

Referenced by HalpAllocateAndInitPciBusHandler().

◆ HalpGetSystemInterruptVector()

ULONG NTAPI HalpGetSystemInterruptVector ( IN PBUS_HANDLER  BusHandler,
IN PBUS_HANDLER  RootHandler,
IN ULONG  BusInterruptLevel,
IN ULONG  BusInterruptVector,
OUT PKIRQL  Irql,
OUT PKAFFINITY  Affinity 
)

Definition at line 144 of file sysbus.c.

150 {
151  ULONG Vector;
152 
153  /* Get the root vector */
156  Irql,
157  Affinity);
158 
159  /* Check if the vector is owned by the HAL and fail if it is */
160  if (HalpIDTUsageFlags[Vector].Flags & IDT_REGISTERED) DPRINT1("Vector %lx is ALREADY IN USE!\n", Vector);
162 }
_In_ ULONG _In_ ULONG BusInterruptLevel
Definition: halfuncs.h:170
IDTUsageFlags HalpIDTUsageFlags[256]
Definition: usage.c:19
_In_ ULONG _In_ ULONG _In_ ULONG BusInterruptVector
Definition: halfuncs.h:170
_Out_ PKIRQL Irql
Definition: csq.h:179
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define IDT_REGISTERED
Definition: halp.h:19
_In_ ULONG _In_ ULONG _In_ ULONG _Out_ PKIRQL _Out_ PKAFFINITY Affinity
Definition: halfuncs.h:170
ULONG NTAPI HalpGetRootInterruptVector(IN ULONG BusInterruptLevel, IN ULONG BusInterruptVector, OUT PKIRQL Irql, OUT PKAFFINITY Affinity)
Definition: sysbus.c:115
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK _In_ ULONG Vector
Definition: iofuncs.h:798
#define DPRINT1
Definition: precomp.h:8
unsigned int ULONG
Definition: retypes.h:1

◆ HalpGetSystemInterruptVector_Acpi()

ULONG NTAPI HalpGetSystemInterruptVector_Acpi ( ULONG  BusNumber,
ULONG  BusInterruptLevel,
ULONG  BusInterruptVector,
PKIRQL  Irql,
PKAFFINITY  Affinity 
)

◆ HalpInitBusHandler()

VOID NTAPI HalpInitBusHandler ( VOID  )

Definition at line 420 of file bushndlr.c.

421 {
422  /* Setup the bus lock */
424 
425  /* Setup the bus event */
427 
428  /* Setup the bus configuration and bus table */
431 
432  /* Setup the bus list */
434 
435  /* Setup the HAL Dispatch routines */
436 #ifndef _MINIHAL_
443 #endif
445  HalPciTranslateBusAddress = HaliTranslateBusAddress; /* PCI Driver can override */
447 }
#define HalReferenceHandlerForBus
Definition: haltypes.h:286
#define HalRegisterBusHandler
Definition: halfuncs.h:38
BOOLEAN NTAPI HaliFindBusAddressTranslation(IN PHYSICAL_ADDRESS BusAddress, IN OUT PULONG AddressSpace, OUT PPHYSICAL_ADDRESS TranslatedAddress, IN OUT PULONG_PTR Context, IN BOOLEAN NextBus)
Definition: bussupp.c:1266
#define HalPciTranslateBusAddress
Definition: halfuncs.h:41
#define TRUE
Definition: types.h:120
PARRAY NTAPI HalpAllocateArray(IN ULONG ArraySize)
Definition: bushndlr.c:27
NTSTATUS NTAPI HalpAssignSlotResources(IN PUNICODE_STRING RegistryPath, IN PUNICODE_STRING DriverClassName, IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT DeviceObject, IN INTERFACE_TYPE BusType, IN ULONG BusNumber, IN ULONG SlotNumber, IN OUT PCM_RESOURCE_LIST *AllocatedResources)
Definition: bus.c:39
PARRAY HalpConfigTable
Definition: bushndlr.c:21
#define HalDereferenceBusHandler
Definition: haltypes.h:288
PBUS_HANDLER FASTCALL HaliHandlerForBus(IN INTERFACE_TYPE InterfaceType, IN ULONG BusNumber)
Definition: bushndlr.c:170
PBUS_HANDLER FASTCALL HaliHandlerForConfigSpace(IN BUS_DATA_TYPE ConfigType, IN ULONG BusNumber)
Definition: bushndlr.c:179
VOID FASTCALL HaliDereferenceBusHandler(IN PBUS_HANDLER Handler)
Definition: bushndlr.c:158
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:251
PARRAY HalpBusTable
Definition: bushndlr.c:20
NTSTATUS NTAPI HaliRegisterBusHandler(IN INTERFACE_TYPE InterfaceType, IN BUS_DATA_TYPE ConfigType, IN ULONG BusNumber, IN INTERFACE_TYPE ParentBusType, IN ULONG ParentBusNumber, IN ULONG ExtraData, IN PINSTALL_BUS_HANDLER InstallCallback, OUT PBUS_HANDLER *ReturnedBusHandler)
Definition: bushndlr.c:242
#define HalHandlerForConfigSpace
Definition: halfuncs.h:36
BOOLEAN NTAPI HaliTranslateBusAddress(IN INTERFACE_TYPE InterfaceType, IN ULONG BusNumber, IN PHYSICAL_ADDRESS BusAddress, IN OUT PULONG AddressSpace, OUT PPHYSICAL_ADDRESS TranslatedAddress)
Definition: bussupp.c:1340
KSPIN_LOCK HalpBusDatabaseSpinLock
Definition: bushndlr.c:17
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
#define HalFindBusAddressTranslation
Definition: halfuncs.h:44
LIST_ENTRY HalpAllBusHandlers
Definition: bushndlr.c:19
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
KEVENT HalpBusDatabaseEvent
Definition: bushndlr.c:18
VOID FASTCALL HaliReferenceBusHandler(IN PBUS_HANDLER Handler)
Definition: bushndlr.c:147
PBUS_HANDLER FASTCALL HaliReferenceHandlerForBus(IN INTERFACE_TYPE InterfaceType, IN ULONG BusNumber)
Definition: bushndlr.c:188
#define HalPciAssignSlotResources
Definition: halfuncs.h:42
#define HalHandlerForBus
Definition: halfuncs.h:35
#define HalReferenceBusHandler
Definition: haltypes.h:287

Referenced by HalpRegisterInternalBusHandlers(), and LoadBootDeviceDriver().

◆ HalpInitializePciBus()

INIT_FUNCTION VOID NTAPI HalpInitializePciBus ( VOID  )

Definition at line 770 of file pci.c.

771 {
772  /* Initialize the stubs */
774 
775  /* FIXME: Initialize NMI Crash Flag */
776 }
VOID NTAPI HalpInitializePciStubs(VOID)
Definition: pci.c:674

Referenced by HalReportResourceUsage().

◆ HalpInitializePciStubs()

INIT_FUNCTION VOID NTAPI HalpInitializePciStubs ( VOID  )

Definition at line 674 of file pci.c.

675 {
676  PPCI_REGISTRY_INFO_INTERNAL PciRegistryInfo;
677  UCHAR PciType;
679  ULONG i;
681  ULONG VendorId = 0;
682 
683  /* Query registry information */
684  PciRegistryInfo = HalpQueryPciRegistryInfo();
685  if (!PciRegistryInfo)
686  {
687  /* Assume type 1 */
688  PciType = 1;
689  }
690  else
691  {
692  /* Get the type and free the info structure */
693  PciType = PciRegistryInfo->HardwareMechanism & 0xF;
694  ExFreePool(PciRegistryInfo);
695  }
696 
697  /* Initialize the PCI lock */
699 
700  /* Check the type of PCI bus */
701  switch (PciType)
702  {
703  /* Type 1 PCI Bus */
704  case 1:
705 
706  /* Copy the Type 1 handler data */
709  sizeof(PCIConfigHandler));
710 
711  /* Set correct I/O Ports */
712  BusData->Config.Type1.Address = PCI_TYPE1_ADDRESS_PORT;
713  BusData->Config.Type1.Data = PCI_TYPE1_DATA_PORT;
714  break;
715 
716  /* Type 2 PCI Bus */
717  case 2:
718 
719  /* Copy the Type 1 handler data */
722  sizeof (PCIConfigHandler));
723 
724  /* Set correct I/O Ports */
725  BusData->Config.Type2.CSE = PCI_TYPE2_CSE_PORT;
726  BusData->Config.Type2.Forward = PCI_TYPE2_FORWARD_PORT;
727  BusData->Config.Type2.Base = PCI_TYPE2_ADDRESS_BASE;
728 
729  /* Only 16 devices supported, not 32 */
730  BusData->MaxDevice = 16;
731  break;
732 
733  default:
734 
735  /* Invalid type */
736  DbgPrint("HAL: Unnkown PCI type\n");
737  }
738 
739  /* Loop all possible buses */
740  for (i = 0; i < 256; i++)
741  {
742  /* Loop all devices */
743  for (j.u.AsULONG = 0; j.u.AsULONG < 32; j.u.AsULONG++)
744  {
745  /* Query the interface */
747  i,
748  j,
749  &VendorId,
750  0,
751  sizeof(ULONG)))
752  {
753  /* Validate the vendor ID */
754  if ((USHORT)VendorId != PCI_INVALID_VENDORID)
755  {
756  /* Set this as the maximum ID */
757  HalpMaxPciBus = i;
758  break;
759  }
760  }
761  }
762  }
763 
764  /* We're done */
766 }
PCI_CONFIG_HANDLER PCIConfigHandlerType2
Definition: pci.c:54
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define PCI_TYPE2_FORWARD_PORT
Definition: bus.h:171
ULONG MaxDevice
Definition: bus.h:100
BOOLEAN HalpPCIConfigInitialized
Definition: pci.c:17
#define DbgPrint
Definition: loader.c:25
union _PCIPBUSDATA::@1396 Config
#define PCI_TYPE1_ADDRESS_PORT
Definition: bus.h:164
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
Definition: glfuncs.h:248
KSPIN_LOCK HalpPCIConfigLock
Definition: pci.c:19
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:251
smooth NULL
Definition: ftsmooth.c:416
struct _PCIPBUSDATA::@1396::@1398 Type2
PCI_CONFIG_HANDLER PCIConfigHandlerType1
Definition: pci.c:32
#define PCI_TYPE1_DATA_PORT
Definition: bus.h:165
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 GLint GLint j
Definition: glfuncs.h:250
#define PCI_INVALID_VENDORID
Definition: iotypes.h:3244
unsigned char UCHAR
Definition: xmlstorage.h:181
PPCI_REGISTRY_INFO_INTERNAL NTAPI HalpQueryPciRegistryInfo(VOID)
Definition: pci.c:543
ULONG HalpMaxPciBus
Definition: pci.c:18
#define PCI_TYPE2_CSE_PORT
Definition: bus.h:170
ULONG NTAPI HaliPciInterfaceReadConfig(IN PBUS_HANDLER RootBusHandler, IN ULONG BusNumber, IN PCI_SLOT_NUMBER SlotNumber, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
Definition: pci.c:505
unsigned short USHORT
Definition: pedump.c:61
struct _PCIPBUSDATA * PPCIPBUSDATA
unsigned int ULONG
Definition: retypes.h:1
BUS_HANDLER HalpFakePciBusHandler
Definition: pci.c:91
struct _PCIPBUSDATA::@1396::@1397 Type1
#define PCI_TYPE2_ADDRESS_BASE
Definition: bus.h:172
PVOID BusData
Definition: haltypes.h:229
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
PCI_CONFIG_HANDLER PCIConfigHandler
Definition: pci.c:20

Referenced by HalpInitializePciBus(), HalReportResourceUsage(), and LoadBootDeviceDriver().

◆ HalpNoBusData()

ULONG NTAPI HalpNoBusData ( IN PBUS_HANDLER  BusHandler,
IN PBUS_HANDLER  RootHandler,
IN ULONG  SlotNumber,
IN PVOID  Buffer,
IN ULONG  Offset,
IN ULONG  Length 
)

Definition at line 108 of file bushndlr.c.

114 {
115  /* Not implemented */
116  DPRINT1("STUB GetSetBusData\n");
117  return 0;
118 }
#define DPRINT1
Definition: precomp.h:8

Referenced by HaliRegisterBusHandler(), and HalpRegisterInternalBusHandlers().

◆ HalpPCIISALine2Pin()

VOID NTAPI HalpPCIISALine2Pin ( IN PBUS_HANDLER  BusHandler,
IN PBUS_HANDLER  RootHandler,
IN PCI_SLOT_NUMBER  SlotNumber,
IN PPCI_COMMON_CONFIG  PciNewData,
IN PPCI_COMMON_CONFIG  PciOldData 
)

Definition at line 556 of file pcibus.c.

561 {
563 }
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

Referenced by HalpAllocateAndInitPciBusHandler().

◆ HalpPCIPin2ISALine()

VOID NTAPI HalpPCIPin2ISALine ( IN PBUS_HANDLER  BusHandler,
IN PBUS_HANDLER  RootHandler,
IN PCI_SLOT_NUMBER  SlotNumber,
IN PPCI_COMMON_CONFIG  PciData 
)

Definition at line 546 of file pcibus.c.

550 {
552 }
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

Referenced by HalpAllocateAndInitPciBusHandler().

◆ HalpPCIReleaseSynchronizationType2()

VOID NTAPI HalpPCIReleaseSynchronizationType2 ( IN PBUS_HANDLER  BusHandler,
IN KIRQL  Irql 
)

Definition at line 204 of file pcibus.c.

206 {
207  PCI_TYPE2_CSE_BITS PciCfg2Cse;
208  PPCIPBUSDATA BusData = (PPCIPBUSDATA)BusHandler->BusData;
209 
210  /* Clear CSE and bus number */
211  PciCfg2Cse.u.AsUCHAR = 0;
212  WRITE_PORT_UCHAR(BusData->Config.Type2.CSE, PciCfg2Cse.u.AsUCHAR);
213  WRITE_PORT_UCHAR(BusData->Config.Type2.Forward, 0);
214 
215  /* Release the lock */
217  KeLowerIrql(Irql);
218 }
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
union _PCI_TYPE2_CSE_BITS::@1437 u
union _PCIPBUSDATA::@1396 Config
_Out_ PKIRQL Irql
Definition: csq.h:179
VOID FASTCALL KiReleaseSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: ntoskrnl.c:39
struct _PCIPBUSDATA::@1396::@1398 Type2
KSPIN_LOCK HalpPCIConfigLock
Definition: pcibus.c:32
struct _PCIPBUSDATA * PPCIPBUSDATA
UCHAR AsUCHAR
Definition: bus.h:210
void WRITE_PORT_UCHAR(PUCHAR Address, UCHAR Value)
Definition: mach.c:539

◆ HalpPCIReleaseSynchronzationType1()

VOID NTAPI HalpPCIReleaseSynchronzationType1 ( IN PBUS_HANDLER  BusHandler,
IN KIRQL  Irql 
)

Definition at line 133 of file pci.c.

135 {
136  PCI_TYPE1_CFG_BITS PciCfg1;
137 
138  /* Clear the PCI Configuration Register */
139  PciCfg1.u.AsULONG = 0;
140  WRITE_PORT_ULONG(((PPCIPBUSDATA)BusHandler->BusData)->Config.Type1.Address,
141  PciCfg1.u.AsULONG);
142 
143  /* Release the lock */
145  KeLowerIrql(Irql);
146 }
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
_Out_ PKIRQL Irql
Definition: csq.h:179
KSPIN_LOCK HalpPCIConfigLock
Definition: pci.c:19
VOID NTAPI WRITE_PORT_ULONG(IN PULONG Port, IN ULONG Value)
Definition: portio.c:123
VOID FASTCALL KiReleaseSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: ntoskrnl.c:39
union _PCI_TYPE1_CFG_BITS::@1435 u
ULONG AsULONG
Definition: bus.h:192

◆ HalpPCISynchronizeType1()

VOID NTAPI HalpPCISynchronizeType1 ( IN PBUS_HANDLER  BusHandler,
IN PCI_SLOT_NUMBER  Slot,
IN PKIRQL  Irql,
IN PPCI_TYPE1_CFG_BITS  PciCfg 
)

Definition at line 114 of file pci.c.

118 {
119  /* Setup the PCI Configuration Register */
120  PciCfg1->u.AsULONG = 0;
121  PciCfg1->u.bits.BusNumber = BusHandler->BusNumber;
122  PciCfg1->u.bits.DeviceNumber = Slot.u.bits.DeviceNumber;
123  PciCfg1->u.bits.FunctionNumber = Slot.u.bits.FunctionNumber;
124  PciCfg1->u.bits.Enable = TRUE;
125 
126  /* Acquire the lock */
129 }
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define TRUE
Definition: types.h:120
_Out_ PKIRQL Irql
Definition: csq.h:179
KSPIN_LOCK HalpPCIConfigLock
Definition: pci.c:19
#define HIGH_LEVEL
Definition: env_spec_w32.h:703
VOID FASTCALL KiAcquireSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: ntoskrnl.c:32

◆ HalpPCISynchronizeType2()

VOID NTAPI HalpPCISynchronizeType2 ( IN PBUS_HANDLER  BusHandler,
IN PCI_SLOT_NUMBER  Slot,
IN PKIRQL  Irql,
IN PPCI_TYPE2_ADDRESS_BITS  PciCfg 
)

Definition at line 159 of file pci.c.

163 {
164  PCI_TYPE2_CSE_BITS PciCfg2Cse;
165  PPCIPBUSDATA BusData = (PPCIPBUSDATA)BusHandler->BusData;
166 
167  /* Setup the configuration register */
168  PciCfg->u.AsUSHORT = 0;
169  PciCfg->u.bits.Agent = (USHORT)Slot.u.bits.DeviceNumber;
170  PciCfg->u.bits.AddressBase = (USHORT)BusData->Config.Type2.Base;
171 
172  /* Acquire the lock */
175 
176  /* Setup the CSE Register */
177  PciCfg2Cse.u.AsUCHAR = 0;
178  PciCfg2Cse.u.bits.Enable = TRUE;
179  PciCfg2Cse.u.bits.FunctionNumber = (UCHAR)Slot.u.bits.FunctionNumber;
180  PciCfg2Cse.u.bits.Key = -1;
181 
182  /* Write the bus number and CSE */
183  WRITE_PORT_UCHAR(BusData->Config.Type2.Forward,
184  (UCHAR)BusHandler->BusNumber);
185  WRITE_PORT_UCHAR(BusData->Config.Type2.CSE, PciCfg2Cse.u.AsUCHAR);
186 }
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define TRUE
Definition: types.h:120
union _PCI_TYPE2_CSE_BITS::@1437 u
union _PCIPBUSDATA::@1396 Config
_Out_ PKIRQL Irql
Definition: csq.h:179
KSPIN_LOCK HalpPCIConfigLock
Definition: pci.c:19
struct _PCIPBUSDATA::@1396::@1398 Type2
unsigned char UCHAR
Definition: xmlstorage.h:181
#define HIGH_LEVEL
Definition: env_spec_w32.h:703
unsigned short USHORT
Definition: pedump.c:61
VOID FASTCALL KiAcquireSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: ntoskrnl.c:32
struct _PCI_TYPE2_CSE_BITS::@1437::@1438 bits
struct _PCIPBUSDATA * PPCIPBUSDATA
UCHAR AsUCHAR
Definition: bus.h:210
void WRITE_PORT_UCHAR(PUCHAR Address, UCHAR Value)
Definition: mach.c:539

◆ HalpQueryPciRegistryInfo()

INIT_FUNCTION PPCI_REGISTRY_INFO_INTERNAL NTAPI HalpQueryPciRegistryInfo ( VOID  )

Definition at line 543 of file pci.c.

544 {
545  WCHAR NameBuffer[8];
547  UNICODE_STRING KeyName, ConfigName, IdentName;
548  HANDLE KeyHandle, BusKeyHandle;
550  UCHAR KeyBuffer[sizeof(PPCI_REGISTRY_INFO) + 100];
551  PKEY_VALUE_FULL_INFORMATION ValueInfo = (PVOID)KeyBuffer;
553  PWSTR Tag;
554  ULONG i;
555  PCM_FULL_RESOURCE_DESCRIPTOR FullDescriptor;
556  PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
557  PPCI_REGISTRY_INFO PciRegInfo;
558  PPCI_REGISTRY_INFO_INTERNAL PciRegistryInfo;
559 
560  /* Setup the object attributes for the key */
562  L"\\Registry\\Machine\\Hardware\\Description\\"
563  L"System\\MultiFunctionAdapter");
565  &KeyName,
567  NULL,
568  NULL);
569 
570  /* Open the key */
571  Status = ZwOpenKey(&KeyHandle, KEY_READ, &ObjectAttributes);
572  if (!NT_SUCCESS(Status)) return NULL;
573 
574  /* Setup the receiving string */
575  KeyName.Buffer = NameBuffer;
576  KeyName.MaximumLength = sizeof(NameBuffer);
577 
578  /* Setup the configuration and identifier key names */
579  RtlInitUnicodeString(&ConfigName, L"ConfigurationData");
580  RtlInitUnicodeString(&IdentName, L"Identifier");
581 
582  /* Keep looping for each ID */
583  for (i = 0; TRUE; i++)
584  {
585  /* Setup the key name */
588  &KeyName,
590  KeyHandle,
591  NULL);
592 
593  /* Open it */
594  Status = ZwOpenKey(&BusKeyHandle, KEY_READ, &ObjectAttributes);
595  if (!NT_SUCCESS(Status))
596  {
597  /* None left, fail */
599  return NULL;
600  }
601 
602  /* Read the registry data */
603  Status = ZwQueryValueKey(BusKeyHandle,
604  &IdentName,
606  ValueInfo,
607  sizeof(KeyBuffer),
608  &ResultLength);
609  if (!NT_SUCCESS(Status))
610  {
611  /* Failed, try the next one */
612  ZwClose(BusKeyHandle);
613  continue;
614  }
615 
616  /* Get the PCI Tag and validate it */
617  Tag = (PWSTR)((ULONG_PTR)ValueInfo + ValueInfo->DataOffset);
618  if ((Tag[0] != L'P') ||
619  (Tag[1] != L'C') ||
620  (Tag[2] != L'I') ||
621  (Tag[3]))
622  {
623  /* Not a valid PCI entry, skip it */
624  ZwClose(BusKeyHandle);
625  continue;
626  }
627 
628  /* Now read our PCI structure */
629  Status = ZwQueryValueKey(BusKeyHandle,
630  &ConfigName,
632  ValueInfo,
633  sizeof(KeyBuffer),
634  &ResultLength);
635  ZwClose(BusKeyHandle);
636  if (!NT_SUCCESS(Status)) continue;
637 
638  /* We read it OK! Get the actual resource descriptors */
639  FullDescriptor = (PCM_FULL_RESOURCE_DESCRIPTOR)
640  ((ULONG_PTR)ValueInfo + ValueInfo->DataOffset);
641  PartialDescriptor = (PCM_PARTIAL_RESOURCE_DESCRIPTOR)
642  ((ULONG_PTR)FullDescriptor->
643  PartialResourceList.PartialDescriptors);
644 
645  /* Check if this is our PCI Registry Information */
646  if (PartialDescriptor->Type == CmResourceTypeDeviceSpecific)
647  {
648  /* Close the key */
650 
651  /* FIXME: Check PnP\PCI\CardList */
652 
653  /* Get the PCI information */
654  PciRegInfo = (PPCI_REGISTRY_INFO)(PartialDescriptor + 1);
655 
656  /* Allocate the return structure */
657  PciRegistryInfo = ExAllocatePoolWithTag(NonPagedPool,
659  TAG_HAL);
660  if (!PciRegistryInfo) return NULL;
661 
662  /* Fill it out */
663  PciRegistryInfo->HardwareMechanism = PciRegInfo->HardwareMechanism;
664  PciRegistryInfo->NoBuses = PciRegInfo->NoBuses;
665  PciRegistryInfo->MajorRevision = PciRegInfo->MajorRevision;
666  PciRegistryInfo->MinorRevision = PciRegInfo->MinorRevision;
667  PciRegistryInfo->ElementCount = 0;
668  }
669  }
670 }
IN CINT OUT PVOID IN ULONG OUT PULONG ResultLength
Definition: conport.c:47
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING KeyName
Definition: ndis.h:4711
#define CmResourceTypeDeviceSpecific
Definition: hwresource.cpp:127
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR * PCM_PARTIAL_RESOURCE_DESCRIPTOR
#define TRUE
Definition: types.h:120
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4711
#define KEY_READ
Definition: nt_native.h:1023
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
uint16_t * PWSTR
Definition: typedefs.h:54
LONG NTSTATUS
Definition: precomp.h:26
UCHAR HardwareMechanism
Definition: pci.h:110
UCHAR MinorRevision
Definition: pci.h:108
uint32_t ULONG_PTR
Definition: typedefs.h:63
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
Definition: glfuncs.h:248
UCHAR MajorRevision
Definition: pci.h:107
struct _CM_FULL_RESOURCE_DESCRIPTOR * PCM_FULL_RESOURCE_DESCRIPTOR
smooth NULL
Definition: ftsmooth.c:416
void * PVOID
Definition: retypes.h:9
NTSYSAPI NTSTATUS NTAPI RtlIntegerToUnicodeString(ULONG Value, ULONG Base, PUNICODE_STRING String)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
unsigned char UCHAR
Definition: xmlstorage.h:181
static const WCHAR L[]
Definition: oid.c:1250
#define TAG_HAL
Definition: hal.h:55
Status
Definition: gdiplustypes.h:24
IN ULONG IN ULONG Tag
Definition: evtlib.h:159
UCHAR NoBuses
Definition: pci.h:109
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
struct _PCI_REGISTRY_INFO * PPCI_REGISTRY_INFO

Referenced by HalpInitializePciBus(), and HalpInitializePciStubs().

◆ HalpReadPCIConfig()

VOID NTAPI HalpReadPCIConfig ( IN PBUS_HANDLER  BusHandler,
IN PCI_SLOT_NUMBER  Slot,
IN PVOID  Buffer,
IN ULONG  Offset,
IN ULONG  Length 
)

Definition at line 255 of file pci.c.

260 {
261  /* Validate the PCI Slot */
262  if (!HalpValidPCISlot(BusHandler, Slot))
263  {
264  /* Fill the buffer with invalid data */
266  }
267  else
268  {
269  /* Send the request */
270  HalpPCIConfig(BusHandler,
271  Slot,
272  Buffer,
273  Offset,
274  Length,
276  }
277 }
VOID NTAPI HalpPCIConfig(IN PBUS_HANDLER BusHandler, IN PCI_SLOT_NUMBER Slot, IN PUCHAR Buffer, IN ULONG Offset, IN ULONG Length, IN FncConfigIO *ConfigIO)
Definition: pci.c:217
FncConfigIO ConfigRead[3]
Definition: bus.h:129
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
Definition: bufpool.h:45
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
BOOLEAN NTAPI HalpValidPCISlot(IN PBUS_HANDLER BusHandler, IN PCI_SLOT_NUMBER Slot)
Definition: pci.c:302
#define RtlFillMemory(Dest, Length, Fill)
Definition: winternl.h:593
PCI_CONFIG_HANDLER PCIConfigHandler
Definition: pci.c:20

Referenced by HaliPciInterfaceReadConfig(), HalpAllocateAndInitPciBusHandler(), HalpAssignPCISlotResources(), HalpGetPciBridgeConfig(), HalpGetPCIData(), HalpInitializePciBus(), HalpIsValidPCIDevice(), HalpSetPCIData(), and HalpValidPCISlot().

◆ HalpRegisterPciDebuggingDeviceInfo()

INIT_FUNCTION VOID NTAPI HalpRegisterPciDebuggingDeviceInfo ( VOID  )

Definition at line 633 of file pcibus.c.

634 {
635  BOOLEAN Found = FALSE;
636  ULONG i;
637  PAGED_CODE();
638 
639  /* Loop PCI debugging devices */
640  for (i = 0; i < 2; i++)
641  {
642  /* Reserved bit is set if we found one */
643  if (HalpPciDebuggingDevice[i].u.bits.Reserved1)
644  {
645  Found = TRUE;
646  break;
647  }
648  }
649 
650  /* Bail out if there aren't any */
651  if (!Found) return;
652 
653  /* FIXME: TODO */
654  UNIMPLEMENTED_DBGBREAK("You have implemented the KD routines for searching PCI debugger"
655  "devices, but you have forgotten to implement this routine\n");
656 }
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
Definition: glfuncs.h:240
#define TRUE
Definition: types.h:120
PCI_TYPE1_CFG_CYCLE_BITS HalpPciDebuggingDevice[2]
Definition: pcibus.c:28
#define PAGED_CODE()
Definition: video.h:57
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
Definition: glfuncs.h:248
unsigned char BOOLEAN
return Found
Definition: dirsup.c:1270
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57
unsigned int ULONG
Definition: retypes.h:1

Referenced by HalReportResourceUsage().

◆ HalpSetCmosData()

ULONG NTAPI HalpSetCmosData ( IN ULONG  BusNumber,
IN ULONG  SlotNumber,
IN PVOID  Buffer,
IN ULONG  Length 
)

Definition at line 99 of file cmos.c.

103 {
104  PUCHAR Ptr = (PUCHAR)Buffer;
106  ULONG Len = Length;
107 
108  /* FIXME: Acquire CMOS Lock */
109 
110  /* Do nothing if we don't have a length */
111  if (!Length) return 0;
112 
113  /* Check if this is simple CMOS */
114  if (!BusNumber)
115  {
116  /* Loop the buffer up to 0xFF */
117  while ((Len > 0) && (Address < 0x100))
118  {
119  /* Write the data */
121 
122  /* Update position and length */
123  Ptr++;
124  Address++;
125  Len--;
126  }
127  }
128  else if (BusNumber == 1)
129  {
130  /* Loop the buffer up to 0xFFFF */
131  while ((Len > 0) && (Address < 0x10000))
132  {
133  /* Write the data */
135 
136  /* Update position and length */
137  Ptr++;
138  Address++;
139  Len--;
140  }
141  }
142 
143  /* FIXME: Release the CMOS Lock */
144 
145  /* Return length read */
146  return Length - Len;
147 }
VOID FORCEINLINE HalpWriteCmos(IN UCHAR Reg, IN UCHAR Value)
Definition: cmos.c:35
unsigned char * PUCHAR
Definition: retypes.h:3
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
static WCHAR Address[46]
Definition: ping.c:68
Definition: bufpool.h:45
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
#define Len
Definition: deflate.h:82
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG SlotNumber
Definition: halfuncs.h:156
unsigned char UCHAR
Definition: xmlstorage.h:181
unsigned int ULONG
Definition: retypes.h:1

Referenced by HalSetBusDataByOffset().

◆ HalpSetPCIData()

ULONG NTAPI HalpSetPCIData ( IN PBUS_HANDLER  BusHandler,
IN PBUS_HANDLER  RootBusHandler,
IN ULONG  SlotNumber,
IN PVOID  Buffer,
IN ULONG  Offset,
IN ULONG  Length 
)

Definition at line 444 of file pcibus.c.

450 {
451  PCI_SLOT_NUMBER Slot;
452  UCHAR PciBuffer[PCI_COMMON_HDR_LENGTH];
453  PPCI_COMMON_CONFIG PciConfig = (PPCI_COMMON_CONFIG)PciBuffer;
454  ULONG Len = 0;
455 
456  Slot.u.AsULONG = SlotNumber;
457 #ifdef SARCH_XBOX
458  /* Trying to get PCI config data from devices 0:0:1 and 0:0:2 will completely
459  * hang the Xbox. Also, the device number doesn't seem to be decoded for the
460  * video card, so it appears to be present on 1:0:0 - 1:31:0.
461  * We hack around these problems by indicating "device not present" for devices
462  * 0:0:1, 0:0:2, 1:1:0, 1:2:0, 1:3:0, ...., 1:31:0 */
463  if ((0 == BusHandler->BusNumber && 0 == Slot.u.bits.DeviceNumber &&
464  (1 == Slot.u.bits.FunctionNumber || 2 == Slot.u.bits.FunctionNumber)) ||
465  (1 == BusHandler->BusNumber && 0 != Slot.u.bits.DeviceNumber))
466  {
467  DPRINT1("Trying to set data on blacklisted PCI slot\n");
468  return 0;
469  }
470 #endif
471 
472  /* Normalize the length */
473  if (Length > sizeof(PCI_COMMON_CONFIG)) Length = sizeof(PCI_COMMON_CONFIG);
474 
475  /* Check if this is a vendor-specific read */
477  {
478  /* Read the header */
479  HalpReadPCIConfig(BusHandler, Slot, PciConfig, 0, sizeof(ULONG));
480 
481  /* Make sure the vendor is valid */
482  if (PciConfig->VendorID == PCI_INVALID_VENDORID) return 0;
483  }
484  else
485  {
486  /* Read the entire header and validate the vendor ID */
488  HalpReadPCIConfig(BusHandler, Slot, PciConfig, 0, Len);
489  if (PciConfig->VendorID == PCI_INVALID_VENDORID) return 0;
490 
491  /* Return what's after the offset and normalize */
492  Len -= Offset;
493  if (Len > Length) Len = Length;
494 
495  /* Copy the specific caller data */
496  RtlMoveMemory(PciBuffer + Offset, Buffer, Len);
497 
498  /* Write the actual configuration data */
499  HalpWritePCIConfig(BusHandler, Slot, PciBuffer + Offset, Offset, Len);
500 
501  /* Update buffer and offset, decrement total length */
502  Offset += Len;
503  Buffer = (PVOID)((ULONG_PTR)Buffer + Len);
504  Length -= Len;
505  }
506 
507  /* Now we still have something to copy */
508  if (Length)
509  {
510  /* Check if it's vendor-specific data */
512  {
513  /* Read it now */
514  HalpWritePCIConfig(BusHandler, Slot, Buffer, Offset, Length);
515  Len += Length;
516  }
517  }
518 
519  /* Update the total length read */
520  return Len;
521 }
struct _PCI_COMMON_CONFIG * PPCI_COMMON_CONFIG
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:263
uint32_t ULONG_PTR
Definition: typedefs.h:63
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
Definition: bufpool.h:45
void * PVOID
Definition: retypes.h:9
union _PCI_SLOT_NUMBER::@3627 u
#define PCI_INVALID_VENDORID
Definition: iotypes.h:3244
struct _PCI_SLOT_NUMBER::@3627::@3628 bits
#define Len
Definition: deflate.h:82
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG SlotNumber
Definition: halfuncs.h:156
unsigned char UCHAR
Definition: xmlstorage.h:181
struct _PCI_COMMON_CONFIG PCI_COMMON_CONFIG
VOID NTAPI HalpWritePCIConfig(IN PBUS_HANDLER BusHandler, IN PCI_SLOT_NUMBER Slot, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
Definition: pcibus.c:295
#define DPRINT1
Definition: precomp.h:8
unsigned int ULONG
Definition: retypes.h:1
VOID NTAPI HalpReadPCIConfig(IN PBUS_HANDLER BusHandler, IN PCI_SLOT_NUMBER Slot, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
Definition: pcibus.c:269
#define PCI_COMMON_HDR_LENGTH
Definition: iotypes.h:3237

◆ HalpTranslateBusAddress()

BOOLEAN NTAPI HalpTranslateBusAddress ( IN INTERFACE_TYPE  InterfaceType,
IN ULONG  BusNumber,
IN PHYSICAL_ADDRESS  BusAddress,
IN OUT PULONG  AddressSpace,
OUT PPHYSICAL_ADDRESS  TranslatedAddress 
)

Definition at line 71 of file bus.c.

76 {
77  /* Translation is easy */
79  return TRUE;
80 }
#define TRUE
Definition: types.h:120
_In_ ULONG _In_ PHYSICAL_ADDRESS BusAddress
Definition: iofuncs.h:2268
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG _Out_ PPHYSICAL_ADDRESS TranslatedAddress
Definition: iofuncs.h:2268
LONGLONG QuadPart
Definition: typedefs.h:112

Referenced by HalpInitNonBusHandler().

◆ HalpTranslateIsaBusAddress()

BOOLEAN NTAPI HalpTranslateIsaBusAddress ( IN PBUS_HANDLER  BusHandler,
IN PBUS_HANDLER  RootHandler,
IN PHYSICAL_ADDRESS  BusAddress,
IN OUT PULONG  AddressSpace,
OUT PPHYSICAL_ADDRESS  TranslatedAddress 
)

Definition at line 21 of file isabus.c.

26 {
28 
29  /* Use system translation */
31  RootHandler,
32  BusAddress,
35 
36  /* If it didn't work and it was memory address space... */
37  if (!(Status) && (*AddressSpace == 0))
38  {
39  /* Try EISA translation instead */
41  BusHandler->BusNumber,
42  BusAddress,
45  }
46 
47  /* Return the result */
48  return Status;
49 }
_In_ ULONG _In_ PHYSICAL_ADDRESS BusAddress
Definition: iofuncs.h:2268
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
Definition: iofuncs.h:2268
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG _Out_ PPHYSICAL_ADDRESS TranslatedAddress
Definition: iofuncs.h:2268
BOOLEAN NTAPI HalpTranslateSystemBusAddress(IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER RootHandler, IN PHYSICAL_ADDRESS BusAddress, IN OUT PULONG AddressSpace, OUT PPHYSICAL_ADDRESS TranslatedAddress)
Definition: sysbus.c:21
unsigned char BOOLEAN
BOOLEAN NTAPI HalTranslateBusAddress(IN INTERFACE_TYPE InterfaceType, IN ULONG BusNumber, IN PHYSICAL_ADDRESS BusAddress, IN OUT PULONG AddressSpace, OUT PPHYSICAL_ADDRESS TranslatedAddress)
Definition: bus.c:140
Status
Definition: gdiplustypes.h:24

◆ HalpTranslateSystemBusAddress()

BOOLEAN NTAPI HalpTranslateSystemBusAddress ( IN PBUS_HANDLER  BusHandler,
IN PBUS_HANDLER  RootHandler,
IN PHYSICAL_ADDRESS  BusAddress,
IN OUT PULONG  AddressSpace,
OUT PPHYSICAL_ADDRESS  TranslatedAddress 
)

Definition at line 21 of file sysbus.c.

26 {
28 
29  /* Check what kind of address space this is */
30  switch (*AddressSpace)
31  {
32  /* Memory address */
33  case 0:
34 
35  /* Loop all prefetch memory */
36  for (Range = &BusHandler->BusAddresses->PrefetchMemory;
37  Range;
38  Range = Range->Next)
39  {
40  /* Check if it's in a valid range */
41  if ((BusAddress.QuadPart >= Range->Base) &&
42  (BusAddress.QuadPart <= Range->Limit))
43  {
44  /* Get out */
45  break;
46  }
47  }
48 
49  /* Check if we haven't found anything yet */
50  if (!Range)
51  {
52  /* Loop all bus memory */
53  for (Range = &BusHandler->BusAddresses->Memory;
54  Range;
55  Range = Range->Next)
56  {
57  /* Check if it's in a valid range */
58  if ((BusAddress.QuadPart >= Range->Base) &&
59  (BusAddress.QuadPart <= Range->Limit))
60  {
61  /* Get out */
62  break;
63  }
64  }
65  }
66 
67  /* Done */
68  break;
69 
70  /* I/O Space */
71  case 1:
72 
73  /* Loop all bus I/O memory */
74  for (Range = &BusHandler->BusAddresses->IO;
75  Range;
76  Range = Range->Next)
77  {
78  /* Check if it's in a valid range */
79  if ((BusAddress.QuadPart >= Range->Base) &&
80  (BusAddress.QuadPart <= Range->Limit))
81  {
82  /* Get out */
83  break;
84  }
85  }
86 
87  /* Done */
88  break;
89  }
90 
91  /* Check if we found a range */
92  if (Range)
93  {
94  /* Do the translation and return the kind of address space this is */
97  (*AddressSpace != Range->SystemAddressSpace))
98  {
99  /* Different than what the old HAL would do */
100  DPRINT1("Translation of %I64x is %I64x %s\n",
102  Range->SystemAddressSpace ? "In I/O Space" : "In RAM");
103  }
104  *AddressSpace = Range->SystemAddressSpace;
105  return TRUE;
106  }
107 
108  /* Nothing found */
109  DPRINT1("Translation of %I64x failed!\n", BusAddress.QuadPart);
110  return FALSE;
111 }
#define TRUE
Definition: types.h:120
_In_ ULONG _In_ PHYSICAL_ADDRESS BusAddress
Definition: iofuncs.h:2268
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
Definition: iofuncs.h:2268
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG _Out_ PPHYSICAL_ADDRESS TranslatedAddress
Definition: iofuncs.h:2268
smooth NULL
Definition: ftsmooth.c:416
Definition: range.c:43
#define DPRINT1
Definition: precomp.h:8
LONGLONG QuadPart
Definition: typedefs.h:112

Referenced by HalpRegisterInternalBusHandlers(), and HalpTranslateIsaBusAddress().

◆ HalpValidPCISlot()

BOOLEAN NTAPI HalpValidPCISlot ( IN PBUS_HANDLER  BusHandler,
IN PCI_SLOT_NUMBER  Slot 
)

Definition at line 302 of file pci.c.

304 {
305  PCI_SLOT_NUMBER MultiSlot;
306  PPCIPBUSDATA BusData = (PPCIPBUSDATA)BusHandler->BusData;
307  UCHAR HeaderType;
308  ULONG Device;
309 
310  /* Simple validation */
311  if (Slot.u.bits.Reserved) return FALSE;
312  if (Slot.u.bits.DeviceNumber >= BusData->MaxDevice) return FALSE;
313 
314  /* Function 0 doesn't need checking */
315  if (!Slot.u.bits.FunctionNumber) return TRUE;
316 
317  /* Functions 0+ need Multi-Function support, so check the slot */
318  Device = Slot.u.bits.DeviceNumber;
319  MultiSlot = Slot;
320  MultiSlot.u.bits.FunctionNumber = 0;
321 
322  /* Send function 0 request to get the header back */
323  HalpReadPCIConfig(BusHandler,
324  MultiSlot,
325  &HeaderType,
326  FIELD_OFFSET(PCI_COMMON_CONFIG, HeaderType),
327  sizeof(UCHAR));
328 
329  /* Now make sure the header is multi-function */
330  if (!(HeaderType & PCI_MULTIFUNCTION) || (HeaderType == 0xFF)) return FALSE;
331  return TRUE;
332 }
#define TRUE
Definition: types.h:120
ULONG MaxDevice
Definition: bus.h:100
_In_ PIRP _In_ PDEVICE_OBJECT Device
Definition: fatprocs.h:2020
#define PCI_MULTIFUNCTION
Definition: iotypes.h:3247
union _PCI_SLOT_NUMBER::@3627 u
VOID NTAPI HalpReadPCIConfig(IN PBUS_HANDLER BusHandler, IN PCI_SLOT_NUMBER Slot, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
Definition: pci.c:255
if(!(yy_init))
Definition: macro.lex.yy.c:714
struct _PCI_SLOT_NUMBER::@3627::@3628 bits
unsigned char UCHAR
Definition: xmlstorage.h:181
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
struct _PCIPBUSDATA * PPCIPBUSDATA
unsigned int ULONG
Definition: retypes.h:1

Referenced by HalpReadPCIConfig(), and HalpWritePCIConfig().

◆ HalpWritePCIConfig()

VOID NTAPI HalpWritePCIConfig ( IN PBUS_HANDLER  BusHandler,
IN PCI_SLOT_NUMBER  Slot,
IN PVOID  Buffer,
IN ULONG  Offset,
IN ULONG  Length 
)

Definition at line 281 of file pci.c.

286 {
287  /* Validate the PCI Slot */
288  if (HalpValidPCISlot(BusHandler, Slot))
289  {
290  /* Send the request */
291  HalpPCIConfig(BusHandler,
292  Slot,
293  Buffer,
294  Offset,
295  Length,
297  }
298 }
VOID NTAPI HalpPCIConfig(IN PBUS_HANDLER BusHandler, IN PCI_SLOT_NUMBER Slot, IN PUCHAR Buffer, IN ULONG Offset, IN ULONG Length, IN FncConfigIO *ConfigIO)
Definition: pci.c:217
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
Definition: bufpool.h:45
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
BOOLEAN NTAPI HalpValidPCISlot(IN PBUS_HANDLER BusHandler, IN PCI_SLOT_NUMBER Slot)
Definition: pci.c:302
FncConfigIO ConfigWrite[3]
Definition: bus.h:130
PCI_CONFIG_HANDLER PCIConfigHandler
Definition: pci.c:20

Referenced by HalpAllocateAndInitPciBusHandler(), HalpAssignPCISlotResources(), and HalpSetPCIData().

◆ TYPE1_DEFINE() [1/6]

TYPE1_DEFINE ( HalpPCIReadUcharType1  )

◆ TYPE1_DEFINE() [2/6]

TYPE1_DEFINE ( HalpPCIReadUshortType1  )

◆ TYPE1_DEFINE() [3/6]

TYPE1_DEFINE ( HalpPCIReadUlongType1  )

◆ TYPE1_DEFINE() [4/6]

TYPE1_DEFINE ( HalpPCIWriteUcharType1  )

◆ TYPE1_DEFINE() [5/6]

TYPE1_DEFINE ( HalpPCIWriteUshortType1  )

◆ TYPE1_DEFINE() [6/6]

TYPE1_DEFINE ( HalpPCIWriteUlongType1  )

◆ TYPE2_DEFINE() [1/6]

TYPE2_DEFINE ( HalpPCIReadUcharType2  )

◆ TYPE2_DEFINE() [2/6]

TYPE2_DEFINE ( HalpPCIReadUshortType2  )

◆ TYPE2_DEFINE() [3/6]

TYPE2_DEFINE ( HalpPCIReadUlongType2  )

◆ TYPE2_DEFINE() [4/6]

TYPE2_DEFINE ( HalpPCIWriteUcharType2  )

◆ TYPE2_DEFINE() [5/6]

TYPE2_DEFINE ( HalpPCIWriteUshortType2  )

◆ TYPE2_DEFINE() [6/6]

TYPE2_DEFINE ( HalpPCIWriteUlongType2  )

Variable Documentation

◆ HalpAllBusHandlers

◆ HalpBusType

◆ HalpFakePciBusHandler

◆ HalpMaxPciBus

ULONG HalpMaxPciBus

Definition at line 18 of file pci.c.

Referenced by HalGetBusDataByOffset(), HaliPciInterfaceReadConfig(), and HalpInitializePciStubs().

◆ HalpMinPciBus

ULONG HalpMinPciBus

Definition at line 18 of file pci.c.

Referenced by HalGetBusDataByOffset().

◆ HalpPCIConfigInitialized

BOOLEAN HalpPCIConfigInitialized

Definition at line 17 of file pci.c.

Referenced by HalGetBusDataByOffset(), HalpInitializePciStubs(), and HalSetBusDataByOffset().

◆ PCIConfigHandler

◆ PCIConfigHandlerType1

PCI_CONFIG_HANDLER PCIConfigHandlerType1

Definition at line 32 of file pci.c.

Referenced by HalpAllocateAndInitPciBusHandler(), and HalpInitializePciStubs().

◆ PCIConfigHandlerType2

PCI_CONFIG_HANDLER PCIConfigHandlerType2

Definition at line 54 of file pci.c.

Referenced by HalpAllocateAndInitPciBusHandler(), and HalpInitializePciStubs().