Ignore:
Timestamp:
Jan 18, 2016, 4:57:13 PM (8 years ago)
Author:
alain
Message:

Introduce 4 new FAT related system calls:

  • giet_fat_pread()
  • giet_fat_fprintf()
  • giet_fat_map()
  • giet_fat_unmap()
File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_libs/stdio.c

    r749 r759  
    992992                     (unsigned int)buffer,
    993993                     count,
    994                      0 );      // no physical addressing required
     994                     0 );
     995}
     996
     997///////////////////////////////////////
     998int giet_fat_pread( unsigned int fd_id,     
     999                    void*        buffer,
     1000                    unsigned int count, 
     1001                    unsigned int offset ) 
     1002{
     1003    return sys_call( SYSCALL_FAT_PREAD,
     1004                     fd_id,
     1005                     (unsigned int)buffer,
     1006                     count,
     1007                     offset );
    9951008}
    9961009
     
    10041017                     (unsigned int)buffer,
    10051018                     count,
    1006                      0 );      // no physical addressing required
     1019                     0 );
    10071020}
    10081021
     
    10831096
    10841097    va_start( args, format );
     1098
    10851099    count = xprintf( stream, 4096, format, &args );
    10861100    va_end( args );
    10871101
    1088     if ( count == 0xFFFFFFFF ) giet_pthread_exit("illegal format in giet_fat_fprintf()");
     1102    if ( count == 0xFFFFFFFF ) giet_pthread_exit("error in giet_fat_fprintf()");
    10891103
    10901104    return sys_call( SYSCALL_FAT_WRITE,
     
    10931107                     count,
    10941108                     0 );      // no physical addressing required
     1109}
     1110
     1111/////////////////////////////////////////
     1112void* giet_fat_mmap( void*         vaddr,        // MAP_FIXED not supported
     1113                     unsigned int  length,
     1114                     unsigned int  prot,
     1115                     unsigned int  flags,
     1116                     unsigned int  fd_id,
     1117                     unsigned int  offset )
     1118{
     1119    if ( flags & MAP_FIXED )     giet_pthread_exit("error in giet_fat_mmap()");
     1120    if ( flags & MAP_PRIVATE )   giet_pthread_exit("error in giet_fat_mmap()");
     1121    if ( flags & MAP_ANONYMOUS ) giet_pthread_exit("error in giet_fat_mmap()");
     1122    if ( length & 0xFFF )        giet_pthread_exit("error in giet_fat_mmap()");
     1123    if ( offset & 0xFFF )        giet_pthread_exit("error in giet_fat_mmap()");
     1124
     1125    return (void*)sys_call( SYSCALL_FAT_MMAP,
     1126                            fd_id,
     1127                            length>>12,
     1128                            offset>>12,
     1129                            prot );
    10951130}
    10961131
Note: See TracChangeset for help on using the changeset viewer.