Use uvm_physseg.h:uvm_page_physload() instead of uvm_extern.h

For this, include uvm_physseg.h in the build and include tree, make a
cosmetic modification to the prototype for uvm_page_physload().
This commit is contained in:
cherry 2016-12-22 13:26:24 +00:00
parent 0805fb3a53
commit 8af61ebf0c
4 changed files with 19 additions and 11 deletions

View File

@ -1,11 +1,11 @@
# $NetBSD: Makefile,v 1.9 2006/02/11 12:45:07 yamt Exp $
# $NetBSD: Makefile,v 1.10 2016/12/22 13:26:24 cherry Exp $
INCSDIR= /usr/include/uvm
INCS= uvm.h uvm_amap.h uvm_anon.h uvm_aobj.h uvm_device.h \
uvm_extern.h uvm_fault.h uvm_fault_i.h uvm_glue.h \
uvm_km.h uvm_loan.h \
uvm_map.h uvm_object.h uvm_page.h \
uvm_map.h uvm_object.h uvm_page.h uvm_physseg.h \
uvm_pager.h uvm_param.h uvm_pdaemon.h uvm_pglist.h \
uvm_pmap.h uvm_prot.h uvm_stat.h \
uvm_swap.h

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm.h,v 1.66 2015/04/13 22:04:44 riastradh Exp $ */
/* $NetBSD: uvm.h,v 1.67 2016/12/22 13:26:24 cherry Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@ -57,6 +57,7 @@
#include <uvm/uvm_object.h>
#include <uvm/uvm_page.h>
#include <uvm/uvm_pager.h>
#include <uvm/uvm_physseg.h>
#include <uvm/uvm_pdaemon.h>
#include <uvm/uvm_swap.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_extern.h,v 1.199 2016/12/22 12:55:21 cherry Exp $ */
/* $NetBSD: uvm_extern.h,v 1.200 2016/12/22 13:26:24 cherry Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@ -474,6 +474,14 @@ extern bool vm_page_zero_enable;
#include <uvm/uvm_pager.h>
#endif
/*
* Include the uvm_hotplug(9) API unconditionally until
* uvm_page_physload() et. al. are obsoleted
*
* After this, MD code will have to explicitly include it if needed.
*/
#include <uvm/uvm_physseg.h>
/*
* helpers for calling ubc_release()
*/
@ -709,9 +717,6 @@ void uvm_pagereplace(struct vm_page *,
struct vm_page *);
void uvm_pagerealloc(struct vm_page *,
struct uvm_object *, voff_t);
/* Actually, uvm_page_physload takes PF#s which need their own type */
void uvm_page_physload(paddr_t, paddr_t, paddr_t,
paddr_t, int);
void uvm_setpagesize(void);
/* uvm_pager.c */

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_page.c,v 1.187 2015/04/11 19:24:13 joerg Exp $ */
/* $NetBSD: uvm_page.c,v 1.188 2016/12/22 13:26:25 cherry Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.187 2015/04/11 19:24:13 joerg Exp $");
__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.188 2016/12/22 13:26:25 cherry Exp $");
#include "opt_ddb.h"
#include "opt_uvm.h"
@ -735,7 +735,7 @@ uvm_page_physget(paddr_t *paddrp)
* => we are limited to VM_PHYSSEG_MAX physical memory segments
*/
void
uvm_physseg_t
uvm_page_physload(paddr_t start, paddr_t end, paddr_t avail_start,
paddr_t avail_end, int free_list)
{
@ -761,7 +761,7 @@ uvm_page_physload(paddr_t start, paddr_t end, paddr_t avail_start,
printf("\t%d segments allocated, ignoring 0x%llx -> 0x%llx\n",
VM_PHYSSEG_MAX, (long long)start, (long long)end);
printf("\tincrease VM_PHYSSEG_MAX\n");
return;
return 0;
}
/*
@ -840,6 +840,8 @@ uvm_page_physload(paddr_t start, paddr_t end, paddr_t avail_start,
if (!preload) {
uvmpdpol_reinit();
}
return 0;
}
/*