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 54503Ssudheer * Common Development and Distribution License (the "License"). 64503Ssudheer * 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 */ 21*10230SRoger.Faulkner@Sun.COM 220Sstevel@tonic-gate /* 23*10230SRoger.Faulkner@Sun.COM * Copyright 2009 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_PCB_H 280Sstevel@tonic-gate #define _SYS_PCB_H 290Sstevel@tonic-gate 300Sstevel@tonic-gate #include <sys/regset.h> 310Sstevel@tonic-gate #include <sys/segments.h> 320Sstevel@tonic-gate 330Sstevel@tonic-gate #ifdef __cplusplus 340Sstevel@tonic-gate extern "C" { 350Sstevel@tonic-gate #endif 360Sstevel@tonic-gate 370Sstevel@tonic-gate #ifndef _ASM 380Sstevel@tonic-gate typedef struct fpu_ctx { 390Sstevel@tonic-gate kfpu_t fpu_regs; /* kernel save area for FPU */ 400Sstevel@tonic-gate uint_t fpu_flags; /* FPU state flags */ 410Sstevel@tonic-gate } fpu_ctx_t; 420Sstevel@tonic-gate 430Sstevel@tonic-gate typedef struct pcb { 440Sstevel@tonic-gate fpu_ctx_t pcb_fpu; /* fpu state */ 450Sstevel@tonic-gate uint_t pcb_flags; /* state flags; cleared on fork */ 460Sstevel@tonic-gate greg_t pcb_drstat; /* status debug register (%dr6) */ 470Sstevel@tonic-gate unsigned char pcb_instr; /* /proc: instruction at stop */ 480Sstevel@tonic-gate #if defined(__amd64) 494503Ssudheer unsigned char pcb_rupdate; /* new register values in pcb -> regs */ 500Sstevel@tonic-gate uintptr_t pcb_fsbase; 510Sstevel@tonic-gate uintptr_t pcb_gsbase; 520Sstevel@tonic-gate selector_t pcb_ds; 530Sstevel@tonic-gate selector_t pcb_es; 540Sstevel@tonic-gate selector_t pcb_fs; 550Sstevel@tonic-gate selector_t pcb_gs; 560Sstevel@tonic-gate #endif /* __amd64 */ 570Sstevel@tonic-gate user_desc_t pcb_fsdesc; /* private per-lwp %fs descriptors */ 580Sstevel@tonic-gate user_desc_t pcb_gsdesc; /* private per-lwp %gs descriptors */ 590Sstevel@tonic-gate } pcb_t; 600Sstevel@tonic-gate 610Sstevel@tonic-gate #endif /* ! _ASM */ 620Sstevel@tonic-gate 630Sstevel@tonic-gate /* pcb_flags */ 640Sstevel@tonic-gate #define DEBUG_PENDING 0x02 /* single-step of lcall for a sys call */ 65*10230SRoger.Faulkner@Sun.COM #define PRSTOP_CALLED 0x04 /* prstop() has been called for this lwp */ 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 */ 725254Sgavinm #define ASYNC_HWERR 0x400 /* hardware error has corrupted context */ 730Sstevel@tonic-gate 740Sstevel@tonic-gate /* fpu_flags */ 750Sstevel@tonic-gate #define FPU_EN 0x1 /* flag signifying fpu in use */ 760Sstevel@tonic-gate #define FPU_VALID 0x2 /* fpu_regs has valid fpu state */ 770Sstevel@tonic-gate #define FPU_MODIFIED 0x4 /* fpu_regs is modified (/proc) */ 780Sstevel@tonic-gate 790Sstevel@tonic-gate #define FPU_INVALID 0x0 /* fpu context is not in use */ 800Sstevel@tonic-gate 810Sstevel@tonic-gate /* fpu_flags */ 820Sstevel@tonic-gate 830Sstevel@tonic-gate #ifdef __cplusplus 840Sstevel@tonic-gate } 850Sstevel@tonic-gate #endif 860Sstevel@tonic-gate 870Sstevel@tonic-gate #endif /* _SYS_PCB_H */ 88