#include <stdio.h>#include "riscv.h"#include "type.h"#include "debug.h"#include "plic/plic.h"#include "irq_handler_stub.h"Go to the source code of this file.
Trap (Interrupt) and Exception Handling Definitions.
This file defines the entry point for all processor traps (trap_entry), as well as the C-level dispatchers for Interrupts (trap()) and Exceptions (crash()).
Definition in file mtrap.h.
Macros | |
| #define | STORE "sw" |
| Store Word (32-bit). | |
| #define | LOAD "lw" |
| Load Word (32-bit). | |
| #define | WORD 4 |
| Word size in bytes. | |
| #define | STR1(x) |
| Context Helper Only. | |
| #define | STR(x) |
| Context Helper Only. | |
Functions | |
Main Trap Entry Point (Naked). | |
Hardware vector target (written to mtvec). | |
| void | trap_entry (void) |
| The Main Trap Entry Point (Naked). | |
CPU Interrupt Handler. | |
Handle interrupt from external, timer, software interrupts.
| |
| int | irq_handleSoft (void) |
| Handlers for CPU interrupts (Software). | |
| int | irq_handleTimer (void) |
| Handlers for CPU interrupts (Timer). | |
| void | irq_handleExt (void) |
| External Interrupt Handler (PLIC). | |
Dispatcher/Exception Handlers (Function) | |
Trap Dispatcher mainly for external interrupt and exception handler.
| |
| void | trap (void) |
| Main C Trap Dispatcher. | |
| void | crash (void) |
| Fatal Exception Handler. | |