[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
rtems_interrupt_is_in_progress() not working.
- Date: Sat, 9 Jan 2010 09:38:20 -0600
- From: joel.sherrill at OARcorp.com (Joel Sherrill)
- Subject: rtems_interrupt_is_in_progress() not working.
On 01/09/2010 03:58 AM, Nick Thomas wrote:
> Hi, I have the following function, which tries to obtain a semaphore, but
> first checking that we are not inside an ISR.
>
> But, it doesn't work.
>
>
Which architecture?
Can you set up a simple test like the one I have attached and try
it? The attached test sends a signal from an ISR. It is pretty small.
Then it either works or doesn't and I can look at it. :)
> It crashes in rtems_semaphore_obtain call, and the debugger shows that there
> is an RTEMS error 18, which corresponds to doing the wrong thing inside an
> ISR ( I think ).
>
> So, why doesn't rtems_interrupt_is_in_progress() detect that the call is
> inside an ISR?
>
> --- SNIP ---
> Void Lock(void)
> {
> rtems_status_code stat;
>
> if (rtems_interrupt_is_in_progress() == FALSE)
> {
> stat = rtems_semaphore_obtain(M_The_mutex, RTEMS_WAIT, 0);
> if (stat != RTEMS_SUCCESSFUL)
> {
> printf("Lock: rtems_semaphore_obtain returned %d\n",
> stat);
> }
> }
> }
> --- END ---
>
> -----------------------------
> Nick Thomas
> Email: nick.thomas at pixsan.com
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-users
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: from_isr.tar.bz2
Type: application/x-bzip
Size: 1522 bytes
Desc: not available
URL: <http://www.rtems.org/pipermail/rtems-users/attachments/20100109/702e1f67/attachment.bin>