From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757548AbXK1VQq (ORCPT ); Wed, 28 Nov 2007 16:16:46 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756949AbXK1VPc (ORCPT ); Wed, 28 Nov 2007 16:15:32 -0500 Received: from relay1.sgi.com ([192.48.171.29]:38893 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755168AbXK1VP1 (ORCPT ); Wed, 28 Nov 2007 16:15:27 -0500 Message-Id: <20071128211526.880137420@sgi.com> References: <20071128210926.008783214@sgi.com> User-Agent: quilt/0.46-1 Date: Wed, 28 Nov 2007 13:09:30 -0800 From: Christoph Lameter To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, ak@suse.de Subject: [patch 04/10] x86_32: Use generic percpu.h Content-Disposition: inline; filename=x86_32_use_generic_percpu Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org x86_32 only provides a special way to obtain the local per cpu area offset via x86_read_percpu. Otherwise it can fully use the generic handling. Cc: tglx@linutronix.de Cc: mingo@redhat.com Cc: ak@suse.de Signed-off-by: Christoph Lameter --- include/asm-x86/percpu_32.h | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) Index: linux-2.6.24-rc3-mm2/include/asm-x86/percpu_32.h =================================================================== --- linux-2.6.24-rc3-mm2.orig/include/asm-x86/percpu_32.h 2007-11-28 12:51:42.448213150 -0800 +++ linux-2.6.24-rc3-mm2/include/asm-x86/percpu_32.h 2007-11-28 12:51:48.084703616 -0800 @@ -42,34 +42,22 @@ */ #ifdef CONFIG_SMP -/* This is used for other cpus to find our section. */ -extern unsigned long __per_cpu_offset[]; - -#define per_cpu_offset(x) (__per_cpu_offset[x]) - -#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name -/* We can use this directly for local CPU (faster). */ -DECLARE_PER_CPU(unsigned long, this_cpu_off); - -/* var is in discarded region: offset to particular copy we want */ -#define per_cpu(var, cpu) (*({ \ - extern int simple_indentifier_##var(void); \ - RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu]); })) - -#define __raw_get_cpu_var(var) (*({ \ - extern int simple_indentifier_##var(void); \ - RELOC_HIDE(&per_cpu__##var, x86_read_percpu(this_cpu_off)); \ -})) - -#define __get_cpu_var(var) __raw_get_cpu_var(var) +#define __my_cpu_offset x86_read_percpu(this_cpu_off) /* fs segment starts at (positive) offset == __per_cpu_offset[cpu] */ #define __percpu_seg "%%fs:" + #else /* !SMP */ -#include + #define __percpu_seg "" + #endif /* SMP */ +#include + +/* We can use this directly for local CPU (faster). */ +DECLARE_PER_CPU(unsigned long, this_cpu_off); + /* For arch-specific code, we can use direct single-insn ops (they * don't give an lvalue though). */ extern void __bad_percpu_size(void); --