[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 17/43] bsd-user: Include host-os.h from main
From: |
imp |
Subject: |
[PATCH v2 17/43] bsd-user: Include host-os.h from main |
Date: |
Thu, 26 Aug 2021 15:11:35 -0600 |
From: Warner Losh <imp@bsdimp.com>
Include host-os.h from main.c to pick up the default OS to emulate. Set
that default in main().
Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
bsd-user/freebsd/host-os.h | 2 ++
bsd-user/main.c | 4 +++-
bsd-user/netbsd/host-os.h | 2 ++
bsd-user/openbsd/host-os.h | 2 ++
4 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/bsd-user/freebsd/host-os.h b/bsd-user/freebsd/host-os.h
index a799164324..ceb1543d06 100644
--- a/bsd-user/freebsd/host-os.h
+++ b/bsd-user/freebsd/host-os.h
@@ -20,4 +20,6 @@
#ifndef __HOST_OS_H_
#define __HOST_OS_H_
+#define HOST_DEFAULT_BSD_TYPE target_freebsd
+
#endif /*!__HOST_OS_H_ */
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 3f6f4080e8..3a23e63cf8 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -41,6 +41,8 @@
#include "exec/log.h"
#include "trace/control.h"
+#include "host-os.h"
+
int singlestep;
unsigned long mmap_min_addr;
uintptr_t guest_base;
@@ -352,7 +354,7 @@ int main(int argc, char **argv)
const char *gdbstub = NULL;
char **target_environ, **wrk;
envlist_t *envlist = NULL;
- bsd_type = target_openbsd;
+ bsd_type = HOST_DEFAULT_BSD_TYPE;
if (argc <= 1) {
usage();
diff --git a/bsd-user/netbsd/host-os.h b/bsd-user/netbsd/host-os.h
index b44cb7fdda..ccbea076e6 100644
--- a/bsd-user/netbsd/host-os.h
+++ b/bsd-user/netbsd/host-os.h
@@ -20,4 +20,6 @@
#ifndef __HOST_OS_H_
#define __HOST_OS_H_
+#define HOST_DEFAULT_BSD_TYPE target_netbsd
+
#endif /*!__HOST_OS_H_ */
diff --git a/bsd-user/openbsd/host-os.h b/bsd-user/openbsd/host-os.h
index 9083555f26..79468073e4 100644
--- a/bsd-user/openbsd/host-os.h
+++ b/bsd-user/openbsd/host-os.h
@@ -20,4 +20,6 @@
#ifndef __HOST_OS_H_
#define __HOST_OS_H_
+#define HOST_DEFAULT_BSD_TYPE target_openbsd
+
#endif /*!__HOST_OS_H_ */
--
2.32.0
- [PATCH v2 07/43] bsd-user: move arch specific defines out of elfload.c, (continued)
- [PATCH v2 07/43] bsd-user: move arch specific defines out of elfload.c, imp, 2021/08/26
- [PATCH v2 10/43] bsd-user: implement path searching, imp, 2021/08/26
- [PATCH v2 11/43] bsd-user: Eliminate elf personality, imp, 2021/08/26
- [PATCH v2 12/43] bsd-user: remove a.out support, imp, 2021/08/26
- [PATCH v2 14/43] bsd-user: elfload: simplify bswap a bit., imp, 2021/08/26
- [PATCH v2 15/43] bsd-user: assume pthreads and support of __thread, imp, 2021/08/26
- [PATCH v2 13/43] bsd-user: TARGET_NGROUPS unused in this file, remove, imp, 2021/08/26
- [PATCH v2 17/43] bsd-user: Include host-os.h from main,
imp <=
- [PATCH v2 16/43] bsd-user: add host-os.h, imp, 2021/08/26
- [PATCH v2 18/43] bsd-user: save the path to the qemu emulator, imp, 2021/08/26
- [PATCH v2 19/43] bsd-user: start to move target CPU functions to target_arch*, imp, 2021/08/26
- [PATCH v2 22/43] bsd-user: Include more things in qemu.h, imp, 2021/08/26
- [PATCH v2 28/43] bsd-user: Add system independent stack, data and text limiting, imp, 2021/08/26
- [PATCH v2 20/43] bsd-user: Move per-cpu code into target_arch_cpu.h, imp, 2021/08/26
- [PATCH v2 24/43] bsd-user: Create target specific vmparam.h, imp, 2021/08/26
- [PATCH v2 26/43] bsd-user: *BSD specific siginfo defintions, imp, 2021/08/26