diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-09-10 22:37:47 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-09-10 22:37:47 +0000 |
commit | cc58655fc1916c594234ef0b59340ebfe3aee32e (patch) | |
tree | e70b13007334f71b11474fad1e21c1870c7e63d2 /sys/arch/hppa | |
parent | 6e84ad843931b38eb2d472077734d6a52216110a (diff) |
randomize space ids, plus we are not gonna run out now (;
Diffstat (limited to 'sys/arch/hppa')
-rw-r--r-- | sys/arch/hppa/hppa/pmap.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/arch/hppa/hppa/pmap.c b/sys/arch/hppa/hppa/pmap.c index 90741f90f51..758443d0d68 100644 --- a/sys/arch/hppa/hppa/pmap.c +++ b/sys/arch/hppa/hppa/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.83 2002/09/10 22:25:46 mickey Exp $ */ +/* $OpenBSD: pmap.c,v 1.84 2002/09/10 22:37:46 mickey Exp $ */ /* * Copyright (c) 1998-2002 Michael Shalayeff @@ -48,6 +48,8 @@ #include <machine/cpufunc.h> +#include <dev/rndvar.h> + #ifdef PMAPDEBUG #define DPRINTF(l,s) do { \ if ((pmapdebug & (l)) == (l)) \ @@ -94,7 +96,7 @@ int pmap_hptsize = 256; /* patchable */ #endif struct pmap kernel_pmap_store; -int pmap_sid_counter, hppa_sid_max = HPPA_SID_MAX; +int hppa_sid_max = HPPA_SID_MAX; boolean_t pmap_initialized = FALSE; struct pool pmap_pmap_pool; struct pool pmap_pv_pool; @@ -658,11 +660,9 @@ pmap_create() pmap->pm_obj.uo_npages = 0; pmap->pm_obj.uo_refs = 1; - if (pmap_sid_counter >= hppa_sid_max) { - /* collect some */ - panic("pmap_create: outer space"); - } else - space = ++pmap_sid_counter; + do + space = 1 + (arc4random() % hppa_sid_max); + while (pmap_sdir_get(space)); if ((pmap->pm_pdir_pg = pmap_pagealloc(NULL, 0)) == NULL) panic("pmap_create: no pages"); |