1 | /* SPDX-License-Identifier: BSD-2-Clause */ |
---|
2 | |
---|
3 | /* |
---|
4 | * Copyright (c) 2014 embedded brains GmbH & Co. KG |
---|
5 | * |
---|
6 | * Redistribution and use in source and binary forms, with or without |
---|
7 | * modification, are permitted provided that the following conditions |
---|
8 | * are met: |
---|
9 | * 1. Redistributions of source code must retain the above copyright |
---|
10 | * notice, this list of conditions and the following disclaimer. |
---|
11 | * 2. Redistributions in binary form must reproduce the above copyright |
---|
12 | * notice, this list of conditions and the following disclaimer in the |
---|
13 | * documentation and/or other materials provided with the distribution. |
---|
14 | * |
---|
15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
---|
19 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
21 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
24 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
---|
25 | * POSSIBILITY OF SUCH DAMAGE. |
---|
26 | */ |
---|
27 | |
---|
28 | #ifdef HAVE_CONFIG_H |
---|
29 | #include "config.h" |
---|
30 | #endif |
---|
31 | |
---|
32 | #include "tmacros.h" |
---|
33 | |
---|
34 | #include <rtems.h> |
---|
35 | #include <rtems/score/smpimpl.h> |
---|
36 | |
---|
37 | #include <assert.h> |
---|
38 | #include <stdlib.h> |
---|
39 | |
---|
40 | const char rtems_test_name[] = "SMPFATAL 5"; |
---|
41 | |
---|
42 | static void Init(rtems_task_argument arg) |
---|
43 | { |
---|
44 | assert(0); |
---|
45 | } |
---|
46 | |
---|
47 | static void fatal_extension( |
---|
48 | rtems_fatal_source source, |
---|
49 | bool always_set_to_false, |
---|
50 | rtems_fatal_code code |
---|
51 | ) |
---|
52 | { |
---|
53 | TEST_BEGIN(); |
---|
54 | |
---|
55 | if ( |
---|
56 | source == RTEMS_FATAL_SOURCE_SMP |
---|
57 | && !always_set_to_false |
---|
58 | && code == SMP_FATAL_MANDATORY_PROCESSOR_NOT_PRESENT |
---|
59 | ) { |
---|
60 | TEST_END(); |
---|
61 | } |
---|
62 | } |
---|
63 | |
---|
64 | #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER |
---|
65 | #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER |
---|
66 | |
---|
67 | #define CONFIGURE_INITIAL_EXTENSIONS \ |
---|
68 | { .fatal = fatal_extension }, \ |
---|
69 | RTEMS_TEST_INITIAL_EXTENSION |
---|
70 | |
---|
71 | /* Lets see when the first RTEMS system hits this limit */ |
---|
72 | #define CONFIGURE_MAXIMUM_PROCESSORS 64 |
---|
73 | |
---|
74 | #define CONFIGURE_SCHEDULER_SIMPLE_SMP |
---|
75 | |
---|
76 | #include <rtems/scheduler.h> |
---|
77 | |
---|
78 | RTEMS_SCHEDULER_SIMPLE_SMP(a); |
---|
79 | |
---|
80 | #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \ |
---|
81 | RTEMS_SCHEDULER_TABLE_SIMPLE_SMP(a, rtems_build_name('S', 'I', 'M', 'P')) |
---|
82 | |
---|
83 | #define ASSIGN \ |
---|
84 | RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY) |
---|
85 | |
---|
86 | #define CONFIGURE_SCHEDULER_ASSIGNMENTS \ |
---|
87 | ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, \ |
---|
88 | ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, \ |
---|
89 | ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, \ |
---|
90 | ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, \ |
---|
91 | ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, \ |
---|
92 | ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, \ |
---|
93 | ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, \ |
---|
94 | ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN, ASSIGN |
---|
95 | |
---|
96 | #define CONFIGURE_MAXIMUM_TASKS 1 |
---|
97 | |
---|
98 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
99 | |
---|
100 | #define CONFIGURE_INIT |
---|
101 | |
---|
102 | #include <rtems/confdefs.h> |
---|