aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2013-01-09 23:50:00 +0200
committerMichael S. Tsirkin <mst@redhat.com>2013-01-30 01:31:08 +0200
commita52a8841038638afe54ffb00e0aca48de0b1539a (patch)
tree1f014504b0c74a00b8546436464469bbdb54fa37
parent0893d46014b0300fb8aec92df94effea34d04b61 (diff)
e1000: document ICS read behaviour
Add code comment to clarify the reason we set ICS with ICR: the reason was previously undocumented and git log confused rather than clarified the comments. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--hw/e1000.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/hw/e1000.c b/hw/e1000.c
index ef06ca1894..ee85c53d38 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -237,7 +237,17 @@ set_interrupt_cause(E1000State *s, int index, uint32_t val)
val |= E1000_ICR_INT_ASSERTED;
}
s->mac_reg[ICR] = val;
+
+ /*
+ * Make sure ICR and ICS registers have the same value.
+ * The spec says that the ICS register is write-only. However in practice,
+ * on real hardware ICS is readable, and for reads it has the same value as
+ * ICR (except that ICS does not have the clear on read behaviour of ICR).
+ *
+ * The VxWorks PRO/1000 driver uses this behaviour.
+ */
s->mac_reg[ICS] = val;
+
qemu_set_irq(s->dev.irq[0], (s->mac_reg[IMS] & s->mac_reg[ICR]) != 0);
}