2 * Copyright (c) 2003,2004 Marcel Moolenaar
3 * Copyright (c) 2000 Doug Rabson
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 #ifndef _MACHINE_PCB_H_
31 #define _MACHINE_PCB_H_
33 #ifndef _MACHINE_REGSET_H_
34 #include <machine/_regset.h>
38 * PCB: process control block
42 struct _special pcb_special;
43 struct _callee_saved pcb_preserved;
44 struct _callee_saved_fp pcb_preserved_fp;
45 struct _high_fp pcb_high_fp;
46 struct pcpu *pcb_fpcpu;
47 struct pmap *pcb_current_pmap;
49 uint64_t pcb_onfault; /* for copy faults */
51 /* IA32 specific registers. */
52 uint64_t pcb_ia32_cflg;
53 uint64_t pcb_ia32_eflag;
54 uint64_t pcb_ia32_fcr;
55 uint64_t pcb_ia32_fdr;
56 uint64_t pcb_ia32_fir;
57 uint64_t pcb_ia32_fsr;
62 #define savectx(p) swapctx(p, NULL)
66 void makectx(struct trapframe *, struct pcb *);
67 void restorectx(struct pcb *) __dead2;
68 int swapctx(struct pcb *old, struct pcb *new) __returns_twice;
70 void ia32_restorectx(struct pcb *);
71 void ia32_savectx(struct pcb *) __returns_twice;
75 #endif /* _MACHINE_PCB_H_ */