1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * CDDL HEADER START
3*0Sstevel@tonic-gate  *
4*0Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*0Sstevel@tonic-gate  * with the License.
8*0Sstevel@tonic-gate  *
9*0Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*0Sstevel@tonic-gate  * and limitations under the License.
13*0Sstevel@tonic-gate  *
14*0Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate  *
20*0Sstevel@tonic-gate  * CDDL HEADER END
21*0Sstevel@tonic-gate  */
22*0Sstevel@tonic-gate /*
23*0Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24*0Sstevel@tonic-gate  * Use is subject to license terms.
25*0Sstevel@tonic-gate  */
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate #ifndef _SYS_PROCFS_ISA_H
28*0Sstevel@tonic-gate #define	_SYS_PROCFS_ISA_H
29*0Sstevel@tonic-gate 
30*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*0Sstevel@tonic-gate 
32*0Sstevel@tonic-gate /*
33*0Sstevel@tonic-gate  * Instruction Set Architecture specific component of <sys/procfs.h>
34*0Sstevel@tonic-gate  * i386 version
35*0Sstevel@tonic-gate  */
36*0Sstevel@tonic-gate 
37*0Sstevel@tonic-gate #include <sys/regset.h>
38*0Sstevel@tonic-gate 
39*0Sstevel@tonic-gate #ifdef	__cplusplus
40*0Sstevel@tonic-gate extern "C" {
41*0Sstevel@tonic-gate #endif
42*0Sstevel@tonic-gate 
43*0Sstevel@tonic-gate /*
44*0Sstevel@tonic-gate  * Possible values of pr_dmodel.
45*0Sstevel@tonic-gate  * This isn't isa-specific, but it needs to be defined here for other reasons.
46*0Sstevel@tonic-gate  */
47*0Sstevel@tonic-gate #define	PR_MODEL_UNKNOWN 0
48*0Sstevel@tonic-gate #define	PR_MODEL_ILP32	1	/* process data model is ILP32 */
49*0Sstevel@tonic-gate #define	PR_MODEL_LP64	2	/* process data model is LP64 */
50*0Sstevel@tonic-gate 
51*0Sstevel@tonic-gate /*
52*0Sstevel@tonic-gate  * To determine whether application is running native.
53*0Sstevel@tonic-gate  */
54*0Sstevel@tonic-gate #if defined(_LP64)
55*0Sstevel@tonic-gate #define	PR_MODEL_NATIVE	PR_MODEL_LP64
56*0Sstevel@tonic-gate #elif defined(_ILP32)
57*0Sstevel@tonic-gate #define	PR_MODEL_NATIVE	PR_MODEL_ILP32
58*0Sstevel@tonic-gate #else
59*0Sstevel@tonic-gate #error "No DATAMODEL_NATIVE specified"
60*0Sstevel@tonic-gate #endif	/* _LP64 || _ILP32 */
61*0Sstevel@tonic-gate 
62*0Sstevel@tonic-gate #if defined(__i386) || defined(__amd64)
63*0Sstevel@tonic-gate /*
64*0Sstevel@tonic-gate  * Holds one i386 or amd64 instruction
65*0Sstevel@tonic-gate  */
66*0Sstevel@tonic-gate typedef	uchar_t instr_t;
67*0Sstevel@tonic-gate #endif
68*0Sstevel@tonic-gate 
69*0Sstevel@tonic-gate #define	NPRGREG		_NGREG
70*0Sstevel@tonic-gate #define	prgreg_t	greg_t
71*0Sstevel@tonic-gate #define	prgregset_t	gregset_t
72*0Sstevel@tonic-gate #define	prfpregset	fpu
73*0Sstevel@tonic-gate #define	prfpregset_t	fpregset_t
74*0Sstevel@tonic-gate 
75*0Sstevel@tonic-gate #if defined(_SYSCALL32)
76*0Sstevel@tonic-gate /*
77*0Sstevel@tonic-gate  * kernel view of the ia32 register set
78*0Sstevel@tonic-gate  */
79*0Sstevel@tonic-gate typedef	uchar_t		instr32_t;
80*0Sstevel@tonic-gate #if defined(__ia64) || defined(__amd64)
81*0Sstevel@tonic-gate #define	NPRGREG32	_NGREG32
82*0Sstevel@tonic-gate #define	prgreg32_t	greg32_t
83*0Sstevel@tonic-gate #define	prgregset32_t	gregset32_t
84*0Sstevel@tonic-gate #define	prfpregset32	fpu32
85*0Sstevel@tonic-gate #define	prfpregset32_t	fpregset32_t
86*0Sstevel@tonic-gate #else
87*0Sstevel@tonic-gate #define	NPRGREG32	_NGREG
88*0Sstevel@tonic-gate #define	prgreg32_t	greg_t
89*0Sstevel@tonic-gate #define	prgregset32_t	gregset_t
90*0Sstevel@tonic-gate #define	prfpregset32	fpu
91*0Sstevel@tonic-gate #define	prfpregset32_t	fpregset_t
92*0Sstevel@tonic-gate #endif
93*0Sstevel@tonic-gate #endif	/* _SYSCALL32 */
94*0Sstevel@tonic-gate 
95*0Sstevel@tonic-gate #if defined(__amd64)
96*0Sstevel@tonic-gate /*
97*0Sstevel@tonic-gate  * The following defines are for portability (see <sys/regset.h>).
98*0Sstevel@tonic-gate  */
99*0Sstevel@tonic-gate #define	R_PC	REG_RIP
100*0Sstevel@tonic-gate #define	R_PS	REG_RFL
101*0Sstevel@tonic-gate #define	R_SP	REG_RSP
102*0Sstevel@tonic-gate #define	R_FP	REG_RBP
103*0Sstevel@tonic-gate #define	R_R0	REG_RAX
104*0Sstevel@tonic-gate #define	R_R1	REG_RDX
105*0Sstevel@tonic-gate #elif defined(__i386)
106*0Sstevel@tonic-gate /*
107*0Sstevel@tonic-gate  * The following defines are for portability (see <sys/regset.h>).
108*0Sstevel@tonic-gate  */
109*0Sstevel@tonic-gate #define	R_PC	EIP
110*0Sstevel@tonic-gate #define	R_PS	EFL
111*0Sstevel@tonic-gate #define	R_SP	UESP
112*0Sstevel@tonic-gate #define	R_FP	EBP
113*0Sstevel@tonic-gate #define	R_R0	EAX
114*0Sstevel@tonic-gate #define	R_R1	EDX
115*0Sstevel@tonic-gate #endif
116*0Sstevel@tonic-gate 
117*0Sstevel@tonic-gate #ifdef	__cplusplus
118*0Sstevel@tonic-gate }
119*0Sstevel@tonic-gate #endif
120*0Sstevel@tonic-gate 
121*0Sstevel@tonic-gate #endif	/* _SYS_PROCFS_ISA_H */
122