Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
boot_fdt.h File Reference

Boot firmware device tree helpers. More...

#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Functions

int sys_boot_fdt_copy (uint8_t *dst, size_t dst_size, const uint8_t *src, uint32_t *fdt_size)
 Validate and copy a boot firmware device tree blob.

Detailed Description

Boot firmware device tree helpers.

Function Documentation

◆ sys_boot_fdt_copy()

int sys_boot_fdt_copy ( uint8_t * dst,
size_t dst_size,
const uint8_t * src,
uint32_t * fdt_size )

Validate and copy a boot firmware device tree blob.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_BOOT_FDT 
.

This helper validates the FDT header magic and total-size field, checks that the blob fits in the caller-provided storage, and copies the blob into that storage. The caller owns the destination buffer and decides how long the copied blob remains available.

Parameters
dstDestination buffer for the copied FDT.
dst_sizeDestination buffer size in bytes.
srcSource FDT pointer.
fdt_sizeOutput for the FDT size in bytes. Set on success and when returning -ENOSPC.
Return values
0If the FDT was validated and copied.
-EINVALIf an argument is invalid or src is not a valid FDT.
-ENOSPCIf dst is too small for the FDT.