Skip to content

Commit a06a809

Browse files
committed
WIP: schedule: limit user-LL to core0
Multiple temporary limitations to limit user LL scheduler to only work on core 0. This is mostly related to privileged cpu_get_id() that is used in many places to check the id of the core code is running on. This is not available to user-space at the moment, so temporary measures are needed. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
1 parent c423e88 commit a06a809

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/schedule/zephyr_domain.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ static int zephyr_domain_register_user(struct ll_schedule_domain *domain,
294294
void (*handler)(void *arg), void *arg)
295295
{
296296
struct zephyr_domain *zephyr_domain = ll_sch_domain_get_pdata(domain);
297-
int core = cpu_get_id();
297+
int core = 0; /* cpu_get_id(); */
298298
struct zephyr_domain_thread *dt = zephyr_domain->domain_thread + core;
299299
char thread_name[] = "ll_thread0";
300300
k_tid_t thread;
@@ -407,7 +407,7 @@ static int zephyr_domain_unregister_user(struct ll_schedule_domain *domain,
407407
struct k_thread *zephyr_domain_thread_tid(struct ll_schedule_domain *domain)
408408
{
409409
struct zephyr_domain *zephyr_domain = ll_sch_domain_get_pdata(domain);
410-
int core = cpu_get_id();
410+
int core = 0; /* cpu_get_id(); */
411411
struct zephyr_domain_thread *dt = zephyr_domain->domain_thread + core;
412412

413413
tr_dbg(&ll_tr, "entry");

zephyr/schedule.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ static struct schedulers *_schedulers[CONFIG_CORE_COUNT];
2121
*/
2222
struct schedulers **arch_schedulers_get(void)
2323
{
24+
if (k_is_user_context()) {
25+
printk("FIXME: using core0 scheduler\n");
26+
return _schedulers;
27+
}
28+
2429
return _schedulers + cpu_get_id();
2530
}
2631
EXPORT_SYMBOL(arch_schedulers_get);

0 commit comments

Comments
 (0)