Real-time multi-tasking processor scheduler(PRCSCH)consists of four function blocks : task dispatcher (XSCAN), high-priority queue handler(XSETHI), and d-bus input queue handler(XBIQ). The last function will be supplied by inter-processor communicatio...
Real-time multi-tasking processor scheduler(PRCSCH)consists of four function blocks : task dispatcher (XSCAN), high-priority queue handler(XSETHI), and d-bus input queue handler(XBIQ). The last function will be supplied by inter-processor communication module and will not be described here.
XSCAN schedules bus input tasks, high-priority tasks, timeout tasks, timeout tasks, normal tasks, and free-time tasks according to their status bytes. Tasks are run in the following way, XSCAN takes out top message in the d-bus input queue, translates the communication type byte(comty) contained in the message to its corresponding task index value, and runs the task when its ready bit is set. If its ready bit is reset or no message is waiting in the d-us input queue, XSCAN checks the high-priority queue. If any task is waiting in it, the task is run before any normal tasks. After bus input tasks and high-priority tasks are run. XSCAN runs normal tasks sequentially according to their status bytes. At extreme case that there are no normal tasks to be run, XSCAN runs free-time tasks(for example memory test, interface test, etc) of which free bit is set.
XSETHI allows each task to upgrade the priority of the ask to high priority, thus permitting it to be run before any normal task. Multiple high-priority requests can be queued.
And XTIME supplies to each task a timer that can be used to suspend its execution for a specified duration of time. These are useful for i/o timeout. If XTIME receives timeout request from a task with tick count(multiples of real-time clock period), the task will be run by XSCAN when timeout expires.