Introduce an AUXARGS_ENTRY_PTR() macro.

As the name implys, it uses the a_ptr member of the auxarg entry (except
in compat32 where it uses a_val).  This is more correct and required for
systems where a_val is not the same size or hardware type as a_ptr (e.g.
CHERI).

This is a prepratory commit for D24407.

Reviewed by:	kib
Obtained from:	CheriBSD
Sponsored by:	DARPA
This commit is contained in:
Brooks Davis 2020-04-15 20:19:59 +00:00
parent 913cacc71f
commit da813b4d95

View File

@ -39,6 +39,13 @@
#define AUXARGS_ENTRY(pos, id, val) \
{(pos)->a_type = (id); (pos)->a_un.a_val = (val); (pos)++;}
#if (defined(__LP64__) && __ELF_WORD_SIZE == 32)
#define AUXARGS_ENTRY_PTR(pos, id, ptr) \
{(pos)->a_type = (id); (pos)->a_un.a_val = (uintptr_t)(ptr); (pos)++;}
#else
#define AUXARGS_ENTRY_PTR(pos, id, ptr) \
{(pos)->a_type = (id); (pos)->a_un.a_ptr = (ptr); (pos)++;}
#endif
struct image_params;
struct thread;