• Home
  • Raw
  • Download

Lines Matching refs:fd

56     int fd, size;  in get_image_size()  local
57 fd = open(filename, O_RDONLY | O_BINARY); in get_image_size()
58 if (fd < 0) in get_image_size()
60 size = lseek(fd, 0, SEEK_END); in get_image_size()
61 close(fd); in get_image_size()
69 int fd, size; in load_image() local
70 fd = open(filename, O_RDONLY | O_BINARY); in load_image()
71 if (fd < 0) in load_image()
73 size = lseek(fd, 0, SEEK_END); in load_image()
74 lseek(fd, 0, SEEK_SET); in load_image()
75 if (read(fd, addr, size) != size) { in load_image()
76 close(fd); in load_image()
79 close(fd); in load_image()
110 int read_targphys(int fd, target_phys_addr_t dst_addr, size_t nbytes) in read_targphys() argument
118 did = read(fd, buf, want); in read_targphys()
213 int fd, size, ret; in load_aout() local
217 fd = open(filename, O_RDONLY | O_BINARY); in load_aout()
218 if (fd < 0) in load_aout()
221 size = read(fd, &e, sizeof(e)); in load_aout()
234 lseek(fd, N_TXTOFF(e), SEEK_SET); in load_aout()
235 size = read_targphys(fd, addr, e.a_text + e.a_data); in load_aout()
242 lseek(fd, N_TXTOFF(e), SEEK_SET); in load_aout()
243 size = read_targphys(fd, addr, e.a_text); in load_aout()
246 ret = read_targphys(fd, addr + N_DATADDR(e), e.a_data); in load_aout()
254 close(fd); in load_aout()
257 close(fd); in load_aout()
263 static void *load_at(int fd, int offset, int size) in load_at() argument
266 if (lseek(fd, offset, SEEK_SET) < 0) in load_at()
269 if (read(fd, ptr, size) != size) { in load_at()
310 int fd, data_order, host_data_order, must_swab, ret; in load_elf() local
313 fd = open(filename, O_RDONLY | O_BINARY); in load_elf()
314 if (fd < 0) { in load_elf()
318 if (read(fd, e_ident, sizeof(e_ident)) != sizeof(e_ident)) in load_elf()
340 lseek(fd, 0, SEEK_SET); in load_elf()
342 ret = load_elf64(fd, address_offset, must_swab, pentry, in load_elf()
345 ret = load_elf32(fd, address_offset, must_swab, pentry, in load_elf()
349 close(fd); in load_elf()
353 close(fd); in load_elf()
459 int fd; in load_uimage() local
466 fd = open(filename, O_RDONLY | O_BINARY); in load_uimage()
467 if (fd < 0) in load_uimage()
470 size = read(fd, hdr, sizeof(uboot_image_header_t)); in load_uimage()
507 if (read(fd, data, hdr->ih_size) != hdr->ih_size) { in load_uimage()
540 close(fd); in load_uimage()