Added system and isa bus handler

svn path=/trunk/; revision=1115
This commit is contained in:
Eric Kohl 2000-04-09 15:58:13 +00:00
parent db593a0fb7
commit 5b7a3113d5
11 changed files with 189 additions and 106 deletions

View file

@ -80,17 +80,11 @@ VOID HalResetDisplay (VOID);
VOID
HalpInitBusHandlers (VOID);
ULONG
STDCALL
HalpGetSystemInterruptVector (
PVOID BusHandler,
ULONG BusNumber,
ULONG BusInterruptLevel,
ULONG BusInterruptVector,
PKIRQL Irql,
PKAFFINITY Affinity
);
/* udelay.c */
VOID HalpCalibrateStallExecution(VOID);
/* irq.c */
VOID HalpInitIRQs (VOID);
#endif /* __INTERNAL_HAL_HAL_H */

View file

@ -38,11 +38,9 @@ VOID KeRemoveAllWaitsThread(PETHREAD Thread, NTSTATUS WaitStatus);
/* INITIALIZATION FUNCTIONS *************************************************/
VOID KeInitExceptions(VOID);
VOID KeInitIRQ(VOID);
VOID KeInitTimer(VOID);
VOID KeInitDpc(VOID);
VOID KeInitDispatcher(VOID);
VOID KeCalibrateTimerLoop(VOID);
VOID KeInitializeDispatcher(VOID);
VOID KeInitializeTimerImpl(VOID);
VOID KeInitializeBugCheck(VOID);

View file

@ -120,18 +120,20 @@ VOID Hal_bios32_probe()
* RETURNS: True if detected
*/
{
DbgPrint ("Hal_bios32_probe()\n");
return;
#if 0
int i;
for (i=0xe0000;i<=0xffff0;i++)
{
/// bios32* service_entry = (bios32 *)physical_to_linear(i);
bios32* service_entry = (bios32 *)physical_to_linear(i);
if ( service_entry->signature != BIOS32_SIGNATURE )
{
continue;
}
// DbgPrint("Signature detected at %x\n",i);
DbgPrint("Signature detected at %x\n",i);
if (!checksum(service_entry))
{
continue;

View file

@ -1,4 +1,4 @@
/* $Id: bus.c,v 1.4 2000/03/20 17:59:41 ekohl Exp $
/* $Id: bus.c,v 1.5 2000/04/09 15:58:13 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -24,6 +24,7 @@
/* TYPE DEFINITIONS *********************************************************/
struct _BUS_HANDLER;
typedef NTSTATUS (STDCALL *pAdjustResourceList) (
@ -87,6 +88,40 @@ typedef struct _BUS_HANDLER
} BUS_HANDLER, *PBUS_HANDLER;
/* sysbus.h */
ULONG
STDCALL
HalpGetSystemInterruptVector (
PVOID BusHandler,
ULONG BusNumber,
ULONG BusInterruptLevel,
ULONG BusInterruptVector,
PKIRQL Irql,
PKAFFINITY Affinity
);
BOOLEAN
STDCALL
HalpTranslateSystemBusAddress (
PBUS_HANDLER BusHandler,
ULONG BusNumber,
PHYSICAL_ADDRESS BusAddress,
PULONG AddressSpace,
PPHYSICAL_ADDRESS TranslatedAddress
);
/* isa.c */
BOOLEAN
STDCALL
HalpTranslateIsaBusAddress (
PBUS_HANDLER BusHandler,
ULONG BusNumber,
PHYSICAL_ADDRESS BusAddress,
PULONG AddressSpace,
PPHYSICAL_ADDRESS TranslatedAddress
);
/* GLOBAL VARIABLES **********************************************************/
KSPIN_LOCK HalpBusHandlerSpinLock = {0,};
@ -235,8 +270,8 @@ HalpInitBusHandlers (VOID)
0);
BusHandler->GetInterruptVector =
(pGetInterruptVector)HalpGetSystemInterruptVector;
// BusHandler->TranslateBusAddress =
// (pTranslateBusAddress)HalpTranslateSystemBusAddress;
BusHandler->TranslateBusAddress =
(pTranslateBusAddress)HalpTranslateSystemBusAddress;
/* cmos bus handler */
BusHandler = HalpAllocateBusHandler (InterfaceTypeUndefined,
@ -247,6 +282,14 @@ HalpInitBusHandlers (VOID)
// BusHandler->SetBusData =
// (pGetSetBusData)HalpSetCmosData;
/* isa bus handler */
BusHandler = HalpAllocateBusHandler (Isa,
ConfigurationSpaceUndefined,
0);
BusHandler->TranslateBusAddress =
(pTranslateBusAddress)HalpTranslateIsaBusAddress;
#if 0
/* pci bus handler */
BusHandler = HalpAllocateBusHandler (PCIBus,
PCIConfiguration,
@ -261,13 +304,7 @@ HalpInitBusHandlers (VOID)
// (pGetSetBusData)HalpAdjustPciResourceList;
// BusHandler->AssignSlotResources =
// (pGetSetBusData)HalpAssignPciSlotResources;
/* isa bus handler */
BusHandler = HalpAllocateBusHandler (Isa,
ConfigurationSpaceUndefined,
0);
// BusHandler->TranslateBusAddress =
// (pTranslateBusAddress)HalpTranslateIsaBusAddress;
#endif
}

View file

@ -1,4 +1,4 @@
/* $Id: halinit.c,v 1.10 2000/04/08 19:08:50 ekohl Exp $
/* $Id: halinit.c,v 1.11 2000/04/09 15:58:13 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -32,30 +32,14 @@ HalInitSystem (
{
HalInitializeDisplay (bp);
HalpCalibrateStallExecution ();
KeInitExceptions();
KeInitIRQ();
KeInitExceptions ();
HalpInitIRQs ();
KeLowerIrql(DISPATCH_LEVEL);
}
else
{
HalpInitBusHandlers ();
/*
* Probe for a BIOS32 extension
*/
Hal_bios32_probe();
/*
* Probe for buses attached to the computer
* NOTE: Order is important here because ISA is the default
*/
#if 0
if (HalPciProbe())
{
return TRUE;
}
HalIsaProbe();
#endif
}
return TRUE;

View file

@ -1,4 +1,4 @@
/* $Id: irq.c,v 1.10 2000/03/26 19:38:18 ea Exp $
/* $Id: irq.c,v 1.11 2000/04/09 15:58:13 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -6,7 +6,7 @@
* PURPOSE: IRQ handling
* PROGRAMMER: David Welch (welch@mcmail.com)
* UPDATE HISTORY:
* 29/05/98: Created
* 29/05/98: Created
*/
/*
@ -187,11 +187,11 @@ asmlinkage VOID KiInterruptDispatch(ULONG irq)
// DbgPrint("}");
}
void KeInitIRQ(void)
VOID HalpInitIRQs (VOID)
{
int i;
DPRINT("KeInitIrq()\n",0);
DPRINT("HalpInitIRQs ()\n",0);
/*
* First mask off all interrupts from pic
@ -370,50 +370,27 @@ IoDisconnectInterrupt(PKINTERRUPT InterruptObject)
KeLowerIrql(oldlvl);
}
#if 0
ULONG
STDCALL
HalpGetSystemInterruptVector(PVOID BusHandler,
ULONG BusNumber,
ULONG BusInterruptLevel,
ULONG BusInterruptVector,
PKIRQL Irql,
PKAFFINITY Affinity)
/*
* FUNCTION: Returns a mapped system interrupt vector for passing to
* IoConnectInterrupt
* ARGUMENTS:
* InterfaceType = Type bus the device is on
* BusNumber = Zero based number of the bus
* BusInterruptLevel = Bus specific interrupt level
* BusInterruptVector = Bus specific interrupt vector
* Irql (IN/OUT) = On entry the bus relative IRQL
* On exit the DIRQL
* Affinity (OUT) = Caller supplied storage for the interrupt
* affinity mask
* RETURNS: The mapped vector
*/
HalDisableSystemInterrupt (
ULONG Unknown0,
ULONG Unknown1
)
{
ULONG ret;
// ASSERT_IRQL(PASSIVE_LEVEL);
#if 0
switch (InterfaceType)
{
case Internal:
#endif
*Irql = HIGH_LEVEL - BusInterruptVector;
ret = BusInterruptVector;
#if 0
break;
default:
ret = -1;
DbgPrint("(%s:%d) Don't know that bus type\n",__FILE__,__LINE__);
break;
}
#endif
return(ret);
}
ULONG
STDCALL
HalEnableSystemInterrupt (
ULONG Unknown0,
ULONG Unknown1,
ULONG Unknown2
)
{
}
#endif
/* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: isa.c,v 1.5 2000/03/20 17:59:42 ekohl Exp $
/* $Id: isa.c,v 1.6 2000/04/09 15:58:13 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -13,6 +13,10 @@
#include <ddk/ntddk.h>
typedef struct _BUS_HANDLER *PBUS_HANDLER;
/* FUNCTIONS *****************************************************************/
BOOL HalIsaProbe(VOID)
@ -31,7 +35,7 @@ BOOL HalIsaProbe(VOID)
return(TRUE);
}
#if 0
BOOLEAN
STDCALL
HalpTranslateIsaBusAddress (
@ -44,19 +48,16 @@ HalpTranslateIsaBusAddress (
{
BOOLEAN Result;
Result = HalpTranslateSystemBusAddress (BusHandler,
BusNumber,
BusAddress,
AddressSpace,
TranslatedAddress);
Result = HalTranslateBusAddress (PCIBus,
BusNumber,
BusAddress,
AddressSpace,
TranslatedAddress);
if (Result != FALSE)
return Result;
/* PCI does not provide memory address space */
if (*AddressSpace == 0)
return Result;
Result = HalTranslateBusAddress (PCIBus,
Result = HalTranslateBusAddress (Internal,
BusNumber,
BusAddress,
AddressSpace,
@ -64,6 +65,5 @@ HalpTranslateIsaBusAddress (
return Result;
}
#endif
/* EOF */

View file

@ -1,4 +1,4 @@
/* $Id: misc.c,v 1.3 2000/04/08 19:08:50 ekohl Exp $
/* $Id: misc.c,v 1.4 2000/04/09 15:58:13 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -71,9 +71,26 @@ HalReportResourceUsage (
{
/*
* FIXME: Report all resources used by hal.
Calls IoReportHalResourceUsage()
* Calls IoReportHalResourceUsage()
*/
/*
* Initialize PCI, IsaPnP and other busses.
*/
#if 0
/*
* Probe for a BIOS32 extension
*/
Hal_bios32_probe();
/*
* Probe for buses attached to the computer
*/
HalPciProbe();
#endif
return;
}

View file

@ -5,4 +5,5 @@ HAL_OBJECTS = hal/x86/irq.o hal/x86/isa.o \
hal/x86/sysinfo.o hal/x86/time.o hal/x86/beep.o \
hal/x86/display.o hal/x86/reboot.o hal/x86/kdbg.o \
hal/x86/portio.o hal/x86/misc.o hal/x86/parttab.o \
hal/x86/adapter.o hal/x86/drive.o hal/x86/udelay.o
hal/x86/adapter.o hal/x86/drive.o hal/x86/udelay.o \
hal/x86/sysbus.o

View file

@ -0,0 +1,71 @@
/* $Id: sysbus.c,v 1.1 2000/04/09 15:58:13 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/hal/sysbus.c
* PURPOSE: System bus handler functions
* PROGRAMMER: Eric Kohl (ekohl@rz-online.de)
* UPDATE HISTORY:
* 09/04/2000 Created
*/
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
typedef struct _BUS_HANDLER *PBUS_HANDLER;
/* FUNCTIONS ****************************************************************/
ULONG
STDCALL
HalpGetSystemInterruptVector (
PVOID BusHandler,
ULONG BusNumber,
ULONG BusInterruptLevel,
ULONG BusInterruptVector,
PKIRQL Irql,
PKAFFINITY Affinity
)
{
*Irql = HIGH_LEVEL - BusInterruptVector;
return BusInterruptVector;
}
BOOLEAN
STDCALL
HalpTranslateSystemBusAddress (
PBUS_HANDLER BusHandler,
ULONG BusNumber,
PHYSICAL_ADDRESS BusAddress,
PULONG AddressSpace,
PPHYSICAL_ADDRESS TranslatedAddress
)
{
ULONG BaseAddress = 0;
if (*AddressSpace == 0)
{
/* memory space */
}
else if (*AddressSpace == 1)
{
/* io space */
}
else
{
/* other */
return FALSE;
}
TranslatedAddress->QuadPart = BusAddress.QuadPart + BaseAddress;
return TRUE;
}
/* EOF */

View file

@ -1,4 +1,6 @@
/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/hal/x86/time.c
* PURPOSE: Getting time information
* UPDATE HISTORY: