lkml.org 
[lkml]   [2000]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject2.2.18 asm-alpha/system.h has a problem
Date
From
Hi, all.

I encounterd the problem that 'cdrdao' is not compilable in 2.2.18 on
Alpha. And I researched a little.
So, then new code added in include/asm-alpha/system.h on 2.2.18 has a
problem in C++. The 'new' may be the reserved word in C++. And I send
its patch.

Regards
Daiki Matsuda
--- linux/include/asm-alpha/system.h.old Sun Dec 17 17:53:28 2000
+++ linux/include/asm-alpha/system.h Sun Dec 17 17:54:51 2000
@@ -390,7 +390,7 @@
#define __HAVE_ARCH_CMPXCHG 1

extern __inline__ unsigned long
-__cmpxchg_u32(volatile int *m, int old, int new)
+__cmpxchg_u32(volatile int *m, int old_val, int new_val)
{
unsigned long prev, cmp;

@@ -409,13 +409,13 @@
"3: br 1b\n"
".previous"
: "=&r"(prev), "=&r"(cmp), "=m"(*m)
- : "r"((long) old), "r"(new), "m"(*m) : "memory");
+ : "r"((long) old_val), "r"(new_val), "m"(*m) : "memory");

return prev;
}

extern __inline__ unsigned long
-__cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new)
+__cmpxchg_u64(volatile long *m, unsigned long old_val, unsigned long new_val)
{
unsigned long prev, cmp;

@@ -434,7 +434,7 @@
"3: br 1b\n"
".previous"
: "=&r"(prev), "=&r"(cmp), "=m"(*m)
- : "r"((long) old), "r"(new), "m"(*m) : "memory");
+ : "r"((long) old_val), "r"(new_val), "m"(*m) : "memory");

return prev;
}
@@ -444,16 +444,16 @@
extern void __cmpxchg_called_with_bad_pointer(void);

static __inline__ unsigned long
-__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
+__cmpxchg(volatile void *ptr, unsigned long old_val, unsigned long new_val, int size)
{
switch (size) {
case 4:
- return __cmpxchg_u32(ptr, old, new);
+ return __cmpxchg_u32(ptr, old_val, new_val);
case 8:
- return __cmpxchg_u64(ptr, old, new);
+ return __cmpxchg_u64(ptr, old_val, new_val);
}
__cmpxchg_called_with_bad_pointer();
- return old;
+ return old_val;
}

#define cmpxchg(ptr,o,n) \
\
 
 \ /
  Last update: 2005-03-22 12:52    [W:0.073 / U:1.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site