Date: Wed, 15 Apr 2020 20:20:00 +0000 (UTC) From: Brooks Davis <brooks@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r359986 - head/sys/sys Message-ID: <202004152020.03FKK0Pm089658@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: brooks Date: Wed Apr 15 20:19:59 2020 New Revision: 359986 URL: https://svnweb.freebsd.org/changeset/base/359986 Log: 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 Modified: head/sys/sys/imgact_elf.h Modified: head/sys/sys/imgact_elf.h ============================================================================== --- head/sys/sys/imgact_elf.h Wed Apr 15 19:47:19 2020 (r359985) +++ head/sys/sys/imgact_elf.h Wed Apr 15 20:19:59 2020 (r359986) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004152020.03FKK0Pm089658>