void manager_jenkins() { #ifdef CONFIG_KERNEL_TESTING printk("<-- BEGIN_KERNEL_TESTS -->\n"); run_registered_ktest_suites(); printk("<-- END_KERNEL_TESTS -->\n"); #endif // Run userspace tests (from config specified path). #ifdef CONFIG_USERSPACE_TESTING if (strlen(CONFIG_USERSPACE_TESTING_SCRIPT) != 0) { char exec[] = "/bin/ash"; char *p_argv[] = {exec, CONFIG_USERSPACE_TESTING_SCRIPT, 0}; struct file *program = do_file_open(exec, 0, 0); struct proc *p = proc_create(program, p_argv, NULL); proc_wakeup(p); proc_decref(p); /* let go of the reference created in proc_create() */ kref_put(&program->f_kref); run_scheduler(); // Need a way to wait for p to finish } else { printk("No user-space launcher file specified.\n"); } #endif smp_idle(); assert(0); }
/* Called when we are currently running an address space on our core and want to * abandon it. We need a known good pgdir before releasing the old one. We * decref, since current no longer tracks the proc (and current no longer * protects the cr3). We also need to clear out the TLS registers (before * unmapping the address space!) */ void __abandon_core(void) { struct per_cpu_info *pcpui = &per_cpu_info[core_id()]; lcr3(boot_cr3); proc_decref(pcpui->cur_proc); pcpui->cur_proc = 0; }