Commit graph

41120 commits

Author SHA1 Message Date
Luiz Augusto von Dentz
324b3a2948 Bluetooth: init: Add CONFIG_BLUETOOTH_RFCOMM to prj_20.conf
This makes sure RFCOMM support is build tested on each patch.

Change-Id: I9cd60da1b0ab0db2b41487393fb59fe1b415ea01
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-04 08:12:14 +03:00
Arun Jagadish
3afc05d816 Bluetooth: AVDTP: Module Initialization
- Data Structure Definition
- Registration and Initialization

Change-Id: Icca95ccbd2692a7d41fd41ef2c99e34761e864b3
Signed-off-by: Arun Jagadish <arun.jagadish@intel.com>
2016-10-04 08:12:14 +03:00
Carles Cufi
f976decdfa Bluetooth: Controller: Clean up naming in the HCI driver
As part of the effort to consolidate the BLE Controller's
HCI layer, the functions in hci_driver.c now use the "hci_driver_"
prefix when it is sensible to do so, and prefixes have been
removed altogether when they are not required.

Jira: ZEP-726

Change-Id: Icd3e56e0170f15636245ea12a389a5a9e86c166c
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-10-04 08:12:14 +03:00
Luiz Augusto von Dentz
c4fb8f8820 Bluetooth: eddystone: Add missing characteristics
This adds last 2 missing characteristics:

(Advanced) Factory reset - a3c8750b-8ed3-4bdf-8a39-a01bebede295
(Advanced) Remain Connectable - a3c8750c-8ed3-4bdf-8a39-a01bebede295

Change-Id: I749b4be65469080a24957805d40395563a74a972
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-04 08:12:14 +03:00
Maureen Helm
51c146b95b frdm_k64f: Add support for RGB LEDs
Add PTB22, PTE26, and PTB21 to the frdm_k64f pinmux table, and helper
macros to board.h to map them to red, green, and blue LEDs respectively.

Change-Id: I257621467e71dfd9bdc5d97d6da444dfb5c58b2b
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-10-04 01:29:14 +00:00
Maureen Helm
a6b57c9455 frdm_k64f: Add support for push button switches
Add PTC6 and PTA4 to the frdm_k64f pinmux table, and helper macros in
board.h to map them to SW2 and SW3 respectively.

Change-Id: Ia30df9015d6d3c09131b4fbb2f2009ee745f7268
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-10-04 01:23:00 +00:00
Yannis Damigos
84ae7d83d6 scripts/sysgen: Fix indentation inconsistency
Building samples or running sanitycheck script fails with
the following error using python 3:
Using /home/xekarfwtos/projects/zephyr as source for kernel
GEN     ./Makefile
CHK     include/generated/version.h
HOSTCC  scripts/basic/fixdep
HOSTCC  scripts/gen_idt/version.o
HOSTCC  scripts/gen_idt/gen_idt.o
HOSTLD  scripts/gen_idt/gen_idt
HOSTCC  scripts/gen_offset_header/gen_offset_header.o
HOSTLD  scripts/gen_offset_header/gen_offset_header
CHK     misc/generated/configs.c
CHK     include/generated/offsets.h
CHK     misc/generated/sysgen/prj.mdef
UPD     misc/generated/sysgen/prj.mdef
File "/home/xekarfwtos/projects/zephyr/scripts/sysgen", line 687
  kernel_main_c_out("K_MSGQ_DEFINE(_k_fifo_obj_%s, %s, %s);\n" %
				                               ^
TabError: inconsistent use of tabs and spaces in indentation

This patch fixes the indentation inconsistency allowing building
using python 3.

Change-Id: I51bda9452e7ff97fe9f07544927d76ce981700d1
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-10-03 20:33:28 +00:00
Peter Mitsis
6704ff462e kernel: Add __unused tag
The '__unused' tag can be used to inform the compiler that a variable
might be deliberately unused. It can be used instead of ARG_UNUSED().

Change-Id: I0ec4ee92dcec29b5f9cbda362d0d6b051055628a
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-03 20:22:05 +00:00
Peter Mitsis
27a21a8e09 nanokernel: nanokernel.h to include sections.h
Mirrors kernel.h to allow both nanokernel and microkernel applications
easy access to section tags such as __noinit.

Change-Id: Ie01395ac63393b7afbebfe26c723702918bfe9ff
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-03 20:20:23 +00:00
Peter Mitsis
0cb65c3c0d unified: Eliminate k_mem_pool_t typedef
Replaces it with a pointer as there is no need for an opaque memory
pool type.

Jira: ZEP-916
Change-Id: I5493eed25c9c34e1b850dc3b20699864edb22d28
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-03 20:17:02 +00:00
Peter Mitsis
0ca7cea8f3 unified: Relocate internal thread group APIs
Moves the following internal thread group APIs from the public
kernel.h header file to the more private thread.c source file as
they do not need to be public APIs.
	_k_task_list_start[];
	_k_task_list_end[];
	_FOREACH_STATIC_THREAD()
	is_in_any_group()

Change-Id: I0b731fb0c20a5574cb1b3c1397803af82918d69d
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-03 20:17:02 +00:00
Marcus Shawcroft
9d67337c2d k64f: Refactor pinmux configuration table.
Statically compute the number of elements in the pinmux table rather
than keep a manual entry in step with the table.

Change-Id: I99634aa460a39bb8a9a10fe37d28aaae792aa641
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-03 19:49:40 +00:00
Carles Cufi
bb9f432dc1 toolchain: Add BUILD_ASSERT macro for compile-time checks
This new macro will trigger a build failure if the compile-time
check fails. Useful for checking static conditions such as
structure sizes or offsets.

Change-Id: I417ea816003b97beb1b5f15bc583c38691f0b8a9
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-10-03 19:41:08 +00:00
Ramesh Thomas
0d2b8224b1 timer: Fixes a build error when MVIC is used
MVIC does not have _REG_TIMER_CFG defined because it does
not have a timer config register. Add checks for MVIC at
places where it is used.

Jira: ZEP-1015
Change-Id: I59f5c43cc2d1b17cf9e88b940631c2542e9729ab
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-10-03 17:28:02 +00:00
Daniel Thompson
90f6ae1532 build: Support for integrating third party build systems
For projects like JerryScript and Micropython we are starting to see
hybrid build systems emerge where the application (which targets a
variety of OSs and already includes a complex build system) is compiled
using the applications own build system before handing over to the
zephyr build system for the final link.

Currently the integration is becoming quite complex as the applications
build integration tries to figure out sane values for CC and CFLAGS.
Much of this complexity can be avoided if we allow the zephyr build
system to export its configuration in a manner that can easily be
consumed by the alien build system.

Change-Id: I4ea4cda2ed0437222d9550c50f0b07e51d9ac91b
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
2016-10-03 02:30:51 +00:00
Anas Nashif
c83e6a1f48 libc: define EWOULDBLOCK to be the same as EAGAIN
EWOULDBLOCK is an old error code from BSD. Not much uses it, and on basically
all modern systems it's defined to the same value as EAGAIN, which is the
System V value for the same condition.

Jira: ZEP-982
Change-Id: I5435ce55fa47f5bd2fac5d881b5b195b025f48a2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-03 02:29:42 +00:00
Anas Nashif
0cf87e4c26 pinmux: remove nonexistant galileo Kconfig
Change-Id: I9f2fb8024f3de6fa6aaf1220ecfa884fabb6ad74
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-03 02:29:23 +00:00
Anas Nashif
1b4742f8a4 help: document ram/rom_report in 'make help'
Change-Id: I0b0b477cc19bb8966a67c6f1e5705f58d8679578
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-03 02:29:22 +00:00
Anas Nashif
315862f59a tests: remove redundant PRINT definition
Change-Id: I0ac5b3730a9a84b89f392c58e3b65e47cbdf132b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-03 02:29:22 +00:00
Andy Ross
0f227848b9 link: Add section size validity checker
There are demons hiding in binutils with regard to the size of the
data section that needs to be copied in XIP platforms.  It's easy to
mess up and get a mismatch between the linker data output and the
runtime addresses.  Add a cheap check to discover this early when it
occurs.

Jira: ZEP-955

Change-Id: If1c61fe8712221c6450b5b89f5f8af006b41b3fe
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2016-10-01 01:41:51 +00:00
Andy Ross
6b3c5e8bb2 x86 link: Specify ALIGN_WITH_INPUT for XIP data sections
Binutils ld has an annoying misfeature (apparently a regression from a
few years ago) that alignment directives (and alignment specifiers on
symbols) apply only to the runtime addresses and not, apparently, to
the load address region specified with the "AT>" syntax.  The net
result is that by default the LMA output ends up too small for the
addresses generated in RAM.  See here for some details:

    https://sourceware.org/ml/binutils/2013-06/msg00246.html
    https://sourceware.org/ml/binutils/2014-01/msg00350.html

The required workaround/fix is that AFAICT any section which can have
inherit a separate VMA vs. LMA from a previous section must specify an
"ALIGN_WITH_INPUT" attribute.  Otherwise the sections will get out of
sync and the XIP data will be wrong at runtime.

No, I don't know why this isn't the default behavior.

A further complexity is that this feature only works as advertised
when the section is declared with the "AT> region" syntax after the
block and not "AT(address)" in the header.  If you use the header
syntax (with or without ALIGN_WITH_INPUT), ld appears to DOUBLE-apply
padding and the LMA ends up to big.  This is almost certainly a
binutils bug, but it's trivial to work around (and the working syntax
is actually cleaner) so we adjust the usage here.

Note finally that this patch includes an effective reversion of commit
d82e9dd9 ("x86: HACK force alignment for _k_task_list section"), which
was an earlier workaround for what seems to be the same issue.

Jira: ZEP-955

Change-Id: I2accd92901cb61fb546658b87d6752c1cd14de3a
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2016-10-01 01:41:50 +00:00
Benjamin Walsh
72e5a39ba7 unified: fix misc issues with APIs in kernel.h
ZEP-1022

Change-Id: I88a043cb0127631fcbb48c91504fe4fcd6ae1ecc
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-10-01 01:36:38 +00:00
Benjamin Walsh
9091e5d253 unified: use correct init macro for k_fifo objects
Was using dlist macro instead of slist macro.

ZEP-1021.

Change-Id: I374ae88289669ca03e3c0c76d33fa0229977e403
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-10-01 01:36:38 +00:00
Benjamin Walsh
d3cfc8602d slist: add static initialization macro
Change-Id: Ic0d057ed68dc6513bcc1d4b68fbdfb86c28d1fda
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-10-01 01:36:38 +00:00
Vinicius Costa Gomes
0dfc9db815 samples/zoap-client: Add a README.txt to zoap-client
Change-Id: I2373d87cda125036cce169aaa492aeedcbe200dd
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-10-01 01:11:27 +00:00
Vinicius Costa Gomes
fcb3297b32 samples/zoap-server: Add a README.txt to zoap-server
Change-Id: I136d405e520ed8550e0b5012128a0c673bb9954a
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-10-01 01:11:27 +00:00
Vinicius Costa Gomes
76e81874f0 samples/zoap_client: Make it work with zoap-server
The path and port used by zoap-client were different than the ones used
by zoap-server.

Even if they are different applications, for consistency, it makes sense
for them both to be able to talk to each other.

Change-Id: I883d59c77bc3800b4f0965ba7bcf96a08e545d29
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-10-01 01:11:26 +00:00
Vinicius Costa Gomes
08e0e86bb0 tests/zoap: Add tests for the observe feature
Change-Id: I993437169715ce57f6c5c9f3e95689f785db65c4
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-10-01 01:11:26 +00:00
Vinicius Costa Gomes
7079a18267 iot/zoap: Add helpers for dealing with integer options
A good number of option values represent numbers, so add these helpers
so applications can avoid repeating this.

Change-Id: Ied2a844c51808dcafe751a77492d00f2063de7d6
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-10-01 01:11:25 +00:00
Vinicius Costa Gomes
441d22a371 iot/zoap: Add port information to network addresses
uIP keeps the port separated from the IP addresses, so if the
application wants to communicate with a remote endpoint we must also
have the port information available.

Change-Id: I8e2b01fe5717166e1f9cebcc74b2056325b8ccc3
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-10-01 01:11:25 +00:00
Vinicius Costa Gomes
92a79f7351 iot/zoap: Add support for observing resources
This adds support for observing resources, for client and server side.

For the server side we augment the resource struct so it can hold
information about each interested observer.

For client side, observing a resource abstracted as an reply that
can be called multiple times.

Change-Id: If3f0b41e302cff357ab891e6e91ec2d41579fb92
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-10-01 01:11:24 +00:00
Jaakko Hannikainen
54c90bcbd5 tests: Add gcov support
If the -C flag is given to sanitycheck, generate gcov files for unit
tests and render them with lcov.

Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
Change-Id: Ic25eae6a3cfc2c45595bd6aa235df2c483aaf6ec
2016-09-30 21:17:42 +00:00
Jaakko Hannikainen
bdfe417020 tests: Add a sample for testing natively
This simple unit test runs basic sanity checking on buffers from
net_buf_get. It demonstrates the mocking support in a real-world case,
where it is used to remove the dependency to nano_fifo.

Origin: Original

Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
Change-Id: If2757823bebbc0fa22b3064a432032cdbccdfe2b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-30 21:17:42 +00:00
Jaakko Hannikainen
6f8e7b33b1 tests: convert tests/net/buf to the new framework
This is a sample how to use the framework in an integration test
environment.

Change-Id: I01619fce06759ed523c8c878e8bbda6d8d87d604
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-30 21:17:41 +00:00
Jaakko Hannikainen
349a6c5c28 ztest: Add simple integration and unit tests
These tests mainly test the stack whether it compiles and runs fine
under normal conditions. They do not test most failure conditions.

Origin: Original

Change-Id: Iaac73511a0664abd84685112b4e526eab3eb5748
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-30 21:17:41 +00:00
Jaakko Hannikainen
891c369807 ztest: Add documentation
Origin: Original

Change-Id: I0927c25fbbba5d4863f199d058d311c10d52d784
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-30 21:17:40 +00:00
Jaakko Hannikainen
ca505f8452 ztest: Add native building support
This commit allows building tests using the ztest framework without
including Zephyr. This can be used to enable unit testing single
functions, even static ones.

Origin: Original

Change-Id: Ib7e84f4bd9bbbf158b9a19edaf6540f28e47259f
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-30 21:17:39 +00:00
Jaakko Hannikainen
9167a0305f tests: Add a generic testing framework
This framework makes testing in most parts a lot easier, since it gives
an unified base to work with, removing a lot of unnecessary code from
tests. This framework currently features simple assertions and basic
mocking support. The framework works both with and without Zephyr
running, so it can be used for real unit testing.

Origin: Original

Change-Id: I8c5bf2e6b8d6656b6197ee91699b61e730c1cfe3
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-30 21:17:39 +00:00
Juan Manuel Cruz
5469ff50a1 win-doc: Adds the dependency with the pthread library
Jira: ZEP-779

Change-Id: If9f1714a28c8614fc82cc42c9835eaf4682ce09b
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-09-30 17:49:41 +00:00
Juan Manuel Cruz
99db9741ec win-doc: Add recommendation for regex library configuration
Jira: ZEP-779

Change-Id: I7a49be6f10959dae81e00d5dc66ef01463e88980
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-09-30 17:49:40 +00:00
Amit Kucheria
9b5a4647e0 boards: Rename the nRF52 Nitrogen to 96Boards Nitrogen
Point to a new wiki page for the documentation. The old page can be removed
once this patch is committed.

Change-Id: I2b031bfffe10ec24c41c58d0754f2b14d95f5e53
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
2016-09-30 17:13:39 +00:00
Jukka Rissanen
d8083bd6c7 toolchain: Use ALIAS_OF() in FUNC_ALIAS() macro
Use the ALIAS_OF() macro instead of using alias attribute
directly.

Change-Id: I2f904644df2212b72d8d973bc3651dcf9e7a8b0d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-09-30 15:55:40 +00:00
Jukka Rissanen
fca95109a8 toolchain: Make ALIAS_OF() macro public
Removing _ prefix from ALIAS_OF() macro in order to indicate
that it is for public use.
The macro can be used whenever the FUNC_ALIAS() cannot. The
FUNC_ALIAS() macro can give errors if the aliased function
has parameters like uint16_t etc.

Change-Id: I2f5bc51268072141bb6fb73efe034eb743db3257
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-09-30 15:55:39 +00:00
Johan Hedberg
27fc467e74 net: buf: Allow NULL head pointer when inserting to frag list
To avoid extra logic in code that creates net_buf fragment lists, make
it possible to pass a NULL pointer as the head net_buf when there are
no previous buffers. Before this change the code would look like this:

	if (head) {
		net_buf_frag_add(head, buf);
	} else {
		head = net_buf_ref(buf);
	}

After the patch the code can simply do:

	head = net_buf_frag_add(head, buf);

This will then do the right thing regardless if head is NULL or
non-NULL.

Change-Id: I300394242e2e243ed3839b25629ec816dd98c148
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-09-30 15:07:32 +00:00
Johan Hedberg
8afb6fc229 net: buf: Allow head deletion with net_buf_frag_del()
Extend the net_buf_frag_del() API to be usable for deleting the head
of a fragment chain. This is useful when parsing a stream-based
protocol encoded into a fragment chain, making code such as the
following possible:

	...parse data from 'head' buffer...

	/* If current buffer is empty, move to the next one */
	if (!head->len) {
		head = net_buf_frag_del(NULL, head);
	}

Change-Id: I65794bd7fab4e6dadfd2d6b2fa367f9424fd1bde
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-09-30 15:07:32 +00:00
ksimanto
1006f94998 doc: Update the device power management API documentation
Updated the device power management documentation to reflect
the updated API.

Change-Id: I6e4da7e1ae3642d28205504b8f19d9c8f9a08727
Signed-off-by: Keren Siman-Tov <keren.siman-tov@intel.com>
2016-09-30 11:04:41 +00:00
Daniel Thompson
9a81ffa7ad device: Make device_get_binding() const correct
Currently passing a constant string (other than a string
literal) to device_get_binding() generates a spurious warning.
The warning is spurious because device_get_binding() does not,
nor is it ever likely to, modify its argument. To fix the
warning we modify the prototype to make clear name will never
be modified.

Change-Id: I2df22de61eb2580b2086a685549900d7ed4a322d
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
2016-09-29 13:46:43 +00:00
Andrew Boie
26b1651f0c intstub.S: fix argument to _sys_power_save_idle_exit on IAMCU
Change-Id: I5aa1abe464ba2b8f9c36be78a95705ffcf993c7d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-28 20:28:27 +00:00
Andrew Boie
70d8a32740 x86: interrupts: consolidate duplicated code in idle path
Change-Id: I16b80f363fef17d3ea99fec0ced4f49238f8e6c7
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-28 20:28:07 +00:00
Andrew Boie
e56f61f5aa x86: exceptions: simplify exception stubs
Exception stubs now just push the handler and in some cases a dummy
error code before jumping to the exception handling code, never to
return.

Change-Id: I6a79d9243deb3fc7ccdae003dd0917364c0aa304
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-28 20:28:07 +00:00