Copyright (C) 1996, 1997 Michael Barabanov




	A Real-Time Scheduler

The kernel module kernel/rt_prio_sched.c implements a simple real-time
scheduler. The scheduler allows creation, running, suspension, waking up and
deletion of real-time tasks.  The real-time tasks have fixed priorities , and
are fully preemptable. The scheduler has special support for periodic tasks.



Include file <linux/rt_sched.h> contains interface function prototypes and type
declarations of the scheduler:


typedef struct rt_task_struct RT_TASK;

	For each rt-task there is a RT_TASK structure. It contains state,
	priority, etc. It's not supposed to be modified directly.

	James R Hester <jrh@nirim.go.jp> notes:
	Any RT_TASK structures that are going to be executed by the rt
	scheduler should not be automatic variables.


extern int rt_task_init(RT_TASK *task, void (*fn)(int data), int data,
	int stack_size,  int priority);

	Initialize a rt-task. `fn' is the code for the new task, `data'
	is an integer value to pass to fn on startup, `stack_size' -
	the stack size for this RT-task `priority' - the highest is 1,
	the lowest is RT_LOWEST_PRIORITY.


extern int rt_task_make_periodic(RT_TASK *task, RTIME start_time,
RTIME period);

	mark this task as periodic; if you want the task to start execution
	immediately, use the return value of rt_get_time() from asm/rt_time.h as
	start_time.


extern int rt_task_delete(RT_TASK *task);

	remove this RT-task from the list of RT-tasks.


extern int rt_task_wait(void);

	wait till the beginning of the next period (for periodic tasks).


extern int rt_task_suspend(RT_TASK *task);

	suspend the real-time task `task'

