[rtems commit] spqreslib - Make global data extern in system.h

Joel Sherrill joel at rtems.org
Wed May 9 21:55:53 UTC 2012


Module:    rtems
Branch:    master
Commit:    c100ba13de481434bb7a019491d7f4c29ada09ab
Changeset: http://git.rtems.org/rtems/commit/?id=c100ba13de481434bb7a019491d7f4c29ada09ab

Author:    Joel Sherrill <joel.sherrill at oarcorp.com>
Date:      Tue May  8 16:39:30 2012 -0500

spqreslib - Make global data extern in system.h

Global data was declared in system.h but should have been extern
in system.h and declared in init.c. There were duplicate symbol
linking errors on at least powerpc/mpc8260ads.

---

 testsuites/sptests/spqreslib/init.c   |    9 +++++++--
 testsuites/sptests/spqreslib/system.h |   11 +++++------
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/testsuites/sptests/spqreslib/init.c b/testsuites/sptests/spqreslib/init.c
index 20745d7..139a56e 100644
--- a/testsuites/sptests/spqreslib/init.c
+++ b/testsuites/sptests/spqreslib/init.c
@@ -21,6 +21,12 @@
 #define CONFIGURE_INIT
 #include "system.h"
 
+rtems_id   Task_id;
+rtems_task_priority Priority;
+time_t  Period;
+time_t  Execution;
+time_t  Phase;
+
 rtems_task Init(
   rtems_task_argument argument
 )
@@ -46,10 +52,9 @@ rtems_task Init(
 
   puts( "\n\n*** TEST QRES LIBRARY ***" );
 
-  Task_name = rtems_build_name( 'P', 'T', '1', ' ' );
 
   status = rtems_task_create(
-    Task_name,
+    rtems_build_name( 'P', 'T', '1', ' ' ),
     Priority,
     RTEMS_MINIMUM_STACK_SIZE * 4,
     RTEMS_DEFAULT_MODES,
diff --git a/testsuites/sptests/spqreslib/system.h b/testsuites/sptests/spqreslib/system.h
index 1f22968..505ec0a 100644
--- a/testsuites/sptests/spqreslib/system.h
+++ b/testsuites/sptests/spqreslib/system.h
@@ -52,11 +52,10 @@ rtems_task Task_Periodic(
 
 /* global variables */
 
-rtems_id   Task_id;
-rtems_name Task_name;
-rtems_task_priority Priority;
-time_t  Period;
-time_t  Execution;
-time_t  Phase;
+extern rtems_id   Task_id;
+extern rtems_task_priority Priority;
+extern time_t  Period;
+extern time_t  Execution;
+extern time_t  Phase;
 
 /* end of include file */




More information about the vc mailing list