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,6 +151,11 @@ if [ "$solaris" = "yes" ] ; then | ||
| 151 | make="gmake" | 151 | make="gmake" |
| 152 | install="ginstall" | 152 | install="ginstall" |
| 153 | solarisrev=`uname -r | cut -f2 -d.` | 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 | fi | 159 | fi |
| 155 | 160 | ||
| 156 | # find source path | 161 | # find source path |
kqemu.c
| @@ -26,6 +26,9 @@ | @@ -26,6 +26,9 @@ | ||
| 26 | #include <sys/mman.h> | 26 | #include <sys/mman.h> |
| 27 | #include <sys/ioctl.h> | 27 | #include <sys/ioctl.h> |
| 28 | #endif | 28 | #endif |
| 29 | +#ifdef HOST_SOLARIS | ||
| 30 | +#include <sys/modctl.h> | ||
| 31 | +#endif | ||
| 29 | #include <stdlib.h> | 32 | #include <stdlib.h> |
| 30 | #include <stdio.h> | 33 | #include <stdio.h> |
| 31 | #include <stdarg.h> | 34 | #include <stdarg.h> |
osdep.c
| @@ -27,6 +27,10 @@ | @@ -27,6 +27,10 @@ | ||
| 27 | #include <string.h> | 27 | #include <string.h> |
| 28 | #include <errno.h> | 28 | #include <errno.h> |
| 29 | #include <unistd.h> | 29 | #include <unistd.h> |
| 30 | +#ifdef HOST_SOLARIS | ||
| 31 | +#include <sys/types.h> | ||
| 32 | +#include <sys/statvfs.h> | ||
| 33 | +#endif | ||
| 30 | 34 | ||
| 31 | #include "cpu.h" | 35 | #include "cpu.h" |
| 32 | #if defined(USE_KQEMU) | 36 | #if defined(USE_KQEMU) |
| @@ -86,13 +90,22 @@ void *kqemu_vmalloc(size_t size) | @@ -86,13 +90,22 @@ void *kqemu_vmalloc(size_t size) | ||
| 86 | const char *tmpdir; | 90 | const char *tmpdir; |
| 87 | char phys_ram_file[1024]; | 91 | char phys_ram_file[1024]; |
| 88 | void *ptr; | 92 | void *ptr; |
| 93 | +#ifdef HOST_SOLARIS | ||
| 94 | + struct statvfs stfs; | ||
| 95 | +#else | ||
| 89 | struct statfs stfs; | 96 | struct statfs stfs; |
| 97 | +#endif | ||
| 90 | 98 | ||
| 91 | if (phys_ram_fd < 0) { | 99 | if (phys_ram_fd < 0) { |
| 92 | tmpdir = getenv("QEMU_TMPDIR"); | 100 | tmpdir = getenv("QEMU_TMPDIR"); |
| 93 | if (!tmpdir) | 101 | if (!tmpdir) |
| 102 | +#ifdef HOST_SOLARIS | ||
| 103 | + tmpdir = "/tmp"; | ||
| 104 | + if (statvfs(tmpdir, &stfs) == 0) { | ||
| 105 | +#else | ||
| 94 | tmpdir = "/dev/shm"; | 106 | tmpdir = "/dev/shm"; |
| 95 | if (statfs(tmpdir, &stfs) == 0) { | 107 | if (statfs(tmpdir, &stfs) == 0) { |
| 108 | +#endif | ||
| 96 | int64_t free_space; | 109 | int64_t free_space; |
| 97 | int ram_mb; | 110 | int ram_mb; |
| 98 | 111 |