20 #ifndef KERNEL_PROCESSOR_MIPS_COMMON_PROCESSOR_H 21 #define KERNEL_PROCESSOR_MIPS_COMMON_PROCESSOR_H 25 #define CP0_ENTRYLO0 2 26 #define CP0_ENTRYLO1 3 28 #define CP0_PAGEMASK 5 31 #define CP0_BADVADDR 8 33 #define CP0_ENTRYHI 10 34 #define CP0_COMPARE 11 41 #define CP0_WATCHLO 18 42 #define CP0_WATCHHI 19 44 #define CP0_CACHEERR 27 47 #define CP0_ERROREPC 30 49 #define CP0_WRITE_INDEX(val) asm volatile("mtc0 %0, $0; nop" : : "r"(val)); 50 #define CP0_WRITE_RANDOM(val) asm volatile("mtc0 %0, $1; nop" : : "r"(val)); 51 #define CP0_WRITE_ENTRYLO0(val) asm volatile("mtc0 %0, $2; nop" : : "r"(val)); 52 #define CP0_WRITE_ENTRYLO1(val) asm volatile("mtc0 %0, $3; nop" : : "r"(val)); 53 #define CP0_WRITE_CONTEXT(val) asm volatile("mtc0 %0, $4; nop" : : "r"(val)); 54 #define CP0_WRITE_PAGEMASK(val) asm volatile("mtc0 %0, $5; nop" : : "r"(val)); 55 #define CP0_WRITE_WIRED(val) asm volatile("mtc0 %0, $6; nop" : : "r"(val)); 56 #define CP0_WRITE_BADVADDR(val) asm volatile("mtc0 %0, $8; nop" : : "r"(val)); 57 #define CP0_WRITE_COUNT(val) asm volatile("mtc0 %0, $9; nop" : : "r"(val)); 58 #define CP0_WRITE_ENTRYHI(val) asm volatile("mtc0 %0, $10; nop" : : "r"(val)); 59 #define CP0_WRITE_COMPARE(val) asm volatile("mtc0 %0, $11; nop" : : "r"(val)); 60 #define CP0_WRITE_SR(val) asm volatile("mtc0 %0, $12; nop" : : "r"(val)); 61 #define CP0_WRITE_CAUSE(val) asm volatile("mtc0 %0, $13; nop" : : "r"(val)); 62 #define CP0_WRITE_EPC(val) asm volatile("mtc0 %0, $14; nop" : : "r"(val)); 63 #define CP0_WRITE_PRID(val) asm volatile("mtc0 %0, $15; nop" : : "r"(val)); 64 #define CP0_WRITE_CONFIG(val) asm volatile("mtc0 %0, $16; nop" : : "r"(val)); 65 #define CP0_WRITE_LLADDR(val) asm volatile("mtc0 %0, $17; nop" : : "r"(val)); 66 #define CP0_WRITE_WATCHLO(val) asm volatile("mtc0 %0, $18; nop" : : "r"(val)); 67 #define CP0_WRITE_WATCHHI(val) asm volatile("mtc0 %0, $19; nop" : : "r"(val)); 68 #define CP0_WRITE_ECC(val) asm volatile("mtc0 %0, $26; nop" : : "r"(val)); 69 #define CP0_WRITE_CACHEERR(val) asm volatile("mtc0 %0, $27; nop" : : "r"(val)); 70 #define CP0_WRITE_TAGLO(val) asm volatile("mtc0 %0, $28; nop" : : "r"(val)); 71 #define CP0_WRITE_TAGHI(val) asm volatile("mtc0 %0, $29; nop" : : "r"(val)); 72 #define CP0_WRITE_ERROREPC(val) asm volatile("mtc0 %0, $30; nop" : : "r"(val)); 74 #define CP0_READ_INDEX(val) asm volatile("mfc0 %0, $0; nop" : "=r"(val)); 75 #define CP0_READ_RANDOM(val) asm volatile("mfc0 %0, $1; nop" : "=r"(val)); 76 #define CP0_READ_ENTRYLO0(val) asm volatile("mfc0 %0, $2; nop" : "=r"(val)); 77 #define CP0_READ_ENTRYLO1(val) asm volatile("mfc0 %0, $3; nop" : "=r"(val)); 78 #define CP0_READ_CONTEXT(val) asm volatile("mfc0 %0, $4; nop" : "=r"(val)); 79 #define CP0_READ_PAGEMASK(val) asm volatile("mfc0 %0, $5; nop" : "=r"(val)); 80 #define CP0_READ_WIRED(val) asm volatile("mfc0 %0, $6; nop" : "=r"(val)); 81 #define CP0_READ_BADVADDR(val) asm volatile("mfc0 %0, $8; nop" : "=r"(val)); 82 #define CP0_READ_COUNT(val) asm volatile("mfc0 %0, $9; nop" : "=r"(val)); 83 #define CP0_READ_ENTRYHI(val) asm volatile("mfc0 %0, $10; nop" : "=r"(val)); 84 #define CP0_READ_COMPARE(val) asm volatile("mfc0 %0, $11; nop" : "=r"(val)); 85 #define CP0_READ_SR(val) asm volatile("mfc0 %0, $12; nop" : "=r"(val)); 86 #define CP0_READ_CAUSE(val) asm volatile("mfc0 %0, $13; nop" : "=r"(val)); 87 #define CP0_READ_EPC(val) asm volatile("mfc0 %0, $14; nop" : "=r"(val)); 88 #define CP0_READ_PRID(val) asm volatile("mfc0 %0, $15; nop" : "=r"(val)); 89 #define CP0_READ_CONFIG(val) asm volatile("mfc0 %0, $16; nop" : "=r"(val)); 90 #define CP0_READ_LLADDR(val) asm volatile("mfc0 %0, $17; nop" : "=r"(val)); 91 #define CP0_READ_WATCHLO(val) asm volatile("mfc0 %0, $18; nop" : "=r"(val)); 92 #define CP0_READ_WATCHHI(val) asm volatile("mfc0 %0, $19; nop" : "=r"(val)); 93 #define CP0_READ_ECC(val) asm volatile("mfc0 %0, $26; nop" : "=r"(val)); 94 #define CP0_READ_CACHEERR(val) asm volatile("mfc0 %0, $27; nop" : "=r"(val)); 95 #define CP0_READ_TAGLO(val) asm volatile("mfc0 %0, $28; nop" : "=r"(val)); 96 #define CP0_READ_TAGHI(val) asm volatile("mfc0 %0, $29; nop" : "=r"(val)); 97 #define CP0_READ_ERROREPC(val) asm volatile("mfc0 %0, $30; nop" : "=r"(val)); 99 #define SR_IE (1 << 0) 100 #define SR_EXL (1 << 1) 101 #define SR_ERL (1 << 2) 106 asm volatile(
"break");