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/syscalls/sys_get_cycle.c

    r408 r440  
    22 * sys_get_cycle.c - get calling core cycles count.
    33 *
    4  * Author    Alain Greiner (2016,2017)
     4 * Author    Alain Greiner (2016,2017,2018)
    55 * 
    66 * Copyright (c) UPMC Sorbonne Universites
     
    3535int sys_get_cycle ( uint64_t * cycle )
    3636{
    37         error_t   error;
    38     paddr_t   paddr;
    39         uint64_t  k_cycle;
     37        error_t     error;
     38    vseg_t    * vseg;
     39        uint64_t    k_cycle;
    4040
    4141    thread_t  * this    = CURRENT_THREAD;
     
    4343
    4444    // check buffer in user space
    45     error = vmm_v2p_translate( false , cycle , &paddr );
     45    error = vmm_get_vseg( process , (intptr_t)cycle , &vseg );
    4646
    4747        if( error )
    4848        {
    49         printk("\n[ERROR] in %s : user buffer unmapped for thread %x in process %x\n",
    50         __FUNCTION__ , this->trdid , process->pid );
     49
     50#if DEBUG_SYSCALLS_ERROR
     51printk("\n[ERROR] in %s : user buffer unmapped %x / thread %x / process %x\n",
     52__FUNCTION__ , (intptr_t)cycle , this->trdid , process->pid );
     53vmm_display( process , false );
     54#endif
    5155        this->errno = EFAULT;
    5256                return -1;
Note: See TracChangeset for help on using the changeset viewer.