On 28/04/2021 01:11, Richard Henderson wrote:
On 4/27/21 12:26 PM, Philippe Mathieu-Daudé wrote:
When building only the leon3 machine, we get this link failure:
/usr/bin/ld: target_sparc_win_helper.c.o: in function `cpu_put_psr':
target/sparc/win_helper.c:91: undefined reference to `cpu_check_irqs'
This is because cpu_check_irqs() is defined in hw/sparc/sun4m.c,
which is only built if the base sun4m machines are built (with
the CONFIG_SUN4M selector).
Fix by moving cpu_check_irqs() out of hw/sparc/sun4m.c and build
it unconditionally.
Signed-off-by: Philippe Mathieu-Daudé<f4...@amsat.org>
---
hw/sparc/irq.c | 61 ++++++++++++++++++++++++++++++++++++++++++++
hw/sparc/sun4m.c | 32 -----------------------
hw/sparc/meson.build | 1 +
3 files changed, 62 insertions(+), 32 deletions(-)
create mode 100644 hw/sparc/irq.c
I think this code should be in target/sparc/. There doesn't seem to be any reference
to anything outside CPUSPARCState.
I suspect that this is based upon the existing precedent set by SPARC64 where the IRQ
routines are stored in hw/sparc64/sparc64.c. I'd lean towards the current approach
for now so that both 32-bit and 64-bit could be moved into target/sparc as a separate
exercise for consistency.
ATB,
Mark.