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