]> git.donarmstrong.com Git - qmk_firmware.git/blob - protocol/lufa/LUFA-120730/LUFA/Platform/UC3/Exception.S
Squashed 'tmk_core/' content from commit 05caacc
[qmk_firmware.git] / protocol / lufa / LUFA-120730 / LUFA / Platform / UC3 / Exception.S
1 /*\r
2              LUFA Library\r
3      Copyright (C) Dean Camera, 2011.\r
4 \r
5   dean [at] fourwalledcubicle [dot] com\r
6            www.lufa-lib.org\r
7 */\r
8 \r
9 /*\r
10   Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
11 \r
12   Permission to use, copy, modify, distribute, and sell this\r
13   software and its documentation for any purpose is hereby granted\r
14   without fee, provided that the above copyright notice appear in\r
15   all copies and that both that the copyright notice and this\r
16   permission notice and warranty disclaimer appear in supporting\r
17   documentation, and that the name of the author not be used in\r
18   advertising or publicity pertaining to distribution of the\r
19   software without specific, written prior permission.\r
20 \r
21   The author disclaim all warranties with regard to this\r
22   software, including all implied warranties of merchantability\r
23   and fitness.  In no event shall the author be liable for any\r
24   special, indirect or consequential damages or any damages\r
25   whatsoever resulting from loss of use, data or profits, whether\r
26   in an action of contract, negligence or other tortious action,\r
27   arising out of or in connection with the use or performance of\r
28   this software.\r
29 */\r
30 \r
31 #if defined(__AVR32__)\r
32 #include <avr32/io.h>\r
33 \r
34 .section .exception_handlers, "ax", @progbits\r
35 \r
36 // ================= EXCEPTION TABLE ================\r
37 .balign  0x200\r
38 .global  EVBA_Table\r
39 EVBA_Table:\r
40 \r
41 .org  0x000\r
42 Exception_Unrecoverable_Exception:\r
43         rjmp $\r
44 .org  0x004\r
45 Exception_TLB_Multiple_Hit:\r
46         rjmp $\r
47 .org  0x008\r
48 Exception_Bus_Error_Data_Fetch:\r
49         rjmp $\r
50 .org  0x00C\r
51 Exception_Bus_Error_Instruction_Fetch:\r
52         rjmp $\r
53 .org  0x010\r
54 Exception_NMI:\r
55         rjmp $\r
56 .org  0x014\r
57 Exception_Instruction_Address:\r
58         rjmp $\r
59 .org  0x018\r
60 Exception_ITLB_Protection:\r
61         rjmp $\r
62 .org  0x01C\r
63 Exception_OCD_Breakpoint:\r
64         rjmp $\r
65 .org  0x020\r
66 Exception_Illegal_Opcode:\r
67         rjmp $\r
68 .org  0x024\r
69 Exception_Unimplemented_Instruction:\r
70         rjmp $\r
71 .org  0x028\r
72 Exception_Privilege_Violation:\r
73         rjmp $\r
74 .org  0x02C\r
75 Exception_Floating_Point:\r
76         rjmp $\r
77 .org  0x030\r
78 Exception_Coprocessor_Absent:\r
79         rjmp $\r
80 .org  0x034\r
81 Exception_Data_Address_Read:\r
82         rjmp $\r
83 .org  0x038\r
84 Exception_Data_Address_Write:\r
85         rjmp $\r
86 .org  0x03C\r
87 Exception_DTLB_Protection_Read:\r
88         rjmp $\r
89 .org  0x040\r
90 Exception_DTLB_Protection_Write:\r
91         rjmp $\r
92 .org  0x044\r
93 Exception_DTLB_Modified:\r
94         rjmp $\r
95 .org  0x050\r
96 Exception_ITLB_Miss:\r
97         rjmp $\r
98 .org  0x060\r
99 Exception_DTLB_Miss_Read:\r
100         rjmp $\r
101 .org  0x070\r
102 Exception_DTLB_Miss_Write:\r
103         rjmp $\r
104 .org  0x100\r
105 Exception_Supervisor_Call:\r
106     rjmp $\r
107 // ============== END OF EXCEPTION TABLE =============\r
108 \r
109 // ============= GENERAL INTERRUPT HANDLER ===========\r
110 .balign 4\r
111 .irp    Level, 0, 1, 2, 3\r
112 Exception_INT\Level:\r
113         mov     r12, \Level\r
114         call    INTC_GetInterruptHandler\r
115         mov     pc, r12\r
116 .endr\r
117 // ========= END OF GENERAL INTERRUPT HANDLER ========\r
118 \r
119 // ====== GENERAL INTERRUPT HANDLER OFFSET TABLE ======\r
120 .balign 4\r
121 .global Autovector_Table\r
122 Autovector_Table:\r
123 .irp    Level, 0, 1, 2, 3\r
124         .word ((AVR32_INTC_INT0 + \Level) << AVR32_INTC_IPR_INTLEVEL_OFFSET) | (Exception_INT\Level - EVBA_Table)\r
125 .endr\r
126 // === END OF GENERAL INTERRUPT HANDLER OFFSET TABLE ===\r
127 \r
128 #endif\r