arch:add faultmask register operation to armv7-m & armv8-m
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
parent
8fb98bc9d1
commit
172d467c26
@ -474,6 +474,33 @@ static inline uint32_t getipsr(void)
|
||||
return ipsr;
|
||||
}
|
||||
|
||||
/* Get/set FAULTMASK */
|
||||
|
||||
static inline uint32_t getfaultmask(void) always_inline_function;
|
||||
static inline uint32_t getfaultmask(void)
|
||||
{
|
||||
uint32_t faultmask;
|
||||
__asm__ __volatile__
|
||||
(
|
||||
"\tmrs %0, faultmask\n"
|
||||
: "=r" (faultmask)
|
||||
:
|
||||
: "memory");
|
||||
|
||||
return faultmask;
|
||||
}
|
||||
|
||||
static inline void setfaultmask(uint32_t faultmask) always_inline_function;
|
||||
static inline void setfaultmask(uint32_t faultmask)
|
||||
{
|
||||
__asm__ __volatile__
|
||||
(
|
||||
"\tmsr faultmask, %0\n"
|
||||
:
|
||||
: "r" (faultmask)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
/* Get/set CONTROL */
|
||||
|
||||
static inline uint32_t getcontrol(void) always_inline_function;
|
||||
|
@ -451,6 +451,33 @@ static inline uint32_t getipsr(void)
|
||||
return ipsr;
|
||||
}
|
||||
|
||||
/* Get/set FAULTMASK */
|
||||
|
||||
static inline uint32_t getfaultmask(void) always_inline_function;
|
||||
static inline uint32_t getfaultmask(void)
|
||||
{
|
||||
uint32_t faultmask;
|
||||
__asm__ __volatile__
|
||||
(
|
||||
"\tmrs %0, faultmask\n"
|
||||
: "=r" (faultmask)
|
||||
:
|
||||
: "memory");
|
||||
|
||||
return faultmask;
|
||||
}
|
||||
|
||||
static inline void setfaultmask(uint32_t faultmask) always_inline_function;
|
||||
static inline void setfaultmask(uint32_t faultmask)
|
||||
{
|
||||
__asm__ __volatile__
|
||||
(
|
||||
"\tmsr faultmask, %0\n"
|
||||
:
|
||||
: "r" (faultmask)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
/* Get/set CONTROL */
|
||||
|
||||
static inline uint32_t getcontrol(void) always_inline_function;
|
||||
|
Loading…
Reference in New Issue
Block a user