Ignore:
Timestamp:
May 3, 2018, 5:51:22 PM (6 years ago)
Author:
alain
Message:

1/ Fix a bug in the Multithreaded "sort" applicationr:
The pthread_create() arguments must be declared as global variables.
2/ The exit syscall can be called by any thread of a process..

File:
1 edited

Legend:

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

    r438 r440  
    5757
    5858/////////////////////////////////////////////////////////////////////////////
    59 // This static function is called by all MMC device functions.
     59// This static function is called by all MMC device access functions.
    6060// It makes some checking, takes the lock granting exclusive
    6161// access to MMC peripheral, call the driver to execute the command
     
    7171    // get MMC device cluster identifier & local pointer
    7272    cxy_t     dev_cxy = GET_CXY( dev_xp );
    73     chdev_t * dev_ptr = (chdev_t *)GET_PTR( dev_xp );
     73    chdev_t * dev_ptr = GET_PTR( dev_xp );
    7474
    7575    // get driver command function pointer from MMC device descriptor
     
    9797
    9898    // get calling thread local pointer
    99     thread_t * this = CURRENT_THREAD;
     99    thread_t  * this    = CURRENT_THREAD;
    100100
    101101#if DEBUG_DEV_MMC
     
    113113             "buffer not aligned on cache line" );
    114114
    115     // get buffer physical address
    116     paddr_t  buf_paddr;
    117     error = vmm_v2p_translate( CONFIG_KERNEL_IDENTITY_MAP , buf_ptr , &buf_paddr );
    118 
    119     assert( (error == 0) , __FUNCTION__ , "cannot get buffer paddr" );
    120 
    121115    // store command arguments in thread descriptor
    122116    this->mmc_cmd.dev_xp    = chdev_dir.mmc[buf_cxy];
    123117    this->mmc_cmd.type      = MMC_CC_INVAL;
    124     this->mmc_cmd.buf_paddr = buf_paddr;
     118    this->mmc_cmd.buf_ptr   = buf_ptr;
    125119    this->mmc_cmd.buf_size  = buf_size;
    126120
     
    144138    error_t error;
    145139
    146     // get calling thread local pointer
    147     thread_t * this = CURRENT_THREAD;
     140    thread_t  * this    = CURRENT_THREAD;
    148141
    149142#if DEBUG_DEV_MMC
     
    161154             "buffer not aligned on cache line" );
    162155
    163     // get  buffer physical address
    164     paddr_t  buf_paddr;
    165     error = vmm_v2p_translate( CONFIG_KERNEL_IDENTITY_MAP , buf_ptr , &buf_paddr );
    166 
    167     assert( (error == 0) , __FUNCTION__ , "cannot get buffer paddr" );
    168 
    169156    // store command arguments in thread descriptor
    170157    this->mmc_cmd.dev_xp    = chdev_dir.mmc[buf_cxy];
    171158    this->mmc_cmd.type      = MMC_CC_SYNC;
    172     this->mmc_cmd.buf_paddr = buf_paddr;
     159    this->mmc_cmd.buf_ptr   = buf_ptr;
    173160    this->mmc_cmd.buf_size  = buf_size;
    174161
Note: See TracChangeset for help on using the changeset viewer.