Changeset 228 for soft/giet_vm/libs/libsrl/srl_sched_wait.c
- Timestamp:
- Feb 12, 2013, 6:33:31 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/libs/libsrl/srl_sched_wait.c
r178 r228 28 28 #define DECLARE_WAIT(name, cmp) \ 29 29 \ 30 void srl_sched_wait_##name( void *addr, sint32_t val ) \ 31 { \ 32 srl_dcache_flush_addr(addr); \ 33 if ( ((sint32_t)*((unsigned int *)addr)) cmp val ) \ 34 return; \ 35 do { \ 36 srl_sched_wait_priv(100);?? \ 37 srl_dcache_flush_addr(addr); \ 38 } while (((sint32_t)*((unsigned int*)addr)) cmp val ); \ 39 } 30 void srl_sched_wait_##name(void * addr, sint32_t val) { \ 31 srl_dcache_flush_addr(addr); \ 32 if (((sint32_t) * ((unsigned int *) addr)) cmp val) \ 33 return; \ 34 do { \ 35 srl_sched_wait_priv(100);?? \ 36 srl_dcache_flush_addr(addr); \ 37 } while (((sint32_t) * ((unsigned int *) addr)) cmp val); \ 38 } 40 39 41 40 … … 53 52 DECLARE_WAIT(gt, >) 54 53 55 //TODO 56 void srl_sched_wait_priv(uint32_t date ) 57 { 58 do{ 59 context_switch(); 60 }while (srl_cycle_count() > date); 54 //TODO 55 void srl_sched_wait_priv(uint32_t date) { 56 do { 57 context_switch(); 58 } while (srl_cycle_count() > date); 61 59 } 62 60 63 void srl_sleep_cycles( uint32_t n ) 64 { 65 uint32_t next_run_to = srl_cycle_count()+n; 61 void srl_sleep_cycles(uint32_t n) { 62 uint32_t next_run_to = srl_cycle_count() + n; 66 63 67 while(srl_cycle_count() < next_run_to) 68 srl_sched_wait_priv(next_run_to); 64 while (srl_cycle_count() < next_run_to) { 65 srl_sched_wait_priv(next_run_to); 66 } 69 67 } 70 68 69 70 // Local Variables: 71 // tab-width: 4 72 // c-basic-offset: 4 73 // c-file-offsets:((innamespace . 0)(inline-open . 0)) 74 // indent-tabs-mode: nil 75 // End: 76 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 77
Note: See TracChangeset
for help on using the changeset viewer.