[CMAKE]
[reactos.git] / hal / halx86 / generic / legacy / bussupp.c
index 6faa60f..013b856 100644 (file)
@@ -65,6 +65,7 @@ HalpAllocateBusHandler(IN INTERFACE_TYPE InterfaceType,
 
 VOID
 NTAPI
+INIT_FUNCTION
 HalpRegisterInternalBusHandlers(VOID)
 {
     PBUS_HANDLER Bus;
@@ -139,6 +140,7 @@ HalpRegisterInternalBusHandlers(VOID)
 #ifndef _MINIHAL_
 NTSTATUS
 NTAPI
+INIT_FUNCTION
 HalpMarkChipsetDecode(BOOLEAN OverrideEnable)
 {
     NTSTATUS Status;
@@ -186,6 +188,7 @@ HalpMarkChipsetDecode(BOOLEAN OverrideEnable)
 
 PBUS_HANDLER
 NTAPI
+INIT_FUNCTION
 HalpAllocateAndInitPciBusHandler(IN ULONG PciType,
                                  IN ULONG BusNo,
                                  IN BOOLEAN TestAllocation)
@@ -270,6 +273,7 @@ HalpAllocateAndInitPciBusHandler(IN ULONG PciType,
 
 BOOLEAN
 NTAPI
+INIT_FUNCTION
 HalpIsValidPCIDevice(IN PBUS_HANDLER BusHandler,
                      IN PCI_SLOT_NUMBER Slot)
 {
@@ -331,6 +335,7 @@ static BOOLEAN WarningsGiven[5];
 
 NTSTATUS
 NTAPI
+INIT_FUNCTION
 HalpGetChipHacks(IN USHORT VendorId,
                  IN USHORT DeviceId,
                  IN UCHAR RevisionId,
@@ -394,6 +399,7 @@ HalpGetChipHacks(IN USHORT VendorId,
 
 BOOLEAN
 NTAPI
+INIT_FUNCTION
 HalpIsRecognizedCard(IN PPCI_REGISTRY_INFO_INTERNAL PciRegistryInfo,
                      IN PPCI_COMMON_CONFIG PciData,
                      IN ULONG Flags)
@@ -474,6 +480,7 @@ HalpIsRecognizedCard(IN PPCI_REGISTRY_INFO_INTERNAL PciRegistryInfo,
 
 BOOLEAN
 NTAPI
+INIT_FUNCTION
 HalpIsIdeDevice(IN PPCI_COMMON_CONFIG PciData)
 {
     /* Simple test first */
@@ -526,6 +533,7 @@ HalpIsIdeDevice(IN PPCI_COMMON_CONFIG PciData)
 
 BOOLEAN
 NTAPI
+INIT_FUNCTION
 HalpIsBridgeDevice(IN PPCI_COMMON_CONFIG PciData)
 {
     /* Either this is a PCI-to-PCI Bridge, or a CardBUS Bridge */
@@ -539,6 +547,7 @@ HalpIsBridgeDevice(IN PPCI_COMMON_CONFIG PciData)
     
 BOOLEAN
 NTAPI
+INIT_FUNCTION
 HalpGetPciBridgeConfig(IN ULONG PciType,
                        IN PUCHAR BusCount)
 {
@@ -591,6 +600,7 @@ HalpGetPciBridgeConfig(IN ULONG PciType,
 
 VOID
 NTAPI
+INIT_FUNCTION
 HalpFixupPciSupportedRanges(IN ULONG BusCount)
 {
     ULONG i;
@@ -653,6 +663,7 @@ HalpFixupPciSupportedRanges(IN ULONG BusCount)
 
 VOID
 NTAPI
+INIT_FUNCTION
 ShowSize(ULONG x)
 {
     if (!x) return;
@@ -678,10 +689,11 @@ ShowSize(ULONG x)
 
 VOID
 NTAPI
-HalpDebugPciBus(IN ULONG i,
-                IN ULONG j,
-                IN ULONG k,
-                IN PPCI_COMMON_CONFIG PciData)
+INIT_FUNCTION
+HalpDebugPciDumpBus(IN ULONG i,
+                    IN ULONG j,
+                    IN ULONG k,
+                    IN PPCI_COMMON_CONFIG PciData)
 {   
     extern CHAR ClassTable[3922];
     extern CHAR VendorTable[642355];
@@ -785,7 +797,9 @@ HalpDebugPciBus(IN ULONG i,
     if ((PciData->Status & PCI_STATUS_DEVSEL) == 0x200) DbgPrint(" medium devsel,");
     if ((PciData->Status & PCI_STATUS_DEVSEL) == 0x400) DbgPrint(" fast devsel,");
     DbgPrint(" latency %d", PciData->LatencyTimer);
-    if (PciData->u.type0.InterruptLine) DbgPrint(", IRQ %02d", PciData->u.type0.InterruptLine);
+    if (PciData->u.type0.InterruptPin != 0 &&
+        PciData->u.type0.InterruptLine != 0 &&
+        PciData->u.type0.InterruptLine != 0xFF) DbgPrint(", IRQ %02d", PciData->u.type0.InterruptLine);
     DbgPrint("\n");
     
     /* Scan addresses */
@@ -827,6 +841,7 @@ HalpDebugPciBus(IN ULONG i,
 
 VOID
 NTAPI
+INIT_FUNCTION
 HalpInitializePciBus(VOID)
 {
 #ifndef _MINIHAL_
@@ -933,7 +948,7 @@ HalpInitializePciBus(VOID)
                 if (PciData->VendorID == PCI_INVALID_VENDORID) continue;
                 
                 /* Print out the entry */
-                HalpDebugPciBus(i, j, k, PciData);
+                HalpDebugPciDumpBus(i, j, k, PciData);
                 
                 /* Check if this is a Cardbus bridge */
                 if (PCI_CONFIGURATION_TYPE(PciData) == PCI_CARDBUS_BRIDGE_TYPE)
@@ -1091,6 +1106,7 @@ HalpInitializePciBus(VOID)
 
 VOID
 NTAPI
+INIT_FUNCTION
 HalpInitBusHandlers(VOID)
 {
     /* Register the HAL Bus Handler support */
@@ -1099,6 +1115,7 @@ HalpInitBusHandlers(VOID)
 
 VOID
 NTAPI
+INIT_FUNCTION
 HalpRegisterKdSupportFunctions(VOID)
 {
     /* Register PCI Device Functions */