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*1468Smarx * Copyright 2006 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 #pragma ident "%Z%%M% %I% %E% SMI" 310Sstevel@tonic-gate 320Sstevel@tonic-gate #include <sys/regset.h> 330Sstevel@tonic-gate #include <sys/segments.h> 340Sstevel@tonic-gate 350Sstevel@tonic-gate #ifdef __cplusplus 360Sstevel@tonic-gate extern "C" { 370Sstevel@tonic-gate #endif 380Sstevel@tonic-gate 390Sstevel@tonic-gate #ifndef _ASM 400Sstevel@tonic-gate typedef struct fpu_ctx { 410Sstevel@tonic-gate kfpu_t fpu_regs; /* kernel save area for FPU */ 420Sstevel@tonic-gate uint_t fpu_flags; /* FPU state flags */ 430Sstevel@tonic-gate } fpu_ctx_t; 440Sstevel@tonic-gate 450Sstevel@tonic-gate typedef struct pcb { 460Sstevel@tonic-gate fpu_ctx_t pcb_fpu; /* fpu state */ 470Sstevel@tonic-gate uint_t pcb_flags; /* state flags; cleared on fork */ 480Sstevel@tonic-gate greg_t pcb_drstat; /* status debug register (%dr6) */ 490Sstevel@tonic-gate unsigned char pcb_instr; /* /proc: instruction at stop */ 500Sstevel@tonic-gate #if defined(__amd64) 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 */ 700Sstevel@tonic-gate #define RUPDATE_PENDING 0x80 /* new register values in the pcb -> regs */ 71*1468Smarx #define REQUEST_STEP 0x100 /* request pending to single-step this lwp */ 72*1468Smarx #define REQUEST_NOSTEP 0x200 /* request pending to disable single-step */ 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