xref: /qemu/include/hw/ppc/fdt.h (revision ce9863b7978976492efc2b57589516f3fcae79cb)
17804c353SCédric Le Goater /*
27804c353SCédric Le Goater  * QEMU PowerPC helper routines for the device tree.
37804c353SCédric Le Goater  *
47804c353SCédric Le Goater  * Copyright (C) 2016 IBM Corp.
57804c353SCédric Le Goater  *
67804c353SCédric Le Goater  * This code is licensed under the GPL version 2 or later. See the
77804c353SCédric Le Goater  * COPYING file in the top-level directory.
87804c353SCédric Le Goater  */
97804c353SCédric Le Goater 
107804c353SCédric Le Goater #ifndef PPC_FDT_H
117804c353SCédric Le Goater #define PPC_FDT_H
127804c353SCédric Le Goater 
13*ce9863b7SCédric Le Goater #include "qemu/error-report.h"
14*ce9863b7SCédric Le Goater 
157804c353SCédric Le Goater #define _FDT(exp)                                                  \
167804c353SCédric Le Goater     do {                                                           \
177804c353SCédric Le Goater         int ret = (exp);                                           \
187804c353SCédric Le Goater         if (ret < 0) {                                             \
19*ce9863b7SCédric Le Goater             error_report("error creating device tree: %s: %s",   \
207804c353SCédric Le Goater                     #exp, fdt_strerror(ret));                      \
217804c353SCédric Le Goater             exit(1);                                               \
227804c353SCédric Le Goater         }                                                          \
237804c353SCédric Le Goater     } while (0)
247804c353SCédric Le Goater 
257804c353SCédric Le Goater #endif /* PPC_FDT_H */
26