| /openbmc/libpldm/src/firmware_device/ |
| H A D | fd.c | 111 static void pldm_fd_set_state(struct pldm_fd *fd, in pldm_fd_set_state() argument 117 if (fd->state == state) { in pldm_fd_set_state() 121 fd->prev_state = fd->state; in pldm_fd_set_state() 122 fd->state = state; in pldm_fd_set_state() 126 static void pldm_fd_set_idle(struct pldm_fd *fd, in pldm_fd_set_idle() argument 129 fd->prev_state = fd->state; in pldm_fd_set_idle() 130 fd->state = PLDM_FD_STATE_IDLE; in pldm_fd_set_idle() 131 fd->reason = reason; in pldm_fd_set_idle() 132 fd->ua_address_set = false; in pldm_fd_set_idle() 136 static void pldm_fd_idle_timeout(struct pldm_fd *fd) in pldm_fd_idle_timeout() argument [all …]
|
| /openbmc/qemu/target/loongarch/tcg/ |
| H A D | fpu_helper.c | 95 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 D | fd-trans.h | 49 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/phosphor-power/test/ |
| H A D | file_descriptor_tests.cpp | 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() 69 EXPECT_TRUE(isValid(fd)); in TEST() [all …]
|
| /openbmc/gpioplus/src/gpioplus/internal/ |
| H A D | fd.cpp | 16 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 D | sys.cpp | 23 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 D | sys.hpp | 21 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 D | 9p-util-darwin.c | 18 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 D | file_descriptor.hpp | 31 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 D | file_descriptor.hpp | 31 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 D | file_descriptor.hpp | 33 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/u-boot/arch/arm/lib/ |
| H A D | semihosting.c | 48 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 D | gen_fixtures.py | 185 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/migration/ |
| H A D | fd.c | 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() 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 D | fds.c | 38 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 D | qcow2_format.py | 101 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 D | mmap-alloc.c | 33 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 D | fsl_dpaa_fd.h | 38 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 D | test-util-sockets.c | 30 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/dbus-sensors/src/ |
| H A D | FileHandle.cpp | 15 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/chardev/ |
| H A D | char-parallel.c | 54 int fd; member 65 if (ioctl(s->fd, PPSETMODE, &m) < 0) { in pp_hw_mode() 76 int fd = drv->fd; in pp_ioctl() local 81 if (ioctl(fd, PPRDATA, &b) < 0) { in pp_ioctl() 88 if (ioctl(fd, PPWDATA, &b) < 0) { in pp_ioctl() 93 if (ioctl(fd, PPRCONTROL, &b) < 0) { in pp_ioctl() 103 if (ioctl(fd, PPWCONTROL, &b) < 0) { in pp_ioctl() 108 if (ioctl(fd, PPRSTATUS, &b) < 0) { in pp_ioctl() 114 if (ioctl(fd, PPDATADIR, (int *)arg) < 0) { in pp_ioctl() 121 int n = read(fd, parg->buffer, parg->count); in pp_ioctl() [all …]
|
| /openbmc/witherspoon-pfault-analysis/ |
| H A D | file.hpp | 30 FileDescriptor(int fd) : fd(fd) {} in FileDescriptor() argument 34 if (fd >= 0) in ~FileDescriptor() 36 close(fd); in ~FileDescriptor() 42 return fd; in operator ()() 47 return fd != -1; in operator bool() 52 if (fd >= 0) in set() 54 close(fd); in set() 57 fd = descriptor; in set() 64 int fd = -1; member in witherspoon::power::util::FileDescriptor
|
| /openbmc/gpioplus/test/internal/ |
| H A D | fd.cpp | 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() 108 Fd fd(path, flags, &mock); in TEST_F() local 109 EXPECT_EQ(expected_fd, *fd); in TEST_F() [all …]
|
| /openbmc/phosphor-bmc-code-mgmt/test/common/software/ |
| H A D | software_update.cpp | 31 sdbusplus::async::context& ctx, int fd, bool expectNewVersion) in testSoftwareUpdateCommon() argument 52 co_await client.start_update(fd, RequestedApplyTimes::Immediate); in testSoftwareUpdateCommon() 99 int fd = memfd_create("test_memfd", 0); in makeUpdateFd() local 100 EXPECT_GE(fd, 0); in makeUpdateFd() 102 if (fd < 0) in makeUpdateFd() 104 return fd; in makeUpdateFd() 107 debug("create fd {FD}", "FD", fd); in makeUpdateFd() 123 ssize_t bytes_written = write(fd, (void*)buf.get(), size_out); in makeUpdateFd() 128 close(fd); in makeUpdateFd() 132 EXPECT_EQ(lseek(fd, 0, SEEK_SET), 0) in makeUpdateFd() [all …]
|
| /openbmc/estoraged/include/ |
| H A D | zero.hpp | 14 using stdplus::fd::Fd; 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() 46 void verifyZero(uint64_t driveSize, Fd& fd); 53 stdplus::fd::Fd&& fd = in verifyZero() 54 stdplus::fd::open(devPath, stdplus::fd::OpenAccess::ReadOnly); in verifyZero() 55 verifyZero(util::findSizeOfBlockDevice(devPath), fd); in verifyZero()
|