Changes between Version 14 and Version 15 of library_stdio


Ignore:
Timestamp:
Oct 23, 2014, 3:04:48 PM (10 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • library_stdio

    v14 v15  
    1010 == __1) Processor related system calls__ ==
    1111
    12  === int giet_procid()===
     12 === int '''giet_procid'''()===
    1313This function returns the global processor identifier gpid, depending on (X,Y,L) where X,Y are the cluster coordinates, and L is the local processor index.
    1414The format is  gpid = X<<Y_WIDTH + Y) * NB_PROCS_MAX) + L
    1515
    16  === int giet_proctime() ===
     16 === int '''giet_proctime'''() ===
    1717This function returns the local processor time (number of cycles from reset.
    1818
    19  === int giet_rand() ===
     19 === int '''giet_rand'''() ===
    2020This function returns a pseudo-random value derived from both the processor
    2121cycle count and the processor index. This value is comprised between 0 & 65535.
     
    2323 == __2) Task related system calls__ ==
    2424
    25  === int giet_proc_task_id() ===
     25 === int '''giet_proc_task_id'''() ===
    2626This functions returns the local task index, identifying the task amongst all task
    2727running on the same processor.
     
    3737  === void giet_tty_printf( char* format, ... ) ===
    3838This function print formated text on a private terminal that must have been allocated to the calling task in the mapping (''use_tty'' argument). Therefore,  it does not take the TTY lock. In case or error, it makes a giet_exit().
    39 
    4039Only a limited number of formats are supported:
    4140   * %d : signed decimal
     
    4645   * %s : string
    4746
    48  === void giet_shr_printf( char* format, ... ) ===
     47 === void '''giet_shr_printf'''( char* format, ... ) ===
    4948This function print formated text on the shared terminal arbitrarily allocated by the kernel, taking the TTY lock
    5049for exclusive access. It supports the same formats as the giet_tty_printf() function. In case or error, it makes a giet_exit().
    5150
    52  === void giet_tty_getc( char* byte ) ===
     51 === void '''giet_tty_getc'''( char* byte ) ===
    5352This blocking function fetches a single character from the private terminal that must have been allocated to the calling task in the application mapping. It uses the TTY_RX_IRQ interrupt, and the associated kernel buffer. In case or error (such as TTY index not defined), it makes a giet_exit().
    5453
    55  === void giet_tty_getw( unsigned int* val ) ===
     54 === void '''giet_tty_getw'''( unsigned int* val ) ===
    5655This blocking function fetches a string of decimal characters (most significant digit first) to build a 32-bits unsigned integer from the private TTY terminal  that must have been allocated to the calling task in the application mapping. It uses the TTY_RX_IRQ interrupt, and the associated kernel buffer.
    5756The non-blocking system function _tty_read is called several times, and the decimal characters are written in a 32 characters buffer until a <LF> character is read. It ignores non-decimal characters, and displays an echo
     
    5958In case or error (such as TTY index not defined), it makes a giet_exit().
    6059
    61  === void giet_tty_gets( char* buf, unsigned int bufsize ) ===
     60 === void '''giet_tty_gets'''( char* buf, unsigned int bufsize ) ===
    6261This blocking function fetches a string from the private terminal that must have been allocated to the calling task in the application mapping. It writes the string to a fixed length buffer.
    6362It uses the TTY_RX_IRQ interrupt, and the associated kernel buffer.
     
    6968The Giet-VM supports a FAT32 file system.
    7069
    71  === int giet_fat_open( const char* pathname, unsigned int flags ) ===
     70 === int '''giet_fat_open'''( const char* pathname, unsigned int flags ) ===
    7271Open a file identified by the ''pathname'' argument. The read/write ''flags''  are not supported yet: no effect.
    7372Return -1 in case or error.
    7473
    75  === void giet_fat_read( unsigned int fd, void* buffer, unsigned int count, unsigned int offset ) ===
     74 === void '''giet_fat_read'''( unsigned int fd, void* buffer, unsigned int count, unsigned int offset ) ===
    7675Read ''count'' sectors from a file identified by the ''fd'' argument, skipping ''offset'' sectors in file, and writing into the user memory ''buffer''. The user buffer base address should be 64 bytes aligned.
    7776In case or error, it makes a giet_exit().
    7877
    79  === void giet_fat_write( unsigned int fd, void* buffer, unsigned int count, unsigned int offset ) ===
     78 === void '''giet_fat_write'''( unsigned int fd, void* buffer, unsigned int count, unsigned int offset ) ===
    8079Write ''count'' sectors into a file identified by the ''fd'' argument, skipping ''offset'' sectors in file, and reading from the user memory ''buffer''. The user buffer base address should be 64 bytes aligned.
    8180In case or error, it makes a giet_exit().
    8281
    83  === void giet_fat_close( unsigned int fd ) ===
     82 === void '''giet_fat_close'''( unsigned int fd ) ===
    8483Close a file identified by the ''fd'' file descriptor.
    8584
     
    119118 == __7) Miscelaneous system calls__ ==
    120119
    121  === void giet_exit( char* string ) ===
     120 === void '''giet_exit'''( char* string ) ===
    122121This function stops execution of the calling task with a TTY message explaining the cause. The user task is descheduled and becomes not runable: it does not consume processor cycles anymore.
    123122
    124  === void giet_assert( unsigned int condition, char* string ) ===
     123 === void '''giet_assert'''( unsigned int condition, char* string ) ===
    125124This function uses the giet_exit() system call to kill the calling task if the condition is false.
    126125
    127  === void giet_context_switch() ===
     126 === void '''giet_context_switch'''() ===
    128127The user task calling this function is descheduled and the processor is allocated to another task.
    129128
    130  === void giet_procnumber( unsigned int cluster_xy, unsigned int buffer ) ===
     129 === void '''giet_procnumber'''( unsigned int cluster_xy, unsigned int buffer ) ===
    131130This function returns in the ''buffer'' argument the number of processors in the cluster specified by the ''cluster_xy'' argument. In case or error (such as illegal cluster index), it makes a giet_exit().
    132131
    133  === void giet_vobj_get_vbase( char* vspace_name, char*  vobj_name, unsigned int* vobj_vaddr) ===
     132 === void '''giet_vobj_get_vbase'''( char* vspace_name, char*  vobj_name, unsigned int* vobj_vaddr) ===
    134133This function returns in argument ''vobj_vaddr'' the virtual base address of a vobj defined in the mapping_info data structure. The vobj is identified by the two arguments ''vspace_name'' and ''vobj_name''. In case of error (such as undefined vspace or undefined vobj), it makes a giet_exit().
    135134
    136  === void giet_heap_info( unsigned int* vaddr, unsigned int* length, unsigned int  x, unsigned int  y );
     135 === void '''giet_heap_info'''( unsigned int* vaddr, unsigned int* length, unsigned int  x, unsigned int  y );
    137136This function supports access to the running task's heap or to a remote heap. If (x < X_SIZE) and (y < Y_SIZE), it returns the base address and length of the heap associated to any task running on cluster(x,y). Otherwise, it returns the base address and length of the heap associated to the calling task. In case of error (such as undefined heap segment in the selected cluster, it returns heap_size = 0).
    138137
    139  === void giet_get_xy( void* ptr, unsigned int* px, unsigned int* py ) ===
     138 === void '''giet_get_xy'''( void* ptr, unsigned int* px, unsigned int* py ) ===
    140139This function takes as input a virtual address (''ptr'' argument), and returns through the ''px,py'' arguments the coordinates of the cluster containing the physical address associated to ''ptr''. In case of error (unmapped virtual address), it makes a giet_exit(). 
    141140