arm: Finish moving newlib to unified syntax for Thumb1
Most code in newlib already uses unified syntax, but just a couple of laggards remain. This patch removes these and means the the entire code base has now been converted.
This commit is contained in:
parent
92bd63de52
commit
9cb6fd382d
|
@ -6,6 +6,8 @@
|
||||||
* is freely granted, provided that this notice is preserved.
|
* is freely granted, provided that this notice is preserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
.syntax unified
|
||||||
|
|
||||||
#include "linux-syscall.h"
|
#include "linux-syscall.h"
|
||||||
|
|
||||||
#if __thumb__
|
#if __thumb__
|
||||||
|
@ -146,12 +148,21 @@ ALIAS(utime)
|
||||||
ALIAS(vfork)
|
ALIAS(vfork)
|
||||||
ALIAS(wait4)
|
ALIAS(wait4)
|
||||||
|
|
||||||
|
#if defined (__thumb__) && !defined (__thumb2__)
|
||||||
|
# define SOCKETCALL(name, NAME) \
|
||||||
|
GLOBAL(name); \
|
||||||
|
push { r0 - r3 }; \
|
||||||
|
movs r0, #SYS_ ## NAME; \
|
||||||
|
b _socketcall_tail; \
|
||||||
|
SIZE(name)
|
||||||
|
#else
|
||||||
# define SOCKETCALL(name, NAME) \
|
# define SOCKETCALL(name, NAME) \
|
||||||
GLOBAL(name); \
|
GLOBAL(name); \
|
||||||
push { r0 - r3 }; \
|
push { r0 - r3 }; \
|
||||||
mov r0, #SYS_ ## NAME; \
|
mov r0, #SYS_ ## NAME; \
|
||||||
b _socketcall_tail; \
|
b _socketcall_tail; \
|
||||||
SIZE(name)
|
SIZE(name)
|
||||||
|
#endif
|
||||||
|
|
||||||
FUNC(_socketcall_tail)
|
FUNC(_socketcall_tail)
|
||||||
mov r1, sp
|
mov r1, sp
|
||||||
|
|
|
@ -57,6 +57,8 @@
|
||||||
|
|
||||||
For Thumb-2 do everything in Thumb mode. */
|
For Thumb-2 do everything in Thumb mode. */
|
||||||
|
|
||||||
|
.syntax unified
|
||||||
|
|
||||||
#if __ARM_ARCH_ISA_THUMB == 1 && !__ARM_ARCH_ISA_ARM
|
#if __ARM_ARCH_ISA_THUMB == 1 && !__ARM_ARCH_ISA_ARM
|
||||||
/* ARMv6-M-like has to be implemented in Thumb mode. */
|
/* ARMv6-M-like has to be implemented in Thumb mode. */
|
||||||
|
|
||||||
|
@ -74,11 +76,11 @@ SYM (setjmp):
|
||||||
mov r5, sp
|
mov r5, sp
|
||||||
mov r6, lr
|
mov r6, lr
|
||||||
stmia r0!, {r1, r2, r3, r4, r5, r6}
|
stmia r0!, {r1, r2, r3, r4, r5, r6}
|
||||||
sub r0, r0, #40
|
subs r0, r0, #40
|
||||||
/* Restore callee-saved low regs. */
|
/* Restore callee-saved low regs. */
|
||||||
ldmia r0!, {r4, r5, r6, r7}
|
ldmia r0!, {r4, r5, r6, r7}
|
||||||
/* Return zero. */
|
/* Return zero. */
|
||||||
mov r0, #0
|
movs r0, #0
|
||||||
bx lr
|
bx lr
|
||||||
|
|
||||||
.thumb_func
|
.thumb_func
|
||||||
|
@ -86,7 +88,7 @@ SYM (setjmp):
|
||||||
TYPE (longjmp)
|
TYPE (longjmp)
|
||||||
SYM (longjmp):
|
SYM (longjmp):
|
||||||
/* Restore High regs. */
|
/* Restore High regs. */
|
||||||
add r0, r0, #16
|
adds r0, r0, #16
|
||||||
ldmia r0!, {r2, r3, r4, r5, r6}
|
ldmia r0!, {r2, r3, r4, r5, r6}
|
||||||
mov r8, r2
|
mov r8, r2
|
||||||
mov r9, r3
|
mov r9, r3
|
||||||
|
@ -95,12 +97,12 @@ SYM (longjmp):
|
||||||
mov sp, r6
|
mov sp, r6
|
||||||
ldmia r0!, {r3} /* lr */
|
ldmia r0!, {r3} /* lr */
|
||||||
/* Restore low regs. */
|
/* Restore low regs. */
|
||||||
sub r0, r0, #40
|
subs r0, r0, #40
|
||||||
ldmia r0!, {r4, r5, r6, r7}
|
ldmia r0!, {r4, r5, r6, r7}
|
||||||
/* Return the result argument, or 1 if it is zero. */
|
/* Return the result argument, or 1 if it is zero. */
|
||||||
mov r0, r1
|
movs r0, r1
|
||||||
bne 1f
|
bne 1f
|
||||||
mov r0, #1
|
movs r0, #1
|
||||||
1:
|
1:
|
||||||
bx r3
|
bx r3
|
||||||
|
|
||||||
|
@ -126,7 +128,6 @@ SYM (longjmp):
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__thumb2__)
|
#if defined(__thumb2__)
|
||||||
.syntax unified
|
|
||||||
.macro MODE
|
.macro MODE
|
||||||
.thumb
|
.thumb
|
||||||
.thumb_func
|
.thumb_func
|
||||||
|
|
Loading…
Reference in New Issue