Changeset 623 for trunk/libs
- Timestamp:
- Mar 6, 2019, 4:37:15 PM (6 years ago)
- Location:
- trunk/libs
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libs/libalmosmkh/almosmkh.c
r611 r623 288 288 (reg_t)page_id, 289 289 (reg_t)nbytes ); 290 } 291 292 /////////////////////////////////////// 293 int display_barrier( unsigned int pid ) 294 { 295 return hal_user_syscall( SYS_DISPLAY, 296 DISPLAY_BARRIER, 297 (reg_t)pid, 0, 0 ); 290 298 } 291 299 -
trunk/libs/libalmosmkh/almosmkh.h
r611 r623 227 227 unsigned int nbytes); 228 228 229 /*************************************************************************************** 230 * This debug syscall displays on the kernel terminal TXT0 231 * the state of the barrier used by the process identified by the <pid> argument. 232 * It can be called by any thread running in any cluster. 233 *************************************************************************************** 234 * @ pid : [in] process identifier. 235 * @ return 0 if success / return -1 if illegal arguments. 236 **************************************************************************************/ 237 int display_barrier( unsigned int pid ); 238 229 239 /***************************************************************************************** 230 240 * This debug syscall is used to activate / desactivate the context switches trace -
trunk/libs/mini-libc/mman.h
r597 r623 38 38 * virtual space, as defined by the arguments. 39 39 ***************************************************************************************** 40 * @ addr : requested address in virtual space / un used : should be NULL.40 * @ addr : requested address in virtual space / unsupported : should be NULL. 41 41 * @ length : requested number of bytes. 42 42 * @ prot : access mode bit vector (PROT_EXEC / PROT_READ / PROT_WRITE) 43 * @ flags : bit_vector (MAP_FILE / MAP_ANON / MAP REMOTE / MAP_PRIVATE / MAP_SHARED)43 * @ flags : bit_vector (MAP_FILE / MAP_ANON / MAP_REMOTE / MAP_PRIVATE / MAP_SHARED) 44 44 * @ fdid : file descriptor index (if MAP_FILE). 45 45 * @ offset : offset in file (if MAP_FILE). -
trunk/libs/mini-libc/stdio.c
r610 r623 35 35 //////////////////////////////////////////////////////////////////////////////////////// 36 36 37 // This user space array registers all FILE descriptors open by a given process 37 38 FILE open_file_array[MAX_OPEN_FILE_PER_PROCESS]; // array of open files structures 38 39 … … 340 341 if( mode != NULL ) 341 342 { 342 printf("\n[ ERROR] in %s: the mode argument must be NULL\n", __FUNCTION__ );343 printf("\n[%s] error : the mode argument must be NULL\n", __FUNCTION__ ); 343 344 return NULL; 344 345 } … … 351 352 if( fd < 0 ) 352 353 { 353 printf("\n[ ERROR] in %s : file %snot found\n", __FUNCTION__ , pathname );354 printf("\n[%s] error : file <%s> not found\n", __FUNCTION__ , pathname ); 354 355 return NULL; 355 356 } 356 357 if( fd > MAX_OPEN_FILE_PER_PROCESS ) 357 358 { 358 printf("\n[ ERROR] in %s : not enough space for file %s\n", __FUNCTION__ , pathname );359 printf("\n[%s] error : not enough space for file <%s>\n", __FUNCTION__ , pathname ); 359 360 return NULL; 360 361 } … … 365 366 366 367 return &open_file_array[fd]; 368 367 369 } // end fopen() 368 370 … … 376 378 int fd = stream->fd; 377 379 378 // remove stream from open_file_array[]380 // remove stream from user open_file_array[] 379 381 open_file_array[fd].key = 0; 380 382 381 return close( fd ); 383 // close the kernel file descriptor 384 if( close( fd ) ) 385 { 386 printf("\n[%s] error : cannot close file %d\n", __FUNCTION__ , fd ); 387 return -1; 388 } 389 390 return 0; 391 382 392 } // end fclose() 383 393 … … 407 417 // get file descriptor from file pointer 408 418 fd = stream->fd; 409 419 420 // set terminating NUL 410 421 string[count] = 0; 411 422 423 printf("\n[%s] fd = %d for string :\n", __FUNCTION__, fd, string ); 424 412 425 return write( fd , &string , count ); 413 426 } -
trunk/libs/mini-libc/stdio.h
r610 r623 40 40 ********************************************************************************************/ 41 41 42 typedef struct file_s42 typedef struct stream_s 43 43 { 44 int fd; 45 int key; 44 int fd; // index in both kernel fd_array[], and user open_file_array[] 45 int key; // entry valid in open_file_array[] when (key == VALID_OPEN_FILE) 46 46 } 47 47 FILE;
Note: See TracChangeset
for help on using the changeset viewer.