3 Copyright (c) 2005,2008 Red Hat Incorporated.
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
9 Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
12 Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
16 The name of Red Hat Incorporated may not be used to endorse
17 or promote products derived from this software without specific
18 prior written permission.
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY
24 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 #if defined(__r8c_cpu__) || defined(__m16c_cpu__)
45 .section ".resetvec","ax",@progbits
53 fclr U /* One stack for user and interrupts */
57 mov.b #%hi8(__romdatastart),r1h
58 mov.w #%lo16(__romdatastart),a0
61 mov.l #__romdatastart,a0
64 mov.w #__romdatacopysize,r3
79 ldc #%lo16(__var_vects),intbl
80 ldc #%hi16(__var_vects),intbh
92 /* rv in r0, ok for arg0 */
101 .global _m32c_run_preinit_array
102 .type _m32c_run_preinit_array,@function
103 _m32c_run_preinit_array:
104 mov.W #__preinit_array_start,a0
105 mov.W #__preinit_array_end,a1
106 jmp.w _m32c_run_inilist
108 .global _m32c_run_init_array
109 .type _m32c_run_init_array,@function
110 _m32c_run_init_array:
111 mov.W #__init_array_start,a0
112 mov.W #__init_array_end,a1
113 jmp.w _m32c_run_inilist
115 .global _m32c_run_fini_array
116 .type _m32c_run_fini_array,@function
117 _m32c_run_fini_array:
118 mov.W #__fini_array_start,a0
119 mov.W #__fini_array_end,a1
129 mov.b:s #0,a1 /* zero extends */
140 .section .init,"ax",@progbits
146 .section .fini,"ax",@progbits
151 jsr.a _m32c_run_fini_array
154 ;;; Provide Dwarf unwinding information that will help GDB stop
155 ;;; backtraces at the right place. This is stolen from assembly
156 ;;; code generated by GCC with -dA.
157 .section .debug_frame,"",@progbits
159 .4byte .LECIE0-.LSCIE0 ; Length of Common Information Entry
161 .4byte 0xffffffff ; CIE Identifier Tag
162 .byte 0x1 ; CIE Version
163 .ascii "\0" ; CIE Augmentation
164 .uleb128 0x1 ; CIE Code Alignment Factor
165 .sleb128 -1 ; CIE Data Alignment Factor
166 .byte 0xd ; CIE RA Column
167 .byte 0xc ; DW_CFA_def_cfa
170 .byte 0x8d ; DW_CFA_offset, column 0xd
175 .4byte .LEFDE0-.LASFDE0 ; FDE Length
177 .4byte .Lframe0 ; FDE CIE offset
178 .4byte .LFB2 ; FDE initial location
179 .4byte .LFE2-.LFB2 ; FDE address range
180 .byte 0xf ; DW_CFA_def_cfa_expression
181 .uleb128 1 ; length of expression
182 .byte 0x30 ; DW_OP_lit0