Subversion Repositories HelenOS

Compare Revisions

Regard whitespace Rev 4344 → Rev 4345

/branches/dynload/kernel/generic/src/main/kinit.c
64,6 → 64,8
#include <security/cap.h>
#include <lib/rd.h>
#include <ipc/ipc.h>
#include <debug.h>
#include <string.h>
 
#ifdef CONFIG_SMP
#include <smp/smp.h>
78,6 → 80,9
static char alive[ALIVE_CHARS] = "-\\|/";
#endif
 
#define INIT_PREFIX "init:"
#define INIT_PREFIX_LEN 5
 
/** Kernel initialization thread.
*
* kinit takes care of higher level kernel
120,9 → 125,7
thread_join(thread);
thread_detach(thread);
}
#endif /* CONFIG_SMP */
#ifdef CONFIG_SMP
if (config.cpu_count > 1) {
count_t i;
138,7 → 141,6
thread_ready(thread);
} else
printf("Unable to create kcpulb thread for cpu" PRIc "\n", i);
 
}
}
#endif /* CONFIG_SMP */
175,11 → 177,25
continue;
}
 
char *name = init.tasks[i].name;
if (name[0] == '\0') name = "init-bin";
/*
* Construct task name from the 'init:' prefix and the
* name stored in the init structure (if any).
*/
char namebuf[TASK_NAME_BUFLEN];
char *name;
name = init.tasks[i].name;
if (name[0] == '\0')
name = "<unknown>";
ASSERT(TASK_NAME_BUFLEN >= INIT_PREFIX_LEN);
strncpy(namebuf, INIT_PREFIX, TASK_NAME_BUFLEN);
strncpy(namebuf + INIT_PREFIX_LEN, name,
TASK_NAME_BUFLEN - INIT_PREFIX_LEN);
int rc = program_create_from_image((void *) init.tasks[i].addr,
name, &programs[i]);
namebuf, &programs[i]);
if ((rc == 0) && (programs[i].task != NULL)) {
/*
202,12 → 218,18
}
/*
* Run user tasks with reasonable delays
* Run user tasks with small delays
* to avoid intermixed klog output.
*
* TODO: This certainly does not guarantee
* anything, it just works in most of the
* cases. Some better way how to achieve
* nice klog output should be found.
*/
for (i = 0; i < init.cnt; i++) {
if (programs[i].task != NULL) {
thread_usleep(50000);
program_ready(&programs[i]);
thread_usleep(10000);
}
}