xref: /titanic_50/usr/src/uts/intel/sys/procfs_isa.h (revision bc0e91320069f0bcaee43e80a7ea686d9efa2d08)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate /*
23c2e7b48dSkalai  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef _SYS_PROCFS_ISA_H
287c478bd9Sstevel@tonic-gate #define	_SYS_PROCFS_ISA_H
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate /*
317c478bd9Sstevel@tonic-gate  * Instruction Set Architecture specific component of <sys/procfs.h>
327c478bd9Sstevel@tonic-gate  * i386 version
337c478bd9Sstevel@tonic-gate  */
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate #include <sys/regset.h>
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
387c478bd9Sstevel@tonic-gate extern "C" {
397c478bd9Sstevel@tonic-gate #endif
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate /*
427c478bd9Sstevel@tonic-gate  * Possible values of pr_dmodel.
437c478bd9Sstevel@tonic-gate  * This isn't isa-specific, but it needs to be defined here for other reasons.
447c478bd9Sstevel@tonic-gate  */
457c478bd9Sstevel@tonic-gate #define	PR_MODEL_UNKNOWN 0
467c478bd9Sstevel@tonic-gate #define	PR_MODEL_ILP32	1	/* process data model is ILP32 */
477c478bd9Sstevel@tonic-gate #define	PR_MODEL_LP64	2	/* process data model is LP64 */
487c478bd9Sstevel@tonic-gate 
497c478bd9Sstevel@tonic-gate /*
507c478bd9Sstevel@tonic-gate  * To determine whether application is running native.
517c478bd9Sstevel@tonic-gate  */
527c478bd9Sstevel@tonic-gate #if defined(_LP64)
537c478bd9Sstevel@tonic-gate #define	PR_MODEL_NATIVE	PR_MODEL_LP64
547c478bd9Sstevel@tonic-gate #elif defined(_ILP32)
557c478bd9Sstevel@tonic-gate #define	PR_MODEL_NATIVE	PR_MODEL_ILP32
567c478bd9Sstevel@tonic-gate #else
577c478bd9Sstevel@tonic-gate #error "No DATAMODEL_NATIVE specified"
587c478bd9Sstevel@tonic-gate #endif	/* _LP64 || _ILP32 */
597c478bd9Sstevel@tonic-gate 
607c478bd9Sstevel@tonic-gate #if defined(__i386) || defined(__amd64)
617c478bd9Sstevel@tonic-gate /*
627c478bd9Sstevel@tonic-gate  * Holds one i386 or amd64 instruction
637c478bd9Sstevel@tonic-gate  */
647c478bd9Sstevel@tonic-gate typedef	uchar_t instr_t;
657c478bd9Sstevel@tonic-gate #endif
667c478bd9Sstevel@tonic-gate 
677c478bd9Sstevel@tonic-gate #define	NPRGREG		_NGREG
687c478bd9Sstevel@tonic-gate #define	prgreg_t	greg_t
697c478bd9Sstevel@tonic-gate #define	prgregset_t	gregset_t
70*bc0e9132SGordon Ross #define	prfpregset	_fpu
717c478bd9Sstevel@tonic-gate #define	prfpregset_t	fpregset_t
727c478bd9Sstevel@tonic-gate 
737c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
747c478bd9Sstevel@tonic-gate /*
757c478bd9Sstevel@tonic-gate  * kernel view of the ia32 register set
767c478bd9Sstevel@tonic-gate  */
777c478bd9Sstevel@tonic-gate typedef	uchar_t		instr32_t;
78c2e7b48dSkalai #if defined(__amd64)
797c478bd9Sstevel@tonic-gate #define	NPRGREG32	_NGREG32
807c478bd9Sstevel@tonic-gate #define	prgreg32_t	greg32_t
817c478bd9Sstevel@tonic-gate #define	prgregset32_t	gregset32_t
827c478bd9Sstevel@tonic-gate #define	prfpregset32	fpu32
837c478bd9Sstevel@tonic-gate #define	prfpregset32_t	fpregset32_t
847c478bd9Sstevel@tonic-gate #else
857c478bd9Sstevel@tonic-gate #define	NPRGREG32	_NGREG
867c478bd9Sstevel@tonic-gate #define	prgreg32_t	greg_t
877c478bd9Sstevel@tonic-gate #define	prgregset32_t	gregset_t
88*bc0e9132SGordon Ross #define	prfpregset32	_fpu
897c478bd9Sstevel@tonic-gate #define	prfpregset32_t	fpregset_t
907c478bd9Sstevel@tonic-gate #endif
917c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
927c478bd9Sstevel@tonic-gate 
937c478bd9Sstevel@tonic-gate #if defined(__amd64)
947c478bd9Sstevel@tonic-gate /*
957c478bd9Sstevel@tonic-gate  * The following defines are for portability (see <sys/regset.h>).
967c478bd9Sstevel@tonic-gate  */
977c478bd9Sstevel@tonic-gate #define	R_PC	REG_RIP
987c478bd9Sstevel@tonic-gate #define	R_PS	REG_RFL
997c478bd9Sstevel@tonic-gate #define	R_SP	REG_RSP
1007c478bd9Sstevel@tonic-gate #define	R_FP	REG_RBP
1017c478bd9Sstevel@tonic-gate #define	R_R0	REG_RAX
1027c478bd9Sstevel@tonic-gate #define	R_R1	REG_RDX
1037c478bd9Sstevel@tonic-gate #elif defined(__i386)
1047c478bd9Sstevel@tonic-gate /*
1057c478bd9Sstevel@tonic-gate  * The following defines are for portability (see <sys/regset.h>).
1067c478bd9Sstevel@tonic-gate  */
1077c478bd9Sstevel@tonic-gate #define	R_PC	EIP
1087c478bd9Sstevel@tonic-gate #define	R_PS	EFL
1097c478bd9Sstevel@tonic-gate #define	R_SP	UESP
1107c478bd9Sstevel@tonic-gate #define	R_FP	EBP
1117c478bd9Sstevel@tonic-gate #define	R_R0	EAX
1127c478bd9Sstevel@tonic-gate #define	R_R1	EDX
1137c478bd9Sstevel@tonic-gate #endif
1147c478bd9Sstevel@tonic-gate 
1157c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1167c478bd9Sstevel@tonic-gate }
1177c478bd9Sstevel@tonic-gate #endif
1187c478bd9Sstevel@tonic-gate 
1197c478bd9Sstevel@tonic-gate #endif	/* _SYS_PROCFS_ISA_H */
120