Commit graph

41120 commits

Author SHA1 Message Date
Mark Ruvald Pedersen
f0e2e1bccb portability: Remove C99-illegal semicolons from the global scope
This commit touches the C codebase and the python syscall generator.

The Z_GENLIST-macros expand to whole functions. Once expanded by the
preprocessor we notice a semicolon is put after the function body. But
ISO C99 does not allow extra ‘;’ outside of a function. Though this is
accepted by GCC with GNU extensions, it is not by Clang.

Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
2018-09-28 07:57:28 +05:30
Mark Ruvald Pedersen
28394cc44e portability: Warn at void* arithmetics which is a GNU C extension
Ensure future commits do not re-introduce use of this GNU C extension.

Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
2018-09-28 07:57:28 +05:30
Mark Ruvald Pedersen
d67096da05 portability: Avoid void* arithmetics which is a GNU extension
Under GNU C, sizeof(void) = 1. This commit merely makes it explicit u8.

Pointer arithmetics over void types is:
 * A GNU C extension
 * Not supported by Clang
 * Illegal across all ISO C standards

See also: https://gcc.gnu.org/onlinedocs/gcc/Pointer-Arith.html

Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
2018-09-28 07:57:28 +05:30
Mark Ruvald Pedersen
a82cb2442d ext: nffs: portability: Avoid void* arithmetics which is a GNU extension
Under GNU C, sizeof(void) = 1. This commit simply uses uint8_t.

Pointer arithmetics over void types is:
 * A GNU C extension
 * Not supported by Clang
 * Illegal across all ISO C standards

See also: https://gcc.gnu.org/onlinedocs/gcc/Pointer-Arith.html

Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
2018-09-28 07:57:28 +05:30
Mark Ruvald Pedersen
6a3552433a ext: libmetal: Update import of libmetal from b4b5bea to a4f7630
Pull in a more recent version of libmetal, motivated by the void
pointer fixes in efc33fe.

libmetal's b4b5bea to a4f7630 spans:

a4f7630 linux: device: fix max chars to copy for the dev name
10a0d5b lib: system: freertos: mutex: change to use atomic_int ...
4e670c5 ci: Zephyr env var for toolchain
3bef6f0 cmake: Fix Zephyr library integration
13158c3 compiler: add IAR compiler file
0820a2e microblaze: suppress io 64-bit R/W access if 64 bit atomic ...
e2e5608 io: suppress io 64 bit R/W access if 64 bit atomic not ...
efc33fe io: fix compilation error for void pointers.
32ad1d2 cache: fix compilation issue
c1ade0d travis CI: update Zephyr SDK version to 0.9.3
c49d7cd travis CI: updated arm compiler ubuntu package
d279a6a travis ci: Update FreeRTOS download path
5c70105 irq: update sys_irq_restore_enable and sys_irq_save_disable
05f0cd4 cmake: Only look for doxygen package if docs enabled
b4b5bea zephyr: Introduce WITH_ZEPHYR_LIB option

At current time of writing, libmetal's HEAD is 5bc2106641.
However this failed to build in their Travis CI.
The latest passing commit is a4f7630.

Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
2018-09-28 07:57:28 +05:30
Ramakrishna Pallala
3a8e37caae soc: x86: quark_se: Select the supported Power States
Select the Low Power States supported by Intel Quark SE SoC series.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-09-28 06:54:15 +05:30
Ramakrishna Pallala
a404d4df6b soc: arc: quark_se_c1000_ss: Select the supported Power States
Select the Low Power States supported by Quark_SE_C1000_SS SoC series.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-09-28 06:54:15 +05:30
Niranjhana N
d3ab9a37d8 lib: posix: remove return error code
ENOTSUP is not being used correctly in
pthread_attr_setschedparam(), hence
replaced its check for EINVAL instead.

Signed-off-by: Niranjhana N <niranjhana.n@intel.com>
2018-09-28 06:53:24 +05:30
Niranjhana N
7e6c103ff5 lib: posix: fix return error code
Added EAGAIN error code in pthread_create()
with fixing the EINVAL return as it is
limited to attribute checking.

Signed-off-by: Niranjhana N <niranjhana.n@intel.com>
2018-09-28 06:53:24 +05:30
Niranjhana N
482579e491 lib: posix: add error code return
Added return of ESRCH error code in
pthread_getschedparam() when the
specified thread could not be found.

Signed-off-by: Niranjhana N <niranjhana.n@intel.com>
2018-09-28 06:53:24 +05:30
Flavio Ceolin
ea716bf023 kernel: Explicitly comparing pointer with NULL
MISRA-C rule: 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-28 06:28:41 +05:30
Flavio Ceolin
92ea2f9189 kernel: Calling Z_SYSCALL_VERIFY_MSG with boolean expressions
Explicitly making a boolean expression when calling
Z_SYSCALL_VERIFY_MSG macro.

MISRA-C rule: 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-28 06:28:41 +05:30
Flavio Ceolin
02ed85bd82 kernel: sched: Change boolean APIs to return bool
Change APIs that essentially return a boolean expression  - 0 for
false and 1 for true - to return a bool.

MISRA-C rule 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-28 06:28:41 +05:30
Flavio Ceolin
420bb62071 misc: dlist: Using boolean expressions
Explicitly make boolean expression instead of promote conversions from
integers/pointers.

MISRA-C rule: 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-28 06:28:41 +05:30
Flavio Ceolin
788f9665e8 misc: list_gen: Using boolean expressions
Make boolean expressions use boolean types.

MISRA-C rule 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-28 06:28:41 +05:30
Flavio Ceolin
d8837c6888 kernel: Using boolean expression on ASSERT macros
ASSERT macro expects a boolean expression, making it
explicit.

MISRA-C rule 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-28 06:28:41 +05:30
Flavio Ceolin
6fdc56d286 kernel: Using boolean types for boolean constants
Make boolean expressions use boolean types.

MISRA-C rule 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-28 06:28:41 +05:30
Flavio Ceolin
2c924119a3 misc: assert: Using boolean constants
Using booleans true/false instead of using 1/0 in boolean
expressions.

MISRA-C rule 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-28 06:28:41 +05:30
Flavio Ceolin
070716ec66 misc: dlist: Returning boolean for assertive functions
Several functions in dlist were returning a boolean expression,
just changing these functions to return a boolean.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-28 06:28:41 +05:30
Maureen Helm
0be600016c soc: x86: arc: Remove spi base address and irq macros
Now that we get the spi base address and irq numbers from dts, we can
remove the preprocessor macros from soc.h

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-09-28 06:27:06 +05:30
Maureen Helm
339a631ac4 boards: Remove redundant "select HAS_DTS_SPI"
The spi drivers now consistently select HAS_DTS_SPI, so we no longer
need to select it at the board level.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-09-28 06:27:06 +05:30
Maureen Helm
55caa7b743 drivers: spi: Select HAS_DTS_SPI in designware driver
Makes the designware spi driver consistent with other spi drivers by
selecting HAS_DTS_SPI in the driver. This required adding spi nodes and
dts fixups to several arc and x86 socs, as well as enabling those nodes
in associated boards.

Also refactors the driver to use the base address, interrupt number, and
interrupt priority from dts.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-09-28 06:27:06 +05:30
qianfan Zhao
15959c8b85 drivers: eth_sam: Add generate random mac address feature
Using a random mac address with Atmel's OUI if enabled this feature

Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
2018-09-27 21:52:14 +03:00
Robert Lubos
8592501828 net: Remove s_addr/s6_addr defines from in_addr/in6_addr
Replace #defines for s_addr/s6_addr etc. in in_addr/in6_addr structures
within net_ip.h with fixed fileds inside an anonymous union. This
prevents intrusive behaviour of net_ip.h, which expands every occurence
of s_addr/s6_addr with it's own define, even in other, non-related
structures.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-09-27 21:46:04 +03:00
Kumar Gala
46592e6398 dts: arm: st: Remove use of CONFIG_SOC_* from STM32 L4 dts files
To move forward and remove use of Kconfig in dts files lets just create
SoC specific dtsi files that the boards can include.  We also seperate
out the L4 dtsi files into their own dir.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-09-27 10:58:56 -05:00
Kumar Gala
223d426663 dts: arm: st: Remove use of CONFIG_SOC_* from STM32 L0 dts files
To move forward and remove use of Kconfig in dts files lets just create
SoC specific dtsi files that the boards can include.  We also seperate
out the L0 dtsi files into their own dir.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-09-27 10:58:56 -05:00
Kumar Gala
aecc4c5d2c dts: arm: st: Remove use of CONFIG_SOC_* from STM32 F1 dts files
To move forward and remove use of Kconfig in dts files lets just create
SoC specific dtsi files that the boards can include.  We also seperate
out the F1 dtsi files into their own dir.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-09-27 10:58:34 -05:00
Alberto Escolar Piedras
bded528b6b tests: uart: add extra config for native_posix
When running a UART test in CI, it is better to configure
the nativeposix UART to be mapped to the process STDIN/OUT.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-09-27 17:24:34 +02:00
Alberto Escolar Piedras
013f279111 uart: Add driver for posix arch
Added a new UART driver for posix arch boards.
The driver can be configured to either attach to a new
pseudo-terminal, or to connect to the invoking shell
stdin-out.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-09-27 17:24:34 +02:00
Alberto Escolar Piedras
3e41ac5f04 subsys: shell: Add missing dependency to SERIAL
The shell subsystem, as it is today, depends on having a UART,
therefore let's add the dependency explicitly in its Kconfig

Fixes #10190

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-09-27 17:24:34 +02:00
Alberto Escolar Piedras
c09b76abd0 subsys: shell: support posix arch
The posix arch does not compile either of Zephyr's libc,
so _prf() is not avaliable

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-09-27 17:24:34 +02:00
Andrzej Puzdrowski
5df93af87a subsys: storage: flash_map: add API for check flash driver support
Some applications might want to check whether flash_areas binds to
any flash drive in the system. It might be better to do that while
sanity check at application start-up then while regular run process.
Example of such application is the mcuboot.

This patch introduce such API for checking whether device bindings
were resolved properly during system startup.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-09-27 16:24:21 +02:00
Ioannis Glaropoulos
12c02448aa arch: arm: style fixes in documentation of MPU region types
Some minor style fixes and rewording of the documentation
for ARM MPU region types.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-09-27 08:10:02 -05:00
Ioannis Glaropoulos
4732328491 arch: arm: group Userspace-related regions together
This commit groups together the MPU region types
that are related to the User-space feature, so that
a single #ifdef USERSPACE is present in the enum.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-09-27 08:10:02 -05:00
Kumar Gala
ebd0ff9f28 dts: arm: st: Remove use of CONFIG_SOC_* from STM32 F0 dts files
To move forward and remove use of Kconfig in dts files lets just create
SoC specific dtsi files that the boards can include.  We also seperate
out the F0 dtsi files into their own dir.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-09-27 08:09:42 -05:00
Erwan Gouriou
c0d58d1a60 boards: nucleo_f207zg: Fix default config
According to GH7151: boards: Move existing boards to
"default configuration guidelines"
Add USART6 Arduino compatible config

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-09-27 06:36:18 -05:00
Erwan Gouriou
37e5a9dc8d boards: nucleo_f413zh: Fix default config
According to GH7151: boards: Move existing boards to
"default configuration guidelines"
Add SPI1 Arduino compatible config
Add I2C1 Arduino compatible config
Add USART6 Arduino compatible config
Disable Features by default.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-09-27 06:36:18 -05:00
Erwan Gouriou
96ddb42f6c boards: nucleo_f412zg: Fix default config
According to GH7151: boards: Move existing boards to
"default configuration guidelines"
Add SPI1 Arduino compatible config
Add I2C1 Arduino compatible config
Add USART6 Arduino compatible config
Disable Features by default.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-09-27 06:36:18 -05:00
Erwan Gouriou
228b148b18 boards: nucleo_f429zi: fix PWM instance
Fix desynch between dts and Kconfig settings

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-09-27 06:36:18 -05:00
Erwan Gouriou
78935f938b boards: nucleo_f429zi: Enable USB
Enable USB on nucleo_f249zi.
Update clock to allow precise USB clock.
Tested on samples/subsys/usb/cdc_acm

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-09-27 06:36:18 -05:00
Yasushi SHOJI
e1e12ba0c6 gitignore: Ignore GNU Global's tag files
GNU Global creates a few files at the root dir.  Ignore them all.

Signed-off-by: Yasushi SHOJI <y-shoji@ispace-inc.com>
2018-09-27 06:00:01 -05:00
Krzysztof Chruscinski
87d177a6fb logging: allow mulitple log_panic calls
Ensure that only first log_panic() sends panic signal to backends

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-27 13:11:26 +05:30
Krzysztof Chruscinski
27459a13e4 arch: Add LOG_PANIC to fault handlers
Added LOG_PANIC to fault handlers to ensure that log is flush and
logger processes messages in a blocking way in fault handler.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-27 13:11:26 +05:30
Yannis Damigos
ab8d0c4f9d include/logging: Avoid subtraction on void pointers
Avoid subtraction on void pointers.
void* pointer arithmetic is not allowed by C standard and also C++.
If you include "logging/log.h" into a C++ application it fails to
build.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-09-27 11:21:51 +05:30
Anas Nashif
6d3fb8b4cf shell: kernel: add more thread data to threads command
Show thread and stack data all under one command and reformat output.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-27 08:58:55 +05:30
Anas Nashif
1aed3858ac logging: rename log_process_thread to logging
Keep the name short to make usuable when thread names are enabled.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-27 08:58:55 +05:30
Anas Nashif
2f30c5dcb8 samples: synchronisation: set thread names
- Use new k_thread_name_set to set thread names.
- Use board name in sample instead of architecture.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-27 08:58:55 +05:30
Anas Nashif
739fd90127 samples: synchronization: remove unused conf
prj_stack_guard.conf not related to this sample, we have tests other
samples for stack guard testing/demonstration.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-27 08:58:55 +05:30
Anas Nashif
46f7cd51dd shell: kernel: print thread name
Use new kernel API to display thread name when listing threads.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-27 08:58:55 +05:30
Anas Nashif
f6e7e98909 tests: test k_thread_name_set
Basic test for new API: k_thread_name_set.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-27 08:58:55 +05:30