1/*	$OpenBSD: reg.h,v 1.2 2007/03/02 06:11:54 miod Exp $	*/
2/*	$NetBSD: reg.h,v 1.5 2005/12/11 12:18:58 christos Exp $	*/
3
4/*-
5 * Copyright (c) 1990 The Regents of the University of California.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by
9 * William Jolitz.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 *    notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 *    notice, this list of conditions and the following disclaimer in the
18 *    documentation and/or other materials provided with the distribution.
19 * 3. Neither the name of the University nor the names of its contributors
20 *    may be used to endorse or promote products derived from this software
21 *    without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 *	@(#)reg.h	5.5 (Berkeley) 1/18/91
36 */
37
38#ifndef _SH_REG_H_
39#define	_SH_REG_H_
40
41/*
42 * Location of the users' stored
43 * registers within appropriate frame of 'trap' and 'syscall', relative to
44 * base of stack frame.
45 *
46 * XXX
47 * The #defines aren't used in the kernel, but some user-level code still
48 * expects them.
49 */
50
51/* When referenced during a trap/exception, registers are at these offsets */
52
53#define	tSPC	(0)
54#define	tSSR	(1)
55#define	tPR	(2)
56#define	tR14	(3)
57#define	tR13	(4)
58#define	tR12	(5)
59#define	tR11	(6)
60#define	tR10	(7)
61#define	tR9	(8)
62
63#define	tR8	(11)
64#define	tR7	(12)
65#define	tR6	(13)
66#define	tR5	(14)
67#define	tR4	(15)
68#define	tR3	(16)
69#define	tR2	(17)
70#define	tR1	(18)
71#define	tR0	(19)
72
73/*
74 * Registers accessible to ptrace(2) syscall for debugger
75 * The machine-dependent code for PT_{SET,GET}REGS needs to
76 * use whichever order, defined above, is correct, so that it
77 * is all invisible to the user.
78 */
79struct reg {
80	int r_spc;
81	int r_ssr;
82	int r_pr;
83	int r_mach;
84	int r_macl;
85	int r_r15;
86	int r_r14;
87	int r_r13;
88	int r_r12;
89	int r_r11;
90	int r_r10;
91	int r_r9;
92	int r_r8;
93	int r_r7;
94	int r_r6;
95	int r_r5;
96	int r_r4;
97	int r_r3;
98	int r_r2;
99	int r_r1;
100	int r_r0;
101};
102
103struct fpreg {
104	int	fpr_fr0;
105	int	fpr_fr1;
106	int	fpr_fr2;
107	int	fpr_fr3;
108	int	fpr_fr4;
109	int	fpr_fr5;
110	int	fpr_fr6;
111	int	fpr_fr7;
112	int	fpr_fr8;
113	int	fpr_fr9;
114	int	fpr_fr10;
115	int	fpr_fr11;
116	int	fpr_fr12;
117	int	fpr_fr13;
118	int	fpr_fr14;
119	int	fpr_fr15;
120	int	fpr_xf0;
121	int	fpr_xf1;
122	int	fpr_xf2;
123	int	fpr_xf3;
124	int	fpr_xf4;
125	int	fpr_xf5;
126	int	fpr_xf6;
127	int	fpr_xf7;
128	int	fpr_xf8;
129	int	fpr_xf9;
130	int	fpr_xf10;
131	int	fpr_xf11;
132	int	fpr_xf12;
133	int	fpr_xf13;
134	int	fpr_xf14;
135	int	fpr_xf15;
136	int	fpr_fpul;
137	int	fpr_fpscr;
138};
139
140#endif /* !_SH_REG_H_ */
141