1100384Speter/*	$OpenBSD: pcb.h,v 1.3 1998/09/15 10:50:12 pefo Exp $	*/
2100384Speter
3100384Speter/*-
4100384Speter * Copyright (c) 1988 University of Utah.
5100384Speter * Copyright (c) 1992, 1993
6100384Speter *	The Regents of the University of California.  All rights reserved.
7100384Speter *
8100384Speter * This code is derived from software contributed to Berkeley by
9100384Speter * the Systems Programming Group of the University of Utah Computer
10100384Speter * Science Department and Ralph Campbell.
11100384Speter *
12100384Speter * Redistribution and use in source and binary forms, with or without
13100384Speter * modification, are permitted provided that the following conditions
14100384Speter * are met:
15100384Speter * 1. Redistributions of source code must retain the above copyright
16100384Speter *    notice, this list of conditions and the following disclaimer.
17100384Speter * 2. Redistributions in binary form must reproduce the above copyright
18100384Speter *    notice, this list of conditions and the following disclaimer in the
19100384Speter *    documentation and/or other materials provided with the distribution.
20100384Speter * 4. Neither the name of the University nor the names of its contributors
21100384Speter *    may be used to endorse or promote products derived from this software
22100384Speter *    without specific prior written permission.
23100384Speter *
24100384Speter * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25100384Speter * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26100384Speter * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27118031Sobrien * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28118031Sobrien * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29118031Sobrien * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30104738Speter * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31104738Speter * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32100384Speter * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33100384Speter * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34100384Speter * SUCH DAMAGE.
35162954Sphk *
36100384Speter *	from: Utah Hdr: pcb.h 1.13 89/04/23
37100384Speter *	from: @(#)pcb.h 8.1 (Berkeley) 6/10/93
38100384Speter *	JNPR: pcb.h,v 1.2 2006/08/07 11:51:17 katta
39123746Speter * $FreeBSD: releng/10.3/sys/mips/include/pcb.h 249882 2013-04-25 06:29:23Z imp $
40100384Speter */
41100384Speter
42161343Sjkim#ifndef _MACHINE_PCB_H_
43100384Speter#define	_MACHINE_PCB_H_
44100384Speter
45100384Speter/*
46151909Sps * used by switch.S
47100384Speter */
48100384Speter#define	PCB_REG_S0	0
49100384Speter#define	PCB_REG_S1	1
50100384Speter#define	PCB_REG_S2	2
51100384Speter#define	PCB_REG_S3	3
52100384Speter#define	PCB_REG_S4	4
53100384Speter#define	PCB_REG_S5	5
54100384Speter#define	PCB_REG_S6	6
55100384Speter#define	PCB_REG_S7	7
56146950Sps#define	PCB_REG_SP	8
57100384Speter#define	PCB_REG_S8	9
58100384Speter#define	PCB_REG_RA	10
59100384Speter#define	PCB_REG_SR	11
60100384Speter#define	PCB_REG_GP	12
61100384Speter#define	PCB_REG_PC	13
62100384Speter
63150883Sjhb#ifndef LOCORE
64113859Sjhb#include <machine/frame.h>
65100384Speter
66100384Speter/*
67100384Speter * MIPS process control block
68162551Sdavidxu */
69100384Speterstruct pcb
70162551Sdavidxu{
71100384Speter	struct trapframe pcb_regs;	/* saved CPU and registers */
72127140Sjhb	__register_t pcb_context[14];	/* kernel context for resume */
73157285Sps	void *pcb_onfault;		/* for copyin/copyout faults */
74157285Sps	register_t pcb_tpc;
75100384Speter};
76100384Speter
77100384Speter#ifdef _KERNEL
78100384Speterextern struct pcb *curpcb;		/* the current running pcb */
79100384Speter
80100384Spetervoid makectx(struct trapframe *, struct pcb *);
81100384Speterint savectx(struct pcb *) __returns_twice;
82100384Speter#endif
83100384Speter#endif
84151582Sps
85151582Sps#endif	/* !_MACHINE_PCB_H_ */
86119333Speter