]> Pileus Git - ~andy/linux/blobdiff - include/asm-mips/processor.h
Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge
[~andy/linux] / include / asm-mips / processor.h
index d6466aa09fb7a181a1dd07a52ac646b3c8755c06..39d2bd50fecede26d52090657e08b5fe71e29f39 100644 (file)
@@ -96,12 +96,25 @@ union mips_fpu_union {
        {{0,},} \
 }
 
+#define NUM_DSP_REGS   6
+
+typedef __u32 dspreg_t;
+
+struct mips_dsp_state {
+       dspreg_t        dspr[NUM_DSP_REGS];
+       unsigned int    dspcontrol;
+};
+
+#define INIT_DSP {{0,},}
+
 typedef struct {
        unsigned long seg;
 } mm_segment_t;
 
 #define ARCH_MIN_TASKALIGN     8
 
+struct mips_abi;
+
 /*
  * If you change thread_struct remember to change the #defines below too!
  */
@@ -117,6 +130,9 @@ struct thread_struct {
        /* Saved fpu/fpu emulator stuff. */
        union mips_fpu_union fpu;
 
+       /* Saved state of the DSP ASE, if available. */
+       struct mips_dsp_state dsp;
+
        /* Other stuff associated with the thread. */
        unsigned long cp0_badvaddr;     /* Last user fault */
        unsigned long cp0_baduaddr;     /* Last kernel fault accessing USEG */
@@ -129,6 +145,7 @@ struct thread_struct {
        unsigned long mflags;
        unsigned long irix_trampoline;  /* Wheee... */
        unsigned long irix_oldctx;
+       struct mips_abi *abi;
 };
 
 #define MF_ABI_MASK    (MF_32BIT_REGS | MF_32BIT_ADDR)
@@ -150,6 +167,10 @@ struct thread_struct {
         * saved fpu/fpu emulator stuff \
         */ \
        INIT_FPU, \
+       /* \
+        * saved dsp/dsp emulator stuff \
+        */ \
+       INIT_DSP, \
        /* \
         * Other stuff associated with the process \
         */ \
@@ -179,11 +200,11 @@ extern void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long
 
 unsigned long get_wchan(struct task_struct *p);
 
-#define __PT_REG(reg) ((long)&((struct pt_regs *)0)->reg - sizeof(struct pt_regs))
-#define __KSTK_TOS(tsk) ((unsigned long)(tsk->thread_info) + THREAD_SIZE - 32)
-#define KSTK_EIP(tsk) (*(unsigned long *)(__KSTK_TOS(tsk) + __PT_REG(cp0_epc)))
-#define KSTK_ESP(tsk) (*(unsigned long *)(__KSTK_TOS(tsk) + __PT_REG(regs[29])))
-#define KSTK_STATUS(tsk) (*(unsigned long *)(__KSTK_TOS(tsk) + __PT_REG(cp0_status)))
+#define __KSTK_TOS(tsk) ((unsigned long)task_stack_page(tsk) + THREAD_SIZE - 32)
+#define task_pt_regs(tsk) ((struct pt_regs *)__KSTK_TOS(tsk) - 1)
+#define KSTK_EIP(tsk) (task_pt_regs(tsk)->cp0_epc)
+#define KSTK_ESP(tsk) (task_pt_regs(tsk)->regs[29])
+#define KSTK_STATUS(tsk) (task_pt_regs(tsk)->cp0_status)
 
 #define cpu_relax()    barrier()