[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 17/42] bsd-user: Include host-os.h from main
From: |
imp |
Subject: |
[PULL 17/42] bsd-user: Include host-os.h from main |
Date: |
Tue, 7 Sep 2021 15:53:07 -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
- [PULL 02/42] bsd-user: add copyright header to elfload.c, (continued)
- [PULL 02/42] bsd-user: add copyright header to elfload.c, imp, 2021/09/07
- [PULL 04/42] bsd-user: add license to bsdload.c, imp, 2021/09/07
- [PULL 01/42] bsd-user: remove sparc and sparc64, imp, 2021/09/07
- [PULL 06/42] bsd-user: Remove all non-x86 code from elfload.c, imp, 2021/09/07
- [PULL 03/42] bsd-user: Add Stacey's copyright to main.c, imp, 2021/09/07
- [PULL 08/42] bsd-user: pass the bsd_param into loader_exec, imp, 2021/09/07
- [PULL 13/42] bsd-user: TARGET_NGROUPS unused in this file, remove, imp, 2021/09/07
- [PULL 07/42] bsd-user: move arch specific defines out of elfload.c, imp, 2021/09/07
- [PULL 09/42] bsd-user: Fix calculation of size to allocate, imp, 2021/09/07
- [PULL 12/42] bsd-user: remove a.out support, imp, 2021/09/07
- [PULL 17/42] bsd-user: Include host-os.h from main,
imp <=
- [PULL 22/42] bsd-user: Include more things in qemu.h, imp, 2021/09/07
- [PULL 10/42] bsd-user: implement path searching, imp, 2021/09/07
- [PULL 15/42] bsd-user: assume pthreads and support of __thread, imp, 2021/09/07
- [PULL 14/42] bsd-user: elfload: simplify bswap a bit., imp, 2021/09/07
- [PULL 16/42] bsd-user: add host-os.h, imp, 2021/09/07
- [PULL 18/42] bsd-user: save the path to the qemu emulator, imp, 2021/09/07
- [PULL 19/42] bsd-user: start to move target CPU functions to target_arch*, imp, 2021/09/07
- [PULL 29/42] bsd-user: Add architecture specific signal tramp code, imp, 2021/09/07
- [PULL 23/42] bsd-user: define max args in terms of pages, imp, 2021/09/07
- [PULL 25/42] bsd-user: Add system independent stack, data and text limiting, imp, 2021/09/07