No empty .Rs/.Re
[netbsd-mini2440.git] / sys / arch / alpha / include / pcb.h
blobf9531026d2bc0a6dedef2a58e3cef69f789a13dd
1 /* $NetBSD: pcb.h,v 1.17 2007/10/17 19:52:58 garbled Exp $ */
3 /*
4 * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
5 * All rights reserved.
7 * Author: Chris G. Demetriou
8 *
9 * Permission to use, copy, modify and distribute this software and
10 * its documentation is hereby granted, provided that both the copyright
11 * notice and this permission notice appear in all copies of the
12 * software, derivative works or modified versions, and any portions
13 * thereof, and that both notices appear in supporting documentation.
15 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
17 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
19 * Carnegie Mellon requests users of this software to return to
21 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
22 * School of Computer Science
23 * Carnegie Mellon University
24 * Pittsburgh PA 15213-3890
26 * any improvements or extensions that they make and grant Carnegie the
27 * rights to redistribute these changes.
30 #ifndef _ALPHA_PCB_H_
31 #define _ALPHA_PCB_H_
33 #ifdef _KERNEL_OPT
34 #include "opt_multiprocessor.h"
35 #endif
37 #include <sys/simplelock.h>
39 #include <machine/frame.h>
40 #include <machine/reg.h>
42 #include <machine/alpha_cpu.h>
45 * PCB: process control block
47 * In this case, the hardware structure that is the defining element
48 * for a process, and the additional state that must be saved by software
49 * on a context switch. Fields marked [HW] are mandated by hardware; fields
50 * marked [SW] are for the software.
52 * It's said in the VMS PALcode section of the AARM that the pcb address
53 * passed to the swpctx PALcode call has to be a physical address. Not
54 * knowing this (and trying a virtual) address proved this correct.
55 * So we cache the physical address of the pcb in the md_proc struct.
57 struct pcb {
58 struct alpha_pcb pcb_hw; /* PALcode defined */
59 unsigned long pcb_context[8]; /* s[0-6], ra [SW] */
60 struct fpreg pcb_fp; /* FP registers [SW] */
61 unsigned long pcb_onfault; /* for copy faults [SW] */
62 unsigned long pcb_accessaddr; /* for [fs]uswintr [SW] */
63 struct cpu_info * volatile pcb_fpcpu; /* CPU with our FP state[SW] */
64 struct simplelock pcb_fpcpu_slock; /* simple lock on fpcpu [SW] */
68 * MULTIPROCESSOR:
69 * Need to block IPIs while holding the fpcpu_slock. That is the
70 * responsibility of the CALLER!
72 #define FPCPU_LOCK(pcb) simple_lock(&(pcb)->pcb_fpcpu_slock)
73 #define FPCPU_UNLOCK(pcb) simple_unlock(&(pcb)->pcb_fpcpu_slock)
76 * The pcb is augmented with machine-dependent additional data for
77 * core dumps. For the Alpha, that's a trap frame and the floating
78 * point registers.
80 struct md_coredump {
81 struct trapframe md_tf;
82 struct fpreg md_fpstate;
84 #endif /* _ALPHA_PCB_H_ */