diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-04-19 11:01:31 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-05-20 08:52:39 +0200 |
commit | 85d6e845d2b9c47779cc96438e3aa6e894b4a71a (patch) | |
tree | 3425c4ba0cc422f01ff648a37c9cc2ca6b209e77 /testsuites/smptests/smpmulticast01 | |
parent | score: Move per-processor job data structures (diff) | |
download | rtems-85d6e845d2b9c47779cc96438e3aa6e894b4a71a.tar.bz2 |
score: Add _Per_CPU_Add_job()
Diffstat (limited to 'testsuites/smptests/smpmulticast01')
-rw-r--r-- | testsuites/smptests/smpmulticast01/init.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/testsuites/smptests/smpmulticast01/init.c b/testsuites/smptests/smpmulticast01/init.c index 5f10400ce6..9e5d15f795 100644 --- a/testsuites/smptests/smpmulticast01/init.c +++ b/testsuites/smptests/smpmulticast01/init.c @@ -351,6 +351,49 @@ static void test_wrong_cpu_state_to_perform_jobs(void) rtems_fatal(RTEMS_FATAL_SOURCE_APPLICATION, 0); } +#define TEST_JOB_ORDER_JOBS 3 + +static Per_CPU_Job job_order_jobs[TEST_JOB_ORDER_JOBS]; + +static void job_order_handler_0(void *arg) +{ + T_step(1, "invalid job order"); +} + +static void job_order_handler_1(void *arg) +{ + T_step(2, "invalid job order"); +} + +static void job_order_handler_2(void *arg) +{ + T_step(3, "invalid job order"); +} + +static const Per_CPU_Job_context job_order_contexts[TEST_JOB_ORDER_JOBS] = { + { .handler = job_order_handler_0 }, + { .handler = job_order_handler_1 }, + { .handler = job_order_handler_2 } +}; + +T_TEST_CASE(JobOrder) +{ + Per_CPU_Control *cpu_self; + size_t i; + + T_plan(4); + cpu_self = _Thread_Dispatch_disable(); + + for (i = 0; i < TEST_JOB_ORDER_JOBS; ++i) { + job_order_jobs[i].context = &job_order_contexts[i]; + _Per_CPU_Add_job(cpu_self, &job_order_jobs[i]); + } + + T_step(0, "wrong job processing time"); + _SMP_Send_message(_Per_CPU_Get_index(cpu_self), SMP_MESSAGE_PERFORM_JOBS); + _Thread_Dispatch_enable(cpu_self); +} + T_TEST_CASE(UnicastDuringMultitaskingIRQDisabled) { test_unicast(&test_instance, multicast_action_irq_disabled); |