2006-11-27 19:26:31 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS HAL
|
[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
|
|
|
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
|
|
|
* FILE: hal/halx86/generic/acpi/busemul.c
|
|
|
|
* PURPOSE: ACPI HAL Bus Handler Emulation Code
|
|
|
|
* PROGRAMMERS: ReactOS Portable Systems Group
|
2001-08-21 20:18:27 +00:00
|
|
|
*/
|
|
|
|
|
[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
|
|
|
/* INCLUDES *******************************************************************/
|
2001-08-21 20:18:27 +00:00
|
|
|
|
2005-06-18 14:29:31 +00:00
|
|
|
#include <hal.h>
|
2005-06-19 22:53:49 +00:00
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
2001-08-21 20:18:27 +00:00
|
|
|
|
[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
|
|
|
/* GLOBALS ********************************************************************/
|
2001-08-21 20:18:27 +00:00
|
|
|
|
[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
|
|
|
/* PRIVATE FUNCTIONS **********************************************************/
|
2001-08-21 20:18:27 +00:00
|
|
|
|
2006-11-29 22:12:50 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
HalpRegisterKdSupportFunctions(VOID)
|
|
|
|
{
|
|
|
|
/* Register PCI Device Functions */
|
|
|
|
KdSetupPciDeviceForDebugging = HalpSetupPciDeviceForDebugging;
|
|
|
|
KdReleasePciDeviceforDebugging = HalpReleasePciDeviceForDebugging;
|
|
|
|
|
|
|
|
/* Register memory functions */
|
2010-03-03 21:56:52 +00:00
|
|
|
#ifndef _MINIHAL_
|
2006-11-29 22:12:50 +00:00
|
|
|
KdMapPhysicalMemory64 = HalpMapPhysicalMemory64;
|
|
|
|
KdUnmapVirtualAddress = HalpUnmapVirtualAddress;
|
2010-03-03 21:56:52 +00:00
|
|
|
#endif
|
2006-11-29 22:12:50 +00:00
|
|
|
|
|
|
|
/* Register ACPI stub */
|
|
|
|
KdCheckPowerButton = HalpCheckPowerButton;
|
|
|
|
}
|
|
|
|
|
2006-11-27 19:26:31 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
HalpAssignSlotResources(IN PUNICODE_STRING RegistryPath,
|
|
|
|
IN PUNICODE_STRING DriverClassName,
|
|
|
|
IN PDRIVER_OBJECT DriverObject,
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN INTERFACE_TYPE BusType,
|
|
|
|
IN ULONG BusNumber,
|
|
|
|
IN ULONG SlotNumber,
|
|
|
|
IN OUT PCM_RESOURCE_LIST *AllocatedResources)
|
2001-08-21 20:18:27 +00:00
|
|
|
{
|
2006-11-27 19:26:31 +00:00
|
|
|
BUS_HANDLER BusHandler;
|
|
|
|
PAGED_CODE();
|
|
|
|
|
|
|
|
/* Only PCI is supported */
|
|
|
|
if (BusType != PCIBus) return STATUS_NOT_IMPLEMENTED;
|
|
|
|
|
|
|
|
/* Setup fake PCI Bus handler */
|
|
|
|
RtlCopyMemory(&BusHandler, &HalpFakePciBusHandler, sizeof(BUS_HANDLER));
|
|
|
|
BusHandler.BusNumber = BusNumber;
|
|
|
|
|
|
|
|
/* Call the PCI function */
|
2007-12-14 08:53:56 +00:00
|
|
|
return HalpAssignPCISlotResources(&BusHandler,
|
|
|
|
&BusHandler,
|
|
|
|
RegistryPath,
|
|
|
|
DriverClassName,
|
|
|
|
DriverObject,
|
|
|
|
DeviceObject,
|
|
|
|
SlotNumber,
|
|
|
|
AllocatedResources);
|
2001-08-21 20:18:27 +00:00
|
|
|
}
|
|
|
|
|
2006-11-27 19:26:31 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
HalpTranslateBusAddress(IN INTERFACE_TYPE InterfaceType,
|
|
|
|
IN ULONG BusNumber,
|
|
|
|
IN PHYSICAL_ADDRESS BusAddress,
|
|
|
|
IN OUT PULONG AddressSpace,
|
|
|
|
OUT PPHYSICAL_ADDRESS TranslatedAddress)
|
2001-08-21 20:18:27 +00:00
|
|
|
{
|
2006-11-27 19:26:31 +00:00
|
|
|
/* Translation is easy */
|
|
|
|
TranslatedAddress->QuadPart = BusAddress.QuadPart;
|
|
|
|
return TRUE;
|
2001-08-21 20:18:27 +00:00
|
|
|
}
|
|
|
|
|
2006-11-29 08:28:20 +00:00
|
|
|
ULONG
|
|
|
|
NTAPI
|
[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
|
|
|
HalpGetSystemInterruptVector_Acpi(IN ULONG BusNumber,
|
|
|
|
IN ULONG BusInterruptLevel,
|
|
|
|
IN ULONG BusInterruptVector,
|
|
|
|
OUT PKIRQL Irql,
|
|
|
|
OUT PKAFFINITY Affinity)
|
2006-11-29 08:28:20 +00:00
|
|
|
{
|
2012-03-28 12:15:54 +00:00
|
|
|
UCHAR Vector = IRQ2VECTOR((UCHAR)BusInterruptLevel);
|
|
|
|
*Irql = VECTOR2IRQL(Vector);
|
2006-11-29 08:28:20 +00:00
|
|
|
*Affinity = 0xFFFFFFFF;
|
|
|
|
return Vector;
|
|
|
|
}
|
|
|
|
|
2007-02-04 19:15:04 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
HalpFindBusAddressTranslation(IN PHYSICAL_ADDRESS BusAddress,
|
|
|
|
IN OUT PULONG AddressSpace,
|
|
|
|
OUT PPHYSICAL_ADDRESS TranslatedAddress,
|
|
|
|
IN OUT PULONG_PTR Context,
|
|
|
|
IN BOOLEAN NextBus)
|
|
|
|
{
|
|
|
|
/* Make sure we have a context */
|
|
|
|
if (!Context) return FALSE;
|
|
|
|
|
|
|
|
/* If we have data in the context, then this shouldn't be a new lookup */
|
|
|
|
if ((*Context) && (NextBus == TRUE)) return FALSE;
|
|
|
|
|
|
|
|
/* Return bus data */
|
|
|
|
TranslatedAddress->QuadPart = BusAddress.QuadPart;
|
|
|
|
|
|
|
|
/* Set context value and return success */
|
|
|
|
*Context = 1;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2006-11-27 19:26:31 +00:00
|
|
|
/* PUBLIC FUNCTIONS **********************************************************/
|
2001-08-21 20:18:27 +00:00
|
|
|
|
2006-11-27 19:26:31 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2010-07-19 15:32:13 +00:00
|
|
|
HalAdjustResourceList(IN OUT PIO_RESOURCE_REQUIREMENTS_LIST* pRequirementsList)
|
2001-08-21 20:18:27 +00:00
|
|
|
{
|
2006-11-27 19:26:31 +00:00
|
|
|
/* Deprecated, return success */
|
|
|
|
return STATUS_SUCCESS;
|
2001-08-21 20:18:27 +00:00
|
|
|
}
|
|
|
|
|
2006-11-27 19:26:31 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
HalAssignSlotResources(IN PUNICODE_STRING RegistryPath,
|
|
|
|
IN PUNICODE_STRING DriverClassName,
|
|
|
|
IN PDRIVER_OBJECT DriverObject,
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN INTERFACE_TYPE BusType,
|
|
|
|
IN ULONG BusNumber,
|
|
|
|
IN ULONG SlotNumber,
|
|
|
|
IN OUT PCM_RESOURCE_LIST *AllocatedResources)
|
2001-08-21 20:18:27 +00:00
|
|
|
{
|
2006-11-27 19:26:31 +00:00
|
|
|
/* Check the bus type */
|
|
|
|
if (BusType != PCIBus)
|
|
|
|
{
|
|
|
|
/* Call our internal handler */
|
|
|
|
return HalpAssignSlotResources(RegistryPath,
|
|
|
|
DriverClassName,
|
|
|
|
DriverObject,
|
|
|
|
DeviceObject,
|
|
|
|
BusType,
|
|
|
|
BusNumber,
|
|
|
|
SlotNumber,
|
|
|
|
AllocatedResources);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Call the PCI registered function */
|
|
|
|
return HalPciAssignSlotResources(RegistryPath,
|
|
|
|
DriverClassName,
|
|
|
|
DriverObject,
|
|
|
|
DeviceObject,
|
|
|
|
PCIBus,
|
|
|
|
BusNumber,
|
|
|
|
SlotNumber,
|
|
|
|
AllocatedResources);
|
|
|
|
}
|
2001-08-21 20:18:27 +00:00
|
|
|
}
|
|
|
|
|
2006-11-27 19:26:31 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
HalGetBusData(IN BUS_DATA_TYPE BusDataType,
|
|
|
|
IN ULONG BusNumber,
|
|
|
|
IN ULONG SlotNumber,
|
|
|
|
IN PVOID Buffer,
|
|
|
|
IN ULONG Length)
|
2001-08-21 20:18:27 +00:00
|
|
|
{
|
2006-11-27 19:26:31 +00:00
|
|
|
/* Call the extended function */
|
|
|
|
return HalGetBusDataByOffset(BusDataType,
|
|
|
|
BusNumber,
|
|
|
|
SlotNumber,
|
|
|
|
Buffer,
|
|
|
|
0,
|
|
|
|
Length);
|
2001-08-21 20:18:27 +00:00
|
|
|
}
|
|
|
|
|
2006-11-27 19:26:31 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
HalGetBusDataByOffset(IN BUS_DATA_TYPE BusDataType,
|
|
|
|
IN ULONG BusNumber,
|
|
|
|
IN ULONG SlotNumber,
|
|
|
|
IN PVOID Buffer,
|
|
|
|
IN ULONG Offset,
|
|
|
|
IN ULONG Length)
|
2001-08-21 20:18:27 +00:00
|
|
|
{
|
2006-11-27 19:26:31 +00:00
|
|
|
BUS_HANDLER BusHandler;
|
|
|
|
|
|
|
|
/* Look as the bus type */
|
|
|
|
if (BusDataType == Cmos)
|
|
|
|
{
|
|
|
|
/* Call CMOS Function */
|
|
|
|
return HalpGetCmosData(0, SlotNumber, Buffer, Length);
|
|
|
|
}
|
|
|
|
else if (BusDataType == EisaConfiguration)
|
|
|
|
{
|
|
|
|
/* FIXME: TODO */
|
2008-08-24 15:48:05 +00:00
|
|
|
ASSERT(FALSE);
|
2006-11-27 19:26:31 +00:00
|
|
|
}
|
|
|
|
else if ((BusDataType == PCIConfiguration) &&
|
|
|
|
(HalpPCIConfigInitialized) &&
|
|
|
|
((BusNumber >= HalpMinPciBus) && (BusNumber <= HalpMaxPciBus)))
|
|
|
|
{
|
|
|
|
/* Setup fake PCI Bus handler */
|
|
|
|
RtlCopyMemory(&BusHandler, &HalpFakePciBusHandler, sizeof(BUS_HANDLER));
|
|
|
|
BusHandler.BusNumber = BusNumber;
|
|
|
|
|
|
|
|
/* Call PCI function */
|
2007-12-14 08:53:56 +00:00
|
|
|
return HalpGetPCIData(&BusHandler,
|
|
|
|
&BusHandler,
|
|
|
|
*(PPCI_SLOT_NUMBER)&SlotNumber,
|
|
|
|
Buffer,
|
|
|
|
Offset,
|
|
|
|
Length);
|
2006-11-27 19:26:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Invalid bus */
|
|
|
|
return 0;
|
2001-08-21 20:18:27 +00:00
|
|
|
}
|
|
|
|
|
2006-11-27 19:26:31 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
HalGetInterruptVector(IN INTERFACE_TYPE InterfaceType,
|
|
|
|
IN ULONG BusNumber,
|
|
|
|
IN ULONG BusInterruptLevel,
|
|
|
|
IN ULONG BusInterruptVector,
|
|
|
|
OUT PKIRQL Irql,
|
|
|
|
OUT PKAFFINITY Affinity)
|
2001-08-21 20:18:27 +00:00
|
|
|
{
|
2006-11-27 19:26:31 +00:00
|
|
|
/* Call the system bus translator */
|
[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
|
|
|
return HalpGetSystemInterruptVector_Acpi(BusNumber,
|
|
|
|
BusInterruptLevel,
|
|
|
|
BusInterruptVector,
|
|
|
|
Irql,
|
|
|
|
Affinity);
|
2001-08-21 20:18:27 +00:00
|
|
|
}
|
|
|
|
|
2006-11-27 19:26:31 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
HalSetBusData(IN BUS_DATA_TYPE BusDataType,
|
|
|
|
IN ULONG BusNumber,
|
|
|
|
IN ULONG SlotNumber,
|
|
|
|
IN PVOID Buffer,
|
|
|
|
IN ULONG Length)
|
2001-08-21 20:18:27 +00:00
|
|
|
{
|
2006-11-27 19:26:31 +00:00
|
|
|
/* Call the extended function */
|
|
|
|
return HalSetBusDataByOffset(BusDataType,
|
|
|
|
BusNumber,
|
|
|
|
SlotNumber,
|
|
|
|
Buffer,
|
|
|
|
0,
|
|
|
|
Length);
|
2001-08-21 20:18:27 +00:00
|
|
|
}
|
|
|
|
|
2006-11-27 19:26:31 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
HalSetBusDataByOffset(IN BUS_DATA_TYPE BusDataType,
|
|
|
|
IN ULONG BusNumber,
|
|
|
|
IN ULONG SlotNumber,
|
|
|
|
IN PVOID Buffer,
|
|
|
|
IN ULONG Offset,
|
|
|
|
IN ULONG Length)
|
2001-08-21 20:18:27 +00:00
|
|
|
{
|
2006-11-27 19:26:31 +00:00
|
|
|
BUS_HANDLER BusHandler;
|
|
|
|
|
|
|
|
/* Look as the bus type */
|
|
|
|
if (BusDataType == Cmos)
|
|
|
|
{
|
|
|
|
/* Call CMOS Function */
|
|
|
|
return HalpSetCmosData(0, SlotNumber, Buffer, Length);
|
|
|
|
}
|
|
|
|
else if ((BusDataType == PCIConfiguration) && (HalpPCIConfigInitialized))
|
|
|
|
{
|
|
|
|
/* Setup fake PCI Bus handler */
|
|
|
|
RtlCopyMemory(&BusHandler, &HalpFakePciBusHandler, sizeof(BUS_HANDLER));
|
|
|
|
BusHandler.BusNumber = BusNumber;
|
|
|
|
|
|
|
|
/* Call PCI function */
|
2007-12-14 08:53:56 +00:00
|
|
|
return HalpSetPCIData(&BusHandler,
|
|
|
|
&BusHandler,
|
|
|
|
*(PPCI_SLOT_NUMBER)&SlotNumber,
|
|
|
|
Buffer,
|
|
|
|
Offset,
|
|
|
|
Length);
|
2006-11-27 19:26:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Invalid bus */
|
|
|
|
return 0;
|
2001-08-21 20:18:27 +00:00
|
|
|
}
|
|
|
|
|
2006-11-27 19:26:31 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
HalTranslateBusAddress(IN INTERFACE_TYPE InterfaceType,
|
|
|
|
IN ULONG BusNumber,
|
|
|
|
IN PHYSICAL_ADDRESS BusAddress,
|
|
|
|
IN OUT PULONG AddressSpace,
|
|
|
|
OUT PPHYSICAL_ADDRESS TranslatedAddress)
|
2001-08-21 20:18:27 +00:00
|
|
|
{
|
2006-11-27 19:26:31 +00:00
|
|
|
/* Look as the bus type */
|
|
|
|
if (InterfaceType == PCIBus)
|
|
|
|
{
|
|
|
|
/* Call the PCI registered function */
|
|
|
|
return HalPciTranslateBusAddress(PCIBus,
|
|
|
|
BusNumber,
|
|
|
|
BusAddress,
|
|
|
|
AddressSpace,
|
|
|
|
TranslatedAddress);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Translation is easy */
|
|
|
|
TranslatedAddress->QuadPart = BusAddress.QuadPart;
|
|
|
|
return TRUE;
|
|
|
|
}
|
2001-08-21 20:18:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* EOF */
|