Esempio n. 1
0
/* this could/should be mi_attach_cpu? */
void
rump_cpus_bootstrap(int *nump)
{
	struct cpu_info *ci;
	int num = *nump;
	int i;

	if (num > MAXCPUS) {
		aprint_verbose("CPU limit: %d wanted, %d (MAXCPUS) "
		    "available (adjusted)\n", num, MAXCPUS);
		num = MAXCPUS;
	}

	for (i = 0; i < num; i++) {
		ci = &rump_cpus[i];
		ci->ci_index = i;
	}

	kcpuset_create(&kcpuset_attached, true);
	kcpuset_create(&kcpuset_running, true);

	/* attach first cpu for bootstrap */
	rump_cpu_attach(&rump_cpus[0]);
	ncpu = 1;
	*nump = num;
}
Esempio n. 2
0
/* this could/should be mi_attach_cpu? */
void
rump_cpus_bootstrap(int *nump)
{
    int num = *nump;

    if (num > MAXCPUS) {
        aprint_verbose("CPU limit: %d wanted, %d (MAXCPUS) "
                       "available (adjusted)\n", num, MAXCPUS);
        num = MAXCPUS;
    }

    mutex_init(&cpu_lock, MUTEX_DEFAULT, IPL_NONE);

    kcpuset_create(&kcpuset_attached, true);
    kcpuset_create(&kcpuset_running, true);

    /* attach first cpu for bootstrap */
    rump_cpu_attach(&rump_bootcpu);
    ncpu = 1;
    *nump = num;
}