mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* PROBLEM: Compatibility problem with C++, i386 & ia64 platform
@ 2004-11-23 12:54 Joakim Bentholm XQ (AS/EAB)
  2004-11-23 19:47 ` Sam Ravnborg
  2004-11-25 15:54 ` Alan Cox
  0 siblings, 2 replies; 3+ messages in thread
From: Joakim Bentholm XQ (AS/EAB) @ 2004-11-23 12:54 UTC (permalink / raw)
  To: 'linux-kernel@vger.kernel.org'

1. Compatibility errors when including <asm/system.h> with g++ compiler on i386 and ia64 platforms.


If you want to use the memory barrier macros mb(), rmb() and wmb(), as defined in <asm/system.h>.

On i386 platform:
This will work if you use gcc, but not in g++, since the name of the parameter in the __cmpxchg(...) is new, which the C++ compiler will not accept. (new_val might have been a better choice ;-)

Function header
---
static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
				      unsigned long new, int size)
---


On Itanium 2 platform:
Compiling on Itanium 2 works if you add som typedefs and a define, which is normally defined when __KERNEL__ is enabled. 

Prepended rows to the include of system.h
---
#define __pa(x) x
typedef long s64;
typedef int s32;
typedef unsigned long u64;
typedef unsigned int u32;
#include <asm/system.h>
---


Maybe the system.h is not supposed to be included outside the kernel?
Is there a less crude way of getting hold of the macros?

Best Regards/JB

--
Joakim Bentholm
joakim.xq.bentholm@ericsson.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-11-27  1:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-23 12:54 PROBLEM: Compatibility problem with C++, i386 & ia64 platform Joakim Bentholm XQ (AS/EAB)
2004-11-23 19:47 ` Sam Ravnborg
2004-11-25 15:54 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®