Searched refs:fd (Results 26 - 50 of 113) sorted by relevance

12345

/u-boot/tools/
H A Dfit_common.c64 int fd; local
67 fd = open(fname, (read_only ? O_RDONLY : O_RDWR) | O_BINARY);
69 if (fd < 0) {
75 if (fstat(fd, sbuf) < 0) {
83 if (ftruncate(fd, sbuf->st_size)) {
93 fd, 0);
119 return fd;
122 if (fd >= 0)
123 close(fd);
H A Dsfspl.c102 int fd, ret = EXIT_SUCCESS; local
111 fd = open(params->outfile, O_WRONLY | O_CREAT | O_TRUNC, 0644);
112 if (fd == -1) {
116 if (write(fd, &buf[hdr_size], file_size) != file_size) {
120 close(fd);
H A Dimagetool.c156 int fd; local
158 fd = open(fname, O_RDONLY | O_BINARY);
159 if (fd < 0) {
165 if (fstat(fd, &sbuf) < 0) {
168 close(fd);
171 close(fd);
H A Drkmux.py114 def process_file(name, fd):
137 for line in fd:
181 def process_csv(name, fd):
182 reader = csv.reader(fd)
209 with open(fname, 'r') as fd:
210 process_file(name, fd)
217 with open(fname, 'r') as fd:
218 process_csv(name, fd)
H A Dpblimage.c109 FILE *fd = NULL; local
115 fd = fopen(name, "r");
116 if (fd == NULL) {
121 while ((getline(&line, &len, fd)) > 0) {
139 fclose(fd);
271 int fd; local
283 fd = fileno(fp_uboot);
285 if (fstat(fd, &st) == -1) {
H A Dimagetool.h260 void pbl_load_uboot(int fd, struct image_tool_params *mparams);
261 int zynqmpbif_copy_image(int fd, struct image_tool_params *mparams);
262 int imx8image_copy_image(int fd, struct image_tool_params *mparams);
263 int imx8mimage_copy_image(int fd, struct image_tool_params *mparams);
264 int rockchip_copy_image(int fd, struct image_tool_params *mparams);
H A Dfit_image.c138 int fd; local
140 fd = open(fname, O_RDONLY | O_BINARY);
141 if (fd < 0) {
147 if (fstat(fd, &sbuf) < 0) {
156 ret = read(fd, ptr, sbuf.st_size);
162 close(fd);
166 close(fd);
444 int fd; local
462 fd = open(fname, O_RDWR | O_CREAT | O_TRUNC | O_BINARY, 0666);
463 if (fd <
501 int fd; local
626 int fd; local
[all...]
H A Dupdate_octeon_header.c149 int fd; local
275 fd = open(filename, O_RDWR);
276 if (fd < 0) {
343 len = read(fd, buf, BUF_SIZE);
370 lseek(fd, hdr_size, SEEK_SET);
372 while ((len = read(fd, buf, BUF_SIZE)) > 0) {
445 lseek(fd, 0, SEEK_SET);
448 ret = write(fd, &header, hdr_size);
452 close(fd);
H A Dkwboot.c417 kwboot_write(int fd, const char *buf, size_t len) argument
422 ssize_t wr = write(fd, buf + tot, len - tot);
515 kwboot_tty_recv(int fd, void *buf, size_t len, int timeo) argument
525 FD_SET(fd, &rfds);
535 nfds = select(fd + 1, &rfds, NULL, NULL, &tv);
545 n = read(fd, buf, len);
561 kwboot_tty_send(int fd, const void *buf, size_t len, int nodrain) argument
566 if (kwboot_write(fd, buf, len) < 0)
572 return tcdrain(fd);
576 kwboot_tty_send_char(int fd, unsigne argument
738 kwboot_tty_change_baudrate(int fd, int baudrate) argument
802 int rc, fd, flags; local
1213 kwboot_baud_magic_handle(int fd, char c, int baudrate) argument
1239 kwboot_xm_recv_reply(int fd, char *c, int stop_on_non_xm, int ignore_nak_reply, int allow_non_xm, int *non_xm_print, int baudrate, int *baud_changed) argument
1309 kwboot_xm_sendblock(int fd, struct kwboot_block *block, int allow_non_xm, int *done_print, int baudrate, int allow_retries) argument
1365 kwboot_xm_finish(int fd) argument
1689 int rc, fd; local
[all...]
/u-boot/include/
H A Dos.h29 * @fd: File descriptor as returned by os_open()
34 ssize_t os_read(int fd, void *buf, size_t count);
39 * @fd: File descriptor as returned by os_open()
44 ssize_t os_write(int fd, const void *buf, size_t count);
49 * @fd: File descriptor as returned by os_open()
54 off_t os_lseek(int fd, off_t offset, int whence);
64 * @fd: File descriptor as returned by os_open()
67 off_t os_filesize(int fd);
88 * @fd: File descriptor to close
91 int os_close(int fd);
[all...]
H A Dsandbox_host.h16 * @fd: File descriptor of file, or 0 for none (file is not open)
21 int fd; member in struct:host_sb_plat
/u-boot/tools/buildman/
H A Dbsettings.py68 with open(config_fname, 'w') as fd:
69 settings.write(fd)
/u-boot/test/py/tests/test_android/
H A Dtest_ab.py34 fd = os.open(persistent, os.O_RDWR | os.O_CREAT)
35 os.ftruncate(fd, 524288)
36 os.close(fd)
/u-boot/scripts/dtc/
H A Dutil.c232 int fd = 0; /* assume stdin */ local
239 fd = open(filename, O_RDONLY);
240 if (fd < 0)
253 ret = read(fd, &buf[offset], bufsize - offset);
262 close(fd);
299 int fd = 1; /* assume stdout */ local
306 fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666);
307 if (fd < 0)
315 ret = write(fd, ptr + offset, totalsize - offset);
323 if (fd !
[all...]
/u-boot/test/py/tests/
H A Dfit_util.py59 with open(make_fname(cons, 'u-boot.dts'), 'w') as fd:
60 fd.write(base_fdt)
H A Dtest_fit_auto_signed.py149 with open(kernel_file, 'wb') as fd:
150 fd.write(os.urandom(512))
152 with open(dt1_file, 'wb') as fd:
153 fd.write(os.urandom(256))
155 with open(dt2_file, 'wb') as fd:
156 fd.write(os.urandom(256))
162 with open(key_file, 'w') as fd:
163 fd.write(str(key.export_key(format='PEM').decode('ascii')))
/u-boot/fs/yaffs2/
H A Dyaffsfs.c55 * A handle is different than an fd because you can use dup()
56 * to create a new handle that accesses the *same* fd. The two
57 * handles will use the same offset (part of the fd). We only close
58 * down the fd when there are no more handles accessing it.
60 * More than one fd can currently access one file, but each fd
76 int handleCount:10; /* Number of handles for this fd */
155 struct yaffsfs_FileDes *fd = yaffsfs_HandleToFileDes(handle); local
157 if (fd && fd
284 struct yaffsfs_FileDes *fd; local
332 struct yaffsfs_FileDes *fd; local
364 struct yaffsfs_FileDes *fd; local
780 struct yaffsfs_FileDes *fd = NULL; local
1069 struct yaffsfs_FileDes *fd = NULL; local
1191 struct yaffsfs_FileDes *fd = NULL; local
1295 yaffs_write(int fd, const void *buf, unsigned int nbyte) argument
1300 yaffs_pwrite(int fd, const void *buf, unsigned int nbyte, loff_t offset) argument
1352 struct yaffsfs_FileDes *fd = NULL; local
1380 struct yaffsfs_FileDes *fd = NULL; local
1678 yaffs_fstat(int fd, struct yaffs_stat *buf) argument
1772 yaffs_futime(int fd, const struct yaffs_utimbuf *buf) argument
1854 yaffs_fsetxattr(int fd, const char *name, const void *data, int size, int flags) argument
1939 yaffs_fgetxattr(int fd, const char *name, void *data, int size) argument
2024 yaffs_flistxattr(int fd, char *data, int size) argument
2109 yaffs_fremovexattr(int fd, const char *name) argument
2140 yaffs_get_wince_times(int fd, unsigned *wctime, unsigned *watime, unsigned *wmtime) argument
2175 yaffs_set_wince_times(int fd, const unsigned *wctime, const unsigned *watime, const unsigned *wmtime) argument
2334 yaffs_fchmod(int fd, mode_t mode) argument
[all...]
/u-boot/tools/binman/
H A Delf.py119 with open(fname, 'rb') as fd:
120 elf = ELFFile(fd)
135 with open(fname, 'rb') as fd:
136 elf = ELFFile(fd)
158 with open(fname, 'rb') as fd:
159 elf = ELFFile(fd)
265 with open(fname, 'rb') as fd:
266 elf = ELFFile(fd)
361 with open(s_file, 'w') as fd:
387 file=fd)
[all...]
H A Dcbfs_util_test.py258 with io.BytesIO(data) as fd:
259 self.assertTrue(cbr._find_and_read_header(fd, len(data)))
260 pos = fd.tell()
261 hdr_data = fd.read(cbfs_util.FILE_HEADER_LEN)
348 with io.BytesIO(data) as fd:
349 self.assertTrue(cbr._find_and_read_header(fd, len(data)))
350 pos = fd.tell()
355 with io.BytesIO(newdata) as fd:
356 fd.seek(pos)
357 self.assertEqual(False, cbr._read_next_file(fd))
[all...]
/u-boot/test/py/
H A Du_boot_spawn.py51 (self.pid, self.fd) = pty.fork()
69 self.poll.register(self.fd, select.POLLIN | select.POLLPRI | select.POLLERR |
136 os.write(self.fd, data.encode(errors='replace'))
195 c = os.read(self.fd, 1024).decode(errors='replace')
229 os.close(self.fd)
/u-boot/lib/
H A Dfdtdec_test.c63 int fd; local
93 fd = os_open("/tmp/fdtdec-text.dtb", OS_O_CREAT | OS_O_WRONLY);
94 if (fd == -1) {
98 os_write(fd, fdt, size);
99 os_close(fd);
238 int fd; local
259 fd = os_open(filename, OS_O_CREAT | OS_O_WRONLY);
260 if (fd < 0) {
265 os_write(fd, fdt, size);
266 os_close(fd);
[all...]
/u-boot/tools/env/
H A Dfw_env.c280 static int ubi_update_start(int fd, int64_t bytes) argument
282 if (ioctl(fd, UBI_IOCVOLUP, &bytes))
287 static int ubi_read(int fd, void *buf, size_t count) argument
292 ret = read(fd, buf, count);
330 static int ubi_write(int fd, const void *buf, size_t count) argument
335 ret = write(fd, buf, count);
869 static int flash_bad_block(int fd, uint8_t mtd_type, loff_t blockstart) argument
872 int badblock = ioctl(fd, MEMGETBADBLOCK, &blockstart);
896 static int flash_read_buf(int dev, int fd, void *buf, size_t count, argument
930 rc = flash_bad_block(fd, DEVTYP
981 flash_write_buf(int dev, int fd, void *buf, size_t count) argument
1156 flash_flag_obsolete(int dev, int fd, off_t offset) argument
1237 flash_read(int fd, void *buf, size_t count) argument
1612 int fd, rc = 0; local
[all...]
/u-boot/tools/patman/
H A Dsettings.py170 fd = open(fname, 'r', encoding='utf-8')
176 for line in fd.readlines():
193 fd.close()
289 with open(fname, encoding='utf-8') as fd:
291 for line in fd:
314 with open(fname) as fd:
315 for line in fd:
/u-boot/drivers/usb/emul/
H A Dsandbox_flash.c45 * @fd: File descriptor of backing file
53 int fd; member in struct:sandbox_flash_priv
197 priv->fd != -1) {
198 offset = os_lseek(priv->fd, info->seek_block * info->block_size,
247 if (priv->fd != -1) {
250 bytes_written = os_write(priv->fd, buff, len);
278 if (priv->fd == -1)
281 bytes_read = os_read(priv->fd, buff, len);
345 priv->fd = os_open(plat->pathname, OS_O_RDWR);
346 if (priv->fd !
[all...]
/u-boot/arch/sandbox/cpu/
H A Dstate.c54 int fd; local
66 fd = os_open(fname, OS_O_RDONLY);
67 if (fd < 0) {
72 if (os_read(fd, state->state_fdt, size) != size) {
77 os_close(fd);
81 os_close(fd);
249 int fd; local
292 fd = os_open(fname, OS_O_WRONLY | OS_O_CREAT);
293 if (fd < 0) {
298 if (os_write(fd, stat
[all...]

Completed in 312 milliseconds

12345