diff --git a/reactos/include/internal/i386/hal.h b/reactos/include/internal/i386/hal.h index 82b8473f012..a7b2d5416b5 100644 --- a/reactos/include/internal/i386/hal.h +++ b/reactos/include/internal/i386/hal.h @@ -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 */ diff --git a/reactos/include/internal/ke.h b/reactos/include/internal/ke.h index 6cda198de8d..9c7e6a52e77 100644 --- a/reactos/include/internal/ke.h +++ b/reactos/include/internal/ke.h @@ -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); diff --git a/reactos/ntoskrnl/hal/x86/bios32.c b/reactos/ntoskrnl/hal/x86/bios32.c index ee0f5615f38..a449ed3d67c 100644 --- a/reactos/ntoskrnl/hal/x86/bios32.c +++ b/reactos/ntoskrnl/hal/x86/bios32.c @@ -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; diff --git a/reactos/ntoskrnl/hal/x86/bus.c b/reactos/ntoskrnl/hal/x86/bus.c index 4625b814613..c3a3c6b443b 100644 --- a/reactos/ntoskrnl/hal/x86/bus.c +++ b/reactos/ntoskrnl/hal/x86/bus.c @@ -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 } diff --git a/reactos/ntoskrnl/hal/x86/halinit.c b/reactos/ntoskrnl/hal/x86/halinit.c index b9116702135..bd60ef64b55 100644 --- a/reactos/ntoskrnl/hal/x86/halinit.c +++ b/reactos/ntoskrnl/hal/x86/halinit.c @@ -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; diff --git a/reactos/ntoskrnl/hal/x86/irq.c b/reactos/ntoskrnl/hal/x86/irq.c index 7fa616df518..aeb180860fe 100644 --- a/reactos/ntoskrnl/hal/x86/irq.c +++ b/reactos/ntoskrnl/hal/x86/irq.c @@ -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 */ diff --git a/reactos/ntoskrnl/hal/x86/isa.c b/reactos/ntoskrnl/hal/x86/isa.c index 8428f6ef08d..bdba17544af 100644 --- a/reactos/ntoskrnl/hal/x86/isa.c +++ b/reactos/ntoskrnl/hal/x86/isa.c @@ -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 + +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 */ diff --git a/reactos/ntoskrnl/hal/x86/misc.c b/reactos/ntoskrnl/hal/x86/misc.c index 318a81db279..c8c66796fff 100644 --- a/reactos/ntoskrnl/hal/x86/misc.c +++ b/reactos/ntoskrnl/hal/x86/misc.c @@ -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; } diff --git a/reactos/ntoskrnl/hal/x86/sources b/reactos/ntoskrnl/hal/x86/sources index abb46bfe702..998d4abf643 100644 --- a/reactos/ntoskrnl/hal/x86/sources +++ b/reactos/ntoskrnl/hal/x86/sources @@ -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 diff --git a/reactos/ntoskrnl/hal/x86/sysbus.c b/reactos/ntoskrnl/hal/x86/sysbus.c new file mode 100644 index 00000000000..38290b43be2 --- /dev/null +++ b/reactos/ntoskrnl/hal/x86/sysbus.c @@ -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 + + +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 */ diff --git a/reactos/ntoskrnl/hal/x86/time.c b/reactos/ntoskrnl/hal/x86/time.c index 4262b52069c..f7707e738ea 100644 --- a/reactos/ntoskrnl/hal/x86/time.c +++ b/reactos/ntoskrnl/hal/x86/time.c @@ -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: