blob: 1930ae1984047d98cfdb6c11ca535893a32922ee (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
/*
* Copyright 2013 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Authors: Jérôme Glisse <jglisse@redhat.com>
*/
/*
* This is a dummy driver to exercise the HMM (heterogeneous memory management)
* API of the kernel. It allows a userspace program to expose its entire address
* space through the HMM dummy driver file.
*/
#ifndef _UAPI_LINUX_HMM_DMIRROR_H
#define _UAPI_LINUX_HMM_DMIRROR_H
#include <linux/types.h>
#include <linux/ioctl.h>
#include <linux/irqnr.h>
struct hmm_dmirror_read {
uint64_t addr;
uint64_t ptr;
uint64_t npages;
uint64_t cpages;
uint64_t dpages;
};
struct hmm_dmirror_write {
uint64_t addr;
uint64_t ptr;
uint64_t npages;
uint64_t cpages;
uint64_t dpages;
};
struct hmm_dmirror_migrate {
uint64_t addr;
uint64_t npages;
};
/* Expose the address space of the calling process through hmm dummy dev file */
#define HMM_DMIRROR_READ _IOWR('H', 0x00, struct hmm_dmirror_read)
#define HMM_DMIRROR_WRITE _IOWR('H', 0x01, struct hmm_dmirror_write)
#define HMM_DMIRROR_MIGRATE _IOWR('H', 0x02, struct hmm_dmirror_migrate)
#endif /* _UAPI_LINUX_HMM_DMIRROR_H */
|