Skip to content

Commit 0195c00

Browse files
committed
Merge tag 'split-asm_system_h-for-linus-20120328' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-asm_system
Pull "Disintegrate and delete asm/system.h" from David Howells: "Here are a bunch of patches to disintegrate asm/system.h into a set of separate bits to relieve the problem of circular inclusion dependencies. I've built all the working defconfigs from all the arches that I can and made sure that they don't break. The reason for these patches is that I recently encountered a circular dependency problem that came about when I produced some patches to optimise get_order() by rewriting it to use ilog2(). This uses bitops - and on the SH arch asm/bitops.h drags in asm-generic/get_order.h by a circuituous route involving asm/system.h. The main difficulty seems to be asm/system.h. It holds a number of low level bits with no/few dependencies that are commonly used (eg. memory barriers) and a number of bits with more dependencies that aren't used in many places (eg. switch_to()). These patches break asm/system.h up into the following core pieces: (1) asm/barrier.h Move memory barriers here. This already done for MIPS and Alpha. (2) asm/switch_to.h Move switch_to() and related stuff here. (3) asm/exec.h Move arch_align_stack() here. Other process execution related bits could perhaps go here from asm/processor.h. (4) asm/cmpxchg.h Move xchg() and cmpxchg() here as they're full word atomic ops and frequently used by atomic_xchg() and atomic_cmpxchg(). (5) asm/bug.h Move die() and related bits. (6) asm/auxvec.h Move AT_VECTOR_SIZE_ARCH here. Other arch headers are created as needed on a per-arch basis." Fixed up some conflicts from other header file cleanups and moving code around that has happened in the meantime, so David's testing is somewhat weakened by that. We'll find out anything that got broken and fix it.. * tag 'split-asm_system_h-for-linus-20120328' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-asm_system: (38 commits) Delete all instances of asm/system.h Remove all #inclusions of asm/system.h Add #includes needed to permit the removal of asm/system.h Move all declarations of free_initmem() to linux/mm.h Disintegrate asm/system.h for OpenRISC Split arch_align_stack() out from asm-generic/system.h Split the switch_to() wrapper out of asm-generic/system.h Move the asm-generic/system.h xchg() implementation to asm-generic/cmpxchg.h Create asm-generic/barrier.h Make asm-generic/cmpxchg.h #include asm-generic/cmpxchg-local.h Disintegrate asm/system.h for Xtensa Disintegrate asm/system.h for Unicore32 [based on ver #3, changed by gxt] Disintegrate asm/system.h for Tile Disintegrate asm/system.h for Sparc Disintegrate asm/system.h for SH Disintegrate asm/system.h for Score Disintegrate asm/system.h for S390 Disintegrate asm/system.h for PowerPC Disintegrate asm/system.h for PA-RISC Disintegrate asm/system.h for MN10300 ...
2 parents f21ce8f + 141124c commit 0195c00

File tree

1,603 files changed

+6973
-7090
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,603 files changed

+6973
-7090
lines changed

arch/alpha/boot/bootp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <generated/utsrelease.h>
1414
#include <linux/mm.h>
1515

16-
#include <asm/system.h>
1716
#include <asm/console.h>
1817
#include <asm/hwrpb.h>
1918
#include <asm/pgtable.h>

arch/alpha/boot/bootpz.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <generated/utsrelease.h>
1616
#include <linux/mm.h>
1717

18-
#include <asm/system.h>
1918
#include <asm/console.h>
2019
#include <asm/hwrpb.h>
2120
#include <asm/pgtable.h>

arch/alpha/boot/head.S

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* initial bootloader stuff..
55
*/
66

7-
#include <asm/system.h>
87

98
.set noreorder
109
.globl __start

arch/alpha/boot/main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <generated/utsrelease.h>
1212
#include <linux/mm.h>
1313

14-
#include <asm/system.h>
1514
#include <asm/console.h>
1615
#include <asm/hwrpb.h>
1716
#include <asm/pgtable.h>

arch/alpha/include/asm/atomic.h

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#include <linux/types.h>
55
#include <asm/barrier.h>
6-
#include <asm/system.h>
76

87
/*
98
* Atomic operations that C can't guarantee us. Useful for
@@ -169,6 +168,73 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
169168
return result;
170169
}
171170

171+
/*
172+
* Atomic exchange routines.
173+
*/
174+
175+
#define __ASM__MB
176+
#define ____xchg(type, args...) __xchg ## type ## _local(args)
177+
#define ____cmpxchg(type, args...) __cmpxchg ## type ## _local(args)
178+
#include <asm/xchg.h>
179+
180+
#define xchg_local(ptr,x) \
181+
({ \
182+
__typeof__(*(ptr)) _x_ = (x); \
183+
(__typeof__(*(ptr))) __xchg_local((ptr), (unsigned long)_x_, \
184+
sizeof(*(ptr))); \
185+
})
186+
187+
#define cmpxchg_local(ptr, o, n) \
188+
({ \
189+
__typeof__(*(ptr)) _o_ = (o); \
190+
__typeof__(*(ptr)) _n_ = (n); \
191+
(__typeof__(*(ptr))) __cmpxchg_local((ptr), (unsigned long)_o_, \
192+
(unsigned long)_n_, \
193+
sizeof(*(ptr))); \
194+
})
195+
196+
#define cmpxchg64_local(ptr, o, n) \
197+
({ \
198+
BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
199+
cmpxchg_local((ptr), (o), (n)); \
200+
})
201+
202+
#ifdef CONFIG_SMP
203+
#undef __ASM__MB
204+
#define __ASM__MB "\tmb\n"
205+
#endif
206+
#undef ____xchg
207+
#undef ____cmpxchg
208+
#define ____xchg(type, args...) __xchg ##type(args)
209+
#define ____cmpxchg(type, args...) __cmpxchg ##type(args)
210+
#include <asm/xchg.h>
211+
212+
#define xchg(ptr,x) \
213+
({ \
214+
__typeof__(*(ptr)) _x_ = (x); \
215+
(__typeof__(*(ptr))) __xchg((ptr), (unsigned long)_x_, \
216+
sizeof(*(ptr))); \
217+
})
218+
219+
#define cmpxchg(ptr, o, n) \
220+
({ \
221+
__typeof__(*(ptr)) _o_ = (o); \
222+
__typeof__(*(ptr)) _n_ = (n); \
223+
(__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
224+
(unsigned long)_n_, sizeof(*(ptr)));\
225+
})
226+
227+
#define cmpxchg64(ptr, o, n) \
228+
({ \
229+
BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
230+
cmpxchg((ptr), (o), (n)); \
231+
})
232+
233+
#undef __ASM__MB
234+
#undef ____cmpxchg
235+
236+
#define __HAVE_ARCH_CMPXCHG 1
237+
172238
#define atomic64_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new))
173239
#define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
174240

arch/alpha/include/asm/auxvec.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@
2121
#define AT_L2_CACHESHAPE 36
2222
#define AT_L3_CACHESHAPE 37
2323

24+
#define AT_VECTOR_SIZE_ARCH 4 /* entries in ARCH_DLINFO */
25+
2426
#endif /* __ASM_ALPHA_AUXVEC_H */

arch/alpha/include/asm/core_lca.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#ifndef __ALPHA_LCA__H__
22
#define __ALPHA_LCA__H__
33

4-
#include <asm/system.h>
54
#include <asm/compiler.h>
5+
#include <asm/mce.h>
66

77
/*
88
* Low Cost Alpha (LCA) definitions (these apply to 21066 and 21068,

arch/alpha/include/asm/core_mcpcia.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <linux/types.h>
99
#include <asm/compiler.h>
10+
#include <asm/mce.h>
1011

1112
/*
1213
* MCPCIA is the internal name for a core logic chipset which provides

arch/alpha/include/asm/core_t2.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include <linux/types.h>
88
#include <linux/spinlock.h>
99
#include <asm/compiler.h>
10-
#include <asm/system.h>
1110

1211
/*
1312
* T2 is the internal name for the core logic chipset which provides

arch/alpha/include/asm/elf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define __ASM_ALPHA_ELF_H
33

44
#include <asm/auxvec.h>
5+
#include <asm/special_insns.h>
56

67
/* Special values for the st_other field in the symbol table. */
78

0 commit comments

Comments
 (0)