lkml.org 
[lkml]   [2009]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 02/13 UPDATED] x86: make early_per_cpu() a lvalue and use it
    Make early_per_cpu() a lvalue as per_cpu() is and use it where
    applicable.

    Meriusz spotted that early_per_cpu() conversion in topology.h was
    missing @cpu argument. Fixed.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Cc: Mariusz Ceier <mceier@gmail.com>
    ---
    git tree has been regenerated accordingly.

    Thanks.

    arch/x86/include/asm/percpu.h | 6 +++---
    arch/x86/include/asm/topology.h | 5 +----
    arch/x86/kernel/apic.c | 13 ++-----------
    3 files changed, 6 insertions(+), 18 deletions(-)

    Index: work/arch/x86/include/asm/topology.h
    ===================================================================
    --- work.orig/arch/x86/include/asm/topology.h
    +++ work/arch/x86/include/asm/topology.h
    @@ -96,10 +96,7 @@ static inline int cpu_to_node(int cpu)
    /* Same function but used if called before per_cpu areas are setup */
    static inline int early_cpu_to_node(int cpu)
    {
    - if (early_per_cpu_ptr(x86_cpu_to_node_map))
    - return early_per_cpu_ptr(x86_cpu_to_node_map)[cpu];
    -
    - return per_cpu(x86_cpu_to_node_map, cpu);
    + return early_per_cpu(x86_cpu_to_node_map, cpu);
    }

    /* Returns a pointer to the cpumask of CPUs on Node 'node'. */
    Index: work/arch/x86/kernel/apic.c
    ===================================================================
    --- work.orig/arch/x86/kernel/apic.c
    +++ work/arch/x86/kernel/apic.c
    @@ -1865,17 +1865,8 @@ void __cpuinit generic_processor_info(in
    #endif

    #if defined(CONFIG_X86_SMP) || defined(CONFIG_X86_64)
    - /* are we being called early in kernel startup? */
    - if (early_per_cpu_ptr(x86_cpu_to_apicid)) {
    - u16 *cpu_to_apicid = early_per_cpu_ptr(x86_cpu_to_apicid);
    - u16 *bios_cpu_apicid = early_per_cpu_ptr(x86_bios_cpu_apicid);
    -
    - cpu_to_apicid[cpu] = apicid;
    - bios_cpu_apicid[cpu] = apicid;
    - } else {
    - per_cpu(x86_cpu_to_apicid, cpu) = apicid;
    - per_cpu(x86_bios_cpu_apicid, cpu) = apicid;
    - }
    + early_per_cpu(x86_cpu_to_apicid, cpu) = apicid;
    + early_per_cpu(x86_bios_cpu_apicid, cpu) = apicid;
    #endif

    cpu_set(cpu, cpu_possible_map);
    Index: work/arch/x86/include/asm/percpu.h
    ===================================================================
    --- work.orig/arch/x86/include/asm/percpu.h
    +++ work/arch/x86/include/asm/percpu.h
    @@ -195,9 +195,9 @@ do { \
    #define early_per_cpu_ptr(_name) (_name##_early_ptr)
    #define early_per_cpu_map(_name, _idx) (_name##_early_map[_idx])
    #define early_per_cpu(_name, _cpu) \
    - (early_per_cpu_ptr(_name) ? \
    - early_per_cpu_ptr(_name)[_cpu] : \
    - per_cpu(_name, _cpu))
    + *(early_per_cpu_ptr(_name) ? \
    + &early_per_cpu_ptr(_name)[_cpu] : \
    + &per_cpu(_name, _cpu))

    #else /* !CONFIG_SMP */
    #define DEFINE_EARLY_PER_CPU(_type, _name, _initvalue) \

    \
     
     \ /
      Last update: 2009-01-13 12:47    [W:0.024 / U:2.288 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site