[ros-diffs] [tkreuzer] 54112: [ASM] Improve .proc / .endproc syntax, so that the full symbolic name is passed, which allows to create fastcall symbols. Remove the need to pass the function name to .endp
tkreuzer at svn.reactos.org
tkreuzer at svn.reactos.org
Thu Oct 13 15:16:29 UTC 2011
Author: tkreuzer
Date: Thu Oct 13 15:16:29 2011
New Revision: 54112
URL: http://svn.reactos.org/svn/reactos?rev=54112&view=rev
Log:
[ASM]
Improve .proc / .endproc syntax, so that the full symbolic name is passed, which allows to create fastcall symbols. Remove the need to pass the function name to .endp
Modified:
trunk/reactos/dll/ntdll/dispatch/i386/dispatch.S
trunk/reactos/dll/win32/kernel32/client/i386/fiber.S
trunk/reactos/dll/win32/rpcrt4/msvc.S
trunk/reactos/hal/halx86/apic/tsccal.S
trunk/reactos/include/asm/asm.inc
trunk/reactos/include/asm/syscalls.inc
trunk/reactos/include/reactos/asm.inc
trunk/reactos/lib/rtl/i386/debug_asm.S
trunk/reactos/lib/rtl/i386/rtlswap.S
trunk/reactos/lib/sdk/crt/string/i386/tcscpy.inc
trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S
trunk/reactos/ntoskrnl/ke/i386/trap.s
Modified: trunk/reactos/dll/ntdll/dispatch/i386/dispatch.S
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/dispatch/i386/dispatch.S?rev=54112&r1=54111&r2=54112&view=diff
==============================================================================
--- trunk/reactos/dll/ntdll/dispatch/i386/dispatch.S [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/dispatch/i386/dispatch.S [iso-8859-1] Thu Oct 13 15:16:29 2011
@@ -184,7 +184,7 @@
PUBLIC _KiUserExceptionDispatcher at 8
-.PROC KiUserExceptionDispatcher at 8
+.PROC _KiUserExceptionDispatcher at 8
FPO 0, 0, 0, 0, 0, FRAME_FPO
/* Clear direction flag */
@@ -241,10 +241,10 @@
call _RtlRaiseException at 4
ret 8
-.ENDP KiUserExceptionDispatcher at 8
+.ENDP
PUBLIC _KiIntSystemCall at 0
-.PROC KiIntSystemCall at 0
+.PROC _KiIntSystemCall at 0
FPO 0, 0, 0, 0, 0, FRAME_FPO
/* Set stack in EDX and do the interrupt */
@@ -254,26 +254,26 @@
/* Return to caller */
ret
-.ENDP KiIntSystemCall at 0
+.ENDP
PUBLIC _KiFastSystemCall at 0
-.PROC KiFastSystemCall at 0
+.PROC _KiFastSystemCall at 0
FPO 0, 0, 0, 0, 0, FRAME_FPO
/* Put ESP in EDX and do the SYSENTER */
mov edx, esp
sysenter
-.ENDP KiFastSystemCall at 0
+.ENDP
PUBLIC _KiFastSystemCallRet at 0
-.PROC KiFastSystemCallRet at 0
+.PROC _KiFastSystemCallRet at 0
FPO 0, 0, 0, 0, 0, FRAME_FPO
/* Just return to caller */
ret
-.ENDP KiFastSystemCallRet at 0
+.ENDP
PUBLIC _RtlpGetStackLimits at 8
_RtlpGetStackLimits at 8:
Modified: trunk/reactos/dll/win32/kernel32/client/i386/fiber.S
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/i386/fiber.S?rev=54112&r1=54111&r2=54112&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/i386/fiber.S [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/i386/fiber.S [iso-8859-1] Thu Oct 13 15:16:29 2011
@@ -15,7 +15,7 @@
.code
PUBLIC _BaseFiberStartup at 0
-.PROC BaseFiberStartup at 0
+.PROC _BaseFiberStartup at 0
/* Frame pointer is zeroed */
FPO 0, 0, 0, 0, 0, FRAME_FPO
@@ -25,7 +25,7 @@
push dword ptr [eax+FIBER_CONTEXT_EBX] /* Parameter */
push dword ptr [eax+FIBER_CONTEXT_EAX] /* Start Address */
call _BaseThreadStartup at 8
-.ENDP BaseFiberStartup at 0
+.ENDP
PUBLIC _SwitchToFiber at 4
@@ -135,6 +135,7 @@
/* Jump to new fiber */
mov esp, [ecx+FIBER_CONTEXT_ESP]
ret 4
+
+
END
-
/* EOF */
Modified: trunk/reactos/dll/win32/rpcrt4/msvc.S
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rpcrt4/msvc.S?rev=54112&r1=54111&r2=54112&view=diff
==============================================================================
--- trunk/reactos/dll/win32/rpcrt4/msvc.S [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/rpcrt4/msvc.S [iso-8859-1] Thu Oct 13 15:16:29 2011
@@ -63,7 +63,7 @@
call ndr_client_call
add rsp, 38h
ret
-ENDFUNC call_stubless_func
+ENDFUNC
PUBLIC call_server_func
FUNC call_server_func
@@ -102,7 +102,7 @@
pop rsi
pop rbp
ret
-ENDFUNC call_server_func
+ENDFUNC
PUBLIC NdrClientCall2
@@ -121,7 +121,7 @@
add rsp, 28h
ret
-ENDFUNC NdrClientCall2
+ENDFUNC
EXTERN ndr_async_client_call:PROC
PUBLIC NdrAsyncClientCall
@@ -139,7 +139,7 @@
add rsp, 28h
ret
-ENDFUNC NdrAsyncClientCall
+ENDFUNC
#endif
Modified: trunk/reactos/hal/halx86/apic/tsccal.S
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/apic/tsccal.S?rev=54112&r1=54111&r2=54112&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/apic/tsccal.S [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/apic/tsccal.S [iso-8859-1] Thu Oct 13 15:16:29 2011
@@ -100,7 +100,7 @@
pop rbx
pop rax
iretq
-ENDFUNC TscCalibrationISR
+ENDFUNC
#endif
END
Modified: trunk/reactos/include/asm/asm.inc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/asm/asm.inc?rev=54112&r1=54111&r2=54112&view=diff
==============================================================================
--- trunk/reactos/include/asm/asm.inc [iso-8859-1] (original)
+++ trunk/reactos/include/asm/asm.inc [iso-8859-1] Thu Oct 13 15:16:29 2011
@@ -32,21 +32,18 @@
/* To avoid reverse syntax we provide a new macro .PROC, replacing PROC... */
.PROC MACRO name
+__current_function_name EQU %name
#ifdef _M_IX86
- _&name PROC
+ %name PROC
#else
- &name PROC FRAME
+ %name PROC FRAME
#endif
ENDM
#define FUNC .PROC
/* ... and .ENDP, replacing ENDP */
-.ENDP MACRO name
-#ifdef _M_IX86
- _&name ENDP
-#else
- &name ENDP
-#endif
+.ENDP MACRO
+ %__current_function_name ENDP
ENDM
#define ENDFUNC .ENDP
@@ -203,17 +200,17 @@
.macro .PROC name
.func \name
#ifdef _X86_
+ /* x86 gas expects a label with _ prefix */
_\name:
-#else
+#endif
\name:
-#endif
.cfi_startproc
.equ cfa_current_offset, -8
.endm
#define FUNC .PROC
/* ... and .ENDP, replacing ENDP */
-.macro .ENDP name
+.macro .ENDP
.cfi_endproc
.endfunc
.endm
Modified: trunk/reactos/include/asm/syscalls.inc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/asm/syscalls.inc?rev=54112&r1=54111&r2=54112&view=diff
==============================================================================
--- trunk/reactos/include/asm/syscalls.inc [iso-8859-1] (original)
+++ trunk/reactos/include/asm/syscalls.inc [iso-8859-1] Thu Oct 13 15:16:29 2011
@@ -77,10 +77,7 @@
ENDM
MACRO(START_PROC, Name, Stackbytes)
PUBLIC _&Name&@&Stackbytes
- .PROC &Name&@&Stackbytes
-ENDM
-MACRO(END_PROC, Name, Stackbytes)
- .ENDP &Name&@&Stackbytes
+ .PROC _&Name&@&Stackbytes
ENDM
#else
MACRO(MAKE_LABEL, Name, Stackbytes)
@@ -91,9 +88,6 @@
PUBLIC &Name
.PROC &Name
ENDM
-MACRO(END_PROC, Name, Stackbytes)
- .ENDP &Name
-ENDM
#endif
MACRO(STUB_U, Name, ArgCount)
@@ -101,7 +95,7 @@
MAKE_LABEL Zw&Name, %Stackbytes
START_PROC Nt&Name, %Stackbytes
STUBCODE_U SyscallId, %Stackbytes
- END_PROC Nt&Name, %Stackbytes
+ .ENDP
SyscallId = SyscallId + 1
ENDM
@@ -109,6 +103,6 @@
Stackbytes = 4 * &ArgCount
START_PROC Zw&Name, %Stackbytes
STUBCODE_K SyscallId, %Stackbytes
- END_PROC Zw&Name, %Stackbytes
+ .ENDP
SyscallId = SyscallId + 1
ENDM
Modified: trunk/reactos/include/reactos/asm.inc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/asm.inc?rev=54112&r1=54111&r2=54112&view=diff
==============================================================================
--- trunk/reactos/include/reactos/asm.inc [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/asm.inc [iso-8859-1] Thu Oct 13 15:16:29 2011
@@ -32,14 +32,20 @@
/* To avoid reverse syntax we provide a new macro .PROC, replacing PROC... */
.PROC MACRO name
- name PROC FRAME
- _name:
-ENDM
+__current_function_name EQU %name
+#ifdef _M_IX86
+ %name PROC
+#else
+ %name PROC FRAME
+#endif
+ENDM
+#define FUNC .PROC
/* ... and .ENDP, replacing ENDP */
-.ENDP MACRO name
- name ENDP
-ENDM
+.ENDP MACRO
+ %__current_function_name ENDP
+ENDM
+#define ENDFUNC .ENDP
/* check http://msdn.microsoft.com/en-us/library/9c9k076y%28VS.80%29.aspx
and http://msdn.microsoft.com/en-us/library/ms679352%28VS.85%29.aspx */
@@ -150,17 +156,17 @@
.macro .PROC name
.func \name
#ifdef _X86_
+ /* x86 gas expects a label with _ prefix */
_\name:
-#else
+#endif
\name:
-#endif
.cfi_startproc
.equ cfa_current_offset, -8
.endm
#define FUNC .PROC
/* ... and .ENDP, replacing ENDP */
-.macro .ENDP name
+.macro .ENDP
.cfi_endproc
.endfunc
.endm
Modified: trunk/reactos/lib/rtl/i386/debug_asm.S
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/i386/debug_asm.S?rev=54112&r1=54111&r2=54112&view=diff
==============================================================================
--- trunk/reactos/lib/rtl/i386/debug_asm.S [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/i386/debug_asm.S [iso-8859-1] Thu Oct 13 15:16:29 2011
@@ -22,31 +22,31 @@
.code
-FUNC DbgBreakPointNoBugCheck at 0
+FUNC _DbgBreakPointNoBugCheck at 0
FPO 0, 0, 0, 0, 0, FRAME_FPO
int 3
ret
-ENDFUNC DbgBreakPointNoBugCheck at 0
+ENDFUNC
_DbgUserBreakPoint at 0:
-FUNC DbgBreakPoint at 0
+FUNC _DbgBreakPoint at 0
FPO 0, 0, 0, 0, 0, FRAME_FPO
int 3
ret
-ENDFUNC DbgBreakPoint at 0
+ENDFUNC
-FUNC DbgBreakPointWithStatus at 4
+FUNC _DbgBreakPointWithStatus at 4
FPO 0, 1, 0, 0, 0, FRAME_FPO
mov eax, [esp+4]
-ENDFUNC DbgBreakPointWithStatus at 4
+ENDFUNC
-FUNC RtlpBreakWithStatusInstruction at 0
+FUNC _RtlpBreakWithStatusInstruction at 0
FPO 0, 0, 0, 0, 0, FRAME_FPO
int 3
ret 4
-ENDFUNC RtlpBreakWithStatusInstruction at 0
+ENDFUNC
-FUNC DebugService2 at 12
+FUNC _DebugService2 at 12
FPO 0, 3, 3, 0, 1, FRAME_NONFPO
/* Setup the stack */
@@ -63,9 +63,9 @@
/* Restore stack */
pop ebp
ret 12
-ENDFUNC DebugService2 at 12
+ENDFUNC
-FUNC DebugService at 20
+FUNC _DebugService at 20
FPO 0, 5, 3, 0, 1, FRAME_NONFPO
/* Setup the stack */
@@ -92,6 +92,6 @@
/* Return */
pop ebp
ret 20
-ENDFUNC DebugService at 20
+ENDFUNC
END
Modified: trunk/reactos/lib/rtl/i386/rtlswap.S
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/i386/rtlswap.S?rev=54112&r1=54111&r2=54112&view=diff
==============================================================================
--- trunk/reactos/lib/rtl/i386/rtlswap.S [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/i386/rtlswap.S [iso-8859-1] Thu Oct 13 15:16:29 2011
@@ -16,28 +16,25 @@
/* FUNCTIONS ***************************************************************/
.code
- at RtlUshortByteSwap@4:
-FUNC RtlUshortByteSwap
+FUNC @RtlUshortByteSwap at 4
FPO 0, 0, 0, 0, 0, FRAME_FPO
/* Swap high and low bits */
mov ah, cl
mov al, ch
ret
-ENDFUNC RtlUshortByteSwap
+ENDFUNC
- at RtlUlongByteSwap@4:
-FUNC RtlUlongByteSwap
+FUNC @RtlUlongByteSwap at 4
FPO 0, 0, 0, 0, 0, FRAME_FPO
/* Swap high and low bits */
mov eax, ecx
bswap eax
ret
-ENDFUNC RtlUlongByteSwap
+ENDFUNC
- at RtlUlonglongByteSwap@8:
-FUNC RtlUlonglongByteSwap
+FUNC @RtlUlonglongByteSwap at 8
FPO 0, 2, 0, 0, 0, FRAME_FPO
/* Get 64-bit integer */
@@ -53,6 +50,6 @@
and therefore put on tthe stack instead of in ecx and edx,
but thats exactly how the function behaves on Windows! */
ret
-ENDFUNC RtlUlonglongByteSwap
+ENDFUNC
END
Modified: trunk/reactos/lib/sdk/crt/string/i386/tcscpy.inc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/string/i386/tcscpy.inc?rev=54112&r1=54111&r2=54112&view=diff
==============================================================================
--- trunk/reactos/lib/sdk/crt/string/i386/tcscpy.inc [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/string/i386/tcscpy.inc [iso-8859-1] Thu Oct 13 15:16:29 2011
@@ -7,7 +7,7 @@
PUBLIC _tcscpy
.code
-FUNC tcscpy
+FUNC _tcscpy
FPO 0, 2, 2, 2, 0, FRAME_FPO
push esi
push edi
@@ -27,7 +27,7 @@
pop edi
pop esi
ret
-ENDFUNC tcscpy
+ENDFUNC
END
/* EOF */
Modified: trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S?rev=54112&r1=54111&r2=54112&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S [iso-8859-1] Thu Oct 13 15:16:29 2011
@@ -219,7 +219,7 @@
MACRO(TRAP_ENTRY, Trap, Flags)
EXTERN @&Trap&Handler at 4 :PROC
PUBLIC _&Trap
- .PROC &Trap
+ .PROC _&Trap
/* Generate proper debugging symbols */
FPO 0, 0, 0, 0, 1, FRAME_TRAP
@@ -228,7 +228,7 @@
/* Call the C handler */
KiCallHandler @&Trap&Handler at 4
- .ENDP &Trap
+ .ENDP
ENDM
#define KI_RESTORE_EAX HEX(001)
Modified: trunk/reactos/ntoskrnl/ke/i386/trap.s
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/trap.s?rev=54112&r1=54111&r2=54112&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/trap.s [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/trap.s [iso-8859-1] Thu Oct 13 15:16:29 2011
@@ -136,19 +136,19 @@
EXTERN @KiSystemServiceHandler at 8:PROC
PUBLIC _KiSystemService
-.PROC KiSystemService
+.PROC _KiSystemService
FPO 0, 0, 0, 0, 1, FRAME_TRAP
KiEnterTrap (KI_PUSH_FAKE_ERROR_CODE OR KI_NONVOLATILES_ONLY OR KI_DONT_SAVE_SEGS)
KiCallHandler @KiSystemServiceHandler at 8
-.ENDP KiSystemService
+.ENDP
EXTERN @KiFastCallEntryHandler at 8:PROC
PUBLIC _KiFastCallEntry
-.PROC KiFastCallEntry
+.PROC _KiFastCallEntry
FPO 0, 0, 0, 0, 1, FRAME_TRAP
KiEnterTrap (KI_FAST_SYSTEM_CALL OR KI_NONVOLATILES_ONLY OR KI_DONT_SAVE_SEGS)
KiCallHandler @KiFastCallEntryHandler at 8
-.ENDP KiFastCallEntry
+.ENDP
PUBLIC _KiEndUnexpectedRange at 0
More information about the Ros-diffs
mailing list