Changeset b97bc8bc in rtems
- Timestamp:
- 05/07/14 16:27:19 (10 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 8fa3422
- Parents:
- 0960fee
- Location:
- testsuites/support
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
testsuites/support/include/test_support.h
r0960fee rb97bc8bc 10 10 #ifndef __TEST_SUPPORT_h 11 11 #define __TEST_SUPPORT_h 12 13 #include <stdarg.h> 12 14 13 15 #ifdef __cplusplus … … 66 68 /*********************************************************************/ 67 69 /*********************************************************************/ 68 extern void locked_print_initialize(void); 69 extern void locked_printf(const char *fmt, ...); 70 extern void locked_printk(const char *fmt, ...); 70 71 void locked_print_initialize(void); 72 73 int locked_printf(const char *fmt, ...); 74 75 int locked_vprintf(const char *fmt, va_list ap); 76 77 int locked_printf_plugin(void *context, const char *fmt, ...); 78 79 void locked_printk(const char *fmt, ...); 71 80 72 81 #ifdef __cplusplus -
testsuites/support/src/locked_print.c
r0960fee rb97bc8bc 12 12 #endif 13 13 14 #include <rtems.h> 15 #include <rtems/system.h> 16 #include <sys/types.h> 17 #include <string.h> 18 #include <stdarg.h> 19 14 #include "test_support.h" 20 15 #include "tmacros.h" 21 16 … … 46 41 } 47 42 48 void locked_printf(const char *fmt, ...) { 49 va_list ap; /* points to each unnamed argument in turn */ 43 int locked_vprintf(const char *fmt, va_list ap) 44 { 45 int rv; 50 46 rtems_status_code sc; 51 47 … … 57 53 } while (sc != RTEMS_SUCCESSFUL ); 58 54 55 rv = vprintf(fmt, ap); 56 57 /* Release the semaphore */ 58 rtems_semaphore_release( locked_print_semaphore ); 59 60 return rv; 61 } 62 63 int locked_printf_plugin(void *context, const char *fmt, ...) 64 { 65 int rv; 66 va_list ap; 67 68 (void) context; 69 70 va_start(ap, fmt); 71 rv = locked_vprintf(fmt, ap); 72 va_end(ap); 73 74 return rv; 75 } 76 77 int locked_printf(const char *fmt, ...) 78 { 79 int rv; 80 va_list ap; /* points to each unnamed argument in turn */ 59 81 60 82 va_start(ap, fmt); /* make ap point to 1st unnamed arg */ 61 vprintf(fmt, ap);83 rv = locked_vprintf(fmt, ap); 62 84 va_end(ap); /* clean up when done */ 63 85 64 /* Release the semaphore */ 65 sc = rtems_semaphore_release( locked_print_semaphore ); 66 } 86 return rv; 87 } 67 88 68 void locked_printk(const char *fmt, ...) { 89 void locked_printk(const char *fmt, ...) 90 { 69 91 va_list ap; /* points to each unnamed argument in turn */ 70 92 rtems_status_code sc; … … 83 105 84 106 /* Release the semaphore */ 85 sc =rtems_semaphore_release( locked_print_semaphore );86 } 107 rtems_semaphore_release( locked_print_semaphore ); 108 }
Note: See TracChangeset
for help on using the changeset viewer.