Porting Embedded Rapid Prototyper Run-Time Libraries : Target Dependent Areas in the RTL

Target Dependent Areas in the RTL

Scheduler

The task mechanism serves to create, start, suspend, resume and stop the tasks. These tasks may be either user-defined tasks or service tasks intended to support GBA, Panel, Trace and/or I/O mapping features of generated code. The tasks implementation and synchronization between tasks is differing for user-defined tasks and other tasks. The tasks are implemented using native mechanism of OS. So every place, where these OS-dependent functions/data structures are used, should be changed/revised according to target OS task description. The task synchronization is performed using semaphore mechanism. Of course, if the target OS does not contain any semaphore implementation, an alternative feature should be used for that.

The scheduler library provides the multithreading package, which contains the task manipulation scheduling services. The task control block (task_entry) has different structure for every OS, so it should be changed for the porting purpose. Moreover, the task services should be implemented in different way for target OS. These parts of library should be rewritten.

Task delay
Timeout/scheduled action blocking/unblocking functions
Waiting for event
Semaphore mechanism