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: Laurent Vivier
Subject: Re: [PATCH 6/8] q800: route SONIC on-board Ethernet IRQ via nubus IRQ 9 in classic mode
Date: Sat, 16 Oct 2021 20:08:48 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

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.)

Thanks,
Laurent



reply via email to

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