int exec_netbsd(const char *file, int howto) { static char bibuf[BOOTINFO_MAXSIZE]; u_long marks[MARK_MAX]; int fd; BI_ALLOC(6); /* XXX */ marks[MARK_START] = 0; /* loadaddr */ if ((fd = loadfile(file, marks, LOAD_KERNEL)) == -1) goto out; printf("Start @ 0x%lx [%ld=0x%lx-0x%lx]...\n", marks[MARK_ENTRY], marks[MARK_NSYM], marks[MARK_SYM], marks[MARK_END]); { struct btinfo_common *help; char *p; int i; p = bibuf; memcpy(p, &bootinfo->nentries, sizeof(bootinfo->nentries)); p += sizeof(bootinfo->nentries); for (i = 0; i < bootinfo->nentries; i++) { help = (struct btinfo_common *)(bootinfo->entry[i]); memcpy(p, help, help->len); p += help->len; } } cache_flush(); cache_disable(); (*(void (*)(int, void *))marks[MARK_ENTRY])(howto, bibuf); panic("exec returned"); out: BI_FREE(); bootinfo = 0; return (-1); }
static int __init nocache_trampoline(unsigned long _arg) { void (*cache_disable)(void) = (void *)_arg; unsigned int mpidr = read_cpuid_mpidr(); unsigned int cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0); unsigned int cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1); phys_reset_t phys_reset; mcpm_set_entry_vector(cpu, cluster, cpu_resume); setup_mm_for_reboot(); __mcpm_cpu_going_down(cpu, cluster); BUG_ON(!__mcpm_outbound_enter_critical(cpu, cluster)); cache_disable(); __mcpm_outbound_leave_critical(cluster, CLUSTER_DOWN); __mcpm_cpu_down(cpu, cluster); phys_reset = (phys_reset_t)(unsigned long)virt_to_phys(cpu_reset); phys_reset(virt_to_phys(mcpm_entry_point)); BUG(); }
void usbModuleDisable(void) { wait_ms(100); led_off(); /* ==== Interrupt mask level change ==== */ set_imask(15); //(0x000000F0); /* USBコントローラディセーブル */ INTC.IPR10.BIT._USB = 0; /* Set USB interrupt level */ USB.SYSCFG.WORD = 0x0481; /* DPRUP off */ wait_ms(30); USB.SYSCFG.WORD = 0x0401; /* HSE off */ wait_ms(30); USB.SYSCFG.WORD = 0x0400; /* USB off */ wait_ms(30); USB.SYSCFG.WORD = 0x0; /* SCKE off */ usb_reset_module(); /* USBモジュール リセット */ wait_ms(1200); INTC.IBNR.WORD = 0x0000; /* レジスタバングディセーブル */ cache_disable(); }
/** * disable D-Cache * */ void rt_hw_cpu_dcache_disable() { cache_disable(DCACHE_MASK); }
/** * disable I-Cache * */ void rt_hw_cpu_icache_disable() { cache_disable(ICACHE_MASK); }