![]() |
SyterKit 0.4.0.x
SyterKit is a bare-metal framework
|
#include <io.h>#include <stdarg.h>#include <stdbool.h>#include <stddef.h>#include <stdint.h>#include <types.h>#include <log.h>#include <mmu.h>#include <reg-ncat.h>#include <sys-gic.h>
Functions | |
| static int | interrupts_is_open (void) |
| Get interrupts state. | |
| static void | gic_spi_set_target (int irq_no, int cpu_id) |
| Set the target CPU for a specific SPI interrupt. | |
| static void | gic_distributor_init (void) |
| Initialize the GIC distributor controller. | |
| static void | gic_cpuif_init (void) |
| static void | default_isr (void *data) |
| static void | gic_sgi_handler (uint32_t irq_no) |
| static void | gic_ppi_handler (uint32_t irq_no) |
| static void | gic_spi_handler (uint32_t irq_no) |
| static void | gic_clear_pending (uint32_t irq_no) |
| Clears the pending status of the specified IRQ in the GIC. | |
| int | arch_interrupt_init (void) |
| Initializes the interrupt mechanism. | |
| int | arch_interrupt_exit (void) |
| Exits the interrupt mechanism. | |
| int | sunxi_gic_cpu_interface_init (int cpu) |
| Initializes the Sunxi GIC CPU interface. | |
| int | sunxi_gic_cpu_interface_exit (void) |
| Exits the Sunxi GIC CPU interface. | |
| void | do_irq (struct arm_regs_t *regs) |
| Handles the IRQ with ARM registers. | |
| void | irq_free_handler (int irq) |
| Frees the resources associated with the specified IRQ handler. | |
| int | irq_enable (int irq_no) |
| Enables the specified IRQ. | |
| int | irq_disable (int irq_no) |
| Disables the specified IRQ. | |
| void | irq_install_handler (int irq, interrupt_handler_t handle_irq, void *data) |
| Installs a handler for the specified IRQ. | |
Variables | |
| static irq_handler_t | sunxi_int_handlers [GIC_IRQ_NUM] |
| int arch_interrupt_exit | ( | void | ) |
Exits the interrupt mechanism.
| int arch_interrupt_init | ( | void | ) |
Initializes the interrupt mechanism.
|
static |
| void do_irq | ( | struct arm_regs_t * | regs | ) |
Handles the IRQ with ARM registers.
| regs | Pointer to the ARM registers |
|
static |
Clears the pending status of the specified IRQ in the GIC.
| irq_no | IRQ number to clear pending status |
|
static |
|
static |
Initialize the GIC distributor controller.
| void |
|
static |
|
static |
|
static |
|
inlinestatic |
Set the target CPU for a specific SPI interrupt.
This inline function sets the target CPU for a specific SPI interrupt. It calculates the address of the target register based on the interrupt number, reads the current value of the register, modifies it to set the target CPU, and writes the modified value back to the register. The function assumes that the interrupt number is offset by 32 and that the maximum CPU ID is 15.
| irq_no | The interrupt number. |
| cpu_id | The CPU ID of the target CPU. |
|
inlinestatic |
Get interrupts state.
This inline function checks the state of interrupts. It reads the value of the CPSR register using assembly instructions and returns 1 if interrupts are open (CPSR bit 7 is cleared), otherwise it returns 0.
| int irq_disable | ( | int | irq_no | ) |
Disables the specified IRQ.
| irq_no | IRQ number to be disabled |
| int irq_enable | ( | int | irq_no | ) |
Enables the specified IRQ.
| irq_no | IRQ number to be enabled |
| void irq_free_handler | ( | int | irq | ) |
Frees the resources associated with the specified IRQ handler.
| irq | IRQ number |
| void irq_install_handler | ( | int | irq, |
| interrupt_handler_t | handle_irq, | ||
| void * | data | ||
| ) |
Installs a handler for the specified IRQ.
| irq | IRQ number |
| handle_irq | Function pointer to the interrupt handler function |
| data | Pointer to data associated with the interrupt handler |
| int sunxi_gic_cpu_interface_exit | ( | void | ) |
Exits the Sunxi GIC CPU interface.
| int sunxi_gic_cpu_interface_init | ( | int | cpu | ) |
Initializes the Sunxi GIC CPU interface.
| cpu | CPU identifier |
|
static |