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)