changeset 790:182dec503417

* tests/signal2.c (cause_illegal_access): PowerPC only generates alignment exceptions in little-endian mode, so make that a special case.
author jlarmour
date Mon, 03 Mar 2003 16:57:54 +0000
parents ce3f213ea1d6
children a2dfa8bf3c57
files packages/compat/posix/current/ChangeLog packages/compat/posix/current/tests/signal2.c
diffstat 2 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/packages/compat/posix/current/ChangeLog
+++ b/packages/compat/posix/current/ChangeLog
@@ -1,5 +1,9 @@
 2003-03-03  Jonathan Larmour  <jifl@eCosCentric.com>
 
+	* tests/signal2.c (cause_illegal_access): PowerPC only generates
+	alignment exceptions in little-endian mode, so make that a special
+	case.
+
 	* tests/mutex3.c: Include POSIX headers before feature tests to
 	prevent spurious CYG_TEST_NA.
 
--- a/packages/compat/posix/current/tests/signal2.c
+++ b/packages/compat/posix/current/tests/signal2.c
@@ -82,7 +82,12 @@ static jmp_buf jbuf;
 
 //--------------------------------------------------------------------------
 
-#ifdef CYGNUM_HAL_EXCEPTION_DATA_UNALIGNED_ACCESS
+// PowerPC is a special case as it has the alignment exception, but it
+// doesn't trigger for this function unless in little-endian mode (although
+// the exception exists for other instructions not used by this function so
+// CYGNUM_HAL_EXCEPTION_DATA_UNALIGNED_ACCESS will still be defined
+
+#if defined(CYGNUM_HAL_EXCEPTION_DATA_UNALIGNED_ACCESS) && !(defined(CYGPKG_HAL_POWERPC) && (CYG_BYTEORDER==CYG_MSBFIRST))
 
 static void
 cause_unaligned_access(void)
@@ -243,7 +248,12 @@ int main(int argc, char **argv)
 #endif
 #endif
 
-#ifdef CYGNUM_HAL_EXCEPTION_DATA_UNALIGNED_ACCESS
+    // PowerPC is a special case as it has the alignment exception, but it
+    // doesn't trigger for this function unless in little-endian mode (although
+    // the exception exists for other instructions not used by this function so
+    // CYGNUM_HAL_EXCEPTION_DATA_UNALIGNED_ACCESS will still be defined
+
+#if defined(CYGNUM_HAL_EXCEPTION_DATA_UNALIGNED_ACCESS) && !(defined(CYGPKG_HAL_POWERPC) && (CYG_BYTEORDER==CYG_MSBFIRST))
     
     CYG_TEST_INFO("Test 1 - provoke unaligned access");