]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/ppc/ppc_init.c
xnu-344.tar.gz
[apple/xnu.git] / osfmk / ppc / ppc_init.c
index d75761a1a9b1c1a78e9ccbfd32343a90565f018c..e52131729d99de7cbed2846a03ca57c0838f7b9b 100644 (file)
@@ -113,6 +113,7 @@ void ppc_init(boot_args *args)
        char *str;
        unsigned long   addr, videoAddr;
        unsigned int    maxmem;
+       unsigned int    cputrace;
        bat_t               bat;
        extern vm_offset_t static_memory_end;
        
@@ -129,16 +130,19 @@ void ppc_init(boot_args *args)
        per_proc_info[0].interrupts_enabled = 0;
        per_proc_info[0].active_kloaded = (unsigned int)
                &active_kloaded[0];
-       per_proc_info[0].cpu_data = (unsigned int)
-               &cpu_data[0];
+       set_machine_current_thread(&pageout_thread);
+       set_machine_current_act(&pageout_act);
+       pageout_thread.top_act = &pageout_act;
+       pageout_act.thread = &pageout_thread;
+       per_proc_info[0].pp_preemption_count = 1;
+       per_proc_info[0].pp_simple_lock_count = 0;
+       per_proc_info[0].pp_interrupt_level = 0;
        per_proc_info[0].active_stacks = (unsigned int)
                &active_stacks[0];
        per_proc_info[0].need_ast = (unsigned int)
                &need_ast[0];
-       per_proc_info[0].FPU_thread = 0;
-       per_proc_info[0].FPU_vmmCtx = 0;
-       per_proc_info[0].VMX_thread = 0;
-       per_proc_info[0].VMX_vmmCtx = 0;
+       per_proc_info[0].FPU_owner = 0;
+       per_proc_info[0].VMX_owner = 0;
 
        machine_slot[0].is_cpu = TRUE;
 
@@ -244,6 +248,10 @@ void ppc_init(boot_args *args)
        if (!PE_parse_boot_arg("diag", &dgWork.dgFlags)) dgWork.dgFlags=0;      /* Set diagnostic flags */
        if(dgWork.dgFlags & enaExpTrace) trcWork.traceMask = 0xFFFFFFFF;        /* If tracing requested, enable it */
 
+       if(PE_parse_boot_arg("ctrc", &cputrace)) {                                                      /* See if tracing is limited to a specific cpu */
+               trcWork.traceMask = (trcWork.traceMask & 0xFFFFFFF0) | (cputrace & 0xF);        /* Limit to 4 */
+       }
+
 #if 0
        GratefulDebInit((bootBumbleC *)&(args->Video)); /* Initialize the GratefulDeb debugger */
 #endif
@@ -301,19 +309,16 @@ ppc_init_cpu(
        struct per_proc_info *proc_info)
 {
        int i;
-       unsigned int gph;
-       savectl *sctl;                                                  /* Savearea controls */
 
-       if(proc_info->savedSave) {                              /* Do we have a savearea set up already? */
-               mtsprg(1, proc_info->savedSave);        /* Set saved address of savearea */
-       }
-       else {
-               gph = (unsigned int)save_get_phys();    /* Get a savearea (physical addressing) */
-               mtsprg(1, gph);                                         /* Set physical address of savearea */
-       }
+       if(!(proc_info->next_savearea))                 /* Do we have a savearea set up already? */
+               proc_info->next_savearea = (savearea *)save_get_init(); /* Get a savearea  */
        
        cpu_init();
-       
+
+       proc_info->pp_preemption_count = 1;
+       proc_info->pp_simple_lock_count = 0;
+       proc_info->pp_interrupt_level = 0;
+
        proc_info->Lastpmap = 0;                                /* Clear last used space */
 
        /* Set up segment registers as VM through space 0 */