]> err.no Git - linux-2.6/blobdiff - include/asm-blackfin/processor.h
mm_init.c: avoid ifdef-inside-macro-expansion
[linux-2.6] / include / asm-blackfin / processor.h
index 997465c93e82fbce217ec50107d54543881481d5..6f3995b119d8e78658abd9c5ca448deaa2026435 100644 (file)
@@ -26,9 +26,14 @@ static inline void wrusp(unsigned long usp)
 
 /*
  * User space process size: 1st byte beyond user address space.
+ * Fairly meaningless on nommu.  Parts of user programs can be scattered
+ * in a lot of places, so just disable this by setting it to 0xFFFFFFFF.
  */
-extern unsigned long memory_end;
-#define TASK_SIZE      (memory_end)
+#define TASK_SIZE      0xFFFFFFFF
+
+#ifdef __KERNEL__
+#define STACK_TOP      TASK_SIZE
+#endif
 
 #define TASK_UNMAPPED_BASE     0
 
@@ -58,10 +63,10 @@ do {                                                                        \
        (_regs)->pc = (_pc);                                            \
        if (current->mm)                                                \
                (_regs)->p5 = current->mm->start_data;                  \
-       current->thread_info->l1_task_info.stack_start                  \
+       task_thread_info(current)->l1_task_info.stack_start             \
                = (void *)current->mm->context.stack_start;             \
-       current->thread_info->l1_task_info.lowest_sp = (void *)(_usp);          \
-       memcpy(L1_SCRATCH_TASK_INFO, &current->thread_info->l1_task_info,       \
+       task_thread_info(current)->l1_task_info.lowest_sp = (void *)(_usp); \
+       memcpy(L1_SCRATCH_TASK_INFO, &task_thread_info(current)->l1_task_info, \
                sizeof(*L1_SCRATCH_TASK_INFO));                         \
        wrusp(_usp);                                                    \
 } while(0)
@@ -104,13 +109,32 @@ unsigned long get_wchan(struct task_struct *p);
 #define cpu_relax()            barrier()
 
 /* Get the Silicon Revision of the chip */
-static inline uint32_t bfin_revid(void)
+static inline uint32_t __pure bfin_revid(void)
 {
        /* stored in the upper 4 bits */
-       return bfin_read_CHIPID() >> 28;
+       uint32_t revid = bfin_read_CHIPID() >> 28;
+
+#ifdef CONFIG_BF52x
+       /* ANOMALY_05000357
+        * Incorrect Revision Number in DSPID Register
+        */
+       if (revid == 0)
+               switch (bfin_read16(_BOOTROM_GET_DXE_ADDRESS_TWI)) {
+               case 0x0010:
+                       revid = 0;
+                       break;
+               case 0x2796:
+                       revid = 1;
+                       break;
+               default:
+                       revid = 0xFFFF;
+                       break;
+               }
+#endif
+       return revid;
 }
 
-static inline uint32_t bfin_compiled_revid(void)
+static inline uint32_t __pure bfin_compiled_revid(void)
 {
 #if defined(CONFIG_BF_REV_0_0)
        return 0;
@@ -124,6 +148,10 @@ static inline uint32_t bfin_compiled_revid(void)
        return 4;
 #elif defined(CONFIG_BF_REV_0_5)
        return 5;
+#elif defined(CONFIG_BF_REV_ANY)
+       return 0xffff;
+#else
+       return -1;
 #endif
 }