xref: /freebsd/sys/sys/procfs.h (revision cfdb160e3181f671ac7d9519329b9ff268f5ac28)
18c64af4fSJohn Polstra /*-
28c64af4fSJohn Polstra  * Copyright (c) 1998 John D. Polstra.
38c64af4fSJohn Polstra  * All rights reserved.
48c64af4fSJohn Polstra  *
58c64af4fSJohn Polstra  * Redistribution and use in source and binary forms, with or without
68c64af4fSJohn Polstra  * modification, are permitted provided that the following conditions
78c64af4fSJohn Polstra  * are met:
88c64af4fSJohn Polstra  * 1. Redistributions of source code must retain the above copyright
98c64af4fSJohn Polstra  *    notice, this list of conditions and the following disclaimer.
108c64af4fSJohn Polstra  * 2. Redistributions in binary form must reproduce the above copyright
118c64af4fSJohn Polstra  *    notice, this list of conditions and the following disclaimer in the
128c64af4fSJohn Polstra  *    documentation and/or other materials provided with the distribution.
138c64af4fSJohn Polstra  *
148c64af4fSJohn Polstra  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
158c64af4fSJohn Polstra  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
168c64af4fSJohn Polstra  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
178c64af4fSJohn Polstra  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
188c64af4fSJohn Polstra  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
198c64af4fSJohn Polstra  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
208c64af4fSJohn Polstra  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
218c64af4fSJohn Polstra  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
228c64af4fSJohn Polstra  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
238c64af4fSJohn Polstra  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
248c64af4fSJohn Polstra  * SUCH DAMAGE.
258c64af4fSJohn Polstra  *
26c3aac50fSPeter Wemm  * $FreeBSD$
278c64af4fSJohn Polstra  */
288c64af4fSJohn Polstra 
298c64af4fSJohn Polstra #ifndef _SYS_PROCFS_H_
308c64af4fSJohn Polstra #define _SYS_PROCFS_H_
318c64af4fSJohn Polstra 
328c64af4fSJohn Polstra #include <sys/param.h>
338c64af4fSJohn Polstra #include <machine/reg.h>
348c64af4fSJohn Polstra 
358c64af4fSJohn Polstra typedef struct reg gregset_t;
368c64af4fSJohn Polstra typedef struct fpreg fpregset_t;
378c64af4fSJohn Polstra 
388c64af4fSJohn Polstra /*
398c64af4fSJohn Polstra  * These structures define an interface between core files and the debugger.
408c64af4fSJohn Polstra  * Never change or delete any elements.  If you add elements, add them to
418c64af4fSJohn Polstra  * the end of the structure, and increment the value of its version field.
428c64af4fSJohn Polstra  * This will help to ensure that today's core dump will still be usable
438c64af4fSJohn Polstra  * with next year's debugger.
448c64af4fSJohn Polstra  *
458c64af4fSJohn Polstra  * A lot more things should be added to these structures.  At present,
468c64af4fSJohn Polstra  * they contain the absolute bare minimum required to allow GDB to work
478c64af4fSJohn Polstra  * with ELF core dumps.
488c64af4fSJohn Polstra  */
498c64af4fSJohn Polstra 
508c64af4fSJohn Polstra /*
518c64af4fSJohn Polstra  * The parenthsized numbers like (1) indicate the minimum version number
528c64af4fSJohn Polstra  * for which each element exists in the structure.
538c64af4fSJohn Polstra  */
548c64af4fSJohn Polstra 
558c64af4fSJohn Polstra #define PRSTATUS_VERSION	1	/* Current version of prstatus_t */
568c64af4fSJohn Polstra 
578c64af4fSJohn Polstra typedef struct prstatus {
588c64af4fSJohn Polstra     int		pr_version;	/* Version number of struct (1) */
598c64af4fSJohn Polstra     size_t	pr_statussz;	/* sizeof(prstatus_t) (1) */
608c64af4fSJohn Polstra     size_t	pr_gregsetsz;	/* sizeof(gregset_t) (1) */
618c64af4fSJohn Polstra     size_t	pr_fpregsetsz;	/* sizeof(fpregset_t) (1) */
628c64af4fSJohn Polstra     int		pr_osreldate;	/* Kernel version (1) */
638c64af4fSJohn Polstra     int		pr_cursig;	/* Current signal (1) */
648c64af4fSJohn Polstra     pid_t	pr_pid;		/* Process ID (1) */
658c64af4fSJohn Polstra     gregset_t	pr_reg;		/* General purpose registers (1) */
668c64af4fSJohn Polstra } prstatus_t;
678c64af4fSJohn Polstra 
68cfdb160eSMarcel Moolenaar typedef gregset_t prgregset_t;
698c64af4fSJohn Polstra typedef fpregset_t prfpregset_t;
708c64af4fSJohn Polstra 
716eef6816SPeter Wemm #define PRFNAMESZ	16	/* Maximum command length saved */
728c64af4fSJohn Polstra #define PRARGSZ		80	/* Maximum argument bytes saved */
738c64af4fSJohn Polstra 
748c64af4fSJohn Polstra #define PRPSINFO_VERSION	1	/* Current version of prpsinfo_t */
758c64af4fSJohn Polstra 
768c64af4fSJohn Polstra typedef struct prpsinfo {
778c64af4fSJohn Polstra     int		pr_version;	/* Version number of struct (1) */
788c64af4fSJohn Polstra     size_t	pr_psinfosz;	/* sizeof(prpsinfo_t) (1) */
796eef6816SPeter Wemm     char	pr_fname[PRFNAMESZ+1];	/* Command name, null terminated (1) */
808c64af4fSJohn Polstra     char	pr_psargs[PRARGSZ+1];	/* Arguments, null terminated (1) */
818c64af4fSJohn Polstra } prpsinfo_t;
828c64af4fSJohn Polstra 
83cfdb160eSMarcel Moolenaar typedef void *psaddr_t;		/* An address in the target process. */
84cfdb160eSMarcel Moolenaar 
858c64af4fSJohn Polstra #endif /* _SYS_PROCFS_H_ */
86