From b49013485476dd508ae82e6143e1e73795e4c348 Mon Sep 17 00:00:00 2001 From: Yann Sionneau Date: Thu, 14 Sep 2023 16:55:22 +0200 Subject: kvx: align specification of user regs Align the specification of the ptrace interface with how it is specified on RISC-V. Signed-off-by: Yann Sionneau --- libc/sysdeps/linux/kvx/sys/procfs.h | 13 ++++--------- libc/sysdeps/linux/kvx/sys/ucontext.h | 5 ++--- libc/sysdeps/linux/kvx/sys/user.h | 28 +--------------------------- 3 files changed, 7 insertions(+), 39 deletions(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/kvx/sys/procfs.h b/libc/sysdeps/linux/kvx/sys/procfs.h index bbbfb838e..b72322888 100644 --- a/libc/sysdeps/linux/kvx/sys/procfs.h +++ b/libc/sysdeps/linux/kvx/sys/procfs.h @@ -31,20 +31,15 @@ #include #include #include +#include -__BEGIN_DECLS +#define ELF_NGREG NGREG -/* Type for a general-purpose register. */ typedef unsigned long elf_greg_t; -/* No FP registers for kvx. */ +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; typedef struct {} elf_fpregset_t; -/* And the whole bunch of them. We could have used `struct - pt_regs' directly in the typedef, but tradition says that - the register set is an array, which does have some peculiar - semantics, so leave it that way. */ -#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) -typedef elf_greg_t elf_gregset_t[ELF_NGREG]; +__BEGIN_DECLS /* Signal info. */ struct elf_siginfo diff --git a/libc/sysdeps/linux/kvx/sys/ucontext.h b/libc/sysdeps/linux/kvx/sys/ucontext.h index 548892389..a97b83cad 100644 --- a/libc/sysdeps/linux/kvx/sys/ucontext.h +++ b/libc/sysdeps/linux/kvx/sys/ucontext.h @@ -12,12 +12,11 @@ #include #include +#define NGREG 70 + /* Type for general register. */ typedef unsigned long greg_t; -/* Number of general registers. */ -#define NGREG 64 - typedef struct ucontext { unsigned long uc_flags; struct ucontext *uc_link; diff --git a/libc/sysdeps/linux/kvx/sys/user.h b/libc/sysdeps/linux/kvx/sys/user.h index 2e228ff19..c871f1a03 100644 --- a/libc/sysdeps/linux/kvx/sys/user.h +++ b/libc/sysdeps/linux/kvx/sys/user.h @@ -1,27 +1 @@ -/* - * This file is subject to the terms and conditions of the LGPL V2.1 - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 2019 Kalray Inc. - */ - -#ifndef _SYS_USER_H -#define _SYS_USER_H 1 - -struct user_regs_struct -{ - /* GPR */ - unsigned long long gpr_regs[64]; - - /* SFR */ - unsigned long lc; - unsigned long le; - unsigned long ls; - unsigned long ra; - - unsigned long cs; - unsigned long spc; -}; - -#endif +/* This file is not needed, but in practice gdb might try to include it. */ -- cgit v1.2.3