Ignore:
Timestamp:
Aug 20, 2018, 1:04:16 PM (6 years ago)
Author:
alain
Message:

1) Introduce the libsemaphore library.
2) Introduce a small libmath library, required by the "fft" application..
3) Introduce the multithreaded "fft" application.
4) Fix a bad synchronisation bug in the Copy-On-Write mechanism.

File:
1 edited

Legend:

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

    r457 r469  
    7474
    7575#if DEBUG_SYSCALLS_ERROR
    76 printk("\n[ERROR] in %s : unmapped semaphore pointer %x / thread %x in process %x\n",
    77 __FUNCTION__ , (intptr_t)vaddr, this->trdid, process->pid );
     76printk("\n[ERROR] in %s : unmapped semaphore pointer %x / thread %x in process %x / cycle %d\n",
     77__FUNCTION__ , (intptr_t)vaddr, this->trdid, process->pid, (uint32_t)hal_get_cycles() );
    7878vmm_display( process , false );
    7979#endif
     
    9797
    9898#if DEBUG_SYSCALLS_ERROR
    99 printk("\n[ERROR] in %s : cannot create semaphore / thread %x in process %x\n",
    100 __FUNCTION__, this->trdid, process->pid );
     99printk("\n[ERROR] in %s INIT: cannot create semaphore / thread %x in process %x / cycle %d\n",
     100__FUNCTION__, this->trdid, process->pid, (uint32_t)hal_get_cycles() );
    101101#endif
    102102                this->errno = ENOMEM;
     
    115115
    116116#if DEBUG_SYSCALLS_ERROR
    117 printk("\n[ERROR] in %s : unmapped buffer for current value %x / thread %x in process %x\n",
    118 __FUNCTION__ , (intptr_t)current_value, this->trdid, process->pid );
     117printk("\n[ERROR] in %s GETVALUE: unmapped target buffer %x / thread %x in process %x / cycle %d\n",
     118__FUNCTION__ , (intptr_t)current_value, this->trdid, process->pid, (uint32_t)hal_get_cycles() );
    119119vmm_display( process , false );
    120120#endif
     
    131131
    132132#if DEBUG_SYSCALLS_ERROR
    133 printk("\n[ERROR] in %s : semaphore %x not registered / thread %x in process %x\n",
    134 __FUNCTION__ , (intptr_t)vaddr, this->trdid, process->pid );
     133printk("\n[ERROR] in %s GETVALUE: semaphore %x not found / thread %x in process %x / cycle %d\n",
     134__FUNCTION__ , (intptr_t)vaddr, this->trdid, process->pid, (uint32_t)hal_get_cycles() );
    135135#endif
    136136                this->errno = EINVAL;
     
    157157
    158158#if DEBUG_SYSCALLS_ERROR
    159 printk("\n[ERROR] in %s : semaphore %x not registered / thread %x in process %x\n",
    160 __FUNCTION__ , (intptr_t)vaddr, this->trdid, process->pid );
     159printk("\n[ERROR] in %s WAIT: semaphore %x not found / thread %x in process %x / cycle %d\n",
     160__FUNCTION__ , (intptr_t)vaddr, this->trdid, process->pid, (uint32_t)hal_get_cycles() );
     161vmm_display( process , true );
    161162#endif
    162163                this->errno = EINVAL;
     
    180181
    181182#if DEBUG_SYSCALLS_ERROR
    182 printk("\n[ERROR] in %s : semaphore %x not registered / thread %x in process %x\n",
    183 __FUNCTION__ , (intptr_t)vaddr, this->trdid, process->pid );
     183printk("\n[ERROR] in %s POST: semaphore %x not found / thread %x in process %x / cycle %d\n",
     184__FUNCTION__ , (intptr_t)vaddr, this->trdid, process->pid, (uint32_t)hal_get_cycles() );
    184185#endif
    185186                this->errno = EINVAL;
     
    203204
    204205#if DEBUG_SYSCALLS_ERROR
    205 printk("\n[ERROR] in %s : semaphore %x not registered / thread %x in process %x\n",
    206 __FUNCTION__ , (intptr_t)vaddr, this->trdid, process->pid );
     206printk("\n[ERROR] in %s DESTROY: semaphore %x not found / thread %x in process %x / cycle %d\n",
     207__FUNCTION__ , (intptr_t)vaddr, this->trdid, process->pid, (uint32_t)hal_get_cycles() );
    207208#endif
    208209                this->errno = EINVAL;
     
    220221
    221222#if DEBUG_SYSCALLS_ERROR
    222 printk("\n[ERROR] in %s : undefined operation type %d / thread %x in process %x\n",
    223 __FUNCTION__ , operation, this->trdid, process->pid );
     223printk("\n[ERROR] in %s : undefined operation type %d / thread %x in process %x / cycle %d\n",
     224__FUNCTION__ , operation, this->trdid, process->pid, (uint32_t)hal_get_cycles() );
    224225#endif
    225226            this->errno = EINVAL;
Note: See TracChangeset for help on using the changeset viewer.