From d9b2f81e27cafe909a53a70f18980fa31d624b53 Mon Sep 17 00:00:00 2001 From: mrg Date: Sun, 8 Feb 1998 07:52:28 +0000 Subject: [PATCH] move pdhist initialisation to the same place as maphist. also, declare the history buffers are "struct uvm_history_ent" to ensure proper alignment (eg, alpha). this fixes a boottime panic when the pdhist was used before it had been initialised. --- sys/uvm/uvm_map.c | 8 +++++--- sys/uvm/uvm_swap.c | 7 +------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c index f34eb7371a80..ff16ccd18f38 100644 --- a/sys/uvm/uvm_map.c +++ b/sys/uvm/uvm_map.c @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_map.c,v 1.4 1998/02/07 12:31:32 mrg Exp $ */ +/* $NetBSD: uvm_map.c,v 1.5 1998/02/08 07:52:28 mrg Exp $ */ /* * XXXCDC: "ROUGH DRAFT" QUALITY UVM PRE-RELEASE FILE! @@ -274,7 +274,8 @@ void uvm_map_init() { static struct vm_map_entry kernel_map_entry[MAX_KMAPENT]; #if defined(UVMHIST) - static char histbuf[sizeof(struct uvm_history_ent) * 100]; + static struct uvm_history_ent maphistbuf[100]; + static struct uvm_history_ent pdhistbuf[100]; #endif int lcv; @@ -283,7 +284,8 @@ void uvm_map_init() */ UVMHIST_FUNC("uvm_map_init"); - UVMHIST_INIT_STATIC(maphist, histbuf); + UVMHIST_INIT_STATIC(maphist, maphistbuf); + UVMHIST_INIT_STATIC(pdhist, pdhistbuf); UVMHIST_CALLED(maphist); UVMHIST_LOG(maphist,"", 0, 0, 0, 0); UVMCNT_INIT(uvm_map_call, UVMCNT_CNT, 0, "# uvm_map() successful calls", 0); diff --git a/sys/uvm/uvm_swap.c b/sys/uvm/uvm_swap.c index 5c68ef51c7f2..3b7427039930 100644 --- a/sys/uvm/uvm_swap.c +++ b/sys/uvm/uvm_swap.c @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_swap.c,v 1.3 1998/02/07 11:09:45 mrg Exp $ */ +/* $NetBSD: uvm_swap.c,v 1.4 1998/02/08 07:52:32 mrg Exp $ */ /* * Copyright (c) 1995, 1996, 1997 Matthew R. Green @@ -206,7 +206,6 @@ struct vndbuf { /* * local variables */ -UVMHIST_DECL(pdhist); static struct extent *swapmap; /* controls the mapping of /dev/drum */ SIMPLEQ_HEAD(swapbufhead, swapbuf); static struct swapbufhead freesbufs; /* list of free swapbufs */ @@ -263,12 +262,8 @@ uvm_swap_init() struct swapbuf *sp; struct proc *p = &proc0; /* XXX */ int i; -#if defined(UVMHIST) - static char histbuf[sizeof(struct uvm_history_ent) * 100]; -#endif UVMHIST_FUNC("uvm_swap_init"); - UVMHIST_INIT_STATIC(pdhist, histbuf); UVMHIST_CALLED(pdhist); /* * first, init the swap list, its counter, and its lock.