Home | History | Annotate | Line # | Download | only in arc
      1      1.1  mrg ; newlib tls glue code for Synopsys DesignWare ARC cpu.
      2      1.1  mrg 
      3  1.1.1.5  mrg /* Copyright (C) 2016-2022 Free Software Foundation, Inc.
      4      1.1  mrg    Contributor: Joern Rennecke <joern.rennecke (at) embecosm.com>
      5      1.1  mrg 		on behalf of Synopsys Inc.
      6      1.1  mrg 
      7      1.1  mrg This file is part of GCC.
      8      1.1  mrg 
      9      1.1  mrg GCC is free software; you can redistribute it and/or modify it under
     10      1.1  mrg the terms of the GNU General Public License as published by the Free
     11      1.1  mrg Software Foundation; either version 3, or (at your option) any later
     12      1.1  mrg version.
     13      1.1  mrg 
     14      1.1  mrg GCC is distributed in the hope that it will be useful, but WITHOUT ANY
     15      1.1  mrg WARRANTY; without even the implied warranty of MERCHANTABILITY or
     16      1.1  mrg FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
     17      1.1  mrg for more details.
     18      1.1  mrg 
     19      1.1  mrg Under Section 7 of GPL version 3, you are granted additional
     20      1.1  mrg permissions described in the GCC Runtime Library Exception, version
     21      1.1  mrg 3.1, as published by the Free Software Foundation.
     22      1.1  mrg 
     23      1.1  mrg You should have received a copy of the GNU General Public License and
     24      1.1  mrg a copy of the GCC Runtime Library Exception along with this program;
     25      1.1  mrg see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
     26      1.1  mrg <http://www.gnu.org/licenses/>.  */
     27      1.1  mrg 
     28      1.1  mrg /* As a special exception, if you link this library with other files,
     29      1.1  mrg    some of which are compiled with GCC, to produce an executable,
     30      1.1  mrg    this library does not by itself cause the resulting executable
     31      1.1  mrg    to be covered by the GNU General Public License.
     32      1.1  mrg    This exception does not however invalidate any other reasons why
     33      1.1  mrg    the executable file might be covered by the GNU General Public License.  */
     34      1.1  mrg 
     35      1.1  mrg 
     36  1.1.1.4  mrg #ifdef __ARC_RF16__
     37  1.1.1.4  mrg 	/* Use object attributes to inform other tools this file is
     38  1.1.1.4  mrg 	safe for RF16 configuration.  */
     39  1.1.1.4  mrg 	.arc_attribute Tag_ARC_ABI_rf16, 1
     40  1.1.1.4  mrg #endif
     41  1.1.1.4  mrg 
     42      1.1  mrg #if (__ARC_TLS_REGNO__ != -1)
     43      1.1  mrg  /* ANSI concatenation macros.  */
     44      1.1  mrg 
     45      1.1  mrg #define CONCAT1(a, b) CONCAT2(a, b)
     46      1.1  mrg #define CONCAT2(a, b) a ## b
     47      1.1  mrg 
     48      1.1  mrg  /* Use the right prefix for global labels.  */
     49      1.1  mrg 
     50      1.1  mrg #define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
     51      1.1  mrg 
     52      1.1  mrg #define FUNC(X)         .type SYM(X),@function
     53      1.1  mrg #define ENDFUNC0(X)     .Lfe_##X: .size X,.Lfe_##X-X
     54      1.1  mrg #define ENDFUNC(X)      ENDFUNC0(X)
     55      1.1  mrg 
     56      1.1  mrg 	.global SYM(__read_tp)
     57      1.1  mrg SYM(__read_tp):
     58      1.1  mrg 	FUNC(__read_tp)
     59      1.1  mrg 	mov r0, CONCAT1 (r, __ARC_TLS_REGNO__)
     60      1.1  mrg 	nop
     61      1.1  mrg 	j [blink]
     62      1.1  mrg 	ENDFUNC(__read_tp)
     63      1.1  mrg 
     64      1.1  mrg 	.section .init
     65      1.1  mrg 	mov CONCAT1 (r, __ARC_TLS_REGNO__),__main_tcb_end+256
     66      1.1  mrg 
     67      1.1  mrg 	.section .tbss
     68      1.1  mrg __main_tcb:
     69      1.1  mrg 	.long 0
     70      1.1  mrg 	.long 0
     71      1.1  mrg __main_tcb_end:
     72      1.1  mrg 
     73      1.1  mrg #endif /*__ARC_TLS_REGNO__ != -1 */
     74