2010-03-31 04:43:39 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS HAL
|
|
|
|
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
[HAL]: Bus support in the HAL actually creates a further wedge between the different x86 HALs: There are actually two dinstinct implementations. On the ACPI HAL, the system is assumed not to have things like special ISA, MCA, EISA buses, and a PCI driver is used in combination with the ACPI Interface for PCI Bus support. On non-ACPI systems, the legacy "Bus Handler" library is used, and the HAL provides a core set of CMOS, EISA, ISA, MCA and PCI bus handlers, each with their own routines and specific code. Additionally, PCI IRQ Routing and other PCI bus internals are handled directly by the HAL -- on the ACPI HAL, the PCI Bus support is implemented through a "Fake"/static bus handler, just to keep the functions shared. On ReactOS, both the ACPI and non-ACPI HAL were currently using a mix of both HAL bus handling types, mostly implemented the "ACPI way" (with a fake PCI bus handler and such).
As a result, none of the Hal*Bus HALDISPATCH routines were implemented, which bus drivers expect to find when they're not on ACPI systems (ReactOS today). eVb's new PCI driver was crashing, for example.
Furthermore, legacy systems suffer, because the ACPI HAL Bus routines (that we currently have) expect perfect ACPI-style-compliant systems, not the legacy crap from the early 90ies. This works fine in VMs and new hardware, but old hardware is left behind.
This patch basically corrects the first part of the problem, by making the bus handling support separate between ACPI and non-ACPI HALs. For now, the code remains 100% the same in functionality between both.
However, I have started adding the first few elements:
[HAL]: Implement HalRegisterBusHandler HALDISPATCH routine.
[HAL]: On legacy HALs, register the CMOS, ISA, SYSTEM handlers.
[HAL]: Add cmosbus.c. Stub all bus-specific bus handler routines in the xxxbus.c files.
No real functionality change occurs with this patch, yet.
svn path=/trunk/; revision=47649
2010-06-07 01:09:41 +00:00
|
|
|
* FILE: hal/halx86/generic/legacy/halpcat.c
|
2010-03-31 04:43:39 +00:00
|
|
|
* PURPOSE: HAL Legacy Support Code
|
|
|
|
* PROGRAMMERS: ReactOS Portable Systems Group
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* INCLUDES *******************************************************************/
|
|
|
|
|
|
|
|
#include <hal.h>
|
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
/* GLOBALS ********************************************************************/
|
|
|
|
|
2010-04-01 20:46:55 +00:00
|
|
|
/* This determines the HAL type */
|
|
|
|
BOOLEAN HalDisableFirmwareMapper = FALSE;
|
|
|
|
PWCHAR HalHardwareIdString = L"e_isa_up";
|
|
|
|
PWCHAR HalName = L"PC Compatible Eisa/Isa HAL";
|
|
|
|
|
2010-03-31 04:43:39 +00:00
|
|
|
/* PRIVATE FUNCTIONS **********************************************************/
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
HalpSetupAcpiPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
|
|
|
{
|
|
|
|
/* There is no ACPI on these HALs */
|
|
|
|
return STATUS_NO_SUCH_DEVICE;
|
|
|
|
}
|
|
|
|
|
2010-04-01 20:46:55 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
HalpBuildAddressMap(VOID)
|
|
|
|
{
|
|
|
|
/* FIXME: Inherit ROM blocks from the registry */
|
|
|
|
//HalpInheritROMBlocks();
|
|
|
|
|
|
|
|
/* FIXME: Add the ROM blocks to our ranges */
|
|
|
|
//HalpAddROMRanges();
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
HalpGetDebugPortTable(VOID)
|
|
|
|
{
|
|
|
|
/* No ACPI */
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
HalpIs16BitPortDecodeSupported(VOID)
|
|
|
|
{
|
|
|
|
/* Only EISA systems support this */
|
|
|
|
return (HalpBusType == MACHINE_TYPE_EISA) ? CM_RESOURCE_PORT_16_BIT_DECODE : 0;
|
|
|
|
}
|
|
|
|
|
2010-09-10 21:46:13 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
HaliInitPnpDriver(VOID)
|
|
|
|
{
|
|
|
|
/* On PC-AT, this will interface with the PCI driver */
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2010-04-01 19:42:07 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
HalReportResourceUsage(VOID)
|
|
|
|
{
|
|
|
|
INTERFACE_TYPE InterfaceType;
|
|
|
|
UNICODE_STRING HalString;
|
|
|
|
|
|
|
|
/* FIXME: Initialize MCA bus */
|
|
|
|
|
|
|
|
/* Initialize PCI bus. */
|
|
|
|
HalpInitializePciBus();
|
|
|
|
|
|
|
|
/* Initialize the stubs */
|
|
|
|
HalpInitializePciStubs();
|
|
|
|
|
|
|
|
/* What kind of bus is this? */
|
|
|
|
switch (HalpBusType)
|
|
|
|
{
|
|
|
|
/* ISA Machine */
|
|
|
|
case MACHINE_TYPE_ISA:
|
|
|
|
InterfaceType = Isa;
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* EISA Machine */
|
|
|
|
case MACHINE_TYPE_EISA:
|
|
|
|
InterfaceType = Eisa;
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* MCA Machine */
|
|
|
|
case MACHINE_TYPE_MCA:
|
|
|
|
InterfaceType = MicroChannel;
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Unknown */
|
|
|
|
default:
|
|
|
|
InterfaceType = Internal;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Build HAL usage */
|
2010-04-01 20:46:55 +00:00
|
|
|
RtlInitUnicodeString(&HalString, HalName);
|
2010-04-01 19:42:07 +00:00
|
|
|
HalpReportResourceUsage(&HalString, InterfaceType);
|
|
|
|
|
|
|
|
/* Setup PCI debugging and Hibernation */
|
|
|
|
HalpRegisterPciDebuggingDeviceInfo();
|
|
|
|
}
|
|
|
|
|
2010-03-31 04:43:39 +00:00
|
|
|
/* EOF */
|