Changeset 440 for trunk/kernel/syscalls/sys_get_config.c
- Timestamp:
- May 3, 2018, 5:51:22 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_get_config.c
r438 r440 2 2 * sys_get_config.c - get hardware platform parameters. 3 3 * 4 * Author Alain Greiner (2016,2017 )4 * Author Alain Greiner (2016,2017,2018) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 37 37 uint32_t * ncores ) 38 38 { 39 paddr_t paddr; 40 uint32_t k_x_size; 41 uint32_t k_y_size; 42 uint32_t k_ncores; 43 44 error_t error = 0; 39 error_t error; 40 vseg_t * vseg; 41 uint32_t k_x_size; 42 uint32_t k_y_size; 43 uint32_t k_ncores; 45 44 46 45 thread_t * this = CURRENT_THREAD; … … 56 55 #endif 57 56 58 // check buffer in user space 59 error |= vmm_v2p_translate( false , x_size , &paddr ); 60 error |= vmm_v2p_translate( false , y_size , &paddr ); 61 error |= vmm_v2p_translate( false , ncores , &paddr ); 57 // check x_size buffer in user space 58 error = vmm_get_vseg( process , (intptr_t)x_size , &vseg ); 62 59 63 60 if( error ) … … 65 62 66 63 #if 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 ); 64 printk("\n[ERROR] in %s : x_size buffer unmapped / thread %x / process %x\n", 65 __FUNCTION__ , (intptr_t)x_size , this->trdid , process->pid ); 66 vmm_display( process , false ); 69 67 #endif 70 this->errno = EFAULT; 68 this->errno = EINVAL; 69 return -1; 70 } 71 72 // check y_size buffer in user space 73 error = vmm_get_vseg( process , (intptr_t)y_size , &vseg ); 74 75 if( error ) 76 { 77 78 #if DEBUG_SYSCALLS_ERROR 79 printk("\n[ERROR] in %s : y_size buffer unmapped / thread %x / process %x\n", 80 __FUNCTION__ , (intptr_t)y_size , this->trdid , process->pid ); 81 vmm_display( process , false ); 82 #endif 83 this->errno = EINVAL; 84 return -1; 85 } 86 87 // check ncores buffer in user space 88 error = vmm_get_vseg( process , (intptr_t)ncores , &vseg ); 89 90 if( error ) 91 { 92 93 #if DEBUG_SYSCALLS_ERROR 94 printk("\n[ERROR] in %s : ncores buffer unmapped / thread %x / process %x\n", 95 __FUNCTION__ , (intptr_t)ncores , this->trdid , process->pid ); 96 vmm_display( process , false ); 97 #endif 98 this->errno = EINVAL; 71 99 return -1; 72 100 }
Note: See TracChangeset
for help on using the changeset viewer.