瀏覽代碼

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>
Warner Losh 4 年之前
父節點
當前提交
d1dc9ab3af
共有 4 個文件被更改,包括 9 次插入1 次删除
  1. 2 0
      bsd-user/freebsd/host-os.h
  2. 3 1
      bsd-user/main.c
  3. 2 0
      bsd-user/netbsd/host-os.h
  4. 2 0
      bsd-user/openbsd/host-os.h

+ 2 - 0
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_ */

+ 3 - 1
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();

+ 2 - 0
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_ */

+ 2 - 0
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_ */