diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-11-10 10:31:29 +0000 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-11-10 10:31:29 +0000 |
commit | b6ed0a603f5a91fb61fe37ef52d178cdc607eb19 (patch) | |
tree | 538f56f3bbb2774b7248eb779b90ab46679c6d5f /xen/arch/x86/hvm/vioapic.c | |
parent | 74e1fab6015b584312eb850b7d55b1378f19c6ce (diff) | |
download | xen-b6ed0a603f5a91fb61fe37ef52d178cdc607eb19.tar.gz xen-b6ed0a603f5a91fb61fe37ef52d178cdc607eb19.tar.bz2 xen-b6ed0a603f5a91fb61fe37ef52d178cdc607eb19.zip |
[HVM] Remove a duplicated range checking in vioapic_set_irq.
Since irq range checking has already been done at the
beginning of this function.
Signed-off-by: Xin Li <xin.b.li@intel.com>
Diffstat (limited to 'xen/arch/x86/hvm/vioapic.c')
-rw-r--r-- | xen/arch/x86/hvm/vioapic.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c index 9eae82f40a..dc7f29d820 100644 --- a/xen/arch/x86/hvm/vioapic.c +++ b/xen/arch/x86/hvm/vioapic.c @@ -504,6 +504,7 @@ void vioapic_set_xen_irq(struct domain *d, int irq, int level) void vioapic_set_irq(struct domain *d, int irq, int level) { struct vioapic *vioapic = domain_vioapic(d); + uint32_t bit; HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "ioapic_set_irq " "irq %x level %x\n", irq, level); @@ -528,22 +529,19 @@ void vioapic_set_irq(struct domain *d, int irq, int level) vioapic->redirtbl[irq].fields.mask, vioapic->redirtbl[irq].fields.dest_id); - if ( (irq >= 0) && (irq < VIOAPIC_NUM_PINS) ) + bit = 1 << irq; + if ( vioapic->redirtbl[irq].fields.trig_mode == VIOAPIC_LEVEL_TRIG ) { - uint32_t bit = 1 << irq; - if ( vioapic->redirtbl[irq].fields.trig_mode == VIOAPIC_LEVEL_TRIG ) - { - if ( level ) - vioapic->irr |= bit; - else - vioapic->irr &= ~bit; - } + if ( level ) + vioapic->irr |= bit; else - { - if ( level ) - /* XXX No irr clear for edge interrupt */ - vioapic->irr |= bit; - } + vioapic->irr &= ~bit; + } + else + { + if ( level ) + /* XXX No irr clear for edge interrupt */ + vioapic->irr |= bit; } service_ioapic(vioapic); |