Ejemplo n.º 1
0
void kernel_interrupts_init(int enable_timer) {
	KERNEL_TRACE("init", "enabling interrupts");
	kernel_assert(cp0_status_ie_get() == 0);
	cp0_status_ie_enable();

	if(enable_timer) {
		/* Start timer */
		kernel_timer_init();
		cp0_status_im_enable(MIPS_CP0_STATUS_IM_TIMER);
	}
}
Ejemplo n.º 2
0
/** @brief preStart() is the function for the startup thread, which is the
 * one spawned by main().
 *
 * It does all the initialization that needs to happen after the
 * kernel is up and running, and then it calls the application start function.
 */
void pre_start(void)
{
    //TODO: this should somehow be auto-generated
#ifdef PLATFORM_LINUX
    mos_node_id_init();	// must be called before gevent_init ()
    gevent_init();

    serial_init();
    terminal_init();
    //udp_init();
    xmos_radio_init();	// gevent_init() must be called first
    xmos_flash_init();	// gevent_init() must be called first
    mos_thread_suspend(); //fixes threading issue with freebsd

#elif defined(ARCH_MICRO)
    uart_init();
    printf_init();
    plat_init();
    clock_init();
#if defined(PLATFORM_TELOSB)
    // clock_init() clobbers TimerA
    // re-initialize TimerA here as a kludge.
    kernel_timer_init();
#endif
    mos_node_id_init();

    //dev_loopback_init();
    //com_loopback_init();


    // seed the rng
    //srandom(mos_node_id_get());
#endif //if defined(ARCH_AVR)

#ifdef MOS_DEBUG
    mos_debug_post_init();
#endif

    start();
}