summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-05-08 09:22:14 +0000
committerRoland McGrath <roland@gnu.org>2002-05-08 09:22:14 +0000
commit0a1dd23a7f70dcf0899c37cb21f18b20e38ff598 (patch)
treea662adb8efd6025abc079156d88a47e1f9a2717b
parent8f3e9096dd29f7bc3420e4e74db624d560ab7ebd (diff)
2002-05-07 Roland McGrath <roland@frob.com>
* data-request.c (_pager_seqnos_memory_object_data_request): Use %z format modifier for vm_size_t argument. * data-return.c (_pager_do_write_request): Likewise. * data-unlock.c (_pager_seqnos_memory_object_data_unlock): Likewise.
-rw-r--r--libpager/data-request.c14
-rw-r--r--libpager/data-return.c28
-rw-r--r--libpager/data-unlock.c13
3 files changed, 27 insertions, 28 deletions
diff --git a/libpager/data-request.c b/libpager/data-request.c
index 82d9b552..f5bbfb5b 100644
--- a/libpager/data-request.c
+++ b/libpager/data-request.c
@@ -22,7 +22,7 @@
/* Implement pagein callback as described in <mach/memory_object.defs>. */
kern_return_t
-_pager_seqnos_memory_object_data_request (mach_port_t object,
+_pager_seqnos_memory_object_data_request (mach_port_t object,
mach_port_seqno_t seqno,
mach_port_t control,
vm_offset_t offset,
@@ -43,7 +43,7 @@ _pager_seqnos_memory_object_data_request (mach_port_t object,
/* Acquire the right to meddle with the pagemap */
mutex_lock (&p->interlock);
_pager_wait_for_seqno (p, seqno);
-
+
/* sanity checks -- we don't do multi-page requests yet. */
if (control != p->memobjcntl)
{
@@ -52,7 +52,7 @@ _pager_seqnos_memory_object_data_request (mach_port_t object,
}
if (length != __vm_page_size)
{
- printf ("incg data request: bad length size %d\n", length);
+ printf ("incg data request: bad length size %zd\n", length);
goto release_out;
}
if (offset % __vm_page_size)
@@ -61,7 +61,7 @@ _pager_seqnos_memory_object_data_request (mach_port_t object,
goto release_out;
}
- _pager_block_termination (p); /* prevent termination until
+ _pager_block_termination (p); /* prevent termination until
mark_object_error is done */
if (p->pager_state != NORMAL)
@@ -99,9 +99,9 @@ _pager_seqnos_memory_object_data_request (mach_port_t object,
if (PM_NEXTERROR (*pm_entry) != PAGE_NOERR && (access & VM_PROT_WRITE))
{
- memory_object_data_error (control, offset, length,
+ memory_object_data_error (control, offset, length,
_pager_page_errors[PM_NEXTERROR (*pm_entry)]);
- _pager_mark_object_error (p, offset, length,
+ _pager_mark_object_error (p, offset, length,
_pager_page_errors[PM_NEXTERROR (*pm_entry)]);
*pm_entry = SET_PM_NEXTERROR (*pm_entry, PAGE_NOERR);
doread = 0;
@@ -119,7 +119,7 @@ _pager_seqnos_memory_object_data_request (mach_port_t object,
err = pager_read_page (p->upi, offset, &page, &write_lock);
if (err)
goto error_read;
-
+
memory_object_data_supply (p->memobjcntl, offset, page, length, 1,
write_lock ? VM_PROT_WRITE : VM_PROT_NONE, 0,
MACH_PORT_NULL);
diff --git a/libpager/data-return.c b/libpager/data-return.c
index a83026fc..a010c6dc 100644
--- a/libpager/data-return.c
+++ b/libpager/data-return.c
@@ -1,5 +1,5 @@
/* Implementation of memory_object_data_return for pager library
- Copyright (C) 1994, 1995, 1996, 1999, 2000 Free Software Foundation
+ Copyright (C) 1994,95,96,99,2000,02 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -45,7 +45,7 @@ _pager_do_write_request (mach_port_t object,
struct lock_list *next;} *lock_list, *ll;
int wakeup;
int omitdata = 0;
-
+
p = ports_lookup_port (0, object, _pager_class);
if (!p)
return EOPNOTSUPP;
@@ -53,7 +53,7 @@ _pager_do_write_request (mach_port_t object,
/* Acquire the right to meddle with the pagemap */
mutex_lock (&p->interlock);
_pager_wait_for_seqno (p, seqno);
-
+
/* sanity checks -- we don't do multi-page requests yet. */
if (control != p->memobjcntl)
{
@@ -62,7 +62,7 @@ _pager_do_write_request (mach_port_t object,
}
if (length % __vm_page_size)
{
- printf ("incg data return: bad length size %d\n", length);
+ printf ("incg data return: bad length size %zd\n", length);
goto release_out;
}
if (offset % __vm_page_size)
@@ -103,7 +103,7 @@ _pager_do_write_request (mach_port_t object,
condition_wait (&p->wakeup, &p->interlock);
goto retry;
}
-
+
/* Mark these pages as being paged out. */
if (initializing)
{
@@ -150,8 +150,8 @@ _pager_do_write_request (mach_port_t object,
for (i = 0; i < npages; i++)
if (!(omitdata & (1 << i)))
- pagerrs[i] = pager_write_page (p->upi,
- offset + (vm_page_size * i),
+ pagerrs[i] = pager_write_page (p->upi,
+ offset + (vm_page_size * i),
data + (vm_page_size * i));
/* Acquire the right to meddle with the pagemap */
@@ -164,10 +164,10 @@ _pager_do_write_request (mach_port_t object,
{
if (omitdata & (1 << i))
continue;
-
+
if (pm_entries[i] & PM_WRITEWAIT)
wakeup = 1;
-
+
if (pagerrs[i] && ! (pm_entries[i] & PM_PAGEINWAIT))
/* The only thing we can do here is mark the page, and give
errors from now on when it is to be read. This is
@@ -179,13 +179,13 @@ _pager_do_write_request (mach_port_t object,
pm_entries[i] |= PM_INVALID;
if (pm_entries[i] & PM_PAGEINWAIT)
- memory_object_data_supply (p->memobjcntl,
- offset + (vm_page_size * i),
- data + (vm_page_size * i),
+ memory_object_data_supply (p->memobjcntl,
+ offset + (vm_page_size * i),
+ data + (vm_page_size * i),
vm_page_size, 1,
VM_PROT_NONE, 0, MACH_PORT_NULL);
else
- munmap ((caddr_t) (data + (vm_page_size * i)),
+ munmap ((caddr_t) (data + (vm_page_size * i)),
vm_page_size);
pm_entries[i] &= ~(PM_PAGINGOUT | PM_PAGEINWAIT | PM_WRITEWAIT);
@@ -214,7 +214,7 @@ _pager_do_write_request (mach_port_t object,
/* Implement pageout call back as described by <mach/memory_object.defs>. */
kern_return_t
-_pager_seqnos_memory_object_data_return (mach_port_t object,
+_pager_seqnos_memory_object_data_return (mach_port_t object,
mach_port_seqno_t seqno,
mach_port_t control,
vm_offset_t offset,
diff --git a/libpager/data-unlock.c b/libpager/data-unlock.c
index a4ef0600..9692f589 100644
--- a/libpager/data-unlock.c
+++ b/libpager/data-unlock.c
@@ -1,5 +1,5 @@
/* Implementation of memory_object_data_unlock for pager library
- Copyright (C) 1994, 1995 Free Software Foundation
+ Copyright (C) 1994,95,2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -19,10 +19,10 @@
#include "memory_object_S.h"
#include <stdio.h>
-/* Implement kernel requests for access as described in
+/* Implement kernel requests for access as described in
<mach/memory_object.defs>. */
kern_return_t
-_pager_seqnos_memory_object_data_unlock (mach_port_t object,
+_pager_seqnos_memory_object_data_unlock (mach_port_t object,
mach_port_seqno_t seqno,
mach_port_t control,
vm_offset_t offset,
@@ -31,7 +31,7 @@ _pager_seqnos_memory_object_data_unlock (mach_port_t object,
{
struct pager *p;
volatile int err;
-
+
p = ports_lookup_port (0, object, _pager_class);
if (!p)
return EOPNOTSUPP;
@@ -65,12 +65,12 @@ _pager_seqnos_memory_object_data_unlock (mach_port_t object,
}
if (length != __vm_page_size)
{
- printf ("incg data unlock: bad length size %d\n", length);
+ printf ("incg data unlock: bad length size %zd\n", length);
goto out;
}
err = pager_unlock_page (p->upi, offset);
-
+
if (!err)
/* We can go ahead and release the lock. */
_pager_lock_object (p, offset, length, MEMORY_OBJECT_RETURN_NONE, 0,
@@ -87,4 +87,3 @@ _pager_seqnos_memory_object_data_unlock (mach_port_t object,
ports_port_deref (p);
return 0;
}
-