xref: /openbmc/qemu/include/hw/ppc/fdt.h (revision 59351d9b40b1de0fb77e1ff3e53faa04c995c707)
1 /*
2  * QEMU PowerPC helper routines for the device tree.
3  *
4  * Copyright (C) 2016 IBM Corp.
5  *
6  * This code is licensed under the GPL version 2 or later. See the
7  * COPYING file in the top-level directory.
8  */
9 
10 #ifndef PPC_FDT_H
11 #define PPC_FDT_H
12 
13 #include "qemu/error-report.h"
14 
15 typedef struct CPUPPCState CPUPPCState;
16 
17 #define _FDT(exp)                                                  \
18     do {                                                           \
19         int ret = (exp);                                           \
20         if (ret < 0) {                                             \
21             error_report("error creating device tree: %s: %s",   \
22                     #exp, fdt_strerror(ret));                      \
23             exit(1);                                               \
24         }                                                          \
25     } while (0)
26 
27 size_t ppc_create_page_sizes_prop(CPUPPCState *env, uint32_t *prop,
28                                   size_t maxsize);
29 
30 #endif /* PPC_FDT_H */
31