Index: sys/mips/include/asm.h =================================================================== --- sys/mips/include/asm.h (revision 255930) +++ sys/mips/include/asm.h (working copy) @@ -262,38 +262,6 @@ .align 3 /* - * Call ast if required - * - * XXX Do we really need to disable interrupts? - */ -#define DO_AST \ -44: \ - mfc0 t0, MIPS_COP_0_STATUS ;\ - and a0, t0, MIPS_SR_INT_IE ;\ - xor t0, a0, t0 ;\ - mtc0 t0, MIPS_COP_0_STATUS ;\ - COP0_SYNC ;\ - GET_CPU_PCPU(s1) ;\ - PTR_L s3, PC_CURPCB(s1) ;\ - PTR_L s1, PC_CURTHREAD(s1) ;\ - lw s2, TD_FLAGS(s1) ;\ - li s0, TDF_ASTPENDING | TDF_NEEDRESCHED;\ - and s2, s0 ;\ - mfc0 t0, MIPS_COP_0_STATUS ;\ - or t0, a0, t0 ;\ - mtc0 t0, MIPS_COP_0_STATUS ;\ - COP0_SYNC ;\ - beq s2, zero, 4f ;\ - nop ;\ - PTR_LA s0, _C_LABEL(ast) ;\ - jalr s0 ;\ - PTR_ADDU a0, s3, U_PCB_REGS ;\ - j 44b ;\ - nop ;\ -4: - - -/* * XXX retain dialects XXX */ #define ALEAF(x) XLEAF(x) Index: sys/mips/include/pcb.h =================================================================== --- sys/mips/include/pcb.h (revision 255930) +++ sys/mips/include/pcb.h (working copy) @@ -79,6 +79,56 @@ void makectx(struct trapframe *, struct pcb *); int savectx(struct pcb *) __returns_twice; + +/* + * Call ast if required + * + * XXX Do we really need to disable interrupts? + */ +#define DO_AST \ +44: \ + mfc0 t0, MIPS_COP_0_STATUS ;\ + and a0, t0, MIPS_SR_INT_IE ;\ + xor t0, a0, t0 ;\ + mtc0 t0, MIPS_COP_0_STATUS ;\ + COP0_SYNC ;\ + GET_CPU_PCPU(s1) ;\ + PTR_L s3, PC_CURPCB(s1) ;\ + PTR_L s1, PC_CURTHREAD(s1) ;\ + lw s2, TD_FLAGS(s1) ;\ + li s0, TDF_ASTPENDING | TDF_NEEDRESCHED;\ + and s2, s0 ;\ + mfc0 t0, MIPS_COP_0_STATUS ;\ + or t0, a0, t0 ;\ + mtc0 t0, MIPS_COP_0_STATUS ;\ + COP0_SYNC ;\ + beq s2, zero, 4f ;\ + nop ;\ + PTR_LA s0, _C_LABEL(ast) ;\ + jalr s0 ;\ + PTR_ADDU a0, s3, U_PCB_REGS ;\ + j 44b ;\ + nop ;\ +4: + +#define SAVE_U_PCB_REG(reg, offs, base) \ + REG_S reg, U_PCB_REGS + (SZREG * offs) (base) + +#define RESTORE_U_PCB_REG(reg, offs, base) \ + REG_L reg, U_PCB_REGS + (SZREG * offs) (base) + +#define SAVE_U_PCB_FPREG(reg, offs, base) \ + FP_S reg, U_PCB_FPREGS + (SZFPREG * offs) (base) + +#define RESTORE_U_PCB_FPREG(reg, offs, base) \ + FP_L reg, U_PCB_FPREGS + (SZFPREG * offs) (base) + +#define SAVE_U_PCB_FPSR(reg, offs, base) \ + REG_S reg, U_PCB_FPREGS + (SZFPREG * offs) (base) + +#define RESTORE_U_PCB_FPSR(reg, offs, base) \ + REG_L reg, U_PCB_FPREGS + (SZFPREG * offs) (base) + #endif #endif Index: sys/mips/mips/exception.S =================================================================== --- sys/mips/mips/exception.S (revision 255930) +++ sys/mips/mips/exception.S (working copy) @@ -61,6 +61,7 @@ #include #include #include +#include #include "assym.s" @@ -411,12 +412,6 @@ END(MipsKernGenException) -#define SAVE_U_PCB_REG(reg, offs, base) \ - REG_S reg, U_PCB_REGS + (SZREG * offs) (base) - -#define RESTORE_U_PCB_REG(reg, offs, base) \ - REG_L reg, U_PCB_REGS + (SZREG * offs) (base) - /*---------------------------------------------------------------------------- * * MipsUserGenException -- Index: sys/mips/mips/swtch.S =================================================================== --- sys/mips/mips/swtch.S (revision 255930) +++ sys/mips/mips/swtch.S (working copy) @@ -68,31 +68,6 @@ .set noreorder # Noreorder is default style! -#define SAVE_U_PCB_REG(reg, offs, base) \ - REG_S reg, U_PCB_REGS + (SZREG * offs) (base) - -#define RESTORE_U_PCB_REG(reg, offs, base) \ - REG_L reg, U_PCB_REGS + (SZREG * offs) (base) - -#define SAVE_U_PCB_FPREG(reg, offs, base) \ - FP_S reg, U_PCB_FPREGS + (SZFPREG * offs) (base) - -#define RESTORE_U_PCB_FPREG(reg, offs, base) \ - FP_L reg, U_PCB_FPREGS + (SZFPREG * offs) (base) - -#define SAVE_U_PCB_FPSR(reg, offs, base) \ - REG_S reg, U_PCB_FPREGS + (SZFPREG * offs) (base) - -#define RESTORE_U_PCB_FPSR(reg, offs, base) \ - REG_L reg, U_PCB_FPREGS + (SZFPREG * offs) (base) - -#define SAVE_U_PCB_CONTEXT(reg, offs, base) \ - REG_S reg, U_PCB_CONTEXT + (SZREG * offs) (base) - -#define RESTORE_U_PCB_CONTEXT(reg, offs, base) \ - REG_L reg, U_PCB_CONTEXT + (SZREG * offs) (base) - - /* * Setup for and return to user. */