Commit Graph

27398 Commits

Author SHA1 Message Date
Jan Dolezal
038e1dba31 i386: doxygen and comments related to VESA real mode framebuffer 2014-12-04 13:37:50 -05:00
Jan Dolezal
d78eac64a8 i386/pc386: cammelCase (struct and function names) to underscores, typedefed structs, break >80 chars lines, removed newlines at EOFs
fb_vesa_rm.c: removed inline from functions declared in fb_vesa.h
              removed unnecessary printks in the end of patch
edid.h, vbe3.h: switched from custom *PACKED_ATTRIBUTE at the structs to the
                RTEMS_COMPILER_PACKED_ATTRIBUTE for easier maintainability
                of doxygen
2014-12-04 13:37:50 -05:00
Sebastian Huber
adc1dbeb39 bsp/leon3: Fix trap table initialization
Fixes bug introduced with dff1803cfb.
2014-12-04 15:16:26 +01:00
Daniel Hellstrom
dff1803cfb SPARC: optimize IRQ enable & disable
* Coding style cleanups.
* Use OS reserved trap 0x89 for IRQ Disable
* Use OS reserved trap 0x8A for IRQ Enable
* Add to SPARC CPU supplement documentation

This will result in faster Disable/Enable code since the
system trap handler does not need to decode which function
the user wants. Besides the IRQ disable/enabled can now
be inline which avoids the caller to take into account that
o0-o7+g1-g4 registers are destroyed by trap handler.

It was also possible to reduce the interrupt trap handler by
five instructions due to this.
2014-12-04 12:51:11 +01:00
Ben Gras
4081032ce0 pc386 bsp fix for default mode
If USE_VBE_RM is 0, vesa_realmode_bootup_init() is not available so the
test should be #if instead of #ifdef.
2014-12-03 18:06:29 +01:00
Sebastian Huber
8905201985 monitor: Replace puts() with proper fprintf() 2014-12-03 13:03:13 +01:00
Sebastian Huber
0104056056 sptests: Add get_one_tick_busy_value()
Extract this function from
interrupt_critical_section_test_support_initialize().
2014-12-03 11:19:53 +01:00
Sebastian Huber
f54e50339c libtests: Omit libdl tests if no RTEMS tools 2014-12-03 08:27:55 +01:00
Nick Withers
fa4fe456b7 Move the flash size probe into bankValidate()
Previously, bankValidate() could be called (e.g., BSP_flashWrite() -> regionCheckAndErase() -> argcheck() -> bankValidate()) without the probe having happened. When it then invoked BSP_flashCheckId(), unmapped memory could be read, possibly causing a fatal exception.
2014-12-03 07:51:02 +01:00
Jiri Gaisler
2501814ee9 sparc/leon2: LEON_Is_interrupt_masked for Leon2 in leon.h wrongly defined
Condition needs to be inverted, as a 1 in the mask register means
    that the interrupt is enabled. Solves ticket #1959 in trac.
2014-12-02 14:04:11 +01:00
Jiri Gaisler
291f30f285 sparc/leon3: LEON_Is_interrupt_masked for Leon3 in leon.h wrongly defined
Condition needs to be inverted, as a 1 in the mask register means
that the interrupt is enabled. Solves ticket #1958 in trac.
2014-12-02 14:04:04 +01:00
Daniel Hellstrom
0d3b5d4742 SPARC: optimize window underflow trap
Save five instructions on underflow handling.

By using an optimized trap entry we can move instructions from
the window underflow function into the trap entry vector. By
setting WIM=0 and using RESTORE it is possible to move the
new WIM register content from the trapped window into the
to-be-restored register window. It is then possible to avoid
the WIM write delay.
2014-12-02 13:57:20 +01:00
Daniel Hellstrom
6930aa7f19 SPARC: optimize window overflow trap entry
By using a optimized trap entry we can move instructions from
the window overflow function into the trap entry vector. By
using the saved locals instead of g1 we don't need to save
that register temporarily. Also spead out non store instructions
inbetween stores to use the write buffer better.
2014-12-02 13:57:15 +01:00
Daniel Hellstrom
348d1812ba SPARC: window overflow optimization
I see no need for waiting the 3 instruction delay for wim to be
written in this case, since the STD after does not depend on WIM
2014-12-02 13:55:50 +01:00
Daniel Hellstrom
e7e92da52e DEVFS04: make test work on LEON3-FT GR712RC
The LEON3 BSP have support for up to 8 termios consoles, the
LEON3-FT GR712RC uses 6 UARTs.

This does not take into account the BSP maximum devices instead
it is hardcoded to 6. This patch increases it the maximum
devices of DEVFS04 from 6 to 10.
2014-12-02 13:47:37 +01:00
Daniel Hellstrom
9e8d8b5ce3 spcpuset01: fix test comments 2014-12-02 13:46:42 +01:00
Daniel Cederman
e4d8513707 nfs: Add RPCd task affinity config option
Similar to the task priority option, the new CPU affinity
option is first controlled by the RPCI specific rpciodCpuset
option. If that is not set, it uses the global network task config.
If that is also not set, it falls back to not setting the affinity
at all, using all CPUs.
2014-12-02 13:41:20 +01:00
Daniel Cederman
69e3f272d9 net: Add network task affinity config
This patch adds a default network tasks CPU affinity configuration
option. The network drivers have the option to create their own
daemon tasks with a custom CPU affinity set, or rely on the
default set.
2014-12-02 13:41:15 +01:00
Sebastian Huber
9ab1558f6e tools: Provide strnlen() if missing 2014-12-02 13:05:30 +01:00
Sebastian Huber
80d99aa20c libtests/complex,math: Prevent optimizations
For constant arguments GCC calculates the values of the math library
functions at compile-time.

close #1741
2014-12-01 08:20:55 +01:00
Chris Johns
dd309b1054 m68k/mcf5235: GCC 4.9.2 generates invalid code for Init5235.
Move the vector table copy out of the Init5235 source to avoid
stipping the GCC bug.

Fixes #2204.
2014-12-01 14:55:23 +11:00
Chris Johns
e37e8504f1 libmisc/shell: Edit history hack is corrupting memory. Remove it.
The hack was a debug aid and is not needed.

Close #2203.
2014-12-01 14:53:55 +11:00
Sebastian Huber
d006b46df3 score: Add heap statistics
Add lifetime bytes allocated and freed since they were present in the
malloc statistics.  Add number of failed allocations.
2014-11-28 13:09:11 +01:00
Sebastian Huber
2c3c657625 score: Return heap stats via _Heap_Get_information
Print out heap statistics via the MALLOC and WKSPACE shell commands.
2014-11-28 13:09:07 +01:00
Sebastian Huber
01557b0c6e libcsupport: Delete malloc statistics
Use the heap handler statistics instead.  Add heap walk option to MALLOC
shell command.

close #1367
2014-11-28 11:23:53 +01:00
Sebastian Huber
3b4ca3ab0f bdbuf: Fix race condition with sync active flag
Bug report by Oleg Kravtsov:

In rtems_bdbuf_swapout_processing() function there is the following
lines:

if (bdbuf_cache.sync_active && !transfered_buffers)
{

    rtems_id sync_requester;
    rtems_bdbuf_lock_cache ();
    ...

}

Here access to bdbuf_cache.sync_active is not protected with anything.
Imagine the following test case:

1. Task1 releases buffer(s) with bdbuf_release_modified() calls;

2. After a while swapout task starts and flushes all buffers;

3. In the end of that swapout flush we are before that part of code, and
assume there is task switching (just before "if (bdbuf_cache.sync_active
&& !transfered_buffers)");

4. Some other task (with higher priority) does bdbuf_release_modified
and rtems_bdbuf_syncdev().

This task successfully gets both locks sync and pool (in
rtems_bdbuf_syncdev() function), sets sync_active to true and starts
waiting for RTEMS_BDBUF_TRANSFER_SYNC event with only sync lock got.

5. Task switching happens again and we are again before "if
(bdbuf_cache.sync_active && !transfered_buffers)".

As the result we check sync_active and we come inside that "if"
statement.

6. The result is that we send RTEMS_BDBUF_TRANSFER_SYNC event! Though
ALL modified messages of that task are not flushed yet!

close #1485
2014-11-28 10:56:46 +01:00
Joel Sherrill
e22af784cd sync.c: Add asserts to document and check assumptions 2014-11-27 10:06:23 -06:00
Joel Sherrill
8dbbea6bcc msdos_file.c: Reverse return codes per Gedare 2014-11-27 09:29:16 -06:00
Joel Sherrill
a8b071dbd5 rtems-bin2c.c: Fix free() of altered pointer 2014-11-27 09:28:42 -06:00
Sebastian Huber
3a8566b796 bsp/qoriq: Delete empty header file
close #2062
2014-11-27 14:03:34 +01:00
Sebastian Huber
43b09a9865 shell: Make mv, cp and rm usable for applications
close #2030
2014-11-27 13:37:52 +01:00
Sebastian Huber
0ff1c29d96 smptests/smpmrsp01: Use busy waits
Use busy waits instead of sleeps to avoid unnecessary switches to the
idle thread.
2014-11-27 10:33:31 +01:00
Sebastian Huber
5bd822a779 smp: Fix scheduler helping protocol
Ensure that scheduler nodes in the SCHEDULER_HELP_ACTIVE_OWNER or
SCHEDULER_HELP_ACTIVE_RIVAL helping state are always
SCHEDULER_SMP_NODE_READY or SCHEDULER_SMP_NODE_SCHEDULED to ensure the
MrsP protocol properties.
2014-11-27 10:33:31 +01:00
Sebastian Huber
79569ae655 smp: Fix scheduler helping protocol assertions 2014-11-27 10:33:31 +01:00
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