Make macro checks ARMv8-M baseline proof

libgloss:

        * arm/Makefile.in: Add newlib/libc/machine/arm to the include path if
        newlib is present.
        * arm/arm.h: Include acle-compat.h.
        (THUMB_V7_V6M): Rename to ...
        (PREFER_THUMB): This.  Use ACLE macros __ARM_ARCH_ISA_ARM instead of
        __ARM_ARCH_6M__ to decide whether to define it.
        (THUMB1_ONLY): Define for Thumb-1 only targets.
        (THUMB_V7M_V6M): Rename to ...
        (THUMB_VXM): This.  Defined based on __ARM_ARCH_ISA_ARM, excluding
        ARMv7.
        * arm/crt0.S: Use THUMB1_ONLY rather than __ARM_ARCH_6M__,
        !__ARM_ARCH_ISA_ARM rather than THUMB_V7M_V6M for fp enabling, and
        PREFER_THUMB rather than THUMB_V7_V6M.  Rename other occurences of
        THUMB_V7M_V6M to THUMB_VXM.
        * arm/linux-crt0.c: Likewise.
        * arm/redboot-crt0.S: Likewise.
        * arm/swi.h: Likewise.
        * arm/trap.S: Likewise.

newlib:

        * libc/machine/arm/memcpy-stub.c: Use ACLE macros __ARM_ARCH_ISA_THUMB
        and __ARM_ARCH_ISA_ARM to check for Thumb-2 only targets rather than
        __ARM_ARCH and __ARM_ARCH_PROFILE.
        * libc/machine/arm/memcpy.S: Likewise.
        * libc/machine/arm/setjmp.S: Likewise for Thumb-1 only target and
        include acle-compat.h.
        * libc/machine/arm/strcmp.S: Likewise for Thumb-1 and Thumb-2 only
        target and include acle-compat.h.
        * libc/sys/arm/arm.h: Include acle-compat.h.
        (THUMB_V7_V6M): Rename to ...
        (PREFER_THUMB): This.  Use ACLE macro __ARM_ARCH_ISA_ARM instead of
        __ARM_ARCH_6M__ to decide whether to define it.
        (THUMB1_ONLY): Define for Thumb-1 only targets.
        (THUMB_V7M_V6M): Rename to ...
        (THUMB_VXM): This.  Defined based on __ARM_ARCH_ISA_ARM, excluding
        ARMv7.
        * libc/sys/arm/crt0.S: Use PREFER_THUMB rather than THUMB_V7_V6M and
        rename THUMB_V7M_V6M into THUMB_VXM.
        * libc/sys/arm/swi.h: Likewise.
This commit is contained in:
Thomas Preud'homme
2016-01-28 11:26:09 +01:00
committed by Corinna Vinschen
parent 0b42ea7960
commit 69f4c40291
14 changed files with 72 additions and 63 deletions

View File

@@ -44,7 +44,7 @@
/* .text is used instead of .section .text so it works with arm-aout too. */
.text
.syntax unified
#ifdef THUMB_V7_V6M
#ifdef PREFER_THUMB
.thumb
.macro FUNC_START name
.global \name
@@ -98,7 +98,7 @@
/* stack limit is at end of data */
/* allow slop for stack overflow handling and small frames */
#ifdef __ARM_ARCH_6M__
#ifdef THUMB1_ONLY
ldr r0, .LC2
adds r0, #128
adds r0, #128
@@ -112,7 +112,7 @@
/* Issue Angel SWI to read stack info */
movs r0, #AngelSWI_Reason_HeapInfo
adr r1, .LC0 /* point at ptr to 4 words to receive data */
#ifdef THUMB_V7M_V6M
#ifdef THUMB_VXM
bkpt AngelSWI
#elif defined(__thumb2__)
/* We are in thumb mode for startup on armv7 architectures. */
@@ -154,7 +154,7 @@
cmp r2, #0
beq .LC27
/* allow slop for stack overflow handling and small frames */
#ifdef __ARM_ARCH_6M__
#ifdef THUMB1_ONLY
adds r2, #128
adds r2, #128
mov sl, r2
@@ -180,7 +180,7 @@
#ifdef __thumb2__
it eq
#endif
#ifdef __ARM_ARCH_6M__
#ifdef THUMB1_ONLY
bne .LC28
ldr r3, .LC0
.LC28:
@@ -192,7 +192,7 @@
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 THUMB_V7_V6M
#ifdef PREFER_THUMB
/* XXX Fill in stack assignments for interrupt modes. */
#else
mrs r2, CPSR
@@ -235,7 +235,7 @@
this default 64k is enough for the program being executed.
However, it ensures that this simple crt0 world will not
immediately cause an overflow event: */
#ifdef __ARM_ARCH_6M__
#ifdef THUMB1_ONLY
movs r2, #64
lsls r2, r2, #10
subs r2, r3, r2
@@ -255,7 +255,7 @@
subs a3, a3, a1 /* Third arg: length of block */
#if defined(__thumb__) && !defined(THUMB_V7_V6M)
#if __thumb__ && !defined(PREFER_THUMB)
/* Enter Thumb mode.... */
add a4, pc, #1 /* Get the address of the Thumb block */
bx a4 /* Go there and start Thumb decoding */
@@ -426,7 +426,7 @@ __change_mode:
bl FUNCTION (exit) /* Should not return. */
#if defined(__thumb__) && !defined(THUMB_V7_V6M)
#if __thumb__ && !defined(PREFER_THUMB)
/* Come out of Thumb mode. This code should be redundant. */
mov a4, pc