aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/include/asm/processor.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin/include/asm/processor.h')
-rw-r--r--arch/blackfin/include/asm/processor.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/arch/blackfin/include/asm/processor.h b/arch/blackfin/include/asm/processor.h
index e3e9b41fa8db..0eece23b41c7 100644
--- a/arch/blackfin/include/asm/processor.h
+++ b/arch/blackfin/include/asm/processor.h
@@ -24,6 +24,14 @@ static inline void wrusp(unsigned long usp)
24 __asm__ __volatile__("usp = %0;\n\t"::"da"(usp)); 24 __asm__ __volatile__("usp = %0;\n\t"::"da"(usp));
25} 25}
26 26
27static inline unsigned long __get_SP(void)
28{
29 unsigned long sp;
30
31 __asm__ __volatile__("%0 = sp;\n\t" : "=da"(sp));
32 return sp;
33}
34
27/* 35/*
28 * User space process size: 1st byte beyond user address space. 36 * User space process size: 1st byte beyond user address space.
29 * Fairly meaningless on nommu. Parts of user programs can be scattered 37 * Fairly meaningless on nommu. Parts of user programs can be scattered
@@ -57,6 +65,7 @@ struct thread_struct {
57 * pass the data segment into user programs if it exists, 65 * pass the data segment into user programs if it exists,
58 * it can't hurt anything as far as I can tell 66 * it can't hurt anything as far as I can tell
59 */ 67 */
68#ifndef CONFIG_SMP
60#define start_thread(_regs, _pc, _usp) \ 69#define start_thread(_regs, _pc, _usp) \
61do { \ 70do { \
62 set_fs(USER_DS); \ 71 set_fs(USER_DS); \
@@ -70,6 +79,16 @@ do { \
70 sizeof(*L1_SCRATCH_TASK_INFO)); \ 79 sizeof(*L1_SCRATCH_TASK_INFO)); \
71 wrusp(_usp); \ 80 wrusp(_usp); \
72} while(0) 81} while(0)
82#else
83#define start_thread(_regs, _pc, _usp) \
84do { \
85 set_fs(USER_DS); \
86 (_regs)->pc = (_pc); \
87 if (current->mm) \
88 (_regs)->p5 = current->mm->start_data; \
89 wrusp(_usp); \
90} while (0)
91#endif
73 92
74/* Forward declaration, a strange C thing */ 93/* Forward declaration, a strange C thing */
75struct task_struct; 94struct task_struct;
@@ -106,7 +125,8 @@ unsigned long get_wchan(struct task_struct *p);
106 eip; }) 125 eip; })
107#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp) 126#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
108 127
109#define cpu_relax() barrier() 128#define cpu_relax() smp_mb()
129
110 130
111/* Get the Silicon Revision of the chip */ 131/* Get the Silicon Revision of the chip */
112static inline uint32_t __pure bfin_revid(void) 132static inline uint32_t __pure bfin_revid(void)
@@ -137,7 +157,11 @@ static inline uint32_t __pure bfin_revid(void)
137static inline uint16_t __pure bfin_cpuid(void) 157static inline uint16_t __pure bfin_cpuid(void)
138{ 158{
139 return (bfin_read_CHIPID() & CHIPID_FAMILY) >> 12; 159 return (bfin_read_CHIPID() & CHIPID_FAMILY) >> 12;
160}
140 161
162static inline uint32_t __pure bfin_dspid(void)
163{
164 return bfin_read_DSPID();
141} 165}
142 166
143static inline uint32_t __pure bfin_compiled_revid(void) 167static inline uint32_t __pure bfin_compiled_revid(void)
@@ -154,6 +178,8 @@ static inline uint32_t __pure bfin_compiled_revid(void)
154 return 4; 178 return 4;
155#elif defined(CONFIG_BF_REV_0_5) 179#elif defined(CONFIG_BF_REV_0_5)
156 return 5; 180 return 5;
181#elif defined(CONFIG_BF_REV_0_6)
182 return 6;
157#elif defined(CONFIG_BF_REV_ANY) 183#elif defined(CONFIG_BF_REV_ANY)
158 return 0xffff; 184 return 0xffff;
159#else 185#else