ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
August 2006
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
19 participants
447 discussions
Start a n
N
ew thread
[ion] 23678: - Write a basic Clock Interrupt handler in the HAL (doesn't deal with changing increments yet, just like current ROS). It will call KeUpdateSystemTime once ready. - Implement KeDisconnectInterrupt with the new implementation. - Put Clock Interrupt initialization in the right place (might still be too late: must investigate more). - Added a debug print when unexpected interrupts are called, just noticed this happens on my checked machine, and it's a useful tracing tool.
by ion@svn.reactos.org
Author: ion Date: Thu Aug 24 09:36:50 2006 New Revision: 23678 URL:
http://svn.reactos.org/svn/reactos?rev=23678&view=rev
Log: - Write a basic Clock Interrupt handler in the HAL (doesn't deal with changing increments yet, just like current ROS). It will call KeUpdateSystemTime once ready. - Implement KeDisconnectInterrupt with the new implementation. - Put Clock Interrupt initialization in the right place (might still be too late: must investigate more). - Added a debug print when unexpected interrupts are called, just noticed this happens on my checked machine, and it's a useful tracing tool. Modified: trunk/reactos/hal/halx86/generic/halinit.c trunk/reactos/hal/halx86/generic/systimer.S trunk/reactos/hal/halx86/up/halinit_up.c trunk/reactos/ntoskrnl/ke/clock.c trunk/reactos/ntoskrnl/ke/i386/irq.c trunk/reactos/ntoskrnl/ke/i386/trap.s Modified: trunk/reactos/hal/halx86/generic/halinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/halinit…
============================================================================== --- trunk/reactos/hal/halx86/generic/halinit.c (original) +++ trunk/reactos/hal/halx86/generic/halinit.c Thu Aug 24 09:36:50 2006 @@ -19,6 +19,7 @@ PVOID HalpZeroPageMapping = NULL; HALP_HOOKS HalpHooks; +VOID NTAPI HalpClockInterrupt(VOID); /* FUNCTIONS ***************************************************************/ @@ -31,6 +32,10 @@ return STATUS_SUCCESS; } +#define MAKEULONG(x, y) \ + (((((ULONG)(x))<<16) & 0xffff0000) | \ + ((ULONG)(y) & 0xffff)) + BOOLEAN STDCALL HalInitSystem (ULONG BootPhase, PLOADER_PARAMETER_BLOCK LoaderBlock) @@ -42,6 +47,14 @@ } else if (BootPhase == 1) { +#if 0 + /* Enable the clock interrupt */ + ((PKIPCR)KeGetPcr())->IDT[IRQ2VECTOR(0)].ExtendedOffset = + (USHORT)(((ULONG_PTR)HalpClockInterrupt >> 16) & 0xFFFF); + ((PKIPCR)KeGetPcr())->IDT[IRQ2VECTOR(0)].Offset = + (USHORT)HalpClockInterrupt; + HalEnableSystemInterrupt(IRQ2VECTOR(0), CLOCK2_LEVEL, Latched); +#endif /* Initialize display and make the screen black */ HalInitializeDisplay ((PROS_LOADER_PARAMETER_BLOCK)LoaderBlock); HalpInitBusHandlers(); Modified: trunk/reactos/hal/halx86/generic/systimer.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/systime…
============================================================================== --- trunk/reactos/hal/halx86/generic/systimer.S (original) +++ trunk/reactos/hal/halx86/generic/systimer.S Thu Aug 24 09:36:50 2006 @@ -12,8 +12,7 @@ .intel_syntax noprefix .extern _Kei386EoiHelper@0 - -/* GLOBALS *******************************************************************/ +.extern _KeUpdateSystemTime@0 /* FUNCTIONS *****************************************************************/ @@ -21,6 +20,31 @@ .func HalpClockInterrupt@0 _HalpClockInterrupt@0: - jmp $ + /* Enter trap */ + INT_PROLOG Hci, DoPushFakeErrorCode + + /* Push vector and make stack for IRQL */ + push 0x30 + sub esp, 4 + + /* Begin the interrupt */ + push esp + push 0x30 + push CLOCK2_LEVEL + call _HalBeginSystemInterrupt@12 + + /* Check if it's spurious */ + or al, al + jz Spurious + + /* Do a tick */ + //jmp _KeUpdateSystemTime@0 + +Spurious: + + /* Exit the interrupt */ + add esp, 8 + mov esi, $ + jmp _Kei386EoiHelper@0 .endfunc Modified: trunk/reactos/hal/halx86/up/halinit_up.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/up/halinit_up.c…
============================================================================== --- trunk/reactos/hal/halx86/up/halinit_up.c (original) +++ trunk/reactos/hal/halx86/up/halinit_up.c Thu Aug 24 09:36:50 2006 @@ -15,8 +15,6 @@ #define NDEBUG #include <debug.h> -VOID NTAPI HalpClockInterrupt(VOID); - /* FUNCTIONS ***************************************************************/ VOID @@ -24,15 +22,6 @@ { HalpInitPICs(); - /* Enable the clock interrupt */ -#if 0 - ((PKIPCR)KeGetPcr())->IDT[IRQ2VECTOR(0)].ExtendedOffset = - (USHORT)(((ULONG_PTR)HalpClockInterrupt >> 16) & 0xFFFF); - ((PKIPCR)KeGetPcr())->IDT[IRQ2VECTOR(0)].Offset = - (USHORT)HalpClockInterrupt; -#endif - HalEnableSystemInterrupt(IRQ2VECTOR(0), CLOCK2_LEVEL, Latched); - /* Setup busy waiting */ HalpCalibrateStallExecution(); } Modified: trunk/reactos/ntoskrnl/ke/clock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/clock.c?rev=23…
============================================================================== --- trunk/reactos/ntoskrnl/ke/clock.c (original) +++ trunk/reactos/ntoskrnl/ke/clock.c Thu Aug 24 09:36:50 2006 @@ -37,7 +37,7 @@ CHAR KiTimerSystemAuditing = 0; static KDPC KiExpireTimerDpc; -static BOOLEAN KiClockSetupComplete = FALSE; +BOOLEAN KiClockSetupComplete = FALSE; extern ULONG KiMaximumDpcQueueDepth; extern ULONG KiMinimumDpcRate; Modified: trunk/reactos/ntoskrnl/ke/i386/irq.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/irq.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/irq.c (original) +++ trunk/reactos/ntoskrnl/ke/i386/irq.c Thu Aug 24 09:36:50 2006 @@ -65,15 +65,10 @@ NTAPI KiChainedDispatch(VOID); - -/* GLOBALS *****************************************************************/ +/* DEPRECATED FUNCTIONS ******************************************************/ void irq_handler_0(void); - extern IDT_DESCRIPTOR KiIdt[256]; - -/* FUNCTIONS ****************************************************************/ - #define PRESENT (0x8000) #define I486_INTERRUPT_GATE (0xe00) @@ -168,6 +163,8 @@ HalEndSystemInterrupt (old_level, 0); } +/* PRIVATE FUNCTIONS *********************************************************/ + VOID NTAPI KiGetVectorDispatch(IN ULONG Vector, @@ -274,6 +271,8 @@ ((PKIPCR)KeGetPcr())->IDT[Interrupt->Vector].Offset = (USHORT)PtrToUlong(Handler); } + +/* PUBLIC FUNCTIONS **********************************************************/ /* * @implemented @@ -430,65 +429,84 @@ /* * @implemented - * - * FUNCTION: Releases a drivers isr - * ARGUMENTS: - * InterruptObject = isr to release */ -BOOLEAN +BOOLEAN STDCALL -KeDisconnectInterrupt(PKINTERRUPT InterruptObject) -{ -#if 0 - KIRQL oldlvl,synch_oldlvl; - PISR_TABLE CurrentIsr; +KeDisconnectInterrupt(PKINTERRUPT Interrupt) +{ + KIRQL OldIrql, Irql; + ULONG Vector; + DISPATCH_INFO Dispatch; + PKINTERRUPT NextInterrupt; BOOLEAN State; - DPRINT1("KeDisconnectInterrupt\n"); - ASSERT (InterruptObject->Number < KeNumberProcessors); - /* Set the affinity */ - KeSetSystemAffinityThread(1 << InterruptObject->Number); - - /* Get the ISR Tabe */ - CurrentIsr = &IsrTable[InterruptObject->Vector - IRQ_BASE] - [(ULONG)InterruptObject->Number]; - - /* Raise IRQL to required level and lock table */ - KeRaiseIrql(VECTOR2IRQL(InterruptObject->Vector),&oldlvl); - KiAcquireSpinLock(&CurrentIsr->Lock); + KeSetSystemAffinityThread(1 << Interrupt->Number); + + /* Lock the dispatcher */ + OldIrql = KeAcquireDispatcherDatabaseLock(); /* Check if it's actually connected */ - if ((State = InterruptObject->Connected)) - { - /* Lock the Interrupt */ - synch_oldlvl = KeAcquireInterruptSpinLock(InterruptObject); - - /* Remove this one, and check if all are gone */ - RemoveEntryList(&InterruptObject->InterruptListEntry); - if (IsListEmpty(&CurrentIsr->ListHead)) - { - /* Completely Disable the Interrupt */ - HalDisableSystemInterrupt(InterruptObject->Vector, InterruptObject->Irql); - } - + State = Interrupt->Connected; + if (State) + { + /* Get the vector and IRQL */ + Irql = Interrupt->Irql; + Vector = Interrupt->Vector; + + /* Get vector dispatch data */ + KiGetVectorDispatch(Vector, &Dispatch); + + /* Check if it was chained */ + if (Dispatch.Type == ChainConnect) + { + /* Check if the top-level interrupt is being removed */ + ASSERT(Irql <= SYNCH_LEVEL); + if (Interrupt == Dispatch.Interrupt) + { + /* Get the next one */ + Dispatch.Interrupt = CONTAINING_RECORD(Dispatch.Interrupt-> + InterruptListEntry.Flink, + KINTERRUPT, + InterruptListEntry); + + /* Reconnect it */ + KiConnectVectorToInterrupt(Dispatch.Interrupt, ChainConnect); + } + + /* Remove it */ + RemoveEntryList(&Interrupt->InterruptListEntry); + + /* Get the next one */ + NextInterrupt = CONTAINING_RECORD(Dispatch.Interrupt-> + InterruptListEntry.Flink, + KINTERRUPT, + InterruptListEntry); + + /* Check if this is the only one left */ + if (Dispatch.Interrupt == NextInterrupt) + { + /* Connect it in non-chained mode */ + KiConnectVectorToInterrupt(Dispatch.Interrupt, NormalConnect); + } + } + else + { + /* Only one left, disable and remove it */ + HalDisableSystemInterrupt(Interrupt->Vector, Irql); + KiConnectVectorToInterrupt(Interrupt, NoConnect); + } + /* Disconnect it */ - InterruptObject->Connected = FALSE; - - /* Release the interrupt lock */ - KeReleaseInterruptSpinLock(InterruptObject, synch_oldlvl); - } - /* Release the table spinlock */ - KiReleaseSpinLock(&CurrentIsr->Lock); - KeLowerIrql(oldlvl); - - /* Go back to default affinity */ + Interrupt->Connected = FALSE; + } + + /* Unlock the dispatcher and revert affinity */ + KeReleaseDispatcherDatabaseLock(OldIrql); KeRevertToUserAffinityThread(); - - /* Return Old Interrupt State */ + + /* Return to caller */ return State; -#endif - return 0; } /* EOF */ Modified: trunk/reactos/ntoskrnl/ke/i386/trap.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/trap.s?re…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/trap.s (original) +++ trunk/reactos/ntoskrnl/ke/i386/trap.s Thu Aug 24 09:36:50 2006 @@ -81,6 +81,9 @@ _KiUnexpectedEntrySize: .long _KiUnexpectedInterrupt1 - _KiUnexpectedInterrupt0 +_UnexpectedMsg: + .asciz "\n\x7\x7!!! Unexpected Interrupt %02lx !!!\n" + /* SOFTWARE INTERRUPT SERVICES ***********************************************/ _KiGetTickCount: @@ -1348,76 +1351,13 @@ jmp _Kei386EoiHelper2ndEntry Handled: - /* Unexpected, exit the interrupt */ - mov esi, $ - cli - call _HalEndSystemInterrupt@8 - jmp _Kei386EoiHelper@0 -.endfunc - -.globl _KiUnexpectedInterrupt -_KiUnexpectedInterrupt: - - /* Bugcheck with invalid interrupt code */ - push 0x12 - call _KeBugCheck@4 - -/* INTERRUPT HANDLERS ********************************************************/ - -.func KiInterruptTemplate -_KiInterruptTemplate: - - /* Enter interrupt trap */ - INT_PROLOG kit, DoPushFakeErrorCode -.endfunc - -_KiInterruptTemplate2ndDispatch: - /* Dummy code, will be replaced by the address of the KINTERRUPT */ - mov edi, 0 - -_KiInterruptTemplateObject: - /* Dummy jump, will be replaced by the actual jump */ - jmp _KeSynchronizeExecution@12 - -_KiInterruptTemplateDispatch: - /* Marks the end of the template so that the jump above can be edited */ - -.func KiChainedDispatch2ndLvl@0 -_KiChainedDispatch2ndLvl@0: - - /* Not yet supported */ - int 3 -.endfunc - -.func KiChainedDispatch@0 -_KiChainedDispatch@0: - - /* Increase interrupt count */ - inc dword ptr [fs:KPCR_PRCB_INTERRUPT_COUNT] - - /* Save trap frame */ - mov ebp, esp - - /* Save vector and IRQL */ - mov eax, [edi+KINTERRUPT_VECTOR] - mov ecx, [edi+KINTERRUPT_IRQL] - - /* Save old irql */ - push eax - sub esp, 4 - - /* Begin interrupt */ - push eax - push ecx - call _HalBeginSystemInterrupt@12 - - /* Check if it was handled */ - or eax, eax - jz SpuriousInt - sub esp, 12 - - /* Call the 2nd-level handler */ - call _KiChainedDispatch2ndLvl@0 + /* Unexpected interrupt, print a message on debug builds */ +#if DBG + push [esp+4] + push offset _UnexpectedMsg + call _DbgPrint + add esp, 8 +#endif /* Exit the interrupt */ mov esi, $ @@ -1426,6 +1366,77 @@ jmp _Kei386EoiHelper@0 .endfunc +.globl _KiUnexpectedInterrupt +_KiUnexpectedInterrupt: + + /* Bugcheck with invalid interrupt code */ + push 0x12 + call _KeBugCheck@4 + +/* INTERRUPT HANDLERS ********************************************************/ + +.func KiInterruptTemplate +_KiInterruptTemplate: + + /* Enter interrupt trap */ + INT_PROLOG kit, DoPushFakeErrorCode +.endfunc + +_KiInterruptTemplate2ndDispatch: + /* Dummy code, will be replaced by the address of the KINTERRUPT */ + mov edi, 0 + +_KiInterruptTemplateObject: + /* Dummy jump, will be replaced by the actual jump */ + jmp _KeSynchronizeExecution@12 + +_KiInterruptTemplateDispatch: + /* Marks the end of the template so that the jump above can be edited */ + +.func KiChainedDispatch2ndLvl@0 +_KiChainedDispatch2ndLvl@0: + + /* Not yet supported */ + int 3 +.endfunc + +.func KiChainedDispatch@0 +_KiChainedDispatch@0: + + /* Increase interrupt count */ + inc dword ptr [fs:KPCR_PRCB_INTERRUPT_COUNT] + + /* Save trap frame */ + mov ebp, esp + + /* Save vector and IRQL */ + mov eax, [edi+KINTERRUPT_VECTOR] + mov ecx, [edi+KINTERRUPT_IRQL] + + /* Save old irql */ + push eax + sub esp, 4 + + /* Begin interrupt */ + push eax + push ecx + call _HalBeginSystemInterrupt@12 + + /* Check if it was handled */ + or eax, eax + jz SpuriousInt + sub esp, 12 + + /* Call the 2nd-level handler */ + call _KiChainedDispatch2ndLvl@0 + + /* Exit the interrupt */ + mov esi, $ + cli + call _HalEndSystemInterrupt@8 + jmp _Kei386EoiHelper@0 +.endfunc + .func KiInterruptDispatch3@0 _KiInterruptDispatch3@0:
18 years, 4 months
1
0
0
0
[ion] 23677: - Completely re-implement IRQ support (KeInitialize/Connect/Disconnect) interrupt using the same model as NT. Implementation was done by analyzing various of my systems at runtime with WinDBG and tracing through some of the code and dumping relevant objects. - Uses new code added to trap.s for generic dispatching, as well as the NT implementation which copies a "template" into the ->DispatchCode array of every KINTERRUPT object. - Also adds support for chained interrupts, but this h
by ion@svn.reactos.org
Author: ion Date: Thu Aug 24 06:53:40 2006 New Revision: 23677 URL:
http://svn.reactos.org/svn/reactos?rev=23677&view=rev
Log: - Completely re-implement IRQ support (KeInitialize/Connect/Disconnect) interrupt using the same model as NT. Implementation was done by analyzing various of my systems at runtime with WinDBG and tracing through some of the code and dumping relevant objects. - Uses new code added to trap.s for generic dispatching, as well as the NT implementation which copies a "template" into the ->DispatchCode array of every KINTERRUPT object. - Also adds support for chained interrupts, but this hasn't been tested yet. Floating interrupts are not supported on NT it seems, so I haven't implemented those at all. - KiDisableInterrupt not yet re-implemented, and timer code is still piggybacked on the old implementation. Modified: trunk/reactos/hal/halx86/generic/irq.S trunk/reactos/ntoskrnl/ke/i386/irq.c Modified: trunk/reactos/hal/halx86/generic/irq.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/irq.S?r…
============================================================================== --- trunk/reactos/hal/halx86/generic/irq.S (original) +++ trunk/reactos/hal/halx86/generic/irq.S Thu Aug 24 06:53:40 2006 @@ -291,7 +291,7 @@ .func HalBeginSystemInterrupt@12 _HalBeginSystemInterrupt@12: - /* Convert to vector and call the handler */ + /* Convert to IRQ and call the handler */ mov edx, [esp+8] sub edx, PRIMARY_VECTOR_BASE jmp HalpSysIntHandler[edx*4] Modified: trunk/reactos/ntoskrnl/ke/i386/irq.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/irq.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/irq.c (original) +++ trunk/reactos/ntoskrnl/ke/i386/irq.c Thu Aug 24 06:53:40 2006 @@ -24,116 +24,52 @@ #define NDEBUG #include <internal/debug.h> +typedef enum _CONNECT_TYPE +{ + NoConnect, + NormalConnect, + ChainConnect, + UnknownConnect +} CONNECT_TYPE, *PCONNECT_TYPE; + +typedef struct _DISPATCH_INFO +{ + CONNECT_TYPE Type; + PKINTERRUPT Interrupt; + PKINTERRUPT_ROUTINE NoDispatch; + PKINTERRUPT_ROUTINE InterruptDispatch; + PKINTERRUPT_ROUTINE FloatingDispatch; + PKINTERRUPT_ROUTINE ChainedDispatch; + PKINTERRUPT_ROUTINE *FlatDispatch; +} DISPATCH_INFO, *PDISPATCH_INFO; + extern ULONG KiInterruptTemplate[KINTERRUPT_DISPATCH_CODES]; extern PULONG KiInterruptTemplateObject; +extern PULONG KiInterruptTemplateDispatch; +extern PULONG KiInterruptTemplate2ndDispatch; +extern ULONG KiUnexpectedEntrySize; + +VOID +NTAPI +KiStartUnexpectedRange(VOID); + +VOID +NTAPI +KiEndUnexpectedRange(VOID); + +VOID +NTAPI +KiInterruptDispatch3(VOID); + +VOID +NTAPI +KiChainedDispatch(VOID); + /* GLOBALS *****************************************************************/ -/* Interrupt handler list */ - -#ifdef CONFIG_SMP - -#define INT_NAME2(intnum) KiUnexpectedInterrupt##intnum - -#define BUILD_INTERRUPT_HANDLER(intnum) \ -VOID INT_NAME2(intnum)(VOID); - -#define D(x,y) \ - BUILD_INTERRUPT_HANDLER(x##y) - -#define D16(x) \ - D(x,0) D(x,1) D(x,2) D(x,3) \ - D(x,4) D(x,5) D(x,6) D(x,7) \ - D(x,8) D(x,9) D(x,A) D(x,B) \ - D(x,C) D(x,D) D(x,E) D(x,F) - -D16(3) D16(4) D16(5) D16(6) -D16(7) D16(8) D16(9) D16(A) -D16(B) D16(C) D16(D) D16(E) -D16(F) - -#define L(x,y) \ - (ULONG)& INT_NAME2(x##y) - -#define L16(x) \ - L(x,0), L(x,1), L(x,2), L(x,3), \ - L(x,4), L(x,5), L(x,6), L(x,7), \ - L(x,8), L(x,9), L(x,A), L(x,B), \ - L(x,C), L(x,D), L(x,E), L(x,F) - -static ULONG irq_handler[ROUND_UP(NR_IRQS, 16)] = { - L16(3), L16(4), L16(5), L16(6), - L16(7), L16(8), L16(9), L16(A), - L16(B), L16(C), L16(D), L16(E) -}; - -#undef L -#undef L16 -#undef D -#undef D16 - -#else /* CONFIG_SMP */ - void irq_handler_0(void); -void irq_handler_1(void); -void irq_handler_2(void); -void irq_handler_3(void); -void irq_handler_4(void); -void irq_handler_5(void); -void irq_handler_6(void); -void irq_handler_7(void); -void irq_handler_8(void); -void irq_handler_9(void); -void irq_handler_10(void); -void irq_handler_11(void); -void irq_handler_12(void); -void irq_handler_13(void); -void irq_handler_14(void); -void irq_handler_15(void); - -unsigned int irq_handler[NR_IRQS]= -{ - (int)&irq_handler_0, - (int)&irq_handler_1, - (int)&irq_handler_2, - (int)&irq_handler_3, - (int)&irq_handler_4, - (int)&irq_handler_5, - (int)&irq_handler_6, - (int)&irq_handler_7, - (int)&irq_handler_8, - (int)&irq_handler_9, - (int)&irq_handler_10, - (int)&irq_handler_11, - (int)&irq_handler_12, - (int)&irq_handler_13, - (int)&irq_handler_14, - (int)&irq_handler_15, -}; - -#endif /* CONFIG_SMP */ - -/* - * PURPOSE: Object describing each isr - * NOTE: The data in this table is only modified at passsive level but can - * be accessed at any irq level. - */ - -typedef struct -{ - LIST_ENTRY ListHead; - KSPIN_LOCK Lock; - ULONG Count; -} -ISR_TABLE, *PISR_TABLE; - -#ifdef CONFIG_SMP -static ISR_TABLE IsrTable[NR_IRQS][MAXIMUM_PROCESSORS]; -#else -static ISR_TABLE IsrTable[NR_IRQS][1]; -#endif - -#define TAG_ISR_LOCK TAG('I', 'S', 'R', 'L') + extern IDT_DESCRIPTOR KiIdt[256]; /* FUNCTIONS ****************************************************************/ @@ -146,28 +82,10 @@ NTAPI KeInitInterrupts (VOID) { - int i, j; - - - /* - * Setup the IDT entries to point to the interrupt handlers - */ - for (i=0;i<NR_IRQS;i++) - { - KiIdt[IRQ_BASE+i].a=(irq_handler[i]&0xffff)+(KGDT_R0_CODE<<16); - KiIdt[IRQ_BASE+i].b=(irq_handler[i]&0xffff0000)+PRESENT+ + + KiIdt[IRQ_BASE].a=((ULONG)irq_handler_0&0xffff)+(KGDT_R0_CODE<<16); + KiIdt[IRQ_BASE].b=((ULONG)irq_handler_0&0xffff0000)+PRESENT+ I486_INTERRUPT_GATE; -#ifdef CONFIG_SMP - for (j = 0; j < MAXIMUM_PROCESSORS; j++) -#else - j = 0; -#endif - { - InitializeListHead(&IsrTable[i][j].ListHead); - KeInitializeSpinLock(&IsrTable[i][j].Lock); - IsrTable[i][j].Count = 0; - } - } } STATIC VOID @@ -191,47 +109,7 @@ TrapFrame->EFlags = IrqTrapFrame->Eflags; } -VOID STDCALL -KiInterruptDispatch2 (ULONG vector, KIRQL old_level) -/* - * FUNCTION: Calls all the interrupt handlers for a given irq. - * ARGUMENTS: - * vector - The number of the vector to call handlers for. - * old_level - The irql of the processor when the irq took place. - * NOTES: Must be called at DIRQL. - */ -{ - PKINTERRUPT isr; - PLIST_ENTRY current; - KIRQL oldlvl; - PISR_TABLE CurrentIsr; - - DPRINT("I(0x%.08x, 0x%.08x)\n", vector, old_level); - - /* - * Iterate the list until one of the isr tells us its device interrupted - */ - CurrentIsr = &IsrTable[vector - IRQ_BASE][(ULONG)KeGetCurrentProcessorNumber()]; - - KiAcquireSpinLock(&CurrentIsr->Lock); - - CurrentIsr->Count++; - current = CurrentIsr->ListHead.Flink; - - while (current != &CurrentIsr->ListHead) - { - isr = CONTAINING_RECORD(current,KINTERRUPT,InterruptListEntry); - oldlvl = KeAcquireInterruptSpinLock(isr); - if (isr->ServiceRoutine(isr, isr->ServiceContext)) - { - KeReleaseInterruptSpinLock(isr, oldlvl); - break; - } - KeReleaseInterruptSpinLock(isr, oldlvl); - current = current->Flink; - } - KiReleaseSpinLock(&CurrentIsr->Lock); -} +extern BOOLEAN KiClockSetupComplete; VOID KiInterruptDispatch (ULONG vector, PKIRQ_TRAPFRAME Trapframe) @@ -243,6 +121,17 @@ { KIRQL old_level; KTRAP_FRAME KernelTrapFrame; + ASSERT(vector == 0x30); +#if 0 + PULONG Frame; + DPRINT1("Received Interrupt: %lx\n", vector); + DPRINT1("My trap frame: %p\n", Trapframe); + DPRINT1("Stack trace\n"); + __asm__("mov %%ebp, %0" : "=r" (Frame) : ); + DPRINT1("Stack trace: %p %p %p %p\n", Frame, *Frame, Frame[1], *(PULONG)Frame[1]); + DPRINT1("Clock setup: %lx\n", KiClockSetupComplete); + if (KiClockSetupComplete) while(TRUE); +#endif /* * At this point we have interrupts disabled, nothing has been done to @@ -268,21 +157,9 @@ */ Ke386EnableInterrupts(); -#ifndef CONFIG_SMP - if (VECTOR2IRQ(vector) == 0) - { //DPRINT1("Tick\n"); KeIRQTrapFrameToTrapFrame(Trapframe, &KernelTrapFrame); KeUpdateSystemTime(&KernelTrapFrame, old_level); - } - else -#endif - { - /* - * Actually call the ISR. - */ - KiInterruptDispatch2(vector, old_level); - } /* * End the system interrupt. @@ -291,135 +168,111 @@ HalEndSystemInterrupt (old_level, 0); } -/* - * @implemented - */ -BOOLEAN -STDCALL -KeConnectInterrupt(PKINTERRUPT InterruptObject) -{ - KIRQL oldlvl,synch_oldlvl; - PKINTERRUPT ListHead; - ULONG Vector; - PISR_TABLE CurrentIsr; - BOOLEAN Result; - - - Vector = InterruptObject->Vector; - DPRINT1("KeConnectInterrupt(): %lx\n", Vector); - - if (Vector < IRQ_BASE || Vector >= IRQ_BASE + NR_IRQS) - return FALSE; - - Vector -= IRQ_BASE; - - ASSERT (InterruptObject->Number < KeNumberProcessors); - - KeSetSystemAffinityThread(1 << InterruptObject->Number); - - CurrentIsr = &IsrTable[Vector][(ULONG)InterruptObject->Number]; - - KeRaiseIrql(VECTOR2IRQL(Vector + IRQ_BASE),&oldlvl); - KiAcquireSpinLock(&CurrentIsr->Lock); - - /* - * Check if the vector is already in use that we can share it - */ - if (!IsListEmpty(&CurrentIsr->ListHead)) - { - ListHead = CONTAINING_RECORD(CurrentIsr->ListHead.Flink,KINTERRUPT,InterruptListEntry); - if (InterruptObject->ShareVector == FALSE || ListHead->ShareVector==FALSE) - { - KiReleaseSpinLock(&CurrentIsr->Lock); - KeLowerIrql(oldlvl); - KeRevertToUserAffinityThread(); - return FALSE; - } - } - - synch_oldlvl = KeAcquireInterruptSpinLock(InterruptObject); - - DPRINT("%x %x\n",CurrentIsr->ListHead.Flink, CurrentIsr->ListHead.Blink); - - Result = HalEnableSystemInterrupt(Vector + IRQ_BASE, InterruptObject->Irql, InterruptObject->Mode); - if (Result) - { - InsertTailList(&CurrentIsr->ListHead,&InterruptObject->InterruptListEntry); - DPRINT("%x %x\n",InterruptObject->InterruptListEntry.Flink, InterruptObject->InterruptListEntry.Blink); - } - - InterruptObject->Connected = TRUE; - KeReleaseInterruptSpinLock(InterruptObject, synch_oldlvl); - - /* - * Release the table spinlock - */ - KiReleaseSpinLock(&CurrentIsr->Lock); - KeLowerIrql(oldlvl); - - KeRevertToUserAffinityThread(); - - return Result; -} - -/* - * @implemented - * - * FUNCTION: Releases a drivers isr - * ARGUMENTS: - * InterruptObject = isr to release - */ -BOOLEAN -STDCALL -KeDisconnectInterrupt(PKINTERRUPT InterruptObject) -{ - KIRQL oldlvl,synch_oldlvl; - PISR_TABLE CurrentIsr; - BOOLEAN State; - - DPRINT1("KeDisconnectInterrupt\n"); - ASSERT (InterruptObject->Number < KeNumberProcessors); - - /* Set the affinity */ - KeSetSystemAffinityThread(1 << InterruptObject->Number); - - /* Get the ISR Tabe */ - CurrentIsr = &IsrTable[InterruptObject->Vector - IRQ_BASE] - [(ULONG)InterruptObject->Number]; - - /* Raise IRQL to required level and lock table */ - KeRaiseIrql(VECTOR2IRQL(InterruptObject->Vector),&oldlvl); - KiAcquireSpinLock(&CurrentIsr->Lock); - - /* Check if it's actually connected */ - if ((State = InterruptObject->Connected)) - { - /* Lock the Interrupt */ - synch_oldlvl = KeAcquireInterruptSpinLock(InterruptObject); - - /* Remove this one, and check if all are gone */ - RemoveEntryList(&InterruptObject->InterruptListEntry); - if (IsListEmpty(&CurrentIsr->ListHead)) - { - /* Completely Disable the Interrupt */ - HalDisableSystemInterrupt(InterruptObject->Vector, InterruptObject->Irql); - } - - /* Disconnect it */ - InterruptObject->Connected = FALSE; - - /* Release the interrupt lock */ - KeReleaseInterruptSpinLock(InterruptObject, synch_oldlvl); - } - /* Release the table spinlock */ - KiReleaseSpinLock(&CurrentIsr->Lock); - KeLowerIrql(oldlvl); - - /* Go back to default affinity */ - KeRevertToUserAffinityThread(); - - /* Return Old Interrupt State */ - return State; +VOID +NTAPI +KiGetVectorDispatch(IN ULONG Vector, + IN PDISPATCH_INFO Dispatch) +{ + PKINTERRUPT_ROUTINE Handler; + ULONG Current; + + /* Setup the unhandled dispatch */ + Dispatch->NoDispatch = (PVOID)(((ULONG_PTR)&KiStartUnexpectedRange) + + (Vector - PRIMARY_VECTOR_BASE) * + KiUnexpectedEntrySize); + + /* Setup the handlers */ + Dispatch->InterruptDispatch = KiInterruptDispatch3; + Dispatch->FloatingDispatch = NULL; // Floating Interrupts are not supported + Dispatch->ChainedDispatch = KiChainedDispatch; + Dispatch->FlatDispatch = NULL; + + /* Get the current handler */ + Current = ((((PKIPCR)KeGetPcr())->IDT[Vector].ExtendedOffset << 16) + & 0xFFFF0000) | + (((PKIPCR)KeGetPcr())->IDT[Vector].Offset & 0xFFFF); + + /* Set the interrupt */ + Dispatch->Interrupt = CONTAINING_RECORD(Current, + KINTERRUPT, + DispatchCode); + + /* Check what this interrupt is connected to */ + if ((PKINTERRUPT_ROUTINE)Current == Dispatch->NoDispatch) + { + /* Not connected */ + Dispatch->Type = NoConnect; + } + else + { + /* Get the handler */ + Handler = Dispatch->Interrupt->DispatchAddress; + if (Handler == Dispatch->ChainedDispatch) + { + /* It's a chained interrupt */ + Dispatch->Type = ChainConnect; + } + else if ((Handler == Dispatch->InterruptDispatch) || + (Handler == Dispatch->FloatingDispatch)) + { + /* It's unchained */ + Dispatch->Type = NormalConnect; + } + else + { + /* Unknown */ + Dispatch->Type = UnknownConnect; + } + } +} + +VOID +NTAPI +KiConnectVectorToInterrupt(IN PKINTERRUPT Interrupt, + IN CONNECT_TYPE Type) +{ + DISPATCH_INFO Dispatch; + PKINTERRUPT_ROUTINE Handler; + PULONG Patch = &Interrupt->DispatchCode[0]; + + /* Get vector data */ + KiGetVectorDispatch(Interrupt->Vector, &Dispatch); + + /* Check if we're only disconnecting */ + if (Type == NoConnect) + { + /* Set the handler to NoDispatch */ + Handler = Dispatch.NoDispatch; + } + else + { + /* Get the right handler */ + Handler = (Type == NormalConnect) ? + Dispatch.InterruptDispatch: + Dispatch.ChainedDispatch; + ASSERT(Interrupt->FloatingSave == FALSE); + + /* Set the handler */ + Interrupt->DispatchAddress = Handler; + + /* Jump to the last 4 bytes */ + Patch = (PULONG)((ULONG_PTR)Patch + + ((ULONG_PTR)&KiInterruptTemplateDispatch - + (ULONG_PTR)KiInterruptTemplate) - 4); + + /* Apply the patch */ + *Patch = (ULONG)((ULONG_PTR)Handler - ((ULONG_PTR)Patch + 4)); + + /* Now set the final handler address */ + ASSERT(Dispatch.FlatDispatch == NULL); + Handler = (PVOID)&Interrupt->DispatchCode; + } + + /* Set the pointer in the IDT */ + ((PKIPCR)KeGetPcr())->IDT[Interrupt->Vector].ExtendedOffset = + (USHORT)(((ULONG_PTR)Handler >> 16) & 0xFFFF); + ((PKIPCR)KeGetPcr())->IDT[Interrupt->Vector].Offset = + (USHORT)PtrToUlong(Handler); } /* @@ -488,4 +341,154 @@ Interrupt->Connected = FALSE; } +/* + * @implemented + */ +BOOLEAN +NTAPI +KeConnectInterrupt(IN PKINTERRUPT Interrupt) +{ + BOOLEAN Connected, Error, Status; + KIRQL Irql, OldIrql; + UCHAR Number; + ULONG Vector; + DISPATCH_INFO Dispatch; + + /* Get data from interrupt */ + Number = Interrupt->Number; + Vector = Interrupt->Vector; + Irql = Interrupt->Irql; + + /* Validate the settings */ + if ((Irql > HIGH_LEVEL) || + (Number >= KeNumberProcessors) || + (Interrupt->SynchronizeIrql < Irql) || + (Interrupt->FloatingSave)) + { + DPRINT1("Invalid interrupt object\n"); + return FALSE; + } + + /* Set defaults */ + Connected = FALSE; + Error = FALSE; + + /* Set the system affinity and acquire the dispatcher lock */ + KeSetSystemAffinityThread(1 << Number); + OldIrql = KeAcquireDispatcherDatabaseLock(); + + /* Check if it's already been connected */ + if (!Interrupt->Connected) + { + /* Get vector dispatching information */ + KiGetVectorDispatch(Vector, &Dispatch); + + /* Check if the vector is already connected */ + if (Dispatch.Type == NoConnect) + { + /* Do the connection */ + Interrupt->Connected = Connected = TRUE; + + /* Initialize the list */ + InitializeListHead(&Interrupt->InterruptListEntry); + + /* Connect and enable the interrupt */ + KiConnectVectorToInterrupt(Interrupt, NormalConnect); + Status = HalEnableSystemInterrupt(Vector, Irql, Interrupt->Mode); + if (!Status) Error = TRUE; + } + else if ((Dispatch.Type != UnknownConnect) && + (Interrupt->ShareVector) && + (Dispatch.Interrupt->ShareVector) && + (Dispatch.Interrupt->Mode == Interrupt->Mode)) + { + /* The vector is shared and the interrupts are compatible */ + ASSERT(FALSE); // FIXME: NOT YET SUPPORTED/TESTED + Interrupt->Connected = Connected = TRUE; + ASSERT(Irql <= SYNCH_LEVEL); + + /* Check if this is the first chain */ + if (Dispatch.Type != ChainConnect) + { + /* Setup the chainned handler */ + KiConnectVectorToInterrupt(Dispatch.Interrupt, ChainConnect); + } + + /* Insert into the interrupt list */ + InsertTailList(&Dispatch.Interrupt->InterruptListEntry, + &Interrupt->InterruptListEntry); + } + } + + /* Unlock the dispatcher and revert affinity */ + KeReleaseDispatcherDatabaseLock(OldIrql); + KeRevertToUserAffinityThread(); + + /* Return to caller */ + return Connected; +} + +/* + * @implemented + * + * FUNCTION: Releases a drivers isr + * ARGUMENTS: + * InterruptObject = isr to release + */ +BOOLEAN +STDCALL +KeDisconnectInterrupt(PKINTERRUPT InterruptObject) +{ +#if 0 + KIRQL oldlvl,synch_oldlvl; + PISR_TABLE CurrentIsr; + BOOLEAN State; + + DPRINT1("KeDisconnectInterrupt\n"); + ASSERT (InterruptObject->Number < KeNumberProcessors); + + /* Set the affinity */ + KeSetSystemAffinityThread(1 << InterruptObject->Number); + + /* Get the ISR Tabe */ + CurrentIsr = &IsrTable[InterruptObject->Vector - IRQ_BASE] + [(ULONG)InterruptObject->Number]; + + /* Raise IRQL to required level and lock table */ + KeRaiseIrql(VECTOR2IRQL(InterruptObject->Vector),&oldlvl); + KiAcquireSpinLock(&CurrentIsr->Lock); + + /* Check if it's actually connected */ + if ((State = InterruptObject->Connected)) + { + /* Lock the Interrupt */ + synch_oldlvl = KeAcquireInterruptSpinLock(InterruptObject); + + /* Remove this one, and check if all are gone */ + RemoveEntryList(&InterruptObject->InterruptListEntry); + if (IsListEmpty(&CurrentIsr->ListHead)) + { + /* Completely Disable the Interrupt */ + HalDisableSystemInterrupt(InterruptObject->Vector, InterruptObject->Irql); + } + + /* Disconnect it */ + InterruptObject->Connected = FALSE; + + /* Release the interrupt lock */ + KeReleaseInterruptSpinLock(InterruptObject, synch_oldlvl); + } + /* Release the table spinlock */ + KiReleaseSpinLock(&CurrentIsr->Lock); + KeLowerIrql(oldlvl); + + /* Go back to default affinity */ + KeRevertToUserAffinityThread(); + + /* Return Old Interrupt State */ + return State; +#endif + return 0; +} + /* EOF */
18 years, 4 months
1
0
0
0
[ion] 23676: - Implement Chained and Normal generic interrupt handlers. - Make generated handlers have a proper .func symbol for symbol data. - Make IDT writable, the page shouldn't be read-only. - Change some symbol names.
by ion@svn.reactos.org
Author: ion Date: Thu Aug 24 05:53:54 2006 New Revision: 23676 URL:
http://svn.reactos.org/svn/reactos?rev=23676&view=rev
Log: - Implement Chained and Normal generic interrupt handlers. - Make generated handlers have a proper .func symbol for symbol data. - Make IDT writable, the page shouldn't be read-only. - Change some symbol names. Modified: trunk/reactos/hal/halx86/generic/systimer.S trunk/reactos/include/ndk/asm.h trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S trunk/reactos/ntoskrnl/ke/i386/kernel.c trunk/reactos/ntoskrnl/ke/i386/trap.s Modified: trunk/reactos/hal/halx86/generic/systimer.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/systime…
============================================================================== --- trunk/reactos/hal/halx86/generic/systimer.S (original) +++ trunk/reactos/hal/halx86/generic/systimer.S Thu Aug 24 05:53:54 2006 @@ -23,3 +23,4 @@ jmp $ .endfunc + Modified: trunk/reactos/include/ndk/asm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/asm.h?rev=2367…
============================================================================== --- trunk/reactos/include/ndk/asm.h (original) +++ trunk/reactos/include/ndk/asm.h Thu Aug 24 05:53:54 2006 @@ -154,6 +154,16 @@ #define KPCR_PRCB_INTERRUPT_COUNT 0x644 #define KPCR_SYSTEM_CALLS 0x6B8 #define KPCR_PRCB_DPC_ROUTINE_ACTIVE 0x994 + +// +// KINTERRUPT Offsets +// +#define KINTERRUPT_SERVICE_ROUTINE 0x0C +#define KINTERRUPT_SERVICE_CONTEXT 0x10 +#define KINTERRUPT_ACTUAL_LOCK 0x1C +#define KINTERRUPT_IRQL 0x20 +#define KINTERRUPT_VECTOR 0x24 +#define KINTERRUPT_SYNCHRONIZE_IRQL 0x29 // // KGDTENTRY Offsets Modified: trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S (original) +++ trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S Thu Aug 24 05:53:54 2006 @@ -125,9 +125,11 @@ // @remark None. // .macro GENERATE_INT_HANDLER Number +.func KiUnexpectedInterrupt&Number _KiUnexpectedInterrupt&Number: push PRIMARY_VECTOR_BASE + Number - jmp _KiEndUnexpected + jmp _KiEndUnexpectedRange@0 +.endfunc .endm // Modified: trunk/reactos/ntoskrnl/ke/i386/kernel.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/kernel.c?…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/kernel.c (original) +++ trunk/reactos/ntoskrnl/ke/i386/kernel.c Thu Aug 24 05:53:54 2006 @@ -489,6 +489,7 @@ NTAPI KeInit2(VOID) { + ULONG Protect; PKIPCR Pcr = (PKIPCR)KeGetCurrentKPCR(); KiInitializeBugCheck(); @@ -548,6 +549,10 @@ { DPRINT("Ke386L2CacheSize: %dkB\n", Pcr->SecondLevelCacheSize); } + + /* Set IDT to writable */ + Protect = MmGetPageProtect(NULL, (PVOID)KiIdt); + MmSetPageProtect(NULL, (PVOID)KiIdt, Protect | PAGE_IS_WRITABLE); } VOID INIT_FUNCTION Modified: trunk/reactos/ntoskrnl/ke/i386/trap.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/trap.s?re…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/trap.s (original) +++ trunk/reactos/ntoskrnl/ke/i386/trap.s Thu Aug 24 05:53:54 2006 @@ -59,6 +59,12 @@ /* Interrupt template entrypoints */ .globl _KiInterruptTemplate .globl _KiInterruptTemplateObject +.globl _KiInterruptTemplateDispatch + +/* Chained and Normal generic interrupt handlers for 1st and 2nd level entry*/ +.globl _KiChainedDispatch2ndLvl@0 +.globl _KiInterruptDispatch3@0 +.globl _KiChainedDispatch@0 /* We implement the following trap exit points: */ .globl _KiServiceExit /* Exit from syscall */ @@ -70,6 +76,10 @@ _KiIdtDescriptor: .short 0x800 .long _KiIdt + +.globl _KiUnexpectedEntrySize +_KiUnexpectedEntrySize: + .long _KiUnexpectedInterrupt1 - _KiUnexpectedInterrupt0 /* SOFTWARE INTERRUPT SERVICES ***********************************************/ @@ -1301,12 +1311,13 @@ /* UNEXPECTED INTERRUPT HANDLERS **********************************************/ -.globl _KiStartUnexpected -_KiStartUnexpected: +.globl _KiStartUnexpectedRange@0 +_KiStartUnexpectedRange@0: GENERATE_INT_HANDLERS -_KiEndUnexpected: +.globl _KiEndUnexpectedRange@0 +_KiEndUnexpectedRange@0: jmp _KiUnexpectedInterruptTail .func KiUnexpectedInterruptTail @@ -1367,3 +1378,113 @@ _KiInterruptTemplateObject: /* Dummy jump, will be replaced by the actual jump */ jmp _KeSynchronizeExecution@12 + +_KiInterruptTemplateDispatch: + /* Marks the end of the template so that the jump above can be edited */ + +.func KiChainedDispatch2ndLvl@0 +_KiChainedDispatch2ndLvl@0: + + /* Not yet supported */ + int 3 +.endfunc + +.func KiChainedDispatch@0 +_KiChainedDispatch@0: + + /* Increase interrupt count */ + inc dword ptr [fs:KPCR_PRCB_INTERRUPT_COUNT] + + /* Save trap frame */ + mov ebp, esp + + /* Save vector and IRQL */ + mov eax, [edi+KINTERRUPT_VECTOR] + mov ecx, [edi+KINTERRUPT_IRQL] + + /* Save old irql */ + push eax + sub esp, 4 + + /* Begin interrupt */ + push eax + push ecx + call _HalBeginSystemInterrupt@12 + + /* Check if it was handled */ + or eax, eax + jz SpuriousInt + sub esp, 12 + + /* Call the 2nd-level handler */ + call _KiChainedDispatch2ndLvl@0 + + /* Exit the interrupt */ + mov esi, $ + cli + call _HalEndSystemInterrupt@8 + jmp _Kei386EoiHelper@0 +.endfunc + +.func KiInterruptDispatch3@0 +_KiInterruptDispatch3@0: + + /* Increase interrupt count */ + inc dword ptr [fs:KPCR_PRCB_INTERRUPT_COUNT] + + /* Save trap frame */ + mov ebp, esp + + /* Save vector and IRQL */ + mov eax, [edi+KINTERRUPT_VECTOR] + mov ecx, [edi+KINTERRUPT_SYNCHRONIZE_IRQL] + + /* Save old irql */ + push eax + sub esp, 4 + push esp + + /* Begin interrupt */ + push eax + push ecx + call _HalBeginSystemInterrupt@12 + + /* Check if it was handled */ + or eax, eax + jz SpuriousInt + sub esp, 12 + + /* Acquire the lock */ +GetIntLock: + mov esi, [edi+KINTERRUPT_ACTUAL_LOCK] + ACQUIRE_SPINLOCK(esi, IntSpin) + + /* Call the ISR */ + mov eax, [edi+KINTERRUPT_SERVICE_CONTEXT] + push eax + push edi + call [edi+KINTERRUPT_SERVICE_ROUTINE] + + /* Release the lock */ + RELEASE_SPINLOCK(esi) + + /* Clean up the stack */ + add esp, 12 + + /* Exit the interrupt */ + mov esi, $ + cli + call _HalEndSystemInterrupt@8 + jmp _Kei386EoiHelper@0 + +SpuriousInt: + /* Exit the interrupt */ + add esp, 8 + mov esi, $ + jmp _Kei386EoiHelper@0 + +#ifdef CONFIG_SMP +IntSpin: + SPIN_ON_LOCK esi, GetIntLock +#endif +.endfunc
18 years, 4 months
1
0
0
0
[fireball] 23675: - Add a new level of debug verbosity - Fix a bunch of warnings by Thomas and me
by fireball@svn.reactos.org
Author: fireball Date: Thu Aug 24 02:17:09 2006 New Revision: 23675 URL:
http://svn.reactos.org/svn/reactos?rev=23675&view=rev
Log: - Add a new level of debug verbosity - Fix a bunch of warnings by Thomas and me Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/bulkonly.c trunk/reactos/drivers/usb/nt4compat/usbdriver/cbi.c trunk/reactos/drivers/usb/nt4compat/usbdriver/debug.h trunk/reactos/drivers/usb/nt4compat/usbdriver/devmgr.c (contents, props changed) trunk/reactos/drivers/usb/nt4compat/usbdriver/dmgrdisp.c trunk/reactos/drivers/usb/nt4compat/usbdriver/ehci.c trunk/reactos/drivers/usb/nt4compat/usbdriver/etd.c trunk/reactos/drivers/usb/nt4compat/usbdriver/hub.c trunk/reactos/drivers/usb/nt4compat/usbdriver/roothub.c (contents, props changed) trunk/reactos/drivers/usb/nt4compat/usbdriver/td.h trunk/reactos/drivers/usb/nt4compat/usbdriver/uhci.c trunk/reactos/drivers/usb/nt4compat/usbdriver/umss.c trunk/reactos/drivers/usb/nt4compat/usbdriver/usb.c trunk/reactos/drivers/usb/nt4compat/usbdriver/usbdriver.h (contents, props changed) [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/bulkonly.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/cbi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/debug.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/devmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/dmgrdisp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/ehci.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/etd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/hub.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/roothub.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/td.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/uhci.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/umss.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/usb.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/usbdriver.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
18 years, 4 months
1
0
0
0
[ion] 23674: - Enable the code in KeInitializeInterrupt that copies the Interrupt Template to the KINTERRUPT object and modifies the template pointer to point to the KINTERRUPT. - Add the template code in trap.s.
by ion@svn.reactos.org
Author: ion Date: Wed Aug 23 23:02:00 2006 New Revision: 23674 URL:
http://svn.reactos.org/svn/reactos?rev=23674&view=rev
Log: - Enable the code in KeInitializeInterrupt that copies the Interrupt Template to the KINTERRUPT object and modifies the template pointer to point to the KINTERRUPT. - Add the template code in trap.s. Modified: trunk/reactos/ntoskrnl/ke/i386/irq.c trunk/reactos/ntoskrnl/ke/i386/trap.s Modified: trunk/reactos/ntoskrnl/ke/i386/irq.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/irq.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/irq.c (original) +++ trunk/reactos/ntoskrnl/ke/i386/irq.c Wed Aug 23 23:02:00 2006 @@ -23,6 +23,9 @@ #define NDEBUG #include <internal/debug.h> + +extern ULONG KiInterruptTemplate[KINTERRUPT_DISPATCH_CODES]; +extern PULONG KiInterruptTemplateObject; /* GLOBALS *****************************************************************/ @@ -245,7 +248,6 @@ * At this point we have interrupts disabled, nothing has been done to * the PIC. */ - KeGetCurrentPrcb()->InterruptCount++; /* @@ -302,9 +304,9 @@ PISR_TABLE CurrentIsr; BOOLEAN Result; - DPRINT("KeConnectInterrupt()\n"); Vector = InterruptObject->Vector; + DPRINT1("KeConnectInterrupt(): %lx\n", Vector); if (Vector < IRQ_BASE || Vector >= IRQ_BASE + NR_IRQS) return FALSE; @@ -437,10 +439,13 @@ CHAR ProcessorNumber, BOOLEAN FloatingSave) { + ULONG i; + PULONG DispatchCode = &Interrupt->DispatchCode[0], Patch = DispatchCode; + /* Set the Interrupt Header */ Interrupt->Type = InterruptObject; Interrupt->Size = sizeof(KINTERRUPT); - + /* Check if we got a spinlock */ if (SpinLock) { @@ -452,7 +457,7 @@ KeInitializeSpinLock(&Interrupt->SpinLock); Interrupt->ActualLock = &Interrupt->SpinLock; } - + /* Set the other settings */ Interrupt->ServiceRoutine = ServiceRoutine; Interrupt->ServiceContext = ServiceContext; @@ -463,7 +468,22 @@ Interrupt->ShareVector = ShareVector; Interrupt->Number = ProcessorNumber; Interrupt->FloatingSave = FloatingSave; - + + /* Loop the template in memory */ + for (i = 0; i < KINTERRUPT_DISPATCH_CODES; i++) + { + /* Copy the dispatch code */ + *DispatchCode++ = KiInterruptTemplate[i]; + } + + /* Jump to the last 4 bytes */ + Patch = (PULONG)((ULONG_PTR)Patch + + ((ULONG_PTR)&KiInterruptTemplateObject - + (ULONG_PTR)KiInterruptTemplate) - 4); + + /* Apply the patch */ + *Patch = PtrToUlong(Interrupt); + /* Disconnect it at first */ Interrupt->Connected = FALSE; } Modified: trunk/reactos/ntoskrnl/ke/i386/trap.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/trap.s?re…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/trap.s (original) +++ trunk/reactos/ntoskrnl/ke/i386/trap.s Wed Aug 23 23:02:00 2006 @@ -56,6 +56,10 @@ .globl _NtRaiseException@12 .globl _NtContinue@8 +/* Interrupt template entrypoints */ +.globl _KiInterruptTemplate +.globl _KiInterruptTemplateObject + /* We implement the following trap exit points: */ .globl _KiServiceExit /* Exit from syscall */ .globl _KiServiceExit2 /* Exit from syscall with complete frame*/ @@ -1295,7 +1299,7 @@ ret .endfunc -/* INTERRUPT HANDLERS ********************************************************/ +/* UNEXPECTED INTERRUPT HANDLERS **********************************************/ .globl _KiStartUnexpected _KiStartUnexpected: @@ -1346,3 +1350,20 @@ /* Bugcheck with invalid interrupt code */ push 0x12 call _KeBugCheck@4 + +/* INTERRUPT HANDLERS ********************************************************/ + +.func KiInterruptTemplate +_KiInterruptTemplate: + + /* Enter interrupt trap */ + INT_PROLOG kit, DoPushFakeErrorCode +.endfunc + +_KiInterruptTemplate2ndDispatch: + /* Dummy code, will be replaced by the address of the KINTERRUPT */ + mov edi, 0 + +_KiInterruptTemplateObject: + /* Dummy jump, will be replaced by the actual jump */ + jmp _KeSynchronizeExecution@12
18 years, 4 months
1
0
0
0
[ion] 23673: - Get rid of some large debugging functions that were called at all times, and don't manually deliver user APCs anymore, since the HAL handles it now.
by ion@svn.reactos.org
Author: ion Date: Wed Aug 23 22:09:44 2006 New Revision: 23673 URL:
http://svn.reactos.org/svn/reactos?rev=23673&view=rev
Log: - Get rid of some large debugging functions that were called at all times, and don't manually deliver user APCs anymore, since the HAL handles it now. Modified: trunk/reactos/ntoskrnl/ke/i386/irq.c Modified: trunk/reactos/ntoskrnl/ke/i386/irq.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/irq.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/irq.c (original) +++ trunk/reactos/ntoskrnl/ke/i386/irq.c Wed Aug 23 22:09:44 2006 @@ -188,27 +188,6 @@ TrapFrame->EFlags = IrqTrapFrame->Eflags; } -STATIC VOID -KeTrapFrameToIRQTrapFrame(PKTRAP_FRAME TrapFrame, - PKIRQ_TRAPFRAME IrqTrapFrame) -{ - IrqTrapFrame->Gs = TrapFrame->SegGs; - IrqTrapFrame->Fs = TrapFrame->SegFs; - IrqTrapFrame->Es = TrapFrame->SegEs; - IrqTrapFrame->Ds = TrapFrame->SegDs; - IrqTrapFrame->Eax = TrapFrame->Eax; - IrqTrapFrame->Ecx = TrapFrame->Ecx; - IrqTrapFrame->Edx = TrapFrame->Edx; - IrqTrapFrame->Ebx = TrapFrame->Ebx; - IrqTrapFrame->Esp = TrapFrame->HardwareEsp; - IrqTrapFrame->Ebp = TrapFrame->Ebp; - IrqTrapFrame->Esi = TrapFrame->Esi; - IrqTrapFrame->Edi = TrapFrame->Edi; - IrqTrapFrame->Eip = TrapFrame->Eip; - IrqTrapFrame->Cs = TrapFrame->SegCs; - IrqTrapFrame->Eflags = TrapFrame->EFlags; -} - VOID STDCALL KiInterruptDispatch2 (ULONG vector, KIRQL old_level) /* @@ -261,8 +240,6 @@ { KIRQL old_level; KTRAP_FRAME KernelTrapFrame; - PKTHREAD CurrentThread; - PKTRAP_FRAME OldTrapFrame=NULL; /* * At this point we have interrupts disabled, nothing has been done to @@ -292,7 +269,7 @@ #ifndef CONFIG_SMP if (VECTOR2IRQ(vector) == 0) { - DPRINT1("Tick\n"); + //DPRINT1("Tick\n"); KeIRQTrapFrameToTrapFrame(Trapframe, &KernelTrapFrame); KeUpdateSystemTime(&KernelTrapFrame, old_level); } @@ -309,81 +286,7 @@ * End the system interrupt. */ Ke386DisableInterrupts(); - - if (old_level==PASSIVE_LEVEL && Trapframe->Cs != KGDT_R0_CODE) - { - HalEndSystemInterrupt (APC_LEVEL, 0); - - CurrentThread = KeGetCurrentThread(); - if (CurrentThread!=NULL && CurrentThread->ApcState.UserApcPending) - { - DPRINT("PID: %d, TID: %d CS %04x/%04x\n", - ((PETHREAD)CurrentThread)->ThreadsProcess->UniqueProcessId, - ((PETHREAD)CurrentThread)->Cid.UniqueThread, - Trapframe->Cs, - CurrentThread->TrapFrame ? CurrentThread->TrapFrame->Cs : 0); - if (CurrentThread->TrapFrame == NULL) - { - OldTrapFrame = CurrentThread->TrapFrame; - KeIRQTrapFrameToTrapFrame(Trapframe, &KernelTrapFrame); - CurrentThread->TrapFrame = &KernelTrapFrame; - } - - Ke386EnableInterrupts(); - KiDeliverApc(UserMode, NULL, NULL); - Ke386DisableInterrupts(); - - ASSERT(KeGetCurrentThread() == CurrentThread); - if (CurrentThread->TrapFrame == &KernelTrapFrame) - { - KeTrapFrameToIRQTrapFrame(&KernelTrapFrame, Trapframe); - CurrentThread->TrapFrame = OldTrapFrame; - } - } - KeLowerIrql(PASSIVE_LEVEL); - } - else - { - HalEndSystemInterrupt (old_level, 0); - } - -} - -static VOID -KeDumpIrqList(VOID) -{ - PKINTERRUPT current; - PLIST_ENTRY current_entry; - LONG i, j; - KIRQL oldlvl; - BOOLEAN printed; - - for (i=0;i<NR_IRQS;i++) - { - printed = FALSE; - KeRaiseIrql(VECTOR2IRQL(i + IRQ_BASE),&oldlvl); - - for (j=0; j < KeNumberProcessors; j++) - { - KiAcquireSpinLock(&IsrTable[i][j].Lock); - - current_entry = IsrTable[i][j].ListHead.Flink; - current = CONTAINING_RECORD(current_entry,KINTERRUPT,InterruptListEntry); - while (current_entry!=&(IsrTable[i][j].ListHead)) - { - if (printed == FALSE) - { - printed = TRUE; - DPRINT("For irq %x:\n",i); - } - DPRINT(" Isr %x\n",current); - current_entry = current_entry->Flink; - current = CONTAINING_RECORD(current_entry,KINTERRUPT,InterruptListEntry); - } - KiReleaseSpinLock(&IsrTable[i][j].Lock); - } - KeLowerIrql(oldlvl); - } + HalEndSystemInterrupt (old_level, 0); } /* @@ -451,8 +354,6 @@ */ KiReleaseSpinLock(&CurrentIsr->Lock); KeLowerIrql(oldlvl); - - KeDumpIrqList(); KeRevertToUserAffinityThread(); @@ -567,21 +468,4 @@ Interrupt->Connected = FALSE; } -VOID KePrintInterruptStatistic(VOID) -{ - LONG i, j; - - for (j = 0; j < KeNumberProcessors; j++) - { - DPRINT1("CPU%d:\n", j); - for (i = 0; i < NR_IRQS; i++) - { - if (IsrTable[i][j].Count) - { - DPRINT1(" Irq %x(%d): %d\n", i, VECTOR2IRQ(i + IRQ_BASE), IsrTable[i][j].Count); - } - } - } -} - /* EOF */
18 years, 4 months
1
0
0
0
[ion] 23672: - Fix some bugs in INT_PROLOG so that it can be used in cases like Unexepcted interrupts, where we don't want to push a fake error code, and want to use our own parameter.
by ion@svn.reactos.org
Author: ion Date: Wed Aug 23 22:02:52 2006 New Revision: 23672 URL:
http://svn.reactos.org/svn/reactos?rev=23672&view=rev
Log: - Fix some bugs in INT_PROLOG so that it can be used in cases like Unexepcted interrupts, where we don't want to push a fake error code, and want to use our own parameter. Modified: trunk/reactos/hal/halx86/generic/halinit.c trunk/reactos/hal/halx86/generic/irq.S trunk/reactos/hal/halx86/generic/systimer.S trunk/reactos/hal/halx86/up/halinit_up.c trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S trunk/reactos/ntoskrnl/ke/i386/irq.c trunk/reactos/ntoskrnl/ke/i386/trap.s Modified: trunk/reactos/hal/halx86/generic/halinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/halinit…
============================================================================== --- trunk/reactos/hal/halx86/generic/halinit.c (original) +++ trunk/reactos/hal/halx86/generic/halinit.c Wed Aug 23 22:02:52 2006 @@ -19,8 +19,6 @@ PVOID HalpZeroPageMapping = NULL; HALP_HOOKS HalpHooks; - -VOID NTAPI HalpClockInterrupt(VOID); /* FUNCTIONS ***************************************************************/ @@ -44,15 +42,6 @@ } else if (BootPhase == 1) { -#if 0 - /* Enable the clock interrupt */ - ((PKIPCR)KeGetPcr())->IDT[IRQ2VECTOR(0)].ExtendedOffset = - (USHORT)(((ULONG_PTR)HalpClockInterrupt >> 16) & 0xFFFF); - ((PKIPCR)KeGetPcr())->IDT[IRQ2VECTOR(0)].Offset = - (USHORT)HalpClockInterrupt; - HalEnableSystemInterrupt(IRQ2VECTOR(0), CLOCK2_LEVEL, Latched); -#endif - /* Initialize display and make the screen black */ HalInitializeDisplay ((PROS_LOADER_PARAMETER_BLOCK)LoaderBlock); HalpInitBusHandlers(); Modified: trunk/reactos/hal/halx86/generic/irq.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/irq.S?r…
============================================================================== --- trunk/reactos/hal/halx86/generic/irq.S (original) +++ trunk/reactos/hal/halx86/generic/irq.S Wed Aug 23 22:02:52 2006 @@ -537,7 +537,7 @@ push eax /* Enter interrupt */ - INT_PROLOG(hapc) + INT_PROLOG hapc, DoPushFakeErrorCode .endfunc .globl _HalpApcInterrupt2ndEntry @@ -584,7 +584,7 @@ push eax /* Enter interrupt */ - INT_PROLOG(hapc) + INT_PROLOG hapc, DoPushFakeErrorCode .endfunc .globl _HalpDispatchInterrupt2ndEntry Modified: trunk/reactos/hal/halx86/generic/systimer.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/systime…
============================================================================== --- trunk/reactos/hal/halx86/generic/systimer.S (original) +++ trunk/reactos/hal/halx86/generic/systimer.S Wed Aug 23 22:02:52 2006 @@ -21,4 +21,5 @@ .func HalpClockInterrupt@0 _HalpClockInterrupt@0: + jmp $ .endfunc Modified: trunk/reactos/hal/halx86/up/halinit_up.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/up/halinit_up.c…
============================================================================== --- trunk/reactos/hal/halx86/up/halinit_up.c (original) +++ trunk/reactos/hal/halx86/up/halinit_up.c Wed Aug 23 22:02:52 2006 @@ -15,6 +15,8 @@ #define NDEBUG #include <debug.h> +VOID NTAPI HalpClockInterrupt(VOID); + /* FUNCTIONS ***************************************************************/ VOID @@ -22,6 +24,15 @@ { HalpInitPICs(); + /* Enable the clock interrupt */ +#if 0 + ((PKIPCR)KeGetPcr())->IDT[IRQ2VECTOR(0)].ExtendedOffset = + (USHORT)(((ULONG_PTR)HalpClockInterrupt >> 16) & 0xFFFF); + ((PKIPCR)KeGetPcr())->IDT[IRQ2VECTOR(0)].Offset = + (USHORT)HalpClockInterrupt; +#endif + HalEnableSystemInterrupt(IRQ2VECTOR(0), CLOCK2_LEVEL, Latched); + /* Setup busy waiting */ HalpCalibrateStallExecution(); } Modified: trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S (original) +++ trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S Wed Aug 23 22:02:52 2006 @@ -16,11 +16,13 @@ #define DoRestoreEverything 1 #define DoRestoreSegments 1 #define DoRestoreVolatiles 1 +#define DoPushFakeErrorCode 1 #define NotFromSystemCall 0 #define DoNotRestorePreviousMode 0 #define DoNotRestoreEverything 0 #define DoNotRestoreSegments 0 #define DoNotRestoreVolatiles 0 +#define DoNotPushFakeErrorCode 0 // Arguments for idt #define INT_32_DPL0 0x8E00 @@ -332,9 +334,12 @@ // // @remark For software interrupts, make sure that a fake INT stack is created. // -.macro INT_PROLOG Label +.macro INT_PROLOG Label FakeErrorCode + +.if \FakeErrorCode /* Save fake error code */ push esp +.endif /* Save the non-volatiles */ push ebp @@ -388,6 +393,14 @@ /* Save the previous exception list */ mov [esp+KTRAP_FRAME_EXCEPTION_LIST], ebx +.ifeq \FakeErrorCode + /* Setup the 16-bit stack */ + lea eax, [esp+KTRAP_FRAME_ERROR_CODE] + lea ecx, [esp+KTRAP_FRAME_EIP] + mov ebx, ss:[eax] + mov ss:[eax], ecx +.endif + /* Check if this is the ABIOS stack */ /* cmp esp, 0x10000*/ /* jb Abios_Label*/ @@ -404,6 +417,11 @@ /* Check if the thread was being debugged */ test byte ptr [ecx+KTHREAD_DEBUG_ACTIVE], 0xFF + +.ifeq \FakeErrorCode + /* Push parameter */ + push ebx +.endif /* Save DR registers if needed */ //jnz Dr_&Label Modified: trunk/reactos/ntoskrnl/ke/i386/irq.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/irq.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/irq.c (original) +++ trunk/reactos/ntoskrnl/ke/i386/irq.c Wed Aug 23 22:02:52 2006 @@ -292,6 +292,7 @@ #ifndef CONFIG_SMP if (VECTOR2IRQ(vector) == 0) { + DPRINT1("Tick\n"); KeIRQTrapFrameToTrapFrame(Trapframe, &KernelTrapFrame); KeUpdateSystemTime(&KernelTrapFrame, old_level); } Modified: trunk/reactos/ntoskrnl/ke/i386/trap.s URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/trap.s?re…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/trap.s (original) +++ trunk/reactos/ntoskrnl/ke/i386/trap.s Wed Aug 23 22:02:52 2006 @@ -1309,7 +1309,7 @@ _KiUnexpectedInterruptTail: /* Enter interrupt trap */ - INT_PROLOG(kui) + INT_PROLOG kui, DoNotPushFakeErrorCode /* Increase interrupt count */ inc dword ptr [fs:KPCR_PRCB_INTERRUPT_COUNT]
18 years, 4 months
1
0
0
0
[hpoussin] 23671: Allow to change more easily the prefix of remote interface functions in services.exe This is a step to share this file with Samba-TNG Thanks to Elrond from Samba-TNG for help
by hpoussin@svn.reactos.org
Author: hpoussin Date: Wed Aug 23 21:57:34 2006 New Revision: 23671 URL:
http://svn.reactos.org/svn/reactos?rev=23671&view=rev
Log: Allow to change more easily the prefix of remote interface functions in services.exe This is a step to share this file with Samba-TNG Thanks to Elrond from Samba-TNG for help Modified: trunk/reactos/include/reactos/idl/svcctl.idl Modified: trunk/reactos/include/reactos/idl/svcctl.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/idl/svcctl…
============================================================================== --- trunk/reactos/include/reactos/idl/svcctl.idl (original) +++ trunk/reactos/include/reactos/idl/svcctl.idl Wed Aug 23 21:57:34 2006 @@ -11,6 +11,8 @@ #define SERVICE_STATUS_HANDLE unsigned long #define SC_STATUS_TYPE unsigned long #define SC_ENUM_TYPE unsigned long + +#define R(fn) Scmr ## fn [ uuid(367abb81-9844-35f1-ad32-98f038001003), @@ -34,27 +36,27 @@ cpp_quote("#endif") /* Function 0 */ - DWORD ScmrCloseServiceHandle([in] handle_t BindingHandle, + DWORD R(CloseServiceHandle) ([in] handle_t BindingHandle, [in] SC_HANDLE hSCObject); /* Function 1 */ - DWORD ScmrControlService([in] handle_t BindingHandle, + DWORD R(ControlService) ([in] handle_t BindingHandle, [in] SC_HANDLE hService, [in] DWORD dwControl, [out] SERVICE_STATUS *lpServiceStatus); /* [out] LPSERVICE_STATUS lpServiceStatus); */ /* Function 2 */ - DWORD ScmrDeleteService([in] handle_t BindingHandle, + DWORD R(DeleteService) ([in] handle_t BindingHandle, [in] SC_HANDLE hService); /* Function 3 */ - DWORD ScmrLockServiceDatabase([in] handle_t BindingHandle, + DWORD R(LockServiceDatabase) ([in] handle_t BindingHandle, [in] SC_HANDLE hSCManager, [out] SC_LOCK *hLock); /* Function 4 */ - DWORD ScmrQueryServiceObjectSecurity([in] handle_t BindingHandle, + DWORD R(QueryServiceObjectSecurity) ([in] handle_t BindingHandle, [in] SC_HANDLE hService, [in] DWORD dwSecurityInformation, [out, size_is(dwSecuityDescriptorSize)] unsigned char *lpSecurityDescriptor, @@ -62,32 +64,32 @@ [out] LPDWORD pcbBytesNeeded); /* Function 5 */ - DWORD ScmrSetServiceObjectSecurity([in] handle_t BindingHandle, + DWORD R(SetServiceObjectSecurity) ([in] handle_t BindingHandle, [in] SC_HANDLE hService, [in] DWORD dwSecurityInformation, [in, size_is(dwSecuityDescriptorSize)] unsigned char *lpSecurityDescriptor, [in] DWORD dwSecuityDescriptorSize); /* Function 6 */ - DWORD ScmrQueryServiceStatus([in] handle_t BindingHandle, + DWORD R(QueryServiceStatus) ([in] handle_t BindingHandle, [in] SC_HANDLE hSCManager, [out] SERVICE_STATUS *lpServiceStatus); /* [out] LPSERVICE_STATUS lpServiceStatus); */ /* Function 7 */ - DWORD ScmrSetServiceStatus([in] handle_t BindingHandle, + DWORD R(SetServiceStatus) ([in] handle_t BindingHandle, [in] SERVICE_STATUS_HANDLE hServiceStatus); /* FIXME */ /* Function 8 */ - DWORD ScmrUnlockServiceDatabase([in] handle_t BindingHandle, + DWORD R(UnlockServiceDatabase) ([in] handle_t BindingHandle, [in] SC_LOCK hLock); /* Function 9 */ - DWORD ScmrNotifyBootConfigStatus([in] handle_t BindingHandle, + DWORD R(NotifyBootConfigStatus) ([in] handle_t BindingHandle, [in] BOOL BootAcceptable); /* Function 10 */ - DWORD ScmrSetServiceBitsW([in] handle_t BindingHandle, + DWORD R(SetServiceBitsW) ([in] handle_t BindingHandle, [in] SERVICE_STATUS_HANDLE hServiceStatus, [in] DWORD dwServiceBits, [in] BOOL bSetBitsOn, @@ -95,7 +97,7 @@ [in, string, unique] LPWSTR lpString); /* Function 11 */ - DWORD ScmrChangeServiceConfigW([in] handle_t BindingHandle, + DWORD R(ChangeServiceConfigW) ([in] handle_t BindingHandle, [in] SC_HANDLE hSCManager, [in] DWORD dwServiceType, [in] DWORD dwStartType, @@ -111,7 +113,7 @@ [in, string, unique] LPCWSTR lpDisplayName); /* Function 12 */ - DWORD ScmrCreateServiceW([in] handle_t BindingHandle, + DWORD R(CreateServiceW) ([in] handle_t BindingHandle, [in] SC_HANDLE hSCManager, [in, string, ref] LPCWSTR lpServiceName, [in, string, unique] LPCWSTR lpDisplayName, @@ -130,7 +132,7 @@ [out] SC_HANDLE *hService); /* Function 13 */ - DWORD ScmrEnumDependentServicesW([in] handle_t BindingHandle, + DWORD R(EnumDependentServicesW) ([in] handle_t BindingHandle, [in] SC_HANDLE hService, [in] DWORD dwServiceState, [out, unique, size_is(cbBufSize)] LPBYTE lpServices, @@ -139,7 +141,7 @@ [out] LPDWORD lpServicesReturned); /* Function 14 */ - DWORD ScmrEnumServicesStatusW([in] handle_t BindingHandle, + DWORD R(EnumServicesStatusW) ([in] handle_t BindingHandle, [in] SC_HANDLE hSCManager, [in] DWORD dwServiceType, [in] DWORD dwServiceState, @@ -150,62 +152,62 @@ [in, out, unique] LPDWORD lpResumeHandle); /* Function 15 */ - DWORD ScmrOpenSCManagerW([in] handle_t BindingHandle, + DWORD R(OpenSCManagerW) ([in] handle_t BindingHandle, [in, string, unique] LPCWSTR lpMachineName, [in, string, unique] LPCWSTR lpDatabaseName, [in] DWORD dwDesiredAccess, [out] SC_HANDLE *hScm); /* Function 16 */ - DWORD ScmrOpenServiceW([in] handle_t BindingHandle, + DWORD R(OpenServiceW) ([in] handle_t BindingHandle, [in] SC_HANDLE hSCManager, [in, string] LPCWSTR lpServiceName, [in] DWORD dwDesiredAccess, [out] SC_HANDLE *hScm); /* Function 17 */ - DWORD ScmrQueryServiceConfigW([in] handle_t BindingHandle, + DWORD R(QueryServiceConfigW) ([in] handle_t BindingHandle, [in] SC_HANDLE hService, [out, unique, size_is(cbBufSize)] LPBYTE lpServiceConfig, [in] DWORD cbBufSize, [out] LPDWORD pcbBytesNeeded); /* Function 18 */ - DWORD ScmrQueryServiceLockStatusW([in] handle_t BindingHandle, + DWORD R(QueryServiceLockStatusW) ([in] handle_t BindingHandle, [in] SC_HANDLE hSCManager, [out, unique, size_is(cbBufSize)] LPBYTE lpLockStatus, [in] DWORD cbBufSize, [out] LPDWORD pcbBytesNeeded); /* Function 19 */ - DWORD ScmrStartServiceW([in] handle_t BindingHandle, + DWORD R(StartServiceW) ([in] handle_t BindingHandle, [in] SC_HANDLE hService, [in] DWORD dwNumServiceArgs, [in, size_is(cbBufSize)] LPBYTE lpServiceArgBuffer, [in] DWORD cbBufSize); /* FIXME: This is the correct interface but WIDL doesn't support it yet! */ -// DWORD ScmrStartServiceW([in] handle_t BindingHandle, +// DWORD R(StartServiceW) ([in] handle_t BindingHandle, // [in] SC_HANDLE hService, // [in] DWORD dwNumServiceArgs, // [in, string, size_is(dwNumServiceArgs, ), unique] LPWSTR *lpServiceArgVectors); /* Function 20 */ - DWORD ScmrGetServiceDisplayNameW([in] handle_t BindingHandle, + DWORD R(GetServiceDisplayNameW) ([in] handle_t BindingHandle, [in] SC_HANDLE hSCManager, [in, string, ref] LPCWSTR lpServiceName, [out, size_is(*lpcchBuffer), unique] LPWSTR lpDisplayName, [in, out, ref] LPDWORD lpcchBuffer); /* Function 21 */ - DWORD ScmrGetServiceKeyNameW([in] handle_t BindingHandle, + DWORD R(GetServiceKeyNameW) ([in] handle_t BindingHandle, [in] SC_HANDLE hSCManager, [in, string, ref] LPCWSTR lpDisplayName, [out, size_is(*lpcchBuffer), unique] LPWSTR lpServiceName, [in, out, ref] LPDWORD lpcchBuffer); /* Function 22 */ - DWORD ScmrSetServiceBitsA([in] handle_t BindingHandle, + DWORD R(SetServiceBitsA) ([in] handle_t BindingHandle, [in] SERVICE_STATUS_HANDLE hServiceStatus, [in] DWORD dwServiceBits, [in] BOOL bSetBitsOn, @@ -213,7 +215,7 @@ [in, string, unique] LPSTR lpString); /* Function 23 */ - DWORD ScmrChangeServiceConfigA([in] handle_t BindingHandle, + DWORD R(ChangeServiceConfigA) ([in] handle_t BindingHandle, [in] SC_HANDLE hSCManager, [in] DWORD dwServiceType, [in] DWORD dwStartType, @@ -229,7 +231,7 @@ [in, string, unique] LPCSTR lpDisplayName); /* Function 24 */ - DWORD ScmrCreateServiceA([in] handle_t BindingHandle, + DWORD R(CreateServiceA) ([in] handle_t BindingHandle, [in] SC_HANDLE hSCManager, [in, string, ref] LPCSTR lpServiceName, [in, string, unique] LPCSTR lpDisplayName, @@ -248,7 +250,7 @@ [out] SC_HANDLE *hService); /* Function 25 */ - DWORD ScmrEnumDependentServicesA([in] handle_t BindingHandle, + DWORD R(EnumDependentServicesA) ([in] handle_t BindingHandle, [in] SC_HANDLE hService, [in] DWORD dwServiceState, [out, unique, size_is(cbBufSize)] LPBYTE lpServices, @@ -257,7 +259,7 @@ [out] LPDWORD lpServicesReturned); /* Function 26 */ - DWORD ScmrEnumServicesStatusA([in] handle_t BindingHandle, + DWORD R(EnumServicesStatusA) ([in] handle_t BindingHandle, [in] SC_HANDLE hSCManager, [in] DWORD dwServiceType, [in] DWORD dwServiceState, @@ -268,82 +270,82 @@ [in, out, unique] LPDWORD lpResumeHandle); /* Function 27 */ - DWORD ScmrOpenSCManagerA([in] handle_t BindingHandle, + DWORD R(OpenSCManagerA) ([in] handle_t BindingHandle, [in, string, unique] LPCSTR lpMachineName, [in, string, unique] LPCSTR lpDatabaseName, [in] DWORD dwDesiredAccess, [out] SC_HANDLE *hScm); /* Function 28 */ - SC_HANDLE ScmrOpenServiceA([in] handle_t BindingHandle, + SC_HANDLE R(OpenServiceA) ([in] handle_t BindingHandle, [in] SC_HANDLE hSCManager, [in, string] LPCSTR lpServiceName, [in] DWORD dwDesiredAccess, [out] SC_HANDLE *hScm); /* Function 29 */ - DWORD ScmrQueryServiceConfigA([in] handle_t BindingHandle, + DWORD R(QueryServiceConfigA) ([in] handle_t BindingHandle, [in] SC_HANDLE hService, [out, unique, size_is(cbBufSize)] LPBYTE lpServiceConfig, [in] DWORD cbBufSize, [out] LPDWORD pcbBytesNeeded); /* Function 30 */ - DWORD ScmrQueryServiceLockStatusA([in] handle_t BindingHandle, + DWORD R(QueryServiceLockStatusA) ([in] handle_t BindingHandle, [in] SC_HANDLE hSCManager, [out, unique, size_is(cbBufSize)] LPBYTE lpLockStatus, [in] DWORD cbBufSize, [out] LPDWORD pcbBytesNeeded); /* Function 31 */ - DWORD ScmrStartServiceA([in] handle_t BindingHandle, + DWORD R(StartServiceA) ([in] handle_t BindingHandle, [in] SC_HANDLE hService, [in] DWORD dwNumServiceArgs, [in, size_is(cbBufSize)] LPBYTE lpServiceArgBuffer, [in] DWORD cbBufSize); /* FIXME: This is the correct interface but WIDL doesn't support it yet! */ -// DWORD ScmrStartServiceA([in] handle_t BindingHandle, +// DWORD R(StartServiceA) ([in] handle_t BindingHandle, // [in] SC_HANDLE hService, // [in] DWORD dwNumServiceArgs, // [in, unique, string, size_is(dwNumServiceArgs, )] LPSTR *lpServiceArgVectors); /* Function 32 */ - DWORD ScmrGetServiceDisplayNameA([in] handle_t BindingHandle, + DWORD R(GetServiceDisplayNameA) ([in] handle_t BindingHandle, [in] SC_HANDLE hSCManager, [in, string, ref] LPCSTR lpServiceName, [out, unique, size_is(*lpcchBuffer)] LPSTR lpDisplayName, [in, out, ref] LPDWORD lpcchBuffer); /* Function 33 */ - DWORD ScmrGetServiceKeyNameA([in] handle_t BindingHandle, + DWORD R(GetServiceKeyNameA) ([in] handle_t BindingHandle, [in] SC_HANDLE hSCManager, [in, string, ref] LPCSTR lpDisplayName, [out, unique, size_is(*lpcchBuffer)] LPSTR lpServiceName, [in, out, ref] LPDWORD lpcchBuffer); /* Function 34 */ - DWORD ScmrGetCurrentGroupStateW([in] handle_t BindingHandle); /* FIXME */ + DWORD R(GetCurrentGroupStateW) ([in] handle_t BindingHandle); /* FIXME */ /* Function 35 */ - DWORD ScmrEnumServiceGroupW([in] handle_t BindingHandle); /* FIXME */ + DWORD R(EnumServiceGroupW) ([in] handle_t BindingHandle); /* FIXME */ /* Function 36 */ - DWORD ScmrChangeServiceConfig2A([in] handle_t BindingHandle, + DWORD R(ChangeServiceConfig2A) ([in] handle_t BindingHandle, [in] SC_HANDLE hService, [in] DWORD dwInfoLevel, [in, size_is(dwInfoSize)] LPBYTE lpInfo, [in] DWORD dwInfoSize); /* Function 37 */ - DWORD ScmrChangeServiceConfig2W([in] handle_t BindingHandle, + DWORD R(ChangeServiceConfig2W) ([in] handle_t BindingHandle, [in] SC_HANDLE hService, [in] DWORD dwInfoLevel, [in, size_is(dwInfoSize)] LPBYTE lpInfo, [in] DWORD dwInfoSize); /* Function 38 */ - DWORD ScmrQueryServiceConfig2A([in] handle_t BindingHandle, + DWORD R(QueryServiceConfig2A) ([in] handle_t BindingHandle, [in] SC_HANDLE hService, [in] DWORD dwInfoLevel, [out, unique, size_is(cbBufSize)] LPBYTE lpBuffer, @@ -351,7 +353,7 @@ [out] LPDWORD pcbBytesNeeded); /* Function 39 */ - DWORD ScmrQueryServiceConfig2W([in] handle_t BindingHandle, + DWORD R(QueryServiceConfig2W) ([in] handle_t BindingHandle, [in] SC_HANDLE hService, [in] DWORD dwInfoLevel, [out, unique, size_is(cbBufSize)] LPBYTE lpBuffer, @@ -359,7 +361,7 @@ [out] LPDWORD pcbBytesNeeded); /* Function 40 */ - DWORD ScmrQueryServiceStatusEx([in] handle_t BindingHandle, + DWORD R(QueryServiceStatusEx) ([in] handle_t BindingHandle, [in] SC_HANDLE hService, [in] SC_STATUS_TYPE InfoLevel, [out, unique, size_is(cbBufSize)] LPBYTE lpBuffer, @@ -367,7 +369,7 @@ [out] LPDWORD pcbBytesNeeded); /* Function 41 */ - DWORD ScmrEnumServicesStatusExA([in] handle_t BindingHandle, + DWORD R(EnumServicesStatusExA) ([in] handle_t BindingHandle, [in] SC_HANDLE hService, [in] SC_ENUM_TYPE InfoLevel, [in] DWORD dwServiceType, @@ -380,7 +382,7 @@ [in, string, unique] LPCSTR pszGroupName); /* Function 42 */ - DWORD ScmrEnumServicesStatusExW([in] handle_t BindingHandle, + DWORD R(EnumServicesStatusExW) ([in] handle_t BindingHandle, [in] SC_HANDLE hService, [in] SC_ENUM_TYPE InfoLevel, [in] DWORD dwServiceType, @@ -393,5 +395,5 @@ [in, string, unique] LPCWSTR pszGroupName); /* Function 43 */ - /* ScmrSendTSMessage */ + /* R(SendTSMessage) */ }
18 years, 4 months
1
0
0
0
[ion] 23670: - [AUDIT] After spending some time looking at the current HAL, I believe it to be clean and written by authors which had knowledge of system internals and have always used clean-rooming. As well, the difference in implementation, complete and utter incompatibility with NT as well as the presence of some Linux-based code confirms this. - Fix function definitions of HalQueryRealTimeClock, HalGetEnvironmentVariable. They were defined in the NDK in one way, but implemented another way,
by ion@svn.reactos.org
Author: ion Date: Wed Aug 23 21:28:39 2006 New Revision: 23670 URL:
http://svn.reactos.org/svn/reactos?rev=23670&view=rev
Log: - [AUDIT] After spending some time looking at the current HAL, I believe it to be clean and written by authors which had knowledge of system internals and have always used clean-rooming. As well, the difference in implementation, complete and utter incompatibility with NT as well as the presence of some Linux-based code confirms this. - Fix function definitions of HalQueryRealTimeClock, HalGetEnvironmentVariable. They were defined in the NDK in one way, but implemented another way, and since the HAL didn't include its own NDK file, the compiler didn't realize this. Calls of these functions might've experienced serious problems. - Also fix HalHandleNmi and HalInitSystem definitions. - Add stub code to actually setup the Clock Interrupt. Added: trunk/reactos/hal/halx86/generic/systimer.S Modified: trunk/reactos/hal/halx86/generic/beep.c (props changed) trunk/reactos/hal/halx86/generic/bus.c (props changed) trunk/reactos/hal/halx86/generic/display.c (props changed) trunk/reactos/hal/halx86/generic/dma.c (props changed) trunk/reactos/hal/halx86/generic/drive.c (props changed) trunk/reactos/hal/halx86/generic/enum.c (props changed) trunk/reactos/hal/halx86/generic/fmutex.c (props changed) trunk/reactos/hal/halx86/generic/generic.rbuild trunk/reactos/hal/halx86/generic/halinit.c (contents, props changed) trunk/reactos/hal/halx86/generic/ipi.c (props changed) trunk/reactos/hal/halx86/generic/isa.c (props changed) trunk/reactos/hal/halx86/generic/kdbg.c (props changed) trunk/reactos/hal/halx86/generic/mca.c (props changed) trunk/reactos/hal/halx86/generic/misc.c (contents, props changed) trunk/reactos/hal/halx86/generic/pci.c (props changed) trunk/reactos/hal/halx86/generic/portio.c (props changed) trunk/reactos/hal/halx86/generic/processor.c (props changed) trunk/reactos/hal/halx86/generic/pwroff.c (props changed) trunk/reactos/hal/halx86/generic/reboot.c (props changed) trunk/reactos/hal/halx86/generic/resource.c (props changed) trunk/reactos/hal/halx86/generic/spinlock.c (props changed) trunk/reactos/hal/halx86/generic/sysbus.c (props changed) trunk/reactos/hal/halx86/generic/sysinfo.c (props changed) trunk/reactos/hal/halx86/generic/time.c (contents, props changed) trunk/reactos/hal/halx86/generic/timer.c (props changed) trunk/reactos/hal/halx86/include/hal.h Propchange: trunk/reactos/hal/halx86/generic/beep.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/hal/halx86/generic/bus.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/hal/halx86/generic/display.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/hal/halx86/generic/dma.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/hal/halx86/generic/drive.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/hal/halx86/generic/enum.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/hal/halx86/generic/fmutex.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Modified: trunk/reactos/hal/halx86/generic/generic.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/generic…
============================================================================== --- trunk/reactos/hal/halx86/generic/generic.rbuild (original) +++ trunk/reactos/hal/halx86/generic/generic.rbuild Wed Aug 23 21:28:39 2006 @@ -35,6 +35,7 @@ <file>processor.c</file> <file>resource.c</file> <file>spinlock.c</file> + <file>systimer.S</file> </module> <module name="hal_generic_pc" type="objectlibrary"> <include base="hal_generic_pc">../include</include> Modified: trunk/reactos/hal/halx86/generic/halinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/halinit…
============================================================================== --- trunk/reactos/hal/halx86/generic/halinit.c (original) +++ trunk/reactos/hal/halx86/generic/halinit.c Wed Aug 23 21:28:39 2006 @@ -20,6 +20,8 @@ PVOID HalpZeroPageMapping = NULL; HALP_HOOKS HalpHooks; +VOID NTAPI HalpClockInterrupt(VOID); + /* FUNCTIONS ***************************************************************/ NTSTATUS @@ -33,7 +35,7 @@ BOOLEAN STDCALL HalInitSystem (ULONG BootPhase, - PROS_LOADER_PARAMETER_BLOCK LoaderBlock) + PLOADER_PARAMETER_BLOCK LoaderBlock) { if (BootPhase == 0) { @@ -42,6 +44,15 @@ } else if (BootPhase == 1) { +#if 0 + /* Enable the clock interrupt */ + ((PKIPCR)KeGetPcr())->IDT[IRQ2VECTOR(0)].ExtendedOffset = + (USHORT)(((ULONG_PTR)HalpClockInterrupt >> 16) & 0xFFFF); + ((PKIPCR)KeGetPcr())->IDT[IRQ2VECTOR(0)].Offset = + (USHORT)HalpClockInterrupt; + HalEnableSystemInterrupt(IRQ2VECTOR(0), CLOCK2_LEVEL, Latched); +#endif + /* Initialize display and make the screen black */ HalInitializeDisplay ((PROS_LOADER_PARAMETER_BLOCK)LoaderBlock); HalpInitBusHandlers(); Propchange: trunk/reactos/hal/halx86/generic/halinit.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/hal/halx86/generic/ipi.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/hal/halx86/generic/isa.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/hal/halx86/generic/kdbg.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/hal/halx86/generic/mca.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Modified: trunk/reactos/hal/halx86/generic/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/misc.c?…
============================================================================== --- trunk/reactos/hal/halx86/generic/misc.c (original) +++ trunk/reactos/hal/halx86/generic/misc.c Wed Aug 23 21:28:39 2006 @@ -26,7 +26,7 @@ VOID STDCALL -HalHandleNMI(ULONG Unused) +HalHandleNMI(PVOID NmiInfo) { UCHAR ucStatus; Propchange: trunk/reactos/hal/halx86/generic/misc.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/hal/halx86/generic/pci.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/hal/halx86/generic/portio.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/hal/halx86/generic/processor.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/hal/halx86/generic/pwroff.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/hal/halx86/generic/reboot.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/hal/halx86/generic/resource.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/hal/halx86/generic/spinlock.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/hal/halx86/generic/sysbus.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/hal/halx86/generic/sysinfo.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Added: trunk/reactos/hal/halx86/generic/systimer.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/systime…
============================================================================== --- trunk/reactos/hal/halx86/generic/systimer.S (added) +++ trunk/reactos/hal/halx86/generic/systimer.S Wed Aug 23 21:28:39 2006 @@ -1,0 +1,24 @@ +/* + * FILE: hal/halx86/generic/timer.S + * COPYRIGHT: See COPYING in the top level directory + * PURPOSE: System Timer Interrupt and Management + * PROGRAMMER: Alex Ionescu (alex(a)relsoft.net) + */ + +/* INCLUDES ******************************************************************/ + +#include <asm.h> +#include <internal/i386/asmmacro.S> +.intel_syntax noprefix + +.extern _Kei386EoiHelper@0 + +/* GLOBALS *******************************************************************/ + +/* FUNCTIONS *****************************************************************/ + +.globl _HalpClockInterrupt@0 +.func HalpClockInterrupt@0 +_HalpClockInterrupt@0: + +.endfunc Modified: trunk/reactos/hal/halx86/generic/time.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/time.c?…
============================================================================== --- trunk/reactos/hal/halx86/generic/time.c (original) +++ trunk/reactos/hal/halx86/generic/time.c Wed Aug 23 21:28:39 2006 @@ -120,7 +120,7 @@ } -VOID STDCALL +BOOLEAN STDCALL HalQueryRealTimeClock(PTIME_FIELDS Time) { KIRQL oldIrql; @@ -162,6 +162,7 @@ #endif Time->Milliseconds = 0; + return TRUE; } @@ -188,14 +189,13 @@ HalpSetCMOS (RTC_REGISTER_CENTURY, INT_BCD(Time->Year / 100)); #endif KeReleaseSpinLock(&CmosLock, oldIrql); - } BOOLEAN STDCALL HalGetEnvironmentVariable(PCH Name, - PCH Value, - USHORT ValueLength) + USHORT ValueLength, + PCH Value) { KIRQL oldIrql; Propchange: trunk/reactos/hal/halx86/generic/time.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/hal/halx86/generic/timer.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Modified: trunk/reactos/hal/halx86/include/hal.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/include/hal.h?r…
============================================================================== --- trunk/reactos/hal/halx86/include/hal.h (original) +++ trunk/reactos/hal/halx86/include/hal.h Wed Aug 23 21:28:39 2006 @@ -17,6 +17,7 @@ #include <arc/arc.h> #include <iotypes.h> #include <kefuncs.h> +#include <halfuncs.h> #include <rosldr.h> #define KPCR_BASE 0xFF000000 // HACK!
18 years, 4 months
1
0
0
0
[ion] 23669: - Switch PRIMARY_VECTOR_BASE to 0x30 instead of 0x40, as it should be.
by ion@svn.reactos.org
Author: ion Date: Wed Aug 23 20:58:43 2006 New Revision: 23669 URL:
http://svn.reactos.org/svn/reactos?rev=23669&view=rev
Log: - Switch PRIMARY_VECTOR_BASE to 0x30 instead of 0x40, as it should be. Modified: trunk/reactos/hal/halx86/generic/irq.S trunk/reactos/hal/halx86/include/halirq.h trunk/reactos/include/ndk/asm.h trunk/reactos/ntoskrnl/ke/i386/irq.c Modified: trunk/reactos/hal/halx86/generic/irq.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/irq.S?r…
============================================================================== --- trunk/reactos/hal/halx86/generic/irq.S (original) +++ trunk/reactos/hal/halx86/generic/irq.S Wed Aug 23 20:58:43 2006 @@ -21,14 +21,14 @@ /* Master PIC */ .short 0x20 /* Port */ .byte 0x11 /* Edge,, cascade, CAI 8, ICW4 */ - .byte 0x40 /* Base */ + .byte PRIMARY_VECTOR_BASE /* Base */ .byte 4 /* IRQ 4 connected to slave */ .byte 1 /* Non buffered, not nested, 8086 */ /* Slave PIC */ .short 0xA0 /* Port */ .byte 0x11 /* Edge, cascade, CAI 8, ICW4 */ - .byte 0x48 /* Base */ + .byte PRIMARY_VECTOR_BASE + 8 /* Base */ .byte 2 /* Slave ID: Slave 2 */ .byte 1 /* Non buffered, not nested, 8086 */ Modified: trunk/reactos/hal/halx86/include/halirq.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/include/halirq.…
============================================================================== --- trunk/reactos/hal/halx86/include/halirq.h (original) +++ trunk/reactos/hal/halx86/include/halirq.h Wed Aug 23 20:58:43 2006 @@ -23,7 +23,7 @@ #else -#define IRQ_BASE (0x40) +#define IRQ_BASE (0x30) #define NR_IRQS (16) #define VECTOR2IRQ(vector) ((vector) - IRQ_BASE) Modified: trunk/reactos/include/ndk/asm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/asm.h?rev=2366…
============================================================================== --- trunk/reactos/include/ndk/asm.h (original) +++ trunk/reactos/include/ndk/asm.h Wed Aug 23 20:58:43 2006 @@ -445,7 +445,7 @@ // // Generic Definitions // -#define PRIMARY_VECTOR_BASE 0x40 // FIXME: HACK +#define PRIMARY_VECTOR_BASE 0x30 // FIXME: HACK #define MAXIMUM_IDTVECTOR 0xFF #endif // !_ASM_H Modified: trunk/reactos/ntoskrnl/ke/i386/irq.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/irq.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/irq.c (original) +++ trunk/reactos/ntoskrnl/ke/i386/irq.c Wed Aug 23 20:58:43 2006 @@ -88,7 +88,7 @@ void irq_handler_14(void); void irq_handler_15(void); -static unsigned int irq_handler[NR_IRQS]= +unsigned int irq_handler[NR_IRQS]= { (int)&irq_handler_0, (int)&irq_handler_1,
18 years, 4 months
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
...
45
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Results per page:
10
25
50
100
200