summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2008-02-29 19:00:40 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2008-02-29 19:00:40 +0000
commitf09d729bc6c091d487e5c62e500533be509865c3 (patch)
treee4801eb9f8b1344c686f2fee53976df320f960e2 /sys
parent40f316c8ffda601ddad7957d0f620826edc21e0b (diff)
Fix db_read_bytes() for short reads.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/mips64/mips64/db_machdep.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/arch/mips64/mips64/db_machdep.c b/sys/arch/mips64/mips64/db_machdep.c
index c6d3fa4fe67..245a5808b31 100644
--- a/sys/arch/mips64/mips64/db_machdep.c
+++ b/sys/arch/mips64/mips64/db_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_machdep.c,v 1.15 2008/02/18 19:47:36 miod Exp $ */
+/* $OpenBSD: db_machdep.c,v 1.16 2008/02/29 19:00:39 miod Exp $ */
/*
* Copyright (c) 1998-2003 Opsycon AB (www.opsycon.se)
@@ -148,19 +148,20 @@ kdb_trap(type, fp)
bcopy((void *)&ddb_regs, (void *)fp, NUMSAVEREGS * sizeof(register_t));
return(TRUE);
}
+
void
db_read_bytes(addr, size, data)
vaddr_t addr;
size_t size;
char *data;
{
- while(size >= sizeof(int)) {
+ while (size >= sizeof(int)) {
*((int *)data)++ = kdbpeek((void *)addr);
addr += sizeof(int);
size -= sizeof(int);
}
- if (size > sizeof(short)) {
+ if (size >= sizeof(short)) {
*((short *)data)++ = kdbpeekw((void *)addr);
addr += sizeof(short);
size -= sizeof(short);
@@ -195,7 +196,7 @@ db_write_bytes(addr, size, data)
if (len) {
kdbpokeb(ptr, *data++);
}
- if (addr < VM_MIN_KERNEL_ADDRESS) {
+ if (addr < VM_MAXUSER_ADDRESS) {
Mips_HitSyncDCache(addr, size);
Mips_InvalidateICache(PHYS_TO_KSEG0(addr & 0xffff), size);
}
@@ -402,8 +403,8 @@ done:
(*pr)("%s+%p ", symname, diff);
(*pr)("(%llx,%llx,%llx,%llx) sp %llx ra %llx, sz %d\n", a0, a1, a2, a3, sp, ra, stksize);
- if (subr == (long)k_intr || subr == (long)k_general) {
- if (subr == (long)k_intr)
+ if (subr == (vaddr_t)k_intr || subr == (vaddr_t)k_general) {
+ if (subr == (vaddr_t)k_intr)
(*pr)("(KERNEL INTERRUPT)\n");
else
(*pr)("(KERNEL TRAP)\n");
@@ -605,7 +606,7 @@ if ((tlbp.tlb_hi == tlb.tlb_hi && (tlb.tlb_lo0 & PG_V || tlb.tlb_lo1 & PG_V)) ||
continue;
if (tlb.tlb_lo0 & PG_V || tlb.tlb_lo1 & PG_V) {
- printf("%2d v=%16llx", tlbno, tlb.tlb_hi & (long)~0xff);
+ printf("%2d v=%16llx", tlbno, tlb.tlb_hi & ~0xffL);
printf("/%02x ", tlb.tlb_hi & 0xff);
if (tlb.tlb_lo0 & PG_V) {