| Ambos lados, revisión anterior
Revisión previa
Próxima revisión
|
Revisión previa
|
arm_interrupt_controllers [2024/05/29 13:53] cnigri [Controlador de Interrupciones Genérico] Mejora de redaccion |
arm_interrupt_controllers [2025/10/22 12:15] (actual) |
| {{ :arm_gic_partitioning.png?800 |GIC logical partitioning}} | {{ :arm_gic_partitioning.png?800 |GIC logical partitioning}} |
| |
| Si bien el diagrama presenta la arquitectura para múltiples núcleos (processors), en nuestro caso de uso (cortex A8) solo basta con reducir el esquema a un solo procesador. | Si bien el diagrama presenta la arquitectura para múltiples núcleos (processors), en nuestro caso de uso (inicialización mono procesador) solo basta con reducir el esquema a un solo procesador. |
| |
| Según la fuente, hay tres tipos principales de interrupciones definidas. | Según la fuente, hay tres tipos principales de interrupciones definidas. |
| CPU Interface base address CPUBASE = PERIPHBASE + 0x0000. | CPU Interface base address CPUBASE = PERIPHBASE + 0x0000. |
| |
| <code c> | El valor especifico de la dirección base se brinda en la documentación especifica de cada fabricante ([[https://developer.arm.com/documentation/dui0417/d/programmer-s-reference/generic-interrupt-controller--gic/generic-interrupt-controller-registers|PB-A8]], [[https://docs.amd.com/r/en-US/ug585-zynq-7000-SoC-TRM/CPU-Private-Bus-Registers|Zynq-7000]]) |
| | <code java> |
| #include <stddef.h> | #include <stddef.h> |
| /*GIC Register Definitions | /*GIC Register Definitions*/ |
| #define ICCICR *((uint32_t *) 0x1E000000) //CPU Interface Control Register | #if defined(__PB_A8__) |
| #define ICDDCR *((uint32_t *) 0x1E001000) //Distributor Control Register | #define GIC0_CPU_BASE 0x1E000000 |
| #define ICDICTR *((uint32_t *) 0x1E001004) //Interrupt Controller Type Register | #define GIC0_DISTRIBUTOR_BASE 0x1E001000 |
| #define ICDISER(n) *(((uint32_t *) 0x1E000100) + n) //Interrupt n Set-Enable Registers | #elif defined(i386) |
| #define ICDICER(n) *(((uint32_t *) 0x1E000180) + n) //Interrupt Clear-Enable Registers | #define GIC0_CPU_BASE 0xF8F00100 |
| #define ICDIPR(n) *(((uint32_t *) 0x1E000400) + n) //Interrupt Priority Registers | #define GIC0_DISTRIBUTOR_BASE 0xF8F01000 |
| #define ICDIPTR(n) *(((uint32_t *) 0x1E000800) + n) //Interrupt Processor Targets Registers | #endif |
| #define ICDICFR(n) *(((uint32_t *) 0x1E000C00) + n) //Interrupt Configuration Registers | |
| | #define ICCICR *((uint32_t *) GIC0_CPU_BASE + 0x00) //CPU Interface Control Register |
| | #define ICCPMR *((uint32_t *) GIC0_CPU_BASE + 0x04) //Interrupt Priority Mask Register |
| | #define ICCBPR *((uint32_t *) GIC0_CPU_BASE + 0x08) //Binary Point Register |
| | #define ICCIAR *((uint32_t *) GIC0_CPU_BASE + 0x0C) //Interrupt Acknowledge |
| | #define ICCEOIR *((uint32_t *) GIC0_CPU_BASE + 0x10) //End of Interrupt Register |
| | #define ICDDCR *((uint32_t *) GIC0_DISTRIBUTOR_BASE + 0x000) //Distributor Control Register |
| | #define ICDICTR *((uint32_t *) GIC0_DISTRIBUTOR_BASE + 0x004) //Interrupt Controller Type Register |
| | #define ICDISER(n) *(((uint32_t *) GIC0_DISTRIBUTOR_BASE + 0x100) + n) //Interrupt n Set-Enable Registers |
| | #define ICDICER(n) *(((uint32_t *) GIC0_DISTRIBUTOR_BASE + 0x180) + n) //Interrupt Clear-Enable Registers |
| | #define ICDIPR(n) *(((uint32_t *) GIC0_DISTRIBUTOR_BASE + 0x400) + n) //Interrupt Priority Registers |
| | #define ICDIPTR(n) *(((uint32_t *) GIC0_DISTRIBUTOR_BASE + 0x800) + n) //Interrupt Processor Targets Registers |
| | #define ICDICFR(n) *(((uint32_t *) GIC0_DISTRIBUTOR_BASE + 0xC00) + n) //Interrupt Configuration Registers |
| </code> | </code> |
| |