Commit graph

41120 commits

Author SHA1 Message Date
Jukka Rissanen
a3b88f53c4 net: Initial commit for the new IP stack
This is a placeholder that compiles but does nothing else.

Change-Id: I9689fa26eb13bc23d29940938f7b3c11f32b2ff1
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:39:59 +02:00
Inaky Perez-Gonzalez
96c4a4b3a3 scrips/kconfig: reduce impact of getenv() buffer overflow
getenv() returns an string of unknown size, so Coverity warns that it
might be used to overflow the stack in the call chain off
conf_read_simple().

To avoid that, wisdom says copy to an string of known size and pass
that.

Change-Id: I9e468de0ae66429062027f58fe0a0a4e1197218f
Coverity-ID: 150819
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
(cherry picked from commit 0307d6ea5fa361abe5c9fb1872f9dc8256208ee0)
2016-12-02 04:16:53 +00:00
Jithu Joseph
1dc41f515f usb :mass_storage: correct the license details
Certain structures and defines in this file are from
from mbed's implementation. The file header is updated
as per this.

Change-Id: I688917cdd17cfc8b27d5b78181ced90df73c9efd
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-12-02 02:11:34 +00:00
Anas Nashif
813d550361 [REVERTME]boards: omit frame pointer for ARC boards
The current ARC GCC compiler used in Zephyr SDK v0.8.2 generates
incorrect code when using the "-fno-omit-frame-pointer" option. This bug
should have been fixed in the 2016.03 release of the compiler.

Jira: ZEP-1243, ZEP-1403

Change-Id: I0901f55973c1ea37491b07bf625d0d1918803f3e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-02 00:14:25 +00:00
Anas Nashif
d3230b0128 MAINTAINERS: fix email address
Change-Id: I91d94dadb975e30c7e5450c07612c7861b0cc996
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-01 19:07:49 -05:00
Anas Nashif
e3febe9aa5 sanitycheck: allow error on deprecation warnings
Added new option to make sanitycheck script error on deprecation
warnings, to use:

sanitycheck --error-on-deprecations

For example, to find usage of legacy APIs in master, run the following:

sanitycheck -e legacy --error-on-deprecations

Change-Id: Ib83c266c8357475840dea03d62ceefed72b73f27
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-01 21:06:07 +00:00
Benjamin Walsh
91f834c908 kernel: add emphasis to nano_sem_take/k_sem_take return code difference
The reversal of the meaning of a value of 0 from k_sem_take vs
nano_sem_take has caused some issue when porting code from the legacy
API to the new API, so put some emphasis on this difference.

- Add a note in the API description.
- Put the call to k_sem_take and the reversal of the return value inside
  of nano_sem_take on one line so that grepping on it shows the
  reversal.

Change-Id: I2f4ba58dc087176d68b55371fa6e367b72559e70
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-12-01 17:57:23 +00:00
Sudarsana Nagineni
4b7bdf25be usb: Add WebUSB enabled custom class support.
This implements a modified version of CDC ACM class driver
in a WebUSB compatible way. It adds the WebUSB descriptors,
custom and vendor requests handlers so that the host OS and
browsers can get the required BOS descriptor and supported
origins from the device. It also adds a custom interface
class so that the interface will not be claimed by the host
CDC ACM driver.

A simple echo app also included in this commit to demonstrate
how to create and use a WebUSB interface, as well as the
communication between browser and WebUSB enabled device.

WebUSB Spec: https://wicg.github.io/webusb/

Origin: Based on CDC ACM device class driver in Zephyr

Jira: ZEP-744

Change-Id: I2eac10bd718e8fce35cda52e7c2ac425c3210e23
Signed-off-by: Sudarsana Nagineni <sudarsana.nagineni@intel.com>
2016-12-01 01:00:12 +00:00
Baohong Liu
120bc132d1 samples: usb: use unified kernel API
Change-Id: Ie6f74e7d8796190edf5a818d981efcdfbf8ca6ce
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-01 00:41:05 +00:00
Baohong Liu
100e141a25 subsys: usb: use unified kernel API
Change-Id: I3eb70333cbfce17ccf1345a94f0f63148c9a3e7e
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-01 00:40:46 +00:00
Baohong Liu
313700e26f drivers: sensor: use unified kernel API
Change-Id: I5d51e65105f9dee3d5eb49c60b9e5636ebd14df6
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-30 23:54:58 +00:00
Ramesh Thomas
fc5475fc46 doc: power_mgmt: Update PM doc with latest changes
Revise the document to reflect the latest changes including
the updated concept of SOC interface instead of PMA. Simplified
and enhanced areas that were known to cause confusion. Added
descriptions of new APIs and usages.

Jira: ZEP-1386
Change-Id: I5fa74d85245924f512c22d9d977dd0c9ea62b6ce
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-11-30 23:54:42 +00:00
Baohong Liu
fa2d38e395 drivers: console: use unified kernel API
Change-Id: I2184f0565a9a4f2ebfdff1f57afc22ce36fe0646
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-30 23:49:04 +00:00
Benjamin Walsh
f421ec23ad kernel: fix race condition when spawning a thread with a delay
Interrupt must be locked before inserting a timeout in the timeout
queue.

Change-Id: Iab0bf01f393e66a6403d2f85e899dbf737da4afc
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-11-30 23:48:06 +00:00
Benjamin Walsh
cb21e03ebb tests: adjust some stack sizes when running debug loads
Having CONFIG_ASSERT=y and CONFIG_DEBUG=y was causing these tests to
overflow their stacks and crash.

Change-Id: Ibcd57abe044a2203d1a954a4c5755218af48f302
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-11-30 23:47:46 +00:00
Benjamin Walsh
4e8a54c1e3 arc: move disabling/invalidation of caches earlier
Too much code might run with a stale icache, before _PrepC(), so move
the invalidation/disabling code earlier. The asm code does the exact
same thing disable_icache() and invalidate_dcache() were doing.

Change-Id: If52f4e4a1de546fb82873c91ead95614a44b106d
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-11-30 23:47:46 +00:00
Andrew Boie
82f11bf099 build: x86: add some flexibility in custom linker scripts
If a particular project needs to add additional data to the
binary image, in most cases the entire linker script needs to
forked into the project space, causing maintenance issues if
the main linker script is changed.

Now we add some Kconfig options to allow a project to specify
some additional linker scripts which get included by the main
one in a few key areas:

1) In the definition to the 'rodata' section, which can allow
additional data to be included in this ROM section.

2) In the definition to the 'datas' section, which allows
additional data to be included in this RAM section.

3) Arbitrary additional sections to be included at the end of
the binary.

For 1 and 2, this is useful to include data generated outside of
the normal C compilation, such as data structures that are created
by special build tools.

3 is useful for including arbitrary binary blobs inside the final
image, such as for peripheral or co-processor firmware.

Change-Id: I5738d3d6da25f5bc96cda8ae806bf1a3fb34bd5d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-30 22:47:02 +00:00
Anas Nashif
e868a80a5c samples: tests: tag all legacy test cases and samples
Tag all legacy kernel tests and samples as such.

Change-Id: I43b24acb71c282ed14ff6e6ef06c9542bad86f6a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-30 21:45:22 +00:00
Anas Nashif
55fa31196e samples: remove legacy usage and convert to unified APIs
Change-Id: Idf281b0bbb7c8f6f1eff74e275d5ebb4e427cd2f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-30 21:45:21 +00:00
Anas Nashif
36e8fc5c05 drivers: lcd: use unified kernel APIs
Change-Id: Ie0d6f6e22646b23883f6b940812f93bba1789828
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-30 21:45:21 +00:00
Vinayak Chettimada
6276ca68c8 drivers: timer: replace deprecated interface in nrf_rtc_timer
Rename sys_cycle_get_32 to k_cycle_get_32 in nrf_rtc_timer.

Change-id: I50af876b254dc5bc3dbb2ccfdf27d33bc4b8d5e5
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2016-11-30 19:21:54 +00:00
Vinayak Chettimada
883f9c39f7 drivers: timer: Fix missing sys_clock_disable in nrf_rtc_timer
Change-id: Ia453b8484050c8431d2f793e8f5726684afa21f4
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2016-11-30 17:25:48 +00:00
Vincenzo Frascino
b41c0159a8 watchdog: Refactor main Kconfig file
This patch refactors the main Kconfig file in order to align it with the
Zephyr code style and to make sure that each Kconfig configuration
portion is easily identifiable.

Change-Id: Ib226aaa9a98e9b08a47d9d1c329f18f4f6936620
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-11-30 17:25:15 +00:00
Marcus Shawcroft
64c69d585f Fix Kconfig formatting.
Change-Id: I5720efb9455740a95ea785b0cd205875a215b922
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-11-30 17:01:46 +00:00
Anas Nashif
8918676de0 maintainers: update kernel file list
Change-Id: Ia53649ca120abd003805b838374ed490081ae41c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-30 15:23:52 +00:00
Anas Nashif
ce9cb26a2e build: add more security related compiler flags
Add the following:

*  -Wformat
*  -Wformat-security
*  -D_FORTIFY_SOURCE=2

Change-Id: I4768713126637f851489d13fc1d803a18986f4c0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-30 15:23:52 +00:00
Anas Nashif
7fee3fdb13 kernel: legacy: remove ztest workaround
Change-Id: I8aee565a13f6d97f30b975c69ffe2f2381b1dc1f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-30 15:23:51 +00:00
Tomasz Bursztyka
44daf98e27 usb: cdc_acm: Various style fixes
- {} are always required on if/for/while
- no break line before an if, if condition is testing previous
  assignment
- parameters indentation etc...

Change-Id: I83f217c02733b9e63ef1e752f55937f3d7dc03e1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-11-30 15:23:42 +00:00
Tomasz Bursztyka
b6e04720c8 usb: cdc_acm: Drop legacy API for unified one
s/nano_sem/k_sem + some necessary changes for the k_sem to work.

Change-Id: I96377083f5e17631b63d6da1a0546966ec95ff8b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-11-30 15:23:42 +00:00
Tomasz Bursztyka
6b2ed0d5c3 board: arduino_101: Pinumx gpio/spi pins relevantly
If SPI 1 is selected and GPIO CS trick as well, then do not use
controller's CS but GPIO 0 instead as a CS.

Change-Id: Ifc17cdc44f47b9348f4c655d510349e3124dceea
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-11-30 15:23:41 +00:00
Qiu Peiyang
f38dc9995e uart: fix typo in uart_console.h
Fix typo introduced by commit 6b2443e("console: Fix warnings
related to the use of deprecated APIs")

Change-Id: I6b4db8ba781fecae4413f473001f40ff53c765f0
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2016-11-30 15:05:19 +00:00
Vincenzo Frascino
73ee7e2d1c counter: Fix interface
With the current interface if multiple counters/timers are present in
the system, it is not possible to select from which one to read the
current value.

This patch fixes the behavior.

Change-Id: Id1ae1f2330e98d078f755c0b81c3b176e90b8389
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-11-30 14:39:10 +00:00
Vincenzo Frascino
f0fd6c2634 counter: Refactor main Kconfig file
This patch refactors the main Kconfig file in order to align it with the
Zephyr code style and to make sure that each Kconfig configuration
portion is easily identifiable.

Change-Id: Iba83be8ae154df4b29ff423b4c3cc97a78c93e00
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-11-30 14:39:10 +00:00
Andrew Boie
52fef67c13 sanitycheck: allow for extra binary sections in testcase.ini
Change-Id: I9e47a58f3f32ba093f7916af111a289b620c30d5
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-30 14:14:10 +00:00
Andrew Boie
9d054653cf x86: add _set_idt()
Sets the interrupt descriptor table in C domain.

Change-Id: Ia8d2f585ebf60464aeedf2a54363e4683cf257a5
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-29 14:52:08 -08:00
Andrew Boie
602682150b x86: fix _set_gdt() implementation
The pointer value needs to be dereferenced first.

Change-Id: I80d8a9b4837adfc7d0efc69c229c863d05e52a93
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-29 14:52:08 -08:00
Andrew Boie
427be9ef75 x86: rename segment descriptor 'size' field to 'db'
It is referred to as D/B in the Intel manuals.

Change-Id: If021d875da2d83a256926d9233f1559c8c2ed1db
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-29 14:52:08 -08:00
Andrew Boie
452fd7a5c2 x86: don't set segment registers if we don't set GDT
We have no idea what's in the GDT if we don't set it ourself.

Change-Id: I3c2e406370e3ea149252c423d66c97aab95bee17
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-29 14:51:57 -08:00
Anas Nashif
d9616b9400 sanitycheck: abort if last_sanity.csv not found
When running --only-failed make sure last_sanity.csv exists.

Change-Id: I862529a58f337987c37da83fd5541dd4f42b3391
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-29 13:41:00 -05:00
Qiu Peiyang
3763487575 sensor: fix typo in Kconfig
Change-Id: I0fc7e0f66ba994f42a04684e4862fc3218ddd075
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2016-11-29 12:59:35 +00:00
Sergio Rodriguez
b0c0548ad6 samples: drivers: current sensing : Exit from testcase if device not found
Exiting from the test case when the i2c device is not found, this
to avoid a null pointer dereference

This issue was reported by Coverity

Coverity-CID: 151982

Change-Id: Ib11224ef2a78170f6e4d20545f645b4f2ea4a181
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-29 03:45:39 +00:00
Sergio Rodriguez
710f9a22a8 samples: drivers: led_apa102c: Exit from testcase if device not found
Exiting from the test case when the gpio device is not found, this
to avoid a null pointer dereference.

This issue was reported by Coverity

Coverity-CID: 151980

Change-Id: I7aafbc993674c8874a16b5a9213108f5769114ec
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-28 17:49:31 -08:00
Jithu Joseph
a3db0d1313 samples: event_collector: Remove redundant check
Removes a redundant check flagged by coverity.

Coverity-CID: 152005

Change-Id: I8cc3a64c42e04a2d52deed11d9022ed4a49baaa7
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-11-28 20:51:44 +00:00
Inaky Perez-Gonzalez
462c6efca4 tests/ztest/mock: remove usage of legacy k_fifo_get()
Legacy FIFO operations were failing and thus the TC was failing to run.

Stop using k_fifo_get() for allocation and use a bitmap allocator. A
couple of the bitmap operations should be moved to a common header
once ZEP-1347 is completed.

Passes on all arches and boards, whitelist removed; ARM excluded
though due to missing bitfield implementation as per ZEP-82.

Note there is a false checkpatch positive in the decl of
sys_bitfield_find_first_clear().

Change-Id: I1d3ce8e988bf799573041026e419e3946d153590
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-11-28 20:50:38 +00:00
Inaky Perez-Gonzalez
b53e6d7774 libc/minimal: snprintf(): KILL negative len parameter
snprintf() implements the ability to foce a negative value through the
(unsigned) size_t len parameter to allow the formatter to use a
maximum size string.

This is point less, we don't have as much memory and this is a recipe
for all kinds of vulnerabilities.

Kill the whole thing, the testcase it represents and thank Coverity
for finding this thing. Whatever use it had before, it has no more.

Change-Id: If422246548664699d8aa328a1b9304ef13cab7ea
Coverity-ID: 131625
Coverity-ID: 131626
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-11-28 20:49:37 +00:00
Vincenzo Frascino
1ce435b646 tests/kernel: Test CONFIG_RUNTIME_NMI behavior
This patch provides a test that verifies the correct functionality of
CONFIG_RUNTIME_NMI at build time.

Change-Id: I92c8af78d327f6f2b8b87573dbf132068ff80a45
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-11-28 20:30:47 +00:00
Anas Nashif
e5b157bc1e net: buf: move test to unified kernel
Change-Id: I6757d32c8e9c713b73f160d46d4fbe4111ac73c1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-28 20:17:23 +00:00
Benjamin Walsh
eba017632a arm/frdm_k64f: fix boot issue with MBED bootloader and INIT_STACKS=y
Initializing the interrupt stack before initializing (turning off) the
watchdog on the FRDM board pushed the initialization of the watchdog too
late, causing it to fire and reset the board. The board would be kept in
a reboot loop.

Move the initialization of the watchdog earlier: this runs on the main
stack now, instead of the interrupt stack, the same stack the interrupt
stack initalization code runs on.

Change-Id: Ic0006f4f4f4090393571d8355a80dc9390c9fbc6
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-11-28 18:33:11 +00:00
Luiz Augusto von Dentz
8062f6ea5a net: buf: Add extra logic when debug is enabled
In case of invalid behavior such as error or warnings print caller
function name and line number so it is easier to track back when there
there is a problem.

Change-Id: I3a5f4c7f63e0560fe0cf6f25936b079f127776a8
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-11-28 14:57:44 +00:00
Luiz Augusto von Dentz
2de6e8da4d net: buf: Add debug for fragments
net_buf_unref actually unrefs the fragments but it only logs information
of the parent.

Change-Id: I03208f250d030b7927d68c8da442f830f6070dc3
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-11-28 14:57:43 +00:00