diff options
author | David Gibson <dgibson@sneetch.(none)> | 2005-06-16 17:04:00 +1000 |
---|---|---|
committer | David Gibson <dgibson@sneetch.(none)> | 2005-06-16 17:04:00 +1000 |
commit | 81f2e89c7551ef44a6203ab1cbb8228d09202572 (patch) | |
tree | 0c432178b62793f65dcf90f3be0580e439e4a35a /dtc.h | |
parent | 4102d840d993e7cce7d5c5aea8ef696dc81236fc (diff) | |
download | dtc-81f2e89c7551ef44a6203ab1cbb8228d09202572.zip dtc-81f2e89c7551ef44a6203ab1cbb8228d09202572.tar.gz dtc-81f2e89c7551ef44a6203ab1cbb8228d09202572.tar.bz2 |
Rudimentary phandle reference support.
Diffstat (limited to 'dtc.h')
-rw-r--r-- | dtc.h | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -76,18 +76,29 @@ typedef u32 cell_t; #define streq(a, b) (strcmp((a), (b)) == 0) +#define strneq(a, b, n) (strncmp((a), (b), (n)) == 0) + #define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1)) #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) /* Data blobs */ +struct fixup { + int offset; + char *ref; + struct fixup *next; +}; + struct data { int len; char *val; int asize; + struct fixup *refs; }; -#define empty_data ((struct data){.len = 0, .val = NULL, .asize = 0}) +#define empty_data \ + ((struct data){.len = 0, .val = NULL, .asize = 0, .refs = NULL}) +void fixup_free(struct fixup *f); void data_free(struct data d); struct data data_grow_for(struct data d, int xlen); @@ -102,6 +113,8 @@ struct data data_append_byte(struct data d, uint8_t byte); struct data data_append_zeroes(struct data d, int len); struct data data_append_align(struct data d, int align); +struct data data_add_fixup(struct data d, char *ref); + int data_is_one_string(struct data d); /* DT constraints */ |