about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/riscv/sys/procfs.h
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmer@dabbelt.com>2018-01-29 10:28:32 -0800
committerPalmer Dabbelt <palmer@dabbelt.com>2018-01-29 10:37:27 -0800
commit7f33b09c65e3fdb6b6a1af8816918bcce977b38a (patch)
tree820a99249081334d21f7a4eb7fa621c05d2337ca /sysdeps/unix/sysv/linux/riscv/sys/procfs.h
parent36960f0c763a904d6d1f028e2c33b7bbe43c2a3a (diff)
downloadglibc-7f33b09c65e3fdb6b6a1af8816918bcce977b38a.tar.gz
glibc-7f33b09c65e3fdb6b6a1af8816918bcce977b38a.tar.xz
glibc-7f33b09c65e3fdb6b6a1af8816918bcce977b38a.zip
RISC-V: Linux ABI
Linux-specific code that is required for maintaining ABI compatibility.
This doesn't contain the actual system call interface, that is split out
in order to avoid having a patch that's too big.

2018-01-29  Palmer Dabbelt  <palmer@sifive.com>

        * sysdeps/riscv/nptl/pthread-offsets.h: New file.
        * sysdeps/riscv/nptl/pthreaddef.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/bits/fcntl.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/bits/mman.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/bits/sigcontext.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/dl-cache.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/flush-icache.c: Likewise.
        * sysdeps/unix/sysv/linux/riscv/getcontext.S: Likewise.
        * sysdeps/unix/sysv/linux/riscv/init-first.c: Likewise.
        * sysdeps/unix/sysv/linux/riscv/libc-vdso.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/makecontext.c: Likewise.
        * sysdeps/unix/sysv/linux/riscv/readelflib.c: Likewise.
        * sysdeps/unix/sysv/linux/riscv/register-dump.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/setcontext.S: Likewise.
        * sysdeps/unix/sysv/linux/riscv/sigcontextinfo.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/swapcontext.S: Likewise.
        * sysdeps/unix/sysv/linux/riscv/sys/cachectl.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/sys/procfs.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/sys/ucontext.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/sys/user.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/ucontext-macros.h: Likewise.
        * sysdeps/unix/sysv/linux/riscv/ucontext_i.sym: Likewise.
Diffstat (limited to 'sysdeps/unix/sysv/linux/riscv/sys/procfs.h')
-rw-r--r--sysdeps/unix/sysv/linux/riscv/sys/procfs.h114
1 files changed, 114 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/riscv/sys/procfs.h b/sysdeps/unix/sysv/linux/riscv/sys/procfs.h
new file mode 100644
index 0000000000..518de56741
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/riscv/sys/procfs.h
@@ -0,0 +1,114 @@
+/* Core image file related definitions, RISC-V version.
+   Copyright (C) 1996-2018 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _SYS_PROCFS_H
+#define _SYS_PROCFS_H	1
+
+/* This is somehow modelled after the file of the same name on SysVr4
+   systems.  It provides a definition of the core file format for ELF
+   used on Linux.  */
+
+#include <features.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/user.h>
+#include <sys/ucontext.h>
+
+/* ELF register definitions */
+#define ELF_NGREG	NGREG
+#define ELF_NFPREG	NFPREG
+
+typedef unsigned long int elf_greg_t;
+typedef unsigned long int elf_gregset_t[32];
+typedef union __riscv_mc_fp_state elf_fpregset_t;
+
+__BEGIN_DECLS
+
+struct elf_siginfo
+  {
+    int si_signo;			/* Signal number.  */
+    int si_code;			/* Extra code.  */
+    int si_errno;			/* Errno.  */
+  };
+
+
+/* Definitions to generate Intel SVR4-like core files.  These mostly
+   have the same names as the SVR4 types with "elf_" tacked on the
+   front to prevent clashes with linux definitions, and the typedef
+   forms have been avoided.  This is mostly like the SVR4 structure,
+   but more Linuxy, with things that Linux does not support and which
+   gdb doesn't really use excluded.  Fields present but not used are
+   marked with "XXX".  */
+struct elf_prstatus
+  {
+    struct elf_siginfo pr_info;		/* Info associated with signal.  */
+    short int pr_cursig;		/* Current signal.  */
+    unsigned long int pr_sigpend;	/* Set of pending signals.  */
+    unsigned long int pr_sighold;	/* Set of held signals.  */
+    __pid_t pr_pid;
+    __pid_t pr_ppid;
+    __pid_t pr_pgrp;
+    __pid_t pr_sid;
+    struct timeval pr_utime;		/* User time.  */
+    struct timeval pr_stime;		/* System time.  */
+    struct timeval pr_cutime;		/* Cumulative user time.  */
+    struct timeval pr_cstime;		/* Cumulative system time.  */
+    elf_gregset_t pr_reg;		/* GP registers.  */
+    int pr_fpvalid;			/* True if math copro being used.  */
+  };
+
+
+#define ELF_PRARGSZ     (80)    /* Number of chars for args */
+
+struct elf_prpsinfo
+  {
+    char pr_state;			/* Numeric process state.  */
+    char pr_sname;			/* Char for pr_state.  */
+    char pr_zomb;			/* Zombie.  */
+    char pr_nice;			/* Nice val.  */
+    unsigned long int pr_flag;		/* Flags.  */
+    long int pr_uid;
+    long int pr_gid;
+    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
+    /* Lots missing */
+    char pr_fname[16];			/* Filename of executable.  */
+    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
+  };
+
+/* The rest of this file provides the types for emulation of the
+   Solaris <proc_service.h> interfaces that should be implemented by
+   users of libthread_db.  */
+
+/* Addresses.  */
+typedef void *psaddr_t;
+
+/* Register sets.  Linux has different names.  */
+typedef elf_gregset_t prgregset_t;
+typedef elf_fpregset_t prfpregset_t;
+
+/* We don't have any differences between processes and threads,
+   therefore habe only ine PID type.  */
+typedef __pid_t lwpid_t;
+
+/* Process status and info.  In the end we do provide typedefs for them.  */
+typedef struct elf_prstatus prstatus_t;
+typedef struct elf_prpsinfo prpsinfo_t;
+
+__END_DECLS
+
+#endif	/* sys/procfs.h */