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

no-image

ST20-C1

Manufacturer Part Number
ST20-C1
Description
Instruction Set Reference Manual
Manufacturer
STMICROELECTRONICS [STMicroelectronics]
Datasheet
bit 0 of the descriptor, and so can be either ExceptionProcessType (which has the
value 1) or UserProcessType (which has the value 0). The type allows each exception
level to be assigned to one of the following:
When the exception is triggered, the CPU looks in the table entry for the requested
exception level. If the value in the table is NotProcess then no exception or trap is
taken and the CPU continues with the default behavior. Otherwise, if bit 0 is
UserProcessType then the address part of the value is assumed to be a valid task
descriptor of a process. If bit 0 is ExceptionProcessType , then the address part is
assumed to be a pointer to a valid exception control block.
Using user processes as exceptions to handle peripherals is described in section
4.11. The rest of this chapter refers only to exceptions.
Typically a separate descriptor is used for each interrupt level and system call, so that
this scheme provides a system of vectored interrupts and system calls. The exception
handler is then executed, and can itself be interrupted or trapped.
6.3
When an exception is taken, the state is saved in the exception control block. The
evaluation stack, status register, Iptr, Wptr and Tdesc are automatically saved on
taking the exception and restored on returning. This is done to enable any exception
handler to have direct access to the state of the underlying process and is required for
some software scheduler implementations.
The constants in Table 6.3 define the locations in the control block.
Word offset
7
6
5
4
3
2
1
0
an exception handler. The entry for an exception handler is the address of the
exception control block (as described in section 6.3) bitwise ORed with
ExceptionProcessType to indicate an exception.
a user process waiting for a peripheral (as described in section 4.11).The entry
for a user process is the task descriptor (i.e. the address of the process control
block) bitwise ORed with UserProcessType to indicate a user process.
the null entry NotProcess . The CPU treats null entries as disabled exceptions.
Exception control block and the saved state
ex.HandlerIptr
ex.InterptdStatus
ex.InterptdTdesc
ex.InterptdIptr
ex.InterptdWptr
ex.InterptdCreg
ex.InterptdBreg
ex.InterptdAreg
Name
Table 6.3 Exception control block
Exception handler instruction pointer.
Interrupted or trapped process status register.
Interrupted or trapped process task descriptor.
Interrupted or trapped process instruction pointer.
Interrupted or trapped process workspace pointer.
Interrupted or trapped process Creg.
Interrupted or trapped process Breg.
Interrupted or trapped process Areg.
Purpose
6 Exceptions
73/205

Related parts for ST20-C1