diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-07-15 09:16:04 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-07-26 11:26:22 +0200 |
commit | 7fe6d60bf08df975c395515074c85976d9e4e3fb (patch) | |
tree | b61a7a72f1c0d763c9fdfadd8275789b1a7de55b /testsuites/sptests/sptasknopreempt01/init.c | |
parent | sptests/spstdc17: New test (diff) | |
download | rtems-7fe6d60bf08df975c395515074c85976d9e4e3fb.tar.bz2 |
score: Remove PRIORITY_PSEUDO_ISR thread priority
The uniprocessor schedulers had some special case logic for the
PRIORITY_PSEUDO_ISR priority. Tasks with a priority of PRIORITY_PSEUDO_ISR
were allowed to preempt a not preemptible task. If other higher priority task
are made ready while a PRIORITY_PSEUDO_ISR task preempts a not preemptible
task, then the other tasks run before the not preemptible task. This made the
RTEMS_NO_PREEMPT mode ineffective.
Remove the PRIORITY_PSEUDO_ISR special case logic. This simplifies the
uniprocessor schedulers. Move the uniprocessor-specific scheduler support to
the new header file <rtems/score/scheduleruniimpl.h>.
Close #2365.
Diffstat (limited to 'testsuites/sptests/sptasknopreempt01/init.c')
-rw-r--r-- | testsuites/sptests/sptasknopreempt01/init.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/testsuites/sptests/sptasknopreempt01/init.c b/testsuites/sptests/sptasknopreempt01/init.c index 617a44ade1..d92bd245e7 100644 --- a/testsuites/sptests/sptasknopreempt01/init.c +++ b/testsuites/sptests/sptasknopreempt01/init.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-2-Clause */ /* - * Copyright (c) 2015 embedded brains GmbH. All rights reserved. + * Copyright (C) 2015, 2022 embedded brains GmbH * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -37,12 +37,7 @@ static bool did_run; static void do_not_run(rtems_task_argument arg) { -#if 0 rtems_test_assert(0); -#else - did_run = true; - rtems_task_suspend(RTEMS_SELF); -#endif } static void test(void) @@ -64,9 +59,9 @@ static void test(void) rtems_test_assert(sc == RTEMS_SUCCESSFUL); /* - * This will start a pseudo interrupt task pre-empting the non-preemtive - * executing task. Later the high priority do_not_run() task is scheduled. - * See also https://devel.rtems.org/ticket/2365. + * This will start a task with a priority of PRIORITY_MINIMUM. Check that + * this task and the test task did not preempt the current task. See also + * https://devel.rtems.org/ticket/2365. */ sc = rtems_timer_initiate_server( RTEMS_TIMER_SERVER_DEFAULT_PRIORITY, @@ -75,8 +70,7 @@ static void test(void) ); rtems_test_assert(sc == RTEMS_SUCCESSFUL); - /* This is probably a bug and not a feature */ - rtems_test_assert(did_run); + rtems_test_assert(!did_run); sc = rtems_task_delete(task); rtems_test_assert(sc == RTEMS_SUCCESSFUL); @@ -99,6 +93,8 @@ static void Init(rtems_task_argument arg) #define CONFIGURE_INIT_TASK_PRIORITY 2 +#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT + #define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |