[PATCH] score: Add _CPU_SMP_Prepare_start_multitasking()

2015-02-16 Thread Sebastian Huber
Update #2268.
---
 c/src/lib/libbsp/arm/shared/arm-a9mpcore-smp.c  |  5 +
 c/src/lib/libbsp/powerpc/qoriq/startup/bspsmp.c |  5 +
 c/src/lib/libbsp/shared/bspsmp.c|  4 
 c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c   | 13 +
 cpukit/score/cpu/arm/rtems/score/cpu.h  |  2 ++
 cpukit/score/cpu/i386/rtems/score/cpu.h |  2 ++
 cpukit/score/cpu/no_cpu/rtems/score/cpu.h   | 12 
 cpukit/score/cpu/powerpc/rtems/score/cpu.h  |  2 ++
 cpukit/score/cpu/sparc/rtems/score/cpu.h|  8 ++--
 cpukit/score/src/threadstartmultitasking.c  |  2 ++
 testsuites/smptests/smpfatal08/init.c   | 12 +---
 11 files changed, 46 insertions(+), 21 deletions(-)

diff --git a/c/src/lib/libbsp/arm/shared/arm-a9mpcore-smp.c 
b/c/src/lib/libbsp/arm/shared/arm-a9mpcore-smp.c
index f755621..f2c0201 100644
--- a/c/src/lib/libbsp/arm/shared/arm-a9mpcore-smp.c
+++ b/c/src/lib/libbsp/arm/shared/arm-a9mpcore-smp.c
@@ -55,6 +55,11 @@ void _CPU_SMP_Finalize_initialization(uint32_t cpu_count)
   }
 }
 
+void _CPU_SMP_Prepare_start_multitasking( void )
+{
+  /* Do nothing */
+}
+
 void _CPU_SMP_Send_interrupt( uint32_t target_processor_index )
 {
   arm_gic_irq_generate_software_irq(
diff --git a/c/src/lib/libbsp/powerpc/qoriq/startup/bspsmp.c 
b/c/src/lib/libbsp/powerpc/qoriq/startup/bspsmp.c
index 80764fe..0b0743b 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/startup/bspsmp.c
+++ b/c/src/lib/libbsp/powerpc/qoriq/startup/bspsmp.c
@@ -228,6 +228,11 @@ void _CPU_SMP_Finalize_initialization(uint32_t cpu_count)
   }
 }
 
+void _CPU_SMP_Prepare_start_multitasking(void)
+{
+  /* Do nothing */
+}
+
 void _CPU_SMP_Send_interrupt(uint32_t target_processor_index)
 {
   qoriq.pic.ipidr [IPI_INDEX].reg = 1U << target_processor_index;
diff --git a/c/src/lib/libbsp/shared/bspsmp.c b/c/src/lib/libbsp/shared/bspsmp.c
index 3dc44b1..f243940 100644
--- a/c/src/lib/libbsp/shared/bspsmp.c
+++ b/c/src/lib/libbsp/shared/bspsmp.c
@@ -26,6 +26,10 @@ void _CPU_SMP_Finalize_initialization( uint32_t cpu_count )
 {
 }
 
+void _CPU_SMP_Prepare_start_multitasking( void )
+{
+}
+
 void _CPU_SMP_Send_interrupt( uint32_t target_processor_index )
 {
 }
diff --git a/c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c 
b/c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c
index ec83e31..ef9cd39 100644
--- a/c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c
+++ b/c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c
@@ -86,16 +86,13 @@ void _CPU_SMP_Finalize_initialization( uint32_t cpu_count )
   /* Nothing to do */
 }
 
-void _CPU_SMP_Send_interrupt(uint32_t target_processor_index)
+void _CPU_SMP_Prepare_start_multitasking( void )
 {
-  /* send interrupt to destination CPU */
-  LEON3_IrqCtrl_Regs->force[target_processor_index] = 1 << LEON3_mp_irq;
+  _CPU_cache_invalidate_entire_instruction();
 }
 
-void _LEON3_Start_multitasking(
-  Context_Control *heir
-)
+void _CPU_SMP_Send_interrupt(uint32_t target_processor_index)
 {
-  _CPU_cache_invalidate_entire_instruction();
-  _CPU_Context_Restart_self( heir );
+  /* send interrupt to destination CPU */
+  LEON3_IrqCtrl_Regs->force[target_processor_index] = 1 << LEON3_mp_irq;
 }
diff --git a/cpukit/score/cpu/arm/rtems/score/cpu.h 
b/cpukit/score/cpu/arm/rtems/score/cpu.h
index 869ab1c..f0573c2 100644
--- a/cpukit/score/cpu/arm/rtems/score/cpu.h
+++ b/cpukit/score/cpu/arm/rtems/score/cpu.h
@@ -504,6 +504,8 @@ void _CPU_Context_validate( uintptr_t pattern );
 
   void _CPU_SMP_Finalize_initialization( uint32_t cpu_count );
 
+  void _CPU_SMP_Prepare_start_multitasking( void );
+
   static inline uint32_t _CPU_SMP_Get_current_processor( void )
   {
 uint32_t mpidr;
diff --git a/cpukit/score/cpu/i386/rtems/score/cpu.h 
b/cpukit/score/cpu/i386/rtems/score/cpu.h
index 13d31a4..5639fdf 100644
--- a/cpukit/score/cpu/i386/rtems/score/cpu.h
+++ b/cpukit/score/cpu/i386/rtems/score/cpu.h
@@ -494,6 +494,8 @@ uint32_t   _CPU_ISR_Get_level( void );
 
   void _CPU_SMP_Finalize_initialization( uint32_t cpu_count );
 
+  void _CPU_SMP_Prepare_start_multitasking( void );
+
   uint32_t _CPU_SMP_Get_current_processor( void );
 
   void _CPU_SMP_Send_interrupt( uint32_t target_processor_index );
diff --git a/cpukit/score/cpu/no_cpu/rtems/score/cpu.h 
b/cpukit/score/cpu/no_cpu/rtems/score/cpu.h
index 0a0cc41..c4e838b 100644
--- a/cpukit/score/cpu/no_cpu/rtems/score/cpu.h
+++ b/cpukit/score/cpu/no_cpu/rtems/score/cpu.h
@@ -1574,6 +1574,18 @@ register struct Per_CPU_Control *_CPU_Per_CPU_current 
asm( "rX" );
   void _CPU_SMP_Finalize_initialization( uint32_t cpu_count );
 
   /**
+   * @brief Prepares a CPU to start multitasking in terms of SMP.
+   *
+   * This function is invoked on all processors requested by the application
+   * during system initialization.
+   *
+   * This function will be called after all processors requested by the
+   * application have been started right before the context switch to the first
+   * thread takes place.
+   */
+  void _CPU_SMP_Prepare_star

Re: [rtems commit] smpcapture02: Add test of functionality to add custom entries to capture trace

2015-02-16 Thread Sebastian Huber

This test fails on my NGMP board with:

*** BEGIN OF TEST SMPCAPTURE 2 ***
rtems-4.11/c/src/../../testsuites/smptests/smpcapture02/init.c: 337 
recs->time>=prev_rec->time


On 11/02/15 16:34, Daniel Hellstrom wrote:

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

Author:Daniel Cederman 
Date:  Wed Feb  4 10:04:05 2015 +0100

smpcapture02: Add test of functionality to add custom entries to capture trace


--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [rtems commit] smpcapture02: Add test of functionality to add custom entries to capture trace

2015-02-16 Thread Daniel Cederman

Hi,

Yes, that is, I think, due to the problem described in ticket #2180 
"_TOD_Get_with_nanoseconds() is broken on SMP". I have a small hack that 
fixes the problem for Leon processors and then the test passes.



On 2015-02-16 13:12, Sebastian Huber wrote:

This test fails on my NGMP board with:

*** BEGIN OF TEST SMPCAPTURE 2 ***
rtems-4.11/c/src/../../testsuites/smptests/smpcapture02/init.c: 337
recs->time>=prev_rec->time

On 11/02/15 16:34, Daniel Hellstrom wrote:

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


Author:Daniel Cederman 
Date:  Wed Feb  4 10:04:05 2015 +0100

smpcapture02: Add test of functionality to add custom entries to
capture trace




--
Daniel Cederman
Software Engineer
Cobham Gaisler
daniel.ceder...@gaisler.com

Cobham Gaisler AB, Kungsgatan 12, SE-411 19, GÖTEBORG, Sweden.
+46 (0) 31 775 8650, www.cobham.com/gaisler

Please consider the environment before printing this email

This e-mail and any files transmitted with it ("E-mail") is intended 
solely for the addressee(s) and may contain confidential and/or legally 
privileged information. If you are not the addressee(s), any disclosure,
reproduction, copying, distribution or other use of the E-mail is 
prohibited. If you have received this E-mail in error, please delete it 
and notify the sender immediately via our switchboard or return e-mail.


Neither the company nor any subsidiary or affiliate or associated 
company nor any individual sending this Email accepts any liability in 
respect of the content (including errors and omissions) nor shall this 
e-mail be deemed to enter the company or any subsidiary or affiliate or 
associated company into a contract or to create any legally binding 
obligations unless expressly agreed to in writing under separate cover 
and timeliness of the E-mail which arise as a result of transmission. If 
verification is required, please request a hard copy version from the 
sender.

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [rtems commit] smpcapture02: Add test of functionality to add custom entries to capture trace

2015-02-16 Thread Sebastian Huber


On 16/02/15 13:29, Daniel Cederman wrote:

Hi,

Yes, that is, I think, due to the problem described in ticket #2180 
"_TOD_Get_with_nanoseconds() is broken on SMP". I have a small hack 
that fixes the problem for Leon processors and then the test passes. 


Ok, thanks for the hint.

We have now a budget to fix this bug properly (three months time frame). 
I will add some tickets related to this in the next couple of days.


--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [rtems commit] smpcapture02: Add test of functionality to add custom entries to capture trace

2015-02-16 Thread Joel Sherrill

On 2/16/2015 7:05 AM, Sebastian Huber wrote:
> On 16/02/15 13:29, Daniel Cederman wrote:
>> Hi,
>>
>> Yes, that is, I think, due to the problem described in ticket #2180 
>> "_TOD_Get_with_nanoseconds() is broken on SMP". I have a small hack 
>> that fixes the problem for Leon processors and then the test passes. 
> Ok, thanks for the hint.
>
> We have now a budget to fix this bug properly (three months time frame). 
> I will add some tickets related to this in the next couple of days.
>
I changed the component on 2180 to SMP so it shows up in queries for SMP
issues.

-- 
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherr...@oarcorp.comOn-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available(256) 722-9985

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Starting with RTEMS

2015-02-16 Thread Rohini Kulkarni
Hi,

I am trying to build RTEMS for arm. I want to know what --enable -rtemsbsp
in config does, when building RTEMS.

Thank you.

-- 
Rohini Kulkarni
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Starting with RTEMS

2015-02-16 Thread Nick Withers
On Mon, 2015-02-16 at 22:57 +0530, Rohini Kulkarni wrote:
> Hi,
> 
> 
> I am trying to build RTEMS for arm. I want to know what --enable
> -rtemsbsp in config does, when building RTEMS.

Hi Rohini!

It selects which Board Support Package(s) (BSP(s)) you'd like to compile
RTEMS for - or, if you prefer, which BSPs' code should be compiled - it
takes a while for each and building the lot is almost always going to be
unnecessary.

There're a lot of different ARM variants and boards, what kind do you
have?

P.S., As a "could you help be to use this" kind o' question, this one'd
probably be best on the users@ list :-)

> Thank you.
> 
> -- 
> Rohini Kulkarni
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: Starting with RTEMS

2015-02-16 Thread Joel Sherrill

On 2/16/2015 6:33 PM, Nick Withers wrote:
> On Mon, 2015-02-16 at 22:57 +0530, Rohini Kulkarni wrote:
>> Hi,
>>
>>
>> I am trying to build RTEMS for arm. I want to know what --enable
>> -rtemsbsp in config does, when building RTEMS.
> Hi Rohini!
>
> It selects which Board Support Package(s) (BSP(s)) you'd like to compile
> RTEMS for - or, if you prefer, which BSPs' code should be compiled - it
> takes a while for each and building the lot is almost always going to be
> unnecessary.
>
> There're a lot of different ARM variants and boards, what kind do you
> have?
>
> P.S., As a "could you help be to use this" kind o' question, this one'd
> probably be best on the users@ list :-)
Good answer and I will pitch in that for many cases, you want one that will
run on a simulator. Especially if you are looking at potential GSoC
projects. :)
>> Thank you.
>>
>> -- 
>> Rohini Kulkarni
>> ___
>> devel mailing list
>> devel@rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel
>
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel

-- 
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherr...@oarcorp.comOn-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available(256) 722-9985

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel