From d1dc9ab3afd51f0a8d6a6b19edca3dd345deb32d Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 27 Aug 2021 11:28:16 -0600 Subject: [PATCH] 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 Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- 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_ */