ST20-C1 STMICROELECTRONICS [STMicroelectronics], ST20-C1 Datasheet - Page 81

no-image

ST20-C1

Manufacturer Part Number
ST20-C1
Description
Instruction Set Reference Manual
Manufacturer
STMICROELECTRONICS [STMicroelectronics]
Datasheet
value MostNeg ) at the bottom of the memory space.
7.4
The ST20-C1 includes support for timeslicing. Timeslicing is a safeguard in a multi-
tasking environment to prevent any one process from taking too much processor time.
Exception handlers are not timesliced.
A timeslicing counter is provided as a field of the status register called the
timeslice_count. It is reset to MaxTimesliceCount each time a user process is loaded
from the scheduling queue into the CPU. The counter is decremented regularly until it
reaches 0, and then stays at 0. A timeslice is due when the counter value is 0.
If a timeslice instruction is executed when a timeslice is due and timeslicing is enabled
then:
If an exception occurs, the value of the counter is saved with the status register and
reloaded when the interrupted or trapped process is restarted. This ensures that a
process will be executed for roughly the same time regardless of whether it was inter-
rupted or trapped.
The timeslice_enable bit of the status register can be used to enable or disable
timeslicing. Timeslicing is enabled when the bit is set. This bit is preserved when a
process is descheduled, so it may be treated as global among user processes. Times-
licing must not be enabled in exception handlers.
Front
Back
Queue control block
Timeslicing
the timeslice trap will be taken if it is installed;
otherwise the current process will be timesliced, i.e. the current process is
placed on the back of the scheduling queue and the process on the front of the
scheduling queue is loaded into the CPU for execution.
Front
Wptr
Iptr
Figure 7.4 A process queue
Process descriptor blocks
Wptr
Iptr
Wptr
Iptr
7 Multi-tasking
Wptr
Back
Iptr
81/205

Related parts for ST20-C1