From ef6a411ce8ff615d65e2be105834c2fdbe557de1 Mon Sep 17 00:00:00 2001 From: johannst Date: Sat, 20 Mar 2021 02:34:01 +0100 Subject: Split common headers in header/src files. --- lib/include/auxv.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 lib/include/auxv.h (limited to 'lib/include/auxv.h') diff --git a/lib/include/auxv.h b/lib/include/auxv.h new file mode 100644 index 0000000..42dac38 --- /dev/null +++ b/lib/include/auxv.h @@ -0,0 +1,36 @@ +// Copyright (c) 2020 Johannes Stoelp + +#pragma once + +#include + +/// ---------------- +/// Auxiliary Vector +/// ---------------- + +// NOTE: [x86-64] Either AT_EXECFD or AT_PHDR must be supplied by the Kernel. + +#define AT_NULL 0 /* [ignored] Mark end of auxiliary vetcor */ +#define AT_IGNORE 1 /* [ignored] */ +#define AT_EXECFD 2 /* [val] File descriptor of user program (in case Linux Kernel didn't mapped) */ +#define AT_PHDR 3 /* [ptr] Address of Phdr of use program (in case Kernel mapped user program) */ +#define AT_PHENT 4 /* [val] Size in bytes of one Phdr entry */ +#define AT_PHNUM 5 /* [val] Number of Phread entries */ +#define AT_PAGESZ 6 /* [val] System page size */ +#define AT_BASE 7 /* [ptr] `base address` interpreter was loaded to */ +#define AT_FLAGS 8 /* [val] */ +#define AT_ENTRY 9 /* [ptr] Entry point of user program */ +#define AT_NOTELF 10 /* [val] >0 if not an ELF file */ +#define AT_UID 11 /* [val] Real user id of process */ +#define AT_EUID 12 /* [val] Effective user id of process */ +#define AT_GID 13 /* [val] Real group id of process */ +#define AT_EGID 14 /* [val] Effective user id of process */ +#define AT_MAX_CNT 15 + +typedef struct { + uint64_t tag; + union { + uint64_t val; + void* ptr; + }; +} Auxv64Entry; -- cgit v1.2.3