aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-07-05 21:25:26 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-07-05 21:25:26 +0000
commit83fb7adf6c653a0285a89d51b746cb642d2859cf (patch)
tree24791ee7957dae766c687945939ef17291306b32 /vl.c
parent1d43a717730346de2c664c0eccf0592eb4ba2cd8 (diff)
downloadqemu-83fb7adf6c653a0285a89d51b746cb642d2859cf.zip
qemu-83fb7adf6c653a0285a89d51b746cb642d2859cf.tar.gz
qemu-83fb7adf6c653a0285a89d51b746cb642d2859cf.tar.bz2
Darwin patch (initial patch by Pierre d'Herbemont)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@980 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/vl.c b/vl.c
index 5f1322e..eebc6e6 100644
--- a/vl.c
+++ b/vl.c
@@ -40,7 +40,9 @@
#include <sys/socket.h>
#ifdef _BSD
#include <sys/stat.h>
+#ifndef __APPLE__
#include <libutil.h>
+#endif
#else
#include <linux/if.h>
#include <linux/if_tun.h>
@@ -63,6 +65,7 @@
#endif
#ifdef CONFIG_SDL
+#include <SDL/SDL.h>
#if defined(__linux__)
/* SDL use the pthreads and they modify sigaction. We don't
want that. */
@@ -909,6 +912,7 @@ static void init_timers(void)
the emulated kernel requested a too high timer frequency */
getitimer(ITIMER_REAL, &itv);
+#if defined(__linux__)
if (itv.it_interval.tv_usec > 1000) {
/* try to use /dev/rtc to have a faster timer */
if (start_rtc_timer() < 0)
@@ -924,7 +928,9 @@ static void init_timers(void)
sigaction(SIGIO, &act, NULL);
fcntl(rtc_fd, F_SETFL, O_ASYNC);
fcntl(rtc_fd, F_SETOWN, getpid());
- } else {
+ } else
+#endif /* defined(__linux__) */
+ {
use_itimer:
pit_min_timer_count = ((uint64_t)itv.it_interval.tv_usec *
PIT_FREQ) / 1000000;
@@ -2622,8 +2628,8 @@ int main(int argc, char **argv)
#ifdef CONFIG_SOFTMMU
#ifdef _BSD
- /* mallocs are always aligned on BSD. */
- phys_ram_base = malloc(phys_ram_size);
+ /* mallocs are always aligned on BSD. valloc is better for correctness */
+ phys_ram_base = valloc(phys_ram_size);
#else
phys_ram_base = memalign(TARGET_PAGE_SIZE, phys_ram_size);
#endif