Skip to content

Commit 3169c92

Browse files
committed
fix: Add big-endian support to ARM_CRx_No_GIC port
This change makes sure the Data endianness bit is set in the SPSR register when the program is being compiled for big-endian. Signed-off-by: Maxim De Clercq <[email protected]>
1 parent 1dbc776 commit 3169c92

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.github/.cSpellWords.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ APIC
2929
APROCFREQ
3030
APSR
3131
ARMCM
32+
ARMEB
3233
Armv
3334
ARMVFP
3435
ASTRINGZ

portable/GCC/ARM_CRx_No_GIC/port.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@
6161
#define portNO_FLOATING_POINT_CONTEXT ( ( StackType_t ) 0 )
6262

6363
/* Constants required to setup the initial task context. */
64-
#define portINITIAL_SPSR ( ( StackType_t ) 0x1f ) /* System mode, ARM mode, IRQ enabled FIQ enabled. */
64+
#ifdef __ARMEB__
65+
#define portINITIAL_SPSR ( ( StackType_t ) 0x21f ) /* System mode, ARM mode, IRQ enabled FIQ enabled, Big-endian. */
66+
#else
67+
#define portINITIAL_SPSR ( ( StackType_t ) 0x01f ) /* System mode, ARM mode, IRQ enabled FIQ enabled, Little-endian. */
68+
#endif
6569
#define portTHUMB_MODE_BIT ( ( StackType_t ) 0x20 )
6670
#define portTHUMB_MODE_ADDRESS ( 0x01UL )
6771

0 commit comments

Comments
 (0)