Home
last modified time | relevance | path

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

12345678910>>...129

/openbmc/linux/tools/testing/selftests/memfd/
H A Dmemfd_test.c51 static ssize_t fd2name(int fd, char *buf, size_t bufsize) in fd2name() argument
57 size = snprintf(buf1, PATH_MAX, "/proc/self/fd/%d", fd); in fd2name()
59 printf("snprintf(%d) failed on %m\n", fd); in fd2name()
77 int r, fd; in mfd_assert_new() local
79 fd = sys_memfd_create(name, flags); in mfd_assert_new()
80 if (fd < 0) { in mfd_assert_new()
86 r = ftruncate(fd, sz); in mfd_assert_new()
92 return fd; in mfd_assert_new()
97 int fd = open("/proc/sys/vm/memfd_noexec", O_WRONLY | O_CLOEXEC); in sysctl_assert_write() local
99 if (fd < 0) { in sysctl_assert_write()
[all …]
/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 …]
/openbmc/libpldm/src/firmware_device/
H A Dfd.c14 #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/qemu/target/loongarch/tcg/
H A Dfpu_helper.c88 uint64_t fd; in helper_fadd_s() local
90 fd = nanbox_s(float32_add((uint32_t)fj, (uint32_t)fk, &env->fp_status)); in helper_fadd_s()
92 return fd; in helper_fadd_s()
97 uint64_t fd; in helper_fadd_d() local
99 fd = float64_add(fj, fk, &env->fp_status); in helper_fadd_d()
101 return fd; in helper_fadd_d()
106 uint64_t fd; in helper_fsub_s() local
108 fd = nanbox_s(float32_sub((uint32_t)fj, (uint32_t)fk, &env->fp_status)); in helper_fsub_s()
110 return fd; in helper_fsub_s()
115 uint64_t fd; in helper_fsub_d() local
[all …]
/openbmc/linux/drivers/clk/
H A Dclk-fractional-divider.c53 static inline u32 clk_fd_readl(struct clk_fractional_divider *fd) in clk_fd_readl() argument
55 if (fd->flags & CLK_FRAC_DIVIDER_BIG_ENDIAN) in clk_fd_readl()
56 return ioread32be(fd->reg); in clk_fd_readl()
58 return readl(fd->reg); in clk_fd_readl()
61 static inline void clk_fd_writel(struct clk_fractional_divider *fd, u32 val) in clk_fd_writel() argument
63 if (fd->flags & CLK_FRAC_DIVIDER_BIG_ENDIAN) in clk_fd_writel()
64 iowrite32be(val, fd->reg); in clk_fd_writel()
66 writel(val, fd->reg); in clk_fd_writel()
71 struct clk_fractional_divider *fd = to_clk_fd(hw); in clk_fd_get_div() local
77 if (fd->lock) in clk_fd_get_div()
[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()
61 error_setg(errp, "No fd named %s", fdname); in monitor_get_fd()
[all …]
/openbmc/linux/fs/hfs/
H A Dbfind.c15 int hfs_find_init(struct hfs_btree *tree, struct hfs_find_data *fd) in hfs_find_init() argument
19 fd->tree = tree; in hfs_find_init()
20 fd->bnode = NULL; in hfs_find_init()
24 fd->search_key = ptr; in hfs_find_init()
25 fd->key = ptr + tree->max_key_len + 2; in hfs_find_init()
44 void hfs_find_exit(struct hfs_find_data *fd) in hfs_find_exit() argument
46 hfs_bnode_put(fd->bnode); in hfs_find_exit()
47 kfree(fd->search_key); in hfs_find_exit()
49 fd->tree->cnid, __builtin_return_address(0)); in hfs_find_exit()
50 mutex_unlock(&fd->tree->tree_lock); in hfs_find_exit()
[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/linux/fs/hfsplus/
H A Dbfind.c15 int hfs_find_init(struct hfs_btree *tree, struct hfs_find_data *fd) in hfs_find_init() argument
19 fd->tree = tree; in hfs_find_init()
20 fd->bnode = NULL; in hfs_find_init()
24 fd->search_key = ptr; in hfs_find_init()
25 fd->key = ptr + tree->max_key_len + 2; in hfs_find_init()
33 void hfs_find_exit(struct hfs_find_data *fd) in hfs_find_exit() argument
35 hfs_bnode_put(fd->bnode); in hfs_find_exit()
36 kfree(fd->search_key); in hfs_find_exit()
38 fd->tree->cnid, __builtin_return_address(0)); in hfs_find_exit()
39 mutex_unlock(&fd->tree->tree_lock); in hfs_find_exit()
[all …]
/openbmc/linux/include/linux/
H A Dfile.h3 * Wrapper functions for accessing the file_struct fd array.
36 struct fd { struct
43 static inline void fdput(struct fd fd) in fdput() argument
45 if (fd.flags & FDPUT_FPUT) in fdput()
46 fput(fd.file); in fdput()
49 extern struct file *fget(unsigned int fd);
50 extern struct file *fget_raw(unsigned int fd);
51 extern struct file *fget_task(struct task_struct *task, unsigned int fd);
52 extern unsigned long __fdget(unsigned int fd);
53 extern unsigned long __fdget_raw(unsigned int fd);
[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/linux/tools/perf/tests/
H A Dwp.c16 #define WP_TEST_ASSERT_VAL(fd, text, val) \ argument
19 wp_read(fd, &count, sizeof(long long)); \
27 static int wp_read(int fd, long long *count, int size) in wp_read() argument
29 int ret = read(fd, count, size); in wp_read()
56 int fd; in __event() local
60 fd = sys_perf_event_open(&attr, 0, -1, -1, in __event()
62 if (fd < 0) { in __event()
63 fd = -errno; in __event()
67 return fd; in __event()
77 int fd; in test__wp_ro()
[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/linux/fs/
H A Dfile.c7 * Manage the dynamic fd arrays in the process files_struct.
37 kvfree(fdt->fd); in __free_fdtable()
52 * Copy 'count' fd bits from the old table to the new table and clear the extra
81 memcpy(nfdt->fd, ofdt->fd, cpy); in copy_fdtable()
82 memset((char *)nfdt->fd + cpy, 0, set); in copy_fdtable()
136 fdt->fd = data; in alloc_fdtable()
152 kvfree(fdt->fd); in alloc_fdtable()
161 * This function will allocate a new fdtable and both fd array and fdset, of
246 static inline void __set_close_on_exec(unsigned int fd, struct fdtable *fdt) in __set_close_on_exec() argument
248 __set_bit(fd, fdt->close_on_exec); in __set_close_on_exec()
[all …]
/openbmc/linux/arch/um/os-Linux/
H A Dfile.c43 int os_stat_fd(const int fd, struct uml_stat *ubuf) in os_stat_fd() argument
48 CATCH_EINTR(err = fstat64(fd, &sbuf)); in os_stat_fd()
88 int os_ioctl_generic(int fd, unsigned int cmd, unsigned long arg) in os_ioctl_generic() argument
92 err = ioctl(fd, cmd, arg); in os_ioctl_generic()
100 int os_get_ifname(int fd, char* namebuf) in os_get_ifname() argument
102 if (ioctl(fd, SIOCGIFNAME, namebuf) < 0) in os_get_ifname()
108 int os_set_slip(int fd) in os_set_slip() argument
113 if (ioctl(fd, TIOCSETD, &disc) < 0) in os_set_slip()
117 if (ioctl(fd, SIOCSIFENCAP, &sencap) < 0) in os_set_slip()
123 int os_mode_fd(int fd, int mode) in os_mode_fd() argument
[all …]
/openbmc/linux/drivers/clk/ti/
H A Dfapll.c71 struct fapll_data *fd; member
79 static bool ti_fapll_clock_is_bypass(struct fapll_data *fd) in ti_fapll_clock_is_bypass() argument
81 u32 v = readl_relaxed(fd->base); in ti_fapll_clock_is_bypass()
83 if (fd->bypass_bit_inverted) in ti_fapll_clock_is_bypass()
89 static void ti_fapll_set_bypass(struct fapll_data *fd) in ti_fapll_set_bypass() argument
91 u32 v = readl_relaxed(fd->base); in ti_fapll_set_bypass()
93 if (fd->bypass_bit_inverted) in ti_fapll_set_bypass()
97 writel_relaxed(v, fd->base); in ti_fapll_set_bypass()
100 static void ti_fapll_clear_bypass(struct fapll_data *fd) in ti_fapll_clear_bypass() argument
102 u32 v = readl_relaxed(fd->base); in ti_fapll_clear_bypass()
[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 …]
/openbmc/linux/tools/perf/tests/attr/
H A Dtest-stat-detailed-29 fd=1
15 fd=2
21 fd=3
27 fd=4
33 fd=5
40 fd=6
47 fd=7
54 fd=8
61 fd=9
68 fd=10
[all …]
H A Dtest-stat-detailed-39 fd=1
15 fd=2
21 fd=3
27 fd=4
33 fd=5
40 fd=6
47 fd=7
54 fd=8
61 fd=9
68 fd=10
[all …]
/openbmc/linux/tools/lib/perf/
H A Devsel.c46 #define FD(_evsel, _cpu_map_idx, _thread) \ macro
47 ((int *)xyarray__entry(_evsel->fd, _cpu_map_idx, _thread))
54 evsel->fd = xyarray__new(ncpus, nthreads, sizeof(int)); in perf_evsel__alloc_fd()
56 if (evsel->fd) { in perf_evsel__alloc_fd()
61 int *fd = FD(evsel, idx, thread); in perf_evsel__alloc_fd() local
63 if (fd) in perf_evsel__alloc_fd()
64 *fd = -1; in perf_evsel__alloc_fd()
69 return evsel->fd != NULL ? 0 : -ENOMEM; in perf_evsel__alloc_fd()
90 int *fd; in get_group_fd() local
101 if (!leader->fd) in get_group_fd()
[all …]
/openbmc/linux/tools/testing/vsock/
H A Dvsock_test.c40 int fd; in test_stream_connection_reset() local
42 fd = socket(AF_VSOCK, SOCK_STREAM, 0); in test_stream_connection_reset()
46 ret = connect(fd, &addr.sa, sizeof(addr.svm)); in test_stream_connection_reset()
60 close(fd); in test_stream_connection_reset()
76 int fd; in test_stream_bind_only_client() local
81 fd = socket(AF_VSOCK, SOCK_STREAM, 0); in test_stream_bind_only_client()
85 ret = connect(fd, &addr.sa, sizeof(addr.svm)); in test_stream_bind_only_client()
102 close(fd); in test_stream_bind_only_client()
117 int fd; in test_stream_bind_only_server() local
119 fd = socket(AF_VSOCK, SOCK_STREAM, 0); in test_stream_bind_only_server()
[all …]
/openbmc/linux/drivers/scsi/
H A Dfdomain.c123 static inline void fdomain_make_bus_idle(struct fdomain *fd) in fdomain_make_bus_idle() argument
125 outb(0, fd->base + REG_BCTL); in fdomain_make_bus_idle()
126 outb(0, fd->base + REG_MCTL); in fdomain_make_bus_idle()
127 if (fd->chip == tmc18c50 || fd->chip == tmc18c30) in fdomain_make_bus_idle()
130 fd->base + REG_ACTL); in fdomain_make_bus_idle()
132 outb(ACTL_RESET | PARITY_MASK, fd->base + REG_ACTL); in fdomain_make_bus_idle()
186 struct fdomain *fd = shost_priv(sh); in fdomain_select() local
188 outb(BCTL_BUSEN | BCTL_SEL, fd->base + REG_BCTL); in fdomain_select()
189 outb(BIT(sh->this_id) | BIT(target), fd->base + REG_SCSI_DATA_NOACK); in fdomain_select()
192 outb(PARITY_MASK, fd->base + REG_ACTL); in fdomain_select()
[all …]
/openbmc/linux/tools/testing/selftests/iommu/
H A Diommufd_fail_nth.c31 int fd; in writeat() local
33 fd = openat(dfd, fn, O_WRONLY); in writeat()
34 if (fd == -1) in writeat()
36 res = write(fd, val, val_len); in writeat()
38 close(fd); in writeat()
207 int fd; in FIXTURE() local
213 self->fd = -1; in FIXTURE_SETUP()
222 /* The access FD holds the iommufd open until it closes */ in FIXTURE_TEARDOWN()
226 teardown_iommufd(self->fd, _metadata); in FIXTURE_TEARDOWN()
238 self->fd = open("/dev/iommu", O_RDWR); in TEST_FAIL_NTH()
[all …]
/openbmc/qemu/linux-user/
H A Dfd-trans.h39 static inline TargetFdDataFunc fd_trans_target_to_host_data(int fd) in fd_trans_target_to_host_data() argument
41 if (fd < 0) { in fd_trans_target_to_host_data()
46 if (fd < target_fd_max && target_fd_trans[fd]) { in fd_trans_target_to_host_data()
47 return target_fd_trans[fd]->target_to_host_data; in fd_trans_target_to_host_data()
52 static inline TargetFdDataFunc fd_trans_host_to_target_data(int fd) in fd_trans_host_to_target_data() argument
54 if (fd < 0) { in fd_trans_host_to_target_data()
59 if (fd < target_fd_max && target_fd_trans[fd]) { in fd_trans_host_to_target_data()
60 return target_fd_trans[fd]->host_to_target_data; in fd_trans_host_to_target_data()
65 static inline TargetFdAddrFunc fd_trans_target_to_host_addr(int fd) in fd_trans_target_to_host_addr() argument
67 if (fd < 0) { in fd_trans_target_to_host_addr()
[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 …]

12345678910>>...129