Create asm-i386/cmpxchg.h
Subsystems (2)
PATCH 2/6 Create asm-i386/cmpxchg.h
Rearrange the i386 cmpxchg code to allow atomic.h to get it without needing to include system.h. This kills warnings in the UML build from atomic.h about implicit declarations of cmpxchg symbols. The i386 build presumably isn't seeing this because a separate inclusion of system.h is covering it over.
The cmpxchg stuff is moved to asm-i386/cmpxchg.h, with an include left in system.h for the benefit of generic code which expects cmpxchg there.
Meanwhile, atomic.h includes cmpxchg.h.
This causes no noticable damage to the i386 build.
--
include/asm-i386/atomic.h | 1 include/asm-i386/cmpxchg.h | 293 +++++++++++++++++++++++++++++++++++++++++++++ include/asm-i386/system.h | 289 -------------------------------------------- 3 files changed, 295 insertions(+), 288 deletions(-)
include/asm-i386/atomic.h +1 -0
@@ -3,6 +3,7 @@#include <linux/compiler.h> #include <asm/processor.h> +#include <asm/cmpxchg.h> /* * Atomic operations that C can't guarantee us. Useful for
include/asm-i386/cmpxchg.h new file +293 -0
293 lines not on this page · raw message
include/asm-i386/system.h +1 -288
301 lines not on this page · raw message
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Quoted 11 lines · On Tuesday 01 May 2007 20:21:57 Jeff Dike wrote:
Rearrange the i386 cmpxchg code to allow
atomic.hto get it without needing to includesystem.h. This kills warnings in the UML build fromatomic.habout implicit declarations of cmpxchg symbols. The i386 build presumably isn't seeing this because a separate inclusion ofsystem.his covering it over.The cmpxchg stuff is moved to
asm-i386/cmpxchg.h, with an include left insystem.hfor the benefit of generic code which expects cmpxchg there.Meanwhile,
atomic.hincludescmpxchg.h.
Doesn't apply against the latest ff tree. Can you please regenerate, not losing whatever change caused it to reject?
-Andi
Quoted 2 lines · Andi Kleen
Doesn't apply against the latest ff tree. Can you please regenerate, not losing whatever change caused it to reject?
What's the ff tree? Is 'f' next to 'm' on your keyboard?
It depends on the tas() elimination patch, which I sent to LKML and linux-arch yesterday, and which is attached.
Also attached is a standalone version of cmpxchg-i386 against rc7-mm2. no-tas applies on top of it. Take your pick.
Jeff
Signature · 1 line
Work email - jdike at linux dot intel dot com
tas() has no users, so get rid of it.
--
include/asm-alpha/system.h | 3 --- include/asm-arm/system.h | 2 -- include/asm-arm26/system.h | 2 -- include/asm-blackfin/system.h | 1 - include/asm-h8300/system.h | 1 - include/asm-i386/system.h | 2 -- include/asm-m32r/system.h | 2 -- include/asm-m68k/system.h | 1 - include/asm-m68knommu/system.h | 1 - include/asm-mips/system.h | 1 - include/asm-powerpc/system.h | 2 -- include/asm-ppc/system.h | 1 - include/asm-sh/system.h | 10 ---------- include/asm-sh64/system.h | 2 -- include/asm-sparc/system.h | 1 - include/asm-sparc64/system.h | 1 - include/asm-v850/system.h | 1 - include/asm-x86_64/system.h | 2 -- include/asm-xtensa/system.h | 2 -- 19 files changed, 38 deletions(-)
include/asm-alpha/system.h +0 -3
@@ -548,9 +548,6 @@ __xchg_u64_local(volatile long *m, unsig sizeof(*(ptr))); \ }) -#define tas (ptr) (xchg((ptr),1)) - -/* * Atomic compare and exchange. Compare OLD with MEM, if identical, * store NEW in MEM. Return the initial value in MEM. Success is
include/asm-arm/system.h +0 -2
@@ -103,8 +103,6 @@ void hook_fault_code(int nr, int (*fn)(u#define xchg (ptr,x) \ ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) -#define tas (ptr) (xchg((ptr),1)) - extern asmlinkage void __backtrace(void); extern asmlinkage void c_backtrace(unsigned long fp, int pmode);
include/asm-arm26/system.h +0 -2
@@ -52,8 +52,6 @@ void hook_fault_code(int nr, int (*fn)(u#define xchg (ptr,x) \ ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) -#define tas (ptr) (xchg((ptr),1)) - extern asmlinkage void __backtrace(void);#define set_cr (x) \
include/asm-blackfin/system.h +0 -1
@@ -138,7 +138,6 @@ extern unsigned long irq_flags;#endif #define xchg (ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) -#define tas (ptr) ((void)xchg((ptr),1))struct __xchg_dummy {unsigned long a[100 ];
include/asm-h8300/system.h +0 -1
@@ -98,7 +98,6 @@ asmlinkage void resume(void);#endif #define xchg (ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) -#define tas (ptr) (xchg((ptr),1))struct __xchg_dummy {unsigned long a[100 ]; };#define __xg (x) ((volatile struct __xchg_dummy *)(x))
include/asm-i386/system.h +0 -2
@@ -197,8 +197,6 @@ static inline unsigned long get_limit(un#define xchg (ptr,v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v),(ptr),sizeof(*(ptr)))) -#define tas (ptr) (xchg((ptr),1)) -struct __xchg_dummy {unsigned long a[100 ]; };#define __xg (x) ((struct __xchg_dummy *)(x))
include/asm-m32r/system.h +0 -2
@@ -122,8 +122,6 @@ static inline void local_irq_disable(voi#define xchg (ptr,x) \ ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) -#define tas (ptr) (xchg((ptr),1)) -#ifdef CONFIG_SMP extern void __xchg_called_with_bad_pointer (void );#endif
include/asm-m68k/system.h +0 -1
@@ -88,7 +88,6 @@ static inline int irqs_disabled(void)#define xchg (ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) -#define tas (ptr) (xchg((ptr),1))struct __xchg_dummy {unsigned long a[100 ]; };#define __xg (x) ((volatile struct __xchg_dummy *)(x))
include/asm-m68knommu/system.h +0 -1
@@ -120,7 +120,6 @@ asmlinkage void resume(void);#endif #define xchg (ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) -#define tas (ptr) (xchg((ptr),1))struct __xchg_dummy {unsigned long a[100 ]; };#define __xg (x) ((volatile struct __xchg_dummy *)(x))
include/asm-mips/system.h +0 -1
@@ -201,7 +201,6 @@ static inline unsigned long __xchg(unsig }#define xchg (ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) -#define tas (ptr) (xchg((ptr),1))#define __HAVE_ARCH_CMPXCHG 1
include/asm-powerpc/system.h +0 -2
@@ -334,8 +334,6 @@ __xchg_local(volatile void *ptr, unsigne (unsigned long)_x_, sizeof(*(ptr))); \ }) -#define tas (ptr) (xchg((ptr),1)) -/* * Compare and exchange - if *p == old, set it to new, * and return the old value of *p.
include/asm-ppc/system.h +0 -1
@@ -169,7 +169,6 @@ xchg_u32(volatile void *p, unsigned longextern void __xchg_called_with_bad_pointer (void );#define xchg (ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) -#define tas (ptr) (xchg((ptr),1))static inline unsigned long __xchg (unsigned long x,volatile void *ptr,int size) {
include/asm-sh/system.h +0 -10
@@ -81,16 +81,6 @@ static inline void sched_cacheflush(void }#endif -static inline unsigned long tas (volatile int *m) -{ -unsigned long retval; - - __asm__ __volatile__ ("tas.b @%1\n\t" -"movt %0" - :"=r" (retval):"r" (m):"t" ,"memory" ); -return retval; -} -/* * A brief note on ctrl_barrier(), the control register write barrier. *
include/asm-sh64/system.h +0 -2
@@ -43,8 +43,6 @@ extern struct task_struct *sh64_switch_t#define xchg (ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) -#define tas (ptr) (xchg((ptr), 1)) -extern void __xchg_called_with_bad_pointer (void );#define mb () __asm__ __volatile__ ("synco": : :"memory")
include/asm-sparc/system.h +0 -1
@@ -241,7 +241,6 @@ static inline unsigned long xchg_u32(__v }#define xchg (ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) -#define tas (ptr) (xchg((ptr),1))extern void __xchg_called_with_bad_pointer (void );
include/asm-sparc64/system.h +0 -1
@@ -253,7 +253,6 @@ static inline unsigned long xchg64(__vol }#define xchg (ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) -#define tas (ptr) (xchg((ptr),1))extern void __xchg_called_with_bad_pointer (void );
include/asm-v850/system.h +0 -1
@@ -76,7 +76,6 @@ static inline int irqs_disabled (void)#define xchg (ptr, with) \ ((__typeof__ (*(ptr)))__xchg ((unsigned long)(with), (ptr), sizeof (*(ptr)))) -#define tas (ptr) (xchg ((ptr), 1))static inline unsigned long __xchg (unsigned long with, __volatile__ void *ptr, int size)
include/asm-x86_64/system.h +0 -2
@@ -126,8 +126,6 @@ static inline void sched_cacheflush(void#define xchg (ptr,v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v),(ptr),sizeof(*(ptr)))) -#define tas (ptr) (xchg((ptr),1)) -#define __xg (x) ((volatile long *)(x))static inline void set_64bit (volatile unsigned long *ptr,unsigned long val)
include/asm-xtensa/system.h +0 -2
@@ -183,8 +183,6 @@ static inline unsigned long xchg_u32(volreturn tmp; } -#define tas (ptr) (xchg((ptr),1)) -#define xchg (ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))/*
Rearrange the i386 cmpxchg code to allow atomic.h to get it without needing to include system.h. This kills warnings in the UML build from atomic.h about implicit declarations of cmpxchg symbols.
The cmpxchg stuff is moved to asm-i386/cmpxchg.h, with an include left in system.h for the benefit of generic code which expects cmpxchg there.
Meanwhile, atomic.h includes cmpxchg.h.
--
include/asm-i386/atomic.h | 1 include/asm-i386/cmpxchg.h | 293 +++++++++++++++++++++++++++++++++++++++++++++ include/asm-i386/system.h | 289 -------------------------------------------- 3 files changed, 295 insertions(+), 288 deletions(-)
include/asm-i386/atomic.h +1 -0
@@ -3,6 +3,7 @@#include <linux/compiler.h> #include <asm/processor.h> +#include <asm/cmpxchg.h> /* * Atomic operations that C can't guarantee us. Useful for
include/asm-i386/cmpxchg.h new file +295 -0
295 lines not on this page · raw message
include/asm-i386/system.h +1 -290
303 lines not on this page · raw message
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Quoted 7 lines · On Wed, 2 May 2007 11:38:47 -0400 Jeff Dike <[email protected]> wrote:
Quoted 2 lines · Andi Kleen
Doesn't apply against the latest ff tree. Can you please regenerate, not losing whatever change caused it to reject?
What's the ff tree? Is 'f' next to 'm' on your keyboard?
My guess is ff means firstfloor :)
https://www.x86-64.org/pipermail/discuss/2006-January/007467.html
Quoted 3 lines · Eric Dumazet
My guess is ff means firstfloor :)
https://www.x86-64.org/pipermail/discuss/2006-January/007467.html
Thanks! That makes much more sense than my funky German keyboard theory...
Jeff
Signature · 11 lines
Work email - jdike at linux dot intel dot com ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ User-mode-linux-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel