mirror of https://github.com/xqemu/xqemu.git
Kqemu support for Solaris, by Ben Taylor.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2329 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
8182266352
commit
605686cd7a
|
@ -151,6 +151,11 @@ if [ "$solaris" = "yes" ] ; then
|
||||||
make="gmake"
|
make="gmake"
|
||||||
install="ginstall"
|
install="ginstall"
|
||||||
solarisrev=`uname -r | cut -f2 -d.`
|
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
|
fi
|
||||||
|
|
||||||
# find source path
|
# find source path
|
||||||
|
|
3
kqemu.c
3
kqemu.c
|
@ -26,6 +26,9 @@
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HOST_SOLARIS
|
||||||
|
#include <sys/modctl.h>
|
||||||
|
#endif
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
13
osdep.c
13
osdep.c
|
@ -27,6 +27,10 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#ifdef HOST_SOLARIS
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/statvfs.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
#if defined(USE_KQEMU)
|
#if defined(USE_KQEMU)
|
||||||
|
@ -86,13 +90,22 @@ void *kqemu_vmalloc(size_t size)
|
||||||
const char *tmpdir;
|
const char *tmpdir;
|
||||||
char phys_ram_file[1024];
|
char phys_ram_file[1024];
|
||||||
void *ptr;
|
void *ptr;
|
||||||
|
#ifdef HOST_SOLARIS
|
||||||
|
struct statvfs stfs;
|
||||||
|
#else
|
||||||
struct statfs stfs;
|
struct statfs stfs;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (phys_ram_fd < 0) {
|
if (phys_ram_fd < 0) {
|
||||||
tmpdir = getenv("QEMU_TMPDIR");
|
tmpdir = getenv("QEMU_TMPDIR");
|
||||||
if (!tmpdir)
|
if (!tmpdir)
|
||||||
|
#ifdef HOST_SOLARIS
|
||||||
|
tmpdir = "/tmp";
|
||||||
|
if (statvfs(tmpdir, &stfs) == 0) {
|
||||||
|
#else
|
||||||
tmpdir = "/dev/shm";
|
tmpdir = "/dev/shm";
|
||||||
if (statfs(tmpdir, &stfs) == 0) {
|
if (statfs(tmpdir, &stfs) == 0) {
|
||||||
|
#endif
|
||||||
int64_t free_space;
|
int64_t free_space;
|
||||||
int ram_mb;
|
int ram_mb;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue