Re: [PATCH] score/or1k/cpu.c: discard linker-symbols.h include and extern the related variable

2015-02-11 Thread Sebastian Huber


On 10/02/15 23:12, Joel Sherrill wrote:

On 2/10/2015 3:46 PM, Peter Dufault wrote:

>>On Feb 10, 2015, at 15:30 , Joel Sherrill  wrote:
>>
>>On 2/10/2015 2:26 PM, Hesham Moustafa wrote:

>>>On Tue, Feb 10, 2015 at 8:21 PM, Joel Sherrill
>>>  wrote:

Thanks. One down.

Crap. It should have had a comment that closed the PR.:(

>>>Who should add the comment? The ticket is now closed (fixed). In the
>>>future patches, should I tag the ticket/PR number part of the commit
>>>message?

>>I think the procedure is to use the git commit message like this:
>>
>>===
>>or1k/cpu.c: Eliminate dependency on BSP provided .h file
>>
>>close 
>>===
>>
>>You just posted a patch and I did remember to add the --author
>>info but forgot the PR.

On 2/10/2015 2:04 PM, Hesham ALMatary wrote:

>---
>cpukit/score/cpu/or1k/cpu.c | 7 ++-
>1 file changed, 6 insertions(+), 1 deletion(-)
>
>diff --git a/cpukit/score/cpu/or1k/cpu.c b/cpukit/score/cpu/or1k/cpu.c
>index 9d1ae49..69845ff 100644
>--- a/cpukit/score/cpu/or1k/cpu.c
>+++ b/cpukit/score/cpu/or1k/cpu.c
>@@ -14,9 +14,14 @@
>#include 
>#include 
>#include 
>-#include 
>#include 
>
>+/* bsp_start_vector_table_begin is the start address of the vector table
>+ * containing addresses to ISR Handlers. It's defined at the BSP linkcmds
>+ * and may differ from one BSP to another.
>+ */
>+extern char bsp_start_vector_table_begin[];
>+
>/**
>  * @brief Performs processor dependent initialization.
>  */
>-- 2.1.0

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


>I'm not sure what it fixes, but removing a header file and putting an "extern" 
declaration in a C file instead needs to be explained in a comment.  In general that's 
moving backwards, I guess the comment implies something (that it may differ from one BSP to 
another), but since an extern in C code is bad practice it should be better explained.

The overarching rule is that code in cpukit/ SHALL not include anything
from the BSP.

It possibly could be moved to cpu.h or a port provided file that defines
the symbols expected to be provided by the BSP.

I am happy with anything that moves us in a better direction. This was
breaking the dependency.



In case the cpukit depends on this, then this symbol should go into 
cpu.h with a _OR1K_ prefix.


--
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


[PATCH 1/2] lpc1768_mbed-testsuite.tcfg: Add ftp01

2015-02-11 Thread Joel Sherrill
---
 c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed-testsuite.tcfg | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed-testsuite.tcfg 
b/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed-testsuite.tcfg
index 2a7d71b..851f938 100644
--- a/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed-testsuite.tcfg
+++ b/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed-testsuite.tcfg
@@ -5,6 +5,7 @@
 #
 
 flashdisk01
+ftp01
 utf8proc01
 spstkalloc02
 fsdosfsname01
-- 
1.9.3

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


[PATCH 2/2] lpc1768_mbed_ahb_ram_eth-testsuite.tcfg: Add ftp01

2015-02-11 Thread Joel Sherrill
---
 .../arm/lpc176x/make/custom/lpc1768_mbed_ahb_ram_eth-testsuite.tcfg  | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed_ahb_ram_eth-testsuite.tcfg
 
b/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed_ahb_ram_eth-testsuite.tcfg
index 8c5e239..5d61685 100644
--- 
a/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed_ahb_ram_eth-testsuite.tcfg
+++ 
b/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed_ahb_ram_eth-testsuite.tcfg
@@ -5,6 +5,7 @@
 #
 
 fileio
+ftp01
 cdtest
 flashdisk01
 fsdosfsname01
-- 
1.9.3

___
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-11 Thread Chris Johns

On 12/02/2015 2:34 am, 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

---

  testsuites/smptests/Makefile.am   |   1 +
  testsuites/smptests/configure.ac  |   1 +
  testsuites/smptests/smpcapture02/Makefile.am  |  19 +
  testsuites/smptests/smpcapture02/init.c   | 425 ++
  testsuites/smptests/smpcapture02/smpcapture02.doc |  30 ++
  testsuites/smptests/smpcapture02/smpcapture02.scn |   2 +
  6 files changed, 478 insertions(+)

diff --git a/testsuites/smptests/Makefile.am b/testsuites/smptests/Makefile.am
index 87c3d7f..4b81a20 100644
--- a/testsuites/smptests/Makefile.am
+++ b/testsuites/smptests/Makefile.am
@@ -13,6 +13,7 @@ SUBDIRS += smpaffinity01
  SUBDIRS += smpatomic01
  SUBDIRS += smpcache01
  SUBDIRS += smpcapture01
+SUBDIRS += smpcapture02
  SUBDIRS += smpfatal01
  SUBDIRS += smpfatal02
  SUBDIRS += smpfatal03
diff --git a/testsuites/smptests/configure.ac b/testsuites/smptests/configure.ac
index f25c9d7..5aee6ec 100644
--- a/testsuites/smptests/configure.ac
+++ b/testsuites/smptests/configure.ac
@@ -68,6 +68,7 @@ smpaffinity01/Makefile
  smpatomic01/Makefile
  smpcache01/Makefile
  smpcapture01/Makefile
+smpcapture02/Makefile
  smpfatal01/Makefile
  smpfatal02/Makefile
  smpfatal03/Makefile
diff --git a/testsuites/smptests/smpcapture02/Makefile.am 
b/testsuites/smptests/smpcapture02/Makefile.am
new file mode 100644
index 000..d7a172c
--- /dev/null
+++ b/testsuites/smptests/smpcapture02/Makefile.am
@@ -0,0 +1,19 @@
+rtems_tests_PROGRAMS = smpcapture02
+smpcapture02_SOURCES = init.c
+
+dist_rtems_tests_DATA = smpcapture02.scn smpcapture02.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
+
+LINK_OBJS = $(smpcapture02_OBJECTS)
+LINK_LIBS = $(smpcapture02_LDLIBS)
+
+smpcapture02$(EXEEXT): $(smpcapture02_OBJECTS) $(smpcapture02_DEPENDENCIES)
+   @rm -f smpcapture02$(EXEEXT)
+   $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/smptests/smpcapture02/init.c 
b/testsuites/smptests/smpcapture02/init.c
new file mode 100644
index 000..bd912ee
--- /dev/null
+++ b/testsuites/smptests/smpcapture02/init.c
@@ -0,0 +1,425 @@
+/*
+ *  COPYRIGHT (c) 2015
+ *  Cobham Gaisler
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.org/license/LICENSE.
+ */
+
+/*
+ * SMP Capture Test 2
+ *
+ * This program tests the functionality to add custom entries to
+ * the SMP capture trace.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include 
+#include 
+#include 
+#include "tmacros.h"
+
+const char rtems_test_name[] = "SMPCAPTURE 2";
+
+#define MAX_CPUS   4
+#define TASKS_PER_CPU  5
+#define ITERATIONS 3
+#define TASK_PRIO  30
+#define CLOCK_TICKS100
+
+typedef struct  {
+  rtems_id id;
+  rtems_id task_sem;
+  rtems_id prev_sem;
+} task_data_t;
+
+typedef struct {
+  bool found;
+  const char *info;
+  rtems_option options;
+  rtems_interrupt_handler handler;
+  void *arg;
+} clock_interrupt_handler;
+
+static rtems_id finished_sem;
+static task_data_t task_data[ TASKS_PER_CPU * TASKS_PER_CPU ];
+static rtems_interrupt_handler org_clock_handler;
+
+enum cap_rec_types {
+  enter_add_number,
+  exit_add_number,
+  clock_tick
+};
+
+/*
+ * These records define the data stored in the capture trace.
+ * The records must be 64-bit aligned to make sure that the time
+ * attribute in rtems_capture_record_t is correctly aligned.
+ */


Daniel(s), could enlighten me why this is needed ? Is this a arch 
constraint or something else ?


Chris


+typedef struct {
+  enum cap_rec_types id;
+  uint32_t a;
+  uint32_t b;
+} __attribute__ ((aligned (8))) enter_add_number_record_t;
+
+typedef struct {
+  enum cap_rec_types id;
+  uint32_t res;
+} __attribute__ ((aligned (8))) exit_add_number_record_t;
+
+typedef struct {
+  enum cap_rec_types id;
+  void *arg;
+} __attribute__ ((aligned (8))) clock_tick_record_t;
+
+typedef struct {
+  enum cap_rec_types id;
+} empty_record_t ;
+
+/*
+ * The function that we want to trace
+ */
+static uint32_t add_number(uint32_t a, uint32_t b)
+{
+  return a+b;
+}
+
+/*
+ * The wrapper for the function we want to trace. Records
+ * input arguments and the result to the capture trace.
+ */
+static uint32_t add_number_wrapper(uint32_t a, uint32_t b)
+{
+  enter_add_number_record_t enter_rec;
+  exit_add_number_record_t exit_rec;
+  uint32_t res;
+  void* rec;
+
+  enter_rec.id = enter_add_number;
+  enter_rec.a = a;
+  enter_rec