Lines Matching refs:idx
107 int idx; in _fdt_slot_alloc() local
110 for (idx = startfd; idx < (int)fdt->maxfd; idx++) in _fdt_slot_alloc()
112 if (fdt->fds[idx] == RT_NULL) in _fdt_slot_alloc()
114 return idx; in _fdt_slot_alloc()
118 idx = fdt->maxfd; in _fdt_slot_alloc()
119 if (idx < startfd) in _fdt_slot_alloc()
121 idx = startfd; in _fdt_slot_alloc()
124 if (_fdt_slot_expand(fdt, idx) < 0) in _fdt_slot_alloc()
129 return idx; in _fdt_slot_alloc()
146 int idx; in _fdt_fd_alloc() local
148 idx = _fdt_slot_alloc(fdt, startfd); in _fdt_fd_alloc()
150 return idx; in _fdt_fd_alloc()
300 int idx = -1; in fdt_fd_new() local
309 idx = _fdt_fd_alloc(fdt, (fdt == &_fdtab) ? DFS_STDIO_OFFSET : 0); in fdt_fd_new()
311 if (idx < 0) in fdt_fd_new()
315 else if (!fdt->fds[idx]) in fdt_fd_new()
323 fdt->fds[idx] = file; in fdt_fd_new()
325 LOG_D("allocate a new fd @ %d", idx); in fdt_fd_new()
329 fdt->fds[idx] = RT_NULL; in fdt_fd_new()
330 idx = -1; in fdt_fd_new()
336 idx = -1; in fdt_fd_new()
341 return idx; in fdt_fd_new()