Lines Matching refs:fp
221 def read_fdt(fp): argument
225 header = HeaderV17.unpack_from(fp.read(HeaderV17.size))
229 fp.seek(header.off_dt_struct)
230 structs = fp.read(header.size_dt_struct)
231 fp.seek(header.off_dt_strings)
232 strings = fp.read(header.size_dt_strings)
297 def write_fdt(root, strblock, fp): argument
305 fp.write(header.pack())
307 header.off_mem_rsvmap = fp.tell()
308 fp.write(RRHeader().pack())
311 header.off_dt_struct = fp.tell()
313 fp.write(structs)
316 header.off_dt_strings = fp.tell()
318 fp.write(strings)
320 header.totalsize = fp.tell()
322 fp.seek(0)
323 fp.write(header.pack())
407 with open(argv[1], 'rb') as fp:
408 root, strblock = read_fdt(fp)
417 with open('blah', 'w+b') as fp:
418 write_fdt(root, strblock, fp)