aboutsummaryrefslogtreecommitdiff
path: root/bsd-user
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2021-08-27 11:28:16 -0600
committerWarner Losh <imp@bsdimp.com>2021-09-10 14:13:06 -0600
commitd1dc9ab3afd51f0a8d6a6b19edca3dd345deb32d (patch)
tree07d8afe401ad1f672a195a0666e7412bf2925b70 /bsd-user
parentcce7ae5c06897a87092456622cf9d46486306a64 (diff)
downloadqemu-d1dc9ab3afd51f0a8d6a6b19edca3dd345deb32d.zip
qemu-d1dc9ab3afd51f0a8d6a6b19edca3dd345deb32d.tar.gz
qemu-d1dc9ab3afd51f0a8d6a6b19edca3dd345deb32d.tar.bz2
bsd-user: Include host-os.h from main
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>
Diffstat (limited to 'bsd-user')
-rw-r--r--bsd-user/freebsd/host-os.h2
-rw-r--r--bsd-user/main.c4
-rw-r--r--bsd-user/netbsd/host-os.h2
-rw-r--r--bsd-user/openbsd/host-os.h2
4 files changed, 9 insertions, 1 deletions
diff --git a/bsd-user/freebsd/host-os.h b/bsd-user/freebsd/host-os.h
index bd3f289..dfb8344 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 e06cc7b..607fdd8 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 d4bbc7d..c0be51a 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 ae23bfe..eb8fdf1 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_ */