hw/sparc/leon3: Minor cleanups
cover hw/sparc/leon3: Minor cleanups
Minor cleanups noticed while reviewing Clément series:
https://lore.kernel.org/qemu-devel/[email protected]/
Philippe Mathieu-Daudé (2):
target/sparc: Provide hint about CPUSPARCState::irq_manager member hw/sparc/leon3: Remove duplicated code
target/sparc/cpu.h | 5 ++--- hw/sparc/leon3.c | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-)
Signature · 1 line
2.41.0
PATCH 1/2 target/sparc: Provide hint about CPUSPARCState::irq_manager member
CPUSPARCState::irq_manager holds a pointer to a QDev, so declare it as DeviceState instead of void.
Move the comment about Leon3 fields.
--- target/sparc/cpu.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
target/sparc/cpu.h +2 -3
@@ -548,10 +548,9 @@ struct CPUArchState {#endif sparc_def_t def; -void *irq_manager; +/* Leon3 */ +DeviceState *irq_manager;void (*qemu_irq_ack)(CPUSPARCState *env,int intno); - -/* Leon3 cache control */ uint32_t cache_control; };
Signature · 1 line
2.41.0
Re: [PATCH 1/2] target/sparc: Provide hint about CPUSPARCState::irq_manager member
Quoted 10 lines · Philippe Mathieu-Daudé
CPUSPARCState::irq_managerholds a pointer to a QDev, so declare it as DeviceState instead of void.Move the comment about Leon3 fields.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/sparc/cpu.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
Quoted 20 lines
target/sparc/cpu.h +2
-4@@ -548,10 +548,9 @@ struct CPUArchState {#endif sparc_def_t def; -void *irq_manager; +/* Leon3 */ +DeviceState *irq_manager;void (*qemu_irq_ack)(CPUSPARCState *env,int intno); - -/* Leon3 cache control */ uint32_t cache_control; }; --2.41.0
PATCH 2/2 hw/sparc/leon3: Remove duplicated code
In reply to Philippe Mathieu-DaudéSince commit b04d989054 ("SPARC: Emulation of Leon3") the main_cpu_reset() handler sets both pc/npc when the CPU is reset, after the machine is realized. It is pointless to set it in leon3_generic_hw_init().
--- hw/sparc/leon3.c | 2 -- 1 file changed, 2 deletions(-)
hw/sparc/leon3.c +0 -2
@@ -343,8 +343,6 @@ static void leon3_generic_hw_init(MachineState *machine) bootloader_entry =memory_region_get_ram_ptr (prom);write_bootloader (env, bootloader_entry, entry); - env->pc =LEON3_PROM_OFFSET ; - env->npc =LEON3_PROM_OFFSET +4 ; reset_info->entry =LEON3_PROM_OFFSET ; } }
Signature · 1 line
2.41.0
Re: [PATCH 2/2] hw/sparc/leon3: Remove duplicated code
Quoted 10 lines · Philippe Mathieu-Daudé
Since commit
b04d989054("SPARC: Emulation of Leon3") themain_cpu_reset()handler sets both pc/npc when the CPU is reset, after the machine is realized. It is pointless to set it inleon3_generic_hw_init().Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/sparc/leon3.c | 2 -- 1 file changed, 2 deletions(-)
Thanks for those cleanups !
Quoted 16 lines
hw/sparc/leon3.c +0
-3@@ -343,8 +343,6 @@ static void leon3_generic_hw_init(MachineState *machine) bootloader_entry =memory_region_get_ram_ptr (prom);write_bootloader (env, bootloader_entry, entry); - env->pc =LEON3_PROM_OFFSET ; - env->npc =LEON3_PROM_OFFSET +4 ; reset_info->entry =LEON3_PROM_OFFSET ; } } --2.41.0
Quoted 6 lines · Philippe Mathieu-Daudé
Minor cleanups noticed while reviewing Clément series:
https://lore.kernel.org/qemu-devel/[email protected]/Philippe Mathieu-Daudé (2):
target/sparc: Provide hint aboutCPUSPARCState::irq_managermember hw/sparc/leon3: Remove duplicated code
Series queued.