summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/include/reg.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/powerpc/include/reg.h')
-rw-r--r--sys/powerpc/include/reg.h44
1 files changed, 41 insertions, 3 deletions
diff --git a/sys/powerpc/include/reg.h b/sys/powerpc/include/reg.h
index 6403655..3d2d581 100644
--- a/sys/powerpc/include/reg.h
+++ b/sys/powerpc/include/reg.h
@@ -4,12 +4,16 @@
#ifndef _POWERPC_REG_H_
#define _POWERPC_REG_H_
+#if defined(_KERNEL) && !defined(KLD_MODULE) && !defined(_STANDALONE)
+#include "opt_compat.h"
+#endif
+
/* Must match struct trapframe */
struct reg {
register_t fixreg[32];
register_t lr;
- int cr;
- int xer;
+ register_t cr;
+ register_t xer;
register_t ctr;
register_t pc;
};
@@ -21,9 +25,29 @@ struct fpreg {
};
struct dbreg {
- unsigned long junk;
+ unsigned int junk;
+};
+
+#ifdef COMPAT_FREEBSD32
+/* Must match struct trapframe */
+struct reg32 {
+ int32_t fixreg[32];
+ int32_t lr;
+ int32_t cr;
+ int32_t xer;
+ int32_t ctr;
+ int32_t pc;
+};
+
+struct fpreg32 {
+ struct fpreg data;
};
+struct dbreg32 {
+ struct dbreg data;
+};
+#endif
+
#ifdef _KERNEL
/*
* XXX these interfaces are MI, so they should be declared in a MI place.
@@ -34,6 +58,20 @@ int fill_fpregs(struct thread *, struct fpreg *);
int set_fpregs(struct thread *, struct fpreg *);
int fill_dbregs(struct thread *, struct dbreg *);
int set_dbregs(struct thread *, struct dbreg *);
+
+#ifdef COMPAT_FREEBSD32
+struct image_params;
+
+int fill_regs32(struct thread *, struct reg32 *);
+int set_regs32(struct thread *, struct reg32 *);
+void ppc32_setregs(struct thread *, struct image_params *, u_long);
+
+#define fill_fpregs32(td, reg) fill_fpregs(td,(struct fpreg *)reg)
+#define set_fpregs32(td, reg) set_fpregs(td,(struct fpreg *)reg)
+#define fill_dbregs32(td, reg) fill_dbregs(td,(struct dbreg *)reg)
+#define set_dbregs32(td, reg) set_dbregs(td,(struct dbreg *)reg)
+#endif
+
#endif
#endif /* _POWERPC_REG_H_ */
OpenPOWER on IntegriCloud