[NDK][NTOS] Add global definition of INIT_FUNCTION/INIT_SECTION (#779)
[reactos.git] / hal / halx86 / acpi / busemul.c
index 59c8935..d63c89c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * PROJECT:         ReactOS HAL
  * LICENSE:         BSD - See COPYING.ARM in the top level directory
- * FILE:            hal/halx86/generic/acpi/busemul.c
+ * FILE:            hal/halx86/acpi/busemul.c
  * PURPOSE:         ACPI HAL Bus Handler Emulation Code
  * PROGRAMMERS:     ReactOS Portable Systems Group
  */
@@ -16,6 +16,7 @@
 
 /* PRIVATE FUNCTIONS **********************************************************/
 
+INIT_FUNCTION
 VOID
 NTAPI
 HalpRegisterKdSupportFunctions(VOID)
@@ -26,8 +27,13 @@ HalpRegisterKdSupportFunctions(VOID)
 
     /* Register memory functions */
 #ifndef _MINIHAL_
+#if (NTDDI_VERSION >= NTDDI_VISTA)
+    KdMapPhysicalMemory64 = HalpMapPhysicalMemory64Vista;
+    KdUnmapVirtualAddress = HalpUnmapVirtualAddressVista;
+#else
     KdMapPhysicalMemory64 = HalpMapPhysicalMemory64;
     KdUnmapVirtualAddress = HalpUnmapVirtualAddress;
+#endif
 #endif
 
     /* Register ACPI stub */
@@ -105,7 +111,7 @@ HalpFindBusAddressTranslation(IN PHYSICAL_ADDRESS BusAddress,
     if (!Context) return FALSE;
 
     /* If we have data in the context, then this shouldn't be a new lookup */
-    if ((*Context) && (NextBus == TRUE)) return FALSE;
+    if ((*Context != 0) && (NextBus != FALSE)) return FALSE;
 
     /* Return bus data */
     TranslatedAddress->QuadPart = BusAddress.QuadPart;
@@ -225,7 +231,7 @@ HalGetBusDataByOffset(IN BUS_DATA_TYPE BusDataType,
         /* Call PCI function */
         return HalpGetPCIData(&BusHandler,
                               &BusHandler,
-                              *(PPCI_SLOT_NUMBER)&SlotNumber,
+                              SlotNumber,
                               Buffer,
                               Offset,
                               Length);
@@ -304,7 +310,7 @@ HalSetBusDataByOffset(IN BUS_DATA_TYPE BusDataType,
         /* Call PCI function */
         return HalpSetPCIData(&BusHandler,
                               &BusHandler,
-                              *(PPCI_SLOT_NUMBER)&SlotNumber,
+                              SlotNumber,
                               Buffer,
                               Offset,
                               Length);