mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 10:09:10 +02:00
kselftest/arm64: Move/add POE helpers to test_signals_utils.h
In preparation to adding further POE signal tests, move get_por_el0() to test_signals_utils.h and add set_por_el0(). Reviewed-by: Mark Brown <broonie@kernel.org> Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com> Signed-off-by: Will Deacon <will@kernel.org>
This commit is contained in:
parent
42c2195406
commit
925a082ec2
|
|
@ -57,6 +57,22 @@ static inline __attribute__((always_inline)) uint64_t get_gcspr_el0(void)
|
|||
return val;
|
||||
}
|
||||
|
||||
#define SYS_POR_EL0 "S3_3_C10_C2_4"
|
||||
|
||||
static inline uint64_t get_por_el0(void)
|
||||
{
|
||||
uint64_t val;
|
||||
|
||||
asm volatile("mrs %0, " SYS_POR_EL0 "\n" : "=r"(val));
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline void set_por_el0(uint64_t val)
|
||||
{
|
||||
asm volatile("msr " SYS_POR_EL0 ", %0\n" :: "r"(val));
|
||||
}
|
||||
|
||||
static inline bool feats_ok(struct tdescr *td)
|
||||
{
|
||||
if (td->feats_incompatible & td->feats_supported)
|
||||
|
|
|
|||
|
|
@ -21,21 +21,6 @@ static union {
|
|||
char buf[1024 * 128];
|
||||
} context;
|
||||
|
||||
#define SYS_POR_EL0 "S3_3_C10_C2_4"
|
||||
|
||||
static uint64_t get_por_el0(void)
|
||||
{
|
||||
uint64_t val;
|
||||
|
||||
asm volatile(
|
||||
"mrs %0, " SYS_POR_EL0 "\n"
|
||||
: "=r"(val)
|
||||
:
|
||||
: );
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
int poe_present(struct tdescr *td, siginfo_t *si, ucontext_t *uc)
|
||||
{
|
||||
struct _aarch64_ctx *head = GET_BUF_RESV_HEAD(context);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user