Save CR24 and CR27 and report in ddb.

This commit is contained in:
skrll 2011-01-22 19:35:47 +00:00
parent 0c3c6bf2b7
commit 5a4e5babba
6 changed files with 31 additions and 13 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: genassym.cf,v 1.27 2011/01/22 19:27:43 skrll Exp $
# $NetBSD: genassym.cf,v 1.28 2011/01/22 19:35:47 skrll Exp $
# $OpenBSD: genassym.cf,v 1.18 2001/09/20 18:31:14 mickey Exp $
@ -175,7 +175,9 @@ member TF_CR20 tf_isr
member TF_CR21 tf_ior
member TF_CR22 tf_ipsw
member TF_CR23 tf_eirr
member TF_CR24 tf_cr24
member TF_CR25 tf_vtop
member TF_CR27 tf_cr27
member TF_CR28 tf_cr28
member TF_CR30 tf_cr30

View File

@ -1,4 +1,4 @@
/* $NetBSD: db_interface.c,v 1.24 2011/01/22 19:25:01 skrll Exp $ */
/* $NetBSD: db_interface.c,v 1.25 2011/01/22 19:35:48 skrll Exp $ */
/* $OpenBSD: db_interface.c,v 1.16 2001/03/22 23:31:45 mickey Exp $ */
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.24 2011/01/22 19:25:01 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.25 2011/01/22 19:35:48 skrll Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -123,6 +123,8 @@ const struct db_variable db_regs[] = {
#endif
{ "vtop", (long *)&ddb_regs.tf_vtop, FCN_NULL },
{ "cr24", (long *)&ddb_regs.tf_cr24, FCN_NULL },
{ "cr27", (long *)&ddb_regs.tf_cr27, FCN_NULL },
{ "cr28", (long *)&ddb_regs.tf_cr28, FCN_NULL },
{ "cr30", (long *)&ddb_regs.tf_cr30, FCN_NULL },
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: db_machdep.c,v 1.2 2010/11/15 06:32:38 uebayasi Exp $ */
/* $NetBSD: db_machdep.c,v 1.3 2011/01/22 19:35:48 skrll Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.2 2010/11/15 06:32:38 uebayasi Exp $");
__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.3 2011/01/22 19:35:48 skrll Exp $");
#include <sys/param.h>
#include <sys/lwp.h>
@ -122,7 +122,9 @@ db_dump_trap(db_expr_t addr, bool have_addr, db_expr_t count, const char *modif)
db_printf("rctr: %08x\n", tf->tf_rctr); /* cr0 */
db_printf("ccr: %08x\n", tf->tf_ccr); /* cr10 */
db_printf("eirr: %08x\n", tf->tf_eirr); /* cr23 - DDB */
db_printf("cr24: %08x\n", tf->tf_cr24); /* cr24 - DDB */
db_printf("vtop: %08x\n", tf->tf_vtop); /* cr25 - DDB */
db_printf("cr27: %08x\n", tf->tf_cr27); /* - DDB */
db_printf("cr28: %08x\n", tf->tf_cr28); /* - DDB */
db_printf("cr30: %08x\n", tf->tf_cr30); /* uaddr */
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: kgdb_hppa.c,v 1.7 2010/06/04 09:25:18 skrll Exp $ */
/* $NetBSD: kgdb_hppa.c,v 1.8 2011/01/22 19:35:48 skrll Exp $ */
/*
* Copyright (c) 1990, 1993
@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kgdb_hppa.c,v 1.7 2010/06/04 09:25:18 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: kgdb_hppa.c,v 1.8 2011/01/22 19:35:48 skrll Exp $");
#include <sys/param.h>
#include <sys/kgdb.h>
@ -209,7 +209,7 @@ kgdb_signal(int type)
KGDB_MOVEREG(57, tf_hptm); /* cr24 - DDB */ \
KGDB_MOVEREG(58, tf_vtop); /* cr25 - DDB */ \
/* 59 should be cr26, which we don't have available */ \
/* 60 should be cr27, which we don't have available */ \
KGDB_MOVEREG(60, tf_cr27); /* - DDB */ \
KGDB_MOVEREG(61, tf_cr28); /* - DDB */ \
/* 62 should be cr29, which we don't have available */ \
KGDB_MOVEREG(63, tf_cr30) /* uaddr */

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.S,v 1.51 2011/01/22 10:57:07 skrll Exp $ */
/* $NetBSD: trap.S,v 1.52 2011/01/22 19:35:48 skrll Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -375,8 +375,13 @@ syscall_entry:
stw %arg0, TF_CR23-TRAPFRAME_SIZEOF(%sr1, %t3)
stw %arg1, TF_CR25-TRAPFRAME_SIZEOF(%sr1, %t3)
mfctl %cr24, %arg0
mfctl %cr28, %arg1
stw %arg0, TF_CR24-TRAPFRAME_SIZEOF(%sr1, %t3)
stw %arg1, TF_CR28-TRAPFRAME_SIZEOF(%sr1, %t3)
mfctl CR_TLS, %arg0
stw %arg0, TF_CR27-TRAPFRAME_SIZEOF(%sr1, %t3)
#endif
/* setup kernel context */
@ -2185,11 +2190,16 @@ trapnowvirt:
stw %t1, TF_CR23(%t3)
stw %t2, TF_CR25(%t3)
mfctl %cr24, %t1
mfctl %cr28, %t2
stw %t1, TF_CR24(%t3)
stw %t2, TF_CR28(%t3)
mfctl CR_TLS, %t1
stw %t1, TF_CR27(%t3)
#endif
mfctl CR_FPPADDR, %t1
stw %t1, TF_CR30(%t3)
mfctl CR_FPPADDR, %t2
stw %t2, TF_CR30(%t3)
/*
* load the global pointer for the kernel

View File

@ -1,4 +1,4 @@
/* $NetBSD: frame.h,v 1.11 2010/03/30 19:27:54 skrll Exp $ */
/* $NetBSD: frame.h,v 1.12 2011/01/22 19:35:48 skrll Exp $ */
/* $OpenBSD: frame.h,v 1.11 1999/11/25 18:28:06 mickey Exp $ */
@ -132,11 +132,13 @@ struct trapframe {
u_int tf_rctr; /* cr0 */
u_int tf_ccr; /* cr10 */
u_int tf_eirr; /* cr23 - DDB */
u_int tf_cr24; /* cr24 - DDB */
u_int tf_vtop; /* cr25 - DDB */
u_int tf_cr27; /* - DDB */
u_int tf_cr28; /* - DDB */
u_int tf_cr30; /* fpregs */
u_int tf_pad[4]; /* pad to 256 bytes */
u_int tf_pad[2]; /* pad to 256 bytes */
};
#endif /* !__ASSEMBLER__ */