@@ -32,11 +32,20 @@ typedef struct {
3232 dt_node_t root_node ; /**< Root node offset. */
3333 u32 total_size ; /**< Total size of the FDT. */
3434 u32 struct_off ; /**< Structure block offset. */
35+ u32 rsvmap_off ; /**< Memory reservation map offset. */
3536 u32 strings_off ; /**< Strings block offset. */
3637 u32 struct_size ; /**< Structure block size. */
3738 u32 fdt_version ; /**< FDT version. */
3839} fdt_t ;
3940
41+ /**
42+ * @brief Reserved memory entry structure.
43+ */
44+ typedef struct {
45+ u64 address ; /**< Entry address. */
46+ u64 size ; /**< Entry size. */
47+ } fdt_rsv_entry ;
48+
4049/**
4150 * @brief Read the header at fdt and set fields of obj.
4251 * @param fdt Pointer to the flattened device tree data.
@@ -214,6 +223,19 @@ error_t dt_get_prop_name_ptr(const fdt_t* fdt, dt_prop_t prop, const char** ptrO
214223[[gnu ::nonnull (3 )]]
215224error_t dt_get_prop_buffer (const fdt_t * fdt , dt_prop_t prop , buffer_t * bufOUT );
216225
226+ /**
227+ * @brief Get a reserved memory entry at index from the Memory Reservation Block.
228+ * @param fdt Pointer to the fdt object.
229+ * @param index Index of the entry to get.
230+ * @param[out] entryOUT Entry at index.
231+ * @retval ERR_NONE on success
232+ * @retval ERR_BAD_ARG on nullptr args
233+ * @retval ERR_NOT_VALID if the FDT is invalid
234+ * @retval ERR_OUT_OF_BOUNDS if index is out of bounds or the Memory Reservation Block is malformed
235+ */
236+ [[gnu ::nonnull (3 )]]
237+ error_t dt_get_rsv_mem_entry (const fdt_t * fdt , u32 index , fdt_rsv_entry * entryOUT );
238+
217239/// @}
218240
219241#endif // !DT_DT
0 commit comments