Книга: Real-Time Concepts for Embedded Systems
10.4.2 Classification of General Exceptions
10.4.2 Classification of General Exceptions
Although not all embedded processors implement exceptions in the same manner, most of the more recent processors have these types of exceptions:
· asynchronous-non-maskable,
· asynchronous-maskable,
· synchronous-precise, and
· synchronous-imprecise.
Asynchronous exceptions are classified into maskable and non-maskable exceptions. External interrupts are asynchronous exceptions. Asynchronous exceptions that can be blocked or enabled by software are called maskable exceptions. Similarly, asynchronous exceptions that cannot be blocked by software are called non-maskable exceptions. Non-maskable exceptions are always acknowledged by the processor and processed immediately. Hardware-reset exceptions are always non-maskable exceptions. Many embedded processors have a dedicated non-maskable interrupt (NMI) request line. Any device connected to the NMI request line is allowed to generate an NMI.
External interrupts, with the exception of NMIs, are the only asynchronous exceptions that can be disabled by software.
Synchronous exceptions can be classified into precise and imprecise exceptions. With precise exception s, the processor's program counter points to the exact instruction that caused the exception, which is the offending instruction, and the processor knows where to resume execution upon return from the exception. With modern architectures that incorporate instruction and data pipelining, exceptions are raised to the processor in the order of written instruction, not in the order of execution. In particular, the architecture ensures that the instructions that follow the offending instruction and that were started in the instruction pipeline during the exception do not affect the CPU state. This chapter is concerned with precise exceptions.
Silicon vendors employ a number of advanced techniques (such as predictive instruction and data loading, instruction and data pipelining, and caching mechanisms) to streamline overall execution in order to increase chip performance. For example, the processor can do floating point and integer memory operations out of order with the non-sequential memory access mode. If an embedded processor implements heavy pipelining or pre-fetch algorithms, it can often be impossible to determine the exact instruction and associated data that caused an exception. This issue indicates an imprecise exception. Consequently, when some exceptions do occur, the reported program counter does not point to the offending instruction, which makes the program counter meaningless to the exception handler.
Why is it important to know this information? Knowing the type of exception for which an exception handler is written helps the programmer determine how the system is to recover from the exception, if the exception is at all recoverable.
- General
- 10.4 A Closer Look at Exceptions and Interrupts
- General concepts
- Appendix I. GNU General Public License
- 9.2.4. Traps, Exceptions, and Interrupts
- General Requirements
- General Security Considerations
- General Configuration Options Using the config File
- Using general-purpose commands
- Chapter 10: Exceptions and Interrupts
- 10.2 What are Exceptions and Interrupts?
- 10.3 Applications of Exceptions and Interrupts