From 7804c353a9f93c3eeb3eb744ee4c962fd34bc760 Mon Sep 17 00:00:00 2001 From: Cédric Le Goater Date: Mon, 25 Jul 2016 16:24:41 +0200 Subject: hw/ppc: include fdt helper routine in a common file spapr_pci would also be a good candidate but the macro _FDT is slightly different. It returns and does not exit. Signed-off-by: Cédric Le Goater Signed-off-by: David Gibson --- include/hw/ppc/fdt.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 include/hw/ppc/fdt.h (limited to 'include') diff --git a/include/hw/ppc/fdt.h b/include/hw/ppc/fdt.h new file mode 100644 index 0000000000..fff3e1b577 --- /dev/null +++ b/include/hw/ppc/fdt.h @@ -0,0 +1,23 @@ +/* + * QEMU PowerPC helper routines for the device tree. + * + * Copyright (C) 2016 IBM Corp. + * + * This code is licensed under the GPL version 2 or later. See the + * COPYING file in the top-level directory. + */ + +#ifndef PPC_FDT_H +#define PPC_FDT_H + +#define _FDT(exp) \ + do { \ + int ret = (exp); \ + if (ret < 0) { \ + fprintf(stderr, "qemu: error creating device tree: %s: %s\n", \ + #exp, fdt_strerror(ret)); \ + exit(1); \ + } \ + } while (0) + +#endif /* PPC_FDT_H */ -- cgit v1.2.3-55-g7522