int init_module(void)
{
	int i, k;

	k = 1;
	for (i = 0; i < NTASKS; i++) {
		rt_task_init_cpuid(&thread[i], fun, k = ~k, STACK_SIZE, 0, 0, 0, i%2);
	}
	start_rt_apic_timers(apic_setup_data, 0);
	for (i = 0; i < NTASKS; i++) {
		rt_task_make_periodic_relative_ns(&thread[i], (i+1)*TICK_PERIOD, NTASKS*TICK_PERIOD);
	}
	return 0;
}
Beispiel #2
0
int init_module(void)
{
	hide = FALSE;
	pause = FALSE;
	rtf_create(Keyboard, 1000);
	rtf_create_handler(Keyboard, keybrd_handler);
	rtf_create(Screen, 10000);
	rt_sem_init(&keybrd_sem, 0);
	rt_task_init_cpuid(&read, ClockChrono_Read, 0, 2000, 0, 0, 0, READ_RUN_ON_CPU);
	rt_task_init_cpuid(&chrono, ClockChrono_Chrono, 0, 2000, 0, 0, 0, CHRONO_RUN_ON_CPU);
	rt_task_init_cpuid(&clock, ClockChrono_Clock, 0, 2000, 0, 0, 0, CLOCK_RUN_ON_CPU);
	rt_task_init_cpuid(&write, ClockChrono_Write, 0, 2000, 0, 0, 0, WRITE_RUN_ON_CPU);
	start_rt_apic_timers(apic_setup_data, 0);
	rt_task_resume(&read);
	rt_task_resume(&chrono);
	rt_task_resume(&clock);
	rt_task_resume(&write);
	return 0;
}