xref: /minix3/minix/include/sys/procfs.h (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc /*
2*433d6423SLionel Sambuc  * This file mainly provides a definition of the structures used
3*433d6423SLionel Sambuc  * to describe the notes section of an ELF file. It doesn't have
4*433d6423SLionel Sambuc  * anything to do with the /proc file system, even though MINIX
5*433d6423SLionel Sambuc  * has one.
6*433d6423SLionel Sambuc  *
7*433d6423SLionel Sambuc  * The whole purpose of this file is for GDB and GDB only.
8*433d6423SLionel Sambuc  */
9*433d6423SLionel Sambuc 
10*433d6423SLionel Sambuc #ifndef _SYS_PROCFS_H_
11*433d6423SLionel Sambuc #define _SYS_PROCFS_H_
12*433d6423SLionel Sambuc 
13*433d6423SLionel Sambuc #include <sys/param.h>
14*433d6423SLionel Sambuc #include <sys/elf_core.h>
15*433d6423SLionel Sambuc #include <i386/stackframe.h>
16*433d6423SLionel Sambuc 
17*433d6423SLionel Sambuc /*
18*433d6423SLionel Sambuc  *
19*433d6423SLionel Sambuc  * These structures define an interface between core files and the debugger.
20*433d6423SLionel Sambuc  * Never change or delete any elements. These structures are modeled from
21*433d6423SLionel Sambuc  * the file with the same name from FreeBSD
22*433d6423SLionel Sambuc  *
23*433d6423SLionel Sambuc  * A lot more things should be added to these structures.  At present,
24*433d6423SLionel Sambuc  * they contain the absolute bare minimum required to allow GDB to work
25*433d6423SLionel Sambuc  * with ELF core dumps.
26*433d6423SLionel Sambuc  */
27*433d6423SLionel Sambuc 
28*433d6423SLionel Sambuc /*
29*433d6423SLionel Sambuc  * The parenthsized numbers like (1) indicate the minimum version number
30*433d6423SLionel Sambuc  * for which each element exists in the structure.
31*433d6423SLionel Sambuc  */
32*433d6423SLionel Sambuc 
33*433d6423SLionel Sambuc #define PRSTATUS_VERSION	1	/* Current version of prstatus_t */
34*433d6423SLionel Sambuc 
35*433d6423SLionel Sambuc typedef struct prstatus {
36*433d6423SLionel Sambuc     int		pr_version;	/* Version number of struct (1) */
37*433d6423SLionel Sambuc     size_t	pr_statussz;	/* sizeof(prstatus_t) (1) */
38*433d6423SLionel Sambuc     size_t	pr_gregsetsz;	/* sizeof(gregset_t) (1) */
39*433d6423SLionel Sambuc     size_t	pr_fpregsetsz;	/* sizeof(fpregset_t) (1) */
40*433d6423SLionel Sambuc     int		pr_osreldate;	/* Kernel version (1) */
41*433d6423SLionel Sambuc     int		pr_cursig;	/* Current signal (1) */
42*433d6423SLionel Sambuc     pid_t	pr_pid;		/* Process ID (1) */
43*433d6423SLionel Sambuc     gregset_t	pr_reg;		/* General purpose registers (1) */
44*433d6423SLionel Sambuc } prstatus_t;
45*433d6423SLionel Sambuc 
46*433d6423SLionel Sambuc #define PRARGSZ		80	/* Maximum argument bytes saved */
47*433d6423SLionel Sambuc 
48*433d6423SLionel Sambuc #ifndef MAXCOMLEN
49*433d6423SLionel Sambuc # define MAXCOMLEN      16      /* Maximum command line arguments */
50*433d6423SLionel Sambuc #endif
51*433d6423SLionel Sambuc 
52*433d6423SLionel Sambuc #define PRPSINFO_VERSION	1	/* Current version of prpsinfo_t */
53*433d6423SLionel Sambuc 
54*433d6423SLionel Sambuc typedef struct prpsinfo {
55*433d6423SLionel Sambuc     int		pr_version;	/* Version number of struct (1) */
56*433d6423SLionel Sambuc     size_t	pr_psinfosz;	/* sizeof(prpsinfo_t) (1) */
57*433d6423SLionel Sambuc     char	pr_fname[MAXCOMLEN+1];	/* Command name, null terminated (1) */
58*433d6423SLionel Sambuc     char	pr_psargs[PRARGSZ+1];	/* Arguments, null terminated (1) */
59*433d6423SLionel Sambuc } prpsinfo_t;
60*433d6423SLionel Sambuc 
61*433d6423SLionel Sambuc #endif /* _SYS_PROCFS_H_ */
62*433d6423SLionel Sambuc 
63