Commit 605686cd7acdc37b87134c7eedf01b99db9213c1
1 parent
81822663
Kqemu support for Solaris, by Ben Taylor.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2329 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
3 changed files
with
21 additions
and
0 deletions
configure
| ... | ... | @@ -151,6 +151,11 @@ if [ "$solaris" = "yes" ] ; then |
| 151 | 151 | make="gmake" |
| 152 | 152 | install="ginstall" |
| 153 | 153 | solarisrev=`uname -r | cut -f2 -d.` |
| 154 | + if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then | |
| 155 | + if test "$solarisrev" -gt 10 ; then | |
| 156 | + kqemu="yes" | |
| 157 | + fi | |
| 158 | + fi | |
| 154 | 159 | fi |
| 155 | 160 | |
| 156 | 161 | # find source path | ... | ... |
kqemu.c
osdep.c
| ... | ... | @@ -27,6 +27,10 @@ |
| 27 | 27 | #include <string.h> |
| 28 | 28 | #include <errno.h> |
| 29 | 29 | #include <unistd.h> |
| 30 | +#ifdef HOST_SOLARIS | |
| 31 | +#include <sys/types.h> | |
| 32 | +#include <sys/statvfs.h> | |
| 33 | +#endif | |
| 30 | 34 | |
| 31 | 35 | #include "cpu.h" |
| 32 | 36 | #if defined(USE_KQEMU) |
| ... | ... | @@ -86,13 +90,22 @@ void *kqemu_vmalloc(size_t size) |
| 86 | 90 | const char *tmpdir; |
| 87 | 91 | char phys_ram_file[1024]; |
| 88 | 92 | void *ptr; |
| 93 | +#ifdef HOST_SOLARIS | |
| 94 | + struct statvfs stfs; | |
| 95 | +#else | |
| 89 | 96 | struct statfs stfs; |
| 97 | +#endif | |
| 90 | 98 | |
| 91 | 99 | if (phys_ram_fd < 0) { |
| 92 | 100 | tmpdir = getenv("QEMU_TMPDIR"); |
| 93 | 101 | if (!tmpdir) |
| 102 | +#ifdef HOST_SOLARIS | |
| 103 | + tmpdir = "/tmp"; | |
| 104 | + if (statvfs(tmpdir, &stfs) == 0) { | |
| 105 | +#else | |
| 94 | 106 | tmpdir = "/dev/shm"; |
| 95 | 107 | if (statfs(tmpdir, &stfs) == 0) { |
| 108 | +#endif | |
| 96 | 109 | int64_t free_space; |
| 97 | 110 | int ram_mb; |
| 98 | 111 | ... | ... |