{"id":807630,"url":"http://patchwork.ozlabs.org/api/1.0/patches/807630/?format=json","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/1.0/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<1504099475-241036-2-git-send-email-imammedo@redhat.com>","date":"2017-08-30T13:24:28","name":"[v2,1/8] ppc: replace cpu_ppc_init() with cpu_generic_init()","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"e5a166bf0498d2e10742ec1de07194e57511f4b3","submitter":{"id":11305,"url":"http://patchwork.ozlabs.org/api/1.0/people/11305/?format=json","name":"Igor Mammedov","email":"imammedo@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/1504099475-241036-2-git-send-email-imammedo@redhat.com/mbox/","series":[{"id":612,"url":"http://patchwork.ozlabs.org/api/1.0/series/612/?format=json","date":"2017-08-30T13:24:29","name":"ppc: cpu_model handling cleanups","version":2,"mbox":"http://patchwork.ozlabs.org/series/612/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/807630/checks/","tags":{},"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=imammedo@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xj5q366j2z9sN7\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 23:25:35 +1000 (AEST)","from localhost ([::1]:50564 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dn2zt-0001rY-II\n\tfor incoming@patchwork.ozlabs.org; Wed, 30 Aug 2017 09:25:33 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:50915)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <imammedo@redhat.com>) id 1dn2z5-0001oe-Hy\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 09:24:49 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <imammedo@redhat.com>) id 1dn2z2-0003VM-AB\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 09:24:43 -0400","from mx1.redhat.com ([209.132.183.28]:46570)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <imammedo@redhat.com>)\n\tid 1dn2z2-0003Tv-0g; Wed, 30 Aug 2017 09:24:40 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 07ACA7EA93;\n\tWed, 30 Aug 2017 13:24:39 +0000 (UTC)","from dell-r430-03.lab.eng.brq.redhat.com\n\t(dell-r430-03.lab.eng.brq.redhat.com [10.34.112.60])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 083E59B518;\n\tWed, 30 Aug 2017 13:24:37 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 07ACA7EA93","From":"Igor Mammedov <imammedo@redhat.com>","To":"qemu-devel@nongnu.org","Date":"Wed, 30 Aug 2017 15:24:28 +0200","Message-Id":"<1504099475-241036-2-git-send-email-imammedo@redhat.com>","In-Reply-To":"<1504099475-241036-1-git-send-email-imammedo@redhat.com>","References":"<1504099475-241036-1-git-send-email-imammedo@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.28]);\n\tWed, 30 Aug 2017 13:24:39 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"[Qemu-devel] [PATCH v2 1/8] ppc: replace cpu_ppc_init() with\n\tcpu_generic_init()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"qemu-ppc@nongnu.org, Alexander Graf <agraf@suse.de>,\n\tDavid Gibson <david@gibson.dropbear.id.au>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"},"content":"it's just a wrapper, drop it and use cpu_generic_init() directly\n\nSigned-off-by: Igor Mammedov <imammedo@redhat.com>\nAcked-by: David Gibson <david@gibson.dropbear.id.au>\nReviewed-by: Hervé Poussineau <hpoussin@reactos.org>\nReviewed-by: Eduardo Habkost <ehabkost@redhat.com>\n---\n target/ppc/cpu.h            | 3 +--\n hw/ppc/e500.c               | 3 ++-\n hw/ppc/mac_newworld.c       | 3 ++-\n hw/ppc/mac_oldworld.c       | 3 ++-\n hw/ppc/ppc440_bamboo.c      | 2 +-\n hw/ppc/ppc4xx_devs.c        | 2 +-\n hw/ppc/prep.c               | 5 +++--\n hw/ppc/virtex_ml507.c       | 2 +-\n target/ppc/translate_init.c | 5 -----\n 9 files changed, 13 insertions(+), 15 deletions(-)","diff":"diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h\nindex 46d3dd8..12f0949 100644\n--- a/target/ppc/cpu.h\n+++ b/target/ppc/cpu.h\n@@ -1276,7 +1276,6 @@ extern const struct VMStateDescription vmstate_ppc_cpu;\n #endif\n \n /*****************************************************************************/\n-PowerPCCPU *cpu_ppc_init(const char *cpu_model);\n void ppc_translate_init(void);\n const char *ppc_cpu_lookup_alias(const char *alias);\n /* you can call this signal handler from your SIGBUS and SIGSEGV\n@@ -1353,7 +1352,7 @@ static inline uint64_t ppc_dump_gpr(CPUPPCState *env, int gprn)\n int ppc_dcr_read (ppc_dcr_t *dcr_env, int dcrn, uint32_t *valp);\n int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, uint32_t val);\n \n-#define cpu_init(cpu_model) CPU(cpu_ppc_init(cpu_model))\n+#define cpu_init(cpu_model) cpu_generic_init(TYPE_POWERPC_CPU, cpu_model)\n \n #define cpu_signal_handler cpu_ppc_signal_handler\n #define cpu_list ppc_cpu_list\ndiff --git a/hw/ppc/e500.c b/hw/ppc/e500.c\nindex 62f1857..f0596f3 100644\n--- a/hw/ppc/e500.c\n+++ b/hw/ppc/e500.c\n@@ -819,7 +819,8 @@ void ppce500_init(MachineState *machine, PPCE500Params *params)\n         CPUState *cs;\n         qemu_irq *input;\n \n-        cpu = cpu_ppc_init(machine->cpu_model);\n+        cpu = POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU,\n+                                           machine->cpu_model));\n         if (cpu == NULL) {\n             fprintf(stderr, \"Unable to initialize CPU!\\n\");\n             exit(1);\ndiff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c\nindex 3056d5f..d466634 100644\n--- a/hw/ppc/mac_newworld.c\n+++ b/hw/ppc/mac_newworld.c\n@@ -187,7 +187,8 @@ static void ppc_core99_init(MachineState *machine)\n #endif\n     }\n     for (i = 0; i < smp_cpus; i++) {\n-        cpu = cpu_ppc_init(machine->cpu_model);\n+        cpu = POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU,\n+                                           machine->cpu_model));\n         if (cpu == NULL) {\n             fprintf(stderr, \"Unable to find PowerPC CPU definition\\n\");\n             exit(1);\ndiff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c\nindex f2ae60a..fcac399 100644\n--- a/hw/ppc/mac_oldworld.c\n+++ b/hw/ppc/mac_oldworld.c\n@@ -116,7 +116,8 @@ static void ppc_heathrow_init(MachineState *machine)\n     if (machine->cpu_model == NULL)\n         machine->cpu_model = \"G3\";\n     for (i = 0; i < smp_cpus; i++) {\n-        cpu = cpu_ppc_init(machine->cpu_model);\n+        cpu = POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU,\n+                                           machine->cpu_model));\n         if (cpu == NULL) {\n             fprintf(stderr, \"Unable to find PowerPC CPU definition\\n\");\n             exit(1);\ndiff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c\nindex 9d997bf..ca26398 100644\n--- a/hw/ppc/ppc440_bamboo.c\n+++ b/hw/ppc/ppc440_bamboo.c\n@@ -186,7 +186,7 @@ static void bamboo_init(MachineState *machine)\n     if (machine->cpu_model == NULL) {\n         machine->cpu_model = \"440EP\";\n     }\n-    cpu = cpu_ppc_init(machine->cpu_model);\n+    cpu = POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU, machine->cpu_model));\n     if (cpu == NULL) {\n         fprintf(stderr, \"Unable to initialize CPU!\\n\");\n         exit(1);\ndiff --git a/hw/ppc/ppc4xx_devs.c b/hw/ppc/ppc4xx_devs.c\nindex e7f413e..6b38ed7 100644\n--- a/hw/ppc/ppc4xx_devs.c\n+++ b/hw/ppc/ppc4xx_devs.c\n@@ -56,7 +56,7 @@ PowerPCCPU *ppc4xx_init(const char *cpu_model,\n     CPUPPCState *env;\n \n     /* init CPUs */\n-    cpu = cpu_ppc_init(cpu_model);\n+    cpu = POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU, cpu_model));\n     if (cpu == NULL) {\n         fprintf(stderr, \"Unable to find PowerPC %s CPU definition\\n\",\n                 cpu_model);\ndiff --git a/hw/ppc/prep.c b/hw/ppc/prep.c\nindex 36d3dcd..00f3321 100644\n--- a/hw/ppc/prep.c\n+++ b/hw/ppc/prep.c\n@@ -520,7 +520,8 @@ static void ppc_prep_init(MachineState *machine)\n     if (machine->cpu_model == NULL)\n         machine->cpu_model = \"602\";\n     for (i = 0; i < smp_cpus; i++) {\n-        cpu = cpu_ppc_init(machine->cpu_model);\n+        cpu = POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU,\n+                                           machine->cpu_model));\n         if (cpu == NULL) {\n             fprintf(stderr, \"Unable to find PowerPC CPU definition\\n\");\n             exit(1);\n@@ -724,7 +725,7 @@ static void ibm_40p_init(MachineState *machine)\n     if (!machine->cpu_model) {\n         machine->cpu_model = \"604\";\n     }\n-    cpu = cpu_ppc_init(machine->cpu_model);\n+    cpu = POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU, machine->cpu_model));\n     if (!cpu) {\n         error_report(\"could not initialize CPU '%s'\",\n                      machine->cpu_model);\ndiff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c\nindex fdbcf22..d5fdc16 100644\n--- a/hw/ppc/virtex_ml507.c\n+++ b/hw/ppc/virtex_ml507.c\n@@ -96,7 +96,7 @@ static PowerPCCPU *ppc440_init_xilinx(ram_addr_t *ram_size,\n     CPUPPCState *env;\n     qemu_irq *irqs;\n \n-    cpu = cpu_ppc_init(cpu_model);\n+    cpu = POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU, cpu_model));\n     if (cpu == NULL) {\n         fprintf(stderr, \"Unable to initialize CPU!\\n\");\n         exit(1);\ndiff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c\nindex 8fb407e..43be9a8 100644\n--- a/target/ppc/translate_init.c\n+++ b/target/ppc/translate_init.c\n@@ -10271,11 +10271,6 @@ const char *ppc_cpu_lookup_alias(const char *alias)\n     return NULL;\n }\n \n-PowerPCCPU *cpu_ppc_init(const char *cpu_model)\n-{\n-    return POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU, cpu_model));\n-}\n-\n PowerPCCPUClass *ppc_cpu_get_family_class(PowerPCCPUClass *pcc)\n {\n     ObjectClass *oc = OBJECT_CLASS(pcc);\n","prefixes":["v2","1/8"]}