arm: asm: add read_mpidr() for 32-bit ARM

Change-Id: I2556d589802d2290da129e03bb33ec11536119cd
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This commit is contained in:
Joseph Chen 2019-02-19 15:54:13 +08:00 committed by Jianhong Chen
parent 595f057c4e
commit f2835bc289
1 changed files with 8 additions and 0 deletions

View File

@ -405,6 +405,14 @@ static inline void set_dacr(unsigned int val)
isb();
}
static inline unsigned int read_mpidr(void)
{
unsigned int mpidr;
asm volatile ("mrc p15, 0, %[mpidr], c0, c0, 5" : [mpidr] "=r" (mpidr));
return mpidr;
}
#ifdef CONFIG_ARMV7_LPAE
/* Long-Descriptor Translation Table Level 1/2 Bits */
#define TTB_SECT_XN_MASK (1ULL << 54)