Skip to contentSkip to conversation

atomic_t in userspace

Xenomai-help Steven Seeger 2 participants 2 messages Feb 15, 2006

lore
Share & tools
lore
#0 lore raw

I just upgraded to the latest SVN after a few months of hiatus, and my userspace app that used atomic_t through nucleus/asm/atomic.h no longer works. It says it can't find atomic_t, and it seems that all the atomic operations have been put inside a kernel only #if. Is there another way to use atomics in my shadowed threads from userspace? Is there any equivalent?

Steven

#1 lore raw
Quoted 6 lines · Steven Seeger

I just upgraded to the latest SVN after a few months of hiatus, and my userspace app that used atomic_t through nucleus/asm/atomic.h no longer works. It says it can't find atomic_t, and it seems that all the atomic operations have been put inside a kernel only #if. Is there another way to use atomics in my shadowed threads from userspace? Is there any equivalent?

Atomic ops were formerly obtained by including linux/include/asm/atomic.h, and doing so from user-space context caused a number of troubles, notably to C++ users. Additionally, doing so was clearly bad practice since we would cause namespace pollution and all sort of conflicts with kernel-only symbols. For this reason, it has been decided to (re-)implement the very few atomic ops we need in the user-space section of xenomai/include/asm-*/atomic.h, instead of reading them from the kernel file(s). But since atomic counters are not needed (anymore) by Xenomai's user-space code, they have not been provided.

You should implement your local copy of the missing stuff, or directly include linux/include/asm/atomic.h from your own headers, but at your own risk.

Quoted 8 lines

Steven

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Signature · 1 line
Philippe.