[BACK]Return to arm32_boot.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / arch / arm / arm32

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/arch/arm/arm32/arm32_boot.c between version 1.10 and 1.10.2.5

version 1.10, 2014/11/04 22:37:09 version 1.10.2.5, 2017/08/28 17:51:29
Line 151  __KERNEL_RCSID(1, "$NetBSD$");
Line 151  __KERNEL_RCSID(1, "$NetBSD$");
 #include <sys/kgdb.h>  #include <sys/kgdb.h>
 #endif  #endif
   
   #ifdef MULTIPROCESSOR
   static kmutex_t cpu_hatch_lock;
   #endif
   
 vaddr_t  vaddr_t
 initarm_common(vaddr_t kvm_base, vsize_t kvm_size,  initarm_common(vaddr_t kvm_base, vsize_t kvm_size,
         const struct boot_physmem *bp, size_t nbp)          const struct boot_physmem *bp, size_t nbp)
Line 169  initarm_common(vaddr_t kvm_base, vsize_t
Line 173  initarm_common(vaddr_t kvm_base, vsize_t
          */           */
         uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);          uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
   
           struct lwp * const l = &lwp0;
           struct pcb * const pcb = lwp_getpcb(l);
   
           /* Zero out the PCB. */
           memset(pcb, 0, sizeof(*pcb));
   
           pcb->pcb_ksp = uvm_lwp_getuarea(l) + USPACE_SVC_STACK_TOP;
           pcb->pcb_ksp -= sizeof(struct trapframe);
   
           struct trapframe * tf = (struct trapframe *)pcb->pcb_ksp;
   
           /* Zero out the trapframe. */
           memset(tf, 0, sizeof(*tf));
           lwp_settrapframe(l, tf);
   
   #if defined(__ARMEB__)
           tf->tf_spsr = PSR_USR32_MODE | (CPU_IS_ARMV7_P() ? PSR_E_BIT : 0);
   #else
           tf->tf_spsr = PSR_USR32_MODE;
   #endif
   
 #ifdef VERBOSE_INIT_ARM  #ifdef VERBOSE_INIT_ARM
         printf("bootstrap done.\n");          printf("bootstrap done.\n");
 #endif  #endif
Line 227  initarm_common(vaddr_t kvm_base, vsize_t
Line 252  initarm_common(vaddr_t kvm_base, vsize_t
 #ifdef VERBOSE_INIT_ARM  #ifdef VERBOSE_INIT_ARM
         printf("page ");          printf("page ");
 #endif  #endif
         uvm_setpagesize();      /* initialize PAGE_SIZE-dependent variables */          uvm_md_init();
   
 #ifdef VERBOSE_INIT_ARM  #ifdef VERBOSE_INIT_ARM
         printf("pmap_physload ");          printf("pmap_physload ");
Line 264  initarm_common(vaddr_t kvm_base, vsize_t
Line 289  initarm_common(vaddr_t kvm_base, vsize_t
                                         break;                                          break;
                                 }                                  }
                         }                          }
   
                         uvm_page_physload(start, segend, start, segend,                          uvm_page_physload(start, segend, start, segend,
                             vm_freelist);                              vm_freelist);
                         start = segend;                          start = segend;
Line 276  initarm_common(vaddr_t kvm_base, vsize_t
Line 301  initarm_common(vaddr_t kvm_base, vsize_t
         printf("pmap ");          printf("pmap ");
 #endif  #endif
         pmap_bootstrap(kvm_base, kvm_base + kvm_size);          pmap_bootstrap(kvm_base, kvm_base + kvm_size);
   
 #ifdef __HAVE_MEMORY_DISK__  #ifdef __HAVE_MEMORY_DISK__
         md_root_setconf(memory_disk, sizeof memory_disk);          md_root_setconf(memory_disk, sizeof memory_disk);
 #endif  #endif
Line 300  initarm_common(vaddr_t kvm_base, vsize_t
Line 325  initarm_common(vaddr_t kvm_base, vsize_t
                 Debugger();                  Debugger();
 #endif  #endif
   
   #ifdef MULTIPROCESSOR
           mutex_init(&cpu_hatch_lock, MUTEX_DEFAULT, IPL_NONE);
   #endif
   
 #ifdef VERBOSE_INIT_ARM  #ifdef VERBOSE_INIT_ARM
         printf("done.\n");          printf("done.\n");
 #endif  #endif
   
         /* We return the new stack pointer address */          /* We return the new stack pointer address */
         return kernelstack.pv_va + USPACE_SVC_STACK_TOP;          return pcb->pcb_ksp;
 }  }
   
 #ifdef MULTIPROCESSOR  #ifdef MULTIPROCESSOR
Line 323  cpu_hatch(struct cpu_info *ci, cpuid_t c
Line 352  cpu_hatch(struct cpu_info *ci, cpuid_t c
          */           */
         splhigh();          splhigh();
   
   #ifdef CPU_CORTEX
   #if 0
           KASSERTMSG(armreg_auxctl_read() & CORTEXA9_AUXCTL_SMP, "auxctl %#x",
               armreg_auxctl_read());
   #endif
   #endif
   
 #ifdef VERBOSE_INIT_ARM  #ifdef VERBOSE_INIT_ARM
         printf("%s(%s): ", __func__, ci->ci_data.cpu_name);          printf("%s(%s): ", __func__, ci->ci_data.cpu_name);
 #endif  #endif
Line 377  cpu_hatch(struct cpu_info *ci, cpuid_t c
Line 413  cpu_hatch(struct cpu_info *ci, cpuid_t c
         if (CPU_ID_CORTEX_P(ci->ci_arm_cpuid)) {          if (CPU_ID_CORTEX_P(ci->ci_arm_cpuid)) {
                 /*                  /*
                  * Start and reset the PMC Cycle Counter.                   * Start and reset the PMC Cycle Counter.
                  */                   */
                 armreg_pmcr_write(ARM11_PMCCTL_E|ARM11_PMCCTL_P|ARM11_PMCCTL_C);                  armreg_pmcr_write(ARM11_PMCCTL_E|ARM11_PMCCTL_P|ARM11_PMCCTL_C);
                 armreg_pmcntenset_write(CORTEX_CNTENS_C);                  armreg_pmcntenset_write(CORTEX_CNTENS_C);
         }          }
 #endif  #endif
   
           mutex_enter(&cpu_hatch_lock);
   
         aprint_naive("%s", device_xname(ci->ci_dev));          aprint_naive("%s", device_xname(ci->ci_dev));
         aprint_normal("%s", device_xname(ci->ci_dev));          aprint_normal("%s", device_xname(ci->ci_dev));
         identify_arm_cpu(ci->ci_dev, ci);          identify_arm_cpu(ci->ci_dev, ci);
Line 391  cpu_hatch(struct cpu_info *ci, cpuid_t c
Line 429  cpu_hatch(struct cpu_info *ci, cpuid_t c
 #endif  #endif
         vfp_attach(ci);          vfp_attach(ci);
   
           mutex_exit(&cpu_hatch_lock);
   
 #ifdef VERBOSE_INIT_ARM  #ifdef VERBOSE_INIT_ARM
         printf(" interrupts");          printf(" interrupts");
 #endif  #endif

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.10.2.5

CVSweb <webmaster@jp.NetBSD.org>