forked from Imagelibrary/rtems
2003-08-21 Till Strauman <strauman@slac.stanford.edu>
PR 456/bsps * irq/irq.c: Fix race condition when installing an ISR.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2003-08-21 Till Strauman <strauman@slac.stanford.edu>
|
||||||
|
|
||||||
|
PR 456/bsps
|
||||||
|
* irq/irq.c: Fix race condition when installing an ISR.
|
||||||
|
|
||||||
2003-08-16 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
2003-08-16 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||||
|
|
||||||
* Makefile.am: Reflect having moved automake/.
|
* Makefile.am: Reflect having moved automake/.
|
||||||
|
|||||||
@@ -235,10 +235,11 @@ int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
|
|||||||
* RATIONALE : to always have the same transition by forcing the user
|
* RATIONALE : to always have the same transition by forcing the user
|
||||||
* to get the previous handler before accepting to disconnect.
|
* to get the previous handler before accepting to disconnect.
|
||||||
*/
|
*/
|
||||||
|
_CPU_ISR_Disable(level);
|
||||||
if (rtems_hdl_tbl[irq->name].hdl != default_rtems_entry.hdl) {
|
if (rtems_hdl_tbl[irq->name].hdl != default_rtems_entry.hdl) {
|
||||||
|
_CPU_ISR_Enable(level);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
_CPU_ISR_Disable(level);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* store the data provided by user
|
* store the data provided by user
|
||||||
@@ -265,10 +266,14 @@ int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
|
|||||||
|
|
||||||
int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* irq)
|
int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* irq)
|
||||||
{
|
{
|
||||||
|
unsigned int level;
|
||||||
|
|
||||||
if (!isValidInterrupt(irq->name)) {
|
if (!isValidInterrupt(irq->name)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
_CPU_ISR_Disable(level);
|
||||||
*irq = rtems_hdl_tbl[irq->name];
|
*irq = rtems_hdl_tbl[irq->name];
|
||||||
|
_CPU_ISR_Enable(level);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,10 +291,11 @@ int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq)
|
|||||||
* RATIONALE : to always have the same transition by forcing the user
|
* RATIONALE : to always have the same transition by forcing the user
|
||||||
* to get the previous handler before accepting to disconnect.
|
* to get the previous handler before accepting to disconnect.
|
||||||
*/
|
*/
|
||||||
|
_CPU_ISR_Disable(level);
|
||||||
if (rtems_hdl_tbl[irq->name].hdl != irq->hdl) {
|
if (rtems_hdl_tbl[irq->name].hdl != irq->hdl) {
|
||||||
|
_CPU_ISR_Enable(level);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
_CPU_ISR_Disable(level);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* disable interrupt at PIC level
|
* disable interrupt at PIC level
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
2003-08-21 Till Strauman <strauman@slac.stanford.edu>
|
||||||
|
|
||||||
|
PR 456/bsps
|
||||||
|
* irq/irq.c: Fix race condition when installing an ISR.
|
||||||
|
|
||||||
2003-08-16 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
2003-08-16 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||||
|
|
||||||
* Makefile.am: Reflect having moved automake/.
|
* Makefile.am: Reflect having moved automake/.
|
||||||
|
|||||||
@@ -131,12 +131,14 @@ int BSP_install_rtems_shared_irq_handler (const rtems_irq_connect_data* irq)
|
|||||||
printk("Invalid interrupt vector %d\n",irq->name);
|
printk("Invalid interrupt vector %d\n",irq->name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_CPU_ISR_Disable(level);
|
||||||
|
|
||||||
if ( (int)rtems_hdl_tbl[irq->name].next_handler == -1 ) {
|
if ( (int)rtems_hdl_tbl[irq->name].next_handler == -1 ) {
|
||||||
|
_CPU_ISR_Enable(level);
|
||||||
printk("IRQ vector %d already connected to an unshared handler\n",irq->name);
|
printk("IRQ vector %d already connected to an unshared handler\n",irq->name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
_CPU_ISR_Disable(level);
|
|
||||||
|
|
||||||
|
|
||||||
vchain = (rtems_irq_connect_data*)malloc(sizeof(rtems_irq_connect_data));
|
vchain = (rtems_irq_connect_data*)malloc(sizeof(rtems_irq_connect_data));
|
||||||
|
|
||||||
@@ -201,11 +203,12 @@ int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
|
|||||||
* RATIONALE : to always have the same transition by forcing the user
|
* RATIONALE : to always have the same transition by forcing the user
|
||||||
* to get the previous handler before accepting to disconnect.
|
* to get the previous handler before accepting to disconnect.
|
||||||
*/
|
*/
|
||||||
|
_CPU_ISR_Disable(level);
|
||||||
if (rtems_hdl_tbl[irq->name].hdl != default_rtems_entry.hdl) {
|
if (rtems_hdl_tbl[irq->name].hdl != default_rtems_entry.hdl) {
|
||||||
|
_CPU_ISR_Enable(level);
|
||||||
printk("IRQ vector %d already connected\n",irq->name);
|
printk("IRQ vector %d already connected\n",irq->name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
_CPU_ISR_Disable(level);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* store the data provided by user
|
* store the data provided by user
|
||||||
@@ -245,10 +248,14 @@ int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
|
|||||||
|
|
||||||
int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* irq)
|
int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* irq)
|
||||||
{
|
{
|
||||||
|
unsigned int level;
|
||||||
|
|
||||||
if (!isValidInterrupt(irq->name)) {
|
if (!isValidInterrupt(irq->name)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
_CPU_ISR_Disable(level);
|
||||||
*irq = rtems_hdl_tbl[irq->name];
|
*irq = rtems_hdl_tbl[irq->name];
|
||||||
|
_CPU_ISR_Enable(level);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -267,10 +274,11 @@ int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq)
|
|||||||
* RATIONALE : to always have the same transition by forcing the user
|
* RATIONALE : to always have the same transition by forcing the user
|
||||||
* to get the previous handler before accepting to disconnect.
|
* to get the previous handler before accepting to disconnect.
|
||||||
*/
|
*/
|
||||||
|
_CPU_ISR_Disable(level);
|
||||||
if (rtems_hdl_tbl[irq->name].hdl != irq->hdl) {
|
if (rtems_hdl_tbl[irq->name].hdl != irq->hdl) {
|
||||||
|
_CPU_ISR_Enable(level);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
_CPU_ISR_Disable(level);
|
|
||||||
|
|
||||||
if( (int)rtems_hdl_tbl[irq->name].next_handler != -1 )
|
if( (int)rtems_hdl_tbl[irq->name].next_handler != -1 )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user