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 13ce9863b7SCédric Le Goater #include "qemu/error-report.h" 14fcf5ef2aSThomas Huth #include "target/ppc/cpu-qom.h" 153654fa95SCédric Le Goater 167804c353SCédric Le Goater #define _FDT(exp) \ 177804c353SCédric Le Goater do { \ 18*90231ce1SCédric Le Goater int _ret = (exp); \ 19*90231ce1SCédric Le Goater if (_ret < 0) { \ 20ce9863b7SCédric Le Goater error_report("error creating device tree: %s: %s", \ 21*90231ce1SCédric Le Goater #exp, fdt_strerror(_ret)); \ 227804c353SCédric Le Goater exit(1); \ 237804c353SCédric Le Goater } \ 247804c353SCédric Le Goater } while (0) 257804c353SCédric Le Goater 26644a2c99SDavid Gibson size_t ppc_create_page_sizes_prop(PowerPCCPU *cpu, uint32_t *prop, 273654fa95SCédric Le Goater size_t maxsize); 283654fa95SCédric Le Goater 297804c353SCédric Le Goater #endif /* PPC_FDT_H */ 30