[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 17/43] bsd-user: Include host-os.h from main
From: |
imp |
Subject: |
[PATCH v3 17/43] bsd-user: Include host-os.h from main |
Date: |
Thu, 2 Sep 2021 17:47:03 -0600 |
From: Warner Losh <imp@FreeBSD.org>
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 bd3f2892db..dfb8344b7b 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 e06cc7b414..607fdd8380 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 d4bbc7d58f..c0be51a7ef 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 ae23bfef64..eb8fdf1567 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 v3 09/43] bsd-user: Fix calculation of size to allocate, (continued)
- [PATCH v3 09/43] bsd-user: Fix calculation of size to allocate, imp, 2021/09/02
- [PATCH v3 10/43] bsd-user: implement path searching, imp, 2021/09/02
- [PATCH v3 11/43] bsd-user: Eliminate elf personality, imp, 2021/09/02
- [PATCH v3 12/43] bsd-user: remove a.out support, imp, 2021/09/02
- [PATCH v3 13/43] bsd-user: TARGET_NGROUPS unused in this file, remove, imp, 2021/09/02
- [PATCH v3 16/43] bsd-user: add host-os.h, imp, 2021/09/02
- [PATCH v3 25/43] bsd-user: Add system independent stack, data and text limiting, imp, 2021/09/02
- [PATCH v3 18/43] bsd-user: save the path to the qemu emulator, imp, 2021/09/02
- [PATCH v3 17/43] bsd-user: Include host-os.h from main,
imp <=
- [PATCH v3 26/43] bsd-user: *BSD specific siginfo defintions, imp, 2021/09/02
- [PATCH v3 21/43] bsd-user: pull in target_arch_thread.h update target_arch_elf.h, imp, 2021/09/02
- [PATCH v3 30/43] bsd-user: elf cleanup, imp, 2021/09/02
- [PATCH v3 19/43] bsd-user: start to move target CPU functions to target_arch*, imp, 2021/09/02
- [PATCH v3 15/43] bsd-user: assume pthreads and support of __thread, imp, 2021/09/02
- [PATCH v3 23/43] bsd-user: define max args in terms of pages, imp, 2021/09/02
- [PATCH v3 22/43] bsd-user: Include more things in qemu.h, imp, 2021/09/02