qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 6/8] q800: route SONIC on-board Ethernet IRQ via nubus IRQ 9


From: Mark Cave-Ayland
Subject: Re: [PATCH 6/8] q800: route SONIC on-board Ethernet IRQ via nubus IRQ 9 in classic mode
Date: Sun, 17 Oct 2021 11:07:36 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0

On 16/10/2021 19:08, Laurent Vivier wrote:

Le 13/10/2021 à 23:21, Mark Cave-Ayland a écrit :
When the hardware is operating in classic mode the SONIC on-board Ethernet IRQ 
is
routed to nubus IRQ 9 instead of directly to the CPU at level 3. This does not
affect the framebuffer which although it exists in slot 9, has its own
dedicated IRQ on the Quadra 800 hardware.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
  hw/m68k/q800.c | 57 ++++++++++++++++++++++++++++++++++++++++----------
  1 file changed, 46 insertions(+), 11 deletions(-)

diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
index 0093872d89..d55e6a7541 100644
--- a/hw/m68k/q800.c
+++ b/hw/m68k/q800.c
@@ -101,6 +101,7 @@ struct GLUEState {
      M68kCPU *cpu;
      uint8_t ipr;
      uint8_t auxmode;
+    qemu_irq irqs[1];
  };
#define GLUE_IRQ_IN_VIA1 0
@@ -108,27 +109,50 @@ struct GLUEState {
  #define GLUE_IRQ_IN_SONIC      2
  #define GLUE_IRQ_IN_ESCC       3
+#define GLUE_IRQ_NUBUS_9 0
+
  static void GLUE_set_irq(void *opaque, int irq, int level)
  {
      GLUEState *s = opaque;
      int i;
- switch (irq) {
-    case GLUE_IRQ_IN_VIA1:
-        irq = 5;
-        break;
+    switch (s->auxmode) {
+    case 0:

why don't you use "if () {} else {}" rather than "switch() { case 0: ; case 1: 
}" ?
(I don't think we need to manage a "default:" case.)

Sure, I can do that: I used the switch()/default originally to make sure the irq wasn't being set to an unexpected value.

I've also just spotted that the comment in this patch is incorrect:

    /*
     * Since the framebuffer in slot 0x9 uses a separate IRQ, wire the unused
     * IRQ via GLUE for use by SONIC Ethernet in A/UX mode
     */

This should be classic mode, of course.


ATB,

Mark.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]