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_core.c

    r410 r440  
    3737                  uint32_t * lid )
    3838{
    39     paddr_t   paddr;
     39        error_t   error;
     40    vseg_t  * vseg;
    4041    uint32_t  k_cxy;
    4142    uint32_t  k_lid;
    42 
    43         error_t   error = 0;
    4443
    4544    thread_t  * this    = CURRENT_THREAD;
    4645    process_t * process = this->process;
    4746
    48     // check buffers in user space
    49     error |= vmm_v2p_translate( false , cxy , &paddr );
    50     error |= vmm_v2p_translate( false , lid , &paddr );
     47    // check cxy buffer in user space
     48    error = vmm_get_vseg( process , (intptr_t)cxy , &vseg );
    5149
    5250        if( error )
    5351        {
    54         printk("\n[ERROR] in %s : user buffer unmapped for thread %x in process %x\n",
    55         __FUNCTION__ , this->trdid , process->pid );
     52
     53#if DEBUG_SYSCALLS_ERROR
     54printk("\n[ERROR] in %s : cxy buffer unmapped %x / thread %x / process %x\n",
     55__FUNCTION__ , (intptr_t)cxy , this->trdid , process->pid );
     56vmm_display( process , false );
     57#endif
     58        this->errno = EFAULT;
     59                return -1;
     60        }
     61
     62    // check lid buffer in user space
     63    error = vmm_get_vseg( process , (intptr_t)lid , &vseg );
     64
     65        if( error )
     66        {
     67
     68#if DEBUG_SYSCALLS_ERROR
     69printk("\n[ERROR] in %s : lid buffer unmapped %x / thread %x / process %x\n",
     70__FUNCTION__ , (intptr_t)lid , this->trdid , process->pid );
     71vmm_display( process , false );
     72#endif
    5673        this->errno = EFAULT;
    5774                return -1;
Note: See TracChangeset for help on using the changeset viewer.