]> git.ipfire.org Git - thirdparty/linux.git/commit
riscv: Introduce is_compat_thread() into compat.h
authorLeonardo Bras <leobras@redhat.com>
Wed, 3 Jan 2024 16:00:22 +0000 (13:00 -0300)
committerPalmer Dabbelt <palmer@rivosinc.com>
Tue, 19 Mar 2024 23:39:39 +0000 (16:39 -0700)
commit5917ea17ad07f35bb5be4fd5fdcd408f090e347b
tree34c9b64a528c454e6b5c8dd0e7edda5e6604b2c6
parent4c0b5a451675e9a95be98a16ddb889bb0486d2ad
riscv: Introduce is_compat_thread() into compat.h

task_user_regset_view() makes use of a function very similar to
is_compat_task(), but pointing to a any thread.

In arm64 asm/compat.h there is a function very similar to that:
is_compat_thread(struct thread_info *thread)

Copy this function to riscv asm/compat.h and make use of it into
task_user_regset_view().

Also, introduce a compile-time test for CONFIG_COMPAT and simplify the
function code by removing the #ifdef.

Signed-off-by: Leonardo Bras <leobras@redhat.com>
Reviewed-by: Guo Ren <guoren@kernel.org>
Reviewed-by: Andy Chiu <andy.chiu@sifive.com>
Link: https://lore.kernel.org/r/20240103160024.70305-6-leobras@redhat.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/compat.h
arch/riscv/kernel/ptrace.c