aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pfair_common.h
blob: 67e18c601a95698238fc8e2837f55055243080e0 (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
40
/* PFAIR common data structures and utility functions shared by all PFAIR 
 * based scheduler plugins
 */

#ifndef __UNC_PFAIR_COMMON_H__
#define __UNC_PFAIR_COMMON_H__

#include <linux/queuelock.h>
#include <linux/cpumask.h>

typedef struct _pfair_domain {
	/* Global lock to protect the data structures */
	queuelock_t			pfair_lock;
	/* runnable rt tasks are in here */
	struct list_head 		ready_queue; 

	/* real-time tasks waiting for release are in here */
	struct list_head 		release_queue;
	
	/*  CPU's in the domain	*/
	cpumask_t domain_cpus;

} pfair_domain_t;

#define next_ready(pfair) \
	(list_entry((pfair)->ready_queue.next, struct task_struct, rt_list))
void pfair_domain_init(pfair_domain_t *pfair);
void  pfair_add_ready(pfair_domain_t* pfair, struct task_struct *new);
struct task_struct* __pfair_take_ready(pfair_domain_t* pfair);
void pfair_add_release(pfair_domain_t* pfair, struct task_struct *task);
void pfair_try_release_pending(pfair_domain_t* pfair);
void __pfair_prepare_new_release(struct task_struct *t, jiffie_t start);

void pfair_prepare_next_job(struct task_struct *t);
void pfair_prepare_next_subtask(struct task_struct *t);

void pfair_prepare_new_releases(pfair_domain_t *pfair, jiffie_t start);

#endif