diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-03-03 20:48:20 +0100 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-04-02 17:44:00 +0200 |
commit | b7cbdde8854ee4c51ec9cd49ce639bd02d646355 (patch) | |
tree | 7c1cf1b5011763d20584733d2bb7be1b586b667a /libpager/data-request.c | |
parent | 64b5d358fcaa039ca2e7634aceaa5ed4c3a10cc4 (diff) |
libpager: fix receiver lookups
Previously, the receiver lookup was done manually in all the server
functions. Use mig translator functions instead.
* libpager/mig-decls.h: New file.
* libpager/mig-mutate.h: Likewise.
* libpager/Makefile (MIGSFLAGS): Include mig-mutate.h.
* libpager/chg-compl.c: Fix receiver lookups.
* libpager/data-request.c: Likewise.
* libpager/data-return.c: Likewise.
* libpager/data-unlock.c: Likewise.
* libpager/lock-completed.c: Likewise.
* libpager/object-init.c: Likewise.
* libpager/object-terminate.c: Likewise.
* libpager/stubs.c: Likewise.
* libpager/seqnos.c (_pager_update_seqno): Move the actual
functionality...
(_pager_update_seqno_p): ... into a new function that can be called
with a pointer to struct pager.
* libpager/priv.h (_pager_update_seqno_p): New declaration.
Diffstat (limited to 'libpager/data-request.c')
-rw-r--r-- | libpager/data-request.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/libpager/data-request.c b/libpager/data-request.c index 34b8b438..82ce9041 100644 --- a/libpager/data-request.c +++ b/libpager/data-request.c @@ -22,22 +22,21 @@ /* 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 (struct pager *p, mach_port_seqno_t seqno, mach_port_t control, vm_offset_t offset, vm_size_t length, vm_prot_t access) { - struct pager *p; short *pm_entry; int doread, doerror; error_t err; vm_address_t page; int write_lock; - p = ports_lookup_port (0, object, _pager_class); - if (!p) + if (!p + || p->port.class != _pager_class) return EOPNOTSUPP; /* Acquire the right to meddle with the pagemap */ @@ -126,7 +125,6 @@ _pager_seqnos_memory_object_data_request (mach_port_t object, _pager_mark_object_error (p, offset, length, 0); _pager_allow_termination (p); pthread_mutex_unlock (&p->interlock); - ports_port_deref (p); return 0; error_read: @@ -136,7 +134,6 @@ _pager_seqnos_memory_object_data_request (mach_port_t object, pthread_mutex_lock (&p->interlock); _pager_allow_termination (p); pthread_mutex_unlock (&p->interlock); - ports_port_deref (p); return 0; allow_release_out: @@ -144,6 +141,5 @@ _pager_seqnos_memory_object_data_request (mach_port_t object, release_out: _pager_release_seqno (p, seqno); pthread_mutex_unlock (&p->interlock); - ports_port_deref (p); return 0; } |