pcb.h revision 178172
1178172Simp/* $OpenBSD: pcb.h,v 1.3 1998/09/15 10:50:12 pefo Exp $ */ 2178172Simp 3178172Simp/*- 4178172Simp * Copyright (c) 1988 University of Utah. 5178172Simp * Copyright (c) 1992, 1993 6178172Simp * The Regents of the University of California. All rights reserved. 7178172Simp * 8178172Simp * This code is derived from software contributed to Berkeley by 9178172Simp * the Systems Programming Group of the University of Utah Computer 10178172Simp * Science Department and Ralph Campbell. 11178172Simp * 12178172Simp * Redistribution and use in source and binary forms, with or without 13178172Simp * modification, are permitted provided that the following conditions 14178172Simp * are met: 15178172Simp * 1. Redistributions of source code must retain the above copyright 16178172Simp * notice, this list of conditions and the following disclaimer. 17178172Simp * 2. Redistributions in binary form must reproduce the above copyright 18178172Simp * notice, this list of conditions and the following disclaimer in the 19178172Simp * documentation and/or other materials provided with the distribution. 20178172Simp * 4. Neither the name of the University nor the names of its contributors 21178172Simp * may be used to endorse or promote products derived from this software 22178172Simp * without specific prior written permission. 23178172Simp * 24178172Simp * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25178172Simp * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26178172Simp * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27178172Simp * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28178172Simp * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29178172Simp * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30178172Simp * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31178172Simp * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32178172Simp * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33178172Simp * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34178172Simp * SUCH DAMAGE. 35178172Simp * 36178172Simp * from: Utah Hdr: pcb.h 1.13 89/04/23 37178172Simp * from: @(#)pcb.h 8.1 (Berkeley) 6/10/93 38178172Simp * JNPR: pcb.h,v 1.2 2006/08/07 11:51:17 katta 39178172Simp * $FreeBSD: head/sys/mips/include/pcb.h 178172 2008-04-13 07:27:37Z imp $ 40178172Simp */ 41178172Simp 42178172Simp#ifndef _MACHINE_PCB_H_ 43178172Simp#define _MACHINE_PCB_H_ 44178172Simp 45178172Simp#include <machine/frame.h> 46178172Simp 47178172Simp/* 48178172Simp * MIPS process control block 49178172Simp */ 50178172Simpstruct pcb 51178172Simp{ 52178172Simp struct trapframe pcb_regs; /* saved CPU and registers */ 53178172Simp label_t pcb_context; /* kernel context for resume */ 54178172Simp int pcb_onfault; /* for copyin/copyout faults */ 55178172Simp}; 56178172Simp 57178172Simp/* these match the regnum's in regnum.h 58178172Simp * used by switch.S 59178172Simp */ 60178172Simp#define PCB_REG_S0 0 61178172Simp#define PCB_REG_S1 1 62178172Simp#define PCB_REG_S2 2 63178172Simp#define PCB_REG_S3 3 64178172Simp#define PCB_REG_S4 4 65178172Simp#define PCB_REG_S5 5 66178172Simp#define PCB_REG_S6 6 67178172Simp#define PCB_REG_S7 7 68178172Simp#define PCB_REG_SP 8 69178172Simp#define PCB_REG_S8 9 70178172Simp#define PCB_REG_RA 10 71178172Simp#define PCB_REG_SR 11 72178172Simp#define PCB_REG_GP 12 73178172Simp 74178172Simp 75178172Simp#ifdef _KERNEL 76178172Simpextern struct pcb *curpcb; /* the current running pcb */ 77178172Simp 78178172Simpvoid makectx(struct trapframe *, struct pcb *); 79178172Simpint savectx(struct pcb *); 80178172Simp#endif 81178172Simp 82178172Simp#endif /* !_MACHINE_PCB_H_ */ 83