Skip to content

Commit

Permalink
Kqemu support for Solaris, by Ben Taylor.
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2329 c046a42c-6fe2-441c-8c8c-71466251a162
  • Loading branch information
ths committed Jan 17, 2007
1 parent 8182266 commit 605686c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions kqemu.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
#include <sys/mman.h>
#include <sys/ioctl.h>
#endif
#ifdef HOST_SOLARIS
#include <sys/modctl.h>
#endif
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
Expand Down
13 changes: 13 additions & 0 deletions osdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
#include <string.h>
#include <errno.h>
#include <unistd.h>
#ifdef HOST_SOLARIS
#include <sys/types.h>
#include <sys/statvfs.h>
#endif

#include "cpu.h"
#if defined(USE_KQEMU)
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 605686c

Please sign in to comment.