From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Egger Subject: [PATCH][IOEMU] build fix for BSD Date: Mon, 10 Nov 2008 12:29:32 +0200 Message-ID: <200811101129.32205.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-00=_M0AGJyq3OfDoaYD" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --Boundary-00=_M0AGJyq3OfDoaYD Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi! Attached patch makes git-ioemu compile on NetBSD. Signed-off-by: Christoph Egger P.S.: I'm about sending the pieces to qemu-devel. The changes in vl.c already went upstream in qemu's svn c/s 5646. =2D-=20 AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Gesch=E4ftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplement=E4r: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Gesch=E4ftsf=FChrer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy --Boundary-00=_M0AGJyq3OfDoaYD Content-Type: text/x-diff; charset="iso-8859-1"; name="xen_ioemu_bsd.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xen_ioemu_bsd.diff" diff --git a/block.c b/block.c index b83e633..a90cfa8 100644 --- a/block.c +++ b/block.c @@ -32,8 +32,10 @@ #include #include #include +#if defined(__FreeBSD__) #include #endif +#endif #define SECTOR_BITS 9 #define SECTOR_SIZE (1 << SECTOR_BITS) diff --git a/configure b/configure index 994a4c8..8ad66dc 100755 --- a/configure +++ b/configure @@ -341,10 +341,10 @@ for opt do esac done -if [ "$bsd" = "yes" ] ; then - AIOLIBS="-lrt" -elif [ "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then +if [ "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then AIOLIBS= +elif [ "$bsd" = "yes" ]; then + AIOLIBS="-lrt -lpthread" else # Some Linux architectures (e.g. s390) don't imply -lpthread automatically. AIOLIBS="-lrt -lpthread" diff --git a/hw/battery_mgmt.h b/hw/battery_mgmt.h index dd60160..4a4ac8e 100644 --- a/hw/battery_mgmt.h +++ b/hw/battery_mgmt.h @@ -25,6 +25,9 @@ #ifdef CONFIG_STUBDOM #define CONFIG_NO_BATTERY_MGMT #endif +#ifdef _BSD /* There's no ioperm(), outb(), inb() */ +#define CONFIG_NO_BATTERY_MGMT +#endif enum POWER_MGMT_MODE { PM_MODE_NONE = 0, PM_MODE_PT, PM_MODE_NON_PT }; enum BATTERY_INFO_TYPE { BATT_NONE, BIF, BST }; diff --git a/monitor.c b/monitor.c index b15a1fa..cc55ccc 100644 --- a/monitor.c +++ b/monitor.c @@ -2210,9 +2210,9 @@ static void monitor_handle_command(const char *cmdline) /* format found */ p++; count = 1; - if (isdigit(*p)) { + if (isdigit((uint8_t)*p)) { count = 0; - while (isdigit(*p)) { + while (isdigit((uint8_t)*p)) { count = count * 10 + (*p - '0'); p++; } diff --git a/vl.c b/vl.c index 182346a..d2833b1 100644 --- a/vl.c +++ b/vl.c @@ -56,23 +56,31 @@ #include #include #include +#include #include #include +#include +#if defined(__NetBSD__) +#include +#endif +#ifdef __linux__ +#include +#endif +#include #include #include #include -#include #ifdef _BSD #include -#ifndef __APPLE__ +#ifdef __FreeBSD__ #include +#else +#include #endif #elif defined (__GLIBC__) && defined (__FreeBSD_kernel__) #include #else #ifdef __linux__ -#include -#include #include #include #include @@ -4115,10 +4123,13 @@ static int tap_open(char *ifname, int ifname_size) #ifndef TAPGIFNAME char *dev; struct stat s; +#else + struct ifreq ifr; #endif TFR(fd = open("/dev/tap", O_RDWR)); if (fd < 0) { + fprintf(stderr, "warning: could not open /dev/tap: no virtual network emulation %s\n", strerror(errno)); return -1; } diff --git a/xen-hooks.mak b/xen-hooks.mak index e874552..8e1b188 100644 --- a/xen-hooks.mak +++ b/xen-hooks.mak @@ -19,6 +19,7 @@ CFLAGS += $(CMDLINE_CFLAGS) LIBS += -L$(XEN_ROOT)/tools/libxc -lxenctrl -lxenguest LIBS += -L$(XEN_ROOT)/tools/xenstore -lxenstore +LIBS += -lossaudio LDFLAGS := $(CFLAGS) $(LDFLAGS) --Boundary-00=_M0AGJyq3OfDoaYD Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_M0AGJyq3OfDoaYD--