OSDN Git Service

ARC: Implement native GDB requirements in procfs.h
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / arc / sys / procfs.h
1 /*
2  * Copyright (C) 2013 Synopsys, Inc. (www.synopsys.com)
3  *
4  * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
5  */
6
7 #ifndef _SYS_PROCFS_H
8 #define _SYS_PROCFS_H   1
9
10 /* This is somewhat modelled after the file of the same name on SVR4
11    systems.  It provides a definition of the core file format for ELF
12    used on Linux.  It doesn't have anything to do with the /proc file
13    system, even though Linux has one.
14
15    Anyway, the whole purpose of this file is for GDB and GDB only.
16    Don't read too much into it.  Don't use it for anything other than
17    GDB unless you know what you are doing.  */
18
19 #include <features.h>
20 #include <sys/time.h>
21 #include <sys/types.h>
22 #include <sys/user.h>
23
24 __BEGIN_DECLS
25
26 /* Type for a general-purpose register.  */
27 typedef unsigned long elf_greg_t;
28
29 /* And the whole bunch of them.  We could have used `struct
30    user_regs' directly in the typedef, but tradition says that
31    the register set is an array, which does have some peculiar
32    semantics, so leave it that way.  */
33 #define ELF_NGREG 40
34 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
35 typedef struct { } elf_fpregset_t;
36
37 /* Signal info.  */
38 struct elf_siginfo
39   {
40     int si_signo;                       /* Signal number.  */
41     int si_code;                        /* Extra code.  */
42     int si_errno;                       /* Errno.  */
43   };
44
45 /* Definitions to generate Intel SVR4-like core files.  These mostly
46    have the same names as the SVR4 types with "elf_" tacked on the
47    front to prevent clashes with Linux definitions, and the typedef
48    forms have been avoided.  This is mostly like the SVR4 structure,
49    but more Linuxy, with things that Linux does not support and which
50    GDB doesn't really use excluded.  */
51
52 struct elf_prstatus
53   {
54     struct elf_siginfo pr_info;         /* Info associated with signal.  */
55     short int pr_cursig;                /* Current signal.  */
56     unsigned long int pr_sigpend;       /* Set of pending signals.  */
57     unsigned long int pr_sighold;       /* Set of held signals.  */
58     __pid_t pr_pid;
59     __pid_t pr_ppid;
60     __pid_t pr_pgrp;
61     __pid_t pr_sid;
62     struct timeval pr_utime;            /* User time.  */
63     struct timeval pr_stime;            /* System time.  */
64     struct timeval pr_cutime;           /* Cumulative user time.  */
65     struct timeval pr_cstime;           /* Cumulative system time.  */
66     elf_gregset_t pr_reg;               /* GP registers.  */
67     int pr_fpvalid;                     /* True if math copro being used.  */
68   };
69
70
71 #define ELF_PRARGSZ     (80)    /* Number of chars for args.  */
72
73 struct elf_prpsinfo
74   {
75     char pr_state;                      /* Numeric process state.  */
76     char pr_sname;                      /* Char for pr_state.  */
77     char pr_zomb;                       /* Zombie.  */
78     char pr_nice;                       /* Nice val.  */
79     unsigned long int pr_flag;          /* Flags.  */
80     unsigned short int pr_uid;
81     unsigned short int pr_gid;
82     int pr_pid, pr_ppid, pr_pgrp, pr_sid;
83     /* Lots missing */
84     char pr_fname[16];                  /* Filename of executable.  */
85     char pr_psargs[ELF_PRARGSZ];        /* Initial part of arg list.  */
86   };
87
88 /* The rest of this file provides the types for emulation of the
89    Solaris <proc_service.h> interfaces that should be implemented by
90    users of libthread_db.  */
91
92 /* Addresses.  */
93 typedef void *psaddr_t;
94
95 /* Register sets.  Linux has different names.  */
96 typedef elf_gregset_t prgregset_t;
97 typedef elf_fpregset_t prfpregset_t;
98
99 /* We don't have any differences between processes and threads,
100    therefore have only one PID type.  */
101 typedef __pid_t lwpid_t;
102
103 /* Process status and info.  In the end we do provide typedefs for them.  */
104 typedef struct elf_prstatus prstatus_t;
105 typedef struct elf_prpsinfo prpsinfo_t;
106
107 __END_DECLS
108
109 #endif  /* sys/procfs.h */