forked from Imagelibrary/rtems
2005-04-18 Eric Valette <eric.valette@free.fr>
* irq/irq.c, irq/irq.h, irq/irq_asm.S, irq/irq_init.c: Added parameter to irq handler
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2005-04-18 Eric Valette <eric.valette@free.fr>
|
||||
|
||||
* irq/irq.c, irq/irq.h, irq/irq_asm.S, irq/irq_init.c: Added parameter
|
||||
to irq handler
|
||||
|
||||
2005-03-14 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
* pci/pcibios.c, pci/pcibios.h: Continue PCI API unification. All use
|
||||
|
||||
@@ -26,13 +26,6 @@
|
||||
*/
|
||||
rtems_i8259_masks irq_mask_or_tbl[BSP_IRQ_LINES_NUMBER];
|
||||
|
||||
/*
|
||||
* Copy of data given via initial BSP_rtems_irq_mngt_set() for
|
||||
* the sake of efficiency.
|
||||
* CAUTION : this table is accessed directly by interrupt routine
|
||||
* prologue.
|
||||
*/
|
||||
rtems_irq_hdl current_irq[BSP_IRQ_LINES_NUMBER];
|
||||
/*
|
||||
* default handler connected on each irq after bsp initialization
|
||||
*/
|
||||
@@ -43,7 +36,7 @@ static rtems_irq_connect_data default_rtems_entry;
|
||||
* management.
|
||||
*/
|
||||
static rtems_irq_global_settings* internal_config;
|
||||
static rtems_irq_connect_data* rtems_hdl_tbl;
|
||||
rtems_irq_connect_data* rtems_hdl_tbl;
|
||||
/*-------------------------------------------------------------------------+
|
||||
| Cache for 1st and 2nd PIC IRQ line's status (enabled or disabled) register.
|
||||
+--------------------------------------------------------------------------*/
|
||||
@@ -189,19 +182,6 @@ static void compute_i8259_masks_from_prio ()
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Caution : this function assumes the variable "internal_config"
|
||||
* is already set and that the tables it contains are still valid
|
||||
* and accessible.
|
||||
*/
|
||||
static void make_copy_of_handlers ()
|
||||
{
|
||||
int i;
|
||||
for (i=0; i < internal_config->irqNb; i++) {
|
||||
current_irq [i] = internal_config->irqHdlTbl[i].hdl;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This function check that the value given for the irq line
|
||||
* is valid.
|
||||
@@ -242,10 +222,6 @@ int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
|
||||
* store the data provided by user
|
||||
*/
|
||||
rtems_hdl_tbl[irq->name] = *irq;
|
||||
/*
|
||||
* update table used directly by rtems interrupt prologue
|
||||
*/
|
||||
current_irq [irq->name] = irq->hdl;
|
||||
/*
|
||||
* Enable interrupt at PIC level
|
||||
*/
|
||||
@@ -308,8 +284,6 @@ int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq)
|
||||
*/
|
||||
rtems_hdl_tbl[irq->name] = default_rtems_entry;
|
||||
|
||||
current_irq[irq->name] = default_rtems_entry.hdl;
|
||||
|
||||
_CPU_ISR_Enable(level);
|
||||
|
||||
return 1;
|
||||
@@ -335,7 +309,6 @@ int BSP_rtems_irq_mngt_set(rtems_irq_global_settings* config)
|
||||
* set up internal tables used by rtems interrupt prologue
|
||||
*/
|
||||
compute_i8259_masks_from_prio ();
|
||||
make_copy_of_handlers ();
|
||||
|
||||
for (i=0; i < internal_config->irqNb; i++) {
|
||||
if (rtems_hdl_tbl[i].hdl != default_rtems_entry.hdl) {
|
||||
@@ -379,3 +352,9 @@ void _ThreadProcessSignalsFromIrq (CPU_Exception_frame* ctx)
|
||||
* This will include DEBUG session requested from keyboard...
|
||||
*/
|
||||
}
|
||||
|
||||
void processIrq(unsigned index)
|
||||
{
|
||||
rtems_hdl_tbl[index].hdl(rtems_hdl_tbl[index].handle);
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,8 @@ extern rtems_i8259_masks i8259s_cache;
|
||||
|
||||
struct __rtems_irq_connect_data__; /* forward declaratiuon */
|
||||
|
||||
typedef void (*rtems_irq_hdl) (void);
|
||||
typedef void *rtems_irq_hdl_param;
|
||||
typedef void (*rtems_irq_hdl) (rtems_irq_hdl_param);
|
||||
typedef void (*rtems_irq_enable) (const struct __rtems_irq_connect_data__*);
|
||||
typedef void (*rtems_irq_disable) (const struct __rtems_irq_connect_data__*);
|
||||
typedef int (*rtems_irq_is_enabled) (const struct __rtems_irq_connect_data__*);
|
||||
@@ -84,6 +85,10 @@ typedef struct __rtems_irq_connect_data__ {
|
||||
* handler. See comment on handler properties below in function prototype.
|
||||
*/
|
||||
rtems_irq_hdl hdl;
|
||||
/*
|
||||
* Handler handle to store private data
|
||||
*/
|
||||
rtems_irq_hdl_param handle;
|
||||
/*
|
||||
* function for enabling interrupts at device level (ONLY!).
|
||||
* The BSP code will automatically enable it at i8259s level.
|
||||
|
||||
@@ -107,9 +107,13 @@ nested:
|
||||
*/
|
||||
|
||||
pushl ecx /* push vector number */
|
||||
mov SYM (current_irq) (,ecx,4),eax
|
||||
/* eax = Users handler */
|
||||
call *eax /* invoke user ISR */
|
||||
lea (ecx,ecx,2), eax
|
||||
mov SYM (rtems_hdl_tbl), edx
|
||||
shl $0x3,eax
|
||||
pushl 0x8(edx,eax,1) /* push hdl argument */
|
||||
call *0x4(edx,eax,1) /* call hdl */
|
||||
addl $4, esp
|
||||
|
||||
/*
|
||||
* disable interrupts_again
|
||||
*/
|
||||
|
||||
@@ -81,8 +81,8 @@ static rtems_raw_irq_connect_data defaultRawIrq = {
|
||||
};
|
||||
|
||||
static rtems_irq_connect_data defaultIrq = {
|
||||
/* vectorIdex, hdl , on , off , isOn */
|
||||
0, nop_func , nop_func , nop_func , not_connected
|
||||
/* vectorIdex, hdl , handle , on , off , isOn */
|
||||
0, nop_func , 0 , nop_func , nop_func , not_connected
|
||||
};
|
||||
|
||||
static rtems_irq_prio irqPrioTable[BSP_IRQ_LINES_NUMBER]={
|
||||
|
||||
Reference in New Issue
Block a user