diff options
author | apb <apb> | 2007-12-24 10:18:22 +0000 |
---|---|---|
committer | apb <apb> | 2007-12-24 10:18:22 +0000 |
commit | 889012eb42e239bcc255dbd645ac7e075106c762 (patch) | |
tree | e72da8d95e5ba7f94e8ca3ae4e35ffa6e0d954f9 /emulators/qemu | |
parent | bd6231b757d988bf10868eea3f5cadbf88c533f7 (diff) | |
download | pkgsrc-889012eb42e239bcc255dbd645ac7e075106c762.tar.gz |
Add patches/patch-ba:
Emulate the speaker port's refresh clock bit. This is supposed
to toggle between 0 and 1<<4 every 15 microseconds. XXX: We use
gettimeofday() in the real machine instead of a monotonic clock
in the virtual machine, and we are a bit sloppy about the 15
microseconds. This should be good enough for crude loops that
measure approximate delays by counting how often this line toggles.
Bump PKGREVISION to 1
Diffstat (limited to 'emulators/qemu')
-rw-r--r-- | emulators/qemu/Makefile | 3 | ||||
-rw-r--r-- | emulators/qemu/distinfo | 3 | ||||
-rw-r--r-- | emulators/qemu/patches/patch-ba | 47 |
3 files changed, 51 insertions, 2 deletions
diff --git a/emulators/qemu/Makefile b/emulators/qemu/Makefile index 3f85f8d911a..1805a5d94d9 100644 --- a/emulators/qemu/Makefile +++ b/emulators/qemu/Makefile @@ -1,7 +1,8 @@ -# $NetBSD: Makefile,v 1.49 2007/12/18 00:16:56 joerg Exp $ +# $NetBSD: Makefile,v 1.50 2007/12/24 10:18:22 apb Exp $ # DISTNAME= qemu-0.9.0 +PKGREVISION= 1 CATEGORIES= emulators MASTER_SITES= http://fabrice.bellard.free.fr/qemu/ diff --git a/emulators/qemu/distinfo b/emulators/qemu/distinfo index 290321ea0e8..5ee07e20a00 100644 --- a/emulators/qemu/distinfo +++ b/emulators/qemu/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.34 2007/12/18 00:16:56 joerg Exp $ +$NetBSD: distinfo,v 1.35 2007/12/24 10:18:22 apb Exp $ SHA1 (qemu-0.9.0.tar.gz) = 1e57e48a06eb8729913d92601000466eecef06cb RMD160 (qemu-0.9.0.tar.gz) = 4296542b6da18a6ac93d20787330d3c1c2ac0a19 @@ -14,3 +14,4 @@ SHA1 (patch-av) = 715e9680d70c1aa1c83bda0270125144a26d6140 SHA1 (patch-aw) = 3b1472a95a2312f9e49ea1a6aa517ad81328324c SHA1 (patch-ax) = 66b060005ecbf9fd0451f7960e81eccbabf959ca SHA1 (patch-ay) = 2d3051685878abe077abdbba9681bd04e04c7fb3 +SHA1 (patch-ba) = 7c5043a39405f52b512e479a46fc76108580b7bc diff --git a/emulators/qemu/patches/patch-ba b/emulators/qemu/patches/patch-ba new file mode 100644 index 00000000000..4eb631522be --- /dev/null +++ b/emulators/qemu/patches/patch-ba @@ -0,0 +1,47 @@ +$NetBSD: patch-ba,v 1.1 2007/12/24 10:18:22 apb Exp $ + +--- hw/pcspk.c.orig 2007-02-06 01:01:54.000000000 +0200 ++++ hw/pcspk.c +@@ -38,7 +38,6 @@ typedef struct { + unsigned int samples; + unsigned int play_pos; + int data_on; +- int dummy_refresh_clock; + } PCSpkState; + + static const char *s_spk = "pcspk"; +@@ -112,15 +111,32 @@ int pcspk_audio_init(AudioState *audio) + return 0; + } + ++/* ++ * Emulate the speaker port's refresh clock bit. This is supposed ++ * to toggle between 0 and 1<<4 every 15 microseconds. XXX: We use ++ * gettimeofday() in the real machine instead of a monotonic clock ++ * in the virtual machine, and we are a bit sloppy about the 15 ++ * microseconds. This should be good enough for crude loops that ++ * measure approximate delays by counting how often this line toggles. ++ */ ++static uint32_t pcspk_dummy_refresh_clock(void) ++{ ++ struct timeval tv; ++ ++ gettimeofday(&tv, NULL); ++ return ((tv.tv_sec ^ (tv.tv_usec / 15)) & 1) << 4; ++} ++ + static uint32_t pcspk_ioport_read(void *opaque, uint32_t addr) + { + PCSpkState *s = opaque; + int out; ++ int dummy_refresh_clock; + +- s->dummy_refresh_clock ^= (1 << 4); + out = pit_get_out(s->pit, 2, qemu_get_clock(vm_clock)) << 5; + +- return pit_get_gate(s->pit, 2) | (s->data_on << 1) | s->dummy_refresh_clock | out; ++ return pit_get_gate(s->pit, 2) | (s->data_on << 1) | ++ pcspk_dummy_refresh_clock() | out; + } + + static void pcspk_ioport_write(void *opaque, uint32_t addr, uint32_t val) |