lkml.org 
[lkml]   [2007]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [patch 04/10] x86_32: Use generic percpu.h

    merge to x86.git below. Please check.

    Ingo

    ---->
    Subject: x86_32: Use generic percpu.h
    From: Christoph Lameter <clameter@sgi.com>

    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: ak@suse.de
    Signed-off-by: Christoph Lameter <clameter@sgi.com>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    ---
    include/asm-x86/percpu_32.h | 30 +++++++++---------------------
    1 file changed, 9 insertions(+), 21 deletions(-)

    Index: linux-x86.q/include/asm-x86/percpu_32.h
    ===================================================================
    --- linux-x86.q.orig/include/asm-x86/percpu_32.h
    +++ linux-x86.q/include/asm-x86/percpu_32.h
    @@ -42,26 +42,7 @@
    */
    #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)

    /* A macro to avoid #include hell... */
    #define percpu_modcopy(pcpudst, src, size) \
    @@ -74,11 +55,18 @@ do { \

    /* fs segment starts at (positive) offset == __per_cpu_offset[cpu] */
    #define __percpu_seg "%%fs:"
    +
    #else /* !SMP */
    -#include <asm-generic/percpu.h>
    +
    #define __percpu_seg ""
    +
    #endif /* SMP */

    +#include <asm-generic/percpu.h>
    +
    +/* 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);
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2007-11-30 12:13    [W:0.034 / U:30.208 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site