Author: tkreuzer
Date: Fri May 30 00:30:38 2014
New Revision: 63501
URL:
http://svn.reactos.org/svn/reactos?rev=63501&view=rev
Log:
[ASM]
- Fix geninc and spec2def to support the MS ARM assembler
- Add an MSVC compatible version of kxarm.h
- autogenerate ksarm.h with geninc.c
- Move some ARM definitions to NDK
Added:
trunk/reactos/include/asm/ksarm.template.h (with props)
trunk/reactos/include/asm/kxarm.h
- copied, changed from r63497, trunk/reactos/ntoskrnl/include/internal/arm/kxarm.h
Removed:
trunk/reactos/ntoskrnl/include/internal/arm/ksarm.h
trunk/reactos/ntoskrnl/include/internal/arm/kxarm.h
Modified:
trunk/reactos/include/asm/CMakeLists.txt
trunk/reactos/include/asm/genincdata.c
trunk/reactos/include/ndk/arm/ketypes.h
trunk/reactos/include/reactos/arm/armddk.h
trunk/reactos/tools/geninc/geninc.c
trunk/reactos/tools/spec2def/spec2def.c
Modified: trunk/reactos/include/asm/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/asm/CMakeLists.txt…
==============================================================================
--- trunk/reactos/include/asm/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/include/asm/CMakeLists.txt [iso-8859-1] Fri May 30 00:30:38 2014
@@ -11,17 +11,19 @@
endif()
if(ARCH STREQUAL "i386")
- set(_filename ks386)
+ set(_filename ks386.inc)
elseif(ARCH STREQUAL "amd64")
- set(_filename ksamd64)
+ set(_filename ksamd64.inc)
+elseif(ARCH STREQUAL "arm")
+ set(_filename ksarm.h)
endif()
get_target_property(genincdata_dll genincdata LOCATION)
add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_filename}.inc
- COMMAND native-geninc ${genincdata_dll} ${CMAKE_CURRENT_BINARY_DIR}/${_filename}.inc
${OPT_MS}
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_filename}
+ COMMAND native-geninc ${genincdata_dll} ${CMAKE_CURRENT_BINARY_DIR}/${_filename}
${OPT_MS}
DEPENDS genincdata native-geninc)
add_custom_target(asm
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_filename}.inc)
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_filename})
Modified: trunk/reactos/include/asm/genincdata.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/asm/genincdata.c?r…
==============================================================================
--- trunk/reactos/include/asm/genincdata.c [iso-8859-1] (original)
+++ trunk/reactos/include/asm/genincdata.c [iso-8859-1] Fri May 30 00:30:38 2014
@@ -74,15 +74,18 @@
ASMGENDATA Table[] =
{
-
+#if defined (_M_IX86) || defined (M_AMD64)
/* PORTABLE CONSTANTS ********************************************************/
#include "ksx.template.h"
+#endif
/* ARCHITECTURE SPECIFIC CONTSTANTS ******************************************/
#ifdef _M_IX86
#include "ks386.template.h"
#elif defined(_M_AMD64)
#include "ksamd64.template.h"
+#elif defined(_M_ARM)
+#include "ksarm.template.h"
#endif
/* End of list */
Added: trunk/reactos/include/asm/ksarm.template.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/asm/ksarm.template…
==============================================================================
--- trunk/reactos/include/asm/ksarm.template.h (added)
+++ trunk/reactos/include/asm/ksarm.template.h [iso-8859-1] Fri May 30 00:30:38 2014
@@ -0,0 +1,105 @@
+
+RAW(""),
+RAW("#include <kxarm.h>"),
+RAW(""),
+
+HEADER("CPSR Values"),
+CONSTANT(CPSR_THUMB_ENABLE),
+CONSTANT(CPSR_FIQ_DISABLE),
+CONSTANT(CPSR_IRQ_DISABLE),
+CONSTANT(CPSR_USER_MODE),
+CONSTANT(CPSR_FIQ_MODE),
+CONSTANT(CPSR_IRQ_MODE),
+CONSTANT(CPSR_SVC_MODE),
+CONSTANT(CPSR_ABORT_MODE),
+CONSTANT(CPSR_UND_MODE),
+CONSTANT(CPSR_MODES),
+
+HEADER("C1 Register Values"),
+CONSTANT(C1_MMU_CONTROL),
+CONSTANT(C1_ALIGNMENT_CONTROL),
+CONSTANT(C1_DCACHE_CONTROL),
+CONSTANT(C1_ICACHE_CONTROL),
+CONSTANT(C1_VECTOR_CONTROL),
+
+HEADER("Loader Parameter Block Offsets"),
+OFFSET(LpbKernelStack, LOADER_PARAMETER_BLOCK, KernelStack),
+OFFSET(LpbPanicStack, LOADER_PARAMETER_BLOCK, u.Arm.PanicStack),
+OFFSET(LpbInterruptStack, LOADER_PARAMETER_BLOCK, u.Arm.InterruptStack),
+
+HEADER("Trap Frame offsets"),
+OFFSET(TrDbgArgMark, KTRAP_FRAME, DbgArgMark),
+OFFSET(TrR0, KTRAP_FRAME, R0),
+OFFSET(TrR1, KTRAP_FRAME, R1),
+OFFSET(TrR2, KTRAP_FRAME, R2),
+OFFSET(TrR3, KTRAP_FRAME, R3),
+OFFSET(TrR4, KTRAP_FRAME, R4),
+OFFSET(TrR5, KTRAP_FRAME, R5),
+OFFSET(TrR6, KTRAP_FRAME, R6),
+OFFSET(TrR7, KTRAP_FRAME, R7),
+OFFSET(TrR8, KTRAP_FRAME, R8),
+OFFSET(TrR9, KTRAP_FRAME, R9),
+OFFSET(TrR10, KTRAP_FRAME, R10),
+OFFSET(TrR11, KTRAP_FRAME, R11),
+OFFSET(TrR12, KTRAP_FRAME, R12),
+OFFSET(TrUserSp, KTRAP_FRAME, UserSp),
+OFFSET(TrUserLr, KTRAP_FRAME, UserLr),
+OFFSET(TrSvcSp, KTRAP_FRAME, SvcSp),
+OFFSET(TrSvcLr, KTRAP_FRAME, SvcLr),
+OFFSET(TrPc, KTRAP_FRAME, Pc),
+OFFSET(TrSpsr, KTRAP_FRAME, Spsr),
+SIZE(TrapFrameLength, KTRAP_FRAME),
+
+HEADER("Exception Frame offsets"),
+OFFSET(ExR4, KEXCEPTION_FRAME, R4),
+OFFSET(ExR5, KEXCEPTION_FRAME, R5),
+OFFSET(ExR6, KEXCEPTION_FRAME, R6),
+OFFSET(ExR7, KEXCEPTION_FRAME, R7),
+OFFSET(ExR8, KEXCEPTION_FRAME, R8),
+OFFSET(ExR9, KEXCEPTION_FRAME, R9),
+OFFSET(ExR10, KEXCEPTION_FRAME, R10),
+OFFSET(ExR11, KEXCEPTION_FRAME, R11),
+OFFSET(ExLr, KEXCEPTION_FRAME, Lr),
+OFFSET(ExSpsr, KEXCEPTION_FRAME, Psr), // name?
+SIZE(ExceptionFrameLength, KEXCEPTION_FRAME),
+
+HEADER("PCR"),
+CONSTANTX(KiPcr, 0xFFFFF000),
+
+HEADER("PCR Offsets"),
+//OFFSET(PcCurrentIrql, KPCR, CurrentIrql),
+
+HEADER("KTHREAD Offsets"),
+OFFSET(ThKernelStack, KTHREAD, KernelStack),
+
+HEADER("CONTEXT Offsets"),
+OFFSET(CsContextFlags, CONTEXT, ContextFlags),
+OFFSET(CsR0, CONTEXT, R0),
+OFFSET(CsR1, CONTEXT, R1),
+OFFSET(CsR2, CONTEXT, R2),
+OFFSET(CsR3, CONTEXT, R3),
+OFFSET(CsR4, CONTEXT, R4),
+OFFSET(CsR5, CONTEXT, R5),
+OFFSET(CsR6, CONTEXT, R6),
+OFFSET(CsR7, CONTEXT, R7),
+OFFSET(CsR8, CONTEXT, R8),
+OFFSET(CsR9, CONTEXT, R9),
+OFFSET(CsR10, CONTEXT, R10),
+OFFSET(CsR11, CONTEXT, R11),
+OFFSET(CsR12, CONTEXT, R12),
+OFFSET(CsSp, CONTEXT, Sp),
+OFFSET(CsLr, CONTEXT, Lr),
+OFFSET(CsPc, CONTEXT, Pc),
+OFFSET(CsPsr, CONTEXT, Psr),
+
+CONSTANT(CONTEXT_FULL),
+
+HEADER("DebugService Control Types"),
+CONSTANT(BREAKPOINT_BREAK),
+CONSTANT(BREAKPOINT_PRINT),
+CONSTANT(BREAKPOINT_PROMPT),
+CONSTANT(BREAKPOINT_LOAD_SYMBOLS),
+CONSTANT(BREAKPOINT_UNLOAD_SYMBOLS),
+CONSTANT(BREAKPOINT_COMMAND_STRING),
+
+
Propchange: trunk/reactos/include/asm/ksarm.template.h
------------------------------------------------------------------------------
svn:eol-style = native
Copied: trunk/reactos/include/asm/kxarm.h (from r63497,
trunk/reactos/ntoskrnl/include/internal/arm/kxarm.h)
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/asm/kxarm.h?p2=tru…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/arm/kxarm.h [iso-8859-1] (original)
+++ trunk/reactos/include/asm/kxarm.h [iso-8859-1] Fri May 30 00:30:38 2014
@@ -1,3 +1,81 @@
+
+
+#ifdef _MSC_VER
+
+ /* Globals */
+ GBLS AreaName
+ GBLS FuncName
+ GBLS PrologName
+ GBLS FuncEndName
+AreaName SETS "|.text|"
+
+ MACRO
+ TEXTAREA
+ AREA |.text|,ALIGN=2,CODE,READONLY
+AreaName SETS "|.text|"
+ MEND
+
+ MACRO
+ NESTED_ENTRY $Name
+FuncName SETS "$Name"
+PrologName SETS "$Name":CC:"_Prolog"
+FuncEndName SETS "$Name":CC:"_end"
+ AREA |.pdata|,ALIGN=2,PDATA
+ ALIGN 2
+ EXPORT $FuncName [FUNC]
+$FuncName
+ ROUT
+ MEND
+
+ MACRO
+ PROLOG_END
+$PrologName
+ MEND
+
+ MACRO
+ ENTRY_END $Name
+$FuncEndName
+ MEND
+
+ MACRO
+ LEAF_ENTRY $Name
+FuncName SETS "$Name"
+PrologName SETS "Invalid Prolog"
+FuncEndName SETS "$Name":CC:"_end"
+ ALIGN 2
+ EXPORT $FuncName [FUNC]
+$FuncName
+ ROUT
+ MEND
+
+ MACRO
+ LEAF_END $Name
+$FuncEndName
+ MEND
+
+ MACRO
+ TRAP_PROLOG $Abort
+ fixme
+ MEND
+
+ MACRO
+ SYSCALL_PROLOG $Abort
+ fixme
+ MEND
+
+ MACRO
+ TRAP_EPILOG $SystemCall
+ fixme
+ MEND
+
+#else
+
+/* Compatibility define */
+#define EQU .equ
+
+.macro IMPORT Name
+ /* Ignore */
+.endm
.macro TEXTAREA
.section .text, "rx"
@@ -5,18 +83,21 @@
.endm
.macro NESTED_ENTRY Name
- .global &Name
+FuncName .equ &Name
+PrologName .equ &Name&_Prolog
+FuncEndName .equ &Name&_end
+ .global &FuncName
.align 2
- .func &Name
- &Name:
-.endm
-
-.macro PROLOG_END Name
- prolog_&Name:
+ .func &FuncName
+ &FuncName:
+.endm
+
+.macro PROLOG_END
+ \PrologName:
.endm
.macro ENTRY_END Name
- end_&Name:
+ &FuncEndName:
.endfunc
.endm
@@ -30,57 +111,39 @@
sub lr, lr, #4
.endif
- //
// Save the bottom 4 registers
- //
stmdb sp, {r0-r3}
-
- //
+
// Save the abort lr, sp, spsr, cpsr
- //
mov r0, lr
mov r1, sp
mrs r2, cpsr
mrs r3, spsr
-
- //
+
// Switch to SVC mode
- //
bic r2, r2, #CPSR_MODES
orr r2, r2, #CPSR_SVC_MODE
msr cpsr_c, r2
-
- //
+
// Save the SVC sp before we modify it
- //
mov r2, sp
-
- //
+
// Make space for the trap frame
- //
sub sp, sp, #TrapFrameLength
-
- //
+
// Save abt32 state
- //
str r0, [sp, #TrPc]
str lr, [sp, #TrSvcLr]
- str r2, [sp, #TrSvcSp]
-
- //
+ str r2, [sp, #TrSvcSp]
+
// Restore the saved SPSR
- //
msr spsr_all, r3
-
- //
+
// Restore our 4 registers
- //
ldmdb r1, {r0-r3}
-
- //
+
// Build trap frame
// FIXME: Change to stmdb later
- //
str r0, [sp, #TrR0]
str r1, [sp, #TrR1]
str r2, [sp, #TrR2]
@@ -102,17 +165,13 @@
ldr r0, =0xBADB0D00
str r0, [sp, #TrDbgArgMark]
.endm
-
+
.macro SYSCALL_PROLOG
- //
// Make space for the trap frame
- //
sub sp, sp, #TrapFrameLength
-
- //
+
// Build trap frame
// FIXME: Change to stmdb later
- //
str r0, [sp, #TrR0]
str r1, [sp, #TrR1]
str r2, [sp, #TrR2]
@@ -136,26 +195,20 @@
ldr r0, =0xBADB0D00
str r0, [sp, #TrDbgArgMark]
.endm
-
+
.macro TRAP_EPILOG SystemCall
- //
// ASSERT(TrapFrame->DbgArgMark == 0xBADB0D00)
- //
ldr r0, [sp, #TrDbgArgMark]
ldr r1, =0xBADB0D00
cmp r0, r1
bne 1f
-
- //
+
// Get the SPSR and restore it
- //
ldr r0, [sp, #TrSpsr]
msr spsr_all, r0
-
- //
+
// Restore the registers
// FIXME: Use LDMIA later
- //
mov r0, sp
add r0, r0, #TrUserSp
ldm r0, {sp, lr}^
@@ -172,10 +225,8 @@
ldr r10, [sp, #TrR10]
ldr r11, [sp, #TrR11]
ldr r12, [sp, #TrR12]
-
- //
+
// Restore program execution state
- //
.if \SystemCall
ldr lr, [sp, #TrPc]
add sp, sp, #TrapFrameLength
@@ -187,3 +238,7 @@
1:
b .
.endm
+
+#endif
+
+
Modified: trunk/reactos/include/ndk/arm/ketypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/arm/ketypes.h?…
==============================================================================
--- trunk/reactos/include/ndk/arm/ketypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/arm/ketypes.h [iso-8859-1] Fri May 30 00:30:38 2014
@@ -26,6 +26,29 @@
//
// Dependencies
//
+
+//
+// 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
+
+//
+// C1 Register Values
+//
+#define C1_MMU_CONTROL 0x01
+#define C1_ALIGNMENT_CONTROL 0x02
+#define C1_DCACHE_CONTROL 0x04
+#define C1_ICACHE_CONTROL 0x1000
+#define C1_VECTOR_CONTROL 0x2000
//
// IPI Types
Modified: trunk/reactos/include/reactos/arm/armddk.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/arm/armddk…
==============================================================================
--- trunk/reactos/include/reactos/arm/armddk.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/arm/armddk.h [iso-8859-1] Fri May 30 00:30:38 2014
@@ -228,6 +228,7 @@
#define RESULT_NEGATIVE 1
#define RESULT_POSITIVE 2
+#if 0
DECLSPEC_IMPORT
VOID
__fastcall
@@ -240,6 +241,7 @@
__fastcall
KfAcquireSpinLock(
IN OUT ULONG_PTR* SpinLock);
+#endif
#ifndef _WINNT_
//
Removed: 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 (removed)
@@ -1,146 +0,0 @@
-/*
- * PROJECT: ReactOS Kernel
- * LICENSE: BSD - See COPYING.ARM in the top level directory
- * FILE: ntoskrnl/include/internal/arm/ksarm.h
- * PURPOSE: Definitions and offsets for ARM Assembly and C code
- * PROGRAMMERS: ReactOS Portable Systems Group
- */
-
-#ifdef _ASM_
-
-/*
- * CPSR Values
- */
-.equ CPSR_THUMB_ENABLE, 0x20
-.equ CPSR_FIQ_DISABLE, 0x40
-.equ CPSR_IRQ_DISABLE, 0x80
-.equ CPSR_USER_MODE, 0x10
-.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
-.equ CPSR_MODES, 0x1F
-
-
-/*
- * C1 Register Values
- */
-.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
-
-/*
- * Loader Parameter Block Offsets
- */
-.equ LpbKernelStack, 0x18
-.equ LpbPanicStack, 0x74
-.equ LpbInterruptStack, 0x5C
-
-/*
- * Trap Frame offsets
- */
-.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
-.equ TrapFrameLength, (23 * 0x04)
-
-/*
- * 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)
-
-/*
- * PCR
- */
-.equ KiPcr, 0xFFFFF000
-
-/*
- * PCR Offsets
- */
-.equ PcCurrentIrql, 0x14C
-
-/*
- * KTHREAD Offsets
- */
-.equ ThKernelStack, 0x20
-
-/*
- * 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
-
-/*
- * 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
-
-/*
- * 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
Removed: trunk/reactos/ntoskrnl/include/internal/arm/kxarm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/arm/kxarm.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/arm/kxarm.h (removed)
@@ -1,189 +0,0 @@
-
-.macro TEXTAREA
- .section .text, "rx"
- .align 2
-.endm
-
-.macro NESTED_ENTRY Name
- .global &Name
- .align 2
- .func &Name
- &Name:
-.endm
-
-.macro PROLOG_END Name
- prolog_&Name:
-.endm
-
-.macro ENTRY_END Name
- end_&Name:
- .endfunc
-.endm
-
-.macro TRAP_PROLOG Abort
- //
- // Fixup lr
- //
-.if \Abort
- sub lr, lr, #8
-.else
- sub lr, lr, #4
-.endif
-
- //
- // Save the bottom 4 registers
- //
- stmdb sp, {r0-r3}
-
- //
- // Save the abort lr, sp, spsr, cpsr
- //
- mov r0, lr
- mov r1, sp
- mrs r2, cpsr
- mrs r3, spsr
-
- //
- // Switch to SVC mode
- //
- bic r2, r2, #CPSR_MODES
- orr r2, r2, #CPSR_SVC_MODE
- msr cpsr_c, r2
-
- //
- // Save the SVC sp before we modify it
- //
- mov r2, sp
-
- //
- // Make space for the trap frame
- //
- sub sp, sp, #TrapFrameLength
-
- //
- // Save abt32 state
- //
- str r0, [sp, #TrPc]
- str lr, [sp, #TrSvcLr]
- str r2, [sp, #TrSvcSp]
-
- //
- // Restore the saved SPSR
- //
- msr spsr_all, r3
-
- //
- // Restore our 4 registers
- //
- ldmdb r1, {r0-r3}
-
- //
- // Build trap frame
- // FIXME: Change to stmdb later
- //
- str r0, [sp, #TrR0]
- str r1, [sp, #TrR1]
- str r2, [sp, #TrR2]
- str r3, [sp, #TrR3]
- str r4, [sp, #TrR4]
- str r5, [sp, #TrR5]
- str r6, [sp, #TrR6]
- str r7, [sp, #TrR7]
- str r8, [sp, #TrR8]
- str r9, [sp, #TrR9]
- str r10, [sp, #TrR10]
- str r11, [sp, #TrR11]
- str r12, [sp, #TrR12]
- mov r12, sp
- add r12, r12, #TrUserSp
- stm r12, {sp, lr}^
- mrs r0, spsr_all
- str r0, [sp, #TrSpsr]
- ldr r0, =0xBADB0D00
- str r0, [sp, #TrDbgArgMark]
-.endm
-
-.macro SYSCALL_PROLOG
- //
- // Make space for the trap frame
- //
- sub sp, sp, #TrapFrameLength
-
- //
- // Build trap frame
- // FIXME: Change to stmdb later
- //
- str r0, [sp, #TrR0]
- str r1, [sp, #TrR1]
- str r2, [sp, #TrR2]
- str r3, [sp, #TrR3]
- str r4, [sp, #TrR4]
- str r5, [sp, #TrR5]
- str r6, [sp, #TrR6]
- str r7, [sp, #TrR7]
- str r8, [sp, #TrR8]
- str r9, [sp, #TrR9]
- str r10, [sp, #TrR10]
- str r11, [sp, #TrR11]
- str r12, [sp, #TrR12]
- mov r12, sp
- add r12, r12, #TrUserSp
- stm r12, {sp, lr}^
- str sp, [sp, #TrSvcSp]
- str lr, [sp, #TrPc]
- mrs r0, spsr_all
- str r0, [sp, #TrSpsr]
- ldr r0, =0xBADB0D00
- str r0, [sp, #TrDbgArgMark]
-.endm
-
-.macro TRAP_EPILOG SystemCall
- //
- // ASSERT(TrapFrame->DbgArgMark == 0xBADB0D00)
- //
- ldr r0, [sp, #TrDbgArgMark]
- ldr r1, =0xBADB0D00
- cmp r0, r1
- bne 1f
-
- //
- // Get the SPSR and restore it
- //
- ldr r0, [sp, #TrSpsr]
- msr spsr_all, r0
-
- //
- // Restore the registers
- // FIXME: Use LDMIA later
- //
- mov r0, sp
- add r0, r0, #TrUserSp
- ldm r0, {sp, lr}^
- ldr r0, [sp, #TrR0]
- ldr r1, [sp, #TrR1]
- ldr r2, [sp, #TrR2]
- ldr r3, [sp, #TrR3]
- ldr r4, [sp, #TrR4]
- ldr r5, [sp, #TrR5]
- ldr r6, [sp, #TrR6]
- ldr r7, [sp, #TrR7]
- ldr r8, [sp, #TrR8]
- ldr r9, [sp, #TrR9]
- ldr r10, [sp, #TrR10]
- ldr r11, [sp, #TrR11]
- ldr r12, [sp, #TrR12]
-
- //
- // Restore program execution state
- //
-.if \SystemCall
- ldr lr, [sp, #TrPc]
- add sp, sp, #TrapFrameLength
- movs pc, lr
-.else
- add sp, sp, #TrSvcSp
- ldmia sp, {sp, lr, pc}^
-.endif
-1:
- b .
-.endm
Modified: trunk/reactos/tools/geninc/geninc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/geninc/geninc.c?rev=…
==============================================================================
--- trunk/reactos/tools/geninc/geninc.c [iso-8859-1] (original)
+++ trunk/reactos/tools/geninc/geninc.c [iso-8859-1] Fri May 30 00:30:38 2014
@@ -188,7 +188,14 @@
case TYPE_CONSTANT:
if (ms_format)
{
- fprintf(output, "%s equ 0%"PRIx64"h\n",
data.Name, data.Value);
+ if (Machine == IMAGE_FILE_MACHINE_ARMNT)
+ {
+ fprintf(output, "%s equ 0x%"PRIx64"\n",
data.Name, data.Value);
+ }
+ else
+ {
+ fprintf(output, "%s equ 0%"PRIx64"h\n",
data.Name, data.Value);
+ }
}
else
{
Modified: trunk/reactos/tools/spec2def/spec2def.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/spec2def/spec2def.c?…
==============================================================================
--- trunk/reactos/tools/spec2def/spec2def.c [iso-8859-1] (original)
+++ trunk/reactos/tools/spec2def/spec2def.c [iso-8859-1] Fri May 30 00:30:38 2014
@@ -258,7 +258,13 @@
fprintf(file, "; File generated automatically, do not edit! \n\n");
if (giArch == ARCH_X86)
+ {
fprintf(file, ".586\n.model flat\n");
+ }
+ else if (giArch == ARCH_ARM)
+ {
+ fprintf(file, "#include <kxarm.h>\n TEXTAREA\n");
+ }
fprintf(file, ".code\n");
}