xref: /openbsd-src/sys/arch/m88k/include/pcb.h (revision fabcfecb28af5579f8c0c1cb806278199e88da42)
1*fabcfecbSjsg /*	$OpenBSD: pcb.h,v 1.9 2024/10/22 21:50:02 jsg Exp $ */
23180e169Smiod /*
33180e169Smiod  * Copyright (c) 1996 Nivas Madhur
43180e169Smiod  * Mach Operating System
53180e169Smiod  * Copyright (c) 1993-1992 Carnegie Mellon University
63180e169Smiod  * All Rights Reserved.
73180e169Smiod  *
83180e169Smiod  * Permission to use, copy, modify and distribute this software and its
93180e169Smiod  * documentation is hereby granted, provided that both the copyright
103180e169Smiod  * notice and this permission notice appear in all copies of the
113180e169Smiod  * software, derivative works or modified versions, and any portions
123180e169Smiod  * thereof, and that both notices appear in supporting documentation.
133180e169Smiod  *
143180e169Smiod  * CARNEGIE MELLON AND OMRON ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS IS"
153180e169Smiod  * CONDITION.  CARNEGIE MELLON AND OMRON DISCLAIM ANY LIABILITY OF ANY KIND
163180e169Smiod  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
173180e169Smiod  *
183180e169Smiod  * Carnegie Mellon requests users of this software to return to
193180e169Smiod  *
203180e169Smiod  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
213180e169Smiod  *  School of Computer Science
223180e169Smiod  *  Carnegie Mellon University
233180e169Smiod  *  Pittsburgh PA 15213-3890
243180e169Smiod  *
253180e169Smiod  * any improvements or extensions that they make and grant Carnegie Mellon
263180e169Smiod  * the rights to redistribute these changes.
273180e169Smiod  */
283180e169Smiod /*
293180e169Smiod  * Motorola 88100 pcb definitions
303180e169Smiod  *
313180e169Smiod  */
323180e169Smiod /*
333180e169Smiod  */
343180e169Smiod #ifndef _M88K_PCB_H_
353180e169Smiod #define _M88K_PCB_H_
363180e169Smiod 
37dc3bbfb1Smiod #include <machine/frame.h>
383180e169Smiod 
393180e169Smiod /*
403180e169Smiod  * Our PCB is the regular PCB+Save area for kernel frame.
413180e169Smiod  * Upon entering kernel mode from userland, save the user context
423180e169Smiod  * in the saved_state area - this is passed as the exception frame.
433180e169Smiod  * On a context switch, only registers that need to be saved by the
443180e169Smiod  * C calling convention and few other regs (pc, psr etc) are saved
453180e169Smiod  * in the kernel_state part of the PCB. Typically, trap frames are
463180e169Smiod  * saved on the stack (by low level handlers or by hardware) but,
473180e169Smiod  * we just decided to do it in the PCB.
483180e169Smiod  */
493180e169Smiod 
503180e169Smiod struct m88100_pcb {
51434a78baSmiod 	unsigned long pcb_pc;	/* address to return */
52434a78baSmiod 	unsigned long :32;
53434a78baSmiod 	unsigned long pcb_r14;
54434a78baSmiod 	unsigned long pcb_r15;
55434a78baSmiod 	unsigned long pcb_r16;
56434a78baSmiod 	unsigned long pcb_r17;
57434a78baSmiod 	unsigned long pcb_r18;
58434a78baSmiod 	unsigned long pcb_r19;
59434a78baSmiod 	unsigned long pcb_r20;
60434a78baSmiod 	unsigned long pcb_r21;
61434a78baSmiod 	unsigned long pcb_r22;
62434a78baSmiod 	unsigned long pcb_r23;
63434a78baSmiod 	unsigned long pcb_r24;
64434a78baSmiod 	unsigned long pcb_r25;
65434a78baSmiod 	unsigned long pcb_r26;
66434a78baSmiod 	unsigned long pcb_r27;
67434a78baSmiod 	unsigned long pcb_r28;
68434a78baSmiod 	unsigned long pcb_r29;
69434a78baSmiod 	unsigned long pcb_r30;
70434a78baSmiod 	unsigned long pcb_sp; 	/* kernel stack pointer */
713180e169Smiod 	/* floating-point state */
72434a78baSmiod 	unsigned long pcb_fcr62;
73434a78baSmiod 	unsigned long pcb_fcr63;
743180e169Smiod };
753180e169Smiod 
76*fabcfecbSjsg struct pcb {
773180e169Smiod 	struct m88100_pcb	kernel_state;
783180e169Smiod 	struct trapframe	user_state;
793180e169Smiod 	int			pcb_onfault;
803180e169Smiod };
813180e169Smiod 
823180e169Smiod /*
833180e169Smiod  *	Location of saved user registers for the proc.
843180e169Smiod  */
853180e169Smiod #define	USER_REGS(p) \
863180e169Smiod 	(((struct reg *)(&((p)->p_addr->u_pcb.user_state))))
87dc3bbfb1Smiod 
883180e169Smiod #endif /* _M88K_PCB_H_ */
89