i386 does not have a variable min address (yet)

This commit is contained in:
christos 2018-08-12 16:00:41 +00:00
parent 5ceff8e2e0
commit 61bf19f212

View File

@ -1,4 +1,4 @@
/* $NetBSD: x86.c,v 1.3 2018/08/12 15:55:26 christos Exp $ */
/* $NetBSD: x86.c,v 1.4 2018/08/12 16:00:41 christos Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: x86.c,v 1.3 2018/08/12 15:55:26 christos Exp $");
__RCSID("$NetBSD: x86.c,v 1.4 2018/08/12 16:00:41 christos Exp $");
#endif /* not lint */
#include <ddb/ddb.h>
@ -47,11 +47,15 @@ __RCSID("$NetBSD: x86.c,v 1.3 2018/08/12 15:55:26 christos Exp $");
#include "extern.h"
#ifdef VM_MIN_KERNEL_ADDRESS_DEFAULT
vaddr_t vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS_DEFAULT;
#endif
static struct nlist nl[] = {
{ .n_name = "_dumppcb" },
#ifdef VM_MIN_KERNEL_ADDRESS_DEFAULT
{ .n_name = "vm_min_kernel_address" },
#endif
{ .n_name = NULL },
};
@ -68,11 +72,13 @@ db_mach_init(kvm_t *kd)
sizeof(pcb)) {
errx(EXIT_FAILURE, "cannot read dumppcb: %s", kvm_geterr(kd));
}
#ifdef VM_MIN_KERNEL_ADDRESS_DEFAULT
if ((size_t)kvm_read(kd, nl[1].n_value, &vm_min_kernel_address,
sizeof(vm_min_kernel_address)) != sizeof(vm_min_kernel_address)) {
errx(EXIT_FAILURE, "cannot read vm_min_kernel_address: %s",
kvm_geterr(kd));
}
#endif
ddb_regs.tf_sp = pcb.pcb_sp;
ddb_regs.tf_bp = pcb.pcb_bp;
if (ddb_regs.tf_bp != 0 && ddb_regs.tf_sp != 0) {