xref: /openbsd-src/sys/arch/powerpc/include/reg.h (revision cf6677a65b386628719094fda053786604840618)
1*cf6677a6Sguenther /*	$OpenBSD: reg.h,v 1.11 2014/09/08 01:47:06 guenther Exp $	*/
2e5e8d547Srahnds 
3e5e8d547Srahnds /*-
4e5e8d547Srahnds  * Copyright (c) 1990 The Regents of the University of California.
5e5e8d547Srahnds  * All rights reserved.
6e5e8d547Srahnds  *
7e5e8d547Srahnds  * This code is derived from software contributed to Berkeley by
8e5e8d547Srahnds  * William Jolitz.
9e5e8d547Srahnds  *
10e5e8d547Srahnds  * Redistribution and use in source and binary forms, with or without
11e5e8d547Srahnds  * modification, are permitted provided that the following conditions
12e5e8d547Srahnds  * are met:
13e5e8d547Srahnds  * 1. Redistributions of source code must retain the above copyright
14e5e8d547Srahnds  *    notice, this list of conditions and the following disclaimer.
15e5e8d547Srahnds  * 2. Redistributions in binary form must reproduce the above copyright
16e5e8d547Srahnds  *    notice, this list of conditions and the following disclaimer in the
17e5e8d547Srahnds  *    documentation and/or other materials provided with the distribution.
1829295d1cSmillert  * 3. Neither the name of the University nor the names of its contributors
19e5e8d547Srahnds  *    may be used to endorse or promote products derived from this software
20e5e8d547Srahnds  *    without specific prior written permission.
21e5e8d547Srahnds  *
22e5e8d547Srahnds  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23e5e8d547Srahnds  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24e5e8d547Srahnds  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25e5e8d547Srahnds  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26e5e8d547Srahnds  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27e5e8d547Srahnds  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28e5e8d547Srahnds  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29e5e8d547Srahnds  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30e5e8d547Srahnds  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31e5e8d547Srahnds  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32e5e8d547Srahnds  * SUCH DAMAGE.
33e5e8d547Srahnds  *
34e5e8d547Srahnds  *	@(#)reg.h	5.5 (Berkeley) 1/18/91
35e5e8d547Srahnds  */
36e5e8d547Srahnds 
37e5e8d547Srahnds #ifndef _POWERPC_REG_H_
38e5e8d547Srahnds #define _POWERPC_REG_H_
39e5e8d547Srahnds 
40b43c05a1Srahnds /*
41*cf6677a6Sguenther  * Struct reg, used for ptrace and in signal contexts
42b43c05a1Srahnds  * Note that in signal contexts, it's represented as an array.
43b43c05a1Srahnds  * That array has to look exactly like 'struct reg' though.
44b43c05a1Srahnds  */
45b43c05a1Srahnds 
46b43c05a1Srahnds struct reg {
47b43c05a1Srahnds 	u_int32_t gpr[32];
48b43c05a1Srahnds 	u_int64_t fpr[32];
49b43c05a1Srahnds 	u_int32_t pc;
50b43c05a1Srahnds 	u_int32_t ps;
51b43c05a1Srahnds 	u_int32_t cnd;
52b43c05a1Srahnds 	u_int32_t lr;
53b43c05a1Srahnds 	u_int32_t cnt;
54b43c05a1Srahnds 	u_int32_t xer;
55b43c05a1Srahnds 	u_int32_t mq;
56b43c05a1Srahnds };
570dcf4312Sdrahn 
586a357d79Skettenis struct fpreg {
596a357d79Skettenis 	u_int64_t fpr[32];
606a357d79Skettenis 	u_int32_t fpscr;
616a357d79Skettenis };
626a357d79Skettenis 
630dcf4312Sdrahn struct vreg {
640dcf4312Sdrahn         u_int32_t vreg[32][4];
65dd09e474Sdrahn 	u_int64_t vscr;
660dcf4312Sdrahn 	u_int32_t vrsave;
67dd09e474Sdrahn 	u_int32_t pad;
680dcf4312Sdrahn };
690dcf4312Sdrahn 
707fdb82ccSdrahn #ifdef _KERNEL
710dcf4312Sdrahn void save_vec(struct proc *);
720dcf4312Sdrahn void enable_vec(struct proc *);
730dcf4312Sdrahn extern struct proc *ppc_vecproc;
740dcf4312Sdrahn extern struct pool ppc_vecpl;
757fdb82ccSdrahn #endif /* _KERNEL */
76e5e8d547Srahnds #endif /* !_POWERPC_REG_H_ */
77