From 7fe6d60bf08df975c395515074c85976d9e4e3fb Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 15 Jul 2022 09:16:04 +0200 Subject: 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 . Close #2365. --- testsuites/sptests/sptasknopreempt01/init.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'testsuites/sptests') 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 -- cgit v1.2.3