Changeset 426 for trunk/libs/stdio.c


Ignore:
Timestamp:
Jan 29, 2018, 6:00:54 PM (6 years ago)
Author:
alain
Message:

The "nostdio" library has been integrated in the stdio library.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libs/stdio.c

    r412 r426  
    2929#define  reg_t     int
    3030
     31///////////// POSIX standard system calls ////////////////////////////////////
     32
    3133///////////////////////
    3234void exit( int status )
     
    3638}
    3739
    38 // 11 ///////////////////////////
     40/////////////////////////////////
    3941int munmap( void         * addr,
    4042            unsigned int   size )
     
    4547}
    4648
    47 // 12 //////////////////////////
     49////////////////////////////////
    4850int open( const char * pathname,
    4951          int          flags,
     
    5658}
    5759
    58 // 13 /////////////////////////
     60///////////////////////////////
    5961void * mmap( void       * addr,
    6062             unsigned int length,
     
    7779}
    7880
    79 // 14 ////////////////////
     81//////////////////////////
    8082int read( int          fd,
    8183          void       * buf,
     
    8890}
    8991
    90 // 15 /////////////////////
     92///////////////////////////
    9193int write( int          fd,
    9294           const void * buf,
     
    99101}
    100102
    101 // 16 /////////////////////
     103///////////////////////////
    102104int lseek( int          fd,
    103105           unsigned int offset,
     
    110112}
    111113
    112 // 17 /////////////
     114///////////////////
    113115int close( int fd )
    114116{
     
    117119}
    118120
    119 // 18 /////////////////////////////
     121///////////////////////////////////
    120122int unlink( const char * pathname )
    121123{
     
    124126}
    125127
    126 // 19 ///////////////
     128/////////////////////
    127129int pipe( int fd[2] )
    128130{
     
    130132}
    131133
    132 // 20 ////////////////////////////
     134//////////////////////////////////
    133135int chdir( const char * pathname )
    134136{
     
    137139}
    138140
    139 // 21 ///////////////////////////
     141/////////////////////////////////
    140142int mkdir( const char * pathname,
    141143           int          mode )
     
    146148}
    147149
    148 // 22 ////////////////////////////
     150//////////////////////////////////
    149151int mkfifo( const char * pathname,
    150152            int          mode )
     
    155157}
    156158
    157 // 23 ////////////////////////////////
     159//////////////////////////////////////
    158160DIR * opendir( const char * pathname )
    159161{
     
    167169}
    168170
    169 // 24 ///////////////////////////////
     171/////////////////////////////////////
    170172struct dirent * readdir( DIR * dirp )
    171173{
     
    179181}
    180182
    181 // 25 ////////////////////
     183//////////////////////////
    182184int closedir( DIR * dirp )
    183185{
     
    186188}
    187189
    188 // 26 ///////////////////////
     190/////////////////////////////
    189191int getcwd( char       * buf,
    190192            unsigned int bytes )
     
    195197}
    196198
    197 // 29 //////////////////////
     199////////////////////////////
    198200int rmdir( char * pathname )
    199201{
     
    202204}
    203205
    204 // 30 ///////////////////////////
     206/////////////////////////////////
    205207int utls( unsigned int operation,
    206208          unsigned int value )
     
    211213}
    212214
    213 // 31 /////////////////////////
     215///////////////////////////////
    214216int chmod( char     * pathname,
    215217           unsigned int   rights )
     
    220222}
    221223
    222 // 32 ///////////////////////////
     224/////////////////////////////////
    223225int signal( unsigned int   sigid,
    224226            void         * handler )
     
    229231}
    230232
    231 // 33 /////////////////////////////////
     233///////////////////////////////////////
    232234int gettimeofday( struct timeval  * tv,
    233235                  struct timezone * tz )
     
    238240}
    239241
    240 // 34 /////////////////////
     242///////////////////////////
    241243int kill( unsigned int pid,
    242244          unsigned int sig_id )
     
    247249}
    248250
    249 // 35 //////
     251////////////
    250252int getpid()
    251253{
     
    253255}
    254256
    255 // 36 ////
     257//////////
    256258int fork()
    257259{
     
    259261}
    260262
    261 // 37 /////////////////////
     263///////////////////////////
    262264int exec( char  * pathname,
    263265          char ** argv,
     
    270272}
    271273
    272 // 38 ///////////////////////////
     274/////////////////////////////////
    273275int stat( const char  * pathname,
    274276          struct stat * stat )
    275277{
    276     return hal_user_syscall( SYS_EXEC,
     278    return hal_user_syscall( SYS_STAT,
    277279                             (reg_t)pathname,
    278280                             (reg_t)stat, 0, 0 );
    279281}
    280282
    281 // 39 ////////////////////////////
     283////////////////////////
     284int wait( int * status )
     285{
     286    return hal_user_syscall( SYS_WAIT,
     287                             (reg_t)status, 0, 0, 0 );
     288}
     289
     290
     291
     292/////////////     Non standard system calls ////////////////////////////////////
     293
     294//////////////////////////
     295int fg( unsigned int pid )
     296{
     297    return hal_user_syscall( SYS_FG,
     298                             (reg_t)pid, 0, 0, 0 );
     299}
     300
     301//////////////////////////////////////
     302int get_config( unsigned int * x_size,
     303                unsigned int * y_size,
     304                unsigned int * ncores )
     305{
     306    return hal_user_syscall( SYS_GET_CONFIG,
     307                             (reg_t)x_size,
     308                             (reg_t)y_size,
     309                             (reg_t)ncores, 0 );
     310}
     311
     312/////////////////////////////////
     313int get_core( unsigned int * cxy,
     314              unsigned int * lid )
     315{
     316    return hal_user_syscall( SYS_GET_CORE,
     317                             (reg_t)cxy,
     318                             (reg_t)lid, 0, 0 );
     319}
     320
     321////////////////////////////////////
     322void display_string( char * string )
     323{
     324    hal_user_syscall( SYS_DISPLAY,
     325                      DISPLAY_STRING,
     326                      (reg_t)string, 0, 0 );
     327}
     328
     329///////////////////////////////////
     330int display_vmm( unsigned int pid )
     331{
     332    return hal_user_syscall( SYS_DISPLAY,
     333                             DISPLAY_VMM,
     334                             (reg_t)pid, 0, 0 );
     335}
     336
     337////////////////////////////////
     338int display_sched( unsigned int cxy,
     339                   unsigned int lid )
     340{
     341    return hal_user_syscall( SYS_DISPLAY,
     342                             DISPLAY_SCHED,
     343                             (reg_t)cxy,
     344                             (reg_t)lid, 0 );
     345}
     346
     347///////////////////////////////////////
     348int display_process( unsigned int cxy )
     349{
     350    return hal_user_syscall( SYS_DISPLAY,
     351                             DISPLAY_PROCESS,
     352                             (reg_t)cxy, 0, 0 );
     353}
     354
     355///////////////////
     356int display_chdev()
     357{
     358    return hal_user_syscall( SYS_DISPLAY,
     359                             DISPLAY_CHDEV, 0, 0, 0 );
     360}
     361
     362/////////////////
     363int display_vfs()
     364{
     365    return hal_user_syscall( SYS_DISPLAY,
     366                             DISPLAY_VFS, 0, 0, 0 );
     367}
     368
     369///////////////////////////////////////////
     370int get_cycle( unsigned long long * cycle )
     371{
     372    return hal_user_syscall( SYS_GET_CYCLE,
     373                             (reg_t)cycle, 0, 0, 0 );
     374}
     375
     376//////////////////////////////////
    282377int trace( unsigned int operation,
    283378           unsigned int pid,
Note: See TracChangeset for help on using the changeset viewer.