source: rtems/testsuites/smptests/smpfatal08/init.c @ c147a139

4.115
Last change on this file since c147a139 was c147a139, checked in by Sebastian Huber <sebastian.huber@…>, on Sep 1, 2014 at 6:45:23 AM

smptests/smpfatal08: Fix link error

  • Property mode set to 100644
File size: 2.6 KB
Line 
1/*
2 * Copyright (c) 2014 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
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.org/license/LICENSE.
13 */
14
15#ifdef HAVE_CONFIG_H
16  #include "config.h"
17#endif
18
19#include <rtems.h>
20#include <rtems/test.h>
21#include <rtems/score/smpimpl.h>
22
23#include <bsp/bootcard.h>
24
25#include <assert.h>
26#include <stdlib.h>
27
28const char rtems_test_name[] = "SMPFATAL 8";
29
30/*
31 * This test is a hack since there is no easy way to test this fatal error path
32 * without BSP support.
33 */
34
35void bsp_start_on_secondary_processor(void)
36{
37  /* Provided to avoid multiple definitions of the CPU SMP support functions */
38}
39
40uint32_t _CPU_SMP_Initialize(void)
41{
42  return 2;
43}
44
45bool _CPU_SMP_Start_processor(uint32_t cpu_index)
46{
47  (void) cpu_index;
48
49  return false;
50}
51
52void _CPU_SMP_Finalize_initialization(uint32_t cpu_count)
53{
54  (void) cpu_count;
55
56  assert(0);
57}
58
59#if defined(RTEMS_PARAVIRT) \
60  || (!defined(__leon__) && !defined(__PPC__) && !defined(__arm__))
61uint32_t _CPU_SMP_Get_current_processor(void)
62{
63  return 0;
64}
65#endif
66
67#if defined(__leon__)
68void _LEON3_Start_multitasking(Context_Control *heir)
69{
70  assert(0);
71}
72#endif
73
74void _CPU_SMP_Send_interrupt(uint32_t target_processor_index)
75{
76  (void) target_processor_index;
77}
78
79static void Init(rtems_task_argument arg)
80{
81  assert(0);
82}
83
84static void fatal_extension(
85  rtems_fatal_source source,
86  bool is_internal,
87  rtems_fatal_code code
88)
89{
90  rtems_test_begink();
91
92  if (
93    source == RTEMS_FATAL_SOURCE_SMP
94      && !is_internal
95      && code == SMP_FATAL_START_OF_MANDATORY_PROCESSOR_FAILED
96  ) {
97    rtems_test_endk();
98  }
99}
100
101#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
102#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
103
104#define CONFIGURE_INITIAL_EXTENSIONS \
105  { .fatal = fatal_extension }, \
106  RTEMS_TEST_INITIAL_EXTENSION
107
108#define CONFIGURE_SMP_APPLICATION
109
110#define CONFIGURE_SMP_MAXIMUM_PROCESSORS 2
111
112#define CONFIGURE_SCHEDULER_SIMPLE_SMP
113
114#include <rtems/scheduler.h>
115
116RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(a);
117
118#define CONFIGURE_SCHEDULER_CONTROLS \
119  RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(a, rtems_build_name('S', 'I', 'M', 'P'))
120
121#define CONFIGURE_SMP_SCHEDULER_ASSIGNMENTS \
122  RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY), \
123  RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY)
124
125#define CONFIGURE_MAXIMUM_TASKS 1
126
127#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
128
129#define CONFIGURE_INIT
130
131#include <rtems/confdefs.h>
Note: See TracBrowser for help on using the repository browser.