lkml.org 
[lkml]   [2022]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH V11 14/22] LoongArch: Add signal handling support
From
On 5/18/22 17:26, Huacai Chen wrote:
> Add ucontext/sigcontext definition and signal handling support for
> LoongArch.
>
> Cc: Eric Biederman <ebiederm@xmission.com>
> Cc: Al Viro <viro@zeniv.linux.org.uk>
> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
> ---
> arch/loongarch/include/uapi/asm/sigcontext.h | 44 ++
> arch/loongarch/include/uapi/asm/signal.h | 13 +
> arch/loongarch/include/uapi/asm/ucontext.h | 35 ++
> arch/loongarch/kernel/signal.c | 566 +++++++++++++++++++
> 4 files changed, 658 insertions(+)
> create mode 100644 arch/loongarch/include/uapi/asm/sigcontext.h
> create mode 100644 arch/loongarch/include/uapi/asm/signal.h
> create mode 100644 arch/loongarch/include/uapi/asm/ucontext.h
> create mode 100644 arch/loongarch/kernel/signal.c
>
> diff --git a/arch/loongarch/include/uapi/asm/sigcontext.h b/arch/loongarch/include/uapi/asm/sigcontext.h
> new file mode 100644
> index 000000000000..be3d3c6ac83e
> --- /dev/null
> +++ b/arch/loongarch/include/uapi/asm/sigcontext.h
> @@ -0,0 +1,44 @@
> +/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
> +/*
> + * Author: Hanlu Li <lihanlu@loongson.cn>
> + * Huacai Chen <chenhuacai@loongson.cn>
> + *
> + * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
> + */
> +#ifndef _UAPI_ASM_SIGCONTEXT_H
> +#define _UAPI_ASM_SIGCONTEXT_H
> +
> +#include <linux/types.h>
> +#include <linux/posix_types.h>
> +
> +/* FP context was used */
> +#define SC_USED_FP (1 << 0)
> +/* Address error was due to memory load */
> +#define SC_ADDRERR_RD (1 << 30)
> +/* Address error was due to memory store */
> +#define SC_ADDRERR_WR (1 << 31)

Looks nice.

BTW: following some communication it appears that the SC_ADDRERR_*
constants are not tightly coupled to BUS_ADRERR after all, so the
spelling is "fixed".

I don't have anything more to comment, because the rest are either
reviewed or non-userspace-ABI that don't exactly require getting right
from the beginning. (Not to say they're flawed.)

Reviewed-by: WANG Xuerui <git@xen0n.name>

\
 
 \ /
  Last update: 2022-05-18 18:18    [W:0.327 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site