1*c9de630fSguenther /* $OpenBSD: pcb.h,v 1.17 2018/06/05 06:39:11 guenther Exp $ */ 2f5df1827Smickey /* $NetBSD: pcb.h,v 1.1 2003/04/26 18:39:45 fvdl Exp $ */ 3f5df1827Smickey 4f5df1827Smickey /*- 5f5df1827Smickey * Copyright (c) 1998 The NetBSD Foundation, Inc. 6f5df1827Smickey * All rights reserved. 7f5df1827Smickey * 8f5df1827Smickey * This code is derived from software contributed to The NetBSD Foundation 9f5df1827Smickey * by Charles M. Hannum. 10f5df1827Smickey * 11f5df1827Smickey * Redistribution and use in source and binary forms, with or without 12f5df1827Smickey * modification, are permitted provided that the following conditions 13f5df1827Smickey * are met: 14f5df1827Smickey * 1. Redistributions of source code must retain the above copyright 15f5df1827Smickey * notice, this list of conditions and the following disclaimer. 16f5df1827Smickey * 2. Redistributions in binary form must reproduce the above copyright 17f5df1827Smickey * notice, this list of conditions and the following disclaimer in the 18f5df1827Smickey * documentation and/or other materials provided with the distribution. 19f5df1827Smickey * 20f5df1827Smickey * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 21f5df1827Smickey * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 22f5df1827Smickey * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23f5df1827Smickey * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 24f5df1827Smickey * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25f5df1827Smickey * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26f5df1827Smickey * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27f5df1827Smickey * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28f5df1827Smickey * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29f5df1827Smickey * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30f5df1827Smickey * POSSIBILITY OF SUCH DAMAGE. 31f5df1827Smickey */ 32f5df1827Smickey 33f5df1827Smickey /*- 34f5df1827Smickey * Copyright (c) 1990 The Regents of the University of California. 35f5df1827Smickey * All rights reserved. 36f5df1827Smickey * 37f5df1827Smickey * This code is derived from software contributed to Berkeley by 38f5df1827Smickey * William Jolitz. 39f5df1827Smickey * 40f5df1827Smickey * Redistribution and use in source and binary forms, with or without 41f5df1827Smickey * modification, are permitted provided that the following conditions 42f5df1827Smickey * are met: 43f5df1827Smickey * 1. Redistributions of source code must retain the above copyright 44f5df1827Smickey * notice, this list of conditions and the following disclaimer. 45f5df1827Smickey * 2. Redistributions in binary form must reproduce the above copyright 46f5df1827Smickey * notice, this list of conditions and the following disclaimer in the 47f5df1827Smickey * documentation and/or other materials provided with the distribution. 48c5217b0aSjsg * 3. Neither the name of the University nor the names of its contributors 49f5df1827Smickey * may be used to endorse or promote products derived from this software 50f5df1827Smickey * without specific prior written permission. 51f5df1827Smickey * 52f5df1827Smickey * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 53f5df1827Smickey * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 54f5df1827Smickey * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 55f5df1827Smickey * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 56f5df1827Smickey * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 57f5df1827Smickey * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 58f5df1827Smickey * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 59f5df1827Smickey * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 60f5df1827Smickey * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 61f5df1827Smickey * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 62f5df1827Smickey * SUCH DAMAGE. 63f5df1827Smickey * 64f5df1827Smickey * @(#)pcb.h 5.10 (Berkeley) 5/12/91 65f5df1827Smickey */ 66f5df1827Smickey 672fa72412Spirofti #ifndef _MACHINE_PCB_H_ 682fa72412Spirofti #define _MACHINE_PCB_H_ 69f5df1827Smickey 70f5df1827Smickey #include <sys/signal.h> 71f5df1827Smickey 72f5df1827Smickey #include <machine/fpu.h> 73f5df1827Smickey 74f5df1827Smickey /* 75f5df1827Smickey * Please note that the pcb_savefpu field in struct below must be 76c36cf6a8Smlarkin * on a 64-byte boundary. 77f5df1827Smickey */ 78f5df1827Smickey struct pcb { 79fd94711fSguenther struct savefpu pcb_savefpu; /* floating point state */ 80f5df1827Smickey u_int64_t pcb_cr3; 81f5df1827Smickey u_int64_t pcb_rsp; 82f5df1827Smickey u_int64_t pcb_rbp; 83fd94711fSguenther u_int64_t pcb_kstack; /* kernel stack address */ 84f1665d79Sguenther u_int64_t pcb_fsbase; /* per-thread offset: %fs */ 85f5df1827Smickey caddr_t pcb_onfault; /* copyin/out fault recovery */ 86f5df1827Smickey struct pmap *pcb_pmap; /* back pointer to our pmap */ 87f5df1827Smickey }; 88f5df1827Smickey 89b13138f2Sguenther #ifdef _KERNEL 90daca63ceSguenther void reset_segs(void); 91b13138f2Sguenther #endif 92b13138f2Sguenther 932fa72412Spirofti #endif /* _MACHINE_PCB_H_ */ 94