fdt/writer.h header reference
[Flattened device tree IO module]

The source code of this header can be browsed online.

Description [link] 

Write-only access to FDT blobs

Members [link] 

Type [link] 

Functions [link] 

Members detail [link] 

#define FDT_WRITER_H_ [link] 

This macro is declared in fdt/writer.h source file, line 1.

void fdt_writer_add_rsvmap(struct fdt_writer_s *writer, uint64_t addr, uint64_t size) [link] 

This function is declared in fdt/writer.h source file, line 53.

this function adds a reservation entry in the memory reservation map.

All calls to this function should be done before beginning to build the structure (nodes and properties)

Parameter list:

  • writer: A writer opaque structure
  • addr: Reserve map base address
  • size: Reserve map size

error_t fdt_writer_finalize(struct fdt_writer_s *writer, size_t *real_size) [link] 

This function is declared in fdt/writer.h source file, line 99.

this function finalizes the blob. This function packs the data and writes all the offsets.

Parameter list:

  • writer: A writer opaque structure
  • real_size: A pointer to a variable to fill with the real size taken by the packed blob, if successful

The return value is whether finalization succeded

error_t fdt_writer_init(struct fdt_writer_s *writer, void *blob, size_t available_size) [link] 

This function is declared in fdt/writer.h source file, line 38.

this function initializes the writer internal state, give a memory region to the writer code. If this memory region is not big enough, caller wont be notified until fdt_writer_finalize is called.

Parameter list:

  • writer: A writer opaque structure to initialize
  • blob: A buffer where the writer will put the blob
  • available_size: buffer size, in bytes

The return value is whether it went well

uint32_t fdt_writer_node_entry(struct fdt_writer_s *writer, const char *name) [link] 

This function is declared in fdt/writer.h source file, line 66.

this function pushes a node in the device tree.

Only the root node should have an empty name ("").

Parameter list:

  • writer: A writer opaque structure
  • name: The relative name of the new node, without '/'

The return value is The offset of the node in the structure

void fdt_writer_node_leave(struct fdt_writer_s *writer) [link] 

This function is declared in fdt/writer.h source file, line 88.

this function closes the current node.

Parameter list:

  • writer: A writer opaque structure

void fdt_writer_node_prop(struct fdt_writer_s *writer, const char *name, const void *data, size_t len) [link] 

This function is declared in fdt/writer.h source file, line 81.

this function pushes an property in the current node. The data will be copied in the blob.

Parameter list:

  • writer: A writer opaque structure
  • name: The property name
  • data: The property value, may be NULL if len is 0
  • len: The property size, in bytes

struct fdt_writer_s [link] 

This struct is declared in fdt/writer.h source file, line 19.

An opaque structure containing the internal state of the writer.

FieldDescription
void * opaque[7];
Valid XHTML 1.0 StrictGenerated by diaxen on Thu Aug 4 15:44:06 2022 using MkDoc