<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2011-06-28)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
<font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>
Jennifer Averett <jennifer.averett@OARcorp.com>
PR 1801/bsps
* Makefile.am, include/leon.h: Add SMP support to LEON3 BSP.
* smp/getcpuid.c, smp/smp_leon3.c: New files.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/sparc/leon3/ChangeLog.diff?r1=text&tr1=1.106&r2=text&tr2=1.107&diff_format=h">M</a></td><td width='1%'>1.107</td><td width='100%'>c/src/lib/libbsp/sparc/leon3/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/sparc/leon3/Makefile.am.diff?r1=text&tr1=1.34&r2=text&tr2=1.35&diff_format=h">M</a></td><td width='1%'>1.35</td><td width='100%'>c/src/lib/libbsp/sparc/leon3/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/sparc/leon3/include/leon.h.diff?r1=text&tr1=1.9&r2=text&tr2=1.10&diff_format=h">M</a></td><td width='1%'>1.10</td><td width='100%'>c/src/lib/libbsp/sparc/leon3/include/leon.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/sparc/leon3/smp/getcpuid.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">c/src/lib/libbsp/sparc/leon3/smp/getcpuid.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/sparc/leon3/smp/smp_leon3.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">c/src/lib/libbsp/sparc/leon3/smp/smp_leon3.c</font></td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/c/src/lib/libbsp/sparc/leon3/ChangeLog:1.106 rtems/c/src/lib/libbsp/sparc/leon3/ChangeLog:1.107
--- rtems/c/src/lib/libbsp/sparc/leon3/ChangeLog:1.106 Sun Jun 19 01:49:20 2011
+++ rtems/c/src/lib/libbsp/sparc/leon3/ChangeLog Tue Jun 28 15:29:10 2011
</font><font color='#997700'>@@ -1,3 +1,10 @@
</font><font color='#000088'>+2011-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>
+ Jennifer Averett <jennifer.averett@OARcorp.com>
+
+ PR 1801/bsps
+ * Makefile.am, include/leon.h: Add SMP support to LEON3 BSP.
+ * smp/getcpuid.c, smp/smp_leon3.c: New files.
+
</font> 2011-06-19 Ralf Corsépius <ralf.corsepius@rtems.org>
* Makefile.am: Fix broken path to clockdrv_shell.h.
<font color='#006600'>diff -u rtems/c/src/lib/libbsp/sparc/leon3/Makefile.am:1.34 rtems/c/src/lib/libbsp/sparc/leon3/Makefile.am:1.35
--- rtems/c/src/lib/libbsp/sparc/leon3/Makefile.am:1.34 Sun Jun 19 01:49:20 2011
+++ rtems/c/src/lib/libbsp/sparc/leon3/Makefile.am Tue Jun 28 15:29:10 2011
</font><font color='#997700'>@@ -91,8 +91,8 @@
</font> libbsp_a_SOURCES += timer/timer.c
if HAS_SMP
<font color='#880000'>-libbsp_a_SOURCES += ../../shared/smp/getcpuid.c ../../shared/smp/smp_stub.c \
- ../../shared/smp/bspsmp_wait_for.c
</font><font color='#000088'>+libbsp_a_SOURCES += smp/getcpuid.c
+libbsp_a_SOURCES += smp/smp_leon3.c
</font> endif
if HAS_NETWORKING
<font color='#006600'>diff -u rtems/c/src/lib/libbsp/sparc/leon3/include/leon.h:1.9 rtems/c/src/lib/libbsp/sparc/leon3/include/leon.h:1.10
--- rtems/c/src/lib/libbsp/sparc/leon3/include/leon.h:1.9 Fri Mar 4 08:06:54 2011
+++ rtems/c/src/lib/libbsp/sparc/leon3/include/leon.h Tue Jun 28 15:29:10 2011
</font><font color='#997700'>@@ -222,6 +222,10 @@
</font>
#define LEON3_MP_IRQ 14 /* Irq used by shared memory driver */
<font color='#000088'>+#define LEON3_IRQMPSTATUS_CPUNR 28
+#define LEON3_IRQMPSTATUS_BROADCAST 27
+
+
</font> #ifndef ASM
/*
<font color='#006600'>diff -u /dev/null rtems/c/src/lib/libbsp/sparc/leon3/smp/getcpuid.c:1.1
--- /dev/null Tue Jun 28 16:11:19 2011
+++ rtems/c/src/lib/libbsp/sparc/leon3/smp/getcpuid.c Tue Jun 28 15:29:10 2011
</font><font color='#997700'>@@ -0,0 +1,18 @@
</font><font color='#000088'>+/*
+ * Extracted from smp-imps.c
+ *
+ * <Insert copyright here : it must be BSD-like so anyone can use it>
+ *
+ * Author: Erich Boleyn <erich@uruk.org> http://www.uruk.org/~erich/
+ *
+ * $Id$
+ */
+
+int bsp_smp_processor_id(void)
+{
+ unsigned int id;
+ __asm__ __volatile__( "rd %%asr17,%0\n\t" : "=r" (id) : );
+
+ return ((id >> 28) & 0xff);
+}
+
</font>
<font color='#006600'>diff -u /dev/null rtems/c/src/lib/libbsp/sparc/leon3/smp/smp_leon3.c:1.1
--- /dev/null Tue Jun 28 16:11:20 2011
+++ rtems/c/src/lib/libbsp/sparc/leon3/smp/smp_leon3.c Tue Jun 28 15:29:10 2011
</font><font color='#997700'>@@ -0,0 +1,180 @@
</font><font color='#000088'>+/**
+ * @file
+ *
+ * LEON3 SMP BSP Support
+ */
+
+/*
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include <bsp.h>
+#include <rtems/bspIo.h>
+#include <rtems/bspsmp.h>
+#include <stdlib.h>
+
+#define RTEMS_DEBUG
+
+static inline void sparc_leon3_set_cctrl( unsigned int val )
+{
+ __asm__ volatile( "sta %0, [%%g0] 2" : : "r" (val) );
+}
+
+static inline unsigned int sparc_leon3_get_cctrl( void )
+{
+ unsigned int v = 0;
+ __asm__ volatile( "lda [%%g0] 2, %0" : "=r" (v) : "0" (v) );
+ return v;
+}
+
+rtems_isr bsp_ap_ipi_isr(
+ rtems_vector_number vector
+)
+{
+ LEON_Clear_interrupt(LEON3_MP_IRQ);
+ rtems_smp_process_interrupt();
+}
+
+void bsp_smp_secondary_cpu_initialize(int cpu)
+{
+ sparc_leon3_set_cctrl( 0x80000F );
+ LEON_Unmask_interrupt(LEON3_MP_IRQ);
+ LEON3_IrqCtrl_Regs->mask[cpu] |= 1 << LEON3_MP_IRQ;
+}
+
+/*
+ * Used to pass information to start.S when bringing secondary CPUs
+ * out of reset.
+ */
+void *bsp_ap_stack;
+void *bsp_ap_entry;
+
+static void bsp_smp_delay( int );
+
+int bsp_smp_initialize(
+ int maximum
+)
+{
+ int cpu;
+ int found_cpus = 0;
+
+ sparc_leon3_set_cctrl( 0x80000F );
+ found_cpus =
+ ((LEON3_IrqCtrl_Regs->mpstat >> LEON3_IRQMPSTATUS_CPUNR) & 0xf) + 1;
+ #if defined(RTEMS_DEBUG)
+ printk( "Found %d CPUs\n", found_cpus );
+ #endif
+
+ if ( found_cpus > rtems_configuration_smp_maximum_processors ) {
+ printk(
+ "%d CPUs IS MORE THAN CONFIGURED -- ONLY USING %d\n",
+ found_cpus,
+ rtems_configuration_smp_maximum_processors
+ );
+ found_cpus = rtems_configuration_smp_maximum_processors;
+ }
+
+ if ( found_cpus == 1 )
+ return 1;
+
+ for ( cpu=1 ; cpu < found_cpus ; cpu++ ) {
+<span style="background-color: #FF0000"> </span>
+ #if defined(RTEMS_DEBUG)
+ printk( "Waking CPU %d\n", cpu );
+ #endif
+
+ bsp_ap_stack = _Per_CPU_Information[cpu].interrupt_stack_high -
+ CPU_MINIMUM_STACK_FRAME_SIZE;
+ bsp_ap_entry = rtems_smp_secondary_cpu_initialize;
+
+ LEON3_IrqCtrl_Regs->mpstat = 1 << cpu;
+ bsp_smp_delay( 1000000 );
+ #if defined(RTEMS_DEBUG)
+ printk(
+ "CPU %d is %s\n",
+ cpu,
+ ((_Per_CPU_Information[cpu].state == RTEMS_BSP_SMP_CPU_INITIALIZED) ?
+ "online" : "offline")
+ );
+ #endif
+ }
+
+ if ( found_cpus > 1 ) {
+ LEON_Unmask_interrupt(LEON3_MP_IRQ);
+ set_vector(bsp_ap_ipi_isr, LEON_TRAP_TYPE(LEON3_MP_IRQ), 1);
+ }
+ return found_cpus;
+}
+
+void bsp_smp_interrupt_cpu(
+ int cpu
+)
+{
+ /* send interrupt to destination CPU */
+ LEON3_IrqCtrl_Regs->force[cpu] = 1 << LEON3_MP_IRQ;
+}
+
+void bsp_smp_broadcast_interrupt(void)
+{
+ int dest_cpu;
+ int cpu;
+ int max_cpus;
+
+ cpu = bsp_smp_processor_id();
+ max_cpus = rtems_smp_get_number_of_processors();
+
+ for ( dest_cpu=0 ; dest_cpu < max_cpus ; dest_cpu++ ) {
+ if ( cpu == dest_cpu )
+ continue;
+ bsp_smp_interrupt_cpu( dest_cpu );
+ /* this is likely needed due to the ISR code not being SMP aware yet */
+ bsp_smp_delay( 100000 );
+ }
+}
+
+extern __inline__ void __delay(unsigned long loops)
+{
+ __asm__ __volatile__("cmp %0, 0\n\t"
+ "1: bne 1b\n\t"
+ "subcc %0, 1, %0\n" :
+ "=&r" (loops) :
+ "0" (loops) :
+ "cc"
+ );
+}
+
+/*
+ * Kill time without depending on the timer being present or programmed.
+ *
+ * This is not very sophisticated.
+ */
+void bsp_smp_delay( int max )
+{
+ __delay( max );
+}
+
+void bsp_smp_wait_for(
+ volatile unsigned int *address,
+ unsigned int desired,
+ int maximum_usecs
+)
+{
+ int iterations;
+ volatile unsigned int *p = address;
+
+ for (iterations=0 ; iterations < maximum_usecs ; iterations++ ) {
+ if ( *p == desired )
+ break;
+ bsp_smp_delay( 5000 );
+ }
+}
+
+
</font></pre>
<p> </p>
<a name='cs2'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
<font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>
Jennifer Averett <jennifer.averett@OARcorp.com>
PR 1801/bsps
* shared/start.S: Add SMP support to LEON3 BSP.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/sparc/ChangeLog.diff?r1=text&tr1=1.86&r2=text&tr2=1.87&diff_format=h">M</a></td><td width='1%'>1.87</td><td width='100%'>c/src/lib/libbsp/sparc/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/sparc/shared/start.S.diff?r1=text&tr1=1.16&r2=text&tr2=1.17&diff_format=h">M</a></td><td width='1%'>1.17</td><td width='100%'>c/src/lib/libbsp/sparc/shared/start.S</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/c/src/lib/libbsp/sparc/ChangeLog:1.86 rtems/c/src/lib/libbsp/sparc/ChangeLog:1.87
--- rtems/c/src/lib/libbsp/sparc/ChangeLog:1.86 Sun Jun 19 01:02:06 2011
+++ rtems/c/src/lib/libbsp/sparc/ChangeLog Tue Jun 28 15:29:33 2011
</font><font color='#997700'>@@ -1,3 +1,9 @@
</font><font color='#000088'>+2011-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>
+ Jennifer Averett <jennifer.averett@OARcorp.com>
+
+ PR 1801/bsps
+ * shared/start.S: Add SMP support to LEON3 BSP.
+
</font> 2011-06-19 Ralf Corsépius <ralf.corsepius@rtems.org>
* Makefile.am: Remove references to non-existing files.
<font color='#006600'>diff -u rtems/c/src/lib/libbsp/sparc/shared/start.S:1.16 rtems/c/src/lib/libbsp/sparc/shared/start.S:1.17
--- rtems/c/src/lib/libbsp/sparc/shared/start.S:1.16 Sun Nov 29 09:33:27 2009
+++ rtems/c/src/lib/libbsp/sparc/shared/start.S Tue Jun 28 15:29:33 2011
</font><font color='#997700'>@@ -1,13 +1,15 @@
</font><font color='#880000'>-/*
- * start.s
</font><font color='#000088'>+/**
+ * @file
</font> *
* Common start code for SPARC.
*
* This is based on the file srt0.s provided with the binary
* distribution of the SPARC Instruction Simulator (SIS) found
* at ftp://ftp.estec.esa.nl/pub/ws/wsd/erc32.
<font color='#880000'>- *
- * COPYRIGHT (c) 1989-2006.
</font><font color='#000088'>+ */
+
+/*
+ * COPYRIGHT (c) 1989-2011.
</font> * On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
<font color='#997700'>@@ -18,18 +20,31 @@
</font> */
#include <rtems/asm.h>
<font color='#000088'>+#include <rtems/system.h>
</font> #include <bspopts.h>
<font color='#000088'>+#if defined(RTEMS_SMP) && defined(BSP_LEON3_SMP)
+ #define ENABLE_SMP
+#endif
+
</font> /*
* Unexpected trap will halt the processor by forcing it to error state
*/
<font color='#880000'>-
</font> #define BAD_TRAP \
ta 0; \
nop; \
nop; \
nop;
<font color='#000088'>+#if defined(ENABLE_SMP)
+/*
+ * Variables to contain information used with bring a secondary core
+ * out of reset.
+ */
+<span style="background-color: #FF0000"> </span> .global bsp_ap_stack
+<span style="background-color: #FF0000"> </span> .global bsp_ap_entry
+#endif
+
</font> /*
* Software trap. Treat as BAD_TRAP for the time being...
*/
<font color='#997700'>@@ -221,6 +236,23 @@
</font> nop
nop
<font color='#000088'>+#if defined(ENABLE_SMP)
+ rd %asr17, %g1
+ srl %g1, 28, %g1
+ and %g1, 0xff, %g1 ! extract cpu id
+ cmp %g1, 0
+ beq cpu0
+ nop
+ set SYM(bsp_ap_stack), %g1 ! set the stack pointer
+ ld [%g1], %sp
+ mov %sp, %fp
+ set SYM(bsp_ap_entry), %g1 ! where to start
+ ld [%g1], %g1
+ call %g1
+ nop
+cpu0:
+#endif
+
</font> set (SYM(rdb_start)), %g6 ! End of RAM
st %sp, [%g6]
sub %sp, 4, %sp ! stack starts at end of RAM - 4
</pre>
<p> </p>
<a name='cs3'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
<font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>
* score/Makefile.am, score/include/rtems/score/schedulersimplesmp.h,
score/src/schedulersimplesmptick.c: Build schedulersimplesmptick.c
and fix typos.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2862&r2=text&tr2=1.2863&diff_format=h">M</a></td><td width='1%'>1.2863</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/Makefile.am.diff?r1=text&tr1=1.104&r2=text&tr2=1.105&diff_format=h">M</a></td><td width='1%'>1.105</td><td width='100%'>cpukit/score/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/include/rtems/score/schedulersimplesmp.h.diff?r1=text&tr1=1.3&r2=text&tr2=1.4&diff_format=h">M</a></td><td width='1%'>1.4</td><td width='100%'>cpukit/score/include/rtems/score/schedulersimplesmp.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/schedulersimplesmptick.c.diff?r1=text&tr1=1.1&r2=text&tr2=1.2&diff_format=h">M</a></td><td width='1%'>1.2</td><td width='100%'>cpukit/score/src/schedulersimplesmptick.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2862 rtems/cpukit/ChangeLog:1.2863
--- rtems/cpukit/ChangeLog:1.2862 Mon Jun 27 15:30:57 2011
+++ rtems/cpukit/ChangeLog Tue Jun 28 15:31:36 2011
</font><font color='#997700'>@@ -1,3 +1,9 @@
</font><font color='#000088'>+2011-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * score/Makefile.am, score/include/rtems/score/schedulersimplesmp.h,
+ score/src/schedulersimplesmptick.c: Build schedulersimplesmptick.c
+ and fix typos.
+
</font> 2011-06-27 Joel Sherrill <joel.sherrill@oarcorp.com>
* posix/include/semaphore.h, posix/include/rtems/posix/mutex.h,
<font color='#006600'>diff -u rtems/cpukit/score/Makefile.am:1.104 rtems/cpukit/score/Makefile.am:1.105
--- rtems/cpukit/score/Makefile.am:1.104 Fri Jun 17 09:31:45 2011
+++ rtems/cpukit/score/Makefile.am Tue Jun 28 15:31:36 2011
</font><font color='#997700'>@@ -134,7 +134,7 @@
</font> if HAS_SMP
libscore_a_SOURCES += src/smp.c src/smplock.c \
src/schedulersimplesmpblock.c src/schedulersimplesmpschedule.c \
<font color='#880000'>- src/schedulersimplesmpunblock.c src/schedulerprioritytick.c<span style="background-color: #FF0000"> </span>
</font><font color='#000088'>+ src/schedulersimplesmpunblock.c src/schedulersimplesmptick.c<span style="background-color: #FF0000"> </span>
</font> endif
## CORE_APIMUTEX_C_FILES
<font color='#006600'>diff -u rtems/cpukit/score/include/rtems/score/schedulersimplesmp.h:1.3 rtems/cpukit/score/include/rtems/score/schedulersimplesmp.h:1.4
--- rtems/cpukit/score/include/rtems/score/schedulersimplesmp.h:1.3 Fri Jun 17 09:31:45 2011
+++ rtems/cpukit/score/include/rtems/score/schedulersimplesmp.h Tue Jun 28 15:31:36 2011
</font><font color='#997700'>@@ -105,7 +105,6 @@
</font> */
void _Scheduler_simple_smp_Tick( void );
<font color='#880000'>-/**
</font> #ifdef __cplusplus
}
#endif
<font color='#006600'>diff -u rtems/cpukit/score/src/schedulersimplesmptick.c:1.1 rtems/cpukit/score/src/schedulersimplesmptick.c:1.2
--- rtems/cpukit/score/src/schedulersimplesmptick.c:1.1 Fri Jun 17 09:31:46 2011
+++ rtems/cpukit/score/src/schedulersimplesmptick.c Tue Jun 28 15:31:36 2011
</font><font color='#997700'>@@ -15,12 +15,14 @@
</font>
#include <rtems/system.h>
#include <rtems/score/schedulersimplesmp.h>
<font color='#000088'>+#include <rtems/score/smp.h>
</font>
static void _Scheduler_simple_smp_Tick_helper(
int cpu
)
{
Thread_Control *executing;
<font color='#000088'>+ ISR_Level level;
</font>
executing = _Per_CPU_Information[cpu].executing;
</pre>
<p> </p>
<a name='cs4'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
<font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1826/cpukit
* libmisc/cpuuse/cpuusagereport.c, rtems/Makefile.am,
rtems/preinstall.am, rtems/include/rtems.h: Add SMP Helper methods to
Classic API.
* rtems/include/rtems/rtems/smp.h: New file.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2863&r2=text&tr2=1.2864&diff_format=h">M</a></td><td width='1%'>1.2864</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libmisc/cpuuse/cpuusagereport.c.diff?r1=text&tr1=1.22&r2=text&tr2=1.23&diff_format=h">M</a></td><td width='1%'>1.23</td><td width='100%'>cpukit/libmisc/cpuuse/cpuusagereport.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/rtems/Makefile.am.diff?r1=text&tr1=1.53&r2=text&tr2=1.54&diff_format=h">M</a></td><td width='1%'>1.54</td><td width='100%'>cpukit/rtems/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/rtems/include/rtems.h.diff?r1=text&tr1=1.38&r2=text&tr2=1.39&diff_format=h">M</a></td><td width='1%'>1.39</td><td width='100%'>cpukit/rtems/include/rtems.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/rtems/include/rtems/rtems/smp.h?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/rtems/include/rtems/rtems/smp.h</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/rtems/preinstall.am.diff?r1=text&tr1=1.14&r2=text&tr2=1.15&diff_format=h">M</a></td><td width='1%'>1.15</td><td width='100%'>cpukit/rtems/preinstall.am</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2863 rtems/cpukit/ChangeLog:1.2864
--- rtems/cpukit/ChangeLog:1.2863 Tue Jun 28 15:31:36 2011
+++ rtems/cpukit/ChangeLog Tue Jun 28 15:39:39 2011
</font><font color='#997700'>@@ -1,5 +1,13 @@
</font> 2011-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>
<font color='#000088'>+ PR 1826/cpukit
+ * libmisc/cpuuse/cpuusagereport.c, rtems/Makefile.am,
+ rtems/preinstall.am, rtems/include/rtems.h: Add SMP Helper methods to
+ Classic API.
+ * rtems/include/rtems/rtems/smp.h: New file.
+
+2011-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>
+
</font> * score/Makefile.am, score/include/rtems/score/schedulersimplesmp.h,
score/src/schedulersimplesmptick.c: Build schedulersimplesmptick.c
and fix typos.
<font color='#006600'>diff -u rtems/cpukit/libmisc/cpuuse/cpuusagereport.c:1.22 rtems/cpukit/libmisc/cpuuse/cpuusagereport.c:1.23
--- rtems/cpukit/libmisc/cpuuse/cpuusagereport.c:1.22 Thu Jun 16 11:24:05 2011
+++ rtems/cpukit/libmisc/cpuuse/cpuusagereport.c Tue Jun 28 15:39:39 2011
</font><font color='#997700'>@@ -49,7 +49,7 @@
</font> }
#else
int cpu;
<font color='#880000'>- for ( cpu=0 ; cpu < _SMP_Processor_count ; cpu++ ) {
</font><font color='#000088'>+ for ( cpu=0 ; cpu < rtems_smp_get_number_of_processors() ; cpu++ ) {
</font> Per_CPU_Control *p = &_Per_CPU_Information[cpu];
if ( p->executing->Object.id == the_thread->Object.id ) {
*time_of_context_switch = p->time_of_last_context_switch;
<font color='#006600'>diff -u rtems/cpukit/rtems/Makefile.am:1.53 rtems/cpukit/rtems/Makefile.am:1.54
--- rtems/cpukit/rtems/Makefile.am:1.53 Mon May 16 09:28:26 2011
+++ rtems/cpukit/rtems/Makefile.am Tue Jun 28 15:39:39 2011
</font><font color='#997700'>@@ -57,6 +57,10 @@
</font> include_rtems_rtems_HEADERS += include/rtems/rtems/taskmp.h
endif
<font color='#000088'>+if HAS_SMP
+include_rtems_rtems_HEADERS += include/rtems/rtems/smp.h
+endif
+
</font> include_rtems_rtems_HEADERS += inline/rtems/rtems/asr.inl
include_rtems_rtems_HEADERS += inline/rtems/rtems/attr.inl
include_rtems_rtems_HEADERS += inline/rtems/rtems/barrier.inl
<font color='#006600'>diff -u rtems/cpukit/rtems/include/rtems.h:1.38 rtems/cpukit/rtems/include/rtems.h:1.39
--- rtems/cpukit/rtems/include/rtems.h:1.38 Mon Aug 9 03:59:57 2010
+++ rtems/cpukit/rtems/include/rtems.h Tue Jun 28 15:39:39 2011
</font><font color='#997700'>@@ -74,6 +74,10 @@
</font> #if defined(RTEMS_MULTIPROCESSING)
#include <rtems/rtems/mp.h>
#endif
<font color='#000088'>+#if defined(RTEMS_SMP)
+#include <rtems/rtems/smp.h>
+#endif
+
</font>
#include <rtems/rtems/support.h>
#include <rtems/score/sysstate.h>
<font color='#006600'>diff -u /dev/null rtems/cpukit/rtems/include/rtems/rtems/smp.h:1.1
--- /dev/null Tue Jun 28 16:11:21 2011
+++ rtems/cpukit/rtems/include/rtems/rtems/smp.h Tue Jun 28 15:39:39 2011
</font><font color='#997700'>@@ -0,0 +1,82 @@
</font><font color='#000088'>+/**
+ * @file rtems/rtems/smp.h
+ *
+ * This include file provides the application interface
+ * to SMP information and services.
+ *
+ * Most of the SMP interface is hidden from the application
+ * and exists between the BSP and RTEMS.
+ */
+
+/* COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#ifndef _RTEMS_RTEMS_SMP_H
+#define _RTEMS_RTEMS_SMP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <rtems/score/smp.h>
+
+/**
+ * @defgroup ClassicSMP Classic API SMP Services
+ *
+ * @ingroup ClassicRTEMS
+ *
+ * This encapsulates functionality which is useful for SMP applications.
+ */
+/**@{*/
+
+extern uint32_t rtems_configuration_smp_maximum_processors;
+
+/**
+ * @brief Obtain Number of Cores in System
+ *
+ * This method returns the number of CPU cores that are currently in
+ * the system. This will always be less than or equal to the number
+ * of maximum number of cores which were configured.
+ *
+ * @return This method returns the number of cores in this system.
+ */
+#define rtems_smp_get_number_of_processors() \
+ (_SMP_Processor_count)
+
+/**
+ * @brief Obtain Maximum Cores Configured
+ *
+ * This method returns the number of CPU cores that were configured
+ * in the system. The actual number of cores will always be less than
+ * or equal to the number of maximum number of cores which were configured.
+ *
+ * @return This method returns the number of cores configured.
+ */
+#define rtems_configuration_get_smp_maximum_processors() \
+ (rtems_configuration_smp_maximum_processors)
+
+/**
+ * @brief Obtain Current Core Number
+ *
+ * This method returns the id of the current CPU core.
+ *
+ * @return This method returns the id of the current CPU core.
+ */
+#define rtems_smp_get_current_processor() \
+ bsp_smp_processor_id()
+
+/**@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+/* end of include file */
</font>
<font color='#006600'>diff -u rtems/cpukit/rtems/preinstall.am:1.14 rtems/cpukit/rtems/preinstall.am:1.15
--- rtems/cpukit/rtems/preinstall.am:1.14 Mon Aug 9 04:03:11 2010
+++ rtems/cpukit/rtems/preinstall.am Tue Jun 28 15:39:39 2011
</font><font color='#997700'>@@ -164,6 +164,11 @@
</font> $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/taskmp.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/taskmp.h
endif
<font color='#000088'>+if HAS_SMP
+$(PROJECT_INCLUDE)/rtems/rtems/smp.h: include/rtems/rtems/smp.h $(PROJECT_INCLUDE)/rtems/rtems/$(dirstamp)
+ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/smp.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/smp.h
+endif
</font> $(PROJECT_INCLUDE)/rtems/rtems/asr.inl: inline/rtems/rtems/asr.inl $(PROJECT_INCLUDE)/rtems/rtems/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/asr.inl
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/asr.inl
</pre>
<p> </p>
<a name='cs5'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
<font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-05-24 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1810/misc
* ChangeLog: Fix previous damage.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/ChangeLog.diff?r1=text&tr1=1.401&r2=text&tr2=1.402&diff_format=h">M</a></td><td width='1%'>1.402</td><td width='100%'>ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/aclocal/enable-smp.m4.diff?r1=text&tr1=1.1&r2=text&tr2=1.2&diff_format=h">M</a></td><td width='1%'>1.2</td><td width='100%'>aclocal/enable-smp.m4</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/ChangeLog:1.401 rtems/ChangeLog:1.402
--- rtems/ChangeLog:1.401 Thu Jun 16 23:05:28 2011
+++ rtems/ChangeLog Tue Jun 28 15:43:53 2011
</font><font color='#997700'>@@ -1,3 +1,8 @@
</font><font color='#000088'>+2011-05-24 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ PR 1810/misc
+ * ChangeLog: Fix previous damage.
+
</font> 2011-06-17 Ralf Corsépius <ralf.corsepius@rtems.org>
* Makefile.am: Remove make/host.cfg.in.
<font color='#006600'>diff -u rtems/aclocal/enable-smp.m4:1.1 rtems/aclocal/enable-smp.m4:1.2
--- rtems/aclocal/enable-smp.m4:1.1 Wed Mar 16 15:06:55 2011
+++ rtems/aclocal/enable-smp.m4 Tue Jun 28 15:43:53 2011
</font><font color='#997700'>@@ -8,7 +8,7 @@
</font> [AS_HELP_STRING([--enable-smp],[enable smp interface])],
[case "${enableval}" in<span style="background-color: #FF0000"> </span>
yes) case "${RTEMS_CPU}" in
<font color='#880000'>- sparc|i386) RTEMS_HAS_SMP=no ;;
</font><font color='#000088'>+ sparc|i386) RTEMS_HAS_SMP=yes ;;
</font> *) RTEMS_HAS_SMP=no ;;
esac
;;
</pre>
<p> </p>
<a name='cs6'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
<font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>
* .configure.ac.swp, ChangeLog, Makefile.am, README, config.h.in,
configure.ac, smp01/.cvsignore, smp01/Makefile.am, smp01/init.c,
smp01/smp01.doc, smp01/smp01.scn, smp01/system.h, smp01/tasks.c,
smp02/.cvsignore, smp02/Makefile.am, smp02/init.c, smp02/smp02.doc,
smp02/smp02.scn, smp02/system.h, smp02/tasks.c, smp03/.cvsignore,
smp03/Makefile.am, smp03/init.c, smp03/smp03.doc, smp03/smp03.scn,
smp03/system.h, smp03/tasks.c, smp04/.cvsignore, smp04/Makefile.am,
smp04/init.c, smp04/smp04.doc, smp04/smp04.scn, smp04/system.h,
smp04/tasks.c, smp05/.cvsignore, smp05/Makefile.am, smp05/init.c,
smp05/smp05.doc, smp05/smp05.scn, smp06/.cvsignore,
smp06/Makefile.am, smp06/init.c, smp06/smp06.doc, smp06/smp06.scn,
smp07/.cvsignore, smp07/Makefile.am, smp07/init.c, smp07/smp07.doc,
smp07/smp07.scn, smp08/.cvsignore, smp08/Makefile.am, smp08/init.c,
smp08/smp08.doc, smp08/smp08.scn, smp08/system.h, smp08/tasks.c,
smp09/.cvsignore, smp09/Makefile.am, smp09/init.c, smp09/smp09.doc,
smp09/smp09.scn: New files.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/.configure.ac.swp?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/.configure.ac.swp</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/ChangeLog?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/ChangeLog</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/Makefile.am?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/README?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/README</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/config.h.in?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/config.h.in</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/configure.ac?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/configure.ac</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp01/.cvsignore?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp01/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp01/Makefile.am?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp01/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp01/init.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp01/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp01/smp01.doc?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp01/smp01.doc</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp01/smp01.scn?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp01/smp01.scn</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp01/system.h?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp01/system.h</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp01/tasks.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp01/tasks.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp02/.cvsignore?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp02/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp02/Makefile.am?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp02/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp02/init.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp02/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp02/smp02.doc?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp02/smp02.doc</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp02/smp02.scn?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp02/smp02.scn</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp02/system.h?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp02/system.h</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp02/tasks.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp02/tasks.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp03/.cvsignore?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp03/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp03/Makefile.am?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp03/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp03/init.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp03/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp03/smp03.doc?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp03/smp03.doc</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp03/smp03.scn?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp03/smp03.scn</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp03/system.h?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp03/system.h</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp03/tasks.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp03/tasks.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp04/.cvsignore?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp04/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp04/Makefile.am?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp04/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp04/init.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp04/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp04/smp04.doc?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp04/smp04.doc</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp04/smp04.scn?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp04/smp04.scn</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp04/system.h?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp04/system.h</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp04/tasks.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp04/tasks.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp05/.cvsignore?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp05/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp05/Makefile.am?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp05/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp05/init.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp05/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp05/smp05.doc?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp05/smp05.doc</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp05/smp05.scn?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp05/smp05.scn</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp06/.cvsignore?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp06/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp06/Makefile.am?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp06/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp06/init.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp06/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp06/smp06.doc?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp06/smp06.doc</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp06/smp06.scn?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp06/smp06.scn</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp07/.cvsignore?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp07/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp07/Makefile.am?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp07/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp07/init.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp07/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp07/smp07.doc?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp07/smp07.doc</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp07/smp07.scn?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp07/smp07.scn</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp08/.cvsignore?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp08/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp08/Makefile.am?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp08/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp08/init.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp08/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp08/smp08.doc?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp08/smp08.doc</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp08/smp08.scn?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp08/smp08.scn</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp08/system.h?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp08/system.h</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp08/tasks.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp08/tasks.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp09/.cvsignore?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp09/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp09/Makefile.am?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp09/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp09/init.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp09/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp09/smp09.doc?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp09/smp09.doc</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/smptests/smp09/smp09.scn?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/smptests/smp09/smp09.scn</font></td></tr>
</table>
<pre>
<font color='#FF0000'>*** DIFF FAILED: ***
</font><font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/ChangeLog:1.1
--- /dev/null Tue Jun 28 16:11:21 2011
+++ rtems/testsuites/smptests/ChangeLog Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,19 @@
</font><font color='#000088'>+2011-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * .configure.ac.swp, ChangeLog, Makefile.am, README, config.h.in,
+ configure.ac, smp01/.cvsignore, smp01/Makefile.am, smp01/init.c,
+ smp01/smp01.doc, smp01/smp01.scn, smp01/system.h, smp01/tasks.c,
+ smp02/.cvsignore, smp02/Makefile.am, smp02/init.c, smp02/smp02.doc,
+ smp02/smp02.scn, smp02/system.h, smp02/tasks.c, smp03/.cvsignore,
+ smp03/Makefile.am, smp03/init.c, smp03/smp03.doc, smp03/smp03.scn,
+ smp03/system.h, smp03/tasks.c, smp04/.cvsignore, smp04/Makefile.am,
+ smp04/init.c, smp04/smp04.doc, smp04/smp04.scn, smp04/system.h,
+ smp04/tasks.c, smp05/.cvsignore, smp05/Makefile.am, smp05/init.c,
+ smp05/smp05.doc, smp05/smp05.scn, smp06/.cvsignore,
+ smp06/Makefile.am, smp06/init.c, smp06/smp06.doc, smp06/smp06.scn,
+ smp07/.cvsignore, smp07/Makefile.am, smp07/init.c, smp07/smp07.doc,
+ smp07/smp07.scn, smp08/.cvsignore, smp08/Makefile.am, smp08/init.c,
+ smp08/smp08.doc, smp08/smp08.scn, smp08/system.h, smp08/tasks.c,
+ smp09/.cvsignore, smp09/Makefile.am, smp09/init.c, smp09/smp09.doc,
+ smp09/smp09.scn: New files.
+
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/Makefile.am:1.1
--- /dev/null Tue Jun 28 16:11:21 2011
+++ rtems/testsuites/smptests/Makefile.am Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,22 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+ACLOCAL_AMFLAGS = -I ../aclocal
+
+SUBDIRS =<span style="background-color: #FF0000"> </span>
+
+if SMPTESTS
+SUBDIRS += smp01
+SUBDIRS += smp02
+SUBDIRS += smp03
+SUBDIRS += smp04
+SUBDIRS += smp05
+SUBDIRS += smp06
+SUBDIRS += smp07
+SUBDIRS += smp08
+SUBDIRS += smp09
+endif
+
+include $(top_srcdir)/../automake/subdirs.am
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/README:1.1
--- /dev/null Tue Jun 28 16:11:21 2011
+++ rtems/testsuites/smptests/README Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,17 @@
</font><font color='#000088'>+#
+# COPYRIGHT (c) 1989-2011.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+# $Id$
+#
+
+This directory contains the RTEMS SMP Test Suite.
+
+As of June 2011, these tests are known to run on only
+
++ pcp4 BSP using qemu with 2-4 cores
++ leon3 BSP using grsim with 4 cores
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/config.h.in:1.1
--- /dev/null Tue Jun 28 16:11:21 2011
+++ rtems/testsuites/smptests/config.h.in Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,19 @@
</font><font color='#000088'>+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/configure.ac:1.1
--- /dev/null Tue Jun 28 16:11:21 2011
+++ rtems/testsuites/smptests/configure.ac Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,47 @@
</font><font color='#000088'>+## Process this file with autoconf to produce a configure script.
+##<span style="background-color: #FF0000"> </span>
+## $Id$
+
+AC_PREREQ([2.68])
+AC_INIT([rtems-c-src-tests-smptests],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
+AC_CONFIG_SRCDIR([smp01])
+AC_CONFIG_HEADER([config.h])
+RTEMS_TOP([../..],[..])
+
+RTEMS_CANONICAL_TARGET_CPU
+
+AM_INIT_AUTOMAKE([no-define foreign 1.11.1])
+AM_MAINTAINER_MODE
+
+RTEMS_ENABLE_CXX
+
+RTEMS_ENV_RTEMSBSP
+
+RTEMS_PROJECT_ROOT
+
+RTEMS_PROG_CC_FOR_TARGET
+
+RTEMS_PROG_CXX_FOR_TARGET
+RTEMS_CANONICALIZE_TOOLS
+
+RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
+RTEMS_CHECK_CPUOPTS([RTEMS_MULTIPROCESSING])
+RTEMS_CHECK_CXX(RTEMS_BSP)
+RTEMS_CHECK_CPUOPTS([RTEMS_NETWORKING])
+RTEMS_CHECK_CPUOPTS([RTEMS_SMP])
+
+AM_CONDITIONAL(SMPTESTS,test "$rtems_cv_RTEMS_SMP" = "yes")
+
+# Explicitly list all Makefiles here
+AC_CONFIG_FILES([Makefile
+smp01/Makefile
+smp02/Makefile
+smp03/Makefile
+smp04/Makefile
+smp05/Makefile
+smp06/Makefile
+smp07/Makefile
+smp08/Makefile
+smp09/Makefile
+])
+AC_OUTPUT
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp01/.cvsignore:1.1
--- /dev/null Tue Jun 28 16:11:21 2011
+++ rtems/testsuites/smptests/smp01/.cvsignore Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,2 @@
</font><font color='#000088'>+Makefile
+Makefile.in
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp01/Makefile.am:1.1
--- /dev/null Tue Jun 28 16:11:22 2011
+++ rtems/testsuites/smptests/smp01/Makefile.am Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,27 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = smp01
+smp01_SOURCES = init.c tasks.c system.h ../../support/src/locked_print.c
+
+dist_rtems_tests_DATA = smp01.scn
+dist_rtems_tests_DATA += smp01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -DSMPTEST<span style="background-color: #FF0000"> </span>
+
+LINK_OBJS = $(smp01_OBJECTS) $(smp01_LDADD)
+LINK_LIBS = $(smp01_LDLIBS)
+
+smp01$(EXEEXT): $(smp01_OBJECTS) $(smp01_DEPENDENCIES)
+ @rm -f smp01$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp01/init.c:1.1
--- /dev/null Tue Jun 28 16:11:22 2011
+++ rtems/testsuites/smptests/smp01/init.c Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,87 @@
</font><font color='#000088'>+/*
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define CONFIGURE_INIT
+#include "system.h"
+
+void Loop() {
+ volatile int i;
+
+ for (i=0; i<300000; i++);
+}
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ int i;
+ char ch;
+ int cpu_num;
+ rtems_id id;
+ rtems_status_code status;
+ bool allDone;
+
+ /* XXX - Delay a bit to allow debug messages from
+ * startup to print. This may need to go away when
+ * debug messages go away.
+ */<span style="background-color: #FF0000"> </span>
+ Loop();
+ locked_print_initialize();
+
+ /* Put start of test message */
+ locked_printf( "\n\n*** SMP01 TEST ***\n" );
+
+ /* Initialize the TaskRan array */
+ for ( i=0; i<rtems_smp_get_number_of_processors() ; i++ ) {
+ TaskRan[i] = false;
+ }
+
+ /* Create and start tasks for each processor */
+ for ( i=1; i< rtems_smp_get_number_of_processors() ; i++ ) {
+ ch = '0' + i;
+
+ status = rtems_task_create(
+ rtems_build_name( 'T', 'A', ch, ' ' ),
+ 1,
+ RTEMS_MINIMUM_STACK_SIZE,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &id
+ );
+ directive_failed( status, "task create" );
+
+ cpu_num = bsp_smp_processor_id();
+ (" CPU %d start task TA%c\n", cpu_num, ch);
+ status = rtems_task_start( id, Test_task, i+1 );
+ directive_failed( status, "task start" );
+
+ Loop();
+ }
+<span style="background-color: #FF0000"> </span>
+ /* Wait on the all tasks to run */
+ while (1) {
+ allDone = true;
+ for ( i=1; i<rtems_smp_get_number_of_processors() ; i++ ) {
+ if (TaskRan[i] == false)
+ allDone = false;
+ }
+ if (allDone) {
+ Loop();
+ locked_printf( "*** END OF TEST SMP01 ***" );
+ rtems_test_exit( 0 );
+ }
+ }
+
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp01/smp01.doc:1.1
--- /dev/null Tue Jun 28 16:11:22 2011
+++ rtems/testsuites/smptests/smp01/smp01.doc Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,21 @@
</font><font color='#000088'>+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-1999.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This is a simple test that verifies that each of the smp
+processors can run a task. The init task creates and starts
+a test_task for each prcessor. With a small delay between
+the start of each processor to allow for the processor to
+print its status. Note: This may need to change to a semaphore
+locked print routine at some point in the furture.
+
+After the tasks have been started the init task waits for flags
+to be set by each task indicating that they are running. Once all
+flags are set the program terminates.
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp01/smp01.scn:1.1
--- /dev/null Tue Jun 28 16:11:22 2011
+++ rtems/testsuites/smptests/smp01/smp01.scn Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,8 @@
</font><font color='#000088'>+*** SMP01 TEST ***
+CPU 0 start task TA1
+CPU 1 running Task TA1
+CPU 0 start task TA2
+CPU 2 running Task TA2
+CPU 0 start task TA3
+CPU 3 running Task TA3
+*** END OF SMP 01 TEST ***
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp01/system.h:1.1
--- /dev/null Tue Jun 28 16:11:22 2011
+++ rtems/testsuites/smptests/smp01/system.h Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,54 @@
</font><font color='#000088'>+/*
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#include "tmacros.h"
+#include "test_support.h"
+
+/* functions */
+
+rtems_task Init(
+ rtems_task_argument argument
+);
+
+rtems_task Test_task(
+ rtems_task_argument argument
+);
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+
+#define CONFIGURE_SMP_APPLICATION
+#define CONFIGURE_SMP_MAXIMUM_PROCESSORS 4<span style="background-color: #FF0000"> </span>
+
+#define CONFIGURE_MAXIMUM_TASKS \
+ (1 + CONFIGURE_SMP_MAXIMUM_PROCESSORS)
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#include <rtems/confdefs.h>
+
+/* global variables */
+
+/*
+ * Keep the names and IDs in global variables so another task can use them.
+ */
+
+TEST_EXTERN volatile bool TaskRan[ CONFIGURE_SMP_MAXIMUM_PROCESSORS ];
+
+void Loop( void );
+
+/*
+ * Handy macros and static inline functions
+ */
+
+/* end of include file */
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp01/tasks.c:1.1
--- /dev/null Tue Jun 28 16:11:22 2011
+++ rtems/testsuites/smptests/smp01/tasks.c Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,45 @@
</font><font color='#000088'>+/*
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "system.h"
+
+rtems_task Test_task(
+ rtems_task_argument task_index
+)
+{
+ int cpu_num;
+ char name[5];
+ char *p;
+
+ /* Get the task name */
+ p = rtems_object_get_name( RTEMS_SELF, 5, name );
+ rtems_test_assert( p != NULL );
+
+ /* Get the CPU Number */
+ cpu_num = bsp_smp_processor_id();
+
+ /* Print that the task is up and running. */
+ Loop();
+ locked_printf(" CPU %d running Task %s\n", cpu_num, name);
+
+ /* Set the flag that the task is up and running */
+ TaskRan[cpu_num] = true;
+
+
+ /* Drop into a loop which will keep this task on
+ * running on the cpu.
+ */
+ while(1);
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp02/.cvsignore:1.1
--- /dev/null Tue Jun 28 16:11:22 2011
+++ rtems/testsuites/smptests/smp02/.cvsignore Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,2 @@
</font><font color='#000088'>+Makefile
+Makefile.in
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp02/Makefile.am:1.1
--- /dev/null Tue Jun 28 16:11:22 2011
+++ rtems/testsuites/smptests/smp02/Makefile.am Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,29 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = smp02
+smp02_SOURCES = init.c tasks.c system.h ../../support/src/locked_print.c
+
+dist_rtems_tests_DATA = smp02.scn
+dist_rtems_tests_DATA += smp02.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -DSMPTEST<span style="background-color: #FF0000"> </span>
+
+smp02_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+LINK_OBJS = $(smp02_OBJECTS) $(smp02_LDADD)
+LINK_LIBS = $(smp02_LDLIBS)
+
+smp02$(EXEEXT): $(smp02_OBJECTS) $(smp02_DEPENDENCIES)
+ @rm -f smp02$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp02/init.c:1.1
--- /dev/null Tue Jun 28 16:11:22 2011
+++ rtems/testsuites/smptests/smp02/init.c Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,102 @@
</font><font color='#000088'>+/*
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define CONFIGURE_INIT
+#include "system.h"
+
+#include <stdio.h>
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ int i;
+ char ch;
+ int cpu_num;
+ rtems_id id;
+ rtems_status_code status;
+ char str[80];
+
+ locked_print_initialize();
+ locked_printf( "\n\n*** SMP02 TEST ***\n" );
+
+ /* Create/verify synchronisation semaphore */
+ status = rtems_semaphore_create(
+ rtems_build_name ('S', 'E', 'M', '1'),
+ 1,<span style="background-color: #FF0000"> </span>
+ RTEMS_LOCAL |
+ RTEMS_SIMPLE_BINARY_SEMAPHORE |
+ RTEMS_PRIORITY,
+ 1,
+ &Semaphore);
+ directive_failed( status, "rtems_semaphore_create" );
+
+ /* Lock semaphore */
+ status = rtems_semaphore_obtain( Semaphore, RTEMS_WAIT, 0);
+ directive_failed( status,"rtems_semaphore_obtain of SEM1\n");
+
+ for ( i=1; i < CONFIGURE_SMP_MAXIMUM_PROCESSORS; i++ ){
+
+ /* Create and start tasks for each CPU */
+ ch = '0' + i;
+
+ status = rtems_task_create(
+ rtems_build_name( 'T', 'A', ch, ' ' ),
+ 1,
+ RTEMS_MINIMUM_STACK_SIZE,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &id
+ );
+
+ cpu_num = bsp_smp_processor_id();
+ locked_printf(" CPU %d start task TA%c\n", cpu_num, ch);
+ status = rtems_task_start( id, Test_task, i+1 );
+ locked_printf(str, "rtems_task_start TA%d", i+1);
+ directive_failed( status, str );
+ }
+
+ /*
+ * Release the semaphore, allowing the blocked tasks to start.
+ */
+ status = rtems_semaphore_release( Semaphore );
+ directive_failed( status,"rtems_semaphore_release of SEM1\n");
+<span style="background-color: #FF0000"> </span>
+
+ /*<span style="background-color: #FF0000"> </span>
+ * Wait for log full. print the log and end the program.
+ */<span style="background-color: #FF0000"> </span>
+ while (Log_index < LOG_SIZE)
+ ;
+<span style="background-color: #FF0000"> </span>
+ for (i=0; i< LOG_SIZE; i++) {
+ if ( Log[i].IsLocked ) {
+ locked_printf(
+ " CPU %d Task TA%" PRIu32 " Obtain\n",<span style="background-color: #FF0000"> </span>
+ Log[i].cpu_num,
+ Log[i].task_index
+ );
+ } else {
+ locked_printf(
+ " CPU %d Task TA%" PRIu32 " Release\n",<span style="background-color: #FF0000"> </span>
+ Log[i].cpu_num,
+ Log[i].task_index
+ );
+ }
+ }
+
+ locked_printf( "*** END OF TEST SMP02 ***\n" );
+ rtems_test_exit( 0 );
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp02/smp02.doc:1.1
--- /dev/null Tue Jun 28 16:11:22 2011
+++ rtems/testsuites/smptests/smp02/smp02.doc Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,19 @@
</font><font color='#000088'>+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-1999.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+This test creates tasks for each process (other than the<span style="background-color: #FF0000"> </span>
+one that Init is running on). Then drops into a loop waiting
+on a log file to fill up. Once the log file is filled the<span style="background-color: #FF0000"> </span>
+information is printed and the program ends.
+
+Each task poll for a semaphore. Once the semaphore is<span style="background-color: #FF0000"> </span>
+obtained , a log the obtain and release is recorded and
+the semaphore is released. If the log is full the semaphore
+is released without changing the log.
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp02/smp02.scn:1.1
--- /dev/null Tue Jun 28 16:11:22 2011
+++ rtems/testsuites/smptests/smp02/smp02.scn Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,25 @@
</font><font color='#000088'>+*** SMP02 TEST ***
+ CPU 0 start task TA1
+ CPU 0 start task TA2
+ CPU 0 start task TA3
+ CPU 1 Task TA2 Obtain
+ CPU 1 Task TA2 Release
+ CPU 1 Task TA2 Obtain
+ CPU 1 Task TA2 Release
+ CPU 3 Task TA4 Obtain
+ CPU 3 Task TA4 Release
+ CPU 1 Task TA2 Obtain
+ CPU 1 Task TA2 Release
+ CPU 3 Task TA4 Obtain
+ CPU 3 Task TA4 Release
+ CPU 1 Task TA2 Obtain
+ CPU 1 Task TA2 Release
+ CPU 2 Task TA3 Obtain
+ CPU 2 Task TA3 Release
+ CPU 3 Task TA4 Obtain
+ CPU 3 Task TA4 Release
+ CPU 1 Task TA2 Obtain
+ CPU 1 Task TA2 Release
+ CPU 2 Task TA3 Obtain
+ CPU 2 Task TA3 Release
+*** END OF SMP 02 TEST ***
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp02/system.h:1.1
--- /dev/null Tue Jun 28 16:11:23 2011
+++ rtems/testsuites/smptests/smp02/system.h Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,73 @@
</font><font color='#000088'>+/*<span style="background-color: #FF0000"> </span>
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#include "tmacros.h"
+#include "test_support.h"
+
+/* functions */
+
+rtems_task Init(
+ rtems_task_argument argument
+);
+
+rtems_task Test_task(
+ rtems_task_argument argument
+);
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+
+#define CONFIGURE_SMP_APPLICATION
+#define CONFIGURE_SMP_MAXIMUM_PROCESSORS 4<span style="background-color: #FF0000"> </span>
+
+#define CONFIGURE_MAXIMUM_TASKS \
+ (1 + CONFIGURE_SMP_MAXIMUM_PROCESSORS)
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+#define CONFIGURE_INIT_TASK_STACK_SIZE \
+ (3 * CONFIGURE_MINIMUM_TASK_STACK_SIZE)
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_MAXIMUM_SEMAPHORES 1
+
+#include <rtems/confdefs.h>
+
+
+/* global variables */
+
+/*
+ * Keep the names and IDs in global variables so another task can use them.
+ */
+
+typedef struct {
+ bool IsLocked;
+ int cpu_num;
+ uint32_t task_index;
+} Log_t;
+
+#define LOG_SIZE 20
+
+TEST_EXTERN rtems_id Semaphore; /* synchronisation semaphore */<span style="background-color: #FF0000"> </span>
+TEST_EXTERN Log_t Log[LOG_SIZE]; /* A log of locks/unlocks */
+TEST_EXTERN volatile uint32_t Log_index; /* Index into log */
+
+/*
+ * Handy macros and static inline functions
+ */
+
+/*
+ * Macro to hide the ugliness of printing the time.
+ */
+
+/* end of include file */
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp02/tasks.c:1.1
--- /dev/null Tue Jun 28 16:11:23 2011
+++ rtems/testsuites/smptests/smp02/tasks.c Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,63 @@
</font><font color='#000088'>+/*
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "system.h"
+
+void Loop() {
+ volatile int i;
+
+ for (i=0; i<300000; i++);
+}
+
+void LogSemaphore(
+ bool obtained,
+ int cpu_num,
+ uint32_t task_index
+){
+ int i;
+
+ if (Log_index < LOG_SIZE) {<span style="background-color: #FF0000"> </span>
+ /* Log the information */
+ Log[ Log_index ].IsLocked = obtained;
+ Log[ Log_index ].cpu_num = cpu_num;
+ Log[ Log_index ].task_index = task_index;
+ Log_index++;
+ }
+}
+
+rtems_task Test_task(
+ rtems_task_argument task_index
+)
+{
+ int cpu_num;
+ rtems_status_code sc;
+
+ cpu_num = bsp_smp_processor_id();
+
+ do {
+
+ /* Poll to obtain the synchronization semaphore */
+ do {
+ sc = rtems_semaphore_obtain( Semaphore, RTEMS_NO_WAIT, 0 );
+ } while (sc != RTEMS_SUCCESSFUL );
+
+ LogSemaphore(true, cpu_num, task_index);
+ LogSemaphore(false, cpu_num, task_index);
+<span style="background-color: #FF0000"> </span>
+ rtems_semaphore_release( Semaphore );
+ }
+
+ while(1);
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp03/.cvsignore:1.1
--- /dev/null Tue Jun 28 16:11:23 2011
+++ rtems/testsuites/smptests/smp03/.cvsignore Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,2 @@
</font><font color='#000088'>+Makefile
+Makefile.in
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp03/Makefile.am:1.1
--- /dev/null Tue Jun 28 16:11:23 2011
+++ rtems/testsuites/smptests/smp03/Makefile.am Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,29 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = smp03
+smp03_SOURCES = init.c tasks.c system.h ../../support/src/locked_print.c
+
+dist_rtems_tests_DATA = smp03.scn
+dist_rtems_tests_DATA += smp03.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -DSMPTEST<span style="background-color: #FF0000"> </span>
+
+smp03_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+LINK_OBJS = $(smp03_OBJECTS) $(smp03_LDADD)
+LINK_LIBS = $(smp03_LDLIBS)
+
+smp03$(EXEEXT): $(smp03_OBJECTS) $(smp03_DEPENDENCIES)
+ @rm -f smp03$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp03/init.c:1.1
--- /dev/null Tue Jun 28 16:11:23 2011
+++ rtems/testsuites/smptests/smp03/init.c Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,94 @@
</font><font color='#000088'>+/*
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define CONFIGURE_INIT
+#include "system.h"
+
+#include <stdio.h>
+
+void Loop() {
+ volatile int i;
+
+ for (i=0; i<300000; i++);
+}
+
+void PrintTaskInfo(
+ const char *task_name
+)
+{
+ int cpu_num;
+ rtems_status_code sc;
+
+ cpu_num = bsp_smp_processor_id();
+
+ locked_printf(" CPU %d running task %s\n", cpu_num, task_name );
+}
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ int i;
+ char ch;
+ rtems_id id;
+ rtems_status_code status;
+
+ Loop();
+ locked_print_initialize();
+
+ locked_printf( "\n\n*** SMP03 TEST ***" );
+
+
+ /* Show that the init task is running on this cpu */
+ PrintTaskInfo( "Init" );
+
+ /* for each remaining cpu create and start a task */
+ for ( i=1; i < CONFIGURE_SMP_MAXIMUM_PROCESSORS; i++ ){
+
+ ch = '0' + i;
+
+ status = rtems_task_create(
+ rtems_build_name( 'T', 'A', ch, ' ' ),
+ CONFIGURE_INIT_TASK_PRIORITY + (2*i),
+ RTEMS_MINIMUM_STACK_SIZE,
+ RTEMS_PREEMPT,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &id
+ );
+ status = rtems_task_start( id, Test_task, i );
+
+ Loop();
+ }
+
+ /* Create/Start an aditional task with the highest priority */
+ status = rtems_task_create(
+ rtems_build_name( 'T', 'A', ch, ' ' ),
+ 3,
+ RTEMS_MINIMUM_STACK_SIZE,
+ RTEMS_PREEMPT,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &id
+ );
+ TestFinished = false;
+ status = rtems_task_start( id, Test_task, CONFIGURE_SMP_MAXIMUM_PROCESSORS );
+
+ /* Wait on the last task to run */
+ while(!TestFinished)
+ ;
+
+ /* End the test */
+ locked_printf( "*** END OF TEST SMP03 ***" );
+ rtems_test_exit( 0 );<span style="background-color: #FF0000"> </span>
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp03/smp03.doc:1.1
--- /dev/null Tue Jun 28 16:11:23 2011
+++ rtems/testsuites/smptests/smp03/smp03.doc Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,19 @@
</font><font color='#000088'>+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-1999.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+This test runs the init task on the first CPU at a priority
+of 5. The Init task creates tasks for each remaining processor
+at priorities ( 5 + (2*CPU) ). It then creates one more
+task at a priority of 3 wich should preempt the last task created.
+The Init task waits on the last task to run then ends the program.
+
+Each created task prints the cpu and task that it is running. Then
+checkes the task id to see if it is the final task. If it is the
+final task, a flag is set for the Init task to see.
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp03/smp03.scn:1.1
--- /dev/null Tue Jun 28 16:11:23 2011
+++ rtems/testsuites/smptests/smp03/smp03.scn Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,7 @@
</font><font color='#000088'>+*** SMP03 TEST ***
+ CPU 0 running task Init
+ CPU 1 running task TA1
+ CPU 2 running task TA2
+ CPU 3 running task TA3
+ CPU 3 running task TA4
+*** END OF SMP03 TEST ***
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp03/system.h:1.1
--- /dev/null Tue Jun 28 16:11:23 2011
+++ rtems/testsuites/smptests/smp03/system.h Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,68 @@
</font><font color='#000088'>+/*<span style="background-color: #FF0000"> </span>
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#include "tmacros.h"
+#include "test_support.h"
+
+/* functions */
+
+rtems_task Init(
+ rtems_task_argument argument
+);
+
+rtems_task Test_task(
+ rtems_task_argument argument
+);
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+
+#define CONFIGURE_SMP_APPLICATION
+#define CONFIGURE_SMP_MAXIMUM_PROCESSORS 4<span style="background-color: #FF0000"> </span>
+
+#define CONFIGURE_MAXIMUM_TASKS \
+ (1 + CONFIGURE_SMP_MAXIMUM_PROCESSORS)
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+#define CONFIGURE_INIT_TASK_STACK_SIZE \
+ (3 * CONFIGURE_MINIMUM_TASK_STACK_SIZE)
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT_TASK_PRIORITY 5<span style="background-color: #FF0000"> </span>
+#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_PREEMPT
+
+#include <rtems/confdefs.h>
+
+
+/* global variables */
+
+/*
+ * Keep the names and IDs in global variables so another task can use them.
+ */
+void Loop(void);
+void PrintTaskInfo(
+ const char *task_name
+);
+
+TEST_EXTERN volatile bool TestFinished;
+
+/*
+ * Handy macros and static inline functions
+ */
+
+/*
+ * Macro to hide the ugliness of printing the time.
+ */
+
+/* end of include file */
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp03/tasks.c:1.1
--- /dev/null Tue Jun 28 16:11:23 2011
+++ rtems/testsuites/smptests/smp03/tasks.c Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,38 @@
</font><font color='#000088'>+/*
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "system.h"
+
+rtems_task Test_task(
+ rtems_task_argument task_index
+)
+{
+ char task_name[5];
+
+ /* Show that this task is running on cpu X */
+ sprintf( task_name, "TA%" PRIu32, task_index );
+ PrintTaskInfo( task_name );
+
+ /* If this is the last task created set a flag for the
+ * test to end.
+ */
+ if ( task_index == CONFIGURE_SMP_MAXIMUM_PROCESSORS ) {
+ TestFinished = true;
+ }
+
+ /* Wait for the test to end without giving up this processor */
+ while(1)
+ ;
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp04/.cvsignore:1.1
--- /dev/null Tue Jun 28 16:11:23 2011
+++ rtems/testsuites/smptests/smp04/.cvsignore Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,2 @@
</font><font color='#000088'>+Makefile
+Makefile.in
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp04/Makefile.am:1.1
--- /dev/null Tue Jun 28 16:11:23 2011
+++ rtems/testsuites/smptests/smp04/Makefile.am Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,29 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = smp04
+smp04_SOURCES = init.c tasks.c system.h ../../support/src/locked_print.c
+
+dist_rtems_tests_DATA = smp04.scn
+dist_rtems_tests_DATA += smp04.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -DSMPTEST<span style="background-color: #FF0000"> </span>
+
+smp04_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+LINK_OBJS = $(smp04_OBJECTS) $(smp04_LDADD)
+LINK_LIBS = $(smp04_LDLIBS)
+
+smp04$(EXEEXT): $(smp04_OBJECTS) $(smp04_DEPENDENCIES)
+ @rm -f smp04$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp04/init.c:1.1
--- /dev/null Tue Jun 28 16:11:24 2011
+++ rtems/testsuites/smptests/smp04/init.c Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,119 @@
</font><font color='#000088'>+/*
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define CONFIGURE_INIT
+#include "system.h"
+
+#include <stdio.h>
+
+
+void Loop() {
+ volatile int i;
+
+ for (i=0; i<500000; i++);
+}
+
+void PrintTaskInfo(
+ const char *task_name
+)
+{
+ int cpu_num;
+
+ cpu_num = bsp_smp_processor_id();
+
+ locked_printf(" CPU %d running task %s\n", cpu_num, task_name );
+}
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ int i;
+ char ch;
+ rtems_id id;
+ rtems_status_code status;
+ bool allDone;
+
+ Loop();
+ locked_print_initialize();
+ locked_printf( "\n\n*** SMP04 TEST ***\n" );
+
+ PrintTaskInfo( "Init" );
+
+ TaskRan[0] = true;
+ for ( i=1; i <= rtems_smp_get_number_of_processors() ; i++ )
+ TaskRan[i] = false;
+<span style="background-color: #FF0000"> </span>
+ for ( i=1; i < rtems_smp_get_number_of_processors() ; i++ ){
+
+ /* Create and start tasks for each CPU */
+ ch = '0' + i;
+ locked_printf(
+ "Create a TA%c a %s task\n",
+ ch,<span style="background-color: #FF0000"> </span>
+ ((i%2) ? "RTEMS_PREEMPT" : "RTEMS_NO_PREEMPT" )<span style="background-color: #FF0000"> </span>
+ );
+
+ status = rtems_task_create(
+ rtems_build_name( 'T', 'A', ch, ' ' ),
+ CONFIGURE_INIT_TASK_PRIORITY +
+ (2*rtems_smp_get_number_of_processors()) - (2*i),
+ RTEMS_MINIMUM_STACK_SIZE,
+ ((i%2) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT),
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &id
+ );
+ }
+
+ for ( i=1; i < rtems_smp_get_number_of_processors() ; i++ ){
+ status = rtems_task_start( id, Test_task, i );
+
+ /* Force a wait on the task to run in order to synchronize on
+ * simulated systems.
+ */<span style="background-color: #FF0000"> </span>
+ while (TaskRan[i] == false)
+ ;
+ }
+
+ ch = '0' + rtems_smp_get_number_of_processors() ;
+
+ status = rtems_task_create(
+ rtems_build_name( 'T', 'A', ch, ' ' ),
+ 3,
+ RTEMS_MINIMUM_STACK_SIZE,
+ RTEMS_PREEMPT,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &id
+ );
+ status = rtems_task_start(
+ id,
+ Test_task,
+ rtems_smp_get_number_of_processors()
+ );
+<span style="background-color: #FF0000"> </span>
+ /* Wait on the all tasks to run */
+ while (1) {
+ allDone = true;
+ for ( i=1; i<=rtems_smp_get_number_of_processors() ; i++ ) {
+ if (TaskRan[i] == false)
+ allDone = false;
+ }
+ if (allDone) {
+ Loop();
+ locked_printf( "*** END OF TEST SMP04 ***" );
+ rtems_test_exit( 0 );
+ }
+ }
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp04/smp04.doc:1.1
--- /dev/null Tue Jun 28 16:11:24 2011
+++ rtems/testsuites/smptests/smp04/smp04.doc Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,17 @@
</font><font color='#000088'>+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-1999.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+This test startst Init task with priority 5 and preemption on which
+runs on CPU 0. The init task alternates preemption off and preemtion
+on as it creates tasks for every other cpu in the system. The priority
+of task N will be 5 + 2; task N-1 will be 5 + 4 .....
+Another task will be created after tasks are running on all cpus. This
+task will be of a priority 3. For a 4 cpu system this task should run
+on cpu 2. For a 2 cpu system the task should preempt the Init task.
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp04/smp04.scn:1.1
--- /dev/null Tue Jun 28 16:11:24 2011
+++ rtems/testsuites/smptests/smp04/smp04.scn Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,8 @@
</font><font color='#000088'>+*** SMP04 TEST ***
+ CPU 0 running task Init
+ CPU 1 running task TA1
+ CPU 2 running task TA2
+ CPU 3 running task TA3
+ CPU 2 running task TA4
+*** END OF SMP 04 TEST ***
+
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp04/system.h:1.1
--- /dev/null Tue Jun 28 16:11:24 2011
+++ rtems/testsuites/smptests/smp04/system.h Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,70 @@
</font><font color='#000088'>+/*<span style="background-color: #FF0000"> </span>
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#include "tmacros.h"
+#include "test_support.h"
+
+/* functions */
+
+rtems_task Init(
+ rtems_task_argument argument
+);
+
+rtems_task Test_task(
+ rtems_task_argument argument
+);
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+
+#define CONFIGURE_SMP_APPLICATION
+#define CONFIGURE_SMP_MAXIMUM_PROCESSORS 4<span style="background-color: #FF0000"> </span>
+
+#define CONFIGURE_MAXIMUM_TASKS \
+ (1 + CONFIGURE_SMP_MAXIMUM_PROCESSORS)
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+#define CONFIGURE_INIT_TASK_STACK_SIZE \
+ (3 * CONFIGURE_MINIMUM_TASK_STACK_SIZE)
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT_TASK_PRIORITY 5<span style="background-color: #FF0000"> </span>
+#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT
+
+#define CONFIGURE_MAXIMUM_SEMAPHORES 1
+
+#include <rtems/confdefs.h>
+
+
+/* global variables */
+
+/*
+ * Keep the names and IDs in global variables so another task can use them.
+ */
+void Loop(void);
+void PrintTaskInfo(
+ const char *task_name
+);
+
+TEST_EXTERN volatile bool TaskRan[ CONFIGURE_SMP_MAXIMUM_PROCESSORS ];
+
+/*
+ * Handy macros and static inline functions
+ */
+
+/*
+ * Macro to hide the ugliness of printing the time.
+ */
+
+/* end of include file */
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp04/tasks.c:1.1
--- /dev/null Tue Jun 28 16:11:24 2011
+++ rtems/testsuites/smptests/smp04/tasks.c Tue Jun 28 16:08:47 2011
</font><font color='#997700'>@@ -0,0 +1,31 @@
</font><font color='#000088'>+/*
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "system.h"
+
+rtems_task Test_task(
+ rtems_task_argument task_index
+)
+{
+ char task_name[5];
+
+ sprintf(task_name, "TA%" PRIu32, task_index );
+ PrintTaskInfo( task_name );
+
+ Loop();
+ TaskRan[task_index] = true;
+
+ while(1);
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp05/.cvsignore:1.1
--- /dev/null Tue Jun 28 16:11:24 2011
+++ rtems/testsuites/smptests/smp05/.cvsignore Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,2 @@
</font><font color='#000088'>+Makefile
+Makefile.in
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp05/Makefile.am:1.1
--- /dev/null Tue Jun 28 16:11:24 2011
+++ rtems/testsuites/smptests/smp05/Makefile.am Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,27 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = smp05
+smp05_SOURCES = init.c ../../support/src/locked_print.c
+
+dist_rtems_tests_DATA = smp05.scn
+dist_rtems_tests_DATA += smp05.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -DSMPTEST<span style="background-color: #FF0000"> </span>
+
+LINK_OBJS = $(smp05_OBJECTS) $(smp05_LDADD)
+LINK_LIBS = $(smp05_LDLIBS)
+
+smp05$(EXEEXT): $(smp05_OBJECTS) $(smp05_DEPENDENCIES)
+ @rm -f smp05$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp05/init.c:1.1
--- /dev/null Tue Jun 28 16:11:24 2011
+++ rtems/testsuites/smptests/smp05/init.c Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,76 @@
</font><font color='#000088'>+/*
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#include <tmacros.h>
+#include "test_support.h"
+
+rtems_task Test_task(
+ rtems_task_argument argument
+)
+{
+ locked_printf( "Shut down from CPU %d\n", bsp_smp_processor_id() );
+ locked_printf( "*** END OF TEST SMP05 ***" );
+ rtems_test_exit(0);
+}
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ int i;
+ char ch;
+ int cpu_num;
+ rtems_id id;
+ rtems_status_code status;
+
+ locked_print_initialize();
+ locked_printf( "\n\n*** TEST SMP05 ***\n" );
+
+ for ( i=0; i<rtems_smp_get_number_of_processors() ; i++ ) {
+ ch = '1' + i;
+
+ status = rtems_task_create(
+ rtems_build_name( 'T', 'A', ch, ' ' ),
+ 1,
+ RTEMS_MINIMUM_STACK_SIZE,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &id
+ );
+ directive_failed( status, "task create" );
+
+ cpu_num = bsp_smp_processor_id();
+ locked_printf(" CPU %d start task TA%c\n", cpu_num, ch);
+
+ status = rtems_task_start( id, Test_task, i+1 );
+ directive_failed( status, "task start" );
+ }
+
+ while (1)
+ ;
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+
+#define CONFIGURE_SMP_APPLICATION
+#define CONFIGURE_SMP_MAXIMUM_PROCESSORS 2
+
+#define CONFIGURE_MAXIMUM_TASKS \
+ (1 + CONFIGURE_SMP_MAXIMUM_PROCESSORS)
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp05/smp05.doc:1.1
--- /dev/null Tue Jun 28 16:11:24 2011
+++ rtems/testsuites/smptests/smp05/smp05.doc Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,22 @@
</font><font color='#000088'>+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2010.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: smp05
+
+directives:
+
+ XXX list them
+
+concepts:
+
++ XXX list them
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp05/smp05.scn:1.1
--- /dev/null Tue Jun 28 16:11:24 2011
+++ rtems/testsuites/smptests/smp05/smp05.scn Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,5 @@
</font><font color='#000088'>+*** TEST SMP05 ***
+ CPU 0 start task TA1
+ CPU 0 start task TA2
+Shut down from CPU 1
+*** END OF TEST SMP05 ***
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp06/.cvsignore:1.1
--- /dev/null Tue Jun 28 16:11:24 2011
+++ rtems/testsuites/smptests/smp06/.cvsignore Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,2 @@
</font><font color='#000088'>+Makefile
+Makefile.in
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp06/Makefile.am:1.1
--- /dev/null Tue Jun 28 16:11:25 2011
+++ rtems/testsuites/smptests/smp06/Makefile.am Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,27 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = smp06
+smp06_SOURCES = init.c ../../support/src/locked_print.c
+
+dist_rtems_tests_DATA = smp06.scn
+dist_rtems_tests_DATA += smp06.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -DSMPTEST<span style="background-color: #FF0000"> </span>
+
+LINK_OBJS = $(smp06_OBJECTS) $(smp06_LDADD)
+LINK_LIBS = $(smp06_LDLIBS)
+
+smp06$(EXEEXT): $(smp06_OBJECTS) $(smp06_DEPENDENCIES)
+ @rm -f smp06$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp06/init.c:1.1
--- /dev/null Tue Jun 28 16:11:25 2011
+++ rtems/testsuites/smptests/smp06/init.c Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,124 @@
</font><font color='#000088'>+/*
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#include <tmacros.h>
+#include "test_support.h"
+
+volatile bool Ran;
+
+rtems_task Test_task(
+ rtems_task_argument do_exit
+)
+{
+ int cpu_num;
+ char name[5];
+ char *p;
+
+ p = rtems_object_get_name( RTEMS_SELF, 5, name );
+ rtems_test_assert( p != NULL );
+
+ cpu_num = bsp_smp_processor_id();
+ locked_printf(" CPU %d running Task %s\n", cpu_num, name);
+
+ Ran = true;
+
+ if ( do_exit ) {
+ locked_printf( "*** END OF TEST SMP06 ***" );
+ rtems_test_exit(0);
+ }
+ while(1)
+ ;
+}
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ int i;
+ char ch;
+ int cpu_num;
+ rtems_id id;
+ rtems_status_code status;
+
+ locked_print_initialize();
+ locked_printf( "\n\n*** TEST SMP06 ***\n" );
+ locked_printf( "rtems_clock_tick - so this task has run longer\n" );
+ status = rtems_clock_tick();
+ directive_failed( status, "clock tick" );
+
+ rtems_test_assert( rtems_smp_get_number_of_processors() > 1 );
+
+ cpu_num = bsp_smp_processor_id();
+
+ /*
+ * Create a task at equal priority.
+ */
+ Ran = false;
+ status = rtems_task_create(
+ rtems_build_name( 'T', 'A', '1', ' ' ),
+ 2,
+ RTEMS_MINIMUM_STACK_SIZE,
+ RTEMS_PREEMPT,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &id
+ );
+ directive_failed( status, "task create" );
+
+ locked_printf(" CPU %d start task TA1\n", cpu_num );
+
+ status = rtems_task_start( id, Test_task, 0 );
+ directive_failed( status, "task start" );
+
+ while ( Ran == false )
+ ;
+
+ /*
+ * Create a task at greater priority.
+ */
+ Ran = false;
+ status = rtems_task_create(
+ rtems_build_name( 'T', 'A', '2', ' ' ),
+ 1,
+ RTEMS_MINIMUM_STACK_SIZE,
+ RTEMS_PREEMPT,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &id
+ );
+ directive_failed( status, "task create" );
+
+ cpu_num = bsp_smp_processor_id();
+ locked_printf(" CPU %d start task TA2\n", cpu_num );
+
+ status = rtems_task_start( id, Test_task, 1 );
+ directive_failed( status, "task start" );
+
+ while ( 1 )
+ ;
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+
+#define CONFIGURE_SMP_APPLICATION
+#define CONFIGURE_SMP_MAXIMUM_PROCESSORS 2
+
+#define CONFIGURE_MAXIMUM_TASKS 4
+
+#define CONFIGURE_INIT_TASK_PRIORITY 2
+#define CONFIGURE_INIT_TASK_MODES RTEMS_PREEMPT
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp06/smp06.doc:1.1
--- /dev/null Tue Jun 28 16:11:25 2011
+++ rtems/testsuites/smptests/smp06/smp06.doc Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,25 @@
</font><font color='#000088'>+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2011.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: smp06
+
+directives:
+
+ rtems_task_create
+ rtems_task_start
+
+concepts:
+
++ Ensure that in an SMP system, when given a choice to preempt one of two
+ threads at equal priority, the thread which has been running the longest
+ is selected.
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp06/smp06.scn:1.1
--- /dev/null Tue Jun 28 16:11:25 2011
+++ rtems/testsuites/smptests/smp06/smp06.scn Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,7 @@
</font><font color='#000088'>+** TEST SMP06 ***
+rtems_clock_tick - so this task has run longer
+ CPU 0 start task TA1
+ CPU 1 running Task TA1<span style="background-color: #FF0000"> </span>
+ CPU 0 start task TA2
+ CPU 1 running Task TA2<span style="background-color: #FF0000"> </span>
+*** END OF TEST SMP06 ***
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp07/.cvsignore:1.1
--- /dev/null Tue Jun 28 16:11:25 2011
+++ rtems/testsuites/smptests/smp07/.cvsignore Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,2 @@
</font><font color='#000088'>+Makefile
+Makefile.in
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp07/Makefile.am:1.1
--- /dev/null Tue Jun 28 16:11:25 2011
+++ rtems/testsuites/smptests/smp07/Makefile.am Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,27 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = smp07
+smp07_SOURCES = init.c ../../support/src/locked_print.c
+
+dist_rtems_tests_DATA = smp07.scn
+dist_rtems_tests_DATA += smp07.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -DSMPTEST<span style="background-color: #FF0000"> </span>
+
+LINK_OBJS = $(smp07_OBJECTS) $(smp07_LDADD)
+LINK_LIBS = $(smp07_LDLIBS)
+
+smp07$(EXEEXT): $(smp07_OBJECTS) $(smp07_DEPENDENCIES)
+ @rm -f smp07$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp07/init.c:1.1
--- /dev/null Tue Jun 28 16:11:25 2011
+++ rtems/testsuites/smptests/smp07/init.c Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,164 @@
</font><font color='#000088'>+/*
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#include <tmacros.h>
+#include "test_support.h"
+
+volatile bool TaskRan = false;
+volatile bool TSRFired = false;
+rtems_id Semaphore;<span style="background-color: #FF0000"> </span>
+
+rtems_task Test_task(
+ rtems_task_argument argument
+)
+{
+ int cpu_num;
+ rtems_status_code sc;
+ char name[5];
+ char *p;
+
+ /* Get the task name */
+ p = rtems_object_get_name( RTEMS_SELF, 5, name );
+ rtems_test_assert( p != NULL );
+
+ /* Get the CPU Number */
+ cpu_num = bsp_smp_processor_id();
+
+ /* Print that the task is up and running. */
+ locked_printf(" CPU %d runnng Task %s and blocking\n", cpu_num, name);
+
+ sc = rtems_semaphore_obtain( Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
+ directive_failed( sc,"obtain in test task");
+
+ if ( !TSRFired )
+ locked_printf( "*** ERROR TSR DID NOT FIRE BUT TEST TASK AWAKE***" );
+
+ TaskRan = true;
+
+ /* Print that the task is up and running. */
+ locked_printf(" CPU %d running Task %s after semaphore release\n", cpu_num, name);
+
+ (void) rtems_task_delete( RTEMS_SELF );
+}
+
+
+rtems_timer_service_routine TimerMethod(
+ rtems_id timer,
+ void *arg
+)
+{
+ /*
+ * Set flag and release the semaphore, allowing the blocked tasks to start.
+ */
+ TSRFired = true;
+
+ rtems_semaphore_release( Semaphore );
+}
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ int cpu_num;
+ rtems_id id;
+ rtems_status_code status;
+ rtems_interval per_second;
+ rtems_interval then;
+ rtems_id Timer;
+
+ locked_print_initialize();
+ locked_printf( "\n\n*** TEST SMP07 ***\n" );
+
+ /* Create/verify semaphore */
+ status = rtems_semaphore_create(
+ rtems_build_name ('S', 'E', 'M', '1'),
+ 1,<span style="background-color: #FF0000"> </span>
+ RTEMS_LOCAL |
+ RTEMS_SIMPLE_BINARY_SEMAPHORE |
+ RTEMS_PRIORITY,
+ 1,
+ &Semaphore
+ );
+ directive_failed( status, "rtems_semaphore_create" );
+
+ /* Lock semaphore */
+ status = rtems_semaphore_obtain( Semaphore, RTEMS_WAIT, 0);
+ directive_failed( status,"rtems_semaphore_obtain of SEM1\n");
+
+ /* Create and Start test task. */
+ status = rtems_task_create(
+ rtems_build_name( 'T', 'A', '1', ' ' ),
+ 1,
+ RTEMS_MINIMUM_STACK_SIZE,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &id
+ );
+ directive_failed( status, "task create" );
+
+ cpu_num = bsp_smp_processor_id();
+ locked_printf(" CPU %d start task TA1\n", cpu_num );
+ status = rtems_task_start( id, Test_task, 1 );
+ directive_failed( status, "task start" );
+
+ /* Create and start TSR */
+ locked_printf(" CPU %d create and start timer\n", cpu_num );
+ status = rtems_timer_create( rtems_build_name( 'T', 'M', 'R', '1' ), &Timer);
+ directive_failed( status, "rtems_timer_create" );
+
+ per_second = rtems_clock_get_ticks_per_second();
+ status = rtems_timer_fire_after( Timer, 2 * per_second, TimerMethod, NULL );
+ directive_failed( status, "rtems_timer_fire_after");
+
+ /*
+ * Wait long enough that TSR should have fired.
+ *
+ * Spin so CPU 0 is consumed. This forces task to run on CPU 1.
+ */
+ then = rtems_clock_get_ticks_since_boot() + 4 * per_second;
+ while (1) {
+ if ( rtems_clock_get_ticks_since_boot() > then )
+ break;
+ if ( TSRFired && TaskRan )
+ break;
+ };
+<span style="background-color: #FF0000"> </span>
+ /* Validate the timer fired and that the task ran */
+ if ( !TSRFired )
+ locked_printf( "*** ERROR TSR DID NOT FIRE ***" );
+
+ if ( !TaskRan ) {
+ locked_printf( "*** ERROR TASK DID NOT RUN ***" );
+ rtems_test_exit(0);
+ }
+
+ /* End the program */
+ locked_printf( "*** END OF TEST SMP07 ***\n" );
+ rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_SMP_APPLICATION
+#define CONFIGURE_SMP_MAXIMUM_PROCESSORS 2
+#define CONFIGURE_MAXIMUM_TIMERS 1
+
+#define CONFIGURE_MAXIMUM_TASKS 2
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+#define CONFIGURE_MAXIMUM_SEMAPHORES 1
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp07/smp07.doc:1.1
--- /dev/null Tue Jun 28 16:11:25 2011
+++ rtems/testsuites/smptests/smp07/smp07.doc Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,24 @@
</font><font color='#000088'>+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2010.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: smp07
+
+directives:
+
+ rtems_semaphore_obtain
+ rtems_semaphore_release
+
+concepts:
+
++ Ensure that if a task is unblocked from an ISR on an SMP system, that
+ it will run.
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp07/smp07.scn:1.1
--- /dev/null Tue Jun 28 16:11:25 2011
+++ rtems/testsuites/smptests/smp07/smp07.scn Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,6 @@
</font><font color='#000088'>+*** TEST SMP07 ***
+ CPU 0 start task TA1
+ CPU 0 create and start timer
+ CPU 1 runnng Task TA1 and blocking
+ CPU 1 running Task TA1 after semaphore release
+*** END OF TEST SMP07 ***
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp08/.cvsignore:1.1
--- /dev/null Tue Jun 28 16:11:25 2011
+++ rtems/testsuites/smptests/smp08/.cvsignore Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,2 @@
</font><font color='#000088'>+Makefile
+Makefile.in
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp08/Makefile.am:1.1
--- /dev/null Tue Jun 28 16:11:25 2011
+++ rtems/testsuites/smptests/smp08/Makefile.am Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,29 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = smp08
+smp08_SOURCES = init.c tasks.c system.h ../../support/src/locked_print.c
+
+dist_rtems_tests_DATA = smp08.scn
+dist_rtems_tests_DATA += smp08.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -DSMPTEST<span style="background-color: #FF0000"> </span>
+
+smp08_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
+
+LINK_OBJS = $(smp08_OBJECTS) $(smp08_LDADD)
+LINK_LIBS = $(smp08_LDLIBS)
+
+smp08$(EXEEXT): $(smp08_OBJECTS) $(smp08_DEPENDENCIES)
+ @rm -f smp08$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp08/init.c:1.1
--- /dev/null Tue Jun 28 16:11:26 2011
+++ rtems/testsuites/smptests/smp08/init.c Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,97 @@
</font><font color='#000088'>+/*
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define CONFIGURE_INIT
+#include "system.h"
+
+void PrintTaskInfo(
+ const char *task_name,
+ rtems_time_of_day *_tb<span style="background-color: #FF0000"> </span>
+)
+{
+ int cpu_num;
+ rtems_status_code sc;
+
+ cpu_num = bsp_smp_processor_id();
+
+ /* Print the cpu number and task name */
+ locked_printf(
+ " CPU %d running task %s - rtems_clock_get_tod "
+ "%02" PRId32 ":%02" PRId32 ":%02" PRId32 " %02" PRId32<span style="background-color: #FF0000"> </span>
+ "/%02" PRId32 "/%04" PRId32 "\n",
+ cpu_num,
+ task_name,
+ _tb->hour, _tb->minute, _tb->second,<span style="background-color: #FF0000"> </span>
+ _tb->month, _tb->day, _tb->year
+ );<span style="background-color: #FF0000"> </span>
+}
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ rtems_time_of_day time;
+ int i;
+ char ch;
+ rtems_id id;
+<span style="background-color: #FF0000"> </span>
+ locked_print_initialize();
+ locked_printf( "\n\n*** SMP08 TEST ***\n" );
+
+ time.year = 1988;
+ time.month = 12;
+ time.day = 31;
+ time.hour = 9;
+ time.minute = 0;
+ time.second = 0;
+ time.ticks = 0;
+
+ status = rtems_clock_set( &time );
+
+ /* Create/verify synchronisation semaphore */
+ status = rtems_semaphore_create(
+ rtems_build_name ('S', 'E', 'M', '1'),
+ 1,<span style="background-color: #FF0000"> </span>
+ RTEMS_LOCAL |
+ RTEMS_SIMPLE_BINARY_SEMAPHORE |
+ RTEMS_PRIORITY,
+ 1,
+ &Semaphore
+ );
+ directive_failed( status, "rtems_semaphore_create" );
+
+ /* Show that the init task is running on this cpu */
+ PrintTaskInfo( "Init", &time );
+
+ for ( i=1; i <= rtems_smp_get_number_of_processors() *3; i++ ) {
+ ch = '0' + i;
+
+ status = rtems_task_create(
+ rtems_build_name( 'T', 'A', ch, ' ' ),
+ 1,
+ RTEMS_MINIMUM_STACK_SIZE,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &id
+ );
+ directive_failed( status, "task create" );
+
+ status = rtems_task_start( id, Test_task, i+1 );
+ directive_failed( status, "task start" );
+ }
+
+ status = rtems_task_delete( RTEMS_SELF );
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp08/smp08.doc:1.1
--- /dev/null Tue Jun 28 16:11:26 2011
+++ rtems/testsuites/smptests/smp08/smp08.doc Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,12 @@
</font><font color='#000088'>+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-1999.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp08/smp08.scn:1.1
--- /dev/null Tue Jun 28 16:11:26 2011
+++ rtems/testsuites/smptests/smp08/smp08.scn Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,16 @@
</font><font color='#000088'>+*** CLOCK TICK TEST ***
+TA1 - clock_get_tod - 09:00:00 12/31/1988
+TA2 - clock_get_tod - 09:00:00 12/31/1988
+TA3 - clock_get_tod - 09:00:00 12/31/1988
+TA1 - clock_get_tod - 09:00:05 12/31/1988
+TA1 - clock_get_tod - 09:00:10 12/31/1988
+TA2 - clock_get_tod - 09:00:10 12/31/1988
+TA1 - clock_get_tod - 09:00:15 12/31/1988
+TA3 - clock_get_tod - 09:00:15 12/31/1988
+TA1 - clock_get_tod - 09:00:20 12/31/1988
+TA2 - clock_get_tod - 09:00:20 12/31/1988
+TA1 - clock_get_tod - 09:00:25 12/31/1988
+TA1 - clock_get_tod - 09:00:30 12/31/1988
+TA2 - clock_get_tod - 09:00:30 12/31/1988
+TA3 - clock_get_tod - 09:00:30 12/31/1988
+*** END OF CLOCK TICK TEST ***
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp08/system.h:1.1
--- /dev/null Tue Jun 28 16:11:26 2011
+++ rtems/testsuites/smptests/smp08/system.h Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,56 @@
</font><font color='#000088'>+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#include "tmacros.h"
+#include "test_support.h"
+
+
+/* functions */
+
+rtems_task Init(
+ rtems_task_argument argument
+);
+
+rtems_task Test_task(
+ rtems_task_argument argument
+);
+
+/* configuration information */
+
+#include <bsp.h> /* for device driver prototypes */
+
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+
+#define CONFIGURE_SMP_APPLICATION
+#define CONFIGURE_SMP_MAXIMUM_PROCESSORS 4<span style="background-color: #FF0000"> </span>
+
+#define CONFIGURE_MAXIMUM_TASKS \
+ (1 + (CONFIGURE_SMP_MAXIMUM_PROCESSORS*3) )
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+#define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
+#define CONFIGURE_MAXIMUM_SEMAPHORES 1
+<span style="background-color: #FF0000"> </span>
+#include <rtems/confdefs.h>
+
+TEST_EXTERN rtems_id Semaphore; /* synchronisation semaphore */<span style="background-color: #FF0000"> </span>
+
+void PrintTaskInfo(
+ const char *task_name,
+ rtems_time_of_day *_tb<span style="background-color: #FF0000"> </span>
+);
+
+/* end of include file */
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp08/tasks.c:1.1
--- /dev/null Tue Jun 28 16:11:26 2011
+++ rtems/testsuites/smptests/smp08/tasks.c Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,59 @@
</font><font color='#000088'>+/* Test_task
+ *
+ * This routine serves as a test task. It verifies the basic task
+ * switching capabilities of the executive.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "system.h"
+
+rtems_task Test_task(
+ rtems_task_argument unused
+)
+{
+ rtems_id tid;
+ rtems_time_of_day time;
+ uint32_t task_index;
+ rtems_status_code status;
+ int cpu_num;
+ char name[5];
+ char *p;
+
+ /* Get the task name */
+ p = rtems_object_get_name( RTEMS_SELF, 5, name );
+ rtems_test_assert( p != NULL );
+
+ status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ task_index = task_number( tid );
+ for ( ; ; ) {
+
+ /* Get the CPU Number */
+ cpu_num = bsp_smp_processor_id();
+
+ status = rtems_clock_get_tod( &time );
+ if ( time.second >= 35 ) {
+ locked_printf( "*** END OF SMP08 TEST ***" );
+ rtems_test_exit( 0 );
+ }
+
+ PrintTaskInfo( p, &time );
+ status = rtems_task_wake_after(
+ task_index * 5 * rtems_clock_get_ticks_per_second() );
+ }
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp09/.cvsignore:1.1
--- /dev/null Tue Jun 28 16:11:26 2011
+++ rtems/testsuites/smptests/smp09/.cvsignore Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,2 @@
</font><font color='#000088'>+Makefile
+Makefile.in
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp09/Makefile.am:1.1
--- /dev/null Tue Jun 28 16:11:26 2011
+++ rtems/testsuites/smptests/smp09/Makefile.am Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,27 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = smp09
+smp09_SOURCES = init.c ../../support/src/locked_print.c
+
+dist_rtems_tests_DATA = smp09.scn
+dist_rtems_tests_DATA += smp09.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+AM_CPPFLAGS += -DSMPTEST<span style="background-color: #FF0000"> </span>
+
+LINK_OBJS = $(smp09_OBJECTS) $(smp09_LDADD)
+LINK_LIBS = $(smp09_LDLIBS)
+
+smp09$(EXEEXT): $(smp09_OBJECTS) $(smp09_DEPENDENCIES)
+ @rm -f smp09$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp09/init.c:1.1
--- /dev/null Tue Jun 28 16:11:26 2011
+++ rtems/testsuites/smptests/smp09/init.c Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,88 @@
</font><font color='#000088'>+/*
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#include <tmacros.h>
+#include "test_support.h"
+#include <rtems/cpuuse.h>
+
+volatile int killtime;
+
+rtems_task Test_task(
+ rtems_task_argument argument
+)
+{
+ while (1)
+ ;
+ /* XXX something goes here */
+}
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ int i;
+ char ch;
+ int cpu_num;
+ rtems_id id;
+ rtems_status_code status;
+
+ locked_print_initialize();
+ locked_printf( "\n\n*** TEST SMP09 ***\n" );
+
+ for ( killtime=0; killtime<1000000; killtime++ )
+ ;
+<span style="background-color: #FF0000"> </span>
+ for ( i=0; i<rtems_smp_get_number_of_processors() -1; i++ ) {
+ ch = '1' + i;
+
+ status = rtems_task_create(
+ rtems_build_name( 'T', 'A', ch, ' ' ),
+ 1,
+ RTEMS_MINIMUM_STACK_SIZE,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &id
+ );
+ directive_failed( status, "task create" );
+
+ cpu_num = bsp_smp_processor_id();
+ locked_printf(" CPU %d start task TA%c\n", cpu_num, ch);
+
+ status = rtems_task_start( id, Test_task, i+1 );
+ directive_failed( status, "task start" );
+ }
+
+ locked_printf(" kill 10 clock ticks\n" );
+ while ( rtems_clock_get_ticks_since_boot() < 10 )
+ ;
+
+ rtems_cpu_usage_report();
+
+ locked_printf( "*** END OF TEST SMP09 ***" );
+ rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_SMP_APPLICATION
+#define CONFIGURE_SMP_MAXIMUM_PROCESSORS 4
+
+#define CONFIGURE_MAXIMUM_TASKS \
+ (1 + CONFIGURE_SMP_MAXIMUM_PROCESSORS)
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp09/smp09.doc:1.1
--- /dev/null Tue Jun 28 16:11:26 2011
+++ rtems/testsuites/smptests/smp09/smp09.doc Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,22 @@
</font><font color='#000088'>+#
+# $Id$
+#
+# COPYRIGHT (c) 1989-2011.
+# On-Line Applications Research Corporation (OAR).
+#
+# The license and distribution terms for this file may be
+# found in the file LICENSE in this distribution or at
+# http://www.rtems.com/license/LICENSE.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: smp09
+
+directives:
+
+ + rtems_cpu_usage_report
+
+concepts:
+
++ Verify that CPU usage reporting is correct in an SMP configuration
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/smptests/smp09/smp09.scn:1.1
--- /dev/null Tue Jun 28 16:11:26 2011
+++ rtems/testsuites/smptests/smp09/smp09.scn Tue Jun 28 16:08:48 2011
</font><font color='#997700'>@@ -0,0 +1,22 @@
</font><font color='#000088'>+*** TEST SMP09 ***
+ CPU 0 start task TA1
+ CPU 0 start task TA2
+ CPU 0 start task TA3
+ kill 10 clock ticks
+-------------------------------------------------------------------------------
+ CPU USAGE BY THREAD
+------------+----------------------------------------+---------------+---------
+ ID | NAME | SECONDS | PERCENT
+------------+----------------------------------------+---------------+---------
+ 0x09010001 | IDLE | 0.000000 | 0.000
+ 0x09010002 | IDLE | 3.780012 | 15.060
+ 0x09010003 | IDLE | 26.961831 | 100.000
+ 0x09010004 | IDLE | 28.811601 | 100.000
+ 0x0A010001 | UI1 | 31.344809 | 100.000
+ 0x0A010002 | TA1 | 30.520797 | 88.979
+ 0x0A010003 | TA2 | 0.000000 | 0.000
+ 0x0A010004 | TA3 | 0.000000 | 0.000
+------------+----------------------------------------+---------------+---------
+ TIME SINCE LAST CPU USAGE RESET IN SECONDS: 39.731571
+-------------------------------------------------------------------------------
+*** END OF TEST SMP09 ***
</font></pre>
<p> </p>
<a name='cs7'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
<font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>
* configure.ac, support/include/test_support.h:
* support/src/locked_print.c: New file.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/ChangeLog.diff?r1=text&tr1=1.183&r2=text&tr2=1.184&diff_format=h">M</a></td><td width='1%'>1.184</td><td width='100%'>testsuites/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/configure.ac.diff?r1=text&tr1=1.30&r2=text&tr2=1.31&diff_format=h">M</a></td><td width='1%'>1.31</td><td width='100%'>testsuites/configure.ac</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/support/include/test_support.h.diff?r1=text&tr1=1.5&r2=text&tr2=1.6&diff_format=h">M</a></td><td width='1%'>1.6</td><td width='100%'>testsuites/support/include/test_support.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/support/src/locked_print.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/support/src/locked_print.c</font></td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/ChangeLog:1.183 rtems/testsuites/ChangeLog:1.184
--- rtems/testsuites/ChangeLog:1.183 Wed Apr 27 12:20:35 2011
+++ rtems/testsuites/ChangeLog Tue Jun 28 16:09:13 2011
</font><font color='#997700'>@@ -1,3 +1,8 @@
</font><font color='#000088'>+2011-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * configure.ac, support/include/test_support.h:
+ * support/src/locked_print.c: New file.
+
</font> 2011-04-27 Jennifer Averett <Jennifer.Averett@OARcorp.com>
PR 1784
<font color='#006600'>diff -u rtems/testsuites/configure.ac:1.30 rtems/testsuites/configure.ac:1.31
--- rtems/testsuites/configure.ac:1.30 Wed Apr 20 16:30:36 2011
+++ rtems/testsuites/configure.ac Tue Jun 28 16:09:13 2011
</font><font color='#997700'>@@ -25,6 +25,7 @@
</font> RTEMS_CHECK_CPUOPTS([RTEMS_POSIX_API])
RTEMS_CHECK_CPUOPTS([RTEMS_MULTIPROCESSING])
RTEMS_CHECK_CPUOPTS([RTEMS_NETWORKING])
<font color='#000088'>+RTEMS_CHECK_CPUOPTS([RTEMS_SMP])
</font>
case $enable_tests in
yes | samples )
<font color='#997700'>@@ -38,6 +39,9 @@
</font> if test "$rtems_cv_RTEMS_MULTIPROCESSING" = "yes"; then
AC_CONFIG_SUBDIRS(mptests)
fi
<font color='#000088'>+ if test "$rtems_cv_RTEMS_SMP" = "yes"; then
+ AC_CONFIG_SUBDIRS(smptests)
+ fi
</font> # Now do performance tests
AC_CONFIG_SUBDIRS(tmtests psxtmtests)
fi
<font color='#006600'>diff -u rtems/testsuites/support/include/test_support.h:1.5 rtems/testsuites/support/include/test_support.h:1.6
--- rtems/testsuites/support/include/test_support.h:1.5 Wed Jul 14 11:03:57 2010
+++ rtems/testsuites/support/include/test_support.h Tue Jun 28 16:09:13 2011
</font><font color='#997700'>@@ -1,5 +1,5 @@
</font> /*
<font color='#880000'>- * COPYRIGHT (c) 1989-2010.
</font><font color='#000088'>+ * COPYRIGHT (c) 1989-2011.
</font> * On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
<font color='#997700'>@@ -80,6 +80,15 @@
</font> int overhead
);
<font color='#000088'>+/*********************************************************************/
+/*********************************************************************/
+/************** TEST SUPPORT **************/
+/*********************************************************************/
+/*********************************************************************/
+extern void locked_print_init(void);
+extern void locked_printf(const char *fmt, ...);
+extern void locked_printk(const char *fmt, ...);
+
</font> #ifdef __cplusplus
};
#endif
<font color='#006600'>diff -u /dev/null rtems/testsuites/support/src/locked_print.c:1.1
--- /dev/null Tue Jun 28 16:11:27 2011
+++ rtems/testsuites/support/src/locked_print.c Tue Jun 28 16:09:13 2011
</font><font color='#997700'>@@ -0,0 +1,87 @@
</font><font color='#000088'>+/*<span style="background-color: #FF0000"> </span>
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems.h>
+#include <rtems/system.h>
+#include <sys/types.h>
+#include <string.h>
+#include <stdarg.h>
+
+#include "tmacros.h"
+
+static rtems_id locked_print_semaphore; /* synchronisation semaphore */<span style="background-color: #FF0000"> </span>
+
+void locked_print_initialize(void)
+{
+ rtems_status_code sc;
+ static bool initted = false;
+
+ if ( initted )
+ return;
+
+ initted = true;
+
+ /* Create/verify synchronisation semaphore */
+ sc = rtems_semaphore_create(
+ rtems_build_name ('S', 'E', 'M', '1'),
+ 1,<span style="background-color: #FF0000"> </span>
+ RTEMS_LOCAL |
+ RTEMS_SIMPLE_BINARY_SEMAPHORE |
+ RTEMS_PRIORITY,
+ 1,
+ &locked_print_semaphore
+ );
+ directive_failed( sc, "rtems_semaphore_create" );
+}
+
+void locked_printf(const char *fmt, ...) {
+ va_list ap; /* points to each unnamed argument in turn */
+ rtems_status_code sc;
+
+ locked_print_initialize();
+
+ /* Lock semaphore without releasing the cpu */
+ do {
+ sc = rtems_semaphore_obtain( locked_print_semaphore, RTEMS_NO_WAIT, 0 );
+ } while (sc != RTEMS_SUCCESSFUL );
+
+
+ va_start(ap, fmt); /* make ap point to 1st unnamed arg */
+ vprintf(fmt, ap);
+ va_end(ap); /* clean up when done */
+
+ /* Release the semaphore */
+ sc = rtems_semaphore_release( locked_print_semaphore );
+}<span style="background-color: #FF0000"> </span>
+
+void locked_printk(const char *fmt, ...) {
+ va_list ap; /* points to each unnamed argument in turn */
+ rtems_status_code sc;
+
+
+ locked_print_initialize();
+
+ /* Lock semaphore without releasing the cpu */
+ do {
+ sc = rtems_semaphore_obtain( locked_print_semaphore, RTEMS_NO_WAIT, 0 );
+ } while (sc != RTEMS_SUCCESSFUL );
+
+ va_start(ap, fmt); /* make ap point to 1st unnamed arg */
+ vprintk(fmt, ap);
+ va_end(ap); /* clean up when done */
+
+ /* Release the semaphore */
+ sc = rtems_semaphore_release( locked_print_semaphore );
+}<span style="background-color: #FF0000"> </span>
</font></pre>
<p> </p>
<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>