Browse Source

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 <ysionneau@kalray.eu>
Yann Sionneau 1 year ago
parent
commit
b490134854

+ 4 - 9
libc/sysdeps/linux/kvx/sys/procfs.h

@@ -31,20 +31,15 @@
 #include <sys/time.h>
 #include <sys/types.h>
 #include <sys/user.h>
+#include <sys/ucontext.h>
 
-__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

+ 2 - 3
libc/sysdeps/linux/kvx/sys/ucontext.h

@@ -12,12 +12,11 @@
 #include <signal.h>
 #include <bits/sigcontext.h>
 
+#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;

+ 1 - 27
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.  */