reg.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /* $NetBSD: reg.h,v 1.4 2000/06/04 09:30:44 tsubai Exp $ */
  2. /* $FreeBSD$ */
  3. #ifndef _POWERPC_REG_H_
  4. #define _POWERPC_REG_H_
  5. /* Must match struct trapframe */
  6. struct reg {
  7. register_t fixreg[32];
  8. register_t lr;
  9. register_t cr;
  10. register_t xer;
  11. register_t ctr;
  12. register_t pc;
  13. };
  14. struct fpreg {
  15. double fpreg[32];
  16. double fpscr;
  17. };
  18. /* Must match pcb.pcb_vec */
  19. struct vmxreg {
  20. uint32_t vr[32][4];
  21. uint32_t pad[2];
  22. uint32_t vrsave;
  23. uint32_t vscr;
  24. };
  25. struct dbreg {
  26. unsigned int junk;
  27. };
  28. #ifdef __LP64__
  29. /* Must match struct trapframe */
  30. struct reg32 {
  31. int32_t fixreg[32];
  32. int32_t lr;
  33. int32_t cr;
  34. int32_t xer;
  35. int32_t ctr;
  36. int32_t pc;
  37. };
  38. struct fpreg32 {
  39. struct fpreg data;
  40. };
  41. struct vmxreg32 {
  42. struct vmxreg data;
  43. };
  44. struct dbreg32 {
  45. struct dbreg data;
  46. };
  47. #define __HAVE_REG32
  48. #endif
  49. #ifdef _KERNEL
  50. /*
  51. * XXX these interfaces are MI, so they should be declared in a MI place.
  52. */
  53. int fill_regs(struct thread *, struct reg *);
  54. int set_regs(struct thread *, struct reg *);
  55. int fill_fpregs(struct thread *, struct fpreg *);
  56. int set_fpregs(struct thread *, struct fpreg *);
  57. int fill_dbregs(struct thread *, struct dbreg *);
  58. int set_dbregs(struct thread *, struct dbreg *);
  59. #ifdef COMPAT_FREEBSD32
  60. struct image_params;
  61. int fill_regs32(struct thread *, struct reg32 *);
  62. int set_regs32(struct thread *, struct reg32 *);
  63. void ppc32_setregs(struct thread *, struct image_params *, uintptr_t);
  64. #define fill_fpregs32(td, reg) fill_fpregs(td,(struct fpreg *)reg)
  65. #define set_fpregs32(td, reg) set_fpregs(td,(struct fpreg *)reg)
  66. #define fill_dbregs32(td, reg) fill_dbregs(td,(struct dbreg *)reg)
  67. #define set_dbregs32(td, reg) set_dbregs(td,(struct dbreg *)reg)
  68. #endif
  69. #endif
  70. #endif /* _POWERPC_REG_H_ */