* Re: ifdef in asm/atomic.h
[not found] <1026183653.15084.43.camel@reykjavik.themountaingoats.net>
@ 2002-07-09 9:48 ` Benjamin Herrenschmidt
0 siblings, 0 replies; only message in thread
From: Benjamin Herrenschmidt @ 2002-07-09 9:48 UTC (permalink / raw)
To: nall, linuxppc-dev
>in /usr/src/linux/include/asm-ppc/atomic.h, an #ifdef __KERNEL__
>surrounds the contents of the file. this causes the GNU CommonC++ build
>to break on ppc (it wants to use atomic_* functions). i looked at the
>asm-i386/atomic.h, and it has no #ifdef __KERNEL__ guard. is there a
>reason ppc should have this and i386 should not? if you're not the right
>person to ask about this, sorry for the inbox clutter. just point me in
>the right direction.
Well, it was decided that userland should not rely on kernel implementation
of such functions, but rather re-implement it's own.
If you look at the atomic functions, you'll notice several problems if
you try to use them from userland
- the use of the SMP_ISYNC macro which depends on kernel config
options
- in 2_4_devel, the use of PPC405_ERR77 macro, which also depends
on kernel config options
- some of them might not be inlined (atomic_set/clear_mask) though
that should probably be fixed
You should probably re-implement them the "safest" way, that is using all
of the additional workarounds the kernel does (based on what the
linuxppc_2_4_devel tree does).
Ben.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-07-09 9:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1026183653.15084.43.camel@reykjavik.themountaingoats.net>
2002-07-09 9:48 ` ifdef in asm/atomic.h Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).