From 1490c31014745abd93c71eb0de09e320b43ffb55 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 20 Aug 2011 10:39:28 +0000 Subject: [PATCH] [ASM] - prefix labels only on x86 - improve syscall stub code svn path=/trunk/; revision=53333 --- reactos/include/asm/asm.inc | 8 ++++++++ reactos/include/asm/syscalls.inc | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/reactos/include/asm/asm.inc b/reactos/include/asm/asm.inc index db0acdb525e..17c57c30df4 100644 --- a/reactos/include/asm/asm.inc +++ b/reactos/include/asm/asm.inc @@ -32,13 +32,21 @@ rip = 0 /* To avoid reverse syntax we provide a new macro .PROC, replacing PROC... */ .PROC MACRO name +#ifdef _M_IX86 _&name PROC +#else + &name PROC FRAME +#endif ENDM #define FUNC .PROC /* ... and .ENDP, replacing ENDP */ .ENDP MACRO name +#ifdef _M_IX86 _&name ENDP +#else + &name ENDP +#endif ENDM #define ENDFUNC .ENDP diff --git a/reactos/include/asm/syscalls.inc b/reactos/include/asm/syscalls.inc index 85ef7a447a7..aad93da82e9 100644 --- a/reactos/include/asm/syscalls.inc +++ b/reactos/include/asm/syscalls.inc @@ -3,12 +3,14 @@ #define KUSER_SHARED_SYSCALL HEX(7ffe0300) #define KGDT_R0_CODE 8 MACRO(STUBCODE_U, SyscallId, StackBytes) + FPO 0, 0, 0, 0, 0, FRAME_FPO mov eax, SyscallId mov ecx, KUSER_SHARED_SYSCALL call dword ptr [ecx] ret StackBytes ENDM MACRO(STUBCODE_K, SyscallId, StackBytes) + FPO 0, 0, 0, 0, 0, FRAME_FPO mov eax, SyscallId lea edx, [esp + 4] pushfd @@ -18,12 +20,14 @@ MACRO(STUBCODE_K, SyscallId, StackBytes) ENDM #elif defined(_M_AMD64) MACRO(STUBCODE_U, SyscallId, StackBytes) + .ENDPROLOG mov eax, SyscallId mov r10, rcx syscall ret StackBytes ENDM MACRO(STUBCODE_K, SyscallId, StackBytes) + .ENDPROLOG mov eax, SyscallId call KiSystemService ret StackBytes @@ -74,7 +78,6 @@ ENDM MACRO(START_PROC, Name, Stackbytes) PUBLIC _&Name&@&Stackbytes .PROC &Name&@&Stackbytes - FPO 0, 0, 0, 0, 0, FRAME_FPO ENDM MACRO(END_PROC, Name, Stackbytes) .ENDP &Name&@&Stackbytes @@ -87,7 +90,6 @@ ENDM MACRO(START_PROC, Name, Stackbytes) PUBLIC &Name .PROC &Name - FPO 0, 0, 0, 0, 0, FRAME_FPO ENDM MACRO(END_PROC, Name, Stackbytes) .ENDP &Name -- 2.17.1