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

Last change on this file since e71f0909 was e71f0909, checked in by Joel Sherrill <joel@…>, on 04/07/22 at 16:13:34

testsuites/samples: Change license to BSD-2

Updates #3053.

  • Property mode set to 100644
File size: 4.3 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#define CONFIGURE_MINIMUM_TASK_STACK_SIZE 512
85
86/*
87 * Keep the interrupt/initialization stack as is.  Otherwise, the test may fail
88 * in the low level system initialization.
89 */
90#ifdef BSP_INTERRUPT_STACK_SIZE
91  #define CONFIGURE_INTERRUPT_STACK_SIZE BSP_INTERRUPT_STACK_SIZE
92#else
93  #define CONFIGURE_INTERRUPT_STACK_SIZE CPU_STACK_MINIMUM_SIZE
94#endif
95
96/*
97 *  This lowers the number of priorities that this test is able to
98 *  use.  The Idle task will be running at the lowest priority.
99 */
100#define CONFIGURE_MAXIMUM_PRIORITY 15
101
102/*
103 *  This configures RTEMS to use a single memory pool for the RTEMS Workspace
104 *  and C Program Heap.  If not defined, there will be separate memory pools
105 *  for the RTEMS Workspace and C Program Heap.  Having separate pools
106 *  does haved some advantages in the event a task blows a stack or writes
107 *  outside its memory area. However, in low memory systems the overhead of
108 *  the two pools plus the potential for unused memory in either pool is
109 *  very undesirable.
110 *
111 *  In high memory environments, this is desirable when you want to use
112 *  the RTEMS "unlimited" objects option.  You will be able to create objects
113 *  until you run out of memory.
114 */
115#define CONFIGURE_UNIFIED_WORK_AREAS
116
117/*
118 *  In this application, the initialization task performs the system
119 *  initialization and then transforms itself into the idle task.
120 */
121#define CONFIGURE_IDLE_TASK_BODY Init
122#define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION
123
124/*
125 *  If you are debugging confdefs.h, define this
126 */
127/* #define CONFIGURE_CONFDEFS_DEBUG */
128
129/*
130 *  Instantiate the configuration tables.
131 */
132#define CONFIGURE_INIT
133
134#include <rtems/confdefs.h>
135
136/* global variables */
Note: See TracBrowser for help on using the repository browser.