MCPcopy Create free account
hub / github.com/F-Stack/f-stack / fdt_check_header

Function fdt_check_header

freebsd/contrib/libfdt/fdt.c:58–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56#include "libfdt_internal.h"
57
58int fdt_check_header(const void *fdt)
59{
60 if (fdt_magic(fdt) == FDT_MAGIC) {
61 /* Complete tree */
62 if (fdt_version(fdt) < FDT_FIRST_SUPPORTED_VERSION)
63 return -FDT_ERR_BADVERSION;
64 if (fdt_last_comp_version(fdt) > FDT_LAST_SUPPORTED_VERSION)
65 return -FDT_ERR_BADVERSION;
66 } else if (fdt_magic(fdt) == FDT_SW_MAGIC) {
67 /* Unfinished sequential-write blob */
68 if (fdt_size_dt_struct(fdt) == 0)
69 return -FDT_ERR_BADSTATE;
70 } else {
71 return -FDT_ERR_BADMAGIC;
72 }
73
74 return 0;
75}
76
77const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len)
78{

Callers 5

fdt_get_nameFunction · 0.85
process_boot_desc_ver_6Function · 0.85
linux_parse_boot_paramFunction · 0.85
linux_parse_boot_paramFunction · 0.85
init_max10_device_tableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected