Commit graph

187 commits

Author SHA1 Message Date
Marcus Shawcroft 1bc999cb8d drivers/uart: Refactor UART input hook.
This refactor is in preparation for making driver API structures
const.

The console driver provides a mechanism to install an input and an
output hook function.  These are primarily used by the onboard
gdb-server.  The output hook is entirely implemented within the
console driver.

The input hook is partially implemented in the top of the uart driver
and within the console driver.  The hook function itself is installed
in the uart API structure, but is invoked only by the console driver.

Installing the hook function directly into the uart API structure
prevents the API structure being const.  There are two approaches to
fixing this:

1) Implement setting of the input hook in the same way as
uart_irq_callback_set().

2) Move the input hook entirely to the console driver.

We implement the latter.  This approach has two benefits, first it
removes the need for every uart driver to implement the behaviour and
second, the current placement of the callback function in the uart API
seems odd given that the callback is only invoked by the console
driver, never by a uart driver.

Change-Id: I258b312d3055df1c2bdeb896bd4f4f39c40838f7
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 11:31:08 +00:00
Allan Stephens b9a4bd906c kernel: Relocate ring buffer suppport to 'misc' directory
Moves the source code for ring buffers to the 'misc' area, since
it isn't really a central component of the kernel. (This also
aligns the ring buffer source code with its include file, which
is already under 'include/misc'.)

Change-Id: I765a383a05f51fa67d154446f412496e689f9702
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-21 15:33:31 +00:00
Anas Nashif ecf96d2cfa arduino 101: make factory bootloader config the default
The Arduino 101 comes with a bootloader that supports DFU
and flashing of all cores using the dfu-util package.

This changes the memory layout of the image built for the
Arduino 101 and remove previous work-arounds to allow booting,
including the version-header section in the linker script.

The bootloader expects the text section at +0x30 from the physical
load address and thus requires special treatment in the linker
script.

Other changes by Andrew Boie:
The flash size parameters were both wrong. X86 side has 192K
of flash from 0x4003000 - 0x40060000, the entire span of
sys_flash1.

ARC side is now the span from 0x40010000 - 0x40030000, 128K.

Change-Id: Iecfa5d2b84a3f522d9eca06268d6b8b71a094aaa
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-17 11:13:59 +00:00
Benjamin Walsh 7e6dacd65f unified/build: allow building the unified kernel
Added needed kconfig options. KERNEL_V2 selects MICROKERNEL to allow
middleware and application that differentiate between NANOKERNEL and
MICROKERNEL to run unmodified.

Build the unified/ kernel directory: do not touch the
nanokernel/microkernel directories.

Invoke sysgen for both microkernel and unified kernel. Only have sysgen
reference include/microkernel if building an original microkernel.

Change-Id: If74779146143434f7ee274bbef32d6c894b9f1a1
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-13 17:12:55 -04:00
Andrew Boie a811cc5085 printk: make _char_out globally accessible
This is to support a printf test case where we need to know
the existing value so we can chain it.

Change-Id: I671429aa7dab1391840f49f54cc6c23baccf265c
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-28 07:47:28 -04:00
Andrew Boie 4c64805336 printk: print leading '0x' for %p
Change-Id: I0140d1721ecaef47245e0fab61300c1dd44b9aff
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-28 07:47:28 -04:00
Andrew Boie 907a99933a printk: "support" some modifier codes
We now allow modifier codes h, l, and z, although at the
moment they are simply dropped. This is to allow us to warn on
incorrect printk() usage by the compiler. These arguments get
promoted to int when they are passed as arguments so this
may never need to be addressed, although there may be implications
for (future) support for systems with 16-bit integers.
We still don't print 64-bit integers properly. but this is
nothing new.

Change-Id: I112d1257c4ec70c3fa7ae65dc56a6076ff29a8c0
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-28 07:47:28 -04:00
David B. Kinder d748577706 doc: Fix terminology in Kconfig files for 'platform'
Completing the terminology change started with change 4008
by updating the Kconfig files processed to produce the
online documentation, plus header files processed by
doxygen.  References to 'platform' are change to 'board'

Change-Id: Id0ed3dc1439a0ea0a4bd19d4904889cf79bec33e
Jira: ZEP-534
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2016-08-18 21:17:29 +00:00
Andrew Boie 17c0b372a2 x86: improve exception APIs
Previously, exception stubs had to be declared in assembly
language files. Now we have two new APIs to regsiter exception
handlers at C toplevel:

 _EXCEPTION_CONNECT_CODE(handler, vector)
 _EXCEPTION_CONNECT_NOCODE(handler, vector)

For x86 exceptions that do and do not push error codes onto
the stack respectively.

In addition, it's now no longer necessary to #define around
exception registration. We now use .gnu.linkonce magic such that
the first _EXCEPTION_CONNECT_*() that the linker finds is used
for the specified vector. Applications are free to install their
own exception handlers which will take precedence over default
handlers such as installed by arch/x86/core/fatal.c

Some Makefiles have been adjusted so that the default exception
handlers in arch/x86/core/fatal.c are linked last. The code has
been tested that the right order of precedence is taken for
exceptions overridden in the floating point, gdb debug, or
application code. The asm SYS_NANO_CPU_EXC_CONNECT API has been
removed; it was ill- conceived as it only worked for exceptions
that didn't push error codes. All the asm NANO_CPU_EXC_CONNECT_*
APIs are gone as well in favor of the new _EXCEPTION_CONNNECT_*()
APIs.

CONFIG_EXCEPTION_DEBUG no longer needs to be disabled for test
cases that define their own exception handlers.

Issue: ZEP-203
Change-Id: I782e0143fba832d18cdf4daaa7e47820595fe041
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-28 18:13:24 +00:00
Inaky Perez-Gonzalez 9b3b36bd7a gdb-server: update call to uart_register_input()
uart_register_input()'s signature changed with the addition of a
callback. gdb_server.c was never updated so now the compilation fails
when enabling the GDB server.

Fix by setting a NULL completion (as seems the code would not use it
anyway).

Change-Id: I4c0df65a31bd906db704f7f4a564e7d6f065aae7
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-06-22 17:40:01 +00:00
Inaky Perez-Gonzalez b4bbc71369 gdb_server: fix semicolon that depends on #define
supported_features_cmd is a string which part of is added based on a

However, the semicolon to do so was being only included if the #define
was there; if not it was generating a syntax error. Place it out of
the #ifdef block.

Change-Id: Idd7e80519719b5ad432971e758a05546df8a89e2
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-06-22 17:39:43 +00:00
Andrew Boie 63cea24896 misc: add config to omit frame pointer
Change-Id: Ia69c14addded7563a24f15d4a3408fcc2c8e673a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-16 18:15:59 +00:00
Kumar Gala 9ec2f3be80 Cleanup whitespace in Kconfig files
Convert leading whitespace into tabs in Kconfig files.  Also replaced
double spaces between config and <prompt>.

Change-Id: I341c718ecf4143529b477c239bbde88e18f37062
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-05-25 13:28:07 -05:00
Benjamin Walsh 0107c80c29 misc: clean up __ASSERT warnings during build
By default, instead of spamming the build output with one warning per
file where __assert.h is included when CONFIG_ASSERT=y, only display a
warning at the end of the build.

Also limit the range of CONFIG_ASSERT_LEVEL between 0 and 2.

Change-Id: I95ffd1bcec9535de1afabc047814e5c6f5b9c2c1
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-05-18 22:06:54 +00:00
Anas Nashif 0b2c44a771 tinycrypt: move from lib to regular objects
tinycrypt was built using the lib- scripts without any real benefit. We
also had a wrong placement of the Kconfig files under misc/ and a Kconfig
file for Crypto that was never used before.

Change-Id: I82d5902d92e7c06e10a95f418d9ead3cbcabcce4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-16 19:43:50 +00:00
Anas Nashif 909dd7ee05 arduino_101: support booting with original bootloader
To boot zephyr on the Arduino 101 running the original bootloader
which supports DFU, set the following in your application configuration
file:

CONFIG_SS_RESET_VECTOR=0x40034000
CONFIG_PHYS_LOAD_ADDR=0x40010000
CONFIG_VERSION_HEADER=y

Jira: ZEP-219
Change-Id: Ia015a7b6fce888b49ed22c558de992132d4713ea
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-30 13:56:54 -04:00
Benjamin Walsh 43592b1127 x86/debug: GDB server needs to handle some exceptions
GDB server needs ownership of some exceptions to display information when
taking a fatal exception (DIVIDE_ERROR, PAGE_FAULT).

Introduce a Kconfig option that can work for any debugger.

Change-Id: I39aef22a820543a7fe9ac333b487592946abc0f3
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-04-16 05:29:22 +00:00
Benjamin Walsh f703f7d0f6 debug: add target GDB server
The GDB server implements a set of GDB commands, such as read/write
memory, read/write registers, connect/detach, breakpoints, single-step,
continue. It is not OS-aware, and thus provides a 'system-level'
debugging environment, where the system stops when debugging (such as
handling a breakpoint or single-stepping).

It currently only works over a serial line, taking over the
uart_console. If target code prints over the console, the GDB server
intecepts them and does not send the characters directly over the serial
line, but rather wraps them in a packet handled by the GDB client.

Change-Id: Ic4b82e81b5a575831c01af7b476767234fbf74f7
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-04-16 05:29:22 +00:00
Benjamin Walsh 270d602efd debug/x86: add runtime info needed by target debuggers
Introduce an x86 interrupt stack frame that contains more information
than the non-debug one, namely the caller-saved GPRs, as well as an API
to retrieve it. Able to handle nested interrupts stack frames.

Change-Id: If182aaa2f34e4714b16ca65ff79da63b72d962f7
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-04-16 05:29:22 +00:00
Benjamin Walsh 45d9689dc8 debug: add missing MEM_SAFE dependency
Change-Id: Ia13b84d1bacfcc9ff7e429be41db31e5e63ae282
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-04-16 05:29:21 +00:00
Benjamin Walsh 6ec02cc807 debug: fit Kconfig lines in 80 columns
Change-Id: I2df06d14cf0c219006adf7609542498b78ce342e
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-04-16 05:29:21 +00:00
Genaro Saucedo Tejada 34d497118a sys_log: Adds the common log API header
The header sys_log.h concentrates logging macro definitions so it can be
reused by all code, change aims create an API to replace replace
currently duplicated logging macro definitions. Later enhancements to
log can now be performed in a single file. Features:

* Optional printing of colored messages
* Incremental log levels per-module
* Optional printing of logging level label (info, error, warning, debug)
* Caller function name printing
* One point log disable
* Global override log level
* Print function detection (printf or printk)

JIRA item ZEP-111 refers to this change.

Origin: Original
Change-Id: I34492b0148b4e9d0094f69c511b96f4fd640ef44
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2016-03-18 00:01:21 +00:00
Anas Nashif 84a5557eb3 kconfig: move ARM bootloader options to bootloader menu
Change-Id: Ia3612413f68691d9e9364f278aada6b9c3296fb5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-14 16:50:50 -04:00
Jithu Joseph 4ad7f2a5a3 libc-hooks: newlib's heap may use entire unused RAM
Use linker symbol and board configs to determine the start
and extent of remaining RAM present in a board and use
it as newlib's heap.

Change-Id: I7128cf2857664331d83f212f27e8af7ad3bb8936
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-02-27 09:57:19 +00:00
Iván Briano 428d51b5db libc-hooks: Make newlib's heap size configurable
While we don't have a proper heap that can make use of all the
available RAM, make it possible for applications using Newlib to
configure the size of the heap exposed via the sbrk() hook.

Change-Id: I4e3193c1f2df0ace1dbc5b1f6ceb2cdc61479762
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-02-20 14:57:53 +00:00
Benjamin Walsh a4ec963138 init: use SYS_INIT() where it makes sense
Mostly SoC initialization and some kernel subsystems, but also some
device drivers like the interrupt controllers.

Change-Id: I8dc1844c33acd877c075b6b03558fdca6f87500b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh d340d4cb3f device: use DEVICE_INIT everwhere
This is the last step before obsoleting DEVICE_DEFINE() and
DEVICE_INIT_CONFIG_DEFINE().

Change-Id: Ica4257662969048083ab9839872b4b437b8b351b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh 0303d8cab9 device: rename SYS_DEFINE_DEVICE()
Rename it to DEVICE_DEFINE() so that it fits in the 'device' namespace.

Change-Id: I3af3a39cf9154359b31d22729d0db9f710cd202b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh bfc27206b2 device: rename DECLARE_DEVICE_INIT_CONFIG()
Rename it to DEVICE_INIT_CONFIG_DEFINE(), because (a) it was not fitting
in any namespace and (b) it is not used to declare, but rather define a
object.

Change-Id: I1da5822f06b85a9fb024b5b184afd0ccc01012ec
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh 2e27adb569 mem_safe: prevent writing to .text in XIP systems
The sys_mem_safe_write_to_text_section() now always fails in XIP
systems, since their .text section is in ROM.

Change-Id: Ie47a5dbf5f75a4bfe8e9fc9852d0037a3546aae8
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:24 -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
Anas Nashif 6fa8588145 kconfig: add mising option TASK_DEBUG
The option is used in the code but was never declared.

Change-Id: I17552c225936652e9208f53a884311eb81cb79a6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:13 -05:00
Anas Nashif 9fe306bc2a Generate stack usage information only when enabled
This will only generate the .su files when CONFIG_STACK_USAGE
is specified, otherwise the tree will be full of .su files.

Change-Id: I3ffc7a7f5ab09aaae49ff65e8ad5de0832370777
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:04 -05:00
Anas Nashif 94b29b562b kconfig: put bootloader and reboot options in a menu
Some options appear in the top level menuconfig, group them
and put put them in a menu.

Change-Id: Ib0285176e7f0ed7ec9ff54dd80c0f02ec4817f2b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:55 -05:00
Dmitriy Korovkin 57f2741e4f init: Implement fine-grained initialization policy
Put initialization priorities as device driver Kconfig
parameter.

Initialization priority value for each platform is defined
in the platform Kconfig file.

Drivers and platform code use SYS_DEFINE_DEVICE to add
and initialization function.

Change-Id: I2f4f3c7370dac02408a1b50a0a1bade8b427a282
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:54 -05:00
Anas Nashif 77ba3c3b8b kconfig: define architecture as a kconfig variable
Do not depend on environment variables and use a kconfig variable
for defining the architecture.

In addition, remove the X86_32 variable, it just duplicates X86 for
not good reason, at least until start supporting MCUs with 64bit.

Change-Id: Ia001db81ed007e6a43f34506fed9be1345b88a4b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:52 -05:00
Benjamin Walsh 826edfc16b reboot: add reboot infrastructure
Add the REBOOT kconfig option, along with the sys_reboot() API.

This infrastructure is not enough to actually perform a reboot.
Architecture/platform code must be provided as well, in the form of a
sys_arch_reboot() function.

Change-Id: I5b2b15855ff06453f2764f3e3b3b7d6a4a078723
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:24:43 -05:00
Benjamin Walsh 760f191b1e debug: add safe memory access routines
Introduces the following routines to provide safe access to memory:
   _mem_probe()
   _mem_safe_read()
   _mem_safe_write()
   _mem_safe_write_to_text_section()
Those routines will return an error if the memory is not accessible rather
than potentially crash.

This implementation is based on the image's boundaries; thus it allows
read/write access to the data/bss/init sections and read access only to
the text/rodata sections.  All other memory is considered invalid, even
if addressable. This includes the leftover from the RAM at the end of
the image, since there is no support for using it (e.g. there is no
dynamic allocator).

Change-Id: I6093688ecfd9b00d61be0fd453ada7bb8915c897
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:24:42 -05:00
Allan Stephens 1e03a8efc9 printk: Standardize support for %%
Tweaks printk() internals to avoid unnecessary special case handling
of %% formatting.

Change-Id: I816b04b458f416a45fd06b5a7b3bebf27453c722
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:24:36 -05:00
Allan Stephens a1d47ba539 printk: Add support for %c
printk() now supports format strings containing %c.

Change-Id: I3de290db59cb1ae5a65a928842e7a74bbf8ecce8
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:24:36 -05:00
Yonattan Louise 815513a11d OS Awareness: Add debug object trace configuration.
Add the Kconfig option for enabling the debug object tracing.

Change-Id: I56bf48568905604f6f50a06db2c5eaf4d91ded1d
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:24:32 -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
Anas Nashif 1dc809b23b kconfig: use zephyr as the binary name globally
do not use microkernel or nanokernel as the output binaries,
instead, use zephyr globally.

Also change the documentation to reflect this.

Change-Id: I8405761d1a0392c90cdfeec5c67d72eb4e5a76ff
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:22 -05:00
Anas Nashif ee743c7d42 build: allow usage of a custom linker script
This change will allow the use of a custom linker script by
setting the config variable CUSTOM_LINKER_SCRIPT to a path outside
of Zephyr tree.

This is useful when an application needs to add sections into the
linker script and avoid having to change the script provided by
Zephyr.

Change-Id: Ibe31abcc8c0227e734f59bc26d3c8d5619951b29
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:22 -05:00
Dirk Brandewie 9af81cc280 kernel: kconfig: remove boot options menu
Change BOOTLOADER_UNKNOWN to be a top level option the depends on
X86_32.

Change-Id: I1a92324038b53234730cc7324f43413f8ac18827
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:20 -05:00
Dirk Brandewie f37a4fcd71 kernel: kconfig: remove dependencies on EXPERIMENTAL
Remove the hard dependencies on EXPERIMENTAL symbol. Mark all the
symbols the relied on EXPERIMENTAL as EXPERIMENTAL in their prompt

Change-Id: I2779b0ed0776b3d510a8e2e44b35b83d7ad2377c
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:20 -05:00
Dirk Brandewie c55c858ffc x86: remove obsolete option PROT_MODE_SWITCH
Zephyr requires that the processor be in 32 bit protected mode on
entry.

Change-Id: I71792eeb154281881e8516a7a8a2291a52f83fc6
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:20 -05:00
Dirk Brandewie c033a6d609 misc/kconfig: remove references to non-existant features
Cleanup help text to remove references to non-existant features

Change-Id: I360cdf3de4d6132f1ffdde627004b730b3392299
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:20 -05:00
Dirk Brandewie 3012166000 x86: remove legacy BOOT_A20_ENABLE option
BOOT_A20_ENABLE relies on the kernel being on a system that has a full
PC BIOS and requires that the A20 line be enabled to boot
correctly. None of the supported platforms satisfy either requirment.

Change-Id: I05805a050f5531de0348b60a4f0cb974e464b279
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:20 -05:00
Andrew Boie 858decd162 misc: don't depend on serial drivers for printk()/printf()
We are introducing other kinds of drivers which support a console
that isn't over a UART.

Change-Id: I0dddbdce958437b5709c5ab26252ed47d030413d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:17 -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 f3f7eac765 Add MINIMAL_LIBC_EXTENDED to limit libc builds
This option adds optional libc functions that are not directly
used by the kernel but can be used for testing purposes.

This option is experimental.

Change-Id: Ia4dba718359c4f381047a5b52ebddb26d87ea75a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:16:15 -05:00
Constanza Heath 7d0e1d9218 Add initial import of TinyCrypt crypto library and tests
Change-Id: I89b8db6925385dd02e95e0401bc42f32543e0daf
Signed-off-by: Constanza Heath <constanza.m.heath@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:36 -05:00
Anas Nashif a2c88abf63 Add dropped GDB_INFO option
This option is being referenced all over the code but is not
being defined in Kconfig.

Change-Id: I181668ce7a35819804b8e6261f6cf27088843377
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:36 -05:00
Tomasz Bursztyka f55392770e misc: Add an option to enable early console
Unset by default. When set, this options will enable early printk
through the console. Such option is only meant to be used for debugging
purposes.

Change-Id: I6690f94b0922826bd2666ef0488dcabe2f131531
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:15:36 -05:00
Anas Nashif 5c0bf859c3 Kconfig: reorganise misc/Kconfig
Put relevant items under the same menu and move compile options
out of general setup and make it a top level menu.

Change-Id: I8125418e19cb6ffd08825d30c07058ec0d943ba3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:35 -05:00
Anas Nashif 59302df0f6 Kbuild: depend CONFIG_MICROKERNEL for building sysgen file
This file exists only with the micro kernel.

Change-Id: Ic175cd4af60fb533c335cae4325cfd85c47b97a7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:33 -05:00
Juan Manuel Cruz 1be6519bda build: fix build fail when NS16550 disabled.
This commit fixes a linking error when disabling all serial drivers
and enabling PRINTK or STDOUT_CONSOLE.

Change-Id: I26414aea42776364ce01e090d533470d9569206b
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:15:27 -05:00
Anas Nashif 42fbd4afd2 cleanup libc kconfig and use choice
This will allow adding more libc implementations in the future.
Also use the location of the include directory from the toolchain
settings.

Change-Id: Idae5e4ffd9b1bcb5e924da156df56e81f10c8842
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:25 -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
Andrew Boie af7d3fb116 misc: remove old printk() stub
It was never being used due to the obj-$(CONFIG_PRINTK) in the
Makefile, and the new method using a static inline function in
the printk.h header performs better since there won't be
function call overhead.

Change-Id: I7536515432e274fde2099eb04d4c1fb0e9d380ef
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:15:20 -05:00
Peter Mitsis e8839abb4a Remove Kconfig option PROT_MODE_SWITCH_PROMPT
The Kconfig option PROT_MODE_SWITCH_PROMPT was being used to conditionally
display the "Boot Sequence Options" Kconfig menu. It is simpler to include
both PROT_MODE_SWITCH and its dependent BOOT_A20_ENABLE in the parent menu.
However, doing so necessitates that the name of the parent menu be changed
from "Bootloader Options" to "Boot Options".

Change-Id: I9b9a074a0d4ec5209f5349b42178409c73875b00
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.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
Peter Mitsis 8ff6904084 Remove references to BSP from misc/ directory
Replaces references to obsolete BSP terminology with platforms.

Change-Id: Id5f7760e2d14353a19c020afd8f87d9033ddbf69
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:43 -05:00
Anas Nashif 212146d5b4 doxygen: fix comments in printk.c
Change-Id: Ia76b2ef1798999057d8b3a8f1e100e930702d179
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:39 -05:00
Anas Nashif c2762f5b5b Remove unused BOOTLOADER_GRUB
This option was remove as part of linker script cleanup
a few months ago.

Change-Id: If04d69096eb3ef682d72258be90bf710ed931e69
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:38 -05:00
Anas Nashif 72cb707f20 kconfig: Let the application decide the name of the kernel bin
This introduces a new option

	CONFIG_KERNEL_BIN_NAME

that can be used in the kernel configuration (kconfig) to set
the final binary name, for example you can set:

CONFIG_KERNEL_BIN_NAME="test_app"

in the project.conf and this will result in

test_app.{elf,bin} in outdir.

The default is still using the type of the kernel being used, i.e.

microkernel.elf or nanokernel.elf

Change-Id: Id6c437af2ce4c02cb52d4e1e41b29e64d83f9aab
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:37 -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
Anas Nashif 1362e3c162 doxygen: RETURNS: -> @return
Previous comment style used RETRURNS:, use @return to comply
with javadoc style.

Change-Id: Ib1dffd92da1d97d60063ec5309b08049828f6661
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:32 -05:00
Anas Nashif ea0d0b220c doxygen: change comment style to match javadoc
The change replaces multiple asterisks to ** at
the beginning of comments and adds a space before
the asterisks at the beginning of lines.

Change-Id: I7656bde3bf4d9a31e38941e43b580520432dabc1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:32 -05:00
Anas Nashif edb02f0274 kconfig: move bootloader options to misc/
More bootloader options moved to 1 single menu.

Change-Id: I6908de8e26b4a15617ad5aa738c9dc2a928ad6a4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:26 -05:00
Anas Nashif def4fc89c1 kconfig: move bootloader options to misc/
Repeating options per BSP should all be maintained in one
single place.

Change-Id: I45394a5230978effa8fff93ecef736ba44e382d2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:26 -05:00
Anas Nashif b3234bd349 kconfig: move printk under debugging options
The options was shown in top level menu, it is however a
debugging option and should part of debug menu.

Change-Id: Id245a45fa9fc367382ffe2f07bf21daa468ad2fe
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:26 -05:00
Anas Nashif 36b05de231 kconfig: metrics depends on experimental
The menu would appear empty in menuconfig otherwise.

Change-Id: I00bb93bb3e9b7d4dbddd9a6e142a458d163781cb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:26 -05:00
Benjamin Walsh ca51a72133 dlist: enhance library and make all functions inline
The old doubly-linked list implementation had only support for very
basic operations, i.e. add at head and remove.

The new implementation is highly enhanced, allowing these operations:

- initialize list
- check if a node is the list's head
- check if a node is the list's tail
- check if the list is empty
- get a reference to the head item in the list
- get a reference to the next item in the list
- add node to tail of list
- add node to head of list
- insert node after a node
- insert node before a node
- insert node at position based on condition
- remove a specific node from a list
- get the first node in a list

The implementation is completely inline, since the operations are rather
simple and do not warrant a function call.

Change-Id: Id85c04e67f6a88b005390172f1276daa12bcf8ce
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:14:22 -05:00
Allan Stephens a1bd59de35 Eliminate obsolete coding convention comments
Gets rid of single-line comments required by a previous set of
coding conventions. These comments provide no value to readers
and just clutter things up.

Change-Id: I2a08b12cf5026253de56979efdfc510e7e68defe
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:14 -05:00
Anas Nashif bbe84f8ae5 Use ccflags-y and asflags-y instead of EXTRA_CFLAGS
According to section 3.7 of Documentation/kbuild/makefiles.txt, using
EXTRA_CFLAGS in Makefiles is "still supported but their usage is
deprecated." However, using make EXTRA_CFLAGS="-DSOMETHING" results in
EXTRA_CFLAGS from Makefiles being overwritten, obviously breaking the
build.  This patch converts to them to the newer ccflags-y which also
fixes the problem.

Change-Id: I6309439599d4c9cc184f9ecd941bde841982ef07
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:14 -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 ab1ab563d5 Kconfig: add general options and debugging in misc/
Change-Id: Id9de9b1073ecf4d49a561e42f7b1013069c0552c

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:11 -05:00
Anas Nashif 1339edc104 remove defs.objs file
Replaced by kbuild

Change-Id: I61a21ed164b02c7770a181919b35ffafbde4f49e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:10 -05:00
Juan Manuel Cruz d15251fec5 Kbuild: Kconfig license headers.
This commit add license headers to Kconfig files.

Change-Id: I79e60263b8c7b696463ecc84b8ad411af5415117
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:10 -05:00
Juan Manuel Cruz 4ee8a8e042 Kbuild Makefile mechanism for samples and projects.
This commit adds the capability to the Kbuild system of adding
samples and projects to the build process.
This commits adds the hello_world and philosophers sample code
as an example of how to configure a project into the build
system.
The project can be hosted inside the kernel source tree or
outside the kernel source tree.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Id980e959ac6e0061f8227d5d81191a169bfc8fc3
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz e55a79d6f9 Creation of Makefiles for kernel and misc directory.
This commit creates the Makefiles that describe the object-bundles for
the kernel directory and every sub-directory below.
It also includes the misc Makefile.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I847e79a40ced0b1d8370b893cd95c15efc7e5147
2016-02-05 20:14:04 -05:00
Juan Manuel Cruz 0e301cc07f Kconfig symbols for kernel and misc directory.
This commit adds the Kconfig files that describe the CONFIG
symbols that belongs to the kernel directory and subdirectories.
It includes the misc directory Kconfig as well.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I3e653562ea5c259203a63274197e3a0e1522ecc4
2016-02-05 20:14:04 -05:00
Peter Mitsis d5d5c702c4 Remove inclusion of unused header files
This was missed from the section tag removal.

Change-Id: I986b54175706181d96d7d36533b81208ccd4479b
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
Yonattan Louise 5b5f4eb948 Fix checkpatch issue - WARNING:LINE_SPACING
Adding a line after variable declaration in order to comply with
the defined coding style.

Change-Id: Id41af88404bd37227bfd59a2d71ce08d0d6ce005
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:39 -05:00
Inaky Perez-Gonzalez 8ddf82cf70 First commit
Signed-off-by:  <inaky.perez-gonzalez@intel.com>
2015-04-10 16:44:37 -07:00