From 5bf03755a972f2a120731051a6fe52a597672e39 Mon Sep 17 00:00:00 2001 From: Nicholas Piggin Date: Tue, 3 Jul 2018 19:25:36 +1000 Subject: cpu: add cpu_queue_job_on_node() Add a job scheduling API which will run the job on the requested chip_id (or return failure). Includes test harness fixes from Stewart. Signed-off-by: Nicholas Piggin Signed-off-by: Stewart Smith --- hdata/test/hdata_to_dt.c | 9 +++++++++ hdata/test/stubs.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) (limited to 'hdata') diff --git a/hdata/test/hdata_to_dt.c b/hdata/test/hdata_to_dt.c index 8c61b4f6..bd11fb0b 100644 --- a/hdata/test/hdata_to_dt.c +++ b/hdata/test/hdata_to_dt.c @@ -83,6 +83,15 @@ struct cpu_thread { uint32_t pir; uint32_t chip_id; }; +struct cpu_job *__cpu_queue_job(struct cpu_thread *cpu, + const char *name, + void (*func)(void *data), void *data, + bool no_return); +void cpu_wait_job(struct cpu_job *job, bool free_it); +void cpu_process_local_jobs(void); +struct cpu_job *cpu_queue_job_on_node(uint32_t chip_id, + const char *name, + void (*func)(void *data), void *data); struct cpu_thread __boot_cpu, *boot_cpu = &__boot_cpu; static unsigned long fake_pvr = PVR_P7; diff --git a/hdata/test/stubs.c b/hdata/test/stubs.c index 59225705..f7b1da10 100644 --- a/hdata/test/stubs.c +++ b/hdata/test/stubs.c @@ -18,6 +18,7 @@ #include #include #include +#include #include @@ -84,6 +85,52 @@ void *__zalloc(size_t bytes, const char *location) return p; } +struct cpu_thread; + +struct cpu_job *__cpu_queue_job(struct cpu_thread *cpu, + const char *name, + void (*func)(void *data), void *data, + bool no_return); + +struct cpu_job *cpu_queue_job_on_node(uint32_t chip_id, + const char *name, + void (*func)(void *data), void *data); + +struct cpu_job *cpu_queue_job_on_node(uint32_t chip_id, + const char *name, + void (*func)(void *data), void *data) +{ + (void)chip_id; + return __cpu_queue_job(NULL, name, func, data, false); +} + +struct cpu_job *__cpu_queue_job(struct cpu_thread *cpu, + const char *name, + void (*func)(void *data), void *data, + bool no_return) +{ + (void)cpu; + (void)name; + (func)(data); + (void)no_return; + return NULL; +} + +void cpu_wait_job(struct cpu_job *job, bool free_it); + +void cpu_wait_job(struct cpu_job *job, bool free_it) +{ + (void)job; + (void)free_it; + return; +} + +void cpu_process_local_jobs(void); + +void cpu_process_local_jobs(void) +{ +} + /* Add any stub functions required for linking here. */ static void stub_function(void) { -- cgit v1.2.1