[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH v2 4/4] spapr: Suppress underscores in device tree CPU
From: |
Andreas Färber |
Subject: |
[Qemu-ppc] [PATCH v2 4/4] spapr: Suppress underscores in device tree CPU node |
Date: |
Fri, 16 Aug 2013 00:35:11 +0200 |
PAPR requires that PowerPC,<name> shall not contain underscores, so skip
any underscores in the type name.
Reported-by: Prerna Saxena <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
hw/ppc/spapr.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 0e9be32..137e060 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -264,7 +264,7 @@ static void *spapr_create_fdt_skel(hwaddr initrd_base,
char qemu_hypertas_prop[] = "hcall-memop1";
uint32_t refpoints[] = {cpu_to_be32(0x4), cpu_to_be32(0x4)};
uint32_t interrupt_server_ranges_prop[] = {0, cpu_to_be32(smp_cpus)};
- int i, smt = kvmppc_smt_threads();
+ int i, j, smt = kvmppc_smt_threads();
unsigned char vec5[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x80};
fdt = g_malloc0(FDT_MAX_SIZE);
@@ -350,6 +350,17 @@ static void *spapr_create_fdt_skel(hwaddr initrd_base,
}
nodename = g_strndup(typename,
strlen(typename) - strlen("-"
TYPE_POWERPC_CPU));
+ for (i = j = 0; j < strlen(nodename); i++, j++) {
+ if (nodename[j] == '_') {
+ j++;
+ }
+ if (j > i) {
+ nodename[i] = nodename[j];
+ }
+ }
+ if (j > i) {
+ nodename[i] = '\0';
+ }
dc->fw_name = g_strdup_printf("PowerPC,%s", nodename);
g_free(nodename);
}
--
1.8.1.4
- [Qemu-ppc] [PATCH v2 0/4] target-ppc: Tidy sPAPR device tree CPU nodes, Andreas Färber, 2013/08/15
- [Qemu-ppc] [PATCH v2 1/4] target-ppc: Fill in OpenFirmware names for some PowerPCCPU families, Andreas Färber, 2013/08/15
- [Qemu-ppc] [PATCH v2 3/4] spapr: Improve device tree CPU node for -cpu host with unknown OF name, Andreas Färber, 2013/08/15
- [Qemu-ppc] [PATCH v2 4/4] spapr: Suppress underscores in device tree CPU node,
Andreas Färber <=
- [Qemu-ppc] [PATCH v2 2/4] spapr: Use DeviceClass::fw_name for device tree CPU node, Andreas Färber, 2013/08/15
- Re: [Qemu-ppc] [Qemu-devel] [PATCH v2 2/4] spapr: Use DeviceClass::fw_name for device tree CPU node, Alexey Kardashevskiy, 2013/08/29
- Re: [Qemu-ppc] [Qemu-devel] [PATCH v2 2/4] spapr: Use DeviceClass::fw_name for device tree CPU node, Andreas Färber, 2013/08/29
- Re: [Qemu-ppc] [Qemu-devel] [PATCH v2 2/4] spapr: Use DeviceClass::fw_name for device tree CPU node, Alexey Kardashevskiy, 2013/08/30
- Re: [Qemu-ppc] [Qemu-devel] [PATCH v2 2/4] spapr: Use DeviceClass::fw_name for device tree CPU node, Alexander Graf, 2013/08/30
- Re: [Qemu-ppc] [Qemu-devel] [PATCH v2 2/4] spapr: Use DeviceClass::fw_name for device tree CPU node, Andreas Färber, 2013/08/30
- Re: [Qemu-ppc] [Qemu-devel] [PATCH v2 2/4] spapr: Use DeviceClass::fw_name for device tree CPU node, Alexander Graf, 2013/08/30
Re: [Qemu-ppc] [PATCH v2 2/4] spapr: Use DeviceClass::fw_name for device tree CPU node, Alexander Graf, 2013/08/30