hjl / source-git / glibc

Forked from source-git/glibc 3 years ago
Clone

Blame sysdeps/unix/sysv/linux/x86/sys/procfs.h

Packit 6c4009
/* Copyright (C) 2001-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef _SYS_PROCFS_H
Packit 6c4009
#define _SYS_PROCFS_H	1
Packit 6c4009
Packit 6c4009
/* This is somewhat modelled after the file of the same name on SVR4
Packit 6c4009
   systems.  It provides a definition of the core file format for ELF
Packit 6c4009
   used on Linux.  It doesn't have anything to do with the /proc file
Packit 6c4009
   system, even though Linux has one.
Packit 6c4009
Packit 6c4009
   Anyway, the whole purpose of this file is for GDB and GDB only.
Packit 6c4009
   Don't read too much into it.  Don't use it for anything other than
Packit 6c4009
   GDB unless you know what you are doing.  */
Packit 6c4009
Packit 6c4009
#include <features.h>
Packit 6c4009
#include <sys/time.h>
Packit 6c4009
#include <sys/types.h>
Packit 6c4009
#include <sys/user.h>
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
/* Type for a general-purpose register.  */
Packit 6c4009
#ifdef __x86_64__
Packit 6c4009
__extension__ typedef unsigned long long elf_greg_t;
Packit 6c4009
#else
Packit 6c4009
typedef unsigned long elf_greg_t;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* And the whole bunch of them.  We could have used `struct
Packit 6c4009
   user_regs_struct' directly in the typedef, but tradition says that
Packit 6c4009
   the register set is an array, which does have some peculiar
Packit 6c4009
   semantics, so leave it that way.  */
Packit 6c4009
#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
Packit 6c4009
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
Packit 6c4009
Packit 6c4009
#ifndef __x86_64__
Packit 6c4009
/* Register set for the floating-point registers.  */
Packit 6c4009
typedef struct user_fpregs_struct elf_fpregset_t;
Packit 6c4009
Packit 6c4009
/* Register set for the extended floating-point registers.  Includes
Packit 6c4009
   the Pentium III SSE registers in addition to the classic
Packit 6c4009
   floating-point stuff.  */
Packit 6c4009
typedef struct user_fpxregs_struct elf_fpxregset_t;
Packit 6c4009
#else
Packit 6c4009
/* Register set for the extended floating-point registers.  Includes
Packit 6c4009
   the Pentium III SSE registers in addition to the classic
Packit 6c4009
   floating-point stuff.  */
Packit 6c4009
typedef struct user_fpregs_struct elf_fpregset_t;
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Signal info.  */
Packit 6c4009
struct elf_siginfo
Packit 6c4009
  {
Packit 6c4009
    int si_signo;			/* Signal number.  */
Packit 6c4009
    int si_code;			/* Extra code.  */
Packit 6c4009
    int si_errno;			/* Errno.  */
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Definitions to generate Intel SVR4-like core files.  These mostly
Packit 6c4009
   have the same names as the SVR4 types with "elf_" tacked on the
Packit 6c4009
   front to prevent clashes with Linux definitions, and the typedef
Packit 6c4009
   forms have been avoided.  This is mostly like the SVR4 structure,
Packit 6c4009
   but more Linuxy, with things that Linux does not support and which
Packit 6c4009
   GDB doesn't really use excluded.  */
Packit 6c4009
Packit 6c4009
struct elf_prstatus
Packit 6c4009
  {
Packit 6c4009
    struct elf_siginfo pr_info;		/* Info associated with signal.  */
Packit 6c4009
    short int pr_cursig;		/* Current signal.  */
Packit 6c4009
    unsigned long int pr_sigpend;	/* Set of pending signals.  */
Packit 6c4009
    unsigned long int pr_sighold;	/* Set of held signals.  */
Packit 6c4009
    __pid_t pr_pid;
Packit 6c4009
    __pid_t pr_ppid;
Packit 6c4009
    __pid_t pr_pgrp;
Packit 6c4009
    __pid_t pr_sid;
Packit 6c4009
    struct timeval pr_utime;		/* User time.  */
Packit 6c4009
    struct timeval pr_stime;		/* System time.  */
Packit 6c4009
    struct timeval pr_cutime;		/* Cumulative user time.  */
Packit 6c4009
    struct timeval pr_cstime;		/* Cumulative system time.  */
Packit 6c4009
    elf_gregset_t pr_reg;		/* GP registers.  */
Packit 6c4009
    int pr_fpvalid;			/* True if math copro being used.  */
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
Packit 6c4009
#define ELF_PRARGSZ     (80)    /* Number of chars for args.  */
Packit 6c4009
Packit 6c4009
struct elf_prpsinfo
Packit 6c4009
  {
Packit 6c4009
    char pr_state;			/* Numeric process state.  */
Packit 6c4009
    char pr_sname;			/* Char for pr_state.  */
Packit 6c4009
    char pr_zomb;			/* Zombie.  */
Packit 6c4009
    char pr_nice;			/* Nice val.  */
Packit 6c4009
    unsigned long int pr_flag;		/* Flags.  */
Packit 6c4009
#if __WORDSIZE == 32
Packit 6c4009
    unsigned short int pr_uid;
Packit 6c4009
    unsigned short int pr_gid;
Packit 6c4009
#else
Packit 6c4009
    unsigned int pr_uid;
Packit 6c4009
    unsigned int pr_gid;
Packit 6c4009
#endif
Packit 6c4009
    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
Packit 6c4009
    /* Lots missing */
Packit 6c4009
    char pr_fname[16];			/* Filename of executable.  */
Packit 6c4009
    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* The rest of this file provides the types for emulation of the
Packit 6c4009
   Solaris <proc_service.h> interfaces that should be implemented by
Packit 6c4009
   users of libthread_db.  */
Packit 6c4009
Packit 6c4009
/* Addresses.  */
Packit 6c4009
typedef void *psaddr_t;
Packit 6c4009
Packit 6c4009
/* Register sets.  Linux has different names.  */
Packit 6c4009
typedef elf_gregset_t prgregset_t;
Packit 6c4009
typedef elf_fpregset_t prfpregset_t;
Packit 6c4009
Packit 6c4009
/* We don't have any differences between processes and threads,
Packit 6c4009
   therefore have only one PID type.  */
Packit 6c4009
typedef __pid_t lwpid_t;
Packit 6c4009
Packit 6c4009
/* Process status and info.  In the end we do provide typedefs for them.  */
Packit 6c4009
typedef struct elf_prstatus prstatus_t;
Packit 6c4009
typedef struct elf_prpsinfo prpsinfo_t;
Packit 6c4009
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
#endif	/* sys/procfs.h */