diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-09-12 15:32:58 +0100 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-09-12 15:32:58 +0100 |
commit | 62916af3ba5007e0a883b735a0d89a87b65170a6 (patch) | |
tree | ae4b94b6023917488edf8461f55dafe2bd89adeb /xen/arch/x86/hvm/i8254.c | |
parent | 59b9df263cdf8b287f1a5d0f1dfd77069195a213 (diff) | |
download | xen-62916af3ba5007e0a883b735a0d89a87b65170a6.tar.gz xen-62916af3ba5007e0a883b735a0d89a87b65170a6.tar.bz2 xen-62916af3ba5007e0a883b735a0d89a87b65170a6.zip |
x86: allow Dom0 to drive PC speaker
as long as Xen doesn't itself make use of PIT channel 2.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/arch/x86/hvm/i8254.c')
-rw-r--r-- | xen/arch/x86/hvm/i8254.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/xen/arch/x86/hvm/i8254.c b/xen/arch/x86/hvm/i8254.c index 2aa3c1a5ba..d10b6ef2ee 100644 --- a/xen/arch/x86/hvm/i8254.c +++ b/xen/arch/x86/hvm/i8254.c @@ -598,11 +598,13 @@ int pv_pit_handler(int port, int data, int write) .size = 1, .type = IOREQ_TYPE_PIO, .addr = port, - .dir = write ? 0 : 1, - .data = write ? data : 0, + .dir = write ? IOREQ_WRITE : IOREQ_READ, + .data = data }; - if ( port == 0x61 ) + if ( (current->domain->domain_id == 0) && dom0_pit_access(&ioreq) ) + /* nothing to do */; + else if ( port == 0x61 ) handle_speaker_io(&ioreq); else handle_pit_io(&ioreq); |