summaryrefslogtreecommitdiff
path: root/libhurd-mm/storage.c
diff options
context:
space:
mode:
authorneal <neal>2007-12-25 20:06:06 +0000
committerneal <neal>2007-12-25 20:06:06 +0000
commit7497724fdbd887029f3d70a691db27a34926e64a (patch)
tree0a5384b105bfedc8e61b5f87d2b18a1124c4dbf4 /libhurd-mm/storage.c
parent4744b703dc58a704e43a88f9af45042b9700fc32 (diff)
hurd/
2007-12-25 Neal H. Walfield <neal@gnu.org> * cap.h: Include <stdint.h>. (OBJECT_PRIORITY_BITS): Define. (OBJECT_PRIORITY_MAX): Likewise. (OBJECT_PRIORITY_LRU): Likewise. (OBJECT_PRIORITY_MIN): Likewise. (struct object_policy): New structure. (OBJECT_POLICY_INIT): Define. (OBJECT_POLICY): Likewise. (OBJECT_POLICY_VOID): Likewise. (OBJECT_POLICY_DEFAULT): Likewise. (struct cap_properties): New structure. (CAP_PROPERTIES_INIT): Define. (CAP_PROPERTIES): Likewise. (CAP_PROPERTIES_VOID): Likewise. (CAP_PROPERTIES_DEFAULT): Likewise. (struct cap): Add fields discardable and priority. [RM_INTERN]: Reduce OID to 54 bits. [! RM_INTERN]: Allow the shadow field an entire word. (CAP_PROPERTIES_GET): Define. (CAP_PROPERTIES_SET): Likewise. (CAP_COPY_DISCARDABLE_SET): Likewise. (CAP_COPY_PRIORITY_SET): Likewise. (cap_copy): Remove the stuct cap_addr_trans parameter and replace with a struct cap_properties. Update callers. (cap_read): Likewise. (object_slot_copy_out): Likewise. (object_slot_copy_in): Likewise. (object_slot_read): Likewise. (cap_copy_x): Likewise. Save the object policies in the shadow capability. (cap_get_shadow): Don't munge the address. (cap_set_shadow): Likewise. * thread.h: Include <hurd/cap.h>. (struct hurd_thread_exregs_in): Remove field aspace_addr_trans. Add field aspace_cap_properties. Rename field aspace_addr_trans_flags to aspace_cap_properties_flags. * folio.h (struct folio): Remove field discardable. Add field policy. (folio_object_alloc): Take an additional argument, a struct object_policy. Update users. * cap.h (cap_is_a): Remove dead code. (cap_is_a_page): Remove dead code. libhurd-mm/ 2007-12-25 Neal H. Walfield <neal@gnu.org> * as.h: Change VISIT's signature: pass a struct cap_properties instead of a struct cap_addr_trans. Update callers. * as.c (as_walk): Change VISIT's signature: pass a struct cap_properties instead of a struct cap_addr_trans. Call VISIT appropriately. (as_alloc_slow): Update rm_cap_read use to reflect API changes. (as_init): Update rm_cap_read use to reflect API changes. Use CAP_PROPERTIES_SET to set shadow capability properties. * storage.c (shadow_setup): Update rm_folio_object_alloc use to reflect API changes. Also save the object policy in the shadow capability. (storage_alloc_): Likewise. (storage_free_): Likewise. viengoos/ 2007-12-25 Neal H. Walfield <neal@gnu.org> * object.h (struct object_desc): Add field policy. (object_desc_to_cap): Also return the discardable bit and the priority. (folio_object_alloc): Take additional parameter, the object's policy. Update callers. * object.c (folio_object_alloc): Take additional parameter, the object policy. Save it in the folio header. * as.c (as_build_internal): Update cap_copy_x use to reflect API changes. * thread.h: Remove parameter addr_trans and replace with a parameter that includes it and the object policy. Update users. * thread.c (thread_exregs): Remove parameter addr_trans and replace with a parameter that includes it and the object policy. Pass it to cap_copy_x as appropriate. * server.c: Include "output.h". (server_loop): Update the folio_object_alloc, object_slot_copy_out, object_slot_copy_in, and cap_copy implementations to set the allocated object's policy consistent with the API changes. Update the object_slot_read and cap_read implementations to return the object policy consistent with the API changes. Update the thread_exregs implementation to handle the address space capability's object policy consistent with the API changes. ruth/ 2007-12-25 Neal H. Walfield <neal@gnu.org> * ruth.c (main): Change visit to be consistent with as_walk's expected function signature. Update rm_folio_object_alloc use to reflect API changes.
Diffstat (limited to 'libhurd-mm/storage.c')
-rw-r--r--libhurd-mm/storage.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/libhurd-mm/storage.c b/libhurd-mm/storage.c
index 7ab79cc..96e46d1 100644
--- a/libhurd-mm/storage.c
+++ b/libhurd-mm/storage.c
@@ -269,6 +269,7 @@ shadow_setup (struct cap *cap, struct storage_desc *storage)
error_t err = rm_folio_object_alloc (meta_data_activity,
storage->folio, idx, cap_page,
+ OBJECT_POLICY_DEFAULT,
ADDR_VOID, ADDR_VOID);
assert (err == 0);
shadow = ADDR_TO_PTR (addr_extend (addr_extend (storage->folio,
@@ -311,7 +312,9 @@ shadow_setup (struct cap *cap, struct storage_desc *storage)
cap_set_shadow (cap, shadow);
shadow->caps[idx].type = cap_page;
- shadow->caps[idx].addr_trans = CAP_ADDR_TRANS_VOID;
+ CAP_PROPERTIES_SET (&shadow->caps[idx],
+ CAP_PROPERTIES (OBJECT_POLICY_DEFAULT,
+ CAP_ADDR_TRANS_VOID));
}
void
@@ -506,14 +509,17 @@ storage_alloc_ (addr_t activity,
if (likely (!! shadow))
{
cap = &shadow->caps[idx];
- cap->addr_trans = CAP_ADDR_TRANS_VOID;
+ CAP_PROPERTIES_SET (cap, CAP_PROPERTIES (OBJECT_POLICY_DEFAULT,
+ CAP_ADDR_TRANS_VOID));
cap->type = type;
}
else
assert (! as_init_done);
error_t err = rm_folio_object_alloc (meta_data_activity,
- folio, idx, type, addr, ADDR_VOID);
+ folio, idx, type,
+ OBJECT_POLICY_DEFAULT,
+ addr, ADDR_VOID);
assert (! err);
/* We drop DESC->LOCK. */
@@ -646,13 +652,16 @@ storage_free_ (addr_t object, bool unmap_now)
error_t err = rm_folio_object_alloc (meta_data_activity,
folio, idx, cap_void,
+ OBJECT_POLICY_DEFAULT,
ADDR_VOID, ADDR_VOID);
assert (err == 0);
if (likely (!! shadow))
{
shadow->caps[idx].type = cap_void;
- shadow->caps[idx].addr_trans = CAP_ADDR_TRANS_VOID;
+ CAP_PROPERTIES_SET (&shadow->caps[idx],
+ CAP_PROPERTIES (OBJECT_POLICY_DEFAULT,
+ CAP_ADDR_TRANS_VOID));
}
else
assert (! as_init_done);