Changeset 279 for trunk/hal/tsar_mips32/core/hal_irqmask.c
- Timestamp:
- Jul 27, 2017, 12:23:29 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/tsar_mips32/core/hal_irqmask.c
r62 r279 28 28 inline void hal_disable_irq( uint32_t * old ) 29 29 { 30 register u nsigned int sr;30 register uint32_t sr; 31 31 32 32 __asm__ volatile 33 33 (".set noat \n" 34 ".set noreorder \n" 35 "mfc0 $1, $12 \n" 36 "nop \n" 37 ".set reorder \n" 34 "mfc0 $1, $12 \n" 38 35 "or %0, $0, $1 \n" 39 36 "srl $1, $1, 1 \n" 40 37 "sll $1, $1, 1 \n" 41 38 "mtc0 $1, $12 \n" 42 43 : "=&r" (sr) );39 ".set at \n" 40 : "=&r" (sr) ); 44 41 45 42 if( old ) *old = sr; … … 49 46 inline void hal_enable_irq( uint32_t * old ) 50 47 { 51 register u nsigned int sr;48 register uint32_t sr; 52 49 53 50 __asm__ volatile 54 51 (".set noat \n" 55 ".set noreorder \n"56 52 "mfc0 $1, $12 \n" 57 "nop \n"58 53 "or %0, $0, $1 \n" 59 "ori $1, $1, 0x 1\n"54 "ori $1, $1, 0xFF01 \n" 60 55 "mtc0 $1, $12 \n" 61 "nop \n" 62 ".set reorder \n" 63 ".set at \n" 64 : "=&r" (sr)); 56 ".set at \n" 57 : "=&r" (sr) ); 65 58 66 59 if( old ) *old = sr; … … 71 64 { 72 65 __asm__ volatile 73 (".set noat \n" 74 ".set noreorder \n" 75 "mfc0 $1, $12 \n" 76 "ori $2, $0, 0xFF \n" 77 "and $2, $2, %0 \n" 78 "or $1, $1, $2 \n" 79 "mtc0 $1, $12 \n" 80 ".set reorder \n" 81 ".set at \n" 82 : : "r" (old) : "$2"); 66 ( "mtc0 %0, $12" : : "r" (old) ); 83 67 } 84 68 69
Note: See TracChangeset
for help on using the changeset viewer.