summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/vm/vm_glue.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c
index bf64a82c62d..df95fb03fb2 100644
--- a/sys/vm/vm_glue.c
+++ b/sys/vm/vm_glue.c
@@ -514,7 +514,7 @@ swapout(p)
register struct proc *p;
{
vm_offset_t addr;
- vm_size_t size;
+ int s;
#ifdef DEBUG
if (swapdebug & SDB_SWAPOUT)
@@ -532,19 +532,18 @@ swapout(p)
/*
* Unwire the to-be-swapped process's user struct and kernel stack.
*/
- addr = (vm_offset_t) p->p_addr;
- size = round_page(USPACE);
- vm_map_pageable(kernel_map, addr, addr+size, TRUE);
+ addr = (vm_offset_t)p->p_addr;
+ vm_map_pageable(kernel_map, addr, addr + USPACE, TRUE);
pmap_collect(vm_map_pmap(&p->p_vmspace->vm_map));
/*
* Mark it as (potentially) swapped out.
*/
- (void) splhigh();
+ s = splstatclock();
p->p_flag &= ~P_INMEM;
if (p->p_stat == SRUN)
remrq(p);
- (void) spl0();
+ splx(s);
p->p_swtime = 0;
}