Home
last modified time | relevance | path

Searched full:pfd (Results 1 – 25 of 103) sorted by relevance

12345

/openbmc/linux/drivers/clk/imx/
H A Dclk-pfdv2.c19 * struct clk_pfdv2 - IMX PFD clock
21 * @reg: PFD register address
43 static int clk_pfdv2_wait(struct clk_pfdv2 *pfd) in clk_pfdv2_wait() argument
47 return readl_poll_timeout(pfd->reg, val, val & (1 << pfd->vld_bit), in clk_pfdv2_wait()
53 struct clk_pfdv2 *pfd = to_clk_pfdv2(hw); in clk_pfdv2_enable() local
58 val = readl_relaxed(pfd->reg); in clk_pfdv2_enable()
59 val &= ~(1 << pfd->gate_bit); in clk_pfdv2_enable()
60 writel_relaxed(val, pfd->reg); in clk_pfdv2_enable()
63 return clk_pfdv2_wait(pfd); in clk_pfdv2_enable()
68 struct clk_pfdv2 *pfd = to_clk_pfdv2(hw); in clk_pfdv2_disable() local
[all …]
H A Dclk-pfd.c15 * struct clk_pfd - IMX PFD clock
17 * @reg: PFD register address
18 * @idx: the index of PFD encoded in the register
20 * PFD clock found on i.MX6 series. Each register for PFD has 4 clk_pfd
38 struct clk_pfd *pfd = to_clk_pfd(hw); in clk_pfd_enable() local
40 writel_relaxed(1 << ((pfd->idx + 1) * 8 - 1), pfd->reg + CLR); in clk_pfd_enable()
47 struct clk_pfd *pfd = to_clk_pfd(hw); in clk_pfd_disable() local
49 writel_relaxed(1 << ((pfd->idx + 1) * 8 - 1), pfd->reg + SET); in clk_pfd_disable()
55 struct clk_pfd *pfd = to_clk_pfd(hw); in clk_pfd_recalc_rate() local
57 u8 frac = (readl_relaxed(pfd->reg) >> (pfd->idx * 8)) & 0x3f; in clk_pfd_recalc_rate()
[all …]
/openbmc/linux/tools/testing/selftests/net/af_unix/
H A Dtest_unix_oob.c94 int read_data(int pfd, char *buf, int size) in read_data() argument
99 len = read(pfd, buf, size); in read_data()
107 static void wait_for_data(int pfd, int event) in wait_for_data() argument
111 pfds[0].fd = pfd; in wait_for_data()
177 int lfd, pfd; in main() local
213 pfd = accept(lfd, (struct sockaddr *) &paddr, &len); in main()
214 fcntl(pfd, F_SETOWN, getpid()); in main()
224 wait_for_data(pfd, POLLPRI); in main()
225 read_oob(pfd, &oob); in main()
226 len = read_data(pfd, buf, 1024); in main()
[all …]
H A Dscm_pidfd.c184 /* send(pfd, "x", sizeof(char), 0) */ in cmsg_check()
377 int pfd; in TEST_F() local
407 pfd = accept(self->server, NULL, NULL); in TEST_F()
408 ASSERT_NE(-1, pfd); in TEST_F()
410 pfd = self->server; in TEST_F()
418 …err = sendto(pfd, "x", sizeof(char), 0, (struct sockaddr *)&self->client_addr->listen_addr, self->… in TEST_F()
421 err = send(pfd, "x", sizeof(char), 0); in TEST_F()
425 close(pfd); in TEST_F()
/openbmc/qemu/util/
H A Daio-win32.c33 GPollFD pfd; member
48 g_source_remove_poll(&ctx->source, &node->pfd); in aio_remove_fd_handler()
54 node->pfd.revents = 0; in aio_remove_fd_handler()
86 if (old_node->pfd.fd == s && !old_node->deleted) { in aio_set_fd_handler()
97 node->pfd.fd = s; in aio_set_fd_handler()
99 node->pfd.events = 0; in aio_set_fd_handler()
101 node->pfd.events |= G_IO_IN; in aio_set_fd_handler()
104 node->pfd.events |= G_IO_OUT; in aio_set_fd_handler()
159 node->pfd.fd = (uintptr_t)event_notifier_get_handle(e); in aio_set_event_notifier()
160 node->pfd.events = G_IO_IN; in aio_set_event_notifier()
[all …]
H A Dfdmon-epoll.c40 .events = new_node ? epoll_events_from_pfd(new_node->pfd.events) : 0, in fdmon_epoll_update()
45 r = epoll_ctl(ctx->epollfd, EPOLL_CTL_DEL, old_node->pfd.fd, &event); in fdmon_epoll_update()
47 r = epoll_ctl(ctx->epollfd, EPOLL_CTL_ADD, new_node->pfd.fd, &event); in fdmon_epoll_update()
49 r = epoll_ctl(ctx->epollfd, EPOLL_CTL_MOD, new_node->pfd.fd, &event); in fdmon_epoll_update()
60 GPollFD pfd = { in fdmon_epoll_wait() local
69 ret = qemu_poll_ns(&pfd, 1, timeout); in fdmon_epoll_wait()
109 if (QLIST_IS_INSERTED(node, node_deleted) || !node->pfd.events) { in fdmon_epoll_try_enable()
112 event.events = epoll_events_from_pfd(node->pfd.events); in fdmon_epoll_try_enable()
114 r = epoll_ctl(ctx->epollfd, EPOLL_CTL_ADD, node->pfd.fd, &event); in fdmon_epoll_try_enable()
H A Daio-posix.c41 node->pfd.revents = revents; in aio_add_ready_handler()
58 if (node->pfd.fd == fd) { in find_aio_handler()
76 g_source_remove_poll(&ctx->source, &node->pfd); in aio_remove_fd_handler()
79 node->pfd.revents = 0; in aio_remove_fd_handler()
130 node->pfd.events = 0; in aio_set_fd_handler()
149 new_node->pfd.fd = fd; in aio_set_fd_handler()
151 new_node->pfd = node->pfd; in aio_set_fd_handler()
153 g_source_add_poll(&ctx->source, &new_node->pfd); in aio_set_fd_handler()
155 new_node->pfd.events = (io_read ? G_IO_IN | G_IO_HUP | G_IO_ERR : 0); in aio_set_fd_handler()
156 new_node->pfd.events |= (io_write ? G_IO_OUT | G_IO_ERR : 0); in aio_set_fd_handler()
[all …]
/openbmc/linux/tools/testing/selftests/bpf/prog_tests/
H A Dfind_vma.c28 int pfd; in open_pe() local
36 pfd = syscall(__NR_perf_event_open, &attr, 0, -1, -1, PERF_FLAG_FD_CLOEXEC); in open_pe()
38 return pfd >= 0 ? pfd : -errno; in open_pe()
53 int pfd, i; in test_find_vma_pe() local
56 pfd = open_pe(); in test_find_vma_pe()
57 if (pfd < 0) { in test_find_vma_pe()
58 if (pfd == -ENOENT || pfd == -EOPNOTSUPP) { in test_find_vma_pe()
63 if (!ASSERT_GE(pfd, 0, "perf_event_open")) in test_find_vma_pe()
67 link = bpf_program__attach_perf_event(skel->progs.handle_pe, pfd); in test_find_vma_pe()
77 close(pfd); in test_find_vma_pe()
H A Dperf_branches.c106 int pfd; in test_perf_branches_hw() local
116 pfd = syscall(__NR_perf_event_open, &attr, -1, 0, -1, PERF_FLAG_FD_CLOEXEC); in test_perf_branches_hw()
122 if (pfd < 0) { in test_perf_branches_hw()
129 if (CHECK(pfd < 0, "perf_event_open", "err %d errno %d\n", in test_perf_branches_hw()
130 pfd, errno)) in test_perf_branches_hw()
134 test_perf_branches_common(pfd, check_good_sample); in test_perf_branches_hw()
136 close(pfd); in test_perf_branches_hw()
147 int pfd; in test_perf_branches_no_hw() local
155 pfd = syscall(__NR_perf_event_open, &attr, -1, 0, -1, PERF_FLAG_FD_CLOEXEC); in test_perf_branches_no_hw()
156 if (CHECK(pfd < 0, "perf_event_open", "err %d\n", pfd)) in test_perf_branches_no_hw()
[all …]
H A Dperf_link.c31 int pfd = -1, link_fd = -1, err; in serial_test_perf_link() local
43 pfd = syscall(__NR_perf_event_open, &attr, -1, 0, -1, PERF_FLAG_FD_CLOEXEC); in serial_test_perf_link()
44 if (!ASSERT_GE(pfd, 0, "perf_fd")) in serial_test_perf_link()
51 link_fd = bpf_link_create(bpf_program__fd(skel->progs.handler), pfd, in serial_test_perf_link()
87 if (pfd >= 0) in serial_test_perf_link()
88 close(pfd); in serial_test_perf_link()
H A Dpe_preserve_elems.c12 int err, key = 0, pfd = -1, mfd = bpf_map__fd(map); in test_one_map() local
20 pfd = syscall(__NR_perf_event_open, &attr, 0 /* pid */, in test_one_map()
22 if (CHECK(pfd < 0, "perf_event_open", "failed\n")) in test_one_map()
25 err = bpf_map_update_elem(mfd, &key, &pfd, BPF_ANY); in test_one_map()
26 close(pfd); in test_one_map()
/openbmc/linux/tools/testing/selftests/filesystems/epoll/
H A Depoll_wakeup_test.c63 struct pollfd pfd; in waiter_entry1ap() local
67 pfd.fd = ctx->efd[0]; in waiter_entry1ap()
68 pfd.events = POLLIN; in waiter_entry1ap()
69 if (poll(&pfd, 1, -1) > 0) { in waiter_entry1ap()
90 struct pollfd pfd; in waiter_entry1op() local
94 pfd.fd = ctx->efd[0]; in waiter_entry1op()
95 pfd.events = POLLIN; in waiter_entry1op()
96 if (poll(&pfd, 1, -1) > 0) { in waiter_entry1op()
117 struct pollfd pfd; in waiter_entry2ap() local
121 pfd.fd = ctx->efd[0]; in waiter_entry2ap()
[all …]
/openbmc/linux/tools/testing/selftests/nsfs/
H A Downer.c28 int pfd[2], ns, uns, init_uns; in main() local
34 if (pipe(pfd)) in main()
44 close(pfd[0]); in main()
45 close(pfd[1]); in main()
50 close(pfd[1]); in main()
51 if (read(pfd[0], &c, 1) != 0) in main()
53 close(pfd[0]); in main()
/openbmc/qemu/chardev/
H A Dchar-pty.c91 GPollFD pfd; in pty_chr_update_read_handler() local
95 pfd.fd = fioc->fd; in pty_chr_update_read_handler()
96 pfd.events = G_IO_OUT; in pty_chr_update_read_handler()
97 pfd.revents = 0; in pty_chr_update_read_handler()
98 rc = RETRY_ON_EINTR(g_poll(&pfd, 1, 0)); in pty_chr_update_read_handler()
101 if (pfd.revents & G_IO_HUP) { in pty_chr_update_read_handler()
111 GPollFD pfd; in char_pty_chr_write() local
122 pfd.fd = QIO_CHANNEL_FILE(s->ioc)->fd; in char_pty_chr_write()
123 pfd.events = G_IO_OUT; in char_pty_chr_write()
124 pfd.revents = 0; in char_pty_chr_write()
[all …]
/openbmc/linux/tools/testing/selftests/net/
H A Dpsock_tpacket.c222 struct pollfd pfd; in walk_v1_v2_rx() local
231 memset(&pfd, 0, sizeof(pfd)); in walk_v1_v2_rx()
232 pfd.fd = sock; in walk_v1_v2_rx()
233 pfd.events = POLLIN | POLLERR; in walk_v1_v2_rx()
234 pfd.revents = 0; in walk_v1_v2_rx()
265 poll(&pfd, 1, 1); in walk_v1_v2_rx()
371 struct pollfd pfd; in walk_tx() local
410 memset(&pfd, 0, sizeof(pfd)); in walk_tx()
411 pfd.fd = sock; in walk_tx()
412 pfd.events = POLLOUT | POLLERR; in walk_tx()
[all …]
H A Dudpgso_bench_rx.c94 struct pollfd pfd; in do_poll() local
97 pfd.events = POLLIN; in do_poll()
98 pfd.revents = 0; in do_poll()
99 pfd.fd = fd; in do_poll()
102 ret = poll(&pfd, 1, 10); in do_poll()
120 if (pfd.revents != POLLIN) in do_poll()
122 pfd.revents, POLLIN); in do_poll()
/openbmc/linux/arch/mips/alchemy/devboards/
H A Dplatform.c155 struct physmap_flash_data *pfd; in db1x_register_norflash() local
173 pfd = kzalloc(sizeof(struct physmap_flash_data), GFP_KERNEL); in db1x_register_norflash()
174 if (!pfd) in db1x_register_norflash()
227 pfd->width = width; in db1x_register_norflash()
228 pfd->parts = parts; in db1x_register_norflash()
229 pfd->nr_parts = 5; in db1x_register_norflash()
231 pd->dev.platform_data = pfd; in db1x_register_norflash()
241 kfree(pfd); in db1x_register_norflash()
/openbmc/linux/drivers/clk/
H A Dclk-versaclock3.c244 const struct vc3_pfd_data *pfd = vc3->data; in vc3_pfd_recalc_rate() local
249 regmap_read(vc3->regmap, pfd->offs, &prediv); in vc3_pfd_recalc_rate()
250 if (pfd->num == VC3_PFD1) { in vc3_pfd_recalc_rate()
252 if (prediv & pfd->mdiv1_bitmsk) { in vc3_pfd_recalc_rate()
260 } else if (pfd->num == VC3_PFD2) { in vc3_pfd_recalc_rate()
262 if (prediv & pfd->mdiv1_bitmsk) { in vc3_pfd_recalc_rate()
273 if (prediv & pfd->mdiv1_bitmsk) in vc3_pfd_recalc_rate()
279 if (prediv & pfd->mdiv2_bitmsk) in vc3_pfd_recalc_rate()
291 const struct vc3_pfd_data *pfd = vc3->data; in vc3_pfd_round_rate() local
303 if (pfd->num == VC3_PFD1 || pfd->num == VC3_PFD3) { in vc3_pfd_round_rate()
[all …]
/openbmc/linux/tools/gpio/
H A Dgpio-watch.c27 struct pollfd pfd; in main() local
55 pfd.fd = fd; in main()
56 pfd.events = POLLIN | POLLPRI; in main()
59 ret = poll(&pfd, 1, 5000); in main()
65 rd = read(pfd.fd, &chg, sizeof(chg)); in main()
/openbmc/linux/tools/testing/selftests/pidfd/
H A Dpidfd_wait.c98 int pfd[2]; in TEST() local
104 ASSERT_EQ(pipe(pfd), 0); in TEST()
111 close(pfd[1]); in TEST()
113 ASSERT_EQ(read(pfd[0], buf, 1), 1); in TEST()
114 close(pfd[0]); in TEST()
119 close(pfd[0]); in TEST()
128 ASSERT_EQ(write(pfd[1], "C", 1), 1); in TEST()
129 close(pfd[1]); in TEST()
/openbmc/linux/tools/testing/selftests/sched/
H A Dcs_prctl_test.c68 int pfd[2]; member
157 close(ca->pfd[0]); in child_func_process()
161 ret = write(ca->pfd[1], &ca->thr_tids, sizeof(int) * ca->num_threads); in child_func_process()
163 printf("write failed on pfd[%d] - error (%s)\n", in child_func_process()
164 ca->pfd[1], strerror(errno)); in child_func_process()
166 close(ca->pfd[1]); in child_func_process()
183 if (pipe(proc[i].pfd) == -1) in create_processes()
189 close(proc[i].pfd[1]); in create_processes()
193 ret = read(proc[i].pfd[0], &proc[i].thr_tids, sizeof(int) * proc[i].num_threads); in create_processes()
195 printf("read failed on proc[%d].pfd[0] error (%s)\n", in create_processes()
[all …]
/openbmc/qemu/audio/
H A Dsndioaudio.c65 struct pollfd *pfd; in sndio_poll_clear() local
69 pfd = &self->pfds[i]; in sndio_poll_clear()
70 qemu_set_fd_handler(pfd->fd, NULL, NULL, NULL); in sndio_poll_clear()
136 struct pollfd *pfd; in sndio_poll_wait() local
158 pfd = &self->pfds[i]; in sndio_poll_wait()
159 if (pfd->fd < 0) { in sndio_poll_wait()
162 qemu_set_fd_handler(pfd->fd, in sndio_poll_wait()
163 (pfd->events & POLLIN) ? sndio_poll_in : NULL, in sndio_poll_wait()
164 (pfd->events & POLLOUT) ? sndio_poll_out : NULL, in sndio_poll_wait()
166 pfd->revents = 0; in sndio_poll_wait()
/openbmc/u-boot/drivers/pinctrl/mediatek/
H A Dpinctrl-mtk-common.c81 struct mtk_pin_field *pfd) in mtk_hw_pin_field_lookup() argument
104 /* Fill pfd from bits. For example 32-bit register applied is assumed in mtk_hw_pin_field_lookup()
107 pfd->offset = c->s_addr + c->x_addrs * (bits / c->sz_reg); in mtk_hw_pin_field_lookup()
108 pfd->bitpos = bits % c->sz_reg; in mtk_hw_pin_field_lookup()
109 pfd->mask = (1 << c->x_bits) - 1; in mtk_hw_pin_field_lookup()
111 /* pfd->next is used for indicating that bit wrapping-around happens in mtk_hw_pin_field_lookup()
115 pfd->next = pfd->bitpos + c->x_bits > c->sz_reg ? c->x_addrs : 0; in mtk_hw_pin_field_lookup()
121 int field, struct mtk_pin_field *pfd) in mtk_hw_pin_field_get() argument
134 return mtk_hw_pin_field_lookup(dev, pin, rc, pfd); in mtk_hw_pin_field_get()
/openbmc/linux/samples/timers/
H A Dhpet_example.c135 struct pollfd pfd; in hpet_poll() local
178 pfd.fd = fd; in hpet_poll()
179 pfd.events = POLLIN; in hpet_poll()
182 pfd.revents = 0; in hpet_poll()
184 if (poll(&pfd, 1, -1) < 0) in hpet_poll()
197 pfd.revents); in hpet_poll()
/openbmc/linux/samples/connector/
H A Ducon.c107 struct pollfd pfd; in main() local
188 pfd.fd = s; in main()
191 pfd.events = POLLIN; in main()
192 pfd.revents = 0; in main()
193 switch (poll(&pfd, 1, -1)) { in main()

12345