Currently, there are a couple MRs open that aim to add resource synchronization locking protocols to RTEMS that can be used by semaphores. Each locking protocol has a yes/no bit in the overall RTEMS attributes mask, but to extend support for more locking protocols in the future, a 2-3 bits semaphore kind mask has been proposed here: !882. More discussion in !1358 as well.
A 3-bit mask gives up to 8 locking protocol options. One of those options would be no protocol of course (000), but then each specific locking protocol (ICPP, PIP, MrsP, etc.) would have its own unique 3-bit pattern.
I’m interesting in knowing what the community thinks of this approach and about any other points to consider as well!