Alexander Duyck | 36e66c5 | 2020-04-06 20:04:56 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #ifndef _LINUX_PAGE_REPORTING_H |
| 3 | #define _LINUX_PAGE_REPORTING_H |
| 4 | |
| 5 | #include <linux/mmzone.h> |
| 6 | #include <linux/scatterlist.h> |
| 7 | |
Alexander Duyck | 43b76f2 | 2020-04-06 20:05:14 -0700 | [diff] [blame] | 8 | /* This value should always be a power of 2, see page_reporting_cycle() */ |
Alexander Duyck | 36e66c5 | 2020-04-06 20:04:56 -0700 | [diff] [blame] | 9 | #define PAGE_REPORTING_CAPACITY 32 |
| 10 | |
| 11 | struct page_reporting_dev_info { |
| 12 | /* function that alters pages to make them "reported" */ |
| 13 | int (*report)(struct page_reporting_dev_info *prdev, |
| 14 | struct scatterlist *sg, unsigned int nents); |
| 15 | |
| 16 | /* work struct for processing reports */ |
| 17 | struct delayed_work work; |
| 18 | |
| 19 | /* Current state of page reporting */ |
| 20 | atomic_t state; |
| 21 | }; |
| 22 | |
| 23 | /* Tear-down and bring-up for page reporting devices */ |
| 24 | void page_reporting_unregister(struct page_reporting_dev_info *prdev); |
| 25 | int page_reporting_register(struct page_reporting_dev_info *prdev); |
| 26 | #endif /*_LINUX_PAGE_REPORTING_H */ |