Commit graph

4869 commits

Author SHA1 Message Date
Kumar Gala
459ad673ba scripts: extract_dts_includes: Fix DeprecationWarning
With python3.7 we get the following warning:

	extract_dts_includes.py:496: DeprecationWarning: Using or
	importing the ABCs from 'collections' instead of from
	'collections.abc' is deprecated, and in 3.8 it will stop
	working.

Fix this by using 'from collections.abc import Mapping' instead of
'import collections'.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-12-04 22:54:46 -05:00
Patrik Flykt
1b48cb6dc1 scripts/coccinelle: Add Coccinelle script for unsigned values
Add a Coccinelle script that adds an 'U' to values assigned to
unsigned variables, according ot MISRA-C rule 7.2.

Add a 'report' mode to the script that can be used by developer/CI
and a 'patch' mode that should do the heavy lifting.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2018-12-04 22:51:56 -05:00
Håkon Øye Amundsen
81c6662d23 cmake: flash: scripts: Include externally built hex files
Allow user to add externally built hex files to the cmake property
HEX_FILES_TO_MERGE. The hex files in this list will be merged
with the hex file generated when building the zephyr application.

This allows users to leverage the application configuration
available in Kconfig and CMake to help decide what hex file
should be merged with the zephyr application.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2018-12-04 19:04:13 +01:00
Anas Nashif
3a361ecdc7 ci: do not build btsim if not installed
Do not attempt to build btsim if software is not installed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-03 19:28:01 -05:00
Anas Nashif
e81c902488 ci: PULL_REQUEST is reserved, use something else
Use PULL_REQUEST_NR instead of PULL_REQUEST which is reserved by
shippable.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-03 18:45:26 -05:00
Andrew Boie
e48bc56b11 elf_helper: skip SYS_INIT() "devices"
SYS_INIT instantiates a device struct, but this is really
just used to run some functions at boot, it does not correspond
to a device driver belonging to a subsystem. Don't put them in
the kernel object table.

These are easy to filter since they are all named with the
_SYS_NAME macro.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-12-03 11:44:01 -08:00
Anas Nashif
d1bca4e056 ci: use set -x for verbosity
set -v was too verbose, so change to -x and remove extra sourcing of
zephyr-env.sh.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-03 13:00:02 -05:00
Anas Nashif
45cbc81160 ci: pass pull request number to CI script
For further processing, pass pull request number to the CI script.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-03 13:00:02 -05:00
Anas Nashif
d95ce03c1d ci: define BSIM_* variables in ci script directly
Rather than pass them as options, just set it directly in the CI script.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-03 13:00:02 -05:00
Anas Nashif
a0a1bffd1c ci: move pos processing to the CI script
Move post processing to script and remove duplicatated code.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-03 13:00:02 -05:00
Andrew Boie
c7b7363da8 userspace: add additional debug to elf_helper
Devices are identified as belonging to a particular subsystem
by looking at device->driver_api.

Print some debug information if this is NULL or points to an
unrecognized API struct.

This is normal in a lot of cases, for example any use of SYS_INIT().
However, for real devices this may be an indication of mis-
configuration.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-12-03 09:26:20 -08:00
Ioannis Glaropoulos
560357b5e6 scripts: add missing lincense in scripts/gen_app_partitions.py
Add missing lincense header in scripts/gen_app_partitions.py

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-11-30 15:22:58 +01:00
Ioannis Glaropoulos
92f9b24ac9 arch: arm: make _image_ram_start point to the beginning of sram
Move the definition of _image_ram_start at the beginning
of the RAMMABLE (SRAM) region, so it points to the actual
start of RAM linker sections.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-11-30 15:22:58 +01:00
Ioannis Glaropoulos
62c5894bc1 arch: arm: properly enforce MPU-aware linker section alignment
This commit standardizes and simplifies the way we enforce
linker section alignment, to comply with minimum alignment
requirement for MPU, if we build Zephyr with MPU support:
- it enforces alignment with the minimum MPU granularity at
  the beginning and end of linker sections that require to
  be protected by MPU,
- it enforces alignment with size if required by the MPU
  architecture.

Particularly for the Application Memory section, the commit
simplifies how the proper alignment is enforced, removing
the need of calculating the alignment with a post-linker
python script. It also removes the need for an additional
section for padding.

For the Application Shared Memory section(s), the commit
enforces minimum alignment besides the requirement for
alignment with size (for the respective MPUs) and fixes
a bug where the app_data_align was erronously used in the
scipts for auto-generating the linker scripts.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-11-30 15:22:58 +01:00
Andrew Boie
c2e01dff3f workqueues: don't put k_work in special section
There's no current need for this and it makes work items
declared with K_WORK_DEFINE() inaccessible to user mode.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-11-29 09:21:18 -08:00
Himanshu Jha
40b5442699 coccinelle: Add script to remove unnecessary return variable
This script helps to remove bogus intermediate local variable
used in functions to store return value and instead return
directly while saving few bits of memory.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-28 11:54:01 -08:00
Anas Nashif
8d84f9229c gitlint: do not start with subsys:
Commit messages should not start with literal "subsys:", instead, spell
out the actual subsystem name.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-28 09:22:01 -08:00
Ulf Magnusson
c1f4d677f2 menuconfig: Improve behavior for named choices included multiple times
Update menuconfig to upstream revision 38dff36b0f97b, to improve the
behavior for a case reported by Øyvind Rønningstad.

Upstream commit message:

    menuconfig: Only list duplicated choice symbols once

    When a Kconfig file defined a named choice and was included multiple
    times, the choice symbols were listed multiple times in the
    menuconfig as well (due to commit 17d7c1e ("menuconfig: Show all
    symbols at each menu location for multi.def. choices")).

    That's probably not what you want. Tweak it so that each symbol is
    only shown once, with the prompt that was used for it at whatever
    choice definition location is entered.

    Also change how the choice selection is displayed before the choice
    is entered, so that the prompt used for the selected symbol at that
    particular location is used. Previously, the prompt at the first
    definition location for the symbol was always used.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-11-28 16:58:28 +01:00
Henrik Brix Andersen
9e8c9ca8fb subsys: fb: add support for generating CFB font headers at build time
Add script and cmake functions for automatically generating Character
Frame Buffer (CFB) font header files from image files, TrueType, or
OpenType font files.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2018-11-28 11:46:00 +01:00
Ulf Magnusson
9347b0f28f kconfiglib/menuconfig: Various improvements
Update Kconfiglib and menuconfig to upstream revision e47d7eff1012e, to
add some small fixes/improvements/changes:

 - Raise errors for extra trailing tokens anywhere. They were silently
   ignored in some places:

     * end{if,menu,choice} <extra tokens>

     * {default,select,...} FOO <extra tokens>  (though e.g.
       'default FOO if' raised an error)

 - Rephrase the warning when selecting a choice symbol to make it
   clearer that select never has any effect on choice symbols.

 - Display empty menus with '----' instead of '---> (empty)'. This
   matches the C tools. It might be less confusing for symbols defined
   with 'menuconfig', which is where you most often get empty menus
   (when the symbol is n).

 - Speed up parsing performance

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-11-26 14:07:36 +01:00
Bobby Noelte
9cf8b3cd20 sanitycheck: fix false passed on localized error message
Fix false passed on localized error message in make invocation.

Fixes #8348

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-21 20:04:19 -05:00
Marti Bolivar
c41703a020 scripts: west: be more explicit in copy warning message
Print the exact path to the copy of west that was run, to further
avoid confusion. Explain exactly what is going away and why.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-11-21 09:43:45 -05:00
Alberto Escolar Piedras
2d580a8339 ci: Add missing option to control placement of BT tests results file
Added a missing option in run_ci.sh to control the placement of the
xml results file. (Before it was just propagated thru the enviroment)
+
Changed .shippable to use this option when callign it.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-11-21 09:42:46 -05:00
Anas Nashif
53982b7e27 Revert "ci: do not build btsim if we are not going to run it"
This reverts commit 6d5ac1c089.

Looks like this was not correctly done, building btsim is needed on all
nodes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-21 09:12:21 -05:00
Anas Nashif
88ece4944b ci: do not build docs in main CI job
Building docs and running various checks is now being done in another CI
job that runs in parallel and reports directly to the PR.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-21 09:12:21 -05:00
Anas Nashif
f114a1383d sanitycheck: outdir should not be relative to ZEPHYR_BASE
We should leave ZEPHYR_BASE alone and create the test output wherever
we are running.
This will support running sanitycheck on test roots other than zephyr's
main git repo.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-21 15:05:07 +01:00
Anas Nashif
f18ad9dd4b sanitycheck: support running tests out of the tree
right now we assume we are running the tests inside the Zephyr tree and
things do not work well when someone tries to use sanitycheck on tests
outside the tree with a different test root. Cleanup the name handling
and support running outside of Zephyr.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-21 15:05:07 +01:00
Anas Nashif
ccb57d766b ci: fix skipped testcase status posting
Skipped tests were not evaluated correctly.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-20 18:14:19 -05:00
Anas Nashif
4c0e3e8697 ci: overhaul check-compliance.py script
- Support sending status to github
- Support license checking
- Make every test a class
- Use junitparser instead of custom xml for junit output

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-20 16:36:10 -05:00
Anas Nashif
6d5ac1c089 ci: do not build btsim if we are not going to run it
We were building this on every node.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-20 16:36:10 -05:00
Anas Nashif
10970a60c0 sanitycheck: remove unused platforms keyword
This keyword had no effect and was being copied over to many samples
errornously.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-19 15:03:55 -05:00
Bobby Noelte
1bf1d6a267 scripts: extract_dts_includes: fix cell name readout from yaml
Default for a unavailable cell name was an empty list, whereas a
given name is a string. Leads to a runtime error if the name is given.
Make the default an empty string.

Names for cells are taken from the yaml binding. The key used is
"#cells" which clashes if there are different cell based properties
for a device. Readout names from the more specific "#xxx-cells" if
given and fall back to "#cells" if not given.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2018-11-19 08:35:10 -06:00
Ulf Magnusson
37fcec9833 kconfiglib/menuconfig/kconfig.py: Various improvements
Update Kconfiglib and menuconfig to upstream revision d3866958c7685, to
add various improvements:

 - Support HOME and END in the jump-to dialog in the menuconfig. END can
   be handy as choices, menus, and comments appear at the end.

 - Add more fine-grained warning controls for multiple assignments to a
   symbol in configuration files. Use it to simplify kconfig.py a bit.

   Clean up kconfig.py a bit in other ways too, e.g. by removing unused
   imports.

 - Improve Kconfig parsing performance slightly

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-11-19 12:18:23 +01:00
Marti Bolivar
18e6c10339 scripts: print notice that west's copy is a copy
One of the most common issues I've had to deal with as people are
starting to try west is that bash has cached the 'west' binary to the
version in zephyr/scripts/west after they ran zephyr-env.sh on Unix
operating systems.

This makes people (correctly) think they are running an older version
when they get output about missing clone commands, etc., but doesn't
give them any hints about why that happened, because most people don't
know that west is already in widespread use for flashing and
debugging.

To make fielding support for these users easier while we're
transitioning, print a notice at the end of the copy informing users
what just happened. We can make it more forceful as time goes on.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-11-17 00:49:12 -05:00
Andrew Boie
f253d0779d k_mem_slab: track as a kernel object
We aren't going to allow any user mode access to the
k_mem_slab APIs, but in some cases (specifically in the
case of the I2S subsystem) we need to allow user mode
to assign a memory slab to a particular driver.

This will let us verfiy (in supervisor mode) that a provided
k_mem_slab pointer is really a k_mem_slab, and know its
initialization state, and have permissions assigned to it.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-11-15 16:20:36 -05:00
Anas Nashif
3cbffefb26 sanitycheck: use overlays to enable coverage
Set COVERAGE option using an overlay instead of piping it through CMAKE
which breaks dependecies, i.e. if someone wants to disable that option
on the application level.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-15 08:31:34 -05:00
Anas Nashif
8d72bb909f sanitycheck: remove dependency of coverage on native_posix
Make it more generic and depend on Kconfig taking care of dependencies.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-15 08:31:34 -05:00
Anas Nashif
4df6c565d2 sanitycheck: ignore generated headers in outdir
With this, we will get results for the same file for every build (tests
and samples).

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-15 08:31:34 -05:00
Anas Nashif
7dd19ea74d sanitycheck: filter by test fixtures
Support specifying a test fixture attached to a board to filter in/out
tests that require this fixture to be able to run a test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-14 23:42:45 -05:00
Himanshu Jha
817f4b374f coccinelle: Suppress reports/warnings for ext/
The following addition `depends on !(file in "ext")` allows
to exclude `ext/` warnings reported by coccinelle scripts.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-14 19:20:34 -05:00
Andrzej Głąbek
a7c430f36f scripts: dts: Use DT_ prefix in generated labels
Almost all labels generated by the extracting script are now prefixed
with DT_. The only exceptions are:
- stuff with 'base_label' specified in yaml bindings
- items specified by 'regs_config' and 'name_config' dictionaries
  in globals.py module
- FLASH related labels generated by flash.extract() called separately
  from generate_node_definitions(), e.g. FLASH_WRITE_BLOCK_SIZE -
  these are used directly, not through fixups, from existing code
  so I didn't want to touch them now

Labels generated for aliases are additionally prefixed with information
from the 'compatible' property, e.g. DT_GPIO_LEDS_LED0_* is generated
instead of LED0_*. To provide backward compatibility for code that uses
LEDx_* and SWx_* labels in their previous forms, a command line option
named 'old-alias-names' is added to the extraction script. This option
causes that the labels for aliases are generated in both old and new
forms. Currently this option is always enabled in dts.cmake.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-13 10:44:42 -06:00
Alberto Escolar Piedras
917711fd8a ci: Run bsim_bt tests and collect coverage results
Compile and run the tests avaliable in bsim_bt
and collect the coverage results into the coverage report.

Also, detect if bsim's component folder already contains the
nRF52 HW models, and if it does instead of trying to fetch
them again (which will fail) check that the right versio is
present. This should ease testing locally.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-11-13 11:14:19 -05:00
Sebastian Bøe
03ed0950e5 sanitycheck: Allow skipping the 'unrecognized section' test
Allow the user to disable the "unrecognized section" test. I can see
multiple use-cases for disabling the test.

If orphan sections exist and are dynamically or unpredictably named
the unrecognized section test will fail.

If out-of-tree sections exist, one might want to temporarily disable
the "unrecognized section" test until one has made it recognized.

The test is disabled through a CLI flag.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-11-13 11:13:33 -05:00
Sebastian Bøe
5a2ddf37d9 msys: Drop support for building in an MSYS environment
MSYS support was added as a stop-gap while native windows support was
unsupported. Now that Native windows support is stable we can drop
support for MSYS.

Dropping support for MSYS fixes #11260 and allows us to spend more
resources on native windows support.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-11-13 10:28:33 +01:00
Anas Nashif
043b0a6a28 ci: build docs on last node
Distribute the load and build docs correctly on the last node.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-11 08:34:12 -05:00
Anas Nashif
0a63947abc ci: move ci scripting from .shippable to a script
move CI scripting to a dedicated script. For example, to simulate what
is run in CI when a pull request is submitted:

./scripts/ci/run_ci.sh -b master -r upstream  -p

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-10 13:09:00 -05:00
Anas Nashif
399281beb8 scripts: remove unused ci scripts
Remove old and unused scripts from the tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-10 13:09:00 -05:00
Erwan Gouriou
eaac6d3cf9 scripts/dts: extract_dts_includes: fix multi-compat bus parent
Case when bus parent has more than one compatible was not treated
correctly. Use get_compat() method which returns first compat
in case several compats are available

Fixes #11121

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-11-10 11:45:53 -06:00
Andrew Boie
506f15c381 interrupts: simplify position of sw ISR table
We now place the linker directives for the SW ISR table
in the common linker scripts, instead of repeating it
everywhere.

The table will be placed in RAM if dynamic interrupts are
enabled.

A dedicated section is used, as this data must not move
in between build phases.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-11-10 11:01:22 -05:00
Andrew Boie
7bac15f2ff x86: add dynamic interrupt support
If dynamic interrupts are enabled, a set of trampoline stubs
are generated which transfer control to a common dynamic
interrupt handler function, which then looks up the proper
handler and parameter and then executes the interrupt.

Based on the prior x86 dynamic interrupt implementation which
was removed from the kernel some time ago, and adapted to
changes in the common interrupt handling code, build system,
and IDT generation tools.

An alternative approach could be to read the currently executing
vector out of the APIC, but this is a much slower operation.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-11-10 11:01:22 -05:00
Mikkel Jakobsen
9c8a6099a7 scripts: locked pyocd version to 0.12.0 in requirements.txt
The recently released version 0.13.0 of pyocd does not install cleanly
in linux and prevents installation of requirements.txt. Locking pyocd to
version 0.12.0 is a temporary workaround until problem is solved by
pyocd maintainers.

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@prevas.dk>
2018-11-10 10:06:17 -05:00
Himanshu Jha
58781d5782 coccinelle: Add script to check legal usage of sizeof expression
sizeof when applied to a pointer typed expression gives the size of
the pointer and not the size of the object associated with the pointer
expression leading to errors.

This scripts checks for inconsistencies where sizeof is incorrectly
used, especially while calculating size of memory to be allocated in
memory allocating functions.

Eg:

-	memset(pStr, 0, sizeof(pStr));
+	memset(pStr, 0, sizeof(*pStr));

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-07 10:34:24 -05:00
Himanshu Jha
1e3e10cfa8 coccinelle: Add script to remove redundant semicolon
This script allowes to remove the redundant semicolon from
`if`, `switch`, `while`, `for` statements.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-07 10:34:06 -05:00
Himanshu Jha
6f2c7eed49 coccinelle: Add script to find cases of unsigned < 0
Unsigned expressions cannot be less than zero and presence
of such practices very likely indicates a bug.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-07 10:33:43 -05:00
Himanshu Jha
1df011c8e2 coccinelle: Add script to find cases of missing locks
This script finds cases of missing locks in the code.
There is some possibilty of false positives in cases
where a particular function is supposed to exit with
the lock held or there is any preceding function call
that releases the lock.

Suggested-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-07 10:32:59 -05:00
Himanshu Jha
6f98ae38a2 coccinelle: irq_lock.cocci: Update script
* Provide a single liner description at top using `///`
  comments. This one liner is displayed when using `--verbose`
  mode of coccicheck.

* Specify Condidence level property adhering to coccinelle.rst
  section "Proposing new semantic patches".

* Add virtual patch rule to handle the patch case when coccicheck
  is supplied with `--mode=patch` option.

* Add `depends on !(file in "ext")` to ignore reports from `ext/`
  directory.

* Simplify rule to use disjunctions and use "exists" to match any
  available control path.

Suggested-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-07 10:31:41 -05:00
Himanshu Jha
ff5a8a85e1 coccinelle: ignore_return.cocci: Update script
* Provide a single liner description at top using `///`
  comments. This one liner is displayed when using `--verbose`
  mode of coccicheck.

* Specify Condidence level property adhering to coccinelle.rst
  section "Proposing new semantic patches".

* Add virtual patch rule to handle the patch case when coccicheck
  is supplied with `--mode=patch` option.

* Add `depends on !(file in "ext")` to ignore reports from `ext/`
  directory.

* Simplify patch rule to reduce effort in reconstruction since
  logically we are only *adding* void cast.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-07 10:30:11 -05:00
Himanshu Jha
6aaba6842b coccinelle: Add script to report cases of NULL dereference
This script finds cases of NULL dereferences where a variable
is dereferenced under a NULL test, even though it is known
to be NULL.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-07 10:28:58 -05:00
Himanshu Jha
060414704b coccinelle: unsigned_shift.cocci: Update script
* Use `expression` metavariable instead of `constant` to catch
  missing cases such as:

diff -u -p a/subsys/net/ip/rpl.c b/subsys/net/ip/rpl.c
--- a/subsys/net/ip/rpl.c
+++ b/subsys/net/ip/rpl.c
@@ -686,7 +686,7 @@ static void new_dio_interval(struct net_
 {
 	u32_t time;

-	time = 1 << instance->dio_interval_current;
+	time = BIT(instance->dio_interval_current);

* Provide a single liner description at top using `///`
  comments. This one liner is displayed when using `--verbose`
  mode of coccicheck.

* Specify Condidence level property adhering to coccinelle.rst
  section "Proposing new semantic patches".

* Add virtual patch rule to handle the patch case when coccicheck
  is supplied with `--mode=patch` option.

* Edit patch rule to remove redundant parentheses in the output.

* Add `depends on !(file in "ext")` to ignore reports from `ext/`
  directory.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-07 10:27:44 -05:00
Kumar Gala
7c2a8a4678 dts/extract_dts_includes.py: Expose flash partition extract function
Allow directly calling the flash partition extraction function and
remove passing any arguments that the function doesn't actually use.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-06 07:42:39 -06:00
Kumar Gala
6fd3fbbd22 dts/extract_dts_includes.py: Rework flash partition extraction
Reworked flash partition extraction so we call it when we see a
node that is 'partiton@' instead of per property.  We also handle the
'read-only' property in the flash partition extraction function which
lets us remove 'use-property-label' handling.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-06 07:42:39 -06:00
Kumar Gala
577df2dbe3 dts/extract_dts_includes.py: remove use of 'use-property-label' in regs
We don't have any cases that need 'use-property-label' related to
handling of reg extraction so lets remove it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-06 07:42:39 -06:00
Kumar Gala
30960e61bf scripts/dts: extract_dts_includes: Add support for client pwms
Add support to the extract script to handle 'pwms' client properties.
This is pretty much identical to how we hand 'gpios'.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-05 14:01:21 -06:00
Anas Nashif
a4c368ef07 sanitycheck: only log printable chars
New Qemu is emitting binary charachters which is disturbing generation
of XML, so make sure we only log printable charachters.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-05 11:00:38 -05:00
Ulf Magnusson
dc6b0c83d2 menuconfig: Add two small error reporting and UI improvements
Update menuconfig and Kconfiglib to upstream revision 68426efeae6aa, to
add two minor menuconfig improvements and a small bugfix:

 - Expected errors, like syntax errors in Kconfig files, no longer
   generate a Python backtrace. Just the error message is shown.

 - Entering a choice now places the cursor on the selected symbol, if
   any.

 - Having two consecutive empty 'if's (which could also appear e.g. due
   to osource) crashed the menuconfig when entering show-all mode, due
   to the 'if' removal logic in Kconfiglib failing to remove one of
   them. All configurations of 'if's are now correctly removed.

   This error was found while reading the code.

Some minor optimizations and some internal cleanup is included as well.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-11-04 22:00:56 +01:00
Kumar Gala
a834c53e91 scripts: dts: extract: Fix handling of prop being a list of lists
Before dtc 1.4.7 we'd get something like the following for an gpios
property:

reg = <1 2 3 4>;

After dtc 1.4.7 we get:

cs-gpios = <0x05 0x0d 0x00>, < 0x06 0x00 0x00>;

We should handle both cases in the extract reg handling code.  So if
we see a list of lists, we flatten it to a single list to normalize
the property.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-02 23:11:33 -04:00
Kumar Gala
73c7cd184b size_report: cleanup up detection and error handling
We first check to see if we have a valid elf file before doing anything
else.  Otherwise we'd could get script errors instead of just notifying
the user the file doesn't exist.

Signed-off-by: Kumar Gala <kumar.gala@gmail.com>
2018-10-29 10:15:17 -04:00
Kumar Gala
f6af3ed14a size_report: Mark arguments as required
We need a minimum of --outdir, --objdump, and --nm set for the script to
work so mark these arguments as required.

Signed-off-by: Kumar Gala <kumar.gala@gmail.com>
2018-10-29 10:15:17 -04:00
Kumar Gala
a4173329d4 size_report: convert to use argparser as optparse has been deprecated
Do a straight forward conversion from optparse to argparser.  All
of our other python scripts use argparser already.

Signed-off-by: Kumar Gala <kumar.gala@gmail.com>
2018-10-29 10:15:17 -04:00
Ulf Magnusson
85f8c0d4eb menuconfig: Add jump-to for choices, menus, and comments
Update menuconfig (and Kconfiglib, just to sync) to upstream revision
bf1701b36634b, to add this commit:

    menuconfig: Add jump-to for choices, menus, and comments

    For choices, search the name and the prompt. This is the same as for
    symbols, except names are optional (and rare) for choices.

    For menus and comments, search the prompt (title text).

    When jumping to a non-empty choice or menu, jump into it instead of
    jumping to its menu node. If show-all mode is off and there are
    visible items in the choice/menu, then jump to the first visible
    node. Otherwise, enable show-all and jump to the first node.

Previously, only symbols could be jumped to.

Various other small fixes/improvements are included too:

 - The "no range constraints" text was dropped from the input dialog
   when settings int/hex symbols without an active 'range'. It might be
   more confusing than helpful.

 - A crash when pressing Ctrl-F (the view-help shortcut) with no matches
   in the jump-to dialog was fixed

 - Some gnome-terminal shoddiness was worked around to remove minor
   jumpiness when reducing the height of the terminal

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-10-27 15:56:36 -04:00
Erwan Gouriou
94d3b6a211 scripts/dts: extract: fix 'compatbible' property typo
Replace "Compatibles" with "compatibles".

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-10-25 08:02:33 +01:00
Erwan Gouriou
ba79b2f43f scripts/dts: extract: Provide a value to generated compat #define
Compat define is generated without value. This should not harm,
but since generated flag is a "Kconfig like" define, we migth need it
to hold a value.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-10-25 08:02:33 +01:00
Erwan Gouriou
a6716aef15 scripts/dts: extract_dts_includes: fix alias creation for subnodes
Heuristic for populating an alias string for a subnode
of an alias node was wrong as there was no check if
alias already existed and string created was not in line
with device tree specfication (allowed chars: [0-9],[a-z], '-').

Fix these two points.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-10-24 18:17:09 +01:00
Kumar Gala
f6a30ff070 dts/extract_dts_includes.py: refactor get_node_label_string
We can replace the method get_node_label_string in DTDirective with the
global function get_node_label.  This way we have a single place that
labels for defines are being generated.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-24 10:41:25 +01:00
Kumar Gala
193ad8ef9f dts/extract_dts_includes.py: refactor get_node_label
Don't based the compat to get_node_label, we can just figure out based
on the node address we are passed.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-24 10:41:25 +01:00
Kumar Gala
168c2dec95 dts/extract_dts_includes.py: Move label override handling
Refactor the handling of 'use-property-label' into extract_prop since
its the only place its needed.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-24 10:41:25 +01:00
Kumar Gala
25ec17683f scripts/dts/extract: Change compat define prefix
Drop CONFIG_ and just use DT_ prefix for compatiable generated defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-24 10:40:46 +01:00
Adithya Baglody
1fa8cf9279 linker: arm: place priv.noinit at the end of RAM
This puts the priviledged stack at the end of RAM.
This combines PR #10507 and #10542.

Fixes #10473
Fixes #10474
Fixes #10515

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-10-19 16:11:34 -04:00
Kumar Gala
b61b0cc631 dts/extract_dts_includes.py: Filter out standard properties
Standard device tree properties like 'reg-names', 'interrupt-names', and
'phandle' should be handled by other extract mechanisms or ignored.  So
filter them out before we even call extract_property

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-19 10:01:51 -05:00
Anas Nashif
924a4e7000 sanitycheck: support requirements on env variables
Some boards depend on environment variables so we want to make sure we
do not attempt to build boards requiring additional setup.

Add the section below into the board YAML file, sanitycheck will check
the environment and will only run tests on that board if the variables
are defined.

env:
  - VAR1
  - VAR2

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-19 10:57:54 -04:00
Kumar Gala
fc5e23365e dts: Add proper handling for boolean properties
We've never handled boolean properties well, if we had a boolean that
existed we'd generate a define of 'True' and if the boolean didn't exist
than nothing would be generated.  So there was no easy way to tell that
the boolean wasn't defined.

Now if we mark a property as boolean in the yaml, we will generate a
define for it regardless if it exists or not.  If it exists we'll
set the value to 1, and if it doesn't to 0.

Fixes #8376

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-19 07:55:34 -05:00
Kumar Gala
527a69ce62 dts/extract/globals.py: Add function to get list of compats
Add a function that given a node address we get a list of compats back
instead of just the first.  This is in prep for eDTS support.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-18 12:57:32 -05:00
Kumar Gala
3c14bbe884 scripts: dts: extract: Fix handling of reg prop being a list of lists
Before dtc 1.4.7 we'd get something like the following for an reg
property:

reg = <1 2 3 4>;

After dtc 1.4.7 we get:

reg = <1 2>, <3 4>;

We should handle both cases in the extract reg handling code.  So if
we see a list of lists, we flatten it to a single list to normalize
the property.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-18 06:59:13 -05:00
Paul Sokolovsky
b9248a17ac scripts: extract_dts_includes: Read files as utf-8
Python's open() by default using "system character encoding", which
may vary from system to system (e.g. LOCALE=C aka "ascii" on bare-OS
systems, something on Windows, etc.). But Zephyr files are utf-8, so
read them as such, by explicitly specifying encoding.

This is similar to changes earlier done to another script in 94620bd.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-10-17 13:56:25 +02:00
Johann Fischer
fcffebfe15 sanitycheck: whitelist font entry section
Whitelist font entry section.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-16 14:54:47 -04:00
Alberto Escolar Piedras
3777b4452d sanitycheck: nf52_bsim testcases to run with other native
To be able to collect all coverage reports from the "native"
applications in the first CI instance, let's also place the
nrf52_bsim testcases first. The order now is:
 unit_testing
 native_posix
 *_bsim
 anything else

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-10-15 09:36:37 -04:00
Anas Nashif
2c7636bc88 sanitycheck: fix skipped element in junit output
The skipped element was left empty, fill it with details to make parsers
happy.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-13 11:35:45 -04:00
Anas Nashif
1ea5d7b472 sanitycheck: run tests based on sub-testcases
run tests based on sub-testcases, for example:
  sanitycheck  --sub-test net.app.app_tcp4_client_hostname_fail

will run all the tests in tests/net/app/net.app.

Useful for re-running tests that are reported in testrail and in reports
generated by sanitycheck.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-13 11:35:45 -04:00
Anas Nashif
07d54c042e sanitycheck: force configured toolchain
Do not check for board/toolchain combination and if a certain toolchain
is configured for a board, run with whatever toolchain we have.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-13 11:35:45 -04:00
Sebastian Bøe
5681f87fd7 sanitycheck: Support legacy variant 'gccarmemb'
CMake will translate from the toolchain variant 'gccarmemb' to
'gnuarmemb', but sanitycheck does not. This causes inconsistent and
therefore confusing behaviour between CMake and sanitycheck.

Until gccarmemb is dropped support for, do the same translation with
sanitycheck.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-10-12 11:05:07 -04:00
Anas Nashif
a3be0945fe west: runner: fix naming and paths to xt-ocd
Fix naming of boards supported by this runner.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-11 10:49:56 -04:00
Erwan Gouriou
76cba5d5ea scripts: cleanup unwanted updstreamed file
scripts/dts_sanity/edts_ref.json_save has been pushed by error
in commmit a429104095
Clean it up.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-10-11 09:24:02 -05:00
Kumar Gala
011b93011e dts: yaml: remove unused id field
The 'id' field was never used and tended to just have the compat of the
node.  Lets remove it and removed some code in extract_dts_includes.py
related to it.  Added a warning if 'id' is set in a yaml so we can
remove it going forward.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-11 08:03:44 -05:00
Praful Swarnakar
cf89e2883d sanitycheck: Add fixture option for external hardware dependecy
Add a new option as fixture in harness configurations for utilizing
sanitycheck to identify test cases that require external hardware
such as sensor, ble, networking for validation. The config will be
added to yaml files with unique fixture name to identify each hardware
and allow automation to trigger test execution on setup having the
specific fixture enabled. Also, remove the default required for type and
regex configs that is not essential in case of ztest based test cases.

Signed-off-by: Praful Swarnakar <praful.swarnakar@intel.com>
2018-10-10 19:11:29 -04:00
Ulf Magnusson
5cfe06b6bc genrest/menuconfig: Fix crash for promptless choices
Update menuconfig (and Kconfiglib, just to sync) to upstream revision
256e5b3e38e92 to get the fix below in, for an issue in an external
project. Also update genrest.py with a similar fix (the genrest issue
was what originally prompted it).

    menuconfig: Improve/fix promptless choice handling

    The code assumed that all parent (interface) menus always have a
    prompt, which is false for items in promptless choices. This led to
    a crash e.g. when viewing the symbol information for a symbol within
    a promptless choice.

    Promptless choices with children can show up "legitimately" when
    people define choices in multiple locations to add symbols, though
    this is broken in the C tools.

    Use standard_sc_expr_str(node.item) instead of the non-existing
    prompt for promptless choices. That way they show up as
    '<choice (name if any>)>', which is consistent with how they're
    shown elsewhere.

    This commit also changes how choice names are displayed in
    show-name/show-all mode, to the standard_sc_expr_str() format.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-10-10 16:16:28 +02:00
Erwan Gouriou
a429104095 ext/hal/st: stm32f2: dos2unix and remove trailing white spaces
Format all cube packages to the same format before update to new
versions:
-Apply dos2unix
-Remove trailing white spaces

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-10-09 12:03:17 -04:00
Kumar Gala
c922788d0a scripts/dts/extract: Add support for translating range properties
For now we've used range properties as a pass through.  However range
properties can translate from one address space to another.  This is
typically used one address spaces translate from one physical bus to
another (For example going from PCI address space to internal SoC memory
map).  However, we can also use this for cases where we want to reduce
duplication (For example with ARMv8-M for secure v non-secure MMIO
registers).

'ranges' takes either the form of:
	ranges; /* pass through translation */
or:
	ranges = <child-bus-address parent-bus-address length>;

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-05 13:19:39 -05:00
Kumar Gala
31340d8cdd scripts/dts/extract: Re-implement get_addr_size_cells
We use to walk to the full tree in search of addr/size cells.  We should
only have to look at the parent of the node for these properties.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-05 09:59:07 -05:00
Kumar Gala
6a8d5952d0 scripts/dts: Add help function to get address/size cells for a node
Given the path address to a node return the address/size cells.  In
theory this should just be looking up the #{address,size}-cells in
the parent node, we'll make that cleanup next.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-05 09:59:07 -05:00
Kumar Gala
bf0001242c scripts/dts/extract: Add get_parent_address helper function
We have a few places that we want the path to the parent, so lets add a
helper function for that.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-05 09:59:07 -05:00
Mieszko Mierunski
316f8604b7 script: dts: Fix alias generation for reg property.
In case of having more than one reg, aliases would not generate
properly. Number of register at the end of define was missing.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-10-04 07:54:48 -05:00
Himanshu Jha
ab35ebe17d coccinelle: Add script to enforce ARRAY_SIZE macro usage
This script detects cases where ARRAY_SIZE can be used such as
where there is a division of sizeof the array by the sizeof its first
element or by any indexed element or the element type. It replaces the
division of the two sizeofs by ARRAY_SIZE helper macro.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-10-02 14:03:39 -07:00
Himanshu Jha
dce9141fb1 Coccinelle: Add support for Coccinelle infrastructure
'coccicheck' target is used to initiate Coccinelle checker. It
can be called via four different modes that generate different
output corresponding the mode.

The four modes are:

* 'patch' proposes a fix, when possible.
* 'report' generates a list in the following format:
	file:line:column-column: message
* 'context' highlights lines of interest and their context in
   a diff-like style. Lines of interest are indicated with '-'.
* 'org' generates a report in the Org mode format of Emacs.

The 'coccicheck' front-end can be called with suitable arguments:

* --mode=<mode>: specify the mode for processsing.
* --cocci=<path/to/foo.cocci>: specify the SmPL file to use.
* --verbose=<1>: enable verbose output.

Run `./scripts/coccicheck --help` for more detailed info
on various options available.

With the above arguments the coccinelle transformation engine
runs on the entire/part of the source code tree depending on
various options supplied to the coccicheck sanity checker.

More detailed documentation can be found at:
doc/application/coccinelle.rst

Cc: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-10-02 14:03:39 -07:00
Aurelien Jarno
872719e9a6 scripts/dts/extract/flash.py: fix load offset
When the code partition is not at the beginning of the flash, the load
offset is wrongly computed. The address in the device tree is already
relative to the beginning of the parent node, ie the beginning of the
flash memory space. There is therefore no need to subtract it.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-10-02 10:00:04 -07:00
David Leach
dc2acd6b94 scripts: extract: globals.py: Fix node name parsing
The node name parsing for the _LABEL #define does not parse the unique
node portion in the same fashion between @<unit_address> and _<number>.
This change normalizes the two modes.

Signed-off-by: David Leach <david.leach@nxp.com>
2018-10-02 09:45:39 -05:00
Ulf Magnusson
905e65d694 Kconfig: Improve error messages for mismatched endchoice/endif/endmenu
Update Kconfiglib (and menuconfig, just to sync) to upstream revision
8087311cd91be to get the following fix in, for an issue reported by
pfalcon:

    Give clearer errors for bad endchoice/endif/endmenu nesting

    An endchoice/endif/endmenu with no corresponding choice/if/menu
    generated a cryptic 'unrecognized construct' parse error. Improve
    the error message so that the problem is pointed out explicitly:

      kconfiglib.KconfigError: Kconfig:37: couldn't parse 'endmenu': no
      corresponding 'menu'

    Reported in https://github.com/ulfalizer/Kconfiglib/issues/56.

This update also adds support for user-defined preprocessor functions in
Python, which could potentially be handy for DTS/Kconfig integration.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-09-29 22:01:00 +02:00
Adithya Baglody
10c6a0c1aa subsys: app_memory: Fixed the build issue wrt ARC.
The linker script is updated to support the new method of size
calculation.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-09-28 08:09:23 +05:30
Flavio Ceolin
6fc84feaf2 kernel: syscalls: Change handlers namespace
According C99 the first 31 characters of an identifier must be unique.
Shortening the namespace of the generated objects to achieve it.

C99 - 5.2.4.1
MISRA-C rule 5.1

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-28 07:58:19 +05:30
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
Marti Bolivar
ddad53abe2 scripts: add colorama to requirements.txt
This got missed in the latest west code import.

Fixes #10241.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-09-27 05:52:39 +05:30
Marti Bolivar
9e3edbbd80 scripts: fix west launcher for macOS
The $(readlink -f) call in scripts/west doesn't work on macOS.

Let's just ensure compatibility on all the platforms by moving
scripts/west-launcher.py to scripts/west, making it executable on
macOS and Linux, and launching it from the Windows doskey macro.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-09-26 00:33:45 +02:00
Marti Bolivar
55b462cdfa scripts: update west to latest upstream version.
Update to the latest west. This includes a new 'attach' command. There
are also multi-repo commands, but those won't get exposed to the user
unless they install Zephyr using "west init" + "west fetch" (and not,
say, "git clone").

Replace the launchers; they now detect whether zephyr is part of a
multi-repo installation, and run the west code in its own repository
if that is the case.

This also requires an update to:

- the flash/debug CMakeLists.txt, as the new west package is no longer
  executable as a module and must have its main script run by the
  interpreter instead.

- the documentation, to reflect a rename and with a hack to fix
  the automodule directive in flash-debug.rst for now

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-09-25 17:51:22 +02:00
Anas Nashif
ba4643b778 sanitycheck: remove special ansi charachters from xml
XML does not like special ansi charachters (coming from logger), so
remove them.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-23 13:04:05 -04:00
Anas Nashif
0f55538762 gitlint: accept "'" in committer names
Allow "'" in names, for example xxx O'xxx.

Fixes #10152

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-21 12:49:23 -04:00
Kumar Gala
c57f3a09bc scripts/dts/extract: Fix handling of value extraction based on cells
If size or address cells happened to be 2 we'd get the wrong value since
we where shift the least significant 32-bit's up.  Adjust the math based
on the value of the cell amount to fix things.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-09-21 07:23:49 -07:00
Bobby Noelte
14ced2f021 scripts/dts/extract: Cleanup reg extraction
Rename address / size cell variable to clarify that its the number
of address / size cells.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-09-21 07:23:49 -07:00
Erwan Gouriou
cc054c8044 scripts/dts/extract: factorize 'reg' prop extraction
reg class is updated to take into account whole use cases
of reg extraction so extract_reg_prop could be removed.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-09-21 07:23:49 -07:00
Erwan Gouriou
8245b0c1a2 scripts/dts: extract_dts_includes: remove unused 'names' argument
Parameter 'names' is provided as argument of several property
extract functions. Thought it is actually used only once.
Remove when not needed.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-09-21 07:23:49 -07:00
Adithya Baglody
ae92f2badf subsys: app_memory: Fixed the size calculation for power of 2 MPUs
The size calculation for power of 2 MPUs were incorrect.
The calculation was not taking into account the amount of padding
the linker does when doing the required alignment. Hence the size
being calculated was completely incorrect.

With this patch the code now is optimized and the size of
partitions is now provided by the linker.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-09-20 11:25:53 -04:00
Krzysztof Chruscinski
6aed72e487 shell: Shell subsystem reimplementation
New shell support features like:
- multi-instance
- command tree
- static and dynamic commands
- multiline
- help print function
- smart tab (autocompletion)
- meta-keys
- history, wildcards etc.
- generic transport (initially, uart present)

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2018-09-19 09:30:29 -04:00
Flavio Ceolin
4218d5f8f0 kernel: Make If statement have essentially Boolean type
Make if statement using pointers explicitly check whether the value is
NULL or not.

The C standard does not say that the null pointer is the same as the
pointer to memory address 0 and because of this is a good practice
always compare with the macro NULL.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-18 13:57:15 -04:00
Flavio Ceolin
a7fffa9e00 headers: Fix headers guards
Any word started with underscore followed by and uppercase letter or a
second underscore is a reserved word according with C99.

With have *many* violations on Zephyr's code, this commit is tackling
only the violations caused by headers guards. It also takes the
opportunity to normalize them using the filename in uppercase and
replacing dot with underscore. e.g file.h -> FILE_H

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-17 15:49:26 -04:00
Anas Nashif
2e7bdb6be2 scripts: gen_priv_stacks.py: run through flake8
Follow pep8 style based on flake8 script.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-17 09:40:02 -04:00
Anas Nashif
7a08b2b353 scripts: gen_kobject_list.py: run through flake8
Follow pep8 style based on flake8 script.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-17 09:40:02 -04:00
Anas Nashif
6af68b3623 scripts: elf_helper.py: run through flake8
Follow pep8 style based on flake8 script.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-17 09:40:02 -04:00
Ulf Magnusson
e0f1d77f5c menuconfig: Fix some minor graphical glitching and add custom styles
Update menuconfig.py to upstream revision 35a60b786c646.

This fixes some minor graphical glitching, with parts of lines that
don't fit the terminal wrapping around to the next line, and some
headings disappearing.

This version also adds supports for custom style definitions,
contributed by Mitja Horvat (punkfluid). Colors can be specified both by
number and in #RRGGBB notation. Color accuracy varies depending on
terminal capabilities, but will usually be good.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-09-17 09:55:12 +02:00
Flavio Ceolin
da49f2e440 coccicnelle: Ignore return of memset
The return of memset is never checked. This patch explicitly ignore
the return to avoid MISRA-C violations.

The only directory excluded directory was ext/* since it contains
only imported code.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00
Flavio Ceolin
91b6123932 kernel: syscall: Explicitly ignoring not used return
Some syscacll return value through parameters and for these functions
the return of _arch_syscall_invoke* are not used.

MISRA requires that all return values be checked.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00
Carles Cufi
5f102fbfca scripts: ci: Set SOC_DIR for check-compliance.py
To avoid having to set it externally, set the SOC_DIR environment
variable directly in the compliance script.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-09-14 17:45:56 +02:00
Erwan Gouriou
c5ada39411 scripts: extract_dts_includes.py: generate 'compatible' CONFIG flags
Generate CONFIG_DT_COMPAT flags using available nodes
'compatible' property.
Store them in a bogus node_address key of defs dict so
duplicates could be removed.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-09-14 08:02:53 -05:00
Anas Nashif
81b272119a docs: fixed documenation pointers
Fixed URL to documentation, now latest docs are under /latest/..
Fixes #9932

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-12 12:03:18 -04:00
Flavio Ceolin
3259ac08ca kernel: userspace: Sanitize switch usage
MISRA-C requires that every switch clause has a break instruction.
Changing gen_kobject_list script to generates compliance code.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-12 10:05:06 -04:00
Marti Bolivar
5cf80e4e22 scripts: requirements.txt: fix PyYAML for python 3.7
PyYAML 3.13 includes a fix necessary to install on Python 3.7:

    3.13 (2018-07-05)

    Rebuild wheels using latest Cython for Python 3.7 support.

Support it by accepting any PyYAML at least as recent as the current
version in requirements.txt, currently 3.12.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-09-11 20:58:09 -04:00
Ulf Magnusson
d0e8752a52 Kconfig: Rename $ENV_VAR_{ARCH,BOARD_DIR} to $ARCH/$BOARD_DIR
The prefixes might be a leftover from the old 'option env="..."' symbols
(which are no longer needed). Since environment variables can be
referenced directly now, there's no point in having a prefix.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-09-11 19:17:25 -04:00
Ulf Magnusson
213a88f7ff Kconfig: Support macro expansion within symbol names
Update Kconfiglib to upstream revision 2be02fac78527 to add support for
expanding macros within symbol names, extending the existing Kconfig
preprocessor
(https://github.com/torvalds/linux/blob/master/Documentation/kbuild/
kconfig-macro-language.txt). Some minor optimizations are included as
well.

This makes it possible to add Kconfig templates to avoid code
repetition, e.g. like below:

Kconfig.log_template:

    choice
    	prompt "Max compiled-in log level for $(module-str)"

    config $(module)_LOG_LEVEL_OFF
    	bool "Off"

    config $(module)_LOG_LEVEL_ERR
    	bool "Error"

    config $(module)_LOG_LEVEL_WRN
    	bool "Warning"

    config $(module)_LOG_LEVEL_INF
    	bool "Info"

    config $(module)_LOG_LEVEL_DBG
    	bool "Debug"

    endchoice

    config $(module)_LOG_LEVEL
    	int
    	default 0 if $(module)_LOG_LEVEL_OFF
    	default 1 if $(module)_LOG_LEVEL_ERR
    	default 2 if $(module)_LOG_LEVEL_WRN
    	default 3 if $(module)_LOG_LEVEL_INF
    	default 4 if $(module)_LOG_LEVEL_DBG

Using the template:

    module = FOO
    module-str = foo
    source "Kconfig.log_template"

    ...

    module = BAR
    module-str = bar
    source "Kconfig.log_template"

This feature might create harder-to-read Kconfig files if abused, so it
should probably be used sparingly.

Fixes: #9761

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-09-11 16:08:38 +02:00
Anas Nashif
38a795074f sanitycheck: update release data
Update footprint data for release.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-09 21:07:19 -04:00
Kumar Gala
5824b81176 scripts: dts: extract: Fix handling of irq prop being a list of lists
Before dtc 1.4.7 we'd get something like the following for an interrupt
property in which #interrupt-cells is 2.

interrupts = <1 2 3 4>;

After dtc 1.4.7 we get:

interrupts = <1 2>, <3 4>;

We should handle both cases in the extract interrupt handling code.  So
if we see a list of lists, we flatten it to a single list to normalize
the property.

Fixes: #9558

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-09-06 09:46:03 -05:00
Ulf Magnusson
af6af0fb8a scripts: kconfig: Put a blank line before warnings and errors
Since the warnings generated by this script are so spammy, it can be
difficult to tell where they start and end. Put a blank line before each
one to make it clearer.

Also put blank lines around the non-whitelisted-warning error.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-09-04 14:28:15 -04:00
Ulf Magnusson
49fa4d5627 scripts: kconfig: Use unique_{defined_syms,choices} and clean up a bit
- Use Kconfig.unique_{defined_syms,choices} to avoid redundant checks
   for symbols/choices defined in multiple locations. These were
   recently added to Kconfiglib.

 - Remove the comment about the alldefconfig starting state. It probably
   isn't useful here.

 - Print the messages about loading configuration files just before they
   are actually loaded. That looks less confusing if one of them fails
   to load.

 - Line-wrap the error message about non-whitelisted warnings.

 - Misc. other minor code cleanup.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-09-04 14:28:15 -04:00
Istvan Bisz
1642c45717 scripts: dts: extract: clock.py fix node alias name
A node alias name should be applied to the all property names.

Before this patch, the alias name is applied erroneously
just for CLOCK_CONTROLLER, skipping the CLOCK_BITS and CLOCK_BUS
property names.

Signed-off-by: Istvan Bisz <istvan.bisz@t-online.hu>
2018-09-03 12:46:44 -04:00
Anas Nashif
77837e8107 sanitycheck: do not abort logging on faults
We have been dropping lines after finding a fault which resulted in
missing information in the log. Make sure we continue and only report
failure at the end of the execution.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-08-30 15:05:30 -04:00
Anas Nashif
39ae72b4cb sanitycheck: capture delayed faults
Do not close console after PASS is reported, wait a bit for any
remaining messages from the tests, sometimes we have faults that need to
be parsed.
This now works for Qemu handler, support for other handlers to follow.

Fixes #9646

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-08-30 15:05:30 -04:00
Ulf Magnusson
9f8d429048 menuconfig: Fix a case of visible symbols not being shown
Update menuconfig (and Kconfiglib, just to sync) to upstream revision
78682a8e3c4fe to get the following fix in, which could cause certain
visible symbols to not show up in the menuconfig interface:

    menuconfig: Always show implicit submenus with visible nodes

    Currently, the symbol BAR below (which ends up indented in an
    implicit submenu) is shown only if DEP is non-n (or if show-all mode
    is enabled):

      config FOO
            bool "foo" if DEP
            default y

      config BAR
            bool "bar" if FOO

    This is bad, because it hides visible symbols from the interface.
    The assumption was that an implicit submenu (which is only created
    if the parent has a prompt) would never have visible items when the
    parent item is invisible, but prompt-specific conditions and
    select/imply can break that assumption.

    Fix it by always showing implicit submenus with visible nodes, along
    with the parent node. If the parent node is invisible, show it in
    red, like in show-all mode (which happens automatically). That's
    probably better than having mysteriously indented nodes when the
    parent is invisible.

(Some other tweaks were made later to avoid showing red outside show-all
mode, because it might look confusing/broken.)

A new color scheme for the menuconfig has been added as well,
contributed by Mitja Horvat (pinkfluid). It can be enabled by setting
the environment variable MENUCONFIG_THEME to 'aquatic'.

The default theme has been tweaked to use bold text for the selected
item too.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-30 14:26:05 +02:00
Daniel Leung
9945e7fda0 doc: add ability to generate PDF
This adds new targets to generate build documentation through
LaTEX to PDF.

There are a few notes:

1. pdflatex complains about the tex file generated by doxygen
   so it needs to be fixed with a Python script before feeding
   in through pdflatex.

2. SVG files are not recognized by pdflatex so they are converted
   to known good format on the fly, only for producing PDF. This
   uses the libRSVG's rsvg-convert tool.

Relates to #6782.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-08-29 18:16:56 -04:00
Bobby Noelte
5a16b9020f dts: bindings: scan application dir for bindings
In addtion to zephyr/dts/bindings als scan the dts/bindings
directory within the application source directory for bindings.

Allows to have application specific bindings and drivers.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2018-08-27 12:50:13 -04:00
Ulf Magnusson
c1f54cc5fd Kconfig: Show include paths in menuconfig and documentation
Update Kconfiglib and menuconfig to upstream revision a28bc4da9762e,
which adds include path information to menuconfig, showing how the
Kconfig file of the symbol got 'source'd in addition to showing the
definition location.

Add include path information to the auto-generated Kconfig documentation
too.

Some small Kconfiglib bugs are fixed to, like error reporting for
recursive 'source's being broken (crashing instead of printing the
error), a minor file descriptor leak, and syntax checking not catching
extra trailing tokens after 'if <expr>' and 'depends on <expr>'.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-26 09:47:20 -07:00
Ulf Magnusson
d67095ba59 Kconfiglib: Make header symbol order match .config files again
Commit f6bf897780 ("kconfiglib: Add preprocessor and two warnings")
accidentally made the ordering of #define's in generated header files
random (dependent on Python's set() implementation). Minimal
configuration files (which can be saved from the menuconfig) were
affected too.

The intent is for the order to match .config files, which in turn match
symbol definition order. This doesn't affect behavior in any way, but
makes things more readable (and is handier if files are checked in).

Update Kconfiglib to upstream revision a3252f620fad9 to make the
ordering match again. Tests have been added upstream.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-22 15:29:18 -07:00
Oleg Zhurakivskyy
f3bc967e49 sanitycheck: Overcommit the default number of jobs
Overcommit the default number of jobs by factor 2
to keep the original behavior intact.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2018-08-19 13:12:15 -07:00
Oleg Zhurakivskyy
99aacd9808 sanitycheck: Rename CPU_COUNTS to JOBS
This would correspond the help and avoid cpus/threads confusion.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2018-08-19 13:12:15 -07:00
Oleg Zhurakivskyy
c97054c1c9 sanitycheck: Fix the logic for jobs
multiprocessing.cpu_count() already returns the number of threads
(not cores), no need to multiply it by 2.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2018-08-19 13:12:15 -07:00
Oleg Zhurakivskyy
42822083c4 sanitycheck: Get ZEPHYR_BASE only once
Also clean up ZEPHYR_BASE discovery.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2018-08-19 13:12:15 -07:00
Ulf Magnusson
4fe581ccc8 check-compliance: Fix undef. Kconfig symbol check for external projects
Threw an exception about Kconfig files not being found. They need to be
looked up relative to ZEPHYR_BASE.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-18 10:38:52 +02:00
Ulf Magnusson
a56be6f58d Kconfiglib: Fix $srctree behavior for the top-level Kconfig file
Due a design goof, the top-level Kconfig file passed to
Kconfig.__init__() wasn't looked up relative to $srctree. This broke a
planned fix for an issue with the CI check for references to undefined
Kconfig files in external projects.

Update Kconfiglib to upstream revision 953cc12464 to fix it.

Also update doc/CMakeLists.txt to pass 'Kconfig' instead of '../Kconfig'
to genrest.py. $srctree is already set to $ZEPHYR_BASE.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-18 10:38:52 +02:00
Flavio Ceolin
8aec087268 kernel: Fix bitwise operators with unsigned operators
Bitwise operators should be used only with unsigned integer operands
because the result os bitwise operations on signed integers are
implementation-defined.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-08-16 19:47:41 -07:00
Flavio Ceolin
0866d18d03 irq: Fix irq_lock api usage
irq_lock returns an unsigned int, though, several places was using
signed int. This commit fix this behaviour.

In order to avoid this error happens again, a coccinelle script was
added and can be used to check violations.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-08-16 19:47:41 -07:00
Anas Nashif
b4bdd66924 sanitycheck: exit on exceptions
Exit on exceptions with crashing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-08-16 13:22:10 -07:00
Nathaniel Graff
0b60f3839d dts: Fix get_compat when parent compat is a list
When a DTS node has no 'compatible' property and its parent node has a
list for its compatible property, return only the first element of the
parent's compatible list.

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
2018-08-16 06:22:39 -07:00
Adithya Baglody
f8a8bdf392 scripts: gen_app_smem.py: Removing a needless file.
No longer needed. Superseded by scripts/gen_app_partitions.py

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-08-14 05:22:54 -07:00
Adithya Baglody
c69fb0d016 userspace: app_shared_mem: Fixed incorrect implementation.
This feature was failing on a default ARM core MPU. The linker
script that was getting created was not able to align the required
partitions at prebuilt time.

The old implementation relied on the prebuilt to finish then
extract the size information which was then used to align the regions.
This fails because the size of the alignment and the fill in the
linker needs to be available at prebuilt time else it cant manage
the final elf file generation. We cant have 2 different sizes of
prebuilt and final elf file.

This implementation will get the alignment requirements met at
prebuilt time.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-08-14 05:22:54 -07:00
Ulf Magnusson
f24d4bb369 check-compliance: Simplify undefined Kconfig symbol check
Use the new KCONFIG_STRICT Kconfiglib functionality, which makes the
library itself warn for references to undefined Kconfig symbols.

Also get rid of the chdir() hack. Kconfiglib now only looks up Kconfig
files relative to $srctree when it's set, so the hack is no longer
needed.

Remove list_undef_kconfig_refs.py. It's no longer needed.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-13 19:31:46 -07:00
Ulf Magnusson
6686efb838 kconfiglib/menuconfig: Add functionality and improve symbol information
Update Kconfiglib and menuconfig to upstream revision 6aea8d06b637e.

Kconfiglib changes:

 - Kconfig files are now looked up just relative to $srctree (if set).
   Previously, each source'd Kconfig file was also looked up in the
   current directory, and Kconfig files there could override Kconfig
   files in $srctree. This is what the C tools do.

   I'm pretty sure that behavior was a bug in the C tools all along, and
   only meant for .config files. It caused problems (and an ugly
   workaround) for the undefined Kconfig symbol CI check in an external
   project.

   The new behavior also saves a bunch of open()'s, though it's probably
   not noticeable.

 - Setting the KCONFIG_STRICT environment variable to 'y' now makes
   Kconfiglib itself warn for references to undefined symbols. This
   isn't safe in general, as some projects use multiple Kconfig trees
   with shared Kconfig files (e.g. the Linux kernel).

   This will be used to simplify the undefined Kconfig symbol CI check.

 - It's now possible to customize how symbols and choices are printed
   within expressions.

   This will be used to make the RST link generation in genrest.py less
   hacky.

 - Instead of having 'gsource', a plain 'source' is now globbing, and
   requires at least one match. There's also 'osource', for when it's
   okay for a glob pattern to match no files.

   'gsource' had the design flaw that there was no way to require at
   least one file to match. I plan on replacing all 'gsource' statements
   with plain 'source's later, but 'gsource' is still supported for
   backwards compatibility.

 - def_int, def_hex, and def_string are now available as a Kconfig
   extensions, analogous to def_bool (set type and add default).

 - Misc. internal cleanup.

menuconfig changes:

 - Boolean value hints are no longer shown to the right of defaults in
   the symbol information for int/hex symbols. Stuff like
   '- 74 (value: "n")' wasn't helpful, and looked confusing.

 - Symbol information has been made more compact in general, e.g. by
   skipping value hints where they aren't helpful
   ('FOO(=y)' instead of 'FOO(=y) (=y)'), and by shortening stuff like
   '(value: "y")' to just '(=y)'.

 - Misc. internal cleanup.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-13 19:31:46 -07:00
Sebastian Bøe
1a40990b2d syscalls: Define the syscall id's with '#define' instead of enum
We use the code generator 'gen_syscalls.py' to assign numeric
id's to each syscall. These id's have been defined using an enum
like this:

enum {
	K_SYSCALL_ADC_DISABLE,
	K_SYSCALL_ADC_ENABLE,
	K_SYSCALL_LIMIT
};

but enums can not be included by assembly files. So we have been
compiling the enum values and then extracting them into #define's when
needed.

In this situation there happen to not be any benefits of using
'enum' over #define's so we can simplify by initially defining
them with #define instead.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-08-13 16:43:40 -07:00
Andrew Boie
09c22cc45d userspace: add net_context as a kernel object
Socket APIs pass pointers to these disguised as file descriptors.
This lets us effectively validate them.

Kernel objects now can have Kconfig dependencies specified, in case
certain structs are not available in all configurations.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-08-13 07:19:39 -07:00
Daniel Egger
f3a6e8aa89 sanitycheck: Recommend installing "ply" instead of "python3-ply"
Since a distributions name for the ply package may change, the only
constant name which can be used for a recommendation is the name on
PyPi which happens to be "ply".

Signed-off-by: Daniel Egger <daniel@eggers-club.de>
2018-08-12 11:39:36 +02:00
Ulf Magnusson
ec3eff57e0 Kconfig: Use the first default with a satisfied condition
Up until now, Zephyr has patched Kconfig to use the last 'default' with
a satisfied condition, instead of the first one. I'm not sure why the
patch was added (it predates Kconfiglib), but I suspect it's related to
Kconfig.defconfig files.

There are at least three problems with the patch:

  1. It's inconsistent with how Kconfig works in other projects, which
     might confuse newcomers.

  2. Due to oversights, earlier 'range' properties are still preferred,
     as well as earlier 'default' properties on choices.

     In addition to being inconsistent, this makes it impossible to
     override 'range' properties and choice 'default' properties if the
     base definition of the symbol/choice already has 'range'/'default'
     properties.

     I've seen errors caused by the inconsistency, and I suspect there
     are more.

  3. A fork of Kconfiglib that adds the patch needs to be maintained.

Get rid of the patch and go back to standard Kconfig behavior, as
follows:

  1. Include the Kconfig.defconfig files first instead of last in
     Kconfig.zephyr.

  2. Include boards/Kconfig and arch/<arch>/Kconfig first instead of
     last in arch/Kconfig.

  3. Include arch/<arch>/soc/*/Kconfig first instead of last in
     arch/<arch>/Kconfig.

  4. Swap a few other 'source's to preserve behavior for some scattered
     symbols with multiple definitions.

     Swap 'source's in some no-op cases too, where it might match the
     intent.

  5. Reverse the defaults on symbol definitions that have more than one
     default.

     Skip defaults that are mutually exclusive, e.g. where each default
     has an 'if <some board>' condition. They are already safe.

  6. Remove the prefer-later-defaults patch from Kconfiglib.

Testing was done with a Python script that lists all Kconfig
symbols/choices with multiple defaults, along with a whitelist of fixed
symbols. The script also verifies that there are no "unreachable"
defaults hidden by defaults without conditions

As an additional test, zephyr/.config was generated before and after the
change for several samples and checked to be identical (after sorting).

This commit includes some default-related cleanups as well:

  - Simplify some symbol definitions, e.g. where a default has 'if FOO'
    when the symbol already has 'depends on FOO'.

  - Remove some redundant 'default ""' for string symbols. This is the
    implicit default.

Piggyback fixes for swapped ranges on BT_L2CAP_RX_MTU and
BT_L2CAP_TX_MTU (caused by confusing inconsistency).

Piggyback some fixes for style nits too, e.g. unindented help texts.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-10 12:38:28 -07:00
Daniel Leung
e58b65427e kernel: threads: assign index no. to dynamically created threads
Kernel threads created at build time have unique indexes to map them
into various bitarrays. This patch extends these indexes to
dynamically created threads where the associated  kernel objects are
allocated at runtime.

Fixes: #9081

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-08-09 09:20:14 -07:00
Erwan Gouriou
69a211fe00 scripts: extract_dts_includes: use deepcopcy when accessing reduced
Variables 'names' is copying value from 'reduced' dict and gives
illusion that any computation could be done on copied data.
Problem is that later computation on 'names' will modify data in
'reduced'.
Use deepcopy in order to avoid erasing thing in reduced.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-08-06 09:44:21 -05:00
Erwan Gouriou
8e7403504a scripts/dts: extract_dts_includes: makes 'defs' and 'structs' global
'defs' variable is used and passed as a parameter in the vast
majority of the functions of extract_dts_includes script.
Set this variable global
Do the same with 'struct' variable for upcoming change.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-08-06 09:44:21 -05:00
Ulf Magnusson
5402662dd9 cmake: kconfig: Fix rerunning cmake after Kconfig warnings
Commit b3d165f ("scripts: kconfig: Handle warnings generated
during evaluation") made it common for kconfig.py to fail after writing
zephyr/.config. This confuses the configuration fragment checksum logic
in cmake/kconfig.cmake, because it expects the saved checksum file to
exist if zephyr/.config exists.

The end result is a CMake error when rerunning the configuration after
non-whitelisted Kconfig warnings.

Fix it by only writing zephyr/.config (and zephyr/include/autoconf.h) in
kconfig.py if there are no warnings-turned-errors.

Also check if the saved checksum file exists in kconfig.cmake before
trying to open it. Normally this shouldn't happen though.

Move the writing of the checksum file to before writing zephyr/.config
as well. That way, zephyr/.config only gets written if the other
operations succeed.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-02 19:15:26 +02:00
Ulf Magnusson
b3d165f3c2 scripts: kconfig: Handle warnings generated during evaluation
Warnings generated during symbol evaluation were accidentally ignored,
due to checking for warnings before writing .config and autoconf.h
(which indirectly evaluates all symbols).

Move the warning checking code to after writing the configuration to
catch such warnings. kconfig.py still gets rerun if any
warnings-turned-errors show up.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-07-31 08:26:28 -04:00
Marti Bolivar
94be858f31 scripts: west: sync with upstream
This brings in content from commits in the upstream West
repository. Since both the version here and upstream have diverged,
this synchronizes them again.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-07-30 17:56:21 -04:00
Anas Nashif
9930633454 kconfig: remove whitelisting for ARC_INIT
ARC_INIT was whitelisted in kconfig, removing now that the issue is
fixed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-30 15:17:51 -04:00
Maureen Helm
d7d1090422 doc: scripts: Updates for pyocd v0.11.1
pyocd recently added support for python 3 so we can now remove the
python 2 package requirements. It also merged Zephyr thread awareness
upstream, so we can remove the reference to my pyocd pull request.

Tested debugging and flashing on Linux and Windows.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-07-27 00:54:55 +02:00
Andrew Boie
353acf4aae gen_syscalls.py: do not output data to stdout
There's no particularly good reason to have one kind of
output from this script to be sent to stdout instead of
a filename specified by parameter, and it makes it
annoying to add debug print() statements.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-07-26 00:53:45 -04:00
Shawn Mosley
573f32b6d2 userspace: compartmentalized app memory organization
Summary: revised attempt at addressing issue 6290.  The
following provides an alternative to using
CONFIG_APPLICATION_MEMORY by compartmentalizing data into
Memory Domains.  Dependent on MPU limitations, supports
compartmentalized Memory Domains for 1...N logical
applications.  This is considered an initial attempt at
designing flexible compartmentalized Memory Domains for
multiple logical applications and, with the provided python
script and edited CMakeLists.txt, provides support for power
of 2 aligned MPU architectures.

Overview: The current patch uses qualifiers to group data into
subsections.  The qualifier usage allows for dynamic subsection
creation and affords the developer a large amount of flexibility
in the grouping, naming, and size of the resulting partitions and
domains that are built on these subsections. By additional macro
calls, functions are created that help calculate the size,
address, and permissions for the subsections and enable the
developer to control application data in specified partitions and
memory domains.

Background: Initial attempts focused on creating a single
section in the linker script that then contained internally
grouped variables/data to allow MPU/MMU alignment and protection.
This did not provide additional functionality beyond
CONFIG_APPLICATION_MEMORY as we were unable to reliably group
data or determine their grouping via exported linker symbols.
Thus, the resulting decision was made to dynamically create
subsections using the current qualifier method. An attempt to
group the data by object file was tested, but found that this
broke applications such as ztest where two object files are
created: ztest and main.  This also creates an issue of grouping
the two object files together in the same memory domain while
also allowing for compartmenting other data among threads.

Because it is not possible to know a) the name of the partition
and thus the symbol in the linker, b) the size of all the data
in the subsection, nor c) the overall number of partitions
created by the developer, it was not feasible to align the
subsections at compile time without using dynamically generated
linker script for MPU architectures requiring power of 2
alignment.

In order to provide support for MPU architectures that require a
power of 2 alignment, a python script is run at build prior to
when linker_priv_stacks.cmd is generated.  This script scans the
built object files for all possible partitions and the names given
to them. It then generates a linker file (app_smem.ld) that is
included in the main linker.ld file.  This app_smem.ld allows the
compiler and linker to then create each subsection and align to
the next power of 2.

Usage:
 - Requires: app_memory/app_memdomain.h .
 - _app_dmem(id) marks a variable to be placed into a data
section for memory partition id.
 - _app_bmem(id) marks a variable to be placed into a bss
section for memory partition id.
 - These are seen in the linker.map as "data_smem_id" and
"data_smem_idb".
 - To create a k_mem_partition, call the macro
app_mem_partition(part0) where "part0" is the name then used to
refer to that partition. This macro only creates a function and
necessary data structures for the later "initialization".
 - To create a memory domain for the partition, the macro
app_mem_domain(dom0) is called where "dom0" is the name then
used for the memory domain.
 - To initialize the partition (effectively adding the partition
to a linked list), init_part_part0() is called. This is followed
by init_app_memory(), which walks all partitions in the linked
list and calculates the sizes for each partition.
 - Once the partition is initialized, the domain can be
initialized with init_domain_dom0(part0) which initializes the
domain with partition part0.
 - After the domain has been initialized, the current thread
can be added using add_thread_dom0(k_current_get()).
 - The code used in ztests ans kernel/init has been added under
a conditional #ifdef to isolate the code from other tests.
The userspace test CMakeLists.txt file has commands to insert
the CONFIG_APP_SHARED_MEM definition into the required build
targets.
  Example:
        /* create partition at top of file outside functions */
        app_mem_partition(part0);
        /* create domain */
        app_mem_domain(dom0);
        _app_dmem(dom0) int var1;
        _app_bmem(dom0) static volatile int var2;

        int main()
        {
                init_part_part0();
                init_app_memory();
                init_domain_dom0(part0);
                add_thread_dom0(k_current_get());
                ...
        }

 - If multiple partitions are being created, a variadic
preprocessor macro can be used as provided in
app_macro_support.h:

        FOR_EACH(app_mem_partition, part0, part1, part2);

or, for multiple domains, similarly:

        FOR_EACH(app_mem_domain, dom0, dom1);

Similarly, the init_part_* can also be used in the macro:

        FOR_EACH(init_part, part0, part1, part2);

Testing:
 - This has been successfully tested on qemu_x86 and the
ARM frdm_k64f board.  It compiles and builds power of 2
aligned subsections for the linker script on the 96b_carbon
boards.  These power of 2 alignments have been checked by
hand and are viewable in the zephyr.map file that is
produced during build. However, due to a shortage of
available MPU regions on the 96b_carbon board, we are unable
to test this.
 - When run on the 96b_carbon board, the test suite will
enter execution, but each individaul test will fail due to
an MPU FAULT.  This is expected as the required number of
MPU regions exceeds the number allowed due to the static
allocation. As the MPU driver does not detect this issue,
the fault occurs because the data being accessed has been
placed outside the active MPU region.
 - This now compiles successfully for the ARC boards
em_starterkit_em7d and em_starterkit_em7d_v22. However,
as we lack ARC hardware to run this build on, we are unable
to test this build.

Current known issues:
1) While the script and edited CMakeLists.txt creates the
ability to align to the next power of 2, this does not
address the shortage of available MPU regions on certain
devices (e.g. 96b_carbon).  In testing the APB and PPB
regions were commented out.
2) checkpatch.pl lists several issues regarding the
following:
a) Complex macros. The FOR_EACH macros as defined in
app_macro_support.h are listed as complex macros needing
parentheses.  Adding parentheses breaks their
functionality, and we have otherwise been unable to
resolve the reported error.
b) __aligned() preferred. The _app_dmem_pad() and
_app_bmem_pad() macros give warnings that __aligned()
is preferred. Prior iterations had this implementation,
which resulted in errors due to "complex macros".
c) Trailing semicolon. The macro init_part(name) has
a trailing semicolon as the semicolon is needed for the
inlined macro call that is generated when this macro
expands.

Update: updated to alternative CONFIG_APPLCATION_MEMORY.
Added config option CONFIG_APP_SHARED_MEM to enable a new section
app_smem to contain the shared memory component.  This commit
seperates the Kconfig definition from the definition used for the
conditional code.  The change is in response to changes in the
way the build system treats definitions.  The python script used
to generate a linker script for app_smem was also midified to
simplify the alignment directives.  A default linker script
app_smem.ld was added to remove the conditional includes dependency
on CONFIG_APP_SHARED_MEM.  By addining the default linker script
the prebuild stages link properly prior to the python script running

Signed-off-by: Joshua Domagalski <jedomag@tycho.nsa.gov>
Signed-off-by: Shawn Mosley <smmosle@tycho.nsa.gov>
2018-07-25 12:02:01 -07:00
Andrew Boie
a698e84a76 userspace: adjust syscall generation scripts
parse_syscalls.py was doing too much and was generating
derived and partial string output information that was
completed later by gen_syscalls.py.

Now parse_syscalls.py just breaks up system call information into
non-derived data which is fully processed by gen_syscalls.py.

The goal is to ease maintenance of system call generation with
all the mechanism on what to do with system call information in
one script location rather than two of them.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-07-24 14:39:38 -04:00
Anas Nashif
f3d48e1cce sanitycheck: allow blacklisting boards
Add new kwyboard to board definition to allow blacklisting boards. This
is needed when a board is broken causing CI to fail without a fix in
sight.

Add:

sanitycheck: false

to the board yaml file to disable the board. By default, the value is
set to true.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-24 09:58:18 -04:00
Anas Nashif
d2b3c75403 Revert "sanitycheck: set state correctly in case of a crash"
This reverts commit d74a56bd63.

Still not soving the issue and introducing additional problems.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-23 12:58:31 -04:00
Anas Nashif
d74a56bd63 sanitycheck: set state correctly in case of a crash
sanitycheck not printing QEMU console in some cases where a crash
happens and when state is not set correctly.

Fixes #9061

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-22 22:14:10 -04:00
Anas Nashif
e24350c775 sanitycheck: do not run if we do not have nsimdrv
Check if we have nSim simulator in path, if not, just test build without
attempting to run.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-19 18:59:07 -04:00
Anas Nashif
99f5a6cfed sanitycheck: support additional handlers
Support nsim simulator with 'make run'.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-19 18:59:07 -04:00
Anas Nashif
685111ac06 sanitycheck: add nsim as simulation type
nSim is a simulator that can run ELF binaries for ARC.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-19 18:59:07 -04:00
Anas Nashif
df7ee61c09 sanitycheck: merge native and unit handlers
The two handlers were doing pretty much the same with minor differences,
unify them into one single handler BinaryHandler that will be able to
handle additional targets.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-19 18:59:07 -04:00
Anas Nashif
4a9f3e63b8 sanitycheck: do not redefine handler_log
handler_log was being redefined, define it in the Handler class as log
only.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-19 18:59:07 -04:00
Anas Nashif
1377375af2 sanitycheck: refactor add_goal
refactor all add_goal routines in to one single function that can handle
multiple platforms. Move everything to one single add_goal function.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-19 18:59:07 -04:00
Alberto Escolar Piedras
b1045fee59 sanitycheck: Do not calculate size for native builds
For native builds it does not make much sense to calculate
the size of the suposed RAM or ROM, or to check that new
unexpected sections did not appear.
So let's save the time and not do it.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-07-18 15:43:12 -04:00
Ulf Magnusson
953cc12464 kconfiglib: Fix paths for gsource'd files in the documentation
$srctree was changed to an absolute path when the documentation building
was switched over to CMake, which uncovered a bug in Kconfiglib that
caused symbols in gsource'd files to show up with absolute paths in the
auto-generated Kconfig documentation.

This commit adds upstream commit ac692af07a123 ("Fix absolute $srctree
prefixes showing up on gsource'd files"), which fixes it.

Upstream commit message:

  When using gsource with $srctree set to an absolute path, the $srctree
  prefix would show up in MenuNode.filename, trickling its way into e.g.
  generated documentation.

  This was due to a broken test: os.path.isabs() was checked after
  joining the pattern with $srctree, making it mistake an absolute
  $srctree for an absolute path in the Kconfig file.

  Fix the test.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-07-14 08:17:58 +02:00
Carles Cufi
9c2f681bc0 scripts: filter-known-issues: Add extra newline
For better readability, add an extra newline when printing the result of
filtering a log.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-07-12 23:11:46 -04:00
Carles Cufi
033f10d272 scripts: Print results from filter-known-issues.py
In order to get rid of doc/scripts/filter-doc-log.sh to make building
the documentation cross-platform, include the functionality in there in
the already existing filter-known-issues.py.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-07-12 01:26:05 +02:00
Ulf Magnusson
f6bf897780 kconfiglib: Add preprocessor and two warnings
Update Kconfiglib to upstream revision 547fced630611 to get a new
Kconfig preprocessor in, documented in
https://github.com/torvalds/linux/blob/master/Documentation/kbuild/kconfig-macro-language.txt.

The preprocessor allows shell functions to be run directly from Kconfig.
Things like 'default "prefix-$(shell,some-cmd)' and
'depends on (success,some-cmd)' are supported.

The preprocessor might come in handy for Kconfig/DTS integration. I'm
thinking of extending it so that Python functions can be called as well.

There's also two new warnings:

 - Trying to use an int/hex symbol like a bool symbol in an expression
   (where it will always evaluate to n)

 - Having a 'default' on an int/hex symbol that lies outside an active
   'range'.

The parser is more strict now as well (due to dropping some hacks for 3+
year old kernel versions).

A related fix for scripts/kconfig.py is also included:

The comment above the whitelist lies. I accidentally changed the warning
text for the select-with-unsatisfied-dependencies warning while
generalizing it (for m-valued dependencies, which you'd never get in
Zephyr).

Update the whitelist to detect the new warning text.

Last-minute piggyback:

Include a change that improved the parse time for U-Boot from 4 seconds
to about 0.6 seconds, related to symbols defined in multiple locations.
It might be helpful for Zephyr as well, as it also uses a lot of symbols
defined in multiple locations.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-07-11 17:02:22 +02:00
Wayne Ren
1952c56e7d scripts: west: add nsim runner
add nsim runner in west

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2018-07-10 19:05:13 -04:00
Adithya Baglody
e67720bbf2 syscalls: Scan multiple folders to build complete syscall list
Previously the syscall list was generated only from the include
folder. This is a limitation when the application tries to create
system calls. This patch create a simple way to include these
new syscalls without the application touching the kernel.

This can be enabled by a Kconfig CONFIG_APPLICATION_DEFINED_SYSCALL.
Once enabled the application source directory will be scanned to
find all application defined syscalls.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-07-10 10:22:04 -07:00
Erwan Gouriou
deb0941cd5 scripts/extract/globals: treat node alternate names as 'aliases'
Treat new generated dtc element 'alt-name' as usual aliases.
Aim is not to duplicate generation of node elements but provide
pointers using generic alternate names.
For instance, defining following overriding node:
arduino_i2c : i2c1 {};
Will generate following definition:
#define ARDUINO_I2C_LABEL	ST_STM32_I2C_V1_40005400_LABEL

Then 'ARDUINO_I2C_LABEL' could be use a generic binding.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-07-05 11:28:53 -05:00
Erwan Gouriou
fa5d6ec363 scripts: devicetree.py: get alternate labels from dt
Allow use of new element of dtc grammar called overriding nodes:
i2cexp: &i2c2  {};

It allows a node to assign an alternate label to a node that
could be generic and used for adapter boards.
This commit is a derivative of a dtc commit from dtc v1.4.2 [1]

[1] https://bit.ly/2GFLLOa

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-07-05 11:28:53 -05:00
Bobby Noelte
ca7fc2adbc scripts: extract_dts_includes.py: fix false info message
Do not provide info message if node type, title, version,
node description is overwritten.
This is the expected behaviour.

Fixes #8360

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2018-07-04 08:28:45 -04:00
Ulf Magnusson
53f4189075 scripts: kconfig: Do not print warnings for choice overriding
Andy Ross wanted to override a choice selection from a board defconfig
file in a prj.conf, but this could trigger the
assigned-value-didn't-take warning, because the choice symbol set to y
in the board defconfig file ends up as n after another choice symbol is
selected.

(Note: Setting any choice symbol to y is enough to make it the choice
(user) selection. There's no need to set the other symbols to n.)

Fix the warning by checking choices at the choice level rather than at
the level of individual choice symbols. This also makes the warning a
bit more informative in general for choice symbols.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-07-03 17:09:47 -04:00
Bobby Noelte
08216f5ef4 scripts: extract_dts_includes.py: refactor for better maintenance
Refactor for better maintenance and to ease future enhancements.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2018-07-03 12:48:19 -05:00
Alberto Escolar Piedras
c026c2ed82 sanitycheck: control coverage from command line
Added a new command line options to sanitycheck:
--enable-coverage which will compile for native_posix
with CONFIG_COVERAGE set, and unit tests accordingly.
+
Now -C --coverage implies also --enable-coverage.

Background:
After 608778a4de
it is possible to add Kconfig options from command
line during the cmake invocation.
So we can use it to set CONFIG_COVERAGE for the native_posix
target when we need to instead of relaying on it always
being compiled with coverage enabled.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-07-03 08:36:06 -04:00
Gautier Seidel
4a8393dd66 esp32: add abitily to flash bootloader
'make flash' also flashes the bootloader

Signed-off-by: Gautier Seidel <gautier.seidel@tado.com>
2018-07-02 08:44:49 -04:00
Anas Nashif
0b68560463 sanitycheck: whitelist logging sections
Whitelist recently add sections in the logging subsystem.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-06-29 17:48:26 -05:00
Ulf Magnusson
90e8d67848 check-compliance: Fix list_undef_kconfig_refs.py for external projects
External projects might run check-compliance.py from a subdirectory,
while list_undef_kconfig_refs.py expects to find the top-level Kconfig
file in the current directory.

Due to obscure Kconfig ugliness (explained in a comment), the working
directory needs to be changed here, instead of using 'srctree'.

(Thinking of changing that Kconfig behavior so that it only applies to
.config files. Suspect it's been a bug in the C tools all along for
Kconfig files.)

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-27 19:14:22 +02:00
Ulf Magnusson
aa2beb9f10 kconfig: Stop whitelisting "undefined symbol SSE" warning
The warnings were fixed by commit c4123643b5 ("tests: fp_sharing:
Extract x86 configs to separate .conf").

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-27 17:07:16 +02:00
Andrew Boie
3efd2693b3 sanitycheck: fix spammy build output
VERBOSE if set to any value enables verbose build output,
setting to 0 does not have the intended effect.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-06-27 03:52:45 -04:00
Sebastian Bøe
a1e806bf44 gen_isr_tables: Delete the dead code accompanying .intList.num_isrs
intList has been populated with the number of isrs, aka interrupts,
but nothing has not been using this information so we drop it and
everything used to construct it.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-06-25 12:54:49 -07:00
Jamie McCrae
60e97de583 scripts: runner: nrfjprog: Allow specifying serial number of nrfjprog
This allows for scripts using nrfjrog to specify the serial number of
the attached device to use instead of showing a list of available
devices by adding an optional parameter.

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdtech.com>
2018-06-25 12:03:12 -05:00
Ulf Magnusson
d317a0e6b4 kconfiglib: Update to use redesigned 'referenced' API
Update Kconfiglib to get upstream commit eb6c21a9b33a2 ("Turn
MenuNode/Symbol/Choice.referenced() into a @property") in. It converts
the MenuNode.referenced() function into a property, which makes the API
more consistent (read-only stuff uses properties).

Also update scripts/ci/list_undef_kconfig_refs.py to access .referenced
as a property.

Piggyback a small is_num() simplification.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-25 10:31:08 +02:00
Ulf Magnusson
54a5997f5c kconfiglib: Add dependency loop detection
Update Kconfiglib to get upstream commit ca89ca0c0c420 ("Add dependency
loop detection") in.

Upstream commit message
=======================

Pretty long overdue.

Until now, dependency loops have raised a hard-to-debug Python
RecursionError during evaluation. A Kconfiglib exception is raised now
instead, with a message that lists all the items in the loop.

See the comment at the start of _check_dep_loop_sym() for an overview of
the algorithm. At a high level, it's loop detection in a directed graph
by keeping track of unvisited/visited nodes during depth-first search.
(A third "visited, known to not be in a dependency loop" state is used
as well.)

Choices complicate things, as they're inherently loopy: The choice
depends on the choice symbols and vice versa, and the choice symbols in
a sense all depend on each other.

Add the choice-to-choice-symbol dependencies separately after dependency
loop detection, so that there's just the choice-symbol-to-choice
dependencies to deal with. It simplifies things, as it makes it possible
to tell dependencies from 'prompt' and 'default' conditions on the
choice from choice symbol dependencies.

Do some flag shenanigans to prevent the choice from being "re-entered"
while looping through the choice symbols. Maybe this could be cleaned up
a bit somehow...

Example exception message:

Dependency loop
===============

A (defined at tests/Kdeploop10:1), with definition...

config A
        bool
        depends on B

...depends on B (defined at tests/Kdeploop10:5), with definition...

config B
        bool
        depends on C = 7

...depends on C (defined at tests/Kdeploop10:9), with definition...

config C
        int
        range D 8

...depends on D (defined at tests/Kdeploop10:13), with definition...

config D
        int
        default 3 if E
        default 8

...depends on E (defined at tests/Kdeploop10:18), with definition...

config E
        bool

(select-related dependencies: F && G)

...depends on G (defined at tests/Kdeploop10:25), with definition...

config G
        bool
        depends on H

...depends on the choice symbol H (defined at tests/Kdeploop10:32), with
definition...

config H
        bool
        prompt "H" if I && <choice>
        depends on I && <choice>

...depends on the choice symbol I (defined at tests/Kdeploop10:41), with
definition...

config I
        bool
        prompt "I" if <choice>
        depends on <choice>

...depends on <choice> (defined at tests/Kdeploop10:38), with
definition...

choice
        bool
        prompt "choice" if J

...depends on J (defined at tests/Kdeploop10:46), with definition...

config J
        bool
        depends on A

...depends again on A (defined at tests/Kdeploop10:1)

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-20 15:53:38 -04:00
Andrei Emeltchenko
c6b38a2a86 usb: tests: Add usb_bos_desc to sanitycheck table
Fix check warnings

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-06-20 15:47:00 -04:00
Torsten Rasmussen
080e32efc5 cmake: Using symlinks on unix like os'es for dependencies
Fixes: #8380

This commit fixes the side-effect of PR #8211 where a 'ninja clean'
would try to remove dependency folders.
Changes:
- Symlinks are created during build and CMake targets now depends on
  the symlinks. Thus, same behavior is achived with regards to
  dependency handling, while at the same time, the output can be
  cleaned as the dependencies are now attached to the symlinks.
- Dependencies have been changed so that generation of json files
  depends on the trigger file and CMake depends upon the subdir txt
  file. This prevents additional CMake runs after a clean.

Signed-off-by: Torsten Rasmussen <torsten.rasmussen@nordicsemi.no>
2018-06-19 17:00:27 +02:00
Ulf Magnusson
4dcde2e628 menuconfig: Allow searches from the info dialog and vice versa
Having to go back to the main display all the time gets awkward,
especially when searching to look up symbol information.

Allow the symbol information dialog to be opened from the search dialog
(with Ctrl-F, since '?' is already used there as a regex metacharacter),
and also allow a search to be started from the symbol information
dialog.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-18 14:41:53 -04:00
Ulf Magnusson
80f19cca42 kconfiglib: Correctly report choice locations in some warnings
This commit gets upstream commit dc0b022247b85 ("Correctly report choice
locations in some warnings") in, which fixes some warnings that would
previously report the location of a choice as being "undefined" (which
is impossible).

Upstream commit message:

  Menu nodes were added to choices after parsing their properties,
  making some warnings generated during parsing (as opposed to in
  _check_choice_sanity()) incorrectly give the choice as '<choice>
  (undefined)'.

  Add the node before parsing choice properties to fix those warnings.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-18 14:41:53 -04:00
Ulf Magnusson
ea108107e6 scripts: kconfig: Extend the assignment-failed warning
- Tailor the warning when the symbol has no prompt, explaining how
   promptless symbols get values. Add some anti-select propaganda too.

 - Reference the 'Setting configuration values' in the Board Porting
   Guide. It explains Kconfig.defconfig files.

Fixes: #8388

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-18 12:49:12 -04:00
David B. Kinder
a3d83ec9f4 doc: update doc build tools documentation
Update the doc build tools versions listed in requirements.txt (and
mentioned in the doc building instructions).

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-06-18 12:42:18 -04:00
Ulf Magnusson
5bfc7ff275 kconfig: Fail in CI if Kconfig files reference undefined symbols
Add a helper module scripts/ci/list_undef_kconfig_refs.py that searches
the entire Kconfig tree and reports any references to undefined Kconfig
symbols. Use it to add a new check to scripts/ci/check-compliance.py.

Also allow list_undef_kconfig_refs.py to be run standalone.

Example error:

  Error: Found references to undefined Kconfig symbols:

  BAR
  ===

  - Referenced at Kconfig:12:

  config FOO
        bool
        depends on BAR

  - Referenced at Kconfig:16:

  menu "menu"
        depends on BAR

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-18 11:25:35 +02:00
Andrei Emeltchenko
391cf424a7 usb: tests: Add missing sections to sanitycheck
Fix warnings during sanitycheck

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-06-15 11:02:05 +02:00
Ulf Magnusson
59c8ae8caf kconfiglib: Fix incorrectly ordered props. for some multi.def symbols
This commit fixes a pretty nasty bug that could cause properties on
symbols and choices defined in multiple locations to end up in the wrong
order, potentially affecting evaluation.

Alexander Wachter ran into this for an out-of-tree build.

Multi.def. symbols are rare in the Linux kernel, which is what the
Kconfiglib test suite uses for compatibility testing, so this managed to
slip through. Comprehensive selftests have been added for property
ordering on nested multi.def. symbols/choices.

This bug was introduced by commit e307ba340c ("kconfiglib: Record
which MenuNode has each property").

Commit message from Kconfiglib (c8801514d63aa)
==============================================

Fix incorrectly ordered properties for some nested multi.def. symbols

_propagate_deps() visits menu nodes roughly breadth-first, meaning
properties on symbols and choices defined in multiple locations could
end up in the wrong order when copied from the menu node for some
unlucky if/menu nestings.

Fix it by moving the menu-node-to-symbol/choice property copying in
_finalize_tree() so that it's guaranteed to happen in definition order.

This bug was introduced by commit 63a4418 ("Record which MenuNode has
each property").

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-14 19:45:58 +02:00
Ulf Magnusson
f425c0aa27 scripts: kconfig: Disable the "FOO set more than once" warning
Some prj.conf files seem to deliberately override settings from the
board configuration (e.g. samples/bluetooth/hci_usb/prj.conf, with
GPIO=y). Disable the warning about a symbol being assigned more than
once to avoid warnings for those cases.

A list similar to WARNING_WHITELIST could be added later if more
warnings need to be disabled.

Also refactor the warning checking code a bit to get rid of some not's.

Suggested by Sebastian Bøe.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-13 14:06:38 +02:00
Torsten Rasmussen
f38e388ad1 cmake: Update to dependency handling for syscalls.json
Fixes: #8210

Following changes has been made to ensure correct behavior on different
system:
- Python script to detect changes to directories, including empty ones.
  When files are modified the list is updated
  If sub-directories are added / removed a trigger file is touched to
  notify cmake to re-run
- Windows: To detect changes to header files in include for
           parse_syscalls.py all files must be individual monitored.
           Hence all headers are globbed added to dependencies.
           CMake configure depends on the folders so the added /
           removed files are picked up.
- Other:   Folders are monitored through the python list file so that
           added / remove / modified
           Added / removed sub-directories are detected through trigger
           file in order to re-run cmake.

Signed-off-by: Torsten Rasmussen <torsten.rasmussen@nordicsemi.no>
2018-06-13 13:22:46 +02:00
Tomasz Gorochowik
7f84001fd3 menuconfig: Fix searching for nonexistent objects
This commit fixes an issue when user searches for a nonexistent object
(e.g. adsdsaasda) and presses enter.

Having all the key checks in one continuous if statement makes sure that
the very last 'else' statement does not get executed when enter is
pressed.

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
2018-06-12 20:27:20 -04:00
Ulf Magnusson
f971aacaf3 scripts: kconfig: Turn most warnings into errors
In particular, this will turn assignments to undefined Kconfig variables
into errors, which are very easy to miss otherwise (e.g. when Kconfig
symbols get renamed or removed).

Warnings generated by anything tested by CI (scripts/sanitycheck) will
be caught.

Have a whitelist of warnings that are not turned into errors. Some
warnings currently whitelisted should be turned into errors as well, but
would require a bit of work.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-12 20:18:14 -04:00
Erwan Gouriou
ad29ec69dd scripts: extract: globals.py: fix node name when it includes "@"
In some cases, node label could be generated with "/" character
in name string, which prevents compilation

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Signed-off-by: Florian Vaussard <florian.vaussard@gmail.com>
2018-06-12 03:54:26 -04:00
Ruslan Mstoi
33fa63e40e sanitycheck: Add progress to verbose mode
In verbose mode (-v) progress of running test cases number out of total
number is not printed. Thus, if there are many test cases, it is
impossible to follow the progress. This commit adds printing of current
test case and total numbers to the verbose output.

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2018-06-11 17:30:58 -04:00
Ulf Magnusson
20721f39fa scripts: kconfig: Improve the 'user value != actual value' warning
Symbols that are assigned values in .config files must have satisfied
dependencies, and must have a prompt. Otherwise, the assigned value is
ignored. A warning is printed if the symbol ends up with a different
value than the assigned value as a result.

It might be difficult to know how to fix the problem just from seeing
the current warning. Add some hints to it to help out:

  - The symbol information dialog in menuconfig is good for figuring out
    dependencies that need to be enabled. Mention menuconfig in the
    warning.

  - The page for the symbol in the autogenerated Kconfig docs can be
    helpful too, so link it. There's a slight chance that it'll be
    outdated, but it's usually correct when working on the master
    branch.

Automatically enabling dependencies is much trickier than it might seem
at first, due to the generality of Kconfig. See
https://github.com/zephyrproject-rtos/zephyr/issues/8181 for some
discussion.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-11 17:24:07 -04:00
Ulf Magnusson
cb95ea0b53 kconfiglib: Update to add list of choices
Update Kconfiglib to upstream revision 9fba375c65341 (+ local Zephyr
modifications) to get commit 94020beb311eb ("Make Kconfig._choices
public") in. It will be used to generate Kconfig reference pages for
choices.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-11 14:40:48 -04:00
Anas Nashif
3b1fb7f9a9 release: update footprint data
Update sanitycheck footprint data for comparison between releases.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-06-11 10:37:14 -05:00
Marti Bolivar
c6c856bc60 scripts: west: cherry-pick upstream 321ab2e17
Bring in the changes from upstream 321ab2e17 ("runner: core: fix
docstrings for ReST integration"). This is a minimal change necessary
to avoid documentation build issues. The rest of West has gained other
features that are too late to pull in to the RC period, so just bring
in what's needed to get to v1.12.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-06-08 16:06:16 -05:00
Anas Nashif
b20c4846dd sanitycheck: fail on faults/panics/oopses
Fail in tests where we have an OOPS or a panic. Right now and in many
cases we continue and test case might be reported as PASS.

Cases that have the tag ignore_faults will ignore those faults (cases
that are testing faults for example).

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-06-07 18:01:49 -05:00
Anas Nashif
5d6e7eb7c6 sanitycheck: export list of tests as CSV
Export tests to a file with Section, subsection and identifier as
columns making it easy to import testcases into test management system.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-06-07 18:01:49 -05:00
Marti Bolivar
63f2cf579d scripts: west: update to upstream 894aedbc0
Update to upstream commit 894aedbc0 ("runner: nios2.py: fix create()
and constructor").

Fixes: #7954
Fixes: #7927

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-06-04 10:52:21 -04:00
Bobby Noelte
1d27ee0b09 scripts: extract_dts_includes: fix recursion in extract_controller
Commit 93d3a42776 changed the interface
of extract_controller() but did not change the recursive call within.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2018-05-28 16:49:34 -04:00
Ulf Magnusson
163dec6dc3 menuconfig: Add show-name mode + small help dialog improvement
- Pressing 'c' ('n' was taken) toggles a mode where the names of all
   symbols are shown before their prompts. This saves going into the
   help display when you just want the name.

 - The name of the symbol/choice now appears in the main text of the
   help dialog rather than in the title, where it might be hard to
   spot, as pointed out by Carles Cufi.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-28 21:04:34 +02:00
Ulf Magnusson
6eabea3a7e Kconfiglib: Warn for unquoted string defaults
Unquoted string defaults work through a quirk of Kconfig (undefined
symbols get their name as their string value), but look confusing. It's
done inconsistently now too.

Suggested by Kumar Gala.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-26 19:17:48 -04:00
Bobby Noelte
58967c7d3c scripts: extract_dts_includes.py: fix multiple include in bindings
Correctly process multiple include files given to the
!include command of the YAML loader.

The fix only targets the sequential definition of include files.

Fixes #7067

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2018-05-25 10:59:12 -05:00
ruuddw
8364b223e4 Fix struct offsets (DWARF v2 compatibility)
For DWARF v2, DW_AT_data_member_location is encoded as a set of operations. The member_offset is in that case a list that starts with an operation (typically DW_OP_plus_uconst), so member_offset[0] is not the offset.

This solves the kernel/poll test (issue #7885)
2018-05-25 16:49:42 +02:00
Andrew Boie
29599f6d80 sanitycheck: deprecate assertion options
This is now done directly in Kconfig for tests.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-05-24 15:12:56 -07:00
Carles Cufi
a06b14f29b scripts: check-compliance: Allow to run from any path
Allow check-compliance.py to be run from any path with a valid Git tree,
removing the unnecessary and artificial limitation imposed in the case
of gitlint.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-05-24 16:57:24 -04:00
Anas Nashif
333a315f7b sanitycheck: improve help message
Aply some feedback to the help messages of sanitycheck.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-24 16:55:55 -04:00
Ulf Magnusson
d44fee359d menuconfig: Add search and save/load improvements from upstream
- Show the value of each symbol in the jump-to dialog.

 - Search names and prompts separately in the jump-to dialog.
   Previously, '_BAR$' wouldn't match FOO_BAR if it had a prompt,
   because '_BAR$' was matched against the string 'FOO_BAR "prompt"'.

 - Show the working directory in save/load dialog boxes. Paths will be
   relative to it, and Carles Cufi pointed out that it might not be
   obvious.

   Also allow ~ to be used to refer to the home directory.

 - Implement scroll offset for edit boxes. This makes it clearer when
   they're scrolled horizontally.

Piggyback an update of Kconfiglib to the latest version (no functional
changes).

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-24 17:41:45 +02:00
Andy Ross
a3a7e8e781 sanitycheck: Add support for _bt_settings_area linker section
This section got added in commit 470349c25a ("Bluetooth: settings:
Add support for per-submodule handlers"), but sanitycheck didn't know
about it and was whining.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-05-23 20:54:36 -04:00
Andrew Boie
f20efcfbe7 scripts: generalize kobject -> enum naming
This was done inconsistently in a few place, centralize it.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-05-23 11:37:47 -07:00
Andrew Boie
e144a68f54 elf_helper: fix member offset calculation
On some arches like ARC, the member location tag is a list with
the offset and then the member size. We just need the offset.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-05-22 15:59:07 -07:00
Ulf Magnusson
b45e152ff0 menuconfig/genrest: Exclude implicit submenus from menu paths
Make all menu paths ("(top menu) -> menu -> submenu -> ...") exclude
implicit submenus, which are shown indented in the menuconfig interface
and are created when items depend on the symbol before them.

Previously, implicit submenus were excluded in the menu path at the top
of the menuconfig interface, but were included in the menuconfig symbol
information dialog and in the docs generated by genrest.py.

This makes it consistent, and un-spams the documentation for some
symbols a bit.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-22 13:31:56 -04:00
Andy Ross
dec163fe83 sanitycheck: Disable parallel builds with Ninja
Ninja and GNU make don't play well with each other.  Both try to start
enough processes to keep the system's CPUs busy, resulting in an
O(N^2) system load in the number of processors.

Long term, Ninja seems likely to support the GNU make jobserver
mechanism for sharing access to parallelism.  But for now we can get
90% of the way there with a simple hack: just run ninja in serial mode
with -j1.  Sanitycheck when run in non-trivial circumstances has
PLENTY of parallelism just from the number of test cases.

One interesting note is that even with -j1, system loads under ninja
are rather higher.  That may be because of significant work done in
the (serial) makefiles that dilutes the parallelism of the eventual
build, or possibly because ninja itself is multithreaded in its setup
code.  So I tweaked the number of jobs down to keep the load roughly
where it is with make.

With this change, I see no difference in behavior or system load, and a
~24% improvement in runtime.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-05-22 10:17:22 -04:00
Marti Bolivar
e047775664 scripts: west: downgrade missing ZEPHYR_BASE to a warning
This is not strictly necessary for flashing and debugging, and is
causing issues in Linux environments where users run "make flash" as
root instead of installing udev rules.

Fixes: #7676

(Though we will need to revisit this when adding commands that run
CMake).

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-05-21 22:46:29 -04:00
Ulf Magnusson
aa26289458 kconfig: Get rid of leading/trailing whitespace in prompts
Leading/trailing whitespace in prompts requires ugly workarounds in
genrest.py, as e.g. *prompt * is invalid RST. strip() all prompts in
Kconfiglib and get rid of the genrest.py workarounds. Add a warning too.

The Kconfiglib update has some unrelated cleanups and fixes (that won't
affect Zephyr).

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-19 09:26:39 +03:00
Marti Bolivar
38e8f06fdb scripts: west: add context-sensitive runner help
Though commands like "west flash -h" now have help for generic runner
configuration options, runner-specific context is not printed.

In order to print this information, we would ideally want to know the
currently available runners from a build directory. Otherwise, we
can't print the current cached configuration, and the user will likely
be overwhelmed by a giant list of options etc. available for all the
runners in the package.

However, we can't print that information out without re-doing the
build, which is not safe to do when the user just gives '--help'.

To provide more complete help without causing side effects in the
default help output, add a new -H/--context option, which explicitly
re-runs the build (unless --skip-rebuild was given), parses the cache,
and prints context-sensitive help. This can be combined with the -r
option to restrict help to a particular runner.

Examples:

- Print context for all available flash runners:

      west flash -H --build-dir build-frdm_k64f/

- Print context for just one runner:

      west flash -H --build-dir build-frdm_k64f/ -r jlink

- Print context for all available debug runners, if current
  working directory is a build directory:

      west debug -H

If no context is available because there is no CMake cache file, this
command can still be used to obtain generic information about
runners. It emits a warning in this case.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-05-19 07:01:39 +03:00
Marti Bolivar
68e5933e97 scripts: west: add build directory to runner configuration
Add the build directory to the central runner configuration.
This is commonly useful information.

The first place we can use it is to eliminate guessing the current
working directory when building objects to parse .config.

It's not necessary to modify the build system for this, so leave the
relevant command line flag among the general options.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-05-19 07:01:39 +03:00
Marti Bolivar
5317f76dec scripts: west: introduce common runner configuration
Continue better integration of the runner subpackage into west by
moving the common runner configuration options into the command
core. This allows commands like "west flash -h" to display help for
common overrides like --kernel-hex.

Adjustments needed to make this happen are:

- Change the build system to separate common configuration values from
  runner-specific options and arguments

- Prepare the runner core by defining a new RunnerConfig class that
  represents the common configuration, and accepting that from a new
  create() method, which replaces create_from_args().

- Convert all concrete runner classes to use the new style of
  argument parsing and initialization.

- Group the command options appropriately for help output readability

There's still a bit of tool-specific stuff in the common
configuration (gdb and openocd configuration in particular); a more
generic way to deal with that will be necessary to better support
things like non-GDB debuggers, but that's out of scope of this patch.

All the runner-specific options are still in the runner packge, which
currently prevents them from being included in "west flash -h" etc.
Fixing that is also out of scope of this patch.

This has the ancillary benefit of getting rid of the legacy 'debug'
argument to ZephyrBinaryRunner, which is no longer appropriate since
verbose debug logging is handled by log.py in west.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-05-19 07:01:39 +03:00
Marti Bolivar
c9dfbfaf02 scripts: west: convert runner to use log module
Replace all informational messages with calls to log functions.

Cases which must interact via the terminal and standard output are not
modified.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-05-19 07:01:39 +03:00
Marti Bolivar
bc7b1c595e scripts: west: fix some intel_s1000 runner issues
There are a few issues with the intel_s1000 runner:

- it doesn't attach to the client when running debug (this is
  a part of the command's contract specified in core.py)

- it uses hard-coded sleeps when running subprocesses instead of
  waiting for them to terminate

- it re-implements pre-existing popen_ignore_int() functionality (in a
  way that is not portable to Windows) rather than using it directly

Fix these issues.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-05-19 07:01:39 +03:00
Marti Bolivar
a9aa250b88 scripts: west: clean up intel_s1000 runner
Make the flake8 linter happy, spell the board name with the correct
case in the module docstring, and keep the usual camel case naming
convention used for classes.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-05-19 07:01:39 +03:00
Marti Bolivar
bc587d9262 scripts: west: add subprocess.call wrapper to runner classes
There's a use case for it in intel_s1000.py

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-05-19 07:01:39 +03:00
Marti Bolivar
a81f0559c3 scripts: west: trivial fix to runner comments
Trivial fix to runner core.py.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-05-19 07:01:39 +03:00
Marti Bolivar
367c0bab6d scripts: west: remove command from runner arguments
This is redundant information.  The command is already known from the
top-level west command line. We can just feed it to run without
inserting it on the command line as well, which is safe to do now that
zephyr_flash_debug.py is gone.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-05-19 07:01:39 +03:00
Marti Bolivar
fbd2e92b42 scripts: remove zephyr_flash_debug.py
Since, by design, the west 'flash', 'debug', and 'debugserver'
commands operate the same way as the Makefile targets when given no
arguments, so just delegate to west from cmake/flash/CMakeLists.txt
instead of invoking zephyr_flash_debug.py by hand.

Removing the old script is the first step towards being able to clean
up the command line argument handling in the runner package, which was
always kind of a hack and can be improved now that runner is part of a
larger tool.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-05-19 07:01:39 +03:00
Marti Bolivar
b611e5b1ea scripts: west: add flash, debug, debugserver commands
When run without any arguments, the commands work the same way that
their CMake equivalents do. For example, if using the Ninja CMake
generator, these are equivalent:

    west flash        <----> ninja flash
    west debug        <----> ninja debug
    west debugserver  <----> ninja debugserver

Like CMake's build tool mode, you can also run them from any directory
in the system by passing the path to the build directory using
--build-dir (-d):

    west flash -d build/my-board

The commands will run the CMake-generated build system, so they keep
dependencies up to date and users don't have to manually compile
binaries between running CMake and using this tool.

The commands also support important use cases that CMake can't:

1) Any arguments not handled by 'west flash' et al. are passed to the
   underlying runner. For example, if the runner supports --gdb-port,
   the default can be overridden like so:

   west debugserver --gdb-port=1234

   Command processing by the 'west' command can also be halted using
   '--'; anything after that point (even if it's an option recognized
   by the west command) will be passed to the runner. Example:

   west debug -- --this-option-goes-to-the-debug-runner=foo

2) Any runner supported by the board can be selected at runtime using
   the -r (--runner) option. For example, if the board's flash runner
   defaults to nrfjprog but jlink is supported as well, it can be
   selected with:

   west flash -r jlink

3) The runner configuration can be persisted elsewhere, edited
   offline, and selected at runtime, using --cmake-cache (-c):

   west flash -c /home/me/some/other/CMakeCache.txt

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-05-19 07:01:39 +03:00
Marti Bolivar
4a354e891d scripts: west: runner: add get_runner_cls()
Add a utility method for getting a runner class given its name.  This
will be used in an upcoming patch which adds a command for printing
runner information.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-05-19 07:01:39 +03:00
Marti Bolivar
3919e70e09 scripts: west: remove redundant quote_sh_list definition
There is a copy in the west util module; now that runner is a
subpackage of west, just import it from there.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-05-19 07:01:39 +03:00
Marti Bolivar
9e7d16acd9 scripts: make runner a west subpackage
This is a stepping-stone to adding runner functionality into west
itself.

Since all of the runner tools assume a Zephyr build directory layout,
this doesn't put anything generic into a Zephyr-specific tool.

Make minimal adjustments to zephyr_flash_debug.py to keep existing
build system targets working unmodified.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-05-19 07:01:39 +03:00
Marti Bolivar
641ae471a7 scripts: west: add cmake utility module
This will be used in subsequent patches when adding commands that
interface with the runner package. These need to do things like
ensuring the CMake build is up to date, parsing the cache, etc.

To keep that interface clean, provide this functionality in a separate
module.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-05-19 07:01:39 +03:00
Marti Bolivar
b6af8eb932 scripts: create meta-tool package, "west"
We have agreed to develop a meta-tool named "west", which will be a
swiss-army knife of Zephyr development. It will support use cases like
building, flashing and debugging; bootloader integration; emulator
support; and integration with multiple git repositories.

The basic usage for the tool is similar to git(1):

    west [common opts] <command-name> [command opts] [<command args>]

There are common options, such as verbosity control, followed by a
mandatory sub-command. The sub-command then takes its own options and
arguments.

This patch adds the basic framework for this tool, as follows:

- a Python 3 package named 'west', in scripts/meta. There is no PyPI
  integration for now; the tool will be improving quickly, so we need
  to keep users up to date by having it in tree.
- an main entry point, main.py, and a package-level shim, __main__.py
- a cmd subpackage, which defines the abstract base class for commands
- logging (log.py)
- catch-all utilities (util.py)
- Windows and Unix launchers so users can type "west" to run the tool
  after sourcing the appropriate zephyr-env script for their
  environment.

Subsequent patches will start to add individual commands.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-05-19 07:01:39 +03:00
Marti Bolivar
1430e0c752 scripts: runner: core: don't print unless self.debug
Guard a pair of stray printlines with "if self.debug:", so they don't
happen by default.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-05-19 07:01:39 +03:00
Marti Bolivar
2715a011ee scripts: runner: add __str__ for RunnerCaps
It will be useful to be able to print a human-readable representation
later.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-05-19 07:01:39 +03:00
Ulf Magnusson
b58cbfd6ab menuconfig: Add .config loading dialog
.config files can now be loaded from within the menuconfig interface.
Show-all mode is turned on if the selected menu entry becomes invisible.

Unrelated fix: The menu path at the top of the display no longer
includes implicit (indentation-based) submenus, which makes it a bit
less spammy and confusing.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-18 20:17:52 +03:00
Ulf Magnusson
6d4d8ce026 menuconfig: Show properties on the correct symbol definition
This commit mirrors 0f1229bd68866 ("doc: genrest: Show properties on the
correct symbol definition"), for the menuconfig symbol information
display.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-17 23:55:07 +03:00
Ulf Magnusson
e307ba340c kconfiglib: Record which MenuNode has each property
This commit does some major surgery to Kconfiglib so that properties
(defaults, selects, etc.) can be shown on the menu node that actually
has the propetrty for symbols and choices defined in multiple locations.

This will be used to improve the output of genrest.py and the symbol
information display in the menuconfig.

The parsing code is a bit simpler now too as a side effect.

Commit message from Kconfiglib (63a44186137e2)
==============================================

This allows accurate documentation to be generated for symbols and
choices defined in multiple locations. There are now MenuNode.defaults,
MenuNode.selects, etc., lists that mirror the corresponding
Symbol/Choice lists.

Symbol/Choice.__str__() now correctly show property locations as well,
by simply concatenating the strings returned by MenuNode.__str__() for
each node.

_parse_properties() was modified to add all properties directly to the
menu node instead of adding them to the contained symbol or choice. The
properties are then copied up to symbols and choices in
_finalize_tree(). Dependency propagation is handled at the same time.

As a side effect, this cleans up the code a bit and de-bloats
_parse_properties().

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-17 23:55:07 +03:00
Ulf Magnusson
4dc9e5b2de kconfig: Get rid of 'option env' bounce symbols
This commit gets rid of the 'option env="ENV_VAR"' bounce symbols.
"$FOO" now expands directly to the value of the environment variable
FOO, instead of to the value of the Kconfig symbol FOO.

This change is likely to soon appear in the C tools as well. Those
'option env' symbols always seemed kinda pointless, and have broken
dependency handling due to forcing symbol evaluation during parsing,
before all the symbols have even been seen.

Compatibility with the C tools could be retained by naming all
'option env' symbols the same as the environment variable they
reference.

This commit also updated the Zephyr documentation to explain the new
behavior. It's relevant for $ZEPHYR_BASE and out-of-tree Kconfig
extensions.

Commit message from Kconfiglib (cbf32e29a130d)
==============================================

Make "$FOO" directly reference the environment variable $FOO in e.g.
'source' statements, instead of the symbol FOO. Use os.path.expandvars()
to expand strings (which preserves "$FOO" as-is if no environment
variable FOO exists).

This gets rid of the 'option env' "bounce" symbols, which are mostly
just spam and are buggy in the C tools (dependencies aren't always
respected, due to parsing and evaluation getting mixed up). The same
change will probably appear soon in the C tools as well.

Keep accepting 'option env' to preserve some backwards compatibility,
but ignore it when expanding strings. For compatibility with the C
tools, bounce symbols will need to be named the same as the environment
variables they reference (which is the case for the Linux kernel).

This is a compatibility break, so the major version will be bumped to 6
at the next release.

The main motivation for adding this now is to allow recording properties
on each MenuNode in a clean way. 'option env' symbols interact badly
with delayed dependency propagation.

Side note: I have a feeling that recording environment variable values
might be redundant to trigger rebuilds if sync_deps() is run at each
compile. It should detect all changes to symbol values due to
environment variables changing value.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-17 23:55:07 +03:00
Andrew Boie
3772f77119 k_poll: expose to user mode
k_poll is now accessible from user mode. A memory allocation takes place
from the caller's resource pool to copy the provided poll_events
array; this can be large enough to make allocating it on the stack
not preferable.

k_poll_signal are now proper kernel objects. Two APIs have been added,
one to reset the signaled state and one to check the current signaled
state and result value.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-05-17 23:34:03 +03:00
Andrew Boie
8345e5ebf0 syscalls: remove policy from handler checks
The various macros to do checks in system call handlers all
implictly would generate a kernel oops if a check failed.
This is undesirable for a few reasons:

* System call handlers that acquire resources in the handler
  have no good recourse for cleanup if a check fails.
* In some cases we may want to propagate a return value back
  to the caller instead of just killing the calling thread,
  even though the base API doesn't do these checks.

These macros now all return a value, if nonzero is returned
the check failed. K_OOPS() now wraps these calls to generate
a kernel oops.

At the moment, the policy for all APIs has not changed. They
still all oops upon a failed check/

The macros now use the Z_ notation for private APIs.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-05-17 23:34:03 +03:00
Andrew Boie
2b9b4b2cf7 k_queue: allow user mode access via allocators
User mode may now use queue objects. Instead of embedding the kernel's
linked list information directly in the data item, a container struct
is allocated from the caller's resource pool which is then added to
the queue. The new sflist type is now used to store a flag indicating
whether a data item needs to be freed when removed from the queue.

FIFO/LIFOs are derived from k_queues and have had allocator functions
added.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-05-17 23:34:03 +03:00
Andrew Boie
47fa8eb98c userspace: generate list of kernel object sizes
This used to be done by hand but can easily be generated like
we do other switch statements based on object type.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-05-16 17:32:59 -07:00
Andrew Boie
577d5ddba4 userspace: fix kobj detection declared extern
If a variable is declared extern first, the name and type
information is stored in a special DW_DIE_variable which
is then referenced by the actual instances via the
tag DW_AT_specification.

We now place extern variable instances in an extern environment
and use this data to fetch the name/type of the instances,
which do not have it (which is why they were being skipped).

As it turns out, the gross hack for the system workqueue was
due to this problem because of the extern declaration in
kernel.h.

Fixes: #6992

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-05-16 17:00:27 -07:00
Ulf Magnusson
e24788eb71 menuconfig: Make search more flexible and search prompts
This commit gets the following incremental search improvements in from
upstream:

  - 1d3db5de9b8c2 ("menuconfig: Add search with multiple search
    strings")

    This makes a search string like 'foo bar' match all symbol names
    that match both 'foo' and 'bar' (which can be regexes), regardless
    of the order in which they appear in the match. This is faster and
    more flexible than having to type a bunch of '.*'.

  - 9bf8fc6e6907e ("menuconfig: Add prompts to incremental search")

    This makes the incremental searcher search prompt strings as well as
    symbol names.

    The prompt is now displayed next to the symbol name in the list of
    matches as well.

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-05-11 16:44:47 -04:00
Ulf Magnusson
295c1d8580 menuconfig: Fix rendering of long prefilled edit box string
The horizontal scroll (hscroll) wasn't initialized properly when the
initial (prefilled) contents of an edit box was longer than the edit box
itself (e.g. when saving with a long path in KCONFIG_CONFIG). Things
snapped back into place once a key was pressed.

Properly initialize hscroll to fix the initial rendering.

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-05-10 23:27:17 +02:00
Erwan Gouriou
93d3a42776 scripts: extract_includes_dts: Remove usage of cell_string yaml attribute
'cell_string' yaml attribute has been introduced in order to
help enforcement of specific string during defines generation.
This adds complexity in understanding script behavior as a black
box and create additional dependency which is not strictly required.

For node specific generation functions (pinctrl and interrupts),
this could be replaced directly by an hardcoded version
(as everyone used the same 'cell_string' anyway).
For extract_cells functions, string could be replaced by extracted
property name. As a consequence, we're now able to generate defines
for properties refering to these controllers via phandle.
For instance, in following node
 	spbtle-rf@0 {
 		compatible = "st,spbtle-rf";
 		reg = <0>;
		reset-gpios = <&gpioa 8 0>;
 	};
We'll be able to generate:
 #define ST_STM32_SPI_...LE_RF_0_RESET_GPIOS_CONTROLLER	"GPIOA"
 #define ST_STM32_SPI_...PBTLE_RF_0_RESET_GPIOS_FLAGS_0		0
 #define ST_STM32_SPI_..._SPBTLE_RF_0_RESET_GPIOS_PIN_0		8

Only impact for this whole change is for NXP clocks which were the
only ones using 'cell_string' attribute with a value different than
the default one.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-05-10 10:38:23 -05:00
Erwan Gouriou
9272a3e5ac scripts: extract_dts_includes: remove prefix argument
prefix was given as argument in several functions but not used
as property is never defined.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-05-10 10:38:23 -05:00
Kumar Gala
ded17a910d scripts: extract_dts_includes: Fix extract_controller for a list
extract_controller only handle the first phandle in a cell property.
However we could easily have something like this where the phandles
vary:

gpios = <&gpiod 13 GPIO_INT_ACTIVE_LOW
         &gpioc 14 GPIO_INT_ACTIVE_LOW>;

So we need to walk the property list for each phandle and produce a
define associated with it.

Also, if alias to the node is defined, indexed alias define
is generated for every indexed controller define:
 #define GPIO_LEDS_0_GPIO_CONTROLLER_0	"GPIOA"
 #define GPIO_LEDS_0_GPIO_CONTROLLER_1	"GPIOB"
 #define LED1_GPIO_CONTROLLER_0		GPIO_LEDS_0_GPIO_CONTROLLER_0
 #define LED1_GPIO_CONTROLLER_1		GPIO_LEDS_0_GPIO_CONTROLLER_1

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-10 10:38:23 -05:00
Kumar Gala
97a1ea22fc scripts: extract_dts_includes: Fix extract_cells for a list
If we had something like:

gpios = <&gpiod 13 GPIO_INT_ACTIVE_LOW
         &gpiod 14 GPIO_INT_ACTIVE_LOW>;

The script blows up in extract_cells.  While extract_cells attempted to
handle more than a single item in such a list, it didn't manipulate the
prop list for the recursive calls properly.

Since we pop off items from the prop list as we use them we can easily
pass the prop list to the rescurive call to fix things.

Besides, if alias is defined for the node, indexed aliases defines are
generated:
 #define GPIO_LEDS_0_GPIO_FLAGS_0 4
 #define GPIO_LEDS_0_GPIO_FLAGS_1 0
 #define GPIO_LEDS_0_GPIO_PIN_0   5
 #define GPIO_LEDS_0_GPIO_PIN_1   6
 #define LED1_GPIO_FLAGS_0 GPIO_LEDS_0_GPIO_FLAGS_0
 #define LED1_GPIO_FLAGS_1 GPIO_LEDS_0_GPIO_FLAGS_1
 #define LED1_GPIO_PIN_0 GPIO_LEDS_0_GPIO_PIN_0
 #define LED1_GPIO_PIN_1 GPIO_LEDS_0_GPIO_PIN_1

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-10 10:38:23 -05:00
Erwan Gouriou
081c9c3bec scripts: extract_dts_includes: Generate'_0' defines only when needed
Indexed defines were systematically generated even when there
was only one element to generate.
So we ended up generated a lot of _0 defines.
Then we needed to generate aliases to these _0 indexed defines,
in order to get useful defines.
For instance:
 #define GPIO_LEDS_0_GPIO_FLAGS_0	4
 #define GPIO_LEDS_0_GPIO_PIN_0		5
 #define GPIO_LEDS_0_GPIO_FLAGS		GPIO_LEDS_0_GPIO_FLAGS_0
 #define GPIO_LEDS_0_GPIO_PIN		GPIO_LEDS_0_GPIO_PIN_0

This commit allows to generate _0 indexed define only if a
property has more than one elements to define.
Aliases generation to _0 indexed defines are also removed.

Note: IRQ are left untouched since this is frequent to handle
multiple IRQs in a driver

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-05-10 10:38:23 -05:00
Erwan Gouriou
e099f3813e scripts: extract_dts_includes: rename arguments for easier reading
Some functions were using y_key and y_val as argument.  This was not
quite easy to read.  Rename argument into more informative versions.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-05-10 10:38:23 -05:00
Ulf Magnusson
27d34926e5 menuconfig: Increase indent and make Unicode more robust
This commit adds the following changes from upstream:

  - ed38e895ace ("Increase indent for implicit submenus to 4")

    Suggested by Carles Cufí. Makes it easier to see the menu structure
    at a glance.

  - 1d252b30c77 ("menuconfig: Convert the C locale to a UTF-8 locale for
                  LC_CTYPE")

    Makes Unicode input work on many systems with bad defaults.

    Also fixes some interface ugliness, like down arrows turning into
    upside-down T's.

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-05-09 14:08:00 +02:00
Anas Nashif
65f0c67906 checkpatch: downgrade COMPLEX_MACRO to a warning
This is generating lots of false positives and we keep overriding them
manually, so downgrade and mark it as a warning.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-08 08:56:12 -07:00
Anas Nashif
de7fc9dec9 sanitycheck: we need pyserial for sanitycheck
Needed for testing on real hardware and connecting to the serial console
to capture output.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-08 07:56:18 -04:00
Anas Nashif
61e2163ec9 sanitycheck: support skipped tests, enhance device handler
- Some tests start with test_, some do not, so make sure we parse both.
- Parse skipped tests
- Improve handling of test case identifier
- Handle Exceptions in device handler

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-08 07:56:18 -04:00
Anas Nashif
a3abe967d6 sanitycheck: do not count duplicate tests
Some tests are being reused to reset or re-init state, ignore them in
accounting.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-08 07:56:18 -04:00
Anas Nashif
a279403c47 tests: remove dot after PASS|FAIL
That dot does not belong here, just stands in the way when parsing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-08 07:56:18 -04:00
Anas Nashif
37f9dc5c2d sanitycheck: simplify argument passing and use global options
We are passing global arguments from one level to the next when those
variables are available globally. Reduce the arguments and remove unused
arguments as well.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-08 07:56:18 -04:00
Anas Nashif
d3384fb71c sanitycheck: cleanup handler class
init class in one place, no need to duplicate all class members in every
subclass.
run_log is not needed in the handler class.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-08 07:56:18 -04:00
Anas Nashif
e0a6a0b692 sanitycheck: parse test results and create detailed report
Parse the test results and create a test report with more granular
results that can be imported to into test management/reporting system.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-08 07:56:18 -04:00
Anas Nashif
73440ead7d sanitycheck: device handler, allow running tests on real hw
This will allow us to run sanitycheck on real devices and get reporting
out of it the same way we do that with Qemu.

To use this, run sanitycheck with the following new options:

 scripts/sanitycheck --device-testing --device-serial /dev/ttyACM0 -p
 frdm_k64f  -T tests/crypto/

--device-serial denotes the serial device the board is connected to.
This needs to be accessible by the user running sanitycheck. You can
run this on one board only at a time, the board is specified using the
--platform option.

This was tested with only a few boards, some board will not work
because how they reset the serial device during flashing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-08 07:56:18 -04:00
Ulf Magnusson
547ed9b563 kconfig: Make 'source' non-globbing and use 'gsource'
Until now, Zephyr has used a patched Kconfiglib that turns 'source' into
a globbing source (by replacing 'source' with 'gsource' at the token
level). There's two problems with this:

  - The patch needs to be maintained separately

  - Misspelled filenames are silently ignored, as they look like glob
    patterns that don't match anything

Fix it as follows:

  1. Replace all 'source' statements that use wildcards with 'gsource'

  2. Remove the custom Kconfiglib patch so that 'source' no longer globs

The sed pattern '/source.*[*?]/s/source/gsource/' was run over all
Kconfig* files to do the replacement.

source's that use environment variables that might contain glob patterns
were manually changed to gsource.

Building the docs in doc/ is a good test, as doc/Makefile deliberately
sets the environment variables to glob up as many Kconfig files as
possible.

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-05-08 11:14:12 +02:00
Ulf Magnusson
ac7f223956 kconfig: Mention that checkconfig.py lacks Kconfiglib 2 support
This script has not been updated for Kconfiglib 2. Add a comment to it
that mentions it.

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-05-07 21:53:37 +02:00
Ulf Magnusson
11952a60bf kconfig: Remove the C Kconfig implementation
Remove the C Kconfig tools and various scripts associated with them.

scripts/kconfig/diffconfig is popular, so keep it.

I don't know whether anyone is using scripts/kconfig/config. Remove it
and see if anyone screams.

scripts/kconfig/streamline_config.pl deals with modules ('m' values) and
can safely be removed. Zephyr's Kconfig files do not use modules.

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-05-07 21:53:37 +02:00
Ulf Magnusson
133bad7899 scripts: install windows-curses package on Windows
The new menuconfig implementation needs it when run on Windows.

Use an environment marker to only install windows-curses on Windows. See
https://www.python.org/dev/peps/pep-0508/#id23.

From some googling, sys_platform might be more widely supported than
platform_system, so use that.

Suggested-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-05-07 21:53:37 +02:00
Ulf Magnusson
b737fcb9ba scripts: kconfig: Add incremental search to menuconfig
Pressing [/] brings up a dialog with an edit box where a regex can be
entered. The list of matching symbols is always shown below it.
Selecting a symbol and pressing [Enter] jumps directly to it in the menu
tree. If the symbol is invisible, show-all mode is turned on
automatically.

This commit also includes a bunch of more-or-less unrelated changes from
poking around with the code:

  - Some redundant styles were merged. Probably wouldn't want to have a
    different style for each separator line, for example...

  - [ESC] in the top menu now works like [Q]

  - Returning to a parent menu now makes sure that the selected row is
    visible, even if the terminal was shrunk between entering the child
    menu and leaving it.

  - A _max_scroll() helper was factored out to reduce code duplication.
    It takes a list of items and a window in which the list is
    displayed, with one row per item, and returns the minimum scroll
    value that will make the final item visible.

  - The save dialog now pops up a message to confirm that the save was
    successful.

  - Lots of minor code nits all over (renamings, etc.)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-05-07 21:53:37 +02:00
Sebastian Bøe
60b01f3f54 kconfig: Refactor kconfig.py to use __main__ and argparse
Kconfig.py is not following the de-facto (real?) coding standards of
Zephyr. This commit refactors kconfig.py with two changes:

Use __main__ and def main().

Use argparse instead of sys.argv.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-05-04 17:25:14 -04:00
Manivannan Sadhasivam
26babfc622 drivers: led: Add system call handler support
Add system call handler support to LED subsystem. No buffers are
involved in any of the API's and hence the syscall support is
straightforward.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2018-05-04 10:07:39 -07:00
Ulf Magnusson
dc97fc2a60 kconfiglib: Update to default to UTF-8 for Python 3
Update Kconfiglib to upstream revision da40c014398f3 (+ local Zephyr
modifications) to get commit da40c014398f3 ("Force encoding to UTF-8 by
default on Python 3") in. It sets a (configurable) UTF-8 default for
Python 3, overriding the encoding specified in the current locale.

I've decided that this is a good idea after some problem reports
unrelated to Zephyr. Running with the C locale breaks things horribly
otherwise, and the fix isn't obvious.

Plain strings aren't decoded on Python 2, so no changes are needed
there.

Related PEP: https://www.python.org/dev/peps/pep-0538/

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-05-02 15:44:45 -04:00
Alberto Escolar Piedras
770178b76e sanitycheck: Stop on linker warnings also in native_posix
After removing the -T linker warning for the POSIX arch
we can, and should, also treat its linker warnings as errors

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-05-02 10:19:09 -04:00
Rajavardhan Gundi
b3153d2405 intel_s1000: scripts: debug, debugserver and flash scripts
This patchset creates Debug, Debugserver and Flash scripts
ensuring support in the ZephyrBinaryRunner mode.

Change-Id: Ib4f7820b1c6a045bd67cf4a031be99cf61e65eca
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-01 16:46:41 -04:00
Ulf Magnusson
1799cfdb2f scripts: kconfig: Turn malformed .config lines into errors
The warning from Kconfiglib might be hard to spot, and the problem is
easily fixed right away (note that malformed .config lines are different
from assignments to undefined symbols).

Do not make malformed .config lines an error in Kconfiglib itself (just
a warning), as you end up with messy "half-loaded" configurations.

Suggested by Marti Bolivar.

Piggyback some minor cleanups in kconfig.py. Make the warning for
configuration settings that didn't match the final value go to stderr,
for consistency.

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-05-01 20:53:40 +02:00
Ulf Magnusson
cfb3c9251c kconfiglib: Update to add warning for malformed .config lines
Update Kconfiglib to upstream revision ed3ceaa056262 (+ local Zephyr
modifications) to get commits c1c5ef2eb1009 ("Print a warning for
malformed .config lines") and ed3ceaa05626f ("Make warnings available in
a list") in.

This warning for malformed .config lines will be turned into an error in
kconfig.py, which is made easier by making the warnings available in a
list in Kconfiglib.

It's now configurable whether warnings are printed to stderr or not. In
this case, it still makes sense to print them to stderr as well.

Suggested by Marti Bolivar.

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-05-01 20:53:40 +02:00
Ulf Magnusson
73549ad852 scripts: kconfig: Add a Python menuconfig implementation
This commit adds a Kconfiglib-based menuconfig implementation, built
with the standard Python 'curses' module. A new 'pymenuconfig' target is
added to run it.

The C tools are kept for now. Removing them separately allows testing of
pymenuconfig alongside the C tools, and keeps changes small and focused.

A feature is planned for later that shows all symbols -- including those
that aren't currently visible -- along with a search and "jump to"
feature. Loading of arbitrary .config files will be supported later as
well (as opposed to always loading .config/KCONFIG_CONFIG). Those
features are all connected implementation-wise.

For Windows, the wheels at
https://www.lfd.uci.edu/~gohlke/pythonlibs/#curses provide the curses
implementation. They use the standard Python curses module
(_cursesmodule.c), linked against PDCurses.

Running 'python -VV' gives the Python version and bitness, to know which
wheel to install. User documentation will be added once the C tools are
removed and the 'pymenuconfig' target is moved over to 'menuconfig'.

The CMake parts are originally by Sebastian Bøe.

Description, taken from the menuconfig.py docstring:

    Overview
    ========

    A curses-based menuconfig implementation. The interface should feel
    familiar to people used to mconf ('make menuconfig').

    Supports the same keys as mconf, and also supports a set of
    keybindings inspired by Vi:

      J/K     : Down/Up
      L       : Enter menu/Toggle item
      H       : Leave menu
      Ctrl-D/U: Page Down/Page Down
      G/End   : Jump to end of list
      g/Home  : Jump to beginning of list

    The mconf feature where pressing a key jumps to a menu entry with
    that character in it in the current menu isn't supported. A search
    feature with a "jump to" function for jumping directly to a
    particular symbol regardless of where it is defined will be added
    later instead.

    Space and Enter are "smart" and try to do what you'd expect for the
    given menu entry.

    Running
    =======

    menuconfig.py can be run either as a standalone executable or by
    calling the menu.menuconfig() function with an existing Kconfig
    instance. The second option is a bit inflexible in that it will
    still load and save .config, etc.

    When run in standalone mode, the top-level Kconfig file to load can
    be passed as a command-line argument. With no argument, it defaults
    to "Kconfig".

    The KCONFIG_CONFIG environment variable specifies the .config file
    to load (if it exists) and save. If KCONFIG_CONFIG is unset,
    ".config" is used.

    $srctree is supported through Kconfiglib.

    Other features
    ==============

      - Seamless terminal resizing

      - No dependencies on *nix, as the 'curses' module is in the Python
        standard library

      - Unicode text entry

      - Improved information screen compared to mconf:

          * Expressions are split up by their top-level &&/|| operands
            to improve readability

          * Undefined symbols in expressions are pointed out

          * Menus and comments have information displays

          * Kconfig definitions are printed

    Limitations
    ===========

      - Python 3 only

        This is mostly due to Python 2 not having curses.get_wch(),
        which is needed for Unicode support.

      - Doesn't work out of the box on Windows

        Has been tested to work with the wheels provided at
        https://www.lfd.uci.edu/~gohlke/pythonlibs/#curses though.

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-05-01 20:51:11 +02:00
Ulf Magnusson
d3bfbfeb17 kconfiglib: Update to get choice.direct_dep in
Update Kconfiglib to upstream revision 509e374dfcadb (+ local Zephyr
modifications) to get commit 509e374dfcadb ("Add Choice.direct_dep
field") in. It is used by the upcoming Python menuconfig implementation
when displaying information about choices.

Origin: https://github.com/zephyrproject-rtos/Kconfiglib/tree/zephyr

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-05-01 20:51:11 +02:00
Sebastian Bøe
6c3a94c01f cmake: Add function for checking if a directory is write-able
Added a CMake extention for determining if a directory is write-able
by the build system. To determine this, we attempt to 'touch' a file
in the directory and check the return code of this command.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-04-27 12:06:02 +02:00
Inaky Perez-Gonzalez
75e2d901e7 sanitycheck: refinements to --list-tests
This packs a few improvements:

- Add a smarter regex that will catch multiple combinations of

    ztest_[user_]unit_test[_setup_teardown](NAME[, setup, teardown])

  as well as single liners like:

    ztest_test_suite(mutex_complex, ztest_user_unit_test(TESTNAME));

- Limit how much we look forward in suite_regex -- we don't have to
  look past the first argument, otherwise we consume too much and the
  loopup at suite_regex_match.start() will start too late.

- Remove include_regex, unused

- Fix the path where we warn about matches in achtung_regexes--it
  needed a few decodes and to use error() vs the unexistant warning()

- Cleanup the path to produce the subcase names, doing the decode and
  the purging of any test_ prefix in scan_path().

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2018-04-26 21:27:57 +05:30
Leandro Pereira
39dc7d03f7 scripts: gen_kobject_list: Generate enums and case statements
Adding a new kernel object type or driver subsystem requires changes
in various different places.  This patch makes it easier to create
those devices by generating as much as possible in compile time.

No behavior change.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-04-26 02:57:12 +05:30
Leandro Pereira
c200367b68 drivers: Perform a runtime check if a driver is capable of an operation
Driver APIs might not implement all operations, making it possible for
a user thread to get the kernel to execute a function at 0x00000000.

Perform runtime checks in all the driver handlers, checking if they're
capable of performing the requested operation.

Fixes #6907.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-04-26 02:57:12 +05:30
Håkon Øye Amundsen
de223cce8a sanitycheck: Updated helptext to -O/--outdir argument.
This addresses issue #7146.

The current helptext does not state that the directory
will be deleted.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2018-04-25 17:37:29 +05:30
Anas Nashif
c0149cc01d sanitycheck: support listing test cases
Parse all yaml file and create a list of declared testcases. This does
list the individual tests inside test projects, not only the projects
containing the tests, for example:

$ sanitycheck --list-tests  -T tests/net/socket/
 - net.socket.udp.send_recv_2_sock
 - net.socket.udp.v4_sendto_recvfrom
 - net.socket.udp.v6_sendto_recvfrom
 - net.socket.udp.v4_bind_sendto
 - net.socket.udp.v6_bind_sendto
 - net.socket.getaddrinfo_ok
 - net.socket.getaddrinfo_no_host
 - net.socket.tcp.v4_send_recv
 - net.socket.tcp.v6_send_recv
 - net.socket.tcp.v4_sendto_recvfrom
 - net.socket.tcp.v6_sendto_recvfrom
 - net.socket.tcp.v4_sendto_recvfrom_null_dest
 - net.socket.tcp.v6_sendto_recvfrom_null_dest
13 total.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-25 14:18:15 +05:30
Anas Nashif
aae71d74dd sanitycheck: parse test cases from source files
This parses the tests that run within a test project/application from
the source code and gives us a view of what was run, skipped and what
was blocked due to early termination of the test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-25 14:18:15 +05:30
Andrew Boie
31bdfc014e userspace: add support for dynamic kernel objects
A red-black tree is maintained containing the metadata for all
dynamically created kernel objects, which are allocated out of the
system heap.

Currently, k_object_alloc() and k_object_free() are supervisor-only.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-04-24 12:27:54 -07:00
Erwan Gouriou
69beec87b1 scripts: extract_dts_includes: generate controller #define's
When a node is referencing to a parent node and this node is
reported as controller, generate a #define to declare this controller.
Value is controller property 'label'
For instance, if following gpio controller is referenced in board dts:
green_led_1: led@1 {
    gpios = <&gpioa 5 GPIO_INT_ACTIVE_HIGH>;
    label = "User LD1";
};
Following will be generated:
\#define GPIO_LEDS_1_GPIO_CONTROLLER "GPIOA"

Besides, if defined, alias label will be generated as well for this
controller:
aliases {
    led0 = &green_led_1;
};
will trigger generation of:
\#define LED0_GPIO_CONTROLLER GPIO_LEDS_1_GPIO_CONTROLLER

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-04-19 09:32:39 -05:00
Erwan Gouriou
f3caef8eac scripts: extract_dts_inlcudes: look up compatible field in parents
Modify get_compat function to look for 'compatible' property
in parent nodes if not available at node level.
Since this operation is quite common, this allows some code
factorization. As a consequence, get_compat takes 'node_address'
as argument instead of 'node'.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-04-19 09:32:39 -05:00
Ulf Magnusson
b742b62b6e kconfiglib: Update to get split_expr() in
Update Kconfiglib to upstream revision 105c835e70a5b (+ local Zephyr
modifications) to get commit 105c835e70a5b ("Add helper for splitting
expressions") in. It will simplify the 'select' logic in genrest.py and
the upcoming menuconfig implementation, and also simplifies some
Kconfiglib internals.

split_expr() will also be helpful if genrest.py ever needs to split
other expressions, e.g. over multiple lines.

Origin: https://github.com/zephyrproject-rtos/Kconfiglib/tree/zephyr

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-04-17 08:02:40 -07:00
Erwan Gouriou
3b529ca3ee scripts: extract_dts_inlcudes: generate cells for gpio
Apply extract_cells function also when property name
contains "gpio" (could be cs-gpio, rst-gpio, gpio-irq, ..)

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-04-13 13:36:45 -05:00
Kumar Gala
c84235eee3 sanitycheck: Exit on load errors
If we have some error parsing a testcase or other files we treat these
as errors and will exit before continuing on building other tests.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-04-10 18:28:21 -04:00
Erwan Gouriou
074c90c5c4 scripts: dts_extract_include: generate aliases defs
In order to generate defs for references in aliases dts node,
add some treatment in extract_xxx functions to generate
aliases #define's

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-04-10 13:01:02 -05:00
Erwan Gouriou
ba2ce2e9f0 script/extract_dts_includes: factorize call to upper()
Factorize call to 'upper()' into convert_string_to_label function

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-04-10 13:01:02 -05:00
Anas Nashif
5c72f40c1d tests: tags should not be required
Tags can be set in the common section, some tests also might choose not
to set any tags.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-09 22:55:20 -04:00
Anas Nashif
75547e2b40 sanitycheck: add option to list all available tags
To avoid duplication when adding a new testcase.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-09 13:29:37 -04:00
Anas Nashif
5df8cff046 sanitycheck: simplify logic of build_only/enable_slow checking
Make checking for flags readable and fix logic for enable_slow.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-09 13:29:37 -04:00
Anas Nashif
ab351f407a sanitycheck: do not create overlays for filtered platforms
Only create those for tests/boards we are actually going to run.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-09 13:29:37 -04:00
Anas Nashif
20f553fe8d sanitycheck: do not call cmake twice on run
In many cases we are calling cmake twice with the same options, first to
build, and then we do the same thing when we want to call 'make run'.
Just call cmake once.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-09 13:29:37 -04:00
Anas Nashif
424a3db775 sanitycheck: do not always dump footprint statistics
When running large set of tests we always get a huge list of footprint
changes that mask the test results making them impossible to see on the
screen. Show the footprint results only on-demand and not on every
build.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-09 13:29:37 -04:00
Marti Bolivar
e32ed18076 jlink: fix flashing behavior on Windows
The object returned by NamedTemporaryFile cannot be opened a second
time while the file is still open on Windows. This is exactly what the
JLink commander needs to do with the resulting file, however, breaking
jlink flash on that platform.

Fix this by using a temporary directory instead, and creating a file
inside it. The resulting directory still gets cleaned up, but the
resulting file can be read by the commander.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-04-09 11:58:36 -05:00
Ulf Magnusson
8fc44f2988 kconfiglib: Update to e8408a06c68d8
Update Kconfiglib to upstream revision e8408a06c68d8 (+ local Zephyr
modifications) to get commit e8408a06c68d8 ("Move sanity checking to
after _finalize_tree()") in. It fixes some obscure false-positive
warnings for named choices that came up in
https://github.com/zephyrproject-rtos/zephyr/issues/6948.

Origin: https://github.com/zephyrproject-rtos/Kconfiglib/tree/zephyr

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-04-06 20:53:41 +02:00
Ulf Magnusson
db28a5d8b7 kconfiglib: Update to 981d24aff7654
Update Kconfiglib to upstream revision 981d24aff7654 (+ local Zephyr
modifications) to get commit 981d24aff7654 ("Set is_menuconfig True on
the top menu") in. It will be needed by the menuconfig implementation.

Origin: https://github.com/zephyrproject-rtos/Kconfiglib/tree/zephyr

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-04-05 13:10:12 +02:00
Ulf Magnusson
46a172ae3c kconfiglib: Update to 2259d353426f1
Update Kconfiglib to upstream revision 2259d353426f1 (+ local Zephyr
modifications) to get commit 2259d353426f1 ("Generalize is_menuconfig to
non-symbol items") in. It will be used by the menuconfig implementation.

Origin: https://github.com/zephyrproject-rtos/Kconfiglib/tree/zephyr

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-04-04 15:29:21 -04:00
Anas Nashif
fdadb501f7 scripts: cleanup scripts directory
Remove unused and obsolete scripts we used with Kbuild or scripts that
were copied from Linux but never used or modified for Zephyr:

- vercomp: not needed with cmake, version comparison is built-in
- mksysmap: Linux script
- make-ll parallel build script, something that is more suitable in
  $HOME/bin, not in Zephyr tree
- headerdep.pl: Linux specific, not adapted or used with Zephyr
- timestamp: used by other checkpatch scripts under scripts/checkpatch
- move uncrustify.cfg to .uncrustify.cfg in top tree for easy access and
  alongside other configuration files.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-03 09:28:09 -04:00
Ulf Magnusson
96d703f9c2 scripts: Fix misspelled CMake project name
s/Zehpyr/Zephyr/

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-03-30 17:51:27 -04:00
Andrew Boie
d5a2400b9f gen_syscall_header.py: fix include issue
This header uses definitions in include/syscall.h but wasn't
explicitly including it.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-03-28 20:52:08 -04:00
Andrew Boie
c67eb56355 gen_syscalls.py: fix include issue
The generated header uses Zephyr's custom integer type
definitions but wasn't including the proper header.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-03-28 20:52:08 -04:00
Ulf Magnusson
4b35875719 kconfiglib: Update to 7245bad9ebb58
Update Kconfiglib to upstream revision 7245bad9ebb58 (+ local Zephyr
modifications), to get the following improvements/fixes in:

 - Print a warning if an int or hex symbol is assigned a value that lies
   outside an active 'range' constraint.

 - Turn 'FOO' into a link in 'select FOO' when generating the Kconfig
   reference documentation.

 - Parenthesize '&&' expressions within '||' expressions --
   (A && B) || (C && D) is more readable than A && B || C && D.

The final two fixes will only be visible once the fix for #5622 gets in.

Fixes #6749
Fixes #6844

Origin: https://github.com/zephyrproject-rtos/Kconfiglib/tree/zephyr

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-03-28 23:56:49 +02:00
Jukka Rissanen
6049207a29 net: Add initial TX and RX traffic class support
With this commit it is possible to add priority to sent or received
network packets. So user is able to send or receive higher priority
packets faster than lower level packets.
The traffic class support is activated by CONFIG_NET_TC_COUNT option.
The TC support uses work queues to separate the traffic. The
priority of the work queue thread specifies the ordering of the
network traffic. Each work queue thread handles traffic to one specific
work queue. Note that you should not enable traffic classes unless
you really need them by your application. Each TC thread needs
stack so this feature requires more memory.

It is possible to disable transmit traffic class support and keep the
receive traffic class support, or vice versa. If both RX and TX traffic
classes are enabled, then both will use the same number of queues
defined by CONFIG_NET_TC_COUNT option.

Fixes #6588

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-27 10:06:54 -04:00
Jukka Rissanen
47dafffb67 net: if: Separate IP address configuration from net_if
Move IP address settings from net_if to separate structs.
This is needed for VLAN support.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-27 10:06:54 -04:00
Erwan Gouriou
1ee8eeaccc scripts: extract_dts_include: convert inherited 'id' to 'node_type'
During yaml collapse step, convert inherited 'id' key to 'node_type'.
With this new 'node_type', it's is more easy to apply common treatment
to all bindings that include the same base yaml file but might not
have similar bindings/constraint naming convention.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-03-26 14:48:49 -04:00
Bobby Noelte
b6005bfb2a scripts: extract_dts_includes.py: factorize globals for module usage
Prepare to split extract_dts_includes in modules.

extract_dts_includes design is based on globals. Every module must be
able to use (import) them.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
2018-03-26 14:48:49 -04:00
Tomasz Bursztyka
dfd92b0602 script/dts: Remove unnecessary empty return on functions
No need to use return at the end of a function when it's not returning
anything.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-03-26 14:48:49 -04:00
Tomasz Bursztyka
7ef3ddee0b scripts/dts: De-clutter main function in extract_dts_includes
Moving logical parts into dedicated functions for clarity.
Factorizing a bit the code for potential future changes (more
'zephyr,xxxx' directives related to CONFIG_ option).

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-03-26 14:48:49 -04:00
Tomasz Bursztyka
1134393ac1 scripts/dts: Make extract_dts_includes generating both files by itself
Thus no need to parse twice the .dtsi, .dts and .yaml files.
Simplify provided arguments relevancy, letting argparse generating usage
message by itself.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-03-26 14:48:49 -04:00
Tomasz Bursztyka
b34d156693 scripts/dts: Use 4-spaces tabs instead of 2-space tabs in devicetree.py
Mandated by Python PEP-8.
(And normalize the way we write python in dts scripts also)

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-03-26 14:48:49 -04:00
Tomasz Bursztyka
6a9ebdcd18 scripts/dts: Fix Copyright headers
One was missing it and the other was not the new format.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-03-26 14:48:49 -04:00
Ulf Magnusson
e3892d9351 scripts: kconfig: Give symbol locations in warnings
Warnings from Kconfiglib itself always give symbol locations, but the
custom value mismatch warning in kconfig.py doesn't. Make it print the
symbol location(s) too. This is helpful when debugging.

Before:

    warning: UART_QMSI_0_HW_FC was assigned the value "y" but got the
    value "n" -- check dependencies

After:

    warning: UART_QMSI_0_HW_FC (defined at
    .../drivers/serial/Kconfig.qmsi:35,
    .../arch/x86/soc/intel_quark/quark_se/Kconfig.defconfig.series:194)
    was assigned the value "y" but got the value "n" -- check
    dependencies

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-03-26 10:03:57 +02:00
Sebastian Bøe
43bc30466a Revert "doc: Kconfig: Decode Kconfig sources as UTF-8 instead [...]"
This reverts commit f8d451258e. The
revert is done because of a regression in Mac OSX
https://github.com/zephyrproject-rtos/zephyr/issues/6726

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-03-21 08:57:44 -04:00
Sebastian Bøe
799b456354 Revert "kconfig: Decode Kconfig sources as UTF-8 instead of [...]"
This reverts commit 8500134cc2. The
revert is done because of a regression in Mac OSX
https://github.com/zephyrproject-rtos/zephyr/issues/6726

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-03-21 08:57:44 -04:00
Anas Nashif
25f6ab62c7 Revert "sanitycheck: Default to using Ninja"
This reverts commit 0e6689d559.

Parallel builds are broken due to a mix of Make/Ninja and the job server
not being operational.

See https://github.com/ninja-build/ninja/issues/1139

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-03-20 12:31:52 -04:00
Sebastian Bøe
f8d451258e doc: Kconfig: Decode Kconfig sources as UTF-8 instead of as LC_CTYPE
Decode Kconfig sources as UTF-8 instead of decoding them according to
the system locale (which might be ascii-only).

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-03-20 12:07:02 -04:00
Sebastian Bøe
8500134cc2 kconfig: Decode Kconfig sources as UTF-8 instead of as LC_CTYPE
Decode Kconfig sources as UTF-8 instead of decoding them according to
the system locale (which might be ascii-only).

This resolves an issue that can be reproduced like this:

$ export LANG=C
$ echo '# Sebastian Bøe' >> ~/zephyr/Kconfig
$ build_any_zephyr_app

See the Python comment for details.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-03-20 12:07:02 -04:00
Sebastian Bøe
46239ba512 kconfiglib: Update to fd21c5cb320b9
Update kconfiglib to revision fd21c5cb320b9 which can be found at
https://github.com/SebastianBoe/Kconfiglib

This allows us to eventually resolve some outstanding Kconfig issues
such as https://github.com/zephyrproject-rtos/zephyr/issues/4951

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-03-18 17:09:40 -04:00
Patrick Boettcher
d485d6c526 uncrustify: add space before name of typedef
typedef enum {
         vvv
    }name;

becomes

    typedef enum {
         vvv
    } name;

Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
2018-03-16 08:40:53 -07:00
Kumar Gala
767785825e scripts: extract_dts_inculdes: Fix issue if no zephyr,flash prop
We should be able to run the script without requiring a zephyr,flash
property in the choosen node.  Qualify insert based on having the
choosen property.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-03-15 08:14:00 -05:00
Maureen Helm
66d6b58176 scripts: extract_dts_includes: Fix path handling in Windows
When building in Windows, extract_dts_includes.py failed with an
exception on boards that have dts sensor bindings. This was caused by
path handling to search for i2c-device.yaml that worked in Linux, but
not in Windows.

Affected boards were disco_l475_iot1, frdm_k64f, frdm_kw41z, and
hexiwear_k64.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-03-12 09:44:36 -05:00
Leandro Pereira
a1ae8453f7 kernel: Name of static functions should not begin with an underscore
Names that begin with an underscore are reserved by the C standard.
This patch does not change names of functions defined and implemented
in header files.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-03-10 08:39:10 -05:00
Aapo Vienamo
edbaeea22f scripts: nrfjprog.py: Add --softreset switch
The current script relies on a hardware reset pin to release the chip
from reset. Software reset is also possible and even required in case
the reset pin hasn't been wired to the J-Link connector on the board.

This patch adds an additional command line switch to nrfjprog.py that
uses the software reset mechanism of nrfjprog instead of pin reset.

Signed-off-by: Aapo Vienamo <aapo.vienamo@iki.fi>
2018-03-09 23:05:34 -05:00
Anas Nashif
1eacdc78ac release: update sanitycheck footprint data
Update for 1.11

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-03-09 13:38:38 -06:00
Wayne Ren
f96a007a9a scripts: bug fixes in arc.py for make flash
do some fixes to let make flash work correctly

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2018-03-08 11:01:11 +01:00
Kumar Gala
451fc36824 scripts: extract_dts_inculdes: Fix reg prop size/addr cell calculation
When we determine the address and size cells to determine how to parse a
reg property, we need to stop at the parent of the node, not at the node
itself.  If we have #address-cells or #size-cells in a node its meant
for the children of that node and not the node itself.

Fixes #4568

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-02-21 06:48:42 -06:00
Christopher Collins
14735116d1 subsys: mgmt: UART transport for SMP (mcumgr).
Add a UART driver dedicated to transporting mcumgr SMP requests and
responses.

Signed-off-by: Christopher Collins <ccollins@apache.org>
2018-02-20 22:07:52 +01:00
Anas Nashif
7fe35cf886 sanitycheck: check for deprecated variant env variable
For those still using old variable ZEPHYR_GCC_VARIANT.
raise an error if the variable is not defined.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-15 08:53:25 -05:00
Carles Cufi
29af3e0396 scripts: nrfjprog: Use built-in pin reset enable
Use nrfjprog's built-in pin reset enabling functionality instead of
doing it manually.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-02-13 20:14:09 +01:00
Erwin Rol
cb3d127981 sanitycheck: add ccm_bss, ccm_noinit and ccm_data sections
Add the STM32 ccm_bss, ccm_noinit, abd ccm_data sections
to the list of allowed sections so the sanity check passes.

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2018-02-13 12:36:22 -06:00
Erwin Rol
e4890181b4 scripts/dts/extract_dts_includes.py: add ccm support
Add support for generating CONFIG_CCM_BASE_ADDRESS and CONFIG_CCM_SIZE
from the dts files.

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2018-02-13 12:36:22 -06:00
Anas Nashif
1aa1edaafa sanitycheck: make schema for toolchains more flexible
Allow for any toolchain variants to be useable with sanitycheck without
the need for them to be registered.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-13 07:44:45 -08:00
Anas Nashif
7ee8bb9677 build: deprecate ZEPHYR_GCC_VARIANT
We want to support other toolchain not based on GCC, so the variable is
confusing, use ZEPHYR_TOOLCHAIN_VARIANT instead.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-13 07:44:45 -08:00
Andrew Boie
ce6c8f347b dma: add system calls for dma_start/dma_stop
As per current policy of requiring supervisor mode to register
callbacks, dma_config() is omitted.

A note added about checking the channel ID for start/stop, current
implementations already do this but best make it explicitly
documented.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-02-12 19:24:25 -05:00
Sebastian Bøe
0e6689d559 sanitycheck: Default to using Ninja
It is important that it is easy to reproduce CI issues locally. Using
the same sanitycheck options locally and in CI helps in this
regard. Specifically, Ninja and Make can produce different results and
therefore the default generator should be the same for sanitycheck and
shippable.

This patch makes four changes:

The sanitycheck option '--make' is introduced to allow specifying Make
as a generator.

CI no longer passes the option '--ninja' to sanitycheck.

Sanitycheck defaults to using Ninja.

Sanitycheck documents the --ninja option as deprecated.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-02-12 08:24:23 -05:00
Alberto Escolar Piedras
bc101c5b25 sanitycheck: better coverage report generation
When generating coverage report:
* Also generate branch coverage
* If the report is properly generated tell user where to find it
* Handle case in which no ztests are run (it would crash before)

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-02-11 11:09:42 -05:00
Alberto Escolar Piedras
25e0636c84 doc: Sanitycheck command line options fixup
Aligned sanitycheck command line options in doc
with the actual ones.
+
Minor fix in --coverage description.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-02-10 13:22:06 -05:00
Carles Cufi
6bb98cc4fb kconfig: Sort the glob results
Sort the glob results when Kconfig sources do 'source
"/path/*/Kconfig"' to ensure that the resulting dotconfig file is the
same for all platforms.

This fixes #5743

Credit goes to @ulfalizer.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-02-09 10:31:26 -05:00
Alberto Escolar Piedras
c6524abc39 CI: also generate coverage for unit tests
sanitycheck: Compile unit tests with coverage enabled always
      + run also first unit tests together with native_posix
shippable: also include unit_testing coverage into report to
      codecov

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-02-09 07:39:55 -05:00
Kumar Gala
8a6381d8e8 dts: flash: Add support for flash labels
Added a label for soc-nv-flash nodes.  Made some updates to the
generation to maintain creating defines for properties like
erase-block-size and write-block-size so they we get both
FLASH_ERASE_BLOCK_SIZE and FLASH_${LABEL}_ERASE_BLOCK_SIZE (same for
WRITE_BLOCK_SIZE).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-02-07 11:28:28 -06:00
Andy Gross
c59d6cb760 scripts: sanitycheck: Add MPU userspace related sections
This patch adds app_pad and priv_stacks to the rw section list so that
tests which validate the sections found in the binary pass when run on
systems which contain MPUs.

Signed-off-by: Andy Gross <andy.gross@linaro.org>
2018-02-07 11:14:12 -06:00
Carles Cufi
8f7fdade1b scrips: kconfig: Rebase KConfiglib to latest upstream
Include latest improvements in 2.7.0

Origin: https://github.com/zephyrproject-rtos/Kconfiglib/tree/zephyr

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-02-07 15:26:23 +01:00
Anas Nashif
9a839df82e sanitycheck: rename qemu_crash -> handler_crash
qemu is only one of many handler we support now.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-06 20:59:35 -05:00
Anas Nashif
a49048b9db sanitycheck: all handlers produce the same log now
Rather than having handler generate differently named log files,
generate the same for all handlers, so qemu, native and unit will now
generate handler.log.

This will simplify things and reporting will be consistent.  Also, this
fixes a bug where we only included qemu.log in generated reports.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-06 20:59:35 -05:00
Anas Nashif
b630ca6292 sanitycheck: fixed function documentation
Functions now accept a different set of parameters, adapt the docs

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-06 20:59:35 -05:00
Anas Nashif
61346f0c42 doc: install pyocd using pip2
pyocd does not exist as a python 3 module, use pip2 to install it.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-06 19:40:42 -05:00
Andy Gross
6042ae9862 scripts: Covert scripts to use elf_helper.py
This patch converts over the current ELF processing scripts to use the
new elf helper python library.

Signed-off-by: Andy Gross <andy.gross@linaro.org>
2018-02-06 15:31:16 -08:00
Andy Gross
826389ab7f scripts: Add elf_helper.py
This patch adds a python helper library that encapsulates the ELF
processing being done across multiple scripts.  Users of this script
will be converted over in a following patch.

Signed-off-by: Andy Gross <andy.gross@linaro.org>
2018-02-06 15:31:16 -08:00
Chunlin Han
18560a01a4 arm: Generate privileged stacks
This patch adds the generation and incorporation of privileged stack
regions that are used by ARM user mode threads.  This patch adds the
infrastructure for privileged stacks.  Later patches will utilize the
generated stacks and helper functions.

Signed-off-by: Chunlin Han <chunlin.han@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2018-02-06 15:31:16 -08:00
Andy Gross
e8860fe8be arm: Add app data section alignment constraints
This patch adds application data section alignment constraints
to match the region definition requirements for ARM MPUs.  Most MPUs
require a minimum of 32 bytes of alignment for any regions, but some
require power of two alignment to the size of a region.

This requires that the linker align the application data section to
the size of the section.  This requires a linker pass to determine the
size.  Once this is accomplished the correct value is added to a linker
include file that is utilized in subsequent linker operations.

Signed-off-by: Andy Gross <andy.gross@linaro.org>
2018-02-06 15:31:16 -08:00
Carles Cufi
81da97c474 kconfig: Rebase to latest Kconfiglib
A lot of improvements have made it into Kconfiglib since we introduced
it into Zephyr. This rebases our 2 Zephyr-specific commits into the
latest Kconfiglib upstream.

Origin: https://github.com/zephyrproject-rtos/Kconfiglib/tree/zephyr

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-02-06 14:06:04 -05:00
Maureen Helm
afc78778d3 scripts: jlink: Do not mass erase flash by default
When adding support for the 'flash' command to the jlink runner, it was
not clear if the jlink commander would erase flash before programming,
therefore an explicit mass erase was implemented in the jlink runner as
a precaution and enabled by default.

The Segger folks later confirmed that the jlink commander does an
implicit erase of relevant flash sectors with the loadbin command,
therefore the explicit mass erase is not required.

Keep the mass erase option available in the jlink runner, but change the
default to false.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-01-30 11:09:06 -06:00
Alberto Escolar Piedras
2151b864d4 sanitycheck: fix crashes with symlinks in path
When building the testcase path, replace symlinks in path
with the realpath both in the testcase root and in ZEPHYR_BASE

For more info see issue #5772

Fixes: #5772

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-01-29 23:50:08 -05:00
Maureen Helm
9f57d11d9b scripts: jlink: Add flash command support to the jlink runner
Adds support for the 'flash' command to the jlink runner so we can flash
via 'make flash'. This works by generating a temporary jlink commander
script file and passing the script to the jlink commander executable.

Previously, the only way to flash with jlink was via 'make debug'.

Includes support for DT based flash address, and an optional mass erase
before loading the flash.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-01-29 23:15:16 -05:00
Sebastian Bøe
d5216a5299 size_report: Don't assume all paths start with ZEPHYR_BASE
Instead of crashing when a source file outside of ZEPHYR_BASE is
detected we accept it as-is to include it in the report.

This fixes #5866

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-29 23:59:16 +05:30
Kumar Gala
bc6aae8d73 scripts: extract_dts_includes: Sanitize interrupt names
Its possible we have dashes in interrupt names that we need to convert
to underscores when we generate defines.  Make sure we do that otherwise
things aren't going to build.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-01-29 11:10:43 -06:00
Anas Nashif
de713534b6 size_report: create a main() function
Refactor code and add main() function.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-29 05:16:52 +05:30
Anas Nashif
de311407bd scripts: fix ram_reports and generate bin file if missing
Some boards do not generate .bin files by default, this file is however
needed when generating ram/rom reports, so in case it is not present,
create it.

Fixes #5784

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-29 05:16:52 +05:30
Kumar Gala
0d48cbe13e sanitycheck: default to assertions being enabled
Changed the default behavior for when we run sanitycheck to match the -R
flag that turns on assertions.  Introduced a --disable-asserts option if
we desire to explicitly turn of asserts.

This matches behavior that our CI builds have been doing and addresses
part of #5726.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-01-27 05:18:10 +05:30
Anas Nashif
39caff5ca1 sanitycheck: use re.search to match output
Account for cases where there is a prefix to the output where exact
matching does not work.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif
fd6eb76579 sanitycheck: native: write output to run.log
Native handler should write output to a file, this is not happening
right now.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif
576be98525 sanitycheck: add harness classes
Add 2 classes, one to handle the current TestCase scenario, and one more
for handling generic Console with regex matching.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif
e722db14ad sanitycheck: support harness_config keyword in schema
Add harness_config to schema with basic options for now to support
console harness.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Sebastian Bøe
4bd904ccae size_report: Ported to native Windows
size_report was assuming Unix-style absolute paths and misbehaving
when paths had a colon ("C:\") in them. Also, refactored and improved
documentation.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-24 06:47:20 +05:30
Sebastian Bøe
cfca2dbfa3 size_report: Use Universal newlines when calling check_output
Use Universal newlines when calling check_output and rely on the
locale's encoding to decode the output instead of explicitly decoding
UTF-8.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-24 06:47:20 +05:30
Sebastian Bøe
8569b28596 size_report: Don't use colors on Windows
Colours are rely on ANSI escape codes that are not supported on
Windows.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-24 06:47:20 +05:30
Sebastian Bøe
91d9fe7f5e size_report: Use "Universal newlines" to fix ram_report on Windows
size_report was assuming that the GNU Binutils programs were
generating files with the line ending '\n'. But on native Windows
binutils will generate files with the line ending \r\n.

This patches size_report to use so-called "Universal newlines"[0], so
that size_report can deal with any kind of newline on any kind of
platform.

[0] https://www.python.org/dev/peps/pep-0278/

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-24 06:47:20 +05:30
Anas Nashif
8acdbd796e sanitycheck: support new simulation keyword
Some boards are supported natively by qemu. This option will allow us to
run tests using those platforms directly without having to go via a
dedicated qemu board definition.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-18 21:37:48 -05:00
Anas Nashif
f18e2abdd5 sanitycheck: reduce verbosity when selecting specifc platforms
if we are using command line platform filter, no need to list every
other platform as excluded, we know that already.  Show only the
discards that apply to the selected platforms on the command line

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-18 11:27:14 -08:00
Anas Nashif
30551f40e9 sanitycheck: do not list discards when loading tests from file
When we load tests from a file, we do not have the discarded list, this
would have been done already when saving the test file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-18 11:27:14 -08:00
Wayne Ren
c92047fcb7 script: make gen_kobject_list.py compatible with dwarf-2
This issuse is found in arch/arc's memory domain api support.
For arc, dwarf-2 is used to keep compatible with synopsys metaware
mdb debugger. However, the gen_kobject_list.py cannot generate the
correct information from dwarf-2, because loc.form's value is
DW_FORM_block1.

If dwarf-4 is adopted, there is no issuse.

Other arch and tools may use dwarf-2 and face the same issuse, so
this commit is created.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2018-01-17 07:43:53 -05:00
Alberto Escolar Piedras
43bae63e88 sanitycheck: Allow pre/postfixes in tests stdout
When checking if a testcase passed or failed, allow there
to be prefixes or postfixes in the line, around
PROJECT EXECUTION SUCCESSFUL/FAILED

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-01-15 18:42:09 -05:00
Juan Manuel Torres Palma
dce32622cd scripts: fix tags.sh to current source tree
Update tags.sh tool to generate appropriate files to use with cscope and
ctags programs.

Current implementation generates tags for all but samples and it's
possible to filter by architecture.

Signed-off-by: Juan Manuel Torres Palma <j.m.torrespalma@gmail.com>
2018-01-15 18:30:28 -05:00
Sebastian Bøe
2612744352 cmake: Don't specify a C standard when building Kconfig
Specifying a C standard triggered a compiler warning on Ubuntu (gcc
5.4.0) and a compiler error on Mac OS 10.12.6. Omit specifying the
standard and let the host toolchain use it's default instead. Tested
on Mac OS and Ubuntu 16.04.3.

This fixes #5640

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-12 08:05:35 -05:00
Carles Cufi
d92769b849 scripts: kconfig: Replace Kconfig exectuables with Python
We have been using a fork of the Linux kernel's Kconfig system to
configure the Zephyr tree. The issue is that this is a native tool
written in C that is not easy to compile for Windows. This patch
replaces the use of the conf executable with kconfig.py, a script that
uses Kconfiglib to generate the .config and autoconf.h files required to
compile Zephyr.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-01-12 07:29:05 -05:00
Carles Cufi
f4639f186a scripts: kconfig: Prefer later defaults
This commit mirrors c6390d559f in
Kconfiglib instead of Kconfig.

Origin: https://github.com/carlescufi/Kconfiglib/tree/zephyr

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-01-12 07:29:05 -05:00
Carles Cufi
33bbecb946 scripts: kconfig: Add support for wildcards and globbing
Some projects use wildcards when sourcing a Kconfig file. Add
support for globbing the files that match the wildcards and process
them one by one.

Origin: https://github.com/carlescufi/Kconfiglib/tree/zephyr

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-01-12 07:29:05 -05:00
Carles Cufi
591eb575ea scripts: kconfig: Import Kconfiglib
Import Kconfiglib, the Python Kconfig parsing library.

Origin: https://github.com/ulfalizer/Kconfiglib
Revision: 8d30e5bb1ad5cab16d1226cc5cd3a03d64664f5d

Note that this will in time replace doc/scripts/genrest/kconfiglib.py,
which is an earlier version and should not live in that folder.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-01-12 07:29:05 -05:00
Carles Cufi
907735dd58 scripts: parse_syscalls: Multiplatform separators
In order to support both "/" and "\" as OS path separators,
use the correct Python os.sep helper.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-01-11 10:48:56 -05:00
Anas Nashif
abfed53525 gitlint: fix check for line_count
We should check if the commits line is less than, not less/equal...

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-11 10:48:03 -05:00
David B. Kinder
77d877c0d9 doc: update doc tools versions
I've been successfully using the latest sphinx/breathe/docutils
and doxygen versions for local doc build testing. The CI system
already uses the latest doxygen, so this patch updates the
pip-installed sphinx, breathe, and docutils tools too.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-01-11 06:51:22 -05:00
Anas Nashif
2dd5cef811 gitlint: do not allow title-only commit messages
It has been agreed in the project TSC to reject commit messages without
any content. Every commit message needs some explaination beyond what
was put in the title, even the most trivial ones.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-11 06:39:42 -05:00
Sebastian Bøe
4971d2a084 cmake: Fix "make VERBOSE=1"
It is desired behaviour that when 'make VERBOSE=1' is invoked, the
underlying scripts will be invoked in 'verbose mode', e.g. they have
the flag --verbose passed to them.

This patch modifies all the underlying scripts in the build system to
inject --verbose into the command line when the environment variable
VERBOSE is set.

The environment variable VERBOSE is a CMake concept. CMake will
generate Makefile's that read this environment variable and try to
behave accordingly. Unfortunately, the generated ninja build systems
behave differently and will have to be invoked like this:

VERBOSE=1 ninja -v

This fixes #4851

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-10 22:14:53 -05:00
Sebastian Bøe
c6f367d251 cmake: Give descriptive error to user when cloned with core.autocrlf
Windows users have on multiple occasions cloned Zephyr using a Windows
git client. It seems that the windows git client defaults to
converting line endings from LF to CRLF when cloning repo's. This
breaks at least one of Zephyr's tools (Kconfig).

This patch introduces a sanity check of the environment for MSYS
users.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-10 22:12:27 -05:00
Anas Nashif
674bb28040 sanitycheck: filter on CONFIG_ASSERT
CONFIG_ASSERT is being set by cmake, so it is not possible to filter
using the generated config, add this as a standalone filter.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-09 11:13:08 -05:00
Anas Nashif
1a5bba72da sanitycheck: move native_posix to the top
Generating coverage data is split over two CI jobs which means the
service will need to merge results and reports wrong coverage data when
only 1 job is finished. This puts the native_posix board first making
sure we run on the first job and generate data in one place.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-05 23:00:50 -05:00
Paul Sokolovsky
100474d99d scripts: sanitycheck: If error happens accessing YAML data, go on
Extend exception handling to cover not just YAML loading, but any
error while accessing parsed data too. That may catch e.g. schema
mismatch errors (for folks who don't have pykwalify installed, which
is optional). So, now error will be logged, but processing of other
tests will continue.

For example, I had a local, uncommitted test which wasn't converted
per 23f81eeb42 and caused:

Traceback (most recent call last):
  File "./scripts/sanitycheck", line 2456, in <module>
    main()
  File "./scripts/sanitycheck", line 2324, in main
    options.outdir, options.coverage)
  File "./scripts/sanitycheck", line 1445, in __init__
    for name in parsed_data.tests.keys():
AttributeError: 'list' object has no attribute 'keys'

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-01-05 09:48:11 -05:00
Anas Nashif
1df7e9a018 script: remove unused script: gcc-version.sh
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-03 19:03:41 -05:00
Anas Nashif
7256553955 scripts: python: cleanup script and fix PEP8 issues
Ran scripts through flake8 and fixed issues.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-03 19:03:41 -05:00
Anas Nashif
712d34513e sanitycheck: encode logs correctly
We were encoding logs twice.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-02 11:54:02 -05:00
Anas Nashif
43e4127df0 sanitycheck: remove unused map
This map is not being used anymore.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-02 11:54:02 -05:00
Anas Nashif
a8a1388ae4 sanitycheck: support ninja builder
Add an option to support building with ninja instead of make.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-02 11:54:02 -05:00
Anas Nashif
4f02888b58 sanitycheck: use global command line options variable
Now use glabal options instead of passing them around as function
arguments.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-02 11:54:02 -05:00
Anas Nashif
e10b651e2d sanitycheck: declare command line options global
We have been passing around options from one function to the next making
it very difficult to add a new option easily and requiring changes to
man function prototypes.
This declated the parsed command line options global and renames args to
options. args is being used elsewhere and this was confusing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-02 11:54:02 -05:00
Anas Nashif
b0f3ae0e98 sanitycheck: harness support
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
ab940163ee tests: add a new harness keyword to schema
This keyword would mean that a special harness is needed to run the
tests sucessfully. This can be as simple as a loopback wiring or a
complete hardware test setup for sensor and IO testing. It is free form
initially and would be changed to be an enum once we have more values in
place.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
262e4a4b8b sanitycheck: work around linking posix port
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2017-12-27 14:16:08 -05:00
Anas Nashif
cc16422538 sanitycheck: add native handler
Support running native applications in sanitycheck using a new handler.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-27 14:16:08 -05:00
Anas Nashif
2f4e170eb2 sanitycheck: support native build with *.exe extension
search for .exe file when running native applications in sanitycheck.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-27 14:16:08 -05:00
Anas Nashif
6b55598ad4 board: posix: add native_posix board definition
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-27 14:16:08 -05:00
Carles Cufi
fdd94d3bd8 scripts: debug: J-Link script tweaks
* Add the interface speed option
* Select USB connection explicitly
* Use "J-Link" consistently

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-12-19 16:57:36 -05:00
Sebastian Bøe
8b2213f670 nrfjprog_py: Use RuntimeError instead of Exception
Be more specific with the exception type.

https://github.com/zephyrproject-rtos/zephyr/pull/5432#issuecomment-352492089

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-12-19 12:45:34 -05:00
Sebastian Bøe
5056ab24fb runner: nrfjprog: Improve error messages
When a debugger is already connected to the JLink debug adapter
nrfjprog.py would incorrectly detect that the snr is '0' and try to
flash a device with that snr.

Also, when there were no boards connected, nrfjprog.py would
incorrectly state that there were multiple boards connected.

This patch improves the error feedback so that a user can more easily
debug why he can't flash his device.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-12-18 21:46:12 -05:00
Marti Bolivar
86e6e674a5 scripts: zephyr_flash_debug.py: swallow exceptions by default
For readability, swallow exceptions unless --verbose is given on the
command line. Add a printline to direct the user how to ensure that's
set in case more information out of the flash script is desired.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-12-18 21:45:48 -05:00
Marti Bolivar
209e2676b4 scripts: runner: add internal DEBUG to core
Add a debug-only global that prevents commands from running, and just
prints what would have been run.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-12-15 09:57:30 -05:00
Marti Bolivar
ec01e0f876 scripts: zephyr_flash_debug: add 'runners' command
This just prints the available runner classes.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-12-15 09:57:30 -05:00
Marti Bolivar
57d5717bc6 scripts: runner: let users copy/paste failed commands
Print a copy/pastable version of any command which fails, to help
debugging.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-12-15 09:57:30 -05:00
Marti Bolivar
ad8b006bf2 scripts: runner: pyocd: support pyocd-flashtool options
Allow the user to specify additional options for pyocd-flashtool. This
grants finer-grained control to individual applications, e.g. to
perform a chip erase instead of a sector erase when flashing.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-12-15 09:57:30 -05:00
Marti Bolivar
ccacaab49f scripts: runner: pyocd: support DT-based flashing
Enable DT support in the pyOCD flasher, and turn it on in the build
system.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-12-15 09:57:30 -05:00
Marti Bolivar
1645d372d2 scripts: runner: dfu-util: add --dfuse-modifiers option
This gives callers finer-grained control over the flash. For example,
giving --dfuse-modifiers=force:mass-erase allows a chip-erase rather
than just erasing the sectors which need to be overwritten with the image.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-12-15 09:57:30 -05:00
Marti Bolivar
3ebc2e46b2 scripts: runner: dfu-util: support DT-based flashing for DfuSe
Enable DT support in the dfu-util flasher when the target is a
DfuSe (DFU + ST extensions) device.

Untangling DfuSe-specific options (currently, the default is 'leave',
to immediately start running after the flashing is done) from the
actual address makes this cleaner, and sets up a subsequent patch to
let callers set DfuSe options.

It also lets us fix an unnecessary printline when flashing DfuSe
devices. There's no need to reset those, since the 'leave' modifier
starts execution immediately.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-12-15 09:57:30 -05:00
Marti Bolivar
3830bc51f2 scripts: runner: add infrastructure for DT-based flashing
Add the necessary infrastructure to the runner core to support
computing flash addresses based on the devicetree. Specifically, add:

- a new RunnerCaps capability, flash_addr, which lets runners declare
  when they support flashing to an arbitrary address

- a common --dt-flash option to all runner command line parsers which
  support this capability, which lets users request flash addresses to
  be computed from device tree

- a ZephyrBinaryRunner helper method, get_flash_address(), which is
  the common code needed to compute a flash address from device
  tree (or return a default value if non-DT based flashing is
  requested). This relies on the BuildConfiguration parser introduced
  in an earlier patch.

Subsequent patches will use this functionality in individual runners.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-12-15 09:57:30 -05:00
Marti Bolivar
7a3462de7a scripts: runner: use arguments, not environment vars
The various runners (flash/debug scripts) use environment variables to
take arguments. This is legacy behavior which is not desirable.

Use command line arguments instead.

Note: this leaves more general environment variables with publicly
      documented behavior in place for now, for compatibility, e.g.:

      ZEPHYR_FLASH_OVER_DFU, OPENSDA_FW, ESP_IDF_PATH, PYOCD_DAPARG

For example, when using dfu-util to flash arduino_101, instead of
setting DFUUTIL_PID, DFUUTIL_ALT, and DFUUTIL_IMG environment
variables, have the script invocation look like this:

  python3 .../zephyr_flash_debug.py dfu-util flash \
          [common arguments omitted] \
          --pid=8087:0aba --alt=x86_app \
          --img=.../build/zephyr/zephyr.bin

Make similar changes for other runners (openocd, etc.) and
targets (debug, debugserver).

To implement this in the scripts:

  - have the individual scripts/support/runner/some-runner.py files
    register their own command line arguments

  - teach them to construct instances from arguments, not the
    environment

  - have zephyr_flash_debug.py request runners to register command
    line argument parsers, and handle arguments

In the build system:

  - add a new board_runner_args() extension function that board.cmake
    files can use to add to the zephyr_flash_debug.py command line

  - adjust cmake/flash/CMakeLists.txt to invoke with arguments

  - add new helper include files for each runner (like
    boards/common/dfu-util.board.cmake, etc.), which add default
    options as needed and then add on overrides from
    board_runner_args() calls

  - update board.cmake files to use the new includes and extension

This implied some tweaking when using openocd to make the CMake string
escaping and unescaping work properly.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-12-15 09:57:30 -05:00
Marti Bolivar
f4ace33daf scripts: runner: add build-time .conf parser
This parses generated_dts_board.conf and auto.conf, given a build
directory.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-12-15 09:57:30 -05:00
Marti Bolivar
cd8d43b1c9 scripts: runner: generalize commands to "capabilities"
Some configuration options or device tree nodes affect the way that
runners ought to behave, but there's no good way for them to report
whether they can handle them.

One motivating example is CONFIG_FLASH_LOAD_OFFSET, as influenced by
the zephyr,code-partition chosen node in the DT for architectures
where CONFIG_HAS_FLASH_LOAD_OFFSET=y.

If CONFIG_FLASH_LOAD_OFFSET is nonzero, the 'flash' command ought to
place the kernel at that address offset from the device flash's start
address. Runners don't support this right now, which should be
fixed. However, we don't want to mandate support for this feature,
since not all targets need it.

We need to let runners declare what their capabilities are. Make it so
by adding a RunnerCaps class to the runner core. This currently just
states which commands a runner can handle, but can be generalized to
implement the above use case.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-12-15 09:57:30 -05:00
Marti Bolivar
e33ec242fd scripts: refactor flash/debug scripts to remove "shell"
The Python-based runners have replaced the old shell scripts. Refactor
the build system accordingly:

- FLASH_SCRIPT is now BOARD_FLASH_RUNNER
- DEBUG_SCRIPT is now BOARD_DEBUG_RUNNER

The values, rather than being the names of files, are now the names of
runners in scripts/support/runner. They are still short, descriptive
names like "openocd", "jlink", "em-starterkit", etc.

Adjust the zephyr_flash_debug.py call and runner internals
accordingly. Have each runner class report a name and the commands it
can handle. This lets us move some boilerplate from each do_run()
method into the common run() routine, and enables further improvements
in future patches.

The handles_command() method is temporary, and will be replaced by a
more general mechanism for describing runner capabilities in a
subsequent patch. The initial use case for extending this is to add
device tree awareness to the runners.

To try to avoid user confusion, abort the configuration if an
xxx_SCRIPT is defined.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-12-15 09:57:30 -05:00
Marti Bolivar
0fba4bf20c scripts: runner: refactor run() implementation
Have the subclasses implement a do_run() method instead, which run()
delegates to. This will make it possible to handle common
functionality in the superclass before runner-specific methods are
called. It is a prerequisite for tasks like loading the build time
configuration to add device tree awareness.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-12-15 09:57:30 -05:00
Marti Bolivar
5b0167ae79 scripts: runner: pyocd: fix stale comment
This isn't just a flasher anymore.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-12-15 09:57:30 -05:00
Marti Bolivar
36aee10bef scripts: zephyr_flash_debug: simple improvements
Delete an unused import to make flake8 happy. Update the module
docstring.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-12-15 09:57:30 -05:00
Marti Bolivar
607a817a4a scripts: extract_dts_includes: fix potential undefined read
Only read 'status' when it has been assigned in compress_nodes().

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-12-15 09:57:30 -05:00
Erwan Gouriou
fa47748ca3 scripts: extract_dts_inculdes: treat 'parent: bus' attribute
When node has 'bus' as 'parent' attribute, change base label to
include parent address in label prefix.

Besides, generates a "_BUS_NAME" define which equals parent label.

Signed-Off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-12-14 11:30:44 -06:00
Erwan Gouriou
568fc9d91f scripts: extract_dts_include: update to match new bindings path
Following move of dts bindings from common/yaml to bindings,
update yaml file search routine.

Signed-Off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-12-14 11:30:44 -06:00
Erwan Gouriou
318436589c script: extract_dts_includes: fix recursive inclusion
extract_dts_includes script was not handling correctly
recusrsive inclusions. Fix it.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-12-12 12:52:04 -06:00
Sebastian Bøe
c87d262295 size_report: Use the CMake-discovered toolchain instead of ENV vars
size_report was using the environment variables NM and OBJDUMP to find
it's toolchain dependencies. It is not clear how well this will work
on different platforms; OSX, Windows. So we now pass the paths of
these dependencies from the build system to the script.

PS: This ensures that size_report uses the cross-compiler's GNU bin
tool instead of the host GNU bin tools. This is presumably beneficial
as it has been required for other GNU bin tools like GDB.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-12-12 11:42:05 -05:00
Gustavo Lima Chaves
4be1db0aac cmake: jailhouse: fix check for JAILHOUSE_QEMU_IMG_FILE
Also remove old, now unused, makefile with previous logic on that.

Signed-off-by: Gustavo Lima Chaves <gustavo.lima.chaves@intel.com>
2017-12-12 09:31:31 -05:00
Anas Nashif
9c974b966c sanitycheck: allow placing parsetab.py in a custom dir
when running multiple instances of sanitycheck, allow placing the
parsetab.py in a customer location that can be set using an environment
variable.

export PARSETAB_DIR=/tmp/

run sanitycheck and the parsetab.py will be placed in /tmp/.

Fixes #4513

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-11 14:47:08 -05:00
Anas Nashif
4701f0190c sanitycheck: disable expr parser debug
Hide the annoying expr parser message on every run

 "Generating LALR tables"

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-11 14:47:08 -05:00
Anas Nashif
4d25b50c9c sanitycheck: remove usage of qemu for generic handlers
We have now different runners/handlers, so avoid using qemu terminology
for the generic classes and for generic usage.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-11 14:47:08 -05:00
Anas Nashif
f487699810 sanitycheck: descriptive variable names
Use qemu instead of q and make code more readable.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-11 14:47:08 -05:00
Anas Nashif
305a88eb00 sanitycheck: we do not need to pass ARCH= on command line
Passing ARCH during the build process is something from the past and
samples/tests should not do that, remove it here to catch any
violations.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-11 14:47:08 -05:00
Anas Nashif
ab74706e2c sanitycheck: remove platform-level option
Since the move to YAML format and the change in how we define default
platforms this is no longer needed as we are able to set multiple
default platforms per architecture and not using a list based on
priority anymore.

Fixes #4445

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-11 14:47:08 -05:00
Anas Nashif
877d3caee3 sanitycheck: reworked Platform/Architecture classes
Fix documentation of both classes and minor cleanup.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-11 14:47:08 -05:00
Anas Nashif
b4754ede52 sanitycheck: use test instead of section
The section terminology was relevant with the ini syntax, with yaml we
can call this a test and avoid confusion and make the code more
readable.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-11 14:47:08 -05:00
Anas Nashif
3ba1d43847 sanitycheck: flake8 fixes and move closer to pep8
run through flake8 and autopep8 scripts and cleanup as much as possible.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-11 14:47:08 -05:00
Anas Nashif
255625b0a3 sanitycheck: refactor data parsing in script
Simplify parsing of yaml structures and remove usage of cp which was for
the ConfigParser used for ini files.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-11 14:47:08 -05:00
Anas Nashif
bb3a27ca86 release: update sanitycheck footprint data
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-08 08:09:55 -05:00
Marti Bolivar
66d4d83db1 scripts: runner: nrfjprog: remove BOARD environment requirement
The BOARD variable has been removed from the environment provided to
runners. It's not being used to flash the board, so just remove the
check for it to avoid an exception at runtime.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-12-06 16:58:49 -06:00
Sebastian Bøe
abbdd88683 cmake: Fix EXTRA_LDFLAGS feature
It is supported to add give extra flags to the linker from the
commandline like this:

cmake -DEXTRA_LDFLAGS=-Lmy_dir path

But unfortunately this was broken during the CMake
migration. Interestingly, the reason that it was broken is that KBuild
was also partially broken. KBuild would pass on EXTRA_LDFLAGS when
object files were linked together into built-in.o files, but it would
not use EXTRA_LDFLAGS for the final link into an elf file.

This patch fixes EXTRA_LDFLAGS.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-12-05 08:39:43 -05:00
Sebastian Bøe
13a6840261 cmake: Re-organize syscall generation wrt. the build system
This commit fixes
https://github.com/zephyrproject-rtos/zephyr/issues/5008.

It does so by splitting up gen_syscalls.py into two scripts with a
json metadata file to communicate syscall metadata between them. The
parsing script parses header files from include/ and writes syscall
metadata to a file if the contents changed. The generation script
reads from the json file and generates syscall code.

The build system DAG now looks like this:

always_rebuild -> json -> syscalls -> offset.o

The script for generating json will do so only if the content changes,
this ensures that the entire DAG does not always do a full rebuild.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-12-04 10:51:07 -08:00
Andrew Boie
3ae644457e gen_syscall_header: create dummy handler refs
The core kernel is built with the --no-whole-archive linker option.
For all the individual .o files which make up the kernel, if there
are no external references to symbols within these object files,
everything in the object file is dropped.

This has a subtle interaction with system call handlers. If an object
file has system call handlers inside it, and nothing else in the
object file is referenced, then the linker will prefer the weak
version of the handler in the generated syscall_dispatch.c. The
user will get an "unimplemented system call" error if the associated
system call for that handler is made.

Fix this by making a fake reference to the handler function at the
system call site. The address gets stored inside a special section
"hndlr_ref".  This is enough to prevent the handlers from being
dropped, and the hndlr_ref section is itself dropped from the binary
from gc-sections; these references will not consume space.

Handlers for system calls that are never invoked anywhere will still be
dropped if nothing else in their containing C files is used, which is
a good thing. A future enhancement could be to split out all handlers
into individual object files, such that we can guarantee that any system
call that is not made somewhere in the application will have its handler
dropped. This will need to be extended to driver subsystems as well.
This won't be pretty but will ensure the tightest binary size.

Fixes #5184.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-11-29 14:18:20 -08:00
Anas Nashif
5fd499b3c6 sanitycheck: remove obsolete DISABLE_TRYRUN
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-28 15:31:27 -05:00
Anas Nashif
66bdb3223e sanitycheck: fix documentation and remove mention of kbuild
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-28 15:31:27 -05:00
Anas Nashif
c8390f1b49 sanitycheck: rename qemu_time to handler time
This can be used by other handlers and is defined in the main Handler
class. Qemu is just an implementer.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-28 15:31:27 -05:00
Anas Nashif
8b11a1f207 sanitycheck: use glob to find board yaml file
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-28 15:31:27 -05:00
Erwan Gouriou
104553d93f yaml: fix properties syntax to 'mapping' instead of 'series'
According to yaml syntaxic rules, 'properties' described in dts
bindings yaml files could be seen as 'mapping'(key/value couple),
instead of 'series' (list of single elements).
yaml 'mappings' will then be converted by yaml python library as
python 'dict' which will ease treatment (instead of current list
as were before this commit).
Same treatment is applied to 'inherits'.

script extract_dts_inlcude is updated to take change of yaml_list
structre into account. This allows some code simplification. Largest
impact is yaml_collapse function which works now allow complete
overload method on all the attributes of a yaml nodes.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-11-28 11:42:59 -06:00
Anas Nashif
f48dda0f0f ci: verify author identity
Make sure committers have correct and valid git settings and verify that
the committer idenity matches one of the signed-off-by entries.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-24 10:21:53 -05:00
Maureen Helm
2358df2647 scripts: jlink: Don't reset after load
The mimxrt1052 does not have any internal flash, therefore a reset after
load blows away the code when loaded into sram. Reverse the order of the
jlink commands such that the load follows the reset.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-11-15 09:09:58 -06:00
Kumar Gala
5fe74ca1ce scripts: zephyr_flash_debug: Cleanup the script argument usage
The script argument isn't really a path, so stop assuming that it is
one.  We still use the shell script name at this point, but there isn't
any actual shell script in the system.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-11-14 12:07:44 -06:00
Paul Sokolovsky
3ba0876a3f sanitycheck: Flush stdout in info()
This makes piped output work as the user expects. And looking at the
piped output is the only way to use sanitycheck normally because
of #4603.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-11-13 19:31:19 -05:00
Anas Nashif
539d2af654 flash: support flashing multiple configurations of a single board
Some boards define multiple configuration which all are maintained under
the same board directory. The flasher was looking for an openocd.cfg
based on the board name, which can't be found for such boards.

Use the variable BOARD_DIR provided by cmake instead of trying to
assemble the board directory location on our own.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-13 10:55:26 -05:00
Anas Nashif
934a8cb077 flasher: remove obsolete KBUILD_VERBOSE
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-13 10:55:26 -05:00
Anas Nashif
5eddb087f0 flash: fix arc flasher script
We do not need python defined, we are running in python already.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-13 10:55:26 -05:00
Sebastian Bøe
c218261a33 sanitycheck: Fixed documentation for --extra-args and extra_args
sanitycheck was incorrectly documenting that --extra-args would pass
on it's input unchanged to Make.

In reality --extra-args acts as a way to define extra CMake cache
entries. The key-value entries will be prefixed with -D before being
passed to CMake.

E.g
"sanitycheck -x=USE_CCACHE=0"
will translate to
"cmake -DUSE_CCACHE=0"

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-09 17:55:30 -05:00
Sebastian Bøe
71d7de01ef sanitycheck: Minor internal documentation fixes
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-09 17:55:30 -05:00
Sebastian Bøe
781e39887c sanitycheck: Remove the --ccache option from sanitycheck
The --ccache option will be replaced by another mechanism.

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-09 17:55:30 -05:00
Sebastian Bøe
0829ddfe9a kbuild: Removed KBuild
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Anas Nashif
f9a70a862d kconfig: fix Qt header for building Qt based kconfig
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-08 20:00:22 -05:00
Anas Nashif
fb91ad6b88 sanitycheck: adapt for cmake
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-08 20:00:22 -05:00
Sebastian Bøe
12f8f76165 Introduce cmake-based rewrite of KBuild
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.

Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.

This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.

For users that just want to continue their work with minimal
disruption the following should suffice:

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..

$ cd build
$ make

PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Marti Bolivar
682a207409 scripts: runner: core: fix stale comments
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-11-07 15:43:55 -05:00
Marti Bolivar
2d21300a50 scripts: runner: core: fix comment typo
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-11-07 15:43:55 -05:00
Marti Bolivar
208526d340 scripts: runner: use ss on linux, not netstat
Netstat is deprecated.

Reported-by: Leandro Pereira <leandro.pereira@intel.com>
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-11-07 15:43:55 -05:00
Andrew Boie
b3227fa614 gen_mmu_x86.py: decrease verbosity
Dumping out the entire page table contents is extremely spammy.
Don't do this unless --verbose is passed twice.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-11-07 09:31:49 -08:00
Andrew Boie
a705eae315 gen_gdt: add debug statements and simplify logic
This is in preparation for making CONFIG_USERSPACE not
depend on CONFIG_HW_STACK_PROTECTION.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-11-07 09:31:49 -08:00
Gustavo Lima Chaves
56922d92fb x86: add new board to accomodate Jailhouse port
The port will enable Zephyr to run as a guest OS on x86-64 systems. It
comes with a test on QEMU to validate that, thus this new board
introduction. It's "make run" target will issue QEMU with the same
configuration Jailhouse upstream uses for their confis/qemu-x86.c root
cell configuration:

  Test configuration for QEMU Q35 VM, 1 GB RAM, 4 cores,
  6 MB hypervisor, 60 MB inmates (-4K shared mem device)

This will work provided qemu-system-x86_64 is installed in the system
and a given (qcow2) image with the Jailhouse root cell in it is
provided (any of those will ever ship with Zephyr, it's out of its
scope).

Signed-off-by: Gustavo Lima Chaves <gustavo.lima.chaves@intel.com>
2017-11-07 08:58:49 -05:00
Andrew Boie
818a96d3af userspace: assign thread IDs at build time
Kernel object metadata had an extra data field added recently to
store bounds for stack objects. Use this data field to assign
IDs to thread objects at build time. This has numerous advantages:

* Threads can be granted permissions on kernel objects before the
  thread is initialized. Previously, it was necessary to call
  k_thread_create() with a K_FOREVER delay, assign permissions, then
  start the thread. Permissions are still completely cleared when
  a thread exits.

* No need for runtime logic to manage thread IDs

* Build error if CONFIG_MAX_THREAD_BYTES is set too low

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-11-03 11:29:23 -07:00
Jan Kiszka
283a0cdafb x86: MMU: Rename gen_mmu script
It's x86-only.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2017-11-03 09:29:39 -07:00
Jan Kiszka
19fdc30187 x86: MMU: Remove dead code from gen_mmu.py
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2017-11-03 09:29:39 -07:00
Jan Kiszka
5ae79d0f66 x86: MMU: Fix PAE page directory permissions
Do not set XD at page directory level - some leaf PTE may have it
cleared.

Fixes: d1703691c8 ("x86: MMU: Generation of PAE tables")

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2017-11-03 09:29:39 -07:00
Anas Nashif
440087e388 checkpatch: add NANO_ESF as a typedef to avoid spacing errors
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-03 10:29:41 -04:00
Leandro Pereira
da9b0ddf5b drivers: Rename random to entropy
This should clear up some of the confusion with random number
generators and drivers that obtain entropy from the hardware.  Also,
many hardware number generators have limited bandwidth, so it's natural
for their output to be only used for seeding a random number generator.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-11-01 08:26:29 -04:00
Anas Nashif
8fe8df23ba scripts: require python module wheel
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-31 12:32:34 -04:00
Andrew Boie
e5b3918a9f userspace: remove some driver object types
Use-cases for these  subsystems appear to be limited to board/SOC
code, network stacks, or other drivers, no need to expose to
userspace at this time. If we change our minds it's easy enough
to add them back.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-30 13:20:19 -07:00
Marti Bolivar
81f2d21fac build: remove flash/debug shell scripts
The functionality of the shell scripts for flashing and debugging has
now been replaced by zephyr_flash_debug.py. Remove the legacy scripts
as part of transitioning all of this to Python.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:31:22 -04:00
Marti Bolivar
a9aec55588 scripts: runner: add qemu.py, a stand-in for QEMU
This, like the shell script, is just a placeholder.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:31:22 -04:00
Marti Bolivar
d4d7cc72ee scripts: runner: add xtensa.py, with debug support
This is debug only, not debugserver.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:31:22 -04:00
Marti Bolivar
f13390e22b scripts: runner: add jlink.py, with debug and debugserver support
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:31:22 -04:00
Marti Bolivar
4732b96ae8 scripts: runner: add debug support to nios.py
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:31:22 -04:00
Marti Bolivar
10409099f9 scripts: runner: add network port helper class
Some of the flashing scripts try to be clever about picking unused
ports. That's convenient for the user, so add a helper class to
runner.core to accomplish similar ends portably.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:31:22 -04:00
Marti Bolivar
32b475ebb9 scripts: zephyr_flash_debug: refactor into new "runner" package
Factor the classes which do the work into a new "runner" package. This
package has a core module where ZephyrBinaryRunner and common helpers
will live, and one file per subclass / runner front-end.

The top-level script, zephyr_flash_debug.py, still exists, but just
delegates its work to the core.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:31:22 -04:00
Marti Bolivar
12802cf36e scripts: zephyr_flash_debug: improve debug logging
Ensure that the printed commands can be copy/pasted into a shell with
the same semantics.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:31:22 -04:00
Marti Bolivar
ade65bd055 scripts: zephyr_flash_debug: get bossac port from environment
Allow the environment variable BOSSAC_PORT to specify the device's
serial port, if present.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:31:22 -04:00
Marti Bolivar
f6c42cd7bc scripts: zephyr_flash_debug: fix Nios II comment
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:31:22 -04:00
Marti Bolivar
b5a78f1161 scripts: zephyr_flash_debug: refactor Nios II runner
Prep work for adding debug and debugserver support. No significant
functional differences.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:31:22 -04:00
Marti Bolivar
90c0cfdc81 scripts: zephyr_flash_debug: add debug support to pyocd
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:31:22 -04:00
Marti Bolivar
9cf7d106f1 scripts: zephyr_flash_debug: refactor pyocd runner
Prep work for adding debug and debugserver support. No significant
functional differences.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:31:22 -04:00
Marti Bolivar
77c2ef54f5 scripts: zephyr_flash_debug: add debug support to openocd
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:31:22 -04:00
Marti Bolivar
4a665366d9 scripts: zephyr_flash_debug: refactor openocd runner
Preparatory work for supporting debugging and flashing. No significant
behavioral changes.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:31:22 -04:00
Marti Bolivar
9224b54105 scripts: zephyr_flash_debug: fix ARC OPENOCD_EXTRA_INIT
Though it isn't used by any in-tree Makefile.boards, looking at the
RIOT OS build system, this is meant to be split along lexical
boundaries defined by the shell, not just whitespace.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:31:22 -04:00
Marti Bolivar
9e619b0d26 scripts: zephyr_flash_debug: make ARC runner portable
Use run_client_and_server() to work across supported platforms.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:31:22 -04:00
Marti Bolivar
3e01cef06f scripts: zephyr_flash_debug: teach runners a client/server abstraction
Several debugging scripts run setsid before executing a server
process, then run GDB with SIGINT ignored.

Relying on setsid is not portable. Add a popen_ignore_int() helper
that provides a portable alternative, and provide a generic
run_server_and_client() in ZephyrBinaryRunner which uses it to
abstract the pattern.

Subsequent patches will use this to implement the 'debug' command.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:31:22 -04:00
Marti Bolivar
45440be89e scripts: zephyr_flash_debug: debug like arc_debugger.sh
Add debug and debugserver support.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:31:22 -04:00
Marti Bolivar
8ceb7ca385 scripts: zephyr_flash_debug: add missing nrfjprog line
The --pinreset line from the shell script is missing.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:31:22 -04:00
Marti Bolivar
fbe2fcda88 scripts: zephyr_flash_debug: generalize to support debugging
Replace the 'flash' method with a 'run' method, which takes a command
to run (flash, debug, or debugserver).

Rename the classes involved appropriately, and generalize the factory
interfaces as needed.

Add documentation and theory of ops.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:31:22 -04:00
Anas Nashif
789d51c4aa ci: do not treat message parts as xml
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-28 09:00:50 -04:00
Andrew Boie
8c20db7d44 sanitycheck: tone down verbose output
We only had a few hundred tests run when sanitycheck was first written,
and printing out the reasoning why tests were skipped seemed reasonable
at the time. Now that we are running tens of thousands of tests, this
is too much information.

The dump of what tests were skipped and why now requires two instances
of --verbose on the command line.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-27 10:55:12 -07:00
Kumar Gala
1f0c60cd4b bossa: add support for specifying the port
Now that we have a newer version of bossa in the SDK we can use a
version where there -p option works properly.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-10-25 03:55:15 +02:00
Adithya Baglody
d1703691c8 x86: MMU: Generation of PAE tables
If CONFIG_X86_PAE_MODE is enabled for the build, then gen_mmu.py
would generate the boot time page tables in PAE format.
This supports 3 level paging i.e Page Directory Pointer(PDPT), Page
Directory(PD) and Page Table(PT). Each Page Table Entry(PTE) maps to
a 4KB region. Each Page Directory Entry(PDE) maps a 2MB region.
Each Page Directory Pointer Entry(PDPTE) maps to a 1GB region.

JIRA: ZEP-2511

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2017-10-23 10:13:07 -07:00
Kumar Gala
03fb9ff5f9 scripts/dts/extract_dts_includes.py: Cleanup yaml file finding
Cleanup how we find the yaml files for device tree bindings.  Move to a
recursive dir search of the dts/ dir.  This will be useful for
supporting re-organizing of the yaml files to match binding dir
structure.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-10-23 15:02:00 +02:00
Anas Nashif
f35002c04d ci: fix encoding of documentation warning file
The file was opened as text, to avoid issues with UTF-8 in the future,
make it all binary and encode to UTF-8 correctly.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-20 15:53:17 -04:00
Leandro Pereira
1d38d98284 scripts: Fix ESP_TOOL detection in zephyr_flash_debug.py
`espidf` was written as `espdif`, causing auto-detection to fail.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-10-19 17:13:59 -04:00
Marti Bolivar
a22a7fe1f8 scripts: zephyr_flash_debug: fix PYOCD_DAPARG
The environment variable is PYOCD_DAPARG, not PYOCD_DAPARG_ARG.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-18 15:24:38 -04:00
Andrew Boie
877f82e847 userspace: add K_THREAD_ACCCESS_GRANT()
It's possible to declare static threads that start up as K_USER,
but these threads can't do much since they start with permissions on
no kernel objects other than their own thread object.

Rather than do some run-time synchronization to have some other thread
grant the necessary permissions, we introduce macros
to conveniently assign object permissions to these threads when they
are brought up at boot by the kernel. The tables generated here
are constant and live in ROM when possible.

Example usage:

K_THREAD_DEFINE(my_thread, STACK_SIZE, my_thread_entry,
                NULL, NULL, NULL, 0, K_USER, K_NO_WAIT);

K_THREAD_ACCESS_GRANT(my_thread, &my_sem, &my_mutex, &my_pipe);

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-18 07:37:38 -07:00
Anas Nashif
981f77f756 sanitycheck: fix extra_configs with multiple values
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-18 08:33:03 -04:00
Anas Nashif
ebc329dc30 doc: document extra_configs option for testcases
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-17 14:13:52 -04:00
Anas Nashif
fa695d2b9e sanitycheck: add extra_configs for testing with multiple values
Support new keywords in testcase.yaml that would allow us to inject
configuration options to be merged with default configuration instead of
having to provide a prj.conf for each variant of the test which is very
difficult to keep in sync.  Sanitycheck script will create an overlay
file that is merged during the build process.

This is now done using the extra_configs option which is a yaml list of
option with the values, for example:

 extra_configs:
   - CONFIG_XXXX=y
   - CONFIG_YYYY=y

With this option we can have multiple tests that for example run on
hardware with different values. This type of testing is good on HW but
it does not make sense to be built in normal sanitycheck operation
because it will be just rebuilding the same code with different values.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-17 08:55:38 -04:00
Andrew Boie
bca15da650 userspace: treat thread stacks as kernel objects
We need to track permission on stack memory regions like we do
with other kernel objects. We want stacks to live in a memory
area that is outside the scope of memory domain permission
management. We need to be able track what stacks are in use,
and what stacks may be used by user threads trying to call
k_thread_create().

Some special handling is needed because thread stacks appear as
variously-sized arrays of struct _k_thread_stack_element which is
just a char. We need the entire array to be considered an object,
but also properly handle arrays of stacks.

Validation of stacks also requires that the bounds of the stack
are not exceeded. Various approaches were considered. Storing
the size in some header region of the stack itself would not allow
the stack to live in 'noinit'. Having a stack object be a data
structure that points to the stack buffer would confound our
current APIs for declaring stacks as arrays or struct members.
In the end, the struct _k_object was extended to store this size.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-16 19:02:00 -07:00
Andrew Boie
c5354552ce gen_syscall_header: use compiler barrier
We need to enforce that if the implementation function is inlined,
and we are using a syscall declaration macro where a runtime check
is performed, that all memory access in the inlined implementation
function is done after the user context check is performed.

Fixes bad memory access issues observed due to the compiler fetching
member data from a kernel object when the calling context was in
user mode.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-16 16:16:56 -07:00
Andrew Boie
ac1db4f08a sanitycheck: add last_sanity.xml to gitignore
This file is otherwise polluting the tree after doing a
sanitycheck run.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-14 19:22:55 -04:00
Andrew Boie
47f8fd1d4d kernel: add K_INHERIT_PERMS flag
By default, threads are created only having access to their own thread
object and nothing else. This new flag to k_thread_create() gives the
thread access to all objects that the parent had at the time it was
created, with the exception of the parent thread itself.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-13 12:17:13 -07:00
Marti Bolivar
a645257988 fix "scripts: zephyr_flash_debug: flash like dfuutil.sh"
- When flashing with dfu-util while alt is not a number, the name must
  be quoted.

- Add missing commas in self.list_pattern

- Always call dfu-util with the VID/PID

Fixes: 257fa4af9 ("scripts: zephyr_flash_debug: flash like dfuutil.sh")
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-13 12:50:40 -04:00
Marti Bolivar
73d560e412 fix "scripts: zephyr_flash_debug: flash like openocd.sh"
All commands need to have quotation marks stripped.

Fixes: bee6f9e73 ("scripts: zephyr_flash_debug: flash like openocd.sh")
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-13 12:50:40 -04:00
Marti Bolivar
b1e6ea27a7 scripts: zephyr_flash_debug: flash like arc_debugger.sh
Only tested by comparing commands that would be run.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-12 23:53:20 -07:00
Marti Bolivar
cdffad214f scripts: zephyr_flash_debug: flash like nios2.sh
Only tested by comparing commands that would be run.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-12 23:53:20 -07:00
Marti Bolivar
bee6f9e73e scripts: zephyr_flash_debug: flash like openocd.sh
Add support for flashing targets compatible with openocd.sh.

Tested on disco_l475_iot1.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-12 23:53:20 -07:00
Marti Bolivar
61aa0e06f5 scripts: zephyr_flash_debug: flash like nrf_flash.sh
Add support for flashing targets compatible with nrf_flash.sh.

Tested on nrf52840_pca10056.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-12 23:53:20 -07:00
Marti Bolivar
1126523396 scripts: zephyr_flash_debug: flash like esp32.sh
Add support for flashing targets compatible with esp32.sh.

Only tested by comparing commands that would be run.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-12 23:53:20 -07:00
Marti Bolivar
289c0f0304 scripts: zephyr_flash_debug: flash like bossa-flash.sh
Add support for flashing targets compatible with bossa-flash.sh.

This is something of a bug-for-bug reimplementation, as the existing
flashing script makes some potentially unsafe assumptions.

Only tested by comparing commands that would be run.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-12 23:53:20 -07:00
Marti Bolivar
4bfbe251ea scripts: zephyr_flash_debug: flash like pyocd.sh
Add support for flashing targets compatible with pyocd.sh.

Tested on 96b_nitrogen, nrf52_blenano2, and frdm_k64f, with and
without PYOCD_BOARD_ID. Additionally, frdm_k64f was tested with
PYOCD_DAPARG_ARG='limit_packets=True'.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-12 23:53:20 -07:00
Marti Bolivar
257fa4af90 scripts: zephyr_flash_debug: flash like dfuutil.sh
Add support for flashing targets compatible with dfuutil.sh.

Tested on 96b_carbon.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-12 23:53:20 -07:00
Marti Bolivar
113ee65b89 build: interpose zephyr_flash_debug.py in flash target
Zephyr board flashing and debugging is done via shell scripts. It
would improve the CMake transition to remove the shell dependency.

Add zephyr_flash_debug.py to allow phasing out the shell scripts.
This takes two arguments:

- a command (eventually flash, debug, and debugserver, but just flash
  for now)

- the path to the corresponding shell script

zephyr_flash_debug.py runs the command in pure Python if it
knows how. Otherwise, it falls back on the shell script. In
this patch, it always falls back. Subsequent patches add support
for existing flash backends.

Invoke zephyr_flash_debug.py from the Makefile flash target, but only
if USE_ZEPHYR_FLASH_DEBUG_SHELL is empty. This lets users keep existing
behavior in case of issues, and can be removed later once the Python
script is more widely tested.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-12 23:53:20 -07:00
Andrew Boie
3ff41b9484 kernel: allow system call with 64-bit return val
This is subject to the constraint that such system calls must have a
return value which is "u64_t" or "s64_t".

So far all the relevant kernel calls just have zero or one arguments,
we can later add more _syscall_ret64_invokeN() APIs as needed.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-12 16:25:00 -07:00
Anas Nashif
2516d6e509 toolchains: fix xtools configurations
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-12 16:27:12 -05:00
Anas Nashif
7bd98a09d5 ci: compliance: decode output to utf8
Fixes GH-1580.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-12 08:47:14 -04:00
Andrew Boie
6093a94454 gen_kobject_list: fix on ARM targets
On ARM, a zero memory address actually falls within the expected bounds
of kernel memory.

Move the NULL check outside the bounds check, so that kernel objects
with NULL memory addresses in the DWARF info (because gc-sections
discarded them) won't confound the script's logic.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-11 15:39:08 -07:00
Anas Nashif
86c8e2330d sanitycheck: fix support for unit tests
When we moved to yaml, we missed porting the 'unit' architecture. This
is now being added again.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-11 09:21:05 -05:00
Anas Nashif
7fae29c711 sanitycheck: inifile -> yamlfile
because we do not use ini files anymore, to avoid confusion, rename this
to be yamlfile, which is the format we use for testcases now.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-11 09:21:05 -05:00
Andrew Boie
a949b50fe7 syscalls: rename __ZEPHYR_KERNEL__
__ZEPHYR_SUPERVISOR__ more accurately represents what this means: that
the code is intended for scenarios when the CPU is expected to be
running in supervisor (privileged) mode. This could be in the kernel or
in the application.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-10 22:42:06 -04:00
Maureen Helm
9c390d7655 scripts: Add support for passing daparg argument to pyocd commands
pyocd occasionally throws USB timeout exceptions when running in
VirtualBox, and recently added a command-line option to limit the USB
packet count as a workaround. Introduce an environment variable
PYOCD_DAPARG so Zephyr can pass the argument to pyocd. For example:

$ make BOARD=frdm_k64f PYOCD_DAPARG='limit_packets=True' flash

This workound comes with a performance penalty when flashing and
debugging with pyocd, so it should only be used when running pyocd in
VirtualBox.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-10-10 11:56:47 -05:00
Anas Nashif
a8d259939b checkpatch: define typedefsfile to deal with a few false positives
checkpatch expects typedefs to be suffixed with _t and has different
rules when typedefs are being used as arguments of a function. This
seems to be a known issue and defining typedefs in a file resolves this
issue.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-09 10:43:05 -04:00
Andrew Boie
6cdc8e90a1 xtools: fix some build issues
$DTC wasn't exported, causing a build failure if it wasn't
defined outside the build system.

The provided ct-ng configuration files define
CT_TARGET_VENDOR="zephyr". Fix CROSS_COMPILE definition so
that the compiler can be found.

Change-Id: I4e25c775e1f02a435704b6a874adb221c677b13a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-09 09:10:39 -04:00
Andrew Boie
c74983e8b4 kernel: remove some kernel objects from tracking
These are removed as the APIs that use them are not suitable for
exporting to userspace.

- Kernel workqueues run in supervisor mode, so it would not be
appropriate to allow user threads to submit work to them. A future
enhancement may extend or introduce parallel API where the workqueue
threads may run in user mode (or leave as an exercise to the user).

- Kernel slabs store private bookkeeping data inside the
user-accessible slab buffers themselves. Alternate APIs are planned
here for managing slabs of kernel objects, implemented within the
runtime library and not the kernel.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-07 10:45:15 -07:00
Andrew Boie
990bf16206 kernel: abolish __syscall_inline
This used to exist because in earlier versions of the system call
interfaces, an "extern" declaration of the system call implementation
function would precede the real inline version of the implementation.
The compiler would not like this and would throw "static declaration
of ‘foo’ follows non-static declaration". So alternate macros were
needed which declare the implementation function as 'static inline'
instead of extern.

However, currently the inline version of these system call
implementations appear first, the K_SYSCALL_DECLARE() macros appear in
the header generated by gen_syscalls.py, which is always included at the
end of the header file. The compiler does not complain if a
static inline function is succeeded by an extern prototype of the
same function. This lets us simplify the generated system call
macros and just use __syscall everywhere.

The disassembly of this was checked on x86 to ensure that for
kernel-only or CONFIG_USERSPACE=n scenarios, everything is still being
inlined as expected.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-03 16:16:03 -04:00
Paul Sokolovsky
94620bdb0b scripts: gen_syscalls: Use explicit encoding when reading headers
In Python, if open() doesn't specify "encoding" parameter,
locale.getpreferredencoding(False) will be used as the default,
as explained in
https://docs.python.org/3/library/functions.html#open ,
which may differ from system to system. So, explicitly specify
"encoding" param in open() call.

Also, fix a typo in a comment.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-03 10:07:41 -07:00
Anas Nashif
1eb244cf6c scripts: Update checkpatch to latest from the linux kernel
This is pulled from commit a8c964eacb21288b2dbfa9d80cee5968a3b8fb21 of
the Linux kernel with local zephyr related modifications.

Fixes #4135.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-02 18:48:56 -04:00
Inaky Perez-Gonzalez
b37bcf2fc0 scrips/merge_config.sh: fix corner case \n-less last line
When a configuration file fragment ends in a line that is not
terminated by a \n, it will mange the pasting of the following
fragment. For example, in file1.prj:

  CONFIG_SETTING_A=34
  CONFIG_SETTING_B=12

and file2.prj:

  CONFIG_SETTING_C=56

would become:

  CONFIG_SETTING_A=34
  CONFIG_SETTING_B=12CONFIG_SETTING_C=56

because there was no \n at the end of CONFIG_SETTING_B=12. This makes
the kconfig parser to reject CONFIG_SETTING_B and to loose
CONFIG_SETTING_C, which then has random consequences.

So, to avoid that problem, always add a newline after a config fragment.

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-09-30 22:42:08 -04:00
Andrew Boie
9928023421 kernel: make 'static inline' implicit to __syscall
The fact that these are all static inline functions internally is an
implementation detail.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-09-29 15:09:44 -07:00
Andrew Boie
5bd891d3b6 gen_kobject_list.py: device driver support
Device drivers need to be treated like other kernel objects, with
thread-level permissions and validation of struct device pointers passed
in from userspace when making API calls.

However it's not sufficient to identify an object as a driver, we need
to know what subsystem it belongs to (if any) so that userspace cannot,
for example, make Ethernet driver API calls using a UART driver object.

Upon encountering a variable representing a device struct, we look at
the value of its driver_api member. If that corresponds to an instance
of a driver API struct belonging to a known subsystem, the proper
K_OBJ_DRIVER_* enumeration type will be associated with this device in
the generated gperf table.

If there is no API struct or it doesn't correspond to a known subsystem,
the device is omitted from the table; it's presumably used internally
by the kernel or is a singleton with specific APIs for it that do not
take a struct device parameter.

The list of kobjects and subsystems in the script is simplified since
the enumeration type name is strongly derived from the name of the data
structure.

A device object is marked as initialized after its init function has
been run at boot.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-09-29 13:25:58 -07:00
Andrew Boie
fa94ee7460 syscalls: greatly simplify system call declaration
To define a system call, it's now sufficient to simply tag the inline
prototype with "__syscall" or "__syscall_inline" and include a special
generated header at the end of the header file.

The system call dispatch table and enumeration of system call IDs is now
automatically generated.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-09-29 13:02:20 -07:00
Kumar Gala
bc6c262122 build: Makefile.gen: reorder make rules to deal with greedy rule match
Some versions of make seem to more greedy about how they match
$(notdir %).inc vs $(notdir %).gz.inc.  If we put the gz.inc rule first
that seems to deal with the issue.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-09-28 09:29:34 -07:00
Andrew Boie
1d3731f1e5 gen_syscall_header.py: script to generate macros
This header could be maintained by hand since there are no inputs
and it only changes if the generating script is modified, but given
the choice to maintain 800-ish lines of extremely repetitive C
preprocessor code, or 100-ish lines of Python, the choice is pretty
clear.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-09-28 08:56:20 -07:00
Anas Nashif
66f1f89da9 qemu: cleanup qemu configurations
Move all QEMU related defines to the boards and cleanup xtensa platforms
which were marked to be QEMU capable by mistake.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-23 16:51:20 -07:00
David B. Kinder
c727923496 doc: filter-known-issues.py and empty files
filter-known-issues (used to remove "expected" messages from log files
during doc and test builds) now properly handles an empty log file
(there won't be anything to filter).

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-09-21 16:58:17 -04:00
Andrew Boie
df5cc172f4 gen_mmu.py: load directly
On most workstations this was unintentionally being run under Python 2.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-09-21 13:27:25 -04:00
Anas Nashif
eb756c5d1a build: remove leftover qemu target
Fixes GH-1522

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-19 10:54:31 -04:00
Jukka Rissanen
0ff4c25958 build: Add rules in Makefile.gen to generate a hex file
This commit is useful if there is a need to generate a file
that can be included into the application at build time.
The file can also be compressed automatically when embedding it.

Files to be generated are listed in
     generate_inc_file
     generate_inc_gz_file
variables.

How to use this commit in your application:

1. Add this to your application Makefile

   SRC = $(ZEPHYR_BASE)/<your-app-dir>/src
   include $(ZEPHYR_BASE)/scripts/Makefile.gen

2. Add needed binary/other embedded files into src/Makefile
   to "generate_inc_file" or "generate_inc_gz_file" variables:

   # List of files that are used to generate a file that can be
   # included into .c file.
   generate_inc_file += \
           echo-apps-cert.der \
           echo-apps-key.der \
           file.bin

   generate_inc_gz_file += \
           index.html

   include $(ZEPHYR_BASE)/scripts/Makefile.gen

3. In the application, do something with the embedded file

   static const unsigned char inc_file[] = {
   #include "file.bin.inc"
   };

   static const unsigned char gz_inc_file[] = {
   #include "index.html.gz.inc"
   };

The generated files in ${SRC}/*.inc are automatically removed
when you do "make pristine"

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-09-18 14:56:16 -04:00
Kumar Gala
aed577a853 scripts/dts/extract_dts_includes.py: allow multiple fixup files
Allow the script to take multiple -f (fixup) file options.  We output
the fixup files in order that the -f options are passed.  This will
allow us to have a common soc fixup and board fixup if we desire.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-09-17 17:34:38 -04:00
Aska Wu
729a7b1e84 scripts/dts/extract_dts_includes.py: Fix tab calculation
If there's any key in the alias which length is larger than other keys
in the node, the include file will be incorrect, there will be no tab
between the key and value.

We need to take into account the max length of alias keys.

Signed-off-by: Aska Wu <aska.wu@linaro.org>
2017-09-17 16:51:16 -04:00
Anas Nashif
541f791fad ci: compliance script should use python3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-12 19:01:58 -04:00
Anas Nashif
bd166f4903 sanitycheck: save/load lists of filterd tests
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-12 18:13:46 -04:00
Anas Nashif
70783cab60 sanitycheck: rename arch_root -> board_root
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-12 18:13:46 -04:00
Andrew Boie
424e993b41 x86: implement userspace APIs
- _arch_user_mode_enter() implemented
- _arch_is_user_context() implemented
- _new_thread() will honor K_USER option if passed in
- System call triggering macros implemented
- _thread_entry_wrapper moved and now looks for the next function to
call in EDI

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-09-12 12:46:36 -07:00
Anas Nashif
1e8afbfe5a cleanup: remove lots of references to unified kernel
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-12 12:37:11 -04:00
Anas Nashif
83134d9531 scripts: move kconfig related scripts to scripts/kconfig
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-11 08:53:56 -07:00
Anas Nashif
9186b6801c scripts: move checkpatch scripts to checkpatch/
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-11 08:53:56 -07:00
Anas Nashif
38625607b1 scripts: move footprint scripts to footprint/
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-11 08:53:56 -07:00
Anas Nashif
3461c8cf59 scripts: move dts related scripts to scripts/dts/
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-11 08:53:56 -07:00
Anas Nashif
db3d55ff1b sanitycheck: move all related files to sanity_chk
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-11 08:53:56 -07:00
Anas Nashif
63d418f0da scripts: move GRUB script to galileo
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-11 08:53:56 -07:00
Anas Nashif
c2de83c32f misc: remove MAINTAINERS file
Remove MAINTAINERS in favor of CODEOWNERS file which is supported by
github. Also remove scripts using this file and change checkpatch to
reference CODEOWNERS instead.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-08 15:08:18 -04:00
Andrew Boie
54ffae7940 gen_mmu.py: Ignore 0-sized regions
Prevents overlapping region errors when enabling application memory
but there is nothing to put in application data.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-09-07 16:35:59 -07:00
Andrew Boie
945af95f42 kernel: introduce object validation mechanism
All system calls made from userspace which involve pointers to kernel
objects (including device drivers) will need to have those pointers
validated; userspace should never be able to crash the kernel by passing
it garbage.

The actual validation with _k_object_validate() will be in the system
call receiver code, which doesn't exist yet.

- CONFIG_USERSPACE introduced. We are somewhat far away from having an
  end-to-end implementation, but at least need a Kconfig symbol to
  guard the incoming code with. Formal documentation doesn't exist yet
  either, but will appear later down the road once the implementation is
  mostly finalized.

- In the memory region for RAM, the data section has been moved last,
  past bss and noinit. This ensures that inserting generated tables
  with addresses of kernel objects does not change the addresses of
  those objects (which would make the table invalid)

- The DWARF debug information in the generated ELF binary is parsed to
  fetch the locations of all kernel objects and pass this to gperf to
  create a perfect hash table of their memory addresses.

- The generated gperf code doesn't know that we are exclusively working
  with memory addresses and uses memory inefficently. A post-processing
  script process_gperf.py adjusts the generated code before it is
  compiled to work with pointer values directly and not strings
  containing them.

- _k_object_init() calls inserted into the init functions for the set of
  kernel object types we are going to support so far

Issue: ZEP-2187
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-09-07 16:33:33 -07:00
Andrew Boie
3ef0b56c15 sanitycheck: fix rw_sections whitespace
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-09-07 16:33:33 -07:00
Anas Nashif
7015b7e5ea release: sanitycheck: update footprint data
Reset the baseline for the new release. This is used by the sanitycheck.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-07 12:29:23 -05:00
Andy Gross
ad704937ff scripts/extract_dts_includes.py: Allow for includes in common yaml files
This patch adds the capability to include yaml files in other yaml
files that reside in dts/common/yaml.

Fixes #1149

Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-08-18 08:55:31 -05:00
Anas Nashif
593f6d4a1b boards: qemu_xtensa: this is not supported by xcc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-16 13:05:54 -04:00
Anas Nashif
e783179948 sanitycheck: add espressif as a supported toolchain
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-14 19:14:59 -04:00
Anas Nashif
6222418337 sanitycheck: fix RAM check
make this consistent with flash size check. This issue caused platforms
with 8k to be completelty ignored.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-14 13:28:42 -04:00
Anas Nashif
c1cafb1f50 ci: run more tests on boards that have changed
Check if any board files have changed and build more tests with this
board to uncover any build regressions.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-14 13:28:42 -04:00
Maureen Helm
61c5c2382b scripts: Run JLinkGDBServer in silent mode
The JLinkGDBServer was printing log messages that messed with debugging
in -tui mode. Run it in silent mode instead.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-08-11 11:21:46 -04:00
Johan Hedberg
2975ca0754 Bluetooth: Kconfig: Rename CONFIG_BLUETOOTH_* to CONFIG_BT_*
The API name space for Bluetooth is bt_* and BT_* so it makes sense to
align the Kconfig name space with this. The additional benefit is that
this also makes the names shorter. It is also in line with what Linux
uses for Bluetooth Kconfig entries.

Some Bluetooth-related Networking Kconfig defines are renamed as well
in order to be consistent, such as NET_L2_BLUETOOTH.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-08-09 11:14:19 +03:00
Anas Nashif
87766a25c6 gitlint: ignore titles prefixed with Revert
The revert commit title is usually prefixed with "Revert" which causes
the title to become longer than the allowed limit. Allow such commits to
keep revert commits consistent with the original commit message.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-08 09:04:25 -04:00
Anas Nashif
408a61d42b gitlint: tolerate long lines with URLs
When including referecnes to external resources using a URL, keep the
line with URL in one line to not break the link and allow this to pass
the gitlint test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-08 09:04:25 -04:00
Inaky Perez-Gonzalez
662dde6675 sanitycheck: validate YAML files w/ schemas files
This introduces an schema-based YAML validation process when loading
any YAML file, before doing any operations on them. An exception will
be raised at SanityConfigParser() if the file fails to verify with the
given schema.

Schemas are defined for the platform files in board///*.yaml and for
the (sample|testcase).yaml files. The verification is done using the
pykwalify python library. If not installed, a warning is printed and
the verification schema is skipped. At some point, we might want to
force it being installed.

The verification library is made a separate module (scl.py) so it can
be easily imported by others.

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-08-07 21:19:12 -04:00
Sebastian Bøe
d3409c5e67 doc: scripts: sanitycheck: s/ini/yaml/
AFAIK an ini file system was ported to a yaml file system. But some
ini file references still remain.

This patch changes all ini file mentions into yaml.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-08-07 12:58:49 -04:00
Anas Nashif
3ac7b3a229 doc: qemu target was deprecated, use 'run'
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-03 11:48:55 -04:00
Andrew Boie
0f16d98b32 x86: mmu: add runtime modification indicator
The CPU first checks the page directory entry for write
or user permissions on a particular page before looking
at the page table entry.

If a region configured all pages to be non user accessible,
and this was changed for a page within it to be accessible,
the PDE would not be updated and any access would still
return a page fault.

The least amount of runtime logic to deal with this is to
indicate at build time that some pages within a region may
be marked writable or user accessible at runtime, and to
pre-set the flags in the page directory entry accordingly.

The driving need for this is the region configuration for
kernel memory, which will have user permissions set at
runtime for stacks and user-configured memory domains.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-08-03 11:46:26 -04:00
Anas Nashif
9527693f2a sanitycheck: support feature classes for boards
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Andy Gross
6654f273e3 build: Fix distclean for gen_idt
This patch removes the gen_idt subdirectory from the clean target as
this directory is no longer in use due to recent changes to the way the
gen_idt is generated.

Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-08-01 22:10:22 -04:00
Anas Nashif
08ed56016d scripts: fix offset.h header guard
Using __hash__() is unpredictable and produces different results for
different python processes. This has been causing unnecessary rebuilds
due to changing header files at the top of the dependency tree.

Just use _GEN_OFFSETS_H_.

Jira: ZEP-2457
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-01 15:05:13 -04:00
Andrew Boie
a0da632fad gen_gdt: properly set descriptor privilege level
The 'dpl' argument was unused, causing problems if the privilege
level was not 0.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-08-01 10:10:28 -07:00
Marti Bolivar
94bf92497d build: allow user to specify DTC_OVERLAY_FILE directly
In some cases, it's possible to share a DTC overlay across multiple
boards (one example is when the overlay just has to choose a
zephyr,code-partition and set it to a well-known value).

To support this, only go looking around in DTC_OVERLAY_DIR if
DTC_OVERLAY_FILE is not already given.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-07-31 09:21:46 -05:00
Anas Nashif
31df3b27cc tests: run modified tests with full coverage
This addition would catch tests being added or modified and would run
those tests with --all and catch issues with non default board
configurations before they get merged into the tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-28 17:03:04 -04:00
Kumar Gala
a19f6629bb scripts/extract_dts_includes.py: Fix typo in device name list
For CONFIG_UART_PIPE_ON_DEV_NAME the chosen property is
"zephyr,uart-pipe" not ""zephyr,bt-mon-uart".

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-26 11:37:06 -05:00
Kumar Gala
b32b581a34 scripts/extract_dts_includes.py: Reduce code for handling chosen names
We have the same pattern for how we map a chosen property to the device
label that generates a Kconfig define.  Rather than duplicating the code
over and over again, lets just iterate over a list of defines and chosen
properties.  This also provides us a list we can use in the future to
special case handle the defines associated with names.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-26 11:21:21 -05:00
Punit Vara
a4eaf6e80c scripts: Fix string pattern on byte like objects error
This patch fixes following error of python script.

TypeError: cannot use a string pattern on a bytes-like object

Jira: ZEP-2290

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-07-26 06:54:12 -04:00
Andrew Boie
3aecba10f7 scripts: add version check for pyelftools
Versions before 0.24 have string handling issues in Python 3.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-25 13:41:16 -04:00
Erwan Gouriou
9f374d9d9c script: extract_dts_includes: Add cell prefix to interrupt-names
Cell prefix was missing to interrupts-names generated defines

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-07-25 11:18:05 -05:00
Andrew Boie
bc666ae7f7 x86: implement improved double-fault handler
We now create a special IA hardware task for handling
double faults. This has a known good stack so that if
the kernel tries to push stack data onto an unmapped page,
we don't triple-fault and reset the system.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-25 11:32:36 -04:00
Andrew Boie
08c291306e x86: generate RAM-based GDT dynamically
We will need this for stack memory protection scenarios
where a writable GDT with Task State Segment descriptors
will be used. The addresses of the TSS segments cannot be
put in the GDT via preprocessor magic due to architecture
requirments that the address be split up into different
fields in the segment descriptor.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-25 11:32:36 -04:00
Andrew Boie
8a102e44ed x86: allow IDT vectors to be task gates
This has one use-case: configuring the double-fault #DF
exception handler to do an IA task switch to a special
IA task with a known good stack, such that we can dump
diagnostic information and then panic.

Will be used for stack overflow detection in kernel mode,
as otherwise the CPU will triple-fault and reset.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-25 11:32:36 -04:00
Andrew Boie
ddf9f4be31 x86: convert gen_idt to Python
This is one less host tool we have to compile for every build,
and makes the build tools more portable across host OSes.
The code is also much simpler to maintain.

Issue: ZEP-2063
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-25 11:32:36 -04:00
Leandro Pereira
f5a8d498ea scripts: Convert gen_offset_header to Python
By having this as a Python script rather than a host executable, this
should simplify the build process on non-Unix platforms.

With this change, pyelftools is now required to build Zephyr.  Please
consult the getting started documentation for your host platform for
installation instructions.

Jira: ZEP-2062

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-07-24 11:20:04 -07:00
Anas Nashif
35a70b41dd doc: add python pip requirements.txt
List all required modules in one file and just call pip with this
file to install all needed modules instead of listing them
individually.

Added gitlint and pyocd and other required packages to the list.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-22 14:04:20 -04:00
Erwan Gouriou
7bace4c290 scripts: extract_dts_includes.py: Fixup for pinmux nodes
Current version of extract_dts_include.py assumes end subnode
of pinctrl is 'pin'. This fix allows having different names.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-07-20 11:52:44 -05:00
Erwan Gouriou
1d602b30ce scripts: extract_dts_includes.py: allow @ in node names
@ could be used in subnode names.
Convert is to '_' in post processing

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-07-20 11:52:44 -05:00
Erwan Gouriou
cb78d8c816 scripts: extract_dts_includes.py: nodes without address def generation
def_label generation was assuming node names always have address
(eg: rcc@40023800). This was generating incorrect def_labels
when node names doen't have address (eg: pin-controller)
With this fix, this case is now taken into account

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-07-20 11:52:44 -05:00
Savinay Dharmappa
c1e5cbfd41 devicetree: Generate BLUETOOTH_UART,UART_PIPE etc config from dt
patch uses chosen property zephyr,bt-uart, zephyr,uart-pipe
and zephyr,bt-mon-uart to determine the uart instance to be
used for bluetooth,uart_pipe and bluetooth_monitor and generate
appropriate configs.

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2017-07-19 11:52:35 -04:00
Anas Nashif
7e61190d94 scripts: updated spelling.txt file
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-14 12:57:40 +03:00
Vinayak Kariappa Chettimada
f16f88555f scripts: Fix size_report to use correct objdump and nm
Commands for objdump and nm where hardcoded in size_report
script, which failed on MacOS as it tried to use ones from
Xcode. Fixed the script to pick the right objdump and nm
from the toolchain being used to build the application.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-07-13 14:27:49 -05:00
Kumar Gala
b8d7b4e0e1 scripts/extract_dts_includes: extract_reg_prop handle cells being 0
Its possible that #size-cells is 0 (ie i2c bus).  So we should handle
either #address-cells or #size-cells being 0 in extract_reg_prop.  This
means that the reg property in reduced map will end up being an integer,
so we need to convert it to a list with one element.  We also need to
not output any address-cell or size-cell related info if the respective
cell is 0.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-13 14:27:19 -05:00
Kumar Gala
65e72be8f7 devicetree: Generate CONFIG_UART_CONSOLE_ON_DEV_NAME from dt
We can use the chosen property "zephyr,console" to determine what uart
should be used as the console and find its name to generate a define for
CONFIG_UART_CONSOLE_ON_DEV_NAME.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-11 12:09:10 -05:00
Adithya Baglody
c5ff761325 scripts: gen_mmu: Better verbose reporting and updated execution logic
Verbose output now prints the value of the raw data provided by
soc.c file. The page directories are printed with the correct
address ranges for each required region.

Updated the page table number calculation and also updated other
calculations which use this information.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2017-07-11 07:57:11 -07:00
Andrew Boie
d5f523c1e6 gen_mmu.py: verbose mode dump MMU_LIST
It's useful to see what original memory regions were configured
in code via the MMU_BOOT_REGION() macros.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-10 11:44:56 -07:00
Andrew Boie
65a9d2a94a kernel: make K_.*_INITIALIZER private to kernel
Upcoming memory protection features will be placing some additional
constraints on kernel objects:

- They need to reside in memory owned by the kernel and not the
application
- Certain kernel object validation schemes will require some run-time
initialization of all kernel objects before they can be used.

Per Ben these initializer macros were never intended to be public. It is
not forbidden to use them, but doing so requires care: the memory being
initialized must reside in kernel space, and extra runtime
initialization steps may need to be peformed before they are fully
usable as kernel objects. In particular, kernel subsystems or drivers
whose objects are already in kernel memory may still need to use these
macros if they define kernel objects as members of a larger data
structure.

It is intended that application developers instead use the
K_<object>_DEFINE macros, which will automatically put the object in the
right memory and add them to a section which can be iterated over at
boot to complete initiailization.

There was no K_WORK_DEFINE() macro for creating struct k_work objects,
this is now added.

k_poll_event and k_poll_signal are intended to be instatiated from
application memory and have not been changed.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-10 11:44:56 -07:00
Kumar Gala
5141d526b3 sanitycheck: fix depends_on when multiple dependencies
If the depends_on has more than one item we need to match all of those
dependencies in the supported list.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-07 09:01:01 -05:00
Anas Nashif
25a8b88588 sanitycheck: fix supported/depends_on usage
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00
Adithya Baglody
5ffffb86bf scripts: gen_mmu: Rectified MMU page table generation.
The script failed on certain corner cases. Whenever the memory region
was falling on the PDE boundary, the glitch was causing incorrect
PTE to be generated.

JIRA: ZEP-2328

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2017-07-05 12:32:33 -04:00
Andy Gross
70e54f9ef7 scripts: extract_dts_includes.py: Adhere to PEP8
This patch PEP8-ifies the extract_dts_includes.py script

Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-07-05 10:54:32 -05:00
Andy Gross
066edc7bac scripts: extract_dts_includes.py: Fix names generation
This patch fixes issues with the IRQ definitions when using
the interrupt-names property in the DT entry.

Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-07-04 10:06:20 -05:00
Andrew Boie
d9c48563a1 check_link_map: fix check for app memory
This script was assuming that all XIP data copied sections
were contiguous. However with application memory partitioning
enabled, this is not the case; in between the kernel data sections
and the app data sections will be the kernel's BSS and noinit.

As a quick fix, reset the last section compared if we encounter
the kernel's BSS section.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-29 07:46:58 -04:00
Andrew Boie
8eed4b0309 sections.h: define application-level sections
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-29 07:46:58 -04:00
John Andersen
913e2cdb24 samples: net Documented QEMU_INSTANCE usage
Signed-off-by: John Andersen <john.s.andersen@intel.com>
2017-06-29 07:20:46 -04:00
John Andersen
06b92c6611 samples: net: Multiple instances of QEMU
Makefiles which start QEMU (make run) have been changed to operate
off of the QEMU_INSTANCE variable. QEMU_INSTANCE is simply appended
to the pid and sock file names. This makes us able to run multiple
QEMU Zephyr instances of the same sample.

Signed-off-by: John Andersen <john.s.andersen@intel.com>
2017-06-29 07:20:46 -04:00
Anas Nashif
b17e1caf0a sanitycheck: add toolchain keyword to testcases
Some testcases can only be built with certain toolchains. Instead of
using filters, add support for toolchain keyword which enables
whitelisting and exclusion.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-28 09:51:40 -05:00
Kumar Gala
914d92e488 scripts/sanitycheck: split out log from config-sanitycheck
Put the results of the config-sanitycheck into their own log so we can
see warnings from that stage of the build.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-27 19:11:31 -04:00
Kumar Gala
c5940fa673 scripts: pyocd.sh: Add support for passing board_id to pyocd commands
If we have more than one board of a given type we need to be able to
specify the board_id to select which specific board that the pyocd
command should target.  Introduce an environment variable PYOCD_BOARD_ID
to we can set that will get passed to the pyocd command that needs it.

Here's an example:

$ make -C samples/hello_world/ BOARD=frdm_k64f flash PYOCD_BOARD_ID=1234

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-23 15:05:10 -05:00
Kumar Gala
76be0a4c92 scripts: bossa-flash.sh: fix variable usage
We define a variable to pickup a default for the bossa binary, however
we weren't using it.  Lets do so now.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-23 15:05:10 -05:00
Anas Nashif
6b1c3e3f1b toolchains: add DTC to environment
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-23 13:10:52 -05:00
Anas Nashif
bfab06bb52 sanitycheck: fix platform filtering
The build_on_all tag in synchronisation sample was resetting the
supplied arguemnt for filtering platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-22 09:48:48 -04:00
Anas Nashif
cf21f5f10b sanitycheck: enhance toolchain filtering
Do not run filters on platforms not supported by toolchain.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-22 09:22:48 -04:00
Anas Nashif
a792a3d410 sanitycheck: support testcases in yaml instead of ini
This commit changes the syntax of the testcase files and changes the
behaviour and configuration of the sanitycheck script.

To avoid having multiple files with different syntax for boards,
samples, tests; this change unifies the syntax and uses YAML instead of
INI.

We maintain the current keywords used in the old syntax and maintain the
flexibility of adding tests with different configuration by using YAML
list configuration. On top of that, the following features are added:

- We now scan for board configurations in the boards directory and look
for a YAML file describing a board and how it should be tested. This
eliminates the need for listing boards per architecture in a special ini
file under scripts/.

- We define hardware information charachterstics in the board YAML file
that helps identifying if a certain test should run on that board or
not. For example, we can specify the available RAM in the board and
filter tests that would require more RAM than the board can handle.

- Boards can be set as default for testing meaning that we always run a
test case (build and run of possible) when sanitycheck is called without
any arguments. Previously this was done only by selecting the first
board defined for a specific architecture.

- Tests can be configured to run on all possible boards, this is to make
sure we always build some basic tests for all boards to catch issues
with the core kernel features.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 20:56:53 -04:00
Leandro Pereira
f0b4e174d7 esp32: Use esptool.py to flash with 'make flash'
This flashes Zephyr at 0x1000: that's where the first stage bootloader,
part of the ESP32 ROM, expects to find an "image header".

The second-stage bootloader, part of ESP-IDF, isn't used by the Zephyr
port.  However, the bootloader can be used if desired; please refer to
the ESP-IDF documentation on how to set up partitions tables and use
the bootloader.

The following environment variables will affect the ESP32 flashing
process:

  Variable              Default value
  ESP_DEVICE            /dev/ttyUSB0
  ESP_BAUD_RATE         921600
  ESP_FLASH_SIZE        detect
  ESP_FLASH_FREQ        40m
  ESP_FLASH_MODE        dio
  ESP_TOOL              espidf

It's impossible to determine which serial port the ESP32 board is
connected to, as it uses a generic RS232-USB converter.  The default of
/dev/ttyUSB0 is provided as that's often the assigned name on a Linux
machine without any other such converters.

The baud rate of 921600bps is recommended.  If experiencing issues when
flashing, try halving the value a few times (460800, 230400, 115200,
etc).  It might be necessary to change the flash frequency or the flash
mode; please refer to the esptool documentation for guidance on these
settings.

If ${ESP_TOOL} is set to "espidf", the esptool.py script found within
ESP-IDF will be used.  Otherwise, this variable is handled as a path to
the tool.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-06-21 12:35:49 -04:00
Leandro Pereira
bb19e08cde Support for Espressif SDK (ESP32, etc)
Three environment variables must be set to use this variant:

   export ZEPHYR_GCC_VARIANT="espressif"
   export ESP_IDF_PATH=/path/to/esp-idf
   export ESPRESSIF_TOOLCHAIN_PATH=/path/to/xtensa-esp32-elf/

ESP-IDF is the SDK provided by Espressif.  It contains, among other things,
the HAL and header files for registers and ROM functions used by the Zephyr
port.  At this stage, with the exception of the HAL library, none of the
binary blobs provided by ESP-IDF are used.  This can be obtained directly
from Espressif, at <https://github.com/espressif/esp-idf>.

Instructions on how to obtain the toolchain are detailed in the README for
ESP-IDF.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-06-21 12:35:49 -04:00
David B. Kinder
29963c30d1 scripts: sanitycheck: more spelliing fixes
PR #515 got merged before I could submit some additional spelling
fixes.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-06-16 17:15:57 -04:00
Andy Gross
07b43e352c scripts: extract_dts_includes.py: Correct LOAD_OFFSET
This patch fixes the LOAD_OFFSET calculation to use the actual offset
of the partition.  This assumes the reg entry in the DTS for that
partition is in relative offset to the flash base address.

Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-06-16 13:15:32 -05:00
Johan Hedberg
9703927f84 net: buf: Move net_buf_pool objects to dedicated linker area
Moving the net_buf_pool objects to a dedicated area lets us access
them by array offset into this area instead of directly by pointer.
This helps reduce the size of net_buf objects by 4 bytes.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-06-16 17:05:06 +03:00
Paul Sokolovsky
ff70add7ab scripts: sanitycheck: Clean up help text.
Fixes a typo, punctuation, and a bit of old info about test paths.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-06-15 23:04:12 -04:00
Andy Gross
25309ab51a scripts: sanitycheck: Switch config target
This patch changes the config target to use the config-sanitycheck
target.  The config-sanitycheck target gets not only the Kconfig
options, but also the DTS generated options.

Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-06-15 16:14:59 -05:00
Erwin Rol
0c4ba8f7d2 boards: arm: olimex_stm32_e407: Initial Olimex STM32-E407 BSP
- board name olimex_stm32_e407
- CPU STM32F407ZGT6 Cortex M4
- LED/BUTTON support
- Console on USART1 with 8n1 115200 baud

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2017-06-15 15:07:46 -05:00
Adithya Baglody
a407739ef4 scripts: x86: MMU: Script to generate page tables
Generates the MMU page tables. This creates a binary output for
the page tables. It takes an binary input which represents the
configuration information needed to generate the page tables.

JIRA:ZEP-2096

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2017-06-13 11:36:54 -04:00
Andrew Boie
65e5401502 xtensa: fix 'make debug' for xt-sim targets
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-12 18:01:13 -04:00
Anas Nashif
2f117af6c5 scripts: make check_compliance scripts take arguments
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-10 10:44:33 -04:00
Anas Nashif
1fc69dd4db ci: merge xml reports into one single file
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-10 10:44:33 -04:00
Anas Nashif
c363a0d000 ci: compliance: add missing classname and enhanced description
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-10 10:44:33 -04:00
Punit Vara
2f28bf538c scripts: convert helper scripts to python3
This patch ports helper scripts from python2 to python3
with following changes:

- print should be used with () in python3
- resolved bytes-like object is required, not 'str'
- added python3 header

ZEP-2054

Signed-off-by: punit vara <punit.vara@intel.com>
2017-06-09 18:52:03 -04:00
Andy Gross
fa4a39322e scripts: extract_dts_includes.py: Correct LOAD_OFFSET
This patch fixes a bug with the computation of the FLASH_LOAD_OFFSET
option that is derived as part of the DTS parsing.  Offset should be
the relative offset from the base of flash.  If the flash base address
and selected partition are the same, the offset should be 0.

JIRA: ZEP-2260

Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-06-09 14:54:02 -05:00
Kumar Gala
817a043fc8 toolchain.gccarmemb: Fix support for where to find newlib
When we build with newlib enabled and utilizing one of the other
variants (like having floating point enabled) we need to have the proper
library path setup to find the library.  This is mimicked after what we
do in Makefile.toolchain.zephyr for newlib.

Issue: ZEP-2240

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-08 14:52:49 -04:00
Andy Gross
69255043e7 dts/extract_dts_includes.py: Add partition support
This patch adds parsing support for flash partitions.

Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-06-08 07:37:44 -05:00
Andrew Boie
5b22d6fab3 Makefile.toolchain.zephyr: fix C++ on Xtensa
Need to set CXXFLAGS just like we did CFLAGS.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-06 20:37:11 -04:00
Anas Nashif
b520075788 gitlint: Ignore signed-off-by line
When checking for line length limits, ignore lines with Signed-off-by.
Some developers have a long name that would not fit within the limits.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-06 09:35:50 -04:00
fallrisk
106bf1c09a arm: board: Add support for board Atmel SAM4S Xplained.
This commit provides support for Atmel SAM4S Xplained board

Signed-off-by: Justin Watson <jwatson5@gmail.com>
2017-06-02 14:11:13 -04:00
Florian Vaussard
13cba0bb76 stm32f4: Add STM32F412 Nucleo board
Add necessary board files, pinmux and device tree in order to have a
usable debug console.

Origin: Original

Change-Id: I43a9d278c3f2c936a714263626722f630367b663
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
2017-06-02 14:11:13 -04:00
Carles Cufi
5dec78bb50 build: Fix DTC overlay file paths on MSYS2
On MSYS2, the #include paths for GCC need to be in native format
(Windows-style paths) since GCC is a native Windows application and
therefore requires standard paths.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-05-31 14:57:33 -04:00
Anas Nashif
b60ff2f840 dts: generate definitions for build system
This will generate an additional file that can be sourced by the build
system to expose definitions generated by device tree and used for
flashing and debugging targets.

Change-Id: I184e247f0a8dbd1a4a42dd4b02ea01f2caa70533
Jira: ZEP-2119
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-31 14:56:57 -04:00
Anas Nashif
6b081415d3 dts: make extract script take options
Use argeparse for options and add a fixup option to add on top of
generated file. This was previously done in the top Makefile and was
generated defines outside of the header main if statement.

Jira: ZEP-2147

Change-Id: If65f34a11de27baa770d4ce0ef4fca2abbd30258
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-31 14:56:57 -04:00
Anas Nashif
bf4d07024a xtools: add new configurations for xtools 1.23
Remove arm.config, we should be using the official ARM cross compiler
instead.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-31 14:54:34 -04:00
Andrew Boie
113015b64c gccarmemb: don't assume 'dtc' is in /usr/bin
Just search for it in the system PATH.

Issue: ZEP-2211
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-05-30 19:01:55 -04:00
Anas Nashif
61dbb5058e Revert "xtools: get rid of warnings about wrong path"
This reverts commit 96def63f10.

This breaks building with xtools for some reason, removing for now while
we figure out what went wrong.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-29 16:20:15 -04:00
David Brown
7a8380a81d dts: Allow override of dts overlay directory
Instead of requiring the dts overlay files to be at the top level
directory (where make is invoked), allow this default to be overridden
by setting DTS_OVERLAY_DIR.  This is a directory where the overlays
themselves (which are still named $(BOARD_NAME).overlay) will live.

Change-Id: Ie9796afbd27971650b7636a36149c0d1f8e2b9fb
Signed-off-by: David Brown <david.brown@linaro.org>
2017-05-27 10:15:48 -04:00
Andy Gross
cb16f5ab9f scripts: Makefile.lib: Add dependency for DTS overlay
This patch adds a dependency for the DTS overlay so that the DTS is
compiled when the state of the overlay file changes.

Change-Id: I2affe67f90f56b1d97384d5cd4e3026abed24253
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-05-27 10:15:48 -04:00
Johan Hedberg
9516d63836 Bluetooth: Remove support for NBLE
NBLE has been deprecated for a few releases now and can be removed.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-25 09:03:16 -07:00
Anas Nashif
8e986c6b8c toolchain: require SDK 0.9.1
The 0.9.1 SDK is now required to cover all architectures and to enable
tests on all plartforms supported.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-20 09:35:51 -04:00
Anas Nashif
051b4b7686 xtensa: add to sanitycheck
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-20 07:04:33 -04:00
Anas Nashif
3c27c46562 gitlint: check for subsystem in commit subject
Check that we have <subsystem>: <subject> in commit messages.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-19 20:04:08 -04:00
Anas Nashif
96def63f10 xtools: get rid of warnings about wrong path
Eliminate following errors:

make[2]: /home/nashif/Work/sdk/xtools/outdir/x-tools//bin/-gcc: Command
not found
make[2]: /home/nashif/Work/sdk/xtools/outdir/x-tools//bin/-gcc: Command
not found
make[2]: /home/nashif/Work/sdk/xtools/outdir/x-tools//bin/-gcc: Command
not found

Also, usage of CROSS_COMPILE with a predefined toolchain is not required and
complicates things, just call CROSS_COMPILE with the full path if you
want to build with a toolchain not supported with Zephyr.

Change-Id: I93ec4ff2e04d22cee82c8e4b74b652927572b30a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-19 18:38:27 -04:00
Neil Armstrong
4a6ba84f67 boards: arm: Add support for STM32F469I-DISCO
Add board configuration, dts and pinmux based on the stm32f4_disco
board.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-05-19 10:06:48 -04:00
Kumar Gala
21ef8a6acc dts/extract_dts_includes.py: Quote strings values
If the value of the property is a string quote it on output.  This lets
us use things like label properties that will have values of strings.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-05-19 10:06:48 -04:00
Kumar Gala
fc2130a3a4 arm: Fixup sanity check list of boards
The stm32f4discovery was incorrectly named and should have been
stm32f4_disco.  Also added 96b_carbon_nrf51 that was missing from the
list.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-05-19 10:06:48 -04:00
Neil Armstrong
84441b2ee4 arm: Add support for STM32F4DISCOVERY Board
Add configuration, documentation, flash script, pinmux and dts for the
STM32F4DISCOVERY board.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-05-19 10:06:48 -04:00
Neil Armstrong
b729b478ec boards: arm: Add support for STM32L496G Discovery board
Add configuration, pinmux, dts and documentation for the STM32L496G
Discovery board based on the STM32L496AG SoC.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-05-19 10:06:48 -04:00
Huaqi Fang
9bc69a46fa boards: Update arc em_starterkit support from 2.2 to 2.3
Here are the main changes:
* board: Update EMSK onboard resources such as Button, Switch and LEDs
  + update soc.h for em7d, em9d, em11d
  + update board.h for em_starterkit board
* arc: Add floating point support and code density support
  + add kconfig configuration
  + add compiler options
  + add register definitions, marcos, assembly codes
  + fixes in existing codes and configurations.
* arc: Update detailed board configurations for cores of emsk 2.3
* script: Provide arc_debugger.sh for debugging em_starterkit board
  + make BOARD=em_starterkit debug
    This will start openocd server for emsk, and arc gdb will connect
    to this debug server, user can run `continue` command if user just
    want to run the application, or other commands if debugging needed.
  + make BOARD=em_starterkit debugserver
    This will start an openocd debugger server for emsk, and user can
    connect to this debugserver using arc gdb and do what they want to.
  + make BOARD=em_starterkit flash
    This will download the zephyr application elf file to emsk,
    and run it.

Signed-off-by: Huaqi Fang <huaqi.fang@synopsys.com>
2017-05-19 15:58:41 +02:00
Andrew Boie
4f69bdaa0d sanitycheck: build more Xtensa SOCs
Now that we can specify what toolchain is intended for each
SOC, enable some more SOCs to be built.

A full sanitycheck run will require the installation of both
RF-2016.4 and RG-2016.4 releases.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-05-18 07:18:36 -04:00
Andrew Boie
de61aa1560 Makefile.toolchain.xcc: support multiple builds
XTENSA_TOOLS_PATH and XTENSA_BUILDS_PATH have been retired.

XTENSA_SDK is now the base directory for the Xtensa SDK. The build
systems will search for toolchains in there, using
CONFIG_TOOLCHAIN_VARIANT to locate the right one. It defaults to
/opt/xtensa.

XTENSA_BUILD_PATHS is now a list of additional directories to search
for Xtensa CPU builds. By default the build system will already search
the builds included in the SDK; this is intended for vendor-supplied
CPU build definitions.

Some whitespace changes made for readability and comments added.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-05-18 07:18:36 -04:00
Andrew Boie
074b806f07 Kbuild.include: add function for unquoting strings
Useful for extracting values from CONFIG_* variables which are always
quoted.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-05-18 07:18:36 -04:00
Andrew Boie
12379d17c1 xtensa: run simulator in turbo mode
This greatly increases the speed in which test cases are evaluated
on the Xtensa simulator.

The cycle limit parameter was removed, we don't currently need it
since sanitycheck handles killing test cases if they time out.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-05-17 12:04:10 -04:00
Anas Nashif
e6fcc0105e sanitycheck: remove color output from xml
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-17 09:10:42 -05:00
Anas Nashif
0605fa33ea sanitycheck: junit: add total duration of run
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-15 15:54:50 -04:00
Anas Nashif
202d1308ae sanitycheck: add classname to testcase
classname seems to be expected by some parsers, so use it in the report,
the name now has the same value, we can add some more information once
we have meaningful metadata for the testcases with more details.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-15 15:54:50 -04:00
Anas Nashif
035799fe45 sanitycheck: add subsets support
This new options makes it possible to only run a subset of the tests
which will allow us to run sanitycheck on multiple hosts and merge the
results into one report. This way we do not need to worry about
selecting specific architectures to be run on a certain host.

The option accepts a string value: x/y where x is the subset and y is
the total, so if we specify --subset 1/5, we will only run the first
fifth of the total tests, --subset 5/5 would only select the last fifth.

To get consistent results, the testcase instance list is now ordered,
to avoid duplications and have full coverage.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-15 15:54:50 -04:00
Florian Vaussard
614db02cc6 stm32f4: Add STM32F413 Nucleo board
Add necessary board files, pinmux and device tree in order to have a
usable debug console.

Origin: Original

Change-Id: I280320700352fd36a544c03f4e57d2eeec2449e5
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
2017-05-15 13:22:54 -04:00
Maureen Helm
f49e199c27 scripts: Add flash and debug support using pyOCD on NXP boards
Adds a new debug support script using pyOCD and configures most NXP
boards so they can use it. frdm_kw41z is the one exception because pyOCD
doesn't yet support kw41z. Tested with pyOCD v0.8.0 and the latest
DAPLink firmware for each board.

Introduces two new environment variables, PYOCD_FLASHTOOL and
PYOCD_GDBSERVER, that allow you to set custom paths to the pyOCD tools.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-05-15 13:22:54 -04:00
Maureen Helm
c16ad344e9 scripts: Add support for 'make debug' using Segger JLink on NXP boards
Adds a new debug support script using Segger JLink and configures all
NXP boards so they can use it. Tested with Segger JLink GDB server
V6.14b and OpenSDA v2.1 firmware.

Change-Id: Ia1b297d9c93d21db61379e22f27ae54cda3ad461
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-05-15 13:22:54 -04:00
Anas Nashif
7708ff8bf6 emulation: fix path of ELF binary when running with xt-sim
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-11 16:51:56 -04:00
Max Filippov
4b8419e420 xtensa: drop references to C library
C library is not actually used by the xtensa port, we only need the
'exit' function. Implement 'exit' in crt1-* and drop remaining
references to the C library.

Change-Id: I8a562363956b4755a6b5baee7acf3726485e5ce3
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2017-05-11 16:51:56 -04:00
Max Filippov
a4f7e562ef Makefile.toolchain.zephyr: fix xtensa support
Building zephyr for xtensa with gcc requires additional include paths and
additional library (libhal).

Add xtensa sysroot and include paths to CFLAGS when building for xtensa.
The root Makefile then does the right thing adding these parameters to
KBUILD_CFLAGS and KBUILD_ASFLAGS.

Add xtensa libhal to the TOOLCHAIN_LIBS_xtensa. Modify TOOLICHAIN_LIBS to
include arch-specific libraries.

Seems that it would be nice to have TOOLCHAIN_CFLAGS_$(ARCH) with the
same behavior as TOOLCHAIN_LIBS_$(ARCH). It also seems that the SYSROOT
definition doesn't have to be restricted to MAKEFILE_TOOLCHAIN_DO_PASS2.

Change-Id: Ia6703ca067b964ac2f8be8fe8513ca28f101a6a3
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2017-05-11 16:51:56 -04:00
Andrew Boie
18c949c9c9 xtensa: remove xt-sim_XRC_D2PM
This core configuration was removed from the tree since it cannot
implement irq_offload().

Remove an orphaned block in xtesna.ini.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-05-11 12:47:23 -04:00
Neil Armstrong
6256c99703 boards: arm: Add support for Nucleo L432KC
Add configuration, dts and documentation for the Nucleo L432KC board
based on the STM32L432KC SoC.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-05-08 15:03:15 -04:00
Anas Nashif
e930a41842 build: honor V=1 when flashing via DFU
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-08 09:15:09 -04:00
Anas Nashif
1338f49206 gitlint: verify full name in signed-off-by line
Make sure we get full name in the commit message and not the username or
some incomplete data that we need to decipher. We still need to verify
the commiter name that is not part of the commit message body, but this
is out of scope of gitlint.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-05 16:11:11 -05:00
Anas Nashif
a1c74b74d2 ci: update path to theme repo
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-03 15:36:03 -04:00
Anas Nashif
ed6eba7f4f CI: show commit range in log
Also print range in the test report.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-03 12:27:10 -05:00
Anas Nashif
accc8eb6f5 sanitycheck: include qemu log when failure is not a build issue
When tests run in Qemu fail, we want to see the log from Qemu, not the
successful build log.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-01 17:48:24 -04:00
Anas Nashif
0de394d313 MAINTAINERS: replace git pointer to github
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-30 20:10:07 -04:00
Anas Nashif
3a212f8875 ci: add documntation checking and posting to AWS S3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-30 11:40:26 -04:00
Erwan Gouriou
2e20577554 board: Add support for board disco_l475_iot1
This commit provides support for disco_l475_iot1 board
Pinmux driver is provided with initial support definitions

Change-Id: I17b637a8ba0b033014969eca8fffe76319c47c52
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-04-28 15:26:39 -05:00
Gustavo Denardin
94abb1f7fb arm: Support for new ARM board FRDM-KL25Z
In order to allow the use of such board, a very preliminar port was
developed. It consists of board files, as well as pinmux, uart, gpio,
spi drivers and device tree files.

Change-Id: I5753064e39e0b023cf4481744c176de26d8dbebb
Signed-off-by: Gustavo Denardin <gustavo.denardin@gmail.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-28 15:26:38 -05:00
Gil Pitney
70040f0e11 boards: Add support for the CC3220SF_LAUNCHXL board
CC3220SF_LAUNCHXL effectively replaces the CC3200_LAUNCHXL,
with support for the CC3220SF SoC, which is an update for
the CC3200 SoC.

This is supported by the Texas Instruments CC3220 SDK.

Jira: ZEP-1958

Change-Id: I2484d3ee87b7f909c783597d95128f2b45db36f2
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2017-04-28 15:06:41 -05:00
Anas Nashif
da871298b4 checkpatch: per coding style, we do not allow c++ style comments
Change-Id: I933f317f2117917bf6413fa0514342f6df4c1e90
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-28 13:03:33 +00:00
Anas Nashif
acedb70a94 ci: add CI/CD integration and related scripts
Add initial .shippable.yml for CI integration on github and related
scripts.

Change-Id: I095d125e780bba980e635e218205c8741e753a8e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-27 20:58:14 -04:00
Daniel Thompson
955ba73024 scripts: openocd.sh: Honour V=1
Currently running "make V=1 flash/debug" does not result in the caller
discovering what commands are run to perform the action because make
calls into an opaque script (which then makes complex invokations of
both openocd and gdb). Make the script more transparent by conditionally
enabling enabling tracing within the script.

We also remove the "Done flashing" message. It is pointless because
openocd has already *told* us it has done flashing ["wrote 16384 bytes
from file .../zephyr.elf in 0.802135s (19.947 KiB/s)"]. It is also
potentially misleading since it tells us we are "Done flashing" even
when we failed to flash anything which risks misleading someone
unfamiliar with openocd.

Change-Id: Icaea28c4b00ac10965726dd4502162b7de080953
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
2017-04-27 13:01:08 +00:00
Anas Nashif
b3311edff6 sanitycheck: support xunit report
Generate a test report using junit/xunit format with all details and
logs that can be published on the web to show results from a sanitycheck
run.

Output is stored in scripts/sanity_chk/ alongside the CSV file.

Change-Id: I5ea6f409c1f86f408eeae870b90a953e71046da9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-26 21:37:33 -04:00
Anas Nashif
a35378e494 scripts: add gitlint to check for validity of commit messages
Install gitlint using pip:

 # pip install gitlint
 # gitlint install-hook

This will install the pre-commit hook.

Policies are define in .gitlint. Custom rules are available under
scripts/gitlint.

This script will also run in CI, so avoid CI errors by using the hook
above.

Change-Id: I62750a1fd9369341db29c413a6c4a1677bb0db8a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-25 22:48:24 +00:00
Anas Nashif
19ee5efa61 build: support building host tools
To speed up builds, this change allows building the needed host tools
that are built for every application and stores them un
${ZEPHYR_BASE}/bin.

Run 'make host-tools' and then define PREBUILT_HOST_TOOLS to reuse the
host tools across multiple builds.

$ make host-tools
  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
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf

$ export PREBUILT_HOST_TOOLS=${ZEPHYR_BASE}/bin

$ make -C samples/hello_world

Now you will notice a speedup when building the application!

Change-Id: Ie0aeee7f9a60b1fd49e7e32d78601f03473d73b8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-25 22:48:23 +00:00
Kumar Gala
a48e8790d3 checkpatch: update checkpatch to warn about C99 type usage
Only in rare cases should we allow C99 types, so lets warn about it to
catch issues.

Change-Id: I2bacdd4ba98f88482e0b7acc0567ff1139e749bf
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 17:24:04 +00:00
Kumar Gala
789081673f Introduce new sized integer typedefs
This is a start to move away from the C99 {u}int{8,16,32,64}_t types to
Zephyr defined u{8,16,32,64}_t and s{8,16,32,64}_t.  This allows Zephyr
to define the sized types in a consistent manor across all the
architectures we support and not conflict with what various compilers
and libc might do with regards to the C99 types.

We introduce <zephyr/types.h> as part of this and have it include
<stdint.h> for now until we transition all the code away from the C99
types.

We go with u{8,16,32,64}_t and s{8,16,32,64}_t as there are some
existing variables defined u8 & u16 as well as to be consistent with
Zephyr naming conventions.

Jira: ZEP-2051

Change-Id: I451fed0623b029d65866622e478225dfab2c0ca8
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-20 16:07:08 +00:00
Anas Nashif
45a7e5d076 kernel: remove legacy.h and MDEF support
Change-Id: I953797f6965354c5b599f4ad91d63901401d2632
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-19 10:59:35 -05:00
Andrew Boie
c09b4b84fc sanitycheck: catch ValueErrors when evaulating expressions
Change-Id: Iae4eb0b242427b98dd6515676c024f307446e49d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-18 20:51:48 +00:00
Andrew Boie
31e772de20 expr_parser: fix issue with hex values in environment
Hex mumeric values directly in the expression were cast correctly
via the t_HEX rule, but ValueErrors would occur if a hex value was
looked up due to the expansion of some environment symbol.

Change-Id: Ia98dfea91eff4ed95778922d38d2967284f4e31b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-18 20:51:26 +00:00
Maureen Helm
14ca99af1e sanitycheck: Add hexiwear_kw40z
Jira: ZEP-1391
Change-Id: I32d0acfc03c57b305667746e9d8315100dec6833
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-04-14 05:56:53 -05:00
Kumar Gala
653d2695a7 sanitcheck: add nrf52_blenano2
Change-Id: Ia4f65b027c75d696ae172569e52fc74eb307f715
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-14 05:56:53 -05:00
Anas Nashif
ed3d7c1de5 build: make sure we are calling python3 in all scripts
Jira: ZEP-1759
Change-Id: I0fc7329f806ca0049c555d3402dd145e92e54028
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-13 20:22:54 +00:00
Andrew Boie
6e1ff792fc sanitycheck: remove hifi_mini from arch config
Change-Id: I24eca1d3f95a4941e5efe1bfbc4905c38d7cb253
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-13 11:54:49 -07:00
Kumar Gala
46e4755d63 Revert "Revert "scripts: devicetree: Handle mixed case node names""
Yes, revert the revert, was a little too quick to apply this.  The fix
is to cleanup the dtsi file in question.

This reverts commit 6702686976.

Change-Id: I933fad9d96ec6375eda33f0b012349f1c39e261f
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-13 15:02:13 +00:00
Andrew Boie
6922a22c28 xtensa: add simulator targets for more SOCs
Change-Id: Ibceaf01ed71783c597b030bcc5778da6a03e5699
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-13 12:42:07 +00:00
Andrew Boie
11ee791b32 xtensa: build similar to other Zephyr arches
* CONFIG_SOC is now properly set and we do not need a separate
  XTENSA_CORE build variable

* Some unnecessary macro -D CFLAGS in the Xtensa Makefile removed

* There is no default SOC selection, it is now done explicitly in
  the board's defconfig

* CONFIG_<board name> now renamed to CONFIG_SOC_<board name in
  uppercase> to conform to established style.

Issue: ZEP-1711
Change-Id: I88997530db09970b7fdd1c3e3d355bfca9d0be1a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-13 12:42:06 +00:00
Anas Nashif
6702686976 Revert "scripts: devicetree: Handle mixed case node names"
This reverts commit 1c06065941.
Breaks cc3200_launchxl really bad:

 CC      drivers/serial/uart_cc32xx.o
/projects/zephyr4/drivers/serial/uart_cc32xx.c:39:18: error: ‘TI_CC32XX_UART_4000C000_BASE_ADDRESS’ undeclared here (not in a function)
  .base = (void *)TI_CC32XX_UART_4000C000_BASE_ADDRESS,
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/projects/zephyr4/drivers/serial/uart_cc32xx.c: In function ‘uart_cc32xx_init’:
/projects/zephyr4/drivers/serial/uart_cc32xx.c:65:5: error: ‘TI_CC32XX_UART_4000C000_BAUD_RATE’ undeclared (first use in this function)
     TI_CC32XX_UART_4000C000_BAUD_RATE,
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Change-Id: If46c239bc8d6b4296494f638e900f6044a92ce26
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-12 22:07:36 +00:00
Andy Gross
1c06065941 scripts: devicetree: Handle mixed case node names
This patch fixes an issue with mixed case node names.  Node names
containing upper case letters were causing key match errors during
post processing.  This patch maintains the case of the node names.

Change-Id: I153a186fa09dcf958c9de55b578dbc63e615a076
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-04-12 19:44:12 +00:00
Andrew Boie
c92c7ee8f9 sanitycheck: add arduino_101_mcuboot
Change-Id: I70613baefd96e71dd548273927b049139f1bbe25
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-12 16:31:47 +00:00
Andrew Boie
06dc2f203f xtensa: fix CONFIG_DEBUG build
A patch moved the specification of debug flags to a
KBUILD_CFLAGS_OPTIMIZE, but this Makefile wasn't updated.

Change-Id: Ic0d23f95609798473298cda4c044981edabb3ed5
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-04-12 16:31:45 +00:00
Mazen NEIFER
6683f13c94 sanitycheck: Let waitpid script kill Xtensa ISS if user hits ctrl+c.
Change-Id: I4a623e55c7e69258d58b2116bd7645d1e83ed274
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-04-11 16:53:41 +00:00
Patrice Buriez
49a8de7ae3 build: use -O2 instead of -Os for ARC with SDK 0.9
This is intended as a temporary fix for ZEP-1882.
Investigation for this bug has shown that the current SDK 0.9 compiler
for ARC generates incorrect code under -Os optimization level.

Kuo-Lang Tseng found out that SDK 0.8.2 does not have this issue, and
that lowering optimization level to -O2 fixes the issue with SDK 0.9.
Juro Bystricky is working on an updated SDK with ARC GCC 6.3.0, but
there are still problems with it, so he also suggested to use -O2 in
the meantime.

Instead of blindly setting -O2 for all toolchains and architectures,
let Makefile.toolchain.zephyr make the decision for ARC and 0.9 only.
Tested with hello_world, CONFIG_ADC=y and BOARD=arduino_101_sss.

Jira: ZEP-1882
Change-Id: Ifde2e3950c9d93eed8982149805acfda9d13a94f
Signed-off-by: Patrice Buriez <patrice.buriez@intel.com>
2017-04-09 14:57:50 +00:00
Patrice Buriez
fd8c59b996 scripts/dfuutil: support both "alternate setting" name and number
Initial assumption with Arduino 101 was that the "alternate setting
name of the DFU interface" would be simple enough to be used as the
grep pattern when attempting to find the board in DFU mode.
However, for boards such as the 96Boards Carbon, this name includes
grep meta-characters, so the DFUUTIL_ALT environment variable is
provided as a numeric value, instead of the previously expected name
string.
In order to avoid false positives, we now check whether DFUUTIL_ALT
is a numeric value, and the grep pattern is adjusted accordingly to
search for either "alt=" or "name=".
Also take into account that the name might contain spaces.

Change-Id: I81351d03bd727b35093fd1280e2b8b6904f3c89b
Signed-off-by: Patrice Buriez <patrice.buriez@intel.com>
2017-04-09 14:57:36 +00:00
Andy Gross
2fb6dce2a1 dts: Add application overlay support.
This patch adds DTS application overlay support.  Applications
requiring specific device features can specify these using
board dtsi files located in the application directory.  These overlay
files are board specific.

Issue: ZEP-1745

Change-Id: I1c5f1a8a198fe543b6d52ee8c1fb31a2038a7956
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-04-06 09:19:28 +00:00
Kumar Gala
a0fbc88c1a arm: dts: Move common arm includes into a dts system include
Introduce a system include so that board dts files are able to live in
any location and properly include the things they need.

Change-Id: Icd26433117a4ca9726aeb74eec9f72c6d9df617c
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-04 17:55:13 -05:00
Piotr Mienkowski
ce6ad70c06 scripts: openocd.sh: align usage of OPENOCD_*_CMD variables
OPENOCD_PRE_CMD, OPENOCD_POST_CMD variables require adding
'-c' in front of an actual OpenOCD command. This is in contrary
to other OPENOCD_*_CMD varialbles which specify OpenOCD commands
directly. This patch aligns usage of various OPENOCD_*_CMD variables.
It is no longer required to add '-c' in front of OPENOCD_PRE_CMD,
OPENOCD_POST_CMD variables.

Change-Id: I276fab00b099694c83c3bf74aa5dd59c8d6a308b
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-04-01 12:21:36 +00:00
Kumar Gala
023f2ce94d dts/extract_dts_includes.py: Fix IRQ define name creation
We were missing the cell name in how we create the IRQ define.  This was
working fine because the only name we had been using with IRQ which we
would shorten down.

Change-Id: I8449c8ced1a9284982d3d5b07c6acdcf26e965e2
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-03-27 18:26:22 +00:00
Ricardo Salveti
4f92c18ebf scripts/dfuutil: add support for DfuSe devices
Add DFUUTIL_DFUSE_ADDR to the list of dfu-util environment variables,
which can be used to flash DfuSe devices (e.g. STM32 based MCUs).

Change-Id: I39fdc338f7f034376ce50b648b06f39fee3169a7
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-03-22 20:59:07 -03:00
Michał Kruszewski
46a00d4b7c scripts:nrf: Add 'make flash' for nrf boards.
Tested on nrf52_pca10040 and nrf51_pca10028 using hello_world sample.

Change-Id: I7cdf1d21e7f8232da737a06e5afbfb1eaec05cde
Signed-off-by: Michał Kruszewski <mkru1992@gmail.com>
2017-03-20 13:44:58 +00:00
Piotr Mienkowski
b6480cd5ae flash: openocd: make 'make flash' target work without Zephyr SDK
At present 'make flash' target for boards that support flashing with
OpenOCD works only with Zephyr SDK. This patch enables flashing
without Zephyr SDK as long as openocd itself is installed.

Change-Id: I4594d795225e54b7638839d590e4c0620f9ca88c
Jira: ZEP-1893
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-03-19 20:22:22 +00:00
Kumar Gala
efc68b4faf dts/extract_dts_includes.py: Replace cell_prefix to cell_string
Only the IRQ prasing was using cell_prefix and cell_string does the same
thing so lets just use that everywhere.

Change-Id: I2ef9b1e2c1baef54b71d811c835b29a9ca8fe81b
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-03-16 22:16:24 +00:00
Patrice Buriez
82188ed651 scripts: add support script for 'make flash' over DFU
Flashing the Arduino 101 board over DFU can be tricky: the
dfu-util command line is cumbersome, and the reset button
must be pressed at the right time.

This script brings the convenience of 'make flash' for the
Arduino 101 board and for other boards that support the DFU
protocol. It checks whether the board is in DFU mode, and
prompts the user to reset it when needed.

The dfu-util command line is constructed from the following
environment variables, to be exported from the Makefile:
- DFUUTIL: path to the dfu-util executable, default: dfu-util
- DFUUTIL_PID: vendor_ID:product_ID of the board in DFU mode
- DFUUTIL_ALT: alternate setting name of the DFU interface
- DFUUTIL_IMG: path to the binary image sent to the board

Change-Id: Ia9577ec96102a92d4c60481f980f30f4f6e7cd9e
Signed-off-by: Patrice Buriez <patrice.buriez@intel.com>
2017-03-14 23:38:13 +00:00
Paul Sokolovsky
cb2ae52fae scripts: sanitycheck: Typo fixes in docstring.
Change-Id: I219d9f6af972b4090536fe83b6b93e6b7191572a
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-03-13 18:06:05 +03:00
Tomasz Bursztyka
e38a9e8b9c net: Switch from per-iface tx thread to a unique k_poll triggered one
Now that k_poll landed in the kernel, it's worth using it to save
memory and reduce the number of threads at runtime.

Such switch has been first done in bluetooth (see hci_core.c and conn.c
in subsys/bluetooth/host). Since network interfaces kind of follows the
same design for sending data, it was then easy to copy the same change as
in bluetooth.

Change-Id: I7f9734b88ac818284bbabaedc946b4765b905ebb
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-09 20:33:49 +02:00
Anas Nashif
3b3659c0d2 sanitycheck: run legacy tests only on daily basis
Change-Id: I3d928264cc47e8e71f05b691133814bcf8a0fd3f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-07 22:54:54 +00:00
Punit Vara
2c3a20b1ea boards: arduino_due: Add make flash support
This patch automates flashing process for arduino_due board. Just make flash will able
to flash binary file on the board.

Bossa tool(http://www.shumatech.com/web/products/bossa) manual flashing process is
automated through shell script and currently this binary is only available for
x86_64 architecture.

JIRA : ZEP-145

Change-Id: Ib7b525466239d0437e449c56827f8a9b3e5a96a1
Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-03-01 12:46:06 +00:00
Anas Nashif
6d72e63f81 sanitycheck: add _k_queue_area to recognised sections
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Change-Id: I2b5084e651d57ffeada38327c774af6471b43efc
2017-02-27 19:52:58 -05:00
Inaky Perez-Gonzalez
5907a56264 filter-known-issues: fix missing variable printing
This is a corner case that barely hits and thus we had not seen it
before.

Change-Id: Ie1420a4c866834e5a233985c6b8a19643426a1f5
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-02-27 21:51:47 +00:00
Marcus Shawcroft
f62e681a5c checkpatch: Recognized volatile as part of a declaration.
Adjust the checkpatch script to recognize the volatile keyword as
forming part of a declaration.  This prevents inappropriate checkpatch
gripes for patches such as:

https://gerrit.zephyrproject.org/r/#/c/10345/

Change-Id: Ia29a9002bb9ef15f747d29231d938ae12790724d
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-22 14:56:44 +00:00
Kumar Gala
d3d2fab1ba boards: Add panther & panther_ss to sanity
Change-Id: I08345fb1063a4ba38095fca6512c5b7eb3e96da8
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-02-20 15:41:31 +00:00
Anas Nashif
15a6598691 Merge "Merge remote-tracking branch 'origin/core'" 2017-02-15 04:33:25 +00:00
Kumar Gala
047ae4033c toolchain.gccarmemb: set DTC for building targets that use devicetrees
We default DTC to /usr/bin/dtc so we can build targets that are using
devicetree and not using the zephyr SDK (which provides a version of
dtc).

Change-Id: I84c3e3181eda75b4da715e16bbde2e67f28785e7
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-02-14 14:15:10 +00:00
Marcus Shawcroft
459e850429 scripts: Fix hardwired python path in extract_dts_include.py
Replace the hardwired #! python path with a PATH search.  This is
necessary to allow build tools to execute from a virtualenv.

Change-Id: Ib83131fd96656bc9f76c606356b1f92c877cc117
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-14 02:14:39 +00:00
Andrew Boie
1e4e68b52a sanitycheck: only disable tryrun when using SDK
Change-Id: I8018db62408240208b6f0b5e8f6f5ddf96d497f2
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 11:39:03 -08:00
Mazen NEIFER
e861775ebb xtensa port: Added arch .ini file to support xt-sim
Change-Id: I0c1fac867cde2c76975fda396b8f524240954be4
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 11:39:03 -08:00
Andrew Boie
60823c2325 sanitycheck: fix defconfig regex
By convention Kconfigs are in all uppercase, but not strictly
required to be so. Currently the Xtensa build defines
CONFIG_${XTENSA_CORE} which can have lowercase letters. This
is marked for cleanup in ZEP-1711.

Issue: ZEP-1711
Change-Id: Ia901ea1688202129f1629001a77f498522859f14
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 11:39:03 -08:00
Andrew Boie
dec83a7ac2 xcc: add ccache support
This toolchain Makefile defines CC/CXX directly so we need to add
a USE_CCACHE case here.

Change-Id: Iee8dc6ab030db8dc45b16e21c5b17864e51341b4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 11:39:02 -08:00
Andrew Boie
a95d524328 xt-run: don't leave dead emulator processes lying around
A ctrl-c in the script wouldn't terminate the child process.
Only do the pid trick if we're communicating with sanitycheck over
pipes.

Change-Id: I79da7362958b5fac00defd74d4b709076085575b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 11:39:02 -08:00
Andrew Boie
eb50958266 xt-sim: add support for 'make debug'
Change-Id: I60b64c6b8c83e1e1c49d8cb2c5f857faee88a7a0
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 11:39:01 -08:00
Mazen NEIFER
a6746c83ba Xtensa port: Removed unsupported c++ flags cuasing xt-c++ to throw an error.
Manu command lin eoption are not supported by xt-c++. There are filtered out
when calling Makefile.toolchain.xcc.

Change-Id: I1e60843d2b23f90250fbb493487c6fc838b7485a
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
0cbf12489e Xtensa port: xt*-run requires options to be passed before file to be ran.
If passed after the file they are just ignored silently!

Change-Id: Ic9b04c3023e4d312382850fa5e1b5ae4ef555856
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
8f1dd3a6e5 sanitycheck: Fixed displayed log when current directory is a symbolic link.
When current directory is a symbolic link or in a symbolic link then os.getcwd
return the real path leading to os.path.relpath returning not so nice relative
path.

Change-Id: I3e24d3e6f1fe7185992f64803d3728e9588d67e1
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Andrew Boie
495d922406 xt-run: fix sanitycheck communication
Sanitycheck actually creates the pipes, using a naming convention imposed
by QEMU. We also need to leave a PID file.
'xt-run' Make target removed, we don't need it.

Change-Id: Ie9fd9dbb1327eb4b10424e7ee5d2f4dc09b121a4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
b012aa1901 Xtensa port: Use directly assmebler and linker instead of via the compiler.
This allows handling options like --fatal-warnings that are passed by
sanitycheck.

Change-Id: Ia78dcef480d9d81cab6051453204c05d52917af2
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Andrew Boie
e536b270f0 sanitycheck: don't disable tryrun
This completely breaks all the cc-option checks. It's not clear
why this was done for everyone running sanitycheck.

Change-Id: I3f944423869ccb15fab29c28130820a93cd94917
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 08:04:27 -08:00
Andrew Boie
9d8d026294 xt-run: delete any stale fifos to avoid mkfifo error
Change-Id: I53d56587a0b90da273e118bd5b9e051aa2451d8f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 08:04:27 -08:00
Andrew Boie
2b2763aa95 xcc: add location of C++ compiler
Change-Id: I5b6ee6e9d424f401cca0e9d360555ff6cf94f504
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
7f046378eb sanitycheck: support other simulators (xt-run and/or xtsc) than QEMU.
In scripts/Makefile.qemu, the target qemu is already an alias for taget run.
In scripts/Makefile.xt{,sc}-run there is no target qemu but a target run.

Change-Id: Ib9dce3561ef9367b17d30070354e709df4d7e528
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
0efb2313ca Xtensa port: Let xcc specific make file override unsupported -Og with -O0.
Change-Id: If1a1833b5ce09c7112245b8b73c0ccd28be66c88
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
ffd4eb9272 Xtensa port: Changed simulation support with xt-run/xtsc-run to be qemu like.
Change-Id: I1626a5cd75d17bc4f72d4a638484f87956f9e703
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
e8813d6fe5 Xtensa port: Define __builtin_unreachable() as CLI macro when using XCC.
XCC does not recognize __builtin_unreachable() and thus cause a link error.

Change-Id: I5dadf5a49d971d5e0a5ef88d582bb5ad2c36bced
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
aa1e95bfb2 Xtensa port: Moved XCC specific libraries out of genric Xtensa make file.
These libraries are unlikely to be uesd by GCC port and thus should not be in
a generic make file. Moved to specific toolchain make file.

Change-Id: Ib585b87700e409d678f7a5cb60cff67b6022ab05
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
0e0e0950dd Xtensa port: Fixed typo in XCC toochain specific make file.
Change-Id: I3ce26e8c047e743bb73fc2e75647788481b2490a
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
0b4adc398d Xtensa port: Added support for XCC, the Cadence Systems Inc compiler
Change-Id: I6947519be1d3b155e4501950ee1303c40a4e5b16
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Anas Nashif
1208bab079 add curie_ble board for all curie based boards
Change-Id: Id87839f80db00da499077ac1c2bb8f588fcf3f06
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-11 07:20:03 +05:30
Anas Nashif
abbd2129ed boards: add tinytile board
Change-Id: I9661c21c25761e29b695f78236df4e44192f367f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-11 07:16:31 +05:30
Vincenzo Frascino
ae5dbe47f6 arm: dts: Add base DTS support for v2m_beetle
This patch adds the base DTS support for the V2M Beetle board.  The
initial set of changes include SRAM, FLASH, and IRQ controller support.

Change-Id: I06685622b9c57ac358544c71350074ce06e3371e
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-02-10 18:14:03 +00:00
Andy Gross
bb063164aa dts: Add support for Device Tree
This patch adds support for using device tree configuration files for
configuring ARM platforms.

In this patch, only the FLASH_SIZE, SRAM_SIZE, NUM_IRQS, and
NUM_IRQ_PRIO_BITS were removed from the Kconfig options.  A minimal set
of options were removed so that it would be easier to work through the
plumbing of the build system.

It should be noted that the host system must provide access to the
device tree compiler (DTC).  The DTC can usually be installed on host
systems through distribution packages or by downloading and compiling
from https://git.kernel.org/pub/scm/utils/dtc/dtc.git

This patch also requires the Python yaml package.

This change implements parts of each of the following Jira:
ZEP-1304
ZEP-1305
ZEP-1306
ZEP-1307
ZEP-1589

Change-Id: If1403801e19d9d85031401b55308935dadf8c9d8
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2017-02-10 18:13:58 +00:00
Anas Nashif
648ecef7bd sanitcheck: add sam_e70_xplained
Change-Id: Ic16f6132b701b4e2079939302473e5e5b295dc59
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-04 02:57:49 +00:00
Anas Nashif
268fa152f2 scripts: add configuration file for uncrustify
Use this configuration file with the uncrustify tool to fix style
issues. the configuration should apply the zephyr coding style on
source code files with a few minor excrption. Do not take the output for
granted, always check for correctness after running.

To use, for example:

uncrustify --replace --no-backup -l C -c $ZEPHYR_BASE/scripts/uncrustify.conf

This will do the changes inline.

Change-Id: Iecfd2e10bc7e475ca83de0d921ebb5d72156d286
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-04 01:46:29 +00:00
Andrew Boie
f7a6e28a3c sanitycheck: don't override environment for USE_CCACHE
Many users set USE_CCACHE=1 in their envionment. Sanitycheck was
disregarding that and placing USE_CCACHE=0 in the generated
Makefile unless --ccache was added to the command line every time
it was invoked.

Issue: ZEP-1663
Change-Id: Id3c1379f5039d4d2f4a3ae01d2ec8d0dd216f523
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-02 13:09:00 -08:00
Anas Nashif
8436c0a967 toolchain: define DTC for zephyr SDK
Change-Id: I34a6d23a3f0f4385b41896ceb8477bc441f3a33e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-30 21:45:05 +00:00
Leandro Pereira
ca42e85bcd scripts: Add device tree parser script
As decided during the Zephyr Mini Summit in December 2016, we're going
to use the same Device Tree format as used by the Linux kernel to store
device configuration from vendors.

This is a parser written during the summit that will parse *.dts files,
and will be used as part of the solution to read in the files provided
by manufacturers and generate board configuration files.

The script will also optionally generate files in the DOT language so
that DTS files can be graphed using the Graphviz suite.

Change-Id: I6e2b7a64a6dcc349b2888332a660b4700af6cd63
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-01-30 20:51:21 +00:00
Anas Nashif
d159c8e476 Merge "Merge arm branch into master" 2017-01-30 18:22:45 +00:00
Maureen Helm
2c1e318389 frdm_kw41z: Add frdm_kw41z board
Adds initial support and documentation for the frdm_kw41z board.

- Configures the kw41 to use the 32 MHz external oscillator on the board
  to generate a 40 MHz system clock. The clock settings match the MCUX
  SDK hello_world example project.
- Provides pinmux settings for the uart, i2c, LEDs, and switches
- Enables pinmux, gpio, uart, and i2c driver instances
- Configures the fxos8700 accelerometer/magnetometer driver

Jira: ZEP-1390
Change-Id: I025a0eae3d380eaf90b02683acf5c592e2204a2e
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-30 11:02:35 -06:00
Andrew Boie
ded842ec89 Revert "Revert "sanitycheck: add support for risc v boards""
This reverts commit 9fb0c2af5c.
SDK 0.9 has now been released.

Change-Id: I676b6f0e31ab48fde3dda41b681abf53964ea9f9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-01-30 08:58:36 -08:00
Andrew Boie
9fb0c2af5c Revert "sanitycheck: add support for risc v boards"
The 0.9 SDK is not released yet!!

This reverts commit 7995e6207c.

Change-Id: I550d1aa27ba7a06ff2cda09496ceb92645a17460
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-01-24 16:50:58 -08:00
Anas Nashif
7995e6207c sanitycheck: add support for risc v boards
Change-Id: I9d51be1d284b31f7ea84868bf09ce5b5a6afa004
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-25 00:08:48 +00:00
Inaky Perez-Gonzalez
e45f05bc1e filter-known-issues: add warning support, clean up, add more help
Introduce support to tag some issues as warnings, that can be printed
but not considered errors.

Added the ability to write the errors and warnings to split files, for
later reporting.

Added a more consistent help.

Change-Id: Ia75430c3337385afca59595437168ab643c92911
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-01-24 13:44:48 +00:00
Jon Medhurst
ac4bfe49d1 boards: arm: Add board for MPS2 with AN383
ARM's Cortex-M Prototyping System (MPS2) is a board with an FPGA that
can be programmed with different 'SoCs'. To use these in Zephyr we need
a set of board files for each variant.

This adds a board for a variant which implements a Cortex-M3 CPU; the
naming of this matches that used for the Zephyr SoC (which is itself
based on ARM's documentation nomenclature).

Change-Id: Ie02a67a03016b8aeee31e3694f0edbcc37f9ee64
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2017-01-23 15:15:54 -06:00
Adam Podogrocki
d8992f576e boards: add initial support for STM32373C-EVAL with SoC STM32F373VC
Change-Id: Iec92b0c7e2c244bd82ee9c318f6f2cb3ed2d7397
Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2017-01-23 15:15:53 -06:00
Adam Podogrocki
5f2fa051a6 boards: add initial support for Nucleo-64 with Soc STM32F334
Change-Id: I0b9992e26353cea3b0415aa57ab3b983d84cef05
Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2017-01-23 15:15:53 -06:00
Anas Nashif
c9c36f15de build: have sysgen create SPDX license identifiers
Jira: ZEP-1593
Change-Id: I9b1f1d26f18b0e4da2ab2110416a4e60e3889f29
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-20 02:29:41 +00:00
Andrew Boie
b739acf5cd gen_idt: show vector assignments in debug output
Change-Id: I3099e56b480cc0e939a37efbf57e0700251d039a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-01-19 20:16:08 +00:00
David B. Kinder
ac74d8b652 license: Replace Apache boilerplate with SPDX tag
Replace the existing Apache 2.0 boilerplate header with an SPDX tag
throughout the zephyr code tree. This patch was generated via a
script run over the master branch.

Also updated doc/porting/application.rst that had a dependency on
line numbers in a literal include.

Manually updated subsys/logging/sys_log.c that had a malformed
header in the original file.  Also cleanup several cases that already
had a SPDX tag and we either got a duplicate or missed updating.

Jira: ZEP-1457

Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-19 03:50:58 +00:00
Andrew Boie
7a992aebac sanitycheck: improve terse output
Values now spaced 4 apart since we commonly build thousands of
tests.

Percentage complete indicator added.

Change-Id: Ia7454dc1e8cc0701dc74dc8a4f6e7a37706524e8
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-01-18 18:47:38 +00:00
Andrew Boie
18ba153300 build: remove obsolete sections from linker scripts
These were causing some issues in the old kernel, but the unified
kernel no longer uses these.

Issue: ZEP-513
Change-Id: I87216565231cd244886fbffe4b4d420d1687b245
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-01-18 18:47:17 +00:00
Anas Nashif
bfcdfaf941 sanitycheck: riscv: add vector to recognised sections
Change-Id: I7f1692eb1bd51b8efc16919780aebaf890b8872c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-13 20:00:16 +00:00
Jean-Paul Etienne
ba776a1fd1 scripts: added Makefile to handle an external riscv32 toolchain
Compiling Zephyr with an external riscv32 toolchain would
require the following env variables to be exported:

export ZEPHYR_GCC_VARIANT=riscv32
export RISCV32_TOOLCHAIN_PATH=/PATH/TO/TOOLCHAIN/BINARY

Change-Id: I2072ed9079a4cabd27837ab39b947bc0a0a1a8b4
Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-01-13 19:52:22 +00:00
Anas Nashif
a1ae7f565b Merge "Merge arm branch into master" 2017-01-12 18:23:39 +00:00
David Brown
8405ce13a1 scripts: Explicitly call out python2
At least one Linux distribution (Arch) has made python 3 the default
interpreter, and Debian and Ubuntu have expressed a desire to eventually
make this the case.  As such, invoking 'python' or '/usr/bin/python'
will possibly run python 3 instead of version 2.

Distributions have included a 'python2' link for quite some time now,
and given that we have some scripts that require python 3, we should be
explicit about those that require python 2.

In addition, be more consistent about how python is invoked, preferring
the:

  #!/usr/bin/env python2

construct rather than a hardcoded path to python.  This allows the user
to have an alternative python in their path that will be used in
preference to the system provided version.

Jira: ZEP-1548
Change-Id: I125c2af808dc268f74277bc97a092df3acad23c0
Signed-off-by: David Brown <david.brown@linaro.org>
2017-01-12 10:28:02 -07:00
Adam Podogrocki
7aeea1a124 boards: add initial support for STM3210C-EVAL board with SoC STM32F107VC
Change-Id: Ib120e0088b009d1e07a756470742fb29a606857e
Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2017-01-12 09:46:27 -06:00
Andrew Boie
822b08711f sanitycheck: properly identify when QEMU crashes out
This had been erroneously reported as a build error.

Issue: ZEP-1460
Change-Id: Idddaf833011beb1165bd766dd115c021c5b90cdf
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-01-11 14:03:39 +00:00
Andrew Boie
d01535cbb6 sanitycheck: don't explode if log data can't be read
Issue: ZEP-723
Change-Id: I5d2b2e756fed7e2906da1e84c2da332682893660
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-01-11 14:03:33 +00:00
Anas Nashif
2bc9d69981 build: abstract emulation and replace qemu goal with run
This will replace the current goal of 'make qemu' with 'make run' and
moves Qemu handling into its own file and into the boards instead of
being architecture specific.

We should be able to add new boards that support some other type of
emulation (by adding scripts/Makefile.<emu type>) and allow the board to
define their own options for the use type of emulation.

'make qemu' will still work, however it will be deprecated, starting
with this commit it is recommended to use 'make run'.

Jira: ZEP-359
Change-Id: I1cacd56b4ec09421a58cf5d010e22e9035214df6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-10 20:20:47 +00:00
Anas Nashif
6d9ed994aa build: use target 'debugserver' for Qemu debugging
Use the existing debugserver target also for Qemu debugging. Qemu
should be maintained as one of many emulation/simulations platforms and
emulation should be abstracted in the Makefiles and not tied to Qemu.

qemugdb will still work, it is however being deprecated.

Change-Id: I0cd10fb66debb939b8f7f1304bf2ef4605da6a1d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-10 20:20:46 +00:00
Anas Nashif
6d4ff2303e sanitycheck: reduce number of unnecessary configuration builds
When running a reduced set of tests with --platform-limit or using the
default of 1 we build the configuration (make initconfig) for all
platforms, although we are only interested in a limited set. On my
machine this is 100s of build time for configurations we are never going
to use.
This reduces the number of builds to what we really need and speeds up
sanitycheck runtime overall.

Might need a few more optimisations.

Change-Id: I813fabf1453f19ce7a83b28e4792b5c80616d936
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-05 02:05:58 +00:00
Juro Bystricky
30093f13ca Makefile.toolchain.zephyr: Modifications for SDK 0.9
Various changes required by new SDK 0.9:

1. Renamed toolchain vendor name ("poky" -> "zephyr")
2. Toolchains now 64 bit, previously 32 bit
3. New toolchain for Xtensa
4. New toolchain for RISC-V

0.8.2 is still supported.

Change-Id: Icfd4cc44ef643da0f3840b33d6dfc4b3c99dfa9a
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-01-04 14:16:12 -08:00
Inaky Perez-Gonzalez
9a36cb6456 sanitycheck: add --log-file to log everything to a file too
Currently CI plays tricks with `tee` to capture the output and post
process it. This makes it more complex to handle and easier for it to
fail in ways it should not.

So add a simple log capture option sanity check that mirrors the
stdout output, removing color encoding for errors.

Change-Id: I6de0b6cfe4da9c289f537979545dddbcd49cf834
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-01-03 19:21:31 +00:00
Kumar Gala
60a079cb2c Revert "sanitycheck: reduce number of unnecessary configuration builds"
This reverts commit 4e2cf33d9d.

The change does not work correct if we have a filter and specify a
specific platform, such as:

./scripts/sanitycheck -p 96b_nitrogen -i -s samples/hello_world/test_singlethread

Change-Id: I43a4f25ed25c8fe5379cda23b6dbfa8f9ae5cb0d
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-12-30 09:43:48 -06:00
Anas Nashif
4e2cf33d9d sanitycheck: reduce number of unnecessary configuration builds
When running a reduced set of tests with --platform-limit or using the
default of 1 we build the configuration (make initconfig) for all
platforms, although we are only interested in a limited set. On my
machine this is 100s of build time for configurations we are never going
to use.
This reduces the number of builds to what we really need and speeds up
sanitycheck runtime overall.

Might need a few more optimisations.

Change-Id: I53d6bacf66045dde7baabbaa40b4fbfc4a01782a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-28 19:51:43 +00:00
Anas Nashif
5312754988 sanitycheck: remove kernel keywords
Change-Id: I076491f58147ffc70d84b62e1d78b4ae419add7b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-28 18:38:46 +00:00
Javier B Perez
814534ba4e compare footprint: add sanity args files
Added sanity args to be used by the compare footprint.
Please notice that compare footprint use sanitycheck to
build footprint apps for base commit and for current commit.
This in order to collect the information and generate the diff.

Change-Id: I6f86bbfa020999b3f26e93a608fc7b34ee508e10
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-12-21 13:46:56 +00:00
Kumar Gala
f4df430bac sanity_chk: add nucleo_f411re to arm list of boards for sanity
Change-Id: I34d3c7a7dd8dc53e6c592fc9339c656a39aeeb3b
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-12-20 09:15:28 -06:00
Carles Cufi
429bea5381 boards: arm: Add support for the Nordic pca10056 PDK
With the appearance of the nRF52840 IC a new Preview Development Kit
(PDK) board has been introduced. This patch adds basic support for this
new board.

JIRA: ZEP-1418

Change-Id: If5845e75312ec756b968e595e5dc31c4c9624be2
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-12-20 09:14:48 -06:00
Anas Nashif
569f0b4105 debug: move debug features from misc to subsys/debug
Change-Id: I446be0202325cf3cead7ce3024ca2047e3f7660d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-19 19:58:40 +00:00
Anas Nashif
095112516a scripts: remove old qemu patch
This patch does not apply anymore. A patched qemu already exists in the
SDK.

Change-Id: Iee18550a7b9288a1db2a6ecc4378ff554b240229
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-12 20:25:06 +00:00
Neil Armstrong
afe71f61e7 nucleo_l476rg: add board support
Add board support for the Nucleo64 L476RG development board.

Change-Id: Ibb5424bc936c67a5d96855617202136d7dea772c
Signed-off-by: Fabien Parent <fparent@baylibre.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2016-12-06 10:31:45 -06:00
Anas Nashif
70f9244db7 Merge "Merge net branch into master" 2016-12-05 15:56:26 +00:00
Anas Nashif
a224a9a67a sanitycheck: update footprint data
Change-Id: I9b400a2f2ae1a1a2739e9c96eb4b9ebc098d998a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-03 00:09:40 +00:00
Jukka Rissanen
8e84e36f14 net: Declare a macro to define stacks used by networking
The macro defines the stack as usual, but if user has
enabled net shell (CONFIG_NET_SHELL), then additional
information about the stack is stored in net_shell
linker section. The information in the net_shell linker
section is then used to print information about the
stacks in the networking sub-system.

Change-Id: Ic6e9f16a73a192b9a59d32a6d0070322382f98bd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:14 +02:00
Jukka Rissanen
dbb3988ee6 net: Remove nbr_data section as it is useless
No need to store the nbr pool data into a dedicated section
as we have only one nbr pool defined.

Change-Id: I6f2afcce57b5f588878496bf085567b938e32c80
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:27 +02:00
Tomasz Bursztyka
b56c4df869 sanitycheck: Add support for section net_l2_data
We missed that section, so sanitycheck was failing.
Also putting the right section in the relevant array.

Change-Id: I361ffa1707c01f0d3c870a7bc36a86ada66af1d2
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:23 +02:00
Tomasz Bursztyka
11f572c9e1 sanitycheck: Recognize native IP stack specific sections
Without these, test case will fail miserably.

Change-Id: Ib46d167b8782c33362ac6edb9d8c50abc25908c0
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:13 +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
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
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
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
Juan Manuel Cruz
7f1c76f2bf win-build: Fixes a kconfig incompatibility for Windows
In windows systems the rename() function fails if the new name
of the original file corresponds to a file that already exists.

The fix removes the new file before renaming the original one.

Jira: ZEP-980

Change-Id: Ib3a43db86c0dd3fabb592f53ea7619eb5738bb65
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-11-18 23:22:21 +00:00
Inaky Perez-Gonzalez
ababbf7815 scrips/kconfig: use snprintf() vs sprintf()
Coverity reported 150819 issue, which steams off Flex generated code
from zconf.l in which sprintf() was use. Because of that, the
conf_read_simple() @name parameter could be used to overrun
zconf_open() @fullname by crafting SRCTREE and KCONFIG_ALLCONFIG
environment variables.

Change-Id: I2cff817dccafe0e06b35636bbb7be95e062410af
Coverity-ID: 150819
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-11-18 23:04:32 +00:00
Benjamin Walsh
59a382e339 kernel: remove last instances of tNANO in comments
Change-Id: I3d533b819422d4b754afb81d3ea67c03bc7f5630
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-11-14 10:30:24 -05:00
Anas Nashif
f23b038431 tests: update sanitycheck footprint baseline
Update file to catch any regressions and major changes during
stabilisation period.

Change-Id: Id30dd1827034b96c5478c78f9c388384f51bcbec
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-13 09:27:02 -05:00
Benjamin Walsh
f6ca7de09c kernel/arch: consolidate tTCS and TNANO definitions
There was a lot of duplication between architectures for the definition
of threads and the "nanokernel" guts. These have been consolidated.

Now, a common file kernel/unified/include/kernel_structs.h holds the
common definitions. Architectures provide two files to complement it:
kernel_arch_data.h and kernel_arch_func.h. The first one contains at
least the struct _thread_arch and struct _kernel_arch data structures,
as well as the struct _callee_saved and struct _caller_saved register
layouts. The second file contains anything that needs what is provided
by the common stuff in kernel_structs.h. Those two files are only meant
to be included in kernel_structs.h in very specific locations.

The thread data structure has been separated into three major parts:
common struct _thread_base and struct k_thread, and arch-specific struct
_thread_arch. The first and third ones are included in the second.

The struct s_NANO data structure has been split into two: common struct
_kernel and arch-specific struct _kernel_arch. The latter is included in
the former.

Offsets files have also changed: nano_offsets.h has been renamed
kernel_offsets.h and is still included by the arch-specific offsets.c.
Also, since the thread and kernel data structures are now made of
sub-structures, offsets have to be added to make up the full offset.
Some of these additions have been consolidated in shorter symbols,
available from kernel/unified/include/offsets_short.h, which includes an
arch-specific offsets_arch_short.h. Most of the code include
offsets_short.h now instead of offsets.h.

Change-Id: I084645cb7e6db8db69aeaaf162963fe157045d5a
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-11-12 07:04:52 -05:00
Anas Nashif
ff23cb58a8 build: support pre-built host tools
Right now the build system builds the host tools over and over again, in some
environments especially when running in an IDE on windows for example,
this is not desired and a set of pre-built host tools should be used.

Provide an option to use pre-built tools instead of building them
from source.

To use, set PREBUILT_HOST_TOOLS to the path where all pre-built host tools
are hosted. To get a prebuilt version of the host tools, build without the
variable set and copy the generated host binaries from outdir. The following
tools are supported:

* conf
* fixdep
* gen_idt
* gen_offset_header

Jira: ZEP-237
Change-Id: Iea505bfd0b50f851ee2781b5117bb6085ab20157
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-12 00:34:03 +00:00
Vincenzo Frascino
1d2fcc2254 board_beetle: Add support for ARM V2M Beetle Board
Add board support for ARM V2M Beetle platform.

ARM V2M Beetle board is build around the ARM Beetle Cortex-M3
based processor.

The support has been tested in nanokernel mode with the bringup
application that will be pushed with a future patch.

Jira: ZEP-1245
Change-Id: Ib05a40c072f10149e692283177387cf2cfe32f66
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-11-11 20:39:54 +00:00
Anas Nashif
0f3d5478a8 checkpatch: update with latest checkpatch from the linux kernel
Update with commit 577f12c07e4edd54730dc559a9c7bc44d22bf7dc from
the Linux kernel.

Change-Id: Ie2cabbfea415d26ffacef340d9497342b496dc29
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-11 14:27:39 +00:00
Anas Nashif
49598db96d Revert "checkpatch: update with latest checkpatch from the linux kernel"
This reverts commit 0c9152d42d.

This was not ready for merge yet.

Change-Id: I08f69e27929867606bc58cdeffed6540725069a1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-10 12:48:33 -05:00
Anas Nashif
0c9152d42d checkpatch: update with latest checkpatch from the linux kernel
Update with commit 577f12c07e4edd54730dc559a9c7bc44d22bf7dc from the Linux
kernel.

Change-Id: I6314dd41eb200c87cdcc6f212f13d3351128de0d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-10 17:24:44 +00:00
Kumar Gala
126fa0073b sanitycheck: Add bbc_microbit to list for platforms
Change-Id: I2afd9f04e1a88b0b7c0ec600cffea18c1b86a3e8
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-11-10 16:58:26 +00:00
Johan Hedberg
dad2a77e6b boards: Add support for Quark SE C1000_BLE
The Quark SE C1000 BLE Core is a nRF51822-QFAA, with 16kB of RAM and
256kB of flash. The configuration is otherwise similar to the Arduino
101 BLE, except that the UART RTS pin is the same as that used by
nrf51_pca10028.

Change-Id: I88cb18876bdde65abcf9a499894f70802046c824
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-08 15:00:00 +00:00
Sakari Poussa
1bfdfbf384 c++: enable subdir-cxxflags
Similar to C subdir-ccflags, enable similar C++ variable subdir-cxxflags

Change-Id: I4355817bc2d6a80a3eebba9b87fbf54725dda5e7
Signed-off-by: Sakari Poussa <sakari.poussa@intel.com>
2016-11-08 13:30:28 +02:00
Andrew Boie
b4cc4c9bea sysgen: build for unified kernel only
sysgen will also now re-run if the build system detects that
the script itself has changed.

Change-Id: I2bf5c4893da088fa27729bc6337bc66cc4cee341
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-04 19:19:17 +00:00
Andrew Boie
4187822d08 sanitycheck: build for unified kernel only
Change-Id: I3bd744b10341bc7292fb0670faf217933efe9edc
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-04 18:32:15 +00:00
Gil Pitney
10ea5d01c6 boards: arm: Add support for TI SimpleLink WiFi CC3200 LaunchXL
Added Kconfig and makefiles to be able to build a Zephyr application
on Linux/gcc, and load via OpenOCD.

Validated by running the hello world, and philosophers microkernel
samples, and stepping through the code in gdb.

Jira: ZEP-1109

Change-Id: If5d3e7b1a8ecf5ecf6a00f147742b3bc5716190f
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2016-11-04 09:38:51 +00:00
Benjamin Walsh
5ce3be75aa unified/sysgen: do not generate TICK_EVENT event
Sysgen was still generating the TICK_EVENT event needed for the
microkernel system clock timer driver in the unified kernel. That ended
up dragging in alerts all the time, which in turns drag in the system
work queue, which drags in the work queue, which drags in FIFOs.

This shaves 1052 bytes of RAM and 860 bytes of ROM in systems that don't
need these components (on x86 with IAMCU).

Change-Id: Ica56857da2b6444181f10e83f6c986d092aa967b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-11-03 23:06:42 +00:00
Kumar Gala
a3e23bc022 sanitycheck: enable missing ARM platforms
Now that these platforms pass sanitycheck add them into the list of
platforms we support

Change-Id: If559c80e107505e6b98f81c0e94b9862618b1735
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-11-03 19:20:20 +00:00
Allan Stephens
3f5c74c922 unified: Add linker script support for all kernel object types
Enhance the linker script so that all statically-defined kernel
objects of a given type are co-located.

Note 1: This capability is needed so that static kernel objects
can be added to the associated object tracing list. (Some kernel
object types are already co-located to permit the kernel to do
other initialzation on statically-defined objects.)

Note 2: A follow-up commit is needed to ensure statically-
defined kernel objects are placed in the sections referenced
in the linker script.

Note 3: The legacy script info remains for now to allow
applications using the microkernel or nanokernel to continue
to build.

Change-Id: I40d831f9e183fb121c950e30fa8298b6d529375b
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-02 21:56:26 +00:00
Yael Avramovich
d5db35204a console: shell: Support multiple modules
Ability to use Zephyr shell by multiple modules simultaneously, each
module for its own usage.

Old shell implementation enabled the user to call only one module
commands, not all of the modules simultaneously.

Change-Id: I0ef8fa2fd190b7490c44fe91d1016363258302c9
Signed-off-by: Yael Avramovich <yael.avramovich@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-02 00:23:18 +00:00
Gil Pitney
304e5a69bf Makefile: Fix clobber of LIB_INCLUDE_DIR during second pass
The commit:
commit f25ac092b9
 "Makefile: Restructure for multilibs"

breaks external HAL library linking, by overriding, in the
the second Makefile pass, the LIB_INCLUDE_DIR variable
set in the first Makefile pass from ext/hal Makefiles.

This breaks use of the CONFIG_CC3200SDK_LIBRARY=y option in
the cc3200 SDK, and also likely the QMSI ext/hal/qmsi/Makefile,
when CONFIG_QMSI_LIBRARY=y is set.

This commit just changes the '=' to "+=".

Jira: ZEP-1163

Change-Id: I1aaaaee57378dcd01ab6f2ed4799281b2337eea2
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2016-11-01 23:51:02 +00:00
Peter Mitsis
058fa4e493 unified: API changes to event handling
Allows event objects to pend signals in a cumulative way using
the semaphore in a non-binary way.

Jira: ZEP-928
Change-Id: I3ce8a075ef89309118596ec5781c15d4f3289d34
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-11-01 16:27:41 -04:00
Flavio Santes
70ff94c42a scripts: Update fixdep from kernel.org
This commit updates fixdep.c from the Linux Kernel, stable v4.8.5.

Origin: https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/plain/scripts/basic/fixdep.c?id=refs/tags/v4.8.5

Jira: ZEP-737

Change-Id: If75d0abb22f98bae74a801aea53218039107dd65
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-10-31 20:58:57 +00:00
Andrew Boie
f1c373c2d5 unified: handle MDEF files that declare main()
Before, the kernel would run the main() function twice; first
as an entry in k_task_list, and then again from _main(). The
_main() invocation would be using a potentially insufficient stack
size.

Now if an MDEF file declares a main() thread, invoke it from
_main(), but honor the desired priority and stack size.

Issue: ZEP-1145
Change-Id: I1abf38fc038e270059589b11d96fae1b3f265208
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-10-28 21:54:38 +00:00
Andrew Boie
c9985d74b0 REVERTME: disable sanity for arduino_101_ble
This is broken currently.

Change-Id: I97bbc8c3c6aa8f5328fa651f5d7fb8d4ad03ded6
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-10-28 13:48:38 -07:00
Amit Kucheria
eb0f8ab9fc boards: 96b_carbon: Add support for 96boards Carbon board
Add support for the STM32F401 chip on the board

Change-Id: I96c0799f3658ecea096fa5971bce9faf21919ee1
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-10-28 18:58:06 +00:00
Ricardo Salveti
779fb0586a boards: nucleo_f401re: add new board
Add configuration for Nucleo-64 F410RE board.

Change-Id: I88b06d87f0fc62b941241cc2f374b8541de86e00
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-10-28 18:58:05 +00:00
Benjamin Walsh
31a3f6a70e unified: rename 'events' to 'alerts'
Event is such an overloaded and generic term (event logger, *kernel*
event logger, "protocol" events in other subsystems, etc.), that it is
confusing for the name an object. Events are kinda like signals, but not
exactly, so we chose not to name them 'signals' to prevent further
confusion. "Alerts" felt like a good fit, since they are used to "alert"
an application that something of significance should be addressed and
because an "alert handler" can be proactively registered with an alert.

Change-Id: Ibfeb5eaf0e6e62702ac3fec281d17f8a63145fa1
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-10-28 18:44:18 +00:00
Benjamin Walsh
7ef0f624a7 unified: rename 'memory maps' to 'memory slabs'
This better aligns with the actual functionality of the object.

Change-Id: I70abf54f994e92abd7367251089ea4f735d273fe
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-10-28 18:44:18 +00:00
Kumar Gala
d5719a64c6 sanitycheck: Add support for ccache
Add a ccache option to allows enabling the use of ccache for builds
generated by sanitycheck.

Change-Id: Ia997ed29f38a3d2d71ba143456e6fcbc5946d56e
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-10-28 17:04:27 +00:00
Anas Nashif
f8dcad4a5b sanitycheck: filter out the prebuilt.elf introduced by Makefile cleanup
commit 018b831a36 keeps another elf file in the
outdir which confused the sanitycheck script.

Change-Id: I87a9bcee6afe6526ecc24f1f5d9cf38101247ce2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-27 18:30:27 -04:00
Anas Nashif
5662110ec4 ci: sanitycheck: now that we do not run footprint script, reenable those
build footprint test as part of the main sanitycheck job, we do not run
the script comparing footprint anymore, it will move to somewhere else.

Change-Id: I36d475bfc3d985bf06a872649eae8c19e1a43aa4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-27 22:12:32 +00:00
Andrew Boie
779aa6ec0b sanitycheck: remove default qemu_support=false
This directive is the default, no need to have an ever-expanding
enumeration of these.

Change-Id: Ic5147fe04de033cb7e97fc5cbe45edd1779d1120
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-10-27 20:54:44 +00:00
Johan Hedberg
9702b83ef2 boards: Add board definition for the BLE core on Arduino 101
The BLE core on the Arduino 101 is an nRF51822 QFAA (256kB flash, 16kB
RAM).

Change-Id: Ia802b3eb634c0cd6775c4059c9569bccd915a578
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-26 17:35:58 +00:00
Anas Nashif
aabbdb79e6 scripts: limit compare_footprint script to a defined group of boards
This script is part of the CI job and currently is run on all defined boards.
We are limited on resources in the CI infra and this part is taking way too
much time. We now select a group of boards to look at instead of just building
everything.

Change-Id: Ifd634e74426c9cc801032b26ad9a9a94a0e55960
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-26 17:18:38 +00:00
Andrew Boie
431607c20a nios2: port to unified kernel
With this patch we introduce unified kernel support for NIOS II.
Not all test cases have been ported, but the following command
currently succeeds with 43/43 passing test cases:

 $ sanitycheck --arch=nios2 -xKERNEL_TYPE=unified \
         --tag=unified_capable

Issue: ZEP-934
Change-Id: Id8effa0369a6a22c4d0a789fa2a8e108af0e0786
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-10-26 17:10:13 +00:00
Szymon Janc
50b9317832 sanitycheck: Add support for unified kernel
This fix sanitycheck for apps that specify unified kernel.

Change-Id: I3f1c4d5a566f6833e56bbda097cb497ccdbfbec9
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2016-10-25 19:01:28 +00:00
Javier B Perez
3daf30c912 sanity: add unified args
Added unified kernel args in zephyr tree.

Usage:
source zephyr-env.sh
sanitycheck +scripts/sanity_chk/sanity_unified.args

Change-Id: I5bc087dbdcfffe3197bb8b4608206bb8f56810c2
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-10-25 11:08:19 -05:00
Genaro Saucedo Tejada
28bba92dc0 sanity: Load arguments from files
Python module argparse has a feature to load arguments from a file.
This commit enables such feature on sanitycheck script so files
prefixed by + (plus sign) are loaded during argument parsing stage
and included as arguments to such script.

Jira: ZEP-122

Change-Id: Ibb0a6e8464218a4f58ce4044a5a0860dc5b32480
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2016-10-25 13:05:36 +00:00
Allan Stephens
480a131ad9 unified: Support heap memory pool
Fleshes out the prototype heap memory pool support
to make it fully operational. Noteworthy changes are
listed below:

Tweaks arguments to k_malloc() and k_free() to be more like
malloc() and free(). Similarly, modifies k_free() to take
no action when passed a NULL pointer.

Now stores the complete block descriptor at the start
of any block allocated from the heap memory pool. This
increases memory overhead by 4 bytes per block, but
streamlines the allocation and freeing algorithms. It also
ensures that the routines will work if the block descriptor
internals are changed in the future.

Now allows the heap memory pool to be defined using the
HEAP_MEM_POOL_SIZE configuration option. This will be the
official configuration approach in the unified kernel.

Also allows the heap memory pool to be defined using the
(undocumented) HEAP_SIZE entry in the MDEF. This is provided
for legacy reasons only.

Co-locates memory pool initialization code to keep the line
that causes memory pool initialization to be done during booting
right next to the routine that does the initialization.

Change-Id: Ifea9d88142fb434d4bea38bb1fcc4856a3853d8d
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-25 00:10:34 +00:00
Kumar Gala
5680681ed9 tests: Rename test_arm_m3_irq_vector_table test since it is not M3 specific
Drop the _m3 from the test name since this can run on M0, M3, M4, etc.

Change-Id: Ia12ece62fc7b42e28f37e191c90c0dead48d40d0
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-10-24 22:56:19 +00:00
Anas Nashif
dfa86e2aca sanitycheck: provide option to exclude tags
This will make it possible for us to optimize the list of tests we run, for
example, we could exclude footprint tests from the main run because those are
run as part of the footprint checks later in the CI job.

Use like this: sanitycheck -e footprint

Change-Id: I4e7a3aa6fac2ba1c9c99b356f08459da97fda777
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-24 22:55:13 +00:00
Kumar Gala
8d35760fec board: organize boards based on architecture
Introduce an architecture sorting of boards.  This is to allow for
easier maintenance going forward as the number of boards grows.  It
will be easier for any scripts to know the board/arch mapping without
having to maintain an explicit list of what boards are associated with
which arch.  We can also do things like have architecture maintainers
cover reviews and branches for arch/${ARCH} and boards/${ARCH} going
forward.

Change-Id: I02e0a30292b31fad58fb5dfab2682ad1c5a7d5a7
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-10-24 19:59:42 +00:00
Anas Nashif
e95abcd310 sanitycheck: add nrf51_pca10028 to buildable tests
Change-Id: I5e3297bfa23870c956b7d89d06c5028020c77087
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-22 16:55:54 -04:00
Andrew Boie
238fe1f60f gen_idt: remove int_vec_alloc bitfield from output
This is no longer used.

Change-Id: I6536076ae3510d66eb26c49d89b865dc82e91e33
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-10-21 23:30:05 +00:00
Anas Nashif
34ffa15669 checkpatch: complain only about actual leading spaces
Change-Id: Ia591966a35765bfc560bd823be488257537e6530
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-19 16:46:41 +00:00
Peter Mitsis
1da807e7a8 unified: Tweak msgq API parameters
- Reorders parameters where necessary
 - Adds alignment parameter to K_MSGQ_DEFINE() for buffer alignment
 - Renames parameters where necessary so they are more intuitive

Change-Id: I0b53105c04109127897bf4790e6908082f82da4e
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-19 14:54:44 +00:00
Maureen Helm
d5a252cc35 sanitycheck: Add hexiwear board
Enable build tests for the hexiwear board.

Change-Id: If7bf155bc77da0d2571eb617fb1803ece65e3a96
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-10-18 21:42:33 +00:00
Peter Mitsis
578f9111ed unified: Tweak mem_map API parameters
- Reorders parameters where necessary
 - Adds buffer alignment parameter to K_MEM_MAP_DEFINE()

Change-Id: Ifa1a09c62492cd6db8bdd83f31a5ca5ba072b484
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-18 15:31:51 +00:00
Peter Mitsis
2a2b075826 unified: Tweak K_MEMORY_POOL_DEFINE() macro
- Renames to K_MEM_POOL_DEFINE() for consistency
- Adds alignment parameter to align the pool buffer.

Jira: ZEP-926
Change-Id: I6cf0a1ce45c3a0fc5f0675047d8928659df1e75e
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-18 15:30:40 +00:00
Peter Mitsis
b2fd5be4dc unified: Rework K_THREAD_DEFINE()
K_THREAD_DEFINE() can no longer specify a thread group. However, it now
accepts a 'delay' parameter just as k_thread_spawn() does.

To create a statically defined thread that may belong to one or more thread
groups the new internal _MDEF_THREAD_DEFINE() macro is used. It is only used
for legacy purposes.

Threads can not both have a delayed start AND belong to a thread group.

Jira: ZEP-916
Change-Id: Ia6e59ddcb4fc68f1f60f9c6b0f4f227f161ad1bb
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-17 17:52:33 +00:00
Sonia Leon Bautista
5606f7f424 check_link_map: Removing unsuported python version.
Zephyr uses python 2.7 by default. Phython3 is breaking windows build.

Change-Id: Id0fdbdce89d63f51a0625f5d1f2f45584ecd4023
Signed-off-by: Sonia Leon Bautista <sonia.leon.bautista@intel.com>
2016-10-15 15:09:55 +00:00
Peter Mitsis
e5d9c58301 unified: Tweak pipe API parameters
- Reorders parameters where necessary
 - Adds alignment parameter to K_PIPE_DEFINE()
 - Renames parameters where necessary so they are sync'd
   between header and source files

Change-Id: I4f2367abc28aff646cc90beb9f08bb266e143b0c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-15 07:09:58 +00:00
Allan Stephens
ea6cfd1d83 unified: Add legacy DEFINE_TASK support
Allows unified kernel to support legacy microkernel applications
that use private tasks.

Also renames the unified kernel macro for defining a thread
to be consistent with the naming used for defining other kernel
objects.

Change-Id: I667d87056138c45c291dd848344e4051bf9fd1ff
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-11 09:59:16 -05:00
Andy Ross
8d801a5e27 sanitycheck: Remove linker VMA/LMA offset checking
This misfeature can crop up at development time as the linker scripts
are modified, not just as a regression in known tests (c.f. ZEP-955).
So it makes more sense to put it in a check_link_map script inovked
for every build.  Remove it from sanitycheck.

Change-Id: I9c2f47a26a3bc03170b895545476350341e91170
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2016-10-05 09:48:54 +00:00
Andy Ross
4cc228baf6 check_link_map: rewrite in python
Oops, turns out that we don't require perl in all our build
environments.  Rewrite this script (it's tiny) in Python.  Exactly the
same logic.

Change-Id: Icbf4b36ef0b18fca94d54fc7fe5e47343c55c669
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2016-10-05 09:48:54 +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
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
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
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
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
Andrew Boie
4dd1ca2c1a x86: add _init_irq_gate and use it in gen_idt
Change-Id: Id655e5c42ca82e48c5e6d80dcb1c7db8d207eb25
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-24 01:23:18 +00:00
Dmitriy Korovkin
3c426888a1 unified: Implement memory pools
Due to the memory pool structure only static declaration of
memory pool is possible.

Change-Id: I4797ed88fd2ac3b7812ff26e552e1745611c4575
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-09-20 22:04:46 +00:00
Andrew Boie
757dae5b7d x86: introduce new segmentation.h header
This header has a bunch of data structure definitions and macros useful
for manipulating segment descriptors on X86. The old IDT_ENTRY defintion
is removed in favor of the new 'struct segment_descriptor' which can be
used for all segment descriptor types and not just IRQ gates.

We also add some inline helper functions for examining segment registers,
descriptor tables, and doing far jumps/calls.

Change-Id: I640879073afa9765d2a214c3fb3c3305fef94b5e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-20 20:46:45 +00:00
Inaky Perez-Gonzalez
00d0e4631b build: use 'vercomp' without relying on it being in PATH
Not every environment has $ZEPHYR_BASE/scripts/ in the PATH, which can
cause conflicts (eg: the test environment doesn't define it to
simplify the build instructions).

Using vercomp as $ZEPHYR_BASE/scripts/vercomp, we remove this
requirement.

Change-Id: I8c390f905907f42d1ba2b4d1378e188705164e13
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-09-15 23:59:15 -07:00
Anas Nashif
5363d14a9e boards: rename Quark SE Devboard to Quark SE C1000
This board now has an official name and will be available soon:

http://www.intel.com/content/www/us/en/embedded/products/quark/mcu/se-soc/overview.html

Jira: ZEP-758
Change-Id: Ia16d33722308cf81471321c3063bdc75055a4d50
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-16 03:10:31 +00:00
Anas Nashif
5e4b62c35c boards: rename Quark SE Devboard to Quark SE C1000 (Sensor Subsystem)
Jira: ZEP-758
Change-Id: I8ee5a2f9e4a6ecbd15214e59321bf27a502ef6ee
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-16 03:10:30 +00:00
Anas Nashif
806ac751d4 sdk: zephyr: check for minimum required version of SDK
Error out when old SDK versions are being used.

Jira: ZEP-584
Change-Id: If3515f38cc75d8a378614ef77d8946ba2d9ab28d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-15 21:17:02 +00:00
Tomasz Bursztyka
a6cf6038e3 gpio: Remove obsolete API 1.0 callback mechanism
In 1.0 you could set only one callback on the whole gpio controller. It
was impossible for another sub-system to add another callback, without
overwritting an existing one.

Such API has been obsolete for a long time and no one is using it
anymore. Thus removing it entirely.

Change-Id: I6a17fd99373dc6cef1fa2ebb421e992412d5015e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-09-14 10:51:09 +00:00
Benjamin Walsh
456c6daa9f unified: initial unified kernel implementation
Summary of what this includes:

    initialization:

    Copy from nano_init.c, with the following changes:

    - the main thread is the continuation of the init thread, but an idle
      thread is created as well

    - _main() initializes threads in groups and starts the EXE group

    - the ready queues are initialized

    - the main thread is marked as non-essential once the system init is
      done

    - a weak main() symbol is provided if the application does not provide a
      main() function

    scheduler:

    Not an exhaustive list, but basically provide primitives for:

    - adding/removing a thread to/from a wait queue
    - adding/removing a thread to/from the ready queue
    - marking thread as ready
    - locking/unlocking the scheduler
      - instead of locking interrupts
    - getting/setting thread priority
      - checking what state (coop/preempt) a thread is currenlty running in
    - rescheduling threads
    - finding what thread is the next to run
    - yielding/sleeping/aborting sleep
    - finding the current thread

    threads:

    - Add operationns on threads, such as creating and starting them.

    standardized handling of kernel object return codes:

    - Kernel objects now cause _Swap() to return the following values:
         0      => operation successful
        -EAGAIN => operation timed out
        -Exxxxx => operation failed for another reason

    - The thread's swap_data field can be used to return any additional
    information required to complete the operation, such as the actual
    result of a successful operation.

    timeouts:

    - same as nano timeouts, renamed to simply 'timeouts'
    - the kernel is still tick-based, but objects take timeout values in
      ms for forward compatibility with a tickless kernel.

    semaphores:

      - Port of the nanokernel semaphores, which have the same basic behaviour
      as the microkernel ones. Semaphore groups are not yet implemented.

      - These semaphores are enhanced in that they accept an initial count and a
      count limit. This allows configuring them as binary semaphores, and also
      provisioning them without having to "give" the semaphore multiple times
      before using them.

    mutexes:

    - Straight port of the microkernel mutexes. An init function is added to
    allow defining them at runtime.

    pipes:

    - straight port

    timers:

    - amalgamation of nano and micro timers, with all functionalities
      intact.

    events:

    - re-implementation, using semaphores and workqueues.

    mailboxes:

    - straight port

    message queues:

    - straight port of  microkernel FIFOs

    memory maps:

    - straight port

    workqueues:

    - Basically, have all APIs follow the k_ naming rule, and use the _timeout
    subsystem from the unified kernel directory, and not the _nano_timeout
    one.

    stacks:

    - Port of the nanokernel stacks. They can now have multiple threads
    pending on them and threads can wait with a timeout.

    LIFOs:

    - Straight port of the nanokernel LIFOs.

    FIFOs:

    - Straight port of the nanokernel FIFOs.

Work by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
         Peter Mitsis <peter.mitsis@windriver.com>
         Allan Stephens <allan.stephens@windriver.com>
         Benjamin Walsh <benjamin.walsh@windriver.com>

Change-Id: Id3cadb3694484ab2ca467889cfb029be3cd3a7d6
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-13 17:12:55 -04:00
Benjamin Walsh
20f7ae47e4 sysgen: add --kernel_type argument
Needs to sort out differences between microkernel and unified MDEF
syntax.

Change-Id: I8f7cb192bdd90c0f9c40593cfbd0aa86b12c7c74
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-13 17:12:55 -04:00
Benjamin Walsh
f6684147c1 build: make sysgen take optional command line arguments
Cleaner than positional parameters, easier to add new arguments.

Change-Id: I30e85f7b2643775c1006564d18da115599688e88
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-13 17:12:55 -04:00
Andrew Boie
31e3a345e5 gen_idt: validate IRQ line before vector assignment
On systems with fixed IRQ-to-vector mapping (like Quark D2000),
if multiple drivers tried to use the same IRQ line, gen_idt would
report an IDT vector collision rather than multiple IRQ line collision,
which is much less intuitive.

Move the IRQ line validation to before the vector validation to report
an easier to understand error.

Change-Id: I3930d8df38391e4708db5486e4bd4527d33c4cce
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-12 17:53:22 +00:00
Daniel Thompson
389ed15b4c build: Make QEMU_BIN_PATH optional
QEMU_BIN_PATH is frequently set to pick up qemu binaries from "obvious"
places such as /usr/bin or /usr/local/bin. Neither of these values will
be correct for all users and both directories would typically be found
in the user's PATH. Much better to make QEMU_BIN_PATH optional and picking
up qemu via PATH instead.

Tested with ZEPHYR_GCC_VARIANT={zephyr|xtools}.

Change-Id: I1acfc5b12341c6d330a3e9e90b0ab5bde29e2e4f
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Cc: Andrew Boie <andrew.p.boie@intel.com>
2016-09-12 02:35:20 +00:00
Daniel Thompson
e4980bd392 build: zephyr: Remove unused QEMU variable
This value is unused; it will be overridden by the main Makefile before it
is used. This is for the best since the value is also broken. Remove it.

Change-Id: Ibc5aae3f9967eb2b26a482425c3bbbaf44c0e2bb
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
2016-09-12 02:35:20 +00:00
Daniel Thompson
77a2011910 build: xtools: Honour CROSS_COMPILE (if set)
crosstool-ng toolchains are relocatable so, while the assumption it will
live in $(XTOOLS_TOOLCHAIN_PATH)/$(CROSS_COMPILE_TARGET) is a reasonable
default, it is useful to have to an quick and easy way to override that.

Reusing CROSS_COMPILE works well for this; it allows
ZEPHYR_GCC_VARIANT=xtools to set up the compiler and linker flags
without being too opinionated about anything else.

Change-Id: I6edd97a3753f2a917a34f723273416f76caa647a
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
2016-09-12 02:31:06 +00:00
Daniel Thompson
06844200d8 build: xtools: Simplify derivation of toolchain flags
Currently several of the variables in the CROSS_COMPILE_... family
are repeated for each architecture despite the content of the variable
being the same in all cases. Fix this.

Change-Id: Ib40eca67926e22050a366e7b349331deaa7dd954
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
2016-09-12 02:31:05 +00:00
Vinicius Costa Gomes
37a9a454a4 scripts: Port get_maintainer.pl to Zephyr
Zephyr has for some time the MAINTAINERS file, now we can use it to
programatically display who should be added as reviewer when proposing
a new patch.

Origin: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/scripts/get_maintainer.pl

Change-Id: Ib71aa25e60f230c4c7cd0724c63118f8ec72b229
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-09-12 00:24:13 +00:00
Carles Cufi
5a271f913c build: Use __CYGWIN__ to detect Cygwin
The old __CYGWIN32__ does not work with the 64-bit version
of Cygiwn. Using __CYGWIN__ instead allows us to build
gen_idt.c under 64-bit Cygwin.

Change-Id: I6590767153e929764f0b448f74bb8e3f2e593a6a
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-09-07 12:58:55 +00:00
Carles Cufi
d29576b365 kconfig: Specify ncurses explicitely
On OS X (macOS), "make menuconfig" fails with missing
linker symbols. By specifying the "-l" linker options
with the menu, panel and ncurses libraries directly if
the autodetection fails, it builds and links properly.
Note that this might denote a problem with
"check-lxdialog.sh".

Change-Id: Ib2721646cc01c3e977911d8e6d0c8303dcedbc58
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-09-07 12:58:29 +00:00
Andrew Boie
ba61200a8f sanitycheck: allow extra arguments to be passed to the build
In some cases, particularly when developing experimental features, it is
useful to be able to pass parameters to 'make' globally for all
sanity checks.

Change-Id: I19eddf222a74064cf6f22ec641fa6b4ff72992e7
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-06 22:44:20 +00:00
Tyler Baker
53dffd61aa add ARM GCC embedded toolchain to the list of supported toolchains
The Zephyr documentation states that the ARM GCC embedded toolchain is
supported for ARM platforms so lets add a reference to allow sanitycheck
to build with this configuration. This patch fixes 4b554baa87
("sanitycheck: support for multiple toolchain").

Change-Id: I5578a3c78432219e2ba4d7393899d54c818c5c17
Signed-off-by: Tyler Baker <tyler.baker@linaro.org>
2016-09-06 21:38:38 +00:00
Andrew Boie
c545e19a00 x86: remove dynamic interrupts and exceptions
Change-Id: I7e9756e9a0735a7d8257ee2142d5759e883e12cc
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-06 18:35:24 +00:00
Andrew Boie
05e3d7f893 sanitycheck: complain loudly about missing platforms
If defconfig files exist under boards/ that don't correspond to
the set of platforms defined in the .ini files under
scripts/sanity_chk/arches, complain about this. We should be at
least compiling all our supported platforms in CI runs.

At the moment it flags 5 boards. Future patches should either add
these boards to the appropriate arch .ini files or remove them
from the kernel.

Change-Id: Id825d6c6bd32089d9f1bead11bc0765685e3771a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-06 16:32:03 +00:00
Andrew Boie
7d432bbd0a microkernel: remove deprecated task IRQs
Change-Id: I02264a587b77ae597133b9c52b342b8e5520a131
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-06 16:15:59 +00:00
Carles Cufi
8081fd3cf8 kconfig: Use HOST_OS environment variable in Makefile
Since the root Makefile already provides a HOST_OS
environment variable that is exported by using uname,
make use of it in the Kconfig Makefile.

Change-Id: I13655a5295bbcd9f2fdfa8b6309634c1ab143f70
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-09-06 15:15:02 +00:00
Javier B Perez
4b554baa87 sanitycheck: support for multiple toolchain
Added support for multiple toolchain usage.
Every arch contains a list of supported toolchain.
Each board can override the supported toolchain list.
If the board is not supported in the current toolchain,
will be discarded.

The current toolchain is defined by ZEPHYR_GCC_VARIANT.
Added support for toolchain ISSM and ZEPHYR.

Change-Id: I31e9b39ba01f6e9bdc4557702428cd09e05f492a
Jira: ZEP-592
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-08-30 21:44:24 +00:00
Javier B Perez
7941454b70 sanitycheck: filter: add support to use env variables
Added support in the sanitycheck to use env variable
value in the filter.

Change-Id: I76388dc04557dcd31e651d23ae8edf96a8fe2474
Jira: ZEP-592
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-08-29 14:43:01 +00:00
Anas Nashif
93d47e6925 sanitychecks: update release data
Change-Id: I47c519532d8a5be401c04c3175e3f606fcf005f3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-08-26 17:12:15 -04:00
Andrew Boie
26f37bab4c build: xtools: fix 'make qemu'
Brew places QEMU in /usr/local/bin.

Change-Id: I6de8bb93e85e0ded9d471972596d38800615b793
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-26 02:04:37 +00:00
David B. Kinder
8e4275298c grub: Tweak build_grub.sh for proxy issues
Using git clone with git: protocol requires proxy settings
that can be a problem that doesn't happen with http: protocol

Change-Id: I4c02289f5c15494c31d4cca0849bf3093b602125
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2016-08-23 13:20:52 +00:00
Andrew Boie
88af1573f2 sanitycheck: arc.ini: add em_starterkit to sanity runs
The per-platform blocks were just specifying defaults and didn't
need to exist.

Change-Id: I9f4c7db4cd16417d5a2c172c3f850f7758dcbd00
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-12 09:36:29 -07:00
Genaro Saucedo Tejada
2968b3644c sanity: non utf-8 characters are tolerated
Sanity check script was not handling non utf-8 characters as a result
it crashed and didn't kill qemu and test used to hang.

Now tests fail upon untranslatable bytes.

JIRA: ZEP-673

Change-Id: I885a185e0481083501fce15cd51412bfdd26a7d7
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2016-08-10 14:31:57 +00:00
Ricardo Salveti
26b9140b9f sanitycheck: add nrf52_nitrogen and nrf52_pca10040
Enable build tests for the nRF52 Nitrogen and nRF52 DK platforms.

Change-Id: Id099167c38a49aa8d9a8a8cb0ed71a9a938e2a46
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2016-08-05 20:59:02 +00:00
Andrew Boie
4760753ab0 Revert "microkernel: remove deprecated task IRQs"
This reverts commit d73a9bb9c6.
The patch was intended for 1.6.0 release.

Change-Id: Id42058b746a3d2a54e4b1a2983eb58bd10b1ed40
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-05 20:37:25 +00:00
Andrew Boie
d73a9bb9c6 microkernel: remove deprecated task IRQs
Change-Id: I06393c8ee0e864105cd0183c92e453638679fe81
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-05 16:55:42 +00:00
Paul Sokolovsky
38e3e0b812 Makefile.toolchain.zephyr: Test CONFIG_TOOLCHAIN_VARIANT robustly.
Current code tests treats "" (quotes included) as an empty value for that
varible (as coming from Kconfig). However, that file also used to
integrate with build systems for 3rd-party components, e.g. as examplified
by samples/static_lib, and in that case it will be just an empty string.
So, first strip surrounding quotes, then test for empty string.

samples/static_lib: Update for recent Makefile.toolchain.zephyr changes.

Makefile.toolchain.zephyr is 2-pass now, so needs to be included twice.
ARCH needs to be defined *before* including it. Otherwise, just used
CROSS_COMPILE and TOOLCHAIN_CFLAGS set by it.

Change-Id: I56e963d0d107c77390395682d60400cf6ca62337
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2016-08-04 18:31:12 +00:00
Andrew Boie
b6612f459b altera_max10: default to UFM flashing
Flashing issues have been resolved. The build system support for
flashing and debugging has been changed back to UFM scenario.
XIP and reset vector no longer disabled. Wiki documentation updated.

Change-Id: Iffe326485c20808dabc1e19e0b18b7b60a83d797
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-28 22:25:48 +00:00
Andrew Boie
12244a3a8e sanitycheck: allow deprecated APIs
sanitycheck is set up to error out on any compiler warnings.
However in the case of deprecated APIs, we may feel compelled
to still test them while they remain in-tree. Don't fail the
build if deprecated APIs are used during sanity runs.

Change-Id: Ic3196896689706d308117e693ab720713d67d698
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-28 21:48:23 +00:00
Kumar Gala
0bf30b0b9d toolchain.gccarmemb: Cleanup Makefile
Simplify setting of CROSS_COMPILE to just a single line.

Change-Id: I6bb00b404b23011e93897c7cb4a882f2f043c973
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-07-28 14:08:49 +00:00
Juro Bystricky
f25ac092b9 Makefile: Restructure for multilibs
Several Zephyr SDK toolchains support multilibs.
Instead of hard-coding locations of the libraries, the proper/cleanest way
is to query the GCC compiler for the locations of libgcc and libc.
However, in order to do this, we need to ensure a certain order of
initialization in the Makefile:

1. Determine CROSS_COMPILE.
   We cannot determine LIB_INCLUDE_DIR, TOOLCHAIN_CFLAGS yet, as we don't
   know the KBUILD_CFLAGS yet.

2. Calculate KBUILD_CFLAGS using CROSS_COMPILE
   KBUILD_CFLAGS often need the compiler to validate options, i.e:
   KBUILD_CFLAGS += $(call cc-option,-mabi=aapcs -mthumb -mcpu=cortex-m0)
   However,  LIB_INCLUDE_DIR, TOOLCHAIN_CFLAGS should not be needed for this

3. Finally, using CROSS_COMPILE and KBUILD_CFLAGS determine LIB_INCLUDE_DIR,
   TOOLCHAIN_CFLAGS by querying GCC using -print-libgcc-file-name and
   -print-multi-directory command line options.

This change should only affect Zephyr SDK toolchains, all other toolchains
are expected to function as before.

Change-Id: I27b460d46fe65d05fcb8bafb51cd6b3deba275ed
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-07-27 17:15:56 +00:00
Andrew Boie
0d03e32036 gen_idt: add -d switch for extra debug info
Previously, gen_idt's code had to be modified to get this information.
We now print it by default when building with V=1

Change-Id: I31bd6c5b851d6280ebcedaab97bd02b8331a2f24
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-27 14:42:27 +00:00
Sonia Leon Bautista
616e96242b scripts: Check all CONFIG_* in the code are defined into a Kconfig file
checkConfig script scans all '*.c', '*.h' and '*.S' looking for all
kconfig items used into the Zephyr Code and validates if they are
defined into any '*.kconfig' file.

to execute script use:
*to run with default values:
	$ checkconfig.py
*to run and get complete log of all symbols used:
	$ checkconfig.py -c
*to run from a diferent subdirectory, not zephyr base, like
 drivers/grove
	$ checkconfig.py -s drivers/grove
*to run and exclude some directories for verification:
	$checkconfig.py -e drivers

*to get more help about how to run script:
	$checkconfig.py --help

Change-Id: Ia8ddda8b560305eb73224c55645729a40fcb5863
Signed-off-by: Sonia Leon Bautista <sonia.leon.bautista@intel.com>
2016-07-22 23:27:08 +00:00
Andrew Boie
56dded4435 qemu_nios2: run sanity checks with the emulator
Requires SDK 0.8.1

Change-Id: I2384508897bcd9f7a3d19962853f642c4ba815f4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-21 16:32:19 +00:00
Jesus Sanchez-Palencia
288f6cc889 build: Improve usage of the ISSM toolchain
With this fix now we can use the ISSM standlone toolchain [1] through
ZEPHYR_GCC_VARIANT=issm and ISSM_INSTALLATION_PATH=/path/to/toolchain
variables only, without the need of setting IA_VERSION and ARC_VERSION
always. These are always the same for a given toolchain release.

This is also a way for us to document the currently supported (and
tested) toolchain version.

Tested on Linux only.

[1]
https://software.intel.com/en-us/articles/issm-toolchain-only-download

Change-Id: I6fba8ea9564b2080bd73b627bc7150863401f18d
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
2016-07-21 02:48:03 +00:00
Kumar Gala
1c0bcc8cc5 toolchain.gccarmemb: Simplify setting of libgcc include path
Utilize the gcc -print-libgcc-file-name to determine the path to
libgcc.a.  Using this also resolve issues if we are building with
floating point and the various ABIs to pickup the right lib.

We can also simply a few Makefiles and remove the need to export
_CROSS_COMPILE_arm_isa.

Change-Id: I293394c921c18fa4984173ba51825d6f9a333697
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-07-21 02:42:56 +00:00
Andrew Boie
5512105562 sanitycheck: add -R to build all tests with assertions
Some tests individually enable assertions; this forces them on
for all tests. Intended for use with daily builds. Disregard
footprint or benchmark data with this enabled.

Change-Id: I7a0822432d5cab7f3ab0767faf214fde536cd68e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-20 23:41:05 +00:00
Andrew Boie
50131a3d0e altera_max10: support 'make flash' and 'make debug'
For both of these, we send the .elf binary over the JTAG and it gets
written directly into SRAM. The CPU boots the image from the entry
point (__start).

This does not provision the kernel onto device's User Flash Memory
(UFM). Implementation of this is still in progress see ZEP-273.

Change-Id: Iae8188a21e4a3eecfda0f4f0bb220c0607d719cb
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-12 18:09:57 +00:00
Allan Stephens
c002401295 sysgen: Cosmetic cleanup of memory pool generation code
Does renaming of variables and comments to conform to the
"block set" and "quad-block" terminology now used by the kernel's
memory pool code. (Note: This renaming also includes names of
some variables generated by sysgen.)

Change-Id: I8e04cb1ee9ca83daddb487b477da7dd2e1004fd8
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 23:04:41 +00:00
Allan Stephens
c0fd08e82d kernel: Rename private memory pool types
Revises the names of 2 types to make them better reflect the
data structures they represent, namely:

- block set: a collection of memory pool blocks of a given size
- quad-block: four contiguous memory pool blocks of a given size

Change-Id: I3e424586e97157eea185fba6836e2e89d10d9cd6
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 23:04:39 +00:00
Allan Stephens
569d08a940 kernel: Eliminate unused memory pool structure field
Eliminates the memory pool field indicating the size of the
pool's memory buffer, since it isn't used anywhere.
(Anyway, it could be computed by multiplying the maximum
block size by the number of maximum-sized blocks.)

Change-Id: Ia11554bdc2b246a1ba0ea33f05c5e6ce6a32ca13
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 23:04:39 +00:00
Allan Stephens
f31b9a377d sysgen: Enhance comments describing generation of memory pools
Change-Id: Ie4a52e110075854dfac2a9e2c32fc8ae8b9e287e
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 20:31:32 +00:00
Allan Stephens
06dc3090d5 kernel: Eliminate unused memory pool structure field
Eliminates memory pool field associated with a capability that was
never implemented. (This field was initialized, but never subsequently
referenced.)

Change-Id: I58cf8c4bb846a66b4c8754654ffc3ff55abcff7f
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 20:31:32 +00:00
Andrew Boie
3316e4c6fc gen_offset_header: don't force 32-bit build
It's not clear why this was forced in the first place.

Change-Id: I95c5e21ac0861a7b224ac9715bc5691c97922fe4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-08 20:31:02 +00:00
Andrew Boie
9557f0306c gen_idt: don't force 32-bit build
We no longer assume pointer sizes are the same between host and
target, and use stdint defintions to size things.

Change-Id: Ie4dc41c60d62931fdb3d1764ade01c16a64d0b54
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-08 20:31:02 +00:00
Kumar Gala
fc867fde11 RFC: fix to build issue with subdirs
Pushing this to see what fails as its a similar fix to the one Flavio
pushed.  Yet in local building with sanitytest not seeing any issues

Change-Id: If42c13b0c1827fe89fb332ac6c40a14a76553330
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-07-08 17:09:05 +00:00
Inaky Perez-Gonzalez
0fb7abfea5 build: script to filter known issues
This is is a proposal to have a system to filter the output of the
build (compilation, documentation, sanity check and runtime tests)
that eliminates known issues so that whoever sees the output of the
tree can note new issues being added without having to dive on
existing, known ones.

Most common user of this will be the continuous integration system, to
decide what is shown to gerrit as feedback to the user who submitted a
change.

The rationale behind having it in the tree is that if somebody submits
code that introduces a false positive (due to tool limitations) or as
an accepted (normally minor) issue to be fixed later, it can also
submit a "filter" for it without breaking CI.

For example, consider the documentation workaround in include/uart.h
(that will be reverted when this is done):

  diff --git a/include/uart.h b/include/uart.h
  index a30b211..178bd5e 100644
  --- a/include/uart.h
  +++ b/include/uart.h
  @@ -97,7 +97,7 @@ typedef void (*uart_irq_config_func_t)(struct device *port);
    * @param sys_clk_freq System clock frequency in Hz
    */
   struct uart_device_config {
  -       union __unnamed_workaround__ {
  +       union {
                  uint32_t port;
                  uint8_t *base;
                  uint32_t regs;

This introduces a harmless warning in the documentation compilation
process due to a limitation in the tools that will be fixed in future
releases. In the meantime, as they accumulate, it makes more difficult
for people to know if *they* introduced any other warnings (or
errors). The configuration in .known-issues/doc/uart.conf matches that
warning and filters it out (and only that), with enough regex glue to work
around subtle context changes (like line numbers).

The implementation is a Python script that can take the build output
and remove what is being told to ignore by a list of configuration
files, each of which contains a list of single/multiline Python
regular expressions.

Addition of said exceptions is caught by CI: it will trigger a
maintainer being included as a reviewer because the as directed by the
entry for the .known-issues in the MAINTAINERS file.

Change-Id: I7939e0726f2c505481592c3a7f5f40fa3e9c62fd
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-07-01 21:53:44 +00:00
Andrew Boie
0a8a101e6e nios2: enable microkernel sanity checks
All tests are building now.

Change-Id: I96a94733a96a92df445c46add0de94319fbca3a5
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-30 20:56:16 +00:00
Andrew Boie
148924827d sanitycheck: build for qemu_nios2 target
Change-Id: Ibb1c831a49440b0273316fad2f15b7dbe2002d50
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-29 00:08:05 +00:00
Javier B Perez
908926ce36 gen_offset_header: resources leak in pTable
Fixed resources leak in pTable when the lseek command
fails.

Change-Id: I414276399b0d0ca3dee0c18d307ccc2035d66198
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-06-24 20:46:13 +00:00
Javier B Perez
5eecd88011 checkpatch: kconfig: warn about spaces instead of tabs
checkpatch warns about kconfig lines that contains spaces
instead of tabs.

Change-Id: I60aa74072ce424f21db64a7df0804d7d4cbe315b
Jira: ZEP-427
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-06-21 19:50:59 +00:00
Andrew Boie
c6d560d198 sanitycheck: build for altera_max10 board
Change-Id: I28084082dcf0401fbafc54bb514aa3cacf7ab8e8
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-10 15:22:42 +00:00
Andrew Boie
3b9302158c nios2: set up common linker script for XIP and non-XIP
We will require 6 variables to be defined by SOC-specific
linker script; these values in turn can be pulled from
defines in layout.h.

To help position code correctly we define two new ELF sections
for this arch, 'reset' and 'exceptions'.

Change-Id: Idffbd53895945b7d0ec0aac281e5bf7c85b4b2c2
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-10 15:22:41 +00:00
Andrew Boie
9280e71ea4 nios2: add flashing/debug scripts
For the moment, NIOS2_CPU_SOF must be set with the path to the
CPU configuration. We are checking with Altera on whether we
can directly check in the binary to the source tree.

These scripts depend on tools provided by the Altera Quartus
Prime Lite Edition. This is available for free but requires
registration on Altera's website to obtain.

Change-Id: Ia6cb6c9e43c3e141807a887cb25c47b370a7d8e9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-10 15:22:40 +00:00
Kumar Gala
52c987e941 toolchain.gccarmemb: Add include path for newlib headers
We need to expose the path to the newlib headers that are part of the
ARM embedded gcc at ${GCCARMEMB_TOOLCHAIN_PATH}/arm-none-eabi/include
otherwise we get build errors like when trying to use newlib:

lib/libc/newlib/libc-hooks.c:17:19: fatal error: errno.h: No such file or directory

Change-Id: Iedce526d23e54e54b9cefdfa6ca176fe12ed8090
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-06-09 16:22:28 +00:00
Anas Nashif
659ff5002f sanitycheck: update the footprint data
Change-Id: I6686e46a5f3c5649fc1781119f388feb8179b853
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-06-03 12:09:26 -04:00
Andrew Boie
7a87f9f500 expr_parser: support ':' operator
Similar to '==' but compiles the RHS into a regular expression
and attempts to match whatever is in the environment against it.

Change-Id: I7a03452ef88d067b62661d14dc6f42273de436fa
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-02 23:10:07 +00:00
Andrew Boie
99c0f64b34 expr_parser: fix concurrent use issues
Change-Id: Ic9ef5d42f4348ada5c418a36118660e79a1a689b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-02 23:10:07 +00:00
Andrew Boie
5aaf5f1c6f expr_parser: support single-quoted strings
Change-Id: I00af87ac3ebd1d63ceba0bb2c9dcf17f56aa8177
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-02 23:10:07 +00:00
Anas Nashif
89205da16e checkpatch: catch changes to MAINTAINERS file
Change-Id: Iceb85f6e9fb3c66f89383f4d159d3752639356b1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-31 19:09:14 +00:00
Carles Cufi
a3a8828af3 scripts: Add the ISA to the path of included libraries
for GCC ARM Embedded

When compiling and linking Zephyr with GCC ARM Embedded,
the path to the libraries to be linked needs to be provided
explicitely for the correct variant to be linked in.

JIRA: ZEP-377
Change-Id: I745aa45c7dde12f1cc5c8ea4380b904e086ed94d
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-05-27 01:38:22 +00:00
Anas Nashif
6361be24bc scripts: add a script to report RAM/ROM usage
Still WIP. Give statistics on memory/flash usage.

Run:
 make BOARD=<board> ram_report
 or
 make BOARD=<board> rom_report

Change-Id: I6b0aee09b89275e12f1cde863d2c0f5b8dfd0409
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-26 15:19:15 +00:00
Anas Nashif
de8bc78a5e arc: support microkernel on ARC
Microkernel on ARC works fine, was missing some declarations in the
linker file.
Also enable testing of microkernel with ARC and disable tests where
ARC is not supported yet.

Jira: ZEP-396
Change-Id: I2ac7b8dc0bea22f5d2e24832d9e3afad8df9f580
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-25 22:14:18 -04:00
Anas Nashif
92a12a19ae checkpatch: add option for excluding directories
when importing code from external sources, we do not want to fail
on checkpatch and want to run full sanity checks.

Using --exclude <dir> we should be able to exclude a list of well
defined locations in the tree that carry sources from other projects
with other styles.

Change-Id: I7d321e85eed6bc37d5c6879ae88e21d20028a433
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-23 16:05:42 +00:00
Sakari Poussa
d3f625b60e toolchain/xtools: enhance include search path to sysroot
For xtools, add sysroot also to include search path.

Change-Id: I72d37c54eb7f3693d3a207a35802b29b150c84f1
Signed-off-by: Sakari Poussa <sakari.poussa@intel.com>
2016-05-17 20:09:50 +00:00
Juan Manuel Cruz
d9b192e5d5 build: Fixes an issue with file permissions on windows
Jira: ZEP-177
Change-Id: Idf6ca12d6cad9467c63fc4ddb8a716b47ec9ad33
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-05-14 15:55:04 +00:00
Juan Manuel Cruz
5516bcaa72 build: Add MinGW dependencies in makefile
Jira: ZEP-177
Change-Id: I5c67b9ed6c279b2b59afd4cd0351df5f0d030533
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-05-14 15:55:03 +00:00
Vlad Dogaru
1cbfbe8426 checkpatch: Remove Change-Id warning
There seems to be no way to configure it, so I've just removed the code.

Change-Id: I35341e8afc0bdfa8b953b833cfb0eecf05b81c16
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-05-05 11:24:06 +00:00
Andrew Boie
3ea7892410 sanitycheck: allow for more expressive filtering in testcase.ini
The old 'config_whitelist' directive in testcase.ini has been removed.
We use the new expr_parser module to parse a 'filter' directive which
is a boolean expression. This gives a great deal more flexibility
in how tests can be filtered.

To keep the tree bisectable, use of config_whitelist in testcase.ini
converted to the new expression language.

Change-Id: I0617319818c5559c0f0569d2fa73d09b681cac51
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-04 22:57:39 +00:00
Andrew Boie
b4efd548f9 expr_parser.py: simple expression language
Sanitycheck will use this to allow for much more expressive
conditions when filtering test cases based on defconfig values.

Origin: Original code
Change-Id: Icb650a2aa383699e4f2e18f66e853279c02b50e5
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-04 22:57:39 +00:00
Arkadiusz Lichwa
b670ddaeec scripts/sysgen: Fix indentation inconsistency
scripts/kconfig/conf --silentoldconfig Kconfig
  Using /home/<user>/zephyr.git as source for kernel
  GEN     ./Makefile
  CHK     include/generated/version.h
  UPD     include/generated/version.h
  HOSTCC  scripts/gen_idt/gen_idt.o
  HOSTLD  scripts/gen_idt/gen_idt
  CHK     misc/generated/configs.c
  UPD     misc/generated/configs.c
  CHK     include/generated/offsets.h
  UPD     include/generated/offsets.h
  CHK     misc/generated/sysgen/prj.mdef
  UPD     misc/generated/sysgen/prj.mdef
  File "/home/<user>/zephyr.git/scripts/sysgen", line 461
    kernel_main_c_out("extern int %s(int event);\n"% (event[1]))
                                                               ^
TabError: inconsistent use of tabs and spaces in indentation
/home/<user>/zephyr.git/./Kbuild:51: recipe for target 'misc/generated/sysgen/kernel_main.c' failed
make[3]: *** [misc/generated/sysgen/kernel_main.c] Error 1
/home/<user>/zephyr.git/Makefile:904: recipe for target 'prepare' failed
make[2]: *** [prepare] Error 2
make[2]: Leaving directory '/home/<user>/zephyr.git/tests/bluetooth/shell/outdir'
Makefile:169: recipe for target 'sub-make' failed
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory '/home/<user>/zephyr.git'
/home/<user>/zephyr.git/Makefile.inc:63: recipe for target 'all' failed
make: *** [all] Error 2
make: Leaving directory '/home/<user>/zephyr.git/tests/bluetooth/shell'

Change-Id: Id6dbf7ef1c0b95a68cf4265465a0124c16e6f971
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-05-04 22:51:56 +00:00
Daniel Leung
aed8ef4d4c microkernel: events: fix undefined function error
The handler of the microkernel events are not declared properly.
This causes the public event objects to complain about
undefined functions. Fix this by declaring the function
before using it.

JIRA: ZEP-85
Change-Id: I68afe777bad66e010c92e637806a48911b2f52f4
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-05-04 15:16:55 +00:00
Anas Nashif
3905ff4482 update sanitycheck footprint data for the release
Change-Id: I32d8fbf94191d2f1c48cd1d514ed679dfa288a11
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-02 20:50:45 -04:00
Juan Manuel Cruz
a0ed1ff1dc build: add arc support to issm toolchain
Jira: ZEP-186
Change-Id: Ib58aaba3020d8db18130f7d73a394a79c972272a
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-05-03 00:02:41 +00:00
Juan Manuel Cruz
2170ca79ff build: support icx llvm compiler
Change-Id: I0bcc1f2e0ea93830e61fb3eaf8b523b7c4e1c301
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-05-03 00:02:40 +00:00
Andrew Boie
b2a343dcb0 Makefile.toolchain.zephyr: add nios2 arch
Directory layout per SDK 0.8 structure. Using toplevel libs for
now.

Change-Id: I7852a9def09fb0a5f0a6e496249d2ebb86720d8f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-27 21:40:18 +00:00
Anas Nashif
ce836e2c69 toolchain: move iamcu output format/arch to SoC
Instead of defining the output format in the toolchain environment
setup, define this per SoC that supports the ABI.

This will allow us to directly referencing an installed toolchain
without the need for declaring ZEPHYR_GCC_VARIANT

Change-Id: Icd1a7a21acbf075a51854fb2ebb3ef06788ce9b5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-25 17:01:48 +00:00
Juan Manuel Cruz
0e40db8a3b build: fixes issue in windows Kconfig support
It allows to silently ignore non-existent files.
When using wildcards in Kconfig source files
(e.g. source folder/*/Kconfig), it is possible to refer files
that does not exist. In the previous example, it is possible
that Kconfig files do not exist in one of the folder's
subfolders and it is not a requirement for the file to exist
in each one of the subfolders.

Additionally, it fixes an issue for wildcards in the file name.
If the name contains a wildcard, Kconfig should iterate
over each file included in the wildcard
(e.g source folder/myKconfig.*)

Jira: ZEP-177
Change-Id: I5aa192ca1e2df83461b12a86fe29a98cd95c4256
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-04-23 11:27:11 +00:00
Tomasz Bursztyka
fea1c49ba2 gpio: Improve the public API to handle multi callbacks
Many sub-systems might require to set a callback on different pins.
Thus enabling it via changing the API.

It is also possible to retrieve private-data in the callback handler
using CONTAINER_OF() macro (include/misc/util.h).

Former API is still available, and is emulated through the new one.
Using both should not be a problem as it's using new API calls.
However, it's now better to start using the new API.

Change-Id: Id16594202905976cc524775d1cd3592b54a84514
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-22 22:15:12 -04:00
Yannis Damigos
2b8d3626c6 sanitycheck: Add olimexino_stm32 board to sanitycheck
Adds olimexino_stm32 board to sanitycheck.

Change-Id: Icd0e5025bc7a348c7a1a4d18d10d2d1e3a9817bd
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-04-20 22:29:02 +00:00
Anas Nashif
0c8564cacb checkpatch: warn on COMPLEX_MACRO and MULTISTATEMENT_MACRO_USE_DO_WHILE
generates lots of false postives, so make it warn only.

Change-Id: I0b2fedc564c29bff32f7c48702a9ad54a969650b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-19 01:14:39 +00:00
Daniel Leung
00525c2acf sanitycheck: align output for easier visual comparison
() The test names are getting longer so adds more padding.
() Aligns the numerical size numbers for easier visual
   comparison when scrolling in shell.

Change-Id: Id218a641e9d5dffb77bf813ffbd828c48d14020f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-12 12:00:47 +00:00
Anas Nashif
11ee55a6cc openocd: make openocd variables overridable from env
Some boards require a newer version of openocd, this will
allow overriding the default version that comes with the SDK.

Change-Id: I70113182c3a2c8610e3b36542c6057ff3f0df547
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-12 12:00:05 +00:00
cacu
124feb27c5 build: Add a toolchain file for the GCC ARM Embedded toolchain
Change-Id: Iea501d30297123955fd699eb7d53e642949b6af7
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-04-12 11:59:38 +00:00
Andrew Boie
27025e1988 x86.ini: increase arduino_101 priority
The ordering of the list of platforms is in priority order,
as the sanitycheck --platform-limit option chooses the first
N platforms in this list when doing a run. Move arduino_101 to
second position. qemu_x86_iamcu is still top priority as it
can execute code as part of the tests.

Change-Id: I989d91c66a0a741ce8eebe6279ee4512c33eb5e9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-08 21:37:59 +00:00
Andrew Boie
14ac902633 sanitycheck: fix test names to be same as before
Add the last path information in the testcase root to the
test name, so that there is much less of chance of name
collisions and the reports come out with the same names
as before.

Change-Id: I75ed6ee96251058dd2547e57be31db3c2517a497
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-08 13:31:53 -07:00
Andrew Boie
3d348715d8 sanitycheck: be smarter about scanning for test cases
A recent tree change moved testcases to both the tests/ and
samples/ directory. The default testcase root was just made
the root of the Zephyr tree, which could lead to potentially
long scan times as every single directory in-tree was checked.
For example, it could be very time-consuming to scan everything
under the sanity-out/ dir if -n is used and --all was used in
a previous run.

Now we allow multiple testcase roots to be supplied on the
command line, and by default only scan under tests/ and
samples/.

Change-Id: I8dac747835b87801474e08c236913e04db64f87b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-08 20:09:18 +00:00
Daniel Leung
7f8501090c sanitycheck: add ability to use arbitrary report for comparison
This adds the ability for sanitycheck to use arbitrary report file
for size comparison. This is useful when optimizing binary size.
For example, a report can be generated with master head, and used
as base for comparison.

Change-Id: Id8c61146c498ba62c4cc77a9ef7d390c0fb11487
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-08 20:09:11 +00:00
Daniel Leung
6b17007b56 sanitycheck: parallelize binary size calculations
Instead of running nm/objdump and parsing the results one testcase
at a time, do these in parallel to speed up sanity check a bit.

The sanitycheck now requires at least Python 3.2 to run because of
the usage of concurrent.futures.

This reduces build time (--all -b) from 4:30 to 3:08 on 24C/48T
Xeon-E5.

Change-Id: I8e7c1efb2f473c7f2b65658f8ed9a101ed091eea
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-08 14:50:20 +00:00
Daniel Leung
1bdc6f8b22 sanitycheck: fix initlevel section being mentioned twice
The "initlevel" section is being metioned twice. It does not affect
the final size calculation, but just remove it just for reader's
sanity.

Change-Id: I0e7d6e82c730631d2c83ca09dde0f675805840f3
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-07 00:56:41 +00:00
Anas Nashif
297c920dc7 sanitychecks: update footprint numbers
Change-Id: I66c71f7322e1529d7b5bfda5b29eeb078b13daf1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-02 08:45:16 -04:00
Maciek Borzecki
24f008bd65 sanitycheck: add nucleo_f103rb abd stm32_mini_a15
Enable build tests for Nucleo-F103RB and STM32 MINI A15 platforms.

Change-Id: I26ccdb6edd537f5dfc9c0120e5a6d4ee1ed63dbb
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
2016-04-01 13:12:56 +00:00
Anas Nashif
e444363cb9 sanity: add quark_se_devboard to tested boards
Change-Id: I82cefb1baaa0c7174cebcd35c527fec3d133241e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-30 11:04:36 +00:00
Andrew Boie
64f7f3da8d compare_footprint: Python 3 compatibility
The script will now run under either Python 2 or Python 3.

Change-Id: Ia7e6647b2331ff9edfbdec7b7357439f7095a3bc
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-03-29 11:06:01 +00:00
Daniel Leung
8df10d4584 kconfig: untangle ordering and dependencies
There are two major issues with the kconfig:

() Some of the config options have incorrect dependencies inside help
   under menuconfig. For example, CONFIG_GPIO depends on BOARD_GALILEO.

() Since the SoC and board specific kconfig files are parsed first,
   the help screen would say, for example, CONFIG_SPI is defined at
   arch/arm/soc/fsl_frdm_k64f/Kconfig. This is incorrect because
   the actual config is defined in drivers/spi/Kconfig.

These cause great confusion to users of menuconfig/xconfig.

To fix these, the SoC and board defaults are now to be parsed last.

Note that the position swapping of defaults in this patch is due to
the fact the the default parsed last will be used.

And, spi_test is broken due to the fact that it requires
CONFIG_SPI_INTEL_PORT_1, but never enables it anywhere. This is
bypassed for now.

Origin: refactored and edited from existing files
Change-Id: I2a4b1ae5be4d27e68c960aa47d91ef350f2d500f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-26 20:36:32 -04:00
Daniel Leung
c6390d559f kconfig: prefer default values that are defined later
This is in preparation to move SoC and board kconfig defaults
to be parsed later.

Change-Id: If24bdf310dac7034da63f34c0e2add173fe75844
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-26 20:36:32 -04:00
Daniel Leung
4babac063c kconfig: add a debug option to print defaults in menuconfig
This adds a debug option to print defaults and their conditions
inside config description under menuconfig/xconfig. This aids in
debugging of kconfig creation.

Change-Id: Ie651435f6b2115dac1bd3a6f7a1b3c2df3c9b0ed
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-26 20:36:32 -04:00
Andrew Boie
e57a1e5622 sanitycheck: don't require arch.ini blocks for every platform
If the arch ini file doesn't have a specific block for the platform,
just assume all defaults.

Change-Id: Id6ab1ede8936bdd6006a5c4fd2f9a4f6aaf42478
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-03-23 15:35:38 +00:00
Andrew Boie
821d832f6d sanitycheck: allow N platforms per arch to be run
It is an unfortunate fact of life that our CI machines are often
severly underpowered virtual machines that take quite some time
to run sanitycheck --all. The only other option was to just use
the default test case filtering semantics which chose one platform
per arch to test.

Now it is possible to specify N platforms per arch with the new
--platform-limit option, allowing greater flexibility on how many
tests will be run.

The counter-intuitive use of '--platform all' or '--platform default'
is no longer supported as these use-cases are covered by other
command line options.

Change-Id: I45b0050df52e1a22e75534a3876d89e3c77698c9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-03-23 15:35:38 +00:00
Andrew Boie
ca094b1691 sanitycheck: enable qemu_x86_iamcu and prefer it over qemu_x86
Rationale for defaulting to IAMCU variant is that our most
interesting x86 boards use this calling convention. --all
will test both.

Change-Id: Idaddfec51a74ae85691d348adeeb88a8528060ea
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-03-12 02:24:51 +00:00
Andrew Boie
e79c960dd8 HACK: qemu: change e_machine for IAMCU binaries
For some strange reason IAMCU sets e_machine to 0x06 which causes
QEMU to freak out. This is just x86 code with a different C
calling convention, hack it back to 0x03 (EM_386) before running
under the emulator.

Change-Id: Ia5d51b771cad41f3013eb3d6a17912c8909c9bac
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-03-12 02:24:46 +00:00
Juan Manuel Cruz
08ed2fc106 debug: adds object tracing capability to microkernel events
Change-Id: I227fd996fa4046efe48b7383a60d3ac01ec9f946
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-03-11 22:13:04 +00:00
Juan Manuel Cruz
caa17577ef debug: kernel's object tracing api
Restructure the kernel's object tracing implementation
to provide a public API that allows debug tools to use
the debug hooks easier and allows kernel developers
to extend the kernel's object tracing scope and include
new kernel objects easier.

The API provides the trace list abstraction to keep track
of different types of kernel objects. The API contains
a simple single-linked list implementation that allows
to save space and simplifies the access to the data for
debug tools such as gdb.

Change-Id: Ic4d393d584576f67f2c5b706e61bae08869debba
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-03-11 12:00:07 +00:00
Jithu Joseph
9e45411a59 memory_pool_heap: malloc/free access over a heap memory pool
Specifying  HEAP_SIZE keyword in an app's MDEF file, results in
creating a new memory pool, which can be accessed using the
task_malloc() and task_free() APIs, which have the usual malloc/free
like semantics.

Expected format in MDEF file
HEAP_SIZE    <value>

Change-Id: I0569cffeecf8a2c23c20c7b359256123ece91982
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-03-10 23:19:59 +00:00
Anas Nashif
b2b9cdddc6 sanitycheck: updated footprint numbers
Change-Id: If73457fac32edf1b2e1b4192c6f266a050bbb6be
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-05 06:57:32 -05:00
Andrew Boie
4900aecc8e gen_idt: correctly warn on duplicate IRQ connections
Now if you try to call IRQ_CONNECT() multiple times on the same
IRQ line it will correcly fail the build, as intended.

Change-Id: Ia629ae3dd009bd3a2e1dbd9797dc2b723b02d234
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-03-03 10:24:25 +00:00
Andrew Boie
8f0211dcf3 sanitycheck: fail on footprint analysis of stripped ELFs
These don't have necessary symbol information to determine if the
kernel is XIP or not. Fail instead of giving bogus data.

Change-Id: I87f6eeb5983f5275929e5b8d448a054b83e23d8f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-03-03 10:24:06 +00:00
Andrew Boie
08ce5a5da7 sanitycheck: use Python 3
Python 2 isn't supported anymore and doesn't get fixes/updates.
For the long-term maintenance health of sanitycheck, convert to
use Python 3 interpreter, which mostly involved changes to how
strings are handled.

Change-Id: Ic42f5b2328001f04d876fd650986c4433968a76b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-24 17:10:39 +00:00
Andrew Boie
411a97c5d0 sanitycheck: correctly treat linker warnings as errors
Change-Id: I2fc82fe83d91121d2228251d9fba8a61ba33b63e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-24 17:08:56 +00:00
Anas Nashif
e7ee08338b checkpatch: fix SPACE false positive
Fix issue where a space is required after a comma:

-:245: ERROR:SPACING: space required after that ',' (ctx:VxB)
+	SECTION_PROLOGUE(_NOINIT_DMA_SECTION_NAME, (NOLOAD OPTIONAL),)

Now we will ignore such errors if the comma is followed by a ).

Change-Id: Ib38161cd11e650764c319ba373a1f7c1a6d80df6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-22 19:11:41 +00:00
Anas Nashif
76b0913a33 checkpatch: update checkpatch to latest from upstream
Update to commit 6b10df4257367dd0ead49f88df473972c00a8b5c from the Linux
kernel, relevant changes since last update:

 - checkpatch: fix a number of COMPLEX_MACRO false positives
 - checkpatch: improve macros with flow control test
 - checkpatch: warn when casting constants to c90 int or longer types
 - checkpatch: improve the unnecessary initialisers tests
 - checkpatch: improve tests for fixes:, long lines and stack dumps in commit log

Change-Id: Ic4f8d925cd7c076e18eb2f2841913be61239aac2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-22 19:11:23 +00:00
Anas Nashif
1e57226ae6 boards: remove obsolete CTB board
This board is not supported and not available for general public.
Use the Quark SE CRB/Devboard instead.

Change-Id: Id0f8c08bbacb812ef00fe9502b4acecf4f31ffd7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-17 17:07:08 +00:00
Anas Nashif
1b6140cc92 sanitychecks: update releas data after restructuring
We have moved tests around, update the files to get accurate footprint
changes per test case.

Change-Id: I563acef4665cb0ab6d3e7e01050a3a49f98b8b9d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-12 22:41:46 +00:00
Dan Kalowsky
50d24833b0 correcting issues identified by coverity
Change-Id: I0bec297b2db36ddd70d754c90ab8396e0890d2ca
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-12 15:48:48 +00:00
Juan Manuel Cruz
99198e794a kconfig: adapt kconfig to work with mingw
MinGW have small conventions differences in the
call of some APIs. The following differences are
addressed:
- mkdir method parameters
- printf format for 64 bit integers
- utsname structure
- glob library

MinGW does not provide glob library.
This patch adapts the code to avoid this library when
building for MinGW on windows systems.
The new routines allow windows to support wildcards
(*, ?) on Kconfig paths.

zconf.lex.c_shipped is the file that the build system
compiles by default. If the user defines the
REGENERATE_PARSES environment variable for the build,
then zconf.lex.c_shipped is generated from the file
zconf.l. Both files are provided in the patch
to keep coherency with the REGENERATE_PARSES option.

Change-Id: I5b6ad24ead0521913ab6ea9da93551edcd2dc66b
Signed-off-by: Louise Mendoza <yonattan.a.louise.mendoza@intel.com>
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-02-12 03:04:13 +00:00
Anas Nashif
a7c4aa2e8a sanitychecks: add new keyword 'kernel' to testcase.ini
Specify the kernel being tested instead of relying on parsing
Makefile for KERNEL_TYPE.

This is needed for testcases that build for multiple kernels.

Change-Id: Ic4df2fa66eee4cd498955aee2b0da80a99d35e30
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-11 02:23:26 +00:00
Anas Nashif
d93cb67109 scan for testcases in root to cover samples and tests
We have test cases in both samples and tests directories,
so cover both by scannining the root directory.

Change-Id: I5258d11b23ced2cc4fc88af4d40269310442dc9f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-11 02:23:00 +00:00
Peter Mitsis
32151afbda arm build: Select correct library version
The build system now pulls in the correct intrinsics libraries
when building for Cortex-M CPUs.

Change-Id: I55ed249cdeb04de8843ad4cdc0099e7031e368b0
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-11 01:13:49 +00:00
Andrew Boie
6bb087c511 sanitycheck: add testcase.ini field for slow tests
Some tests take a very long time to complete, add a directive in
testcase.ini to mark them as such. Unless --enable-slow is passed
on the command line, these tests are not executed, only compiled.

app_kernel and test_sha256 marked as slow test cases. It appears
test_sha256 was being skipped earlier due to platform_whitelist line
which has been removed; the test should be able to run on all
microkernel-supporting boards. Same with test_aes, which completes
very quickly and is not marked as 'slow'.

Change-Id: I39ec8212f3fa10122ff786c10b6659d22bae64e3
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-10 22:12:55 +00:00
Daniel Leung
f42664554e sanitycheck: enable build tests for Arduino Due
This enables sanitycheck to build for Arduino Due.

Note that there is no on-board bluetooth so bluetooth tests
are skipped.

Change-Id: I4f564e68ec65f01b7b33a32f6d0d7749290c0e5b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-10 01:35:33 +00:00
Andrew Boie
9fc3afc339 x86: rebase priority levels
Having priority levels 0 and 1 reserved on x86 due to implementation
details on how the CPU uses the vector table is confusing to users,
and makes it unnecessarily difficult to share drivers between arches.

Now on x86, priority levels 0 and 1 are available. Semantically, all
priority levels have had 2 subtracted from them.

It is no longer necessary to specify a priority level when the
vector itself is specified. If an IDT entry has a specific vector
associated with it, any priority argument is simply ignored.

In gen_idt, some simplifications have been made:
- The printed representation of a generated entry now fits on one line
- Some checks being done in validate_priority() were redundant, as
  generate_interrupt_vector_bitmap() also ensures that there are
  sufficient free vectors within a priority level.

Change-Id: I26669d8ee0a53f48fbc2283490a8c42d8b1daf8e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-08 21:45:07 -05:00
Javier B Perez
108aaf89ec compare footprint: fixed script to run in bash shell only
When you run the script in another console, no bash, the script
won't be able to run the sanitycheck due to the source.

Change-Id: I89d1f0a4e0ae9f8b0bf0cea77e3752c5a1012840
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-02-08 09:19:19 -06:00
Anas Nashif
b14104f81a sanitycheck: update footprint data for release
Change-Id: I1c9a1a18c04ca449a7cc398c5c6487979270e11e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:33 -05:00
Louise Mendoza
9f39a8aee9 build: fix fixdep warning.
The data type returned by sizeof in windows is different to Linux.
This commit cast the value to the largest type to avoid a warning
when compiling on MinGW and Linux.

Change-Id: I4ce50f0b62dd614b1d180adea5aa2679032643e0
Signed-off-by: Louise Mendoza <yonattan.a.louise.mendoza@intel.com>
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:25:31 -05:00
Anas Nashif
a49762ccce add debug/debugserver support
Change-Id: I114994cb092870cd57b8e43b197d56ab8ca7db20
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:30 -05:00
Anas Nashif
54634d6a43 add support for debugserver
Change-Id: Ib22d9c06ba7816c3b870973d16e1c25229f31e1f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:30 -05:00
Anas Nashif
c0ddcb7a49 Revert "Change the try-run option as disable by default."
This reverts commit e3c2477c52f792ec972f9715ac9a810e52bc9929.

This was done for windows build support. We can disable this for
windows individually instead of disabling it for everyone.

Change-Id: I8bd322b024c0471f89e83a41589c03783c0f9893
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:30 -05:00
Louise Mendoza
8905bdb49f build: add support for mingw32 zephyr toolchain
The toolchain provided by Yocto has a specific path location.
The linux toolchain home directory after the installation is
sysroot/i686-pokysdk-linux meanwhile the mingw toolchain home
directory is sysroot/i686-pokysdk-mingw32

Change-Id: I2241a996897539c2c630c6e391f5125b51385b8e
Signed-off-by: Louise Mendoza <yonattan.a.louise.mendoza@intel.com>
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:25:30 -05:00
Anas Nashif
416525849a toolchain: add support for external libc on arm/arc
Both ARM and ARC did not have the right include path defined.

Change-Id: I8322b49ffa1830ef7b06cddef686ceb83a85fdfa
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:29 -05:00
Anas Nashif
51be9a50a4 Add flash support for boards using latest SDK
Using the latest SDK (0.7.2) you can flash directly using make
by specifying the board, for example

make BOARD=arduino_101 flash

This will build and flash the generated binary to the board.

Change-Id: I90254abd69874efbb449ef318079958980c23074
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:29 -05:00
Andrew Boie
2ee9aca31a irq: size _irq_to_interrupt_vector_table
Most systems have far less than 256 IRQ lines available, so
save some bytes in ROM by making this a config option.

On systems with MVIC, omit the table entirely as the mapping
is fixed.

The build cmd_gen_idt is slightly easier to read and will fail
immediately if any of the commands in the sequence error out.

Change-Id: I411f114557591e5cd96b618e6f79f97e8bedadf0
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:25 -05:00
Anas Nashif
e3401c9496 toolchain: remove yocto variant, now using zephyr variant
Change-Id: I976f1e47a4fa80030878da1568dc71289bbd8e0f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:23 -05:00
Peter Mitsis
8e35cc8eb4 build: Add C++ support
Adds C++ support to the build system.

Change-Id: Ice1e57a13598e7a48b0bf3298fc318f4ce012ee6
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:23 -05:00
Peter Mitsis
a74d5d63f1 test c++: Recognize init_array as a valid section
Updates the sanitycheck script to identify the "init_array" section
as a valid section in the image.

Change-Id: I55c20909d3734e68e8ec319e1abde94da93665a1
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:22 -05:00
Anas Nashif
06e78de681 build: do not use link-zephyr
Use makefile targets to build and link final binary. This removes
dependency on a shell script which is not portable and imporves
dependency tracking when building.

Change-Id: Ib75f162cdb1dde35ccaf980658bfe70daaf581b6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:15 -05:00
Anas Nashif
3bdae61cac build: remove unused linux related code
- Modules are not a feature of the Zephyr kernel.
- genksyms removed, not used by zephyr
- bin2c remove, not used in zephyr

Change-Id: Ic8f0e786530dcf410b07d6c5cc47f1087000d528
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:15 -05:00
Anas Nashif
0bb325d035 release: Update sanitycheck footprint data
Change-Id: I6a5115980ab98617ab8496d246f9ae375b24c8a8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:14 -05:00
Anas Nashif
893320abd3 toolchain: remove forgotten debug message
Change-Id: I2d05eeafdb150452de31918ac8bde8fcdc31183d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:14 -05:00
Anas Nashif
e49530a562 kconfig: do not build with NLS by default
Build kconfig with -DKBUILD_NO_NLS by default and disable compiler
warning on Mac OS when building the host tools.

Change-Id: I76a2b5ab6b6b1c0bbe2dc2b31e3bd651fd05948e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:14 -05:00
Anas Nashif
04727bcf9e toolchain: remove hardcoded compiler versions
When the SDK is updated usually it comes with new versions of the
compiler causing issues with the toolchain not finding libraries.

This will get the version from the compiler and sets the path
accordingly.

Change-Id: I854c57bb082ae8136eebdd0ae7a8c151c1d699c8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:14 -05:00
Peter Mitsis
3c350ffb39 fixdep: Use correct printf identifier
Fixes a build warning caused by using the incorrect printf
identifier for a parameter of type size_t.

Change-Id: I03ecc245de366e7de07eb2b49a03f69af087090c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:13 -05:00
Anas Nashif
4cc935d4f0 build: update xtools configurations
Update the crosstool-ng .config files to build the most recent
gcc compiler (5.2.0) and update the configuration of the xtools
variant to use this compiler.

Change-Id: I8c895943a9db8637abf294da36df35040ae7527f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:13 -05:00
Anas Nashif
0b18055b4c rename fsl_frdm_k64f -> frdm_k64f
Shorten the name and remove the vendor prefix. No need to add
vendor to board names.

Change-Id: I68d441121c4034276706da63d7e5420ddf317149
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:13 -05:00
Louise Mendoza
264617c83d Adapt fixdep to works with MinGW
MinGW does not provide mman nor arpa/inet.h library.
This patch modify fixdep to work with windows without
using those library.

Change-Id: I3908735d0d989b165f2adb70b21f4cd41c8e15a6
Signed-off-by: Louise Mendoza <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:25:12 -05:00
Louise Mendoza
2386328e7e Adapt gen_offset_header to work with MinGW.
This patch change the custom macro WINDOWS for the macros
provided by the compiler to determine if it is being build
on Windows or Linux to use the correct flags for opening files.

Change-Id: I7278439767e93754eaae831b6f234b48c3ac8eac
Signed-off-by: Louise Mendoza <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:25:12 -05:00
Daniel Leung
efeb9b6534 update tests due to recent board files shuffle
() Adds board arduino_101, arduino_101_sss to sanity check.
   This will build the tests against these two new boards
   to catch issues.
() Updates existing sample apps to be arduino_101_sss instead of
   quark_se_ss, due to renaming of boards.

Change-Id: Ic512728d2ce581539bc3ae4c9f6524d5bf01b296
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:12 -05:00
Peter Mitsis
d6aeec249c rebranding: Remove stray references to VxMicro
Change-Id: I489dcd1a9ee8b8e502907543f284dc46220e5127
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:12 -05:00
Anas Nashif
dcf046c72d rename basic_atom with minnowboard
Use a real board name that can run this kernel instead of a generic
name. Basic functionality exits on this board with Zephyr.

Setup of the board is mostly similar to what we have in galileo (EFI
based)

Change-Id: Ic8554f26dcac0dbbbb6d35d863482f6207dc63c5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:11 -05:00
Anas Nashif
1cfc5b3f6f Move defconfig files to the board directory
This commit also renames boards and makes naming consistent between
board name and defconfig files.

quark_d2000_reference -> quark_d2000_crb
quark_se_test_sss -> quark_se_sss_ctb
quark_se_test -> quark_se_ctb

Change-Id: Ibe6a5102edb987fe1d6ce32c8c392a87d45d6951
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:11 -05:00
Anas Nashif
c740608ce5 Use BOARD instead of PLATFORM_CONFIG
Change-Id: I14db0087cd705df0db8a911071bc3949b5c79314
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:11 -05:00
Anas Nashif
013e6167a8 build: switch to board based configurations
Define boards based on platforms/SoCs and define them under boards/.
Also unify the naming of all platform, SoC and board files and use
platform.h for platforms and board.h for boards.

Change-Id: Icfeb96479ab5800aca98c80a79bdc3cecd645314
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:11 -05:00
Anas Nashif
fdb1daf786 kconfig: add board configurations
First step for adding the new board layer. Create configurations for the
various boards we support on x86 under boards with the new Kconfig variables
defining them.

The board selection is optional, that means you will be able to run

 make menuconfig

and create your own .config and select any SoC.

Change-Id: If08e88e9675d13f0f0501ef6750b9424b15f5dc8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:10 -05:00
Louise Mendoza
988e9eda1f Change the try-run option as disable by default.
When an app fail to run, windows show a pop-up with the errors.
To avoid this pop-up we disable this feature by default

Change-Id: If21f3aaf37555052874ee8e29310e955124d2cb0
Signed-off-by: Louise Mendoza <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:25:10 -05:00
Javier B Perez Hernandez
f55fefe3d0 compare footprint: added error counter and error message for sanity.
Added error log when base or current commit cannot be built.
Removed exit(1) when there are deltas, deltas should not be consider as errors.

Change-Id: I182edab83be14f642086818a9df0be96d8d4ae09
Signed-off-by: Javier B Perez Hernandez <javier.b.perez.hernandez@linux.intel.com>
2016-02-05 20:25:06 -05:00
Anas Nashif
3a87dae54d sanitize use of ARCH/SRCARCH
We now only use ARCH and avoid duplication of the same definition.

Change-Id: Ia61059b906a2ebc31e703412bead948997975d58
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:04 -05:00
Anas Nashif
801874d71f build: remove more unused linux code
Change-Id: Iac7472e6cdf002c850947375db7072f9a0d29e58
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:04 -05:00
Anas Nashif
275ca60b08 Fixed file description and applied doxygen style
Removed old style file description and documnetation and apply
doxygen synatx.

Change-Id: I3ac9f06d4f574bf3c79c6f6044cec3a7e2f6e4c8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:58 -05:00
Javier B Perez Hernandez
89d619b5b2 footprint compare: script to build and compare footprint apps
Added a new script to compare footprint apps and report
RAM or ROM changes in images. Also works without a git tree.

Usage:
./scripts/compare_footprint -h
./scripts/compare_footprint -b 1280bec
./scripts/compare_footprint -c 96acd07

Change-Id: Ib5d212eefe50c0d4650291265d6260604f9cd8c9
Signed-off-by: Javier B Perez Hernandez <javier.b.perez.hernandez@linux.intel.com>
2016-02-05 20:24:57 -05:00
Anas Nashif
621b5b18d8 sanity: update footprint numbers
Change-Id: Icc28e5562b114bcaa6a36effa3f3c75fce9af5c4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:57 -05:00
Sergio Rodriguez
2e2ad8166e qemu: Creation of QEMU specific platforms
Setting up new platforms to handle emulation, and make them the only
ones able to run on QEMU from the Makefile "qemu" target to avoid
confusion with other platforms. We have now platform qemu_x86 and
platform qemu_cortex_m3, also modification to the sanity checks to have
qemu support only on those platforms

Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Change-Id: I9291918a1d58fea4f37750ada78234628f9a5d98
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:56 -05:00
Anas Nashif
bbe94000e4 quark_se_ss: rename platform and remove arc suffix
This platform if actually a subsystem of the Quark SE SoC and is
not standalone. Use a more descriptive name and remove the architecture
from the platform name.

Change-Id: I16b1ab8dd668441683b07fc4512c219924463441
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:54 -05:00
Anas Nashif
5115fb57ad quark_se: rename platform and remove x86 suffix
Change-Id: I19ac3a4c6081720736c6fbf16b649ccf6ae60e2f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:54 -05:00
Anas Nashif
c47769bd56 kconfig: move all defconfig fragments to configs/
When building for a certain platform, we have no idea
what architecture we are building for.

We used to specify the architecture alongside the board or platform
name and this was used to find the defconfig in arch/<arch>/configs.

By putting all board configurations we support in one place we do
not have to specify the architecture, just the configuration name.

Change-Id: Ib7e9f63b9a8051714dc207f583fd26ef620497d8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:53 -05:00
Anas Nashif
24da31f7fa kbuild: support makefile wildcards
Change-Id: I7482899718da02975949c362045b4f09e117c27b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:52 -05:00
Anas Nashif
6e23ff44ef kconfig: support wildcards
This allows using wildcards with kconfig files so there is no need
to include individual files within a well define tree structure.

For example, you add

source "drivers/*/Kconfig"

and all Kconfig files under drivers/ will be sourced and the order in
menuconfig will be based on the wildcard processing, not in any particular
order.

The main advantage here is that drivers and platforms become drop-ins, a platform
or a driver can be added by just placing it in the right place without having to
change system Kconfig files or Makefiles (Makefiles will be supported in other change).

Change-Id: Id223ba10e6f48b4c48435e9ea37885162ce55e7c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:52 -05:00
Yonattan Louise
2ccaed8720 Adapt fixdep to support Windows.
Text files on windows are be created with a different format
for line endings. This commit improves the host tool 'fixdep' to
support files with the windows-style line endings.

Change-Id: I1d120790c5cbb1f1e7df6761821bc7e01c99b988
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:24:52 -05:00
Yonattan Louise
b8a0d15784 gen_idt: Change the custom host identifier macro.
In order to keep the code compatibility with Linux and Windows, the flag
O_BINARY is defined as zero when we are compiling in a Linux host. But
when compiling in a Windows host, we have to use the definition of the
flag provided by the host's includes. Currently, there is a custom macro
to identify if the host is a Windows host. This commit change that custom
macro for the macros that compilers provide to avoid defining a new one.

Change-Id: Ifeeab17c68d07039bd5b4a80c8263d338e6448ce
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:24:52 -05:00
Anas Nashif
0c22192c3f quark se: add sensor subsystem platform to sanity
Run sanity for this platform

Change-Id: Ic317c63d720a420d3d02e382e17742dec8d08e07
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:49 -05:00
Anas Nashif
c34da1576c sanity: add Quark D2000 and Quark SE
Change-Id: I06494a5a0a3697b6ce9224f7f5c1a86052898b9d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:49 -05:00
Anas Nashif
8ea9d02cdf sanity: add extra arguments when creating defconfigs
When config_whitelist is used in a testcase that has extra
arguments, those were not set correctly and the test case build would
fail in some cases.

Change-Id: Idb8a4f07d29beefe62de932afa7cc0986e8dd1d4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:43 -05:00
Anas Nashif
f80bc35d58 toolchain: update iamcu toolchain version
the iamcu toolchain is based on 5.2.1, update the variable so we
can point to the right path of headers/libraries.

Change-Id: Ia1634efc6fb6a37eb3456d9b7bd3c30e03c40b4e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:42 -05:00
Anas Nashif
98c50de9ff checkpatch: Allow space before [ in the case of inline asm
This allows the customary syntax for declaring named arguments,
such as:

asm ("mov %[out],%[in]" : [out] "=r" (x) : [in] "r" (y));

Since :[ is comple-error-inducingly invalid syntax in other cases,
this won't create unintentional leniency for normal uses of [

Originally from https://lkml.org/lkml/2010/11/16/145 by Dave Martin

Change-Id: Iead3fdb147ba2f6cbd108f19dd348bb72a7e6b6f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:42 -05:00
Anas Nashif
6c625c925f kbuild: remove unused and unsupported GCOV_KERNEL
CONFIG_GCOV_KERNEL comes from Linux, we do not use this feature
in Zephyr.

Change-Id: Ibef77ac4b26f2831b2fbba25e2a4d72899d75974
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:41 -05:00
Anas Nashif
4115d68ef9 link: remove unsupported features
Removing unsupported features that we inherited from Linux kbuild

Change-Id: I7cf19f913b0a7ba6195d2cb9c04b426144bdebb9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:41 -05:00
Anas Nashif
c0078cfb9b Remove linux features in build process that we do not support
Lots of code that is not being used by Zephyr but makes debugging and find
issues related to zephyr very difficult.

Change-Id: If8f6515d68f64b03cc881a9c3cde48c0451fe3b5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:41 -05:00
Anas Nashif
672cb6ba25 Update sanity test results
Run sanitycheck with --release option to generate the numbers for
this release.
This will reset the footprint numbers so that warnings are based on
the latest release numbers.

Change-Id: Ibad9ed4120cd47109eec7a234e70af5b12a2a630
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:37 -05:00
Dirk Brandewie
08cf2157f3 build: Add tags.sh to enable tagging targets
Add tags.sh from the Linux tree.  This file is used by the tags, TAGS,
cscope and gtags targets in the toplevel makefile.

Change-Id: I9b0845dab26dc9b15731888b3d713dd3950eb1d8
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:36 -05:00
Anas Nashif
2dba160235 update sanitycheck data
Change-Id: I3cc7337fe2b69ea81ecad355f3af8f38987fec23
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:36 -05:00
Andrew Boie
829c056260 sanitycheck: show absolute size deltas
Change-Id: I0de8446b32ca2def2baceab4fa837a022c82db84
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:36 -05:00
Anas Nashif
2bd99bcbdf sanitychecks: add skip keyword for skipping tests unconditionally
In case we want to skip a test for whatever reason without having to change
the other filters or deleting the ini file.

Change-Id: I8af527b1c56b8a2f395cb9ca336162233f150c2e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:35 -05:00
Daniel Leung
949e97aecf sysgen: fix copy-and-paste errors and more empty lines
While adding private object supports, there were lots of
copy and paste. This results in lines writing to kernel_main.c
while it should be writing to sysgen.h. So update those lines
to write to sysgen.h instead, and add more new lines there
so sysgen.h is easier to read.

Change-Id: I38496b58d6dc4ed8a50eab4e09ac7bff8c59026f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:35 -05:00
Daniel Leung
851c6f8f60 microkernel: introduce private event objects
This patch enables defining microkernel events within source code.
This is similar to other private kernel object patches.

The test has been modified a little bit due to the fact that
the event ID is now a memory address, instead of numeric ID.

Change-Id: Ie3c8d4f4e459d9c631e50bb242cf7a05ca8ea82c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:35 -05:00
Anas Nashif
8b45f4e50b sysgen: generate sysgen.h instead of zephyr.h
use zephyr.h as the main include in applications, no need to have nano/micro
includes in applications and samples.
Inclusion of the proper kernel headers is be handled in the zephyr.h based
on the configured and used kernel.

Change-Id: If5275cef5d2ad1f475dfb39102cb71cfe5630f6c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:35 -05:00
Peter Mitsis
47888a31db Update static IDT generation to use IRQ priority
Updates the 'gen_idt' tool to generate a mapping of IRQ numbers to
interrupt vector IDs, thereby allowing the IRQ priority to be utilized
when statically connecting an interrupt.

Change-Id: I2e54ceb65145682820dfbd8ca1ee6ec68d71ce1a
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:34 -05:00
Peter Mitsis
b2746c9b86 gen_idt: add unspecified macros
Adds the following macros to improve code quality.
   UNSPECIFIED_INT_VECTOR
   UNSPECIFIED_PRIORITY
   UNSPECIFIED_IRQ

Change-Id: Ia51becd39ce9cf07d8a26c15e62f3e3d5673b951
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:34 -05:00
Anas Nashif
eab9ee1fbe sanity: update sanity check data
Change-Id: I05816609e9364c7ae5126d87597d703158eed4be
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:34 -05:00
Yonattan Louise
86ea4e6827 OS Awareness: Add microkernel object tracing.
Add a list for each kind of microkernel object. Add the register of
the public objects to the tracing lists in the dynamic initialization
function of sysgen.

Change-Id: I8c413812e4db0f443c9dd3a5501e0096270dc70e
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:24:32 -05:00
Anas Nashif
db13998741 toolchain: change section macro to support external c libraries
rename the sections macro to avoid conflicts with the same
macro being defined in sys/cdefs.h of an external libc.

Change-Id: I4d9e060eeff788ca4112c0ad3e98f0bea135f145
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:29 -05:00
Anas Nashif
360682b5b5 toolchain: extend iamcu variant to support provided libc
Change-Id: I2c6681a4ea3a4c8bc2367a5e9d6baeabc5a0dd90
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:29 -05:00
Anas Nashif
cbfb62c93d checkpatch: Update to latest version from the Linux kernel
Lots of enhancements and bug fixes but primarily it fixes an issue
where checkpatch was reporting errors in lines that have not changed.

Change-Id: If141a294b92cbabd4ad8978a40168abb062aebfb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:29 -05:00
Javier B Perez Hernandez
f7fffae8aa Change BSD-3 licenses to Apache 2
Change all the Intel and Wind River code license from BSD-3 to Apache 2.

Change-Id: Id8be2c1c161a06ea8a0b9f38e17660e11dbb384b
Signed-off-by: Javier B Perez Hernandez <javier.b.perez.hernandez@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:24:29 -05:00
Peter Mitsis
5705d06874 x86: Properly initialize _interrupt_vectors_allocated[] bitmap
Updates the 'gen_idt' tool to generate a bitmap of (statically) allocated
interrupt vectors that is linked into the final image in a manner similar to
the static IDT. The kernel then uses this bitmap when dynamically connecting
an interrupt vector, thereby preventing the dynamic irq connections
from clobbering the static irq connections.

Change-Id: I0a8f488408dad4912736865179f32f63ff1ca98f
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:28 -05:00
Peter Mitsis
56fa1a98d0 x86: Update generation of static IDT
Adds two new fields to the ISR_LIST structure (irq and priority) to allow
the decoupling of the vector ID and priority from the IRQ number at some
future time.

As a result of the addition of these two new fields, the gen_idt tool is
modified to both process these new fields as well as validate them.

Change-Id: I343dac68d99c78168a25b19784140f85d5db7578
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:28 -05:00
Peter Mitsis
3dc247825c Refactor gen_idt
Refactor gen_idt tool to detect more errors as well as be both more clear and
easily expanded.

Change-Id: I035a0666871733cc670f64302a1e85be455550ee
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:28 -05:00
Peter Mitsis
ad76795063 gen_idt: Fix issues found by checkpatch
Change-Id: Ib486d8453c16c093dd188cd9e84c1eb2282ab746
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:28 -05:00
Peter Mitsis
b8780c7813 gen_idt: Update file description section
Change-Id: Ice0c88228f5d79404277502f68594db91058344b
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:28 -05:00
Anas Nashif
6f8d628d77 re-enable compile time option checking and make it conditional
When building a sinle application, use the compiler option checking
macro, disable macro if running sanity checks to speed up build
time.

Change-Id: I63b17f4bd9fdff9030f1b2550ec8b05ee0bc2df2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:28 -05:00
Anas Nashif
2cf0df018d sanity: build testcase defconfigs for config_whitelist
Originally, the config_whitelist was done on the platform level
ignoring any config options in the testcase. This change generates
the defconfig for all relevant testcases that have config_whitelist
and applies filters based on the testcase defconfig.
If we have many testcases using config_whitelist it might be a bit
slower, but it is more accurate.

Change-Id: Ie1e871e85f05196d04419d6cf9a87f9927bfbfd1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:28 -05:00
Anas Nashif
30d1387c5c sanity: add platform/arch exclude functionality
Change-Id: I8af20c04ba8b0872d5196aa166d2479bfa048275
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:28 -05:00
Andrew Boie
9882dcd3d2 sanitycheck: look for misaligned XIP VMA/LMA addresses
XIP is currently implemented in Zephyr by copying only the RW
sections from flash into RAM. For these sections, if the VMA spacing
is different than the LMA spacing the sections in RAM will not be
at the right addresses. Warn about this situation.

Change-Id: I59a55fc27703103e37a7f0bbc34f236047621e0e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:27 -05:00
Andrew Boie
73b4ee69b7 sanitycheck: binary size calculation improvements
- Several recently added binary sections were not being taken
  into consideration, unknown sections now trigger test case
  failure
- Use same VMA/LMA terminology that objdump uses and show both
  addresses

Change-Id: I641eef64aaed6612f62e5aa092f66baaa2797c70
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:27 -05:00
Anas Nashif
b7881fecfa checkpatch: remove comment about MAINTAINERS file
Zephyr does not have a MAINTAINERS files, so remove the comment
about checking the file when reporting false positives to avoid
confusion.

Change-Id: I915dba009902a68d5e621603d22b7df57d84a1b1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:23 -05:00
Anas Nashif
38c0d1884a sdk: create a new variant for zephyr based on yocto
Introduce a new variant for the Zephyr SDK, do not call it
Yocto SDK anymore.

Keeping the yocto variant for now to avoid breaking developer
setup.

Change-Id: I545693eb4be4cec910096ca2ba7e3f38803b4c8d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:23 -05:00
Anas Nashif
9dbbf2c809 sanity: update baseline for sanity reports
Change-Id: I3f3e527ce783244f789d31f56aa6113c959194c3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:22 -05:00
Juan Manuel Cruz
7fe3dc4510 build: help message config targets update
This commit removes *config targets that does not apply to
the system or that are not implemented

Change-Id: Ib7739fda4085562fbe7d14491b7de9f354d0dc7d
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:24:22 -05:00
Andrew Boie
5d4eb7812b sanitycheck: fix issues if alternate binary name is used
Fixes an issue if CONFIG_KERNEL_BIN_NAME is customized.
There isn't a mechanism to parse the project defconfig, but
as there should be exactly one .elf artifact in the outdir
just glob it.

Change-Id: Ib3d517006dd13ef6e3e10ea3a8e975c287344d56
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:22 -05:00
Allan Stephens
ddaebc15b3 kernel: Eliminate use of main() in microkernel
Revises microkernel initialization code by incorporating the existing
_k_kernel_init() and main() routines into _main(). This optimizes kernel
initialization a bit, and allows application code to use main()
if desired -- for example, as the entry point to an application task.
The change also eliminates the need for sysgen to generate a routine
whose content is always the same.

This change preserves the existing order of operations done during
kernel initialization, and leaves further improvements for later.

Change-Id: Ie03d8a6f38f8a311f398667ed977fd8478719d70
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:24:21 -05:00
Javier B Perez Hernandez
9ff8875a6c toolchain yocto: Update makefile to use SDK 0.6
Updated bin references in Makefile.toolchain.yocto
with new versions of gcc and locations.

Change-Id: I12e623ebfdf1863b58865fcd7f1eb7413b0f236f
Signed-off-by: Javier B Perez Hernandez <javier.b.perez.hernandez@linux.intel.com>
2016-02-05 20:24:19 -05:00
Alexandre dAlton
3bef343493 linker: add whole-archive flag to app lib
Change-Id: I167b67bb227718d18bc383c4562cccaa915ed22b
Signed-off-by: Alexandre d'Alton <alexandre.d'alton@intel.com>
Signed-off-by: Alexandre d'Alton <alexandre.dalton@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:04 -05:00
Anas Nashif
0073eecba9 merge_config: look for *.config files in app root
Change-Id: Ie0fa2b8ea4560402ce7f07851a2de066924ec8be
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:59 -05:00
Masahiro Yamada
32e1ecb827 kbuild: add generic mergeconfig target, %.config
"scripts/kconfig/merge_config.sh && make oldconfig" works well
enough for merging local config fragments, but Kbuild currently has
the entry points only for "kvmconfig" and "tinyconfig".

This commit provides the generic target for mergeconfig, so we can
manage our own config fragments easily:
put "foo.config" in arch/$(SRCARCH)/configs/ or kernel/configs/,
and then run "make foo.config".

Now "make kvmconfig" is just a shorthand of "make kvm_guest.config".
Likewise, "make tinyconfig" is equivalent to
"make allnoconfig tiny.config".

Change-Id: I9ea4fd21ac46b42c2b6d87ee7eeeff67768bc375
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:59 -05:00
Masahiro Yamada
830c9fbc5c kbuild: mergeconfig: remove redundant $(objtree)
Kbuild always runs in $(objtree).  Actually, $(objtree) is always
set to "." by the top-level Makefile.

We can omit "-O $(objtree)" and "$(objtree)/".

Change-Id: I17eea62cc3b85957572f9f9eb5207caa1a91f881
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:59 -05:00
Masahiro Yamada
61c6277e86 kbuild: mergeconfig: fix "jobserver unavailable" warning
If "make kvmconfig" is run with "-j" option, a warning message,
"jobserver unavailable: using -j1.  Add `+' to parent make rule.",
is displayed.

  $ make -s defconfig
  *** Default configuration is based on 'x86_64_defconfig'
  #
  # configuration written to .config
  #
  $ make -j8 kvmconfig
  Using ./.config as base
  Merging ./arch/x86/configs/kvm_guest.config
    [ snip ]
  #
  # merged configuration written to ./.config (needs make)
  #
  make[2]: warning: jobserver unavailable: using -j1.  Add `+' to
  parent make rule.
  scripts/kconfig/conf --oldconfig Kconfig
    [ snip ]
  #
  # configuration written to .config
  #

Change-Id: Icda8d75af0bb50612cb020874649593c2ed0154f
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:59 -05:00
Masahiro Yamada
8f298d3fe1 merge_config.sh: rename MAKE to RUNMAKE
The variable "MAKE" is used to store the command name that has
invoked the Makefile.  (Actually, it is already set to "make"
if you run this script from a Makefile.)

In this script, however, it is used to determine if Make should be
run or not.  It is not what we usually expect.

Change-Id: I6891ecfc5003b4494d72878fa0da00a6ab452b21
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:59 -05:00
Sam Bobroff
224fa9455c merge_config.sh: exit on missing input files
Add a check for the existence of input files and exit (with failure)
if they are missing.

Without this additional check, missing files produce error messages
but still result in an output file being generated and a successful
exit code.

Change-Id: I8609e00ce99b491dcb1d41e64106a6829dc1fb41
Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:59 -05:00
Masahiro Yamada
15e1669e48 kbuild: mergeconfig: move an error check to merge_config.sh
Currently, "make tinyconfig" does not work with "-j" option.

  $ make mrproper
  $ make -j8 tinyconfig
    HOSTCC  scripts/basic/fixdep
    HOSTCC  scripts/kconfig/conf.o
    SHIPPED scripts/kconfig/zconf.tab.c
    SHIPPED scripts/kconfig/zconf.lex.c
    SHIPPED scripts/kconfig/zconf.hash.c
    HOSTCC  scripts/kconfig/zconf.tab.o
    HOSTLD  scripts/kconfig/conf
  scripts/kconfig/conf --allnoconfig Kconfig
  #
  # configuration written to .config
  #
  scripts/kconfig/Makefile:122: *** You need an existing .config
  for this target.  Stop.
  make: *** [tinyconfig] Error 2

As shown above, "allnoconfig" has created the .config file before
mergeconfig is called, but Make still raises a false alarm because
of some sort of race condition.

We can fix this issue by moving the error check to the shell script.

Anyway, scripts/kconfig/merge_config.sh always requires an existing
.config as a base file.  It is reasonable to check its existence in
the shell script.

Change-Id: I4c6b26bf3b19c5d5b19ed43ee6b553f7a5944c21
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:59 -05:00
Masahiro Yamada
1540777fe4 kconfig: fix a misspelling in scripts/kconfig/merge_config.sh
Change-Id: I5fdbe712db8e15031c8c214c0d4378f8508d03da
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:59 -05:00
Olof Johansson
40cd34e5de merge_config.sh: Display usage if given too few arguments
Two or more arguments are always expected. Show usage and exit if
given less.

Change-Id: I1e503495f34eab3f181238a1aa877a4aee3b7e5e
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:59 -05:00
Daniel Leung
8253b90cfc microkernel: add task pointer list
Due to similar padding issue as pipe, the list of task object
may not be used directly. As mentioned before, some compiler/linker
may pad the large struct. For example, compiling under gcc and
march=i686 pads the struct to 32-byte alignment (march=atom to
64-byte alignment). This causes issue with sizeof() and pointer
arithmetic because they have no idea about the padding.
When the stars align in a certain way, these task structs may be
corrupted. So add a task pointer list and use it for task
manipulation. The task list remains as it is beneficial to group
them together to take advantage of cache locality.

Change-Id: I0e86bfe05742040f4540d7854c1ac14e76162776
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:58 -05:00
Anas Nashif
8976762df8 arc: rename generic platform to generic_arc
The generic name is too generic and when it appears on its
own, for example nano_generic_defconfig, it is not
visible what the file is about, so call it generic_arc the same
way the Kconfig platform is called.

Change-Id: Icf737f305d84142dad4f52fd26a5c7481f9fc5be
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:58 -05:00
Dirk Brandewie
e5844a41d5 sanitycheck: add arc architecture
Add ARC to the list of architectures sanitycheck will build against.

Change-Id: Ibf1aa3a167a7a53a59b40bde4442d16f7d7b9611
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:15:58 -05:00
Benjamin Walsh
0f5607a211 microkernel: rename _k_init_node() to _k_init_dynamic()
It was badly named: this routine initializes what cannot be done
statically, i.e. what has to be done dynamically.

We also do not have concepts of "node" anymore since the kernel is
single-node only.

Change-Id: Idde3183ca01ca3f70c5ae0e948734a965582ded8
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:36 -05:00
Anas Nashif
4df6dfe040 sanity: update test footprint data
Change-Id: I7f6e2ef8264077aa2a976bfce393a61bdc7ec99b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:35 -05:00
Andrew Boie
b391e66edf sanitycheck: fix -O with relative paths
Change-Id: If4bcfb20113344bd62bcf33ccc594ac9b7c7a7e1
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:15:34 -05:00
Andrew Boie
4ef16c5314 sanitycheck: properly report defconfig build errors
Change-Id: I9122f9c1d8232caa110dd6459c5f7cf2a079e36b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:15:33 -05:00
Anas Nashif
cec625afc4 Move sysgen hooks and file generation to top-level Kbuild
Change-Id: Icb06c0e041e08863947c7b31d843771c3f2c6a0c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:33 -05:00
Anas Nashif
e927a459cd build offsets in-place and not in include/generated
We have been building offsets.o in the include directory, this
is wrong.

Change-Id: I22e785413158117e1cdfa8353bd7f4d022fae0ac
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:33 -05:00
Anas Nashif
e3ac0907df Move scripts/Makefile.<arch>preparch to arch/<arch>
Follow the model of the Linux kernel for adding arch
specific CFLAGS by using the Makefile and Kbuild combination
in the arch/<arch> directory.

This will also allow adding architecture specific targets and is
easy to maintain when alongside the architecture.

Change-Id: If51a78e8845baa71d9090c4a4f49fcd013354840
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:33 -05:00
Anas Nashif
fde80d7ead cleanup makefiles and remove duplication
Makefile.inc duplicates many of the existing targets in Makefile.
Instead of duplication, pass all none local targets to Makefile
and implement only those needed locally.

Change-Id: I1e923dd398a138543fa676ab67570b630c75d7ea
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:32 -05:00
Anas Nashif
e4fe55c8e8 add script to build grub for galileo
This script will download and build grub.efi which can
be used on galileo for booting Zephyr.

Change-Id: Iba8777ae3868befa3bcd3972813779dbecd9c947
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:31 -05:00
Anas Nashif
9b9ab3767a make sed happy on OSX when invoked with -i
Change-Id: I6180aedf11ec68e9698e48c612d202e39eaa3adf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:31 -05:00
Anas Nashif
bd2274813d use gen_offset_header to generate offsets.h
Using nm and sed works fine on Linux, however when moving to other
platforms, nm and sed do not work the same way and might have
different behaviour. This reduces dependency on host tools and brings
back the code for generating the offsets.h directly using a built
utility that is portable.

Change-Id: I13db1c16cbed12e366fd41d151886bbcbf419548
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:31 -05:00
Anas Nashif
9927108ab7 sanity: update footprint data for release
Change-Id: I4542e55953a99cf00796ee6300779af6c8457e8a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:28 -05:00
Benjamin Walsh
bed144b179 microkernel: rename k_proc to k_task
k_proc was a legacy leftover that does not make any sense, since there
is no concept of a "process" in the system. Rather, that data structure
refers to a 'task control block', i.e. the representation of a task
execution context from the microkernel's point-of-view (not to confuse
with the 'struct ccs', the representation of a thread execution context,
from the nanokernel's point-of-view).

Change-Id: Ic29db565af023be629ce740bbcb652ece7dc359f
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:27 -05:00
Anas Nashif
05875f062d toolchain: support toolchain variants
This commit enables the use of special toolchains other than
the default. Some architectures have specialized cross-compilers
within the same SDK that need to be enabled for specific platforms
of an architecture.

For example, for Intel MCUs, we have an optimized toolchain that
needs to be used for specific platforms under x86.

Change-Id: I7e25603dd66ed3ec4e019c72483c76a32b3bbdde
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:25 -05:00
Anas Nashif
b2f5c48755 remove shared/ and create files directly
The files idtEnt.h and segselect.h in shared are linked from
the source tree for no good reason adding and extra top level
directory that might be confusing.

The shared/ here means shared between host and target, this is
not longer necessary in our build system.

Change-Id: Id9665e10de7a1d290888d9069be3db9f4330d284
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:25 -05:00
Andrew Boie
bbd670c9fc sanitycheck: add -z option for 'truesize' functionality
The sizing code was merged with the sanitycheck script. A new
-z option has been added to simply measure and report sizes
to stdout instead of running any tests.

Change-Id: I1450e3b08e3bd0030d2df00190da884621962d01
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:15:24 -05:00
Andrew Boie
ea7928f642 sanitycheck: add --all-deltas option
This shows all changes in size, good or bad. Useful for testing
size optimizations.

Change-Id: I47124b64f7d751120af666a4b7c7efd4bbed4ac8
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:15:24 -05:00
Peter Mitsis
92d1810def Fix typo: occured -> occurred
Change-Id: I40150719135108f18834a35db1c5be7ca4c5c9b2
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:21 -05:00
Anas Nashif
a8259afed8 allow linking of external application libraries
This will allow building of external components and linking
them at the end of the build process to the main kernel.

add a Makefile.app to the project directory with the required
targets, for example

Makefile.app:

KBUILD_ZEPHYR_APP := /tmp/libapp.a

/tmp/libapp.a:
	@touch /tmp/libapp.a

Change-Id: If2ba6b3ee59023acc5f85c5701b65c4d096d5059
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:21 -05:00
Anas Nashif
8cdd210798 move qemu patch to script/patches
Change-Id: Ib1c85f476901db7164305236e88f157434ebfda1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:21 -05:00
Anas Nashif
7312837c5f mdef: allow mdef file to be at custom location
Right now mdef file of an app can only be hosted in the
application root or under the same tree. This patch
allows hosting the file at custom location outside the
application tree.

Change-Id: I5ffdacb00d29d754d0fdd826c8f190f5a7968905
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:21 -05:00
Andrew Boie
2041d5b227 remove old sanity check mechanism
Change-Id: I754c4db10844d346277e8f47ba99db3c0cd6bc79
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:15:20 -05:00
Anas Nashif
427cdd36ec sanity: add new line when emitting an error
Change-Id: I4075dbe3706b45e926e9ab4d0f620fe262aaa705
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:19 -05:00
Daniel Leung
971eb0ef44 samples/microkernel: add test for private memory maps
This adds unit test for microkernel private memory maps.
The code piggybacks to the public memory map test (by
including the same source file), so any updates to
the test will be applied to both.

Note that the prj.mdef are different for both tests, since
the private memory maps test move the memory maps inside
source code. So, both mdef files will need to be updated at
the same time.

Change-Id: Ia7f65f55b61d9fb0d42ba58d63662e914d69194e
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
0abe07a0cd microkernel: introduce support for private memory maps
This enable defining memory maps in source code in addition to
defining in MDEF files. This introduces the macro
DEFINE_MEM_MAP(mem_map_name, ...). The memory maps created this
way are the same, in functionality, as those defined in MDEF
files. They can be manipulated by the standard microkernel
memory map APIs.

Define the memory map using:

  DEFINE_MEM_MAP(mem_map1, blocks, block_size);

and "mem_map1" can be used, for example:

  task_mem_map_alloc(mem_map1, ...);

or,

  task_mem_map_free(mem_map1, ...);

etc.

To use the memory map defined in another source file, simply add:

extern const kmemory_map_t mem_map1;

to the desired C or header file.

Change-Id: I9c551b90f9d0a95f961fd8ec1c5278c2ea44312d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
201aa8c708 microkernel: put memory map pointers into its own binary section
The _k_mem_map_list was a static array generated by sysgen,
where it containing all pre-defined memory maps from MDEF file.
To support private memory map objects (aka, defining them within
source files), the list has to accommodate memory maps that
are not only processed through sysgen, but also those defined
within source files.

This is done by creating a new section in binary, and all memory
map pointers go into this section. By doing this, the list
can still be manipulated as an array.

Change-Id: I1f3414b72f685fef4b99850749178661f14d9345
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
a77808462e Redefine microkernel memory map object identifier type
The opaque memory map object id type is now a pointer to
the associated memory map structure, rather than an index
into the microkernel's array of memory map structures.

This change is a pre-requisite to support for private
memory map objects, which are defined in source code.

Change-Id: I82ecb59eeed00efa54f781f775710c92ff9c9fc9
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
8eec65c742 samples/microkernel: add test for private pipes
This adds unit test for microkernel private pipes.
The code piggybacks to the public pipe test (by
including the same source file), so any updates to
the test will be applied to both.

Note that the prj.mdef are different for both tests, since
the private pipes test move the pipes inside source
code. So, both mdef files will need to be updated at
the same time.

Change-Id: I6fdb5eab7c3a1d6f4b72c26a3620cee0188b07a5
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
b5517ab61c microkernel: introduce support for private pipes
This enable defining pipes in source code in addition to
defining in MDEF files. This introduces the macro
DEFINE_PIPE(pipe_name, ...). The pipes created this
way are the same, in functionality, as those defined in MDEF
files. They can be manipulated by the standard microkernel
pipe APIs.

Define the pipe using:

  DEFINE_PIPE(pipe1, size);

and "pipe1" can be used, for example:

  task_pipe_put(pipe1, ...);

or,

  task_pipe_get(pipe1, ...);

etc.

To use the pipe defined in another source file, simply add:

extern const kpipe_t pipe1;

to the desired C or header file.

Change-Id: Iae8e04706359bc18aae51acc75df3e3d26388882
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
815d64522f microkernel: put pipe pointer list into its own binary section
The _k_pipe_list was a static array generated by sysgen,
where it containing all pre-defined pipes from MDEF file.
To support private pipe objects (aka, defining pipes within
source files), the pipe list has to accommodate pipes that
are not only processed through sysgen, but also those defined
within source files.

This is done by creating a new section in binary, and all pipe
pointers go into this section. By doing this, the pipe list
can still be manipulated as an array. The reason behind
putting the pointers to pipe, instead of the pipe objects
themselves, is that some compiler/linker may pad the large pipe
struct. For example, compiling under gcc and march=i686 pads
the struct to 32-byte alignment (march=atom to 64-byte alignment).
This causes issue with sizeof() and pointer arithmetic because
they have no idea about the padding. So use pointers here to
prevent padding.

Change-Id: I6d3b75614c4d8760c037a5c26746410d4e4b17cb
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
2285976f03 microkernel: redefine pipe object identifier type
The opaque pipe object id type is now a pointer to
the associated pipe structure, rather than an index
into the microkernel's array of pipe structures.

This change is a pre-requisite to support for private
pipes, which are defined in source code.

This also moves the required struct into more visible
headers such that private pipes can be declared.
Renaming the struct is also being done to conform to
naming convention for private kernel objects.
Since a couple structs have to be moved anyway, so
do the moving and renaming here too (contrary to what
have been done in the past, with separated patches).

Change-Id: Ibb6ec7f62745a81439ae3ea2616688b757439843
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
62077917b6 samples/microkernel: add test for private tasks
This adds unit test for microkernel private tasks.
The code piggybacks to the public task test (by
including the same source file), so any updates to
the test will be applied to both.

Note that the prj.mdef are different for both tests, since
the private tasks test move the tasks inside source
code. So, both mdef files will need to be updated at
the same time.

Change-Id: I2890f70be460c0e45208ce03d6e7897d2662f6f0
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
75e5427e15 microkernel: put _k_task_list into its own binary section
The _k_task_list was a static array generated by sysgen,
where it containing all pre-defined tasks from MDEF file.
To support private task objects (aka, defining tasks within
source files), the task list has to accommodate tasks that
are not only processed through sysgen, but also those defined
within source files.

This is done by creating a new section in binary, and all task
objects go into this section. By doing this, the task list
can still be manipulated as an array, which is required for
task group operation.

Change-Id: I799d6967567079498bc414e0cb809e8af856b53e
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
1367a98e9e Redefine microkernel task object identifier type
The opaque task object id type is now a pointer to
the associated task structure, rather than an index
into the microkernel's array of task structures.

This change is a pre-requisite to support for private
task objects, which are defined in source code.

Change-Id: Idb53ea7f8a8a5b7e6477a74273930b08fc77dcfe
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
f6369abf4d samples/microkernel: add test for private mailboxes
This adds unit test for microkernel private mailboxes.
The code piggybacks to the public mailbox test (by
including the same source files), so any updates to
the test will be applied to both.

Note that the prj.mdef are different for both tests, since
the private mailboxes test move the mailboxes inside source
code. So, both mdef files will need to be updated at
the same time.

Change-Id: I52ccc5931b1abfd3ae3d654f888d4a019268bba0
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
39887c4358 microkernel: introduce support for private mailboxes
This enable defining mailboxes in source code in addition to
defining in MDEF files. This introduces the macro
DEFINE_MAILBOX(mailbox_name). The mailboxes created this
way are the same, in functionality, as those defined in MDEF
files. They can be manipulated by the standard microkernel
mailbox APIs.

Define the mailbox using:

  DEFINE_MAILBOX(mailbox1);

and "mailbox1" can be used, for example:

  task_mbox_put(mailbox1, &msg);

or,

  task_mbox_get(mailbox1, &msg);

etc.

To use the mailbox defined in another source file, simply add:

extern const kmox_t mailbox1;

to the desired C or header file.

Change-Id: I32d4194af740f96fc8df8c6cd3144a0c9accb4ec
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
105e723faa microkernel: Rename struct mbx_struct to _k_mbox_struct
This is in preparation to enable private mailbox support.
The struct needs to be moved into more visible header
so private mailboxes can be declared. This also renames
according to naming convention to be private kernel
objects.

Change-Id: Ibd75497e726efd447d27f3bfd0b4695ed1695693
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
09387cc9dd Redefine microkernel mailbox object identifier type
The opaque mailbox object id type is now a pointer to
the associated mailbox structure, rather than an index
into the microkernel's array of mailbox structures.

This change is a pre-requisite to support for private
mailboxes, which are defined in source code.

Change-Id: Ide832eee2a0762e601847ad07afba380bd79ed8b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
5d934a3786 samples/microkernel: add test for private FIFOs
This adds unit test for microkernel private FIFOs.
The code piggybacks to the public FIFOs tests (by
including the same source file), so any updates to
the test will be applied to both.

Note that the prj.mdef are different for both tests, since
the private FIFOs test move some of the FIFOs
inside source code.

Change-Id: I4130ac540b10a31cd30f37890e9cc389af73e89b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
e510742d43 microkernel: introduce support for private FIFOs
This enable defining FIFOs in source code in addition to
defining in MDEF files. This introduces the macro
DEFINE_FIFO(fifo_name). The FIFOs created this
way are the same, in functionality, as those defined in MDEF
files. They can be manipulated by the standard microkernel
FIFO APIs.

Define the FIFO using:

  DEFINE_FIFO(fifo1, depth, width);

and "fifo1" can be used, for example:

  task_fifo_put(fifo1);

or,

  task_fifo_get(fifo1);

etc.

To use the FIFO defined in another source file, simply add:

extern const kfifo_t fifo1;

to the desired C or header file.

Change-Id: I29667c4cfdcd0e6d189358478acf1a6149ecb826
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
e27b5c9abf microkernel: Rename struct que_struct to _k_fifo_struct
This is in preparation to enable private FIFO support.
The struct needs to be moved into more visible header
so private FIFOs can be declared. This also renames
according to naming convention to be private kernel
objects.

Change-Id: I9b90ddccbaf01ff8c7e2ef03c926d0328dd7ec39
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
ef242d3291 Redefine microkernel FIFO object identifier type
The opaque FIFO object id type is now a pointer to
the associated FIFO structure, rather than an index
into the microkernel's array of FIFO structures.

This change is a pre-requisite to support for private
FIFOs, which are defined in source code.

Change-Id: Ieb1343d6d5dd1b747063603457d47fab2710f557
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
8232067646 samples/microkernel: add test for private semaphores
This adds unit test for microkernel private semaphores.
The code piggybacks to the public semaphores tests (by
including the same source files), so any updates to
the test will be applied to both.

Note that the prj.mdef are different for both tests, since
the private semaphores test move some of the semaphores
inside source code.

Change-Id: Ic318bf6808514c5d335a46cb3e88ebf6000f4c3e
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
a0224842bc microkernel: introduce support for private semaphores
This enable defining semaphores in source code in addition to
defining in MDEF files. This introduces the macro
DEFINE_SEMAPHORE(semaphore_name). The semaphores created this
way are the same, in functionality, as those defined in MDEF
files. They can be manipulated by the standard microkernel
semaphore APIs.

Define the semaphore using:

  DEFINE_SEMAPHORE(sem1);

and "sem1" can be used, for example:

  task_sem_give(sem1);

or,

  task_sem_take(sem1);

etc.

To use the semaphore defined in another source file, simply add:

extern const ksem_t sem11;

to the desired C or header file.

Change-Id: Ia9c128648f7a26fc776eeb8f6fcc4158b1712a97
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
1036aee613 microkernel: Rename struct sem_struct to _k_sem_struct
This is in preparation to enable private semaphore support.
The struct needs to be moved into more visible header
so private semaphores can be declared. This also renames
according to naming convention to be private kernel
objects.

Change-Id: I84ac7d580404ac5e1753c1bd446d38993fd23310
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
013666c964 Redefine microkernel semaphore object identifier type
The opaque semaphore object id type is now a pointer to
the associated semaphore structure, rather than an index
into the microkernel's array of semaphore structures.

This change is a pre-requisite to support for private
semaphores, which are defined in source code.

Change-Id: I3821360be35237bfe3bf090efce84f99e335d309
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Allan Stephens
eddae0e0f2 sysgen: Don't generate mutex object id variables
It is no longer necessary to generate variables containing the
object id each public mutex. This capability was once needed to
allow kernel code to reference mutexes generated by the build
system (i.e. pseudo-private mutexes); however, the existence of
private mutexes renders this obsolete.

Change-Id: I594be31268c9a336ae2a43d48c1b32dbf3d7cde0
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
811c838ff1 microkernel: introduce support for private mutexes
This enable defining mutexes in source code in addition to
defining in MDEF files. This introduces the macro
DEFINE_MUTEX(mutex_name). The mutexes created this way are
the same, in functionality, as those defined in MDEF files.
They can be manipulated by the standard microkernel
mutex APIs.

Sample usage:

    DEFINE_MUTEX(mutex1);

    void one_function(void)
    {
        task_mutex_lock_wait(mutex1);
        ...
        task_mutex_unlock(mutex1);
    }

To use the mutex defined in another source file, simply add:

    extern const kmutex_t mutex1;

to the desired C or header file.

[ DL: This is a slightly modified version of similar patch
      by Allan Stephens available at
      https://oic-review.01.org/gerrit/3255 ]

Change-Id: Ib9cd8193eaf849a8aad1d217912759324ee8818e
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:14:46 -05:00
Daniel Leung
43eed86737 microkernel: Rename struct mutex_struct to _k_mutex_struct
This is in preparation to enable private mutex support.
The struct needs to be moved into more visible header
so private mutexes can be declared. This also renames
according to naming convention to be private kernel
objects.

Change-Id: Ifccb60a837b44e443be0b091c2df4f06373718fe
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:14:46 -05:00
Allan Stephens
ffd802250e Redefine microkernel mutex object identifier type
The opaque mutex object id type is now a pointer to the associated
mutex structure, rather than an index into the microkernel's
array of mutex structures.

This change is a pre-requisite to support for private mutexes
(i.e. mutexes not defined using a project's MDEF file).

[DL: fix some whitespace issues.]

Change-Id: Ida419f1674df245f51a36d28ca7d4631239f1edd
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:14:46 -05:00
Daniel Leung
74c8852d05 microkernel: remove kernel service dispatch table
This change removes the internal number-to-function mapping
of microkernel services. Instead, function pointers are used
to specify which service to use.

This is in preparation for private kernel objects. Before this,
only kernel objects that are defined in MDEF files would have
corresponding functions included in the final binary, via sysgen
by populating an array of number-to-function mapping. This
causes an issue when a certain type of objects are all defined
with source code, and never in MDEF file. The corresponding
mapping would be deleted, and the functions are never included
in the binary. For example, if no mutexes are defined in MDEF
file, the _k_mutex_*() functions would not be included.

With this change, any usage of private kernel objects will hint
to the linker that those functions are needed, and should not be
removed from final binary.

Change-Id: If48864abcd6471bcb7964ec00fe668bcabe3239b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:14:46 -05:00
Peter Mitsis
739489f337 Kconfig: Rework PLATFORM_QUARK to become PLATFORM_IA32_PCI
1. The new name aligns with the 'arch/x86/platforms/ia32_pci' platform
   directory.
2. A shorter prompt works better with menuconfig.
3. Removes IOAPIC selection as HPET_TIMER selection makes it implicit.
4. Removes LINK_AUX_COMPILER_LIBS selection as it does not exist.
5. Removes CPU_MINUTEIA selection to permit CPU_ATOM as a valid choice.

Change-Id: I55694d2594a103f4f5ca233c279df0556ff1327f
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:45 -05:00
Andrew Boie
d1b3d54a94 sanitycheck: treat warnings as errors
This policy was in place for the old sanity checks, was simply
overlooked.

Change-Id: Id021a669b35622f9e9cba23b4417c5d0b7afc15c
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:14:45 -05:00
Anas Nashif
eb1fdf5741 Add debug option to Kconfig to enable debugging
This only disables optimizations for now, we should
be able to select more debug options from here.

it changes KBUILD_CFLAGS from  -Os to -O0.

Change-Id: I84515356f8af006b724d706c0647a671db54a6b5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:45 -05:00
Andrew Boie
ae9e7f7bca sanitycheck: default to cleaning outdir
-C/--clean is now -n/--no-clean. Made this change since the build system
can't always do incremental rebuild correctly depending on what was
changed (such as Make variables).

Change-Id: I199e505693479184b2f197ddb584ade5eca1704a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:14:45 -05:00
Andrew Boie
4b18247749 sanitycheck: print elapsed time
Change-Id: I5e18edaf9074f0166582fc51da81bb8978c9038b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:14:44 -05:00
Dmitriy Korovkin
8b0271dd2c Adapt HPET driver to work with QEMU
Qemu implements HPET so that it is connected to IRQ 2, which makes
necessary to use it in legacy emulation mode.

Add legacy emulation mode to HPET driver.

Change the way the HPET driver is initialized. QEMU requires that
the mode (one shot or periodic) gets set prior loading comparator
value.

Add debugging mode to HPET driver to ease the next port.

Change-Id: I668325d5968451585519a08b6c41863cf6e37f88
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:14:42 -05:00
Andrew Boie
6acbe63aea initial commit for next-gen sanity checks
The online help ./scripts/sanitycheck --help describes usage.
Most users will simply want to run with no arguments.

Change-Id: Icedbbfc22599a64a6e3dbbb808ff3276db06f2e0
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:14:42 -05:00
Andrew Boie
6fbbcbac22 build: don't use FORCE in deps for sysgen
We only want to rebuild this if the MDEF file has been touched.
Otherwise, zephyr.h gets rebuilt with every build, causing
unnecessary rebuilds of application source.

Change-Id: If128da48c9688f043c467f6b163ec6cb3e1d952c
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:14:42 -05:00
Anas Nashif
f45e4aa9a1 Support ARC architecture with kbuild
Change-Id: Ic0b884e3760d5957986208ea7b19653c06eda072
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:41 -05:00
Peter Mitsis
b4e1f7154a sanity: Replace obsolete BSP_FLAG with PLATFORM_FLAG
The bluetooth regression script now refers to PLATFORM_FLAG instead of the
obsolete BSP_FLAG variable.

Change-Id: I8cafc01b66004c7bdd76c03d3f3b6aeba134565d
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:39 -05:00
Peter Mitsis
9d63adf3ea Renames supported platform configurations
Renames supported platform configurations to conform to new platform
configuration naming scheme.

Example usage with PLATFORM_CONFIG:
    make PLATFORM_CONFIG=basic_cortex_m3
    make PLATFORM_CONFIG=basic_atom
    make PLATFORM_CONFIG=basic_minuteia
    make PLATFORM_CONFIG=galileo

  xxx_ti_lm3s6965_defconfig           -> xxx_basic_cortex_m3_defconfig
  xxx_generic_pc_atom_n28xx_defconfig -> xxx_basic_atom_defconfig
  xxx_generic_pc_minuteia_defconfig   -> xxx_basic_minuteia_defconfig
  xxx_quark_defconfig                 -> xxx_galileo_defconfig

Change-Id: I696eb8b9ad9a72d7a72efbe1341ce23500335764
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:39 -05:00
Anas Nashif
9aeb08213f toolchain: add support for iamcu toolchain
See
https://groups.google.com/forum/#!topic/ia32-abi/cn7TM6J_TIg

for more details.

• Support IA32 without FPU.
• Minimum ISA: Pentium ISA without x87 FPU instructions.
• Don't allow mixing i386 object files with Intel MCU object files.
• Support floating point with software emulation:
     a. Long double is the same as double.
     b. Use __float80 for 80-bit double.
• Minimize memory footprint:
     a. Code size
     b. Data size
     c. Stack size

Here is the draft of Intel MCU psABI.   The differences from IA32
 psABI are

1. The minimum instruction set is Intel Pentium ISA minus instructions
for x87 floating point unit.
2. There are no x87 floating point registers.
3. There are no vector registers.
4. Segment registers are optional.
5. Support for TLS relocations are optional.
6. Scalar types larger than 4 bytes are aligned to 4 bytes.
7. There are no vector types.
8. _Decimal32, _Decimal64, and _Decimal128 types are optional.
9. long double type is the same as double.
10. float, double and long double types are passed and returned in
 general purpose registers.
11. _Decimal32 and _Decimal64 types are passed in general purpose
registers.
12. Aggregate types no larger than 8 bytes are passed and returned
in general purpose registers.
13. Stack is 4-byte aligned.
14. The auxiliary vector support is optional.
15. Register %edx has undefined value at process entry.
16. New ELF machine code: EM_IAMCU.
17. New predefined C/C++ pre-processor symbols: __iamcu and __iamcu__

Change-Id: I6a0c45ad22d8f710b6f37a041aaa2fc1bf0b1c39
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:38 -05:00
Andrew Boie
84fed36539 Kbuild: Introduce QEMU_PIPE option
If set, 'make qemu' will direct its console output to a named pipe and
disable the interactive monitor. Intended for use with the new sanity
check system which will parallelize test execution.

Change-Id: I902f77c02ed3f210891ff13147afea890e64d9c1
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:14:38 -05:00
Peter Mitsis
519351ee92 Use PLATFORM_CONFIG to specify configuration
Uses PLATFORM_CONFIG to specify the configuration file instead of
KBUILD_DEFCONFIG.  This name is more intuitive to Zephyr users and
it is not tied to kbuild.

Example usage:
    make PLATFORM_CONFIG=generic_pc_atom_n28xx
    make PLATFORM_CONFIG=generic_pc_minuteia
    make PLATFORM_CONFIG=quark
    make PLATFORM_CONFIG=ti_lm3s6965
    make PLATFORM_CONFIG=fsl_frdm_k64f

Change-Id: I177608942c3e77c2f152743c862aad1d460c0e33
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:38 -05:00
Peter Mitsis
c141aaae37 arch/x86: Remove pentium4 Kconfig options
Removes CONFIG_CPU_PENTIUM4 and CONFIG_PLATFORM_PENTIUM4 as Zephyr does not
support the Pentium4.

Change-Id: Ieb1970894eda184f4c33d03e3563fb08f861ec6c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:38 -05:00
Peter Mitsis
e147071219 sanity: out-of-tree_chk: minuteia -> atom_n28xx
Replaces the default executable target (generic_pc_minuteia) with
generic_pc_atom_n28xx.  This ensures that sanity testing can evaluate
two different x86 processors just as it did before generic_pc_pentium4
was removed.

Change-Id: Iad439d8465811e9e45f02e9516ce3e6d65d7c1ed
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:38 -05:00
Peter Mitsis
4f1cc4e168 sanity: Mark atom_n28xx as an executable target
Marks the generic_pc_atom_28xx platform configuration as a default executable
target.  This is desirable as the removal of generic_pc_pentium4 removed an
executable target from the sanity test suite.

Change-Id: Ic990a003ff23367199164dfcc434c033d78abaac
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:38 -05:00
Peter Mitsis
7b363ebe70 sanity: Remove generic_pc_pentium4
Removes the generic_pc_pentium4 platform configuration from the sanity tests
as the pentium4 is not considered an essential target for Zephyr.

Change-Id: I804ad44c4157f40a501ae56b928b57b2003d2415
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:38 -05:00
Peter Mitsis
a7644b86a5 Rename CONFIG_BSP_xxx to CONFIG_PLATFORM_xxx
Updates Kconfig option names as part of transforming BSPs to platforms.

Change-Id: If397bcac8b058e5700e82c3cabbfe64588316d1d
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:37 -05:00
Peter Mitsis
03ab32a66a Microkernel timer uses new driver initialization
Update microkernel systems to use the new driver initialization model on the
timer driver.

Change-Id: Ida9ef2a395d0dddf4104d490d78b13b11ea3c347
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:37 -05:00
Peter Mitsis
6e95fe0356 Update _sys_clock_driver_init() interface
Prepares the _sys_clock_driver_init() routine to interface with the new driver
model.  To this end, it must accept a pointer to a device structure and return
an integer.

Change-Id: I3c600ce1efb49c0864aae7b09663ca40d6289372
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:37 -05:00
Allan Stephens
098e9dc68f SysGen: remove support for USERDRIVER
The USERDRIVER line is currently unused, and recent driver
initialization enhancements have rendered it obsolete.

Change-Id: If14089a52871a8891223156fde99b3fc9b650b10
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:33 -05:00
Peter Mitsis
b2744f396c SysGen: remove processing of TIMERDRIVER
The TIMERDRIVER line is no longer used.

Change-Id: Ibe068793fe644be39916e508d26e0c0a98cff739
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:33 -05:00
Peter Mitsis
8efb4b570b Remove config1p.mdef references from build system
Since SysGen generates the code to invoke _sys_clock_driver_init(), the build
system no longer needs anything from the config1p.mdef files.

Change-Id: Id22615ff137c9d146ccc5c3777a75b2d3bfee73a
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:33 -05:00
Peter Mitsis
95b6f7509b Hoist _sys_clock_driver_init out of config1p.mdef
SysGen generates code to invoke _sys_clock_driver_init() when
CONFIG_SYS_CLOCK_EXISTS is defined thereby reducing the number
items the user must remember to configure.

Change-Id: I6f6909378c8a865a6ef50a99179800d58be5dd68
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:33 -05:00
Anas Nashif
f367f071b6 doxygen: add @brief and capitalize
Remove function name from comment and add @brief instead.
Also capitilize first letter.

Change-Id: Ib708b49bf02e5bc89b0066637a55874e659637e0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:33 -05:00
Peter Mitsis
8768257789 Rename internal K_ChMovedAck() routine
This private API now follows Zephyr OS naming conventions.

Change-Id: Ic8b1d4673862263d90d240e749a272d01a53679e
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:28 -05:00
Peter Mitsis
48dd7e2908 Rename internal K_ChSendxxx() routines
These private APIs now follow Zephyr OS naming conventions.

Change-Id: Ia11a082e46456d12a3d6af7dfb2f34c29c137cb2
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:28 -05:00
Peter Mitsis
6a4c85aff9 Rename internal K_ChRecvxxx() routines
These private APIs now follow Zephyr OS naming conventions.

Change-Id: I63815013be2d3b01463563d17f05aac28b27ce04
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:28 -05:00
Peter Mitsis
e65534c877 maintainer-checkpatch.bash: ignore gerrit ID
Updates maintain-checkpatch.bash to ignore the gerrit ID in the commit log.
This helps reduce the noise/false positives when using the tool.

Change-Id: I2d6f3c501abd1ffd541fb8d0fdf7cbc7f37830b6
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:27 -05:00
Peter Mitsis
1ffabeaf3d Rename BSP_DIR to PLATFORM
Updates references to CONFIG_BSP_DIR to CONFIG_PLATFORM as part of the
BSP -> platform clean up.

Note that despite the renaming, the usage of the config option remains
unchanged.

Change-Id: I2846c3f761cf09871019c0855bf1824ae03e6b3c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:27 -05:00
Peter Mitsis
340d8d2442 Base x86 ISA optimization on CPU not BSP
Fixes Makefile.x86.preparch so that the ISA optimization passed to the compiler
is based on the CPU rather than the BSP.

Change-Id: I78e4ad10fbc3d25a20367ccd3c4df39ffbfa8380
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:27 -05:00
Anas Nashif
37b50b62ce Use value of CONFIG_IDT_NUM_VECTORS when creating static idt
Restore original behaviour from before moving to kbuild

Change-Id: I299ad25cf39378b2537e0791cce65f077c5d1c08
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:27 -05:00
Anas Nashif
ac47c45ca0 Rename Zephyr OS into Zephyr Kernel
We are a kernel, not an OS.

Change-Id: Ib987e3e511e1bdbed6293ab5e15e598bff00b09b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:26 -05:00
Allan Stephens
7da1dd860b Rename microkernel's kernel_struct.h to micro_private_types.h
The new name better reflects that this file contains private
microkernel APIs (types, structs, etc.) that are used by various
kernel subsystems.

Change-Id: I7a89be893455b3daaf30baa40a0ec8e0cde7cc36
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:26 -05:00
Allan Stephens
a0148a8544 Rename sysgen.py to sysgen
Gets rid of the Python file extension, since the fact the code is
written in this language could conceivably change someday (and
doesn't really need to be advertised to anyone invoking it).

Change-Id: I0d01a89fd25e4a0f033099a4bcea674bc302c658
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:25 -05:00
Peter Mitsis
3e6c31207b Rename option CPU_CORTEXM4 to CPU_CORTEX_M4
Makes name more consistent with CPU_CORTEX_M3_M4 option.

Change-Id: I6f0a14322b7774df54a3459f91cd3acf07819b04
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:25 -05:00
Peter Mitsis
a9941af3ee Rename option CPU_CORTEXM3 to CPU_CORTEX_M3
Makes name more consistent with CPU_CORTEX_M3_M4 option.

Change-Id: I0b89a50a5c0b728167cd76219d25ddf98243c0dd
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:25 -05:00
Anas Nashif
27603f4801 Revert "Kbuild: Tools build at TIMO_BASE directory."
This reverts commit 23da104f0dc8c6c4a768a727b564272c084aa79b.

Conflicts:
	Makefile
	Makefile.inc

Change-Id: Ia8f2efe3cd37e82c04c304f04c46d787d2265dde

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:24 -05:00
Anas Nashif
0180a63d62 Revert "Kconfig stop creating empty header files."
This reverts commit 5e56c21dfae2e08253820f7fcad1e96be009ca89.

Change-Id: Ie4e0c2afe27937206230e5574c41e5a4a4c3d616
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:24 -05:00
Anas Nashif
fda70d2130 Revert "Kconfig: Create dependency header files in outpur directory."
This reverts commit ecf5bd8048b683f119e867e85c1693955694b33d.

Change-Id: I51717ad96f312be1f116534f6b79d599bf0e5b4e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:24 -05:00
Szymon Janc
d90ce68d9d Bluetooth: Add central and tester samples to bt_regression
This allows to easily checks if all samples builds with supported
configurations. Also tester application is (unlike other samples)
build with all Bluetooth debugs enabled.

Change-Id: Ia151b97d14c75b0509243e2c1dc8d26211f70e83
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
2016-02-05 20:14:23 -05:00
Andrei Emeltchenko
a6e47f7c40 Bluetooth: Add beacon app build test to bt_regression
Add build test for beacon app for following targets: pentium4 and
ti_lm3s6965.

Change-Id: I4b8949b4f21d3554465bbf8c229462c026db5e29
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:14:23 -05:00
Anas Nashif
a502618b41 sanity: allow setting of tmp dir for out-of-tree
export TMP if you want the out of tree tests to write
to something else other then /tmp

Change-Id: I77b1dffe5fa5e61db66a8d754370a0cd47511ab4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:23 -05:00
Anas Nashif
b766bfef89 sanity: add support for arc platforms
Change-Id: I363f387f07bace937544c3447b0614ab4a943f61
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:22 -05:00
Juan Manuel Cruz
eee6787269 Kbuild: Clean target fix.
This commit fix an error with the clean targets.
The package directory does not exist anymore.

Change-Id: I415085cb35eda9a1f30d6b53a5529e1fb2a8447a
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:22 -05:00
Juan Manuel Cruz
1eb89a9b3a Kconfig: Create dependency header files in outpur directory.
Kconfig creates a header file per each Kconfig symbol that changes
in between configuration changes and rebuilds.

This commit creates the files in the output directory specified by the
O environment variable.

Change-Id: I01b3482e9497f70961268505865788385b41ca8f
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:22 -05:00
Peter Mitsis
5e29f52883 sanity: Enable out-of-tree sanity check
Enables sanity to run out-of-sanity checks on a set of sample projects.

Change-Id: I58ae894b326a6eb15d6d56bc8e95738d21e17245
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:21 -05:00
Peter Mitsis
d902e9e514 sanity: Key off platform instead of BSP
Deprecates (and hides) the -B option in favor of using the -P option.
The -B option is used to specify the BSP, whereas the -P option specifies
the platform.

Change-Id: Ie1d3cd6383f08a84e5d994221b253153152a0658
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:21 -05:00
Peter Mitsis
53d81ebeef sanity: Remove the -s option from sanity_chk
The -s option to sanity_chk became obsolete with the switchover to Kbuild.

Change-Id: I6ab68692aea39e4289520613b53a46320044fcfb
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:21 -05:00
Peter Mitsis
02432ca5e7 sanity: Use KBUILD_DEFCONFIG to specify target info
The sanity scripts no longer use the deprecated method specifying the BSP (and
the optional BSP_VARIANT).  Instead, they now use KBUILD_DEFCONFIG to identify
the target platform.

Change-Id: I583f876afd006e66fc314b8913cd766ba9d2b764
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:21 -05:00
Peter Mitsis
5d8c23a254 sanity: Update sanity scripts to use data files
Completes the separation of data from the sanity scripts.

Change-Id: Icc7a4922d5f108ca54d2c2f08b192259b07b3a0e
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:21 -05:00
Peter Mitsis
a62a41c86a sanity: Add data files for use by sanity checks
These data files will eventually replace the project list tables that are
currently defined in the various sanity checks.

Change-Id: I1b9aef528ff2acc1ba96fa540986c50e01032f68
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:21 -05:00
Peter Mitsis
6a1287ba07 sanity: change strings stored in $PRJ_TYPE
Changes the set of strings stored in $PRJ_TYPE from
    {"microkernel", "nanokernel"} -> {"micro", "nano"}.

The $PRJ_TYPE variable will be used in later commits to create the
$KBUILD_DEFCONFIG string.

Change-Id: I9e2d866d4277ffaccff4f84a42ec2bc75c2ce57a
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:21 -05:00
Peter Mitsis
820a62dc7d sanity: Move Bluetooth regression script
Moves the Bluetooth regression script 'bt_regression.sh' so that it resides
in the same directory as the other sanity scripts.  It also renames it to
'bt_regression_chk' so that its name is consistent with the other sanity
scripts.

Change-Id: Ia5a683e2c370c91a90edc648634ce56e484dcc20
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:21 -05:00
Peter Mitsis
99c55ba2fe sanity: Remove common-klibs_chk
KLIB_DIR builds are a relic from the previous build system.

Change-Id: I382db45f0a21786e1b7c50c9a881c82feb2c7481
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:21 -05:00
Juan Manuel Cruz
308f1586d6 Kbuild: Assembly code extension.
This commit set back .S as the assembly code extension for Kbuild.

Change-Id: Ib0119876bd0bed6617bbfbad2ca6a44e172ab042
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:20 -05:00
Arkadiusz Lichwa
d7e239c6c2 Python: Tweak with python3 compatibility
Fixes sysgen's python code errors generated during build.
On python2 environment it's ok but *not* on python3.

Change-Id: I4a042c5d5203e546b65540f7020ae75677d102f8
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:14:20 -05:00
Allan Stephens
9e675cf581 Rename private microkernel APIs
The following APIs now use an approved Zephyr OS prefix:

_pipe_init
_mem_map_init
_mem_pools_init (also loses plural aspect)
init_node
init_drivers
kernel_init
kernel_idle

Change-Id: Ic380c56b09cb870d44c51fd12c6c0e0a13e9b4e3
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:19 -05:00
Allan Stephens
f9b2c757db Rename K_ticker() to _k_ticker()
This API now uses an approved Zephyr OS prefix.

Change-Id: Ia16829d908da9bfaa82f82da47b583a0004cae7d
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:19 -05:00
Allan Stephens
c718f32a49 Eliminate remainder of sanity check support for obsolete -T option
There is no longer any need to retain any support for this option
as a "do nothing" for backwards compatibility reasons.

Change-Id: I4b8fa727f80effdcc3fd92007fc9c50654291175
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:19 -05:00
Anas Nashif
652309470c Rename tinymountain -> zephyr
Remove excessive use of zephyr and use a more generic
terminology where possible.

Change-Id: Ida8916765dbe824f63d7a4cedba60b35d14aee55
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
b8823770d2 Rename TIMO -> ZEPHYR
Change-Id: Id44a129e275fb0cfe1fce6ec2a03c2d86ffe3995
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
54ac4484d7 Rename VXMICRO_ARCH and VXMICRO
Change-Id: I6f3858de98333ec466aa876c5f2887faa8e276e2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
274622ea69 Rename VXMICRO_ARCH_arm -> CONFIG_ARM
Change-Id: I32b2e39781825504e7936b3df0c864988650c35c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
191fc279ce Rename VXMICRO_ARCH_x86 -> CONFIG_X86_32
Change-Id: Ie1bcfebce1db838ea994cb3626396ea032225830
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Peter Mitsis
61eff496e0 kbuild: link using ${LD} instead of ${CC}
Not all GCC toolchains generate a fully linked image (non-relocatable) when
using ${CC} for linking.

Change-Id: Id99501b6510cd6eeb87f245a6273fcebd6d36cde
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:16 -05:00
Peter Mitsis
fb624c9d54 kbuild: Add libgcc.a directory to xtools search path
Informs the 'xtools' toolchain where to look for the libgcc.a library when
linking.

Change-Id: Ic990f1522dd8ddc9c5baf1366505e49929130969
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:16 -05:00
Peter Mitsis
28846dbf82 kbuild: Specify -march when using ARM cortex-m3/m4
Some compilers default to a value for -march that is incompatible with the
specified -mcpu setting.

Change-Id: Id94fc6666efe86ab511cf2320bf07b2eb70d72ce
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:16 -05:00
Peter Mitsis
cbf6d5b470 kbuild: Update xtools toolchain default versions
Aligns the default version of the xtools toolchain to that specified by the
x86.config and arm.config files under 'scripts/cross_compiler'.

Change-Id: Ib05766871a85de98c5ead19e15d740073f2f42cf
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
53bee67642 Remove unused files from scripts/
Mostly files related to kernel modules and scripts used
in old build system.

Change-Id: I12dfe4c976b0f6f933b519bd7eb96148f689535d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
e06da7bd65 Remove packaging dependencies
Change-Id: Ife53df325c1ddad26299c6c6075338d2225f49b0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
79635e002a Remove depmod and dependencies
Change-Id: I70325e049fbde1a965b9d845683cb7799fa54382
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Allan Stephens
072961cda4 Rename VXMICRO_BSP_BASE to ZEPHYR_BSP_BASE
Updates this environment variable to reflect the new OS name.

(Note: Out-of-tree builds are not yet supported.)

Change-Id: If26264c39a98d76c418f07be88ecb196f34fba1c
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:16 -05:00
Allan Stephens
06f10df990 Eliminate references to VXMICRO_TOOL
Since the build system now supports only one toolchain, the
VXMICRO_TOOL environment variable is obsolete. The sanity
check scripts that reference this symbol are revised accordingly.

(Note: As a temporary measure, the main sanity check script
continues to accept the -T option; however, the option has no
effect.)

Change-Id: I383b128b9f5b07164abb7ddeb5a699d819a20316
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens
570795f014 Rename VXMICRO_JOBS to ZEPHYR_JOBS
Updates this environment variable to reflect the new OS name.

Change-Id: Icc6a2f3d4cdfcf7cab11da7920aaa8110177047b
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens
815c6406bc Rename VPF files to use MDEF file extension
The file extension indicates a "Microkernel DEFinitions" file,
and no longer reflects the obsolete VxMicro/Viper branding.

Change-Id: Ib95b271404a4a4737e851d603c371244fa609e4d
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens
b36b379af3 Eliminate VxMicro branding in sanity check scripts
Change-Id: I5cf0c49a986b75f8ea1169f36542d39a3394121d
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens
f94682bafb Eliminate VxMicro branding in build system
Change-Id: Ie0f34b36e58ee0ea8e7438742d4448be1c393913
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens
ec2d3fb6de Eliminate Viper branding
Gets rid of references to the obsolete OS name. (Note that removing
the build system comment entirely makes sense, since there are no
other comments for anything else in the file.)

Change-Id: I4473b016c1c85be48ac9ab8d5b8f6a5b11dd58d0
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens
5b291d3567 Eliminate VxMicro branding in main application include file
File is renamed to zephyr.h.

Change-Id: Ice7ab9318c525630572023614b5bed67ae0400c1
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Juan Manuel Cruz
80ce28aebe Kconfig stop creating empty header files.
This commit fixes the issue of kbuild creating empty header files
at the include/config directory.

Linux Kconfig creates a header file for each Kconfig symbol that
changed in between build runs and re-configurations. This feature
is not needed in Zephyr.

Change-Id: I366183cef398b3ab7488456ddbed07f292c5a9bc
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:14 -05:00
Juan Manuel Cruz
4ef2d598cc Kbuild: Adding bin and strip generation.
This commit adds the generation of the binary kernel files:
kernel.bin
kernel.lst
kernel.strip

Change-Id: I7e1aab494ee1143994b4b65d0991906fbe8a36df
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:14 -05:00
Anas Nashif
5aaef9c981 re-add -Werror to sanity checks
Change-Id: I115ee95e33e0c9bc09c2b8626a25a3c71bebd0b0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:14 -05:00
Peter Mitsis
2bf5fc44f1 Initialize idle task's stack related fields in sysgen
Hoists the initialization of the the microkernel's idle task's stack fields
out of the runtime and into sysgen thereby removing microkernel code from
the nanokernel initialization.

Change-Id: I54cbbec9e875a52b5fa52562e1a2770cd3ac1cc3
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:13 -05:00
Peter Mitsis
b4e7a4fdbe Apply __stack tag to align kernel defined task/fiber stacks
Updates the kernel defined stacks to ensure that they are properly aligned
by using the __stack tag.

Change-Id: I8514d38ee2e5bb2b2d87b17021db3c7f9c36a772
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:13 -05:00
Peter Mitsis
db8a41c90d Replace use of __attribute__((packed)) with __packed
The __attribute__ keyword is toolchain specific.

Change-Id: Ia3c0ff54d778785679c864704f8db6a3ba898948
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:13 -05:00
Peter Mitsis
b5c2342a4e Update checkpatch scripts to use TIMO_BASE
The use of VXMICRO_BASE has been supplanted by TIMO_BASE.

Change-Id: I905232a8d87145afb2f8df30b5f9056ec72ce045
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:13 -05:00
Allan Stephens
e54a6c4b68 Eliminate separate include files for generating absolute symbols
The toolchain-specific macros used to generate absolute symbols
are now part of the main include file for that toolchain, since
there doesn't seem to be a good reason to have them in a separate
file.

Change-Id: Ic97800485b20d6c5b23d14f69f67ee845cf076f5
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:13 -05:00
Allan Stephens
4b105f459d Eliminate testing of secure string library code
Test project is no longer needed, since the associated library
is now scheduled for removal.

Change-Id: I843018e647c4bdc82c785ae21dbfa9de608c0d50
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:12 -05:00
Dmitriy Korovkin
b08727ed2d Add random number API test
Change-Id: I810705c84609ca3497cc1d2dd7a2f7706f140815
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:14:12 -05:00
Dirk Brandewie
f25f9b37ea kbuild: Remove compilation tool command line validation
To support multiple versions of the compilation tools GCC etal the
original Kbuild would execute the tool to ascertain if the argument
being added to command line was compatible with the version of the
tool installed on the system.  This causes significant overhead and is
not required since we specify the minimum version of the tools
required for the build.

Change-Id: I23d811bee9e89bf7549449c679adbfa02efd94de
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:14:12 -05:00
Andrei Emeltchenko
f9360e8069 make: Fix qemu flags for ARM architecture
Fixes missing qemu flag and when adding Bluetooth -serial switch it
became the first UART.

Change-Id: I85f4bf236383a288f2935f6455141fa7b18c3ac8
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:14:12 -05:00
Anas Nashif
f1c7c178cf Use qemu from toolchain if available
Use patches qemu binary provided by the Yocto SDK.

Change-Id: I5edc2338f45fdd0d953d8d34bea648d0d18d8bf8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:12 -05:00
Anas Nashif
8e9d8ebfd2 Remove nodes naming when using sysgen
Change-Id: I8914c25ad18d3c294f398f98efca04c3ac371f44
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:12 -05:00
Anas Nashif
6082c0989d Remove Makefile.modpost and .ko building
Change-Id: Iac29d5cac1efbc894cbe036fab8bff865d1cec96
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:12 -05:00
Juan Manuel Cruz
4d7f954896 Kbuild: Tools build at TIMO_BASE directory.
This commit allows the tools build to be executed at TIMO_BASE
directory insted of being executed at the PROJECT_BASE.
This allows the sanity checks to run faster because there is no
need to recompile the tools with every test.

Change-Id: I9e9ac78695db884b44e2693029e9ea6ed96b21c8
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:10 -05:00
Anas Nashif
e3d4ce5eaf Add missing -Wl,--end-group and always use __start
Change-Id: I1b98114f3ca851f580a581d1707f349215405643
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:10 -05:00
Anas Nashif
73b3d99692 bluetooth: do not run sanity on quark
Change-Id: I8bb50a350b5344772afa86c80f766a910d07407e

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:10 -05:00
Anas Nashif
1b670ab7ae Kbuild: fix yocto toolchain settings for ARC
Change-Id: Ib075242c43738eee1cace219ac5a02e66c566ace
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:10 -05:00
Anas Nashif
02085a3fda Kbuild: make merge_config less verbose
Change-Id: I1102f383db23fad18364f09eff6128391980637a

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:10 -05:00
Anas Nashif
3d95ca0530 Kbuild: use sed to generate offsets.h
Change-Id: Ib90ee51b5a3da8f7541d002ee70945ca907c7e06
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:10 -05:00
Anas Nashif
cdf88a7848 Kbuild: Do not generate modules.order
Change-Id: Ie7609bb4917d6f80ac19ddbe286a06cd85c91ca1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:10 -05:00
Juan Manuel Cruz
988236f2b9 Kbuild: Output files at outdir directory.
This commit enables the outdir directory.
Kbuild output files will be generated at the outdir directory
inside the project directory.

Change-Id: Icec04aca1753326c9d50dea20c71850c1d8c3dd0
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:10 -05:00
Anas Nashif
02369f05e1 VXMICRO_BASE->TIMO_BASE
Change-Id: Id39cce43084caa9f4448be3552028212f3ae4e78
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:10 -05:00
Juan Manuel Cruz
cdc3bab8ad Kbuild: Dash compatibility.
This commit adds changes to the shell scripts to add
compatibility with bash and dash shells.

Change-Id: I7831eba24afca2211cd58aab996dee13a02207f3
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:10 -05:00
Anas Nashif
e439f510f8 Kbuild: link against libc only for newlib
Right now we are building minimal libc as an archive (lib.a)
and do not need to link against -lc -lm in that case.
Link against libc/libm only when using an external libc.

Change-Id: I1af0eaf5c059bd5f0c8c16cda28114c6dc10b156
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:09 -05:00
Anas Nashif
b424acc272 Kbuild: do not copy libc.a
Change-Id: I096209ca29142f47975a0068267062fc44f82913
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:09 -05:00
Anas Nashif
19f0ff2756 Kbuild: enable toolchain newlib library instead of minimal libc
This options allows us to link against newlib instead of the
integrated minimal c library.

Change-Id: I20990354d74c08f2f6348f0aeea452b8f0f4c8e9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:09 -05:00
Anas Nashif
369cf08e29 Kbuild: Support toolchain auxiliary libraries per variant
This allows a toolchain to define the auxiliary libraries in
scripts/Makefile.toolchain.{variant} with more flexibility.

Change-Id: Iaae9c7613ddcbcc8376b7e756aa4b675db680737
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:09 -05:00
Anas Nashif
faa7109e0d sysgen: VXMICRO_BASE -> TIMO_BASE
Change-Id: Iba207c6aad90058352bdbb51dfeac22c56ad304c

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:09 -05:00
Anas Nashif
cede6c794d fix path to truesize
Change-Id: I2465735a0c389e8afe24430bf9bf7c21dc8008a2

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:09 -05:00
Juan Manuel Cruz
0c47e4fbe7 Kbuild: LDLIBS_TOOLCHAIN adds toolchain static libraries.
This commit adds the variable LDLIBS_TOOLCHAIN that, by default,
add the gcc static library to the link command.
This variable can be overriden as an environmental variable or as a make
parameter to allow the use of different toolchains different from gcc.

Change-Id: Id9d6c8621a7dc8feebdf377c115564701fb7652b
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:09 -05:00
Anas Nashif
0467c632cb Kbuild: Error when toolchain path is not set
Change-Id: I53c74f8bbafe5438ff6b01eb21d2d54b1b34702a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:08 -05:00
Anas Nashif
282828f4a7 Kbuild: set ARCH when building qemu targets
Change-Id: Ia9ab35f46d02698664e5719c7d842e8b65c53eb5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:08 -05:00
Anas Nashif
aa7ec61cb5 Kbuild: Replace awk with python for generating offsets.h
awk is causing issues on the ci infrastructure, some
options used here are not supported on ci hosts.

Change-Id: Iabd5dd37b6464e093d3f91188128ef85a9fc6df5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:08 -05:00
Anas Nashif
fc1e6b5b44 fixed LIB_INCLUDE for arm
Change-Id: I3f08f7b10b50c24ce1a15ec086c4355fa7a479c8

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:08 -05:00
Anas Nashif
aca245d96f Kbuild: Add support for multiple toolchains
To use this, export the following:

export VXMICRO_GCC_VARIANT=yocto # for yocto
export VXMICRO_GCC_VARIANT=xtools # for crosstool-ng

export YOCTO_SDK_INSTALL_DIR=/opt/poky-tm/1.8
or
export XTOOLS_TOOLCHAIN_PATH=/opt/crosstool-ng

Change-Id: I9cd6062ecc32047d1582aad46209f4232e0e31f6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:08 -05:00
Juan Manuel Cruz
86dfd37817 Kbuild: REVERT the removal of bluetooth tests.
This commit reverts the removal of bluetooth tests.

Change-Id: Id84bb6b61da1fd8b617059be2b1617a6dacf2af9
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:08 -05:00
Juan Manuel Cruz
62cf77c569 Kbuild: Create directories for lib-y files during a O option.
This commit allows the following:

lib-y will create external directories, when building with
the O=<external/directory>option.

Originally in Kbuild, only obj-y dependencies were subject to
directory creation when builded in an external directory.

This change allow Kbuild to completely build in external
directories, including libc.a.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: If6c2bc77b2c00ce199df87a08f86e366f929ac08
2016-02-05 20:14:08 -05:00
Juan Manuel Cruz
de1cec29d6 Kbuild: Build minimal libc as a static library.
This commit changes the way libc is built.
Instead of building a hierarchy of objects linked into the
microkernel, libc minimal is built as a static library and
linked against the microkernel binary.
The location of the libc is configurable with the variable
KLIBC_DIR. This gives the flexibility to build against a
different libc other than minimal.

Change-Id: I9c0b6a684a9f3b407861aa387727c45eceb269c4
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:08 -05:00
Anas Nashif
679c440b54 Sanity: Run make with ARCH variable set
Change-Id: Ifc751c7f66972fb549996883c6351a86b05aa614
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:08 -05:00
Anas Nashif
f7c13d2a74 [REVERT ME]: disable klib tests
Change-Id: I22fe3883f8fd02eb4d2fbf1a1ddc593e39f8af1a

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:08 -05:00
Anas Nashif
7f4f4a32f2 Kbuild: use qemu target when testing
Change-Id: I4218ea99498da980c259b68181ae56183c853fde

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:08 -05:00
Anas Nashif
0ff11b33b9 [REVERT ME] Sanity: Disable bluetooth tests
Change-Id: Ice7e93e1f229f3256e42ce9a8b480d6fb2a3fcfa

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:08 -05:00
Anas Nashif
d06c20eb58 VXMICRO_BASE -> TIMO_BASE
Change-Id: I35650b2f4ff8e90217a9c38e0251e8c8b9e29049

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:08 -05:00
Anas Nashif
71f8e91666 Sanity: make the script work with Kbuild
Make the script work with the first set of testcases.
Works continues as we fix more samples.

Change-Id: I48b77781fc162971a1ef83bed32c02c2b08f81d7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:08 -05:00
Anas Nashif
10516620d7 move scripts to scripts/
Change-Id: Ie48f3e9e92ee696dc68fad31d41b55c5bea82e93
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:07 -05:00
Juan Manuel Cruz
6e1a4ef6fd Kbuild: Adding gcc library to the linker scheme.
This commit adds the gcc library to the linker process
of Kbuild.

Change-Id: Ic237dedc7b28dae020e4778c9b373ac650e31bad
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:07 -05:00
Juan Manuel Cruz
52836ec3a8 Kbuild: GenIdt auto build.
This commit includes the genIdt tool as part of the kconfig
basic tools. Now the genIdt tool is built automatically as
part of the whole kernel project.

Change-Id: I45110a7c564c59d7a6684d868ccc377cbd6ef1c4
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:07 -05:00
Anas Nashif
144e8ce330 renamed include file absSym.h -> abs_sym.h
Change-Id: I8500ee9d63b0048486e49268de3680fd6a3e1ef3

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:06 -05:00
Juan Manuel Cruz
892857cd2c Kbuild: VPFile can be selected from outside the working directory.
This commit allows to select a VPFile outside the working directory.
This change is needed for sanity checks.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Ia6f1e334c0a5274c4029197e5f64aaa4c236f9f0
2016-02-05 20:14:06 -05:00
Anas Nashif
c31a8cca66 remove linux firmware Makefile
Change-Id: I9bbefb5696864e9567d91190ef388e4cb4e730d3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:06 -05:00
Juan Manuel Cruz
6e666cf28a Kbuild: Removes the SECTION_GARBAGE_COLLECTION ksymbol.
This commit removes from the Kconfig system the
SECTION_GARBAGE_COLLECTION kconfig symbols and sets the
SECTION_GC_FLAG flag permanently on the compilation options.

Change-Id: Iec070613d85afa697c62d6cbc54cc146cffcab27
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:06 -05:00
Juan Manuel Cruz
71c7083ae0 Kbuild: iSSE_FP_MATH flag fix.
This commit fixes the issue that the iSSE_FP_MATH flags was
not being added during the build process.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I0702e8b317fde1858e90145efaa470146ad5a416
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz
06b41d1ace KBuild: ALIGN_STACK_FLAG fix.
This commit fixes the issue that ALIGN_STACK_FLAG was not being
added to the build process.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Iced7700b51da4c5b04181affca2f2ca090987371
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz
fbc5956ade Kbuild: ISA_FLAG Fix
This commit fixes the issue that ISA_FLAG was not being
added during the build process.

Change-Id: I780c8dbae8912ee8e159827cb24a5700432898d2
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:05 -05:00
Anas Nashif
88131c8176 Make sure we start with a new *.lnk file
Start with a new linker file every time we run make. Otherwise
we fail.

Change-Id: I3abe9c203dcfe8710e6c4946662959bfeb6a6bc9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz
e7de0f65b4 Kbuild: QEMU target.
This commit adds support for the qemu target.
This target will generate the kernel binary and will
launch a qemu instance running the binary.
Currently, only the x86 generic pc and the arm tilm3s6965
BSPs are supported with emulation.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I9e71d3ce2fba98572830475a2e15e3fceb0216b4
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz
1c8f5a75e7 Kbuild: Standard output file names.
This commit changes the name of the output files.
The output names tinymountain.* have been changed to
microkernel.* and nanokernel.*.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Ia73daa35bb8e44972065af3a217bf87335169dac
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz
622e273d08 Kbuild: Sysgen support for NUM_TASK_PRIORITIES
This commit add support to the Kbuild system for the
NUM_TASK_PRIORITIES Kconfig symbol and the corresponding sysgen
parameter.

Change-Id: I6b035437c86d62f72c25d696d18182a7b0448e8f
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz
90abf06e7f Kbuild cortex processor link option.
This commit allows the Kbuild system to specify the
Cortex processor as a toolchain link parameter by
reading the kconfig configuration options.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I29296fb255810b6bc5e14637c9000e054ac5deb2
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz
808e5c4ba0 Fixes to Kbuild to build on ARM architecture.
This commit fixes issues to allow build on ARM architecture.
- It fixes the include paths in Makefiles.
- It fixes the include path for the offsets.c compilation.
- It fixes the linker command. This changes is needed because gcc
  ARM cross-compiler does not accept an AT() command without
  specifing an address explicitly. This corner case appears
  on ARM architectures when XIP is disabled.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Ief8b53c4cc154abba7b7827121ec5a56f62b7b26
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz
2e3e28c3ed Kconfig KERNEL_DIR symbol removal.
This commit removes the Kconfig symbol KERNEL_DIR.
The symbols was no longer needed because sysgen is only
used on microkernel architectures and the value of
KERNEL_DIR is always "ukernel", therefore it is redundant.

Change-Id: I5e38dd431c5b6f7586e8b25aea330632e96f581f
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz
7ac851afef Kbuild. Remove linux name references.
This commit substitutes references to the linux string in variable
names.

It changes the LINUX prefix and uses the TIMO prefix (short for
tiny mountain)

It changes the vmlinux prefix for tinymountain prefix.

It preserves linux references found in licenses, comments giving
credits and from scripts that are not supported by the current build
system yet, like rpm generation.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Id17d8d12161f00e2a2ff38f218cdb6c5afd169c0
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz
0d01f5bedc Adding Kbuild linking process.
This commit is adding the linking process.
  -Creates linker command files.
  -Creates IDT tables.
  -Creates final ELF file.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I3ce92868b00957fdc24a361cc419e3548f475cc3
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz
a0b5466540 Adding Kbuild CFLAGS.
This commit adds all Kbuild CFLAGS to build the kernel binary.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Ia4ca1b71b4e68c4515c428147a8814ca983bb541
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz
ba741fedd7 Root Makefile adaptation.
This commit organizes the different directories listed in the
root Makefile. Each directory hold a root Makefile describing
libraries and object bundles that will be linked together as
the kernel binary.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I4af16114598ad985dfb4faac68e82dc73b1b6cc5
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz
94b78c1276 Creation of offsets.h header file.
This commit adds the target to generate the offsets.h header.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I6222f7478ade33f5ca130eea8637cb454b67eaab
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz
e1bb210bf3 Creation of configs.c file.
This commit adds the target to generate the configs.c source file.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Ia068a20c3b76c78f5bdd041f6e19daabd2107a5a
2016-02-05 20:14:04 -05:00
Juan Manuel Cruz
9b0854bd84 Creation of target for sysgen execution.
This commit adds the target to execute sysgen.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I31f2e896274fa5ddfe6c10b4ccfb07ff6704c130
2016-02-05 20:14:04 -05:00
Juan Manuel Cruz
e33ede376e Creation of prj.vpf file.
This commit adds the target to generate the configuration file prj.vpf.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I407b304d33fe27daf92e6049377930cca484fde5
2016-02-05 20:14:04 -05:00
Allan Stephens
267753d967 Streamline public pipe APIs
1) Now invokes pipe routines directly, without the use of function
   pointers.
2) Eliminates unreferenced _DEVICE_CHANNEL symbol.

Change-Id: I6e26476265ed8f33febb5a06c9d03daf7147ee5e
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:00 -05:00
Peter Mitsis
1c313b6f89 Remove references to ICC
Keys off variations of "ICC" to remove references to the Intel C Compiler as
it is not supported.

Change-Id: I09f67880b39839982ed1c450e564c274440628a5
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:00 -05:00
Allan Stephens
a02396098d Eliminate exposure of non-public microkernel structures
Renames the include file defining non-public microkernel structures
from k_struct.h to kernel_structures.h, and relocates it to the
microkernel's non-public include file directory. This means that
applications and drivers including the microkernel's public APIs,
using microkernel.h, can no longer access non-public information.

Note: This change also eliminates some redundant #includes by the
microkernel's own subsystems, since the inclusion of minik.h brings
in the vast majority of public and non-public APIs.

Change-Id: Ic7d9ec1ebb8a124ccd0aaad98b50e16c197ffa00
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:00 -05:00
Allan Stephens
ec391c363c Relocate misplaced items in main microkernel API include file
1) Eliminates declaration of variables that are already being
   included by a microkernel subsystem include file.
2) Eliminates duplicate declaration of timer_driver().
3) Moves definition of well-known events to the event-specific
   include file.
4) Moves declaration of a task-related routine to the task-specific
   include file.
5) Moves declarations that are only needed by kernel_main.c
   to kernel_main.h.

Change-Id: I6f387915a5ce208879482522586b977118f657e7
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:00 -05:00
Benjamin Walsh
d8d273cbff sanity_chk: test x86 platforms other than pentium4
Only pentium4 was tested with the default sanity_chk, since it was
listed as the default platform on every test.

The ARM platforms were already taking a different approach: if the test
is runnable, build and run it for the QEMU platform (ti_lm3s6965):
otherwise, build it for the real board (fsl_frdm_k64f), since running on
that board is not currently automated.

Do something similar for x86 platforms: when runnable, use either
pentium4 or minuteia on QEMU; this gives coverage to minuteia. Also, for
a couple of build-only tests, build one for quark and one for atom.

Change-Id: I2f80a835d8f9b6df020bc8a2ed966e6d47c51e2e
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:14:00 -05:00
Allan Stephens
02bf1c1eb1 Eliminate obsolete symbols from generated vxmicro.h
These symbols are no longer part of the microkernel's public API.

Change-Id: I0dfa32af02cfa71fb31997b9bcdac60208d93888
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:59 -05:00
Allan Stephens
c54ce8fc16 Eliminate unnecessary include in generated kernel_main.c
The generated file now takes advantage of the fact that including
vxmicro.h automatically includes the microkernel's public APIs.

Change-Id: I17879b8f209c67ad159405aca16770af8e099fb0
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:59 -05:00
Allan Stephens
ae626642c7 Eliminate generated microkernel_objects.h file
Sysgen no longer needs to generate two different include files
containing the various definitions available to applications.

Note: This consolidation also eliminates the generation of
an obsoleted symbol of the form NODEx.

Change-Id: Idf28efba95193037d04603498e9e956638027ed9
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:59 -05:00
Allan Stephens
ede54c8df3 Eliminate unneeded task entry points from generated vxmicro.h
Now declares task entry points in the generated kernel_main.c,
which is the only place that needs to know about them.

Change-Id: Ifa2ebf64ced26e71387d6fd8350893205d6961a0
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:59 -05:00
Allan Stephens
ed29b076ea Eliminate unneeded non-public APIs from generated vxmicro.h
There is no longer a reason to expose information about the
internels of the microkernel's event subsystem to application
files.

Note: The one sample project that tests event processing now
explicitly declares any non-public event APIs in requires.

Change-Id: I4c3f85a7b0bc485713c21424a923102b4f400ced
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:59 -05:00
Allan Stephens
d3126ff88b Cosmetic changes to sysgen
Corrects PEP8 coding standard violations.

Change-Id: I12cb7df84f5ff3f90027db657ef088a12ab5bd03
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:59 -05:00
Peter Mitsis
6273c15e7c Rewrite truesize tool to use python
Using 'python' instead of 'gawk' for the 'truesize' has several advantages:
  - more people understand python than gawk
  - python script is easier to maintain
  - lessens the number of tools on which the product depends

Change-Id: If6780b530e28867d89939e09b81b153a960004b2
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:13:58 -05:00
Andrei Emeltchenko
f8df842dd5 Bluetooth: Add compile test for nanokernel shell app
Bluetooth regression and system regression would run compile test
for shell app.

Change-Id: I029772483e7aa9ac0717db760d8de1f6be3371b5
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:57 -05:00
Andrei Emeltchenko
9bfda983d8 Bluetooth: Add arm targets for init sample
Add new targets for sanity_chk script: fsl_frdm_k64f and ti_lm3s6965,
this would add compile tests for mentioned BSPs in sanity check
script.

Change-Id: I556f8e3a5048d2a58ab09b10197e0cc6fb3c8765
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:56 -05:00
Andrei Emeltchenko
0ec0ea297d Bluetooth: Add arm targets for microkernel sanity test
Add ti_lm3s6965 and fsl_frdm_k64f targets for bluetooth test.

Change-Id: Ibbe8ebbab72abb02505f47a82c904f0e9460e812
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:56 -05:00
Andrei Emeltchenko
81a97132de Bluetooth: Add arm targets for nanokernel sanity test
Add ti_lm3s6965 and fsl_frdm_k64f targets for bluetooth test.

Change-Id: I054c9500511fe40969127445444f85f3fe85902c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:56 -05:00
Allan Stephens
f2be9ae6c1 Cosmetic change to sysgen
Corrects a PEP8 coding standard violation.

Change-Id: Ifcdb2ac8d57dd90d74c2f72e94a774c894935a17
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:55 -05:00
Allan Stephens
8f66024f57 Revise kernel_main.c access to non-public microkernel APIs
Sysgen now copies kernel_main.h into its output directory, so that it
can be easily included by kernel_main.c. This eliminates a kludge
that required kernel_main.c to reference kernel_main.h using a relative
path name.

Change-Id: I24fcfa6b70a44526a80f33619dd68ff0a7f7acc5
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:55 -05:00
Allan Stephens
0507aefbdc Continue limiting exposure of microkernel APIs needed by sysgen
Relocates and renames the include file which declares non-public
APIs needed by sysgen from the directory containing the microkernel's
public API to the directory containing its non-public API.

Note: Need to come up with a more elegant way for generated
kernel_main.c to access kernel_main.h, since the current relative
path approach is kludgy.

Change-Id: I5e4b07038e566f1f161001d676a3b0faa487a480
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:55 -05:00
Allan Stephens
fb64710410 Limit exposure of non-public microkernel APIs needed by sysgen
Hides the existence of these routines from the microkernel's main
public API include file, but allows both sysgen and the microkernel
itself to continue accessing them.

Change-Id: Iaf1beff81d045e9df29eb07517793e4b4410f51e
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:55 -05:00
Allan Stephens
56f93e3a21 Eliminate unnecessary K_TIMER type
Since the K_TIMER type is a non-public API used within the micro-
kernel itself, it doesn't provide any real type abstraction benefit
that isn't served equally well by the struct k_timer type it is
based on.

Change-Id: I482d7c0459d5734402be541322ff752dd1a3714a
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:55 -05:00
Allan Stephens
fb7f961554 Rename EVENTS to _k_event_list
Brings the name of this non-public microkernel variable into line
with those of analogous variables.

Change-Id: I17dc343faf2dc1ace63b5a3e8164ff08ddd60ebd
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:55 -05:00
Dan Kalowsky
fd7109e015 Enabling the libc tests
Currently these tests are disabled in the regression_chk
application.

Change-Id: Ibf53b25a08201db0b50df7dca96f638b419ea4a8
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:55 -05:00
Yonattan Louise
991d16c7ae Rename K_ArgsBlocks to _k_server_command_packets
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: I855f3d468e5752abfe7a3c768c5a613566a697a0
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:54 -05:00
Yonattan Louise
068a98add2 Rename K_TimerBlocks to _k_timer_blocks
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: Ia753f8415b656e3b819a9cdb1eb24d02b750f9d2
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:54 -05:00
Benjamin Walsh
b4484a7816 nano_lifo: allow multiple fibers to pend
The nanokernel LIFOs could only have one fiber pending on one of
them concurrently. If a second fiber wanted to take a contested
LIFO, if would kick the pending fiber out of the wait 'container',
but would not put it in back in the ready queue with an error.  Instead,
it would, for all intents and purposes, remove it from the scheduling
mechanism of the nanokernel: the fiber would be 'lost' at that point.

The nanokernel LIFOs now make use of the fiber pend queue, and thus
allow multiple fibers to pend concurrently.

sysgen is updated since the microkernel initializes statically two
LIFOs, one for the command packets and one for the timer packets, and
the LIFO data structure has changed.

The nano_timers use the LIFOs and look at their internals, so they are
updated as well.

Change-Id: I250a610fcdee9d32172c88d38e6c3cfd5b437d15
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:13:53 -05:00
Allan Stephens
2b39dde39c Relocate definition of microkernel server's stack area
The microkernel server's stack area can be defined by the kernel
library itself, without relying on sysgen to do it.

Change-Id: I9359946ce9ca9138970db4e264fd25d8b92034c6
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:52 -05:00
Allan Stephens
2a7151ac9f Rename _k_node_workload_get() to _k_workload_get()
Shorten API name by removing extraneous wording.

Change-Id: Iff67c4d7e82b7093e3d4d8a7ce61a3011e0ff517
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:52 -05:00
Allan Stephens
e3d5ec6d7a Removing _k_this_node
Since the microkernel now supports only a single processor, there
is no longer a need for a means to identify it.

Change-Id: If5b2d8e114d8a3bfdd597bc23d70be5e1fa2238c
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:51 -05:00
Dan Kalowsky
fe1226713c Renaming InitPipe to _pipe_init
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I4a3755e77038eccbd31f8247cb230052dd3edccf
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:51 -05:00
Andrei Emeltchenko
8f539793ef Bluetooth: Add compile test to sanity_check
Add nanokernel init sample to sanity check compile testing.

Change-Id: Ifef4116a6cc7307f7b17a62d066f33b243a2e6ce
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:50 -05:00
Andrei Emeltchenko
de1477759c Bluetooth: Add Bluetooth microkernel smoke test
The test registers Bluetooth driver to Bluetooth the subsystem and
runs bt_init() which calls open() callback. We return expected error
to indicate that there is no real Bluetooth device attached.

Change-Id: I39526acbb25e7d4bb322d4511659a40505874592
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:50 -05:00
Andrei Emeltchenko
3760dc8709 Bluetooth: Add Bluetooth nanokernel smoke test
The test registers Bluetooth driver to the Bluetooth subsystem and
runs bt_init() which calls open() callback. We return expected error
to indicate that there is no real Bluetooth device attached.

Change-Id: I1b324c82ce8be2ce73f2b41a07135b0bc76eed61
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:50 -05:00
Allan Stephens
ec7b9fba4a Allow system generator to support tickless kernel
Revises sysgen so that it doesn't generate timer-related variables
or executable code for a tickless microkernel. Also corrects some
misleading comments about dependencies on timers.

Change-Id: I5655e32fcab22d9991f2f8e0f2db9557642b6b54
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:49 -05:00
Allan Stephens
1c32b5d720 Introduce NUM_TASK_PRIORITIES configuration option
Allows the number of task priority levels supported by the micro-
kernel to be configured, rather than fixing this value at 64.
Setting NUM_TASK_PRIORITIES to N provides support for task
priorities 0 (highest priority) through N-1 (lowest priority).
The lowest priority is reserved for the kernel's idle task.

This enhancement allows system designers to significantly reduce
the size of the microkernel's task priority queues by eliminating
unneeded queues. In systems requiring only a few task priorities
over 500 bytes can be saved.

Change-Id: I497aac608a3d548fb1b024068c08a5f494c3d524
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:48 -05:00
Allan Stephens
09ef176ce0 sysgen: Fix PEP8 standards violations
Corrects issues introduced by recent global variable renaming that
resulted in lines exceeding PEP8 guidelines. (Running the command
"pep8 scripts/sysgen.py" once again reports no issues.)

Change-Id: I6dff820bc3529cbffbc930c13e98171140c09a52
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:48 -05:00
Peter Mitsis
4780fbb4bb Remove code coverage code from sanity_chk scripts
Code coverage analysis required Simics (which is not supported).

Change-Id: Ifec09ee5699bcd1ea423eaf544ce060ec1dca04d
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:13:48 -05:00
Dan Kalowsky
3ff1132374 Re-alinging all the comments in sysgen after variable renaming has
made them no longer aligned.

Change-Id: Ia21b7db1f517c6cbe8a5ae501569aefa4d670210
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:48 -05:00
Dan Kalowsky
a6f9d1a7b8 Renaming K_mvdreq to _k_movedata_request
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I32e0105c90ef1a7f7326dd43c39c0eb85e173ee3
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:48 -05:00
Dan Kalowsky
9cd404161d Renaming K_nop to _k_nop
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Iefd087790814dbfa10ee942f4f93d955b25f42f1
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:48 -05:00
Dan Kalowsky
33bb451faf Renaming K_workload to _k_node_workload_get
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find . -type f \( -iname \*.c -o -iname \*.h -o -iname \*.s -o -iname \*.kconf \) \
       -not \( -path host/src/genIdt -prune \) \   \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I6b3d61c9ae7b024bb82356678cc2fc1d433dd3bc
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:48 -05:00
Dan Kalowsky
24ad23d7fb Renaming K_offload to _k_offload_to_fiber
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I0e29bab5dcb7e00a394304a23e4b91e3e7b4cf75
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:48 -05:00
Dan Kalowsky
b0d718d116 Renaming K_dealloc to _k_mem_map_dealloc
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Ia233946c1c4cce4a9a1b0c72a5f5025e0456441d
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:48 -05:00
Dan Kalowsky
1836e017ce Renaming K_alloc to _k_mem_map_alloc
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Ia99f28bd2fa89c0a1d592276bacdcaa679a624dd
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:48 -05:00
Dan Kalowsky
87e125fcb4 Renaming K_event_signal to _k_event_signal
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Ie8fecf7de481a6e11879124100362abe010c63a0
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:48 -05:00
Dan Kalowsky
435dad4381 Renaming K_event_test to _k_event_test
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I725ef09143213ef869064ca3b22bc35e4804089d
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
e723e9a943 Renaming K_event_set_handler to _k_event_handler_set
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Ia74ced653daf4b4ea139f7316d1a9e5a5ea9a925
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
672bda57cd Renaming K_queue to _k_fifo_ioctl
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Ibbfef7d1a6a26abca56d49733ce54f56ec5336fc
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
fee5db1259 Renaming K_unlock to _k_mutex_unlock
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Iec1871232b52bcc39bfc37d8f02bb4ce74f98ad3
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
3550116e82 Renaming K_elapse to _k_time_elapse
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"


echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Ic8106240bff4fbfb9d1bf446d343b3e8631be45c
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
167e977cbf Renaming K_sleep to _k_task_sleep
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"


echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I8c99b555275243772e91248659e340b07d41be98
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
b28fb27e1d Renaming K_wakeup to _k_task_wakeup
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"


echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: If11051da4478ef34dddd5661202b7d3486a7fba3
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
8b4d6a618f Renaming K_stop_timer to _k_timer_stop
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"


echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Ie765eb9f4b075b66d69e0f35f5f0771df9fd2244
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
e0fab87035 Renaming K_start_timer to _k_timer_start
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"


echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I2aca9bffe8ce6f61f9c272fc8ba009ffc94ec21b
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
f23bb63606 Renaming K_dealloc_timer to _k_timer_dealloc
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"


echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I3119cb67a64398426ef783c915b865fe02f7127a
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
7a21cc0d2d Renaming K_alloc_timer to _k_timer_alloc
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"


echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Iecf0984c786b48aacc23947b2a033995c3996d09
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
fb0cf2ed7d Renaming K_yield to _k_task_yield
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"


echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Ie07e38bca912647e49a2c0914001690b7c545f3b
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
3a9ff35beb Renaming K_set_prio to _k_task_priority_set
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"


echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I725126b52c68bbcbc1fe832fa892b67b6a60146a
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
ff37393a07 Renaming K_groupop to _k_task_group_op
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"


echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Iff54480375197fc1fad947a8dc98b970e142dcaf
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
cc84ca20d6 Renaming K_taskop to _k_task_op
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"


echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Icb28c7393314118d07eeaad2db634f2afe391e02
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
52de992543 Renaming K_inqsema to _k_sem_inquiry
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"


echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I5eef6b5686f4f0bea525f8d3fcbee09a264289da
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
46478250f1 Renaming K_resetm to _k_sem_group_reset
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"


echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I4b7b8a624b8cdd56f0ed95721b58077c7d412d0b
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
d8f5461f2d Renaming K_resets to _k_sem_reset
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"


echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I0656956bd43a952592ed0a3ebed7e4b9db5cc556
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
2ba9c244a3 Renaming K_signals to _k_sem_signal
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"


echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I010e56fc6b17337863efeb23ea4b64bd9d09168a
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
43a23786d9 Renaming K_signalm to _k_sem_group_signal
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"


echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Iebde762379bf36c43c802c6ec2febf8cd867171c
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
30ac0b3007 Renaming K_waitsreq to _k_sem_wait_request
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"


echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I9ed961ac9f01ead2ec688febc579874407e3b6db
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
aa0eefb856 Renaming K_waitmany to _k_sem_group_wait_any
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"


echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I894597fa00b9364451f6609c1b7c3b550c5c0c32
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
4ad6fe35ca Renaming K_waitmreq to _k_sem_group_wait_request
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"


echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I60d8a5ef34b7a6763f682f517319f81145ba9b1e
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
32d45baab0 Renaming K_waitsrpl to _k_sem_wait_reply
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"


echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Ie633b6fb90775e48c59b73da52ba2b1be4ae35d3
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
e941440ae6 Renaming K_waitmrdy to _k_sem_group_ready
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"


echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I2e7da030c447a41bb427b8599f97d84f1c1c1774
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:47 -05:00
Dan Kalowsky
c822a446a7 Renaming K_waitmtmo to _k_sem_group_wait_timeout
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Ie71e119d39a15d223a1c4f9d94f729f84dae1ed9
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
b330543d90 Renaming K_waitmacc to _k_sem_group_wait_accept
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Idfa1822876c05b4416e7e254bec7c27195ed9737
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
06c2417d4e Renaming K_waitmcan to _k_sem_group_wait_cancel
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Ifffa92fb53cafa5c76dd66a5910554226951bffa
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
34b2c67080 Renaming K_waitmend to _k_sem_group_wait_end
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Id1c504bb09875fba3e75c80810eef3e0b037d125
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
979b40f77f Renaming K_deqreq to _k_fifo_deque_request
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I7bcf9d9df788caec6d4e4dd29d1c0b58efc87af2
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
10aaf5aefa Renaming K_deqrpl to _k_fifo_deque_reply
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"


echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Ic3f0816ebc4e7df7bfdb90005d774abd748d14af
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
ec121586f0 Renaming K_enqreq to _k_fifo_enque_request
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Iba93e81cd3daec24831c45d31dfd905327e7ec18
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
e0d338a7e9 Renaming K_enqrpl to _k_fifo_enque_reply
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I3d006b76386a4ac8fc82192bf83c028bc66455ed
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
ec1dd85846 Renaming K_lockreq to _k_mutex_lock_request
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I0113be3f432d96857cea651d22ebf9822117101f
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
d3c35c2d40 Renaming K_lockrpl to _k_mutex_lock_reply
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I8aefe976518badd3acbe2b246f695931d94c58ed
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
2a6e4ed661 Renaming K_RelBlock to _k_mem_pool_block_release
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I7fc8d96a722970d6c5333544f047cd1a6d6690b2
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
b3b8e72dab Renaming K_GetBlock _k_mem_pool_block_get
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Ibbca87c801157ef48996e86f7b4b3a87eab5628a
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
dc703d8f81 Renaming K_gtbltmo to _k_block_get_timeout_handle
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I366189b4cf896020c10dbeed25c7d104a0d106a1
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
770c5fc42c Renaming K_GetBlock_Waiters to _k_block_waiters_get
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find . -type f \( -iname \*.c -o -iname \*.h -o -iname \*.s -o -iname \*.kconf \) \
       -not \( -path host/src/genIdt -prune \) \   \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I1a4bdbb5d7248896830ea25d2126b1bb9b918878
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
fe32b0717b Renaming K_Defrag _k_defrag
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find . -type f \( -iname \*.c -o -iname \*.h -o -iname \*.s -o -iname \*.kconf \) \
       -not \( -path host/src/genIdt -prune \) \   \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Id6215f2aaab918ce13e99909c21f67647cf7229e
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
a536a18693 Renaming InitPools to _mem_pools_init
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find . -type f \( -iname \*.c -o -iname \*.h -o -iname \*.s -o -iname \*.kconf \) \
       -not \( -path host/src/genIdt -prune \) \   \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I9f3fc202c580d158a18737ff0f16a25952902ae4
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
8f41d89142 Renaming K_alloctmo to _k_mem_map_alloc_timeout
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I5fa261fc3798fc3f2b1c608fcb74744741ec74f6
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
12af4313ea Renaming InitMap _mem_map_init
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find . -type f \( -iname \*.c -o -iname \*.h -o -iname \*.s -o -iname \*.kconf \) \
       -not \( -path host/src/genIdt -prune \) \   \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I0eb8925e53f00b7993374fd8ed3e6ac950dfc1ef
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
629d73d857 Renaming K_senddata to _k_mbox_send_data
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find . -type f \( -iname \*.c -o -iname \*.h -o -iname \*.s -o -iname \*.kconf \) \
       -not \( -path host/src/genIdt -prune \) \   \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I6e0edb61dcac091f87c9ffc8fd8bf507ba075367
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
7651e26d9d Renaming K_recvdata to _k_mbox_receive_data
Updating micro kernel functions to follow a consistent naming convention.
Part of that process is the removal of camelCase naming conventions for the
preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find . -type f \( -iname \*.c -o -iname \*.h -o -iname \*.s -o -iname \*.kconf \) \
       -not \( -path host/src/genIdt -prune \) \   \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I5f879ff27f8b7d02ab148cb05dd1916a831a51a8
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
8ad329b09e Renaming K_recvreq to _k_mbox_receive_request
Updating micro kernel functions to follow a consistent naming
convention.  Part of that process is the removal of camelCase
naming conventions for the preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find . -type f \( -iname \*.c -o -iname \*.h -o -iname \*.s -o -iname \*.kconf \) \
       -not \( -path host/src/genIdt -prune \) \   \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I79b03884f154507aa22c42c3c89136c202c2c9e0
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
88343e969c Renaming K_recvrpl to _k_mbox_receive_reply
Updating micro kernel functions to follow a consistent naming
convention.  Part of that process is the removal of camelCase
naming conventions for the preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find . -type f \( -iname \*.c -o -iname \*.h -o -iname \*.s -o -iname \*.kconf \) \
       -not \( -path host/src/genIdt -prune \) \   \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: If7f5e78d6dd5492dbbbcc080c2e822f33eb1c967
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
9ac922e096 Renaming K_recvack to _k_mbox_receive_ack
Updating micro kernel functions to follow a consistent naming
convention.  Part of that process is the removal of camelCase
naming conventions for the preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find . -type f \( -iname \*.c -o -iname \*.h -o -iname \*.s -o -iname \*.kconf \) \
       -not \( -path host/src/genIdt -prune \) \   \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I3de0a16879f142ef20830dfc429c989f10c2cd92
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
5ea892cffc Renaming K_sendreq to _k_mbox_send_request
Updating micro kernel functions to follow a consistent naming
convention.  Part of that process is the removal of camelCase
naming conventions for the preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find . -type f \( -iname \*.c -o -iname \*.h -o -iname \*.s -o -iname \*.kconf \) \
       -not \( -path host/src/genIdt -prune \) \   \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I628e057f54eb72901c3753b6b8b4849c4cd046c0
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
35d15ec09a Renaming K_sendrlp to _k_mbox_send_reply
Updating micro kernel functions to follow a consistent naming
convention.  Part of that process is the removal of camelCase
naming conventions for the preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find . -type f \( -iname \*.c -o -iname \*.h -o -iname \*.s -o -iname \*.kconf \) \
       -not \( -path host/src/genIdt -prune \) \   \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I02122837d74c9d7c5c406e644feda6923b5161f2
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
217de05b4b Renaming K_sendack to _k_mbox_send_ack
Updating micro kernel functions to follow a consistent naming
convention.  Part of that process is the removal of camelCase
naming conventions for the preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: Iccdd40f652f71273830155349a957839be970bd9
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:46 -05:00
Dan Kalowsky
e91808154e Renaming K_eventtesttmo to _k_event_test_timeout
Updating micro kernel functions to follow a consistent naming
convention.  Part of that process is the removal of camelCase
naming conventions for the preferred_underscore_method.

Change accomplished with the following script:

#!/bin/bash
echo "Searching for ${1} to replace with ${2}"

echo "Checking C, CPP, H, HPP, and s files..."
find . -type f \( -iname \*.[ch] -o -iname \*.[ch]pp -o -iname \*.s \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

echo "Checking KCONF, LST, and PY files..."
find . -type f \( -iname \*.lst -o -iname \*.kconf -o -iname \*.py \) \
       -not \( -path host/src/genIdt -prune \) \
       -not \( -path host/src/gen_tables -prune \) \
       -print | xargs sed -i "s/"${1}"/"${2}"/g"

Change-Id: I3919b2dda4a37c2c81e070179eae251131b14be4
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:13:45 -05:00
Yonattan Louise
e2be61c15e Rename K_StackSize to _k_server_stack_size
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: I56ee3d3ab6d1254359adcffa4d86c1bf2e20537a
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:44 -05:00
Yonattan Louise
6120750f19 Rename K_max_eventnr to _k_num_events
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: Idcd3b4dfd86b6e835638623fa7b39401cabdee06
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:43 -05:00
Yonattan Louise
91791874e8 Rename K_TimerFree to _k_timer_free
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: I0a807704a81b1faf4b79fe3832830c4994795fe3
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:43 -05:00
Yonattan Louise
ece60ad6f5 Rename K_ArgsFree to _k_server_command_packet_free
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: I175a8bcd29e21d64de735fba9a2e2ee2bc57993e
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:43 -05:00
Yonattan Louise
9bbb6e1e7b Rename K_Task to _k_current_task
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: Ic81b4ad7edf476da61ae62df627866e0446714d7
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:43 -05:00
Yonattan Louise
f282dbcb1f Rename K_PipeCount to _k_pipe_count
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: I10a1bff593c56cf6703920b9feccd10e32cc65ef
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:43 -05:00
Yonattan Louise
d109105597 Rename K_PoolCount to _k_mem_pool_count
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: I413e59e0200c2b8eba1bee79e444b3492de8fb7c
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:43 -05:00
Yonattan Louise
5c3646b5d9 Rename K_MapCount to _k_mem_map_count
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: Ifdfb9042ff4e83f6d7a8430d47c573b85eca9048
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:43 -05:00
Yonattan Louise
86c128d3ba Rename K_PipeList to _k_pipe_list
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: I77d459388aa26eaa52d0f59234d761f3ca7d1496
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:43 -05:00
Yonattan Louise
652796d345 Rename K_PoolList to _k_mem_pool_list
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: If9b4747ffa6f9dae4cb77717931fed445ae43721
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:43 -05:00
Yonattan Louise
e960e23410 Rename K_QueList to _k_fifo_list
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: I8996c427a98f542052b40bcc9f623c05f6d9bb21
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:43 -05:00
Yonattan Louise
054d3f0787 Rename K_SemList to _k_sem_list
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: I2045fab9f67fda6f0d26a53d47561a705046d4db
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:43 -05:00
Yonattan Louise
69bc5940d2 Rename K_MutexList to _k_mutex_list
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: I719d6f1a89b343d149eded7227534ee30055e030
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:43 -05:00
Yonattan Louise
65ffb9e81e Rename K_MbxList to _k_mbox_list
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: Ibe83bc837cdae54cf553b80efd989ad321447873
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:43 -05:00
Yonattan Louise
59d838355a Rename K_MapList to _k_mem_map_list
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: I12ab3ee4111a32afc674b654bf0a914012ec0318
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:43 -05:00
Yonattan Louise
3473bb7609 Rename K_TaskCount to _k_task_count
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: Iafa862861cc6b56212c036acc0bb182e2c620e7b
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:43 -05:00
Yonattan Louise
a07990ecea Rename K_ThisNode to _k_this_node
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: I1b3cb984fa75cd1a83649c81787a40aee97f8a32
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:43 -05:00
Yonattan Louise
bf650d4fe5 Rename K_TaskList to _k_task_list
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: I4c27dd98967dedbb15e28618f5dd8f26b919579d
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:43 -05:00
Yonattan Louise
964a9c9d77 Rename K_PrioList to _k_task_priority_list
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: Idff77a32adb875789a57d2c9131b87769bf6f174
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:43 -05:00
Yonattan Louise
a12dd63c74 Rename _minik_stack to _k_server_stack
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: Iad6d39bea0da42633e40e7e7d5b64d2a05efbad0
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:42 -05:00
Yonattan Louise
6530f4a26b Rename _minik_func to _k_server_dispatch_table
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: Ifb54b2dbdc726e87b10c33776c0d1815d56776cd
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:42 -05:00
Inaky Perez-Gonzalez
9343cc7ca0 qemu: use a pidfile to avoid killing all and thus enabling parallel runs
When killing QEMU, we defaulted to either killall or find the first
qemu process. This intefered with parallel builds, as we might kill
some other build's qemu process.

This makes QEMU write a pidfile in the local outdir directory and kill
only that when done.

Change-Id: I498b1e0833fcda9a7bd50111616dfba015e566bd
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-02-05 20:13:42 -05:00
Peter Mitsis
6feec0d462 Remove references to host server channels
The host server channels are not used; their function pointers are always NULL.

Change-Id: I7616499f5695b83a015e6ee18c004aba96838d63
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:13:42 -05:00
Peter Mitsis
bd969c97cc Remove k_boot.h and flashboot.c
The files k_boot.h and flashboot.c are obsolete.

Change-Id: Ieab69e714462079c2a836dacb7c5bab53d2e3b2b
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:13:41 -05:00
Peter Mitsis
d1179f2c54 Remove Dest field from k_args
The 'Dest' field in the 'k_args' structure is only relevant to
a multi-node system.

Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Change-Id: I6942f503af6ebadd62a2bf10b2a3bd0c81850bb8
2016-02-05 20:13:41 -05:00
Allan Stephens
4baf0f0e15 sysgen: Detect invalid number of arguments for keywords
Now terminates process with an error message if there is a mismatch
between a keyword and the expected number of arguments that follow it.

Change-Id: Ib1902161937cae482e52be449c89789f8ff816a5
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:40 -05:00
Allan Stephens
d00b802a6d sysgen: Terminate build when error detected
System generator now terminates with a non-zero exit code when
it detects an error, allowing the build system to detect the failure
and terminate the build.

Note: Sysgen only detects invalid keywords at this time. It would be
nice if it also detected other syntax and semantic errors.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:40 -05:00
Allan Stephens
5b76cee54e sysgen: Improve readability of kernel_main.c
Adds blank lines to kernel_main.c output file in places where
unrelated variables were juxtaposed. Also suppresses an unwanted
blank line that occurred when no project-specific events were
defined.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:40 -05:00
Allan Stephens
4cb503d165 sysgen: Standardize output file header creation routine naming
Makes the generation of kernel_main.c more consistent with the
generation of the other two output files.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:40 -05:00
Allan Stephens
3cddec6551 sysgen: Standardize newline creation in output files
The routine that appends data to kernel_main.c no longer adds
a newline character, similar to what is done during the generation
of microkernel_objs.h and vxmicro.h.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:40 -05:00
Allan Stephens
04012be07c sysgen: Relocate code for processing output directory name
Reworks output directory name processing so that it is invoked
at the bottom of the file, just like the rest of the program's
mainline. (It's previous location wasn't incorrect, but it could
be easily overlooked.)

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:40 -05:00
Allan Stephens
779932139c sysgen: Improve location of functions and global variables
Relocates a handful of functions and global variables that were
located in places that were logically inconsistent with most other
functions and variables.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:40 -05:00
Allan Stephens
ed9499e83f sysgen: Enhancements to comments
Adds, removes, and revises various comments to make it easier
to figure out what is going on.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:40 -05:00
Allan Stephens
fc86999380 sysgen: Cosmetic changes to achieve PEP 8 conformance
Makes cosmetic changes to address all issues reported by
the pep8 Python programming style tool.

Note: All future changes to sysgen should be run against pep8
to ensure no new issues are introduced.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:40 -05:00
Yonattan Louise
3322984234 Add patch for QEMU that solves the interrupt locking issue with ARM in QEMU.
Due to interrupt locking for ARM is not implemented by QEMU we provide
a temporary solution for internal purposes that works for the BSP = ti_lm3s6965.

This patch applies to QEMU v2.1.

Change-Id: Id14b66a18d02c53280c19d9a11fcf99256b3f5fb

Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 19:45:10 -05:00
Yonattan Louise
cfd8417fe8 Add copyright header to do_checkpatch script
Adding copyright header to the file script/do_checkpatch.sh

Change-Id: I3160a68b6715ea35aa6c1d3529e2b2483bb44b5c
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2015-04-15 14:06:04 -05:00
Anas Nashif
edb24ef6eb remove QA scripts
QA related scripts should be either maintained out
of the tree or come as enhancements to the sanity check
scripts.

Change-Id: I6dceed81f66b84cedad2dd84fd42d6b388de3468
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2015-04-13 18:47:50 -04:00
Inaky Perez-Gonzalez
8ddf82cf70 First commit
Signed-off-by:  <inaky.perez-gonzalez@intel.com>
2015-04-10 16:44:37 -07:00