6 years, 5 months ago.

Where can I find the source code for function __svcMutexAcquire() ?

Hello, I am interested in having a look at how a mutex is actually implemented in Mbed OS 5 (just to find out whether it temporarily disables interrupts or uses LDREX/STREX), but I am unable to find the low level source code. I found out that osMutexAcquire() in rtx_mutex.c calls function svcMutexAcquire().

But where can I find the source code for function svcMutexAcquire() ?

1 Answer

6 years, 5 months ago.

The source code for mbed-os can be found here : github.com/armmbed/mbed-os

Cheers,

-Austin

Accepted Answer

Thank you for your response.

Apparently calling svcMutexAcquire() results in a call to function svcRtxMutexAcquire(), within the context of the SVC exception handler. Thanks to this SVC context no further critical sections are needed to acquire mutual exclusive access to the scheduler's internal data structures. Brilliant!

posted by Henk Dekker 28 Nov 2017