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/fs/devfs.c

    r673 r683  
    5656xptr_t devfs_ctx_alloc( cxy_t cxy )
    5757{
    58     kmem_req_t    req;
    59 
    60         req.type    = KMEM_KCM;
    61         req.order   = bits_log2( sizeof(devfs_ctx_t) );
    62     req.flags   = AF_KERNEL | AF_ZERO;
    63 
    6458    // allocates devfs context from target cluster
    65         return XPTR( cxy , kmem_remote_alloc( cxy , &req ) );
     59        void * ptr = kmem_remote_alloc( cxy,
     60                                    bits_log2(sizeof(devfs_ctx_t)),
     61                                    AF_ZERO );
     62
     63    if( ptr == NULL ) return XPTR_NULL;
     64        else              return XPTR( cxy , ptr );
    6665}
    6766
     
    9089void devfs_ctx_destroy( xptr_t  devfs_ctx_xp )
    9190{
    92     kmem_req_t    req;
    93 
    9491    // get cluster and local pointer on devfs context
    9592    devfs_ctx_t * devfs_ctx_ptr = GET_PTR( devfs_ctx_xp );
    9693    cxy_t         devfs_ctx_cxy = GET_CXY( devfs_ctx_xp );
    9794
    98     req.type = KMEM_KCM;
    99     req.ptr  = devfs_ctx_ptr;
    100 
    10195    // release devfs context descriptor to remote cluster
    102     kmem_remote_free( devfs_ctx_cxy , &req );
     96    kmem_remote_free( devfs_ctx_cxy,
     97                      devfs_ctx_ptr,
     98                      bits_log2(sizeof(devfs_ctx_t)) );
    10399}
    104100
Note: See TracChangeset for help on using the changeset viewer.