This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[APPROVE?] One kernel and two POSIX test fixes


Since I'm getting bogged down in some network stack problems on the viper board, here are some fixes I've got. Checked into trunk, approval required for v2 please.

Jifl
--
eCosCentric    http://www.eCosCentric.com/    The eCos and RedBoot experts
--[ "You can complain because roses have thorns, or you ]--
--[  can rejoice because thorns have roses." -Lincoln   ]-- Opinions==mine
Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/compat/posix/current/ChangeLog,v
retrieving revision 1.38
diff -u -5 -p -r1.38 ChangeLog
--- ChangeLog	24 Feb 2003 14:08:21 -0000	1.38
+++ ChangeLog	3 Mar 2003 04:40:13 -0000
@@ -1,5 +1,14 @@
+2003-03-03  Jonathan Larmour  <jifl at eCosCentric dot 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.
+
 2003-02-24  Jonathan Larmour  <jifl at eCosCentric dot com>
 
 	* doc/posix.sgml: Expunge EL/IX. Dead standard.
 	* cdl/posix.cdl: Add doc link.
 
Index: tests/mutex3.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/compat/posix/current/tests/mutex3.c,v
retrieving revision 1.5
diff -u -5 -p -r1.5 mutex3.c
--- tests/mutex3.c	23 May 2002 23:00:01 -0000	1.5
+++ tests/mutex3.c	3 Mar 2003 04:40:14 -0000
@@ -54,10 +54,17 @@
 #include <pkgconf/system.h>
 #ifdef CYGPKG_KERNEL
 #include <pkgconf/kernel.h>
 #endif
 
+#ifdef CYGPKG_ISOINFRA
+# include <sys/types.h>
+# include <pthread.h>
+# include <semaphore.h>
+# include <time.h>
+#endif
+
 #if !defined(CYGPKG_POSIX_PTHREAD)
 #define NA_MSG "POSIX threads not enabled"
 
 // ------------------------------------------------------------------------
 //
@@ -83,15 +90,10 @@ cyg_start(void)
 {
     CYG_TEST_INIT();
     CYG_TEST_NA(NA_MSG);
 }
 #else
-
-#include <sys/types.h>
-#include <pthread.h>
-#include <semaphore.h>
-#include <time.h>
 
 #include <cyg/infra/cyg_ass.h>
 #include <cyg/infra/cyg_trac.h>
 #include <cyg/infra/diag.h>             // diag_printf
 
Index: tests/signal2.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/compat/posix/current/tests/signal2.c,v
retrieving revision 1.7
diff -u -5 -p -r1.7 signal2.c
--- tests/signal2.c	23 May 2002 23:00:02 -0000	1.7
+++ tests/signal2.c	3 Mar 2003 04:40:14 -0000
@@ -80,11 +80,13 @@ cyg_start(void)
 
 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 unless in little-endian mode.
+#if defined(CYGNUM_HAL_EXCEPTION_DATA_UNALIGNED_ACCESS) && !(defined(CYGPKG_HAL_POWERPC) && (CYG_BYTEORDER==CYG_MSBFIRST))
 
 static void
 cause_unaligned_access(void)
 {
     volatile int x;
@@ -241,11 +243,13 @@ int main(int argc, char **argv)
 #ifdef CYGNUM_HAL_EXCEPTION_FPU_DIV_BY_ZERO
     HAL_VSR_SET_TO_ECOS_HANDLER( CYGNUM_HAL_EXCEPTION_FPU_DIV_BY_ZERO, NULL );
 #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 unless in little-endian mode.
+#if defined(CYGNUM_HAL_EXCEPTION_DATA_UNALIGNED_ACCESS) && !(defined(CYGPKG_HAL_POWERPC) && (CYG_BYTEORDER==CYG_MSBFIRST))
     
     CYG_TEST_INFO("Test 1 - provoke unaligned access");
     
     if( setjmp( jbuf ) == 0 )
     {
Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/kernel/current/ChangeLog,v
retrieving revision 1.98
diff -u -5 -p -r1.98 ChangeLog
--- ChangeLog	27 Feb 2003 06:14:31 -0000	1.98
+++ ChangeLog	3 Mar 2003 04:18:50 -0000
@@ -1,5 +1,10 @@
+2003-03-03  Jonathan Larmour  <jifl at eCosCentric dot com>
+
+	* tests/fptest.c: Make all variables static to avoid any risk
+	of collisions with symbols defined elsewhere in eCos.
+
 2003-02-27  Jonathan Larmour  <jifl at eCosCentric dot com>
 
 	* include/kapidata.h: Revert change of 2001-08-23 and instead make
 	it conditional on the GCC version. Also add comments explaining why
 	this file has been apparently obfuscated.
Index: tests/fptest.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/kernel/current/tests/fptest.c,v
retrieving revision 1.3
diff -u -5 -p -r1.3 fptest.c
--- tests/fptest.c	25 Feb 2003 18:42:00 -0000	1.3
+++ tests/fptest.c	3 Mar 2003 04:18:50 -0000
@@ -87,23 +87,23 @@
 //==========================================================================
 // Thread parameters
 
 #define STACK_SIZE (CYGNUM_HAL_STACK_SIZE_MINIMUM)
 
-cyg_uint8 stacks[3][STACK_SIZE];
-cyg_handle_t thread[3];
-cyg_thread thread_struct[3];
+static cyg_uint8 stacks[3][STACK_SIZE];
+static cyg_handle_t thread[3];
+static cyg_thread thread_struct[3];
 
 //==========================================================================
 // Alarm parameters.
 
-cyg_alarm alarm_struct;
-cyg_handle_t alarm;
+static cyg_alarm alarm_struct;
+static cyg_handle_t alarm;
 
-cyg_count8 cur_thread = 0;
-cyg_count32 alarm_ticks = 0;
-cyg_count32 run_ticks = RUN_TICKS;
+static cyg_count8 cur_thread = 0;
+static cyg_count32 alarm_ticks = 0;
+static cyg_count32 run_ticks = RUN_TICKS;
 
 //==========================================================================
 
 static int errors = 0;
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]