Mercurial > flash_v2
diff packages/kernel/current/tests/except1.cxx @ 78:59d97b6ba612 ecos-sw-2000-03-28
Merge from eCos master repository on 2000-03-28-19:50:47-BST
| author | jlarmour |
|---|---|
| date | Tue, 28 Mar 2000 20:13:29 +0000 |
| parents | c5536bad4c24 |
| children | 518f42066aba |
line wrap: on
line diff
--- a/packages/kernel/current/tests/except1.cxx +++ b/packages/kernel/current/tests/except1.cxx @@ -55,8 +55,9 @@ #define NTHREADS 1 #include "testaux.hxx" +static int d0; +#ifdef CYGNUM_HAL_EXCEPTION_DATA_ACCESS static cyg_exception_handler handler0; -static int d0; static void handler0(CYG_ADDRWORD data, cyg_code number, CYG_ADDRWORD info) { @@ -70,6 +71,7 @@ static void handler0(CYG_ADDRWORD data, CYG_TEST_PASS_FINISH("Except 1 OK"); } +#endif static void handler1(CYG_ADDRWORD data, cyg_code number, CYG_ADDRWORD info) { @@ -86,7 +88,7 @@ static void handler1(CYG_ADDRWORD data, CYG_TEST_CHECK((CYG_ADDRWORD)99 == info, "handler given wrong info"); } - +#ifdef CYGNUM_HAL_EXCEPTION_DATA_ACCESS // The following function attempts to cause an exception in various // hacky ways. It is machine dependent what exception is generated. // It does reads rather than writes hoping not to corrupt anything @@ -101,10 +103,13 @@ void cause_exception(void) p+=0x100000; } while(p != 0); } +#endif static void entry0( CYG_ADDRWORD data ) { +#ifdef CYGNUM_HAL_EXCEPTION_DATA_ACCESS cyg_code n; +#endif cyg_exception_handler *old_handler, *old_handler1; CYG_ADDRWORD old_data, old_data1; Cyg_Thread *p=Cyg_Thread::self(); @@ -137,6 +142,8 @@ static void entry0( CYG_ADDRWORD data ) p->deregister_exception(CYGNUM_HAL_EXCEPTION_MAX); p->deregister_exception(CYGNUM_HAL_EXCEPTION_MAX); +#ifdef CYGNUM_HAL_EXCEPTION_DATA_ACCESS + #if 0 #elif defined(CYGPKG_HAL_POWERPC_SIM) // The exception generated by the SIM is not recognized by GDB. @@ -161,6 +168,10 @@ static void entry0( CYG_ADDRWORD data ) cause_exception(); CYG_TEST_FAIL_FINISH("Couldn't cause exception"); +#else // CYGNUM_HAL_EXCEPTION_DATA_ACCESS + CYG_TEST_NA("Platform does not support data exceptions"); +#endif + } #ifdef CYG_HAL_MIPS_TX39_JMR3904
