xref: /onnv-gate/usr/src/uts/intel/sys/procfs_isa.h (revision 641:057d58d31499)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
50Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
60Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
70Sstevel@tonic-gate  * with the License.
80Sstevel@tonic-gate  *
90Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
100Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
110Sstevel@tonic-gate  * See the License for the specific language governing permissions
120Sstevel@tonic-gate  * and limitations under the License.
130Sstevel@tonic-gate  *
140Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate  *
200Sstevel@tonic-gate  * CDDL HEADER END
210Sstevel@tonic-gate  */
220Sstevel@tonic-gate /*
23*641Skalai  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate #ifndef _SYS_PROCFS_ISA_H
280Sstevel@tonic-gate #define	_SYS_PROCFS_ISA_H
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
310Sstevel@tonic-gate 
320Sstevel@tonic-gate /*
330Sstevel@tonic-gate  * Instruction Set Architecture specific component of <sys/procfs.h>
340Sstevel@tonic-gate  * i386 version
350Sstevel@tonic-gate  */
360Sstevel@tonic-gate 
370Sstevel@tonic-gate #include <sys/regset.h>
380Sstevel@tonic-gate 
390Sstevel@tonic-gate #ifdef	__cplusplus
400Sstevel@tonic-gate extern "C" {
410Sstevel@tonic-gate #endif
420Sstevel@tonic-gate 
430Sstevel@tonic-gate /*
440Sstevel@tonic-gate  * Possible values of pr_dmodel.
450Sstevel@tonic-gate  * This isn't isa-specific, but it needs to be defined here for other reasons.
460Sstevel@tonic-gate  */
470Sstevel@tonic-gate #define	PR_MODEL_UNKNOWN 0
480Sstevel@tonic-gate #define	PR_MODEL_ILP32	1	/* process data model is ILP32 */
490Sstevel@tonic-gate #define	PR_MODEL_LP64	2	/* process data model is LP64 */
500Sstevel@tonic-gate 
510Sstevel@tonic-gate /*
520Sstevel@tonic-gate  * To determine whether application is running native.
530Sstevel@tonic-gate  */
540Sstevel@tonic-gate #if defined(_LP64)
550Sstevel@tonic-gate #define	PR_MODEL_NATIVE	PR_MODEL_LP64
560Sstevel@tonic-gate #elif defined(_ILP32)
570Sstevel@tonic-gate #define	PR_MODEL_NATIVE	PR_MODEL_ILP32
580Sstevel@tonic-gate #else
590Sstevel@tonic-gate #error "No DATAMODEL_NATIVE specified"
600Sstevel@tonic-gate #endif	/* _LP64 || _ILP32 */
610Sstevel@tonic-gate 
620Sstevel@tonic-gate #if defined(__i386) || defined(__amd64)
630Sstevel@tonic-gate /*
640Sstevel@tonic-gate  * Holds one i386 or amd64 instruction
650Sstevel@tonic-gate  */
660Sstevel@tonic-gate typedef	uchar_t instr_t;
670Sstevel@tonic-gate #endif
680Sstevel@tonic-gate 
690Sstevel@tonic-gate #define	NPRGREG		_NGREG
700Sstevel@tonic-gate #define	prgreg_t	greg_t
710Sstevel@tonic-gate #define	prgregset_t	gregset_t
720Sstevel@tonic-gate #define	prfpregset	fpu
730Sstevel@tonic-gate #define	prfpregset_t	fpregset_t
740Sstevel@tonic-gate 
750Sstevel@tonic-gate #if defined(_SYSCALL32)
760Sstevel@tonic-gate /*
770Sstevel@tonic-gate  * kernel view of the ia32 register set
780Sstevel@tonic-gate  */
790Sstevel@tonic-gate typedef	uchar_t		instr32_t;
80*641Skalai #if defined(__amd64)
810Sstevel@tonic-gate #define	NPRGREG32	_NGREG32
820Sstevel@tonic-gate #define	prgreg32_t	greg32_t
830Sstevel@tonic-gate #define	prgregset32_t	gregset32_t
840Sstevel@tonic-gate #define	prfpregset32	fpu32
850Sstevel@tonic-gate #define	prfpregset32_t	fpregset32_t
860Sstevel@tonic-gate #else
870Sstevel@tonic-gate #define	NPRGREG32	_NGREG
880Sstevel@tonic-gate #define	prgreg32_t	greg_t
890Sstevel@tonic-gate #define	prgregset32_t	gregset_t
900Sstevel@tonic-gate #define	prfpregset32	fpu
910Sstevel@tonic-gate #define	prfpregset32_t	fpregset_t
920Sstevel@tonic-gate #endif
930Sstevel@tonic-gate #endif	/* _SYSCALL32 */
940Sstevel@tonic-gate 
950Sstevel@tonic-gate #if defined(__amd64)
960Sstevel@tonic-gate /*
970Sstevel@tonic-gate  * The following defines are for portability (see <sys/regset.h>).
980Sstevel@tonic-gate  */
990Sstevel@tonic-gate #define	R_PC	REG_RIP
1000Sstevel@tonic-gate #define	R_PS	REG_RFL
1010Sstevel@tonic-gate #define	R_SP	REG_RSP
1020Sstevel@tonic-gate #define	R_FP	REG_RBP
1030Sstevel@tonic-gate #define	R_R0	REG_RAX
1040Sstevel@tonic-gate #define	R_R1	REG_RDX
1050Sstevel@tonic-gate #elif defined(__i386)
1060Sstevel@tonic-gate /*
1070Sstevel@tonic-gate  * The following defines are for portability (see <sys/regset.h>).
1080Sstevel@tonic-gate  */
1090Sstevel@tonic-gate #define	R_PC	EIP
1100Sstevel@tonic-gate #define	R_PS	EFL
1110Sstevel@tonic-gate #define	R_SP	UESP
1120Sstevel@tonic-gate #define	R_FP	EBP
1130Sstevel@tonic-gate #define	R_R0	EAX
1140Sstevel@tonic-gate #define	R_R1	EDX
1150Sstevel@tonic-gate #endif
1160Sstevel@tonic-gate 
1170Sstevel@tonic-gate #ifdef	__cplusplus
1180Sstevel@tonic-gate }
1190Sstevel@tonic-gate #endif
1200Sstevel@tonic-gate 
1210Sstevel@tonic-gate #endif	/* _SYS_PROCFS_ISA_H */
122