diff options
| author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-11-06 14:29:15 -0500 |
|---|---|---|
| committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-11-06 14:29:15 -0500 |
| commit | 643415abd5c348edc4c0af471f2165af7d21f4e0 (patch) | |
| tree | 317b9bd8a67a5a21700b9e2add026bbcb96438b3 /include | |
| parent | 5091ac6ebbfb121ba218d04fa0d59cbdf4ba2bb1 (diff) | |
LITMUS: provide per-plugin setup/tear down callbacks
Give plugins a chance to set up state and clean up.
Diffstat (limited to 'include')
| -rw-r--r-- | include/litmus/sched_plugin.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/litmus/sched_plugin.h b/include/litmus/sched_plugin.h index aba75222fc..94952f6ccb 100644 --- a/include/litmus/sched_plugin.h +++ b/include/litmus/sched_plugin.h | |||
| @@ -21,6 +21,12 @@ struct pi_semaphore { | |||
| 21 | struct task_struct *holder; | 21 | struct task_struct *holder; |
| 22 | }; | 22 | }; |
| 23 | 23 | ||
| 24 | /************************ setup/tear down ********************/ | ||
| 25 | |||
| 26 | typedef long (*activate_plugin_t) (void); | ||
| 27 | typedef long (*deactivate_plugin_t) (void); | ||
| 28 | |||
| 29 | |||
| 24 | 30 | ||
| 25 | /********************* scheduler invocation ******************/ | 31 | /********************* scheduler invocation ******************/ |
| 26 | 32 | ||
| @@ -75,6 +81,8 @@ typedef long (*return_priority_t) (struct pi_semaphore *sem); | |||
| 75 | typedef long (*pi_block_t) (struct pi_semaphore *sem, struct task_struct *t); | 81 | typedef long (*pi_block_t) (struct pi_semaphore *sem, struct task_struct *t); |
| 76 | 82 | ||
| 77 | 83 | ||
| 84 | |||
| 85 | |||
| 78 | /********************* sys call backends ********************/ | 86 | /********************* sys call backends ********************/ |
| 79 | /* This function causes the caller to sleep until the next release */ | 87 | /* This function causes the caller to sleep until the next release */ |
| 80 | typedef long (*complete_job_t) (void); | 88 | typedef long (*complete_job_t) (void); |
| @@ -87,6 +95,11 @@ struct sched_plugin { | |||
| 87 | struct list_head list; | 95 | struct list_head list; |
| 88 | /* basic info */ | 96 | /* basic info */ |
| 89 | char *plugin_name; | 97 | char *plugin_name; |
| 98 | |||
| 99 | /* setup */ | ||
| 100 | activate_plugin_t activate_plugin; | ||
| 101 | deactivate_plugin_t deactivate_plugin; | ||
| 102 | |||
| 90 | #ifdef CONFIG_SRP | 103 | #ifdef CONFIG_SRP |
| 91 | unsigned int srp_active; | 104 | unsigned int srp_active; |
| 92 | #endif | 105 | #endif |
| @@ -141,4 +154,6 @@ static inline int fmlp_active(void) | |||
| 141 | #endif | 154 | #endif |
| 142 | } | 155 | } |
| 143 | 156 | ||
| 157 | extern struct sched_plugin linux_sched_plugin; | ||
| 158 | |||
| 144 | #endif | 159 | #endif |
