- The last piece of the puzzle: we had to initialize the IDR in HalInitProcessor to set it to the default of 0xFFFFFFB so that we don't get IRQ 0 and IRQ 1 until we're ready to handle them, which was causing the clock interrupt to be called too early.

- Remove irqhand.S and all other remaining pieces of deprecated code.

svn path=/trunk/; revision=23695
This commit is contained in:
Alex Ionescu 2006-08-25 00:30:26 +00:00
parent 5d9935a1fa
commit 425592dd06
7 changed files with 8 additions and 76 deletions

View file

@ -25,6 +25,9 @@ HalInitializeProcessor(ULONG ProcessorNumber,
PLOADER_PARAMETER_BLOCK LoaderBlock)
{
DPRINT("HalInitializeProcessor(%lu %p)\n", ProcessorNumber, LoaderBlock);
/* Set default IDR */
KeGetPcr()->IDR = 0xFFFFFFFB;
KeGetPcr()->StallScaleFactor = INITIAL_STALL_COUNT;
}
BOOLEAN STDCALL

View file

@ -95,6 +95,11 @@ Author:
#define IPI_PACKET_READY 8
#define IPI_SYNCH_REQUEST 16
//
// HAL Variables
//
#define INITIAL_STALL_COUNT 0x64
//
// Static Kernel-Mode Address start (use MM_KSEG0_BASE for actual)
//

View file

@ -78,7 +78,6 @@ KiInitializeSystemClock(VOID)
{
TIME_FIELDS TimeFields;
DPRINT1("KiInitializeSystemClock()\n");
InitializeListHead(&KiTimerListHead);
KeInitializeDpc(&KiExpireTimerDpc, (PKDEFERRED_ROUTINE)KiExpireTimers, 0);
@ -95,9 +94,6 @@ KiInitializeSystemClock(VOID)
SharedUserData->SystemTime.High2Time = SystemBootTime.u.HighPart;
SharedUserData->SystemTime.LowPart = SystemBootTime.u.LowPart;
SharedUserData->SystemTime.High1Time = SystemBootTime.u.HighPart;
KiClockSetupComplete = TRUE;
DPRINT1("Finished KiInitializeSystemClock()\n");
}
VOID

View file

@ -15,21 +15,6 @@
#define NDEBUG
#include <debug.h>
/* DEPRECATED FUNCTIONS ******************************************************/
void irq_handler_0(void);
extern IDT_DESCRIPTOR KiIdt[256];
VOID
INIT_FUNCTION
NTAPI
KeInitInterrupts (VOID)
{
KiIdt[0x30].a=((ULONG)irq_handler_0&0xffff)+(KGDT_R0_CODE<<16);
KiIdt[0x30].b=((ULONG)irq_handler_0&0xffff0000)+0x8000+
0xe00;
}
/* PRIVATE FUNCTIONS *********************************************************/
VOID

View file

@ -1,55 +0,0 @@
/*
* FILE: ntoskrnl/ke/i386/clock.S
* COPYRIGHT: See COPYING in the top level directory
* PURPOSE: System Clock Management
* PROGRAMMER: Alex Ionescu (alex@relsoft.net)
*/
/* INCLUDES ******************************************************************/
#include <asm.h>
#include <internal/i386/asmmacro.S>
.intel_syntax noprefix
/* GLOBALS *******************************************************************/
#include <ndk/asm.h>
#include <../hal/halx86/include/halirq.h>
.global _irq_handler_0
_irq_handler_0:
pusha
cld
push ds
push es
push fs
push gs
push 0xCEAFBEEF
mov eax, KGDT_R0_DATA
mov ds, eax
mov es, eax
mov gs, eax
mov eax, KGDT_R0_PCR
mov fs, eax
/* Increase interrupt count */
inc dword ptr [fs:KPCR_PRCB_INTERRUPT_COUNT]
/* Put vector in EBX and make space for KIRQL */
sub esp, 4
/* Begin interrupt */
push esp
push 0x30
push HIGH_LEVEL
call _HalBeginSystemInterrupt@12
cli
call _HalEndSystemInterrupt@8
pop gs
pop fs
pop es
pop ds
popa
iret

View file

@ -380,7 +380,6 @@ KeInit1(PCHAR CommandLine, PULONG LastKernelAddress)
InitializeListHead(&KPCR->PrcbData.WaitListHead);
KeInitExceptions ();
KeInitInterrupts ();
KeActiveProcessors |= 1 << 0;

View file

@ -34,7 +34,6 @@
<file>fpu.c</file>
<file>gdt.c</file>
<file>irq.c</file>
<file>irqhand.s</file>
<file>kernel.c</file>
<file>ldt.c</file>
<file>thread.c</file>