Ignore:
Timestamp:
Apr 29, 2019, 7:25:09 PM (5 years ago)
Author:
alain
Message:

This version has been tested on the sort multithreaded application
for TSAR_IOB architectures ranging from 1 to 8 clusters.
It fixes three bigs bugs:
1) the dev_ioc device API has been modified: the dev_ioc_sync_read()
and dev_ioc_sync_write() function use now extended pointers on the
kernel buffer to access a mapper stored in any cluster.
2) the hal_uspace API has been modified: the hal_copy_to_uspace()
and hal_copy_from_uspace() functions use now a (cxy,ptr) couple
to identify the target buffer (equivalent to an extended pointer.
3) an implementation bug has been fixed in the assembly code contained
in the hal_copy_to_uspace() and hal_copy_from_uspace() functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libs/mini-libc/unistd.h

    r610 r626  
    3535
    3636/*****************************************************************************************
    37  * This function sets a timer to deliver the signal SIGALRM to the calling process,
     37 * This function implements the "alarm" system call.
     38 * sets a timer to deliver the signal SIGALRM to the calling process,
    3839 * after the specified number of seconds.
    3940 * If an alarm has already been set with alarm() but has not been delivered,
     
    4849
    4950/*****************************************************************************************
    50  * This function change the current working directory in the reference process descriptor.
     51 * This function implements the "chdir" system call.
     52 * It changes the current working directory in the reference process descriptor.
    5153 *****************************************************************************************
    5254 * @ pathname   : pathname (can be relative or absolute).
     
    5658
    5759/*****************************************************************************************
    58  * This function release the memory allocated for the file descriptor identified by
    59  * the <fd> argument, and remove the fd array_entry in all process descriptor copies.
     60 * This function implements the "close" system call.
     61 * It releases the memory allocated for the file identified by the <fd> argument,
     62 * and remove the fd array_entry in all process descriptor copies.
    6063 *****************************************************************************************
    6164 * @ fd   : file descriptor index in fd_array.
     
    6568
    6669/*****************************************************************************************
    67  * This function implement the "exec" system call on the user side.
     70 * This function implement the "exec" system call.
    6871 * It creates, in the same cluster as the calling thread, a new process descriptor,
    6972 * and a new associated main thread descriptor, executing a new memory image defined
     
    8790
    8891/*****************************************************************************************
    89  * This function implement the "fork" system call on the user side.
     92 * This function implement the "fork" system call.
    9093 * The calling process descriptor (parent process), and the associated thread descriptor
    9194 * are replicated in a - likely - remote cluster, that becomes the new process owner.
     
    103106
    104107/*****************************************************************************************
    105  * This function returns the pathname of the current working directory.
     108 * This function implements the "fsync" system call.
     109 * It causes all the modified data and attributes of file identified by the <fd> argument
     110 * to be copied from the file mapper and file descriptor to the IOC device.
     111 *****************************************************************************************
     112 * @ fd   : file descriptor index in fd_array.
     113 * @ return 0 if success / returns -1 if failure.
     114 ****************************************************************************************/
     115int fsync( int fd );
     116
     117/*****************************************************************************************
     118 * This function implements the "getcwd" system call.
     119 * It returns the pathname of the current working directory.
    106120 *****************************************************************************************
    107121 * buf     : buffer addres in user space.
     
    113127
    114128/*****************************************************************************************
    115  * This function implements the "getpid" system call on the user side.
     129 * This function implements the "getpid" system call.
     130 * It returns the process identifier.
    116131 *****************************************************************************************
    117132 * @ returns the process PID for the calling thread process.
     
    120135
    121136/*****************************************************************************************
    122  * This function test whether a file descriptor refers to a terminal.
     137 * This function implements the "isatty" system call.
     138 * It test whether a file descriptor refers to a terminal.
    123139 *****************************************************************************************
    124140 * @ fd   : file descriptor index in fd_array.
     
    128144
    129145/*****************************************************************************************
    130  * This function repositions the offset of the file descriptor identified by <fd>,
     146 * This function implements the "lseek" system call.
     147 * It repositions the offset of the file descriptor identified by <fd>,
    131148 * according to the operation type defined by the <whence> argument.
    132149 *****************************************************************************************
     
    141158
    142159/*****************************************************************************************
    143  * This function stops the calling process until any signal is received.
     160 * This function implements the "pause" system call.
     161 * It stops the calling process until a signal is received.
    144162 *****************************************************************************************
    145163 * @ return 0 if success / returns -1 if failure.
     
    148166
    149167/*****************************************************************************************
    150  * This function creates in the calling thread cluster an unnamed pipe, and two
    151  * (read and write) file descriptors to access this pipe. The calling function must pass
    152  * the pointer on the fd[] array.
     168 * This function implements the "pipe" system call.
     169 * It creates in the calling thread cluster an unnamed pipe, and two (read and write)
     170 * file descriptors to access this pipe. The argument is a pointer a fd[] array.
    153171 * TODO not implemented yet...
    154172 *****************************************************************************************
     
    160178
    161179/*****************************************************************************************
    162  * This function read bytes from an open file identified by the <fd> file descriptor.
     180 * This function implements the "read" system call.
     181 * It reads bytes from an open file identified by the <fd> file descriptor.
    163182 * This file can be a regular file or a character oriented device.
    164183 *****************************************************************************************
     
    173192
    174193/*****************************************************************************************
    175  * This function removes a directory file whose name is given by <pathname>.
    176  * The directory must not have any entries other than `.' and `..'.
     194 * This function implements the "rmdir" system call.
     195 * It removes a directory file whose name is given by <pathname>.
     196 * The directory must not contain any entries other than `.' and `..'.
    177197 *****************************************************************************************
    178198 * @ pathname   : pathname (can be relative or absolute).
     
    182202
    183203/*****************************************************************************************
    184  * This function removes a directory entry identified by the <pathname> from the
    185  * directory, and decrement the link count of the file referenced by the link.
     204 * This function implements the "sync" system call.
     205 * It forces all kernel mappers (file caches) to be copied to the IOC device.
     206 ****************************************************************************************/
     207void sync( void );
     208
     209/*****************************************************************************************
     210 * This function implements the "unlink" system call.
     211 * It removes a directory entry identified by the <pathname> from the parent directory,
     212 * and decrement the link count of the file referenced by the link.
    186213 * If the link count reduces to zero, and no process has the file open, then all resources
    187214 * associated with the file are released.  If one or more process have the file open when
     
    195222
    196223/*****************************************************************************************
    197  * This function writes bytes to an open file identified by the <fd> file descriptor.
     224 * This function implements the "write" system call.
     225 * It writes bytes to an open file identified by the <fd> file descriptor.
    198226 * This file can be a regular file or character oriented device.
    199227 *****************************************************************************************
Note: See TracChangeset for help on using the changeset viewer.