xref: /openbsd/sys/arch/m88k/include/pcb.h (revision fabcfecb)
1 /*	$OpenBSD: pcb.h,v 1.9 2024/10/22 21:50:02 jsg Exp $ */
2 /*
3  * Copyright (c) 1996 Nivas Madhur
4  * Mach Operating System
5  * Copyright (c) 1993-1992 Carnegie Mellon University
6  * All Rights Reserved.
7  *
8  * Permission to use, copy, modify and distribute this software and its
9  * documentation is hereby granted, provided that both the copyright
10  * notice and this permission notice appear in all copies of the
11  * software, derivative works or modified versions, and any portions
12  * thereof, and that both notices appear in supporting documentation.
13  *
14  * CARNEGIE MELLON AND OMRON ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS IS"
15  * CONDITION.  CARNEGIE MELLON AND OMRON DISCLAIM ANY LIABILITY OF ANY KIND
16  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
17  *
18  * Carnegie Mellon requests users of this software to return to
19  *
20  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
21  *  School of Computer Science
22  *  Carnegie Mellon University
23  *  Pittsburgh PA 15213-3890
24  *
25  * any improvements or extensions that they make and grant Carnegie Mellon
26  * the rights to redistribute these changes.
27  */
28 /*
29  * Motorola 88100 pcb definitions
30  *
31  */
32 /*
33  */
34 #ifndef _M88K_PCB_H_
35 #define _M88K_PCB_H_
36 
37 #include <machine/frame.h>
38 
39 /*
40  * Our PCB is the regular PCB+Save area for kernel frame.
41  * Upon entering kernel mode from userland, save the user context
42  * in the saved_state area - this is passed as the exception frame.
43  * On a context switch, only registers that need to be saved by the
44  * C calling convention and few other regs (pc, psr etc) are saved
45  * in the kernel_state part of the PCB. Typically, trap frames are
46  * saved on the stack (by low level handlers or by hardware) but,
47  * we just decided to do it in the PCB.
48  */
49 
50 struct m88100_pcb {
51 	unsigned long pcb_pc;	/* address to return */
52 	unsigned long :32;
53 	unsigned long pcb_r14;
54 	unsigned long pcb_r15;
55 	unsigned long pcb_r16;
56 	unsigned long pcb_r17;
57 	unsigned long pcb_r18;
58 	unsigned long pcb_r19;
59 	unsigned long pcb_r20;
60 	unsigned long pcb_r21;
61 	unsigned long pcb_r22;
62 	unsigned long pcb_r23;
63 	unsigned long pcb_r24;
64 	unsigned long pcb_r25;
65 	unsigned long pcb_r26;
66 	unsigned long pcb_r27;
67 	unsigned long pcb_r28;
68 	unsigned long pcb_r29;
69 	unsigned long pcb_r30;
70 	unsigned long pcb_sp; 	/* kernel stack pointer */
71 	/* floating-point state */
72 	unsigned long pcb_fcr62;
73 	unsigned long pcb_fcr63;
74 };
75 
76 struct pcb {
77 	struct m88100_pcb	kernel_state;
78 	struct trapframe	user_state;
79 	int			pcb_onfault;
80 };
81 
82 /*
83  *	Location of saved user registers for the proc.
84  */
85 #define	USER_REGS(p) \
86 	(((struct reg *)(&((p)->p_addr->u_pcb.user_state))))
87 
88 #endif /* _M88K_PCB_H_ */
89