[rtems-libbsd commit] Added an initialization method for minimal vm initialization.
Jennifer Averett
jennifer at rtems.org
Thu May 31 19:47:24 UTC 2012
Module: rtems-libbsd
Branch: master
Commit: 1bfe311a1dd0cee365cb5095fd95291d07740837
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=1bfe311a1dd0cee365cb5095fd95291d07740837
Author: Jennifer Averett <jennifer.averett at oarcorp.com>
Date: Thu May 31 14:50:48 2012 -0500
Added an initialization method for minimal vm initialization.
---
rtemsbsd/src/rtems-bsd-vm_glue.c | 34 +++++++++++++++++++++++++++++++---
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 30f618b..298e588 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
*
More information about the vc
mailing list