qemu-e2k/include/qemu/userfaultfd.h
Markus Armbruster c0e38aa8f5 migration: Clean up includes
This commit was created with scripts/clean-includes.

All .c should include qemu/osdep.h first.  The script performs three
related cleanups:

* Ensure .c files include qemu/osdep.h first.
* Including it in a .h is redundant, since the .c  already includes
  it.  Drop such inclusions.
* Likewise, including headers qemu/osdep.h includes is redundant.
  Drop these, too.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230202133830.2152150-12-armbru@redhat.com>
[Straightforward conflict with commit d5890ea072 resolved]
2023-02-08 07:27:20 +01:00

47 lines
1.4 KiB
C

/*
* Linux UFFD-WP support
*
* Copyright Virtuozzo GmbH, 2020
*
* Authors:
* Andrey Gruzdev <andrey.gruzdev@virtuozzo.com>
*
* This work is licensed under the terms of the GNU GPL, version 2 or
* later. See the COPYING file in the top-level directory.
*/
#ifndef USERFAULTFD_H
#define USERFAULTFD_H
#ifdef CONFIG_LINUX
#include "exec/hwaddr.h"
#include <linux/userfaultfd.h>
/**
* uffd_open(): Open an userfaultfd handle for current context.
*
* @flags: The flags we want to pass in when creating the handle.
*
* Returns: the uffd handle if >=0, or <0 if error happens.
*/
int uffd_open(int flags);
int uffd_query_features(uint64_t *features);
int uffd_create_fd(uint64_t features, bool non_blocking);
void uffd_close_fd(int uffd_fd);
int uffd_register_memory(int uffd_fd, void *addr, uint64_t length,
uint64_t mode, uint64_t *ioctls);
int uffd_unregister_memory(int uffd_fd, void *addr, uint64_t length);
int uffd_change_protection(int uffd_fd, void *addr, uint64_t length,
bool wp, bool dont_wake);
int uffd_copy_page(int uffd_fd, void *dst_addr, void *src_addr,
uint64_t length, bool dont_wake);
int uffd_zero_page(int uffd_fd, void *addr, uint64_t length, bool dont_wake);
int uffd_wakeup(int uffd_fd, void *addr, uint64_t length);
int uffd_read_events(int uffd_fd, struct uffd_msg *msgs, int count);
bool uffd_poll_events(int uffd_fd, int tmo);
#endif /* CONFIG_LINUX */
#endif /* USERFAULTFD_H */