[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 07/23] i8259: Move pic_set_irq1 after pic_update_
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH v2 07/23] i8259: Move pic_set_irq1 after pic_update_irq |
Date: |
Fri, 7 Oct 2011 09:19:40 +0200 |
We are about to call the latter from the former. No functional changes.
Signed-off-by: Jan Kiszka <address@hidden>
---
hw/i8259.c | 55 +++++++++++++++++++++++++++++--------------------------
1 files changed, 29 insertions(+), 26 deletions(-)
diff --git a/hw/i8259.c b/hw/i8259.c
index f1d58ba..de2d5ca 100644
--- a/hw/i8259.c
+++ b/hw/i8259.c
@@ -79,32 +79,6 @@ static uint64_t irq_count[16];
#endif
PicState2 *isa_pic;
-/* set irq level. If an edge is detected, then the IRR is set to 1 */
-static void pic_set_irq1(PicState *s, int irq, int level)
-{
- int mask;
- mask = 1 << irq;
- if (s->elcr & mask) {
- /* level triggered */
- if (level) {
- s->irr |= mask;
- s->last_irr |= mask;
- } else {
- s->irr &= ~mask;
- s->last_irr &= ~mask;
- }
- } else {
- /* edge triggered */
- if (level) {
- if ((s->last_irr & mask) == 0)
- s->irr |= mask;
- s->last_irr |= mask;
- } else {
- s->last_irr &= ~mask;
- }
- }
-}
-
/* return the highest priority found in mask (highest = smallest
number). Return 8 if no irq */
static int get_priority(PicState *s, int mask)
@@ -144,6 +118,8 @@ static int pic_get_irq(PicState *s)
}
}
+static void pic_set_irq1(PicState *s, int irq, int level);
+
/* raise irq to CPU if necessary. must be called every time the active
irq may change */
static void pic_update_irq(PicState2 *s)
@@ -178,6 +154,33 @@ static void pic_update_irq(PicState2 *s)
}
}
+/* set irq level. If an edge is detected, then the IRR is set to 1 */
+static void pic_set_irq1(PicState *s, int irq, int level)
+{
+ int mask;
+ mask = 1 << irq;
+ if (s->elcr & mask) {
+ /* level triggered */
+ if (level) {
+ s->irr |= mask;
+ s->last_irr |= mask;
+ } else {
+ s->irr &= ~mask;
+ s->last_irr &= ~mask;
+ }
+ } else {
+ /* edge triggered */
+ if (level) {
+ if ((s->last_irr & mask) == 0) {
+ s->irr |= mask;
+ }
+ s->last_irr |= mask;
+ } else {
+ s->last_irr &= ~mask;
+ }
+ }
+}
+
#ifdef DEBUG_IRQ_LATENCY
int64_t irq_time[16];
#endif
--
1.7.3.4
- [Qemu-devel] [PATCH v2 00/23] Rework i8259 and PC interrupt models, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 01/23] pc: Drop useless test from isa_irq_handler, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 03/23] pc: Convert GSIState::i8259_irq into array, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 05/23] i8259: Remove premature inline function attributes, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 06/23] i8259: Drop obsolete prototypes, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 04/23] pc: Fix and clean up PIC-to-APIC IRQ path, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 08/23] i8239: Introduce per-PIC output interrupt, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 07/23] i8259: Move pic_set_irq1 after pic_update_irq,
Jan Kiszka <=
- [Qemu-devel] [PATCH v2 11/23] i8259: Update IRQ state after reset, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 10/23] i8259: Reorder intack in pic_read_irq, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 09/23] i8259: Do not update IRQ output after spurious pic_poll_read, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 13/23] i8259: Switch to per-PIC IRQ update, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 15/23] i8259: Clean up pic_ioport_read, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 14/23] i8259: Fix poll command, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 17/23] i8259: Replace PicState::pics_state with master flag, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 12/23] i8259: Clear ELCR on reset, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 02/23] pc: Generalize ISA IRQs to GSIs, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 19/23] qdev: Add HEX8 property, Jan Kiszka, 2011/10/07