1 /* 2 * PROJECT: ReactOS HAL 3 * LICENSE: BSD - See COPYING.ARM in the top level directory 4 * PURPOSE: HAL Legacy Support Code 5 * PROGRAMMERS: ReactOS Portable Systems Group 6 */ 7 8 /* INCLUDES *******************************************************************/ 9 10 #include <hal.h> 11 12 #define NDEBUG 13 #include <debug.h> 14 15 #if defined(ALLOC_PRAGMA) && !defined(_MINIHAL_) 16 //#pragma alloc_text(INIT, HaliInitPnpDriver) 17 #pragma alloc_text(INIT, HalpBuildAddressMap) 18 #pragma alloc_text(INIT, HalpGetDebugPortTable) 19 #pragma alloc_text(INIT, HalpIs16BitPortDecodeSupported) 20 #pragma alloc_text(INIT, HalpSetupAcpiPhase0) 21 #pragma alloc_text(INIT, HalReportResourceUsage) 22 #endif 23 24 /* GLOBALS ********************************************************************/ 25 26 /* This determines the HAL type */ 27 BOOLEAN HalDisableFirmwareMapper = FALSE; 28 #if defined(SARCH_XBOX) 29 PWCHAR HalHardwareIdString = L"xbox"; 30 PWCHAR HalName = L"Xbox HAL"; 31 #elif defined(SARCH_PC98) 32 PWCHAR HalHardwareIdString = L"pc98_up"; 33 PWCHAR HalName = L"NEC PC-98 Compatible NESA/C-Bus HAL"; 34 #else 35 PWCHAR HalHardwareIdString = L"e_isa_up"; 36 PWCHAR HalName = L"PC Compatible Eisa/Isa HAL"; 37 #endif 38 39 /* PRIVATE FUNCTIONS **********************************************************/ 40 41 INIT_FUNCTION 42 NTSTATUS 43 NTAPI 44 HalpSetupAcpiPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock) 45 { 46 /* There is no ACPI on these HALs */ 47 return STATUS_NO_SUCH_DEVICE; 48 } 49 50 INIT_FUNCTION 51 VOID 52 NTAPI 53 HalpBuildAddressMap(VOID) 54 { 55 /* FIXME: Inherit ROM blocks from the registry */ 56 //HalpInheritROMBlocks(); 57 58 /* FIXME: Add the ROM blocks to our ranges */ 59 //HalpAddROMRanges(); 60 } 61 62 INIT_FUNCTION 63 BOOLEAN 64 NTAPI 65 HalpGetDebugPortTable(VOID) 66 { 67 /* No ACPI */ 68 return FALSE; 69 } 70 71 INIT_FUNCTION 72 ULONG 73 NTAPI 74 HalpIs16BitPortDecodeSupported(VOID) 75 { 76 /* Only EISA systems support this */ 77 return (HalpBusType == MACHINE_TYPE_EISA) ? CM_RESOURCE_PORT_16_BIT_DECODE : 0; 78 } 79 80 #if 0 81 INIT_FUNCTION 82 NTSTATUS 83 NTAPI 84 HaliInitPnpDriver(VOID) 85 { 86 /* On PC-AT, this will interface with the PCI driver */ 87 //HalpDebugPciBus(); 88 return STATUS_SUCCESS; 89 } 90 #endif 91 92 /* 93 * @implemented 94 */ 95 INIT_FUNCTION 96 VOID 97 NTAPI 98 HalReportResourceUsage(VOID) 99 { 100 INTERFACE_TYPE InterfaceType; 101 UNICODE_STRING HalString; 102 103 /* FIXME: Initialize MCA bus */ 104 105 /* Initialize PCI bus. */ 106 HalpInitializePciBus(); 107 108 /* Initialize the stubs */ 109 HalpInitializePciStubs(); 110 111 /* What kind of bus is this? */ 112 switch (HalpBusType) 113 { 114 /* ISA Machine */ 115 case MACHINE_TYPE_ISA: 116 InterfaceType = Isa; 117 break; 118 119 /* EISA Machine */ 120 case MACHINE_TYPE_EISA: 121 InterfaceType = Eisa; 122 break; 123 124 /* MCA Machine */ 125 case MACHINE_TYPE_MCA: 126 InterfaceType = MicroChannel; 127 break; 128 129 /* Unknown */ 130 default: 131 InterfaceType = Internal; 132 break; 133 } 134 135 /* Build HAL usage */ 136 RtlInitUnicodeString(&HalString, HalName); 137 HalpReportResourceUsage(&HalString, InterfaceType); 138 139 /* Setup PCI debugging and Hibernation */ 140 HalpRegisterPciDebuggingDeviceInfo(); 141 } 142 143 /* EOF */ 144