]> git.sur5r.net Git - freertos/blob - Demo/AVR32_UC3A_GCC/Atmel_SW_Framework/UTILS/LIBS/NEWLIB_ADDONS/INCLUDE/nlao_exceptions.h
Temporarily revert the AVR32 port back to the V6.0.5 files. Work will continue on...
[freertos] / Demo / AVR32_UC3A_GCC / Atmel_SW_Framework / UTILS / LIBS / NEWLIB_ADDONS / INCLUDE / nlao_exceptions.h
1 /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */\r
2
3 /*This file is prepared for Doxygen automatic documentation generation.*/\r
4 /*! \file *********************************************************************\r
5  *\r
6  * \brief NEWLIB_ADDONS exceptions include file for AVR32.\r
7  *\r
8  * - Compiler:           GNU GCC for AVR32\r
9  * - Supported devices:  All AVR32 devices can be used.\r
10  * - AppNote:\r
11  *\r
12  * \author               Atmel Corporation: http://www.atmel.com \n\r
13  *                       Support and FAQ: http://support.atmel.no/\r
14  *\r
15  ******************************************************************************/\r
16 \r
17 /* Copyright (c) 2009 Atmel Corporation. All rights reserved.\r
18  *\r
19  * Redistribution and use in source and binary forms, with or without\r
20  * modification, are permitted provided that the following conditions are met:\r
21  *\r
22  * 1. Redistributions of source code must retain the above copyright notice, this\r
23  * list of conditions and the following disclaimer.\r
24  *\r
25  * 2. Redistributions in binary form must reproduce the above copyright notice,\r
26  * this list of conditions and the following disclaimer in the documentation\r
27  * and/or other materials provided with the distribution.\r
28  *\r
29  * 3. The name of Atmel may not be used to endorse or promote products derived\r
30  * from this software without specific prior written permission.\r
31  *\r
32  * 4. This software may only be redistributed and used in connection with an Atmel\r
33  * AVR product.\r
34  *\r
35  * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED\r
36  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
37  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE\r
38  * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR\r
39  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
40  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
41  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r
42  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
43  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r
44  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\r
45  *\r
46  */\r
47 \r
48 #ifndef __AVR32_NEWLIB_ADDONS_EXCEPTIONS_H__\r
49 #define __AVR32_NEWLIB_ADDONS_EXCEPTIONS_H__\r
50 \r
51 #include <_ansi.h>\r
52 \r
53 _BEGIN_STD_C\r
54 \r
55 /*\r
56  Exception vector offsets\r
57 */\r
58 #define EVBA_UNRECOVERABLE    0x000\r
59 #define EVBA_TLB_MULTIPLE     0x004\r
60 #define EVBA_BUS_ERROR_DATA   0x008\r
61 #define EVBA_BUS_ERROR_INSTR  0x00C\r
62 #define EVBA_NMI              0x010\r
63 #define EVBA_INSTR_ADDR       0x014\r
64 #define EVBA_ITLB_MISS        0x050\r
65 #define EVBA_ITLB_PROT        0x018\r
66 #define EVBA_BREAKPOINT       0x01C\r
67 #define EVBA_ILLEGAL_OPCODE   0x020\r
68 #define EVBA_UNIMPLEMENTED    0x024\r
69 #define EVBA_PRIVILEGE_VIOL   0x028\r
70 #define EVBA_FLOATING_POINT   0x02C\r
71 #define EVBA_COP_ABSENT       0x030\r
72 #define EVBA_SCALL            0x100\r
73 #define EVBA_DATA_ADDR_R      0x034\r
74 #define EVBA_DATA_ADDR_W      0x038\r
75 #define EVBA_DTLB_MISS_R      0x060\r
76 #define EVBA_DTLB_MISS_W      0x070\r
77 #define EVBA_DTLB_PROT_R      0x03C\r
78 #define EVBA_DTLB_PROT_W      0x040\r
79 #define EVBA_DTLB_MODIFIED    0x044\r
80 \r
81 \r
82 /*\r
83    Define the form of the function used when registering exceptions.\r
84    The function should return the address which the exception should\r
85    return to after the exception processing.\r
86 */\r
87 \r
88 typedef unsigned int (*__exception_handler)(int /*evba_offset*/, int /*return address*/);\r
89 \r
90 /*\r
91    Define the form of the function used when registering a scall handler.\r
92 */\r
93 \r
94 typedef void (*__scall_handler)(int /*code*/, int /*p1*/, int /*p2*/\r
95                                          , int /*p3*/, int /*p4*/);\r
96 \r
97 /*\r
98    Function for registering an exception handler for the exception with\r
99    offset given by evba_offset.\r
100 */\r
101 void _register_exception_handler(__exception_handler handler, int evba_offset);\r
102 \r
103 /*\r
104    Function for registering a scall handler which can be a arbirary\r
105    function which uses r8-r12 for parameters.\r
106 */\r
107 void _register_scall_handler(__scall_handler handler);\r
108 \r
109 /*\r
110    Initialize exceptions. Must be called before registering exception handlers\r
111    and needed to enable exceptions. 'evba' is the pointer to the exception\r
112    vector. 'handler_table' is a pointer to an array where the pointers to\r
113    the exception handlers are stored. This array must be at least 0x104 bytes\r
114    and word aligned.\r
115 */\r
116 void init_exceptions(void *evba, void *handler_table);\r
117 \r
118 _END_STD_C\r
119 \r
120 #endif\r