Skip to content

Commit dbc895f

Browse files
Graf YangBryan Wu
authored andcommitted
Blackfin arch: smp patch cleanup from LKML review
1. Use inline get_l1_... functions instead of macro 2. Fix compile issue about smp barrier functions Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
1 parent f994607 commit dbc895f

17 files changed

Lines changed: 92 additions & 105 deletions

File tree

‎arch/blackfin/include/asm/mem_map.h‎

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,79 @@
99

1010
#include <mach/mem_map.h>
1111

12+
#ifndef __ASSEMBLY__
13+
14+
#ifdef CONFIG_SMP
15+
static inline ulong get_l1_scratch_start_cpu(int cpu)
16+
{
17+
return (cpu) ? COREB_L1_SCRATCH_START : COREA_L1_SCRATCH_START;
18+
}
19+
static inline ulong get_l1_code_start_cpu(int cpu)
20+
{
21+
return (cpu) ? COREB_L1_CODE_START : COREA_L1_CODE_START;
22+
}
23+
static inline ulong get_l1_data_a_start_cpu(int cpu)
24+
{
25+
return (cpu) ? COREB_L1_DATA_A_START : COREA_L1_DATA_A_START;
26+
}
27+
static inline ulong get_l1_data_b_start_cpu(int cpu)
28+
{
29+
return (cpu) ? COREB_L1_DATA_B_START : COREA_L1_DATA_B_START;
30+
}
31+
32+
static inline ulong get_l1_scratch_start(void)
33+
{
34+
return get_l1_scratch_start_cpu(blackfin_core_id());
35+
}
36+
static inline ulong get_l1_code_start(void)
37+
{
38+
return get_l1_code_start_cpu(blackfin_core_id());
39+
}
40+
static inline ulong get_l1_data_a_start(void)
41+
{
42+
return get_l1_data_a_start_cpu(blackfin_core_id());
43+
}
44+
static inline ulong get_l1_data_b_start(void)
45+
{
46+
return get_l1_data_b_start_cpu(blackfin_core_id());
47+
}
48+
49+
#else /* !CONFIG_SMP */
50+
51+
static inline ulong get_l1_scratch_start_cpu(int cpu)
52+
{
53+
return L1_SCRATCH_START;
54+
}
55+
static inline ulong get_l1_code_start_cpu(int cpu)
56+
{
57+
return L1_CODE_START;
58+
}
59+
static inline ulong get_l1_data_a_start_cpu(int cpu)
60+
{
61+
return L1_DATA_A_START;
62+
}
63+
static inline ulong get_l1_data_b_start_cpu(int cpu)
64+
{
65+
return L1_DATA_B_START;
66+
}
67+
static inline ulong get_l1_scratch_start(void)
68+
{
69+
return get_l1_scratch_start_cpu(0);
70+
}
71+
static inline ulong get_l1_code_start(void)
72+
{
73+
return get_l1_code_start_cpu(0);
74+
}
75+
static inline ulong get_l1_data_a_start(void)
76+
{
77+
return get_l1_data_a_start_cpu(0);
78+
}
79+
static inline ulong get_l1_data_b_start(void)
80+
{
81+
return get_l1_data_b_start_cpu(0);
82+
}
83+
84+
#endif /* CONFIG_SMP */
85+
#endif /* __ASSEMBLY__ */
86+
1287
#endif /* _MEM_MAP_H_ */

‎arch/blackfin/include/asm/smp.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232

3333
#define raw_smp_processor_id() blackfin_core_id()
3434

35+
extern char coreb_trampoline_start, coreb_trampoline_end;
36+
3537
struct corelock_slot {
3638
int lock;
3739
};

‎arch/blackfin/include/asm/system.h‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,13 @@ asmlinkage unsigned long __raw_cmpxchg_4_asm(volatile void *ptr,
6666
# define smp_mb() do { barrier(); smp_check_barrier(); smp_mark_barrier(); } while (0)
6767
# define smp_rmb() do { barrier(); smp_check_barrier(); } while (0)
6868
# define smp_wmb() do { barrier(); smp_mark_barrier(); } while (0)
69+
#define smp_read_barrier_depends() do { barrier(); smp_check_barrier(); } while (0)
70+
6971
#else
7072
# define smp_mb() barrier()
7173
# define smp_rmb() barrier()
7274
# define smp_wmb() barrier()
75+
#define smp_read_barrier_depends() barrier()
7376
#endif
7477

7578
static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
@@ -120,8 +123,6 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
120123
((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \
121124
(unsigned long)(n), sizeof(*(ptr))))
122125

123-
#define smp_read_barrier_depends() smp_check_barrier()
124-
125126
#else /* !CONFIG_SMP */
126127

127128
#define smp_mb() barrier()
@@ -192,6 +193,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
192193
*/
193194

194195
#include <asm/l1layout.h>
196+
#include <asm/mem_map.h>
195197

196198
asmlinkage struct task_struct *resume(struct task_struct *prev, struct task_struct *next);
197199

‎arch/blackfin/kernel/bfin_ksyms.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ EXPORT_SYMBOL(__raw_bit_test_set_asm);
9999
EXPORT_SYMBOL(__raw_bit_test_clear_asm);
100100
EXPORT_SYMBOL(__raw_bit_test_toggle_asm);
101101
EXPORT_SYMBOL(__raw_uncached_fetch_asm);
102+
#ifdef __ARCH_SYNC_CORE_DCACHE
102103
EXPORT_SYMBOL(__raw_smp_mark_barrier_asm);
103104
EXPORT_SYMBOL(__raw_smp_check_barrier_asm);
104105
#endif
106+
#endif

‎arch/blackfin/kernel/cplb-mpu/cplbinit.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <asm/blackfin.h>
2626
#include <asm/cplb.h>
2727
#include <asm/cplbinit.h>
28+
#include <asm/mem_map.h>
2829

2930
#if ANOMALY_05000263
3031
# error the MPU will not function safely while Anomaly 05000263 applies

‎arch/blackfin/kernel/cplb-nompu/cplbinit.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <asm/cacheflush.h>
2828
#include <asm/cplb.h>
2929
#include <asm/cplbinit.h>
30+
#include <asm/mem_map.h>
3031

3132
u_long icplb_tables[NR_CPUS][CPLB_TBL_ENTRIES+1];
3233
u_long dcplb_tables[NR_CPUS][CPLB_TBL_ENTRIES+1];

‎arch/blackfin/kernel/process.c‎

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

4040
#include <asm/blackfin.h>
4141
#include <asm/fixed_code.h>
42+
#include <asm/mem_map.h>
4243

4344
asmlinkage void ret_from_fork(void);
4445

‎arch/blackfin/kernel/ptrace.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
#include <asm/asm-offsets.h>
4646
#include <asm/dma.h>
4747
#include <asm/fixed_code.h>
48+
#include <asm/mem_map.h>
4849

4950
#define TEXT_OFFSET 0
5051
/*

‎arch/blackfin/mach-bf518/include/mach/mem_map.h‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,6 @@
9999
#define L1_SCRATCH_START 0xFFB00000
100100
#define L1_SCRATCH_LENGTH 0x1000
101101

102-
#define get_l1_scratch_start_cpu(cpu) L1_SCRATCH_START
103-
#define get_l1_code_start_cpu(cpu) L1_CODE_START
104-
#define get_l1_data_a_start_cpu(cpu) L1_DATA_A_START
105-
#define get_l1_data_b_start_cpu(cpu) L1_DATA_B_START
106-
#define get_l1_scratch_start() L1_SCRATCH_START
107-
#define get_l1_code_start() L1_CODE_START
108-
#define get_l1_data_a_start() L1_DATA_A_START
109-
#define get_l1_data_b_start() L1_DATA_B_START
110-
111102
#define GET_PDA_SAFE(preg) \
112103
preg.l = _cpu_pda; \
113104
preg.h = _cpu_pda;

‎arch/blackfin/mach-bf527/include/mach/mem_map.h‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,6 @@
9999
#define L1_SCRATCH_START 0xFFB00000
100100
#define L1_SCRATCH_LENGTH 0x1000
101101

102-
#define get_l1_scratch_start_cpu(cpu) L1_SCRATCH_START
103-
#define get_l1_code_start_cpu(cpu) L1_CODE_START
104-
#define get_l1_data_a_start_cpu(cpu) L1_DATA_A_START
105-
#define get_l1_data_b_start_cpu(cpu) L1_DATA_B_START
106-
#define get_l1_scratch_start() L1_SCRATCH_START
107-
#define get_l1_code_start() L1_CODE_START
108-
#define get_l1_data_a_start() L1_DATA_A_START
109-
#define get_l1_data_b_start() L1_DATA_B_START
110-
111102
#define GET_PDA_SAFE(preg) \
112103
preg.l = _cpu_pda; \
113104
preg.h = _cpu_pda;

0 commit comments

Comments
 (0)