arm: Tidy whitespace in sysdep.h files

This commit is contained in:
Richard Henderson 2013-02-27 23:04:17 -08:00
parent c98ec0b97f
commit 63cc0e75ea
4 changed files with 270 additions and 270 deletions

View File

@ -7,6 +7,10 @@
* sysdeps/unix/sysv/linux/arm/Makefile [elf] (sysdep-rtld-routines):
Include libc-do-syscall.
* sysdeps/arm/sysdep.h: Fix assembly whitespace.
* ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h: Likewise.
* sysdeps/unix/sysv/linux/arm/sysdep.h: Likewise.
2013-02-27 Roland McGrath <roland@hack.frob.com>
* sysdeps/arm/sysdep.h (CFI_SECTIONS): New macro.

View File

@ -58,43 +58,43 @@
#endif
/* Define an entry point visible from C. */
#define ENTRY(name) \
.globl C_SYMBOL_NAME(name); \
.type C_SYMBOL_NAME(name),%function; \
.align ALIGNARG(4); \
C_LABEL(name) \
CFI_SECTIONS; \
cfi_startproc; \
CALL_MCOUNT
#define ENTRY(name) \
.globl C_SYMBOL_NAME(name); \
.type C_SYMBOL_NAME(name),%function; \
.align ALIGNARG(4); \
C_LABEL(name) \
CFI_SECTIONS; \
cfi_startproc; \
CALL_MCOUNT
#define CFI_SECTIONS \
.cfi_sections .debug_frame
#define CFI_SECTIONS \
.cfi_sections .debug_frame
#undef END
#define END(name) \
cfi_endproc; \
ASM_SIZE_DIRECTIVE(name)
#define END(name) \
cfi_endproc; \
ASM_SIZE_DIRECTIVE(name)
/* If compiled for profiling, call `mcount' at the start of each function. */
#ifdef PROF
/* Call __gnu_mcount_nc if GCC >= 4.4. */
#if __GNUC_PREREQ(4,4)
#define CALL_MCOUNT \
str lr,[sp, #-4]!; \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (lr, 0); \
bl PLTJMP(mcount); \
cfi_adjust_cfa_offset (-4); \
cfi_restore (lr)
#define CALL_MCOUNT \
str lr,[sp, #-4]!; \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (lr, 0); \
bl PLTJMP(mcount); \
cfi_adjust_cfa_offset (-4); \
cfi_restore (lr)
#else /* else call _mcount */
#define CALL_MCOUNT \
str lr,[sp, #-4]!; \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (lr, 0); \
bl PLTJMP(mcount); \
ldr lr, [sp], #4; \
cfi_adjust_cfa_offset (-4); \
cfi_restore (lr)
#define CALL_MCOUNT \
str lr,[sp, #-4]!; \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (lr, 0); \
bl PLTJMP(mcount); \
ldr lr, [sp], #4; \
cfi_adjust_cfa_offset (-4); \
cfi_restore (lr)
#endif
#else
#define CALL_MCOUNT /* Do nothing. */

View File

@ -30,161 +30,157 @@
# undef PSEUDO
# define PSEUDO(name, syscall_name, args) \
.section ".text"; \
PSEUDO_PROLOGUE; \
.type __##syscall_name##_nocancel,%function; \
.globl __##syscall_name##_nocancel; \
__##syscall_name##_nocancel: \
CFI_SECTIONS; \
cfi_startproc; \
DO_CALL (syscall_name, args); \
cmn r0, $4096; \
PSEUDO_RET; \
cfi_endproc; \
.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
.text; \
PSEUDO_PROLOGUE; \
ENTRY (__##syscall_name##_nocancel); \
CFI_SECTIONS; \
DO_CALL (syscall_name, args); \
cmn r0, $4096; \
PSEUDO_RET; \
END (__##syscall_name##_nocancel); \
ENTRY (name); \
SINGLE_THREAD_P; \
DOARGS_##args; \
bne .Lpseudo_cancel; \
cfi_remember_state; \
ldr r7, =SYS_ify (syscall_name); \
swi 0x0; \
UNDOARGS_##args; \
cmn r0, $4096; \
PSEUDO_RET; \
cfi_restore_state; \
SINGLE_THREAD_P; \
DOARGS_##args; \
bne .Lpseudo_cancel; \
cfi_remember_state; \
ldr r7, =SYS_ify (syscall_name); \
swi 0x0; \
UNDOARGS_##args; \
cmn r0, $4096; \
PSEUDO_RET; \
cfi_restore_state; \
.Lpseudo_cancel: \
.fnstart; /* matched by the .fnend in UNDOARGS below. */ \
DOCARGS_##args; /* save syscall args etc. around CENABLE. */ \
CENABLE; \
mov ip, r0; /* put mask in safe place. */ \
UNDOCARGS_##args; /* restore syscall args. */ \
ldr r7, =SYS_ify (syscall_name); \
swi 0x0; /* do the call. */ \
mov r7, r0; /* save syscall return value. */ \
mov r0, ip; /* get mask back. */ \
CDISABLE; \
mov r0, r7; /* retrieve return value. */ \
RESTORE_LR_##args; \
UNDOARGS_##args; \
cmn r0, $4096
.fnstart; /* matched by the .fnend in UNDOARGS below. */ \
DOCARGS_##args; /* save syscall args etc. around CENABLE. */ \
CENABLE; \
mov ip, r0; /* put mask in safe place. */ \
UNDOCARGS_##args; /* restore syscall args. */ \
ldr r7, =SYS_ify (syscall_name); \
swi 0x0; /* do the call. */ \
mov r7, r0; /* save syscall return value. */ \
mov r0, ip; /* get mask back. */ \
CDISABLE; \
mov r0, r7; /* retrieve return value. */ \
RESTORE_LR_##args; \
UNDOARGS_##args; \
cmn r0, $4096
/* DOARGS pushes eight bytes on the stack for five arguments, twelve bytes for
six arguments, and four bytes for fewer. In order to preserve doubleword
alignment, sometimes we must save an extra register. */
# define RESTART_UNWIND \
.fnend; \
.fnstart; \
.save {r7}; \
.save {lr}
# define RESTART_UNWIND \
.fnend; \
.fnstart; \
.save {r7}; \
.save {lr}
# define DOCARGS_0 \
.save {r7}; \
str lr, [sp, #-4]!; \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (lr, 0); \
.save {lr}
# define DOCARGS_0 \
.save {r7}; \
str lr, [sp, #-4]!; \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (lr, 0); \
.save {lr}
# define UNDOCARGS_0
# define RESTORE_LR_0 \
ldr lr, [sp], #4; \
cfi_adjust_cfa_offset (-4); \
cfi_restore (lr)
# define RESTORE_LR_0 \
ldr lr, [sp], #4; \
cfi_adjust_cfa_offset (-4); \
cfi_restore (lr)
# define DOCARGS_1 \
.save {r7}; \
stmfd sp!, {r0, r1, lr}; \
cfi_adjust_cfa_offset (12); \
cfi_rel_offset (lr, 8); \
.save {lr}; \
.pad #8
# define UNDOCARGS_1 \
ldr r0, [sp], #8; \
cfi_adjust_cfa_offset (-8); \
RESTART_UNWIND
# define RESTORE_LR_1 \
RESTORE_LR_0
# define DOCARGS_1 \
.save {r7}; \
stmfd sp!, {r0, r1, lr}; \
cfi_adjust_cfa_offset (12); \
cfi_rel_offset (lr, 8); \
.save {lr}; \
.pad #8
# define UNDOCARGS_1 \
ldr r0, [sp], #8; \
cfi_adjust_cfa_offset (-8); \
RESTART_UNWIND
# define RESTORE_LR_1 \
RESTORE_LR_0
# define DOCARGS_2 \
.save {r7}; \
stmfd sp!, {r0, r1, lr}; \
cfi_adjust_cfa_offset (12); \
cfi_rel_offset (lr, 8); \
.save {lr}; \
.pad #8
# define UNDOCARGS_2 \
ldmfd sp!, {r0, r1}; \
cfi_adjust_cfa_offset (-8); \
RESTART_UNWIND
# define RESTORE_LR_2 \
RESTORE_LR_0
# define DOCARGS_2 \
.save {r7}; \
stmfd sp!, {r0, r1, lr}; \
cfi_adjust_cfa_offset (12); \
cfi_rel_offset (lr, 8); \
.save {lr}; \
.pad #8
# define UNDOCARGS_2 \
ldmfd sp!, {r0, r1}; \
cfi_adjust_cfa_offset (-8); \
RESTART_UNWIND
# define RESTORE_LR_2 \
RESTORE_LR_0
# define DOCARGS_3 \
.save {r7}; \
stmfd sp!, {r0, r1, r2, r3, lr}; \
cfi_adjust_cfa_offset (20); \
cfi_rel_offset (lr, 16); \
.save {lr}; \
.pad #16
# define UNDOCARGS_3 \
ldmfd sp!, {r0, r1, r2, r3}; \
cfi_adjust_cfa_offset (-16); \
RESTART_UNWIND
# define RESTORE_LR_3 \
RESTORE_LR_0
# define DOCARGS_3 \
.save {r7}; \
stmfd sp!, {r0, r1, r2, r3, lr}; \
cfi_adjust_cfa_offset (20); \
cfi_rel_offset (lr, 16); \
.save {lr}; \
.pad #16
# define UNDOCARGS_3 \
ldmfd sp!, {r0, r1, r2, r3}; \
cfi_adjust_cfa_offset (-16); \
RESTART_UNWIND
# define RESTORE_LR_3 \
RESTORE_LR_0
# define DOCARGS_4 \
.save {r7}; \
stmfd sp!, {r0, r1, r2, r3, lr}; \
cfi_adjust_cfa_offset (20); \
cfi_rel_offset (lr, 16); \
.save {lr}; \
.pad #16
# define UNDOCARGS_4 \
ldmfd sp!, {r0, r1, r2, r3}; \
cfi_adjust_cfa_offset (-16); \
RESTART_UNWIND
# define RESTORE_LR_4 \
RESTORE_LR_0
# define DOCARGS_4 \
.save {r7}; \
stmfd sp!, {r0, r1, r2, r3, lr}; \
cfi_adjust_cfa_offset (20); \
cfi_rel_offset (lr, 16); \
.save {lr}; \
.pad #16
# define UNDOCARGS_4 \
ldmfd sp!, {r0, r1, r2, r3}; \
cfi_adjust_cfa_offset (-16); \
RESTART_UNWIND
# define RESTORE_LR_4 \
RESTORE_LR_0
/* r4 is only stmfd'ed for correct stack alignment. */
# define DOCARGS_5 \
.save {r4, r7}; \
stmfd sp!, {r0, r1, r2, r3, r4, lr}; \
cfi_adjust_cfa_offset (24); \
cfi_rel_offset (lr, 20); \
.save {lr}; \
.pad #20
# define UNDOCARGS_5 \
ldmfd sp!, {r0, r1, r2, r3}; \
cfi_adjust_cfa_offset (-16); \
.fnend; \
.fnstart; \
.save {r4, r7}; \
.save {lr}; \
.pad #4
# define RESTORE_LR_5 \
ldmfd sp!, {r4, lr}; \
cfi_adjust_cfa_offset (-8); \
/* r4 will be marked as restored later. */ \
cfi_restore (lr)
# define DOCARGS_5 \
.save {r4, r7}; \
stmfd sp!, {r0, r1, r2, r3, r4, lr}; \
cfi_adjust_cfa_offset (24); \
cfi_rel_offset (lr, 20); \
.save {lr}; \
.pad #20
# define UNDOCARGS_5 \
ldmfd sp!, {r0, r1, r2, r3}; \
cfi_adjust_cfa_offset (-16); \
.fnend; \
.fnstart; \
.save {r4, r7}; \
.save {lr}; \
.pad #4
# define RESTORE_LR_5 \
ldmfd sp!, {r4, lr}; \
cfi_adjust_cfa_offset (-8); \
/* r4 will be marked as restored later. */ \
cfi_restore (lr)
# define DOCARGS_6 \
.save {r4, r5, r7}; \
stmfd sp!, {r0, r1, r2, r3, lr}; \
cfi_adjust_cfa_offset (20); \
cfi_rel_offset (lr, 16); \
.save {lr}; \
.pad #16
# define UNDOCARGS_6 \
ldmfd sp!, {r0, r1, r2, r3}; \
cfi_adjust_cfa_offset (-16); \
.fnend; \
.fnstart; \
.save {r4, r5, r7}; \
.save {lr};
# define RESTORE_LR_6 \
RESTORE_LR_0
# define DOCARGS_6 \
.save {r4, r5, r7}; \
stmfd sp!, {r0, r1, r2, r3, lr}; \
cfi_adjust_cfa_offset (20); \
cfi_rel_offset (lr, 16); \
.save {lr}; \
.pad #16
# define UNDOCARGS_6 \
ldmfd sp!, {r0, r1, r2, r3}; \
cfi_adjust_cfa_offset (-16); \
.fnend; \
.fnstart; \
.save {r4, r5, r7}; \
.save {lr};
# define RESTORE_LR_6 \
RESTORE_LR_0
# ifdef IS_IN_libpthread
# define CENABLE bl PLTJMP(__pthread_enable_asynccancel)
@ -207,12 +203,12 @@ extern int __local_multiple_threads attribute_hidden;
# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
# else
# define SINGLE_THREAD_P \
ldr ip, 1b; \
2: \
ldr ip, [pc, ip]; \
teq ip, #0;
ldr ip, 1b; \
2: \
ldr ip, [pc, ip]; \
teq ip, #0;
# define PSEUDO_PROLOGUE \
1: .word __local_multiple_threads - 2f - 8;
1: .word __local_multiple_threads - 2f - 8;
# endif
# else
/* There is no __local_multiple_threads for librt, so use the TCB. */
@ -223,15 +219,15 @@ extern int __local_multiple_threads attribute_hidden;
# else
# define PSEUDO_PROLOGUE
# define SINGLE_THREAD_P \
stmfd sp!, {r0, lr}; \
cfi_adjust_cfa_offset (8); \
cfi_rel_offset (lr, 4); \
bl __aeabi_read_tp; \
ldr ip, [r0, #MULTIPLE_THREADS_OFFSET]; \
ldmfd sp!, {r0, lr}; \
cfi_adjust_cfa_offset (-8); \
cfi_restore (lr); \
teq ip, #0
stmfd sp!, {r0, lr}; \
cfi_adjust_cfa_offset (8); \
cfi_rel_offset (lr, 4); \
bl __aeabi_read_tp; \
ldr ip, [r0, #MULTIPLE_THREADS_OFFSET]; \
ldmfd sp!, {r0, lr}; \
cfi_adjust_cfa_offset (-8); \
cfi_restore (lr); \
teq ip, #0
# define SINGLE_THREAD_P_PIC(x) SINGLE_THREAD_P
# endif
# endif

View File

@ -57,49 +57,49 @@
test with -4095. */
#undef PSEUDO
#define PSEUDO(name, syscall_name, args) \
.text; \
ENTRY (name); \
DO_CALL (syscall_name, args); \
cmn r0, $4096;
#define PSEUDO(name, syscall_name, args) \
.text; \
ENTRY (name); \
DO_CALL (syscall_name, args); \
cmn r0, $4096;
#define PSEUDO_RET \
RETINSTR(cc, lr); \
b PLTJMP(SYSCALL_ERROR)
#define PSEUDO_RET \
RETINSTR(cc, lr); \
b PLTJMP(SYSCALL_ERROR)
#undef ret
#define ret PSEUDO_RET
#undef PSEUDO_END
#define PSEUDO_END(name) \
SYSCALL_ERROR_HANDLER; \
#define PSEUDO_END(name) \
SYSCALL_ERROR_HANDLER; \
END (name)
#undef PSEUDO_NOERRNO
#define PSEUDO_NOERRNO(name, syscall_name, args) \
.text; \
ENTRY (name); \
DO_CALL (syscall_name, args);
#define PSEUDO_NOERRNO(name, syscall_name, args) \
.text; \
ENTRY (name); \
DO_CALL (syscall_name, args);
#define PSEUDO_RET_NOERRNO \
DO_RET (lr);
#define PSEUDO_RET_NOERRNO \
DO_RET (lr);
#undef ret_NOERRNO
#define ret_NOERRNO PSEUDO_RET_NOERRNO
#undef PSEUDO_END_NOERRNO
#define PSEUDO_END_NOERRNO(name) \
#define PSEUDO_END_NOERRNO(name) \
END (name)
/* The function has to return the error code. */
#undef PSEUDO_ERRVAL
#define PSEUDO_ERRVAL(name, syscall_name, args) \
.text; \
ENTRY (name) \
DO_CALL (syscall_name, args); \
rsb r0, r0, #0
#define PSEUDO_ERRVAL(name, syscall_name, args) \
.text; \
ENTRY (name) \
DO_CALL (syscall_name, args); \
rsb r0, r0, #0
#undef PSEUDO_END_ERRVAL
#define PSEUDO_END_ERRVAL(name) \
#define PSEUDO_END_ERRVAL(name) \
END (name)
#define ret_ERRVAL PSEUDO_RET_NOERRNO
@ -192,19 +192,19 @@ __local_syscall_error: \
syscalls. */
#undef DO_CALL
#define DO_CALL(syscall_name, args) \
DOARGS_##args; \
ldr r7, =SYS_ify (syscall_name); \
swi 0x0; \
UNDOARGS_##args
#define DO_CALL(syscall_name, args) \
DOARGS_##args; \
ldr r7, =SYS_ify (syscall_name); \
swi 0x0; \
UNDOARGS_##args
#undef DOARGS_0
#define DOARGS_0 \
.fnstart; \
str r7, [sp, #-4]!; \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (r7, 0); \
.save { r7 }
#define DOARGS_0 \
.fnstart; \
str r7, [sp, #-4]!; \
cfi_adjust_cfa_offset (4); \
cfi_rel_offset (r7, 0); \
.save { r7 }
#undef DOARGS_1
#define DOARGS_1 DOARGS_0
#undef DOARGS_2
@ -214,44 +214,44 @@ __local_syscall_error: \
#undef DOARGS_4
#define DOARGS_4 DOARGS_0
#undef DOARGS_5
#define DOARGS_5 \
.fnstart; \
stmfd sp!, {r4, r7}; \
cfi_adjust_cfa_offset (8); \
cfi_rel_offset (r4, 0); \
cfi_rel_offset (r7, 4); \
.save { r4, r7 }; \
ldr r4, [sp, #8]
#define DOARGS_5 \
.fnstart; \
stmfd sp!, {r4, r7}; \
cfi_adjust_cfa_offset (8); \
cfi_rel_offset (r4, 0); \
cfi_rel_offset (r7, 4); \
.save { r4, r7 }; \
ldr r4, [sp, #8]
#undef DOARGS_6
#define DOARGS_6 \
.fnstart; \
mov ip, sp; \
stmfd sp!, {r4, r5, r7}; \
cfi_adjust_cfa_offset (12); \
cfi_rel_offset (r4, 0); \
cfi_rel_offset (r5, 4); \
cfi_rel_offset (r7, 8); \
.save { r4, r5, r7 }; \
ldmia ip, {r4, r5}
#define DOARGS_6 \
.fnstart; \
mov ip, sp; \
stmfd sp!, {r4, r5, r7}; \
cfi_adjust_cfa_offset (12); \
cfi_rel_offset (r4, 0); \
cfi_rel_offset (r5, 4); \
cfi_rel_offset (r7, 8); \
.save { r4, r5, r7 }; \
ldmia ip, {r4, r5}
#undef DOARGS_7
#define DOARGS_7 \
.fnstart; \
mov ip, sp; \
stmfd sp!, {r4, r5, r6, r7}; \
cfi_adjust_cfa_offset (16); \
cfi_rel_offset (r4, 0); \
cfi_rel_offset (r5, 4); \
cfi_rel_offset (r6, 8); \
cfi_rel_offset (r7, 12); \
.save { r4, r5, r6, r7 }; \
ldmia ip, {r4, r5, r6}
#define DOARGS_7 \
.fnstart; \
mov ip, sp; \
stmfd sp!, {r4, r5, r6, r7}; \
cfi_adjust_cfa_offset (16); \
cfi_rel_offset (r4, 0); \
cfi_rel_offset (r5, 4); \
cfi_rel_offset (r6, 8); \
cfi_rel_offset (r7, 12); \
.save { r4, r5, r6, r7 }; \
ldmia ip, {r4, r5, r6}
#undef UNDOARGS_0
#define UNDOARGS_0 \
ldr r7, [sp], #4; \
cfi_adjust_cfa_offset (-4); \
cfi_restore (r7); \
.fnend
#define UNDOARGS_0 \
ldr r7, [sp], #4; \
cfi_adjust_cfa_offset (-4); \
cfi_restore (r7); \
.fnend
#undef UNDOARGS_1
#define UNDOARGS_1 UNDOARGS_0
#undef UNDOARGS_2
@ -261,29 +261,29 @@ __local_syscall_error: \
#undef UNDOARGS_4
#define UNDOARGS_4 UNDOARGS_0
#undef UNDOARGS_5
#define UNDOARGS_5 \
ldmfd sp!, {r4, r7}; \
cfi_adjust_cfa_offset (-8); \
cfi_restore (r4); \
cfi_restore (r7); \
.fnend
#define UNDOARGS_5 \
ldmfd sp!, {r4, r7}; \
cfi_adjust_cfa_offset (-8); \
cfi_restore (r4); \
cfi_restore (r7); \
.fnend
#undef UNDOARGS_6
#define UNDOARGS_6 \
ldmfd sp!, {r4, r5, r7}; \
cfi_adjust_cfa_offset (-12); \
cfi_restore (r4); \
cfi_restore (r5); \
cfi_restore (r7); \
.fnend
#define UNDOARGS_6 \
ldmfd sp!, {r4, r5, r7}; \
cfi_adjust_cfa_offset (-12); \
cfi_restore (r4); \
cfi_restore (r5); \
cfi_restore (r7); \
.fnend
#undef UNDOARGS_7
#define UNDOARGS_7 \
ldmfd sp!, {r4, r5, r6, r7}; \
cfi_adjust_cfa_offset (-16); \
cfi_restore (r4); \
cfi_restore (r5); \
cfi_restore (r6); \
cfi_restore (r7); \
.fnend
#define UNDOARGS_7 \
ldmfd sp!, {r4, r5, r6, r7}; \
cfi_adjust_cfa_offset (-16); \
cfi_restore (r4); \
cfi_restore (r5); \
cfi_restore (r6); \
cfi_restore (r7); \
.fnend
#else /* not __ASSEMBLER__ */