Rev 1769 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1769 | Rev 1780 | ||
---|---|---|---|
Line 40... | Line 40... | ||
40 | /** |
40 | /** |
41 | * va_arg macro for MIPS32 - problem is that 64 bit values must be aligned on an 8-byte boundary (32bit values not) |
41 | * va_arg macro for MIPS32 - problem is that 64 bit values must be aligned on an 8-byte boundary (32bit values not) |
42 | * To satisfy this, paddings must be sometimes inserted. |
42 | * To satisfy this, paddings must be sometimes inserted. |
43 | */ |
43 | */ |
44 | 44 | ||
45 | typedef __address va_list; |
45 | typedef uintptr_t va_list; |
46 | 46 | ||
47 | #define va_start(ap, lst) \ |
47 | #define va_start(ap, lst) \ |
48 | ((ap) = (va_list)&(lst) + sizeof(lst)) |
48 | ((ap) = (va_list)&(lst) + sizeof(lst)) |
49 | 49 | ||
50 | #define va_arg(ap, type) \ |
50 | #define va_arg(ap, type) \ |
51 | (((type *)((ap) = (va_list)( (sizeof(type) <= 4) ? ((__address)((ap) + 2*4 - 1) & (~3)) : ((__address)((ap) + 2*8 -1) & (~7)) )))[-1]) |
51 | (((type *)((ap) = (va_list)( (sizeof(type) <= 4) ? ((uintptr_t)((ap) + 2*4 - 1) & (~3)) : ((uintptr_t)((ap) + 2*8 -1) & (~7)) )))[-1]) |
52 | 52 | ||
53 | #define va_copy(dst,src) ((dst)=(src)) |
53 | #define va_copy(dst,src) ((dst)=(src)) |
54 | 54 | ||
55 | #define va_end(ap) |
55 | #define va_end(ap) |
56 | 56 |