source: rtems/testsuites/sptests/spinternalerror01/init.c @ 44633fd

4.115
Last change on this file since 44633fd was 44633fd, checked in by Sebastian Huber <sebastian.huber@…>, on 11/07/12 at 11:31:27

sptests/spinternalerror01: New test

  • Property mode set to 100644
File size: 1.7 KB
Line 
1/*
2 * Copyright (c) 2012 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Obere Lagerstr. 30
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.com/license/LICENSE.
13 */
14
15#ifdef HAVE_CONFIG_H
16  #include "config.h"
17#endif
18
19#include <bsp.h>
20#include <bsp/bootcard.h>
21
22#define FATAL_SOURCE 0xdeadbeef
23
24#define FATAL_IS_INTERNAL false
25
26#define FATAL_ERROR 0x600df00d
27
28uint32_t boot_card( const char *cmdline )
29{
30  _Internal_error_Occurred( FATAL_SOURCE, FATAL_IS_INTERNAL, FATAL_ERROR );
31
32  return 0;
33}
34
35static void fatal_extension(
36  Internal_errors_Source source,
37  bool is_internal,
38  Internal_errors_t error
39)
40{
41  printk( "\n\n*** TEST SPINTERNALERROR 1 ***\n" );
42
43  if (
44    source == FATAL_SOURCE
45      && is_internal == FATAL_IS_INTERNAL
46      && error == FATAL_ERROR
47  ) {
48    printk( "*** END OF TEST SPINTERNALERROR 1 ***\n" );
49  }
50}
51
52static void *idle_body(uintptr_t ignored)
53{
54  while ( true ) {
55    /* Do nothing */
56  }
57
58  return NULL;
59}
60
61#define CONFIGURE_INITIAL_EXTENSIONS { .fatal = fatal_extension }
62
63#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
64
65#define CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
66
67#define CONFIGURE_DISABLE_NEWLIB_REENTRANCY
68
69#define CONFIGURE_SCHEDULER_ENTRY_POINTS NULL
70
71#define CONFIGURE_SCHEDULER_USER
72
73#define CONFIGURE_MEMORY_FOR_SCHEDULER 0
74
75#define CONFIGURE_MEMORY_PER_TASK_FOR_SCHEDULER 0
76
77#define CONFIGURE_TASK_STACK_ALLOCATOR NULL
78
79#define CONFIGURE_TASK_STACK_DEALLOCATOR NULL
80
81#define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION
82
83#define CONFIGURE_IDLE_TASK_BODY idle_body
84
85#define CONFIGURE_INIT
86
87#include <rtems/confdefs.h>
Note: See TracBrowser for help on using the repository browser.