target-openrisc hw/openrisc: Some OpenRISC fix.
v4 cover target-openrisc hw/openrisc: Some OpenRISC fix.
Fix OpenRISC CPU and sim broad.
We should free typename in openrisc_cpu_class_by_name, and we should use stderr output in openrisc_sim.c.
Updates from V4:
* Remove a not needed patch.
Updates from V3:
* Replace a typo fix using a stderr fix.
Updates from V2:
* Combine typo patchset and typename free.
Jia Liu (3):
hw/openrisc: Indent typo
hw/openrisc: Use stderr output instead of qemu_log
target-openrisc: Free typename in openrisc_cpu_class_by_name
hw/openrisc/openrisc_sim.c | 6 +++--- target-openrisc/cpu.c | 1 + 2 files changed, 4 insertions(+), 3 deletions(-)
Signature · 1 line
1.7.12.4 (Apple Git-37)
PATCH v4 1/3 hw/openrisc: Indent typo
Indent typo.
--- hw/openrisc/openrisc_sim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/openrisc/openrisc_sim.c +1 -1
@@ -96,7 +96,7 @@ static void openrisc_sim_init(QEMUMachineInitArgs *args)ram_addr_t ram_size = args->ram_size;const char *cpu_model = args->cpu_model;const char *kernel_filename = args->kernel_filename; -OpenRISCCPU *cpu =NULL ; +OpenRISCCPU *cpu =NULL ;MemoryRegion *ram;int n;
Signature · 1 line
1.7.12.4 (Apple Git-37)
PATCH v4 2/3 hw/openrisc: Use stderr output instead of qemu_log
In reply to Jia LiuWe should use stderr output instead of qemu_log in order to output ErrMsg onto the screen.
--- hw/openrisc/openrisc_sim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/openrisc/openrisc_sim.c +2 -2
@@ -82,7 +82,7 @@ static void cpu_openrisc_load_kernel(ram_addr_t ram_size, }if (kernel_size <0 ) { -qemu_log ("QEMU: couldn't load the kernel '%s'\n" , +fprintf (stderr,"QEMU: couldn't load the kernel '%s'\n" , kernel_filename);exit (1 ); }
@@ -107,7 +107,7 @@ static void openrisc_sim_init(QEMUMachineInitArgs *args)for (n =0 ; n < smp_cpus; n++) { cpu =cpu_openrisc_init (cpu_model);if (cpu ==NULL ) { -qemu_log ("Unable to find CPU definition!\n" ); +fprintf (stderr,"Unable to find CPU definition!\n" );exit (1 ); }qemu_register_reset (main_cpu_reset, cpu);
Signature · 1 line
1.7.12.4 (Apple Git-37)
PATCH v4 3/3 target-openrisc: Free typename in openrisc_cpu_class_by_name
In reply to Jia LiuWe should free typename here.
--- target-openrisc/cpu.c | 1 + 1 file changed, 1 insertion(+)
target-openrisc/cpu.c +1 -0
@@ -99,6 +99,7 @@ static ObjectClass *openrisc_cpu_class_by_name(const char *cpu_model) typename =g_strdup_printf ("%s-" TYPE_OPENRISC_CPU , cpu_model); oc =object_class_by_name (typename); +g_free (typename);if (oc !=NULL && (!object_class_dynamic_cast (oc,TYPE_OPENRISC_CPU ) ||object_class_is_abstract (oc))) {return NULL ;
Signature · 1 line
1.7.12.4 (Apple Git-37)
Am 22.07.2013 12:30, schrieb Jia Liu:
Quoted 4 lines
Jia Liu (3):
hw/openrisc: Indent typo
hw/openrisc: Use stderr output instead ofqemu_log
target-openrisc: Free typename inopenrisc_cpu_class_by_name
Remainder of v4 series:
Andreas
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg