Embedded Xinu Operating System
An ongoing research project and educational operating system.
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
Data Structures | Macros | Functions | Variables
dispatch.c File Reference
#include <interrupt.h>
#include <kernel.h>
#include <stddef.h>
#include "bcm2837.h"

Data Structures

struct  bcm2835_interrupt_registers
 

Macros

#define BCM2835_NUM_GPU_SHARED_IRQS   64
 
#define BCM2835_NUM_ARM_SPECIFIC_IRQS   8
 
#define BCM2835_NUM_IRQS   (BCM2835_NUM_GPU_SHARED_IRQS + BCM2835_NUM_ARM_SPECIFIC_IRQS)
 

Functions

void dispatch (void)
 
void enable_irq (irqmask irq_num)
 
void disable_irq (irqmask irq_num)
 

Variables

interrupt_handler_t interruptVector [BCM2835_NUM_IRQS]
 

Detailed Description

This file contains code that interfaces with the interrupt controller of the BCM2835 SoC used in the Raspberry Pi.

This "interrupt controller" is, more specifically, the interrupt controller used by the ARM processor on the BCM2835. That is, this interrupt controller controls which IRQs the ARM receives. The VideoCore co-processor likely has its own (undocumented) way to control IRQs to itself.

See http://xinu-os.org/BCM2835_Interrupt_Controller for additional information.

Function Documentation

void disable_irq ( irqmask  irq_num)

Disable an interrupt request line.

Parameters
irq_numindex of the interrupt to disable, which must be valid on the current platform.
void dispatch ( void  )

Processes all pending interrupt requests.

On the BCM2837 (Raspberry Pi3), this done by iterating through all registered interrupts on the ARM and checking whether each one is pending. This is not necessarily the fastest way to do it, but this should minimize problems with the poorly-documented hardware and conflicts with the GPU.

void enable_irq ( irqmask  irq_num)

Enable an interrupt request line.

Parameters
irq_numindex of the interrupt to enable, which must be valid on the current platform.

Variable Documentation

interrupt_handler_t interruptVector[BCM2835_NUM_IRQS]

Table of Xinu's interrupt handler functions. This is an array mapping IRQ numbers to handler functions.