diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2013-07-19 09:57:51 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2013-07-19 09:57:51 +0000 |
commit | 320a1e7412dbbc36e957144423d49af1c16abbfe (patch) | |
tree | aaf1768ef1dea227968aac67f3d60b49fd3e7bd8 | |
parent | 8eeeb65f41a875b6e1ac0ff2224ec89e5c0837e2 (diff) | |
download | newlib-320a1e7412dbbc36e957144423d49af1c16abbfe.zip newlib-320a1e7412dbbc36e957144423d49af1c16abbfe.tar.gz newlib-320a1e7412dbbc36e957144423d49af1c16abbfe.tar.bz2 |
* libc/sys/arm/syscalls.c (do_AngelSWI): Delete.
* libc/sys/arm/libcfuncs.c (do_AngelSWI): Delete.
* libc/sys/arm/swi.h: Copy over from libgloss.
-rw-r--r-- | newlib/ChangeLog | 6 | ||||
-rw-r--r-- | newlib/libc/sys/arm/libcfunc.c | 14 | ||||
-rw-r--r-- | newlib/libc/sys/arm/swi.h | 27 | ||||
-rw-r--r-- | newlib/libc/sys/arm/syscalls.c | 21 |
4 files changed, 31 insertions, 37 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 688a3d8..d706f45 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,9 @@ +2013-07-18 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com> + + * libc/sys/arm/syscalls.c (do_AngelSWI): Delete. + * libc/sys/arm/libcfuncs.c (do_AngelSWI): Delete. + * libc/sys/arm/swi.h: Copy over from libgloss. + 2013-07-17 Janis Johnson <janisjo@codesourcery.com> * libc/machine/powerpc/configure.in: Remove extra_sources; fix diff --git a/newlib/libc/sys/arm/libcfunc.c b/newlib/libc/sys/arm/libcfunc.c index 9fa9cb4..77583b7 100644 --- a/newlib/libc/sys/arm/libcfunc.c +++ b/newlib/libc/sys/arm/libcfunc.c @@ -7,20 +7,6 @@ to provide libc funcitons as well. */ #include "swi.h" -#ifdef ARM_RDI_MONITOR - -static inline int -do_AngelSWI (int reason, void * arg) -{ - int value; - asm volatile ("mov r0, %1; mov r1, %2; " AngelSWIInsn " %a3; mov %0, r0" - : "=r" (value) /* Outputs */ - : "r" (reason), "r" (arg), "i" (AngelSWI) /* Inputs */ - : "r0", "r1", "lr" - /* Clobbers r0 and r1, and lr if in supervisor mode */); - return value; -} -#endif /* ARM_RDI_MONITOR */ void diff --git a/newlib/libc/sys/arm/swi.h b/newlib/libc/sys/arm/swi.h index f5c9103..0f93134 100644 --- a/newlib/libc/sys/arm/swi.h +++ b/newlib/libc/sys/arm/swi.h @@ -1,3 +1,5 @@ +#include "arm.h" + /* SWI numbers for RDP (Demon) monitor. */ #define SWI_WriteC 0x0 #define SWI_Write0 0x2 @@ -33,8 +35,8 @@ #else #define AngelSWI AngelSWI_ARM #endif -/* For Thumb-2 code use the BKPT instruction instead of SWI. */ -#ifdef __thumb2__ +/* For thumb only architectures use the BKPT instruction instead of SWI. */ +#ifdef THUMB_V7M_V6M #define AngelSWIInsn "bkpt" #define AngelSWIAsm bkpt #else @@ -66,3 +68,24 @@ #define AngelSWI_Reason_ReportException 0x18 #define ADP_Stopped_ApplicationExit ((2 << 16) + 38) #define ADP_Stopped_RunTimeError ((2 << 16) + 35) + +#if defined(ARM_RDI_MONITOR) && !defined(__ASSEMBLER__) + +static inline int +do_AngelSWI (int reason, void * arg) +{ + int value; + asm volatile ("mov r0, %1; mov r1, %2; " AngelSWIInsn " %a3; mov %0, r0" + : "=r" (value) /* Outputs */ + : "r" (reason), "r" (arg), "i" (AngelSWI) /* Inputs */ + : "r0", "r1", "r2", "r3", "ip", "lr", "memory", "cc" + /* Clobbers r0 and r1, and lr if in supervisor mode */); + /* Accordingly to page 13-77 of ARM DUI 0040D other registers + can also be clobbered. Some memory positions may also be + changed by a system call, so they should not be kept in + registers. Note: we are assuming the manual is right and + Angel is respecting the APCS. */ + return value; +} + +#endif diff --git a/newlib/libc/sys/arm/syscalls.c b/newlib/libc/sys/arm/syscalls.c index f9ac14c..c5df5bb 100644 --- a/newlib/libc/sys/arm/syscalls.c +++ b/newlib/libc/sys/arm/syscalls.c @@ -48,7 +48,6 @@ static int wrap _PARAMS ((int)); static int error _PARAMS ((int)); static int get_errno _PARAMS ((void)); static int remap_handle _PARAMS ((int)); -static int do_AngelSWI _PARAMS ((int, void *)); static int findslot _PARAMS ((int)); /* Register name faking - works in collusion with the linker. */ @@ -94,26 +93,6 @@ findslot (int fh) return i; } -#ifdef ARM_RDI_MONITOR - -static inline int -do_AngelSWI (int reason, void * arg) -{ - int value; - asm volatile ("mov r0, %1; mov r1, %2; " AngelSWIInsn " %a3; mov %0, r0" - : "=r" (value) /* Outputs */ - : "r" (reason), "r" (arg), "i" (AngelSWI) /* Inputs */ - : "r0", "r1", "r2", "r3", "ip", "lr", "memory", "cc" - /* Clobbers r0 and r1, and lr if in supervisor mode */); - /* Accordingly to page 13-77 of ARM DUI 0040D other registers - can also be clobbered. Some memory positions may also be - changed by a system call, so they should not be kept in - registers. Note: we are assuming the manual is right and - Angel is respecting the APCS. */ - return value; -} -#endif /* ARM_RDI_MONITOR */ - /* Function to convert std(in|out|err) handles to internal versions. */ static int remap_handle (int fh) |