Chapter 3 Introduction to MR308
- 17 -
3.2.1 Service Call Processing
When a service call is issued, processing takes place in the following sequence.8
1. The current register contents are saved.
2. The stack pointer is changed from the task type to the real-time OS (system) type.
3. Processing is performed in compliance with the request made by the service call.
4. The task to be executed next is selected.
5. The stack pointer is changed to the task type.
6. The register contents are recovered to resume task execution.
The flowchart in Figure 3.10 shows the process between service call generation and task switching.
Key input Task
Service call issuanc e
Register Save
SP <= OS
Processing
Task S ele ctio n
Task = > SP
Register Resto re
LED illumination Task
Figure 3.10 Service Call Processing Flowchart
8 A different sequence is followed if the issued service call does not evoke task switching.