aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/x86_64/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/x86_64/sys')
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sys/perm.h36
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sys/procfs.h127
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sys/reg.h47
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sys/ucontext.h160
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sys/user.h97
5 files changed, 467 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/x86_64/sys/perm.h b/sysdeps/unix/sysv/linux/x86_64/sys/perm.h
new file mode 100644
index 0000000000..382fa92ee3
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/sys/perm.h
@@ -0,0 +1,36 @@
+/* Copyright (C) 1996, 1999, 2001 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_PERM_H
+
+#define _SYS_PERM_H 1
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Set port input/output permissions. */
+extern int ioperm (unsigned long int __from, unsigned long int __num,
+ int __turn_on) __THROW;
+
+
+/* Change I/O privilege level. */
+extern int iopl (int __level) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_PERM_H */
diff --git a/sysdeps/unix/sysv/linux/x86_64/sys/procfs.h b/sysdeps/unix/sysv/linux/x86_64/sys/procfs.h
new file mode 100644
index 0000000000..d774c63706
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/sys/procfs.h
@@ -0,0 +1,127 @@
+/* Copyright (C) 2001 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_PROCFS_H
+#define _SYS_PROCFS_H 1
+
+/* This is somewhat modelled after the file of the same name on SVR4
+ systems. It provides a definition of the core file format for ELF
+ used on Linux. It doesn't have anything to do with the /proc file
+ system, even though Linux has one.
+
+ Anyway, the whole purpose of this file is for GDB and GDB only.
+ Don't read too much into it. Don't use it for anything other than
+ GDB unless you know what you are doing. */
+
+#include <features.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/user.h>
+
+__BEGIN_DECLS
+
+/* Type for a general-purpose register. */
+typedef unsigned long elf_greg_t;
+
+/* And the whole bunch of them. We could have used `struct
+ user_regs_struct' 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];
+
+/* Register set for the extended floating-point registers. Includes
+ the Pentium III SSE registers in addition to the classic
+ floating-point stuff. */
+typedef struct user_fpregs_struct elf_fpregset_t;
+
+/* Signal info. */
+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. */
+
+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. */
+ unsigned int pr_uid;
+ unsigned 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 have only one 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 */
diff --git a/sysdeps/unix/sysv/linux/x86_64/sys/reg.h b/sysdeps/unix/sysv/linux/x86_64/sys/reg.h
new file mode 100644
index 0000000000..fec64d6f17
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/sys/reg.h
@@ -0,0 +1,47 @@
+/* Copyright (C) 2001 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_REG_H
+#define _SYS_REG_H 1
+
+/* Index into an array of 8 byte longs returned from ptrace for
+ location of the users' stored general purpose registers. */
+
+#define R15 0
+#define R14 1
+#define R13 2
+#define R12 3
+#define RBP 4
+#define RBX 5
+#define R11 6
+#define R10 7
+#define R9 8
+#define R8 9
+#define RAX 10
+#define RCX 11
+#define RDX 12
+#define RSI 13
+#define RDI 14
+#define ORIG_RAX 15
+#define RIP 16
+#define CS 17
+#define EFLAGS 18
+#define RSP 19
+#define SS 20
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/x86_64/sys/ucontext.h b/sysdeps/unix/sysv/linux/x86_64/sys/ucontext.h
new file mode 100644
index 0000000000..6b69c84db2
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/sys/ucontext.h
@@ -0,0 +1,160 @@
+/* Copyright (C) 2001 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H 1
+
+#include <features.h>
+#include <signal.h>
+
+/* We need the signal context definitions even if they are not used
+ included in <signal.h>. */
+#include <bits/sigcontext.h>
+
+/* Type for general register. */
+typedef long int greg_t;
+
+/* Number of general registers. */
+#define NGREG 27
+
+/* Container for all general registers. */
+typedef greg_t gregset_t[NGREG];
+
+#ifdef __USE_GNU
+/* Number of each register in the `gregset_t' array. */
+enum
+{
+ REG_GSFS = 0,
+# define REG_GSFS REG_GSFS
+ REG_ESDS,
+# define REG_ESDS REG_ESDS
+ REG_R8,
+# define REG_R8 REG_R8
+ REG_R9,
+# define REG_R9 REG_R9
+ REG_R10,
+# define REG_R10 REG_R10
+ REG_R11,
+# define REG_R11 REG_R11
+ REG_R12,
+# define REG_R12 REG_R12
+ REG_R13,
+# define REG_R13 REG_R13
+ REG_R14,
+# define REG_R14 REG_R14
+ REG_R15,
+# define REG_R15 REG_R15
+ REG_RDI,
+# define REG_RDI REG_RDI
+ REG_RSI,
+# define REG_RSI REG_RSI
+ REG_RBP,
+# define REG_RBP REG_RBP
+ REG_RSP,
+# define REG_RSP REG_RSP
+ REG_RBX,
+# define REG_RBX REG_RBX
+ REG_RDX,
+# define REG_RDX REG_RDX
+ REG_RCX,
+# define REG_RCX REG_RCX
+ REG_RAX,
+# define REG_RAX REG_RAX
+ REG_TRAPNO,
+# define REG_TRAPNO REG_TRAPNO
+ REG_ERR,
+# define REG_ERR REG_ERR
+ REG_RIP,
+# define REG_RIP REG_RIP
+ REG_CS,
+# define REG_CS REG_CS
+ REG_EFL,
+# define REG_EFL REG_EFL
+ REG_URSP,
+# define REG_URSP REG_URSP
+ REG_SS
+# define REG_SS REG_SS
+};
+#endif
+
+/* Definitions taken from the kernel headers. */
+struct _libc_fpreg
+{
+ unsigned short int significand[4];
+ unsigned short int exponent;
+};
+
+struct _libc_fpxreg
+{
+ unsigned short int significand[4];
+ unsigned short int exponent;
+ unsigned short int padding[3];
+};
+
+struct _libc_xmmreg
+{
+ unsigned long int element[4];
+};
+
+struct _libc_fpstate
+{
+ /* Regular FPU environment. */
+ unsigned long int cw;
+ unsigned long int sw;
+ unsigned long int tag;
+ unsigned long int ipoff;
+ unsigned long int cssel;
+ unsigned long int dataoff;
+ unsigned long int datasel;
+ struct _libc_fpreg _st[16];
+ unsigned short int status;
+ unsigned short int magic;
+ /* FXSR FPU environment. */
+
+ unsigned long int _fxsr_env[6];
+ unsigned long int mxcsr;
+ unsigned long int reserved;
+ struct _libc_fpxreg _fxsr_st[8];
+ struct _libc_xmmreg _xmm[16];
+ unsigned long int padding[32];
+};
+
+/* Structure to describe FPU registers. */
+typedef struct _libc_fpstate fpregset_t;
+
+/* Context to describe whole processor state. */
+typedef struct
+ {
+ gregset_t gregs;
+ fpregset_t fpregs;
+ unsigned long int oldmask;
+ unsigned long int cr2;
+ } mcontext_t;
+
+/* Userlevel context. */
+typedef struct ucontext
+ {
+ unsigned long int uc_flags;
+ struct ucontext *uc_link;
+ stack_t uc_stack;
+ mcontext_t uc_mcontext;
+ __sigset_t uc_sigmask;
+ struct _libc_fpstate __fpregs_mem;
+ } ucontext_t;
+
+#endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/x86_64/sys/user.h b/sysdeps/unix/sysv/linux/x86_64/sys/user.h
new file mode 100644
index 0000000000..2df7b2e46d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/sys/user.h
@@ -0,0 +1,97 @@
+/* Copyright (C) 2001 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_USER_H
+#define _SYS_USER_H 1
+
+/* The whole purpose of this file is for GDB and GDB only. Don't read
+ too much into it. Don't use it for anything other than GDB unless
+ you know what you are doing. */
+
+struct user_fpregs_struct
+{
+ unsigned short int cwd;
+ unsigned short int swd;
+ unsigned short int twd;
+ unsigned short int fop;
+ unsigned int fip;
+ unsigned int fcs;
+ unsigned int foo;
+ unsigned int fos;
+ unsigned int mxcsr;
+ unsigned int reserved;
+ unsigned int st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
+ unsigned int xmm_space[32]; /* 8*16 bytes for each XMM-reg = 128 bytes */
+ unsigned int padding[56];
+};
+
+struct user_regs_struct
+{
+ unsigned long r15;
+ unsigned long r14;
+ unsigned long r13;
+ unsigned long r12;
+ unsigned long rbp;
+ unsigned long rbx;
+ unsigned long r11;
+ unsigned long r10;
+ unsigned long r9;
+ unsigned long r8;
+ unsigned long rax;
+ unsigned long rcx;
+ unsigned long rdx;
+ unsigned long rsi;
+ unsigned long rdi;
+ unsigned long orig_rax;
+ unsigned long rip;
+ unsigned long cs;
+ unsigned long eflags;
+ unsigned long rsp;
+ unsigned long ss;
+ unsigned long fs_base;
+ unsigned long kernel_gs_base;
+};
+
+struct user
+{
+ struct user_regs_struct regs;
+ int u_fpvalid;
+ struct user_fpregs_struct i387;
+ unsigned long int u_tsize;
+ unsigned long int u_dsize;
+ unsigned long int u_ssize;
+ unsigned long start_code;
+ unsigned long start_stack;
+ long int signal;
+ int reserved;
+ struct user_regs_struct* u_ar0;
+ struct user_fpregs_struct* u_fpstate;
+ unsigned long int magic;
+ char u_comm [32];
+ int u_debugreg [8];
+};
+
+#define PAGE_SHIFT 12
+#define PAGE_SIZE (1UL << PAGE_SHIFT)
+#define PAGE_MASK (~(PAGE_SIZE-1))
+#define NBPG PAGE_SIZE
+#define UPAGES 1
+#define HOST_TEXT_START_ADDR (u.start_code)
+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
+
+#endif /* _SYS_USER_H */