Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
8e71cd35
Commit
8e71cd35
authored
Feb 13, 2015
by
Andrea Arcangeli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userfaultfd: UFFDIO_COPY|UFFDIO_ZEROPAGE uAPI
This implements the uABI of UFFDIO_COPY and UFFDIO_ZEROPAGE.
parent
c20828d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
1 deletion
+41
-1
include/uapi/linux/userfaultfd.h
include/uapi/linux/userfaultfd.h
+41
-1
No files found.
include/uapi/linux/userfaultfd.h
View file @
8e71cd35
...
@@ -21,7 +21,9 @@
...
@@ -21,7 +21,9 @@
(__u64)1 << _UFFDIO_UNREGISTER | \
(__u64)1 << _UFFDIO_UNREGISTER | \
(__u64)1 << _UFFDIO_API)
(__u64)1 << _UFFDIO_API)
#define UFFD_API_RANGE_IOCTLS \
#define UFFD_API_RANGE_IOCTLS \
((__u64)1 << _UFFDIO_WAKE)
((__u64)1 << _UFFDIO_WAKE | \
(__u64)1 << _UFFDIO_COPY | \
(__u64)1 << _UFFDIO_ZEROPAGE)
/*
/*
* Valid ioctl command number range with this API is from 0x00 to
* Valid ioctl command number range with this API is from 0x00 to
...
@@ -34,6 +36,8 @@
...
@@ -34,6 +36,8 @@
#define _UFFDIO_REGISTER (0x00)
#define _UFFDIO_REGISTER (0x00)
#define _UFFDIO_UNREGISTER (0x01)
#define _UFFDIO_UNREGISTER (0x01)
#define _UFFDIO_WAKE (0x02)
#define _UFFDIO_WAKE (0x02)
#define _UFFDIO_COPY (0x03)
#define _UFFDIO_ZEROPAGE (0x04)
#define _UFFDIO_API (0x3F)
#define _UFFDIO_API (0x3F)
/* userfaultfd ioctl ids */
/* userfaultfd ioctl ids */
...
@@ -46,6 +50,10 @@
...
@@ -46,6 +50,10 @@
struct uffdio_range)
struct uffdio_range)
#define UFFDIO_WAKE _IOR(UFFDIO, _UFFDIO_WAKE, \
#define UFFDIO_WAKE _IOR(UFFDIO, _UFFDIO_WAKE, \
struct uffdio_range)
struct uffdio_range)
#define UFFDIO_COPY _IOWR(UFFDIO, _UFFDIO_COPY, \
struct uffdio_copy)
#define UFFDIO_ZEROPAGE _IOWR(UFFDIO, _UFFDIO_ZEROPAGE, \
struct uffdio_zeropage)
/* read() structure */
/* read() structure */
struct
uffd_msg
{
struct
uffd_msg
{
...
@@ -118,4 +126,36 @@ struct uffdio_register {
...
@@ -118,4 +126,36 @@ struct uffdio_register {
__u64
ioctls
;
__u64
ioctls
;
};
};
struct
uffdio_copy
{
__u64
dst
;
__u64
src
;
__u64
len
;
/*
* There will be a wrprotection flag later that allows to map
* pages wrprotected on the fly. And such a flag will be
* available if the wrprotection ioctl are implemented for the
* range according to the uffdio_register.ioctls.
*/
#define UFFDIO_COPY_MODE_DONTWAKE ((__u64)1<<0)
__u64
mode
;
/*
* "copy" is written by the ioctl and must be at the end: the
* copy_from_user will not read the last 8 bytes.
*/
__s64
copy
;
};
struct
uffdio_zeropage
{
struct
uffdio_range
range
;
#define UFFDIO_ZEROPAGE_MODE_DONTWAKE ((__u64)1<<0)
__u64
mode
;
/*
* "zeropage" is written by the ioctl and must be at the end:
* the copy_from_user will not read the last 8 bytes.
*/
__s64
zeropage
;
};
#endif
/* _LINUX_USERFAULTFD_H */
#endif
/* _LINUX_USERFAULTFD_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment