reg.h revision 1.5 1 1.5 matt /* $NetBSD: reg.h,v 1.5 2012/02/06 02:14:13 matt Exp $ */
2 1.1 cgd
3 1.1 cgd /*
4 1.1 cgd * Copyright (c) 1994, 1995 Carnegie-Mellon University.
5 1.1 cgd * All rights reserved.
6 1.1 cgd *
7 1.1 cgd * Author: Chris G. Demetriou
8 1.5 matt *
9 1.1 cgd * Permission to use, copy, modify and distribute this software and
10 1.1 cgd * its documentation is hereby granted, provided that both the copyright
11 1.1 cgd * notice and this permission notice appear in all copies of the
12 1.1 cgd * software, derivative works or modified versions, and any portions
13 1.1 cgd * thereof, and that both notices appear in supporting documentation.
14 1.5 matt *
15 1.5 matt * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16 1.5 matt * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
17 1.1 cgd * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
18 1.5 matt *
19 1.1 cgd * Carnegie Mellon requests users of this software to return to
20 1.1 cgd *
21 1.1 cgd * Software Distribution Coordinator or Software.Distribution (at) CS.CMU.EDU
22 1.1 cgd * School of Computer Science
23 1.1 cgd * Carnegie Mellon University
24 1.1 cgd * Pittsburgh PA 15213-3890
25 1.1 cgd *
26 1.1 cgd * any improvements or extensions that they make and grant Carnegie the
27 1.1 cgd * rights to redistribute these changes.
28 1.1 cgd */
29 1.1 cgd
30 1.1 cgd #ifndef _ALPHA_REG_H_
31 1.1 cgd #define _ALPHA_REG_H_
32 1.1 cgd
33 1.1 cgd /*
34 1.1 cgd * XXX where did this info come from?
35 1.1 cgd */
36 1.1 cgd
37 1.1 cgd /*
38 1.1 cgd * Struct reg, used for procfs and in signal contexts
39 1.1 cgd * Note that in signal contexts, it's represented as an array.
40 1.1 cgd * That array has to look exactly like 'struct reg' though.
41 1.1 cgd */
42 1.1 cgd #define R_V0 0
43 1.1 cgd #define R_T0 1
44 1.1 cgd #define R_T1 2
45 1.1 cgd #define R_T2 3
46 1.1 cgd #define R_T3 4
47 1.1 cgd #define R_T4 5
48 1.1 cgd #define R_T5 6
49 1.1 cgd #define R_T6 7
50 1.1 cgd #define R_T7 8
51 1.1 cgd #define R_S0 9
52 1.1 cgd #define R_S1 10
53 1.1 cgd #define R_S2 11
54 1.1 cgd #define R_S3 12
55 1.1 cgd #define R_S4 13
56 1.1 cgd #define R_S5 14
57 1.1 cgd #define R_S6 15
58 1.1 cgd #define R_A0 16
59 1.1 cgd #define R_A1 17
60 1.1 cgd #define R_A2 18
61 1.1 cgd #define R_A3 19
62 1.1 cgd #define R_A4 20
63 1.1 cgd #define R_A5 21
64 1.1 cgd #define R_T8 22
65 1.1 cgd #define R_T9 23
66 1.1 cgd #define R_T10 24
67 1.1 cgd #define R_T11 25
68 1.1 cgd #define R_RA 26
69 1.1 cgd #define R_T12 27
70 1.1 cgd #define R_AT 28
71 1.1 cgd #define R_GP 29
72 1.1 cgd #define R_SP 30
73 1.1 cgd #define R_ZERO 31
74 1.1 cgd
75 1.1 cgd struct reg {
76 1.5 matt uint64_t r_regs[32];
77 1.1 cgd };
78 1.1 cgd
79 1.1 cgd /*
80 1.1 cgd * Floating point unit state. (also, register set used for ptrace.)
81 1.1 cgd *
82 1.1 cgd * The floating point registers for a process, saved only when
83 1.1 cgd * necessary.
84 1.1 cgd *
85 1.1 cgd * Note that in signal contexts, it's represented as an array.
86 1.1 cgd * That array has to look exactly like 'struct reg' though.
87 1.1 cgd */
88 1.1 cgd struct fpreg {
89 1.5 matt uint64_t fpr_regs[32];
90 1.5 matt uint64_t fpr_cr;
91 1.1 cgd };
92 1.1 cgd
93 1.2 jtc #ifdef _KERNEL
94 1.4 thorpej void restorefpstate(struct fpreg *);
95 1.4 thorpej void savefpstate(struct fpreg *);
96 1.1 cgd #endif
97 1.1 cgd
98 1.1 cgd #endif /* _ALPHA_REG_H_ */
99