forked from Imagelibrary/rtems
2007-11-06 Till Straumann <strauman@slac.stanford.edu>
* mpc5xx/irq/irq.c, mpc5xx/exceptions/raw_exception.c, new-exceptions/raw_exception.c: test for non-NULL-ness before calling 'on'/'off' methods so that users don't have to provide no-ops if they don't want this feature.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2007-11-06 Till Straumann <strauman@slac.stanford.edu>
|
||||
|
||||
* mpc5xx/irq/irq.c, mpc5xx/exceptions/raw_exception.c,
|
||||
new-exceptions/raw_exception.c: test for non-NULL-ness before calling
|
||||
'on'/'off' methods so that users don't have to provide
|
||||
no-ops if they don't want this feature.
|
||||
|
||||
2007-10-25 Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
|
||||
|
||||
* mpc83xx/network/tsec.c:
|
||||
|
||||
@@ -95,7 +95,8 @@ int mpc5xx_set_exception (const rtems_raw_except_connect_data* except)
|
||||
raw_except_table[except->exceptIndex] = *except;
|
||||
|
||||
exception_handler_table[except->exceptIndex] = except->hdl.raw_hdl;
|
||||
except->on(except);
|
||||
if (except->on)
|
||||
except->on(except);
|
||||
|
||||
rtems_interrupt_enable(level);
|
||||
return 1;
|
||||
@@ -132,7 +133,8 @@ int mpc5xx_delete_exception (const rtems_raw_except_connect_data* except)
|
||||
|
||||
rtems_interrupt_disable(level);
|
||||
|
||||
except->off(except);
|
||||
if (except->off)
|
||||
except->off(except);
|
||||
exception_handler_table[except->exceptIndex] =
|
||||
default_raw_except_entry.hdl.raw_hdl;
|
||||
|
||||
@@ -168,10 +170,12 @@ int mpc5xx_init_exceptions (rtems_raw_except_global_settings* config)
|
||||
exception_handler_table[i] = raw_except_table[i].hdl.raw_hdl;
|
||||
|
||||
if (raw_except_table[i].hdl.raw_hdl != default_raw_except_entry.hdl.raw_hdl) {
|
||||
raw_except_table[i].on(&raw_except_table[i]);
|
||||
if (raw_except_table[i].on)
|
||||
raw_except_table[i].on(&raw_except_table[i]);
|
||||
}
|
||||
else {
|
||||
raw_except_table[i].off(&raw_except_table[i]);
|
||||
if (raw_except_table[i].off)
|
||||
raw_except_table[i].off(&raw_except_table[i]);
|
||||
}
|
||||
}
|
||||
rtems_interrupt_enable(level);
|
||||
|
||||
@@ -252,7 +252,8 @@ int CPU_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
|
||||
/*
|
||||
* Enable interrupt on device
|
||||
*/
|
||||
irq->on(irq);
|
||||
if (irq->on)
|
||||
irq->on(irq);
|
||||
|
||||
rtems_interrupt_enable(level);
|
||||
|
||||
@@ -291,7 +292,8 @@ int CPU_remove_rtems_irq_handler (const rtems_irq_connect_data* irq)
|
||||
/*
|
||||
* Disable interrupt on device
|
||||
*/
|
||||
irq->off(irq);
|
||||
if (irq->off)
|
||||
irq->off(irq);
|
||||
|
||||
if (is_uimb_irq(irq->name)) {
|
||||
/*
|
||||
@@ -345,10 +347,12 @@ int CPU_rtems_irq_mngt_set (rtems_irq_global_settings* config)
|
||||
for (i = CPU_UIMB_IRQ_MIN_OFFSET; i <= CPU_UIMB_IRQ_MAX_OFFSET ; i++) {
|
||||
if (rtems_hdl_tbl[i].hdl != default_rtems_entry.hdl) {
|
||||
CPU_irq_enable_at_uimb (i);
|
||||
rtems_hdl_tbl[i].on(&rtems_hdl_tbl[i]);
|
||||
if (rtems_hdl_tbl[i].on)
|
||||
rtems_hdl_tbl[i].on(&rtems_hdl_tbl[i]);
|
||||
}
|
||||
else {
|
||||
rtems_hdl_tbl[i].off(&rtems_hdl_tbl[i]);
|
||||
if (rtems_hdl_tbl[i].off)
|
||||
rtems_hdl_tbl[i].off(&rtems_hdl_tbl[i]);
|
||||
CPU_irq_disable_at_uimb (i);
|
||||
}
|
||||
}
|
||||
@@ -362,10 +366,12 @@ int CPU_rtems_irq_mngt_set (rtems_irq_global_settings* config)
|
||||
for (i = CPU_USIU_IRQ_MIN_OFFSET; i <= CPU_USIU_IRQ_MAX_OFFSET ; i++) {
|
||||
if (rtems_hdl_tbl[i].hdl != default_rtems_entry.hdl) {
|
||||
CPU_irq_enable_at_usiu (i);
|
||||
rtems_hdl_tbl[i].on(&rtems_hdl_tbl[i]);
|
||||
if (rtems_hdl_tbl[i].on)
|
||||
rtems_hdl_tbl[i].on(&rtems_hdl_tbl[i]);
|
||||
}
|
||||
else {
|
||||
rtems_hdl_tbl[i].off(&rtems_hdl_tbl[i]);
|
||||
if (rtems_hdl_tbl[i].off)
|
||||
rtems_hdl_tbl[i].off(&rtems_hdl_tbl[i]);
|
||||
CPU_irq_disable_at_usiu (i);
|
||||
}
|
||||
}
|
||||
@@ -381,10 +387,12 @@ int CPU_rtems_irq_mngt_set (rtems_irq_global_settings* config)
|
||||
*/
|
||||
for (i = CPU_PROC_IRQ_MIN_OFFSET; i <= CPU_PROC_IRQ_MAX_OFFSET; i++) {
|
||||
if (rtems_hdl_tbl[i].hdl != default_rtems_entry.hdl) {
|
||||
rtems_hdl_tbl[i].on(&rtems_hdl_tbl[i]);
|
||||
if (rtems_hdl_tbl[i].on)
|
||||
rtems_hdl_tbl[i].on(&rtems_hdl_tbl[i]);
|
||||
}
|
||||
else {
|
||||
rtems_hdl_tbl[i].off(&rtems_hdl_tbl[i]);
|
||||
if (rtems_hdl_tbl[i].off)
|
||||
rtems_hdl_tbl[i].off(&rtems_hdl_tbl[i]);
|
||||
}
|
||||
}
|
||||
rtems_interrupt_enable(level);
|
||||
|
||||
@@ -415,7 +415,8 @@ int ppc_set_exception (const rtems_raw_except_connect_data* except)
|
||||
except->hdl.raw_hdl,
|
||||
except->hdl.raw_hdl_size,
|
||||
PPC_CACHE_ALIGNMENT);
|
||||
except->on(except);
|
||||
if (except->on)
|
||||
except->on(except);
|
||||
|
||||
_ISR_Enable(level);
|
||||
return 1;
|
||||
@@ -453,7 +454,8 @@ int ppc_delete_exception (const rtems_raw_except_connect_data* except)
|
||||
}
|
||||
_ISR_Disable(level);
|
||||
|
||||
except->off(except);
|
||||
if (except->off)
|
||||
except->off(except);
|
||||
codemove((void*)ppc_get_vector_addr(except->exceptIndex),
|
||||
default_raw_except_entry.hdl.raw_hdl,
|
||||
default_raw_except_entry.hdl.raw_hdl_size,
|
||||
@@ -494,10 +496,12 @@ int ppc_init_exceptions (rtems_raw_except_global_settings* config)
|
||||
raw_except_table[i].hdl.raw_hdl_size,
|
||||
PPC_CACHE_ALIGNMENT);
|
||||
if (raw_except_table[i].hdl.raw_hdl != default_raw_except_entry.hdl.raw_hdl) {
|
||||
raw_except_table[i].on(&raw_except_table[i]);
|
||||
if (raw_except_table[i].on)
|
||||
raw_except_table[i].on(&raw_except_table[i]);
|
||||
}
|
||||
else {
|
||||
raw_except_table[i].off(&raw_except_table[i]);
|
||||
if (raw_except_table[i].off)
|
||||
raw_except_table[i].off(&raw_except_table[i]);
|
||||
}
|
||||
}
|
||||
_ISR_Enable(level);
|
||||
|
||||
Reference in New Issue
Block a user