From 5a4e5babba42707415b0fe2674959538de98ca8f Mon Sep 17 00:00:00 2001 From: skrll Date: Sat, 22 Jan 2011 19:35:47 +0000 Subject: [PATCH] Save CR24 and CR27 and report in ddb. --- sys/arch/hp700/hp700/genassym.cf | 4 +++- sys/arch/hppa/hppa/db_interface.c | 6 ++++-- sys/arch/hppa/hppa/db_machdep.c | 6 ++++-- sys/arch/hppa/hppa/kgdb_hppa.c | 6 +++--- sys/arch/hppa/hppa/trap.S | 16 +++++++++++++--- sys/arch/hppa/include/frame.h | 6 ++++-- 6 files changed, 31 insertions(+), 13 deletions(-) diff --git a/sys/arch/hp700/hp700/genassym.cf b/sys/arch/hp700/hp700/genassym.cf index 2d4711431611..66458f056b1e 100644 --- a/sys/arch/hp700/hp700/genassym.cf +++ b/sys/arch/hp700/hp700/genassym.cf @@ -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 diff --git a/sys/arch/hppa/hppa/db_interface.c b/sys/arch/hppa/hppa/db_interface.c index 9c9bfc0fabe4..9a67ed19cb60 100644 --- a/sys/arch/hppa/hppa/db_interface.c +++ b/sys/arch/hppa/hppa/db_interface.c @@ -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 -__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 #include @@ -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 }, }; diff --git a/sys/arch/hppa/hppa/db_machdep.c b/sys/arch/hppa/hppa/db_machdep.c index a671c27bbde1..66be15ffefac 100644 --- a/sys/arch/hppa/hppa/db_machdep.c +++ b/sys/arch/hppa/hppa/db_machdep.c @@ -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 -__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 #include @@ -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 */ } diff --git a/sys/arch/hppa/hppa/kgdb_hppa.c b/sys/arch/hppa/hppa/kgdb_hppa.c index 683c57cc64ba..178b92b9ae09 100644 --- a/sys/arch/hppa/hppa/kgdb_hppa.c +++ b/sys/arch/hppa/hppa/kgdb_hppa.c @@ -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 -__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 #include @@ -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 */ diff --git a/sys/arch/hppa/hppa/trap.S b/sys/arch/hppa/hppa/trap.S index a426ecfebaab..d46f90024b4b 100644 --- a/sys/arch/hppa/hppa/trap.S +++ b/sys/arch/hppa/hppa/trap.S @@ -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 diff --git a/sys/arch/hppa/include/frame.h b/sys/arch/hppa/include/frame.h index cf4ddea5af21..5525e15064ae 100644 --- a/sys/arch/hppa/include/frame.h +++ b/sys/arch/hppa/include/frame.h @@ -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__ */