projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
merge in vnode changes
[unix-history]
/
usr
/
src
/
sys
/
kern
/
subr_rmap.c
diff --git
a/usr/src/sys/kern/subr_rmap.c
b/usr/src/sys/kern/subr_rmap.c
index
e34447b
..
7acbc57
100644
(file)
--- a/
usr/src/sys/kern/subr_rmap.c
+++ b/
usr/src/sys/kern/subr_rmap.c
@@
-1,13
+1,19
@@
-/* subr_rmap.c 4.5 82/04/11 */
+/*
+ * 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 7.2 (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/mtpr
.h"
-#include "
../h/text
.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.
/*
* Resource map handling routines.
@@
-43,7
+49,7
@@
*/
rminit(mp, size, addr, name, mapsize)
register struct map *mp;
*/
rminit(mp, size, addr, name, mapsize)
register struct map *mp;
-
int
size, addr;
+
long
size, addr;
char *name;
int mapsize;
{
char *name;
int mapsize;
{
@@
-66,6
+72,8
@@
rminit(mp, size, addr, name, mapsize)
*/
ep->m_size = size;
ep->m_addr = addr;
*/
ep->m_size = size;
ep->m_addr = addr;
+ (++ep)->m_size = 0;
+ ep->m_addr = 0;
}
/*
}
/*
@@
-79,15
+87,17
@@
rminit(mp, size, addr, name, mapsize)
* This routine knows about the interleaving of the swapmap
* and handles that.
*/
* This routine knows about the interleaving of the swapmap
* and handles that.
*/
+long
rmalloc(mp, size)
register struct map *mp;
rmalloc(mp, size)
register struct map *mp;
+ long size;
{
register struct mapent *ep = (struct mapent *)(mp+1);
register int addr;
register struct mapent *bp;
swblk_t first, rest;
{
register struct mapent *ep = (struct mapent *)(mp+1);
register int addr;
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
panic("rmalloc");
/*
* Search for a piece of the resource map which has enough
@@
-100,8
+110,8
@@
rmalloc(mp, size)
* then have to respect interleaving
* boundaries.
*/
* 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;
if (bp->m_size - first < size)
continue;
addr = bp->m_addr + first;
@@
-141,7
+151,7
@@
rmalloc(mp, size)
*/
rmfree(mp, size, addr)
struct map *mp;
*/
rmfree(mp, size, addr)
struct map *mp;
-
register int
size, addr;
+
long
size, addr;
{
struct mapent *firstbp;
register struct mapent *bp;
{
struct mapent *firstbp;
register struct mapent *bp;
@@
-318,7
+328,7
@@
rmget(mp, size, addr)
*/
for (bp2=bp; bp2->m_size; bp2++)
;
*/
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;
return (0);
while (bp2 > bp) {
(bp2+1)->m_addr = bp2->m_addr;