139198Sjdp/*-
239198Sjdp * Copyright (c) 1998 John D. Polstra.
339198Sjdp * All rights reserved.
439198Sjdp *
539198Sjdp * Redistribution and use in source and binary forms, with or without
639198Sjdp * modification, are permitted provided that the following conditions
739198Sjdp * are met:
839198Sjdp * 1. Redistributions of source code must retain the above copyright
939198Sjdp *    notice, this list of conditions and the following disclaimer.
1039198Sjdp * 2. Redistributions in binary form must reproduce the above copyright
1139198Sjdp *    notice, this list of conditions and the following disclaimer in the
1239198Sjdp *    documentation and/or other materials provided with the distribution.
1339198Sjdp *
1439198Sjdp * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1539198Sjdp * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1639198Sjdp * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1739198Sjdp * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1839198Sjdp * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1939198Sjdp * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2039198Sjdp * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2139198Sjdp * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2239198Sjdp * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2339198Sjdp * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2439198Sjdp * SUCH DAMAGE.
2539198Sjdp *
2650477Speter * $FreeBSD$
2739198Sjdp */
2839198Sjdp
2939198Sjdp#ifndef _SYS_PROCFS_H_
3039198Sjdp#define _SYS_PROCFS_H_
3139198Sjdp
3239198Sjdp#include <sys/param.h>
3339198Sjdp#include <machine/reg.h>
3439198Sjdp
3539198Sjdptypedef struct reg gregset_t;
3639198Sjdptypedef struct fpreg fpregset_t;
3739198Sjdp
3839198Sjdp/*
3939198Sjdp * These structures define an interface between core files and the debugger.
4039198Sjdp * Never change or delete any elements.  If you add elements, add them to
4139198Sjdp * the end of the structure, and increment the value of its version field.
4239198Sjdp * This will help to ensure that today's core dump will still be usable
4339198Sjdp * with next year's debugger.
4439198Sjdp *
4539198Sjdp * A lot more things should be added to these structures.  At present,
4639198Sjdp * they contain the absolute bare minimum required to allow GDB to work
4739198Sjdp * with ELF core dumps.
4839198Sjdp */
4939198Sjdp
5039198Sjdp/*
5139198Sjdp * The parenthsized numbers like (1) indicate the minimum version number
5239198Sjdp * for which each element exists in the structure.
5339198Sjdp */
5439198Sjdp
5539198Sjdp#define PRSTATUS_VERSION	1	/* Current version of prstatus_t */
5639198Sjdp
5739198Sjdptypedef struct prstatus {
5839198Sjdp    int		pr_version;	/* Version number of struct (1) */
5939198Sjdp    size_t	pr_statussz;	/* sizeof(prstatus_t) (1) */
6039198Sjdp    size_t	pr_gregsetsz;	/* sizeof(gregset_t) (1) */
6139198Sjdp    size_t	pr_fpregsetsz;	/* sizeof(fpregset_t) (1) */
6239198Sjdp    int		pr_osreldate;	/* Kernel version (1) */
6339198Sjdp    int		pr_cursig;	/* Current signal (1) */
6439198Sjdp    pid_t	pr_pid;		/* Process ID (1) */
6539198Sjdp    gregset_t	pr_reg;		/* General purpose registers (1) */
6639198Sjdp} prstatus_t;
6739198Sjdp
68132175Sdavidxutypedef gregset_t prgregset_t[1];
6939198Sjdptypedef fpregset_t prfpregset_t;
7039198Sjdp
7181757Speter#define PRFNAMESZ	16	/* Maximum command length saved */
7239198Sjdp#define PRARGSZ		80	/* Maximum argument bytes saved */
7339198Sjdp
7439198Sjdp#define PRPSINFO_VERSION	1	/* Current version of prpsinfo_t */
7539198Sjdp
7639198Sjdptypedef struct prpsinfo {
7739198Sjdp    int		pr_version;	/* Version number of struct (1) */
7839198Sjdp    size_t	pr_psinfosz;	/* sizeof(prpsinfo_t) (1) */
7981757Speter    char	pr_fname[PRFNAMESZ+1];	/* Command name, null terminated (1) */
8039198Sjdp    char	pr_psargs[PRARGSZ+1];	/* Arguments, null terminated (1) */
8139198Sjdp} prpsinfo_t;
8239198Sjdp
83215679Sattilio#define THRMISC_VERSION		1	/* Current version of thrmisc_t */
84215679Sattilio
85215679Sattiliotypedef struct thrmisc {
86215679Sattilio    char	pr_tname[MAXCOMLEN+1];	/* Thread name, null terminated (1) */
87215679Sattilio    u_int	_pad;			/* Convenience pad, 0-filled (1) */
88215679Sattilio} thrmisc_t;
89215679Sattilio
90183023Smarceltypedef uint64_t psaddr_t;	/* An address in the target process. */
91131119Smarcel
9239198Sjdp#endif /* _SYS_PROCFS_H_ */
93