From: Yann Sionneau <[email protected]>

Align the specification of the ptrace interface with how it is specified on 
RISC-V.

Signed-off-by: Yann Sionneau <[email protected]>
---
 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(-)

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 <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
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 <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;
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.  */
-- 
2.42.0

_______________________________________________
devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to