Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Mar 1999 16:40:03 -0800 (PST)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        "AARON MARKS" <amarks@sarnoff.com>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: getpages() for a memory-based fs
Message-ID:  <199903030040.QAA59228@apollo.backplane.com>
References:   <36DC669B.707C33C7@sarnoff.com>

next in thread | previous in thread | raw e-mail | index | archive | help
:I'm working on the getpages() routine for a memory-based fs and I don't
:quite understand how to map my page(s) to kernel vm via the vm_page
:struct. What's the formal method of copying data to a vm page?
:
:Thanks,
:-A.
:
:-- 
:Aaron J. Marks		       Communications and Computing Systems Lab
:Assoc. Member Tech Staff       Advanced Networks and Computation Group
:amarks@sarnoff.com	       Sarnoff Corporation

    A vm_page_t is not mapped.  Typically you map it by allocating a
    physical buffer with getpbuf() and mapping up to MAXBSIZE bytes worth
    of pages into it's reserved KVM space using pmap_qenter().  You must,
    of course, undo the mappings when finished with them.

    For an eample if how to do this, look at swap_pager_getpages() in
    vm/swap_pager.c from FreeBSD-current ( i.e. the -4.x tree, not the -3.x
    tree.  The -3.x version of the function is not very readable ).

    There are kernel support routines to zero pages, copy pages ( see
    uiomove, uiomoveco ), and so forth but I think you will be happier using
    a pbuf.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199903030040.QAA59228>