1 /* $OpenBSD: pcb.h,v 1.11 2015/05/05 02:13:46 guenther Exp $ */ 2 /* $NetBSD: pcb.h,v 1.5 1996/11/13 22:21:00 cgd Exp $ */ 3 4 /* 5 * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. 6 * All rights reserved. 7 * 8 * Author: Chris G. Demetriou 9 * 10 * Permission to use, copy, modify and distribute this software and 11 * its documentation is hereby granted, provided that both the copyright 12 * notice and this permission notice appear in all copies of the 13 * software, derivative works or modified versions, and any portions 14 * thereof, and that both notices appear in supporting documentation. 15 * 16 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 17 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 18 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 19 * 20 * Carnegie Mellon requests users of this software to return to 21 * 22 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 23 * School of Computer Science 24 * Carnegie Mellon University 25 * Pittsburgh PA 15213-3890 26 * 27 * any improvements or extensions that they make and grant Carnegie the 28 * rights to redistribute these changes. 29 */ 30 31 #ifndef _MACHINE_PCB_H_ 32 #define _MACHINE_PCB_H_ 33 34 #include <machine/frame.h> 35 #include <machine/reg.h> 36 37 #include <machine/alpha_cpu.h> 38 39 /* 40 * PCB: process control block 41 * 42 * In this case, the hardware structure that is the defining element 43 * for a process, and the additional state that must be saved by software 44 * on a context switch. Fields marked [HW] are mandated by hardware; fields 45 * marked [SW] are for the software. 46 * 47 * It's said in the VMS PALcode section of the AARM that the pcb address 48 * passed to the swpctx PALcode call has to be a physical address. Not 49 * knowing this (and trying a virtual) address proved this correct. 50 * So we cache the physical address of the pcb in the md_proc struct. 51 */ 52 struct pcb { 53 struct alpha_pcb pcb_hw; /* PALcode defined */ 54 unsigned long pcb_context[9]; /* s[0-6], ra, ps [SW] */ 55 struct fpreg pcb_fp; /* FP registers [SW] */ 56 unsigned long pcb_onfault; /* for copy faults [SW] */ 57 struct cpu_info *volatile pcb_fpcpu; /* CPU with our FP state[SW] */ 58 }; 59 60 #ifdef _KERNEL 61 void savectx(struct pcb *); 62 #endif 63 64 #endif /* _MACHINE_PCB_H_ */ 65