Ignore:
Timestamp:
Jan 13, 2021, 12:36:17 AM (3 years ago)
Author:
alain
Message:

All modifications required to support the <tcp_chat> application
including error recovery in case of packet loss.A

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/devices/dev_fbf.c

    r674 r683  
    159159                                intptr_t * user_buffer )
    160160{
    161     kmem_req_t     req;
    162161    fbf_window_t * window;      // window descriptor (created in local cluster)
    163162    vseg_t       * vseg;        // vseg descriptor (created in reference cluster)
     
    202201 
    203202    // 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 );
    208204
    209205    if( window == NULL )
     
    256252        printk("\n[ERROR] in %s / thread[%x,%x] cannot create vseg in reference cluster\n",
    257253        __FUNCTION__, process->pid, this->trdid );
    258         req.ptr = (void *)window;
    259         kmem_free( &req );
     254        kmem_free( window , bits_log2(sizeof(fbf_window_t)) );
    260255        return -1;
    261256    }
     
    281276        printk("\n[ERROR] in %s / thread[%x,%x] cannot allocate buffer for window\n",
    282277        __FUNCTION__, process->pid, this->trdid );
    283         req.ptr = (void *)window;
    284         kmem_free( &req );
     278        kmem_free( window , bits_log2(sizeof(fbf_window_t)) );
    285279        vmm_remove_vseg( process , vseg );
    286280        return -1;
     
    521515error_t dev_fbf_delete_window( uint32_t  wid )
    522516{
    523     kmem_req_t     req;
    524 
    525517    thread_t  * this    = CURRENT_THREAD;
    526518    process_t * process = this->process;
     
    581573 
    582574    // 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)) );
    586576
    587577    // 9. release the associated vseg
Note: See TracChangeset for help on using the changeset viewer.