2008-03-12 18:17:55 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS Kernel
|
2008-06-29 02:58:05 +00:00
|
|
|
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
2008-03-12 18:17:55 +00:00
|
|
|
* FILE: ntoskrnl/include/internal/arm/ksarm.h
|
|
|
|
* PURPOSE: Definitions and offsets for ARM Assembly and C code
|
|
|
|
* PROGRAMMERS: ReactOS Portable Systems Group
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef _ASM_
|
|
|
|
|
2008-02-12 16:32:13 +00:00
|
|
|
/*
|
|
|
|
* CPSR Values
|
|
|
|
*/
|
2008-02-12 05:55:12 +00:00
|
|
|
.equ CPSR_THUMB_ENABLE, 0x20
|
2008-03-11 02:45:13 +00:00
|
|
|
.equ CPSR_FIQ_DISABLE, 0x40
|
|
|
|
.equ CPSR_IRQ_DISABLE, 0x80
|
2008-03-12 18:17:55 +00:00
|
|
|
.equ CPSR_USER_MODE, 0x10
|
2008-03-11 02:45:13 +00:00
|
|
|
.equ CPSR_FIQ_MODE, 0x11
|
|
|
|
.equ CPSR_IRQ_MODE, 0x12
|
|
|
|
.equ CPSR_SVC_MODE, 0x13
|
|
|
|
.equ CPSR_ABORT_MODE, 0x17
|
|
|
|
.equ CPSR_UND_MODE, 0x1B
|
2008-03-11 16:13:43 +00:00
|
|
|
.equ CPSR_MODES, 0x1F
|
2008-03-11 02:45:13 +00:00
|
|
|
|
2008-02-12 05:55:12 +00:00
|
|
|
|
2008-02-12 16:32:13 +00:00
|
|
|
/*
|
|
|
|
* C1 Register Values
|
|
|
|
*/
|
2008-02-12 05:55:12 +00:00
|
|
|
.equ C1_MMU_CONTROL, 0x01
|
|
|
|
.equ C1_ALIGNMENT_CONTROL, 0x02
|
|
|
|
.equ C1_DCACHE_CONTROL, 0x04
|
|
|
|
.equ C1_ICACHE_CONTROL, 0x1000
|
|
|
|
.equ C1_VECTOR_CONTROL, 0x2000
|
2008-02-12 16:22:01 +00:00
|
|
|
|
2008-02-12 16:32:13 +00:00
|
|
|
/*
|
|
|
|
* Loader Parameter Block Offsets
|
|
|
|
*/
|
2008-02-12 16:22:01 +00:00
|
|
|
.equ LpbKernelStack, 0x18
|
2008-03-11 02:45:13 +00:00
|
|
|
.equ LpbPanicStack, 0x74
|
|
|
|
.equ LpbInterruptStack, 0x5C
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Trap Frame offsets
|
|
|
|
*/
|
- Rewrite the low-level trap/exception/system call code from the ground up:
- Do not corrupt the stack anymore
- Use a consistent trap frame layout (enable OldIrql and PreviousMode, and set the 0xBADB0D00 debug mark)
- Use slower but more correct trap prolog/epilog code for now.
- Generalize all prolog/epilog code into macros just like on x86. As a result, traps are now 6 lines of code.
- Rewrite the system call interface from the ground up:
- System calls didn't actually work: a debug print made the stack layout magical enough so that they didn't normally crush, but only slowly ate the stack.
- Copying arguments from caller to system call was, as the comment on the original code so aptly put it, "total shit".
- Due to ABI concerns, and to provide an actual template on how you're -supposed- to implement something like system calls on RISC processors, we now use
a model similar to BSD, but about ten times better (with that much less code too). We'll document it later on the RosPSG Wiki.
- This code probably contains some of the most vile-yet-elegant macro magic ever written for such low-level code as system call dispatching.
- The result of all this is that we're at the same place as before (RamdiskAddDevice needs to be implemented by the Ramdisk guys) but with a sane low-level
backend that isn't slowly eating away the stack, corrupting data, and basically working through random chance.
- Move timebase code from stubs.c to its own file, time.c.
- Silence multiple debug prints and fix a corrupted debug print in KiSystemStartup.
svn path=/trunk/; revision=34366
2008-07-08 09:11:44 +00:00
|
|
|
.equ TrDbgArgMark, 0x00
|
|
|
|
.equ TrR0, 0x04
|
|
|
|
.equ TrR1, 0x08
|
|
|
|
.equ TrR2, 0x0C
|
|
|
|
.equ TrR3, 0x10
|
|
|
|
.equ TrR4, 0x14
|
|
|
|
.equ TrR5, 0x18
|
|
|
|
.equ TrR6, 0x1C
|
|
|
|
.equ TrR7, 0x20
|
|
|
|
.equ TrR8, 0x24
|
|
|
|
.equ TrR9, 0x28
|
|
|
|
.equ TrR10, 0x2C
|
|
|
|
.equ TrR11, 0x30
|
|
|
|
.equ TrR12, 0x34
|
|
|
|
.equ TrUserSp, 0x38
|
|
|
|
.equ TrUserLr, 0x3C
|
|
|
|
.equ TrSvcSp, 0x40
|
|
|
|
.equ TrSvcLr, 0x44
|
|
|
|
.equ TrPc, 0x48
|
|
|
|
.equ TrSpsr, 0x4C
|
2008-07-21 15:55:58 +00:00
|
|
|
.equ TrapFrameLength, (23 * 0x04)
|
2008-02-12 16:22:01 +00:00
|
|
|
|
2008-07-14 03:15:48 +00:00
|
|
|
/*
|
|
|
|
* Exception Frame offsets
|
|
|
|
*/
|
|
|
|
.equ ExR4, 0x00
|
|
|
|
.equ ExR5, 0x04
|
|
|
|
.equ ExR6, 0x08
|
|
|
|
.equ ExR7, 0x0C
|
|
|
|
.equ ExR8, 0x10
|
|
|
|
.equ ExR9, 0x14
|
|
|
|
.equ ExR10, 0x18
|
|
|
|
.equ ExR11, 0x1C
|
|
|
|
.equ ExLr, 0x20
|
|
|
|
.equ ExSpsr, 0x24
|
|
|
|
.equ ExceptionFrameLength, (10 * 0x04)
|
|
|
|
|
2008-02-12 16:32:13 +00:00
|
|
|
/*
|
|
|
|
* PCR
|
|
|
|
*/
|
2008-02-12 16:22:01 +00:00
|
|
|
.equ KiPcr, 0xFFFFF000
|
2008-03-12 18:17:55 +00:00
|
|
|
|
2008-06-11 18:39:44 +00:00
|
|
|
/*
|
|
|
|
* PCR Offsets
|
|
|
|
*/
|
|
|
|
.equ PcCurrentIrql, 0x14C
|
|
|
|
|
2008-06-11 19:13:25 +00:00
|
|
|
/*
|
|
|
|
* KTHREAD Offsets
|
|
|
|
*/
|
|
|
|
.equ ThKernelStack, 0x20
|
|
|
|
|
2008-06-27 03:06:11 +00:00
|
|
|
/*
|
|
|
|
* CONTEXT Offsets
|
|
|
|
*/
|
|
|
|
.equ CONTEXT_FULL, 0x43
|
|
|
|
.equ CsContextFlags, 0x00
|
|
|
|
.equ CsR0, 0x04
|
|
|
|
.equ CsR1, 0x08
|
|
|
|
.equ CsR2, 0x0C
|
|
|
|
.equ CsR3, 0x10
|
|
|
|
.equ CsR4, 0x14
|
|
|
|
.equ CsR5, 0x18
|
|
|
|
.equ CsR6, 0x1C
|
|
|
|
.equ CsR7, 0x20
|
|
|
|
.equ CsR8, 0x24
|
|
|
|
.equ CsR9, 0x28
|
|
|
|
.equ CsR10, 0x2C
|
|
|
|
.equ CsR11, 0x30
|
|
|
|
.equ CsR12, 0x34
|
|
|
|
.equ CsSp, 0x38
|
|
|
|
.equ CsLr, 0x3C
|
|
|
|
.equ CsPc, 0x40
|
|
|
|
.equ CsPsr, 0x44
|
|
|
|
|
2008-07-13 22:40:36 +00:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
|
2008-03-12 18:17:55 +00:00
|
|
|
#else
|
|
|
|
|
|
|
|
/*
|
|
|
|
* CPSR Values
|
|
|
|
*/
|
|
|
|
#define CPSR_THUMB_ENABLE 0x20
|
|
|
|
#define CPSR_FIQ_DISABLE 0x40
|
|
|
|
#define CPSR_IRQ_DISABLE 0x80
|
|
|
|
#define CPSR_USER_MODE 0x10
|
|
|
|
#define CPSR_FIQ_MODE 0x11
|
|
|
|
#define CPSR_IRQ_MODE 0x12
|
|
|
|
#define CPSR_SVC_MODE 0x13
|
|
|
|
#define CPSR_ABORT_MODE 0x17
|
|
|
|
#define CPSR_UND_MODE 0x1B
|
|
|
|
#define CPSR_MODES 0x1F
|
|
|
|
|
|
|
|
#endif
|