Re: rtems_task_argument type

2014-11-25 Thread Joel Sherrill
On November 25, 2014 8:54:24 AM CST, Gabriel Ibarra gabriel.iba...@tallertechnologies.com wrote: Hi, I'm working with rtems task and I'm trying to pass a pointer object as argument of the task, using the RTEMS API. I saw that rtems_task_argument is defined as uintptr_t, so I assume that the

Epiphany - Alignment question (double word)

2014-11-25 Thread Hesham Moustafa
Hi all, I came across an issue with alignment when I am porting RTEMS to Epiphany now. The reference manual says that stores should be aligned according to the store instruction type (half word, word, double word). For example strd instruction should get an address aligned to 8 bytes. Although I

Re: coverity i2c Issue

2014-11-25 Thread Gedare Bloom
On Tue, Nov 25, 2014 at 2:03 PM, Joel Sherrill joel.sherr...@oarcorp.com wrote: Hi These appear to be easy to address. I would appreciate someone addressing these: i2c/eeprom.c: 221 1. Condition address_bytes 4, taking false branch 2. cond_at_most: Checking address_bytes 4 implies

Coverity untar Issue 1255358

2014-11-25 Thread Joel Sherrill
Hi There are two Coverity Issues with untar.c but this one seems especially odd to me. My reading of the following code is that if the creat() of the filename in the tar image fails, then the code reads the contents of the tar image and throws it away to skip it. What would be wrong with

Re: spsem01 does not terminate on sis (and real leon3 hardware)

2014-11-25 Thread Joel Sherrill
On 11/25/2014 4:49 PM, Jiri Gaisler wrote: On 11/25/2014 11:42 PM, Jiri Gaisler wrote: spsem01.exe executes correctly on sis and real hardware, but does not terminate. The program hangs in the bsp_idle_tread() after executing the final rtems_test_exit(0). Is this the intention of the

[PATCH 01/20] apimutex.c: Add _Assert for NULL pointer access

2014-11-25 Thread Joel Sherrill
From: Josh Oguin josh.og...@oarcorp.com CodeSonar detects a possible NULL deference here. But it should never occur in tested code. Memory for the API Mutexes is reserved by confdefs.h and are all preallocated when the class of objects is initialized. Allocating a single instance should never

[PATCH 03/20] libchip/display/disp_hcms29xx.c: Remove useless variable and check

2014-11-25 Thread Joel Sherrill
From: Josh Oguin josh.og...@oarcorp.com This was flagged by CodeSonar. --- c/src/libchip/display/disp_hcms29xx.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/c/src/libchip/display/disp_hcms29xx.c b/c/src/libchip/display/disp_hcms29xx.c index 50fce99..5730b36 100644

[PATCH 04/20] libchip/serial/ns16550* and z8530*: Assert on baud number to avoid divide by 0

2014-11-25 Thread Joel Sherrill
From: Josh Oguin josh.og...@oarcorp.com This was flagged by CodeSonar. It should be impossible to get an incorrect baud number back but ensure this in debug mode. The _Assert() keeps their scanner from evaluating for divide by 0 past this point. --- c/src/libchip/serial/ns16550-context.c | 4

[PATCH 05/20] libchip/serial/z85c30.c: Remove redundant assignment

2014-11-25 Thread Joel Sherrill
From: Josh Oguin josh.og...@oarcorp.com This was flagged by CodeSonar. --- c/src/libchip/serial/z85c30.c | 1 - 1 file changed, 1 deletion(-) diff --git a/c/src/libchip/serial/z85c30.c b/c/src/libchip/serial/z85c30.c index 1f43271..7c55a51 100644 --- a/c/src/libchip/serial/z85c30.c +++

[PATCH 07/20] libcsupport/src/newlibc_exit.c: Remove dead code

2014-11-25 Thread Joel Sherrill
From: Josh Oguin josh.og...@oarcorp.com This was flagged as an empty for statement by CodeSonar but is actually unreachable code that should be removed. --- cpukit/libcsupport/src/newlibc_exit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 08/20] libcsupport/src/sync.c: Indicate return value explicitly ignored

2014-11-25 Thread Joel Sherrill
From: Josh Oguin josh.og...@oarcorp.com This was flagged as an ignored return value by CodeSonar. --- cpukit/libcsupport/src/sync.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpukit/libcsupport/src/sync.c b/cpukit/libcsupport/src/sync.c index 653a177..b8e5059

[PATCH 10/20] dosfs/msdos_file.c: Return an error if it occurs

2014-11-25 Thread Joel Sherrill
From: Josh Oguin josh.og...@oarcorp.com CodeSonar flagged this as a case where the return value from fat_sync() was not used. Now it is used to return pass/fail to the caller. --- cpukit/libfs/src/dosfs/msdos_file.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

[PATCH 11/20] dosfs/msdos_misc.c: Remove unnecessary operation

2014-11-25 Thread Joel Sherrill
From: Josh Oguin josh.og...@oarcorp.com CodeSonar flagged the increment of this pointer as unneeded. The pointer is not used past this point. --- cpukit/libfs/src/dosfs/msdos_misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpukit/libfs/src/dosfs/msdos_misc.c

[PATCH 14/20] cpukit/posix/src/timertsr.c: Add _Assert()

2014-11-25 Thread Joel Sherrill
From: Josh Oguin josh.og...@oarcorp.com CodeSonar flagged this as an empty if body. Upon analysis, it turned out to be an error that we think should never occur but if it did, there is nothing we could do about it. It would likely just indicate the thread was deleted before we got here. Adding

[PATCH 15/20] chainimpl.h: Add _Assert() to _Chain_Initialize_empty()

2014-11-25 Thread Joel Sherrill
From: Josh Oguin josh.og...@oarcorp.com CodeSonar flagged this as a potential NULL deference. That should never occur but adding the _Assert() ensures we are checking that. --- cpukit/score/include/rtems/score/chainimpl.h | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff

[PATCH 16/20] objectimpl.h: Add _Assert() to _Objects_Invalidate_Id()

2014-11-25 Thread Joel Sherrill
From: Josh Oguin josh.og...@oarcorp.com CodeSonar flagged this as a possible NULL deference. This should never occur but adding the _Assert() ensures we are guarding against that. --- cpukit/score/include/rtems/score/objectimpl.h | 6 ++ 1 file changed, 6 insertions(+) diff --git

[PATCH 17/20] objectgetnameasstring.c: Reformat _Objects_Get() switch to follow pattern

2014-11-25 Thread Joel Sherrill
From: Josh Oguin josh.og...@oarcorp.com --- cpukit/score/src/objectgetnameasstring.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cpukit/score/src/objectgetnameasstring.c b/cpukit/score/src/objectgetnameasstring.c index 099d837..7505c02 100644 ---

[PATCH 18/20] monitor/mon-prmisc.c: Use puts() not fprintf()

2014-11-25 Thread Joel Sherrill
From: Josh Oguin josh.og...@oarcorp.com CodeSonar flagged this as a case where the user could inject a format string and cause issues. Since we were not printing anything but a string, just switching to puts() rather than fprintf(stdout,...) was sufficient to make this code safer. ---

[PATCH 19/20] libcsupport/src/sync.c: Explicitly ignore return status

2014-11-25 Thread Joel Sherrill
From: Josh Oguin josh.og...@oarcorp.com CodeSonar spotted that the return values were being ignored. --- cpukit/libcsupport/src/sync.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cpukit/libcsupport/src/sync.c b/cpukit/libcsupport/src/sync.c index b8e5059..0e935ce

[PATCH 09/20] dosfs/msdos_conv.c: Remove unnecessary operations

2014-11-25 Thread Joel Sherrill
From: Josh Oguin josh.og...@oarcorp.com These were flagged by CodeSonar. The assignments on variable declaration are overridden a few lines below and the other line later with name_size is where name_size was not used after this assignment. --- cpukit/libfs/src/dosfs/msdos_conv.c | 5 ++--- 1

Re: spsem01 does not terminate on sis (and real leon3 hardware)

2014-11-25 Thread Joel Sherrill
On 11/25/2014 4:54 PM, Joel Sherrill wrote: On 11/25/2014 4:49 PM, Jiri Gaisler wrote: On 11/25/2014 11:42 PM, Jiri Gaisler wrote: spsem01.exe executes correctly on sis and real hardware, but does not terminate. The program hangs in the bsp_idle_tread() after executing the final

Re: [PATCH 19/20] libcsupport/src/sync.c: Explicitly ignore return status

2014-11-25 Thread Sebastian Huber
On 26/11/14 00:02, Joel Sherrill wrote: From: Josh Oguin josh.og...@oarcorp.com CodeSonar spotted that the return values were being ignored. --- cpukit/libcsupport/src/sync.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cpukit/libcsupport/src/sync.c

Re: Please review RTEMS JFFS2 Adapter Issue

2014-11-25 Thread Sebastian Huber
Hello Joel, On 25/11/14 20:30, Joel Sherrill wrote: Coverity Id 1255348 in fs-rtems.c can't be ignored on the grounds the JFFS2 project will see it. this is one-to-one copy from the eCos code. I don't know how and why it works. -- Sebastian Huber, embedded brains GmbH Address :