summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJennifer Averett <jennifer.averett@oarcorp.com>2012-05-31 14:50:48 -0500
committerJennifer Averett <jennifer.averett@oarcorp.com>2012-05-31 14:50:48 -0500
commit1bfe311a1dd0cee365cb5095fd95291d07740837 (patch)
tree400ad6918748dfb06023a2a7cc976aca8cdf0c6f
parentAdded initialization needed by Nics into uma_core.c (diff)
downloadrtems-libbsd-1bfe311a1dd0cee365cb5095fd95291d07740837.tar.bz2
Added an initialization method for minimal vm initialization.
-rw-r--r--rtemsbsd/src/rtems-bsd-vm_glue.c34
1 files changed, 31 insertions, 3 deletions
diff --git a/rtemsbsd/src/rtems-bsd-vm_glue.c b/rtemsbsd/src/rtems-bsd-vm_glue.c
index 30f618b6..298e5885 100644
--- a/rtemsbsd/src/rtems-bsd-vm_glue.c
+++ b/rtemsbsd/src/rtems-bsd-vm_glue.c
@@ -32,14 +32,42 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+#include <freebsd/machine/rtems-bsd-config.h>
#include <sys/param.h>
#include <sys/lock.h>
#include <sys/sched.h>
+#include <freebsd/sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+#include <freebsd/sys/kernel.h>
+#include <freebsd/vm/uma.h>
+#include <freebsd/vm/uma_int.h>
+#include <freebsd/sys/systm.h>
+
+/*
+ * System initialization
+ */
+static int boot_pages = UMA_BOOT_PAGES;
+static void vm_mem_init(void *);
+SYSINIT(vm_mem, SI_SUB_VM, SI_ORDER_FIRST, vm_mem_init, NULL);
+
+static void
+vm_mem_init(dummy)
+ void *dummy;
+{
+ void *mapped;
+
+ /*
+ * The values for mapped came from the freeBSD method
+ * vm_page_startup() in the freeBSD file vm_page.c.
+ * XXX - This may need to be adjusted for our system.
+ */
+ mapped = calloc( boot_pages * UMA_SLAB_SIZE, 1 );
+ uma_startup((void *)mapped, boot_pages);
+ kern_timeout_callwheel_init();
+}
+
/*
* MPSAFE
*