source: rtems/testsuites/samples/minimum/init.c @ 3ac6eb90

4.11
Last change on this file since 3ac6eb90 was 3ac6eb90, checked in by Sebastian Huber <sebastian.huber@…>, on Jul 7, 2010 at 9:26:05 AM

2010-07-07 Sebastian Huber <Sebastian.Huber@…>

  • minimum/init.c: Use fatal error extension to prevent infinite runtime.
  • Property mode set to 100644
File size: 3.4 KB
Line 
1/*  Minimum Size Application Initialization
2 *
3 *  COPYRIGHT (c) 1989-2008.
4 *  On-Line Applications Research Corporation (OAR).
5 *
6 *  The license and distribution terms for this file may be
7 *  found in the file LICENSE in this distribution or at
8 *  http://www.rtems.com/license/LICENSE.
9 *
10 *  $Id$
11 */
12
13#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
14
15#include <bsp.h>
16#include <rtems/score/thread.h>
17
18rtems_task Init(
19  rtems_task_argument ignored
20)
21{
22  /* initialize application */
23
24  /* Real application would call idle loop functionality */
25
26  /* but in this case, just return and fall into a fatal error */
27}
28
29/* configuration information */
30
31/*
32 * This fatal extension adds some bytes to the absolute minimum, but it
33 * prevents the _CPU_Fatal_halt().
34 */
35static void Fatal_extension(
36  uint32_t source,
37  bool is_internal,
38  uint32_t error
39)
40{
41  _Thread_Stop_multitasking();
42}
43
44#define CONFIGURE_INITIAL_EXTENSIONS { .fatal = Fatal_extension }
45
46/*
47 * This application has no device drivers.
48 */
49/* NOTICE: the clock driver is explicitly disabled */
50#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
51
52/*
53 *  This application has no filesytem and libio support.
54 */
55#define CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
56
57/*
58 *  This disables reentrancy support in the C Library.  It is usually
59 *  not something an application wants to do unless the development
60 *  team is committed to using C Library routines that are KNOWN to
61 *  be reentrant.  Caveat Emptor!!
62 */
63#define CONFIGURE_DISABLE_NEWLIB_REENTRANCY
64
65/*
66 *  This test does not need the console driver so there is no reason
67 *  to configure termios.
68 */
69#define CONFIGURE_TERMIOS_DISABLED
70
71/*
72 *  This test does not use any stdio.
73 */
74#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 0
75
76/*
77 *  This may prevent us from running on every architecture but it
78 *  demonstrates that the user can specify how small of a minimum
79 *  stack they want.
80 */
81#define CONFIGURE_MINIMUM_TASK_STACK_SIZE 512
82
83/*
84 *  This lowers the number of priorities that this test is able to
85 *  use.  The Idle task will be running at the lowest priority.
86 */
87#define CONFIGURE_MAXIMUM_PRIORITY 15
88
89/*
90 *  This disables Classic API Notepads and saves 16 uint32_t's of RAM
91 *  per Task Control Block.  If you aren't using these and are tight
92 *  on RAM, this is an option.
93 */
94#define CONFIGURE_DISABLE_CLASSIC_API_NOTEPADS
95
96/*
97 *  This configures RTEMS to use a single memory pool for the RTEMS Workspace
98 *  and C Program Heap.  If not defined, there will be separate memory pools
99 *  for the RTEMS Workspace and C Program Heap.  Having separate pools
100 *  does haved some advantages in the event a task blows a stack or writes
101 *  outside its memory area. However, in low memory systems the overhead of
102 *  the two pools plus the potential for unused memory in either pool is
103 *  very undesirable.
104 *
105 *  In high memory environments, this is desirable when you want to use
106 *  the RTEMS "unlimited" objects option.  You will be able to create objects
107 *  until you run out of memory.
108 */
109#define CONFIGURE_UNIFIED_WORK_AREAS
110
111/*
112 *  In this application, the initialization task performs the system
113 *  initialization and then transforms itself into the idle task.
114 */
115#define CONFIGURE_IDLE_TASK_BODY Init
116#define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION
117
118/*
119 *  If you are debugging confdefs.h, define this
120 */
121/* #define CONFIGURE_CONFDEFS_DEBUG */
122
123/*
124 *  Instantiate the configuration tables.
125 */
126#define CONFIGURE_INIT
127
128#include <rtems/confdefs.h>
129
130/* global variables */
Note: See TracBrowser for help on using the repository browser.