sched: register the schedulers into the list

Adds a simple macro to place a pointer to a scheduler into an array
section at compile time. Also, goes ahead and generates the array
entries with each of the schedulers.

Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
This commit is contained in:
Jonathan Creekmore authored and Jan Beulich committed 2016-01-21 16:06:36 +01:00
1 parent 2c94cd917d
commit 18c8d613aa
5 files changed
+10

No files matched your search

+2
View File
@@ -767,6 +767,8 @@ const struct scheduler sched_arinc653_def = {
.tick_resume = NULL,
};
REGISTER_SCHEDULER(sched_arinc653_def);
/*
* Local variables:
* mode: C
+2
View File
@@ -2027,3 +2027,5 @@ const struct scheduler sched_credit_def = {
.tick_suspend = csched_tick_suspend,
.tick_resume = csched_tick_resume,
};
REGISTER_SCHEDULER(sched_credit_def);
+2
View File
@@ -2228,3 +2228,5 @@ const struct scheduler sched_credit2_def = {
.alloc_domdata = csched2_alloc_domdata,
.free_domdata = csched2_free_domdata,
};
REGISTER_SCHEDULER(sched_credit2_def);
+2
View File
@@ -1199,3 +1199,5 @@ const struct scheduler sched_rtds_def = {
.wake = rt_vcpu_wake,
.context_saved = rt_context_saved,
};
REGISTER_SCHEDULER(sched_rtds_def);
+2
View File
@@ -170,6 +170,8 @@ extern const struct scheduler sched_credit2_def;
extern const struct scheduler sched_arinc653_def;
extern const struct scheduler sched_rtds_def;
#define REGISTER_SCHEDULER(x) static const struct scheduler *x##_entry \
__used_section(".data.schedulers") = &x;
struct cpupool
{
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.