summaryrefslogtreecommitdiff
path: root/mach-defpager/default_pager.c
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-03-14 00:29:02 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-11-03 11:18:34 +0100
commit282e4ae275dc1b9b0b5bba6eb1b145cd1e80fa33 (patch)
tree972b4d244dc4f9511163f7da151381a5356c9558 /mach-defpager/default_pager.c
parent89abef408f02e463cfe9d462fa10be64a94b3b36 (diff)
mach-defpager: use protected payloads for object lookups
* mach-defpager/default_pager.c (pager_port_list_insert): Set protected payload. (pager_port_list_delete): Clear protected payload. * mach-defpager/mig-decls.h (begin_using_default_pager_payload): New function. * mach-defpager/mig-mutate.h: Add mutator.
Diffstat (limited to 'mach-defpager/default_pager.c')
-rw-r--r--mach-defpager/default_pager.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c
index d40a9c92..831ed968 100644
--- a/mach-defpager/default_pager.c
+++ b/mach-defpager/default_pager.c
@@ -1803,6 +1803,12 @@ void pager_port_list_insert(port, ds)
(hurd_ihash_key_t) port,
(hurd_ihash_value_t) ds);
pthread_mutex_unlock(&all_pagers.lock);
+
+ /* Try to set a protected payload. This is an optimization,
+ if it fails we degrade gracefully. */
+ mach_port_set_protected_payload (mach_task_self (),
+ port,
+ (unsigned long) ds);
}
void pager_port_list_delete(ds)
@@ -1812,6 +1818,9 @@ void pager_port_list_delete(ds)
hurd_ihash_locp_remove (&all_pagers.htable,
ds->htable_locp);
pthread_mutex_unlock(&all_pagers.lock);
+
+ mach_port_clear_protected_payload (mach_task_self (),
+ ds->pager);
}
/*