/linux-4.1.27/fs/ |
H A D | eventfd.c | 2 * fs/eventfd.c 21 #include <linux/eventfd.h> 29 * Every time that a write(2) is performed on an eventfd, the 41 * eventfd_signal - Adds @n to the eventfd counter. 42 * @ctx: [in] Pointer to the eventfd context. 43 * @n: [in] Value of the counter to be added to the eventfd internal counter. 83 * eventfd_ctx_get - Acquires a reference to the internal eventfd context. 84 * @ctx: [in] Pointer to the eventfd context. 86 * Returns: In case of success, returns a pointer to the eventfd context. 96 * eventfd_ctx_put - Releases a reference to the internal eventfd context. 97 * @ctx: [in] Pointer to eventfd context. 99 * The eventfd context reference must have been previously acquired either 145 * @ctx: [in] Pointer to eventfd context. 153 * This is used to atomically remove a wait queue entry from the eventfd wait 173 * eventfd_ctx_read - Reads the eventfd counter or wait if it is zero. 174 * @ctx: [in] Pointer to eventfd context. 183 * If @no_wait is zero, the function might sleep until the eventfd internal 295 seq_printf(m, "eventfd-count: %16llx\n", eventfd_show_fdinfo() 313 * eventfd_fget - Acquire a reference of an eventfd file descriptor. 316 * Returns a pointer to the eventfd file structure in case of success, or the 320 * -EINVAL : The @fd file descriptor is not an eventfd file. 339 * eventfd_ctx_fdget - Acquires a reference to the internal eventfd context. 342 * Returns a pointer to the internal eventfd context, otherwise the error 360 * eventfd_ctx_fileget - Acquires a reference to the internal eventfd context. 363 * Returns a pointer to the internal eventfd context, otherwise the error 366 * -EINVAL : The @fd file descriptor is not an eventfd file. 378 * eventfd_file_create - Creates an eventfd file pointer. 379 * @count: Initial eventfd counter value. 380 * @flags: Flags for the eventfd file. 382 * This function creates an eventfd file pointer, w/out installing it into 383 * the fd table. This is useful when the eventfd file is used during the 384 * initialization of data structures that require extra setup after the eventfd 385 * creation. So the eventfd creation is split into the file pointer creation 389 * Returns an eventfd file pointer, or a proper error pointer. 412 file = anon_inode_getfile("[eventfd]", &eventfd_fops, ctx, eventfd_file_create() 445 SYSCALL_DEFINE1(eventfd, unsigned int, count) SYSCALL_DEFINE1()
|
H A D | Makefile | 29 obj-$(CONFIG_EVENTFD) += eventfd.o
|
H A D | aio.c | 36 #include <linux/eventfd.h> 186 * this is the underlying eventfd context to deliver events to. 1126 * eventfd. The eventfd_signal() function is safe to be called aio_complete() 1526 * an eventfd() fd, and will be signaled for each completed io_submit_one()
|
/linux-4.1.27/virt/kvm/ |
H A D | eventfd.c | 2 * kvm eventfd support - use eventfd objects to signal various KVM events 32 #include <linux/eventfd.h> 52 * level triggered interrupts. The interrupt is asserted on eventfd 92 struct eventfd_ctx *eventfd; member in struct:_irqfd 178 eventfd_ctx_remove_wait_queue(irqfd->eventfd, &irqfd->wait, &cnt); irqfd_shutdown() 194 eventfd_ctx_put(irqfd->eventfd); irqfd_shutdown() 250 /* The eventfd is closing, detach from KVM */ irqfd_wakeup() 309 struct eventfd_ctx *eventfd = NULL, *resamplefd = NULL; kvm_irqfd_assign() local 334 eventfd = eventfd_ctx_fileget(f.file); kvm_irqfd_assign() 335 if (IS_ERR(eventfd)) { kvm_irqfd_assign() 336 ret = PTR_ERR(eventfd); kvm_irqfd_assign() 340 irqfd->eventfd = eventfd; kvm_irqfd_assign() 392 * a callback whenever someone signals the underlying eventfd kvm_irqfd_assign() 401 if (irqfd->eventfd != tmp->eventfd) kvm_irqfd_assign() 418 * Check if there was an event already pending on the eventfd kvm_irqfd_assign() 441 if (eventfd && !IS_ERR(eventfd)) kvm_irqfd_assign() 442 eventfd_ctx_put(eventfd); kvm_irqfd_assign() 529 struct eventfd_ctx *eventfd; kvm_irqfd_deassign() local 531 eventfd = eventfd_ctx_fdget(args->fd); kvm_irqfd_deassign() 532 if (IS_ERR(eventfd)) kvm_irqfd_deassign() 533 return PTR_ERR(eventfd); kvm_irqfd_deassign() 538 if (irqfd->eventfd == eventfd && irqfd->gsi == args->gsi) { kvm_irqfd_deassign() 553 eventfd_ctx_put(eventfd); kvm_irqfd_deassign() 639 * ioeventfd: translate a PIO/MMIO memory write to an eventfd signal. 641 * userspace can register a PIO/MMIO address with an eventfd for receiving 650 struct eventfd_ctx *eventfd; member in struct:_ioeventfd 666 eventfd_ctx_put(p->eventfd); ioeventfd_release() 726 eventfd_signal(p->eventfd, 1); ioeventfd_write() 779 struct eventfd_ctx *eventfd; kvm_assign_ioeventfd_idx() local 783 eventfd = eventfd_ctx_fdget(args->fd); kvm_assign_ioeventfd_idx() 784 if (IS_ERR(eventfd)) kvm_assign_ioeventfd_idx() 785 return PTR_ERR(eventfd); kvm_assign_ioeventfd_idx() 797 p->eventfd = eventfd; kvm_assign_ioeventfd_idx() 832 eventfd_ctx_put(eventfd); kvm_assign_ioeventfd_idx() 842 struct eventfd_ctx *eventfd; kvm_deassign_ioeventfd_idx() local 845 eventfd = eventfd_ctx_fdget(args->fd); kvm_deassign_ioeventfd_idx() 846 if (IS_ERR(eventfd)) kvm_deassign_ioeventfd_idx() 847 return PTR_ERR(eventfd); kvm_deassign_ioeventfd_idx() 855 p->eventfd != eventfd || kvm_deassign_ioeventfd_idx() 873 eventfd_ctx_put(eventfd); kvm_deassign_ioeventfd_idx()
|
/linux-4.1.27/arch/x86/kvm/ |
H A D | Makefile | 11 $(KVM)/eventfd.o $(KVM)/irqchip.o $(KVM)/vfio.o
|
/linux-4.1.27/tools/cgroup/ |
H A D | cgroup_event_listener.c | 17 #include <sys/eventfd.h> 46 efd = eventfd(0, 0); main() 48 err(1, "eventfd() failed"); main() 65 err(1, "Cannot read from eventfd"); main()
|
/linux-4.1.27/drivers/vfio/ |
H A D | virqfd.c | 2 * VFIO generic eventfd code for IRQFD support. 14 #include <linux/eventfd.h> 64 * The eventfd is closing, if the virqfd has not yet been virqfd_wakeup() 93 eventfd_ctx_remove_wait_queue(virqfd->eventfd, &virqfd->wait, &cnt); virqfd_shutdown() 95 eventfd_ctx_put(virqfd->eventfd); virqfd_shutdown() 143 virqfd->eventfd = ctx; vfio_virqfd_enable() 146 * virqfds can be released by closing the eventfd or directly vfio_virqfd_enable() 164 * a callback whenever someone signals the underlying eventfd. vfio_virqfd_enable() 172 * Check if there was an event already pending on the eventfd vfio_virqfd_enable()
|
/linux-4.1.27/arch/s390/kvm/ |
H A D | Makefile | 10 common-objs = $(KVM)/kvm_main.o $(KVM)/eventfd.o $(KVM)/async_pf.o $(KVM)/irqchip.o
|
/linux-4.1.27/include/linux/ |
H A D | vmpressure.h | 10 #include <linux/eventfd.h> 38 struct eventfd_ctx *eventfd, 41 struct eventfd_ctx *eventfd);
|
H A D | eventfd.h | 2 * include/linux/eventfd.h 18 * from eventfd, in order to leave a free define-space for 46 * Ugly ugly ugly error layer to support modules that uses eventfd but
|
H A D | timerfd.h | 21 * from eventfd, in order to leave a free define-space for
|
H A D | vfio.h | 121 struct eventfd_ctx *eventfd; member in struct:virqfd
|
H A D | vringh.h | 167 /* Do we need to fire the eventfd to notify the other side? */
|
/linux-4.1.27/mm/ |
H A D | vmpressure.c | 21 #include <linux/eventfd.h> 283 * vmpressure_register_event() - Bind vmpressure notifications to an eventfd 285 * @eventfd: eventfd context to link notifications with 288 * This function associates eventfd context with the vmpressure 290 * @eventfd. The @args parameter is a string that denotes pressure level 297 struct eventfd_ctx *eventfd, const char *args) vmpressure_register_event() 315 ev->efd = eventfd; vmpressure_register_event() 326 * vmpressure_unregister_event() - Unbind eventfd from vmpressure 328 * @eventfd: eventfd context that was used to link vmpressure with the @cg 330 * This function does internal manipulations to detach the @eventfd from 332 * associated with the @eventfd (but the @eventfd itself is not freed). 337 struct eventfd_ctx *eventfd) vmpressure_unregister_event() 344 if (ev->efd != eventfd) vmpressure_unregister_event() 378 * Make sure there is no pending work before eventfd infrastructure vmpressure_cleanup() 296 vmpressure_register_event(struct mem_cgroup *memcg, struct eventfd_ctx *eventfd, const char *args) vmpressure_register_event() argument 336 vmpressure_unregister_event(struct mem_cgroup *memcg, struct eventfd_ctx *eventfd) vmpressure_unregister_event() argument
|
H A D | memcontrol.c | 53 #include <linux/eventfd.h> 183 struct eventfd_ctx *eventfd; member in struct:mem_cgroup_threshold 211 struct eventfd_ctx *eventfd; member in struct:mem_cgroup_eventfd_list 223 * eventfd to signal userspace about the event. 225 struct eventfd_ctx *eventfd; member in struct:mem_cgroup_event 233 * on eventfd to send notification to userspace. 236 struct eventfd_ctx *eventfd, const char *args); 239 * the eventfd or on cgroup removing. This callback must be set, 243 struct eventfd_ctx *eventfd); 246 * userspace closes eventfd. 3602 eventfd_signal(t->entries[i].eventfd, 1); __mem_cgroup_threshold() 3614 eventfd_signal(t->entries[i].eventfd, 1); __mem_cgroup_threshold() 3654 eventfd_signal(ev->eventfd, 1); mem_cgroup_oom_notify_cb() 3669 struct eventfd_ctx *eventfd, const char *args, enum res_type type) __mem_cgroup_usage_register_event() 3715 new->entries[size - 1].eventfd = eventfd; __mem_cgroup_usage_register_event() 3752 struct eventfd_ctx *eventfd, const char *args) mem_cgroup_usage_register_event() 3754 return __mem_cgroup_usage_register_event(memcg, eventfd, args, _MEM); mem_cgroup_usage_register_event() 3758 struct eventfd_ctx *eventfd, const char *args) memsw_cgroup_usage_register_event() 3760 return __mem_cgroup_usage_register_event(memcg, eventfd, args, _MEMSWAP); memsw_cgroup_usage_register_event() 3764 struct eventfd_ctx *eventfd, enum res_type type) __mem_cgroup_usage_unregister_event() 3791 if (thresholds->primary->entries[i].eventfd != eventfd) __mem_cgroup_usage_unregister_event() 3809 if (thresholds->primary->entries[i].eventfd == eventfd) __mem_cgroup_usage_unregister_event() 3843 struct eventfd_ctx *eventfd) mem_cgroup_usage_unregister_event() 3845 return __mem_cgroup_usage_unregister_event(memcg, eventfd, _MEM); mem_cgroup_usage_unregister_event() 3849 struct eventfd_ctx *eventfd) memsw_cgroup_usage_unregister_event() 3851 return __mem_cgroup_usage_unregister_event(memcg, eventfd, _MEMSWAP); memsw_cgroup_usage_unregister_event() 3855 struct eventfd_ctx *eventfd, const char *args) mem_cgroup_oom_register_event() 3865 event->eventfd = eventfd; mem_cgroup_oom_register_event() 3870 eventfd_signal(eventfd, 1); mem_cgroup_oom_register_event() 3877 struct eventfd_ctx *eventfd) mem_cgroup_oom_unregister_event() 3884 if (ev->eventfd == eventfd) { mem_cgroup_oom_unregister_event() 4026 event->unregister_event(memcg, event->eventfd); memcg_event_remove() 4029 eventfd_signal(event->eventfd, 1); memcg_event_remove() 4031 eventfd_ctx_put(event->eventfd); memcg_event_remove() 4037 * Gets called on POLLHUP on eventfd when user closes it. 4134 event->eventfd = eventfd_ctx_fileget(efile.file); memcg_write_event_control() 4135 if (IS_ERR(event->eventfd)) { memcg_write_event_control() 4136 ret = PTR_ERR(event->eventfd); memcg_write_event_control() 4194 ret = event->register_event(memcg, event->eventfd, buf); memcg_write_event_control() 4214 eventfd_ctx_put(event->eventfd); memcg_write_event_control() 3668 __mem_cgroup_usage_register_event(struct mem_cgroup *memcg, struct eventfd_ctx *eventfd, const char *args, enum res_type type) __mem_cgroup_usage_register_event() argument 3751 mem_cgroup_usage_register_event(struct mem_cgroup *memcg, struct eventfd_ctx *eventfd, const char *args) mem_cgroup_usage_register_event() argument 3757 memsw_cgroup_usage_register_event(struct mem_cgroup *memcg, struct eventfd_ctx *eventfd, const char *args) memsw_cgroup_usage_register_event() argument 3763 __mem_cgroup_usage_unregister_event(struct mem_cgroup *memcg, struct eventfd_ctx *eventfd, enum res_type type) __mem_cgroup_usage_unregister_event() argument 3842 mem_cgroup_usage_unregister_event(struct mem_cgroup *memcg, struct eventfd_ctx *eventfd) mem_cgroup_usage_unregister_event() argument 3848 memsw_cgroup_usage_unregister_event(struct mem_cgroup *memcg, struct eventfd_ctx *eventfd) memsw_cgroup_usage_unregister_event() argument 3854 mem_cgroup_oom_register_event(struct mem_cgroup *memcg, struct eventfd_ctx *eventfd, const char *args) mem_cgroup_oom_register_event() argument 3876 mem_cgroup_oom_unregister_event(struct mem_cgroup *memcg, struct eventfd_ctx *eventfd) mem_cgroup_oom_unregister_event() argument
|
/linux-4.1.27/arch/arm64/kvm/ |
H A D | Makefile | 14 kvm-$(CONFIG_KVM_ARM_HOST) += $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o $(KVM)/eventfd.o
|
/linux-4.1.27/arch/arm/kvm/ |
H A D | Makefile | 18 kvm-arm-y = $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o $(KVM)/eventfd.o
|
/linux-4.1.27/arch/powerpc/kvm/ |
H A D | Makefile | 11 $(KVM)/eventfd.o 92 $(KVM)/eventfd.o \
|
/linux-4.1.27/include/uapi/linux/ |
H A D | vhost.h | 92 /* Specify an eventfd file descriptor to signal on log write. */ 106 /* The following ioctls use eventfd file descriptors to signal and poll 109 /* Set eventfd to poll for added buffers */ 111 /* Set eventfd to signal when buffers have beed used */ 113 /* Set eventfd to signal an error */
|
H A D | aio_abi.h | 102 * eventfd to signal AIO readiness to
|
H A D | vfio.h | 206 * The EVENTFD flag indicates the interrupt index supports eventfd based 256 * DATA_EVENTFD binds the specified ACTION to the provided __s32 eventfd. 258 * assigned or skip un-assigned interrupts. For example, to set an eventfd 282 #define VFIO_IRQ_SET_DATA_EVENTFD (1 << 2) /* Data is eventfd (s32) */
|
/linux-4.1.27/tools/usb/ffs-aio-example/multibuff/device_app/ |
H A D | aio_multibuff.c | 43 #include <sys/eventfd.h> 293 evfd = eventfd(0, 0); main() 295 perror("unable to open eventfd"); main() 335 /* enable eventfd notification */ main() 355 perror("unable to read eventfd"); main()
|
/linux-4.1.27/tools/usb/ffs-aio-example/simple/device_app/ |
H A D | aio_simple.c | 43 #include <sys/eventfd.h> 267 evfd = eventfd(0, 0); main() 269 perror("unable to open eventfd"); main() 305 perror("unable to read eventfd"); main() 327 /* enable eventfd notification */ main()
|
/linux-4.1.27/drivers/vhost/ |
H A D | vhost.h | 4 #include <linux/eventfd.h> 27 /* Poll a file (eventfd or socket) */
|
H A D | test.c | 10 #include <linux/eventfd.h> 63 /* Nothing new? Wait for eventfd to tell us they refilled. */ handle_vq()
|
H A D | vhost.c | 14 #include <linux/eventfd.h> 1357 * want to notify the guest, using eventfd. */ vhost_add_used() 1413 * want to notify the guest, using eventfd. */ vhost_add_used_n() 1485 /* This actually signals the guest, using eventfd. */ vhost_signal()
|
H A D | net.c | 10 #include <linux/eventfd.h> 342 /* Nothing new? Wait for eventfd to tell us they refilled. */ handle_tx() 582 /* Nothing new? Wait for eventfd to tell us handle_rx()
|
H A D | scsi.c | 36 #include <linux/eventfd.h> 1043 /* Nothing new? Wait for eventfd to tell us they refilled. */ vhost_scsi_handle_vq()
|
/linux-4.1.27/tools/virtio/ |
H A D | virtio_test.c | 5 #include <sys/eventfd.h> 95 info->kick = eventfd(0, EFD_NONBLOCK); vq_info_add() 96 info->call = eventfd(0, EFD_NONBLOCK); vq_info_add()
|
/linux-4.1.27/drivers/vfio/pci/ |
H A D | vfio_pci_intrs.c | 18 #include <linux/eventfd.h> 72 * If this is triggered by an eventfd, we can't call eventfd_signal 73 * or else we'll deadlock on the eventfd wait queue. Return >0 when
|
H A D | vfio_pci.c | 17 #include <linux/eventfd.h>
|
/linux-4.1.27/drivers/vfio/platform/ |
H A D | vfio_platform_irq.c | 17 #include <linux/eventfd.h>
|
/linux-4.1.27/arch/powerpc/include/asm/ |
H A D | systbl.h | 314 SYSCALL_SPU(eventfd)
|
/linux-4.1.27/tools/lguest/ |
H A D | lguest.c | 21 #include <sys/eventfd.h> 220 int eventfd; member in struct:virtqueue 775 /* Nothing new? Wait for eventfd to tell us they refilled. */ wait_for_vq_desc() 776 if (read(vq->eventfd, &event, sizeof(event)) != sizeof(event)) wait_for_vq_desc() 1850 /* Create a zero-initialized eventfd. */ start_virtqueue() 1851 vq->eventfd = eventfd(0, 0); start_virtqueue() 1852 if (vq->eventfd < 0) start_virtqueue() 1853 err(1, "Creating eventfd"); start_virtqueue() 2111 /* Notify the process handling this vq by adding 1 to eventfd */ 2112 write(vq->eventfd, "\1\0\0\0\0\0\0\0", 8);
|
/linux-4.1.27/arch/s390/kernel/ |
H A D | compat_wrapper.c | 195 COMPAT_SYSCALL_WRAP1(eventfd, unsigned int, count);
|
/linux-4.1.27/arch/parisc/kernel/ |
H A D | syscall_table.S | 402 ENTRY_SAME(eventfd)
|
/linux-4.1.27/include/uapi/asm-generic/ |
H A D | unistd.h | 77 /* fs/eventfd.c */
|
/linux-4.1.27/drivers/powercap/ |
H A D | intel_rapl.c | 900 * to userspace via eventfd. once we have a usecase, this is simple
|
/linux-4.1.27/drivers/usb/gadget/function/ |
H A D | f_fs.c | 35 #include <linux/eventfd.h>
|
/linux-4.1.27/tools/perf/ |
H A D | builtin-trace.c | 19 #include <sys/eventfd.h>
|