LTTng sched_switch documentation patch

2019-08-30 Thread Ravindra Kumar Meena
Hello Chris and Sebastian,

I have attached the updated LTTng sched_switch documentation patch(v5).
This one is a whole single patch.

Please review the attached patch.

*What changed from v4 to v5:*
* rtems-record-lttng tool is now available via RSB. So for the same, I have
updated the patch.
* I have removed the Trace Compass screen capture.
* I have REST numbering format.
* Removed the telent command. Telnet is not required for tracing.
* set the code block type to shell.
* Added few lines for raw-data.

Thanks
-- 
*Ravindra Kumar Meena*,
B. Tech. Computer Science and Engineering,
Indian Institute of Technology (Indian School of Mines)
, Dhanbad


v5-0001-Basic-Support-for-Trace-Compass.patch
Description: Binary data
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH] record: Allow tracing of ISR disable/enable

2019-08-30 Thread Sebastian Huber
Directly use the CPU port API in boot_card() to allow tracing of the
higher level interrupt disable/enable routines, e.g.
_ISR_Local_disable() and _ISR_Local_enable().  Currently, there is no
configuration option to enable this.  Below is a patch.  It may be used
to investigate some nasty low level bugs in the system.

Update #3665.

diff --git a/cpukit/include/rtems/score/isrlevel.h 
b/cpukit/include/rtems/score/isrlevel.h
index c42451d010..46d361ddc2 100644
--- a/cpukit/include/rtems/score/isrlevel.h
+++ b/cpukit/include/rtems/score/isrlevel.h
@@ -40,6 +40,10 @@ extern "C" {
  */
 typedef uint32_t   ISR_Level;

+uint32_t rtems_record_interrupt_disable( void );
+
+void rtems_record_interrupt_enable( uint32_t level );
+
 /**
  *  @brief Disables interrupts on this processor.
  *
@@ -56,8 +60,7 @@ typedef uint32_t   ISR_Level;
  */
 #define _ISR_Local_disable( _level ) \
   do { \
-_CPU_ISR_Disable( _level ); \
-RTEMS_COMPILER_MEMORY_BARRIER(); \
+_level = rtems_record_interrupt_disable(); \
   } while (0)

 /**
@@ -72,10 +75,7 @@ typedef uint32_t   ISR_Level;
  *  _ISR_Local_disable().
  */
 #define _ISR_Local_enable( _level ) \
-  do { \
-RTEMS_COMPILER_MEMORY_BARRIER(); \
-_CPU_ISR_Enable( _level ); \
-  } while (0)
+  rtems_record_interrupt_enable( _level )

 /**
  *  @brief Temporarily enables interrupts on this processor.
@@ -98,9 +98,8 @@ typedef uint32_t   ISR_Level;
  */
 #define _ISR_Local_flash( _level ) \
   do { \
-RTEMS_COMPILER_MEMORY_BARRIER(); \
-_CPU_ISR_Flash( _level ); \
-RTEMS_COMPILER_MEMORY_BARRIER(); \
+rtems_record_interrupt_enable( _level ); \
+_level = rtems_record_interrupt_disable(); \
   } while (0)

 /
---
 bsps/shared/start/bootcard.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/bsps/shared/start/bootcard.c b/bsps/shared/start/bootcard.c
index 542785bd83..a6ad1953c0 100644
--- a/bsps/shared/start/bootcard.c
+++ b/bsps/shared/start/bootcard.c
@@ -46,13 +46,15 @@ void boot_card(
   const char *cmdline
 )
 {
-  rtems_interrupt_level  bsp_isr_level;
+  ISR_Level bsp_isr_level;
 
   /*
-   *  Make sure interrupts are disabled.
+   * Make sure interrupts are disabled.  Directly use the CPU port API to allow
+   * tracing of the higher level interrupt disable/enable routines, e.g.
+   * _ISR_Local_disable() and _ISR_Local_enable().
*/
+  _CPU_ISR_Disable( bsp_isr_level );
   (void) bsp_isr_level;
-  rtems_interrupt_local_disable( bsp_isr_level );
 
   bsp_boot_cmdline = cmdline;
 
-- 
2.16.4

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


Re: [PATCH 1/2] psxmsgq05: Added priority unblocking mq tests

2019-08-30 Thread Sebastian Huber

On 29/08/2019 20:11, Lou Woods wrote:

From: Lou Woods 

This test exercises the unblocking order of a POSIX
message queue

-Added psxmsgq05 test to the make structure.
-Added tests, doc, and scn output.

updates #3791.
---
  testsuites/psxtests/Makefile.am |  10 +
  testsuites/psxtests/configure.ac|   1 +
  testsuites/psxtests/psxmsgq05/init.c| 440 
  testsuites/psxtests/psxmsgq05/psxmsgq05.doc |  42 +++
  testsuites/psxtests/psxmsgq05/psxmsgq05.scn |   4 +
  testsuites/psxtests/psxmsgq05/system.h  |  56 
  6 files changed, 553 insertions(+)
  mode change 100755 => 100644 testsuites/psxtests/Makefile.am
  create mode 100644 testsuites/psxtests/psxmsgq05/init.c
  create mode 100644 testsuites/psxtests/psxmsgq05/psxmsgq05.doc
  create mode 100644 testsuites/psxtests/psxmsgq05/psxmsgq05.scn
  create mode 100644 testsuites/psxtests/psxmsgq05/system.h

diff --git a/testsuites/psxtests/Makefile.am b/testsuites/psxtests/Makefile.am
old mode 100755
new mode 100644
index c12b036..52c9644
--- a/testsuites/psxtests/Makefile.am
+++ b/testsuites/psxtests/Makefile.am
@@ -685,6 +685,16 @@ psxmsgq04_CPPFLAGS = $(AM_CPPFLAGS) 
$(TEST_FLAGS_psxmsgq04) \
$(support_includes) -I$(top_srcdir)/include
  endif
  
+if TEST_psxmsgq05

+psx_tests += psxmsgq05
+psx_screens += psxmsgq05/psxmsgq05.scn
+psx_docs += psxmsgq05/psxmsgq05.doc
+psxmsgq05_SOURCES = psxmsgq05/init.c psxmsgq05/system.h \
+   include/pmacros.h ../support/src/test_support.c
+psxmsgq05_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_psxmsgq05) \
+   $(support_includes) -I$(top_srcdir)/include
+endif
+
  if TEST_psxmutexattr01
  psx_tests += psxmutexattr01
  psx_screens += psxmutexattr01/psxmutexattr01.scn
diff --git a/testsuites/psxtests/configure.ac b/testsuites/psxtests/configure.ac
index bb44bb8..32d143a 100644
--- a/testsuites/psxtests/configure.ac
+++ b/testsuites/psxtests/configure.ac
@@ -112,6 +112,7 @@ RTEMS_TEST_CHECK([psxmsgq01])
  RTEMS_TEST_CHECK([psxmsgq02])
  RTEMS_TEST_CHECK([psxmsgq03])
  RTEMS_TEST_CHECK([psxmsgq04])
+RTEMS_TEST_CHECK([psxmsgq05])
  RTEMS_TEST_CHECK([psxmutexattr01])
  RTEMS_TEST_CHECK([psxndbm01])
  RTEMS_TEST_CHECK([psxobj01])
diff --git a/testsuites/psxtests/psxmsgq05/init.c 
b/testsuites/psxtests/psxmsgq05/init.c
new file mode 100644
index 000..ab06156
--- /dev/null
+++ b/testsuites/psxtests/psxmsgq05/init.c
@@ -0,0 +1,440 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2019 On-Line Applications Research.  All rights reserved.


In the licence template:

https://git.rtems.org/rtems/tree/LICENSE.BSD-2-Clause

there is no "All rights reserved.".

[...]

+/* forward declarations to avoid warnings */


Static functions don't need forward declarations to avoid warnings.


+static int test_msgQ_unblock_order(
+  bool  receive_test,/* true to test receive order, false for
+send order */
+  bool *task1_released,  /* set by function to indicate task1 was
+released */
+  bool *task2_released   /* set by function to indicate task2 was
+released */
+);
+static void *taskEntry( void *arg );
+
+/* The taskEntry function calls send or receive on the provided message queue
+ * and will block waiting to receive or send a message depending on the
+ * receive_test flag.  Once the tasked is unblocked it will post the provided
+ * semaphore.
+ */
+static void *taskEntry( void *arg )
+{
+  char  buffer[ DEFAULT_BUFFER_SIZE ];
+  struct timespec   timeout;
+  int   retval;
+  struct task_args *args = arg;
+
+  if ( args == NULL ) {
+fprintf( stderr, "NULL argument passed to task, exiting\n" );
+
+return NULL;
+  }
+
+#if 0
+  fprintf( stderr,
+"task id %x with sem %x about to block\n",
+pthread_self(),
+(unsigned int) ( args->p_task_sem ) );
+#endif


#if 0 code should be removed.


+
+  if ( args->receive_test == true ) {
+if ( args->wait_timeout != 0 ) {
+  retval = clock_gettime( CLOCK_REALTIME, &timeout );
+
+  if ( retval == ( -1 ) ) {
+perror( "clock gettime failed" );
+
+return NULL;
+  }
+
+  timeout.tv_sec += args->wait_timeout;
+  retval = mq_timedreceive( *( args->p_main_msgQ ),
+buffer,
+DEFAULT_BUFFER_SIZE,
+NULL,
+&timeout );
+
+  if ( retval == ( -1 ) ) {
+perror( "time mq_receive returned unexpectedly." );
+
+return NULL;
+  }


Test cases should use assertions to check test conditions.  The new test 
framework helps you to do this:


https://docs.rtems.org/branches/master/eng/test-framework.html#posix-error-numbers

https://docs.rtems.org/branches/master/eng/test-framework.html#posix-status-codes

You should also test for success and not some failure.

[...]

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

Re: littleVGL now supports FreeBSD framebuffer

2019-08-30 Thread Vijay Kumar Banerjee
On Fri, Aug 30, 2019 at 12:08 PM Christian Mauderer <
christian.maude...@embedded-brains.de> wrote:

> On 30/08/2019 02:39, Chris Johns wrote:
> > On 30/8/19 1:19 am, Vijay Kumar Banerjee wrote:
> >> I have written the scripts to build littlevgl using rtems_waf. The
> build works fine
> >> and installs the required header and the static library in the prefix
> library path.
> >
> > This is great work. Well done.
>
> +1
>
> Thanks!

> >
> >> The repository is pushed here, please have a look:
> >> https://github.com/thelunatic/littlevgl-rsb
> >
> > First a simple question ... why is there an import of runpy in wscript?
> >
>
It's no more needed, I'll post a patch to remove it.
Also, I'll post patches to add a README and README.waf for the repo.

> > Second, I have moved the repo to the git.rtems.org. :)
> >
> > Could you please check if it is OK?
> >
>
Looks great!

> > I have sorted out how to manage the repos in cgit so from the previous
> > discussions I have taken the path of separate repos.
>
> Hello Chris,
>
> that looks great. Very clear structure.
>
> Best regards
>
> Christian
>
> > Please have a look at
> > https://git.rtems.org/ and the LittleVGL repo I have added under
> Packages.
> >
> > Again, thank you for this and your work in creating the package.
> >
> > Chris
> > ___
> > devel mailing list
> > devel@rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
> >
>
> --
> 
> embedded brains GmbH
> Herr Christian Mauderer
> Dornierstr. 4
> D-82178 Puchheim
> Germany
> email: christian.maude...@embedded-brains.de
> Phone: +49-89-18 94 741 - 18
> Fax:   +49-89-18 94 741 - 08
> 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: [PATCH 1/2] psxmsgq05: Added priority unblocking mq tests

2019-08-30 Thread Peter Dufault

> On Aug 30, 2019, at 03:08 , Sebastian Huber 
>  wrote:
> 
> [...]
>> +/* forward declarations to avoid warnings */
> 
> Static functions don't need forward declarations to avoid warnings.

... because you should order the definitions properly.  Only if two static 
functions need to reference each other do you need to forward declare one.  
That’s a rare situation.

Peter
-
Peter Dufault
HD Associates, Inc.  Software and System Engineering

This email is delivered through the public internet using protocols subject to 
interception and tampering.

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

[PATCH] record: Add wrappers for malloc() functions

2019-08-30 Thread Sebastian Huber
Introduce new library librtemsrecordwrap.a which contains wrappers for
operating system functions which produce entry/exit events.

The wrappers can be selected during link time via the GNU ld --wrap
option.

Update #3665.
---
 cpukit/Makefile.am  |   5 +
 cpukit/libtrace/record/record-wrap-malloc.c | 145 ++
 testsuites/libtests/Makefile.am |   8 +
 testsuites/libtests/record02/init.c |  23 +-
 testsuites/libtests/record02/record02.scn   | 691 +++-
 5 files changed, 642 insertions(+), 230 deletions(-)
 create mode 100644 cpukit/libtrace/record/record-wrap-malloc.c

diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am
index 01ee40980f..3914b3d363 100644
--- a/cpukit/Makefile.am
+++ b/cpukit/Makefile.am
@@ -1831,6 +1831,11 @@ project_lib_LIBRARIES += librtemsdefaultconfig.a
 librtemsdefaultconfig_a_SOURCES =
 librtemsdefaultconfig_a_SOURCES += libmisc/dummy/default-configuration.c
 
+project_lib_LIBRARIES += librtemsrecordwrap.a
+
+librtemsrecordwrap_a_SOURCES =
+librtemsrecordwrap_a_SOURCES += libtrace/record/record-wrap-malloc.c
+
 project_lib_LIBRARIES += librtemstest.a
 
 librtemstest_a_SOURCES =
diff --git a/cpukit/libtrace/record/record-wrap-malloc.c 
b/cpukit/libtrace/record/record-wrap-malloc.c
new file mode 100644
index 00..2ec3e9c023
--- /dev/null
+++ b/cpukit/libtrace/record/record-wrap-malloc.c
@@ -0,0 +1,145 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2018, 2019 embedded brains GmbH
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include 
+
+#include 
+
+typedef void *Record_Aligned_alloc(size_t, size_t);
+
+Record_Aligned_alloc aligned_alloc;
+Record_Aligned_alloc __real_aligned_alloc;
+Record_Aligned_alloc __wrap_aligned_alloc;
+
+void *__wrap_aligned_alloc( size_t alignment, size_t size )
+{
+  void *ptr;
+
+  rtems_record_entry_2(
+RTEMS_RECORD_ALIGNED_ALLOC_ENTRY,
+alignment,
+size
+  );
+  ptr = __real_aligned_alloc( alignment, size );
+  rtems_record_exit_1(
+RTEMS_RECORD_ALIGNED_ALLOC_EXIT,
+(rtems_record_data) ptr
+  );
+  return ptr;
+}
+
+typedef void *Record_Calloc( size_t, size_t );
+
+Record_Calloc calloc;
+Record_Calloc __real_calloc;
+Record_Calloc __wrap_calloc;
+
+void *__wrap_calloc( size_t nelem, size_t elsize )
+{
+  void *ptr;
+
+  rtems_record_entry_2( RTEMS_RECORD_CALLOC_ENTRY, nelem, elsize );
+  ptr = __real_calloc( nelem, elsize );
+  rtems_record_exit_1( RTEMS_RECORD_CALLOC_EXIT, (rtems_record_data) ptr );
+  return ptr;
+}
+
+typedef void *Record_Malloc( size_t );
+
+Record_Malloc malloc;
+Record_Malloc __real_malloc;
+Record_Malloc __wrap_malloc;
+
+void *__wrap_malloc( size_t size )
+{
+  void *ptr;
+
+  rtems_record_entry_1( RTEMS_RECORD_MALLOC_ENTRY, size );
+  ptr = __real_malloc( size );
+  rtems_record_exit_1( RTEMS_RECORD_MALLOC_EXIT, (rtems_record_data) ptr );
+  return ptr;
+}
+
+typedef void Record_Free( void *ptr );
+
+Record_Free free;
+Record_Free __real_free;
+Record_Free __wrap_free;
+
+void __wrap_free( void *ptr )
+{
+  rtems_record_entry_1( RTEMS_RECORD_FREE_ENTRY, (rtems_record_data) ptr );
+  __real_free( ptr );
+  rtems_record_entry( RTEMS_RECORD_FREE_EXIT );
+}
+
+typedef int Record_POSIX_memalign( void **, size_t, size_t );
+
+Record_POSIX_memalign posix_memalign;
+Record_POSIX_memalign __real_posix_memalign;
+Record_POSIX_memalign __wrap_posix_memalign;
+
+int __wrap_posix_memalign( void **memptr, size_t alignment, size_t size )
+{
+  int eno;
+
+  rtems_record_entry_3(
+RTEMS_RECORD_POSIX_MEMALIGN_ENTRY,
+(rtems_record_data) memptr,
+alignment,
+size
+  );
+  eno = __real_posix_memalign( mem

[PATCH] Add lvgl_hello: Sample Hello world app using littleVGL and libbsd

2019-08-30 Thread Vijay Kumar Banerjee
---
 README |   2 +-
 lvgl_hello/README  |   6 ++
 lvgl_hello/test.c  | 180 +
 lvgl_hello/wscript |  25 +++
 wscript|   1 +
 5 files changed, 213 insertions(+), 1 deletion(-)
 create mode 100644 lvgl_hello/README
 create mode 100644 lvgl_hello/test.c
 create mode 100644 lvgl_hello/wscript

diff --git a/README b/README
index 99ca787..f1e127c 100644
--- a/README
+++ b/README
@@ -15,4 +15,4 @@ posix_api- POSIX API examples (no led)
 schedsim - RTEMS Scheduler Simulator examples
 ticker   - Ticker Variations
 uboot- U-Boot interaction examples
-
+lvgl_hello   - LittleVGL graphics app example using libbsd framebuffer driver
diff --git a/lvgl_hello/README b/lvgl_hello/README
new file mode 100644
index 000..866d0cd
--- /dev/null
+++ b/lvgl_hello/README
@@ -0,0 +1,6 @@
+This folder contains a sample graphics app using littleVGL library and libbsd
+The generated exe file can be directly run using a JTAG debugger on a target
+with the right device tree or this can be converted into an image.
+
+For instructions on how to build the image or how to run the exe, please refer
+to the BSP documentation in https://docs.rtems.org
diff --git a/lvgl_hello/test.c b/lvgl_hello/test.c
new file mode 100644
index 000..6e0c030
--- /dev/null
+++ b/lvgl_hello/test.c
@@ -0,0 +1,180 @@
+/*
+ * Copyright (c) 2019 Vijay Kumar Banerjee .
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+#define PRIO_SHELL 150
+#define STACK_SIZE_SHELL   (64 * 1024)
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+void
+libbsdhelper_start_shell(rtems_task_priority prio)
+{
+   rtems_status_code sc = rtems_shell_init(
+   "SHLL",
+   STACK_SIZE_SHELL,
+   prio,
+   CONSOLE_DEVICE_NAME,
+   false,
+   true,
+   NULL
+   );
+   assert(sc == RTEMS_SUCCESSFUL);
+}
+
+static void
+Init(rtems_task_argument arg)
+{
+   rtems_status_code sc;
+   int exit_code;
+   (void)arg;
+   static lv_color_t buf[LV_HOR_RES_MAX*10];
+   static lv_disp_buf_t disp_buf;
+
+   puts("\nRTEMS I2C TEST\n");
+   exit_code = bbb_register_i2c_0();
+   assert(exit_code == 0);
+   sc = rtems_bsd_initialize();
+   assert(sc == RTEMS_SUCCESSFUL);
+
+   lv_init();
+
+   fbdev_init();
+
+   lv_disp_buf_init(&disp_buf, buf, NULL, LV_HOR_RES_MAX*10);
+
+   lv_disp_drv_t disp_drv;
+   lv_disp_drv_init(&disp_drv);
+   disp_drv.buffer = &disp_buf;
+   disp_drv.flush_cb = fbdev_flush;
+   lv_disp_drv_register(&disp_drv);
+
+   lv_obj_t * label = lv_label_create(lv_scr_act(), NULL);
+   lv_label_set_text(label, "Hello world!");
+   lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0);
+
+   lv_tick_inc(5);
+   lv_task_handler();
+
+   /* Some time for USB device to be detected. */
+   libbsdhelper_start_shell(PRIO_SHELL);
+
+
+   exit(0);
+}
+
+/*
+ * Configure LibBSD.
+ */
+#define RTEMS_BSD_CONFIG_BSP_CONFIG
+#define RTEMS_BSD_CONFIG_TERMIOS_KQUEUE_AND_POLL
+#define RTEMS_BSD_CONFIG_INIT
+
+#include 
+
+/*
+ * Configure RTEMS.
+ */
+#define CONFIGURE_MICROSECONDS_PER_TICK 1000
+
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
+#define CONFI

[PATCH] lvgl.py: install the lvgl headers in PREFIX following a similar tree to the source tree

2019-08-30 Thread Vijay Kumar Banerjee
This is required to be able to add the PREFIX path as the include
path in an lvgl based app.
---
 lvgl.py | 12 
 wscript |  1 -
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/lvgl.py b/lvgl.py
index bc3eae2..6d83c63 100644
--- a/lvgl.py
+++ b/lvgl.py
@@ -67,9 +67,13 @@ def build(bld):
 sources, includes = source_list()
 includes.append('.')
 objects = []
+include_paths = []
 
 for source in sources:
 objects.append(source[:-1] + 'o')
+source_dir = os.path.dirname(source)
+if source_dir not in include_paths:
+include_paths.append(source_dir)
 
 bld.objects(target = objects,
 features = 'c',
@@ -88,10 +92,10 @@ def build(bld):
 arch_inc_path = rtems.arch_bsp_include_path(bld.env.RTEMS_VERSION,
 bld.env.RTEMS_ARCH_BSP)
 
-include_paths = ['lv_drivers/display', 'lvgl', 'lv_drivers', 'lvgl/src', 
'.']
-include_headers = []
+include_paths.extend(['lvgl/', 'lv_drivers', 'lvgl/src', '.'])
 for include_path in include_paths:
 files = os.listdir(include_path)
-include_headers.extend([os.path.join(include_path, x) for x in files 
if (x[-2:] == '.h')])
+include_headers = [os.path.join(include_path, x) for x in files if 
(x[-2:] == '.h')]
+bld.install_files(os.path.join("${PREFIX}/" , arch_inc_path, 
include_path),
+  include_headers)
 bld.install_files('${PREFIX}/' + arch_lib_path, ["liblvgl.a"])
-bld.install_files("${PREFIX}/" + arch_inc_path, include_headers)
diff --git a/wscript b/wscript
index fb5d932..03e010c 100644
--- a/wscript
+++ b/wscript
@@ -28,7 +28,6 @@
 from __future__ import print_function
 
 import lvgl
-import runpy
 import sys
 
 rtems_version = "5"
-- 
2.20.1

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


Convert rtems-record-lttng program to C++

2019-08-30 Thread Sebastian Huber
Hello,

attached are two patches which convert the rtems-record-lttng client program 
from C to C++. I used

clang-format -style=Chromium -i trace/record/record-main-lttng.cc

to format the source.

-- 
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.
From 1318f60f47c3a52e8b1b52d9834a8604f31444e9 Mon Sep 17 00:00:00 2001
From: Sebastian Huber 
Date: Thu, 29 Aug 2019 07:53:35 +0200
Subject: [PATCH 1/2] record: Convert to C++

Formatted with:

clang-format -style=Chromium -i trace/record/record-main-lttng.cc

Update #3665.
---
 trace/record/record-main-lttng.c  | 585 --
 trace/record/record-main-lttng.cc | 549 +++
 trace/wscript |   4 +-
 3 files changed, 552 insertions(+), 586 deletions(-)
 delete mode 100644 trace/record/record-main-lttng.c
 create mode 100644 trace/record/record-main-lttng.cc

diff --git a/trace/record/record-main-lttng.c b/trace/record/record-main-lttng.c
deleted file mode 100644
index 3aeafab..000
--- a/trace/record/record-main-lttng.c
+++ /dev/null
@@ -1,585 +0,0 @@
-/*
- * SPDX-License-Identifier: BSD-2-Clause
- *
- * Copyright (c) 2019 Ravindra Kumar Meena 
- * Copyright (C) 2018, 2019 embedded brains GmbH
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *notice, this list of conditions and the following disclaimer in the
- *documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include 
-#include 
-
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-
-#define CTF_MAGIC 0xC1FC1FC1
-#define TASK_RUNNING  0x
-#define TASK_IDLE 0x0402
-#define UUID_SIZE 16
-#define THREAD_NAME_SIZE  16
-#define THREAD_API_COUNT  3
-#define THREAD_ID_COUNT   0x1
-#define BITS_PER_CHAR 8
-#define COMPACT_HEADER_ID 31
-
-static const struct option longopts[] = {
-  { "help", 0, NULL, 'h' },
-  { "host", 1, NULL, 'H' },
-  { "port", 1, NULL, 'p' },
-  { "input", 1, NULL, 'i' },
-  { NULL, 0, NULL, 0 }
-};
-
-typedef struct {
-  uint64_t   ns;
-  uint32_t   cpu;
-  rtems_record_event event;
-  uint64_t   data;
-} client_item;
-
-typedef struct {
-  uint32_t ctf_magic;
-  uint8_t  uuid[ UUID_SIZE ];
-  uint32_t stream_id;
-  uint64_t stream_instance_id;
-} __attribute__((__packed__)) packet_header;
-
-typedef struct packet_context {
-  packet_headerheader;
-  uint64_t timestamp_begin;
-  uint64_t timestamp_end;
-  uint64_t content_size;
-  uint64_t packet_size;
-  uint64_t packet_seq_num;
-  unsigned longevents_discarded;
-  uint32_t cpu_id;
-} __attribute__((__packed__)) packet_context;
-
-typedef struct {
-  uint8_t  id;
-  uint32_t event_id;
-  uint64_t ns;
-} __attribute__((__packed__)) event_header_compact;
-
-typedef struct {
-  event_header_compact header;
-  uint8_t  prev_comm[ THREAD_NAME_SIZE ];
-  int32_t  prev_tid;
-  int32_t  prev_prio;
-  int64_t  prev_state;
-  uint8_t  next_comm[ THREAD_NAME_SIZE ];
-  int32_t  next_tid;
-  int32_t  next_prio