diff options
author | marcus <marcus> | 2004-11-01 20:54:00 +0000 |
---|---|---|
committer | marcus <marcus> | 2004-11-01 20:54:00 +0000 |
commit | 0236bd7cec6b4bb677b17ca7719ae9703b4d63e4 (patch) | |
tree | 309ad09e8c6753fd6994008625ae1bc688e6abc4 /libhurd-cap-server/class-init.c | |
parent | 63c60b12a8ac44e279f7223844909d22db9f88e1 (diff) |
libhurd-cap-server/
2004-11-01 Marcus Brinkmann <marcus@gnu.org>
* cap-server.h (hurd_cap_class_create): Rename to ...
(hurd_cap_class_create_untyped): ... this.
(hurd_cap_class_create): New macro.
(hurd_cap_class_init): Rename to ...
(hurd_cap_class_init_untyped): ... this.
(hurd_cap_class_init): New macro.
(hurd_cap_get_obj_size): New inline function.
(hurd_cap_obj_to_user_untyped, hurd_cap_obj_from_user_untyped):
New inline function.
(hurd_cap_obj_to_user, hurd_cap_obj_from_user): New macro.
* class-alloc.c (hurd_cap_class_alloc): New variable NEW_OBJ, use
it as a temporary placeholder.
* class-create.c (hurd_cap_class_create): Rename to ...
(hurd_cap_class_create_untyped): ... this.
Use hurd_cap_class_init_untyped.
* class-init.c (hurd_cap_class_init): Rename to ...
(hurd_cap_class_init_untyped): ... this.
Add the size of struct hurd_cap_obj to SIZE.
* client-create.c (_hurd_cap_client_alloc): New variable
NEW_CLIENT, use it as a temporary placeholder.
* obj-copy-out.c (_hurd_cap_obj_copy_out): New variable NEW_ENTRY,
use it as a temporary placeholder.
physmem/
2004-11-01 Marcus Brinkmann <marcus@gnu.org>
* container.c (struct container, container_t): Remove member OBJ.
Move struct and typedef to ...
* physmem.h (struct container, container_t): ... here.
(container_alloc): Change type of last argument in prototype to a
pointer to a container_t.
* container.c (container_reinit, container_map): Use
hurd_cap_obj_to_user instead cast.
(container_class_init): Provide type instead size and alignment.
(container_alloc): Add new variable OBJ and use hurd_cap_obj_to_user.
Change type of last argument to a pointer to container_t.
* physmem.c (create_bootstrap_caps): New variable CONTAINER.
Use hurd_cap_obj_from_user to get at the object.
task/
2004-11-01 Marcus Brinkmann <marcus@gnu.org>
* task.h (struct task): Remove member OBJ.
(task_alloc): Change type of last argument to pointer to task_t.
(task_id_get_task): Use hurd_cap_obj_from_user.
* task.c (create_bootstrap_caps): Remove variable STARTUP_CAP.
Add variable TASK. Use hurd_cap_obj_to_user.
* task-class.c (task_reinit): Use hurd_cap_obj_to_user instead of
cast.
(task_class_init): Use type instead size and alignment.
(task_alloc): Change type of last argument to pointer to task_t.
Add new variable OBJ and use it as a temporary placeholder.
deva/
2004-11-01 Marcus Brinkmann <marcus@gnu.org>
* deva-class.c (struct deva): Remove member obj (and add dummy
member foo).
(deva_reinit): Use hurd_cap_obj_to_user instead of cast.
(deva_class_init): Replace size and alignment with type.
(deva_alloc): New variable OBJ. Use it with hurd_cap_class_alloc.
Use hurd_cap_obj_to_user to get at the deva object.
Diffstat (limited to 'libhurd-cap-server/class-init.c')
-rw-r--r-- | libhurd-cap-server/class-init.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/libhurd-cap-server/class-init.c b/libhurd-cap-server/class-init.c index e4468d3..9c7d185 100644 --- a/libhurd-cap-server/class-init.c +++ b/libhurd-cap-server/class-init.c @@ -87,17 +87,20 @@ _hurd_cap_obj_destructor (void *hook, void *buffer) /* Same as hurd_cap_class_create, but doesn't allocate the storage for CAP_CLASS. Instead, you have to provide it. */ error_t -hurd_cap_class_init (hurd_cap_class_t cap_class, - size_t size, size_t alignment, - hurd_cap_obj_init_t obj_init, - hurd_cap_obj_alloc_t obj_alloc, - hurd_cap_obj_reinit_t obj_reinit, - hurd_cap_obj_destroy_t obj_destroy, - hurd_cap_class_demuxer_t demuxer) +hurd_cap_class_init_untyped (hurd_cap_class_t cap_class, + size_t size, size_t alignment, + hurd_cap_obj_init_t obj_init, + hurd_cap_obj_alloc_t obj_alloc, + hurd_cap_obj_reinit_t obj_reinit, + hurd_cap_obj_destroy_t obj_destroy, + hurd_cap_class_demuxer_t demuxer) { error_t err; - assert (size >= sizeof (struct hurd_cap_obj)); + size += hurd_cap_obj_get_size (alignment); + + /* FIXME: Find the smallest possible alignment common to the user + object and a struct hurd_cap_obj. */ assert (alignment >= __alignof__(struct hurd_cap_obj)); /* Capability object management. */ |