From 5f2bbc64c17c06fe72d074ae0d67c613cf24d06a Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Mon, 11 Feb 2013 12:25:06 +0100 Subject: [PATCH] --- yaml --- r: 351147 b: refs/heads/master c: 9520a5bece13b7382f4b0059180f61530c423c81 h: refs/heads/master i: 351145: 4004b683dd6a1f730785a1ca9a39d9e60246d664 351143: 808aec518329894e887cf6fb4d6726db159a3c22 v: v3 --- [refs] | 2 +- trunk/arch/arm/mm/context.c | 3 +++ trunk/arch/arm/mm/proc-macros.S | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index c40848d02206..6b4afc0a5103 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 352af7d4dd90bac3640ad2383e4e9f332d3a4537 +refs/heads/master: 9520a5bece13b7382f4b0059180f61530c423c81 diff --git a/trunk/arch/arm/mm/context.c b/trunk/arch/arm/mm/context.c index bc4a5e9ebb78..7a0511191f6b 100644 --- a/trunk/arch/arm/mm/context.c +++ b/trunk/arch/arm/mm/context.c @@ -34,6 +34,9 @@ * The ASID is used to tag entries in the CPU caches and TLBs. * The context ID is used by debuggers and trace logic, and * should be unique within all running processes. + * + * In big endian operation, the two 32 bit words are swapped if accesed by + * non 64-bit operations. */ #define ASID_FIRST_VERSION (1ULL << ASID_BITS) #define NUM_USER_ASIDS (ASID_FIRST_VERSION - 1) diff --git a/trunk/arch/arm/mm/proc-macros.S b/trunk/arch/arm/mm/proc-macros.S index eb6aa73bc8b7..f9a0aa725ea9 100644 --- a/trunk/arch/arm/mm/proc-macros.S +++ b/trunk/arch/arm/mm/proc-macros.S @@ -38,9 +38,14 @@ /* * mmid - get context id from mm pointer (mm->context.id) + * note, this field is 64bit, so in big-endian the two words are swapped too. */ .macro mmid, rd, rn +#ifdef __ARMEB__ + ldr \rd, [\rn, #MM_CONTEXT_ID + 4 ] +#else ldr \rd, [\rn, #MM_CONTEXT_ID] +#endif .endm /*