Ignore:
Timestamp:
Jul 18, 2019, 2:06:55 PM (5 years ago)
Author:
alain
Message:

Introduce the non-standard pthread_parallel_create() system call
and re-write the <fft> and <sort> applications to improve the
intrinsic paralelism in applications.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/syscalls/sys_mmap.c

    r635 r637  
    4141{
    4242    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
    4545    mmap_attr_t   k_attr;       // attributes copy in kernel space
    4646    xptr_t        mapper_xp;
    47     error_t       error;
    4847    reg_t         save_sr;      // required to enable IRQs
    4948
     
    6261
    6362    // 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 ) )
    6764    {
    6865
     
    7673
    7774    // 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 ),
    8076                          attr,
    8177                          sizeof(mmap_attr_t) );
     
    119115
    120116    // test mmap type : can be FILE / ANON / REMOTE
     117    // to define vseg_type & vseg_cxy
    121118
    122119    /////////////////////////////////////////////////////////// MAP_FILE
     
    126123#if (DEBUG_SYS_MMAP & 1)
    127124if ( DEBUG_SYS_MMAP < tm_start )
    128 printk("\n[%s] thread[%x,%x] map file : fdid %d / offset %d / %d bytes\n",
     125printk("\n[%s] thread[%x,%x] type file : fdid %d / offset %x / %x bytes\n",
    129126__FUNCTION__, process->pid, this->trdid, fdid, offset, length );
    130127#endif
    131128
    132             // FIXME: handle concurent delete of file by another thread closing it
     129            // FIXME: handle concurent delete of file by another thread
    133130
    134131                if( fdid >= CONFIG_PROCESS_FILE_MAX_NR )
     
    228225#if (DEBUG_SYS_MMAP & 1)
    229226if ( DEBUG_SYS_MMAP < tm_start )
    230 printk("\n[%s] thread[%x,%x] map anon / %d bytes / cluster %x\n",
     227printk("\n[%s] thread[%x,%x] type anon / %x bytes / cluster %x\n",
    231228__FUNCTION__, process->pid, this->trdid, length, vseg_cxy );
    232229#endif
     
    242239#if (DEBUG_SYS_MMAP & 1)
    243240if ( DEBUG_SYS_MMAP < tm_start )
    244 printk("\n[%s] thread[%x,%x] map remote / %d bytes / cluster %x\n",
     241printk("\n[%s] thread[%x,%x] type remote / %x bytes / target cluster %x\n",
    245242__FUNCTION__, process->pid, this->trdid, length, vseg_cxy );
    246243#endif
    247244 
    248         if( cluster_is_undefined( vseg_cxy ) )
     245        if( cluster_is_active( vseg_cxy ) == false )
    249246        {
    250247
     
    266263    process_t * ref_ptr = GET_PTR( ref_xp );
    267264
    268     // create the vseg in reference cluster
     265    // register vseg in reference VSL
    269266    if( local_cxy == ref_cxy )
    270267    {
     
    306303    }
    307304
    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 ),
    312308                        sizeof(intptr_t) );
    313309    hal_fence();
     
    324320#if DEBUG_SYS_MMAP
    325321if ( DEBUG_SYS_MMAP < tm_end )
    326 printk("\n[%s] thread[%x,%x] exit / %s / cxy %x / base %x / size %d / cycle %d\n",
     322printk("\n[%s] thread[%x,%x] exit / %s / cxy %x / base %x / size %x / cycle %d\n",
    327323__FUNCTION__, process->pid, this->trdid,
    328324vseg_type_str(vseg->type), vseg->cxy, vseg->min, length, (uint32_t)tm_end );
Note: See TracChangeset for help on using the changeset viewer.