linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Ben Stanley <bds02@uow.edu.au>
To: linuxppc-dev@lists.linuxppc.org
Subject: [PATCH] remove #ifdef __KERNEL__ from atomic.h
Date: Wed, 25 Sep 2002 15:11:16 +1000	[thread overview]
Message-ID: <3D914574.7030300@uow.edu.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 658 bytes --]

Hi,

I was trying to compile sumji (formerly xtunes), which requires
libCommonC++. I found that libCommonC++ would not compile, because it
needs to use the atomic functions declared in include/asm-ppc/atomic.h .
However, this file does not declare these functions unless __KERNEL__ is
defined. I believe that this is incorrect.

I have checked the i386 and s390 versions of atomic.h and they declare
the atomic functions regardless of the status of the __KERNEL__ macro.
Therefore I propose that it should be removed from asm-ppc/atomic.h, and
have attached a patch to effect this.

With this patch applied, I am able to compile libCommonC++.

Ben Stanley.


[-- Attachment #2: atomic_ppc.patch --]
[-- Type: text/plain, Size: 449 bytes --]

--- include/asm-ppc/atomic.h.orig	Wed Sep 25 07:49:12 2002
+++ include/asm-ppc/atomic.h	Wed Sep 25 07:49:32 2002
@@ -10,8 +10,6 @@

 typedef struct { volatile int counter; } atomic_t;

-#ifdef __KERNEL__
-
 #define ATOMIC_INIT(i)	{ (i) }

 #define atomic_read(v)		((v)->counter)
@@ -181,5 +179,4 @@
 #define smp_mb__before_atomic_inc()	smp_mb()
 #define smp_mb__after_atomic_inc()	smp_mb()

-#endif /* __KERNEL__ */
 #endif /* _ASM_PPC_ATOMIC_H_ */

             reply	other threads:[~2002-09-25  5:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-25  5:11 Ben Stanley [this message]
2002-09-25  7:12 ` [PATCH] remove #ifdef __KERNEL__ from atomic.h Ethan Benson
2002-09-25  7:44 ` Paul Mackerras
2002-09-26  0:47   ` Ben Stanley
2002-09-25  8:45 ` Benjamin Herrenschmidt

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=3D914574.7030300@uow.edu.au \
    --to=bds02@uow.edu.au \
    --cc=linuxppc-dev@lists.linuxppc.org \
    /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).