3 * 1 define and initial the stack pointer
\r
4 * 2 exception handler table
\r
6 * 4 go to __main in entry.o
\r
8 * Copyright (C) 2016~2017 Hangzhou C-SKY Microsystems Co., Ltd
\r
9 * Modify by Jiang Long on 2016-09-14
\r
11 // <<< Use Configuration Wizard in Context Menu >>>
\r
14 * For importing variable or functions from other c or assemble files.
\r
19 * default service routine
\r
21 .global Reset_Handler
\r
22 .global Misaligned_Access_Handler
\r
23 .global Access_Error_Handler
\r
24 .global Divided_By_Zero_Handler
\r
25 .global Illegal_Handler
\r
26 .global Privlege_Violation_Handler
\r
27 .global Trace_Exection_Handler
\r
28 .global Breakpoint_Exception_Handler
\r
29 .global Unrecoverable_Error_Handler
\r
30 .global Idly4_Error_Handler
\r
31 .global Auto_INT_Handler
\r
32 .global Auto_FINT_Handler
\r
33 .global Reserved_HAI_Handler
\r
34 .global Reserved_FP_Handler
\r
35 .global TLB_Ins_Empty_Handler
\r
36 .global TLB_Data_Empty_Handler
\r
37 .global Default_handler
\r
40 .weak Misaligned_Access_Handler
\r
41 .weak Access_Error_Handler
\r
42 .weak Divided_By_Zero_Handler
\r
43 .weak Illegal_Handler
\r
44 .weak Privlege_Violation_Handler
\r
45 .weak Trace_Exection_Handler
\r
46 .weak Breakpoint_Exception_Handler
\r
47 .weak Unrecoverable_Error_Handler
\r
48 .weak Idly4_Error_Handler
\r
49 .weak Auto_INT_Handler
\r
50 .weak Auto_FINT_Handler
\r
51 .weak Reserved_HAI_Handler
\r
52 .weak Reserved_FP_Handler
\r
53 .weak TLB_Ins_Empty_Handler
\r
54 .weak TLB_Data_Empty_Handler
\r
55 .weak Default_handler
\r
58 .export ckcpu_vsr_table /* Vector table base address. */
\r
59 .section .exp_table,"ax",@progbits
\r
60 /* Vector table space. */
\r
65 .long Misaligned_Access_Handler
\r
66 .long Access_Error_Handler
\r
67 .long Divided_By_Zero_Handler
\r
68 .long Illegal_Handler
\r
69 .long Privlege_Violation_Handler
\r
70 .long Trace_Exection_Handler
\r
71 .long Breakpoint_Exception_Handler
\r
72 .long Unrecoverable_Error_Handler
\r
73 .long Idly4_Error_Handler
\r
74 .long Auto_INT_Handler
\r
75 .long Auto_FINT_Handler
\r
76 .long Reserved_HAI_Handler
\r
77 .long Reserved_FP_Handler
\r
78 .long TLB_Ins_Empty_Handler
\r
79 .long TLB_Data_Empty_Handler
\r
82 .long NOVIC_IRQ_Default_Handler
\r
85 /* The ckcpu startup codes. */
\r
89 * This is the codes first entry point. This is where it all begins...
\r
93 * Init psr value, enable exception, disable interrupt and fast interrupt.
\r
103 * Setup initial vector base table for interrupts and exceptions
\r
105 lrw a3, ckcpu_vsr_table
\r
108 /* Initialize the normal stack pointer from the linker definition. */
\r
109 lrw r0, g_top_irqstack
\r
113 * The ranges of copy from/to are specified by following symbols
\r
114 * __etext: LMA of start of the section to copy from. Usually end of text
\r
115 * __data_start__: VMA of start of the section to copy to
\r
116 * __data_end__: VMA of end of the section to copy to
\r
118 * All addresses must be aligned to 4 bytes boundary.
\r
121 lrw r2, __data_start__
\r
122 lrw r3, __data_end__
\r
140 * The BSS section is specified by following symbols
\r
141 * __bss_start__: start of the BSS section.
\r
142 * __bss_end__: end of the BSS section.
\r
144 * Both addresses must be aligned to 4 bytes boundary.
\r
146 lrw r1, __bss_start__
\r
147 lrw r2, __bss_end__
\r
164 /* Should never get here. */
\r
167 Misaligned_Access_Handler:
\r
168 Access_Error_Handler:
\r
169 Divided_By_Zero_Handler:
\r
171 Privlege_Violation_Handler:
\r
172 Trace_Exection_Handler:
\r
173 Breakpoint_Exception_Handler:
\r
174 Unrecoverable_Error_Handler:
\r
175 Idly4_Error_Handler:
\r
178 Reserved_HAI_Handler:
\r
179 Reserved_FP_Handler:
\r
180 TLB_Ins_Empty_Handler:
\r
181 TLB_Data_Empty_Handler:
\r
189 .global g_intstackalloc
\r
190 .global g_intstackbase
\r
191 .global g_top_irqstack
\r