From 34484277b173d0af1bb00532a264940b57920429 Mon Sep 17 00:00:00 2001 From: David Howells Date: Wed, 28 Mar 2012 18:30:03 +0100 Subject: Make asm-generic/cmpxchg.h #include asm-generic/cmpxchg-local.h Make asm-generic/cmpxchg.h #include asm-generic/cmpxchg-local.h as all arch files that #include the former also #include the latter. See: grep -rl asm-generic/cmpxchg-local[.]h arch/ | sort > b grep -rl asm-generic/cmpxchg[.]h arch/ | sort > a comm a b This simplifies the disintegration of asm-generic/system.h for arches that don't have their own. Signed-off-by: David Howells Acked-by: Arnd Bergmann --- include/asm-generic/system.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/asm-generic/system.h') diff --git a/include/asm-generic/system.h b/include/asm-generic/system.h index 215efa74f5a2..82cb53abb9f6 100644 --- a/include/asm-generic/system.h +++ b/include/asm-generic/system.h @@ -19,7 +19,6 @@ #include #include -#include #include struct task_struct; -- cgit v1.2.3 From 885df91ca3571afd4b3f50f3391329bbf3c9e262 Mon Sep 17 00:00:00 2001 From: David Howells Date: Wed, 28 Mar 2012 18:30:03 +0100 Subject: Create asm-generic/barrier.h Create asm-generic/barrier.h and move the barrier definitions from asm-generic/system.h to it. Signed-off-by: David Howells Acked-by: Arnd Bergmann --- include/asm-generic/system.h | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) (limited to 'include/asm-generic/system.h') diff --git a/include/asm-generic/system.h b/include/asm-generic/system.h index 82cb53abb9f6..f98f693383c4 100644 --- a/include/asm-generic/system.h +++ b/include/asm-generic/system.h @@ -19,6 +19,7 @@ #include #include +#include #include struct task_struct; @@ -33,42 +34,9 @@ extern struct task_struct *__switch_to(struct task_struct *, #define arch_align_stack(x) (x) -#define nop() asm volatile ("nop") - -#endif /* !__ASSEMBLY__ */ - -/* - * Force strict CPU ordering. - * And yes, this is required on UP too when we're talking - * to devices. - * - * This implementation only contains a compiler barrier. - */ - -#define mb() asm volatile ("": : :"memory") -#define rmb() mb() -#define wmb() asm volatile ("": : :"memory") - -#ifdef CONFIG_SMP -#define smp_mb() mb() -#define smp_rmb() rmb() -#define smp_wmb() wmb() -#else -#define smp_mb() barrier() -#define smp_rmb() barrier() -#define smp_wmb() barrier() -#endif - -#define set_mb(var, value) do { var = value; mb(); } while (0) -#define set_wmb(var, value) do { var = value; wmb(); } while (0) - -#define read_barrier_depends() do {} while (0) -#define smp_read_barrier_depends() do {} while (0) - /* * we make sure local_irq_enable() doesn't cause priority inversion */ -#ifndef __ASSEMBLY__ /* This function doesn't exist, so you'll get a linker error * if something tries to do an invalid xchg(). */ -- cgit v1.2.3 From b4816afa3986704d1404fc48e931da5135820472 Mon Sep 17 00:00:00 2001 From: David Howells Date: Wed, 28 Mar 2012 18:30:03 +0100 Subject: Move the asm-generic/system.h xchg() implementation to asm-generic/cmpxchg.h Move the asm-generic/system.h xchg() implementation to asm-generic/cmpxchg.h to simplify disintegration of asm/system.h. Signed-off-by: David Howells Acked-by: Arnd Bergmann --- include/asm-generic/system.h | 70 -------------------------------------------- 1 file changed, 70 deletions(-) (limited to 'include/asm-generic/system.h') diff --git a/include/asm-generic/system.h b/include/asm-generic/system.h index f98f693383c4..54cd124ea9a4 100644 --- a/include/asm-generic/system.h +++ b/include/asm-generic/system.h @@ -17,7 +17,6 @@ #ifndef __ASSEMBLY__ #include -#include #include #include @@ -34,75 +33,6 @@ extern struct task_struct *__switch_to(struct task_struct *, #define arch_align_stack(x) (x) -/* - * we make sure local_irq_enable() doesn't cause priority inversion - */ - -/* This function doesn't exist, so you'll get a linker error - * if something tries to do an invalid xchg(). */ -extern void __xchg_called_with_bad_pointer(void); - -static inline -unsigned long __xchg(unsigned long x, volatile void *ptr, int size) -{ - unsigned long ret, flags; - - switch (size) { - case 1: -#ifdef __xchg_u8 - return __xchg_u8(x, ptr); -#else - local_irq_save(flags); - ret = *(volatile u8 *)ptr; - *(volatile u8 *)ptr = x; - local_irq_restore(flags); - return ret; -#endif /* __xchg_u8 */ - - case 2: -#ifdef __xchg_u16 - return __xchg_u16(x, ptr); -#else - local_irq_save(flags); - ret = *(volatile u16 *)ptr; - *(volatile u16 *)ptr = x; - local_irq_restore(flags); - return ret; -#endif /* __xchg_u16 */ - - case 4: -#ifdef __xchg_u32 - return __xchg_u32(x, ptr); -#else - local_irq_save(flags); - ret = *(volatile u32 *)ptr; - *(volatile u32 *)ptr = x; - local_irq_restore(flags); - return ret; -#endif /* __xchg_u32 */ - -#ifdef CONFIG_64BIT - case 8: -#ifdef __xchg_u64 - return __xchg_u64(x, ptr); -#else - local_irq_save(flags); - ret = *(volatile u64 *)ptr; - *(volatile u64 *)ptr = x; - local_irq_restore(flags); - return ret; -#endif /* __xchg_u64 */ -#endif /* CONFIG_64BIT */ - - default: - __xchg_called_with_bad_pointer(); - return x; - } -} - -#define xchg(ptr, x) \ - ((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))) - #endif /* !__ASSEMBLY__ */ #endif /* __ASM_GENERIC_SYSTEM_H */ -- cgit v1.2.3 From 158bc507c2f53109bed51c806acf5bfd48d95f1a Mon Sep 17 00:00:00 2001 From: David Howells Date: Wed, 28 Mar 2012 18:30:03 +0100 Subject: Split the switch_to() wrapper out of asm-generic/system.h Split the switch_to() wrapper out of asm-generic/system.h into its own asm-generic/system.h as part of the asm/system.h disintegration. Signed-off-by: David Howells Acked-by: Arnd Bergmann --- include/asm-generic/system.h | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'include/asm-generic/system.h') diff --git a/include/asm-generic/system.h b/include/asm-generic/system.h index 54cd124ea9a4..f2b8eb453cbb 100644 --- a/include/asm-generic/system.h +++ b/include/asm-generic/system.h @@ -14,25 +14,10 @@ #ifndef __ASM_GENERIC_SYSTEM_H #define __ASM_GENERIC_SYSTEM_H -#ifndef __ASSEMBLY__ - -#include - #include #include - -struct task_struct; - -/* context switching is now performed out-of-line in switch_to.S */ -extern struct task_struct *__switch_to(struct task_struct *, - struct task_struct *); -#define switch_to(prev, next, last) \ - do { \ - ((last) = __switch_to((prev), (next))); \ - } while (0) +#include #define arch_align_stack(x) (x) -#endif /* !__ASSEMBLY__ */ - #endif /* __ASM_GENERIC_SYSTEM_H */ -- cgit v1.2.3 From 5d1250660a476c588361fb5cb9cbfa52768540c2 Mon Sep 17 00:00:00 2001 From: David Howells Date: Wed, 28 Mar 2012 18:30:03 +0100 Subject: Split arch_align_stack() out from asm-generic/system.h Split arch_align_stack() out from asm-generic/system.h into its own header of asm-generic/exec.h as part of the asm/system.h disintegration. Signed-off-by: David Howells Acked-by: Arnd Bergmann --- include/asm-generic/system.h | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'include/asm-generic/system.h') diff --git a/include/asm-generic/system.h b/include/asm-generic/system.h index f2b8eb453cbb..a7f40578587c 100644 --- a/include/asm-generic/system.h +++ b/include/asm-generic/system.h @@ -1,23 +1,5 @@ -/* Generic system definitions, based on MN10300 definitions. - * - * It should be possible to use these on really simple architectures, - * but it serves more as a starting point for new ports. - * - * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public Licence - * as published by the Free Software Foundation; either version - * 2 of the Licence, or (at your option) any later version. - */ -#ifndef __ASM_GENERIC_SYSTEM_H -#define __ASM_GENERIC_SYSTEM_H - +/* FILE TO BE DELETED. DO NOT ADD STUFF HERE! */ #include #include +#include #include - -#define arch_align_stack(x) (x) - -#endif /* __ASM_GENERIC_SYSTEM_H */ -- cgit v1.2.3 From 141124c02059eee9dbc5c86ea797b1ca888e77f7 Mon Sep 17 00:00:00 2001 From: David Howells Date: Wed, 28 Mar 2012 18:30:03 +0100 Subject: Delete all instances of asm/system.h Delete all instances of asm/system.h as they should be redundant by this point. Signed-off-by: David Howells --- include/asm-generic/system.h | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 include/asm-generic/system.h (limited to 'include/asm-generic/system.h') diff --git a/include/asm-generic/system.h b/include/asm-generic/system.h deleted file mode 100644 index a7f40578587c..000000000000 --- a/include/asm-generic/system.h +++ /dev/null @@ -1,5 +0,0 @@ -/* FILE TO BE DELETED. DO NOT ADD STUFF HERE! */ -#include -#include -#include -#include -- cgit v1.2.3