diff options
author | neal <neal> | 2007-11-16 14:18:05 +0000 |
---|---|---|
committer | neal <neal> | 2007-11-16 14:18:05 +0000 |
commit | a4efc641a17b5ea8707c649a01b1985fa77046ea (patch) | |
tree | afb02e6a85015c96102d30b8809edd433420991b /libhurd-mm/mm-init.c | |
parent | e46ff816c662bc8b47dfc00bbe5501dbeffd93bb (diff) |
2007-11-16 Neal H. Walfield <neal@gnu.org>
* Makefile.am (includehurd_HEADERS): Remove vm.h. Add storage.h
and as.h.
(AM_CPPFLAGS): Rename from this...
(COMMON_CPPFLAGS): ... to this.
(libhurd_mm_a_SOURCES): Remove vm.h, vm.c, priv.h, store.c, map.c,
memory.c, pager.c, core.c, anonymous.c, anonymous.h,
physmem-user.h and physmem-user.c. Add capalloc.h, capalloc.c,
storage.h, storage.c, as.h and mmap.c.
* headers.m4: Don't link $(BUILDDIR)/include/hurd/vm.h to vm.h or
$(BUILDDIR)/include/hurd/anonymous.h to anonymous.h. Link
$(BUILDDIR)/include/hurd/as.h to as.h,
$(BUILDDIR)/include/hurd/storage.h to storage.h, and
$(BUILDDIR)/include/hurd/capalloc.h to libhurd-mm/capalloc.h.
* mm-init.c: Rewrite.
* mm.h: Likewise.
* as.c: Likewise.
* as.h: New file.
* capalloc.h: Likewise.
* capalloc.c: Likewise.
* mmap.c: Likewise.
* storage.h: Likewise.
* storage.c: Likewise.
* physmem-user.h: Remove file.
* physmem-user.c: Remove file.
Diffstat (limited to 'libhurd-mm/mm-init.c')
-rw-r--r-- | libhurd-mm/mm-init.c | 71 |
1 files changed, 13 insertions, 58 deletions
diff --git a/libhurd-mm/mm-init.c b/libhurd-mm/mm-init.c index 927cc6b..b23ccb7 100644 --- a/libhurd-mm/mm-init.c +++ b/libhurd-mm/mm-init.c @@ -23,72 +23,27 @@ #include <config.h> #endif -#include <assert.h> -#include <errno.h> -#include <stdbool.h> -#include <l4.h> #include <hurd/startup.h> -#include "anonymous.h" -#include "vm.h" -#include "priv.h" +#include "storage.h" +#include "as.h" -/* Physmem's server thread. */ -l4_thread_id_t physmem; - -/* True once the MM is up and running. */ -int mm_init_done; - -/* Initialized by the machine-specific startup-code. */ extern struct hurd_startup_data *__hurd_startup_data; -/* Initialize the memory management subsystem. */ +addr_t meta_data_activity; + void -hurd_mm_init (l4_thread_id_t pager_tid) +mm_init (addr_t activity) { - error_t err; - uintptr_t stack; - - /* FIXME: The image server may not be (and will likely not be) - physmem. */ - physmem = __hurd_startup_data->image.server; - -#define INIT(service) \ - do \ - { \ - void service##_system_init (void); \ - service##_system_init (); \ - } \ - while (0) - - /* Initialize the core. */ - INIT (memory); - - /* Initialize the system pagers. */ - INIT (core); - INIT (hurd_anonymous); - - /* Initialize the mapping database. */ - INIT (map); - - /* The mapping database is now bootstrapped. */ - mm_init_done = 1; - - /* Allocate a stack for the pager thread. */ - err = core_allocate (&stack, getpagesize (), 0, 1); - if (err) - panic ("Unable to allocate a stack for the pager thread.\n"); + extern int output_debug; - /* Start it up. */ - l4_start_sp_ip (pager_tid, stack + getpagesize (), (l4_word_t) pager); + output_debug = 4; - /* XXX: EVIL. If a thread causes a page fault before its pager is - waiting for faults, the pager will not get the correct message - contents. This is an evil work around to make sure that the - pager is up before we return. */ - int i; - for (i = 0; i < 100; i ++) - l4_yield (); + if (ADDR_IS_VOID (activity)) + meta_data_activity = __hurd_startup_data->activity; + else + meta_data_activity = activity; - l4_set_pager (pager_tid); + storage_init (); + as_init (); } |