From 28d46f209483ba6604dd8854c0ac335be3a0ac10 Mon Sep 17 00:00:00 2001 From: Robert Schwebel Date: Mon, 13 Oct 2008 07:52:52 +0000 Subject: * newlib: add thumb2 patches git-svn-id: https://svn.pengutronix.de/svn/oselas/toolchain/trunks/OSELAS.Toolchain-trunk@7752 f8d472c7-5700-0410-ac5a-87979cec3adf --- .../generic/newlib-1.16.0-thumb2.diff | 96 ++++++++++++++++++++++ patches/newlib-1.16.0/generic/series | 1 + 2 files changed, 97 insertions(+) create mode 100644 patches/newlib-1.16.0/generic/newlib-1.16.0-thumb2.diff create mode 100644 patches/newlib-1.16.0/generic/series diff --git a/patches/newlib-1.16.0/generic/newlib-1.16.0-thumb2.diff b/patches/newlib-1.16.0/generic/newlib-1.16.0-thumb2.diff new file mode 100644 index 0000000..cd78c99 --- /dev/null +++ b/patches/newlib-1.16.0/generic/newlib-1.16.0-thumb2.diff @@ -0,0 +1,96 @@ +From: Nick Clifton +To: info dot gnu at rt-labs dot com +Cc: newlib at sources dot redhat dot com +Date: Fri, 25 Apr 2008 10:01:35 +0100 +Subject: Re: arm-elf thumb-2 issue in newlib or gas? + +[...] +http://sourceware.org/ml/newlib/2008/msg00222.html +[...] + +OK, well the crt0.S will work if used in User mode, so I am going to check in +these patches for now. At some point in the future I will look at how we should +be initializing the interrupt stack pointers. + +Cheers + Nick + +newlib/ChangeLog +2008-04-25 Nick Clifton + + +* libc/machine/arm/setjmp.S: Fix thumb2 support. + +libgloss/ChangeLog +2008-04-25 Nick Clifton + + + * arm/crt0.S: Allow assembly under ARMv7 ISA. Support for + initializing stack pointers for interrupt modes is still pending. + +--- + libgloss/arm/crt0.S | 7 +++++++ + newlib/libc/machine/arm/setjmp.S | 10 ++++++++++ + 2 files changed, 17 insertions(+) + +Index: newlib-1.16.0/libgloss/arm/crt0.S +=================================================================== +--- newlib-1.16.0.orig/libgloss/arm/crt0.S ++++ newlib-1.16.0/libgloss/arm/crt0.S +@@ -82,12 +82,18 @@ + + ldr r3, .Lstack + cmp r3, #0 ++#ifdef __thumb2__ ++ it eq ++#endif + ldreq r3, .LC0 + /* Note: This 'mov' is essential when starting in User, and ensures we + always get *some* sp value for the initial mode, even if we + have somehow missed it below (in which case it gets the same + value as FIQ - not ideal, but better than nothing.) */ + mov sp, r3 ++#ifdef __thumb2__ ++ /* XXX Fill in stack assignments for interrupt modes. */ ++#else + mrs r2, CPSR + tst r2, #0x0F /* Test mode bits - in User of all are 0 */ + beq .LC23 /* "eq" means r2 AND #0x0F is 0 */ +@@ -119,6 +125,7 @@ + + orr r2, r2, #0xC0 /* Back to original mode, presumably SVC, */ + msr CPSR_c, r2 /* with FIQ/IRQ disable bits forced to 1 */ ++#endif + .LC23: + /* Setup a default stack-limit in-case the code has been + compiled with "-mapcs-stack-check". Hard-wiring this value +Index: newlib-1.16.0/newlib/libc/machine/arm/setjmp.S +=================================================================== +--- newlib-1.16.0.orig/newlib/libc/machine/arm/setjmp.S ++++ newlib-1.16.0/newlib/libc/machine/arm/setjmp.S +@@ -120,7 +120,12 @@ SYM (\name): + FUNC_START setjmp + + /* Save all the callee-preserved registers into the jump buffer. */ ++#ifdef __thumb2__ ++ stmea a1!, { v1-v7, fp, ip, lr } ++ str sp, [a1],#+4 ++#else + stmea a1!, { v1-v7, fp, ip, sp, lr } ++#endif + + #if 0 /* Simulator does not cope with FP instructions yet. */ + #ifndef __SOFTFP__ +@@ -142,7 +147,12 @@ SYM (\name): + /* If we have stack extension code it ought to be handled here. */ + + /* Restore the registers, retrieving the state when setjmp() was called. */ ++#ifdef __thumb2__ ++ ldmfd a1!, { v1-v7, fp, ip, lr } ++ ldr sp, [a1],#+4 ++#else + ldmfd a1!, { v1-v7, fp, ip, sp, lr } ++#endif + + #if 0 /* Simulator does not cope with FP instructions yet. */ + #ifndef __SOFTFP__ diff --git a/patches/newlib-1.16.0/generic/series b/patches/newlib-1.16.0/generic/series new file mode 100644 index 0000000..c4759fe --- /dev/null +++ b/patches/newlib-1.16.0/generic/series @@ -0,0 +1 @@ +newlib-1.16.0-thumb2.diff -- cgit v1.2.3