RTEMS 6.1-rc5
Loading...
Searching...
No Matches
tasksimpl.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
12/* COPYRIGHT (c) 1989-2014.
13 * On-Line Applications Research Corporation (OAR).
14 *
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
17 * are met:
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
37#ifndef _RTEMS_RTEMS_TASKSIMPL_H
38#define _RTEMS_RTEMS_TASKSIMPL_H
39
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
66
67typedef rtems_status_code ( *RTEMS_tasks_Prepare_stack )(
69 const rtems_task_config *
70);
71
72rtems_status_code _RTEMS_tasks_Create(
74 rtems_id *id,
75 RTEMS_tasks_Prepare_stack prepare_stack
76);
77
78static inline Thread_Control *_RTEMS_tasks_Allocate(void)
79{
80 _Objects_Allocator_lock();
81
83
84 return (Thread_Control *)
85 _Objects_Allocate_unprotected( &_RTEMS_tasks_Information.Objects );
86}
87
102static inline Priority_Control _RTEMS_Priority_To_core(
103 const Scheduler_Control *scheduler,
104 rtems_task_priority priority,
105 bool *valid
106)
107{
108 *valid = ( priority <= scheduler->maximum_priority );
109
110 return _Scheduler_Map_priority( scheduler, (Priority_Control) priority );
111}
112
122static inline rtems_task_priority _RTEMS_Priority_From_core(
123 const Scheduler_Control *scheduler,
124 Priority_Control priority
125)
126{
127 return (rtems_task_priority)
128 _Scheduler_Unmap_priority( scheduler, priority );
129}
130
141#if defined(RTEMS_MULTIPROCESSING)
142#include <rtems/rtems/taskmp.h>
143#endif
144
145#ifdef __cplusplus
146}
147#endif
148
149#endif
150/* end of include file */
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:85
uint32_t rtems_task_priority
This integer type represents task priorities of the Classic API.
Definition: types.h:257
Objects_Id rtems_id
This type represents RTEMS object identifiers.
Definition: types.h:94
Thread_Information _RTEMS_tasks_Information
void _RTEMS_tasks_Initialize_user_tasks(void)
RTEMS User Task Initialization.
uint64_t Priority_Control
The thread priority control.
Definition: priority.h:91
void _Thread_Kill_zombies(void)
Kills all zombie threads in the system.
Definition: threadrestart.c:168
This header file provides interfaces of the Scheduler Handler which are only used by the implementati...
This header file provides interfaces of the Object Handler which are only used by the implementation.
The configuration of a new thread to initialize.
Definition: threadimpl.h:169
Objects_Information Objects
The object information.
Definition: thread.h:1137
Scheduler control.
Definition: scheduler.h:337
Priority_Control maximum_priority
The maximum priority value of this scheduler.
Definition: scheduler.h:354
Definition: thread.h:837
Definition: deflate.c:114
This structure defines the configuration of a task constructed by rtems_task_construct().
Definition: tasks.h:110
This header file provides the implementation interfaces of the Task Manager Multiprocessing (MP) Supp...
This header file provides data structures used by the implementation and the Application Configuratio...
This header file provides interfaces of the Thread Handler which are only used by the implementation.