xref: /reactos/hal/halx86/legacy/halpcat.c (revision 40462c92)
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 /* GLOBALS ********************************************************************/
16 
17 /* This determines the HAL type */
18 BOOLEAN HalDisableFirmwareMapper = FALSE;
19 #if defined(SARCH_XBOX)
20 PWCHAR HalHardwareIdString = L"xbox";
21 PWCHAR HalName = L"Xbox HAL";
22 #elif defined(SARCH_PC98)
23 PWCHAR HalHardwareIdString = L"pc98_up";
24 PWCHAR HalName = L"NEC PC-98 Compatible NESA/C-Bus HAL";
25 #else
26 PWCHAR HalHardwareIdString = L"e_isa_up";
27 PWCHAR HalName = L"PC Compatible Eisa/Isa HAL";
28 #endif
29 
30 /* PRIVATE FUNCTIONS **********************************************************/
31 
32 CODE_SEG("INIT")
33 NTSTATUS
34 NTAPI
35 HalpSetupAcpiPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
36 {
37     /* There is no ACPI on these HALs */
38     return STATUS_NO_SUCH_DEVICE;
39 }
40 
41 CODE_SEG("INIT")
42 VOID
43 NTAPI
44 HalpBuildAddressMap(VOID)
45 {
46     /* FIXME: Inherit ROM blocks from the registry */
47     //HalpInheritROMBlocks();
48 
49     /* FIXME: Add the ROM blocks to our ranges */
50     //HalpAddROMRanges();
51 }
52 
53 CODE_SEG("INIT")
54 BOOLEAN
55 NTAPI
56 HalpGetDebugPortTable(VOID)
57 {
58     /* No ACPI */
59     return FALSE;
60 }
61 
62 CODE_SEG("INIT")
63 ULONG
64 NTAPI
65 HalpIs16BitPortDecodeSupported(VOID)
66 {
67     /* Only EISA systems support this */
68     return (HalpBusType == MACHINE_TYPE_EISA) ? CM_RESOURCE_PORT_16_BIT_DECODE : 0;
69 }
70 
71 #if 0
72 CODE_SEG("INIT")
73 NTSTATUS
74 NTAPI
75 HaliInitPnpDriver(VOID)
76 {
77     /* On PC-AT, this will interface with the PCI driver */
78     //HalpDebugPciBus();
79     return STATUS_SUCCESS;
80 }
81 #endif
82 
83 /*
84  * @implemented
85  */
86 CODE_SEG("INIT")
87 VOID
88 NTAPI
89 HalReportResourceUsage(VOID)
90 {
91     INTERFACE_TYPE InterfaceType;
92     UNICODE_STRING HalString;
93 
94     /* FIXME: Initialize MCA bus */
95 
96     /* Initialize PCI bus. */
97     HalpInitializePciBus();
98 
99     /* Initialize the stubs */
100     HalpInitializePciStubs();
101 
102     /* What kind of bus is this? */
103     switch (HalpBusType)
104     {
105         /* ISA Machine */
106         case MACHINE_TYPE_ISA:
107             InterfaceType = Isa;
108             break;
109 
110         /* EISA Machine */
111         case MACHINE_TYPE_EISA:
112             InterfaceType = Eisa;
113             break;
114 
115         /* MCA Machine */
116         case MACHINE_TYPE_MCA:
117             InterfaceType = MicroChannel;
118             break;
119 
120         /* Unknown */
121         default:
122             InterfaceType = Internal;
123             break;
124     }
125 
126     /* Build HAL usage */
127     RtlInitUnicodeString(&HalString, HalName);
128     HalpReportResourceUsage(&HalString, InterfaceType);
129 
130     /* Setup PCI debugging and Hibernation */
131     HalpRegisterPciDebuggingDeviceInfo();
132 }
133 
134 /* EOF */
135