[EXTERNAL] rtems_semaphore routines on SMP systems

Heinz Junkes junkes at fhi-berlin.mpg.de
Tue Sep 28 10:24:18 UTC 2021


Hallo Sebastian,

in EPICS osdMutex the semaphore is created like this:

sc = rtems_semaphore_create (rtems_build_name ('M', c3, c2, c1),
        1,
        RTEMS_PRIORITY|RTEMS_BINARY_SEMAPHORE|RTEMS_INHERIT_PRIORITY|RTEMS_NO_PRIORITY_CEILING|RTEMS_LOCAL,
        0,
        &sid);
    if (sc != RTEMS_SUCCESSFUL) {
        errlogPrintf ("Can't create mutex semaphore: %s\n", rtems_status_text (sc));
        return NULL;
    }

The implementation: 
https://github.com/epics-base/epics-base/blob/7.0/modules/libcom/src/osi/os/RTEMS-score/osdMutex.c

Viele Grüße und Danke
Heinz 


> On 28. Sep 2021, at 12:02, Sebastian Huber <sebastian.huber at embedded-brains.de> wrote:
> 
> On 28/09/2021 11:46, Heinz Junkes wrote:
>> Unfortunately we found out that EPICS uses the mutex handling also in the interrupt context
>> and this leads to core-dumps in RTEMS :-(
> 
> Yes, using any kind of mutexes in interrupt context is undefined behaviour. Mutexes may only be used from threads.
> 
> Which RTEMS semaphore classes do you use in EPICS and in particular which classes do you use in interrupt context?
> 
> -- 
> embedded brains GmbH
> Herr Sebastian HUBER
> Dornierstr. 4
> 82178 Puchheim
> Germany
> email: sebastian.huber at embedded-brains.de
> phone: +49-89-18 94 741 - 16
> fax:   +49-89-18 94 741 - 08
> 
> Registergericht: Amtsgericht München
> Registernummer: HRB 157899
> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> Unsere Datenschutzerklärung finden Sie hier:
> https://embedded-brains.de/datenschutzerklaerung/



More information about the users mailing list