Commit Graph

21319 Commits

Author SHA1 Message Date
Chris Johns
c1d7c5fa6e Change version to 4.10 to the rtems-bsps. 2016-09-04 12:29:40 +10:00
Chris Johns
f2aef52881 Back port rtems-bsps for use in the release procedure. 2016-09-02 13:37:42 +10:00
Sebastian Huber
6adad1e70a fat: Fix for invalid cluster sizes
A cluster size > 32KiB resulted in an infinite loop in
fat_init_volume_info() due to an integer overflow.

Update #2717.
2016-05-20 08:15:24 +02:00
Sebastian Huber
d346f705e2 posix: Fix return states of pthread_kill()
POSIX mandates that an error code is returned and not -1 plus errno.

Update #2715.
2016-05-17 13:48:08 +02:00
Sebastian Huber
e34b7a8d40 posix: Fix return status of pthread_cancel()
POSIX recommends ESRCH in case no thread exists for the specified
identifier.

Update #2713.
2016-05-17 08:42:10 +02:00
Sebastian Huber
90b51b5a44 RFS: Fix resource leak
Update #2433.
2015-10-21 10:05:47 +02:00
Nick Withers
3699161a36 Fixes breakage on at least FreeBSD.
closes #2379.
2015-08-01 10:15:43 -07:00
Michael Davidsaver
a4e052b53f tftpDriver: close() false error
closes #2376.
2015-07-29 11:04:18 -05:00
Jeffrey Hill
0f3388d1f3 rpc: misaligned pointer dereference in clnt_udp.c line 363
see #2248
2015-02-23 12:27:05 -05:00
Jeffrey Hill
2fc3deae2e rpc: misaligned address exception in get_myaddress.c
updates #2249 see #1401
2015-02-23 12:07:37 -05:00
Till Straumann
70148eef28 networking: alignment exception in ioctl(SIOCGIFCONF)
Access memory using a byte stream when copying to avoid unaligned
access. update #1401
2015-02-23 10:48:56 -05:00
Till Strauman
0863e8e390 pc386: scan all functions of multi-function PCI devices
The current algorithm scans all PCI busses (0..ff)
 and all devices (0..31) on each bus for bridges
 and determines the maximum of all subordinate
 busses encountered.

 However, the algorithm does not scan all functions
 present in multi-function devices -- I have a PCI express
 root complex (82801H) where multiple (non-zero index)
 functions are 'PCI bridges' whose subordinate bus number is
 missed by the original algorithm.

 This commit makes sure that the scan
 is extended to all functions of multi-function
 devices.

 See #2067
2014-12-23 22:29:08 -05:00
Sebastian Huber
f0f2a3dc19 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 11:15:18 +01:00
Pavel Pisa
7d015db0c6 SPI SD-Card: adapt common driver code to block devices core API changes.
close #1558
2014-11-27 11:00:48 +01:00
Sebastian Huber
0444c03180 Avoid buffer overflow and misaligned memory access 2014-11-24 08:58:24 +01:00
Sebastian Huber
d1d31a5f61 ppp: PR1943: Avoid NULL pointer access
Waiting for mbufs at this level is a bad solution.  It would be better
to try to allocate a new mbuf chain before we hand over the current mbuf
chain to the upper layer.  In case the allocation fails we should drop
the current packet and use its mbuf chain for a new packet.
2014-11-22 09:33:12 -05:00
Nickolay Semyonov
b47dffc510 capture: back-port conversion from task_name to task_id (see #1361) 2014-11-22 09:05:07 -05:00
Sebastian Huber
a62a3c32b1 score: PR2179: Fix initially locked PI mutex 2014-08-20 07:24:16 +02:00
Sebastian Huber
f8811e4364 ramdisk: Fix device name generation 2014-06-27 16:34:32 +02:00
Sebastian Huber
272a80b776 score: PR2179: Fix initially locked PCP mutexes
Elevate the priority of the creating task to the ceiling priority in
case a semaphore is created as initially locked.
2014-05-23 09:04:17 +02:00
Till Strauman
907cfb1e2f posix: fix race condition between pthread_create and capture engine
Fix PR 2068:
Reproducable crashes occur when using pthreads and the capture engine
at the same time. 'pthread_create()' is the culprit. It creates a SCORE thread
and then calls Thread_Start( ) without disabling thread-dispatching.
2014-04-11 15:40:16 -04:00
Aleksandr Platonov
fc48ad84c7 rtems_cache_invalidate_multiple_instruction_lines
According with comment in
rtems_cache_invalidate_multiple_instruction_lines(), final_address
indicates the last address which needs to be invalidated.  But if in
while loop we got final_address == i_addr condition then loop breaks and
final_address will not be invalidated.
2014-01-14 14:46:07 +01:00
Joel Sherrill
387c90b9a8 sparc.t: Correct for V8/V9 2013-11-20 15:53:27 -06:00
Pavel Pisa
df29cfeb0c SPI SD-Card: setup valid CRC-7 for STOP_TRANSMISSION command.
STOP_TRANSMISSION command is used to finish READ_MULTIPLE_BLOCK
command and its format is regular command format.
It requires valid CRC-7 to have effect at least on
same cards types else it is ignored and attempt
to issue next READ or WRITE commands results in
illegal command condition (0x04) preceded by strange
(0x3f) for tested card.

Signed-off-by: Pavel Pisa <ppisa@pikron.com>
2013-10-08 11:16:15 +02:00
Pavel Pisa
7c709c05e9 Backport of development SPI SD-card patches to RTEMS 4.10.
Arnout Vandecappelle:

        PR 1569/misc
        * libchip/i2c/spi-sd-card.c: Added CRC checks.

        PR 1576/misc
        * libchip/i2c/spi-sd-card.c: Enable CRC checks.

        PR 1567/misc
        * libchip/i2c/spi-sd-card.h, libchip/i2c/spi-sd-card.c: Fixed
        timeouts.

        PR 1579/misc
        * libchip/i2c/spi-sd-card.c: Gradually increasing sleep times when
        waiting for write to finish.

        PR 1580/misc
        * libchip/i2c/spi-sd-card.c: Use bigger chunks and yield processor
        while waiting for read data.

        PR 1586/misc
        * libchip/i2c/spi-sd-card.h, libchip/i2c/spi-sd-card.c: Add retries to
        SD card accesses.

Signed-off-by: Pavel Pisa <ppisa@pikron.com>
2013-10-08 11:14:42 +02:00
Sebastian Huber
ab0da63e3c score: PR2140: Fix _Thread_queue_Process_timeout()
The _Thread_queue_Process_timeout() operation had several race
conditions in the event of nested interrupts.  Protect the critical
sections via disabled interrupts.
2013-08-26 10:22:36 +02:00
Sebastian Huber
2077ae4cc8 score: PR2140: _Thread_queue_Extract()
Return if the executing context performed the extract operation since
interrupts may interfere.
2013-08-26 10:22:18 +02:00
Sebastian Huber
db99ce7ced libblock: PR2040: Avoid NULL pointer access
This partly reverts commit 08b9d53460.

Avoid a NULL pointer access and perform the source segment erase if
necessary.
2013-08-23 09:34:13 +02:00
Pavel Pisa
356b8c7baa bsp/csb336: Memory map update to support i.MX1 based PiMX1 as well.
CSB336 i.MX1/i.MXS memory map organization

 - SDRAM starts at address 0x08000000 but 2 MB are reserved
   for boot-block/loader (or other use) before RTEMS image
   origin/load address (that is kept from previous setup)

 - Caching of 30 MB of SDRAM used for RTEMS (start at 0x08200000)
   is changed to writeback mode which provides higher throughput.

 - The first 1 MB of RTEMS dedicated SDRAM is remapped to address 0
   to provide area for ARM CPU exceptions table.

 - Internal registers and rest of the Flash (above 1 MB) are mapped
   one to one. Registers region is extended to 2 MB to cover
   eSRAM found on i.MX1 chip variant.

 - The first two megabytes of SDRAM unused by RTEMS are mapped
   with attributes to allow specific purposes.

   - the first MB (at address 0x08000000) is nocached to allow
     directly set some values read by booot-block after warm reset

   - the second MB (at address 0x08100000) is set for write-through
     caching.  That allows to use memory for LCD frame-buffer without
     need to flush cache after each redraw.

Signed-off-by: Pavel Pisa <pi@baree.pikron.com>
2013-08-19 14:25:22 +02:00
Pavel Pisa
a791d39818 bsp/csb336: implement bsp_interrupt_vector_enable/disable.
Signed-off-by: Pavel Pisa <ppisa@pikron.com>
2013-08-19 14:25:18 +02:00
Pavel Pisa
4eeddefb22 bsp/csb336: mc9328mxl correct AITC access in bsp_interrupt_dispatch.
The original version is missing void and result is that (*x >> 16) is
optimized to ldh rX,[rY]. But it is not allowed/supported to access
bus/address range used by AITC by other than 32 bit wide accesses
and 16-bit access results in the data abort exception.
The corrected version works on real hardware and is even
more readable.

Signed-off-by: Pavel Pisa <ppisa@pikron.com>
2013-08-19 10:54:02 +02:00
Daron Chabot
833eeae358 Add c++ guard to header. 2013-05-16 11:47:09 +02:00
Sebastian Huber
8949e5b1a1 score: Fix _Objects_Shrink_information()
The chain iteration was wrong.  The chain tail is not an object.
2013-01-07 16:34:18 +01:00
Sebastian Huber
39691cd1b1 rtems: Critical fix for events
Commit 4b45c1393c marked a test in
_Event_Timeout() as debug only.  This test is required also in non-debug
configurations since otherwise state corruption can happen.  A revised
test sptests/spintrcritical10 checks the relevant sequences.
2013-01-07 15:21:40 +01:00
Sebastian Huber
073e3e106b score: Critical fix for timer server
Under certain conditions it is possible that a call to
_Watchdog_Adjust_to_chain() happens with a unit parameter value of zero
(for example sptests/spintrcritical17).  Remove superfluous checks that
prevent an adjust to a chain of a watchdog chain which first element has
a delta zero value.
2012-12-06 10:01:24 +01:00
Dylan Maxwell
d29f206209 tftpfs: PR1624: Fix parsing of hostnames and paths 2012-12-06 09:50:20 +01:00
Ralf Corsépius
c160bc2e97 Remove stray '/'. 2012-10-10 14:49:19 +02:00
Gedare Bloom
d692342a01 Delete lingering bspopts.h.in file 2012-08-09 10:26:07 -04:00
Ralf Corsépius
67aeb83f27 Use http://www.rtems.org/bugzilla as bug-URL. 2012-08-09 09:49:13 -04:00
Sebastian Huber
811e4b98ff libblock: Fix purge device tree traversal 2012-08-09 09:49:13 -04:00
Sebastian Huber
57d29cd5a9 bsp/genmcf548x: Enable FPU in BSP startup code 2012-05-02 10:27:08 +02:00
Sebastian Huber
eeb965b325 bsp/genmcf548x: Fix BSP options 2012-05-02 10:26:45 +02:00
Sebastian Huber
29c8aa6494 libblock: PR2040: Fix recycle destination update
Check the availablity of a recycle destination segment only when it is
necessary to avoid missing resycle source segment erasures.
2012-04-16 11:08:50 +02:00
Sebastian Huber
4abb14e5ca libblock: PR2040: Add starvation threshold
Do not use the unavailable block count as the erased blocks starvation
threshold.  Use instead the block count of the largest segment.  This
improves the starvation resolution gain of available blocks.
2012-04-16 11:08:38 +02:00
Sebastian Huber
108d6de7be PR2040: libtests/flashdisk01: New test 2012-03-14 11:27:15 +01:00
Sebastian Huber
941d470db4 PR2040: libblock: Flash disk starvations statistic 2012-03-14 11:27:14 +01:00
Sebastian Huber
1c47c470b3 PR2040: libblock: Flash disk documentation 2012-03-14 11:27:14 +01:00
Sebastian Huber
7b646be2bb PR2040: libblock: Fix return status 2012-03-14 11:26:17 +01:00
Sebastian Huber
b3142bdc50 PR2040: libblock: Avoid erased blocks starvation
The compaction process needs erased blocks.  It is only possible to
erase an entire segment.  Thus in order to make a progress we always
need enough erased blocks to empty a used or available segment which can
be erased in turn.  A (possibly the worst case) lower bound of erased
blocks is the block count of the largest segment.  The number of
unavailable blocks specified by the configuration will be used to
determine the erase blocks starvation situation.  The number of
unavailable blocks must be greater than or equal to the number of blocks
in the largest segment.
2012-03-14 11:26:17 +01:00
Sebastian Huber
d22a91e8f2 PR2040: libblock: Track number of erased blocks 2012-03-14 11:26:17 +01:00