On Wed, Jun 12, 2002 at 04:47:08PM +0200, Neal H. Walfield wrote:
> You can use the default pager as your backing store.

Ah, that's cool, thanks for the tip how to do it.  I don't mind the delay in
page out performance right now.

I can try the default pager approach again later, but it's only a couple of
lines of code either way, and I have more pressing issues to solve.

Can you please verify with me that the following code matches what you
described here:

> You do not even have to do this.  Just hold a reference to the regions
> returned by pager_write_page; it is up to you to vm_deallocate them.

error_t
pager_write_page (struct user_pager_info *upi, vm_offset_t page,
                  vm_address_t buf)
{
  assert (upi->memobj_pages[page / vm_page_size] == (vm_address_t) NULL);
  upi->memobj_pages[page / vm_page_size] = buf;
  return 0;
}

/* Implement the pager_clear_user_data callback from the pager library. */
void
pager_clear_user_data (struct user_pager_info *upi)
{
  int idx;

  for (idx = 0; idx < upi->memobj_npages; idx++)
    if (upi->memobj_pages[idx])
      vm_deallocate (mach_task_self (), upi->memobj_pages[idx], vm_page_size);
  free (upi);
}

Thanks,
Marcus
 

-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org [EMAIL PROTECTED]
Marcus Brinkmann              GNU    http://www.gnu.org    [EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.marcus-brinkmann.de

_______________________________________________
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd

Reply via email to