Commit Graph

33527 Commits

Author SHA1 Message Date
Vijay Kumar Banerjee
4bae9c31b4 MAINTAINERS: Add myself to Write After Approval 2020-03-25 01:04:01 +05:30
Sebastian Huber
96402b74a8 score: Document _TLS_Alignment 2020-03-23 16:16:18 +01:00
Sebastian Huber
24c21795ea score: Fix size of TLS_Thread_control_block
On most architectures, the size of the thread-local storage TCB must be
8 bytes.  Fix the definition for 64-bit targets.
2020-03-23 15:57:50 +01:00
Sebastian Huber
d05a900a5b sptests/sptls02: Add test case
Add a test case which requires the use of __tls_guard() and
__tls_init().

Change license to BSD-2-Clause.
2020-03-23 15:44:41 +01:00
Sebastian Huber
3fd4889157 conf: Improve evaluation of event recording opts
Check for configuration errors earlier.  Allow fatal dumps without the
other extensions.  Add some warnings.

Update #3904.
2020-03-23 07:40:36 +01:00
Joel Sherrill
37e7cc5f4c gdbarmsim: Remove
Closes #3611.
2020-03-19 15:55:26 -05:00
Sebastian Huber
ab42b3e100 record: Add rtems_record_dump()
Add rtems_record_dump_base64() and rtems_record_dump_base64_zlib().

Add CONFIGURE_RECORD_FATAL_DUMP_BASE64 and
CONFIGURE_RECORD_FATAL_DUMP_BASE64_ZLIB configuration options.

Update #3904.
2020-03-18 07:20:52 +01:00
Sebastian Huber
c584d4eda4 rtems: Add rtems_put_char()
Update #3904.
2020-03-16 11:54:27 +01:00
Sebastian Huber
a6b3633459 score: Add _IO_Base64()
Update #3904.
2020-03-16 11:54:26 +01:00
Sebastian Huber
5662210311 bsps: Remove legacy interrupt API from default
This fixes linker issues on the powerpc/virtex4 and powerpc/virtex5
BSPs.
2020-03-13 15:20:30 +01:00
Sebastian Huber
aa2d5d930e bsp/virtex: Remove duplicate include 2020-03-13 15:20:30 +01:00
Sebastian Huber
c2287ba2cf libio: Robust file descriptor reference counting
There was a race conditon in the reference counting of file descriptors
during a close() operation.  After the call to the close handler, the
rtems_libio_free() function cleared the flags to zero.  However, at this
point in time there may still exist some holders of the file descriptor.
With RTEMS_DEBUG enabled this could lead to failed assertions in
rtems_libio_iop_drop().

Change the code to use only atomic read-modify-write operations on the
rtems_libio_iop::flags.
2020-03-13 09:57:04 +01:00
Joel Sherrill
2ff8363466 mrm332-testsuite.tcfg: Add dl01 2020-03-12 16:00:25 -05:00
Joel Sherrill
a518795655 rtl22xx-testsuite.tcfg: Add dl10 and ttest01 2020-03-12 16:00:05 -05:00
Joel Sherrill
9bbfb2b693 lpc23xx_tli800-testsuite.tcfg: Add ttest01 2020-03-12 15:59:35 -05:00
Joel Sherrill
ae6597f93a lpc2362-testsuite.tcfg: Add ttest01 2020-03-12 15:59:10 -05:00
Joel Sherrill
16ed7f6497 lm3s3749-testsuite.tcfg: Add ttest01 2020-03-12 15:53:51 -05:00
Sebastian Huber
0161b93d50 imfs: Replace devfs with an IMFS specialization
Add a simplified path evaluation function IMFS_eval_path_devfs() for a
device only IMFS configuration.

The code size can be further reduced by the application if it disables
the support for legacy IO drivers via:

  #define CONFIGURE_IMFS_DISABLE_MKNOD
  #define CONFIGURE_IMFS_DISABLE_MKNOD_DEVICE

Obsolete CONFIGURE_MAXIMUM_DEVICES.  Remove BSP_MAXIMUM_DEVICES.

Update #3894.
Update #3898.
2020-03-09 17:26:54 +01:00
Sebastian Huber
103a371faa imfs: Simplify code generation
Update #3894.
2020-03-09 17:15:20 +01:00
Sebastian Huber
277b9dd3f7 imfs: Remove unused handlers
Update #3894.
2020-03-09 17:15:20 +01:00
Sebastian Huber
83994913b6 imfs: Constify imfs_memfile_bytes_per_block
The CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK value is validated by
<rtems/confdefs/libio.h>.  Changing this value during runtime could lead
to memory corruption.

Update #3894.
2020-03-09 17:15:20 +01:00
Sebastian Huber
85c9145f09 imfs: Use _IMFS_get_time()
Update #3894.
2020-03-09 17:15:20 +01:00
Sebastian Huber
624d691bdc libio: Constify some functions 2020-03-09 17:15:20 +01:00
Joel Sherrill
097ea1ecc5 psim: Rework device tree so devices do not conflict with 256MB RAM
updates #3849.
2020-03-05 18:27:52 -06:00
Sebastian Huber
fa3005f6c1 console: Use IMFS_add_node() for simple task cons
Change license to BSD-2-Clause according to file history.

Update #3053.
Update #3894.
2020-03-04 09:38:58 +01:00
Sebastian Huber
7e3b5c0ced console: Use IMFS_add_node() for simple console
Change license to BSD-2-Clause according to file history.

Update #3053.
Update #3894.
2020-03-04 09:37:59 +01:00
Sebastian Huber
fa44c3903a imfs: Add IMFS_add_node()
Update #3894.
2020-03-04 09:30:03 +01:00
Sebastian Huber
13b71f88f4 imfs: Simplify IMFS_create_node()
Update #3894.
2020-03-04 09:30:03 +01:00
Sebastian Huber
0b0cd93a40 imfs: Remove IMFS_NODE_FLAG_NAME_ALLOCATED
Remove IMFS_NODE_FLAG_NAME_ALLOCATED and instead replace the node
control in rename operations.  This avoids a special case in the general
node destruction which pulled in free().

Update #3894.
2020-03-04 09:30:02 +01:00
Sebastian Huber
8b73ee5023 rtems: rtems_scheduler_get_processor_maximum()
In uniprocessor configurations, use compile-time constants for
rtems_scheduler_get_processor_maximum() and
rtems_scheduler_get_processor().  This helps compilers and static
analyzers to deduce that some loop bodies are only executed once and
some conditional statements have a fixed outcome (may improve code
generation and reduce false positives).

In SMP configurations, directly provide the internal implementation for
performance reasons.
2020-03-04 08:43:45 +01:00
Sebastian Huber
fdeaa64e17 config: Remove <rtems/btimer.h> include
The use of CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER does not define
anything, so remove the <rtems/btimer.h> include.

Update #3875.
2020-03-04 08:43:45 +01:00
Sebastian Huber
60b769335e sptests/spheapprot: Fix warning 2020-03-04 08:43:45 +01:00
Sebastian Huber
c4d5a341bd fstests/fsrename: Rename a file twice 2020-03-03 11:35:11 +01:00
Sebastian Huber
198c07e5a5 sptests/spextensions01: Add comment
Update #3885.
2020-03-03 07:30:04 +01:00
Sebastian Huber
180201094e rtems: Add rtems_scheduler_map_priority_from_posix()
Update #3881.
2020-03-03 07:10:55 +01:00
Sebastian Huber
38736c69f8 rtems: Add rtems_scheduler_map_priority_to_posix()
Update #3881.
2020-03-03 07:09:59 +01:00
Sebastian Huber
fd8c87a8cf dtc: Update VERSION 2020-03-02 07:52:21 +01:00
Simon Glass
5fa49fa43c libfdt: Allow exclusion of fdt_check_full()
This function is used to perform a full check of the device tree. Allow
it to be excluded if all assumptions are enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20200220214557.176528-9-sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-03-02 07:52:21 +01:00
Simon Glass
83cd34199a libfdt: Add support for disabling ordering check/fixup
Add a way to remove this check and the reordering code, which is
unnecessary if the dtb is known to be correctly ordered.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20200220214557.176528-8-sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-03-02 07:52:21 +01:00
Simon Glass
0791bdf89e libfdt: Add support for disabling version checks
Allow enabling FDT_ASSUME_LATEST to disable version checks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20200220214557.176528-7-sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-03-02 07:52:21 +01:00
Simon Glass
23fe4d7b98 libfdt: Add support for disabling rollback handling
Allow enabling FDT_ASSUME_NO_ROLLBACK to disable rolling back after a
failed operation.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20200220214557.176528-6-sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-03-02 07:52:21 +01:00
Simon Glass
52d4c65008 libfdt: Add support for disabling sanity checks
Allow enabling ASSUME_VALID_INPUT to disable sanity checks on the device
tree and the parameters to libfdt. This assumption covers that cases where
the problem could be with either.

Signed-off-by: Simon Glass <sjg@chromium.org>
Message-Id: <20200220214557.176528-5-sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-03-02 07:52:21 +01:00
Simon Glass
e9ebc6ab87 libfdt: Add support for disabling dtb checks
Support ASSUME_VALID_DTB to disable some sanity checks

If we assume that the DTB itself is valid then we can skip some checks and
save code space. Add various conditions to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Message-Id: <20200220214557.176528-4-sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-03-02 07:52:21 +01:00
Simon Glass
b44c574d85 Add a way to control the level of checks in the code
Add a new ASSUME_MASK option, which allows for some control over the
checks used in libfdt. With all assumptions enabled, libfdt assumes that
the input data and parameters are all correct and that internal errors
cannot happen.

By default no assumptions are made and all checks are enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
Message-Id: <20200220214557.176528-3-sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-03-02 07:52:21 +01:00
Simon Glass
461c735406 libfdt: De-inline fdt_header_size()
There does not seem to be a strong reason to inline this function. Also
we are about to add some extra code to it which will increase its size.

Move it into fdt.c and use a simple declaration in libfdt.h

Signed-off-by: Simon Glass <sjg@chromium.org>
Message-Id: <20200220214557.176528-2-sjg@chromium.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-03-02 07:52:21 +01:00
David Gibson
7217a4f40b libfdt: Correct prototype for fdt_ro_probe_()
This function returns an int32_t, however the prototype in
libfdt_internal.h shows it returning an int.  We haven't caught this before
because they're the same type on nearly all platforms this gets built on.
Apparently it's not the case on FreeRTOS, so someone hit this mismatch
building for that platform.

Reported-by: dharani kumar <dharanikumarsrvn@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-03-02 07:52:20 +01:00
Luc Michel
94d5b6ea56 libfdt.h: add explicit cast from void* to uint8_t* in fdt(32|64)_st
Including libfdt.h in a C++ project fails during compilation with recent
version of GCC or Clang.

This simple example:

extern "C" {
 #include <libfdt.h>
}

int main(void) { return 0; }

leads to the following errors with GCC 9.1.0:

/usr/include/libfdt.h: In function ‘void fdt32_st(void*, uint32_t)’:
/usr/include/libfdt.h:139:16: error: invalid conversion from ‘void*’ to ‘uint8_t*’ {aka ‘unsigned char*’} [-fpermissive]
  139 |  uint8_t *bp = property;
      |                ^~~~~~~~
      |                |
      |                void*
/usr/include/libfdt.h: In function ‘void fdt64_st(void*, uint64_t)’:
/usr/include/libfdt.h:163:16: error: invalid conversion from ‘void*’ to ‘uint8_t*’ {aka ‘unsigned char*’} [-fpermissive]
  163 |  uint8_t *bp = property;
      |                ^~~~~~~~
      |                |
      |                void*

This commit adds an explicit cast to uint8_t* to fix this issue.

Signed-off-by: Luc Michel <luc.michel@greensocs.com>
Message-Id: <20190910104824.1321594-1-luc.michel@greensocs.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-03-02 07:52:20 +01:00
David Gibson
39f64e089c libfdt: Allow #size-cells of 0
c12b2b0c20eb "libfdt: fdt_address_cells() and fdt_size_cells()" introduced
a bug as it consolidated code between the helpers for getting
#address-cells and #size-cells.  Specifically #size-cells is allowed to
be 0, and is frequently found so in practice for /cpus.  IEEE1275 only
requires implementations to handle 1..4 for #address-cells, although one
could make a case for #address-cells == #size-cells == 0 being used to
represent a bridge with a single port.

While we're there, it's not totally obvious that the existing implicit
cast of a u32 to int will give the correct results according to strict C,
although it does work in practice.  Straighten that up to cast only after
we've made our range checks.

Reported-by: yonghuhaige via https://github.com/dgibson/dtc/issues/28
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-03-02 07:52:20 +01:00
David Gibson
1a5c324480 libfdt: Tweak data handling to satisfy Coverity
In libfdt we often sanity test fdt_totalsize(fdt) fairly early, then
trust it (but *only* that header field) for the remainder of our work.
However, Coverity gets confused by this - it sees the byteswap in
fdt32_ld() and assumes that means it is coming from an untrusted source
everytime, resulting in many tainted data warnings.

Most of these end up with logic in fdt_get_string() as the unsafe
destination for this tainted data, so let's tweak the logic there to make
it clearer to Coverity that this is ok.

We add a sanity test on fdt_totalsize() to fdt_probe_ro_().  Because the
interface allows bare ints to be used for offsets, we already have the
assumption that totalsize must be 31-bits or less (2GiB would be a
ludicrously large fdt).  This makes this more explicit.

We also make fdt_probe_ro() return the size for convenience, and change the
logic in fdt_get_string() to keep it in a local so that Coverity can see
that it has already been bounds-checked.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-03-02 07:52:20 +01:00
Rob Herring
0b83b822d7 libfdt: Replace GPL/BSD boilerplate/reference with SPDX tags
Replace instances of dual GPLv2 or BSD license boilerplate with SPDX tags.

Signed-off-by: Rob Herring <robh@kernel.org>
Message-Id: <20190620211944.9378-3-robh@kernel.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2020-03-02 07:52:20 +01:00