pcb.h revision 122278
14Srgrimes/*- 24Srgrimes * Copyright (c) 1990 The Regents of the University of California. 34Srgrimes * All rights reserved. 44Srgrimes * 54Srgrimes * This code is derived from software contributed to Berkeley by 64Srgrimes * William Jolitz. 74Srgrimes * 84Srgrimes * Redistribution and use in source and binary forms, with or without 94Srgrimes * modification, are permitted provided that the following conditions 104Srgrimes * are met: 114Srgrimes * 1. Redistributions of source code must retain the above copyright 124Srgrimes * notice, this list of conditions and the following disclaimer. 134Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 144Srgrimes * notice, this list of conditions and the following disclaimer in the 154Srgrimes * documentation and/or other materials provided with the distribution. 164Srgrimes * 3. All advertising materials mentioning features or use of this software 174Srgrimes * must display the following acknowledgement: 184Srgrimes * This product includes software developed by the University of 194Srgrimes * California, Berkeley and its contributors. 204Srgrimes * 4. Neither the name of the University nor the names of its contributors 214Srgrimes * may be used to endorse or promote products derived from this software 224Srgrimes * without specific prior written permission. 234Srgrimes * 244Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 254Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 264Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 274Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 284Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 294Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 304Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 314Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 324Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 334Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 344Srgrimes * SUCH DAMAGE. 354Srgrimes * 36557Srgrimes * from: @(#)pcb.h 5.10 (Berkeley) 5/12/91 3750477Speter * $FreeBSD: head/sys/amd64/include/pcb.h 122278 2003-11-08 02:39:46Z peter $ 384Srgrimes */ 394Srgrimes 40557Srgrimes#ifndef _I386_PCB_H_ 41557Srgrimes#define _I386_PCB_H_ 42557Srgrimes 434Srgrimes/* 44122278Speter * AMD64 process control block 454Srgrimes */ 46122278Speter#include <machine/fpu.h> 474Srgrimes 484Srgrimesstruct pcb { 49114349Speter register_t padxx[8]; 50114349Speter register_t pcb_cr3; 51114349Speter register_t pcb_r15; 52114349Speter register_t pcb_r14; 53114349Speter register_t pcb_r13; 54114349Speter register_t pcb_r12; 55114349Speter register_t pcb_rbp; 56114349Speter register_t pcb_rsp; 57114349Speter register_t pcb_rbx; 58114349Speter register_t pcb_rip; 59114349Speter register_t pcb_rflags; 60114928Speter register_t pcb_fsbase; 61114928Speter register_t pcb_gsbase; 62114987Speter u_int32_t pcb_ds; 63114987Speter u_int32_t pcb_es; 64114987Speter u_int32_t pcb_fs; 65114987Speter u_int32_t pcb_gs; 6648691Sjlemon 67114349Speter struct savefpu pcb_save; 68114349Speter u_long pcb_flags; 69122278Speter#define PCB_NPXINITDONE 0x01 /* fpu state is initialized */ 70122278Speter#define PCB_FULLCTX 0x02 /* full context restore on sysret */ 7148691Sjlemon 724Srgrimes caddr_t pcb_onfault; /* copyin/out fault recovery */ 734Srgrimes}; 744Srgrimes 7555205Speter#ifdef _KERNEL 7692761Salfredvoid savectx(struct pcb *); 774Srgrimes#endif 78557Srgrimes 79557Srgrimes#endif /* _I386_PCB_H_ */ 80