Mercurial > ecos
annotate packages/kernel/current/tests/kexcept1.c @ 2729:74dbf4c3f2e1 after-copyright-change-20090129
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
| author | jlarmour |
|---|---|
| date | Thu, 29 Jan 2009 17:47:46 +0000 |
| parents | d2c90368aeef |
| children | 80f232caf539 |
| rev | line source |
|---|---|
| 0 | 1 /*================================================================= |
| 2 // | |
| 3 // kexcept1.cxx | |
| 4 // | |
| 5 // Kernel C API Exception test 1 | |
| 6 // | |
| 7 //================================================================= | |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
8 // ####ECOSGPLCOPYRIGHTBEGIN#### |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
9 // ------------------------------------------- |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
10 // This file is part of eCos, the Embedded Configurable Operating System. |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
11 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. |
|
208
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
202
diff
changeset
|
12 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
13 // eCos is free software; you can redistribute it and/or modify it under |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
14 // the terms of the GNU General Public License as published by the Free |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
15 // Software Foundation; either version 2 or (at your option) any later |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
16 // version. |
|
208
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
202
diff
changeset
|
17 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
18 // eCos is distributed in the hope that it will be useful, but WITHOUT |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
19 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
20 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
21 // for more details. |
|
208
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
202
diff
changeset
|
22 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
23 // You should have received a copy of the GNU General Public License |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
24 // along with eCos; if not, write to the Free Software Foundation, Inc., |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
25 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
208
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
202
diff
changeset
|
26 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
27 // As a special exception, if other files instantiate templates or use |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
28 // macros or inline functions from this file, or you compile this file |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
29 // and link it with other works to produce a work based on this file, |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
30 // this file does not by itself cause the resulting work to be covered by |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
31 // the GNU General Public License. However the source code for this file |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
32 // must still be made available in accordance with section (3) of the GNU |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
33 // General Public License v2. |
|
208
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
202
diff
changeset
|
34 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
35 // This exception does not invalidate any other reasons why a work based |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
36 // on this file might be covered by the GNU General Public License. |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
37 // ------------------------------------------- |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
210
diff
changeset
|
38 // ####ECOSGPLCOPYRIGHTEND#### |
| 0 | 39 //================================================================= |
| 40 //#####DESCRIPTIONBEGIN#### | |
| 41 // | |
| 42 // Author(s): dsm | |
| 2 | 43 // Contributors: dsm, jlarmour |
| 44 // Date: 1999-02-16 | |
| 0 | 45 // Description: Test basic exception functionality |
| 46 //####DESCRIPTIONEND#### | |
| 47 */ | |
| 48 | |
| 2 | 49 #include <cyg/hal/hal_arch.h> // CYGNUM_HAL_STACK_SIZE_TYPICAL |
| 50 | |
| 0 | 51 #include <cyg/kernel/kapi.h> |
| 52 | |
| 53 #include <cyg/infra/testcase.h> | |
| 54 | |
| 55 #ifdef CYGPKG_KERNEL_EXCEPTIONS | |
| 56 | |
| 57 #ifdef CYGFUN_KERNEL_API_C | |
| 58 | |
| 59 #include <cyg/hal/hal_intr.h> // exception ranges | |
| 60 | |
| 61 #include "testaux.h" | |
| 62 | |
|
202
353a011b23b8
Merge from eCos master repository on 2002-01-11-06:43:03-GMT
jlarmour
parents:
161
diff
changeset
|
63 #ifndef CYGPKG_HAL_ARM_PID |
|
353a011b23b8
Merge from eCos master repository on 2002-01-11-06:43:03-GMT
jlarmour
parents:
161
diff
changeset
|
64 #define EXCEPTION_DATA_ACCESS |
|
353a011b23b8
Merge from eCos master repository on 2002-01-11-06:43:03-GMT
jlarmour
parents:
161
diff
changeset
|
65 #endif |
|
353a011b23b8
Merge from eCos master repository on 2002-01-11-06:43:03-GMT
jlarmour
parents:
161
diff
changeset
|
66 |
| 0 | 67 #define NTHREADS 1 |
| 2 | 68 #define STACKSIZE CYGNUM_HAL_STACK_SIZE_TYPICAL |
| 0 | 69 |
| 70 static cyg_handle_t thread[NTHREADS]; | |
| 71 | |
| 72 static cyg_thread thread_obj[NTHREADS]; | |
| 73 static char stack[NTHREADS][STACKSIZE]; | |
| 74 | |
| 75 | |
|
208
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
202
diff
changeset
|
76 |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
202
diff
changeset
|
77 #ifdef EXCEPTION_DATA_ACCESS |
| 0 | 78 static cyg_exception_handler_t handler0; |
| 79 | |
| 80 static void handler0(cyg_addrword_t data, cyg_code_t number, cyg_addrword_t info) | |
| 81 { | |
| 82 CYG_TEST_INFO("handler 0 called"); | |
| 83 | |
| 84 CYG_TEST_CHECK((cyg_addrword_t)123 == data, "handler given wrong data"); | |
| 85 | |
| 86 // ignore machine specific stuff | |
| 87 CYG_UNUSED_PARAM(cyg_code_t, number); | |
| 88 CYG_UNUSED_PARAM(cyg_addrword_t, info); | |
| 89 | |
| 90 CYG_TEST_PASS_FINISH("Except 1 OK"); | |
| 91 } | |
|
208
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
202
diff
changeset
|
92 #endif |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
202
diff
changeset
|
93 |
|
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
202
diff
changeset
|
94 static int d0; |
| 0 | 95 |
| 96 static void handler1(cyg_addrword_t data, cyg_code_t number, cyg_addrword_t info) | |
| 97 { | |
| 98 CYG_TEST_INFO("handler 1 called"); | |
| 99 | |
| 100 CYG_TEST_CHECK((cyg_addrword_t)&d0 == data, "handler given wrong data"); | |
| 101 | |
| 102 #ifdef CYGSEM_KERNEL_EXCEPTIONS_DECODE | |
| 2 | 103 CYG_TEST_CHECK(number == CYGNUM_HAL_EXCEPTION_MAX, "handler given wrong number"); |
| 0 | 104 #else |
| 105 CYG_UNUSED_PARAM(cyg_code_t, number); | |
| 106 #endif | |
| 107 | |
| 108 CYG_TEST_CHECK((cyg_addrword_t)99 == info, "handler given wrong info"); | |
| 109 } | |
| 110 | |
| 111 | |
|
202
353a011b23b8
Merge from eCos master repository on 2002-01-11-06:43:03-GMT
jlarmour
parents:
161
diff
changeset
|
112 #ifdef EXCEPTION_DATA_ACCESS |
| 0 | 113 // The following function attempts to cause an exception in various |
| 114 // hacky ways. It is machine dependent what exception is generated. | |
| 115 // It does reads rather than writes hoping not to corrupt anything | |
| 116 // important. | |
|
126
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
117 static int |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
118 cause_fpe(int num) |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
119 { |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
120 double a; |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
121 |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
122 a = 1.0/num; // Depending on FPU emulation and/or |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
123 // the FPU architecture, this may |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
124 // cause an exception. |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
125 // (float division by zero) |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
126 |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
127 return ((int)a)/num; // This may cause an exception if |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
128 // the architecture supports it. |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
129 // (integer division by zero). |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
130 } // cause_fpe() |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
131 |
| 0 | 132 void cause_exception(void) |
| 133 { | |
| 134 int x; | |
| 135 unsigned int p=0; | |
| 136 | |
|
126
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
137 // First try for an address exception (unaligned access exception |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
138 // or SEGV/BUS exceptions) |
| 0 | 139 do { |
|
126
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
140 x=*(volatile int *)(p-1); |
| 0 | 141 p+=0x100000; |
| 142 } while(p != 0); | |
|
126
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
143 |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
144 // Next try an integer or floating point divide-by-zero exception. |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
145 cause_fpe(0); |
| 0 | 146 } |
|
78
59d97b6ba612
Merge from eCos master repository on 2000-03-28-19:50:47-BST
jlarmour
parents:
70
diff
changeset
|
147 #endif |
| 0 | 148 |
| 149 static void entry0( CYG_ADDRWORD data ) | |
| 150 { | |
|
202
353a011b23b8
Merge from eCos master repository on 2002-01-11-06:43:03-GMT
jlarmour
parents:
161
diff
changeset
|
151 #ifdef EXCEPTION_DATA_ACCESS |
| 0 | 152 cyg_code_t n; |
|
78
59d97b6ba612
Merge from eCos master repository on 2000-03-28-19:50:47-BST
jlarmour
parents:
70
diff
changeset
|
153 #endif |
| 0 | 154 cyg_exception_handler_t *old_handler, *old_handler1; |
| 155 cyg_addrword_t old_data, old_data1; | |
| 156 | |
| 157 CYG_UNUSED_PARAM(CYG_ADDRESS, data); | |
| 158 | |
| 159 cyg_exception_set_handler( | |
| 2 | 160 CYGNUM_HAL_EXCEPTION_MAX, |
| 0 | 161 &handler1, |
| 162 (cyg_addrword_t)&d0, | |
| 163 &old_handler, | |
| 164 &old_data); | |
| 165 | |
| 166 cyg_exception_set_handler( | |
| 2 | 167 CYGNUM_HAL_EXCEPTION_MAX, |
| 0 | 168 &handler1, |
| 169 (cyg_addrword_t)&d0, | |
| 170 &old_handler1, | |
| 171 &old_data1); | |
| 172 | |
| 173 CYG_TEST_CHECK(old_handler1 == &handler1, | |
| 174 "register exception: old_handler not the one previously registered"); | |
| 175 CYG_TEST_CHECK(old_data1 == (cyg_addrword_t)&d0, | |
| 176 "register exception: old_data not those previously registered"); | |
| 177 | |
| 178 cyg_exception_call_handler( | |
| 179 cyg_thread_self(), | |
| 2 | 180 CYGNUM_HAL_EXCEPTION_MAX, |
| 0 | 181 (cyg_addrword_t)99); |
| 182 | |
| 183 CYG_TEST_INFO("handler 1 returned"); | |
| 184 | |
| 2 | 185 cyg_exception_clear_handler(CYGNUM_HAL_EXCEPTION_MAX); |
| 186 cyg_exception_clear_handler(CYGNUM_HAL_EXCEPTION_MAX); | |
| 0 | 187 |
|
202
353a011b23b8
Merge from eCos master repository on 2002-01-11-06:43:03-GMT
jlarmour
parents:
161
diff
changeset
|
188 #ifdef EXCEPTION_DATA_ACCESS |
|
78
59d97b6ba612
Merge from eCos master repository on 2000-03-28-19:50:47-BST
jlarmour
parents:
70
diff
changeset
|
189 |
|
4
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
190 #if 0 |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
191 #elif defined(CYGPKG_HAL_POWERPC_SIM) |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
192 // The exception generated by the SIM is not recognized by GDB. |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
193 // PR 19945 workaround. |
|
1d7f19c9e4d1
Merge from eCos master repository on 1999-05-11-21:11:10-BST
jlarmour
parents:
2
diff
changeset
|
194 CYG_TEST_NA("Not applicable to PowerPC SIM"); |
| 2 | 195 #endif |
| 196 | |
| 197 for(n = CYGNUM_HAL_EXCEPTION_MIN; n <= CYGNUM_HAL_EXCEPTION_MAX; n++) { | |
| 0 | 198 cyg_exception_set_handler( |
| 199 n, | |
| 200 handler0, | |
| 201 (cyg_addrword_t)123, | |
| 202 &old_handler1, | |
| 203 &old_data1); | |
| 204 } | |
| 205 | |
| 2 | 206 CYG_TEST_PASS("Attempting to provoke exception"); |
| 0 | 207 |
| 208 cause_exception(); | |
| 209 | |
| 210 CYG_TEST_FAIL_FINISH("Couldn't cause exception"); | |
|
202
353a011b23b8
Merge from eCos master repository on 2002-01-11-06:43:03-GMT
jlarmour
parents:
161
diff
changeset
|
211 #else // EXCEPTION_DATA_ACCESS |
|
78
59d97b6ba612
Merge from eCos master repository on 2000-03-28-19:50:47-BST
jlarmour
parents:
70
diff
changeset
|
212 CYG_TEST_NA("Platform does not support data exceptions"); |
|
59d97b6ba612
Merge from eCos master repository on 2000-03-28-19:50:47-BST
jlarmour
parents:
70
diff
changeset
|
213 #endif |
| 0 | 214 } |
| 215 | |
|
10
d3fbcdfa1b2f
Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents:
4
diff
changeset
|
216 #ifdef CYG_HAL_MIPS_TX39_JMR3904 |
| 0 | 217 |
| 218 extern void __default_exception_vsr(void); | |
| 219 | |
| 220 #endif | |
| 221 | |
| 222 void except0_main( void ) | |
| 223 { | |
| 2 | 224 // Use CYG_TEST_GDBCMD _before_ CYG_TEST_INIT() |
| 225 CYG_TEST_GDBCMD("handle SIGBUS nostop"); | |
| 226 CYG_TEST_GDBCMD("handle SIGSEGV nostop"); | |
|
126
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
227 CYG_TEST_GDBCMD("handle SIGFPE nostop"); |
| 2 | 228 |
| 0 | 229 CYG_TEST_INIT(); |
| 230 | |
| 2 | 231 #ifdef HAL_VSR_SET_TO_ECOS_HANDLER |
| 232 // Reclaim the VSR off CygMon possibly | |
| 233 #ifdef CYGNUM_HAL_EXCEPTION_DATA_ACCESS | |
| 234 HAL_VSR_SET_TO_ECOS_HANDLER( CYGNUM_HAL_EXCEPTION_DATA_ACCESS, NULL ); | |
| 235 #endif | |
|
70
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
66
diff
changeset
|
236 #ifdef CYGNUM_HAL_EXCEPTION_DATA_TLBMISS_ACCESS |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
66
diff
changeset
|
237 HAL_VSR_SET_TO_ECOS_HANDLER( CYGNUM_HAL_EXCEPTION_DATA_TLBMISS_ACCESS, NULL ); |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
66
diff
changeset
|
238 #endif |
| 2 | 239 #ifdef CYGNUM_HAL_EXCEPTION_DATA_UNALIGNED_ACCESS |
| 240 HAL_VSR_SET_TO_ECOS_HANDLER( CYGNUM_HAL_EXCEPTION_DATA_UNALIGNED_ACCESS, NULL ); | |
| 241 #endif | |
| 242 #ifdef CYGNUM_HAL_EXCEPTION_ILLEGAL_INSTRUCTION | |
| 243 HAL_VSR_SET_TO_ECOS_HANDLER( CYGNUM_HAL_EXCEPTION_ILLEGAL_INSTRUCTION, NULL ); | |
| 244 #endif | |
|
126
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
245 #ifdef CYGNUM_HAL_EXCEPTION_DIV_BY_ZERO |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
246 HAL_VSR_SET_TO_ECOS_HANDLER( CYGNUM_HAL_EXCEPTION_DIV_BY_ZERO, NULL ); |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
247 #endif |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
248 #ifdef CYGNUM_HAL_EXCEPTION_FPU |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
249 HAL_VSR_SET_TO_ECOS_HANDLER( CYGNUM_HAL_EXCEPTION_FPU, NULL ); |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
250 #endif |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
251 #ifdef CYGNUM_HAL_EXCEPTION_FPU_DIV_BY_ZERO |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
252 HAL_VSR_SET_TO_ECOS_HANDLER( CYGNUM_HAL_EXCEPTION_FPU_DIV_BY_ZERO, NULL ); |
|
518f42066aba
Merge from eCos master repository on 2000-09-19-06:25:26-BST
jlarmour
parents:
78
diff
changeset
|
253 #endif |
| 2 | 254 #endif |
| 0 | 255 |
| 256 cyg_thread_create(4, entry0 , (cyg_addrword_t)0, "kexcept1", | |
| 2 | 257 (void *)stack[0], STACKSIZE, &thread[0], &thread_obj[0]); |
| 0 | 258 cyg_thread_resume(thread[0]); |
| 259 | |
| 260 cyg_scheduler_start(); | |
| 261 | |
| 262 CYG_TEST_FAIL_FINISH("Not reached"); | |
| 263 } | |
| 264 | |
| 265 externC void | |
| 266 cyg_start( void ) | |
| 267 { | |
| 268 except0_main(); | |
| 269 } | |
| 270 | |
| 271 #else // def CYGFUN_KERNEL_API_C | |
| 272 #define N_A_MSG "Kernel C API layer disabled" | |
| 273 #endif // def CYGFUN_KERNEL_API_C | |
| 274 #else // def CYGPKG_KERNEL_EXCEPTIONS | |
| 275 #define N_A_MSG "Exceptions disabled" | |
| 276 #endif // def CYGPKG_KERNEL_EXCEPTIONS | |
| 277 | |
| 278 #ifdef N_A_MSG | |
| 279 externC void | |
| 280 cyg_start( void ) | |
| 281 { | |
| 282 CYG_TEST_INIT(); | |
| 2 | 283 CYG_TEST_NA( N_A_MSG); |
| 0 | 284 } |
| 285 #endif // N_A_MSG | |
| 286 | |
| 287 /* EOF kexcept1.c */ |
