blob: 3b99e0ec24f22548cb00e19e2baa8968f24fe880 [file] [log] [blame]
Alexander Duyck36e66c52020-04-06 20:04:56 -07001/* 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 Duyck43b76f22020-04-06 20:05:14 -07008/* This value should always be a power of 2, see page_reporting_cycle() */
Alexander Duyck36e66c52020-04-06 20:04:56 -07009#define PAGE_REPORTING_CAPACITY 32
10
11struct 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 */
24void page_reporting_unregister(struct page_reporting_dev_info *prdev);
25int page_reporting_register(struct page_reporting_dev_info *prdev);
26#endif /*_LINUX_PAGE_REPORTING_H */