source: rtems/testsuites/smptests/smpfatal08/init.c @ 5f652cb2

Last change on this file since 5f652cb2 was 5f652cb2, checked in by Kinsey Moore <kinsey.moore@…>, on 07/26/21 at 20:43:00

cpukit: Add AArch64 SMP Support

This adds SMP support for AArch64 in cpukit and for the ZynqMP BSPs.

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