]> rtime.felk.cvut.cz Git - mcf548x/linux.git/blobdiff - arch/m68k/include/asm/processor.h
Current (FEC from 2.6.31 port, no CAN, no I2C, no PCI)
[mcf548x/linux.git] / arch / m68k / include / asm / processor.h
index 7a6a7590cc02cd584d28fd9e2a98d9d1b8b30797..c58938bdf80b81d0aff177409adab9ef4deb5361 100644 (file)
@@ -45,9 +45,11 @@ static inline void wrusp(unsigned long usp)
  * so don't change it unless you know what you are doing.
  */
 #ifdef CONFIG_MMU
-#ifndef CONFIG_SUN3
+#if !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE) 
 #define TASK_SIZE      (0xF0000000UL)
-#else
+#elif defined(CONFIG_COLDFIRE) 
+#define TASK_SIZE       (0xC0000000UL) 
+#else /* CONFIG_SUN3 */ 
 #define TASK_SIZE      (0x0E000000UL)
 #endif
 #else
@@ -63,9 +65,11 @@ static inline void wrusp(unsigned long usp)
  * space during mmap's.
  */
 #ifdef CONFIG_MMU
-#ifndef CONFIG_SUN3
+#if !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE) 
 #define TASK_UNMAPPED_BASE     0xC0000000UL
-#else
+#elif defined(CONFIG_COLDFIRE)
+#define TASK_UNMAPPED_BASE     0x60000000UL 
+#else /* CONFIG_SUN3 */ 
 #define TASK_UNMAPPED_BASE     0x0A000000UL
 #endif
 #define TASK_UNMAPPED_ALIGN(addr, off) PAGE_ALIGN(addr)
@@ -77,7 +81,11 @@ struct thread_struct {
        unsigned long  ksp;             /* kernel stack pointer */
        unsigned long  usp;             /* user stack pointer */
        unsigned short sr;              /* saved status register */
+#ifndef CONFIG_COLDFIRE 
        unsigned short fs;              /* saved fs (sfc, dfc) */
+#else 
+       mm_segment_t   fs; 
+#endif         
        unsigned long  crp[2];          /* cpu root pointer */
        unsigned long  esp0;            /* points to SR of stack frame */
        unsigned long  faddr;           /* info about last fault */
@@ -99,6 +107,9 @@ struct thread_struct {
 /*
  * Do necessary setup to start up a newly executed thread.
  */
+
+#ifndef CONFIG_COLDFIRE
+  
 static inline void start_thread(struct pt_regs * regs, unsigned long pc,
                                unsigned long usp)
 {
@@ -110,6 +121,26 @@ static inline void start_thread(struct pt_regs * regs, unsigned long pc,
        wrusp(usp);
 }
 
+#else 
+/* 
+ * Do necessary setup to start up a newly executed thread. 
+ * 
+ * pass the data segment into user programs if it exists, 
+ * it can't hurt anything as far as I can tell
+ *
+ * XXX: Why the fuck is this a macro ???? 
+ */ 
+#define start_thread(_regs, _pc, _usp)                  \
+do {                                                    \
+        set_fs(USER_DS); /* reads from user space */    \
+        (_regs)->pc = (_pc);                            \
+        if (current->mm)                                \
+                (_regs)->d5 = current->mm->start_data;  \
+        (_regs)->sr &= ~0x2000;                         \
+        wrusp(_usp);                                    \
+} while (0) 
+#endif 
+
 #else
 
 /*