[rtems-libbsd commit] Add some of the initialization from freeBSD vm_init. c needed for Nic.

Jennifer Averett jennifer at rtems.org
Fri Jun 1 18:48:19 UTC 2012


Module:    rtems-libbsd
Branch:    master
Commit:    8e4f82c9800e85f1515ee16df0512fd4d984cbe7
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=8e4f82c9800e85f1515ee16df0512fd4d984cbe7

Author:    Jennifer Averett <jennifer.averett at oarcorp.com>
Date:      Fri Jun  1 13:51:41 2012 -0500

Add some of the initialization from freeBSD vm_init.c needed for Nic.

---

 rtemsbsd/src/rtems-bsd-vm_glue.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/rtemsbsd/src/rtems-bsd-vm_glue.c b/rtemsbsd/src/rtems-bsd-vm_glue.c
index 298e588..6aba59a 100644
--- a/rtemsbsd/src/rtems-bsd-vm_glue.c
+++ b/rtemsbsd/src/rtems-bsd-vm_glue.c
@@ -52,11 +52,15 @@ 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;
+  void        *mapped;
+  static void *callwheel_array[270];
+  caddr_t      c;
+  caddr_t      p;
 
   /*
    * The values for mapped came from the freeBSD method
@@ -65,6 +69,16 @@ vm_mem_init(dummy)
    */
   mapped = calloc( boot_pages * UMA_SLAB_SIZE, 1 );
   uma_startup((void *)mapped, boot_pages);
+
+  /*
+   * The following is doing a minimal amount of work from 
+   * the method vm_ksubmap_init() in freeBSD vm_init.c.
+   */
+  c = (caddr_t) callwheel_array;
+  p = kern_timeout_callwheel_alloc(c);
+  printf( "*** callwheel 0x%x 0x%x 0x%x\n", c, p,  (c + sizeof(callwheel_array)) );
+  if ( p > (c + sizeof(callwheel_array)) )
+    panic( "*** not enough memory for callwheel_array ***" );
   kern_timeout_callwheel_init();
 }
 




More information about the vc mailing list