xref: /illumos-gate/usr/src/uts/common/sys/core.h (revision bc0e9132)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
24  *
25  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
26  * Use is subject to license terms.
27  */
28 
29 #ifndef	_SYS_CORE_H
30 #define	_SYS_CORE_H
31 
32 #ifndef _KERNEL
33 #include <sys/reg.h>
34 #endif /* _KERNEL */
35 
36 #include <sys/exechdr.h>
37 #include <sys/pcb.h>
38 #include <sys/user.h>
39 
40 #ifdef	__cplusplus
41 extern "C" {
42 #endif
43 
44 #define	CORE_MAGIC	0x080456
45 #define	CORE_NAMELEN	16
46 
47 #if !defined(_LP64) && !defined(_KERNEL)
48 /*
49  * This structure describes the header of the old 32-bit SunOS 4.x aout exec
50  * module's core files.  Following the header, copies of the data and stack
51  * segments and a copy of the user struct were recorded in the core file.
52  * These core files have not been produced since SunOS 5.5; new debuggers
53  * should not make use of this structure.  The structure is not suitable for
54  * 64-bit consumers and will be removed altogether in a future Solaris release.
55  */
56 struct core {
57 	int	c_magic;		/* Corefile magic number */
58 	int	c_len;			/* Sizeof (struct core) */
59 	struct	regs c_regs;		/* General purpose registers */
60 	struct 	exdata c_exdata;	/* Executable header */
61 	int	c_signo;		/* Killing signal, if any */
62 	int	c_tsize;		/* Text size (bytes) */
63 	int	c_dsize;		/* Data size (bytes) */
64 	int	c_ssize;		/* Stack size (bytes) */
65 	char	c_cmdname[CORE_NAMELEN + 1]; /* Command name */
66 	struct	_fpu	c_fpu;		/* external FPU state */
67 #if defined(__sparc)
68 	struct	_fq c_fpu_q[_MAXFPQ];	/* fpu exception queue */
69 #endif
70 	int	c_ucode;		/* Exception no. from u_code */
71 };
72 #endif	/* !_LP64 && !_KERNEL */
73 
74 #ifdef	_KERNEL
75 
76 extern int core(int, int);
77 
78 #endif	/* _KERNEL */
79 
80 #ifdef	__cplusplus
81 }
82 #endif
83 
84 #endif /* _SYS_CORE_H */
85