diff options
author | neal <neal> | 2008-05-28 09:16:33 +0000 |
---|---|---|
committer | neal <neal> | 2008-05-28 09:16:33 +0000 |
commit | a67826343a0c64d67fe19f98f0cc2d67e7cc6bdc (patch) | |
tree | 8b3e7887ba3fc3e12af3d5bbcd645b6728e61724 | |
parent | ebc0994216518c4fa323a6d7f5b0eda61b727fd1 (diff) |
libc-parts/
2008-05-28 Neal H. Walfield <neal@gnu.org>
* process-spawn.c (process_spawn): Update use of
folio_object_alloc to be consistent with new API.
viengoos/
2008-05-28 Neal H. Walfield <neal@gnu.org>
* object.h (folio_object_alloc): Return a struct cap, not void.
Remove the objectp parameter. Update all users.
* object.c (folio_object_alloc): Return a capability designating
the new object. Don't take a location in which to store the
new object.
-rw-r--r-- | libc-parts/ChangeLog | 5 | ||||
-rw-r--r-- | libc-parts/process-spawn.c | 9 | ||||
-rw-r--r-- | viengoos/ChangeLog | 8 | ||||
-rw-r--r-- | viengoos/object.c | 19 | ||||
-rw-r--r-- | viengoos/object.h | 13 | ||||
-rw-r--r-- | viengoos/server.c | 13 | ||||
-rw-r--r-- | viengoos/t-activity.c | 22 | ||||
-rw-r--r-- | viengoos/t-as.c | 8 |
8 files changed, 50 insertions, 47 deletions
diff --git a/libc-parts/ChangeLog b/libc-parts/ChangeLog index b401e64..945b649 100644 --- a/libc-parts/ChangeLog +++ b/libc-parts/ChangeLog @@ -1,3 +1,8 @@ +2008-05-28 Neal H. Walfield <neal@gnu.org> + + * process-spawn.c (process_spawn): Update use of + folio_object_alloc to be consistent with new API. + 2008-02-21 Neal H. Walfield <neal@gnu.org> * Makefile.am (COMMON_CPPFLAGS): Remove variable. diff --git a/libc-parts/process-spawn.c b/libc-parts/process-spawn.c index 7b734cf..b7dafd3 100644 --- a/libc-parts/process-spawn.c +++ b/libc-parts/process-spawn.c @@ -386,11 +386,10 @@ process_spawn (addr_t activity, int index = folio_index ++; #ifdef RM_INTERN - struct object *object; - folio_object_alloc (root_activity, - folio_local_addr, index, cap_type_strengthen (type), - OBJECT_POLICY_VOID, 0, &object); - rt.cap = object_to_cap (object); + rt.cap = folio_object_alloc (root_activity, + folio_local_addr, index, + cap_type_strengthen (type), + OBJECT_POLICY_VOID, 0); #else rm_folio_object_alloc (ADDR_VOID, folio_local_addr, index, diff --git a/viengoos/ChangeLog b/viengoos/ChangeLog index ad7e854..685c617 100644 --- a/viengoos/ChangeLog +++ b/viengoos/ChangeLog @@ -1,3 +1,11 @@ +2008-05-28 Neal H. Walfield <neal@gnu.org> + + * object.h (folio_object_alloc): Return a struct cap, not void. + Remove the objectp parameter. Update all users. + * object.c (folio_object_alloc): Return a capability designating + the new object. Don't take a location in which to store the + new object. + 2008-05-24 Neal H. Walfield <neal@gnu.org> * thread.h (THREAD_WAIT_STATS): Define. diff --git a/viengoos/object.c b/viengoos/object.c index 26edaa1..6b8ecfa 100644 --- a/viengoos/object.c +++ b/viengoos/object.c @@ -499,14 +499,13 @@ folio_free (struct activity *activity, struct folio *folio) bit_dealloc (folios, fdesc->oid / (FOLIO_OBJECTS + 1)); } -void +struct cap folio_object_alloc (struct activity *activity, struct folio *folio, int idx, enum cap_type type, struct object_policy policy, - uintptr_t return_code, - struct object **objectp) + uintptr_t return_code) { debug (4, "allocating %s at %d", cap_type_string (type), idx); @@ -645,15 +644,13 @@ folio_object_alloc (struct activity *activity, ; } - if (objectp) - /* Caller wants to use the object. */ - { - assert (type != cap_void); + struct cap cap; + memset (&cap, 0, sizeof (cap)); + cap.type = type; + cap.oid = oid; + cap.version = folio_object_version (folio, idx); - if (! object) - object = object_find (activity, oid, policy); - *objectp = object; - } + return cap; } void diff --git a/viengoos/object.h b/viengoos/object.h index 8d4a3fa..24fc740 100644 --- a/viengoos/object.h +++ b/viengoos/object.h @@ -426,12 +426,11 @@ extern void folio_free (struct activity *activity, struct folio *folio); equivalent to calling folio_object_free. If OBJECTP is not-NULL, then the in-memory location of the object is returned in *OBJECTP. */ -extern void folio_object_alloc (struct activity *activity, - struct folio *folio, int page, - enum cap_type type, - struct object_policy policy, - uintptr_t return_code, - struct object **objectp); +extern struct cap folio_object_alloc (struct activity *activity, + struct folio *folio, int page, + enum cap_type type, + struct object_policy policy, + uintptr_t return_code); /* Deallocate the object stored in page PAGE of folio FOLIO. */ static inline void @@ -439,7 +438,7 @@ folio_object_free (struct activity *activity, struct folio *folio, int page) { folio_object_alloc (activity, folio, page, cap_void, - OBJECT_POLICY_VOID, 0, NULL); + OBJECT_POLICY_VOID, 0); } /* Return an object's position within its folio. */ diff --git a/viengoos/server.c b/viengoos/server.c index 2e261c6..5a464cd 100644 --- a/viengoos/server.c +++ b/viengoos/server.c @@ -565,23 +565,20 @@ server_loop (void) idx, cap_type_string (type), addr_prefix (object_addr), addr_depth (object_addr)); - struct object *object; - folio_object_alloc (principal, - folio, idx, type, policy, return_code, - type == cap_void ? NULL : &object); + struct cap cap; + cap = folio_object_alloc (principal, + folio, idx, type, policy, return_code); if (type != cap_void) { if (object_slot) { - bool r = cap_set (principal, - object_slot, object_to_cap (object)); + bool r = cap_set (principal, object_slot, cap); assert (r); } if (object_weak_slot) { - bool r = cap_set (principal, object_weak_slot, - object_to_cap (object)); + bool r = cap_set (principal, object_weak_slot, cap); assert (r); object_weak_slot->type = cap_type_weaken (object_weak_slot->type); diff --git a/viengoos/t-activity.c b/viengoos/t-activity.c index f04950a..2351f3b 100644 --- a/viengoos/t-activity.c +++ b/viengoos/t-activity.c @@ -25,12 +25,10 @@ allocate_object (enum cap_type type, addr_t addr) object = 0; } - struct object *o; - folio_object_alloc (root_activity, folio, object ++, - type, OBJECT_POLICY_DEFAULT, 0, &o); - struct as_insert_rt rt; - rt.cap = object_to_cap (o); + rt.cap = folio_object_alloc (root_activity, folio, object ++, + type, OBJECT_POLICY_DEFAULT, 0); + /* We don't need to set RT.STORAGE as as_insert doesn't require it for the internal interface implementations. */ rt.storage = ADDR (0, 0); @@ -78,17 +76,19 @@ test (void) struct object *object; /* Allocate a new activity. */ - folio_object_alloc (activity, folio, obj ++, - cap_activity_control, OBJECT_POLICY_DEFAULT, 0, - &object); - a[i].child = (struct activity *) object; + struct cap cap; + cap = folio_object_alloc (activity, folio, obj ++, + cap_activity_control, + OBJECT_POLICY_DEFAULT, 0); + a[i].child = (struct activity *) cap_to_object (activity, &cap); /* Allocate a folio against the activity and use it. */ a[i].folio = folio_alloc (a[i].child, FOLIO_POLICY_DEFAULT); assert (a[i].folio); - folio_object_alloc (a[i].child, a[i].folio, 0, - cap_page, OBJECT_POLICY_DEFAULT, 0, &a[i].page); + cap = folio_object_alloc (a[i].child, a[i].folio, 0, + cap_page, OBJECT_POLICY_DEFAULT, 0); + a[i].page = cap_to_object (activity, &cap); assert (object_type (a[i].page) == cap_page); } diff --git a/viengoos/t-as.c b/viengoos/t-as.c index bb209ff..ee1a7b1 100644 --- a/viengoos/t-as.c +++ b/viengoos/t-as.c @@ -25,12 +25,10 @@ allocate_object (enum cap_type type, addr_t addr) object = 0; } - struct object *o; - folio_object_alloc (root_activity, folio, object ++, - type, OBJECT_POLICY_DEFAULT, 0, &o); - struct as_insert_rt rt; - rt.cap = object_to_cap (o); + rt.cap = folio_object_alloc (root_activity, folio, object ++, + type, OBJECT_POLICY_DEFAULT, 0); + /* We don't need to set RT.STORAGE as as_insert doesn't require it for the internal interface implementations. */ rt.storage = ADDR (0, 0); |