Merge remote-tracking branch 'origin/clustered' into aks_dev_clus
[projects/modsched/linux.git] / include / linux / process_server.h
1 /*********************
2  * process server header
3  * dkatz
4  *********************/
5
6 #include <linux/sched.h>
7 #include <asm/ptrace.h>
8
9 #ifndef _PROCESS_SERVER_H
10 #define _PROCESS_SERVER_H
11
12 /**
13  * Constants
14  */
15 #define RETURN_DISPOSITION_NONE 0
16 #define RETURN_DISPOSITION_EXIT 1
17 #define RETURN_DISPOSITION_MIGRATE 2
18 #define PROCESS_SERVER_CLONE_SUCCESS 0
19 #define PROCESS_SERVER_CLONE_FAIL 1
20
21 //configuration
22 //#define SUPPORT_FOR_CLUSTERING
23 #undef SUPPORT_FOR_CLUSTERING
24
25 /*
26  * Migration hook.
27  */
28 int process_server_do_migration(struct task_struct* task, int cpu);
29 void process_server_do_return_disposition(void);
30
31 /*
32  * Utilities for other modules to hook
33  * into the process server.
34  */
35 int process_server_import_address_space(unsigned long* ip, unsigned long *sp, struct pt_regs* regs);
36 int process_server_notify_delegated_subprocess_starting(pid_t pid, pid_t remote_pid, int remote_cpu);
37 int process_server_do_exit(void);
38 int process_server_do_group_exit(void);
39 int process_server_notify_mmap(struct file *file, unsigned long addr,
40                                 unsigned long len, unsigned long prot,
41                                 unsigned long flags, unsigned long pgoff);
42 int process_server_notify_munmap(struct mm_struct *mm, unsigned long start, size_t len);
43 int process_server_try_handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
44                                 unsigned long address, unsigned int flags,
45                                 struct vm_area_struct **vma_out,
46                                 unsigned long error_code);
47 int process_server_do_munmap(struct mm_struct* mm, 
48                                 struct vm_area_struct *vma,
49                                 unsigned long start, 
50                                 unsigned long len);
51 void process_server_do_mprotect(struct task_struct* task,
52                                 unsigned long addr,
53                                 size_t len,
54                                 unsigned long prot);
55 int process_server_dup_task(struct task_struct* orig, struct task_struct* task);
56 unsigned long process_server_do_mmap_pgoff(struct file *file, unsigned long addr,
57                                            unsigned long len, unsigned long prot,
58                                            unsigned long flags, unsigned long pgoff);
59 #endif // _PROCESS_SERVER_H