summaryrefslogtreecommitdiff
path: root/doc/src/05-Interrupt-Handling.md
blob: 0c549e166367bd153e11e36cfcabbfd3915f542e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Interrupt and Exception Handling

This chapter describes the interrupt and exception-handling mechanism on a
Vertex-32 or Vertex-64 processor.

## Interrupts Overview

Interrupts and exceptions are events that get triggered either upon a special
condition or when the instruction `INT interrupt_number` is executed. Typically,
an interrupt forces a transfer of execution from the currently executing task to
a special routine called an interrupt handler or an exception handler. The
action taken by a processor in response to an interrupt is referred to as
servicing or handling the interrupt or exception.

Interrupts can occur at regular intervals or randomly during the execution of a
task or software routine in response to signals from hardware, such as requests
from peripheral devices. Interrupts can also be generated by software by calling
the `INT` instruction.

Exceptions occur when the processor detects an error condition while executing
an instruction. For instance, the processor could detect that a program is
requesting a page that is currently not mapped, generating a page fault.

When an interrupt is received, the currently running task is suspended while the
processor services the interrupt or exception. Upon completion of the interrupt
handler, execution is returned to the suspended task without loss of continuity.
If the exception cannot be handled or the exception handler does not return, a
double fault is generated. If a further exception is encountered while servicing
the double fault, it is considered an unrecoverable error and the processor is
reset.