Changes between Version 115 and Version 116 of library_stdio


Ignore:
Timestamp:
Sep 25, 2015, 11:09:08 AM (10 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • library_stdio

    v115 v116  
    1414
    1515 === 1) void '''giet_proc_xyp'''( unsigned int* cluster_x, unsigned int* cluster_y unsigned int* p )===
    16 This function returns the processor identifiers (x,y,p) from the wired global processor index in CP0_PROCID.
     16Each thread is statically allocated to one processor P[x,y,p] in the boot phase, and there is no thread migration.
     17This function returns the processor identifiers (x,y,p) for the processor running the calling thread. It access the wired global processor index stored in the CP0_PROCID register.
    1718 The <x> and <y> arguments are the the cluster coordinates. The <p> argument is the processor local index.
    1819The format is CP0_PROCID = ( ( cluster_x << Y_WIDTH + cluster_y ) << P_WIDTH ) + lpid
    1920
    2021 === 2) unsigned int '''giet_proctime'''() ===
    21 This function returns the local processor time from the CP0_TIME register (number of cycles from reset).
    22 The processor implements a 32 bits wrapping register.
     22This function returns the local processor time from the CP0_TIME register (number of cycles from reset),
     23This register is a 32 bits wrapping register
    2324 
    2425 === 3) unsigned int '''giet_rand'''() ===
     
    2930 == __Thread related system calls__ ==
    3031
    31 The GIET-VM support a subset of the POSIX Threads.
     32The GIET-VM support a subset of the POSIX Threads API.
    3233The ''pthread_t'' and ''pthread_attr_t'' types are defined in the [source:soft/giet_vm/giet_libs/stdio.h stdio.h] file.
    3334
     
    3839The thread identifier stored in the ''buffer'' argument by the kernel is unique in a given space: It is actually build from the 4 following informations : [x,y,p,ltid], where x,y,p are the processor coordinates, and ltid is the thread index in the scheduler.   
    3940 * buffer : pointer on a buffer that will contain the activated thread identifier.
    40  * attr :  not supported in the current implementation and must be set to NULL.
     41 * attr :  not supported in the current implementation / must be set to NULL.
    4142 * function : pointer on function
    42  * arg : not supported
     43 * arg : not supported in the current implementation / must be set to NULL.
    4344Return 0 if success.
    4445Return -1  if no matching thread.
     
    4647
    4748 === 2) void '''giet_pthread_exit'''( void* string ) ===
    48 This function desactivates the calling thread.
    49 The 'string' argument is a (user defined) log message displayed on the kernel TTY0.
     49This function send a KILL signal to the calling thread, that is immediately desactivated, and goes to the ''blocked'' state. All resources dynamically allocated to the thread, such as private peripheral channels are released. An user defined message is displayed on the kernel terminal TTY0.
     50 * '''string''': message on TTY0.
    5051
    5152 === 3) int '''giet_pthread_join'''( pthread_t  trdid , void** ptr ) ===
    52 This blocking function can be used to detect completion of a thread activated by a giet_pthread_create().
    53 It returns only when the thread identified by the ''traded'' argument is desactivated.
    54 The ''ptr'' argument is not supported, and should be set to NULL.
     53This blocking function can be used to detect completion of a thread previously activated by a giet_pthread_create().
     54It returns only when the thread identified by the <trdid> argument is desactivated.
     55The <ptr> argument is not supported, and should be set to NULL.
    5556 * trdid : unique thread identifier in vspace.
    5657 * ptr : not supported.
     
    5960Return -2  if ptr not NULL
    6061
    61  === 4) int '''giet_pthread_kill'''( pthread_id trdid , int signal ) ===
    62 This function send a KILL signal to the thread identified by the ''trdid'' argument when the ''signal'' argument is non zero,
    63 and the thread will be deactivated at the next context switch.
    64 If the ''signal'' argument is zero, the thread existence is checked, but the KILL signal it is not sent.
    65  * trdid : unique thread identifier in vspace.
    66  * signal : deactivation if non zero.
     62 === 4) int '''giet_pthread_kill'''( pthread_t trdid , int signal ) ===
     63This function send a KILL signal to the thread identified by the <trdid> argument, in the same space as the calling thread.
     64If the <signal> argument has a non zero value, the target thread will be deactivated at the next context switch.
     65If the <signal> argument is zero, the thread existence is checked, but the KILL signal it is not sent.
     66 * '''trdid''' : thread identifier in vspace.
     67 * '''signal''' : deactivation if non zero.
    6768Return 0 if success.
    6869Return -1 if no matching thread.
    6970
    7071 === 5) void '''giet_pthreadt_yield'''() ===
    71 The thread calling this function is descheduled and the processor is allocated to another thread.
     72The thread calling this function is descheduled and the processor is allocated to another thread. The calling thread is not deactivated and keep in the ''runable'' state.
     73
     74The following functions define GIET specific extensions to the POSIX threads API.
    7275
    7376 === 6) void '''giet_pthread_assert'''( unsigned int condition, char* string ) ===
    74 This non standard function stops execution of the calling thread with a TTY0 message if the condition is 0.
    75  * condition : thread exit if condition value is 0.
    76  * string : message displayed on TTY0.
     77This function is an extension to the POSIX standard. It send a KILL signal and deactivates immediately the calling thread (as does the giet_pthread_exit() function), with a TTY0 message defined by the <string> argument if the <condition> argument has a zero value.
     78 * '''condition''' : thread exit if condition value is 0.
     79 * '''string''' : message displayed on TTY0.
     80
     81 === 7) int '''giet_pthread_pause'''( char* vspace , pthread_t trdid ) ===
     82This function is an extension to the POSIX standard. It deschedules and deactivates immediately the thread identified by the <vspace> and <trdid> arguments. The target thread goes to the ''blocked'' state, and will not be scheduled until the thread is reactivated by the giet_pthread_resume() function. The thread context (including the resources dynamically allocated to the thread) is not modified.
     83 * '''vspace''' : vspace name.
     84 * '''trdid''' : thread identifier in vspace.
     85Return 0 if success.
     86Return -1 if no matching thread.
     87
     88 === 8) int '''get_pthread_resume'''( char* vspace , pthread_t trdid ) ===
     89This function is an extension to the POSIX standard. It  reactivates a thread identified by the <vspace> and <trdid> arguments, that was descheduled by the gift_pthread_pause() function. The target thread goes to the ''runable'' state, and can be rescheduled at the next context switch to resume execution.
     90 * '''vspace''' : vspace name.
     91 * '''trdid''' : thread identifier in vspace.
     92Return 0 if success.
     93Return -1 if no matching thread.
    7794
    7895
     
    447464This function returns through the <px> and <py> arguments the coordinates of the cluster containing the physical address associated to the <ptr> argument containing a virtual address. In case of error (unmapped virtual address), the calling thread exit. 
    448465
    449