source: rtems/testsuites/samples/minimum/init.c

Last change on this file was 120c857e, checked in by Sebastian Huber <sebastian.huber@…>, on 09/08/22 at 14:11:43

minimum: Do not use unified work areas

The CONFIGURE_UNIFIED_WORK_AREAS option pulls in a system initialization
handler which initializes the unified heap.

Close #4108.

  • Property mode set to 100644
File size: 3.7 KB
Line 
1/* SPDX-License-Identifier: BSD-2-Clause */
2
3/**
4 *  @file
5 *
6 *  Minimum Size Application Initialization
7 */
8
9/*
10 *  COPYRIGHT (c) 1989-2012.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 * 1. Redistributions of source code must retain the above copyright
17 *    notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 *    notice, this list of conditions and the following disclaimer in the
20 *    documentation and/or other materials provided with the distribution.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 */
34
35#ifdef HAVE_CONFIG_H
36#include "config.h"
37#endif
38
39#include <bsp.h>
40#include <rtems/score/thread.h>
41
42static void *Init( uintptr_t ignored )
43{
44  /* initialize application */
45
46  /* Real application would call idle loop functionality */
47
48  /* but in this case, just return and fall into a fatal error */
49
50  return NULL;
51}
52
53/* configuration information */
54
55/*
56 * This application has no device drivers.
57 */
58/* NOTICE: the clock driver is explicitly disabled */
59#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
60
61/*
62 *  This application has no filesytem and libio support.
63 */
64#define CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
65
66/*
67 *  This disables reentrancy support in the C Library.  It is usually
68 *  not something an application wants to do unless the development
69 *  team is committed to using C Library routines that are KNOWN to
70 *  be reentrant.  Caveat Emptor!!
71 */
72#define CONFIGURE_DISABLE_NEWLIB_REENTRANCY
73
74/*
75 *  This test does not use any stdio.
76 */
77#define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 0
78
79/*
80 *  This may prevent us from running on every architecture but it
81 *  demonstrates that the user can specify how small of a minimum
82 *  stack they want.
83 */
84#ifdef RTEMS_GCOV_COVERAGE
85#define CONFIGURE_MINIMUM_TASK_STACK_SIZE \
86  (CPU_STACK_MINIMUM_SIZE - CPU_STACK_ALIGNMENT)
87#else
88#define CONFIGURE_MINIMUM_TASK_STACK_SIZE 512
89#endif
90
91/*
92 * Keep the interrupt/initialization stack as is.  Otherwise, the test may fail
93 * in the low level system initialization.
94 */
95#ifdef BSP_INTERRUPT_STACK_SIZE
96  #define CONFIGURE_INTERRUPT_STACK_SIZE BSP_INTERRUPT_STACK_SIZE
97#else
98  #define CONFIGURE_INTERRUPT_STACK_SIZE CPU_STACK_MINIMUM_SIZE
99#endif
100
101/*
102 *  This lowers the number of priorities that this test is able to
103 *  use.  The Idle task will be running at the lowest priority.
104 */
105#define CONFIGURE_MAXIMUM_PRIORITY 15
106
107/*
108 *  In this application, the initialization task performs the system
109 *  initialization and then transforms itself into the idle task.
110 */
111#define CONFIGURE_IDLE_TASK_BODY Init
112#define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION
113
114/*
115 *  If you are debugging confdefs.h, define this
116 */
117/* #define CONFIGURE_CONFDEFS_DEBUG */
118
119/*
120 *  Instantiate the configuration tables.
121 */
122#define CONFIGURE_INIT
123
124#include <rtems/confdefs.h>
125
126/* global variables */
Note: See TracBrowser for help on using the repository browser.