]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - sys/powerpc/include/reg.h
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / sys / powerpc / include / reg.h
1 /* $NetBSD: reg.h,v 1.4 2000/06/04 09:30:44 tsubai Exp $        */
2 /* $FreeBSD$    */
3
4 #ifndef _POWERPC_REG_H_
5 #define _POWERPC_REG_H_
6
7 #if defined(_KERNEL) && !defined(KLD_MODULE) && !defined(_STANDALONE)
8 #include "opt_compat.h"
9 #endif
10
11 /* Must match struct trapframe */
12 struct reg {
13         register_t fixreg[32];
14         register_t lr;
15         register_t cr;
16         register_t xer;
17         register_t ctr;
18         register_t pc;
19 };
20
21 /* Must match pcb.pcb_fpu */
22 struct fpreg {
23         double fpreg[32];
24         double fpscr;
25 };
26
27 struct dbreg {
28         unsigned int    junk;
29 };
30
31 #ifdef __LP64__
32 /* Must match struct trapframe */
33 struct reg32 {
34         int32_t fixreg[32];
35         int32_t lr;
36         int32_t cr;
37         int32_t xer;
38         int32_t ctr;
39         int32_t pc;
40 };
41
42 struct fpreg32 {
43         struct fpreg data;
44 };
45
46 struct dbreg32 {
47         struct dbreg data;
48 };
49
50 #define __HAVE_REG32
51 #endif
52
53 #ifdef _KERNEL
54 /*
55  * XXX these interfaces are MI, so they should be declared in a MI place.
56  */
57 int     fill_regs(struct thread *, struct reg *);
58 int     set_regs(struct thread *, struct reg *);
59 int     fill_fpregs(struct thread *, struct fpreg *);
60 int     set_fpregs(struct thread *, struct fpreg *);
61 int     fill_dbregs(struct thread *, struct dbreg *);
62 int     set_dbregs(struct thread *, struct dbreg *);
63
64 #ifdef COMPAT_FREEBSD32
65 struct image_params;
66
67 int     fill_regs32(struct thread *, struct reg32 *);
68 int     set_regs32(struct thread *, struct reg32 *);
69 void    ppc32_setregs(struct thread *, struct image_params *, u_long);
70
71 #define fill_fpregs32(td, reg)  fill_fpregs(td,(struct fpreg *)reg)
72 #define set_fpregs32(td, reg)   set_fpregs(td,(struct fpreg *)reg)
73 #define fill_dbregs32(td, reg)  fill_dbregs(td,(struct dbreg *)reg)
74 #define set_dbregs32(td, reg)   set_dbregs(td,(struct dbreg *)reg)
75 #endif
76
77 #endif
78
79 #endif /* _POWERPC_REG_H_ */