Changeset 48627ab in mainline
- Timestamp:
- 2006-03-16T15:06:02Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 11eae82
- Parents:
- b81e7c6
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
init/init.c
rb81e7c6 r48627ab 34 34 #include <ns.h> 35 35 36 /* 36 37 37 static void test_printf(void) 38 38 { … … 41 41 printf("We are brave enought to print numbers like %%d = '%d'\n", 0x123456); 42 42 printf("And now... '%b' byte! '%w' word! '%W' Word! \n", 0x12, 0x1234, 0x1234); 43 printf(" '%Q' Q! Another '%q' q! \n", 0x1234567887654321ll, 0x1234567887654321ll); 44 printf(" '%P' with 64bit value and '%p' with 32 bit value. \n", 0x1234567887654321ll, 0x12345678 ); 43 printf("'%Q' Q! Another '%q' q! \n", 0x1234567887654321ll, 0x1234567887654321ll); 44 printf("'%Q' with 64bit value and '%p' with 32 bit value. \n", 0x1234567887654321ll, 0x12345678 ); 45 printf("'%Q' 64bit, '%p' 32bit, '%b' 8bit, '%w' 16bit, '%Q' 64bit and '%s' string.\n", 0x1234567887654321ll, 0x12345678, 0x12, 0x1234, 0x1234567887654321ull, "Lovely string" ); 46 45 47 printf("Thats all, folks!\n"); 46 48 } 47 */ 49 48 50 49 51 extern char _heap; … … 162 164 version_print(); 163 165 166 /* test_printf(); */ 164 167 // test_ping(); 165 168 // test_async_ipc(); -
libc/arch/mips32/include/stackarg.h
rb81e7c6 r48627ab 35 35 #include <types.h> 36 36 37 typedef struct va_list {38 int pos;39 uint8_t *last;40 } va_list;41 42 #define va_start(ap, lst) \43 (ap).pos = sizeof(lst); \44 (ap).last = (uint8_t *) &(lst)45 46 37 /** 47 38 * va_arg macro for MIPS32 - problem is that 64 bit values must be aligned on an 8-byte boundary (32bit values not) 48 39 * To satisfy this, paddings must be sometimes inserted. 49 40 */ 50 #define va_arg(ap, type) \ 51 (*((type *)((ap).last + ((ap).pos += sizeof(type) + ((sizeof(type) == 8) && (((ap).pos)&4) ? 4 : 0)) - sizeof(type)))) 41 42 typedef uint8_t* va_list; 43 44 #define va_start(ap, lst) \ 45 ((ap) = (va_list)&(lst) + sizeof(lst)) 46 47 #define va_arg(ap, type) \ 48 (((type *)((ap) = (va_list)( (sizeof(type) <= 4) ? ((uint32_t)((ap) + 2*4 - 1) & (~3)) : ((uint32_t)((ap) + 2*8 -1) & (~7)) )))[-1]) 52 49 53 50 #define va_end(ap) 54 51 55 56 57 52 #endif
Note:
See TracChangeset
for help on using the changeset viewer.