Chapter 10 PDF
Chapter 10 PDF
Embedded Systems
ISBN: 1-57820-124-1
CMPBooks
Chapter 10
Exceptions and Interrupts
Outline
10.1 Introduction
10.2 What are Exceptions and Interrupts?
10.3 Applications of Exceptions and Interrupts
10.4 A Closer Look at Exceptions and Interrupts
10.5 Processing General Exceptions
10.6 The Nature of Spurious Interrupts
10.1 Introduction
Exceptions and interrupts
Provided by most of the processor architectures to
allow for the disruption of the processor's normal
execution path
Many operating systems provide wrapper
functions to handle exceptions and interrupts
To shield the embedded programmer from low-
level details
10.2 What are Exceptions and
Interrupts?
Exception
Any event that disrupts the normal execution of
the processor and forces the processor into
execution of special instructions in a privileged
state
Two categories:
Synchronous exceptions
Asynchronous exceptions
What are Exceptions and Interrupts?
(Cont.)
Synchronous exceptions (exception)
Raised by internal events, such as events generated by the
execution of processor instructions
For example, alignment exception, division by zero
Hardware concurrency
Exception frame
also called the interrupt stack in the context of
asynchronous exceptions
Exception Frame
Two main reasons exist for needing an
exception frame:
To handle nested exceptions
Pass parameters during function invocation in a
high-level programming language, such as C
The common approach to the exception frame:
ESR or ISR allocates a block of memory, either
statically or dynamically, before installing itself
into the system
Switching SP to Exception Frame
Differences Between ESR and ISR
An ESR in many cases cannot prevent other
exceptions from occurring