Changeset 683 for trunk/kernel/devices/dev_fbf.c
- Timestamp:
- Jan 13, 2021, 12:36:17 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/devices/dev_fbf.c
r674 r683 159 159 intptr_t * user_buffer ) 160 160 { 161 kmem_req_t req;162 161 fbf_window_t * window; // window descriptor (created in local cluster) 163 162 vseg_t * vseg; // vseg descriptor (created in reference cluster) … … 202 201 203 202 // allocate memory for the window descriptor in local cluster 204 req.type = KMEM_KCM; 205 req.order = bits_log2( sizeof(fbf_window_t) ); 206 req.flags = AF_ZERO | AF_KERNEL; 207 window = kmem_alloc( &req ); 203 window = kmem_alloc( bits_log2(sizeof(fbf_window_t)) , AF_ZERO ); 208 204 209 205 if( window == NULL ) … … 256 252 printk("\n[ERROR] in %s / thread[%x,%x] cannot create vseg in reference cluster\n", 257 253 __FUNCTION__, process->pid, this->trdid ); 258 req.ptr = (void *)window; 259 kmem_free( &req ); 254 kmem_free( window , bits_log2(sizeof(fbf_window_t)) ); 260 255 return -1; 261 256 } … … 281 276 printk("\n[ERROR] in %s / thread[%x,%x] cannot allocate buffer for window\n", 282 277 __FUNCTION__, process->pid, this->trdid ); 283 req.ptr = (void *)window; 284 kmem_free( &req ); 278 kmem_free( window , bits_log2(sizeof(fbf_window_t)) ); 285 279 vmm_remove_vseg( process , vseg ); 286 280 return -1; … … 521 515 error_t dev_fbf_delete_window( uint32_t wid ) 522 516 { 523 kmem_req_t req;524 525 517 thread_t * this = CURRENT_THREAD; 526 518 process_t * process = this->process; … … 581 573 582 574 // 8. release memory allocated for window descriptor 583 req.type = KMEM_KCM; 584 req.ptr = window_ptr; 585 kmem_remote_free( window_cxy , &req ); 575 kmem_remote_free( window_cxy , window_ptr , bits_log2(sizeof(fbf_window_t)) ); 586 576 587 577 // 9. release the associated vseg
Note: See TracChangeset
for help on using the changeset viewer.