diff options
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/include/uapi/asm/sigcontext.h | 7 | ||||
-rw-r--r-- | arch/arm64/kernel/signal.c | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm64/include/uapi/asm/sigcontext.h b/arch/arm64/include/uapi/asm/sigcontext.h index 690ad51cc901..b72cf405b3fe 100644 --- a/arch/arm64/include/uapi/asm/sigcontext.h +++ b/arch/arm64/include/uapi/asm/sigcontext.h | |||
@@ -53,5 +53,12 @@ struct fpsimd_context { | |||
53 | __uint128_t vregs[32]; | 53 | __uint128_t vregs[32]; |
54 | }; | 54 | }; |
55 | 55 | ||
56 | /* ESR_EL1 context */ | ||
57 | #define ESR_MAGIC 0x45535201 | ||
58 | |||
59 | struct esr_context { | ||
60 | struct _aarch64_ctx head; | ||
61 | u64 esr; | ||
62 | }; | ||
56 | 63 | ||
57 | #endif /* _UAPI__ASM_SIGCONTEXT_H */ | 64 | #endif /* _UAPI__ASM_SIGCONTEXT_H */ |
diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c index 7ff2eee96c6b..dc2ab1b0ac0d 100644 --- a/arch/arm64/kernel/signal.c +++ b/arch/arm64/kernel/signal.c | |||
@@ -194,6 +194,16 @@ static int setup_sigframe(struct rt_sigframe __user *sf, | |||
194 | aux += sizeof(*fpsimd_ctx); | 194 | aux += sizeof(*fpsimd_ctx); |
195 | } | 195 | } |
196 | 196 | ||
197 | /* fault information, if valid */ | ||
198 | if (current->thread.fault_code) { | ||
199 | struct esr_context *esr_ctx = | ||
200 | container_of(aux, struct esr_context, head); | ||
201 | __put_user_error(ESR_MAGIC, &esr_ctx->head.magic, err); | ||
202 | __put_user_error(sizeof(*esr_ctx), &esr_ctx->head.size, err); | ||
203 | __put_user_error(current->thread.fault_code, &esr_ctx->esr, err); | ||
204 | aux += sizeof(*esr_ctx); | ||
205 | } | ||
206 | |||
197 | /* set the "end" magic */ | 207 | /* set the "end" magic */ |
198 | end = aux; | 208 | end = aux; |
199 | __put_user_error(0, &end->magic, err); | 209 | __put_user_error(0, &end->magic, err); |