Changeset 8ff0bd2 in mainline for kernel/arch/mips32/include/cp0.h
- Timestamp:
- 2011-09-04T11:30:58Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 03bc76a
- Parents:
- d2c67e7 (diff), deac215e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips32/include/cp0.h
rd2c67e7 r8ff0bd2 36 36 #define KERN_mips32_CP0_H_ 37 37 38 #ifdef KERNEL39 #include <typedefs.h>40 #else41 #include <sys/types.h>42 #endif43 44 38 #define cp0_status_ie_enabled_bit (1 << 0) 45 39 #define cp0_status_exl_exception_bit (1 << 1) … … 49 43 #define cp0_status_fpu_bit (1 << 29) 50 44 51 #define cp0_status_im_shift 52 #define cp0_status_im_mask 45 #define cp0_status_im_shift 8 46 #define cp0_status_im_mask 0xff00 53 47 54 #define cp0_cause_excno(cause) ((cause >> 2) & 0x1f)55 #define cp0_cause_coperr(cause) ((cause >> 28) & 0x3)48 #define cp0_cause_excno(cause) ((cause >> 2) & 0x1f) 49 #define cp0_cause_coperr(cause) ((cause >> 28) & 0x3) 56 50 57 #define fpu_cop_id 151 #define fpu_cop_id 1 58 52 59 53 /* 60 54 * Magic value for use in msim. 61 55 */ 62 #define cp0_compare_value 56 #define cp0_compare_value 100000 63 57 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)))) 58 #define cp0_mask_all_int() \ 59 cp0_status_write(cp0_status_read() & ~(cp0_status_im_mask)) 68 60 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 } 61 #define cp0_unmask_all_int() \ 62 cp0_status_write(cp0_status_read() | cp0_status_im_mask) 75 63 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 } 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 } 80 91 81 92 GEN_READ_CP0(index, 0);
Note:
See TracChangeset
for help on using the changeset viewer.