Update crt0.S for ARC.
This is similar to commit 06537f05d4
to the
newlib for ARC.
GCC for ARC has been updated to provide consistent naming of preprocessor
definitions for different optional architecture features:
* __ARC_BARREL_SHIFTER__ instead of __Xbarrel_shifter for
-mbarrel-shifter
* __ARCEM__ instead of __EM__ for ARC EM cores
* __ARCHS__ instead of __HS__ for ARC HS cores
* etc (not used in libgloss)
This patch updates crt0.S for ARC to use new definitions instead of a
deprecated ones. To ensure compatibility with older compiler new definitions
are also defined in crt0.S if needed, based on presence of deprecated
preprocessor definitions.
libgloss/ChangeLog
2016-04-29 Anton Kolesov <Anton.Kolesov@synopsys.com>
* arc/crt0.S: Use new GCC defines to detect processor features.
This commit is contained in:
parent
e90da68265
commit
cd494f7038
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (c) 2015, Synopsys, Inc. All rights reserved.
|
Copyright (c) 2015-2016, Synopsys, Inc. All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions are met:
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
@ -41,10 +41,24 @@
|
||||||
the initialization code.
|
the initialization code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Compatibility with older ARC GCC, that doesn't provide some of the
|
||||||
|
preprocessor defines used by newlib and libgloss for ARC. */
|
||||||
|
#if defined (__Xbarrel_shifter) && !defined (__ARC_BARREL_SHIFTER__)
|
||||||
|
#define __ARC_BARREL_SHIFTER__ 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined (__EM__) && !defined (__ARCEM__)
|
||||||
|
#define __ARCEM__ 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined (__HS__) && !defined (__ARCHS__)
|
||||||
|
#define __ARCHS__ 1
|
||||||
|
#endif
|
||||||
|
|
||||||
.file "crt0.S"
|
.file "crt0.S"
|
||||||
.extern main
|
.extern main
|
||||||
|
|
||||||
#if defined (__EM__) || defined (__HS__)
|
#if defined (__ARCEM__) || defined (__ARCHS__)
|
||||||
.section .ivt, "a", @progbits
|
.section .ivt, "a", @progbits
|
||||||
|
|
||||||
; handler's name, type, number,name, offset in IVT (hex/dec)
|
; handler's name, type, number,name, offset in IVT (hex/dec)
|
||||||
|
@ -74,7 +88,7 @@
|
||||||
.section .text.__startup, "ax", @progbits
|
.section .text.__startup, "ax", @progbits
|
||||||
#else
|
#else
|
||||||
.text
|
.text
|
||||||
#endif
|
#endif /* __ARCEM__ || __ARCHS__ */
|
||||||
|
|
||||||
.global __start
|
.global __start
|
||||||
.type __start, @function
|
.type __start, @function
|
||||||
|
@ -111,7 +125,7 @@ __start:
|
||||||
; instruction
|
; instruction
|
||||||
; - loop body should have at least two instruction words
|
; - loop body should have at least two instruction words
|
||||||
__start:
|
__start:
|
||||||
#if defined (__HS__)
|
#if defined (__ARCHS__)
|
||||||
; Allow unaligned accesses.
|
; Allow unaligned accesses.
|
||||||
lr r2, [0xA]
|
lr r2, [0xA]
|
||||||
bset r2, r2, 19
|
bset r2, r2, 19
|
||||||
|
@ -163,21 +177,21 @@ __start:
|
||||||
jl @_init
|
jl @_init
|
||||||
#else
|
#else
|
||||||
bl @_init
|
bl @_init
|
||||||
#endif
|
#endif /* __ARCEM__ || __ARCHS__ */
|
||||||
mov_s r0, r13
|
mov_s r0, r13
|
||||||
mov_s r1, r14
|
mov_s r1, r14
|
||||||
; branch to main
|
; branch to main
|
||||||
#if defined (__EM__) || defined (__HS__)
|
#if defined (__ARCEM__) || defined (__ARCHS__)
|
||||||
mov fp,0 ; initialize frame pointer
|
mov fp,0 ; initialize frame pointer
|
||||||
jl @main
|
jl @main
|
||||||
#else
|
#else
|
||||||
bl.d @main
|
bl.d @main
|
||||||
mov fp, 0 ; initialize frame pointer
|
mov fp, 0 ; initialize frame pointer
|
||||||
#endif
|
#endif /* __ARCEM__ || __ARCHS__ */
|
||||||
; r0 contains exit code
|
; r0 contains exit code
|
||||||
j @exit
|
j @exit
|
||||||
|
|
||||||
#if defined (__EM__) || defined (__HS__)
|
#if defined (__ARCEM__) || defined (__ARCHS__)
|
||||||
; ARCv2 default interrupt routines, defined as weak symbols.
|
; ARCv2 default interrupt routines, defined as weak symbols.
|
||||||
; Default implementation halts the core. To conserve code size those symbols
|
; Default implementation halts the core. To conserve code size those symbols
|
||||||
; share a single implementation, however as a downside debugger and
|
; share a single implementation, however as a downside debugger and
|
||||||
|
@ -225,7 +239,7 @@ IRQ_20 :
|
||||||
nop
|
nop
|
||||||
b .Lloop_halt
|
b .Lloop_halt
|
||||||
nop
|
nop
|
||||||
#endif
|
#endif /* __ARCEM__ || __ARCHS__ */
|
||||||
|
|
||||||
.section .text._exit_halt,"ax",@progbits
|
.section .text._exit_halt,"ax",@progbits
|
||||||
.global _exit_halt
|
.global _exit_halt
|
||||||
|
|
Loading…
Reference in New Issue