From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: nall <nall@themountaingoats.net>, <linuxppc-dev@lists.linuxppc.org>
Subject: Re: ifdef in asm/atomic.h
Date: Tue, 9 Jul 2002 11:48:16 +0200 [thread overview]
Message-ID: <20020709094816.5908@192.168.4.1> (raw)
In-Reply-To: <1026183653.15084.43.camel@reykjavik.themountaingoats.net>
>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/
parent reply other threads:[~2002-07-09 9:48 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1026183653.15084.43.camel@reykjavik.themountaingoats.net>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020709094816.5908@192.168.4.1 \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@lists.linuxppc.org \
--cc=nall@themountaingoats.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).