Ignore:
Timestamp:
Feb 20, 2018, 5:32:17 PM (6 years ago)
Author:
alain
Message:

Fix a bad bug in scheduler...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/syscalls/sys_get_config.c

    r421 r435  
    3535int sys_get_config( uint32_t * x_size,
    3636                    uint32_t * y_size,
    37                     uint32_t * y_width,
    3837                    uint32_t * ncores )
    3938{
     
    4140    uint32_t  k_x_size;
    4241    uint32_t  k_y_size;
    43     uint32_t  k_y_width;
    4442    uint32_t  k_ncores;
    4543
     
    4947    process_t * process = this->process;
    5048
     49#if CONFIG_DEBUG_SYS_GET_CONFIG
     50uint64_t     tm_start;
     51uint64_t     tm_end;
     52tm_start = hal_get_cycles();
     53if( CONFIG_DEBUG_SYS_GET_CONFIG < tm_start )
     54printk("\n[DBG] %s : thread %x enter / process %x / cycle %d\n",
     55__FUNCTION__, this, process->pid, (uint32_t)tm_start );
     56#endif
     57
    5158    // check buffer in user space
    5259    error |= vmm_v2p_translate( false , x_size  , &paddr );
    5360    error |= vmm_v2p_translate( false , y_size  , &paddr );
    54     error |= vmm_v2p_translate( false , y_width , &paddr );
    5561    error |= vmm_v2p_translate( false , ncores  , &paddr );
    5662
    5763        if( error )
    5864        {
    59         printk("\n[ERROR] in %s : user buffer unmapped for thread %x in process %x\n",
    60                __FUNCTION__ , this->trdid , process->pid );
     65
     66#if CONFIG_DEBUG_SYSCALLS_ERROR
     67printk("\n[ERROR] in %s : user buffer unmapped for thread %x in process %x\n",
     68__FUNCTION__ , this->trdid , process->pid );
     69#endif
    6170        this->errno = EFAULT;
    6271                return -1;
     
    6675        k_x_size  = LOCAL_CLUSTER->x_size;
    6776        k_y_size  = LOCAL_CLUSTER->y_size;
    68         k_y_width = LOCAL_CLUSTER->y_width;
    6977        k_ncores  = LOCAL_CLUSTER->cores_nr;
    7078
     
    7280        hal_copy_to_uspace( x_size  , &k_x_size  , sizeof(uint32_t) );
    7381        hal_copy_to_uspace( y_size  , &k_y_size  , sizeof(uint32_t) );
    74         hal_copy_to_uspace( y_width , &k_y_width , sizeof(uint32_t) );
    7582        hal_copy_to_uspace( ncores  , &k_ncores  , sizeof(uint32_t) );
     83
     84    hal_fence();
     85
     86#if CONFIG_DEBUG_SYS_GET_CONFIG
     87tm_end = hal_get_cycles();
     88if( CONFIG_DEBUG_SYS_GET_CONFIG < tm_end )
     89printk("\n[DBG] %s : thread %x exit / process %x / cost %d / tycle %d\n",
     90__FUNCTION__, this, process->pid, (uint32_t)(tm_end-tm_start), (uint32_t)tm_end );
     91#endif
    7692
    7793        return 0;
Note: See TracChangeset for help on using the changeset viewer.