In the new non-contig case, redefine pmap_steal_memory() as an alternative

to vm_bootstrap_steal_memory(), since we may need to steal memory from
a direct-mapped segment at this early stage of the game (on e.g. MIPS
and Alpha).

This interface is activated by defining PMAP_STEAL_MEMORY in <machine/pmap.h>.
Otherwise, the pmap_virtual_space() prototype is in-scope for use by
vm_bootstrap_steal_memory().
This commit is contained in:
thorpej 1998-01-08 23:28:04 +00:00
parent 15efce41a3
commit 54f8b4bf57
2 changed files with 24 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.h,v 1.19 1998/01/08 23:13:05 thorpej Exp $ */
/* $NetBSD: pmap.h,v 1.20 1998/01/08 23:28:04 thorpej Exp $ */
/*
* Copyright (c) 1991, 1993
@ -140,9 +140,13 @@ u_int pmap_free_pages __P((void));
boolean_t pmap_next_page __P((vm_offset_t *));
#endif
#if defined(MACHINE_NONCONTIG) || defined(MACHINE_NEW_NONCONTIG)
vm_offset_t pmap_steal_memory __P((vm_size_t));
#if defined(PMAP_STEAL_MEMORY)
vm_offset_t pmap_steal_memory __P((vm_size_t, vm_offset_t *,
vm_offset_t *));
#else
void pmap_virtual_space __P((vm_offset_t *, vm_offset_t *));
#endif
#endif
__END_DECLS
#endif /* kernel*/
#endif /* PMAP_EXCLUDE_DECLS */

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_page.c,v 1.34 1998/01/08 23:03:24 thorpej Exp $ */
/* $NetBSD: vm_page.c,v 1.35 1998/01/08 23:28:06 thorpej Exp $ */
#define VM_PAGE_ALLOC_MEMORY_STATS
@ -354,6 +354,22 @@ vm_offset_t
vm_bootstrap_steal_memory(size)
vm_size_t size;
{
#if defined(PMAP_STEAL_MEMORY)
vm_offset_t addr;
/*
* Defer this to machine-dependent code; we may need to allocate
* from a direct-mapped segment.
*/
addr = pmap_steal_memory(size, &virtual_space_start,
&virtual_space_end);
/* round it the way we like it */
virtual_space_start = round_page(virtual_space_start);
virtual_space_end = trunc_page(virtual_space_end);
return (addr);
#else /* ! PMAP_STEAL_MEMORY */
vm_offset_t addr, vaddr, paddr;
/* round the size to an integer multiple */
@ -391,6 +407,7 @@ vm_bootstrap_steal_memory(size)
VM_PROT_READ|VM_PROT_WRITE, FALSE);
}
return(addr);
#endif /* PMAP_STEAL_MEMORY */
}
/*