source: rtems/testsuites/sptests/sptls03/init.c @ 95d0c98

4.115
Last change on this file since 95d0c98 was 95d0c98, checked in by Sebastian Huber <sebastian.huber@…>, on 02/24/14 at 09:13:32

score: Fix thread TLS area initialization

Do not use _TLS_Size here since this will lead GCC to assume that this
symbol is not 0 and the later > 0 test will be optimized away.

  • Property mode set to 100644
File size: 1.2 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.com/license/LICENSE.
13 */
14
15#ifdef HAVE_CONFIG_H
16  #include "config.h"
17#endif
18
19#include <rtems/score/thread.h>
20
21#include "tmacros.h"
22
23static volatile int read_write_small = 0xdeadbeef;
24
25static const volatile int read_only_small = 0x601dc0fe;
26
27static void test(void)
28{
29  Thread_Control *executing = _Thread_Get_executing();
30
31  rtems_test_assert(read_write_small == 0xdeadbeef);
32  rtems_test_assert(read_only_small == 0x601dc0fe);
33
34  rtems_test_assert(executing->Start.tls_area == NULL);
35}
36
37static void Init(rtems_task_argument arg)
38{
39  puts("\n\n*** TEST SPTLS 3 ***");
40
41  test();
42
43  puts("*** END OF TEST SPTLS 3 ***");
44
45  rtems_test_exit(0);
46}
47
48#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
49#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
50
51#define CONFIGURE_MAXIMUM_TASKS 1
52
53#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
54
55#define CONFIGURE_INIT
56
57#include <rtems/confdefs.h>
Note: See TracBrowser for help on using the repository browser.