pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/emulators/qemu Add patches/patch-ba:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6966a71253a2
branches:  trunk
changeset: 536832:6966a71253a2
user:      apb <apb%pkgsrc.org@localhost>
date:      Mon Dec 24 10:18:22 2007 +0000

description:
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:

 emulators/qemu/Makefile         |   3 +-
 emulators/qemu/distinfo         |   3 +-
 emulators/qemu/patches/patch-ba |  47 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 51 insertions(+), 2 deletions(-)

diffs (78 lines):

diff -r e0aeebd29327 -r 6966a71253a2 emulators/qemu/Makefile
--- a/emulators/qemu/Makefile   Mon Dec 24 08:47:53 2007 +0000
+++ b/emulators/qemu/Makefile   Mon Dec 24 10:18:22 2007 +0000
@@ -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 -r e0aeebd29327 -r 6966a71253a2 emulators/qemu/distinfo
--- a/emulators/qemu/distinfo   Mon Dec 24 08:47:53 2007 +0000
+++ b/emulators/qemu/distinfo   Mon Dec 24 10:18:22 2007 +0000
@@ -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-aw) = 3b1472a95a2312f9e49ea1a6aa517ad81328324c
 SHA1 (patch-ax) = 66b060005ecbf9fd0451f7960e81eccbabf959ca
 SHA1 (patch-ay) = 2d3051685878abe077abdbba9681bd04e04c7fb3
+SHA1 (patch-ba) = 7c5043a39405f52b512e479a46fc76108580b7bc
diff -r e0aeebd29327 -r 6966a71253a2 emulators/qemu/patches/patch-ba
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/qemu/patches/patch-ba   Mon Dec 24 10:18:22 2007 +0000
@@ -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)



Home | Main Index | Thread Index | Old Index