]> git.saurik.com Git - apple/xnu.git/blobdiff - pexpert/i386/pe_init.c
xnu-1699.22.73.tar.gz
[apple/xnu.git] / pexpert / i386 / pe_init.c
index feb0a8843922d83568fcc8a879ff4bd05ae835fe..fc29c1a6525034ef70f35e9a7c9b2529668ed5b0 100644 (file)
@@ -31,6 +31,7 @@
  */
 #include <sys/types.h>
 #include <mach/vm_param.h>
+#include <machine/machine_routines.h>
 #include <pexpert/protos.h>
 #include <pexpert/pexpert.h>
 #include <pexpert/boot.h>
@@ -74,11 +75,16 @@ int PE_initialize_console( PE_Video * info, int op )
 
         case kPEEnableScreen:
             initialize_screen(info, op);
+            if (info) PE_state.video = *info;
             kprintf("kPEEnableScreen %d\n", last_console);
             if( last_console != -1)
                 switch_to_old_console( last_console);
             break;
        
+        case kPEBaseAddressChange:
+            if (info) PE_state.video = *info;
+            /* fall thru */
+
         default:
             initialize_screen(info, op);
             break;
@@ -101,7 +107,7 @@ void PE_init_iokit(void)
     boolean_t norootInitialized = FALSE;
     DTEntry             entry;
     unsigned int       size;
-    void **            map;
+    uint32_t           *map;
        boot_progress_element *bootPict;
 
     PE_init_kprintf(TRUE);
@@ -115,12 +121,14 @@ void PE_init_iokit(void)
 
     if( kSuccess == DTLookupEntry(NULL, "/chosen/memory-map", &entry)) {
        if( kSuccess == DTGetProperty(entry, "BootCLUT", (void **) &map, &size)) {
-           bcopy( map[0], appleClut8, sizeof(appleClut8) );
-            bootClutInitialized = TRUE;
-        }
+           if (sizeof(appleClut8) <= map[1]) {
+               bcopy( (void *)ml_static_ptovirt(map[0]), appleClut8, sizeof(appleClut8) );
+               bootClutInitialized = TRUE;
+           }
+       }
 
        if( kSuccess == DTGetProperty(entry, "Pict-FailedBoot", (void **) &map, &size)) {
-           bootPict = (boot_progress_element *) map[0];
+           bootPict = (boot_progress_element *) ml_static_ptovirt(map[0]);
            default_noroot.width  = bootPict->width;
            default_noroot.height = bootPict->height;
            default_noroot.dx     = 0;
@@ -165,8 +173,8 @@ void PE_init_platform(boolean_t vm_initialized, void * _args)
 
         // New EFI-style
         PE_state.bootArgs           = _args;
-        PE_state.deviceTreeHead            = (void *) args->deviceTreeP;
-        PE_state.video.v_baseAddr   = args->Video.v_baseAddr;
+        PE_state.deviceTreeHead            = (void *) ml_static_ptovirt(args->deviceTreeP);
+        PE_state.video.v_baseAddr   = args->Video.v_baseAddr; // remains physical address
         PE_state.video.v_rowBytes   = args->Video.v_rowBytes;
         PE_state.video.v_width     = args->Video.v_width;
         PE_state.video.v_height            = args->Video.v_height;
@@ -177,18 +185,16 @@ void PE_init_platform(boolean_t vm_initialized, void * _args)
     }
 
     if (!vm_initialized) {
-               /* Hack! FIXME.. */ 
-        outb(0x21, 0xff);   /* Maskout all interrupts Pic1 */
-        outb(0xa1, 0xff);   /* Maskout all interrupts Pic2 */
+
         if (PE_state.deviceTreeHead) {
             DTInit(PE_state.deviceTreeHead);
-    }
+        }
 
         pe_identify_machine(args);
     } else {
         pe_init_debug();
     }
+
 }
 
 void PE_create_console( void )
@@ -270,5 +276,8 @@ PE_stub_poll_input(__unused unsigned int options, char * c)
 int (*PE_poll_input)(unsigned int options, char * c)
        = PE_stub_poll_input;
 
-
-
+boolean_t
+PE_reboot_on_panic(void)
+{
+       return FALSE;
+}