summaryrefslogtreecommitdiff
path: root/physmem/physmem.c
AgeCommit message (Collapse)Author
2008-08-222008-08-22 Neal H. Walfield <neal@gnu.org>neal
* libhurd-cap: Remove. * libhurd-cap-server: Likewise. * physmem: Likewise. * task: Likewise.
2005-06-24physmem/neal
2005-06-24 Neal H. Walfield <neal@gnu.org> * physmem.c (main): Call frame_entry_init and frame_init before calling create_bootstrap_caps. Reported by Matthieu Lemerre <racin@free.fr>.
2005-06-22libhurd-slab/neal
2005-06-22 Neal H. Walfield <neal@gnu.org> * slab.h: Clean up comments. (SLAB_CLASS): New macro. physmem/ 2005-06-22 Neal H. Walfield <neal@gnu.org> * priv.h (frame_entry_init): Declare. (frame_init): Declare. * physmem.c (main): Call frame_entry_init and frame_init. * frame-entry.c: Create a frame_entry slab class. Don't use HURD_SLAB_SPACE_INITIALIZER to initialize frame_entry_space. Do it ... (frame_entry_init): ... here with hurd_frame_entry_slab_init. (frame_entry_constructor): Update argument type given stronger type checking. (frame_entry_alloc): Call hurd_frame_entry_slab_alloc, not hurd_slab_alloc. (frame_entry_free): Call hurd_frame_entry_slab_dealloc, not hurd_slab_dealloc. * frame.c: Create a frame slab class. Don't use HURD_SLAB_SPACE_INITIALIZER to initialize frame_space. Do it ... (frame_init): ... here with hurd_frame_slab_init. (frame_constructor): Update argument type given stronger type checking. (frame_alloc): Call hurd_frame_slab_alloc, not hurd_slab_alloc. (frame_free): Call hurd_frame_slab_dealloc, not hurd_slab_dealloc.
2005-04-062005-04-06 Neal H. Walfield <neal@gnu.org>neal
* physmem.h: Move from here... * priv.h: ...to here. Improve comments. (extract_access): New function. (struct frame): Add lock field. Change type of may_be_mapped field from bool to l4_word_t. (struct frame_entry): Add container, shared_next and shared_prevp fields. (frame_entry_free): Renamed from frame_entry_dealloc. Update callers. (frame_entry_create): Renamed from frame_entry_new. Update callers. (frame_entry_use): Renamed from frame_entry_use_frame. Update callers. (frame_entry_copy): New declaration. (frame_entry_destroy): Renamed from frame_entry_drop. Update callers. (frame_entry_map): New declaration. (frame_entry_deallocate): New declaration. (frame_memory_bind): Assert that FRAME->LOCK is locked. (frame_release): New definition. (container_attach): Renamed from frame_entry_attach. Update callers. (frame_entry_detach): Renamed from frame_entry_detach. Update callers. * frame.c: Don't include "physmem.h". Include "priv.h" and <pthread.h>. (frame_dump): New function. (frame_constructor): Initialize FRAME->LOCK and lock it. (frame_space): It is a space of frame structures, no frame_entry structures. Fix typo. (frame_alloc): Initialize FRAME_MAY_BE_MAPPED. Assert FRAME->LOCK is locked. (frame_deref): When unmapping a frame, assert that FRAME->MEMORY points to memory. Unlock FRAME->LOCK on return. Add sanity checks. (frame_add_user): Assert that FRAME->LOCK is locked. (frame_drop_user): Assert that FRAME->LOCK is locked. Don't drop a reference. * frame-entry.c: Include <string.h> and "zalloc.h". (frame_entry_constructor): New function. (frame_entry_space): Use it. (frame_entry_dump): Don't mark as static. Improve output. Add some sanity checks. (frame_entry_alloc): Assert that FRAME_ENTRY->SHARED_NEXT and FRAME_ENTRY->SHARED_PREVP are correct. (frame_entry_free): Add sanity checks. [!NDEBUG]: Clear memory. (frame_entry_share_with): New function. (frame_entry_create): Assert CONT->LOCK is held. Initialize FRAME_ENTRY->CONTAINER. Initialize share list. (frame_entry_copy): New function. (frame_entry_use): Assert CONT->LOCK and SOURCE->LOCK are held. Set FRAME_ENTRY->CONTAINER. Initialize share list. (frame_entry_destroy): If CONT is NULL, don't try to detach FRAME_ENTRY from a container. Assert CONT->LOCK in CONT is non-NULL and SOURCE->LOCK are held. Correctly update COW count. Only unlock FRAME_ENTRY->LOCK if DO_UNLOCK is true. (frame_entry_attach): Moved to container.c and renamed to container_attach. (frame_entry_detach): Moved to container.c and renamed to container_detach. (frame_entry_map): New function. (frame_entry_deallocate): New function. * container.c: Include <string.h> and "priv.h". (container_dump): New function. (container_attach): Moved from frame-entry.c and renamed from frame_entry_attach. (container_detach): Moved from frame-entry.c and renamed from frame_entry_detach. (container_allocate): Lock CONT->LOCK. Don't check the return value of FRAME_ENTRY_ALLOC for errors: it is guaranteed to succeed. Unlock FE->FRAME->LOCK and CONT->LOCK. (container_deallocate): Lock CONT->LOCK. Refactor iteration. Rewrite body to use frame_entry_deallocate. Return the number of bytes allocated. (container_map): Refactor iteration. Rewrite body to use frame_entry_map. (container_copy): If HURD_PM_CONT_ALL_OR_NONE is set try better to make sure the operation won't fail mid-flight. Lock SFE->FRAME->LOCK. If the copy is a copy on write and the frame has extant write mappings, remove them. (container_ops): Moved to physmem.h. Preface names with hurd_pm_ to reflect presence in the global name space. (container_demuxer): If the invoke method produces returns an error code, emit a debugging message. (container_alloc) [!NDEBUG]: Lock CONT->LOCK. Unlock FE->FRAME->LOCK. (container_init): New function. (container_reinit): Assert CONT->LOCK is held. (container_class_init): Use CONTAINER_INIT. * physmem.h: New file. * headers.m4: New file. * physmem.c: Don't include "physmem.h". Include "priv.h". * ia32-cmain.c: Likewise.
2005-01-11/neal
2005-01-11 Neal H. Walfield <neal@gnu.org> * libhurd-mm: New directory. * Makefile.am (SUBDIRS): Add libhurd-mm. * configure.ac: Add include for libhurd-mm/headers.m4. (AC_CONFIG_FILES): Add libhurd-mm/Makefile. deva/ 2005-01-11 Neal H. Walfield <neal@gnu.org> * Makefile.am (deva_SOURCES): Remove physmem-user.h and physmem-user.c. (deva_LDADD): Add ../libhurd-btree/libhurd-btree.a and ../libhurd-mm/libhurd-mm.a. * ia32-cmain.c: Include <hurd/mm.h>. (pager_tid): New global variable. (cmain): Allocate a thread that the memory management subsystem can use as the pager thread. Call hurd_mm_init. Set the PAGER_TID as the current thread's pager. * mmap.c: Rewrite to use new interfaces. * physmem-user.h: Remove obsolete file. * physmem-user.c: Likewise. libhurd-mm/ 2005-01-11 Neal H. Walfield <neal@gnu.org> * Makefile.am: Initial check in. * README: Likewise. * frame.c: Likewise. * headers.m4: Likewise. * map.c: Likewise. * mm-init.c: Likewise. * mm.h: Likewise. * pager.c: Likewise. * physmem-user.c: Likewise. * physmem-user.h: Likewise. * priv.h: Likewise. * vm.c: Likewise. * vm.h: Likewise. physmem/ 2005-01-11 Neal H. Walfield <neal@gnu.org> * Makefile.am (physmem_SOURCES): Add frame-entry.c and frame.c (physmem_LDADD): Add ../libhurd-btree/libhurd-btree.a. * frame-entry.c: New file. * frame.c: New file. * README: Rewrite. * container.c: Likewise. * physmem.h: Likewise. * physmem.c (create_bootstrap_caps): Change container_t to struct container *. task/ 2005-01-11 Neal H. Walfield <neal@gnu.org> * Makefile.am (task_SOURCES): Remove physmem-user.h and physmem-user.c. (task_LDADD): Add ../libhurd-btree/libhurd-btree.a and ../libhurd-mm/libhurd-mm.a. * ia32-cmain.c: Include <hurd/mm.h>. (pager_tid): New global variable. (cmain): Allocate a thread that the memory management subsystem can use as the pager thread. Call hurd_mm_init. Set the PAGER_TID as the current thread's pager. * mmap.c: Rewrite to use new interfaces. * physmem-user.h: Remove obsolete file. * physmem-user.c: Likewise. wortel/ 2005-01-11 Neal H. Walfield <neal@gnu.org> * startup.c (physmem_map): Rename . . . (allocate): . . . to this. Rewrite it. (map): New function. (cmain): Call map, not physmem_map. * wortel.c (setup_components): Allocate an extra thread for the task server. (start_elf): Update assert.
2004-11-17deva/neal
2004-11-17 Neal H. Walfield <neal@gnu.org> * output.h (debug): Include program_name and __FUNCTION__ in output. laden/ 2004-11-17 Neal H. Walfield <neal@gnu.org> * output.h (debug): Include program_name and __FUNCTION__ in output. physmem/ 2004-11-17 Neal H. Walfield <neal@gnu.org> * output.h (debug): Include program_name and __FUNCTION__ in output. * physmem.c (create_bootstrap_caps): First argument to debug must be a constant format string. task/ 2004-11-17 Neal H. Walfield <neal@gnu.org> * output.h (debug): Include program_name and __FUNCTION__ in output. wortel/ 2004-11-17 Neal H. Walfield <neal@gnu.org> * output.h (debug): Include program_name and __FUNCTION__ in output.
2004-11-01libhurd-cap-server/marcus
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.
2004-11-012004-11-01 Marcus Brinkmann <marcus@gnu.org>marcus
* container.c: Include "zalloc.h". * physmem.c (create_bootstrap_caps): Remove unused variables STARTUP_CAP, NR_FPAGES, FPAGES.
2004-10-282004-10-28 Marcus Brinkmann <marcus@gnu.org>marcus
* deva: New directory. * configure.ac (AC_CONFIG_FILES): Add deva/Makefile. * Makefile.am (SUBDIRS): Add deva. deva/ 2004-10-28 Marcus Brinkmann <marcus@gnu.org> * Initial check-in. physmem/ 2004-10-28 Marcus Brinkmann <marcus@gnu.org> * physmem.c (get_task_cap): Removed. (bootstrap_final): New function. (main): Call bootstrap_final, not get_task_cap. task/ 2004-10-28 Marcus Brinkmann <marcus@gnu.org> * task.c (bootstrap_final): New function. (main): Call bootstrap_final. wortel/ 2004-10-28 Marcus Brinkmann <marcus@gnu.org> * wortel.h: Include <stdbool.h>. (WORTEL_MSG_GET_TASK_CAP): Renamed into WORTEL_MSG_BOOTSTRAP_FINAL. (WORTEL_MSG_GET_DEVA_CAP_REQUEST, WORTEL_MSG_GET_DEVA_CAP_REPLY): Define new macros. (wortel_get_deva_cap_request, wortel_get_deva_cap_reply, wortel_bootstrap_final): New functions. (wortel_get_task_cap): Removed. * wortel.c (start_elf, start_deva): New functions. (start_task): Bunch of it is now in start_elf. (serve_bootstrap_requests): Handle WORTEL_MSG_BOOTSTRAP_FINAL, not WORTEL_MSG_GET_TASK_CAP. Implement support for starting deva. Implement WORTEL_MSG_GET_DEVA_CAP_REQUEST and WORTEL_MSG_GET_DEVA_CAP_REPLY. * wortel-intern.h (struct wortel_module): New member deva.
2004-10-27Clarify comment.marcus
2004-10-252004-10-25 Marcus Brinkmann <marcus@gnu.org>marcus
* physmem.c (physmem_server): Call hurd_cap_bucket_worker_alloc.
2004-07-162004-07-16 Bas Wijnen <b.wijnen@phys.rug.nl>marco_g
* physmem.c (physmem_server): Added missing parameter.
2004-04-262004-04-26 Marcus Brinkmann <marcus@gnu.org>marcus
* physmem.c: Include <hurd/wortel.h>. (wortel_thread_id, wortel_cap_id): New variables. (get_all_memory): Rewritten using wortel interface. (create_bootstrap_caps): Likewise. (get_threads): Likewise. (get_task_cap): Likewise. (main): Initialize wortel_thread_id. * output.c (shutdown): Include <hurd/wortel.h>. (shutdown): Rewritten using wortel interface. (putchar): Rewritten using wortel interface.
2004-04-11physmem/marcus
2004-04-11 Marcus Brinkmann <marcus@gnu.org> * physmem.c (get_task_cap): New function. (main): Call get_task_cap. wortel/ 2004-04-11 Marcus Brinkmann <marcus@gnu.org> * Makefile.am (wortel_SOURCES): Add startup-bin.S. (noinst_PROGRAMS): Add startup. (STARTUP_ARCH_SOURCES): New variable. (startup_CPPFLAGS, startup_SOURCES, startup_LDFLAGS) (startup_LDADD): New variables. * startup-bin.S, ia32-startup.S, startup.c: New files. * wortel.c (startup_bin_start, startup_bin_end): New declarations. (STARTUP_LOAD_ADDR): New macro. (start_task): New function. (WORTEL_MSG_GET_TASK_CAP): New macro. (serve_bootstrap_requests): Implement the first half of the WORTEL_MSG_GET_TASK_CAP RPC.
2004-04-10wortel/marcus
2004-04-10 Marcus Brinkmann <marcus@gnu.org> * wortel.h (struct wortel_module): New member task_id. (enum wortel_module_type): New modules MOD_DEVA and MOD_DEVA_STORE. (MOD_IS_TASK): New macro. * wortel.c: Include <assert.h>, <l4/thread-start.h> and <l4/pagefault.h> Throughout the whole file, use map items instead of grant items, use L4_FPAGE_SPAN_MAX instead MAX_FPAGES, and use l4_fpage_span instead make_fpages. (mod_names): Add names for MOD_DEVA and MOD_DEVA_STORE. (MAX_FPAGES): Removed. (make_fpages): Removed. (start_components): Split up into ... (setup_components): ... this new function ... (start_physmem): ... and this. (serve_bootstrap_requests): Rewrite the container creation. (main): Call setup_components and start_physmem instead start_components. physmem/ 2004-04-09 Marcus Brinkmann <marcus@gnu.org> * container.c: Revert last change. * physmem.h: Revert last change. * physmem.c (MAX_FPAGES): Removed macro. (create_bootstrap_caps): Use L4_FPAGE_SPAN_MAX, not MAX_FPAGES. Update bootstrap cap code to new wortel interface (essentially reverting the last change).
2004-04-09wortel/marcus
2004-04-09 Marcus Brinkmann <marcus@gnu.org> * wortel.c (serve_bootstrap_requests): Replace start and end in the WORTEL_MSG_GET_CAP_REQUEST reply with startup. (physmem_master): Change type to hurd_cap_handle_t. (hurd_task_id_t): Remove typedef. (HURD_TASK_ID_NULL): Remove macro. physmem/ 2004-04-09 Marcus Brinkmann <marcus@gnu.org> * physmem.h: Include <stdbool.h>. * container.c (struct container): Add member mapped. (container_alloc): Add new argument mapped. Initialize CONTAINER->mapped.
2004-04-092004-04-09 Marcus Brinkmann <marcus@gnu.org>marcus
* Makefile.am (physmem_LDADD): Add ../libhurd-cap-server/libhurd-cap-server.a and ../libhurd-slab/libhurd-slab.a. (physmem_SOURCES): Add container.c. * container.c: New file. * physmem.h: Include <hurd/cap-server.h> and <errno.h>. (container_class_init, container_alloc): New prototypes. * physmem.c (create_bootstrap_caps): Take new argument bucket. Create container capabilities and inject them into the bucket. (getpagesize): New temporary helper function. (physmem_server): New function. (main): New variable BUCKET. Create capability bucket. Pass BUCKET to create_bootstrap_caps. New variable MANAGER. Create manager thread.
2004-04-06Fix off by one error in last change.marcus
2004-04-062004-04-06 Marcus Brinkmann <marcus@gnu.org>marcus
* physmem.c (setup_threads): Add threads to pool after creating main thread. Don't overwrite server_thread with an incorrect value at the end.
2004-03-19libl4/marcus
2004-03-19 Marcus Brinkmann <marcus@gnu.org> * l4/gnu/ipc.h (L4_string_items_acceptor): Rename to ... (L4_STRING_ITEMS_ACCEPTOR): ... this. (L4_untyped_words_acceptor): Rename to ... (L4_UNTYPED_WORDS_ACCEPTOR): ... this. wortel/ 2004-03-19 Marcus Brinkmann <marcus@gnu.org> * wortel.c (WORTEL_MSG_GET_THREADS): New. (serve_bootstrap_requests): Implement it. physmem/ 2004-03-19 Marcus Brinkmann <marcus@gnu.org> * physmem.c (WORTEL_MSG_GET_THREADS): New macro. (setup_threads): Request number of extra threads from wortel. Add them to the pool.
2004-03-192004-03-19 Marcus Brinkmann <marcus@gnu.org>marcus
* output.h (shutdown): Add noreturn attribute to prototype. * output.c (shutdown): Add noreturn attribute. Sleep forever. * config.m4 (HURD_LOAD_ADDRESS): Change load address to 0x400000. * physmem.c: Include pthread.h. (setup_threads): New function. (main): New variable SERVER_THREAD. Call setup_threads. (exit, abort): New functions. * physmem.h (switch_thread): Add prototype. * ia32-cmain.c (switch_thread): New function. (__thread_stack_pointer): New macro. (__thread_set_stack_pointer): New macro. * Makefile.am (physmem_LDADD): Add ../libpthread/libpthread.a and ../libhurd-ihash/libhurd-ihash.a.
2004-03-162004-03-16 Marcus Brinkmann <marcus@gnu.org>marcus
* output.c (putchar): Replace all &msg with msg. Update everything to new API. * physmem.c: Likewise.
2003-10-162003-10-16 Marcus Brinkmann <marcus@gnu.org>marcus
* output.c (shutdown): New function. * physmem.c: Include <stdlib.h>. (get_all_memory): Update to match new wortel interface. (create_bootstrap_caps): New function. (main): Call create_bootstrap_caps.
2003-09-192003-09-19 Marcus Brinkmann <marcus@gnu.org>marcus
* physmem.c: Include "zalloc.h". * zalloc.c: Include <string.h>, not <strings.h>. (add_block): Add missing return type. (zalloc_dump_zones): Use %p for pointer.
2003-09-17Use different UTCB for physmem (to where wortel is, so physmem can take allmarcus
the physmem, probably do more safety checks here). Fix fpages creation algorithm to use self-aligned pages. physmem's zalloc now almost works (still a bug somewhere).
2003-09-17Add more bootstrap code, and Neal's zalloc.marcus
2003-09-16Add some more bootstrap code, that will eventually lead to physmemmarcus
requesting its memory from wortel. Doesn't work yet, maybe a sigma0 bug.
2003-09-09Add a simple demonstration server physmem (not a real physical memorymarcus
server at all), and support in wortel to create a new task from it and start it.