Commit Graph

27414 Commits

Author SHA1 Message Date
Sebastian Huber
cbc433c7a2 bsps/arm: Add .nocache section
This section can be use to provide a cache coherent memory area via
rtems_cache_coherent_add_area().
2014-11-27 10:33:30 +01:00
Sebastian Huber
038faca160 rtems: Add rtems_cache_coherent_allocate()
Add rtems_cache_coherent_free() and rtems_cache_coherent_add_area().
2014-11-27 10:33:30 +01:00
Josh Oguin
b164303012 tools/build/*.c: Clean up issues reported by CodeSonar
This code is built without warnings and ignored by Coverity Scan.
CodeSonar found a wide range of issues including buffer overruns,
buffer underruns, questionable type conversions, leaks, etc. This
set of patches addresses all reported issues.
2014-11-26 07:52:00 -06:00
Josh Oguin
d4ec0a2d75 monitor/mon-prmisc.c: Use puts() not fprintf()
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.
2014-11-26 07:52:00 -06:00
Josh Oguin
8b9bc54b5a objectgetnameasstring.c: Reformat _Objects_Get() switch to follow pattern 2014-11-26 07:52:00 -06:00
Josh Oguin
c562d0c9b0 objectimpl.h: Add _Assert() to _Objects_Invalidate_Id()
CodeSonar flagged this as a possible NULL deference. This should never
occur but adding the _Assert() ensures we are guarding against that.
2014-11-26 07:51:59 -06:00
Josh Oguin
fbafb8f249 chainimpl.h: Add _Assert() to _Chain_Initialize_empty()
CodeSonar flagged this as a potential NULL deference. That should never
occur but adding the _Assert() ensures we are checking that.
2014-11-26 07:51:59 -06:00
Josh Oguin
e106aa7380 cpukit/posix/src/timertsr.c: Add _Assert()
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 the _Assert() at least
will flag this if it ever occurs during a debug build and we can discuss
what happened.
2014-11-26 07:51:59 -06:00
Josh Oguin
90a8e42be4 monitor/mon-editor.c: Use puts() and snprintf() not fprintf() or sprintf()
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.

snprintf() places a limit on the length of the output from sprintf()
and avoids similar buffer overrun issues.
2014-11-26 07:51:59 -06:00
Josh Oguin
4862532fd9 imfs/imfs_handlers_link.c: Add _Assert for NULL pointer
CodeSonar flagged this as a possible dereference of a NULL pointer.
This should never occur so adding _Assert().
2014-11-26 07:51:59 -06:00
Josh Oguin
43d6a28fd1 dosfs/msdos_misc.c: Remove unnecessary operation
CodeSonar flagged the increment of this pointer as unneeded. The pointer
is not used past this point.
2014-11-26 07:51:58 -06:00
Josh Oguin
21c0ca8426 dosfs/msdos_file.c: Return an error if it occurs
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.
2014-11-26 07:51:58 -06:00
Josh Oguin
10f28a3af1 dosfs/msdos_conv.c: Remove unnecessary operations
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.
2014-11-26 07:51:58 -06:00
Josh Oguin
72f63eeff0 libcsupport/src/newlibc_exit.c: Remove dead code
This was flagged as an empty for statement by CodeSonar but is actually
unreachable code that should be removed.
2014-11-26 07:51:58 -06:00
Josh Oguin
f18fd4f2bc libcsupport/src/mount.c: Remove unnecessary operation
This was flagged by CodeSonar.
2014-11-26 07:51:57 -06:00
Josh Oguin
aed6e1de21 libchip/serial/z85c30.c: Remove redundant assignment
This was flagged by CodeSonar.
2014-11-26 07:51:57 -06:00
Josh Oguin
02958c5e53 libchip/serial/ns16550* and z8530*: Assert on baud number to avoid divide by 0
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.
2014-11-26 07:51:57 -06:00
Josh Oguin
0ad1e8001f libchip/display/disp_hcms29xx.c: Remove useless variable and check
This was flagged by CodeSonar.
2014-11-26 07:51:57 -06:00
Josh Oguin
61f8d668d0 libbsp/shared/bspinit.c: Document assumption of NULL returned 2014-11-26 07:51:57 -06:00
Josh Oguin
ba3b6fdc89 apimutex.c: Add _Assert for NULL pointer access
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 fail.
2014-11-26 07:51:56 -06:00
Sebastian Huber
fdd1e20579 shell: Include missing header 2014-11-26 09:58:40 +01:00
Sebastian Huber
90b0e28456 i2c: Do not close file descriptor 0 if open fails 2014-11-26 09:56:01 +01:00
Sebastian Huber
d6f0ca64a5 i2c: Avoid undefined right shift operation 2014-11-26 08:26:15 +01:00
Jennifer Averett
39af57c3f7 smp09: Resolve missing prototype warning. 2014-11-25 14:44:59 -06:00
Jennifer Averett
6291e9627e smp07: Resolve missing prototype warning. 2014-11-25 14:44:59 -06:00
Jennifer Averett
2c474a056f smp05: Resolve missing prototype warning. 2014-11-25 14:44:59 -06:00
Jennifer Averett
441dc1c1ad smp02: Resolve unused method warnings. 2014-11-25 14:44:59 -06:00
Jennifer Averett
4375b3b660 smp03: Remove set but not used warning.
Added status validation.
2014-11-25 14:44:59 -06:00
Jennifer Averett
689cba286f smpschedsem01: Remove unused variable warning. 2014-11-25 14:44:59 -06:00
Jennifer Averett
15e371fe67 smpschedaffinity02: Remove unused prototype. 2014-11-25 14:44:59 -06:00
Joel Sherrill
505b680642 rtems-rfs-rtems.c: Add cast to address warning 2014-11-25 12:58:01 -06:00
Joel Sherrill
ebb39a216d hexdump-conv.c: Use proper printf() formatting for wchar_t 2014-11-25 12:58:00 -06:00
Joel Sherrill
3bd0cd1ad5 main_edit.c: Do not reference beyond end of array 2014-11-25 12:58:00 -06:00
Joel Sherrill
d15202490c shell/main_edit.c: Note return value not checked
Coverity Id 1255320 spotted an unchecked return value.
2014-11-25 12:57:09 -06:00
Joel Sherrill
3211e8e9c0 cpukit/libcsupport/src/pwdgrp.c: Check return value
Coverity Id 1255518. mkdir() could fail. Check return value and return
on failure. Behavior is similar to if open() failed while writing the
files.
2014-11-25 12:57:09 -06:00
Joel Sherrill
630642e21c shell/main_blksync.c: Fix leak of file descriptor
Coverity Id 1063887. File descriptor not freed on error path.
2014-11-25 12:57:09 -06:00
Joel Sherrill
4afa216ba8 cpukit/libmisc/shell/main_edit.c: Fix use after free()
Coverity Id 1255353. Read from pointer after free().
2014-11-25 12:57:08 -06:00
Joel Sherrill
a0bf44e115 cpukit/dev/i2c/i2c-dev.c: Fix leak on error path
Coverity ID 1255520. fd was not closed on error path.
2014-11-25 12:57:08 -06:00
Jennifer Averett
0a0ded702a capture: Resolve failure path memory leak. 2014-11-25 12:50:17 -06:00
Sebastian Huber
e681762704 bdbuf: Use rtems_cache_aligned_malloc() 2014-11-25 16:12:59 +01:00
Sebastian Huber
7e5c9b895e rtems: Move rtems_cache_aligned_malloc()
Make sure also the size is cache aligned since otherwise we may have
some overlap with the next allocation block.  A cache invalidate on this
area would be fatal.
2014-11-25 16:08:16 +01:00
Sebastian Huber
7981a885f8 sptest/spcache01: New test cases 2014-11-25 16:08:16 +01:00
Sebastian Huber
42fe0d3fbb bsps/arm: L2C 310 avoid infinite loops 2014-11-25 16:08:16 +01:00
Sebastian Huber
0273349594 libcsupport: malloc_is_system_state_OK()
Move system state check to malloc_is_system_state_OK().
2014-11-25 16:08:16 +01:00
Sebastian Huber
46689a1ee1 arm: Use CPU_TIMESTAMP_USE_STRUCT_TIMESPEC
Converting 64-bit nanoseconds values into the common struct timeval or
struct timespec formats requires a 64-bit division to get the seconds
value.  Performance analysis of high network loads revealed that this is
too costly on ARM.
2014-11-25 16:08:16 +01:00
Jennifer Averett
44da98f08f smpcapture01: New test. 2014-11-24 14:04:54 -06:00
Jennifer Averett
11b3ba1b02 capture01: Use capture engine print methods. 2014-11-24 14:04:54 -06:00
Jennifer Averett
c577500023 capture: Remove whitespace and fix copyrights. 2014-11-24 14:04:54 -06:00
Jennifer Averett
66bf2af278 capture: Add SMP support.
To support smp data was broken into global and percpu capture data.
Capture control must be disabled prior to printing or setting of
watch points.
2014-11-24 14:04:54 -06:00
Jennifer Averett
04a13bdf74 capture: Move print methods out of cli for reuse.
Methods to print the data were moved from capture-cli into
a support area and are no longer static so that they can
be shared by test routines, or application code that wants
to use the capture engine without the shell interface.
2014-11-24 14:04:53 -06:00