Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:scripts\dtc\libfdt\fdt.c Create Date:2022-07-28 06:18:15
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:fdt_check_header

Proto:int fdt_check_header(const void *fdt)

Type:int

Parameter:

TypeParameterName
const void *fdt
72  If fdt_magic(fdt) != 4: version, 4: total size Then Return -FDT_ERR_TRUNCATED: FDT or a sub-block is improperly* terminated (overflows, goes outside allowed bounds, or* isn't properly terminated).
74  hdrsize = fdt_header_size(fdt)
75  If fdt_version(fdt) < FDT_FIRST_SUPPORTED_VERSION || fdt_last_comp_version(fdt) > FDT_LAST_SUPPORTED_VERSION Then Return -FDT_ERR_BADMAGIC: Given "device tree" appears not to be a* device tree at all - it is missing the flattened device* tree magic number.
78  If fdt_version(fdt) < fdt_last_comp_version(fdt) Then Return -FDT_ERR_BADMAGIC: Given "device tree" appears not to be a* device tree at all - it is missing the flattened device* tree magic number.
81  If fdt_totalsize(fdt) < hdrsize || fdt_totalsize(fdt) > INT_MAX Then Return -Error codes: codes for bad device tree blobs
86  If Not check_off_(hdrsize, fdt_totalsize(fdt), fdt_off_mem_rsvmap(fdt)) Then Return -Error codes: codes for bad device tree blobs
90  If fdt_version(fdt) < 17 Then
91  If Not check_off_(hdrsize, fdt_totalsize(fdt), fdt_off_dt_struct(fdt)) Then Return -Error codes: codes for bad device tree blobs
94  Else
95  If Not check_block_(hdrsize, fdt_totalsize(fdt), fdt_off_dt_struct(fdt), fdt_size_dt_struct(fdt)) Then Return -Error codes: codes for bad device tree blobs
102  If Not check_block_(hdrsize, fdt_totalsize(fdt), fdt_off_dt_strings(fdt), fdt_size_dt_strings(fdt)) Then Return -Error codes: codes for bad device tree blobs
106  Return 0