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