21351 Commits

Author SHA1 Message Date
Gedare Bloom
e3f6d35f65 cpukit/score: avoid NULL and races in priority mutex
The PIP modifications from #3359 introduced new data structures
to track priority inheritance. Prioritized mutexes without PIP
share some of the code paths, and may result in NULL pointer
accesses. This patch checks for NULL, and also adds ISR critical
sections to an uncovered corner case during thread restarts.

Closes #3829.
2020-01-03 09:10:09 -07:00
Jonathan Brandmeyer
e816b4e961 shell: Correct argument order of mfill
Close #3723.

(cherry picked from commit 2e8a66d13f)
2019-03-14 09:56:40 -04:00
Sebastian Huber
68f2ea07c2 rfs: Remove erroneous call of rtems_disk_release()
The function rtems_rfs_buffer_sync() erroneously calls
rtems_disk_release(). This screws up the reference counting of the disk.

Close #3495.
2018-08-10 06:58:56 +02:00
Sebastian Huber
680d765089 sptests/sp36: Remove obsolete test program
It tests the (never really working) strict order mutex option.

Close #3406.
2018-06-19 07:59:57 +02:00
Gedare Bloom
b50468c6bf score: add Inherited_priorities priority queue and functions
Adds enqueue, dequeue, requeue, evaluate, and release functions
for the thread priority node priority queue of inherited priorities.
Add calls to these functions as needed to maintain the priority
queue due to blocking, unblocking, and priority changes.

Closes #3359.
2018-03-23 11:33:59 -04:00
Gedare Bloom
78b867e26d score: replace current and real priority with priority node
Encapsulate the current_priority and real_priority fields of
the thread control block with a Thread_Priority_node struct.
Propagate modifications throughout the tree where the two
fields are directly accessed.

Updates #3359.
2018-03-23 11:33:59 -04:00
Gedare Bloom
776caaed01 sptests: Add spmutex01 to build 2018-03-23 11:33:59 -04:00
Sebastian Huber
83e6cefaaf sptests/spmutex01: test flush with inherit prio 2018-03-23 11:33:59 -04:00
Gedare Bloom
95d5a0a9c9 sptests/spmutex01: strip out deadlock, c11, posix 2018-03-23 11:33:59 -04:00
Sebastian Huber
f9126f6629 sptests/spmutex01: add tests for lock nesting 2018-03-23 11:33:59 -04:00
Sebastian Huber
fc027be4f9 sptests/spmutex01: refactor and add deadlock test 2018-03-23 11:33:59 -04:00
Sebastian Huber
a5c1b2be0c score: Test thread priority queue disciplines
Add test sptests/spmutex01, since no existing uni-processor test covered
the thread priority queueing discipline for CORE mutexes.
2018-03-23 11:33:59 -04:00
Gedare Bloom
9f011b97d9 sptests/spsem05: another test of prio stepdown on sem release 2018-03-23 11:33:59 -04:00
Gedare Bloom
8e1421f6e3 sptests/spsem04: test prio stepdown on sem release
Closes #3263.
2018-03-23 11:33:59 -04:00
Gedare Bloom
79cf35de9b sptests: back-port spsem01, spsem02, and spsem03 from 4.11 2018-03-23 11:33:59 -04:00
Sebastian Huber
d1d4e0172a bsps: Fix rtems_interrupt_server_handler_remove() 2018-01-11 13:07:35 -05:00
Ralf Kirchner
95f3656ae9 dosfs: Fix msdos_format()
For FAT32 msdos_format() used to initialize first FAT entries to
non-zero values only if a volume label was given.  Absence of these
entries made mounting such a FAT32 volume fail.
2018-01-11 13:00:15 -05:00
Sebastian Huber
45f9cd01f5 libnetworking: Disconnect after mbuf shortage
The missing disconnect left the socket in an unusable state.  Each send
request resulted in an EISCONN error.
2018-01-11 12:43:25 -05:00
Sebastian Huber
0e75aae563 score: Use _Workspace_Allocate_or_fatal_error()
Use _Workspace_Allocate_or_fatal_error() consistently in case auto
extend is turned off.  This helps to avoid undefined behaviour in
_API_Mutex_Allocate() in case _API_Mutex_Information() fails.
2018-01-11 12:37:45 -05:00
Sebastian Huber
b6b8cd7fb1 rtems: PR1844: Fix MP process packet size 2018-01-11 12:27:26 -05:00
Sebastian Huber
17fa7d6160 librpc: PR2066: Fix for short enums
The XDR library has a problem on architectures with short enums like the
default ARM EABI.  Short enums means that the size of the enum type is
variable and the smallest integer type to hold all enum values will be
selected.  For many enums this is char.  The XDR library uses int32_t
for enum_t.  There are several evil casts from an enum type to enum_t
which leads to invalid memory accesses on short enum architectures.  A
workaround is to add appropriate dummy enum values.
2018-01-11 12:13:32 -05:00
Sebastien Bourdeauducq
a078d6f0ab network/bootp: PR2031: Add and use header file 2018-01-11 12:13:21 -05:00
Sebastian Huber
89dd2ec437 dosfs: Fix for no space left on device condition
The file size was wrong in the no space left on device condition.  This
resulted in turn in a read of an invalid block which lead to an EIO
error status.
2018-01-11 12:12:53 -05:00
Sebastien Bourdeauducq
0d653397a9 network/dhcp: PR1841: Fix DNS processing in DHCP 2018-01-11 12:08:24 -05:00
Gedare Bloom
991e1b8594 score/chain: Fix _Chain_Is_first and _Chain_Is_last
Updates #1964.
2018-01-10 09:42:02 -05:00
Michael Davidsaver
aecb508673 tftpDriver: don't free directory node's path string
Update #2375.
2017-01-26 07:41:42 +01:00
Michael Davidsaver
05d84959f7 tftpDriver: backport fixes
ensure that node_access is comparable in unmount()

Update #2375.
2017-01-26 07:41:38 +01:00
Michael Davidsaver
4bcbd8d6f0 tftpDriver: apply changes through master
from 4.10.2-15-g5b21eb6
to eb7753437f

Update #2375.
2017-01-26 07:41:24 +01:00
Joel Sherrill
e2f7059d7e m32csim-testsuite.tcfg: m32csim now completes build 2016-09-06 18:34:52 -05:00
Joel Sherrill
85910040d8 Backport capability to exclude tests from building
Backported build infrastructure and .tcfg files from master.
2016-09-06 10:31:16 +10:00
Joel Sherrill
7dc65fa6a6 Add autotools generated files 2016-09-04 19:48:45 -05:00
Chris Johns
b9d871f9e1 rtems-test-check: Ignore tests which require real ISR based clock tick
BSPs for simulators which do not include a clock tick interrupt source
are incapable of running some tests successfully. This is a common
characteristic of some BSPs and a fixed set of tests. There is no point
in duplicating this list of tests in those BSPs test configuration.

Read testsuites/testdata/require-tick-isr.tcfg for details.

Conflicts:
	testsuites/automake/test-subdirs.am
	tools/build/rtems-test-check
2016-09-04 19:38:15 -05:00
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