aboutsummaryrefslogtreecommitdiffstats
path: root/include/litmus/sched_zl_plugin.h
blob: db044e6063541403e63edd03f333f00912acf456 (plain) (blame)
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
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * EDZL common data structures and utility functions shared by all EDZL
 * based scheduler plugins
 */

#ifndef __UNC_EDZL_COMMON_H__
#define __UNC_EDZL_COMMON_H__

#include <litmus/rt_domain.h>
#include <litmus/sched_global_plugin.h>

int edzl_higher_prio(struct task_struct* first,
                     struct task_struct* second);


typedef lt_t (*laxity_remaining_t)(struct task_struct* t);
typedef lt_t (*budget_remaining_t)(struct task_struct* t);
typedef int (*budget_exhausted_t)(struct task_struct* t);

struct sched_zl_plugin {
    struct sched_global_plugin gbl_plugin;
    
    /* function pointers MUST be set by plugin */
    laxity_remaining_t  laxity_remaining;
    budget_remaining_t  budget_remaining;
    budget_exhausted_t  budget_exhausted;
} __attribute__ ((__aligned__(SMP_CACHE_BYTES)));

/* functions common to EDZL and AEDZL */
enum hrtimer_restart zl_on_zero_laxity(struct hrtimer *timer);
struct task_struct* __zl_take_ready(rt_domain_t* rt);
void __zl_add_ready(rt_domain_t* rt, struct task_struct *new);
void zl_job_arrival(struct task_struct* task);
void zl_task_new(struct task_struct * t, int on_rq, int running);
void zl_task_wake_up(struct task_struct *task);
void zl_task_exit(struct task_struct * t);
int zl_preemption_needed(struct task_struct *t);

#endif