Skip to contentSkip to conversation

OpenRISC patch queue

GIT PULL Jia Liu 1 participant 4 messages Jul 23, 2013

lore
Share & tools
lore

Jia Liu

author
#0 lore raw

Hi Anthony,

This is my OpenRISC patch queue, and myfirst time to send a pull requests, please pull.

It fix OpenRISC CPU and sim broad:
* Free typename in openrisc_cpu_class_by_name
* Use stderr output in openrisc_sim.c
* fixed a indent typo.

The following changes since commit 3464700f6aecb3e2aa9098839d90672d6b3fa974:

tests: Add test-bitops.c with some sextract tests (2013-07-22 15:41:49 -0500)

are available in the git repository at:

git://github.com/J-Liu/qemu.git or32

for you to fetch changes up to 9b146e9a28bbd9567f5ac6a8e2bcb543aa3b9392:

target-openrisc: Free typename in openrisc_cpu_class_by_name (2013-07-23 18:32:30 +0800)

----------------------------------------------------------------
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(-)
author
#1 lore raw

[Qemu-devel] [PULL 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
index 924438b..250f5b5 100644
@@ -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)
author
#2 lore raw

[Qemu-devel] [PULL 3/3] target-openrisc: Free typename in openrisc_cpu_class_by_name

In reply to Jia Liu

We should free typename here.

---
 target-openrisc/cpu.c | 1 +
 1 file changed, 1 insertion(+)
target-openrisc/cpu.c +1 -0
index 6d40f1b..e348df0 100644
@@ -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)
author
#3 lore raw

[Qemu-devel] [PULL 2/3] hw/openrisc: Use stderr output instead of qemu_log

In reply to Jia Liu

We 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
index 250f5b5..a08f27c 100644
@@ -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)