]> err.no Git - linux-2.6/blobdiff - include/asm-parisc/processor.h
Merge branch 'master' into gfs2
[linux-2.6] / include / asm-parisc / processor.h
index a9dfadd05658e7a548c73318385c73b791999593..b73626f040dace5eb8d091636be645ed564864a0 100644 (file)
@@ -9,7 +9,6 @@
 #define __ASM_PARISC_PROCESSOR_H
 
 #ifndef __ASSEMBLY__
-#include <linux/config.h>
 #include <linux/threads.h>
 #include <linux/spinlock_types.h>
 
  * Default implementation of macro that returns current
  * instruction pointer ("program counter").
  */
-
-/* We cannot use MFIA as it was added for PA2.0 - prumpf
-
-   At one point there were no "0f/0b" type local symbols in gas for
-   PA-RISC.  This is no longer true, but this still seems like the
-   nicest way to implement this. */
-
-#define current_text_addr() ({ void *pc; __asm__("\n\tblr 0,%0\n\tnop":"=r" (pc)); pc; })
+#ifdef CONFIG_PA20
+#define current_ia(x)  __asm__("mfia %0" : "=r"(x))
+#else /* mfia added in pa2.0 */
+#define current_ia(x)  __asm__("blr 0,%0\n\tnop" : "=r"(x))
+#endif
+#define current_text_addr() ({ void *pc; current_ia(pc); pc; })
 
 #define TASK_SIZE               (current->thread.task_size)
 #define TASK_UNMAPPED_BASE      (current->thread.map_base)
@@ -122,19 +119,38 @@ struct thread_struct {
 }; 
 
 /* Thread struct flags. */
+#define PARISC_UAC_NOPRINT     (1UL << 0)      /* see prctl and unaligned.c */
+#define PARISC_UAC_SIGBUS      (1UL << 1)
 #define PARISC_KERNEL_DEATH    (1UL << 31)     /* see die_if_kernel()... */
 
+#define PARISC_UAC_SHIFT       0
+#define PARISC_UAC_MASK                (PARISC_UAC_NOPRINT|PARISC_UAC_SIGBUS)
+
+#define SET_UNALIGN_CTL(task,value)                                       \
+        ({                                                                \
+        (task)->thread.flags = (((task)->thread.flags & ~PARISC_UAC_MASK) \
+                                | (((value) << PARISC_UAC_SHIFT) &        \
+                                   PARISC_UAC_MASK));                     \
+        0;                                                                \
+        })
+
+#define GET_UNALIGN_CTL(task,addr)                                        \
+        ({                                                                \
+        put_user(((task)->thread.flags & PARISC_UAC_MASK)                 \
+                 >> PARISC_UAC_SHIFT, (int __user *) (addr));             \
+        })
+
 #define INIT_THREAD { \
-       regs:   {       gr: { 0, }, \
-                       fr: { 0, }, \
-                       sr: { 0, }, \
-                       iasq: { 0, }, \
-                       iaoq: { 0, }, \
-                       cr27: 0, \
+       .regs = {       .gr     = { 0, }, \
+                       .fr     = { 0, }, \
+                       .sr     = { 0, }, \
+                       .iasq   = { 0, }, \
+                       .iaoq   = { 0, }, \
+                       .cr27   = 0, \
                }, \
-       task_size:      DEFAULT_TASK_SIZE, \
-       map_base:       DEFAULT_MAP_BASE, \
-       flags:          0 \
+       .task_size      = DEFAULT_TASK_SIZE, \
+       .map_base       = DEFAULT_MAP_BASE, \
+       .flags          = 0 \
        }
 
 /*