- Timestamp:
- Apr 28, 2016, 1:12:22 PM (9 years ago)
- Location:
- soft/giet_vm/giet_common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_common/utils.c
r745 r817 80 80 return ret; 81 81 } 82 82 //////////////////////////// 83 void _set_proctime( unsigned int val ) 84 { 85 asm volatile ( "mtc0 $0, $9 \n" 86 : 87 :"r" (val)); 88 } 83 89 ///////////////////////////////////////////// 84 90 void _it_disable( unsigned int * save_sr_ptr) … … 119 125 } 120 126 127 void _cpu_sync() 128 { 129 asm volatile("sync" ::: "memory"); 130 } 121 131 122 132 /////////////////////////////////////////////////////////////////////////// … … 585 595 : "r" (delay) 586 596 : "$3" ); 597 } 598 599 ///////////////////////////////////// 600 void _sleep( unsigned int cycles ) 601 { 602 unsigned int delay = cycles; 603 asm volatile( ".set noreorder \n" 604 "1: \n" 605 "bnez %0, 1b \n" 606 "addi %0, %0, -1 \n" 607 ".set reorder \n" 608 : "+r" (delay) ); 587 609 } 588 610 -
soft/giet_vm/giet_common/utils.h
r709 r817 56 56 extern unsigned int _get_proctime(void); 57 57 58 extern void _set_proctime( unsigned int value ); 59 58 60 extern void _it_disable( unsigned int* save_sr_ptr ); 59 61 … … 63 65 64 66 extern void _set_sr(unsigned int value); 67 68 extern void _cpu_sync(); 65 69 66 70 /////////////////////////////////////////////////////////////////////////// … … 154 158 extern void _break( char* str); 155 159 160 extern void _sleep( unsigned int cycles ); 161 156 162 extern unsigned int _strlen( char* str); 157 163
Note: See TracChangeset
for help on using the changeset viewer.