Changeset 46579c66 in mainline for arch/mips32/include/arg.h
- Timestamp:
- 2006-03-16T17:17:41Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 79aeb43b
- Parents:
- 41fa6f2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/mips32/include/arg.h
r41fa6f2 r46579c66 32 32 #include <arch/types.h> 33 33 34 typedef struct va_list {35 int pos;36 __u8 *last;37 } va_list;38 39 #define va_start(ap, lst) \40 (ap).pos = sizeof(lst); \41 (ap).last = (__u8 *) &(lst)42 43 34 /** 44 35 * va_arg macro for MIPS32 - problem is that 64 bit values must be aligned on an 8-byte boundary (32bit values not) 45 36 * To satisfy this, paddings must be sometimes inserted. 46 37 */ 47 #define va_arg(ap, type) \ 48 (*((type *)((ap).last + ((ap).pos += sizeof(type) + ((sizeof(type)==8)&&(((ap).pos)&(4))?4:0)) - sizeof(type)))) 38 39 typedef __address va_list; 40 41 #define va_start(ap, lst) \ 42 ((ap) = (va_list)&(lst) + sizeof(lst)) 43 44 #define va_arg(ap, type) \ 45 (((type *)((ap) = (va_list)( (sizeof(type) <= 4) ? ((__address)((ap) + 2*4 - 1) & (~3)) : ((__address)((ap) + 2*8 -1) & (~7)) )))[-1]) 49 46 50 47 #define va_end(ap) 51 48 52 53 54 49 #endif
Note:
See TracChangeset
for help on using the changeset viewer.