Code for handling exceptions/interupts. More...
Files | |
file | irq.c |
Implementation of interrupt handling functions. | |
file | irq.h |
Definition of armv6 interrupt initialization functions. | |
file | irq.h |
Definition of armv8-a interrupt initialization functions. | |
file | irq.h |
Definition of interrupt handling functions. | |
Functions | |
void | irq_vector_init () |
void | irq_enable () |
void | irq_disable () |
void | enable_interrupt_controller () |
void | show_invalid_entry_message (int type, unsigned long esr, unsigned long address) |
void | handle_irq () |
void | handle_timer_1_irq () |
void | handle_timer_3_irq () |
void | handle_uart_irq () |
Code for handling exceptions/interupts.
void enable_interrupt_controller | ( | ) |
Enables System Timer and UART interrupts.
void handle_irq | ( | ) |
Exception handler for all IRQs.
Reads from the interrupt pending registers ( IRQ0_PENDING_0 or IRQ0_PENDING_1), and if a valid value is found we have an interrupt. Checks each bit for the interrupts we have enabled, and if it is set, it removes the bit we handled and calls the corresponding handler.
void handle_timer_1_irq | ( | ) |
Exception handler for System Timer 1.
Gets called when an interrupt is triggered from the System Timer 1.
void handle_timer_3_irq | ( | ) |
Exception handler for System Timer 3.
Gets called when an interrupt is triggered from the System Timer 3.
void handle_uart_irq | ( | ) |
Exception handler for the UART (Asynchronous read from the serial input).
Gets called when an interrupt is triggered from the UART. While the receiver holds a valid bit, reads the byte and echoes back.
\r
) char is found, it appends a New Line (\n
) char. void irq_disable | ( | ) |
Disables (Masks) interrupts.
void irq_enable | ( | ) |
Enables (Unmasks) interrupts.
void irq_vector_init | ( | ) |
Initializes interrupts, by moving the exception vector at address 0x0.
void show_invalid_entry_message | ( | int | type, |
unsigned long | esr, | ||
unsigned long | address | ||
) |
Prints information about the error, on an invalid exception.
type | Type of exception, defined in include/armv8-a/entry.h |
esr | Exception Syndrome Register (ESR), contains detailed information about what causes an exception. |
address | The address of the instruction that had been executed when the exception was generated. |