mem_data.h 772 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. #include "asm-generic/errno-base.h"
  3. #include "linux/gfp.h"
  4. #include "linux/sched/signal.h"
  5. #include "linux/spinlock.h"
  6. #include "linux/spinlock_types.h"
  7. #include "linux/types.h"
  8. #include <linux/string.h>
  9. #ifndef MEM_DATA_H__
  10. #define MEM_DATA_H__ 1
  11. #include <asm/atomic.h>
  12. #include <linux/mutex.h>
  13. #include <linux/list.h>
  14. #include <linux/hashtable.h>
  15. #include <linux/slab.h>
  16. #include <linux/sched.h>
  17. #define ADDR_TABLE_SIZE 5
  18. struct mem_data {
  19. atomic_t calls;
  20. atomic_t mem;
  21. };
  22. struct addr_data {
  23. pid_t tgid;
  24. unsigned long addr;
  25. ssize_t size;
  26. struct hlist_node node;
  27. };
  28. static inline void init_mem_data(struct mem_data *data)
  29. {
  30. arch_atomic_set(&data->calls, 0);
  31. arch_atomic_set(&data->mem, 0);
  32. }
  33. #endif // MEM_DATA_H__