source: rtems/testsuites/smptests/smpunsupported01/init.c @ d2711c37

5
Last change on this file since d2711c37 was c4b8b147, checked in by Sebastian Huber <sebastian.huber@…>, on 11/03/17 at 07:35:38

tests: Use simple console driver

Update #3170.
Update #3199.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*
2 * Copyright (c) 2014 On-Line Applications Research Corporation (OAR).
3 * Copyright (c) 2013, 2016 embedded brains GmbH.  All rights reserved.
4 *
5 *  embedded brains GmbH
6 *  Dornierstr. 4
7 *  82178 Puchheim
8 *  Germany
9 *  <rtems@embedded-brains.de>
10 *
11 * The license and distribution terms for this file may be
12 * found in the file LICENSE in this distribution or at
13 * http://www.rtems.org/license/LICENSE.
14 */
15
16#ifdef HAVE_CONFIG_H
17  #include "config.h"
18#endif
19
20#include "tmacros.h"
21
22const char rtems_test_name[] = "SMPUNSUPPORTED 1";
23
24static void test(void)
25{
26  rtems_status_code sc;
27  rtems_mode mode;
28  rtems_id id;
29
30  rtems_test_assert(rtems_configuration_is_smp_enabled());
31
32  sc = rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &mode);
33  rtems_test_assert(sc == RTEMS_NOT_IMPLEMENTED);
34
35  sc = rtems_task_create(
36    rtems_build_name('T', 'A', 'S', 'K'),
37    RTEMS_MINIMUM_PRIORITY,
38    RTEMS_MINIMUM_STACK_SIZE,
39    RTEMS_NO_PREEMPT,
40    RTEMS_DEFAULT_ATTRIBUTES,
41    &id
42  );
43  rtems_test_assert(sc == RTEMS_UNSATISFIED);
44
45  mode = RTEMS_INTERRUPT_LEVEL(1);
46
47  if (mode != 0) {
48    sc = rtems_task_create(
49      rtems_build_name('T', 'A', 'S', 'K'),
50      RTEMS_MINIMUM_PRIORITY,
51      RTEMS_MINIMUM_STACK_SIZE,
52      mode,
53      RTEMS_DEFAULT_ATTRIBUTES,
54      &id
55    );
56    rtems_test_assert(sc == RTEMS_UNSATISFIED);
57  } else {
58    puts("RTEMS_INTERRUPT_LEVEL(1) not supported on this platform");
59  }
60}
61
62static void Init(rtems_task_argument arg)
63{
64  TEST_BEGIN();
65
66  test();
67
68  TEST_END();
69  rtems_test_exit(0);
70}
71
72#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
73#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
74
75#define CONFIGURE_MAXIMUM_PROCESSORS 2
76
77#define CONFIGURE_MAXIMUM_TASKS 2
78
79#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
80
81#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
82
83#define CONFIGURE_INIT
84
85#include <rtems/confdefs.h>
Note: See TracBrowser for help on using the repository browser.