source: rtems/testsuites/smptests/smpfatal08/init.c @ 4f10ed6

4.115
Last change on this file since 4f10ed6 was 4f10ed6, checked in by Sebastian Huber <sebastian.huber@…>, on 03/24/15 at 12:42:08

smptests/smpfatal08: Workaround for QorIQ BSPs

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