[PATCH 0/3] hw/misc/mac_via: Factor generic via_irq_request() out

Philippe Mathieu-Daudé posted 3 patches 3 years, 6 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201013204927.3660030-1-f4bug@amsat.org
hw/misc/mac_via.c | 59 +++++++++++++++--------------------------------
1 file changed, 18 insertions(+), 41 deletions(-)
[PATCH 0/3] hw/misc/mac_via: Factor generic via_irq_request() out
Posted by Philippe Mathieu-Daudé 3 years, 6 months ago
The same logic is used in 4 different places:
- via1_irq_request()
- via2_irq_request()
- via1_VBL()
- via1_one_second()

Extract the common function and reuse it.

Philippe Mathieu-Daudé (3):
  hw/misc/mac_via: Make generic via_irq_request() from
    via1_irq_request()
  hw/misc/mac_via: Replace via2_irq_request() with via_irq_request()
  hw/misc/mac_via: Use via_irq_request() in via1_VBL(),
    via1_one_second()

 hw/misc/mac_via.c | 59 +++++++++++++++--------------------------------
 1 file changed, 18 insertions(+), 41 deletions(-)

-- 
2.26.2

Re: [PATCH 0/3] hw/misc/mac_via: Factor generic via_irq_request() out
Posted by Mark Cave-Ayland 3 years, 6 months ago
On 13/10/2020 21:49, Philippe Mathieu-Daudé wrote:

> The same logic is used in 4 different places:
> - via1_irq_request()
> - via2_irq_request()
> - via1_VBL()
> - via1_one_second()
> 
> Extract the common function and reuse it.
> 
> Philippe Mathieu-Daudé (3):
>    hw/misc/mac_via: Make generic via_irq_request() from
>      via1_irq_request()
>    hw/misc/mac_via: Replace via2_irq_request() with via_irq_request()
>    hw/misc/mac_via: Use via_irq_request() in via1_VBL(),
>      via1_one_second()
> 
>   hw/misc/mac_via.c | 59 +++++++++++++++--------------------------------
>   1 file changed, 18 insertions(+), 41 deletions(-)

Whilst I can see the advantage of consolidating the logic in via_irq_request(), I'd 
still like to keep the above 4 functions as wrappers for now since they are a great 
aid with current work debugging Linux and MacOS. Perhaps for now the functions above 
could act as thin wrappers on your version of via_irq_request(), or alternatively 
this could be something to revisit once the m68k/q800 emulation has matured further?


ATB,

Mark.