1ab786f460
* printcmd.c (makeva_list): Use MAKEVA_EXTRA_INFO to define machine dependent fields in the makeva_list structure. (makeva_size): Allocate extra space to handle gaps made by alignment restrictions. * config/pa/xm-pa.h (MAKEVA_EXTRA_INFO): Define. (MAKEVA_START): Initialize arglist_address field. (MAKEVA_ARG): Always store arguments on natural alignment boundaries. Set arglist_address to the address right after the args. (MAKEVA_END): Simply return the value stored in arglist_address.
34 lines
1.2 KiB
C
34 lines
1.2 KiB
C
/* Definitions for all PA machines. */
|
|
|
|
#define MAKEVA_EXTRA_INFO int arglist_address;
|
|
|
|
#define MAKEVA_START(list) \
|
|
list->argindex = list->nargs * list->max_arg_size; \
|
|
list->arglist_address = 0;
|
|
|
|
#define MAKEVA_ARG(list, argaddr, argsize) \
|
|
{ \
|
|
int rounded_argsize; \
|
|
if (argsize > 8) \
|
|
/* Currently this never happens; printf_command only uses argsize */ \
|
|
/* of sizeof (int), sizeof (double), or sizeof (long long). */ \
|
|
error ("MAKEVA_ARG not fully written for hp-pa"); \
|
|
if (argsize <= 4) \
|
|
rounded_argsize = 4; \
|
|
else if (argsize <= 8) \
|
|
rounded_argsize = 8; \
|
|
list->argindex -= rounded_argsize; \
|
|
while ((int)(&list->arg_bytes[list->argindex]) % rounded_argsize) \
|
|
list->argindex--; \
|
|
/* arglist_address is used to store the address of the first arguent. */ \
|
|
if (list->arglist_address == 0) \
|
|
list->arglist_address = &list->arg_bytes[list->argindex] \
|
|
+ rounded_argsize; \
|
|
memcpy (&list->arg_bytes[list->argindex], argaddr, argsize); \
|
|
}
|
|
|
|
/* The address of the arglist is the address right after the args
|
|
(which is what you'd expect). This address is stored in the arglist_address
|
|
field. */
|
|
#define MAKEVA_END(list) \
|
|
return (va_list) list->arglist_address;
|