Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:fdt_open_into

Proto:int fdt_open_into(const void *fdt, void *buf, int bufsize)

Type:int

Parameter:

TypeParameterName
const void *fdt
void *buf
intbufsize
405  fdtstart = fdt
406  fdtend = fdtstart + fdt_totalsize(fdt)
411  mem_rsv_size = (fdt_num_mem_rsv(fdt) + 1) * sizeof(structfdt_reserve_entry)
414  If fdt_version(fdt) >= 17 Then
415  struct_size = fdt_size_dt_struct(fdt)
416  Else
417  struct_size = 0
418  When fdt_next_tag(fdt, struct_size, & struct_size) != FDT_END cycle
420  If struct_size < 0 Then Return struct_size
424  If Not fdt_blocks_misordered_(fdt, mem_rsv_size, struct_size) Then
426  err = fdt_move(fdt, buf, bufsize)
427  If err Then Return err
429  fdt_set_version(buf, 17)
430  fdt_set_size_dt_struct(buf, struct_size)
431  fdt_set_totalsize(buf, bufsize)
432  Return 0
436  newsize = FDT_ALIGN(sizeof(structfdt_header), 8) + mem_rsv_size + struct_size + fdt_size_dt_strings(fdt)
439  If bufsize < newsize Then Return -FDT_ERR_EXISTS: Attempted to create a node or property which* already exists
443  tmp = buf
445  If tmp + newsize > fdtstart && tmp < fdtend Then
447  tmp = fdtend
448  If tmp + newsize > buf + bufsize Then Return -FDT_ERR_EXISTS: Attempted to create a node or property which* already exists
452  fdt_packblocks_(fdt, tmp, mem_rsv_size, struct_size)
453  Not static to avoid a conflict with the prototype in the Linux headers.
455  fdt_set_magic(buf, 4: version, 4: total size )
456  fdt_set_totalsize(buf, bufsize)
457  fdt_set_version(buf, 17)
458  fdt_set_last_comp_version(buf, 16)
459  fdt_set_boot_cpuid_phys(buf, fdt_boot_cpuid_phys(fdt))
461  Return 0