diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-04-12 23:30:36 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-04-12 23:30:36 -0400 |
commit | 05b2ec2ab620b102a2d2fb92dac95ddbc1e09143 (patch) | |
tree | 2950ddff097e1cf781f6ed5fba0c55673e668cce | |
parent | 24141cda67fe0cbe680c2d3ca15a5ba0799ed744 (diff) |
Add get_control_page() library function
-rw-r--r-- | include/litmus.h | 7 | ||||
-rw-r--r-- | src/kernel_iface.c | 13 |
2 files changed, 20 insertions, 0 deletions
diff --git a/include/litmus.h b/include/litmus.h index 6d0ad40..e0f16d3 100644 --- a/include/litmus.h +++ b/include/litmus.h | |||
@@ -120,6 +120,13 @@ static inline int open_srp_sem(int fd, int name) | |||
120 | /* syscall overhead measuring */ | 120 | /* syscall overhead measuring */ |
121 | int null_call(cycles_t *timestamp); | 121 | int null_call(cycles_t *timestamp); |
122 | 122 | ||
123 | /* | ||
124 | * get control page: | ||
125 | * atm it is used only by preemption migration overhead code | ||
126 | * but it is very general and can be used for different purposes | ||
127 | */ | ||
128 | struct control_page* get_ctrl_page(void); | ||
129 | |||
123 | #ifdef __cplusplus | 130 | #ifdef __cplusplus |
124 | } | 131 | } |
125 | #endif | 132 | #endif |
diff --git a/src/kernel_iface.c b/src/kernel_iface.c index dbc4baa..afb6202 100644 --- a/src/kernel_iface.c +++ b/src/kernel_iface.c | |||
@@ -72,3 +72,16 @@ void exit_np(void) | |||
72 | } | 72 | } |
73 | } | 73 | } |
74 | 74 | ||
75 | /* init and return a ptr to the control page for | ||
76 | * preemption and migration overhead analysis | ||
77 | * | ||
78 | * FIXME it may be desirable to have a RO control page here | ||
79 | */ | ||
80 | struct control_page* get_ctrl_page(void) | ||
81 | { | ||
82 | if((ctrl_page != NULL) || init_kernel_iface() == 0) | ||
83 | return ctrl_page; | ||
84 | else | ||
85 | return NULL; | ||
86 | } | ||
87 | |||