2001-06-10 02:39:37 +00:00
|
|
|
/* $NetBSD: reg.h,v 1.4 2000/06/04 09:30:44 tsubai Exp $ */
|
|
|
|
/* $FreeBSD$ */
|
|
|
|
|
|
|
|
#ifndef _POWERPC_REG_H_
|
|
|
|
#define _POWERPC_REG_H_
|
|
|
|
|
2010-07-13 05:32:19 +00:00
|
|
|
#if defined(_KERNEL) && !defined(KLD_MODULE) && !defined(_STANDALONE)
|
|
|
|
#include "opt_compat.h"
|
|
|
|
#endif
|
|
|
|
|
2004-07-29 13:39:27 +00:00
|
|
|
/* Must match struct trapframe */
|
2001-06-10 02:39:37 +00:00
|
|
|
struct reg {
|
|
|
|
register_t fixreg[32];
|
|
|
|
register_t lr;
|
2010-07-13 05:32:19 +00:00
|
|
|
register_t cr;
|
|
|
|
register_t xer;
|
2001-06-10 02:39:37 +00:00
|
|
|
register_t ctr;
|
|
|
|
register_t pc;
|
|
|
|
};
|
|
|
|
|
2004-07-29 13:39:27 +00:00
|
|
|
/* Must match pcb.pcb_fpu */
|
2001-06-10 02:39:37 +00:00
|
|
|
struct fpreg {
|
|
|
|
double fpreg[32];
|
|
|
|
double fpscr;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct dbreg {
|
2010-07-13 05:32:19 +00:00
|
|
|
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;
|
2001-06-10 02:39:37 +00:00
|
|
|
};
|
|
|
|
|
2010-07-13 05:32:19 +00:00
|
|
|
struct dbreg32 {
|
|
|
|
struct dbreg data;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
[partially forced commit due to pilot error in earlier commit attempt]
{set,fill}_{,fp,db}regs() fixup:
- Add dummy {set,fill}_dbregs() on architectures that don't have them.
- KSEfy the powerpc versions (struct proc -> struct thread).
- Some architectures had the prototypes in md_var.h, some in reg.h, and
some in both; for consistency, move them to reg.h on all platforms.
These functions aren't really MD (the implementation is MD, but the interface
is MI), so they should move to an MI header, but I haven't figured out which
one yet.
Run-tested on i386, build-tested on Alpha, untested on other platforms.
2001-10-21 22:16:48 +00:00
|
|
|
#ifdef _KERNEL
|
|
|
|
/*
|
|
|
|
* XXX these interfaces are MI, so they should be declared in a MI place.
|
|
|
|
*/
|
2002-03-20 23:17:50 +00:00
|
|
|
int fill_regs(struct thread *, struct reg *);
|
|
|
|
int set_regs(struct thread *, struct reg *);
|
|
|
|
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 *);
|
2010-07-13 05:32:19 +00:00
|
|
|
|
|
|
|
#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
|
|
|
|
|
[partially forced commit due to pilot error in earlier commit attempt]
{set,fill}_{,fp,db}regs() fixup:
- Add dummy {set,fill}_dbregs() on architectures that don't have them.
- KSEfy the powerpc versions (struct proc -> struct thread).
- Some architectures had the prototypes in md_var.h, some in reg.h, and
some in both; for consistency, move them to reg.h on all platforms.
These functions aren't really MD (the implementation is MD, but the interface
is MI), so they should move to an MI header, but I haven't figured out which
one yet.
Run-tested on i386, build-tested on Alpha, untested on other platforms.
2001-10-21 22:16:48 +00:00
|
|
|
#endif
|
2001-06-10 02:39:37 +00:00
|
|
|
|
|
|
|
#endif /* _POWERPC_REG_H_ */
|