Changeset 637 for trunk/kernel/mm


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.

Location:
trunk/kernel/mm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/mm/mapper.c

    r635 r637  
    442442        if ( page_xp == XPTR_NULL ) return -1;
    443443
    444         // compute cluster and pointers on page in mapper
    445         xptr_t     map_xp  = ppm_page2base( page_xp );
    446         uint8_t  * map_ptr = GET_PTR( map_xp );
    447         cxy_t      map_cxy = GET_CXY( map_xp );
     444        // compute extended pointer in kernel mapper
     445        xptr_t     map_xp  = ppm_page2base( page_xp ) + page_offset;
    448446
    449447#if (DEBUG_MAPPER_MOVE_USER & 1)
     
    458456        if( to_buffer )
    459457        {
    460             hal_copy_to_uspace( map_cxy , map_ptr + page_offset , buf_ptr , page_bytes );
     458            hal_copy_to_uspace( buf_ptr , map_xp , page_bytes );
    461459
    462460#if DEBUG_MAPPER_MOVE_USER & 1
     
    464462printk("\n[%s] thread[%x,%x] moved %d bytes / mapper %s (%x,%x) -> user buffer(%x,%x)\n",
    465463__FUNCTION__, this->process->pid, this->trdid, page_bytes,
    466 name, map_cxy, map_ptr + page_offset, local_cxy, buf_ptr );
     464name, GET_CXY(map_xp), GET_PTR(map_xp), local_cxy, buf_ptr );
    467465#endif
    468466
     
    471469        {
    472470            ppm_page_do_dirty( page_xp );
    473             hal_copy_from_uspace( map_cxy , map_ptr + page_offset , buf_ptr , page_bytes );
     471            hal_copy_from_uspace( map_xp , buf_ptr , page_bytes );
    474472
    475473#if DEBUG_MAPPER_MOVE_USER & 1
     
    477475printk("\n[%s] thread[%x,%x] moved %d bytes / user buffer(%x,%x) -> mapper %s (%x,%x)\n",
    478476__FUNCTION__, this->process->pid, this->trdid, page_bytes,
    479 local_cxy, buf_ptr, name, map_cxy, map_ptr + page_offset );
     477local_cxy, buf_ptr, name, GET_CXY(map_xp), GET_PTR(map_xp) );
    480478mapper_display_page(  mapper_xp , page_id, 128 );
    481479#endif
  • trunk/kernel/mm/ppm.c

    r636 r637  
    533533    page_xp = XPTR( page_cxy , page_ptr );
    534534   
    535 
    536535    // get local pointer on PPM (same in all clusters)
    537536        ppm_t * ppm = &LOCAL_CLUSTER->ppm;
     
    568567                buddy_index = current_index ^ (1 << current_order);
    569568                buddy_ptr   = pages_tbl + buddy_index;
     569
     570        // get buddy order
     571        buddy_order = hal_remote_l32( XPTR( page_cxy , &buddy_ptr->order ) );
    570572       
    571573        // exit loop if buddy not found
Note: See TracChangeset for help on using the changeset viewer.