Changeset 267 for soft/giet_vm/giet_libs
- Timestamp:
- Jan 13, 2014, 3:20:29 PM (11 years ago)
- Location:
- soft/giet_vm/giet_libs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_libs/stdio.c
r260 r267 12 12 #include <stdarg.h> 13 13 #include <stdio.h> 14 #include <giet_config.h> 14 15 15 16 … … 298 299 unsigned int ret; 299 300 301 if (GIET_MONO_TTY) 302 { 303 ret = sys_call(SYSCALL_TTY_LOCK, 0, 0, 0, 0); // Get TTY lock 304 } 305 300 306 printf_text: 301 307 … … 311 317 0xFFFFFFFF, 312 318 0); 313 if (ret != i) return 1; /* return error */ 319 320 if (ret != i) goto return_error; 321 314 322 format += i; 315 323 } … … 319 327 goto printf_arguments; 320 328 } 329 } 330 331 if (GIET_MONO_TTY) 332 { 333 ret = sys_call(SYSCALL_TTY_LOCK, 1, 0, 0, 0); // Release TTY lock 321 334 } 322 335 … … 349 362 0xFFFFFFFF, 350 363 0); 351 if (ret != 1) return 1; /* return error */364 if (ret != 1) goto return_error; 352 365 } 353 366 case ('u'): /* decimal unsigned integer */ … … 366 379 0xFFFFFFFF, 367 380 0); 368 if (ret != 2) return 1; /* return error */381 if (ret != 2) goto return_error; /* return error */ 369 382 for(i = 0; i < 8; i++) 370 383 { … … 394 407 0xFFFFFFFF, 395 408 0); 396 if (ret != len) return 1; 409 if (ret != len) goto return_error; 410 397 411 goto printf_text; 398 412 } 413 414 return_error: 415 if (GIET_MONO_TTY) 416 { 417 ret = sys_call(SYSCALL_TTY_LOCK, 1, 0, 0, 0); // Release TTY lock 418 } 419 420 return 1; 399 421 } 400 422 … … 663 685 } 664 686 687 ////////////////////////////////////////////////////////////////////////////////// 688 // giet_thread_id() 689 ////////////////////////////////////////////////////////////////////////////////// 690 // This functions returns the thread index of the current task. 691 ////////////////////////////////////////////////////////////////////////////////// 692 int giet_thread_id() 693 { 694 return sys_call( SYSCALL_THREAD_ID, 695 0, 0, 0, 0 ); 696 } 697 665 698 /////////////////////////////////////////////////////////////////////////////////// 666 699 ///////////////////// FAT related system calls //////////////////////////////////// -
soft/giet_vm/giet_libs/stdio.h
r260 r267 31 31 #define SYSCALL_FB_SYNC_WRITE 0x10 32 32 #define SYSCALL_FB_SYNC_READ 0x11 33 #define SYSCALL_ FREE_120x1234 #define SYSCALL_ FREE_130x1333 #define SYSCALL_THREAD_ID 0x12 34 #define SYSCALL_TTY_LOCK 0x13 35 35 #define SYSCALL_FREE_14 0x14 36 36 #define SYSCALL_FREE_15 0x15 … … 209 209 extern int giet_global_task_id(); 210 210 211 extern int giet_thread_id(); 212 211 213 extern void giet_assert( unsigned int, 212 214 char* string );
Note: See TracChangeset
for help on using the changeset viewer.