5 .byte ((val) >> 24) & 0xff ; \
6 .byte ((val) >> 16) & 0xff ; \
7 .byte ((val) >> 8) & 0xff ; \
10 #define FDTQUAD(val) \
11 .byte ((val) >> 56) & 0xff ; \
12 .byte ((val) >> 48) & 0xff ; \
13 .byte ((val) >> 40) & 0xff ; \
14 .byte ((val) >> 32) & 0xff ; \
15 .byte ((val) >> 24) & 0xff ; \
16 .byte ((val) >> 16) & 0xff ; \
17 .byte ((val) >> 8) & 0xff ; \
20 #define TREE_HDR(tree) \
25 FDTLONG(FDT_MAGIC) ; \
26 FDTLONG(tree##_end - tree) ; \
27 FDTLONG(tree##_struct - tree) ; \
28 FDTLONG(tree##_strings - tree) ; \
29 FDTLONG(tree##_rsvmap - tree) ; \
33 FDTLONG(tree##_strings_end - tree##_strings) ; \
34 FDTLONG(tree##_struct_end - tree##_struct) ;
36 #define RSVMAP_ENTRY(addr, len) \
40 #define EMPTY_RSVMAP(tree) \
46 #define PROPHDR(tree, name, len) \
49 FDTLONG(tree##_##name - tree##_strings) ;
51 #define PROP_INT(tree, name, val) \
52 PROPHDR(tree, name, 4) \
55 #define PROP_INT64(tree, name, val) \
56 PROPHDR(tree, name, 8) \
59 #define PROP_STR(tree, name, str) \
60 PROPHDR(tree, name, 55f - 54f) \
66 #define BEGIN_NODE(name) \
67 FDTLONG(FDT_BEGIN_NODE) ; \
72 FDTLONG(FDT_END_NODE) ;
74 #define STRING(tree, name, str) \
84 RSVMAP_ENTRY(TEST_ADDR_1, TEST_SIZE_1)
85 RSVMAP_ENTRY(TEST_ADDR_2, TEST_SIZE_2)
87 test_tree1_rsvmap_end:
91 PROP_STR(test_tree1, compatible, "test_tree1")
92 PROP_INT(test_tree1, prop_int, TEST_VALUE_1)
93 PROP_INT64(test_tree1, prop_int64, TEST_VALUE64_1)
94 PROP_STR(test_tree1, prop_str, TEST_STRING_1)
96 BEGIN_NODE("subnode@1")
97 PROP_STR(test_tree1, compatible, "subnode1")
98 PROP_INT(test_tree1, prop_int, TEST_VALUE_1)
100 BEGIN_NODE("subsubnode")
101 PROP_STR(test_tree1, compatible, "subsubnode1\0subsubnode")
102 PROP_INT(test_tree1, prop_int, TEST_VALUE_1)
110 BEGIN_NODE("subnode@2")
111 PROP_INT(test_tree1, linux_phandle, PHANDLE_1)
112 PROP_INT(test_tree1, prop_int, TEST_VALUE_2)
114 BEGIN_NODE("subsubnode@0")
115 PROP_INT(test_tree1, phandle, PHANDLE_2)
116 PROP_STR(test_tree1, compatible, "subsubnode2\0subsubnode")
117 PROP_INT(test_tree1, prop_int, TEST_VALUE_2)
127 test_tree1_struct_end:
130 STRING(test_tree1, compatible, "compatible")
131 STRING(test_tree1, prop_int, "prop-int")
132 STRING(test_tree1, prop_int64, "prop-int64")
133 STRING(test_tree1, prop_str, "prop-str")
134 STRING(test_tree1, linux_phandle, "linux,phandle")
135 STRING(test_tree1, phandle, "phandle")
136 test_tree1_strings_end:
140 TREE_HDR(truncated_property)
141 EMPTY_RSVMAP(truncated_property)
143 truncated_property_struct:
145 PROPHDR(truncated_property, prop_truncated, 4)
146 /* Oops, no actual property data here */
147 truncated_property_struct_end:
149 truncated_property_strings:
150 STRING(truncated_property, prop_truncated, "truncated")
151 truncated_property_strings_end:
153 truncated_property_end:
156 TREE_HDR(bad_node_char)
157 EMPTY_RSVMAP(bad_node_char)
159 bad_node_char_struct:
161 BEGIN_NODE("sub$node")
165 bad_node_char_struct_end:
167 bad_node_char_strings:
168 bad_node_char_strings_end:
172 TREE_HDR(bad_node_format)
173 EMPTY_RSVMAP(bad_node_format)
175 bad_node_format_struct:
177 BEGIN_NODE("subnode@1@2")
181 bad_node_format_struct_end:
183 bad_node_format_strings:
184 bad_node_format_strings_end:
188 TREE_HDR(bad_prop_char)
189 EMPTY_RSVMAP(bad_prop_char)
191 bad_prop_char_struct:
193 PROP_INT(bad_prop_char, prop, TEST_VALUE_1)
196 bad_prop_char_struct_end:
198 bad_prop_char_strings:
199 STRING(bad_prop_char, prop, "prop$erty")
200 bad_prop_char_strings_end: