Changes between Version 6 and Version 7 of library_stdio
- Timestamp:
- Aug 6, 2014, 7:03:47 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
library_stdio
v6 v7 1 1 = The stdio Library = 2 2 3 The [source:soft/giet_vm/giet_libs/stdio.c stdio.c] and [source:soft/giet_vm/giet_libs/stdio.h stdio.h] files define all system calls provided to user applications by the GIET-VM. They are generally prefixed by ''giet_''. 4 3 5 [[PageOutline]] 4 5 The [source:soft/giet_vm/giet_libs/stdio.c stdio.c] and [source:soft/giet_vm/giet_libs/stdio.h stdio.h] files define all system calls provided to user applications by the GIET-VM. They are generally prefixed by ''giet_''.6 6 7 7 == __1) Processor related system calls__ == … … 32 32 == __3) TTY related system calls__ == 33 33 34 * '''void giet_tty_printf( char* format, ... )'''34 === void giet_tty_printf( char* format, ... ) === 35 35 This 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(). 36 36 … … 43 43 * %s : string 44 44 45 * '''void giet_shr_printf( char* format, ... )'''45 === void giet_shr_printf( char* format, ... ) === 46 46 This function print formated text on the shared terminal arbitrarily allocated by the kernel, taking the TTY lock 47 47 for exclusive access. It supports the same formats as the giet_tty_printf() function. In case or error, it makes a giet_exit(). 48 48 49 * '''void giet_tty_getc( char* byte )50 This 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 , it makes a giet_exit().49 === void giet_tty_getc( char* byte ) === 50 This 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(). 51 51 52 * '''void giet_tty_getw( unsigned int* val )'''52 === void giet_tty_getw( unsigned int* val ) === 53 53 This 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. 54 54 The 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 55 55 system function) for each decimal character. The <DEL> character is interpreted, and previous characters can be cancelled. When the <LF> character is received, the string is converted to an unsigned int value. If the number of decimal digit is too large for the 32 bits range, the zero value is returned. 56 In case or error , it makes a giet_exit().56 In case or error (such as TTY index not defined), it makes a giet_exit(). 57 57 58 * '''void giet_tty_gets( char* buf, unsigned int bufsize )'''58 === void giet_tty_gets( char* buf, unsigned int bufsize ) === 59 59 This 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. 60 60 It uses the TTY_RX_IRQ interrupt, and the associated kernel buffer. 61 61 Up to (bufsize - 1) characters (including the non printable characters) are copied into buffer, and the string is completed by a NUL character. The <LF> character is interpreted, and the function close the string with a NUL character if <LF> is read. The <DEL> character is interpreted, and the corresponding character(s) are removed from the target buffer. It does not provide an echo. 62 In case or error , it makes a giet_exit().62 In case or error (such as TTY index not defined), it makes a giet_exit(). 63 63 64 64 == __4) File system related system calls__ == … … 82 82 83 83 === void giet_procnumber( unsigned int cluster_xy, unsigned int buffer ) === 84 This function returns in the ''buffer'' argument the number of processors in the cluster specified by the ''cluster_xy'' argument. In case or error ( illegal cluster index), it makes a giet_exit().84 This 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(). 85 85 86 86 === void giet_vobj_get_vbase( char* vspace_name, char* vobj_name, unsigned int* vobj_vaddr) === 87 This function returns in argument ''vobj_vaddr'' the virtual base address of a vobj defined in the mapping_info data structure), identified by the two arguments ''vspace_name'' and ''vobj_name''. In case of error ( undefined vspace or undefined vobj), it makes a giet_exit().87 This function returns in argument ''vobj_vaddr'' the virtual base address of a vobj defined in the mapping_info data structure), 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(). 88 88 89 89 === void giet_heap_info( unsigned int* vaddr, unsigned int* length, unsigned int x, unsigned int y ); 90 This 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. 90 This 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). 91 91 92 92