Ignore:
Timestamp:
Feb 12, 2013, 6:33:31 PM (11 years ago)
Author:
meunier
Message:

Added support for memspaces and const.
Added an interrupt masking to the "giet_context_switch" syscall
Corrected two bugs in boot/boot_init.c (one minor and one regarding barriers initialization)
Reformatted the code in all files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/libs/libsrl/srl_sched_wait.c

    r178 r228  
    2828#define DECLARE_WAIT(name, cmp)                                 \
    2929                                                                \
    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     }
     30void 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}
    4039
    4140
     
    5352DECLARE_WAIT(gt, >)
    5453
    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
     55void srl_sched_wait_priv(uint32_t date) {
     56    do {
     57        context_switch();
     58    } while (srl_cycle_count() > date);
    6159}
    6260
    63 void srl_sleep_cycles( uint32_t n )
    64 {
    65         uint32_t next_run_to = srl_cycle_count()+n;
     61void srl_sleep_cycles(uint32_t n) {
     62    uint32_t next_run_to = srl_cycle_count() + n;
    6663
    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    }
    6967}
    7068
     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.