X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/39d536e67f78a1d5cb735af8573e874d3b4aae66..1eebc1a70802d2bd87f4a95eba439778ff6803ae:/usr/src/sys/kern/subr_rmap.c.sav diff --git a/usr/src/sys/kern/subr_rmap.c.sav b/usr/src/sys/kern/subr_rmap.c.sav index 9a04685f1a..034a6a2330 100644 --- a/usr/src/sys/kern/subr_rmap.c.sav +++ b/usr/src/sys/kern/subr_rmap.c.sav @@ -1,13 +1,19 @@ -/* subr_rmap.c.sav 4.7 82/10/21 */ +/* + * Copyright (c) 1982, 1986 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)subr_rmap.c.sav 7.1 (Berkeley) %G% + */ -#include "../h/param.h" -#include "../h/systm.h" -#include "../h/map.h" -#include "../h/dir.h" -#include "../h/user.h" -#include "../h/proc.h" -#include "../h/text.h" -#include "../h/kernel.h" +#include "param.h" +#include "systm.h" +#include "map.h" +#include "dir.h" +#include "user.h" +#include "proc.h" +#include "text.h" +#include "kernel.h" /* * Resource map handling routines. @@ -43,7 +49,7 @@ */ rminit(mp, size, addr, name, mapsize) register struct map *mp; - int size, addr; + long size, addr; char *name; int mapsize; { @@ -89,7 +95,7 @@ rmalloc(mp, size) register struct mapent *bp; swblk_t first, rest; - if (size <= 0 || mp == swapmap && size > DMMAX) + if (size <= 0 || mp == swapmap && size > dmmax) panic("rmalloc"); /* * Search for a piece of the resource map which has enough @@ -102,8 +108,8 @@ rmalloc(mp, size) * then have to respect interleaving * boundaries. */ - if (mp == swapmap && - (first = DMMAX - bp->m_addr%DMMAX) < bp->m_size) { + if (mp == swapmap && nswdev > 1 && + (first = dmmax - bp->m_addr%dmmax) < bp->m_size) { if (bp->m_size - first < size) continue; addr = bp->m_addr + first; @@ -320,7 +326,7 @@ rmget(mp, size, addr) */ for (bp2=bp; bp2->m_size; bp2++) ; - if (bp2 == mp->m_limit) + if (bp2 + 1 >= mp->m_limit) return (0); while (bp2 > bp) { (bp2+1)->m_addr = bp2->m_addr;