Changeset 759 for soft/giet_vm/giet_libs
- Timestamp:
- Jan 18, 2016, 4:57:13 PM (9 years ago)
- Location:
- soft/giet_vm/giet_libs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_libs/stdio.c
r749 r759 992 992 (unsigned int)buffer, 993 993 count, 994 0 ); // no physical addressing required 994 0 ); 995 } 996 997 /////////////////////////////////////// 998 int 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 ); 995 1008 } 996 1009 … … 1004 1017 (unsigned int)buffer, 1005 1018 count, 1006 0 ); // no physical addressing required1019 0 ); 1007 1020 } 1008 1021 … … 1083 1096 1084 1097 va_start( args, format ); 1098 1085 1099 count = xprintf( stream, 4096, format, &args ); 1086 1100 va_end( args ); 1087 1101 1088 if ( count == 0xFFFFFFFF ) giet_pthread_exit(" illegal formatin giet_fat_fprintf()");1102 if ( count == 0xFFFFFFFF ) giet_pthread_exit("error in giet_fat_fprintf()"); 1089 1103 1090 1104 return sys_call( SYSCALL_FAT_WRITE, … … 1093 1107 count, 1094 1108 0 ); // no physical addressing required 1109 } 1110 1111 ///////////////////////////////////////// 1112 void* 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 ); 1095 1130 } 1096 1131 -
soft/giet_vm/giet_libs/stdio.h
r743 r759 65 65 #define SYSCALL_FAT_CLOSEDIR 0x2A 66 66 #define SYSCALL_FAT_READDIR 0x2B 67 //0x2C68 //0x2D69 //0x2E67 #define SYSCALL_FAT_PREAD 0x2C 68 #define SYSCALL_FAT_MMAP 0x2D 69 #define SYSCALL_FAT_MUNMAP 0x2E 70 70 // 0x2F 71 71 … … 127 127 #define THREAD_CMD_RESUME 1 128 128 #define THREAD_CMD_CONTEXT 2 129 130 //////////////////////////////////////////////////////////////////////////// 131 // Flags and protection values for the giet_fat_mmap() syscall 132 // These define must be synchronized with values in the sys_handler.h file 133 //////////////////////////////////////////////////////////////////////////// 134 135 #define MAP_ANONYMOUS 0x01 136 #define MAP_FILE 0x02 137 #define MAP_FIXED 0x04 138 #define MAP_PRIVATE 0x08 139 #define MAP_SHARED 0x10 140 141 #define MAP_PROT_READ 0x1 142 #define MAP_PROT_WRITE 0x2 143 #define MAP_PROT_EXEC 0x4 129 144 130 145 //////////////////////////////////////////////////////////////////////////// … … 364 379 unsigned int count ); 365 380 381 extern int giet_fat_pread( unsigned int fd_id, 382 void* buffer, 383 unsigned int count, 384 unsigned int offset ); 385 366 386 extern int giet_fat_write( unsigned int fd, 367 387 void* buffer, … … 389 409 extern int giet_fat_fprintf( unsigned int fd_id, 390 410 char* format, ... ); 411 412 extern void* giet_fat_mmap( void* vaddr, 413 unsigned int length, 414 unsigned int prot, 415 unsigned int flags, 416 unsigned int fd_id, 417 unsigned int offset ); 418 419 extern int giet_fat_munmap( void* vaddr, 420 unsigned int length ); 391 421 392 422 //////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.