Author: ros-arm-bringup
Date: Sun Jul 13 17:40:36 2008
New Revision: 34474
URL:
http://svn.reactos.org/svn/reactos?rev=34474&view=rev
Log:
- Write a DebugService routine for ARM in the RTL library and get rid of the hack in
ntoskrnl.
- Just like on x86, this routine generates a breakpoint -- on ARM this is done with BKPT
followed by an index.
- We use the BREAKPOINT_PRINT index just like on x86.
- This generates a prefetch abort -- so now we implement the prefetch abort handler.
Thanks to the trap macros, this was 10 lines of code.
- This calls into the real C handler, which is now unimplemented and hangs the whole
system, so we've regressed way back (on purpose).
Modified:
trunk/reactos/lib/rtl/arm/debug_asm.S
trunk/reactos/ntoskrnl/include/internal/arm/ksarm.h
trunk/reactos/ntoskrnl/ke/arm/kiinit.c
trunk/reactos/ntoskrnl/ke/arm/trap.s
trunk/reactos/ntoskrnl/ke/arm/trapc.c
Modified: trunk/reactos/lib/rtl/arm/debug_asm.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/arm/debug_asm.S?re…
==============================================================================
--- trunk/reactos/lib/rtl/arm/debug_asm.S [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/arm/debug_asm.S [iso-8859-1] Sun Jul 13 17:40:36 2008
@@ -17,9 +17,19 @@
//
// Do a breakpoint and return
//
- bkpt 3
+ bkpt BREAKPOINT_BREAK
bx lr
ENTRY_END DbgBreakPoint
+
+ NESTED_ENTRY DebugService
+ PROLOG_END DebugService
+
+ //
+ // Do a breakpoint and return
+ //
+ bkpt BREAKPOINT_PRINT // Could also be PROMPT -- we check later in a1
+ bx lr
+ ENTRY_END DebugService
NESTED_ENTRY RtlCaptureContext
PROLOG_END RtlCaptureContext
Modified: trunk/reactos/ntoskrnl/include/internal/arm/ksarm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/arm/ksarm.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/arm/ksarm.h [iso-8859-1] Sun Jul 13 17:40:36
2008
@@ -102,6 +102,16 @@
.equ CsPc, 0x40
.equ CsPsr, 0x44
+/*
+ * DebugService Control Types
+ */
+.equ BREAKPOINT_BREAK, 0
+.equ BREAKPOINT_PRINT, 1
+.equ BREAKPOINT_PROMPT, 2
+.equ BREAKPOINT_LOAD_SYMBOLS, 3
+.equ BREAKPOINT_UNLOAD_SYMBOLS, 4
+.equ BREAKPOINT_COMMAND_STRING, 5
+
#else
/*
Modified: trunk/reactos/ntoskrnl/ke/arm/kiinit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/kiinit.c?r…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/arm/kiinit.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/arm/kiinit.c [iso-8859-1] Sun Jul 13 17:40:36 2008
@@ -30,24 +30,6 @@
KiIdleLoop(
VOID
);
-
-VOID
-STDCALL
-KdpSerialDebugPrint(LPSTR Message,
- ULONG Length);
-
-VOID
-DebugService(IN ULONG ServiceType,
- IN PCHAR Buffer,
- IN ULONG Length,
- IN ULONG Component,
- IN ULONG Level)
-{
- //
- // FIXME: ARM Bring-up Hack
- //
- KdpSerialDebugPrint(Buffer, Length);
-}
VOID
DebugService2(IN ULONG Arg1,
Modified: trunk/reactos/ntoskrnl/ke/arm/trap.s
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/trap.s?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/arm/trap.s [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/arm/trap.s [iso-8859-1] Sun Jul 13 17:40:36 2008
@@ -67,9 +67,22 @@
PROLOG_END KiPrefetchAbortException
//
- // FIXME: TODO
+ // Handle trap entry
//
- b .
+ TRAP_PROLOG 1 // FromAbort
+
+ //
+ // Call the C handler
+ //
+ adr lr, 1f
+ mov r0, sp
+ ldr pc, =KiPrefetchAbortHandler
+
+1:
+ //
+ // Handle trap exit
+ //
+ TRAP_EPILOG 0 // NotFromSystemCall
ENTRY_END KiPrefetchAbortException
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] Sun Jul 13 17:40:36 2008
@@ -432,6 +432,14 @@
}
NTSTATUS
+KiPrefetchAbortHandler(IN PKTRAP_FRAME TrapFrame)
+{
+ ASSERT(TrapFrame->DbgArgMark == 0xBADB0D00);
+ while (TRUE);
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
KiDataAbortHandler(IN PKTRAP_FRAME TrapFrame)
{
NTSTATUS Status;