Changes in kernel/arch/mips32/include/cp0.h [c0699467:84f0a79] in mainline
- File:
-
- 1 edited
-
kernel/arch/mips32/include/cp0.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips32/include/cp0.h
rc0699467 r84f0a79 36 36 #define KERN_mips32_CP0_H_ 37 37 38 #ifdef KERNEL 39 #include <typedefs.h> 40 #else 41 #include <sys/types.h> 42 #endif 43 38 44 #define cp0_status_ie_enabled_bit (1 << 0) 39 45 #define cp0_status_exl_exception_bit (1 << 1) … … 43 49 #define cp0_status_fpu_bit (1 << 29) 44 50 45 #define cp0_status_im_shift 846 #define cp0_status_im_mask 0xff0051 #define cp0_status_im_shift 8 52 #define cp0_status_im_mask 0xff00 47 53 48 #define cp0_cause_excno(cause) ((cause >> 2) & 0x1f)49 #define cp0_cause_coperr(cause) ((cause >> 28) & 0x3)54 #define cp0_cause_excno(cause) ((cause >> 2) & 0x1f) 55 #define cp0_cause_coperr(cause) ((cause >> 28) & 0x3) 50 56 51 #define fpu_cop_id 157 #define fpu_cop_id 1 52 58 53 59 /* 54 60 * Magic value for use in msim. 55 61 */ 56 #define cp0_compare_value 10000062 #define cp0_compare_value 100000 57 63 58 #define cp0_mask_all_int() \ 59 cp0_status_write(cp0_status_read() & ~(cp0_status_im_mask)) 64 #define cp0_mask_all_int() cp0_status_write(cp0_status_read() & ~(cp0_status_im_mask)) 65 #define cp0_unmask_all_int() cp0_status_write(cp0_status_read() | cp0_status_im_mask) 66 #define cp0_mask_int(it) cp0_status_write(cp0_status_read() & ~(1 << (cp0_status_im_shift + (it)))) 67 #define cp0_unmask_int(it) cp0_status_write(cp0_status_read() | (1 << (cp0_status_im_shift + (it)))) 60 68 61 #define cp0_unmask_all_int() \ 62 cp0_status_write(cp0_status_read() | cp0_status_im_mask) 69 #define GEN_READ_CP0(nm,reg) static inline uint32_t cp0_ ##nm##_read(void) \ 70 { \ 71 uint32_t retval; \ 72 asm volatile ("mfc0 %0, $" #reg : "=r"(retval)); \ 73 return retval; \ 74 } 63 75 64 #define cp0_mask_int(it) \ 65 cp0_status_write(cp0_status_read() & ~(1 << (cp0_status_im_shift + (it)))) 66 67 #define cp0_unmask_int(it) \ 68 cp0_status_write(cp0_status_read() | (1 << (cp0_status_im_shift + (it)))) 69 70 #define GEN_READ_CP0(nm, reg) \ 71 static inline uint32_t cp0_ ##nm##_read(void) \ 72 { \ 73 uint32_t retval; \ 74 \ 75 asm volatile ( \ 76 "mfc0 %0, $" #reg \ 77 : "=r"(retval) \ 78 ); \ 79 \ 80 return retval; \ 81 } 82 83 #define GEN_WRITE_CP0(nm, reg) \ 84 static inline void cp0_ ##nm##_write(uint32_t val) \ 85 { \ 86 asm volatile ( \ 87 "mtc0 %0, $" #reg \ 88 :: "r"(val) \ 89 ); \ 90 } 76 #define GEN_WRITE_CP0(nm,reg) static inline void cp0_ ##nm##_write(uint32_t val) \ 77 { \ 78 asm volatile ("mtc0 %0, $" #reg : : "r"(val) ); \ 79 } 91 80 92 81 GEN_READ_CP0(index, 0);
Note:
See TracChangeset
for help on using the changeset viewer.
