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