Author: sir_richard
Date: Tue Feb 9 03:09:34 2010
New Revision: 45512
URL:
http://svn.reactos.org/svn/reactos?rev=45512&view=rev
Log:
[NTOS]: Update code to use new KPCR structure.
[NTOS]: Make all trap code currently spin forever, because it has not been reviewed yet.
Modified:
trunk/reactos/ntoskrnl/ke/arm/trapc.c
trunk/reactos/ntoskrnl/ke/arm/usercall.c
Modified: trunk/reactos/ntoskrnl/ke/arm/trapc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/trapc.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/arm/trapc.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/arm/trapc.c [iso-8859-1] Tue Feb 9 03:09:34 2010
@@ -25,6 +25,9 @@
//
// Loop forever... that's why this is an idle loop
//
+ DPRINT1("[IDLE LOOP]\n");
+ while (TRUE);
+
while (TRUE)
{
//
@@ -117,9 +120,12 @@
KiSwapContextInternal(IN PKTHREAD OldThread,
IN PKTHREAD NewThread)
{
- PKPCR Pcr = (PKPCR)KeGetPcr();
+ PKIPCR Pcr = (PKIPCR)KeGetPcr();
PKPRCB Prcb = Pcr->Prcb;
PKPROCESS OldProcess, NewProcess;
+
+ DPRINT1("SWAP\n");
+ while (TRUE);
//
// Increase context switch count
@@ -163,7 +169,7 @@
// Increase thread context switches
//
NewThread->ContextSwitches++;
-
+#if 0 // I don't buy this
//
// Set us as the current thread
// NOTE: On RISC Platforms, there is both a KPCR CurrentThread, and a
@@ -175,7 +181,7 @@
// there as well.
//
Pcr->CurrentThread = NewThread;
-
+#endif
//
// DPCs shouldn't be active
//
@@ -221,7 +227,9 @@
KPROCESSOR_MODE PreviousMode;
KEXCEPTION_FRAME ExceptionFrame;
PKTRAP_FRAME TrapFrame = KeGetCurrentThread()->TrapFrame;
- //DPRINT1("[APC]\n");
+
+ DPRINT1("[APC TRAP]\n");
+ while (TRUE);
//
// Isolate previous mode
@@ -257,14 +265,17 @@
VOID
KiDispatchInterrupt(VOID)
{
- PKPCR Pcr;
+ PKIPCR Pcr;
PKPRCB Prcb;
PKTHREAD NewThread, OldThread;
+ DPRINT1("[DPC TRAP]\n");
+ while (TRUE);
+
//
// Get the PCR and disable interrupts
//
- Pcr = (PKPCR)KeGetPcr();
+ Pcr = (PKIPCR)KeGetPcr();
Prcb = Pcr->Prcb;
_disable();
@@ -339,14 +350,14 @@
{
KIRQL OldIrql, Irql;
ULONG InterruptCause, InterruptMask;
- PKPCR Pcr;
+ PKIPCR Pcr;
PKTRAP_FRAME OldTrapFrame;
ASSERT(TrapFrame->DbgArgMark == 0xBADB0D00);
//
// Increment interrupt count
//
- Pcr = (PKPCR)KeGetPcr();
+ Pcr = (PKIPCR)KeGetPcr();
Pcr->Prcb->InterruptCount++;
//
@@ -359,7 +370,7 @@
// Get the interrupt source
//
InterruptCause = HalGetInterruptSource();
-// DPRINT1("[INT] (%x) @ %p %p\n", InterruptCause, TrapFrame->SvcLr,
TrapFrame->Pc);
+ //DPRINT1("[INT] (%x) @ %p %p\n", InterruptCause, TrapFrame->SvcLr,
TrapFrame->Pc);
//
// Get the new IRQL and Interrupt Mask
@@ -421,6 +432,10 @@
ULONG DebugType, Parameter0;
EXCEPTION_RECORD ExceptionRecord;
+ DPRINT1("[PREFETCH ABORT] (%x) @ %p/%p/%p\n",
+ KeArmInstructionFaultStatusRegisterGet(), Address, TrapFrame->SvcLr,
TrapFrame->Pc);
+ while (TRUE);
+
//
// What we *SHOULD* do is look at the instruction fault status register
// and see if it's equal to 2 (debug trap). Unfortunately QEMU doesn't seem
@@ -483,8 +498,6 @@
//
// Unhandled
//
- DPRINT1("[PREFETCH ABORT] (%x) @ %p/%p/%p\n",
- KeArmInstructionFaultStatusRegisterGet(), Address, TrapFrame->SvcLr,
TrapFrame->Pc);
UNIMPLEMENTED;
ASSERT(FALSE);
return STATUS_SUCCESS;
@@ -497,6 +510,10 @@
PVOID Address = (PVOID)KeArmFaultAddressRegisterGet();
ASSERT(TrapFrame->DbgArgMark == 0xBADB0D00);
+ DPRINT1("[ABORT] (%x) @ %p/%p/%p\n",
+ KeArmFaultStatusRegisterGet(), Address, TrapFrame->SvcLr,
TrapFrame->Pc);
+ while (TRUE);
+
//
// Check if this is a page fault
//
@@ -512,8 +529,6 @@
//
// Unhandled
//
- DPRINT1("[ABORT] (%x) @ %p/%p/%p\n",
- KeArmFaultStatusRegisterGet(), Address, TrapFrame->SvcLr,
TrapFrame->Pc);
UNIMPLEMENTED;
ASSERT(FALSE);
return STATUS_SUCCESS;
@@ -527,6 +542,9 @@
ULONG Instruction;
ASSERT(TrapFrame->DbgArgMark == 0xBADB0D00);
+ DPRINT1("[SWI] @ %p/%p\n", TrapFrame->SvcLr, TrapFrame->Pc);
+ while (TRUE);
+
//
// Get the current thread
//
Modified: trunk/reactos/ntoskrnl/ke/arm/usercall.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/usercall.c…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/arm/usercall.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/arm/usercall.c [iso-8859-1] Tue Feb 9 03:09:34 2010
@@ -226,7 +226,7 @@
//
// Forcibly put us in a sane state
//
- KeGetPcr()->CurrentIrql = 0;
+ KeGetPcr()->Irql = 0;
_disable();
//