Changeset 637 for trunk/kernel/syscalls/sys_mmap.c
- Timestamp:
- Jul 18, 2019, 2:06:55 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_mmap.c
r635 r637 41 41 { 42 42 vseg_t * vseg; 43 cxy_t vseg_cxy; 44 vseg_type_t vseg_type; 43 cxy_t vseg_cxy; // target cluster for the vseg 44 vseg_type_t vseg_type; // vseg type 45 45 mmap_attr_t k_attr; // attributes copy in kernel space 46 46 xptr_t mapper_xp; 47 error_t error;48 47 reg_t save_sr; // required to enable IRQs 49 48 … … 62 61 63 62 // check user buffer (containing attributes) is mapped 64 error = vmm_get_vseg( process , (intptr_t)attr , &vseg ); 65 66 if( error ) 63 if( vmm_get_vseg( process , (intptr_t)attr , &vseg ) ) 67 64 { 68 65 … … 76 73 77 74 // copy attributes from user space to kernel space 78 hal_copy_from_uspace( local_cxy, 79 &k_attr, 75 hal_copy_from_uspace( XPTR( local_cxy , &k_attr ), 80 76 attr, 81 77 sizeof(mmap_attr_t) ); … … 119 115 120 116 // test mmap type : can be FILE / ANON / REMOTE 117 // to define vseg_type & vseg_cxy 121 118 122 119 /////////////////////////////////////////////////////////// MAP_FILE … … 126 123 #if (DEBUG_SYS_MMAP & 1) 127 124 if ( DEBUG_SYS_MMAP < tm_start ) 128 printk("\n[%s] thread[%x,%x] map file : fdid %d / offset %d / %dbytes\n",125 printk("\n[%s] thread[%x,%x] type file : fdid %d / offset %x / %x bytes\n", 129 126 __FUNCTION__, process->pid, this->trdid, fdid, offset, length ); 130 127 #endif 131 128 132 // FIXME: handle concurent delete of file by another thread closing it129 // FIXME: handle concurent delete of file by another thread 133 130 134 131 if( fdid >= CONFIG_PROCESS_FILE_MAX_NR ) … … 228 225 #if (DEBUG_SYS_MMAP & 1) 229 226 if ( DEBUG_SYS_MMAP < tm_start ) 230 printk("\n[%s] thread[%x,%x] map anon / %dbytes / cluster %x\n",227 printk("\n[%s] thread[%x,%x] type anon / %x bytes / cluster %x\n", 231 228 __FUNCTION__, process->pid, this->trdid, length, vseg_cxy ); 232 229 #endif … … 242 239 #if (DEBUG_SYS_MMAP & 1) 243 240 if ( DEBUG_SYS_MMAP < tm_start ) 244 printk("\n[%s] thread[%x,%x] map remote / %d bytes /cluster %x\n",241 printk("\n[%s] thread[%x,%x] type remote / %x bytes / target cluster %x\n", 245 242 __FUNCTION__, process->pid, this->trdid, length, vseg_cxy ); 246 243 #endif 247 244 248 if( cluster_is_ undefined( vseg_cxy ))245 if( cluster_is_active( vseg_cxy ) == false ) 249 246 { 250 247 … … 266 263 process_t * ref_ptr = GET_PTR( ref_xp ); 267 264 268 // create the vseg in reference cluster265 // register vseg in reference VSL 269 266 if( local_cxy == ref_cxy ) 270 267 { … … 306 303 } 307 304 308 // copy vseg base address to user space 309 hal_copy_to_uspace( local_cxy, 310 &vseg->min, 311 &attr->addr, 305 // copy vseg base address to user space mmap_attr_t 306 hal_copy_to_uspace( &attr->addr, 307 XPTR( ref_cxy , &vseg->min ), 312 308 sizeof(intptr_t) ); 313 309 hal_fence(); … … 324 320 #if DEBUG_SYS_MMAP 325 321 if ( DEBUG_SYS_MMAP < tm_end ) 326 printk("\n[%s] thread[%x,%x] exit / %s / cxy %x / base %x / size % d/ cycle %d\n",322 printk("\n[%s] thread[%x,%x] exit / %s / cxy %x / base %x / size %x / cycle %d\n", 327 323 __FUNCTION__, process->pid, this->trdid, 328 324 vseg_type_str(vseg->type), vseg->cxy, vseg->min, length, (uint32_t)tm_end );
Note: See TracChangeset
for help on using the changeset viewer.