source: rtems/cpukit/score/cpu/m68k/__m68k_read_tp.c @ 022851a

4.115
Last change on this file since 022851a was 022851a, checked in by Sebastian Huber <sebastian.huber@…>, on Jan 28, 2014 at 11:10:08 AM

Add thread-local storage (TLS) support

Tested and implemented on ARM, m68k, PowerPC and SPARC. Other
architectures need more work.

  • Property mode set to 100644
File size: 784 bytes
Line 
1/*
2 * Copyright (c) 2014 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Obere Lagerstr. 30
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#include <rtems/score/tls.h>
21
22void __m68k_read_tp(void);
23
24void __m68k_read_tp(void)
25{
26  const Thread_Control *executing = _Thread_Get_executing();
27  void *tp = (char *) executing->Start.tls_area +
28    _TLS_Get_thread_control_block_area_size((uintptr_t) _TLS_Alignment)
29    + 0x7000;
30
31  __asm__ volatile (
32    "move.l %0, %%a0"
33    :
34    : "d" (tp)
35  );
36}
Note: See TracBrowser for help on using the repository browser.