summaryrefslogtreecommitdiff
path: root/libhurd-mm/anonymous.c
AgeCommit message (Collapse)Author
2008-06-222008-06-22 Neal H. Walfield <neal@gnu.org>neal
* anonymous.c (mdestroy) [! NDEBUG]: Don't void capability slots, we destroy the associated objects, which does that.
2008-06-202008-06-20 Neal H. Walfield <neal@gnu.org>neal
* anonymous.c (fault): When copying the storage in place, pass ANON->ACTIVITY, not META_DATA_ACTIVITY, to cap_copy_x.
2008-06-202008-06-20 Neal H. Walfield <neal@gnu.org>neal
* anonymous.c (mdestroy): Optimize storage destruction when MAP is the last reference. (destroy): Assert that PAGER has no allocated storage.
2008-06-182008-06-18 Neal H. Walfield <neal@gnu.org>neal
* anonymous.c (offset_compare): When calculating A_END, subtract one from A[1]. When calculating B_END, subtract one from B[1]. (mdestroy): Correctly calculate the bounds. Detach the node from the tree.
2008-06-182008-06-18 Neal H. Walfield <neal@gnu.org>neal
* mmap.c (mmap): If MAP_FIXED is specified, first unmap the region. (mmap): Don't panic if we fail to create a pager, just return MAP_FAILED. * map.h (map_destroy_t): New define. (struct map): Add field destroy. (map_create): Take additional argument destroy. * map.c (map_create): Take additional argument destroy. Set MAP->DESTROY to it. (map_destroy): Call MAP->DESTROY. If MAP->PAGER->NO_REFS is NULL, unlock MAP->PAGER->LOCK. * anonymous.c (offset_compare): Support comparing ranges. (mdestroy): New function. (destroy): Don't free ANON->MAP_AREA. (anonymous_pager_alloc): Pass mdestroy to map_create. * mprotect.c: New file. * Makefile.am (libhurd_mm_a_SOURCES): Add mprotect.c.
2008-06-172008-06-17 Neal H. Walfield <neal@gnu.org>neal
* anonymous.c (fault): Assert that calling rm_object_discarded_clear does not fail.
2008-06-16libhurd-mm/neal
2008-06-16 Neal H. Walfield <neal@gnu.org> * map.h: New file. * map.c: New file. * Makefile.am (libhurd_mm_a_SOURCES): Add map.h and map.c. * headers.m4: Link map.h to sysroot/include/hurd/map.h. * pager.h: Rewrite. * pager.c: Likewise. * anonymous.h (ANONYMOUS_STAGING_AREA): New define. (anonymous_pager_fill_t): Don't pass the base of the region. Pass the location of the storage corresponding to the pages on which the faults were raised and the offset into the region. Update users. (struct anonymous_pager): Add fields map_area, map_area_count and lock. Remove field alloced_region. (anonymous_pager_alloc): Replace size parameter with length parameter. Take access parameter indicating the desired access. Update users. * anonymous.c (offset_compare): Compare the values, not the pointers. (fault): Update signature to be consistent with new API. Lock ANON->LOCK. Always look up the storage descriptor corresponding to the faulted page. Copy the storage to the faulted address as required. Update how we call ANON->FILL to be consistent with the new API. (destroy): Free ANON->STAGING_AREA. (anonymous_pager_alloc): Update signature to be consistent with new API. Allocate the staging area if ANONYMOUS_STAGING_AREA is set. Allocate it separately from the main map. Create a map corresponding to the region. (anonymous_pager_destroy): Just lock ANON->LOCK. Don't call destroy, call pager_deinit. * mmap.c: Include <hurd/map.h>. (mmap): Add support for protection other than read/write. (munmap): Rewrite to use new API. Use map_split to support splitting of memory maps. * exceptions.c: Don't include "pager.h", include "map.h". (exception_handler_normal): Don't call pager_fault but map_fault. (exception_handler_activated): Likewise. ruth/ 2008-06-16 Neal H. Walfield <neal@gnu.org> * ruth.c (main): Improve mmap test. Update use of anonymous_pager_alloc to be consistent with new API. Update fill functions to be consistent with new API. Remove redundant test. benchmarks/ 2008-06-16 Neal H. Walfield <neal@gnu.org> * activity-distribution.c (main): Update use of anonymous_pager_alloc to be consistent with new API. Update fill functions to be consistent with new API.
2008-06-142008-06-14 Neal H. Walfield <neal@gnu.org>neal
* anonymous.c (anonymous_pager_alloc): If allocating a specific address fails, really fail.
2008-06-05viengoos/neal
2008-06-05 Neal H. Walfield <neal@gnu.org> * cap-lookup.c: Move from here... * ../libhurd-mm/as-lookup.c: ... to here. * as.c: Move from here... * ../libhurd-mm/as-build.c: ... to here. * as-custom.c: Move from here... * ../libhurd-mm/as-build-custom.c: ... to here. * as.h: Move contents... * ../libhurd-mm/as.h: ... to here... * ../libhurd-mm/as-compute-gbits.h: ... and to here. * bits.h: Move from here... * ../libhurd-mm/bits.h: ... to here. * Makefile.am (viengoos_SOURCES): Remove cap-lookup.c, as.h and as.c. (t_as_SOURCES): Likewise. (t_activity_SOURCES): Likewise. (viengoos_LDADD): Add ../libhurd-mm/libas-kernel.a. (t_as_LDADD): Add ../libhurd-mm/libas-check.a. (t_activity_LDADD): Likewise. (lib_LIBRARIES): Remove libhurd-cap.a. (libhurd_cap_a_CPPFLAGS): Remove variable. (libhurd_cap_a_CFLAGS): Likewise. (libhurd_cap_a_SOURCES): Likewise. * server.c (server_loop): Replace use of object_lookup_rel with as_object_lookup_rel. Replace use of slot_lookup_rel with as_slot_lookup_rel_use. Replace use of cap_lookup_rel with as_cap_lookup_rel. * viengoos.c: Don't include "as.h", include <hurd/as.h>. * t-activity.c: Don't include "as.h", include <hurd/as.h>. (allocate_object): Change return type to struct as_allocate_pt_ret. * t-as.c: Don't include "as.h", include <hurd/as.h>. (allocate_object): Change return type to struct as_allocate_pt_ret. (allocate_page_table): New function. (try): Replace use of as_insert with as_insert_full. Replace use of slot_lookup_rel with as_slot_lookup_rel_use. Replace use of object_lookup_rel with as_object_lookup_rel. (test): Likewise. * t-guard.c: Don't include "as.h", include <hurd/as.h>. Include "../libhurd-mm/as-compute-gbits.h". libhurd-mm/ 2008-06-05 Neal H. Walfield <neal@gnu.org> * as.h: Include <hurd/exceptions.h>. [! RM_INTERN]: Include <hurd/storage.h> and <pthread.h>. (as_lock_ensure_stack) [! RM_INTERN]: New function. (as_lock): New function. (as_lock_readonly): Likewise. (as_unlock): Likewise. (meta_data_activity) [RM_INTERN]: Don't declare. (shadow_root) [RM_INTERN]: Don't declare. (struct as_insert_rt): Rename from this... (struct as_allocate_pt_ret): ... to this. Update users. (as_allocate_page_table_t): New typedef. (as_allocate_page_table): New declaration. (as_build): New declaration. (as_build_custom): Likewise. (as_slot_ensure): Remove declaration. (as_ensure_full): New macro. (as_ensure_use) [! RM_INTERN]: Likewise. (as_ensure) [! RM_INTERN]: New function. (as_insert): Rename from this... (as_insert_full): ... to this. Don't return the capability. Reverse the order of the source address and cap. Replace allocate_object parameter with an allocate_page_table parameter. Update users. (as_insert) [! RM_INTERN]: New function. (as_slot_ensure_full_custom): Rename from this... (as_ensure_full_custom): ... to this. Replace allocate_object parameter with an allocate_page_table parameter. (as_insert_custom): Likewise. (union as_lookup_ret): New definition. (as_lookup_want_cap): New definition. (as_lookup_want_slot): Likewise. (as_lookup_want_object): Likewise. (as_lookup_rel): New declaration. (slot_lookup): Remove declaration. (as_slot_lookup_rel_use): Replace it with this macro. (as_slot_lookup_use) [! RM_INTERN]: New macro. (as_cap_lookup_rel): New function. (cap_lookup): Rename from this... (as_cap_lookup) [! RM_INTERN]: ... to this. Remove activity parameter. Implement here as a static inline function. (as_object_lookup_rel): New function. (object_lookup): Rename from this... (as_object_lookup) [! RM_INTERN]: ... to this. Remove activity parameter. Implement here as a static inline function. (as_dump_from): New declaration. * as-compute-gbits.h: Include <hurd/folio.h>. * as.c (allocate_object): Rename from this... (as_allocate_page_table): ... to this. Remove static qualifier. Don't take parameter type, just allocate a cap_cappage. (as_slot_ensure): Remove function. (as_init): Replace use of slot_lookup_rel with as_slot_lookup_use or as_cap_lookup as appropriate. (cap_lookup): Remove function. (object_lookup): Likewise. (slot_lookup): Likewise. (as_dump): Likewise. * as-build.c: Don't include "as.h", but <hurd/as.h>. Include <hurd/rm.h>, "as-compute-gbits.h". [RM_INTERN]: Don't include "object.h" but "../viengoos/object.h". (CUSTOM) [ID_SUFFIX]: Define. (as_build_internal): Rename from this... (as_build): ... to this. Remove static qualifier. Replace parameter allocate_object with allocate_page_table. Use it instead. (as_slot_ensure_full): Remove function. (as_insert): Likewise. * as-build-custom.c (as_object_index_t): Remove definition. (AS_LOCK): Don't define. (AS_UNLOCK): Don't define. (as_ensure_full_custom): New function. (as_insert_custom): Likewise. * as-lookup.c: Include <hurd/as.h>. [RM_INTERN]: Don't include "object.h" but "../viengoos/object.h". [! RM_INTERN]: Include <pthread.h>. (as_lock) [! RM_INTERN]: Rename from this... (as_rwlock) [! RM_INTERN]: ... to this. (ensure_stack) [! RM_INTERN]: Remove function. (AS_LOCK): Don't define. (AS_UNLOCK): Don't define. (lookup): Rename from this... (as_lookup_rel): ... to this. Change mode's type to an enum as_lookup_mode. Change rt's type to a union as_lookup_ret. Don't use want_object but as_lookup_want_object. Don't use want_slot but as_lookup_want_slot. Don't use want_cap but as_lookup_want_cap. (cap_lookup_rel): Remove function. (object_lookup_rel): Likewise. (slot_lookup_rel): Likewise. (print_nr): Move from here... * as-lookup.c (do_walk): Move from here... * as-dump.c (do_walk): ... to here. * as-lookup.c (as_dump_from): Move from here... * as-dump.c (as_dump_from): ... to here. * Makefile.am (lib_LIBRARIES) [ENABLE_TESTS]: Set to libas-check.a (lib_LIBRARIES) [! ENABLE_TESTS]: Add libas-kernel.a. (libhurd_mm_a_SOURCES): Add bits., as-build.c as-build-custom.c, as-lookup.c and as-dump.c. (libas_kernel_a_CPPFLAGS): New variable. (libas_kernel_a_CCASFLAGS): New variable. (libas_kernel_a_CFLAGS): New variable. (libas_kernel_a_SOURCES): New variable. (libas_check_a_CPPFLAGS): New variable. (libas_check_a_CCASFLAGS): New variable. (libas_check_a_CFLAGS): New variable. (libas_check_a_SOURCES): New variable. * anonymous.c (fault): Replace use of as_slot_ensure with as_ensure. * exceptions.c (exception_handler_init): Replace use of as_slot_ensure with as_ensure. * storage.c (storage_check_reserve_internal): Replace use of as_lock with as_rwlock. Replace use of as_slot_ensure with and slot_lookup with as_ensure and as_slot_lookup_use. (storage_alloc): Replace use of slot_lookup with as_slot_lookup_use. hurd/ 2008-06-05 Neal H. Walfield <neal@gnu.org> * cap.h: Don't include <pthread.h>. (as_lock): Remove declaration. (cap_lookup_rel): Likewise. (object_lookup_rel): Likewise. (slot_lookup_rel): Likewise. / 2008-06-05 Neal H. Walfield <neal@gnu.org> * libc.a.in: Remove -lhurd-cap. * Makefile.am (libc-stmp): Remove dependency on viengoos/libhurd-cap.a. 2008-06-05 Neal H. Walfield <neal@gnu.org> * process-spawn.c (as_insert_custom): Replace use of as_insert with as_insert_full. (allocate_object): Change return type to struct as_allocate_pt_ret. Replace use of as_slot_ensure with as_ensure_use. (allocate_page_table): New function. (process_spawn): Update use of as_insert_custom to be consistent with new API, in particular, pass allocate_page_table instead of allocate_object. Replace use of object_lookup_rel with as_object_lookup_rel. libpthread/ 2008-06-05 Neal H. Walfield <neal@gnu.org> * sysdeps/l4/hurd/pt-thread-alloc.c (__pthread_thread_alloc): Replace use of as_slot_ensure with as_ensure. ruth/ 2008-06-05 Neal H. Walfield <neal@gnu.org> * ruth.c (main): Replace use of slot_lookup with as_cap_lookup. Replace use of as_slot_ensure with as_ensure_use. Replace use of slot_lookup with as_slot_lookup_use.
2008-02-20libhurd-mm/neal
2008-02-20 Neal H. Walfield <neal@gnu.org> * anonymous.h: Include <hurd/exceptions.h> and <l4/thread.h>. (ANONYMOUS_ZEROFILL): Rename from this... (ANONYMOUS_NO_CLEAR): ... to this, inverting logic. Update users. (ANONYMOUS_DISCARDABLE): Don't define. (ANONYMOUS_NO_ALLOC): Define. (ANONYMOUS_NO_RECURSIVE): Likewise. (ANONYMOUS_THREAD_SAFE): Likewise. (anonymous_pager_fill_t): Likewise. (struct anonymous_pager): Add fields allocated_region, staging_area, fill, fill_thread, fill_lock and policy. Change fill's type to anonymous_pager_fill_t. (anonymous_pager_alloc): Take additional parameters, P and ADDR_OUT. Change the fill function's type to anonymous_pager_fill_t. Require that the address is not already allocated. Update users. * anonymous.c: Include <string.h> and <hurd/rm.h>. (struct storage_desc): Remove field addr and replace with offset. (addr_compare): Remove function. (offset_compare): New function. (storage_desc): Change node key from the addr field to the offset field. (fault): Rewrite to handle a fill function, discarded pages, and the ANONYMOUS_NO_RECURSIVE and ANONYMOUS_NO_ALLOC flags. (destroy): Free the allocated region and any staging area. (anonymous_pager_alloc): Rewrite to allocate virtual memory. Set up the data structure appropriately if ANONYMOUS_THREAD_SAFE is given. * pager.h (PAGER_REGION_LENGTH): New define. (pager_fault_t): Change ABI such that the callback must release PAGER->LOCK. * pager.c (pager_fault): Don't release PAGER->LOCK. ruth/ 2008-02-20 Neal H. Walfield <neal@gnu.org> * ruth.c: Include <hurd/anonymous.h>, <stdlib.h> and <l4.h>. (main): Add tests to check rendered regions and discardable pages.
2008-02-15libhurd-btree/neal
2008-02-15 Neal H. Walfield <neal@gnu.org> * btree.h (BTREE_(insert)) [!NDEBUG]: Assert that the node pointers are clear. * btree.c (BTREE_(detach)) [!NDEBUG]: Clear ROOT. * btree-test.c (main): Clear allocated nodes. libhurd-mm/ 2008-02-15 Neal H. Walfield <neal@gnu.org> * anonymous.c (destroy) [!NDEBUG]: Clear NODE before freeing it.
2008-02-13libhurd-mm/neal
2008-02-13 Neal H. Walfield <neal@gnu.org> * storage.h (storage_alloc): Take additional parameter policy. Update callers. * storage.c (storage_alloc): Take additional parameter policy. Use it when allocating the object and updating the shadow capability slots. libpthread/ 2008-02-13 Neal H. Walfield <neal@gnu.org> * sysdeps/l4/hurd/pt-thread-alloc.c (__pthread_thread_alloc): Update use of storage_alloc to be consistent with new API. newlib/ 2008-02-13 Neal H. Walfield <neal@gnu.org> * addon/newlib/libc/sys/hurd/getreent.c (slab_alloc): Update use of storage_alloc to be consistent with new API. ruth/ 2008-02-13 Neal H. Walfield <neal@gnu.org> * ruth.c (main): Update use of storage_alloc to be consistent with new API.
2007-12-17libhurd-mm/neal
2007-12-17 Neal H. Walfield <neal@gnu.org> * anonymous.c: Update BTREE_CLASS use to reflect API changes. * as.c: Likewise. * capalloc.c: Likewise. * pager.h: Likewise. * storage.c: Likewise. viengoos/ 2007-12-17 Neal H. Walfield <neal@gnu.org> * memory.c: Update BTREE_CLASS use to reflect API changes.
2007-12-122007-12-12 Neal H. Walfield <neal@gnu.org>neal
* mmap.c (munmap): Implement. * pager.h (pager_destroy_t): New type. (struct pager): New field, destory. (pagers): New declaration. * pager.c (pagers): Remove static qualifier. * anonymous.c (destroy): New function. (anonymous_pager_alloc): Set ANON->PAGER.DESTROY to it. (anonymous_pager_destroy): Call destroy to do the bulk of the work.
2007-12-102007-12-10 Neal H. Walfield <neal@gnu.org>neal
* as.c: Don't include <pthread.h>. Include <hurd/mutex.h>. (free_spaces_lock): Make an ss_mutex_t, not a pthread_mutex_t. Update users. * storage.c: Don't include <pthread.h>. Include <hurd/mutex.h>. (struct storage_desc): Make lock an ss_mutex_t, not a pthread_mutex_t. Update users. (storage_descs_lock): Likewise. * pager.h: Don't include <pthread.h>. Include <hurd/mutex.h>. (struct pager): Make lock an ss_mutex_t, not a pthread_mutex_t. Update users. (pagers_lock): Likewise.
2007-11-272007-11-27 Neal H. Walfield <neal@gnu.org>neal
* as.c: Include <pthread.h>. Remove dead code. (free_spaces_lock): New variable. (free_space_split): Assert that it is held. (as_alloc): Make thread-safe. (as_alloc_at): Likewise. (as_free): Likewise. (as_alloced_dump): Likewise. * storage.c: Include <pthread.h> and <atomic.h>. (free_count): Make a uatomic32_t, rather than an int. Update users to access it using atomic operations. (struct storage_desc): New field, lock. (storage_descs_lock): New global variable. (link): Assert that STORAGE_DESCS_LOCK is held. (unlink): Likewise. Don't assert that E->NEXT is NULL, which is valid. (slab_space_reserve): Make an atomicptr_t, rather than a void *. Update users to access it using atomic operations. (check_slab_space_reserve): Rewrite function to be thread-safe. (storage_desc_free): Assert that STORAGE_DESCS_LOCK is held. (storage_alloc): Rewrite function to be thread-safe. (storage_free): Likewise. (storage_init): Take STORAGE_DESCS_LOCK. Initialize SDESC->LOCK. * capalloc.c: Include <pthread.h>. (struct cappage_desc): New field, lock. (unlink): Don't assert E->NEXT. (cappage_descs_lock): New variable. (capalloc): Make thread safe. (capfree): Likewise. * pager.h: Include <pthread.h>. (pager_fault_t): Note that PAGER->LOCK will be held. (struct pager): New field, lock. (pagers_lock): New declaration. (pager_install): Note locking requirements. (pager_relocate): Likewise. (pager_deinstall): Likewise. * pager.c (pagers_lock): New definition. (pager_install): Add asserts. (pager_relocate): Likewise. (pager_deinstall): Likewise. (pager_fault): Likewise. Make function thread-safe. * anonymous.c (struct storage_desc): Add comment about locking. (fault): Add assert. (anonymous_pager_alloc): Take PAGERS_LOCK before calling pager_install and drop it afterwards. (anonymous_pager_destroy): Take PAGERS_LOCK before calling pager_deinstall and drop it afterwards. Take ANON->PAGER.LOCK.
2007-11-22libhurd-mm/neal
2007-11-22 Neal H. Walfield <neal@gnu.org> * storage.h (struct storage): New struct. (storage_alloc): Return a struct storage, not an addr. Update all callers. * storage.c (struct storage_desc): Remove field shadow. Add field cap. (shadow_setup): Save the cap. (storage_alloc): Return a struct storage, not an addr. (storage_free): Correctly free the shadow if not used. Update STORAGE->CAP to reflect that the folio has been removed. * capalloc.c (struct cappage_desc): Add field cap. (capalloc): Stash CAP. When allocating a cappage, allocate a shadow object. (capfree): Really free CAPPAGE if there is another page available. If freeing CAPPAGE, unlink DESC and update DESC->CAP to reflect that the page has been deallocated, deallocate the shadow, and deallocate CAPPAGE. * exceptions.c (exception_thread): Print IP when a fault cannot be resolved. * mmap.c (mmap): Cast addr to a uintptr_t to elide warning. ruth/ 2007-11-22 Neal H. Walfield <neal@gnu.org> * ruth.c (main): Update uses of stroage_alloc to its new interface.
2007-11-19hurd/neal
2007-11-19 Neal H. Walfield <neal@gnu.org> * Makefile.am (includehurd_HEADERS): Add exceptions.h. * headers.m4: Link $(BUILDIR)/include/hurd/exceptions.h to exceptions.h. * exceptions.h: New file. viengoos/ 2007-11-19 Neal H. Walfield <neal@gnu.org> * thread.h (struct thread): Add fields have_exception and exception. (UTCB_AREA_SIZE): Provide space for two UTCBs. * thread.c: Include <hurd/exceptions.h>. (thread_create_in): For each thread that we allocate, allocate two consecutive l4 thread ids. (thread_commission): Initialize the main thread and the exception thread. (thread_decommission): Destroy both the main thread and the exception thread. * rm.h: Add RM_exception_collect. (rm_method_id_string): Handle RM_exception_collect. (exception_collect): New RPC method. * server.c: Include <hurd/exceptions.h>. (server_loop): If FROM is the exception thread, look up the thread object using the main thread id. Propagate any fault to the exception thread. If not immediately successful, save the message in THREAD->EXCEPTION and set THREAD->HAVE_EXCEPTION. Implement the exception_collect method. (DEBUG): Also print the method number. libhurd-mm/ 2007-11-19 Neal H. Walfield <neal@gnu.org> * Makefile.am (libhurd_mm_a_SOURCES): Add exceptions.h, exceptions.c, pager.h, pager.c, anonymous.h and anonymous.c. * headers.m4: Link $(BUILDDIR)/include/hurd/pager.h to pager.h. Link $(BUILDDIR)/include/hurd/anonymous.h to anonymous.h. * mm-init.c: Include "exceptions.h". (mm_init): Call exception_handler_init. * pager.h: Completely rewrite. * pager.c: Likewise. * anonymous.h: Likewise. * anonymous.c: Likewise. * exceptions.h: New file. * exceptions.c: Likewise. * mmap.c: Include <hurd/anonymous.h>. (mmap): Rewrite to use an anonymous pager.
2005-04-062005-04-06 Neal H. Walfield <neal@gnu.org>neal
* vm.h (hurd_vm_allocate): Remove declaration. (hurd_vm_release): Rename from hurd_vm_deallocate. Update callers. (VM_HERE): Remove. (VM_ZEROFILL): Remove. * vm.c (hurd_vm_allocate): Remove function. (hurd_vm_release): Rename from hurd_vm_deallocate. * mm.h: Include <stdint.h>, <sys/types.h>, <l4/types.h> and <hurd/physmem.h>. (hurd_store_t): New typedef. (hurd_memory_t): Likewise. (hurd_memory_use): New declaration. (hurd_memory_transfer): Likewise. (hurd_store_fault_t): New typedef. (hurd_store_init): New declaration. (hurd_store_size): New declaration. (HURD_VM_HERE): New definition. (hurd_store_bind_to_vm): New declaration. (hurd_store_flush): New declaration. * priv.h: Include "vm.h" and "mm.h". (here): New debugging macro. (struct region): Move to... * mm.h: ...here. (struct hurd_memory): Rename from struct frame. Rename field dc_start to cont_start. Add field cont. Remove field refs. Update users. (memory_slab): Rename from frame_slab. Update users. (memory_alloc_into): Rename from frame_alloc_into. Update users. (frame_alloc): Move to... * priv.h (frame_insert): Move to... * mm.h (hurd_store_cache): ...here. * priv.h (frame_find_first): Move to... * mm.h (hurd_store_find_cached): ...here. * priv.h (frame_map): Move to... * mm.h (hurd_memory_map): ...here. * priv.h (frame_dealloc): Move to... * mm.h (hurd_memory_dealloc): ...here. * priv.h (struct hurd_store): Rename from struct store. Remove fields server and handle. Add fields hook and fault. Rename field frames to memory. Update users. (store_find_free): Remove declaration. (struct map): Add field store_offset. (default_container): Likewise. (map_init): Likewise. (map_free): Rename from map_dealloc. Update callers. (map_init): New declaration. (map_find_first): Rename from map_find. Update callers. (as_find_free): Rename from map_find_free. Update callers. (container_find_free): Remove declaration. (core_slab_allocate_buffer): Rename from mem_slab_allocate_buffer. Update users. (core_slab_deallocate_buffer): Rename from mem_slab_deallocate_buffer. Update users. (frame_spare): Rename to memory_spare. Update users. (core_store): New declaration. * map.c (VIRTUAL_MEMORY_START): Move from here... * priv.h: ...to here. * map.c (as): Move from here... * as.c: ...to here. (map_system_init): Rename from map_init. Reserve the UTCB and the KIP. (memory_spare): Rename from frame_spare. (core_slab_allocate_buffer): Rename from mem_slab_allocate_buffer. (core_slab_deallocate_buffer): Rename from mem_slab_deallocate_buffer. (map_init): New function. (map_free): Rename from map_dealloc. (map_find): Rename from map_find_first. Avoid gratuitous hurd_btree_map_prev. (map_find_free): Remove function. (store_find_free): Move from here... * as.c (as_find_free): ...to here. * frame.c: Move from here... * memory.c: ...to here. Include <hurd/startup.h>. (swap_store): Remove definition. (memory_slab): Rename from frame_slab. (default_container): New static global. (dc_offset): New function. (memory_system_init): Likewise. (memory_alloc_into): Rename from frame_alloc_into. (hurd_memory_new): New function. Refactored from frame_alloc. (hurd_memory_delete): New function. (hurd_memory_alloc): Rename from frame_alloc. Rewritten to use hurd_memory_new. (frame_insert): Move from here... * store.c (hurd_store_cache): ...to here. * memory.c (hurd_memory_use): New function. (hurd_memory_transfer): New function. (hurd_memory_dealloc): Rename from frame_dealloc. Don't deallocate too eagerly: split memory which is only partially deallocated. (frame_find_first): Move from here... * store.c (hurd_store_find_cached): ...to here. * memory.c (hurd_memory_map): Rename from frame_map. Loop mapping all of the requested if a single RPC is insufficient. * mm-init.c (default_container): Remove definition. (hurd_mm_init): Don't initialize DEFAULT_CONTAINER. Don't initialize the store data structures. Call memory_system_init, core_system_init, hurd_anonymous_init, and map_system_init. Use core_allocate rather than hurd_vm_allocate to allocate a stack for the pager thread. * pager.c (pager): Don't round ADDR. Call MAP->STORE->FAULT if the physical memory is not cached. * physmem-user.h: Include <hurd/physmem.h>. Improve documentation. (hurd_pm_control_t): Remove redundant typedef. (hurd_pm_container_t): Likewise. (hurd_pm_container_access_t): Remove typedef. (HURD_PM_CONT_ALLOC_PARTIAL): Remove redundant define. (HURD_PM_CONT_ALLOC_SQUASH): Likewise. (HURD_PM_CONT_ALLOC_EXTRA): Likewise. (HURD_PM_CONT_ALLOC_DMA): Likewise. (hurd_pm_container_share): Change ACCESSS from a hurd_pm_container_access_t * to a hurd_pm_container_t *. (hurd_pm_container_map): Rename parameter rights to flags. Add new parameter AMOUNT. Update callers. * physmem-user.c (container_ops): Remove redundant enumeration. (hurd_pm_container_create): Use hurd_pm_container_create_id as the RPC identifier. (hurd_pm_container_share): Use hurd_pm_container_share_id as the RPC identifier. (hurd_pm_container_allocate): Use hurd_pm_container_allocate_id as the RPC identifier. (hurd_pm_container_deallocate): Use hurd_pm_container_deallocate_id as the RPC identifier. (hurd_pm_container_map): Use hurd_pm_container_map_id as the RPC identifier. If AMOUNTP is non-NULL, return the number of bytes mapped in *AMOUNTP. Remove debugging code. (hurd_pm_container_copy): Use hurd_pm_container_copy_id as the RPC identifier. * anonymous.h: New file. * anonymous.c: New file. * as.c: New file. * core.c: New file. * frame.c: Remove file. * store.c: New file. * Makefile.am (libhurd_mm_a_SOURCES): Add as.c, store.c, memory.c, core.c, anonymous.c and anonymous.h. Remove frame.c. * headers.m4: Install anonymous.h as <hurd/anonymous.h>.