From 9b90419adf58bcbec1819c2b95494a8b093e42be Mon Sep 17 00:00:00 2001 From: ths Date: Wed, 17 Jan 2007 23:31:19 +0000 Subject: [PATCH] Kqemu support for Solaris, by Ben Taylor. --- configure | 5 +++++ kqemu.c | 3 +++ osdep.c | 13 +++++++++++++ 3 files changed, 21 insertions(+) diff --git a/configure b/configure index 93bbe7b7..68c3fcc7 100755 --- a/configure +++ b/configure @@ -151,6 +151,11 @@ if [ "$solaris" = "yes" ] ; then make="gmake" install="ginstall" solarisrev=`uname -r | cut -f2 -d.` + if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then + if test "$solarisrev" -gt 10 ; then + kqemu="yes" + fi + fi fi # find source path diff --git a/kqemu.c b/kqemu.c index 5ba314f4..e01556ad 100644 --- a/kqemu.c +++ b/kqemu.c @@ -26,6 +26,9 @@ #include #include #endif +#ifdef HOST_SOLARIS +#include +#endif #include #include #include diff --git a/osdep.c b/osdep.c index 1a4c0368..d1eff8de 100644 --- a/osdep.c +++ b/osdep.c @@ -27,6 +27,10 @@ #include #include #include +#ifdef HOST_SOLARIS +#include +#include +#endif #include "cpu.h" #if defined(USE_KQEMU) @@ -86,13 +90,22 @@ void *kqemu_vmalloc(size_t size) const char *tmpdir; char phys_ram_file[1024]; void *ptr; +#ifdef HOST_SOLARIS + struct statvfs stfs; +#else struct statfs stfs; +#endif if (phys_ram_fd < 0) { tmpdir = getenv("QEMU_TMPDIR"); if (!tmpdir) +#ifdef HOST_SOLARIS + tmpdir = "/tmp"; + if (statvfs(tmpdir, &stfs) == 0) { +#else tmpdir = "/dev/shm"; if (statfs(tmpdir, &stfs) == 0) { +#endif int64_t free_space; int ram_mb; -- 2.39.5