Commit graph

18576 commits

Author SHA1 Message Date
Allan Stephens
7a4be5abf1 Allow AppKernel benchmark to utilize non-public microkernel APIs
This project requires access to non-public kernel structures
for testing purposes.

Change-Id: Ibfa119b99bda170498503cdbbee6b98f5cf41f54
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:00 -05:00
Allan Stephens
cff0fc3209 Eliminate exposure of non-public task IRQ type definition
Removes non-public type definition used to implement the microkernel's
task IRQ support from the public API.

Change-Id: I42c22f0fa323c5b9abbc7d3d29a89a9b2b903a36
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
Allan Stephens
dc5230ec35 Eliminate non-public structures from public microkernel API
No longer drags in include file defining non-public structures.

Change-Id: I91098867b31e34e8d16639339bbd938dcd8869af
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:00 -05:00
Allan Stephens
7e3679b4f6 Eliminate defunct mon_struct structure
This structure is no longer referenced anywhere.

Change-Id: I41eb69dbab9a6e73b947a0a46fced9d8f7166922
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:00 -05:00
Dirk Brandewie
ff5062675a Add argument names to _task_mutex_{lock/unlock}
Needed to quite compiler warning which is turned into an error by
-Werror

Change-Id: I1f84af332e516edbeaa5e1836653c21935ca7924
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:00 -05:00
Dirk Brandewie
1a159cb3f5 loapic: Expose APIC LVT mask definition
When the local APIC timer driver is configured into the system it needs to
ability to enable/disable the local APIC timer. The definition of the
LVT mask bit was moved into the APIC interrupt driver as part of the
driver reroganization effort. Move the definition to the public header
file.

Change-Id: I8e7f8eab9f39aa17b96079836c182bde6f7b4fd1
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.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
Johan Hedberg
99dce8cf7b test_libs: Add memcmp test case
The initial memcmp implementation was buggy, so to have at least some
sort of sanity testing of the implementation add a test case for it to
test_libs.

Change-Id: I9e1a48e4b646e80258c1689dde2461a6134dddf8
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:00 -05:00
Johan Hedberg
afffab10a4 libc: Fix memcmp implementation
The previous implementation would read one byte past both buffers if
the buffers were equal. Make sure the pointers are not incremented
past the last byte. Also ensure that comparing zero bytes always
returns 0.

Change-Id: I5ef25d6bd2f7417b60102dc1c2602d8b23c4c1bc
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:00 -05:00
Johan Hedberg
7fc1c37c32 libc: Add memcmp implementation
Add a memcmp implementation that may be used in various parts of the
operating system.

Change-Id: I784bdcb26b924b2513ecd0b3ce1898195453f755
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:00 -05:00
Yonattan Louise
8f08126af8 Change task_irq_object from global to local variable.
The variable task_irq_object is global because the test_task_irq project
needed to access it. That data should only be accessed through the API.
To make the variable local, break that dependency to the test project
and restrict the access to the variable.

Change-Id: I1ccb21625d456714a038e0374d124b42aa72e577
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:14:00 -05:00
Juan Manuel Cruz
19f4eccb4a x86 lo-apic timer _sys_clock_tick_announce call.
This commit fixes the calling of the function
_sys_clock_tick_announce from the x86 lo-apic timer.
This call was used wrongly, using the old convention:
__sys_clock_tick_announce

Change-Id: I5417efe1efcb94925bd4bebbb3b91b491349c26e
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:13:59 -05:00
Yonattan Louise
5f9042e6c1 Fix whitespace issues
Fixing the folling whitespace issues:

- SPACE_BEFORE_TAB : We should not use white spaces before tabs to alignment.
- TRAILING_WHITESPACE : Lines should not end with a white space.
- QUOTED_WHITESPACE_BEFORE_NEWLINE : Removing unnecessary whitespace before a quoted newline.

Change-Id: I024e8d39164c5e5e9d8370f3499d21b49147feee
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:59 -05:00
Yonattan Louise
63e3a4e772 Fix checkpatch issue - ERROR:ELSE_AFTER_BRACE
The 'else' statement should be in the same line that the
close brace of the 'if' statement. E.g.:

	if (condition) {
		do_this();
		do_that();
	} else {
		otherwise();
	}

This commit fixed this kind of error using the following script:

	#!/bin/bash

	for file in $(find ./ -name "*.[ch]" ! -path "./scripts/*" ! -path "./host/src/wrsconfig/*");
	do
		if [ ! -h $file ];
		then
			sed -i '/^[ \t]*}$/ {
	:review_next_one_too
	N
	s/^\(.*\)\n[ \t]*else/\1 else/
	/}$/ b review_next_one_too
	}' $file;

		fi;
	done

Change-Id: I7e811a572d735fa08e84850055ebbde29eb10e8d
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:59 -05:00
Yonattan Louise
918cf45f33 Fix coding style of control statements
There should be a whitespace between the 'if', 'for' and 'while' statements
and the open brace. this commit fix this kind of error.

Change-Id: I4bae17d98f8ec8b698d40253a9a4c873111a8904
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:59 -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
Yonattan Louise
b0b11989df Fix checkpatch issue - WARNING:LONG_LINE
Line's length should be shorten than 100 characters. This commit
fixes these lines separating them into two parts.

Change-Id: Ic68c9086866cd778187aa1465470acc0485e2271
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:59 -05:00
Yonattan Louise
dbada63eee Fix coding style issues.
Some checkpatch issues were solved by scripts leaving other problems
such as alignment and indentation issues.  In order to comply with the
defined coding style the following fixes were made:

- Fixed the function declaration moving the parameters' comments above
  the function in accordance to the doxygen format.
- Fixed functions' opening and closing brackets. These brackets should
  not be indented.
- Fixed the 'if', 'for' and 'while' statements adding the brackets
  around the sentence.
- Fixed comments' alignment.
- Fixed indentation.

The work was done manually and submitted as one commit. I didn't
separate these changes in different commits because they were fixed all
at once. Basically, all errors were fixed in every file at once.

Change-Id: Icc94a10bfd2cff82007ce60df23b2ccd4c30268d
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:59 -05:00
Yonattan Louise
d133f9661d Fix checkpatch issue - WARNING:SPACING
This commit fixes the issue marked as SPACING by the checkpatch script
deleting the whitespaces between the function name and the open parenthesis.

Change-Id: I972b1646904bf6e1131263f94ab5024a528ae07d
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:59 -05:00
Juro Bystricky
8c074e2afc toolchain.defs: Remove absolute path
Avoid hard-coded absolute paths.
Assume gcc and ar will be found using $PATH.

Change-Id: Ie7bd7d262a56a20741c8b3e5c1d0d600d8a1b60d
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2016-02-05 20:13:59 -05:00
Benjamin Walsh
ba7f55b92b tickless idle: remove APM dependency on MICROKERNEL
The ARCv2 will provide support for nanokernel tickless idle.

The other architectures still have the MICROKERNEL dependency by having
the APM menu depend on MICROKERNEL.

Change-Id: Ib8e550bb9515b332311b122751f534f69155cef5
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:13:59 -05:00
Benjamin Walsh
a12924be27 kconfig: remove useless tickless idle dependency
TICKLESS_IDLE_THRESH depends on TICKLESS_IDLE, which depends on
ADVANCED_POWER_MANAGEMENT, which itself already depends on MICROKERNEL.
There is thus no point in having TICKLESS_IDLE_THRESH depend on
MICROKERNEL.

Change-Id: I71daeee5fe0766f40ba56d499c48cc5a0dda561c
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:13:59 -05:00
Benjamin Walsh
da26208623 timer: use _sys_clock_tick_announce() in drivers
Replace duplicate code and will allow for further cleanup by possibly
consolidating micro/nano code that is currently guarded by preprocessor
conditionals.

Change-Id: I9aa9966c581244646b6ea317ef8b51fef9054dd4
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:13:59 -05:00
Benjamin Walsh
153503d766 timer: micro/nano abstraction for announcing tick
The gain is two-fold:

- Removes the need of preprocessor conditionals in the timer drivers'
  ISRs.
- Allows removing the duplication of the 'tick announce' code across
  all timer drivers.

Change-Id: I6078a0b00a833c1d1ca76474987c3214a0c05f7b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:13:59 -05:00
Benjamin Walsh
0c798772cc timer: fix incorrect nano_fiber_lifo_put in ISR
The correct call is nano_isr_lifo_put, but they are aliases of each
other, so that never caused an issue at runtime.

Change-Id: Ibec8e6d3377133e5e67589c5a3ad1b8fb3cc652c
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:13:59 -05:00
Benjamin Walsh
8678e3a9a8 nanokernel/idle: fix file description
Change-Id: I247c592a528b8c2138576026596c765491a8b90b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:13:59 -05:00
Benjamin Walsh
f166d84220 arm: fix tabs-vs-space issues in isr_wrapper.s
Change-Id: I4a87fe44e2a9444a460e7b0629d41a845ad2e7ed
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:13:59 -05:00
Juro Bystricky
aa47ce79c6 yocto toolchains: Modified for i686 SDK
Changes due to the different SDK package layout.

All needed settings are derived from the following environment
variables:

export VXMICRO_TOOL=gcc
export VXMICRO_GCC_VARIANT=yocto
export YOCTO_SDK_INSTALL_DIR=<toolchain dir>

sdk_host_tools=${YOCTO_SDK_INSTALL_DIR}/sysroots/i686-pokysdk-linux/usr/bin
export PATH=${sdk_host_tools}:${PATH}

Change-Id: I358b0b55b552d639bb2a2c2a54f2bef5e5099316
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2016-02-05 20:13:59 -05:00
Allan Stephens
d3fe0374da Eliminate _Cput and _Cpsh APIs
These APIs no longer serve a useful purpose; there removal helps
reduce microkernel-related "pollution" of nanokernel files.

Change-Id: I3fb1df1feb47abf1b3e57656175ba6c80e191932
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:59 -05:00
Allan Stephens
32826127de Rename nanokernel files
Makes various nanokernel file names more accurately reflect their
actual roles, and improves consistency with other naming conventions.

Change-Id: Ibea5a66a8d66c4e41810d6b3d70b4c459a3848a8
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:59 -05:00
Allan Stephens
4d30cd8408 Eliminate unnecessary operations during nanokernel initialization
There is no need to have code to set fields of _nanokernel to zero,
since the variable is zeroed out during BSS initialization.

Change-Id: I338369511d8b0bcc2fb2b6104acdd281dac9a926
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:59 -05:00
Allan Stephens
16f935ab1f Cosmetic changes to nanokernel initialization code
1) Revises name of background/idle task stack area to make it
   more meaningful.
2) Converts a routine to be non-global since it isn't used elsewhere,
   and renames it to remove an unneeded leading underscore.
3) Updates and enhances comments to better reflect the current
   operation of nanokernel initialization.

Change-Id: Ibff7703562d1a9585dc2022741a6f0acb90c0a78
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:59 -05:00
Allan Stephens
5d4390f012 Eliminate unneeded arguments during nanokernel initialization
No longer passes arguments to _nano_init() that aren't needed.

Note: Also eliminates duplicate declarations of _nano_init()
that are obsolete.

Change-Id: I36ddfc9ceb18e3e5d6942a23574e38c1dfd3eb65
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:59 -05:00
Allan Stephens
9597404727 Consolidate nanokernel initialization code
Moves all nanokernel initialization code into a single file, since
they are all conceptually related.

Change-Id: Icd4e8572756fdcef7d0b965224ae00824e748a0a
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:59 -05:00
Allan Stephens
ffdbe7d691 Consolidate the nanokernel's context manipulation APIs
Moves all general purpose context manipulation routines into a
single nanokernel file, since they are all conceptually related.
(This also eliminates the anomaly of having APIs that could be
used with a task in a fiber-specific file.)

Change-Id: Idb862175e8795962dd78d31b66151f7b14936df0
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:58 -05:00
Allan Stephens
a139256afc Enhance microkernel command stack size bounds checking
Ensures that the microkernel's command stack has at least one element
at project configuration time, rather than at project build time.

Change-Id: I74f10bcb0d0275854801b50d5160fc85fb911250
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:58 -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
Peter Mitsis
7d75790dad Rename scp and scs sections
Renaming the "scp" and "scs" sections to ".scp" and ".scs" respectively
signals the "truesize" tool to ignore them as they occupy neither normal ROM
nor normal RAM space.

Change-Id: Ic22013965b20d0c14e08d4d0332f2b7d028d10d9
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:13:58 -05:00
Luiz Augusto von Dentz
9ef64a3112 toolchain/gcc: Add UNALIGNED_GET macro
Similar to PACK_STRUCT it provide safe access to possible unaligned data
but it is much more convenient to use with non-struct types since all
one need to do is add a cast e.g. UNALIGNED_GET((uint16_t *) data).

Change-Id: I46402bdf1dd13081fe340a7214a84750a6cf04d2
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:13:58 -05:00
Anas Nashif
06d380c2ba Add tools and Makefiles for Documentation
This will allow us to start adding content and structure.
To generate documentation you will need to install both
- sphinx
- breathe

go into the doc directory and run:

$ make doxy html

No content has been submitted here, only a few placeholders.

Change-Id: Ifc3617aee8f7d45fa4e4a494ff0a1ab71516af06
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:13:58 -05:00
Arkadiusz Lichwa
e60b8f1927 Bluetooth: Intro of basic ADV handler
Adds basic handler deserializing advertising data.
Adds helper reformat function.

Change-Id: I6385249c39e92b2f068a01e89d34530b7a321f34
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:13:58 -05:00
Arkadiusz Lichwa
f170898634 Bluetooth: Add simple LE scan app
Use scan functionality by simple app that starts LE scan
and in a while stops it.
It uses basic HCI scan interface prepared for
supporting LE central role feature.

Change-Id: Idcde4c742290d46931ab86522e51b0fc547a2d42
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:13:58 -05:00
Luiz Augusto von Dentz
329e4276ae Bluetooth: Fix ATT define values
The codestyle is to use lower case for hexadecimal values.

Change-Id: I0e73cdf6d8ff4b48e6cb814f705193c65a01d14a
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:13:58 -05:00
Luiz Augusto von Dentz
f8215b94f5 Bluetooth: Move Write Command definitions
This changes order of Write Command definitions so it is consistent with
the opcode value.

Change-Id: Ie0eaaaec75d7b17d2da62a6c930ec56d1e666253
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:13:58 -05:00