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 5*4503Ssudheer * Common Development and Distribution License (the "License"). 6*4503Ssudheer * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* 22*4503Ssudheer * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 230Sstevel@tonic-gate * Use is subject to license terms. 240Sstevel@tonic-gate */ 250Sstevel@tonic-gate 260Sstevel@tonic-gate #ifndef _SYS_PCB_H 270Sstevel@tonic-gate #define _SYS_PCB_H 280Sstevel@tonic-gate 290Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 300Sstevel@tonic-gate 310Sstevel@tonic-gate #include <sys/regset.h> 320Sstevel@tonic-gate #include <sys/segments.h> 330Sstevel@tonic-gate 340Sstevel@tonic-gate #ifdef __cplusplus 350Sstevel@tonic-gate extern "C" { 360Sstevel@tonic-gate #endif 370Sstevel@tonic-gate 380Sstevel@tonic-gate #ifndef _ASM 390Sstevel@tonic-gate typedef struct fpu_ctx { 400Sstevel@tonic-gate kfpu_t fpu_regs; /* kernel save area for FPU */ 410Sstevel@tonic-gate uint_t fpu_flags; /* FPU state flags */ 420Sstevel@tonic-gate } fpu_ctx_t; 430Sstevel@tonic-gate 440Sstevel@tonic-gate typedef struct pcb { 450Sstevel@tonic-gate fpu_ctx_t pcb_fpu; /* fpu state */ 460Sstevel@tonic-gate uint_t pcb_flags; /* state flags; cleared on fork */ 470Sstevel@tonic-gate greg_t pcb_drstat; /* status debug register (%dr6) */ 480Sstevel@tonic-gate unsigned char pcb_instr; /* /proc: instruction at stop */ 490Sstevel@tonic-gate #if defined(__amd64) 50*4503Ssudheer unsigned char pcb_rupdate; /* new register values in pcb -> regs */ 510Sstevel@tonic-gate uintptr_t pcb_fsbase; 520Sstevel@tonic-gate uintptr_t pcb_gsbase; 530Sstevel@tonic-gate selector_t pcb_ds; 540Sstevel@tonic-gate selector_t pcb_es; 550Sstevel@tonic-gate selector_t pcb_fs; 560Sstevel@tonic-gate selector_t pcb_gs; 570Sstevel@tonic-gate #endif /* __amd64 */ 580Sstevel@tonic-gate user_desc_t pcb_fsdesc; /* private per-lwp %fs descriptors */ 590Sstevel@tonic-gate user_desc_t pcb_gsdesc; /* private per-lwp %gs descriptors */ 600Sstevel@tonic-gate } pcb_t; 610Sstevel@tonic-gate 620Sstevel@tonic-gate #endif /* ! _ASM */ 630Sstevel@tonic-gate 640Sstevel@tonic-gate /* pcb_flags */ 650Sstevel@tonic-gate #define DEBUG_PENDING 0x02 /* single-step of lcall for a sys call */ 660Sstevel@tonic-gate #define INSTR_VALID 0x08 /* value in pcb_instr is valid (/proc) */ 670Sstevel@tonic-gate #define NORMAL_STEP 0x10 /* normal debugger-requested single-step */ 680Sstevel@tonic-gate #define WATCH_STEP 0x20 /* single-stepping in watchpoint emulation */ 690Sstevel@tonic-gate #define CPC_OVERFLOW 0x40 /* performance counters overflowed */ 701468Smarx #define REQUEST_STEP 0x100 /* request pending to single-step this lwp */ 711468Smarx #define REQUEST_NOSTEP 0x200 /* request pending to disable single-step */ 720Sstevel@tonic-gate 730Sstevel@tonic-gate /* fpu_flags */ 740Sstevel@tonic-gate #define FPU_EN 0x1 /* flag signifying fpu in use */ 750Sstevel@tonic-gate #define FPU_VALID 0x2 /* fpu_regs has valid fpu state */ 760Sstevel@tonic-gate #define FPU_MODIFIED 0x4 /* fpu_regs is modified (/proc) */ 770Sstevel@tonic-gate 780Sstevel@tonic-gate #define FPU_INVALID 0x0 /* fpu context is not in use */ 790Sstevel@tonic-gate 800Sstevel@tonic-gate /* fpu_flags */ 810Sstevel@tonic-gate 820Sstevel@tonic-gate #ifdef __cplusplus 830Sstevel@tonic-gate } 840Sstevel@tonic-gate #endif 850Sstevel@tonic-gate 860Sstevel@tonic-gate #endif /* _SYS_PCB_H */ 87