rtems_interrupt_catch(): installing old handler
Ingolf Steinbach
Ingolf.Steinbach at jena-optronik.de
Fri Oct 7 11:35:35 UTC 2005
Hi,
in my code, I am using something like the following (simplified)
code to install and deinstall an ISR (RTEMS 4.6.1 using the
leon2 BSP):
#include <rtems.h>
#include <assert.h>
[...]
rtems_isr_entry oldInterruptHandler = NULL;
rtems_isr_entry dummy = NULL;
rtems_status_code const result =
rtems_interrupt_catch(
newHandler, trapNumber,
&oldInterruptHandler);
assert(RTEMS_SUCCESSFUL == result); /* first assertion */
/* do something */
[...]
/* install the old handler */
result =
rtems_interrupt_catch(
oldInterruptHandler, trapNumber,
&dummy);
assert(RTEMS_SUCCESSFUL == result); /* second assertion */
The first assertion succeeds. The newHandler ISR is installed
and is indeed called when the associated interrupt is received.
However, the second assertion fails because result indicates
an RTEMS_INVALID_ADRESS error (probably because the first
rtems_interrupt_catch() returned a NULL oldInterruptHandler).
How can I de-install an interrupt handler?
Kind regards
Ingolf
PS: I know that 4.6.1 is not the latest 4.6.x release but I
did not find any changes related to the above problem
in the change logs.
--
Ingolf Steinbach Jena-Optronik GmbH
ingolf.steinbach at jena-optronik.de ++49 3641 200-147
PGP: 0x7B3B5661 213C 828E 0C92 16B5 05D0 4D5B A324 EC04
More information about the users
mailing list