BeRTOS
Defines | Functions | Variables
sysirq_at91.c File Reference

System IRQ handler for Atmel AT91 ARM7 processors. More...

#include "sysirq_at91.h"
#include <io/arm.h>
#include <cpu/irq.h>
#include <cpu/types.h>
#include <cfg/module.h>
#include <cfg/macros.h>

Go to the source code of this file.

Defines

#define SYSIRQ_PRIORITY   0
 default priority for system irqs.

Functions

void pit_setEnable (bool enable)
 Enable/disable the Periodic Interrupt Timer interrupt.
static DECLARE_ISR_CONTEXT_SWITCH (sysirq_dispatcher)
 System IRQ dispatcher.
void sysirq_init (void)
 Init system IRQ handling.
void sysirq_setHandler (sysirq_t irq, sysirq_handler_t handler)
 Helper function used to set handler for system IRQ irq.
void sysirq_setEnable (sysirq_t irq, bool enable)
 Helper function used to enable/disable system IRQ irq.
bool sysirq_enabled (sysirq_t irq)
 Helper function used to get system IRQ irq state.

Variables

static SysIrq sysirq_tab []
 Table containing all system irqs.

Detailed Description

System IRQ handler for Atmel AT91 ARM7 processors.

Author:
Francesco Sacchi <batt@develer.com>

In Atmel AT91 ARM7TDMI processors, there are various peripheral interrupt sources. In general, every source has its own interrupt vector, so it is possible to assign a specific handler for each interrupt independently. However, there are a few sources called "system sources" that share a common IRQ line and vector, called "system IRQ". So a unique system IRQ dispatcher is implemented here. This module also contains an interface to manage every source independently. It is possible to assign to every system IRQ a specific IRQ handler.

See also:
sysirq_setHandler
sysirq_setEnable

Definition in file sysirq_at91.c.


Function Documentation

static DECLARE_ISR_CONTEXT_SWITCH ( sysirq_dispatcher  ) [static]

System IRQ dispatcher.

This is the entry point for all system IRQs in AT91. This function checks for interrupt enable state of various sources (system timer, etc..) and calls the corresponding handler.

Note:
On AT91SAM7, all system IRQs (timer included) are handled by the sysirq_dispatcher, so we can't differentiate between context-switch and non-context-switch ISR inside this class of IRQs.

Definition at line 101 of file sysirq_at91.c.

void sysirq_init ( void  )

Init system IRQ handling.

Note:
all system interrupts are disabled.

Definition at line 125 of file sysirq_at91.c.