diff options
author | Michael I. Bushnell <mib@gnu.org> | 1994-01-13 21:00:25 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1994-01-13 21:00:25 +0000 |
commit | 54772067a21af8495122534642ec416b8610fe23 (patch) | |
tree | 8b1bc98ec288cb4e6fa8420a742bfff6d8920879 | |
parent | d2621ec8179cf3bf9c14bfe39e0d173ae78e6695 (diff) |
Initial revision
-rw-r--r-- | libpager/pager-create.c | 9 | ||||
-rw-r--r-- | libpager/pager-flush.c | 43 |
2 files changed, 43 insertions, 9 deletions
diff --git a/libpager/pager-create.c b/libpager/pager-create.c index acd53beb..1a967769 100644 --- a/libpager/pager-create.c +++ b/libpager/pager-create.c @@ -38,13 +38,4 @@ pager_create (struct user_pager_info *upi) p->pagemapsize = 0; spin_lock (&pagerlistlock); - p->next = _pager_all_pagers; - p->prevp = &_pager_all_pagers; - _pager_all_pagers = p; - if (p->next) - p->next->prevp = &p->next; - spin_unlock (&pagerlistlock); - return p; -} - diff --git a/libpager/pager-flush.c b/libpager/pager-flush.c new file mode 100644 index 00000000..aad86117 --- /dev/null +++ b/libpager/pager-flush.c @@ -0,0 +1,43 @@ +/* Functions for flushing data + Copyright (C) 1994 Free Software Foundation + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2, or (at + your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + + +/* Have the kernel flush all pages in the pager; if WAIT is set, then + wait for them to be finally expunged before returning. */ +void +pager_flush (struct pager *p, int wait) +{ + vm_address_t offset; + vm_size_t len; + + pager_report_extent (p->upi, &offset, &len); + + lock_object (p, offset, len, MEMORY_OBJECT_RETURN_NONE, 1 + VM_PROT_NONE, wait); +} + + +/* Have the kernel write back some pages of a pager; if WAIT is set, + then wait for them to be finally written before returning. */ +void +pager_sync_some (struct pager *p, vm_address_t offset, + vm_size_t size, int wait) +{ + lock_object (p, offset, len, MEMORY_OBJECT_RETURN_DIRTY, 0 + VM_PROT_NO_CHANGE, wait); +} + |