summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid CARLIER2020-06-12 10:46:06 +0200
committerPaolo Bonzini2020-06-26 12:45:29 +0200
commitae2b72072bc401114ebb9f46abd67d07d4cabf10 (patch)
treeba472e702691d523631a237f282390601ff99f63
parentkvm: support to get/set dirty log initial-all-set capability (diff)
downloadqemu-ae2b72072bc401114ebb9f46abd67d07d4cabf10.tar.gz
qemu-ae2b72072bc401114ebb9f46abd67d07d4cabf10.tar.xz
qemu-ae2b72072bc401114ebb9f46abd67d07d4cabf10.zip
util/getauxval: Porting to FreeBSD getauxval feature
From d7f9d40777d1ed7c9450b0be4f957da2993dfc72 Mon Sep 17 00:00:00 2001 From: David Carlier <devnexen@gmail.com> Date: Fri, 12 Jun 2020 09:39:17 +0100 Subject: [PATCH] util/getauxval: Porting to FreeBSD getauxval feature FreeBSD has a similar API for auxiliary vector. Signed-off-by: David Carlier <devnexen@gmail.com> Message-Id: <CA+XhMqxTU6PUSQBpbA9VrS1QZfqgrCAKUCtUF-x2aF=fCMTDOw@mail.gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--util/getauxval.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/util/getauxval.c b/util/getauxval.c
index 36afdfb9e6..b124107d61 100644
--- a/util/getauxval.c
+++ b/util/getauxval.c
@@ -98,6 +98,16 @@ unsigned long qemu_getauxval(unsigned long type)
return 0;
}
+#elif defined(__FreeBSD__)
+#include <sys/auxv.h>
+
+unsigned long qemu_getauxval(unsigned long type)
+{
+ unsigned long aux = 0;
+ elf_aux_info(type, &aux, sizeof(aux));
+ return aux;
+}
+
#else
unsigned long qemu_getauxval(unsigned long type)