diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2009-05-30 09:00:18 -0400 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2009-05-30 09:00:18 -0400 |
commit | 26584853a44c58f3d6ac7360d697a2ddcd1a3efa (patch) | |
tree | a47156d781c6207d316746a056a81ca82b90d452 /arch/arm/include/asm | |
parent | ee8c9571191e588ede9a220ded807e33c4897d91 (diff) |
Add core support for ARMv6/v7 big-endian
Starting with ARMv6, the CPUs support the BE-8 variant of big-endian
(byte-invariant). This patch adds the core support:
- setting of the BE-8 mode via the CPSR.E register for both kernel and
user threads
- big-endian page table walking
- REV used to rotate instructions read from memory during fault
processing as they are still little-endian format
- Kconfig and Makefile support for BE-8. The --be8 option must be passed
to the final linking stage to convert the instructions to
little-endian
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm/include/asm')
-rw-r--r-- | arch/arm/include/asm/processor.h | 1 | ||||
-rw-r--r-- | arch/arm/include/asm/ptrace.h | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h index 1845892260e7..6a89567ffc5b 100644 --- a/arch/arm/include/asm/processor.h +++ b/arch/arm/include/asm/processor.h | |||
@@ -71,6 +71,7 @@ struct thread_struct { | |||
71 | regs->ARM_cpsr = USR26_MODE; \ | 71 | regs->ARM_cpsr = USR26_MODE; \ |
72 | if (elf_hwcap & HWCAP_THUMB && pc & 1) \ | 72 | if (elf_hwcap & HWCAP_THUMB && pc & 1) \ |
73 | regs->ARM_cpsr |= PSR_T_BIT; \ | 73 | regs->ARM_cpsr |= PSR_T_BIT; \ |
74 | regs->ARM_cpsr |= PSR_ENDSTATE; \ | ||
74 | regs->ARM_pc = pc & ~1; /* pc */ \ | 75 | regs->ARM_pc = pc & ~1; /* pc */ \ |
75 | regs->ARM_sp = sp; /* sp */ \ | 76 | regs->ARM_sp = sp; /* sp */ \ |
76 | regs->ARM_r2 = stack[2]; /* r2 (envp) */ \ | 77 | regs->ARM_r2 = stack[2]; /* r2 (envp) */ \ |
diff --git a/arch/arm/include/asm/ptrace.h b/arch/arm/include/asm/ptrace.h index 4a4290f7b4a2..67b833c9b6b9 100644 --- a/arch/arm/include/asm/ptrace.h +++ b/arch/arm/include/asm/ptrace.h | |||
@@ -50,6 +50,7 @@ | |||
50 | #define PSR_F_BIT 0x00000040 | 50 | #define PSR_F_BIT 0x00000040 |
51 | #define PSR_I_BIT 0x00000080 | 51 | #define PSR_I_BIT 0x00000080 |
52 | #define PSR_A_BIT 0x00000100 | 52 | #define PSR_A_BIT 0x00000100 |
53 | #define PSR_E_BIT 0x00000200 | ||
53 | #define PSR_J_BIT 0x01000000 | 54 | #define PSR_J_BIT 0x01000000 |
54 | #define PSR_Q_BIT 0x08000000 | 55 | #define PSR_Q_BIT 0x08000000 |
55 | #define PSR_V_BIT 0x10000000 | 56 | #define PSR_V_BIT 0x10000000 |
@@ -72,6 +73,15 @@ | |||
72 | #define PSR_IT_MASK 0x0600fc00 /* If-Then execution state mask */ | 73 | #define PSR_IT_MASK 0x0600fc00 /* If-Then execution state mask */ |
73 | #define PSR_ENDIAN_MASK 0x00000200 /* Endianness state mask */ | 74 | #define PSR_ENDIAN_MASK 0x00000200 /* Endianness state mask */ |
74 | 75 | ||
76 | /* | ||
77 | * Default endianness state | ||
78 | */ | ||
79 | #ifdef CONFIG_CPU_ENDIAN_BE8 | ||
80 | #define PSR_ENDSTATE PSR_E_BIT | ||
81 | #else | ||
82 | #define PSR_ENDSTATE 0 | ||
83 | #endif | ||
84 | |||
75 | #ifndef __ASSEMBLY__ | 85 | #ifndef __ASSEMBLY__ |
76 | 86 | ||
77 | /* | 87 | /* |