mirror of
https://github.com/reactos/reactos.git
synced 2024-07-08 05:35:06 +00:00
Implemented bus handler functions (not working yet)
Several STDCALL fixes svn path=/trunk/; revision=1085
This commit is contained in:
parent
9887130ab7
commit
802301d861
|
@ -32,7 +32,10 @@
|
|||
*/
|
||||
|
||||
BOOLEAN
|
||||
HalMakeBeep(ULONG Frequency)
|
||||
STDCALL
|
||||
HalMakeBeep (
|
||||
ULONG Frequency
|
||||
)
|
||||
{
|
||||
/* save flags and disable interrupts */
|
||||
__asm__("pushf\n\t" \
|
||||
|
|
|
@ -6,72 +6,554 @@
|
|||
* PROGRAMMER: David Welch (welch@mcmail.com)
|
||||
* UPDATE HISTORY:
|
||||
* Created 22/05/98
|
||||
*
|
||||
*
|
||||
* NOTE: The bus handler code is under contruction!
|
||||
* It does NOT work yet!
|
||||
*
|
||||
* TODO:
|
||||
* - Add missing default bus handler functions
|
||||
* - Change ntoskrnl's initialization sequence
|
||||
* (non-paged pool and spin locks must be available before HalInitSystem()
|
||||
* is called in system initialization phase 0)
|
||||
* - Add bus handler functions for all busses
|
||||
*/
|
||||
|
||||
/* INCLUDES *****************************************************************/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <internal/hal.h>
|
||||
|
||||
#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
||||
|
||||
/* TYPE DEFINITIONS *********************************************************/
|
||||
|
||||
struct _BUS_HANDLER;
|
||||
|
||||
typedef ULONG (STDCALL *pGetInterruptVector) (
|
||||
IN struct _BUS_HANDLER *BusHandler,
|
||||
IN ULONG BusInterruptLevel,
|
||||
IN ULONG BusInterruptVector,
|
||||
OUT PKIRQL Irql,
|
||||
OUT PKAFFINITY Affinity
|
||||
);
|
||||
|
||||
typedef ULONG (STDCALL *pTranslateBusAddress) (
|
||||
IN struct _BUS_HANDLER *BusHandler,
|
||||
IN PHYSICAL_ADDRESS BusAddress,
|
||||
IN ULONG Length,
|
||||
IN OUT PULONG AddressSpace,
|
||||
OUT PPHYSICAL_ADDRESS TranslatedAddress
|
||||
);
|
||||
|
||||
|
||||
typedef struct _BUS_HANDLER
|
||||
{
|
||||
LIST_ENTRY Entry;
|
||||
INTERFACE_TYPE InterfaceType;
|
||||
BUS_DATA_TYPE BusDataType;
|
||||
ULONG BusNumber;
|
||||
ULONG RefCount;
|
||||
|
||||
PVOID GetBusData;
|
||||
PVOID SetBusData;
|
||||
PVOID AssignSlotResources;
|
||||
pGetInterruptVector GetInterruptVector;
|
||||
pTranslateBusAddress TranslateBusAddress;
|
||||
|
||||
} BUS_HANDLER, *PBUS_HANDLER;
|
||||
|
||||
|
||||
/* GLOBAL VARIABLES **********************************************************/
|
||||
|
||||
//KSPIN_LOCK HalpBusHandlerSpinLock = {0,};
|
||||
LIST_ENTRY HalpBusHandlerList;
|
||||
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
NTSTATUS HalAssignSlotResources(PUNICODE_STRING RegistryPath,
|
||||
PUNICODE_STRING DriverClassName,
|
||||
PDRIVER_OBJECT DriverObject,
|
||||
PDEVICE_OBJECT DeviceObject,
|
||||
INTERFACE_TYPE BusType,
|
||||
ULONG BusNumber,
|
||||
ULONG SlotNumber,
|
||||
PCM_RESOURCE_LIST* AllocatedResources)
|
||||
static
|
||||
ULONG
|
||||
HalpNoBusData (
|
||||
PBUS_HANDLER BusHandler,
|
||||
ULONG SlotNumber,
|
||||
PVOID Buffer,
|
||||
ULONG Offset,
|
||||
ULONG Length
|
||||
)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
PBUS_HANDLER
|
||||
HalpAllocateBusHandler (
|
||||
INTERFACE_TYPE InterfaceType,
|
||||
BUS_DATA_TYPE BusDataType,
|
||||
ULONG BusNumber
|
||||
)
|
||||
{
|
||||
PBUS_HANDLER BusHandler = NULL;
|
||||
|
||||
// BusHandler = ExAllocatePool (NonPagedPool, sizeof(BUS_HANDLER));
|
||||
if (BusHandler == NULL)
|
||||
return NULL;
|
||||
|
||||
RtlZeroMemory (BusHandler, sizeof(BUS_HANDLER));
|
||||
|
||||
InsertTailList (&HalpBusHandlerList,
|
||||
&BusHandler->Entry);
|
||||
|
||||
BusHandler->InterfaceType = InterfaceType;
|
||||
BusHandler->BusDataType = BusDataType;
|
||||
BusHandler->BusNumber = BusNumber;
|
||||
|
||||
/* initialize handler function table */
|
||||
BusHandler->GetBusData = HalpNoBusData;
|
||||
BusHandler->SetBusData = HalpNoBusData;
|
||||
// BusHandler->AdjustResourceList = HalpNoAdjustResourceList;
|
||||
// BusHandler->AssignSlotResources = HalpNoAssignSlotResources;
|
||||
// BusHandler->GetInterruptVector = HalpNoGetInterruptVector;
|
||||
// BusHandler->TranslateBusAddress = HalpNoTranslateBusAddress;
|
||||
|
||||
|
||||
return BusHandler;
|
||||
}
|
||||
|
||||
|
||||
|
||||
VOID
|
||||
HalpInitBusHandlers (VOID)
|
||||
{
|
||||
PBUS_HANDLER BusHandler;
|
||||
|
||||
/* general preparations */
|
||||
// KeInitializeSpinLock (&HalpBusHandlerSpinLock);
|
||||
InitializeListHead (&HalpBusHandlerList);
|
||||
|
||||
/* initialize hal dispatch tables */
|
||||
#if 0
|
||||
|
||||
|
||||
HalDispatchTable->HalQueryBusSlots = HaliQueryBusSlots;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* add bus handlers
|
||||
*/
|
||||
|
||||
/* system bus handler */
|
||||
BusHandler = HalpAllocateBusHandler (Internal,
|
||||
ConfigurationSpaceUndefined,
|
||||
0);
|
||||
// BusHandler->GetInterruptVector =
|
||||
// (pGetInterruptVector)HalpGetSystemInterruptVector;
|
||||
// BusHandler->TranslateBusAddress =
|
||||
// (pTranslateBusAddress)HalpTranslateSystemBusAddress;
|
||||
|
||||
/* cmos bus handler */
|
||||
BusHandler = HalpAllocateBusHandler (InterfaceTypeUndefined,
|
||||
Cmos,
|
||||
0);
|
||||
|
||||
/* pci bus handler */
|
||||
BusHandler = HalpAllocateBusHandler (PCIBus,
|
||||
PCIConfiguration,
|
||||
0);
|
||||
|
||||
/* isa bus handler */
|
||||
BusHandler = HalpAllocateBusHandler (Isa,
|
||||
ConfigurationSpaceUndefined,
|
||||
0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
PBUS_HANDLER
|
||||
FASTCALL
|
||||
HaliHandlerForBus (
|
||||
INTERFACE_TYPE InterfaceType,
|
||||
ULONG BusNumber
|
||||
)
|
||||
{
|
||||
PBUS_HANDLER BusHandler;
|
||||
PLIST_ENTRY CurrentEntry;
|
||||
// KIRQL OldIrql;
|
||||
|
||||
// KeAcquireSpinLock (&HalpBusHandlerSpinLock, &OldIrql);
|
||||
|
||||
CurrentEntry = HalpBusHandlerList.Flink;
|
||||
while (CurrentEntry != &HalpBusHandlerList)
|
||||
{
|
||||
BusHandler = (PBUS_HANDLER)CurrentEntry;
|
||||
if (BusHandler->InterfaceType == InterfaceType &&
|
||||
BusHandler->BusNumber == BusNumber)
|
||||
{
|
||||
// KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql);
|
||||
return BusHandler;
|
||||
}
|
||||
CurrentEntry = CurrentEntry->Flink;
|
||||
}
|
||||
// KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
PBUS_HANDLER
|
||||
FASTCALL
|
||||
HaliHandlerForConfigSpace (
|
||||
BUS_DATA_TYPE BusDataType,
|
||||
ULONG BusNumber
|
||||
)
|
||||
{
|
||||
PBUS_HANDLER BusHandler;
|
||||
PLIST_ENTRY CurrentEntry;
|
||||
// KIRQL OldIrql;
|
||||
|
||||
// KeAcquireSpinLock (&HalpBusHandlerSpinLock, &OldIrql);
|
||||
|
||||
CurrentEntry = HalpBusHandlerList.Flink;
|
||||
while (CurrentEntry != &HalpBusHandlerList)
|
||||
{
|
||||
BusHandler = (PBUS_HANDLER)CurrentEntry;
|
||||
if (BusHandler->BusDataType == BusDataType &&
|
||||
BusHandler->BusNumber == BusNumber)
|
||||
{
|
||||
// KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql);
|
||||
return BusHandler;
|
||||
}
|
||||
CurrentEntry = CurrentEntry->Flink;
|
||||
}
|
||||
// KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
PBUS_HANDLER
|
||||
FASTCALL
|
||||
HaliReferenceHandlerForBus (
|
||||
INTERFACE_TYPE InterfaceType,
|
||||
ULONG BusNumber
|
||||
)
|
||||
{
|
||||
PBUS_HANDLER BusHandler;
|
||||
PLIST_ENTRY CurrentEntry;
|
||||
// KIRQL OldIrql;
|
||||
|
||||
// KeAcquireSpinLock (&HalpBusHandlerSpinLock, &OldIrql);
|
||||
|
||||
CurrentEntry = HalpBusHandlerList.Flink;
|
||||
while (CurrentEntry != &HalpBusHandlerList)
|
||||
{
|
||||
BusHandler = (PBUS_HANDLER)CurrentEntry;
|
||||
if (BusHandler->InterfaceType == InterfaceType &&
|
||||
BusHandler->BusNumber == BusNumber)
|
||||
{
|
||||
BusHandler->RefCount++;
|
||||
// KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql);
|
||||
return BusHandler;
|
||||
}
|
||||
CurrentEntry = CurrentEntry->Flink;
|
||||
}
|
||||
// KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
PBUS_HANDLER
|
||||
FASTCALL
|
||||
HaliReferenceHandlerForConfigSpace (
|
||||
BUS_DATA_TYPE BusDataType,
|
||||
ULONG BusNumber
|
||||
)
|
||||
{
|
||||
PBUS_HANDLER BusHandler;
|
||||
PLIST_ENTRY CurrentEntry;
|
||||
// KIRQL OldIrql;
|
||||
|
||||
// KeAcquireSpinLock (&HalpBusHandlerSpinLock, &OldIrql);
|
||||
|
||||
CurrentEntry = HalpBusHandlerList.Flink;
|
||||
while (CurrentEntry != &HalpBusHandlerList)
|
||||
{
|
||||
BusHandler = (PBUS_HANDLER)CurrentEntry;
|
||||
if (BusHandler->BusDataType == BusDataType &&
|
||||
BusHandler->BusNumber == BusNumber)
|
||||
{
|
||||
BusHandler->RefCount++;
|
||||
// KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql);
|
||||
return BusHandler;
|
||||
}
|
||||
CurrentEntry = CurrentEntry->Flink;
|
||||
}
|
||||
// KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
FASTCALL
|
||||
HaliDereferenceBusHandler (
|
||||
PBUS_HANDLER BusHandler
|
||||
)
|
||||
{
|
||||
// KIRQL OldIrql;
|
||||
|
||||
// KeAcquireSpinLock (&HalpBusHandlerSpinLock, &OldIrql);
|
||||
|
||||
BusHandler->RefCount--;
|
||||
|
||||
// KeReleaseSpinLock (&HalpBusHandlerSpinLock, OldIrql);
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
HalAdjustResourceList (
|
||||
PCM_RESOURCE_LIST Resources
|
||||
)
|
||||
{
|
||||
#if 0
|
||||
PBUS_HANDLER BusHandler;
|
||||
NTSTATUS Status;
|
||||
|
||||
BusHandler = HaliReferenceHandlerForBus (Resources->List[0].InterfaceType,
|
||||
Resources->List[0].BusNumber);
|
||||
if (BusHandler == NULL)
|
||||
return STATUS_SUCCESS;
|
||||
|
||||
Status = BusHandler->AdjustResourceList (BusHandler,
|
||||
BusHandler,
|
||||
Resources);
|
||||
|
||||
HaliDereferenceBusHandler (BusHandler);
|
||||
|
||||
return Status;
|
||||
#endif
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
ULONG HalGetBusData(BUS_DATA_TYPE BusDataType,
|
||||
ULONG BusNumber,
|
||||
ULONG SlotNumber,
|
||||
PVOID Buffer,
|
||||
ULONG Length)
|
||||
|
||||
NTSTATUS
|
||||
STDCALL
|
||||
HalAssignSlotResources (
|
||||
PUNICODE_STRING RegistryPath,
|
||||
PUNICODE_STRING DriverClassName,
|
||||
PDRIVER_OBJECT DriverObject,
|
||||
PDEVICE_OBJECT DeviceObject,
|
||||
INTERFACE_TYPE BusType,
|
||||
ULONG BusNumber,
|
||||
ULONG SlotNumber,
|
||||
PCM_RESOURCE_LIST *AllocatedResources
|
||||
)
|
||||
{
|
||||
#if 0
|
||||
PBUS_HANDLER BusHandler;
|
||||
NTSTATUS Status;
|
||||
|
||||
BusHandler = HaliReferenceHandlerForBus (InterfaceType,
|
||||
BusNumber);
|
||||
if (BusHandler == NULL)
|
||||
return STATUS_NOT_FOUND;
|
||||
|
||||
Status = BusHandler->AssignSlotResources (BusHandler,
|
||||
BusHandler,
|
||||
RegistryPath,
|
||||
DriverClassName,
|
||||
DriverObject,
|
||||
DeviceObject,
|
||||
SlotNumber,
|
||||
AllocatedResources);
|
||||
|
||||
HaliDereferenceBusHandler (BusHandler);
|
||||
|
||||
return Status;
|
||||
#endif
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
ULONG HalGetBusDataByOffset(BUS_DATA_TYPE BusDataType,
|
||||
ULONG BusNumber,
|
||||
ULONG SlotNumber,
|
||||
PVOID Buffer,
|
||||
ULONG Offset,
|
||||
ULONG Length)
|
||||
|
||||
ULONG
|
||||
STDCALL
|
||||
HalGetBusData (
|
||||
BUS_DATA_TYPE BusDataType,
|
||||
ULONG BusNumber,
|
||||
ULONG SlotNumber,
|
||||
PVOID Buffer,
|
||||
ULONG Length
|
||||
)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return (HalGetBusDataByOffset (BusDataType,
|
||||
BusNumber,
|
||||
SlotNumber,
|
||||
Buffer,
|
||||
0,
|
||||
Length));
|
||||
}
|
||||
ULONG HalSetBusData(BUS_DATA_TYPE BusDataType,
|
||||
ULONG BusNumber,
|
||||
ULONG SlotNumber,
|
||||
PVOID Buffer,
|
||||
ULONG Length)
|
||||
|
||||
|
||||
ULONG
|
||||
STDCALL
|
||||
HalGetBusDataByOffset (
|
||||
BUS_DATA_TYPE BusDataType,
|
||||
ULONG BusNumber,
|
||||
ULONG SlotNumber,
|
||||
PVOID Buffer,
|
||||
ULONG Offset,
|
||||
ULONG Length
|
||||
)
|
||||
{
|
||||
#if 0
|
||||
PBUS_HANDLER BusHandler;
|
||||
ULONG Result;
|
||||
|
||||
BusHandler = HaliReferenceHandlerForConfigSpace (BusDataType,
|
||||
BusNumber);
|
||||
if (BusHandler == NULL)
|
||||
return 0;
|
||||
|
||||
Result = BusHandler->GetBusData (BusHandler,
|
||||
SlotNumber,
|
||||
Buffer,
|
||||
Offset,
|
||||
Length);
|
||||
|
||||
HaliDereferenceBusHandler (BusHandler);
|
||||
|
||||
return Result;
|
||||
#endif
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
ULONG HalSetBusDataByOffset(BUS_DATA_TYPE BusDataType,
|
||||
ULONG BusNumber,
|
||||
ULONG SlotNumber,
|
||||
PVOID Buffer,
|
||||
ULONG Offset,
|
||||
ULONG Length)
|
||||
|
||||
ULONG
|
||||
STDCALL
|
||||
HalGetInterruptVector (
|
||||
INTERFACE_TYPE InterfaceType,
|
||||
ULONG BusNumber,
|
||||
ULONG BusInterruptLevel,
|
||||
ULONG BusInterruptVector,
|
||||
PKIRQL Irql,
|
||||
PKAFFINITY Affinity
|
||||
)
|
||||
{
|
||||
#if 0
|
||||
PBUS_HANDLER BusHandler;
|
||||
ULONG Result;
|
||||
|
||||
BusHandler = HaliReferenceHandlerForBus (InterfaceType,
|
||||
BusNumber);
|
||||
if (BusHandler == NULL)
|
||||
return 0;
|
||||
|
||||
Result = BusHandler->GetInterruptVector (BusHandler,
|
||||
BusInterruptLevel,
|
||||
BusInterruptVector,
|
||||
Irql,
|
||||
Affinity);
|
||||
|
||||
HaliDereferenceBusHandler (BusHandler);
|
||||
|
||||
return Result;
|
||||
#endif
|
||||
return (HalpGetSystemInterruptVector (NULL,
|
||||
BusInterruptLevel,
|
||||
BusInterruptVector,
|
||||
Irql,
|
||||
Affinity));
|
||||
}
|
||||
|
||||
|
||||
ULONG
|
||||
STDCALL
|
||||
HalSetBusData (
|
||||
BUS_DATA_TYPE BusDataType,
|
||||
ULONG BusNumber,
|
||||
ULONG SlotNumber,
|
||||
PVOID Buffer,
|
||||
ULONG Length
|
||||
)
|
||||
{
|
||||
return (HalSetBusDataByOffset (BusDataType,
|
||||
BusNumber,
|
||||
SlotNumber,
|
||||
Buffer,
|
||||
0,
|
||||
Length));
|
||||
}
|
||||
|
||||
|
||||
ULONG
|
||||
STDCALL
|
||||
HalSetBusDataByOffset (
|
||||
BUS_DATA_TYPE BusDataType,
|
||||
ULONG BusNumber,
|
||||
ULONG SlotNumber,
|
||||
PVOID Buffer,
|
||||
ULONG Offset,
|
||||
ULONG Length
|
||||
)
|
||||
{
|
||||
#if 0
|
||||
PBUS_HANDLER BusHandler;
|
||||
ULONG Result;
|
||||
|
||||
BusHandler = HaliReferenceHandlerForConfigSpace (BusDataType,
|
||||
BusNumber);
|
||||
if (BusHandler == NULL)
|
||||
return 0;
|
||||
|
||||
Result = BusHandler->SetBusData (BusHandler,
|
||||
BusHandler,
|
||||
SlotNumber,
|
||||
Buffer,
|
||||
Offset,
|
||||
Length);
|
||||
|
||||
HaliDereferenceBusHandler (BusHandler);
|
||||
|
||||
return Result;
|
||||
#endif
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
BOOLEAN HalTranslateBusAddress(INTERFACE_TYPE InterfaceType,
|
||||
ULONG BusNumber,
|
||||
PHYSICAL_ADDRESS BusAddress,
|
||||
PULONG AddressSpace,
|
||||
PPHYSICAL_ADDRESS TranslatedAddress)
|
||||
|
||||
BOOLEAN
|
||||
STDCALL
|
||||
HalTranslateBusAddress (
|
||||
INTERFACE_TYPE InterfaceType,
|
||||
ULONG BusNumber,
|
||||
PHYSICAL_ADDRESS BusAddress,
|
||||
PULONG AddressSpace,
|
||||
PPHYSICAL_ADDRESS TranslatedAddress
|
||||
)
|
||||
{
|
||||
#if 0
|
||||
PBUS_HANDLER BusHandler;
|
||||
BOOLEAN Result;
|
||||
|
||||
BusHandler = HaliReferenceHandlerForBus (InterfaceType,
|
||||
BusNumber);
|
||||
if (BusHandler == NULL)
|
||||
return FALSE;
|
||||
|
||||
Result = BusHandler->TranslateBusAddress (BusHandler,
|
||||
BusHandler,
|
||||
BusAddress,
|
||||
AddressSpace,
|
||||
TranslatedAddress);
|
||||
|
||||
HaliDereferenceBusHandler (BusHandler);
|
||||
|
||||
return Result;
|
||||
#endif
|
||||
UNIMPLEMENTED;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: display.c,v 1.5 2000/01/09 21:39:07 ekohl Exp $
|
||||
/* $Id: display.c,v 1.6 2000/03/19 13:34:47 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -162,9 +162,10 @@ HalResetDisplay (VOID)
|
|||
/* PUBLIC FUNCTIONS *********************************************************/
|
||||
|
||||
VOID
|
||||
STDCALL
|
||||
HalAcquireDisplayOwnership (
|
||||
IN PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters
|
||||
)
|
||||
IN PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters
|
||||
)
|
||||
/*
|
||||
* FUNCTION:
|
||||
* ARGUMENTS:
|
||||
|
@ -178,7 +179,10 @@ HalAcquireDisplayOwnership (
|
|||
|
||||
|
||||
VOID
|
||||
HalDisplayString(PCH String)
|
||||
STDCALL
|
||||
HalDisplayString (
|
||||
IN PCH String
|
||||
)
|
||||
/*
|
||||
* FUNCTION: Switches the screen to HAL console mode (BSOD) if not there
|
||||
* already and displays a string
|
||||
|
@ -251,10 +255,13 @@ HalDisplayString(PCH String)
|
|||
|
||||
|
||||
VOID
|
||||
HalQueryDisplayParameters (PULONG DispSizeX,
|
||||
PULONG DispSizeY,
|
||||
PULONG CursorPosX,
|
||||
PULONG CursorPosY)
|
||||
STDCALL
|
||||
HalQueryDisplayParameters (
|
||||
PULONG DispSizeX,
|
||||
PULONG DispSizeY,
|
||||
PULONG CursorPosX,
|
||||
PULONG CursorPosY
|
||||
)
|
||||
{
|
||||
if (DispSizeX)
|
||||
*DispSizeX = SizeX;
|
||||
|
@ -268,11 +275,14 @@ HalQueryDisplayParameters (PULONG DispSizeX,
|
|||
|
||||
|
||||
VOID
|
||||
HalSetDisplayParameters (ULONG CursorPosX,
|
||||
ULONG CursorPosY)
|
||||
STDCALL
|
||||
HalSetDisplayParameters (
|
||||
ULONG CursorPosX,
|
||||
ULONG CursorPosY
|
||||
)
|
||||
{
|
||||
CursorX = (CursorPosX < SizeX) ? CursorPosX : SizeX - 1;
|
||||
CursorY = (CursorPosY < SizeY) ? CursorPosY : SizeY - 1;
|
||||
CursorX = (CursorPosX < SizeX) ? CursorPosX : SizeX - 1;
|
||||
CursorY = (CursorPosY < SizeY) ? CursorPosY : SizeY - 1;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: halinit.c,v 1.7 1999/12/12 03:48:47 phreak Exp $
|
||||
/* $Id: halinit.c,v 1.8 2000/03/19 13:34:47 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -22,7 +22,11 @@
|
|||
/* FUNCTIONS ***************************************************************/
|
||||
|
||||
BOOLEAN
|
||||
HalInitSystem (ULONG Phase, boot_param *bp)
|
||||
STDCALL
|
||||
HalInitSystem (
|
||||
ULONG Phase,
|
||||
boot_param *bp
|
||||
)
|
||||
{
|
||||
if (Phase == 0)
|
||||
{
|
||||
|
@ -34,6 +38,8 @@ HalInitSystem (ULONG Phase, boot_param *bp)
|
|||
KeInitIRQ();
|
||||
KeLowerIrql(DISPATCH_LEVEL);
|
||||
|
||||
HalpInitBusHandlers ();
|
||||
|
||||
/*
|
||||
* Probe for a BIOS32 extension
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*
|
||||
/* $Id: irq.c,v 1.8 2000/03/19 13:34:47 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/hal/x86/irq.c
|
||||
|
@ -29,6 +30,7 @@
|
|||
|
||||
#include <internal/i386/segment.h>
|
||||
#include <internal/halio.h>
|
||||
#include <internal/hal.h>
|
||||
|
||||
#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
@ -364,8 +366,9 @@ VOID IoDisconnectInterrupt(PKINTERRUPT InterruptObject)
|
|||
KeLowerIrql(oldlvl);
|
||||
}
|
||||
|
||||
ULONG HalGetInterruptVector(INTERFACE_TYPE InterfaceType,
|
||||
ULONG BusNumber,
|
||||
ULONG
|
||||
STDCALL
|
||||
HalpGetSystemInterruptVector(PVOID BusHandler,
|
||||
ULONG BusInterruptLevel,
|
||||
ULONG BusInterruptVector,
|
||||
PKIRQL Irql,
|
||||
|
@ -389,11 +392,14 @@ ULONG HalGetInterruptVector(INTERFACE_TYPE InterfaceType,
|
|||
|
||||
// ASSERT_IRQL(PASSIVE_LEVEL);
|
||||
|
||||
#if 0
|
||||
switch (InterfaceType)
|
||||
{
|
||||
case Internal:
|
||||
#endif
|
||||
*Irql = HIGH_LEVEL - BusInterruptVector;
|
||||
ret = BusInterruptVector;
|
||||
#if 0
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -401,7 +407,8 @@ ULONG HalGetInterruptVector(INTERFACE_TYPE InterfaceType,
|
|||
DbgPrint("(%s:%d) Don't know that bus type\n",__FILE__,__LINE__);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: reboot.c,v 1.3 1999/12/12 03:48:47 phreak Exp $
|
||||
/* $Id: reboot.c,v 1.4 2000/03/19 13:34:47 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -52,7 +52,10 @@ HalReboot (VOID)
|
|||
|
||||
|
||||
VOID
|
||||
HalReturnToFirmware (ULONG Action)
|
||||
STDCALL
|
||||
HalReturnToFirmware (
|
||||
ULONG Action
|
||||
)
|
||||
{
|
||||
if (Action == FIRMWARE_HALT)
|
||||
{
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
/* MACROS and CONSTANTS ******************************************************/
|
||||
|
||||
/* macro BCD_INT : convert bcd to int */
|
||||
#define BCD_INT(bcd) ( ((bcd & 0xf0) >> 4) * 10 + (bcd &0x0f) )
|
||||
#define BCD_INT(bcd) (((bcd & 0xf0) >> 4) * 10 + (bcd &0x0f))
|
||||
|
||||
/* macro INT_BCD : convert int to bcd */
|
||||
#define INT_BCD(int) ( ((int / 10) << 4) + (int % 10) )
|
||||
#define INT_BCD(int) (((int / 10) << 4) + (int % 10))
|
||||
|
||||
|
||||
#define RTC_REGISTER_A 0x0A
|
||||
|
@ -59,62 +59,68 @@ HalSetCMOS (BYTE Reg, BYTE Val)
|
|||
|
||||
|
||||
VOID
|
||||
HalQueryRealTimeClock (PTIME_FIELDS pTime)
|
||||
STDCALL
|
||||
HalQueryRealTimeClock (
|
||||
PTIME_FIELDS Time
|
||||
)
|
||||
{
|
||||
/* check 'Update In Progress' bit */
|
||||
while (HalQueryCMOS (RTC_REGISTER_A) & RTC_REG_A_UIP)
|
||||
;
|
||||
|
||||
pTime->Second = BCD_INT(HalQueryCMOS (0));
|
||||
pTime->Minute = BCD_INT(HalQueryCMOS (2));
|
||||
pTime->Hour = BCD_INT(HalQueryCMOS (4));
|
||||
pTime->Weekday = BCD_INT(HalQueryCMOS (6));
|
||||
pTime->Day = BCD_INT(HalQueryCMOS (7));
|
||||
pTime->Month = BCD_INT(HalQueryCMOS (8));
|
||||
pTime->Year = BCD_INT(HalQueryCMOS (9));
|
||||
Time->Second = BCD_INT(HalQueryCMOS (0));
|
||||
Time->Minute = BCD_INT(HalQueryCMOS (2));
|
||||
Time->Hour = BCD_INT(HalQueryCMOS (4));
|
||||
Time->Weekday = BCD_INT(HalQueryCMOS (6));
|
||||
Time->Day = BCD_INT(HalQueryCMOS (7));
|
||||
Time->Month = BCD_INT(HalQueryCMOS (8));
|
||||
Time->Year = BCD_INT(HalQueryCMOS (9));
|
||||
|
||||
if (pTime->Year > 80)
|
||||
pTime->Year += 1900;
|
||||
if (Time->Year > 80)
|
||||
Time->Year += 1900;
|
||||
else
|
||||
pTime->Year += 2000;
|
||||
Time->Year += 2000;
|
||||
|
||||
#if 0
|
||||
/* Century */
|
||||
pTime->Year += BCD_INT(HalQueryCMOS (RTC_REGISTER_CENTURY)) * 100;
|
||||
Time->Year += BCD_INT(HalQueryCMOS (RTC_REGISTER_CENTURY)) * 100;
|
||||
#endif
|
||||
|
||||
#ifndef NDEBUG
|
||||
DbgPrint ("HalQueryRealTimeClock() %d:%d:%d %d/%d/%d\n",
|
||||
pTime->Hour,
|
||||
pTime->Minute,
|
||||
pTime->Second,
|
||||
pTime->Day,
|
||||
pTime->Month,
|
||||
pTime->Year
|
||||
Time->Hour,
|
||||
Time->Minute,
|
||||
Time->Second,
|
||||
Time->Day,
|
||||
Time->Month,
|
||||
Time->Year
|
||||
);
|
||||
#endif
|
||||
|
||||
pTime->Milliseconds = 0;
|
||||
Time->Milliseconds = 0;
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
HalSetRealTimeClock (PTIME_FIELDS pTime)
|
||||
STDCALL
|
||||
HalSetRealTimeClock (
|
||||
PTIME_FIELDS Time
|
||||
)
|
||||
{
|
||||
/* check 'Update In Progress' bit */
|
||||
while (HalQueryCMOS (RTC_REGISTER_A) & RTC_REG_A_UIP)
|
||||
;
|
||||
|
||||
HalSetCMOS (0, INT_BCD(pTime->Second));
|
||||
HalSetCMOS (2, INT_BCD(pTime->Minute));
|
||||
HalSetCMOS (4, INT_BCD(pTime->Hour));
|
||||
HalSetCMOS (6, INT_BCD(pTime->Weekday));
|
||||
HalSetCMOS (7, INT_BCD(pTime->Day));
|
||||
HalSetCMOS (8, INT_BCD(pTime->Month));
|
||||
HalSetCMOS (9, INT_BCD(pTime->Year % 100));
|
||||
HalSetCMOS (0, INT_BCD(Time->Second));
|
||||
HalSetCMOS (2, INT_BCD(Time->Minute));
|
||||
HalSetCMOS (4, INT_BCD(Time->Hour));
|
||||
HalSetCMOS (6, INT_BCD(Time->Weekday));
|
||||
HalSetCMOS (7, INT_BCD(Time->Day));
|
||||
HalSetCMOS (8, INT_BCD(Time->Month));
|
||||
HalSetCMOS (9, INT_BCD(Time->Year % 100));
|
||||
|
||||
#if 0
|
||||
/* Century */
|
||||
HalSetCMOS (RTC_REGISTER_CENTURY, INT_BCD(pTime->Year / 100));
|
||||
HalSetCMOS (RTC_REGISTER_CENTURY, INT_BCD(Time->Year / 100));
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; $Id: ntoskrnl.def,v 1.61 2000/03/19 09:14:49 ea Exp $
|
||||
; $Id: ntoskrnl.def,v 1.62 2000/03/19 13:35:37 ekohl Exp $
|
||||
;
|
||||
; reactos/ntoskrnl/ntoskrnl.def
|
||||
;
|
||||
|
@ -659,51 +659,51 @@ wctomb
|
|||
ExAcquireFastMutex
|
||||
ExReleaseFastMutex
|
||||
ExTryToAcquireFastMutex
|
||||
HalAcquireDisplayOwnership
|
||||
;HalAdjustResourceList
|
||||
HalAcquireDisplayOwnership@4
|
||||
HalAdjustResourceList@4
|
||||
;HalAllProcessorsStarted
|
||||
;HalAllocateAdapterChannel
|
||||
;HalAllocateCommonBuffer
|
||||
;HalAllocateCrashDumpRegisters
|
||||
;HalAssignSlotResources
|
||||
HalAssignSlotResources@32
|
||||
;HalBeginSystemInterrupt
|
||||
;HalCalibratePerformanceCounter
|
||||
;HalClearSoftwareInterrupt
|
||||
;HalDisableSystemInterrupt
|
||||
HalDisplayString
|
||||
HalDisplayString@4
|
||||
;HalEnableSystemInterrupt
|
||||
;HalEndSystemInterrupt
|
||||
;HalFlushCommonBuffer
|
||||
;HalFreeCommonBuffer
|
||||
;HalGetAdapter
|
||||
;HalGetBusData
|
||||
HalGetBusDataByOffset
|
||||
HalGetBusData@20
|
||||
HalGetBusDataByOffset@24
|
||||
;HalGetEnvironmentVariable
|
||||
HalGetInterruptVector
|
||||
HalGetInterruptVector@24
|
||||
HalHandleNMI@4
|
||||
HalInitSystem
|
||||
HalInitSystem@8
|
||||
;HalInitializeProcessor
|
||||
HalMakeBeep
|
||||
HalMakeBeep@4
|
||||
HalProcessorIdle@0
|
||||
HalQueryDisplayParameters
|
||||
HalQueryRealTimeClock
|
||||
HalQueryDisplayParameters@16
|
||||
HalQueryRealTimeClock@4
|
||||
;HalReadDmaCounter
|
||||
;HalReportResourceUsage
|
||||
;HalRequestIpi
|
||||
;HalRequestSoftwareInterrupt
|
||||
HalReturnToFirmware
|
||||
;HalSetBusData
|
||||
HalSetBusDataByOffset
|
||||
HalSetDisplayParameters
|
||||
HalReturnToFirmware@4
|
||||
HalSetBusData@20
|
||||
HalSetBusDataByOffset@24
|
||||
HalSetDisplayParameters@8
|
||||
;HalSetEnvironmentVariable
|
||||
;HalSetProfileInterval
|
||||
HalSetRealTimeClock
|
||||
HalSetRealTimeClock@4
|
||||
;HalSetTimeIncrement
|
||||
;HalStartNextProcessor
|
||||
;HalStartProfileInterrupt
|
||||
;HalStopProfileInterrupt
|
||||
;HalSystemVectorDispatchEntry
|
||||
;HalTranslateBusAddress
|
||||
HalTranslateBusAddress@24
|
||||
;IoAssignDriveLetters
|
||||
;IoFlushAdapterBuffers
|
||||
;IoFreeAdapterChannel
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; $Id: ntoskrnl.edf,v 1.48 2000/03/19 09:14:50 ea Exp $
|
||||
; $Id: ntoskrnl.edf,v 1.49 2000/03/19 13:35:38 ekohl Exp $
|
||||
;
|
||||
; reactos/ntoskrnl/ntoskrnl.def
|
||||
;
|
||||
|
@ -586,51 +586,51 @@ wctomb
|
|||
ExAcquireFastMutex
|
||||
ExReleaseFastMutex
|
||||
ExTryToAcquireFastMutex
|
||||
HalAcquireDisplayOwnership
|
||||
;HalAdjustResourceList
|
||||
HalAcquireDisplayOwnership=HalAcquireDisplayOwnership@4
|
||||
HalAdjustResourceList=HalAdjustResourceList@4
|
||||
;HalAllProcessorsStarted
|
||||
;HalAllocateAdapterChannel
|
||||
;HalAllocateCommonBuffer
|
||||
;HalAllocateCrashDumpRegisters
|
||||
;HalAssignSlotResources
|
||||
HalAssignSlotResource=HalAssignSlotResources@32
|
||||
;HalBeginSystemInterrupt
|
||||
;HalCalibratePerformanceCounter
|
||||
;HalClearSoftwareInterrupt
|
||||
;HalDisableSystemInterrupt
|
||||
HalDisplayString
|
||||
HalDisplayString=HalDisplayString@4
|
||||
;HalEnableSystemInterrupt
|
||||
;HalEndSystemInterrupt
|
||||
;HalFlushCommonBuffer
|
||||
;HalFreeCommonBuffer
|
||||
;HalGetAdapter
|
||||
;HalGetBusData
|
||||
HalGetBusDataByOffset
|
||||
HalGetBusData=HalGetBusData@20
|
||||
HalGetBusDataByOffset=HalGetBusDataByOffset@24
|
||||
;HalGetEnvironmentVariable
|
||||
HalGetInterruptVector
|
||||
HalGetInterruptVector=HalGetInterruptVector@24
|
||||
HalHandleNMI=HalHandleNMI@4
|
||||
HalInitSystem
|
||||
HalInitSystem=HalInitSystem@8
|
||||
;HalInitializeProcessor
|
||||
HalMakeBeep
|
||||
HalMakeBeep=HalMakeBeep@4
|
||||
HalProcessorIdle=HalProcessorIdle@0
|
||||
HalQueryDisplayParameters
|
||||
HalQueryRealTimeClock
|
||||
HalQueryDisplayParameters=HalQueryDisplayParameters@16
|
||||
HalQueryRealTimeClock=HalQueryRealTimeClock@4
|
||||
;HalReadDmaCounter
|
||||
;HalReportResourceUsage
|
||||
;HalRequestIpi
|
||||
;HalRequestSoftwareInterrupt
|
||||
HalReturnToFirmware
|
||||
;HalSetBusData
|
||||
HalSetBusDataByOffset
|
||||
HalSetDisplayParameters
|
||||
HalReturnToFirmware=HalReturnToFirmware@4
|
||||
HalSetBusData=HalSetBusData@20
|
||||
HalSetBusDataByOffset=HalSetBusDataByOffset@24
|
||||
HalSetDisplayParameters=HalSetDisplayParameters@8
|
||||
;HalSetEnvironmentVariable
|
||||
;HalSetProfileInterval
|
||||
HalSetRealTimeClock
|
||||
HalSetRealTimeClock=HalSetRealTimeClock@4
|
||||
;HalSetTimeIncrement
|
||||
;HalStartNextProcessor
|
||||
;HalStartProfileInterrupt
|
||||
;HalStopProfileInterrupt
|
||||
;HalSystemVectorDispatchEntry
|
||||
;HalTranslateBusAddress
|
||||
HalTranslateBusAddress=HalTranslateBusAddress@24
|
||||
;IoAssignDriveLetters
|
||||
;IoFlushAdapterBuffers
|
||||
;IoFreeAdapterChannel
|
||||
|
@ -675,4 +675,3 @@ WRITE_PORT_ULONG=WRITE_PORT_ULONG@8
|
|||
WRITE_PORT_USHORT=WRITE_PORT_USHORT@8
|
||||
InsertTailList
|
||||
RemoveEntryList
|
||||
KeServiceDescriptorTable DATA
|
||||
|
|
Loading…
Reference in a new issue