summaryrefslogtreecommitdiff
path: root/source/module/monitor_mem.h
blob: 394d900bc54e4c2cfd17c55d88ed69debafb6ce0 (plain)
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
#include <linux/list.h>

// for memory access
// #include <linux/sched.h>

typedef struct {
  int __user *user_ptr_len;
  size_t __user user_buf_len;
  void __user *user_buf;
} ioctl_dump_param; // for ioctl_num 1;

typedef struct {
  pid_t task_id; // current process id
  struct page *page;
  void *kaddr;
  struct list_head entry;
} watch_local_memory;

// Global variable
static LIST_HEAD(watch_local_memory_list);

void *convert_user_space_ptr(pid_t pid, unsigned long kaddr);
void free_page_list(pid_t task_id);
void free_all_page_list(void);

unsigned char read_and_compare(void *ptr, int len, unsigned char above_threshold,
                               unsigned char is_unsigned, long long threshold);