RTEMS: cpukit/include/rtems/confdefs/inittask.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
inittask.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
14/*
15 * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions
19 * are met:
20 * 1. Redistributions of source code must retain the above copyright
21 * notice, this list of conditions and the following disclaimer.
22 * 2. Redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in the
24 * documentation and/or other materials provided with the distribution.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
30 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39#ifndef _RTEMS_CONFDEFS_INITTASK_H
40#define _RTEMS_CONFDEFS_INITTASK_H
41
42#ifndef __CONFIGURATION_TEMPLATE_h
43#error "Do not include this file directly, use <rtems/confdefs.h> instead"
44#endif
45
46#ifdef CONFIGURE_INIT
47
48#ifdef CONFIGURE_RTEMS_INIT_TASKS_TABLE
49
50#include <rtems/confdefs/percpu.h>
51#include <rtems/rtems/object.h>
52#include <rtems/rtems/tasksdata.h>
53#include <rtems/sysinit.h>
54
55#ifndef CONFIGURE_INIT_TASK_ATTRIBUTES
56 #define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES
57#endif
58
59#ifndef CONFIGURE_INIT_TASK_INITIAL_MODES
60 #ifdef RTEMS_SMP
61 #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES
62 #else
63 #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT
64 #endif
65#endif
66
67#ifndef CONFIGURE_INIT_TASK_NAME
68 #define CONFIGURE_INIT_TASK_NAME rtems_build_name( 'U', 'I', '1', ' ' )
69#endif
70
71#ifndef CONFIGURE_INIT_TASK_PRIORITY
72 #define CONFIGURE_INIT_TASK_PRIORITY 1
73#endif
74
75#ifndef CONFIGURE_INIT_TASK_STACK_SIZE
76 #define CONFIGURE_INIT_TASK_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE
77#endif
78
79#if CONFIGURE_INIT_TASK_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE
80 #define _CONFIGURE_INIT_TASK_STACK_EXTRA \
81 ( CONFIGURE_INIT_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE )
82#endif
83
84#ifdef __cplusplus
85extern "C" {
86#endif
87
88#ifndef CONFIGURE_INIT_TASK_ENTRY_POINT
89 rtems_task Init( rtems_task_argument );
90 #define CONFIGURE_INIT_TASK_ENTRY_POINT Init
91
92 #ifndef CONFIGURE_INIT_TASK_ARGUMENTS
93 extern const char *bsp_boot_cmdline;
94 #define CONFIGURE_INIT_TASK_ARGUMENTS \
95 ( (rtems_task_argument) &bsp_boot_cmdline )
96 #endif
97#endif
98
99#ifndef CONFIGURE_INIT_TASK_ARGUMENTS
100 #define CONFIGURE_INIT_TASK_ARGUMENTS 0
101#endif
102
103const rtems_initialization_tasks_table _RTEMS_tasks_User_task_table = {
104 CONFIGURE_INIT_TASK_NAME,
105 CONFIGURE_INIT_TASK_STACK_SIZE,
106 CONFIGURE_INIT_TASK_PRIORITY,
107 CONFIGURE_INIT_TASK_ATTRIBUTES,
108 CONFIGURE_INIT_TASK_ENTRY_POINT,
109 CONFIGURE_INIT_TASK_INITIAL_MODES,
110 CONFIGURE_INIT_TASK_ARGUMENTS
111};
112
113RTEMS_SYSINIT_ITEM(
114 _RTEMS_tasks_Initialize_user_task,
115 RTEMS_SYSINIT_CLASSIC_USER_TASKS,
116 RTEMS_SYSINIT_ORDER_MIDDLE
117);
118
119#ifdef __cplusplus
120}
121#endif
122
123#endif /* CONFIGURE_RTEMS_INIT_TASKS_TABLE */
124
125#ifndef _CONFIGURE_INIT_TASK_STACK_EXTRA
126 #define _CONFIGURE_INIT_TASK_STACK_EXTRA 0
127#endif
128
129#endif /* CONFIGURE_INIT */
130
131#endif /* _RTEMS_CONFDEFS_INITTASK_H */
percpu.h
Evaluate Per-CPU Configuration Options.
_RTEMS_tasks_User_task_table
const rtems_initialization_tasks_table _RTEMS_tasks_User_task_table
Initialization table for the first user task.
Definition: taskinitdefault.c:34
_RTEMS_tasks_Initialize_user_task
void _RTEMS_tasks_Initialize_user_task(void)
System initialization handler to create and start the first user task.
Definition: taskinitusers.c:27
rtems_task
void rtems_task
Definition: tasks.h:101
rtems_task_argument
CPU_Uint32ptr rtems_task_argument
Definition: tasks.h:106
bsp_boot_cmdline
const char * bsp_boot_cmdline
Global pointer to the command line of boot_card().
Definition: bootcard.c:25
object.h
rtems_initialization_tasks_table
Definition: tasks.h:121
tasksdata.h
Classic Tasks Manager Data Structures.