56#include "libfdt_internal.h"
62#define FDT_ERRTABENT(val) \
63 [(val)] = { .str = #val, }
66 FDT_ERRTABENT (FDT_ERR_NOTFOUND),
67 FDT_ERRTABENT (FDT_ERR_EXISTS),
68 FDT_ERRTABENT (FDT_ERR_NOSPACE),
70 FDT_ERRTABENT (FDT_ERR_BADOFFSET),
71 FDT_ERRTABENT (FDT_ERR_BADPATH),
72 FDT_ERRTABENT (FDT_ERR_BADPHANDLE),
73 FDT_ERRTABENT (FDT_ERR_BADSTATE),
75 FDT_ERRTABENT (FDT_ERR_TRUNCATED),
76 FDT_ERRTABENT (FDT_ERR_BADMAGIC),
77 FDT_ERRTABENT (FDT_ERR_BADVERSION),
78 FDT_ERRTABENT (FDT_ERR_BADSTRUCTURE),
79 FDT_ERRTABENT (FDT_ERR_BADLAYOUT),
80 FDT_ERRTABENT (FDT_ERR_INTERNAL),
81 FDT_ERRTABENT (FDT_ERR_BADNCELLS),
82 FDT_ERRTABENT (FDT_ERR_BADVALUE),
83 FDT_ERRTABENT (FDT_ERR_BADOVERLAY),
84 FDT_ERRTABENT (FDT_ERR_NOPHANDLES),
86#define FDT_ERRTABSIZE (sizeof(fdt_errtable) / sizeof(fdt_errtable[0]))
94 return "<valid offset/length>";
95 }
else if (errval == 0) {
97 }
else if (errval > -FDT_ERRTABSIZE) {
98 const char *s = fdt_errtable[-errval].str;
105 return "<unknown error>";