Home
last modified time | relevance | path

Searched full:fd (Results 1 – 25 of 1295) sorted by relevance

12345678910>>...52

/openbmc/gpioplus/src/gpioplus/internal/
H A Dfd.cpp3 #include <gpioplus/internal/fd.hpp>
15 Fd::Fd(const char* pathname, int flags, const Sys* sys) : in Fd() function in gpioplus::internal::Fd
16 sys(sys), fd(sys->open(pathname, flags)) in Fd()
18 if (fd < 0) in Fd()
20 throw std::system_error(errno, std::generic_category(), "Opening FD"); in Fd()
26 int fd = sys->dup(oldfd); in dup() local
27 if (fd < 0) in dup()
29 throw std::system_error(errno, std::generic_category(), "Duping FD"); in dup()
31 return fd; in dup()
34 Fd::Fd(int fd, const Sys* sys) : sys(sys), fd(dup(fd, sys)) {} in Fd() function in gpioplus::internal::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 …]
H A Dfd.hpp11 /** @class Fd
15 class Fd class
25 Fd(const char* pathname, int flags, const Sys* sys);
30 * @param[in] fd - File descriptor being duplicated
34 Fd(int fd, const Sys* sys);
39 * @param[in] fd - File descriptor being duplicated
40 * @param[in] - Denotes that the fd is directly used
43 Fd(int fd, std::false_type, const Sys* sys);
45 virtual ~Fd();
46 Fd(const Fd& other);
[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/libpldm/src/firmware_device/
H A Dfd.c3 #include "fd-internal.h"
112 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()
[all …]
/openbmc/gpioplus/test/internal/
H A Dfd.cpp5 #include <gpioplus/internal/fd.hpp>
46 Fd fd(expected_fd, std::false_type(), &mock); in TEST_F() local
47 EXPECT_EQ(expected_fd, *fd); in TEST_F()
48 EXPECT_EQ(&mock, fd.getSys()); in TEST_F()
55 Fd fd(-1, std::false_type(), &mock); in TEST_F() local
56 EXPECT_EQ(-1, *fd); in TEST_F()
62 Fd fd(expected_fd, &mock); in TEST_F() local
63 EXPECT_EQ(expected_fd2, *fd); in TEST_F()
64 EXPECT_EQ(&mock, fd.getSys()); in TEST_F()
73 EXPECT_THROW(Fd(expected_fd, &mock), std::system_error); in TEST_F()
[all …]
/openbmc/estoraged/include/
H A Dzero.hpp6 #include <stdplus/fd/create.hpp>
7 #include <stdplus/fd/managed.hpp>
14 using stdplus::fd::Fd;
27 * @param[in] fd - the stdplus file descriptor
29 void writeZero(uint64_t driveSize, Fd& fd);
36 stdplus::fd::Fd&& fd = in writeZero()
37 stdplus::fd::open(devPath, stdplus::fd::OpenAccess::WriteOnly); in writeZero()
38 writeZero(util::findSizeOfBlockDevice(devPath), fd); in writeZero()
44 * @param[in] fd - the stdplus file descriptor
46 void verifyZero(uint64_t driveSize, Fd& fd);
[all …]
H A Dpattern.hpp6 #include <stdplus/fd/create.hpp>
7 #include <stdplus/fd/managed.hpp>
15 using stdplus::fd::Fd;
31 stdplus::fd::Fd&& fd = in writePattern()
32 stdplus::fd::open(devPath, stdplus::fd::OpenAccess::WriteOnly); in writePattern()
33 writePattern(util::findSizeOfBlockDevice(devPath), fd); in writePattern()
40 * @param[in] fd - the stdplus file descriptor
42 void writePattern(uint64_t driveSize, Fd& fd);
49 stdplus::fd::Fd&& fd = in verifyPattern()
50 stdplus::fd::open(devPath, stdplus::fd::OpenAccess::ReadOnly); in verifyPattern()
[all …]
/openbmc/openbmc/meta-openembedded/meta-oe/classes/
H A Dfitimage.bbclass137 def fitimage_emit_fit_header(d, fd):
138 fd.write('/dts-v1/;\n\n/ {\n')
139 fd.write(d.expand('\tdescription = "fitImage for ${DISTRO_NAME}/${PV}/${MACHINE}";\n'))
140 fd.write('\t#address-cells = <1>;\n')
145 def fitimage_emit_fit_footer(d, fd):
146 fd.write('};\n')
151 def fitimage_emit_section_start(d, fd, section):
152 fd.write(f'\t{section} {{\n')
157 def fitimage_emit_section_end(d, fd):
158 fd.write('\t};\n')
[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/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()
96 /* wvmcs(cs->accel->fd, VMCS_GUEST_CR2, env->cr[2]); */ 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()
[all …]
/openbmc/qemu/migration/
H A Dfd.c2 * QEMU live migration via generic fd
19 #include "fd.h"
28 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()
[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()
58 error_prepend(errp, "Could not parse remote object fd %s:", str); 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()
79 /* fd came from the command line. Fetch updated value from cpr state. */ in iommufd_backend_complete()
[all …]
/openbmc/dbus-sensors/src/
H A DFileHandle.cpp15 fd(open(name.c_str(), mode)) in FileHandle()
17 if (fd < 0) in FileHandle()
23 FileHandle::FileHandle(int fdIn) : fd(fdIn) {}; in FileHandle()
25 FileHandle::FileHandle(FileHandle&& in) noexcept : fd(in.fd) in FileHandle()
27 in.fd = -1; in FileHandle()
32 fd = in.fd; in operator =()
33 in.fd = -1; in operator =()
39 if (fd >= 0) in ~FileHandle()
41 int r = close(fd); in ~FileHandle()
44 lg2::error("Failed to close fd: '{FD}'", "FD", fd); in ~FileHandle()
[all …]
/openbmc/qemu/net/
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 …]
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 …]
/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/phosphor-power/test/
H A Dfile_descriptor_tests.cpp33 * @param[in] fd - File descriptor
36 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()
[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()
108 printf("%s: ERROR ret %ld, fd %ld, len %zu memp %p\n", in smh_read()
[all …]
/openbmc/qemu/tests/qemu-iotests/
H A Dqcow2_format.py101 def __init__(self, fd=None, offset=None, data=None): argument
104 1. Specify data. fd and offset must be None.
105 2. Specify fd and offset, data must be None. offset may be omitted
106 in this case, than current position of fd is used.
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)
[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/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/qemu/roms/
H A Dedk2-build.config46 cpy1 = FV/OVMF_CODE.fd edk2-i386-code.fd
47 cpy2 = FV/OVMF_VARS.fd edk2-i386-vars.fd
57 cpy1 = FV/OVMF_CODE.fd edk2-i386-secure-code.fd
69 cpy1 = FV/OVMF_CODE.fd edk2-x86_64-code.fd
79 cpy1 = FV/OVMF_CODE.fd edk2-x86_64-secure-code.fd
88 cpy1 = FV/MICROVM.fd edk2-x86_64-microvm.fd
102 cpy1 = FV/QEMU_EFI.fd edk2-arm-code.fd
103 cpy2 = FV/QEMU_VARS.fd edk2-arm-vars.fd
104 pad1 = edk2-arm-code.fd 64m
105 pad2 = edk2-arm-vars.fd 64m
[all …]

12345678910>>...52