Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ddb Add support for 'q' qualifier for 64-bit values on e...
details: https://anonhg.NetBSD.org/src/rev/6b325bbe8218
branches: trunk
changeset: 338758:6b325bbe8218
user: matt <matt%NetBSD.org@localhost>
date: Sat Jun 06 22:06:05 2015 +0000
description:
Add support for 'q' qualifier for 64-bit values on examine and write.
Align data to long so that the MD parts can use aligned load/stores.
Don't use db_extend but use db_expr_t based expressions.
diffstat:
sys/ddb/db_access.c | 21 ++++++++-------------
sys/ddb/db_examine.c | 10 ++++++++--
sys/ddb/db_write_cmd.c | 13 +++++++++++--
3 files changed, 27 insertions(+), 17 deletions(-)
diffs (123 lines):
diff -r 9a8773a82b34 -r 6b325bbe8218 sys/ddb/db_access.c
--- a/sys/ddb/db_access.c Sat Jun 06 21:48:45 2015 +0000
+++ b/sys/ddb/db_access.c Sat Jun 06 22:06:05 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_access.c,v 1.21 2009/09/28 05:53:37 bsh Exp $ */
+/* $NetBSD: db_access.c,v 1.22 2015/06/06 22:06:05 matt Exp $ */
/*
* Mach Operating System
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_access.c,v 1.21 2009/09/28 05:53:37 bsh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_access.c,v 1.22 2015/06/06 22:06:05 matt Exp $");
#if defined(_KERNEL_OPT)
#include "opt_kgdb.h"
@@ -55,17 +55,10 @@
#if defined(_COMPILE_THIS) || defined(KGDB) && defined(SOFTWARE_SSTEP)
-const int db_extend[] = { /* table for sign-extending */
- 0,
- 0xFFFFFF80,
- 0xFFFF8000,
- 0xFF800000
-};
-
db_expr_t
db_get_value(db_addr_t addr, size_t size, bool is_signed)
{
- char data[sizeof(db_expr_t)];
+ char data[sizeof(db_expr_t)] __aligned(sizeof(db_expr_t));
db_expr_t value;
size_t i;
@@ -79,15 +72,17 @@
#endif /* BYTE_ORDER */
value = (value << 8) + (data[i] & 0xFF);
- if (size < 4 && is_signed && (value & db_extend[size]) != 0)
- value |= db_extend[size];
+ if (size < sizeof(db_expr_t) && is_signed
+ && (value & ((db_expr_t)1 << (8*size - 1)))) {
+ value |= ~(db_expr_t)0 << (8*size - 1);
+ }
return (value);
}
void
db_put_value(db_addr_t addr, size_t size, db_expr_t value)
{
- char data[sizeof(db_expr_t)];
+ char data[sizeof(db_expr_t)] __aligned(sizeof(db_expr_t));
size_t i;
#if BYTE_ORDER == LITTLE_ENDIAN
diff -r 9a8773a82b34 -r 6b325bbe8218 sys/ddb/db_examine.c
--- a/sys/ddb/db_examine.c Sat Jun 06 21:48:45 2015 +0000
+++ b/sys/ddb/db_examine.c Sat Jun 06 22:06:05 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_examine.c,v 1.35 2011/05/26 15:34:14 joerg Exp $ */
+/* $NetBSD: db_examine.c,v 1.36 2015/06/06 22:06:05 matt Exp $ */
/*
* Mach Operating System
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_examine.c,v 1.35 2011/05/26 15:34:14 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_examine.c,v 1.36 2015/06/06 22:06:05 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -101,6 +101,12 @@
size = 4;
width = 12;
break;
+ case 'q':
+ if (sizeof(db_expr_t) != sizeof(uint64_t)) {
+ size = -1;
+ db_error("q not supported\n");
+ /*NOTREACHED*/
+ }
case 'L': /* implementation maximum */
size = sizeof value;
width = 12 * (sizeof value / 4);
diff -r 9a8773a82b34 -r 6b325bbe8218 sys/ddb/db_write_cmd.c
--- a/sys/ddb/db_write_cmd.c Sat Jun 06 21:48:45 2015 +0000
+++ b/sys/ddb/db_write_cmd.c Sat Jun 06 22:06:05 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_write_cmd.c,v 1.26 2010/02/02 09:04:14 tron Exp $ */
+/* $NetBSD: db_write_cmd.c,v 1.27 2015/06/06 22:06:05 matt Exp $ */
/*
* Mach Operating System
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_write_cmd.c,v 1.26 2010/02/02 09:04:14 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_write_cmd.c,v 1.27 2015/06/06 22:06:05 matt Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@@ -67,6 +67,15 @@
case '\0':
size = 4;
break;
+ case 'q':
+ if (sizeof(db_expr_t) != sizeof(uint64_t)) {
+ size = -1;
+ db_error("q not supported\n");
+ /*NOTREACHED*/
+ }
+ case 'L':
+ size = sizeof(db_expr_t);
+ break;
default:
size = -1;
db_error("Unknown size\n");
Home |
Main Index |
Thread Index |
Old Index