summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/taskconstruct.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/rtems/src/taskconstruct.c')
-rw-r--r--cpukit/rtems/src/taskconstruct.c34
1 files changed, 28 insertions, 6 deletions
diff --git a/cpukit/rtems/src/taskconstruct.c b/cpukit/rtems/src/taskconstruct.c
index 6e03440aed..531d64903d 100644
--- a/cpukit/rtems/src/taskconstruct.c
+++ b/cpukit/rtems/src/taskconstruct.c
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
@@ -11,9 +13,26 @@
* COPYRIGHT (c) 1989-2014,2016.
* On-Line Applications Research Corporation (OAR).
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
@@ -154,14 +173,17 @@ rtems_status_code _RTEMS_tasks_Create(
attributes = _Attributes_Clear( attributes, ATTRIBUTES_NOT_SUPPORTED );
memset( &thread_config, 0, sizeof( thread_config ) );
- thread_config.budget_algorithm = _Modes_Is_timeslice( config->initial_modes ) ?
- THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE
- : THREAD_CPU_BUDGET_ALGORITHM_NONE,
thread_config.isr_level = _Modes_Get_interrupt_level( config->initial_modes );
thread_config.name = config->name;
thread_config.is_fp = _Attributes_Is_floating_point( attributes );
thread_config.is_preemptible = _Modes_Is_preempt( config->initial_modes );
+ if ( _Modes_Is_timeslice( config->initial_modes ) ) {
+ thread_config.cpu_budget_operations = &_Thread_CPU_budget_reset_timeslice;
+ } else {
+ thread_config.cpu_budget_operations = NULL;
+ }
+
/*
* Validate the RTEMS API priority and convert it to the core priority range.
*/