Changeset 435 for trunk/kernel/syscalls/sys_get_config.c
- Timestamp:
- Feb 20, 2018, 5:32:17 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_get_config.c
r421 r435 35 35 int sys_get_config( uint32_t * x_size, 36 36 uint32_t * y_size, 37 uint32_t * y_width,38 37 uint32_t * ncores ) 39 38 { … … 41 40 uint32_t k_x_size; 42 41 uint32_t k_y_size; 43 uint32_t k_y_width;44 42 uint32_t k_ncores; 45 43 … … 49 47 process_t * process = this->process; 50 48 49 #if CONFIG_DEBUG_SYS_GET_CONFIG 50 uint64_t tm_start; 51 uint64_t tm_end; 52 tm_start = hal_get_cycles(); 53 if( CONFIG_DEBUG_SYS_GET_CONFIG < tm_start ) 54 printk("\n[DBG] %s : thread %x enter / process %x / cycle %d\n", 55 __FUNCTION__, this, process->pid, (uint32_t)tm_start ); 56 #endif 57 51 58 // check buffer in user space 52 59 error |= vmm_v2p_translate( false , x_size , &paddr ); 53 60 error |= vmm_v2p_translate( false , y_size , &paddr ); 54 error |= vmm_v2p_translate( false , y_width , &paddr );55 61 error |= vmm_v2p_translate( false , ncores , &paddr ); 56 62 57 63 if( error ) 58 64 { 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 67 printk("\n[ERROR] in %s : user buffer unmapped for thread %x in process %x\n", 68 __FUNCTION__ , this->trdid , process->pid ); 69 #endif 61 70 this->errno = EFAULT; 62 71 return -1; … … 66 75 k_x_size = LOCAL_CLUSTER->x_size; 67 76 k_y_size = LOCAL_CLUSTER->y_size; 68 k_y_width = LOCAL_CLUSTER->y_width;69 77 k_ncores = LOCAL_CLUSTER->cores_nr; 70 78 … … 72 80 hal_copy_to_uspace( x_size , &k_x_size , sizeof(uint32_t) ); 73 81 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) );75 82 hal_copy_to_uspace( ncores , &k_ncores , sizeof(uint32_t) ); 83 84 hal_fence(); 85 86 #if CONFIG_DEBUG_SYS_GET_CONFIG 87 tm_end = hal_get_cycles(); 88 if( CONFIG_DEBUG_SYS_GET_CONFIG < tm_end ) 89 printk("\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 76 92 77 93 return 0;
Note: See TracChangeset
for help on using the changeset viewer.