Re: Use GCC 11 for RTEMS 6?

2021-05-02 Thread Chris Johns
On 3/5/21 3:08 pm, Sebastian Huber wrote:
> 
> GCC 11 was released recently:
> 
> https://gcc.gnu.org/gcc-11/changes.html
> 
> Should we switch to this version for RTEMS 6 in the RSB?
> 

Do we have build reports on our supported host platforms?

I would like to clear confirmation we can build the tools and there are no
regressions on tier 1 BSPs and archs.

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


Use GCC 11 for RTEMS 6?

2021-05-02 Thread Sebastian Huber

Hello,

GCC 11 was released recently:

https://gcc.gnu.org/gcc-11/changes.html

Should we switch to this version for RTEMS 6 in the RSB?

--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/

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

[PATCH] rtems: Use allocator mutex for timer server

2021-05-02 Thread Sebastian Huber
The allocator mutex is recursive and already used for the task creation
in rtems_timer_initiate_server().  Just use this mutex instead of the
once mutex to serialize the initialization.  This avoids a dependency on
condition variables which are not used here.
---
 cpukit/rtems/src/timerserver.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/cpukit/rtems/src/timerserver.c b/cpukit/rtems/src/timerserver.c
index 3c994933cd..28b77e5635 100644
--- a/cpukit/rtems/src/timerserver.c
+++ b/cpukit/rtems/src/timerserver.c
@@ -24,7 +24,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 static Timer_server_Control _Timer_server_Default;
@@ -225,11 +224,10 @@ rtems_status_code rtems_timer_initiate_server(
 )
 {
   rtems_status_code status;
-  Thread_Life_state thread_life_state;
 
-  thread_life_state = _Once_Lock();
+  _Objects_Allocator_lock();
   status = _Timer_server_Initiate( priority, stack_size, attribute_set );
-  _Once_Unlock( thread_life_state );
+  _Objects_Allocator_unlock();
 
   return status;
 }
-- 
2.26.2

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


Re: [PATCH] libtest: Fix use of flexible array member

2021-05-02 Thread Sebastian Huber

On 02/05/2021 21:24, Joel Sherrill wrote:



On Sun, May 2, 2021, 2:01 PM Sebastian Huber 
> wrote:


Flexible array members must not appear in the middle of a structure.


Any idea why this doesn't generate a warning? I thought this 
restriction is well known.
Flexible array members in the middle of a structure are a GCC/clang 
extension. You only get a warning with -pedantic.


--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/

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

Re: [PATCH] libtest: Fix use of flexible array member

2021-05-02 Thread Joel Sherrill
On Sun, May 2, 2021, 2:01 PM Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> Flexible array members must not appear in the middle of a structure.
>

Any idea why this doesn't generate a warning? I thought this restriction is
well known.

---
>  cpukit/include/rtems/test.h   | 18 +---
>  cpukit/libtest/t-test-thread-switch.c | 24 ++---
>  testsuites/libtests/ttest02/init.c| 30 +--
>  3 files changed, 37 insertions(+), 35 deletions(-)
>
> diff --git a/cpukit/include/rtems/test.h b/cpukit/include/rtems/test.h
> index 10ff665107..f95433bc7c 100644
> --- a/cpukit/include/rtems/test.h
> +++ b/cpukit/include/rtems/test.h
> @@ -89,10 +89,8 @@ typedef struct T_fixture_node {
>
>  #if defined(__GNUC__) || __STDC_VERSION__ >= 199409L
>  #define T_ZERO_LENGTH_ARRAY
> -#define T_ZERO_LENGTH_ARRAY_EXTENSION(n) (n)
>  #else
>  #define T_ZERO_LENGTH_ARRAY 1
> -#define T_ZERO_LENGTH_ARRAY_EXTENSION(n) ((n) - 1)
>  #endif
>
>  /** @} */
> @@ -2434,22 +2432,26 @@ typedef struct {
> size_t recorded;
> size_t capacity;
> uint64_t switches;
> +} T_thread_switch_header;
> +
> +typedef struct {
> +   T_thread_switch_header header;
> T_thread_switch_event events[T_ZERO_LENGTH_ARRAY];
>  } T_thread_switch_log;
>
>  typedef struct {
> -   T_thread_switch_log log;
> -   T_thread_switch_event events[T_ZERO_LENGTH_ARRAY_EXTENSION(2)];
> +   T_thread_switch_header header;
> +   T_thread_switch_event events[2];
>  } T_thread_switch_log_2;
>
>  typedef struct {
> -   T_thread_switch_log log;
> -   T_thread_switch_event events[T_ZERO_LENGTH_ARRAY_EXTENSION(4)];
> +   T_thread_switch_header header;
> +   T_thread_switch_event events[4];
>  } T_thread_switch_log_4;
>
>  typedef struct {
> -   T_thread_switch_log log;
> -   T_thread_switch_event events[T_ZERO_LENGTH_ARRAY_EXTENSION(10)];
> +   T_thread_switch_header header;
> +   T_thread_switch_event events[10];
>  } T_thread_switch_log_10;
>
>  T_thread_switch_log *T_thread_switch_record(T_thread_switch_log *);
> diff --git a/cpukit/libtest/t-test-thread-switch.c
> b/cpukit/libtest/t-test-thread-switch.c
> index 87ad4651fc..60179aaa40 100644
> --- a/cpukit/libtest/t-test-thread-switch.c
> +++ b/cpukit/libtest/t-test-thread-switch.c
> @@ -96,11 +96,11 @@ T_thread_switch_recorder(Thread_Control *executing,
> Thread_Control *heir)
> if (log != NULL) {
> size_t recorded;
>
> -   ++log->switches;
> -   recorded = log->recorded;
> +   ++log->header.switches;
> +   recorded = log->header.recorded;
>
> -   if (recorded < log->capacity) {
> -   log->recorded = recorded + 1;
> +   if (recorded < log->header.capacity) {
> +   log->header.recorded = recorded + 1;
> log->events[recorded].executing =
> executing->Object.id;
> log->events[recorded].heir = heir->Object.id;
> log->events[recorded].cpu =
> @@ -127,8 +127,8 @@ T_thread_switch_record(T_thread_switch_log *log)
> }
>
> if (log != NULL) {
> -   log->recorded = 0;
> -   log->switches = 0;
> +   log->header.recorded = 0;
> +   log->header.switches = 0;
> }
>
> rtems_interrupt_lock_acquire(>lock, _context);
> @@ -142,20 +142,20 @@ T_thread_switch_record(T_thread_switch_log *log)
>  T_thread_switch_log *
>  T_thread_switch_record_2(T_thread_switch_log_2 *log)
>  {
> -   log->log.capacity = 2;
> -   return T_thread_switch_record(>log);
> +   log->header.capacity = T_ARRAY_SIZE(log->events);
> +   return T_thread_switch_record((T_thread_switch_log *)log);
>  }
>
>  T_thread_switch_log *
>  T_thread_switch_record_4(T_thread_switch_log_4 *log)
>  {
> -   log->log.capacity = 4;
> -   return T_thread_switch_record(>log);
> +   log->header.capacity = T_ARRAY_SIZE(log->events);
> +   return T_thread_switch_record((T_thread_switch_log *)log);
>  }
>
>  T_thread_switch_log *
>  T_thread_switch_record_10(T_thread_switch_log_10 *log)
>  {
> -   log->log.capacity = 10;
> -   return T_thread_switch_record(>log);
> +   log->header.capacity = T_ARRAY_SIZE(log->events);
> +   return T_thread_switch_record((T_thread_switch_log *)log);
>  }
> diff --git a/testsuites/libtests/ttest02/init.c
> b/testsuites/libtests/ttest02/init.c
> index 7f972aec7e..4d540c9a86 100644
> --- a/testsuites/libtests/ttest02/init.c
> +++ b/testsuites/libtests/ttest02/init.c
> @@ -222,23 +222,23 @@ T_TEST_CASE(TestThreadSwitch)
> memset(_2, 0xff, sizeof(log_2));
> log = T_thread_switch_record_2(_2);
> T_null(log);
> -   T_eq_sz(log_2.log.recorded, 0);
> -   T_eq_sz(log_2.log.capacity, 2);
> -   T_eq_u64(log_2.log.switches, 0);
> +   T_eq_sz(log_2.header.recorded, 

[PATCH] libtest: Fix use of flexible array member

2021-05-02 Thread Sebastian Huber
Flexible array members must not appear in the middle of a structure.
---
 cpukit/include/rtems/test.h   | 18 +---
 cpukit/libtest/t-test-thread-switch.c | 24 ++---
 testsuites/libtests/ttest02/init.c| 30 +--
 3 files changed, 37 insertions(+), 35 deletions(-)

diff --git a/cpukit/include/rtems/test.h b/cpukit/include/rtems/test.h
index 10ff665107..f95433bc7c 100644
--- a/cpukit/include/rtems/test.h
+++ b/cpukit/include/rtems/test.h
@@ -89,10 +89,8 @@ typedef struct T_fixture_node {
 
 #if defined(__GNUC__) || __STDC_VERSION__ >= 199409L
 #define T_ZERO_LENGTH_ARRAY
-#define T_ZERO_LENGTH_ARRAY_EXTENSION(n) (n)
 #else
 #define T_ZERO_LENGTH_ARRAY 1
-#define T_ZERO_LENGTH_ARRAY_EXTENSION(n) ((n) - 1)
 #endif
 
 /** @} */
@@ -2434,22 +2432,26 @@ typedef struct {
size_t recorded;
size_t capacity;
uint64_t switches;
+} T_thread_switch_header;
+
+typedef struct {
+   T_thread_switch_header header;
T_thread_switch_event events[T_ZERO_LENGTH_ARRAY];
 } T_thread_switch_log;
 
 typedef struct {
-   T_thread_switch_log log;
-   T_thread_switch_event events[T_ZERO_LENGTH_ARRAY_EXTENSION(2)];
+   T_thread_switch_header header;
+   T_thread_switch_event events[2];
 } T_thread_switch_log_2;
 
 typedef struct {
-   T_thread_switch_log log;
-   T_thread_switch_event events[T_ZERO_LENGTH_ARRAY_EXTENSION(4)];
+   T_thread_switch_header header;
+   T_thread_switch_event events[4];
 } T_thread_switch_log_4;
 
 typedef struct {
-   T_thread_switch_log log;
-   T_thread_switch_event events[T_ZERO_LENGTH_ARRAY_EXTENSION(10)];
+   T_thread_switch_header header;
+   T_thread_switch_event events[10];
 } T_thread_switch_log_10;
 
 T_thread_switch_log *T_thread_switch_record(T_thread_switch_log *);
diff --git a/cpukit/libtest/t-test-thread-switch.c 
b/cpukit/libtest/t-test-thread-switch.c
index 87ad4651fc..60179aaa40 100644
--- a/cpukit/libtest/t-test-thread-switch.c
+++ b/cpukit/libtest/t-test-thread-switch.c
@@ -96,11 +96,11 @@ T_thread_switch_recorder(Thread_Control *executing, 
Thread_Control *heir)
if (log != NULL) {
size_t recorded;
 
-   ++log->switches;
-   recorded = log->recorded;
+   ++log->header.switches;
+   recorded = log->header.recorded;
 
-   if (recorded < log->capacity) {
-   log->recorded = recorded + 1;
+   if (recorded < log->header.capacity) {
+   log->header.recorded = recorded + 1;
log->events[recorded].executing = executing->Object.id;
log->events[recorded].heir = heir->Object.id;
log->events[recorded].cpu =
@@ -127,8 +127,8 @@ T_thread_switch_record(T_thread_switch_log *log)
}
 
if (log != NULL) {
-   log->recorded = 0;
-   log->switches = 0;
+   log->header.recorded = 0;
+   log->header.switches = 0;
}
 
rtems_interrupt_lock_acquire(>lock, _context);
@@ -142,20 +142,20 @@ T_thread_switch_record(T_thread_switch_log *log)
 T_thread_switch_log *
 T_thread_switch_record_2(T_thread_switch_log_2 *log)
 {
-   log->log.capacity = 2;
-   return T_thread_switch_record(>log);
+   log->header.capacity = T_ARRAY_SIZE(log->events);
+   return T_thread_switch_record((T_thread_switch_log *)log);
 }
 
 T_thread_switch_log *
 T_thread_switch_record_4(T_thread_switch_log_4 *log)
 {
-   log->log.capacity = 4;
-   return T_thread_switch_record(>log);
+   log->header.capacity = T_ARRAY_SIZE(log->events);
+   return T_thread_switch_record((T_thread_switch_log *)log);
 }
 
 T_thread_switch_log *
 T_thread_switch_record_10(T_thread_switch_log_10 *log)
 {
-   log->log.capacity = 10;
-   return T_thread_switch_record(>log);
+   log->header.capacity = T_ARRAY_SIZE(log->events);
+   return T_thread_switch_record((T_thread_switch_log *)log);
 }
diff --git a/testsuites/libtests/ttest02/init.c 
b/testsuites/libtests/ttest02/init.c
index 7f972aec7e..4d540c9a86 100644
--- a/testsuites/libtests/ttest02/init.c
+++ b/testsuites/libtests/ttest02/init.c
@@ -222,23 +222,23 @@ T_TEST_CASE(TestThreadSwitch)
memset(_2, 0xff, sizeof(log_2));
log = T_thread_switch_record_2(_2);
T_null(log);
-   T_eq_sz(log_2.log.recorded, 0);
-   T_eq_sz(log_2.log.capacity, 2);
-   T_eq_u64(log_2.log.switches, 0);
+   T_eq_sz(log_2.header.recorded, 0);
+   T_eq_sz(log_2.header.capacity, 2);
+   T_eq_u64(log_2.header.switches, 0);
 
memset(_4, 0xff, sizeof(log_4));
log = T_thread_switch_record_4(_4);
-   T_eq_ptr(log, _2.log);
-   T_eq_sz(log_4.log.recorded, 0);
-   T_eq_sz(log_4.log.capacity, 4);
-   T_eq_u64(log_4.log.switches, 0);
+   T_eq_ptr(>header, _2.header);
+   T_eq_sz(log_4.header.recorded, 0);

Re: [PATCH] riscv/start: Startup sequence update.

2021-05-02 Thread Sebastian Huber

On 30/04/2021 15:34, Sebastian Huber wrote:


On 30/04/2021 15:32, Hesham Almatary wrote:


    The noinit attributes is a bit broken in GCC:

I guess we can go for a separate custom section then? Or we can just 
assign it a magic value so that it doesn’t go into BSS.


I propose to add something like this:

+/* Generated from spec:/rtems/basedefs/if/noinit */
+
+/**
+ * @ingroup RTEMSAPIBaseDefs
+ *
+ * @brief Instructs the compiler to place the variable in a section 
which is

+ *   not initialized.
+ */
+#define RTEMS_NOINIT RTEMS_SECTION( ".noinit" )

I work currently on a support for this in the linker command files.


I checked in the .noinit support. Could you please check if this patch 
fixes the problem:


https://lists.rtems.org/pipermail/devel/2021-May/067005.html

--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/

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

[PATCH] bsp: Use RTEMS_NOINIT for bsp_fdt_blob

2021-05-02 Thread Sebastian Huber
This makes it possible to copy a boot loader provided device tree to
bsp_fdt_blob before the BSS section is cleared to zero.  The
disadvantage is that bsp_fdt_blob contains now uninitialized data.
---
 bsps/shared/start/bsp-fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bsps/shared/start/bsp-fdt.c b/bsps/shared/start/bsp-fdt.c
index 50a485eb16..9cd46e5927 100644
--- a/bsps/shared/start/bsp-fdt.c
+++ b/bsps/shared/start/bsp-fdt.c
@@ -32,7 +32,7 @@ static const uint32_t
 bsp_fdt_blob[BSP_FDT_BLOB_SIZE_MAX / sizeof(uint32_t)] CPU_STRUCTURE_ALIGNMENT 
=
   { 0xdeadbeef };
 #else
-static uint32_t
+RTEMS_NOINIT static uint32_t
 bsp_fdt_blob[BSP_FDT_BLOB_SIZE_MAX / sizeof(uint32_t)] CPU_STRUCTURE_ALIGNMENT;
 #endif
 
-- 
2.26.2

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


Re: [PATCH] score: Add _Thread_Dispatch_direct_no_return()

2021-05-02 Thread Gedare Bloom
ok, that's annoying.

On Fri, Apr 30, 2021 at 9:02 AM Sebastian Huber
 wrote:
>
> The __builtin_unreachable() cannot be used with current GCC versions to
> tell the compiler that a function does not return to the caller, see:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99151
>
> Add a no return variant of _Thread_Dispatch_direct() to avoid generation
> of dead code.
> ---
>  cpukit/include/rtems/score/threaddispatch.h | 11 +++
>  cpukit/posix/src/pthreadexit.c  |  2 +-
>  cpukit/rtems/src/taskexit.c |  2 +-
>  cpukit/score/src/threaddispatch.c   |  3 +++
>  cpukit/score/src/threadrestart.c|  4 ++--
>  5 files changed, 18 insertions(+), 4 deletions(-)
>
> diff --git a/cpukit/include/rtems/score/threaddispatch.h 
> b/cpukit/include/rtems/score/threaddispatch.h
> index 707b449771..7f3673a0d5 100644
> --- a/cpukit/include/rtems/score/threaddispatch.h
> +++ b/cpukit/include/rtems/score/threaddispatch.h
> @@ -125,6 +125,17 @@ void _Thread_Dispatch( void );
>   */
>  void _Thread_Dispatch_direct( Per_CPU_Control *cpu_self );
>
> +/**
> + * @brief Directly do a thread dispatch and do not return.
> + *
> + * @param cpu_self is the current processor.
> + *
> + * @see _Thread_Dispatch_direct().
> + */
> +RTEMS_NO_RETURN void _Thread_Dispatch_direct_no_return(
> +  Per_CPU_Control *cpu_self
> +);
> +
>  /**
>   * @brief Performs a thread dispatch on the current processor.
>   *
> diff --git a/cpukit/posix/src/pthreadexit.c b/cpukit/posix/src/pthreadexit.c
> index 502476d141..657497010b 100644
> --- a/cpukit/posix/src/pthreadexit.c
> +++ b/cpukit/posix/src/pthreadexit.c
> @@ -35,6 +35,6 @@ void pthread_exit( void *value_ptr )
>
>_Thread_Exit( executing, THREAD_LIFE_TERMINATING, value_ptr );
>
> -  _Thread_Dispatch_direct( cpu_self );
> +  _Thread_Dispatch_direct_no_return( cpu_self );
>RTEMS_UNREACHABLE();
>  }
> diff --git a/cpukit/rtems/src/taskexit.c b/cpukit/rtems/src/taskexit.c
> index c08089e956..4c8420d255 100644
> --- a/cpukit/rtems/src/taskexit.c
> +++ b/cpukit/rtems/src/taskexit.c
> @@ -42,6 +42,6 @@ void rtems_task_exit( void )
>  NULL
>);
>
> -  _Thread_Dispatch_direct( cpu_self );
> +  _Thread_Dispatch_direct_no_return( cpu_self );
>RTEMS_UNREACHABLE();
>  }
> diff --git a/cpukit/score/src/threaddispatch.c 
> b/cpukit/score/src/threaddispatch.c
> index 2fd125dd76..fd3f4eda4d 100644
> --- a/cpukit/score/src/threaddispatch.c
> +++ b/cpukit/score/src/threaddispatch.c
> @@ -358,6 +358,9 @@ void _Thread_Dispatch_direct( Per_CPU_Control *cpu_self )
>_Thread_Do_dispatch( cpu_self, level );
>  }
>
> +RTEMS_ALIAS( _Thread_Dispatch_direct ) void
> +_Thread_Dispatch_direct_no_return( Per_CPU_Control * );
> +
>  void _Thread_Dispatch_enable( Per_CPU_Control *cpu_self )
>  {
>uint32_t disable_level = cpu_self->thread_dispatch_disable_level;
> diff --git a/cpukit/score/src/threadrestart.c 
> b/cpukit/score/src/threadrestart.c
> index 3c0190164e..364d67d04e 100644
> --- a/cpukit/score/src/threadrestart.c
> +++ b/cpukit/score/src/threadrestart.c
> @@ -288,7 +288,7 @@ void _Thread_Life_action_handler(
>if ( _Thread_Is_life_terminating( previous_life_state ) ) {
>  cpu_self = _Thread_Wait_for_join( executing, cpu_self );
>  _Thread_Make_zombie( executing );
> -_Thread_Dispatch_direct( cpu_self );
> +_Thread_Dispatch_direct_no_return( cpu_self );
>  RTEMS_UNREACHABLE();
>}
>
> @@ -610,7 +610,7 @@ void _Thread_Restart_self(
>_Thread_Wait_release_default( executing, lock_context );
>
>_Thread_Priority_update( _context );
> -  _Thread_Dispatch_direct( cpu_self );
> +  _Thread_Dispatch_direct_no_return( cpu_self );
>RTEMS_UNREACHABLE();
>  }
>
> --
> 2.26.2
>
> ___
> 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: [PATCH] spmisc01: Test RTEMS_NOINIT

2021-05-02 Thread Gedare Bloom
ok

On Fri, Apr 30, 2021 at 9:04 AM Sebastian Huber
 wrote:
>
> Close #3866.
> ---
>  testsuites/sptests/spmisc01/init.c | 5 +
>  1 file changed, 5 insertions(+)
>
> diff --git a/testsuites/sptests/spmisc01/init.c 
> b/testsuites/sptests/spmisc01/init.c
> index e64fa4e480..6fbc0eeff8 100644
> --- a/testsuites/sptests/spmisc01/init.c
> +++ b/testsuites/sptests/spmisc01/init.c
> @@ -49,6 +49,8 @@ RTEMS_CONST static int const_func(void)
>
>  RTEMS_SECTION(".rtemsroset.test") static int section_variable = 28;
>
> +RTEMS_NOINIT static int noinit_variable;
> +
>  RTEMS_USED static int used_func(void)
>  {
>return 35;
> @@ -205,6 +207,7 @@ static int concat(void)
>  static void Init(rtems_task_argument arg)
>  {
>void *p;
> +  int   v;
>
>TEST_BEGIN();
>rtems_test_assert(inline_func() == 7);
> @@ -213,6 +216,8 @@ static void Init(rtems_task_argument arg)
>rtems_test_assert(pure_func() == 21);
>rtems_test_assert(const_func() == 23);
>rtems_test_assert(section_variable == 28);
> +  v = noinit_variable;
> +  RTEMS_OBFUSCATE_VARIABLE(v);
>rtems_test_assert(unused_arg_and_variable_func(49) == 42);
>rtems_test_assert(sizeof(packed_struct) == 5);
>rtems_test_assert(alias_func() == 14);
> --
> 2.26.2
>
> ___
> 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: [PATCH 2/2] bsps: Support RTEMS_NOINIT in linkcmds

2021-05-02 Thread Gedare Bloom
these 2 look good

On Fri, Apr 30, 2021 at 7:55 AM Sebastian Huber
 wrote:
>
> Close #3866.
> ---
>  bsps/arm/include/bsp/arm-cp15-start.h| 6 +-
>  bsps/arm/include/bsp/linker-symbols.h| 4 
>  bsps/arm/shared/start/linkcmds.base  | 7 +++
>  bsps/bfin/TLL6527M/start/linkcmds| 4 
>  bsps/bfin/bf537Stamp/start/linkcmds  | 4 
>  bsps/bfin/eZKit533/start/linkcmds| 4 
>  bsps/i386/pc386/start/linkcmds   | 3 +++
>  bsps/lm32/lm32_evr/start/linkcmds| 4 
>  bsps/lm32/milkymist/start/linkcmds   | 4 
>  bsps/m68k/av5282/start/linkcmds  | 4 
>  bsps/m68k/av5282/start/linkcmdsflash | 4 
>  bsps/m68k/av5282/start/linkcmdsram   | 4 
>  bsps/m68k/csb360/start/linkcmds  | 4 
>  bsps/m68k/gen68340/start/linkcmds| 4 
>  bsps/m68k/gen68360/start/linkcmds| 4 
>  bsps/m68k/gen68360/start/linkcmds.bootp  | 4 
>  bsps/m68k/gen68360/start/linkcmds.prom   | 4 
>  bsps/m68k/mcf5206elite/start/linkcmds| 4 
>  bsps/m68k/mcf5206elite/start/linkcmds.flash  | 4 
>  bsps/m68k/mcf52235/start/linkcmds| 4 
>  bsps/m68k/mcf5225x/start/linkcmds| 4 
>  bsps/m68k/mcf5235/start/linkcmds | 4 
>  bsps/m68k/mcf5235/start/linkcmdsflash| 4 
>  bsps/m68k/mcf5235/start/linkcmdsram  | 4 
>  bsps/m68k/mcf5329/start/linkcmds | 4 
>  bsps/m68k/mcf5329/start/linkcmdsflash| 4 
>  bsps/m68k/mrm332/start/linkcmds  | 3 +++
>  bsps/m68k/shared/start/linkcmds.base | 7 +++
>  bsps/m68k/uC5282/start/linkcmds  | 4 
>  bsps/mips/csb350/start/linkcmds  | 4 
>  bsps/mips/hurricane/start/linkcmds   | 4 
>  bsps/mips/jmr3904/start/linkcmds | 4 
>  bsps/mips/malta/start/linkcmds   | 4 
>  bsps/mips/rbtx4925/start/linkcmds| 4 
>  bsps/mips/rbtx4938/start/linkcmds| 4 
>  bsps/moxie/moxiesim/start/linkcmds   | 3 +++
>  bsps/nios2/nios2_iss/start/linkcmds  | 4 
>  bsps/or1k/shared/start/linkcmds.base | 7 +++
>  bsps/powerpc/gen5200/start/linkcmds.gen5200_base | 4 
>  bsps/powerpc/haleakala/start/linkcmds| 4 
>  bsps/powerpc/include/bsp/linker-symbols.h| 4 
>  bsps/powerpc/mpc8260ads/start/linkcmds   | 4 
>  bsps/powerpc/qoriq/start/mmu-config.c| 1 +
>  bsps/powerpc/shared/start/linkcmds.base  | 7 +++
>  bsps/powerpc/shared/start/linkcmds.share | 3 +++
>  bsps/powerpc/ss555/start/linkcmds| 4 
>  bsps/powerpc/virtex4/start/linkcmds  | 4 
>  bsps/powerpc/virtex5/start/linkcmds  | 4 
>  bsps/riscv/include/bsp/linker-symbols.h  | 4 
>  bsps/riscv/shared/start/linkcmds.base.in | 7 +++
>  bsps/sh/gensh1/start/linkcmds| 4 
>  bsps/sh/gensh2/start/linkcmds| 4 
>  bsps/sh/gensh2/start/linkcmds.ram| 4 
>  bsps/sh/gensh2/start/linkcmds.rom| 4 
>  bsps/sh/gensh4/start/linkcmds| 4 
>  bsps/sh/gensh4/start/linkcmds.rom| 4 
>  bsps/sh/gensh4/start/linkcmds.rom2ram| 4 
>  bsps/sh/shsim/start/linkcmds | 4 
>  bsps/sparc/shared/start/linkcmds.base| 3 +++
>  bsps/sparc64/shared/start/linkcmds   | 4 
>  bsps/v850/gdbv850sim/start/linkcmds  | 3 +++
>  bsps/x86_64/amd64/start/linkcmds | 5 +
>  62 files changed, 252 insertions(+), 5 deletions(-)
>
> diff --git a/bsps/arm/include/bsp/arm-cp15-start.h 
> b/bsps/arm/include/bsp/arm-cp15-start.h
> index 75cbdac848..e46ea39a0e 100644
> --- a/bsps/arm/include/bsp/arm-cp15-start.h
> +++ b/bsps/arm/include/bsp/arm-cp15-start.h
> @@ -75,10 +75,6 @@ typedef struct {
>  .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED \
>}, { \
>  .begin = (uint32_t) bsp_section_rtemsstack_begin, \
> -.end = (uint32_t) bsp_section_rtemsstack_end, \
> -.flags = ARMV7_MMU_DATA_READ_WRITE_CACHED \
> -  }, { \
> -.begin = (uint32_t) bsp_section_work_begin, \
>  .end = (uint32_t) bsp_section_work_end, \
>  .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED \
>}, { \
> @@ -99,7 +95,7 @@ typedef struct {
>  .flags = ARMV7_MMU_DATA_READ_WRITE_CACHED \
>}
>
> -#define ARMV7_CP15_START_WORKSPACE_ENTRY_INDEX 9
> +#define ARMV7_CP15_START_WORKSPACE_ENTRY_INDEX 8
>
>  BSP_START_DATA_SECTION extern const arm_cp15_start_section_config
>arm_cp15_start_mmu_config_table[];
> diff --git a/bsps/arm/include/bsp/linker-symbols.h 
> 

Re: GSoC Project - Beagle BSP Projects

2021-05-02 Thread Christian Mauderer

Hello Husni,

On 01/05/2021 23:38, Ahamed Husni wrote:

Hi all,

My project proposal
https://docs.google.com/document/d/1CN3ri7g6NJeFPb5h8y4smr1aziGWyXbiiXUsFMhdUu4/edit?usp=sharing 



I tried to set up the JTAG Environment for the Beaglebone Black.
But I couldn't find the hardware anywhere in my country (Sri Lanka).

I tried to,

 1. Find TI XDS Debuggers
 2. Find a TI Launchpad so we can isolate and use the debugger in it.


I assume you didn't find these?


 3. Use RPi as a debugger using OpenOCD


I would have expect that one to work (like nearly any OpenOCD debugger). 
What was the problem? Did OpenOCD detect the processor? What pins did 
you connect? Please provide some more details so we might can help with 
tips.


By the way: If you get it running it might would be a nice addition to 
the user manual:


https://docs.rtems.org/branches/master/user/bsps/bsps-arm.html#debugging-beagle-bone-black-using-a-jtag-debugger-and-gdb

That's currently mostly about the gdb part. You maybe could add two or 
three sentences and program calls how to start OpenOCD on a beagle and 
what pins can be used for it.




I looked for the debuggers in major electronic shops, embedded systems 
related companies,

university labs and etc. But couldn't find them.
Also these debuggers are expensive. When ordering online the shipping 
charges are also high.


I know from past GSoC that it can be difficult to get certain stuff in 
some countries. That's OK and I'm sure we find some solution.



So I can't guarantee that I can set up JTAG.

Can we use RTEMS Libdebugger until we figure out the JTAG?


I did too few stuff with libdebugger. So I don't know it really well. I 
_think_ that it needs a working network stack which would mean that you 
can only use it _after_ libbsd is initialized.


Anyone: Please correct me if I'm wrong. If it would for example work 
with a serial interface, it should be OK.


Can we make a fallback plan for this project? If yes, what sorts of 
changes should be made?


I think the next best thing if you don't have a hardware debugger would 
be the RTEMS event recording. You have to instrument code and the 
processor has to be able to print an exception so you can get the data. 
You can't check anything on a instruction level but it's a great tool if 
you have to analyze the execution order of some problem cases. Most 
likely that will work for a lot of problems in your project too. So I 
would say that should be a fallback. Maybe you want to have a look at that:


https://docs.rtems.org/branches/master/user/tracing/eventrecording.html

Basically it's adding a few CONFIGURE_RECORD_... defines to your 
application, receive events with rtems-record-lttng via network or from 
a serial dump and then using Eclipse Trace Compass to analyze the trace. 
Please speak up if you need help setting that up.


Best regards

Christian



Best regards,
Husni.

On Fri, Apr 2, 2021 at 6:16 PM Christian Mauderer > wrote:




On 02/04/2021 08:36, Ahamed Husni wrote:
 >         >     Yes, this seems like an area that can be chipped
away at, with a
 >         >     strong plan of activities. My concern would be
whether it is about
 >         >     writing code or not?
 >         >
 >         >
 >         > After completing the above milestones, if we have more
time I can start
 >         > to work on
 >         > the Mass storage support.
 >         >
 >
 >
 >     I would suggest to put _more_ into the proposal and make it
clear that
 >     the later points depend on whether there is enough time or not.
 >
 >     @Gedare: The time and effort for that project is really hard to
 >     estimate
 >     in my point of view. Do you have an idea how we could handle
that?
 >
 >
 > So do I have to include mass storage support into the project
schedule or
 > should I prepare the schedule for Ethernet, Serial and add the
list of
 > possible advances and say that I'll work on them if there is
enough time?

I would suggest to include it. I'm quite sure that there is enough time.

 >
 >     Most likely we would have to put some further open points at
the end of
 >     that because like I said: Depending on how well it works you
might need
 >     anything between a day and three weeks to get CDC Ethernet
running.
 >      From
 >     my first guess, it's maybe a week.
 >
 >     Note that I would expect that you will need a debugger and
the RTEMS
 >     event recording for this kind of project.
 >
 >
 >     CDC Serial should be only a small step as soon as CDC Ethernet is
 >     running.
 >
 >
 > I don't have a JTAG debugger now. I'll get that set up asap.
 >
 >
 >     > USB OTG would be a nice