Home
last modified time | relevance | path

Searched refs:fd (Results 1 – 25 of 1197) sorted by relevance

12345678910>>...48

/openbmc/libpldm/src/firmware_device/
H A Dfd.c112 static void pldm_fd_set_state(struct pldm_fd *fd, in pldm_fd_set_state() argument
118 if (fd->state == state) { in pldm_fd_set_state()
122 fd->prev_state = fd->state; in pldm_fd_set_state()
123 fd->state = state; in pldm_fd_set_state()
127 static void pldm_fd_set_idle(struct pldm_fd *fd, in pldm_fd_set_idle() argument
130 fd->prev_state = fd->state; in pldm_fd_set_idle()
131 fd->state = PLDM_FD_STATE_IDLE; in pldm_fd_set_idle()
132 fd->reason = reason; in pldm_fd_set_idle()
133 fd->ua_address_set = false; in pldm_fd_set_idle()
137 static void pldm_fd_idle_timeout(struct pldm_fd *fd) in pldm_fd_idle_timeout() argument
[all …]
/openbmc/qemu/target/loongarch/tcg/
H A Dfpu_helper.c95 uint64_t fd; in helper_fadd_s() local
97 fd = nanbox_s(float32_add((uint32_t)fj, (uint32_t)fk, &env->fp_status)); in helper_fadd_s()
99 return fd; in helper_fadd_s()
104 uint64_t fd; in helper_fadd_d() local
106 fd = float64_add(fj, fk, &env->fp_status); in helper_fadd_d()
108 return fd; in helper_fadd_d()
113 uint64_t fd; in helper_fsub_s() local
115 fd = nanbox_s(float32_sub((uint32_t)fj, (uint32_t)fk, &env->fp_status)); in helper_fsub_s()
117 return fd; in helper_fsub_s()
122 uint64_t fd; in helper_fsub_d() local
[all …]
/openbmc/qemu/linux-user/
H A Dfd-trans.h49 static inline TargetFdDataFunc fd_trans_target_to_host_data(int fd) in fd_trans_target_to_host_data() argument
51 if (fd < 0) { in fd_trans_target_to_host_data()
56 if (fd < target_fd_max && target_fd_trans[fd]) { in fd_trans_target_to_host_data()
57 return target_fd_trans[fd]->target_to_host_data; in fd_trans_target_to_host_data()
62 static inline TargetFdDataFunc fd_trans_host_to_target_data(int fd) in fd_trans_host_to_target_data() argument
64 if (fd < 0) { in fd_trans_host_to_target_data()
69 if (fd < target_fd_max && target_fd_trans[fd]) { in fd_trans_host_to_target_data()
70 return target_fd_trans[fd]->host_to_target_data; in fd_trans_host_to_target_data()
75 static inline TargetFdAddrFunc fd_trans_target_to_host_addr(int fd) in fd_trans_target_to_host_addr() argument
77 if (fd < 0) { in fd_trans_target_to_host_addr()
[all …]
/openbmc/qemu/net/
H A Dtap-bsd.c41 int fd; in tap_open() local
59 fd = RETRY_ON_EINTR(open(dname, O_RDWR)); in tap_open()
60 if (fd >= 0) { in tap_open()
70 if (fd < 0) { in tap_open()
76 if (ioctl(fd, TAPGIFNAME, (void *)&ifr) < 0) { in tap_open()
82 if (fstat(fd, &s) < 0) { in tap_open()
97 close(fd); in tap_open()
101 g_unix_set_fd_nonblocking(fd, true, NULL); in tap_open()
102 return fd; in tap_open()
111 int fd, s, ret; in tap_open_clone() local
[all …]
H A Dtap-linux.c44 int fd, ret; in tap_open() local
52 fd = open(file, O_RDWR); in tap_open()
54 fd = -1; in tap_open()
57 if (fd < 0) { in tap_open()
58 fd = RETRY_ON_EINTR(open(PATH_NET_TUN, O_RDWR)); in tap_open()
59 if (fd < 0) { in tap_open()
67 if (ioctl(fd, TUNGETFEATURES, &features) == -1) { in tap_open()
87 close(fd); in tap_open()
96 ioctl(fd, TUNSETVNETHDRSZ, &len); in tap_open()
103 close(fd); in tap_open()
[all …]
H A Dsocket.c39 int fd; member
53 qemu_set_fd_handler(s->fd, in net_socket_update_fd_handler()
97 ret = iov_send(s->fd, iov, 2, s->send_index, remaining); in net_socket_receive()
122 sendto(s->fd, buf, size, 0, in net_socket_receive_dgram()
125 send(s->fd, buf, size, 0) in net_socket_receive_dgram()
163 size = recv(s->fd, buf1, sizeof(buf1), 0); in net_socket_send()
175 close(s->fd); in net_socket_send()
177 s->fd = -1; in net_socket_send()
198 size = recv(s->fd, s->rs.buf, sizeof(s->rs.buf), 0); in net_socket_send_dgram()
218 int fd; in net_socket_mcast_create() local
[all …]
/openbmc/phosphor-power/test/
H A Dfile_descriptor_tests.cpp36 bool isValid(int fd) in isValid() argument
38 return (fcntl(fd, F_GETFL) != -1) || (errno != EBADF); in isValid()
50 int fd = open("/etc/hosts", O_RDONLY); in createOpenFileDescriptor() local
51 EXPECT_NE(fd, -1); in createOpenFileDescriptor()
52 EXPECT_TRUE(isValid(fd)); in createOpenFileDescriptor()
53 return fd; in createOpenFileDescriptor()
65 int fd = createOpenFileDescriptor(); in TEST() local
66 FileDescriptor descriptor{fd}; in TEST()
67 EXPECT_EQ(descriptor(), fd); in TEST()
69 EXPECT_TRUE(isValid(fd)); in TEST()
[all …]
/openbmc/gpioplus/src/gpioplus/internal/
H A Dfd.cpp16 sys(sys), fd(sys->open(pathname, flags)) in Fd()
18 if (fd < 0) in Fd()
26 int fd = sys->dup(oldfd); in dup() local
27 if (fd < 0) in dup()
31 return fd; in dup()
34 Fd::Fd(int fd, const Sys* sys) : sys(sys), fd(dup(fd, sys)) {} in Fd() argument
36 Fd::Fd(int fd, std::false_type, const Sys* sys) : sys(sys), fd(fd) {} in Fd() argument
50 Fd::Fd(const Fd& other) : sys(other.sys), fd(dup(other.fd, sys)) {} in Fd()
58 fd = dup(other.fd, sys); in operator =()
63 Fd::Fd(Fd&& other) : sys(other.sys), fd(std::move(other.fd)) in Fd()
[all …]
H A Dsys.cpp23 int SysImpl::close(int fd) const in close()
25 return ::close(fd); in close()
28 int SysImpl::read(int fd, void* buf, size_t count) const in read() argument
30 return ::read(fd, buf, count); in read()
33 int SysImpl::fcntl_setfl(int fd, int flags) const in fcntl_setfl() argument
35 return ::fcntl(fd, F_SETFL, flags); in fcntl_setfl()
38 int SysImpl::fcntl_getfl(int fd) const in fcntl_getfl()
40 return ::fcntl(fd, F_GETFL); in fcntl_getfl()
43 int SysImpl::gpiohandle_get_line_values(int fd, in gpiohandle_get_line_values() argument
46 return ::ioctl(fd, GPIOHANDLE_GET_LINE_VALUES_IOCTL, data); in gpiohandle_get_line_values()
[all …]
H A Dsys.hpp21 virtual int close(int fd) const = 0;
22 virtual int read(int fd, void* buf, size_t count) const = 0;
23 virtual int fcntl_setfl(int fd, int flags) const = 0;
24 virtual int fcntl_getfl(int fd) const = 0;
27 int fd, struct gpiohandle_data* data) const = 0;
29 int fd, struct gpiohandle_data* data) const = 0;
30 virtual int gpio_get_chipinfo(int fd, struct gpiochip_info* info) const = 0;
31 virtual int gpio_get_lineinfo(int fd, struct gpioline_info* info) const = 0;
33 int fd, struct gpiohandle_request* request) const = 0;
34 virtual int gpio_get_lineevent(int fd,
[all …]
/openbmc/qemu/hw/9pfs/
H A D9p-util-darwin.c18 int fd = openat_file(dirfd, filename, in fgetxattrat_nofollow() local
20 if (fd == -1) { in fgetxattrat_nofollow()
23 ret = fgetxattr(fd, name, value, size, 0, 0); in fgetxattrat_nofollow()
24 close_preserve_errno(fd); in fgetxattrat_nofollow()
32 int fd = openat_file(dirfd, filename, in flistxattrat_nofollow() local
34 if (fd == -1) { in flistxattrat_nofollow()
37 ret = flistxattr(fd, list, size, 0); in flistxattrat_nofollow()
38 close_preserve_errno(fd); in flistxattrat_nofollow()
46 int fd = openat_file(dirfd, filename, O_PATH_9P_UTIL | O_NOFOLLOW, 0); in fremovexattrat_nofollow() local
47 if (fd == -1) { in fremovexattrat_nofollow()
[all …]
/openbmc/openpower-hw-diags/util/
H A Dfile_descriptor.hpp31 explicit FileDescriptor(int fd) : fd(fd) {} in FileDescriptor() argument
40 FileDescriptor(FileDescriptor&& other) : fd(other.fd) in FileDescriptor()
42 other.fd = -1; in FileDescriptor()
58 set(other.fd); in operator =()
59 other.fd = -1; in operator =()
82 return fd; in operator ()()
92 return fd != -1; in operator bool()
106 if (fd >= 0) in close()
108 rc = ::close(fd); in close()
109 fd = -1; in close()
[all …]
/openbmc/phosphor-power/
H A Dfile_descriptor.hpp31 FileDescriptor(int fd) : fd(fd) {} in FileDescriptor() argument
40 FileDescriptor(FileDescriptor&& other) : fd(other.fd) in FileDescriptor()
42 other.fd = -1; in FileDescriptor()
58 set(other.fd); in operator =()
59 other.fd = -1; in operator =()
82 return fd; in operator ()()
92 return fd != -1; in operator bool()
106 if (fd >= 0) in close()
108 rc = ::close(fd); in close()
109 fd = -1; in close()
[all …]
/openbmc/openpower-debug-collector/watchdog/
H A Dfile_descriptor.hpp33 explicit FileDescriptor(int fd) : fd(fd) {} in FileDescriptor() argument
42 FileDescriptor(FileDescriptor&& other) : fd(other.fd) in FileDescriptor()
44 other.fd = -1; in FileDescriptor()
61 set(other.fd); in operator =()
62 other.fd = -1; in operator =()
85 return fd; in operator ()()
95 return fd != -1; in operator bool()
110 if (fd >= 0) in close()
112 rc = ::close(fd); in close()
113 fd = -1; in close()
[all …]
/openbmc/qemu/linux-user/s390x/
H A Dtarget_proc.h25 static void show_facilities(int fd) in show_facilities() argument
31 dprintf(fd, "facilities :"); in show_facilities()
35 dprintf(fd, " %d", bit); in show_facilities()
38 dprintf(fd, "\n"); in show_facilities()
47 static void show_cpu_summary(CPUArchState *cpu_env, int fd) in show_cpu_summary() argument
55 dprintf(fd, "vendor_id : IBM/S390\n" in show_cpu_summary()
59 dprintf(fd, "max thread id : 0\n"); in show_cpu_summary()
60 dprintf(fd, "features\t: "); in show_cpu_summary()
67 dprintf(fd, "%s ", hwcap_str); in show_cpu_summary()
70 dprintf(fd, "\n"); in show_cpu_summary()
[all …]
/openbmc/u-boot/arch/arm/lib/
H A Dsemihosting.c48 long fd; in smh_open() local
74 fd = smh_trap(SYSOPEN, &open); in smh_open()
75 if (fd == -1) in smh_open()
76 printf("%s: ERROR fd %ld for file \'%s\'\n", __func__, fd, in smh_open()
79 return fd; in smh_open()
85 static long smh_read(long fd, void *memp, size_t len) in smh_read() argument
89 long fd; in smh_read() member
94 debug("%s: fd %ld, memp %p, len %zu\n", __func__, fd, memp, len); in smh_read()
96 read.fd = fd; in smh_read()
109 __func__, ret, fd, len, memp); in smh_read()
[all …]
/openbmc/openbmc/poky/bitbake/lib/toaster/orm/fixtures/
H A Dgen_fixtures.py185 def print_str(str,fd): argument
189 print(str,file=fd)
191 def print_template(template,params,fd): argument
203 print(line,file=fd)
210 fd = open('poky.xml','w')
214 print_template(prolog_template,params,fd)
215 print_str('',fd)
217 print_str(' <!-- Bitbake versions which correspond to the metadata release -->',fd)
228 print_template(bitbakeversion_poky_template,params,fd)
229 print_str('',fd)
[all …]
/openbmc/qemu/target/i386/hvf/
H A Dx86hvf.c80 if (hv_vcpu_write_fpstate(cs->accel->fd, xsave, xsave_len)) { in hvf_put_xsave()
90 wvmcs(cs->accel->fd, VMCS_GUEST_IDTR_LIMIT, env->idt.limit); in hvf_put_segments()
91 wvmcs(cs->accel->fd, VMCS_GUEST_IDTR_BASE, env->idt.base); in hvf_put_segments()
93 wvmcs(cs->accel->fd, VMCS_GUEST_GDTR_LIMIT, env->gdt.limit); in hvf_put_segments()
94 wvmcs(cs->accel->fd, VMCS_GUEST_GDTR_BASE, env->gdt.base); in hvf_put_segments()
97 wvmcs(cs->accel->fd, VMCS_GUEST_CR3, env->cr[3]); in hvf_put_segments()
99 wvmcs(cs->accel->fd, VMCS_GUEST_IA32_EFER, env->efer); in hvf_put_segments()
101 macvm_set_cr4(cs->accel->fd, env->cr[4]); in hvf_put_segments()
102 macvm_set_cr0(cs->accel->fd, env->cr[0]); in hvf_put_segments()
133 hv_vcpu_write_msr(cs->accel->fd, MSR_IA32_SYSENTER_CS, in hvf_put_msrs()
[all …]
/openbmc/qemu/migration/
H A Dfd.c28 static bool fd_is_pipe(int fd) in fd_is_pipe() argument
32 if (fstat(fd, &statbuf) == -1) { in fd_is_pipe()
39 static bool migration_fd_valid(int fd) in migration_fd_valid() argument
41 if (fd_is_socket(fd)) { in migration_fd_valid()
45 if (fd_is_pipe(fd)) { in migration_fd_valid()
55 int fd = monitor_get_fd(monitor_cur(), fdname, errp); in fd_start_outgoing_migration() local
56 if (fd == -1) { in fd_start_outgoing_migration()
60 if (!migration_fd_valid(fd)) { in fd_start_outgoing_migration()
65 trace_migration_fd_outgoing(fd); in fd_start_outgoing_migration()
66 ioc = qio_channel_new_fd(fd, errp); in fd_start_outgoing_migration()
[all …]
/openbmc/qemu/monitor/
H A Dfds.c38 int fd; member
45 int fd; member
63 static bool monitor_add_fd(Monitor *mon, int fd, const char *fdname, Error **errp) in monitor_add_fd() argument
68 close(fd); in monitor_add_fd()
83 tmp_fd = monfd->fd; in monitor_add_fd()
84 monfd->fd = fd; in monitor_add_fd()
93 monfd->fd = fd; in monitor_add_fd()
104 int fd; in qmp_getfd() local
106 fd = qemu_chr_fe_get_msgfd(&cur_mon->chr); in qmp_getfd()
107 if (fd == -1) { in qmp_getfd()
[all …]
/openbmc/qemu/tests/qemu-iotests/
H A Dqcow2_format.py101 def __init__(self, fd=None, offset=None, data=None): argument
109 assert fd is not None
112 fd.seek(offset)
113 data = fd.read(buf_size)
115 assert fd is None and offset is None
148 def __init__(self, fd, cluster_size): argument
149 super().__init__(fd=fd)
152 fd.seek(8 - tail, 1)
153 position = fd.tell()
155 self.read_bitmap_directory(fd)
[all …]
/openbmc/qemu/util/
H A Dmmap-alloc.c33 QemuFsType qemu_fd_getfs(int fd) in qemu_fd_getfs() argument
39 if (fd < 0) { in qemu_fd_getfs()
44 ret = fstatfs(fd, &fs); in qemu_fd_getfs()
60 size_t qemu_fd_getpagesize(int fd) in qemu_fd_getpagesize() argument
66 if (fd != -1) { in qemu_fd_getpagesize()
68 ret = fstatfs(fd, &fs); in qemu_fd_getpagesize()
85 static bool map_noreserve_effective(int fd, uint32_t qemu_map_flags) in map_noreserve_effective() argument
101 if (qemu_fd_getpagesize(fd) != qemu_real_host_page_size()) { in map_noreserve_effective()
113 if (readonly || (shared && fd >= 0)) { in map_noreserve_effective()
152 static void *mmap_reserve(size_t size, int fd) in mmap_reserve() argument
[all …]
/openbmc/u-boot/include/fsl-mc/
H A Dfsl_dpaa_fd.h38 static inline u64 ldpaa_fd_get_addr(const struct dpaa_fd *fd) in ldpaa_fd_get_addr() argument
40 return (u64)((((uint64_t)fd->simple.addr_hi) << 32) in ldpaa_fd_get_addr()
41 + fd->simple.addr_lo); in ldpaa_fd_get_addr()
44 static inline void ldpaa_fd_set_addr(struct dpaa_fd *fd, u64 addr) in ldpaa_fd_set_addr() argument
46 fd->simple.addr_hi = upper_32_bits(addr); in ldpaa_fd_set_addr()
47 fd->simple.addr_lo = lower_32_bits(addr); in ldpaa_fd_set_addr()
50 static inline u32 ldpaa_fd_get_len(const struct dpaa_fd *fd) in ldpaa_fd_get_len() argument
52 return fd->simple.len; in ldpaa_fd_get_len()
55 static inline void ldpaa_fd_set_len(struct dpaa_fd *fd, u32 len) in ldpaa_fd_set_len() argument
57 fd->simple.len = len; in ldpaa_fd_set_len()
[all …]
/openbmc/qemu/tests/unit/
H A Dtest-util-sockets.c30 int fd = mkstemp(tmp); in test_fd_is_socket_bad() local
31 if (fd != 0) { in test_fd_is_socket_bad()
36 g_assert(fd >= 0); in test_fd_is_socket_bad()
38 g_assert(!fd_is_socket(fd)); in test_fd_is_socket_bad()
39 close(fd); in test_fd_is_socket_bad()
44 int fd = qemu_socket(PF_INET, SOCK_STREAM, 0); in test_fd_is_socket_good() local
46 g_assert(fd >= 0); in test_fd_is_socket_good()
48 g_assert(fd_is_socket(fd)); in test_fd_is_socket_good()
49 close(fd); in test_fd_is_socket_good()
82 int fd; in test_socket_fd_pass_name_good() local
[all …]
/openbmc/qemu/backends/
H A Diommufd.c35 be->fd = -1; in iommufd_backend_init()
45 close(be->fd); in iommufd_backend_finalize()
46 be->fd = -1; in iommufd_backend_finalize()
54 int fd = -1; in iommufd_backend_set_fd() local
56 fd = monitor_fd_param(monitor_cur(), str, errp); in iommufd_backend_set_fd()
57 if (fd == -1) { in iommufd_backend_set_fd()
61 be->fd = fd; in iommufd_backend_set_fd()
63 trace_iommu_backend_set_fd(be->fd); in iommufd_backend_set_fd()
81 be->fd = cpr_find_fd(name, 0); in iommufd_backend_complete()
83 cpr_save_fd(name, 0, be->fd); in iommufd_backend_complete()
[all …]

12345678910>>...48