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