Commit graph

99049 commits

Author SHA1 Message Date
Kumar Gala
2893be57ef scripts: extract_dts_includes: Split out yaml_list info
Have the yaml_list now have 'node', 'bus', and 'compat' information
instead of just the 'node' info.  For now we have all YAML nodes under
yaml_list['node'], however this will change to support sensors that
can be on I2C or SPI, since they will have the same compat, but
different YAML nodes.

This also introduces yaml_list['bus'] which has YAML nodes for any
compatiables on a given 'parent' bus (ie, 'i2c', or 'spi').

Finally, we also have yaml_list['compat'] with all the compatiables
that we parsed and matched to a YAML.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-12-07 09:08:04 -06:00
Kumar Gala
f34a99532a scripts: extract_dts_includes: Pass node address to get_binding
Change get_binding to take the node address instead of the
compatiable.  This is in prep for having get_binding be able to look
at the parent of the node and determine which bus specific binding to
utilize (for cases like sensors that support both I2C & SPI).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-12-07 09:08:04 -06:00
Kumar Gala
112b0f5eff scripts: extract_dts_includes: Add accessor function to access binding
Add accessor functions get_binding and get_binding_compats to
encapsulate access to binding database info.  Cleanup all direct access
to binding info and replace with calls to get_binding() and
get_binding_compats()

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-12-07 09:08:04 -06:00
Kumar Gala
35afcc9c12 scripts: extract_dts_includes: remove passing yaml param to functions
Various functions like add_prop_aliases, extract_single_prop,
extract_single, reg.extract, compatible.extract, default.extract, and
flash.extract don't use the yaml argument that is passed to them.
Remove passing the argument, this is the first step in making access to
the yaml node information go through an accessor function.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-12-07 09:08:04 -06:00
Kumar Gala
b7f5101e79 scripts: extract_dts_includes: Handle YAML inheritance when we load
Move the handling of 'inherits' in the YAML to right when we load.  This
allows us to remove yaml_collapse function and will allow us to look
into the yaml right after we load it for things like if the yaml is for
a child bus.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-12-07 09:08:04 -06:00
Jukka Rissanen
2b268f8d3d net: gptp: state2str() func is only available if debugging
The state2str() function should only be used if debugging
is enabled thus add some pre-processor checks there.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 16:43:59 +02:00
Jukka Rissanen
3af324033e net: gptp: Add more debugging when changing state
Print function and line number when changing state and when
debugging is enabled. Otherwise it is a bit difficult to follow
the program logic and locate the state change operation.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 16:43:59 +02:00
Jukka Rissanen
83f38b5f2d net: gptp: Remove log_strdup() when printing packet info
As the msg parameter for PRINT_INFO() is always a const string
that is not coming from stack, there is no need to use
log_strdup() here. This helps to avoid the
"<log_strdup alloc failed>" messages.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 16:43:59 +02:00
Jukka Rissanen
ff0483c5af net: gptp: Get the gPTP header properly
If the link layer header is in the separate net_buf,
then skip that one.

Fixes #11827

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 16:43:59 +02:00
Peter A. Bigot
2dbecc2f2a i2c: support const correctness for write operations
Material that is being written to the device, as well as blocks of
octets used to specify the operation, are never written to by the I2C
infrastructure.  Applications should be permitted to store these objects
in immutable memory.

Update the API to add const qualifiers to object pointer arguments where
the corresponding address is used in an I2C write operation.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2018-12-07 09:24:26 -05:00
Jukka Rissanen
e812b6804a net: if: Make dst address const when selecting src addr
As the functions do not modify the destination address parameter,
it can be made const.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 16:18:24 +02:00
Flavio Ceolin
118715c62d misra: Fixes for MISRA-C rule 8.3
MISRA-C says all declarations of an object or function must use the
same name and qualifiers.

MISRA-C rule 8.3

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-12-07 09:06:34 -05:00
Flavio Ceolin
4b35dd2628 misra: Fixes for MISRA-C rule 8.2
In C90 was introduced function prototype, that allows argument types
to be checked against parameter types, though it is not necessary
specify names for the parameters. MISRA-C requires names for function
prototype parameters, it claims that names can provide useful
information regarding the function interface.

MISRA-C rule 8.2

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-12-07 09:06:34 -05:00
Flavio Ceolin
34b12d8f16 arch: x86: x86_mmu: Remove possible dead code
When __ASSERT is not enabled there is an attribution to the variable
total_partitions and it is never used.

MISRA-C rule 2.2

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-12-07 09:06:34 -05:00
Flavio Ceolin
1492df3415 x86: core: thread: Avoid clash with function identifier
There is a function called _thread_entry defined in
lib/thread_entry.c. Just changing name to fix MISRA-C violation.

MISRA-C rule 5.8

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-12-07 09:06:34 -05:00
Flavio Ceolin
26be3355ac kernel: sched: Fix undefined behavior
The order of evaluation of function calls in the arguments of a
function. This is undefined (32)/ unspecified(15-18) in C99.

MISRA-C rule 13.2 does not allow that a value of an expression and its
side effects happens in not deterministic order to avoid these
undefined behaviors.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-12-07 09:06:34 -05:00
Flavio Ceolin
c42dc9435d arch: x86: Make tag name unique
Renaming a variable to not clash with a struct name.

MISRA-C rule 5.7

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-12-07 09:06:34 -05:00
Flavio Ceolin
5304f352a7 include: misc: list_gen: Fix possible undefined behavior
The order of evaluation of function calls in the arguments of a
function. This is undefined (32)/ unspecified(15-18) in C99.

MISRA-C rule 13.2 does not allow that a value of an expression and its
side effects happens in not deterministic order to avoid these
undefined behaviors.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-12-07 09:06:34 -05:00
Flavio Ceolin
d7271ec9db kernel: poll: Fix switch usage
According with MISRA-C and unconditional break statement must
terminate every switch-clause.

MISRA-C rule 16.1 and 16.3

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-12-07 09:06:34 -05:00
Flavio Ceolin
c1eee25a98 lib: rbtree: Do not use lowercase l for literal suffix
Use suffix L to remove potential ambiguity between digit 1 and letter
l.

MISRA-C rule 7.3

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-12-07 09:06:34 -05:00
Flavio Ceolin
a42de6466a kernel: queue: Fix MISRA-C violation
MISRA-C requires the right-hand operand of && or || operator does not
contain persistent effect.

MISRA-C rule 13.5

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-12-07 09:06:34 -05:00
Kumar Gala
c9e5a27f41 samples: cmsis_rtos_v1: Disable tests on qemu_xtensa
We get an intermittent fail when running on qemu_xtensa.  Disable this
sample for now on that platform to allow sanitycheck / CI to pass for
other PRs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-12-07 08:37:07 -05:00
Anas Nashif
df3b7994d3 templates: Update issue templates
Updated templates with auto-labels.
Added enhancement/RFC templates.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-07 08:27:20 -05:00
Anas Nashif
60f7052bc4 samples: cmsis_rtos_v1: remove tracing test
This is not relevant to the test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-07 08:17:37 -05:00
Tomasz Bursztyka
8a8d4d3070 drivers/ethernet: Update RX error statistics relevantly
Update such statistic on all drivers.
Also, remove TX stats in native and stellaris drivers: such update is
done in L2 now.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-12-07 14:30:06 +02:00
Tomasz Bursztyka
952e494bdd net/ethernet: Let L2 updating common rx/tx statistics
Common statistics should be updated in one centralized place and
ethernet_send is the right place for tx stats, as well as ethernet_recv
for rx stats.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-12-07 14:30:06 +02:00
Tomasz Bursztyka
538961d109 drivers/ethernet: Remove double unref from stellaris driver
It's now either L2 which unref the pkt on successful tx, or net_if on
error.

Also removing pkt->frags check, net_core.c:net_send_data() does it
already.

And using data_len in logging instead of net_pkt_get_len(), which one is
currently greedy (it goes over all net_bufs).

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-12-07 14:30:06 +02:00
Tomasz Bursztyka
76fa82f7ab net/icmpv6: Optimize how chksum is verified
Just recalculate the chksum without resetting its value to 0, and test
if return value is 0.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-12-07 13:50:46 +02:00
Carles Cufi
6075133bae doc: dts: Document aliases and chosen nodes
In order to clarify their use, add a brief description of the Device
Tree `aliases` and `chosen` nodes and their use in Zephyr.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-12-07 12:11:11 +01:00
Jakub Rzeszutko
f8178dcb05 shell: remove Console dependencies
Removed Console dependencies from shell uart backend.
Generated define: CONFIG_UART_SHELL_ON_DEV_NAME for each board.

Fixes #10191

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-07 12:11:11 +01:00
Vincent van der Locht
58463b7ea7 net: dhcpv4: dhcp start/stop made compatible for multiple interfaces
The net_dhcpv4_stop() function stops the event listener for any IF_UP
events previously. In case multiple interfaces are used and optionally
being switched over, it could result in disabling dhcp unintentionally.

The callback is initialized at the init function and added/removed in
the start/stop function based on the interface list being empty
or not. (first added, last removed)

The event handler checks if the interface is in the list before acting
on it.

Signed-off-by: Vincent van der Locht <vincent@vlotech.nl>
2018-12-07 12:23:46 +02:00
Vincent van der Locht
994a4772ca net: dhcpv4: net_dhcpv4_stop() removing address during renew
In case "net_dhcpv4_stop(..) is called when the interface is
in NET_DHCPV4_RENEWING state, the address is not removed.
When deleting the address in the NET_DHCPV4_RENEWING state
means the status is always equal to the moment before _start
is called.

Signed-off-by: Vincent van der Locht <vincent@vlotech.nl>
2018-12-07 12:22:19 +02:00
Jukka Rissanen
d551f6c5ff tests: net: context: Disable assertion for net_context tests
The unit test gives net_context_get() an invalid protocol family
value which triggers an assert in net_context.c:160
This assert fails the test when it should not as we properly
check the return value. Fix this by disabling asserts for this
test.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 12:00:04 +02:00
Jukka Rissanen
0869a86760 tests: net: tcp: Fix interface initialization
The network interface mac address was not initialized properly
which caused assert in net_if.c:2881 to fail.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 12:00:04 +02:00
Jukka Rissanen
a26a6ae6a7 net: core: Change NET_ASSERT*() to use zephyr standard assert
Avoid dependency to logging subsystem in NET_ASSERT*(), so
use standard Zephyr asserts instead.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 12:00:04 +02:00
Jukka Rissanen
301d342571 net: Move net_analyze_stack() function to net_core.c
No need to this function be inlined so move it to .c file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 12:00:04 +02:00
Jukka Rissanen
cd4eb946c4 samples: net: Convert to use generic logging macros
Use generic logging macros LOG_*() instead of NET_*() as the
latter are mostly meant for internal networking stack use.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 12:00:04 +02:00
Jukka Rissanen
86689030e8 net: Clarify logging in networking code
Remove network specific default and max log level setting
and start to use the zephyr logging values for those.

Remove LOG_MODULE_REGISTER() from net_core.h and place the
calls into .c files. This is done in order to avoid weird
compiler errors in some cases and to make the code look similar
as other subsystems.

Fixes #11343
Fixes #11659

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 12:00:04 +02:00
Linden Krouse
7ab2827035 shell: Piped output of cd to /dev/null when setting ZEPHYR_BASE.
Solves an issue where any output from the user's shell's cd command
would be prepended to ZEPHYR_BASE when sourcing zephyr_env.sh.
Fixes #11894.

Signed-off-by: Linden Krouse <ztaticnull@gmail.com>
2018-12-06 19:14:50 -05:00
Andrew Boie
ab82ef4ca5 x86: always build the page fault handler
Previously, this was only built if CONFIG_EXCEPTION_DEBUG
was enabled, but CONFIG_USERSPACE needs it too for validating
strings sent in from user mode.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-12-06 12:44:23 -08:00
Andrew Boie
d4363e4185 x86: print helpful message on FPU exception
A few people have tripped over this recently.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-12-06 12:44:23 -08:00
Carles Cufi
15fbf707ca doc: revert to copy files with extract_content.py directly
Adding ninja targets based on the files that are to be copied into the
build folder doesn't seem to speed up the build, so simplify the CMake
script by relying on extract_content.py to do the copy.

Numbers on my machine:

* master
  clean: 6m45.541s, 6m8.113s
  incremental: 1m24.233s, 1m32.720s

* revert
  clean: 6m25.221s, 6m19.751s
  incremental:1m20.893s, 1m20.337s

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-12-06 14:27:29 -05:00
Anas Nashif
c562e4247d ci: remove bsim result options
This option is not being used anymore.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-06 14:24:41 -05:00
Anas Nashif
c3e98056ea ci: set second pass options correctly
Use correct 3rd pass env variable.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-06 14:24:41 -05:00
Robert Lubos
3651e03eeb samples: sockets: Add overlay configs to socket echo samples
Add Bluetooth, 802.15.4 and OpenThread overlay configurations to socket
echo_client and echo_server samples.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-12-06 12:45:19 -05:00
Robert Lubos
fff401d693 samples: net: echo_server config cleanup
* Add generic 802.15.4 overlay config,
* Move OT generic configs into overlay-ot.conf,
* Remove nrf52840_pca10056 board configuration,
* Remove overlay-reel_board-15_4.conf - generic overlay can be used
instead.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-12-06 12:45:19 -05:00
Robert Lubos
34b19acc9f samples: net: echo_client config cleanup
* Add generic 802.15.4 overlay config,
* Move OT generic configs into overlay-ot.conf,
* Remove nrf52840_pca10056 board configuration.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-12-06 12:45:19 -05:00
Spoorthi K
34c4d0e3dd samples: cmsis_rtos_v1: Demo on msgq and timers
Sample to demonstrate usage of message queue, threads
and timers with CMSIS RTOS V1 APIs.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2018-12-06 12:19:23 -05:00
Spoorthi K
940ee4e7e5 samples: cmsis_rtos_v1: Demo with Dining philosopher's problem
Sample application to demonstrate usage of cmsis_rtos_v1 APIs
with dining philosopher's problem implementation.

This covers semaphores, mutex and thread APIs of CMSIS RTOS V1.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2018-12-06 12:19:23 -05:00
Anas Nashif
64aecd044f Revert "subsys/fb/cfb: Introduce cfb_framebuffer_invert function"
This reverts commit b6528469df.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-06 11:39:44 -05:00