page_reporting.h 895 B

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