Annotated i386/smp_boot.c init.c manager.c monitor.c and multiboot.c
authorZach Anderson <zra@zra-intrepid.(none)>
Sat, 15 Aug 2009 01:09:24 +0000 (18:09 -0700)
committerZach Anderson <zra@zra-intrepid.(none)>
Sat, 15 Aug 2009 01:09:24 +0000 (18:09 -0700)
kern/arch/i386/smp_boot.c
kern/include/pmap.h
kern/src/init.c
kern/src/manager.c
kern/src/monitor.c
kern/src/multiboot.c

index 69a9e89..84ef309 100644 (file)
@@ -4,10 +4,6 @@
  * See LICENSE for details.
  */
 
-#ifdef __DEPUTY__
-//#pragma nodeputy
-#endif
-
 #include <arch/x86.h>
 #include <arch/arch.h>
 #include <smp.h>
index aaa1816..90fc5af 100644 (file)
@@ -80,8 +80,8 @@ extern page_list_t page_free_list;
 void*  (DALLOC(n) boot_alloc)(uint32_t n, uint32_t align);
 void*  (DALLOC(_n*sz) boot_calloc)(uint32_t _n, size_t sz, uint32_t align);
 
-void   multiboot_detect_memory(multiboot_info_t *mbi);
-void   multiboot_print_memory_map(multiboot_info_t *mbi);
+void   multiboot_detect_memory(multiboot_info_t *COUNT(1) mbi);
+void   multiboot_print_memory_map(multiboot_info_t *COUNT(1) mbi);
 bool   enable_pse(void);
 void   vm_init(void);
 
index 76481bd..44b4c78 100644 (file)
@@ -1,9 +1,5 @@
 /* See COPYRIGHT for copyright information. */
 
-#ifdef __DEPUTY__
-#pragma nodeputy
-#endif
-
 #ifdef __BSD_ON_CORE_0__
 #include Everything For Free -- It just works!!
 #else
@@ -41,8 +37,12 @@ void kernel_init(multiboot_info_t *mboot_info)
 
        print_cpuinfo();
 
-       multiboot_detect_memory((multiboot_info_t*)((uint32_t)mboot_info + KERNBASE));
-       multiboot_print_memory_map((multiboot_info_t*)((uint32_t)mboot_info + KERNBASE));
+       // zra: using KADDR macro gives a runtime warning, but it is possibly more
+    //      clear what's going on this way?
+       //multiboot_detect_memory((multiboot_info_t*)((uint32_t)mboot_info + KERNBASE));
+       //multiboot_print_memory_map((multiboot_info_t*)((uint32_t)mboot_info + KERNBASE));
+       multiboot_detect_memory((multiboot_info_t*COUNT(1))KADDR(mboot_info));
+       multiboot_print_memory_map((multiboot_info_t*COUNT(1))KADDR(mboot_info));
 
        vm_init();
 
index 4764e84..7f88665 100644 (file)
@@ -4,10 +4,6 @@
  * See LICENSE for details.
  */
 
-#ifdef __DEPUTY__
-#pragma nodeputy
-#endif
-
 #include <arch/types.h>
 #include <smp.h>
 
index 9648a37..aece729 100644 (file)
@@ -1,10 +1,6 @@
 // Simple command-line kernel monitor useful for
 // controlling the kernel and exploring the system interactively.
 
-#ifdef __DEPUTY__
-#pragma nodeputy
-#endif
-
 #include <arch/arch.h>
 #include <stab.h>
 #include <smp.h>
index f835747..6c47bc6 100644 (file)
@@ -6,7 +6,7 @@
 #include <stdio.h>
 
 #ifdef __DEPUTY__
-#pragma nodeputy
+//#pragma nodeputy
 #endif
 
 #ifdef __i386__
@@ -50,22 +50,27 @@ multiboot_detect_memory(multiboot_info_t *mbi)
 
 void
 multiboot_print_memory_map(multiboot_info_t *mbi) {
-       const char* memory_type[] = {"", "FREE", "RESERVED", "UNDEFINED", "UNDEFINED4"};
+       const char *NTS memory_type[] = {"", "FREE", "RESERVED", "UNDEFINED", "UNDEFINED4"};
 
 
        if(CHECK_FLAG(mbi->flags, 6)) {
+               memory_map_t *SNT mmap_b =
+                       (memory_map_t *SNT)(mbi->mmap_addr + KERNBASE);
+               memory_map_t *SNT mmap_e =
+                       (memory_map_t *SNT)(mbi->mmap_addr + KERNBASE + mbi->mmap_length);
+               memory_map_t *BND(mmap_b, mmap_e) mmap = TC(mmap_b);
+
                cprintf ("mmap_addr = 0x%x, mmap_length = 0x%x\n", (unsigned long)mbi->mmap_addr,
                           (unsigned long)mbi->mmap_length);
 
-               memory_map_t* mmap = (memory_map_t*) ((uint32_t)mbi->mmap_addr + KERNBASE);
-               while((uint32_t)mmap < ((uint32_t)mbi->mmap_addr + KERNBASE) + mbi->mmap_length) {
+               while(mmap < mmap_e) {
                        cprintf ("base = 0x%08x%08x, length = 0x%08x%08x, type = %s\n",
                                (unsigned) mmap->base_addr_high,
                                (unsigned) mmap->base_addr_low,
                                (unsigned) mmap->length_high,
                                (unsigned) mmap->length_low,
                                (unsigned) memory_type[mmap->type]);
-                       mmap = (memory_map_t*) ((uint32_t) mmap + mmap->size + sizeof (mmap->size));
+                       mmap = (char *)mmap + mmap->size + sizeof(mmap->size);
                }
        }
 }