578029ba9f9435e493b936c5ba20ace3ad8a64dc
[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 /**
14  * Constants
15  */
16 #define RETURN_DISPOSITION_NONE 0
17 #define RETURN_DISPOSITION_EXIT 1
18 #define RETURN_DISPOSITION_MIGRATE 2
19 #define PROCESS_SERVER_CLONE_SUCCESS 0
20 #define PROCESS_SERVER_CLONE_FAIL 1
21
22 //configuration
23 //#define SUPPORT_FOR_CLUSTERING
24 #undef SUPPORT_FOR_CLUSTERING
25
26 //#define PROCESS_SERVER_USE_KMOD
27 #undef PROCESS_SERVER_USE_KMOD
28
29 #define PROCESS_SERVER_ENFORCE_VMA_MOD_ATOMICITY
30 //#undef PROCESS_SERVER_ENFORCE_VMA_MOD_ATOMICITY
31
32 #define PROCESS_SERVER_USE_HEAVY_LOCK
33 //#undef PROCESS_SERVER_USE_HEAVY_LOCK
34
35 /*
36  * Migration hook.
37  */
38 int process_server_do_migration(struct task_struct* task, int cpu);
39 void process_server_do_return_disposition(void);
40
41 /*
42  * Utilities for other modules to hook
43  * into the process server.
44  */
45 #ifdef PROCESS_SERVER_USE_KMOD
46 int process_server_import_address_space(unsigned long* ip, unsigned long *sp, struct pt_regs* regs);
47 #else
48 // long sys_process_server_import_task(void* info, struct pt_regs* regs) 
49 #endif
50 int process_server_notify_delegated_subprocess_starting(pid_t pid, pid_t remote_pid, int remote_cpu);
51 int process_server_do_exit(void);
52 int process_server_do_group_exit(void);
53 int process_server_notify_mmap(struct file *file, unsigned long addr,
54                                 unsigned long len, unsigned long prot,
55                                 unsigned long flags, unsigned long pgoff);
56 int process_server_notify_munmap(struct mm_struct *mm, unsigned long start, size_t len);
57 int process_server_pull_remote_mappings(struct mm_struct *mm, struct vm_area_struct *vma,
58                                 unsigned long address, unsigned int flags,
59                                 struct vm_area_struct **vma_out,
60                                 unsigned long error_code);
61 int process_server_do_munmap(struct mm_struct* mm, 
62                                 unsigned long start, 
63                                 unsigned long len);
64 void process_server_do_mprotect(struct task_struct* task,
65                                 unsigned long addr,
66                                 size_t len,
67                                 unsigned long prot);
68 int process_server_dup_task(struct task_struct* orig, struct task_struct* task);
69 unsigned long process_server_do_mmap_pgoff(struct file *file, unsigned long addr,
70                                            unsigned long len, unsigned long prot,
71                                            unsigned long flags, unsigned long pgoff);
72 int process_server_acquire_page_lock(unsigned long address);
73 int process_server_acquire_page_lock_range(unsigned long address, size_t sz);
74 int process_server_acquire_heavy_lock(void);
75 void process_server_release_page_lock(unsigned long address);
76 void process_server_release_page_lock_range(unsigned long address, size_t sz);
77 void process_server_release_heavy_lock(void);
78
79 #endif // _PROCESS_SERVER_H