Commit graph

1347 commits

Author SHA1 Message Date
Peter Mitsis 1cbc9089ee nanokernel: [un]block tasks on nanokernel objects infrastructure
Adds the nanokernel infrastructure to permit microkernel tasks
to block/unblock on nanokernel objects. Multiple tasks may wait
on a nanokernel object's dedicated task wait queue.

It is important to note that when data is posted to the object
all the tasks on that object's dedicated task wait queue may be
woken up but the data is not immediately given to any of the tasks.
This is done to maintain consistent behavior with the nanokernel
as in a nanokernel system, fibers are given preference in both
waiting on and getting data from a nanokernel object.

Change-Id: Ia5c7f21ae59a367d9fec23dafc3a918d9e767db5
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-05-04 22:51:33 +00:00
Peter Mitsis 4ce3c0004b microkernel: [un]block tasks on nanokernel objects infrastructure
Adds the microkernel infrastructure to permit a microkernel task
to [un]block on a nanokernel object. Unlike tasks that [un]block
on microkernel objects, the work for [un]blocking tasks on nanokernel
objects will not always be done in the kernel service fiber. One of
the repercussions of this is that in many cases the microkernel task
scheduler must be explicitly invoked (by issuing a no-op kernel
service call).

Origin: Original
Change-Id: I2b145668cef142a7a4034e191116fcb344a9b8b3
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-05-04 22:51:33 +00:00
Peter Mitsis b58878bb89 kernel: Init back pointer to microkernel task
Fibers initialize this back pointer to NULL as they are (by definition)
not microkernel tasks.  Microkernel tasks initialize it to their
corresponding 'ktask_t'.

However for nanokernel systems, the back pointer is always NULL. This
is because there is only one task in a nanokernel system (the background
task) and it can not pend on a nanokernel object--it must poll.

Change-Id: I9840fecc44224bef63d09d587d703720cf33ad57
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-05-04 22:51:33 +00:00
Peter Mitsis f0948a4cbc microkernel: Add TF_NANO wait flag reason
Adds the TF_NANO wait flag reason to indicate that a task is pending
on a nanokernel object.

Change-Id: Ic20ef79398da7d9118bdf775e22b8f8a31501f7f
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-05-04 22:51:32 +00:00
Andrew Boie 68b3b6135e errno: implement _get_errno() in common code
We really should have more faith in the compiler, it generates
code to implement this exactly like the arch-specific assembly
versions, and on ARM is actually 4 bytes shorter.

FUNC_NO_FP used to disable the usual C preamble to update the
frame/stack pointers, which is how the sizes are still the same
or less. It's debatable how useful the occasional use of
FUNC_NO_FP is in practice since it hinders debugging and in a
production build frame pointers should be globally disabled, but
we can address that later.

Change-Id: I6c4b64ab3e3a9b6f91d52fa8c92e6e79a986fc77
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-04 17:04:14 +00:00
Geoff Thorpe ded3070c1c nanokernel: tighten _is_thread_essential()
Of the 3 related functions;
  _thread_essential_set()
  _thread_essential_clear()
  _is_thread_essential()

The first two are parameter-less and always operate on
"_nanokernel.current". The last one takes a 'thread' parameter but will
operate on _nanokernel.current if the parameter is NULL. All calls to
_is_thread_essential() pass NULL!

This change makes the 3 functions consistent by removing the parameter
to the 3rd function. This should also be marginally more efficient,
though consistency was the motivation. This change corrects the doc
preamble to all 3 functions.

(These functions would probably be better as inlines. Also, the choice
of when to use wrappers seems a bit arbitrary. E.g. there's nothing
for setting/testing the "FIBER" flag.)

Change-Id: Ie3589f8a28b227c6d7a3a31b664d3b3e6e9c6d17
Signed-off-by: Geoff Thorpe <geoff.thorpe@nxp.com>
2016-05-03 17:42:54 +00:00
Geoff Thorpe 8b16cac073 microkernel: use _thread_essential_set()
This wrapper exists so that the ESSENTIAL bit doesn't have to be set
explicitly in _nanokernel.current. (And a note is added to nano_init to
avoid a nasty gotcha there.)

Change-Id: I4026ac0cfeace60e36abdbccf15554759f2dbf7a
Signed-off-by: Geoff Thorpe <geoff.thorpe@nxp.com>
2016-05-03 17:42:54 +00:00
Andrew Boie 7327c9ee1f nanokernel: move C atomic operations to centralized code
These C variants of atomic operations can work on any arch,
have platforms select them if they don't have ASM equivalents.

Change-Id: I38eb03bb58beff865681ee56ef7bc0fcded1e906
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-27 21:40:19 +00:00
Andre Guedes 36c8e09a3a device: Include errno.h
The file device.c uses errno codes so it should include errno.h.

Change-Id: I93e806a9b20b2c9bcb245ac5e86fba70486c9591
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-04-26 22:49:49 +00:00
Daeseok Youn fa442b0287 microkernel: Match alignment with open parenthesis
fix alignment coding style issue

Change-Id: I29fefd994ffe772a6a52995b83ad5b0bf9a0dd2c
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
2016-04-26 11:10:37 +00:00
Jithu Joseph 592882e5f4 power_mgmt: APIs for devices to signal busy
Certain Low power SOC states (e.g. deep sleep)  will result in device
IP blocks losing state. In such a scenario it can be useful to have
a mechanism for devices (driver code) to signal the power manager /
policy that they are in the middle of a transaction.

We expect the device driver code to make a call to
device_busy_set(device *) before initiating a transaction and
device_busy_clear(device *) on completion. It is expected that device
driver developers will add this as necessary in their drivers.

Further an API is provided  for power manager application / policy to
check this. Based on this the power manager / policy can  decide
whether or not to go into a particular power state.

Change-Id: I0fedd90b98e182cd41b53c7f9e08655532822faa
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-04-23 02:14:21 +00:00
Daniel Leung dd5e90ec6c device_get_binding() returns NULL if driver_api is not set
This changes the behavior of device_get_binding() so that
it returns NULL if driver_api is not set. This provides
a way for driver to state that it has not been initialized
properly, and prevents app from using it since no reference
to the device struct will be returned.

This implements the idea specified in [1]. The idea is to
reuse an existing resource by piggy-backing onto driver_api,
thus avoiding an extra "device state" variable in the device
struct. This differs from the code specified in the mailing
list by checking driver_api for NULL first. This avoids
the unnecessary strcmp() if driver_api is NULL.

[1] https://lists.zephyrproject.org/archives/list/devel@lists.zephyrproject.org/message/MZB5PYBSRHV3NIEHJYXYQVLTPFIIHPB3/

Change-Id: I978b1a6683cd56c8a72532d6368c47e67515c82d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-12 19:30:35 +08:00
Peter Mitsis 5aaf7ab930 nano_fifo: Fix problem with nano_fifo and timeouts
Fixes a problem where the nanokernel FIFO state information could get
out of sync due to a timeout.

The nanokernel FIFO structure nano_fifo now maintains two separate
queues: one for waiting fibers and the other for posted data. This
permits the safe and independent querying of the queues as needed
when getting and/or putting data from/on the nanokernel FIFO.

Change-Id: Ifbcb5004558b06fc55cad2a955f5be20e716b392
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-04-12 01:22:42 +00:00
Dmitriy Korovkin 4fc7d0242c kernel: Make idle task sleep
Device drivers may use task_sleep() routine during the initialization.
As device driver initialization is carried by idle task, it can not
be sheduled out as any other task. Idle task goes into a wait loop
instead.

In order to invoke task_sleep() device drivers must enable
CONFIG_NANO_TIMEOUTS option.

Change-Id: Ib73a2ad1f3c0bda44c24f2417e102bfaa3a13a15
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-04-08 15:08:33 +00:00
Daniel Leung 546b8ade37 refactor common driver initialization priorities
Most of the SoC and board Kconfig use the same values for
driver initialization priorities. So refactor them, and
discard duplicate ones.

The shared IRQ init priority was changed so that the kernel
default init and device init priorities can be standardized
across all SoC/boards. Same goes for DesignWare SPI driver.

This also changes the UART_CONSOLE_PRIORITY and
IPM_CONSOLE_PRIORITY to UART_CONSOLE_INIT_PRIORITY and
IPM_CONSOLE_INIT_PRIORITY, to standardize across all drivers.

Note that this does not take away the ability to override
those values. This just provides reasonable defaults such
that there is virtually no need to override.

Change-Id: Ibbd95d802c637df06f9a2fd48763ee1e6f4ff627
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-28 15:58:29 -07: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
Ramesh Thomas 4104bbfb08 power_mgmt: Add device power management support
Added device power management hook infrastructure. Added
DEVICE_INIT_PM and SYS_INIT_PM macros that creates device
structures with the supplied device_ops structure containing
the hooks.

Added example support in gpio_dw driver.  Updated the sample
app and tested using LPS and Device Suspend Only policies.

Change-Id: I2fe347f8d8fd1041d8318e02738990deb8c5d68e
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-26 14:35:11 -04:00
Ramesh Thomas bb19e6f82f power_mgmt: Make names consistent with new RFC
Changed names of Kconfig flags, variables, functions, files and
return codes consistent with names used in the RFC. Updated
relevant comments to match the changes.

Origin: Original
Change-Id: Ie7941032d7ad7af61fc02928f74538745e7966e8
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-26 14:35:11 -04:00
Dmitriy Korovkin 661d2f3a16 microkernel: Add support for *_sleep() during initialization
Add support for task_sleep() and fiber_sleep() during the
system initialization. When CONFIG_NANO_TIMEOUTS defined,
before the k_server() starts, kernel uses nanokernel
system clock announce and task sleep functionality.

To give device drivers early sleep functionality, the system
clock has to start on SECONDARY initialization level, same
as most of the drivers.

Change-Id: Ie1d391945cd1cfb9a5dc199783c2d224eb1b0ef3
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-03-26 10:17:15 +00:00
Dmitriy Korovkin 9b2452047d kernel: Combine nano_timers and nano_timeouts
To avoid code duplication nano_timers use nano_timeout
mechanism.

Change-Id: I916bffd2b86e29ee7b7ff7bbb009cd4c844e2a44
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-03-26 09:20:10 +00:00
Anas Nashif 6b8c6403ec kconfig: move kernel options close together
have micro and nano kernel next to eachother.

JIRA: ZEP-107
Change-Id: I8d6e4354cf6a8cdf1193c641b112a078cd7ec460
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-17 13:00:20 +00:00
Juan Manuel Cruz 57cd459e71 debug: fixes issue on debug tracing for pool struct
Change-Id: I6af44e2388db76b4f6d38f634ae983a0d458871d
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-03-14 22:17:10 +00:00
Anas Nashif 207d0e799e kconfig: remove redundant EVENT_LOGGER option
KERNEL_EVENT_LOGGER selects EVENT_LOGGER which is then used to
enabling building. Skip EVENT_LOGGER and use KERNEL_EVENT_LOGGER
directly.

Change-Id: Ib9cf3a58b12bf4e78f264d8e8ac48a8104120c3b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-14 16:50:51 -04:00
Anas Nashif a033c14dd1 kconfig: add power management options into a menu
Change-Id: I8e847c7f3305b63647f01a83a002a7962056732a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-14 16:50:50 -04:00
Anas Nashif a13b04e022 kernel: fix boot banner option
Add missing option for adding time stamp to boot banner.

Change-Id: Idda61feeef4a89c1aa8bb7e81b52272babeb1efe
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-14 16:50:50 -04:00
Juan Manuel Cruz 568df1b17d debug: add debug tracing support for task initialization
Change-Id: I3d6ec2364f97b415bc27c0ce36df289e8eae9397
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-03-11 22:13:30 +00:00
Juan Manuel Cruz 787b41c8a3 debug: adds object tracing capability to microkernel timers
Microkernel timers are defined at compile time as a static list
but they are allocated dynamically in kernel execution.

The object tracing list will only list those timers that are
currently allocated at debug time. For this reason, timers
can be removed from the tracing list at any time.

A very simple double linked list was implemented to reduce the
complexity of the action to remove an item from the list from O(n)
to O(1) and simplify the remove implementation.

Change-Id: Ib7ea718b52e7c719a32b3fa4ff1d7e6b00482c28
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-03-11 22:13:15 +00:00
Juan Manuel Cruz f240bf18f7 debug: adds object tracing capability to nano stack
Change-Id: I0a13741a0b250fa587293936110291a4e6eec809
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-03-11 22:12:26 +00:00
Juan Manuel Cruz d151776e59 debug: thread monitor allow to access more thread information
The thread monitor allows to iterate over the thread context
structures for each existing thread (fiber/task) in the system.

Thread context structures do not expose thread entry information
directly. Although all the information can be scavenged from memory
stacks. Besides, accessing the information depends on the stack
implementation for each architecture.

By extending the tcs we allow a direct access to the thread
entry point and its parameters, only when thread monitor is
enabled.

It also allows a task to access its kernel task structure
through the first parameter of the thread.

This allows a debugger application to access the information directly
from the thread context structures list.

Change-Id: I0a435942b80eddffdf405016ac4056eb7aa1239c
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-03-11 22:11:39 +00:00
Anas Nashif 4f9239984f Revert "microkernel: Add support for *_sleep() during initialization"
This reverts commit 0d50329105.

This breaks sanitychecks in CI. The early_sleep kernel test case is failing
randomly.

Change-Id: I015f20699c052b4089076699fc0180945c4d3d16
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-11 22:08:44 +00:00
Juan Manuel Cruz c15259aca1 debug: expose thread monitor in object tracing header
Exposes the CONFIG_THREAD_MONITOR functionality as part of the
object tracing header.

Change-Id: I2022a580df2cf33e543b980dc9c33b9adca3d3bf
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-03-11 22:07:16 +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 6182fca156 memory_pool: Refactor code into a helper function
Moves some code from pool_alloc into a helper function,
to avoid code duplication when implementing a pool based heap.

Change-Id: I29b9bc1b8ba166a2187df5ea037aad4d4a522f69
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-03-10 23:19:59 +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
Dmitriy Korovkin 0d50329105 microkernel: Add support for *_sleep() during initialization
Add support for task_sleep() and fiber_sleep() during the
system initialization. When CONFIG_NANO_TIMEOUTS defined,
before the k_server() starts, kernel uses nanokernel
system clock announce and task sleep functionality.

To give device drivers early sleep functionality, the system
clock has to start on SECONDARY initialization level, same
as most of the drivers.

Change-Id: I5b3cf3da4c8d8398a966e901ab211f2fcee18dd6
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-03-10 18:39:33 +00:00
Yannis Damigos baddeadda1 arch: & kernel: Updated Kconfigs to remove errors in html generation
This patch updates some help sections to remove the "ERROR:
Unexpected indentation" messages during hmtl documentation
generation.

Change-Id: Idcdc17727b921b6145f9eb28d85975ceca273ce2
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-03-04 13:26:15 +00:00
Anas Nashif 29d0d234e1 device: add missing license header
Change-Id: Ice01a19373ad17a9f8080f93c066d8be31a3b115
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-02 12:56:17 +00:00
Benjamin Walsh fcfb4b6bda kernel: add fiber_wakeup()
Like for the other context-specific APIs, also provide a
context-agnostic wrapper.

Change-Id: Icf0a62f4c06aec42f0febc298edbd8bdeec63749
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-25 11:06:09 -05:00
Benjamin Walsh 7a613adc14 kernel: fix xxx_fiber_wakeup() if the timeout has expired
A call to xxx_fiber_wakeup() if the timeout had expired would put the
fiber on the fiber ready queue _again_, corrupting it, or could remove
the fiber from a nanokernel object wait queue, prematurely un-pending
it.

We now verify the fiber is indeed still on the timeout queue and also
not on a wait queue, meaning the fiber is indeed sleeping.

Change-Id: Iba454d79ab50db01632b0591fb7b589221b5110b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-25 11:06:09 -05:00
Benjamin Walsh 2aee77f8cf kernel: record when a fiber is removed from a wait queue
Until now, this was not needed since the checks for being on a wait
queue were only performed if a fiber was known to be on a timeout queue
as well. However, an upcoming fix for _fiber_wakeup() needs to verify if
a fiber is on a wait queue even if it is not timing out, because said
fix needs to check if the fiber is timing out as well.

Change-Id: If1694ceb551f2029d6a145963e81d3826956fd1d
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-25 11:06:09 -05:00
Benjamin Walsh b1903d7e48 kernel: have _nano_timeout_abort() return an error code
An upcoming fix for _fiber_wakeup() will need to know if the fiber was
dequeued from a timeout queue.

Change-Id: I09ca039098c09a997db73f4719261352f0af07c1
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-25 11:06:09 -05:00
Peter Mitsis b4313cef6f nanokernel: Add routines for waking a fiber
Adds the following routines for waking a fiber that was previously
put to sleep using fiber_sleep().
    isr_fiber_wakeup()
    fiber_fiber_wakeup()
    task_fiber_wakeup()

Change-Id: I7d78ee6997163d71b92f388a7b4c484f2e97862b
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-23 10:48:54 -05:00
Peter Mitsis cee79a7ca9 nanokernel: Change fiber_start() return type
The fiber_start() family of routines now return a nanokernel
thread id (nano_thread_id_t).  This is a pre-requisite step for
allowing fiber_sleep() operations to be cancelled.

Change-Id: I74a3885eda3252c158f4a48e90244569633469c3
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-23 10:48:54 -05:00
Peter Mitsis 06e2b4e129 nanokernel: Change fiber_delayed_start() return type
Instead of returning a 'void *', the nanokernel fiber_delayed_start()
family of routines now return a handle of type nano_thread_id_t.

Consequently, the nanokernel fiber_delayed_start_cancel() family of
routines now accept a parameter of type nano_thread_id_t instead of
'void *'.

The complete list of affected nanokernel routines is:
    fiber_delayed_start()        fiber_delayed_start_cancel()
    fiber_fiber_delayed_start()  fiber_fiber_delayed_start_cancel()
    task_fiber_delayed_start()   task_fiber_delayed_start_cancel()

Change-Id: Ibd4658df3ef07e79a81b7643a8be9ea5ffe08ba0
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-23 10:48:54 -05:00
Ramesh Thomas 3888735e0d adv_power:Advanced Power Management APIs
This is part of an ongoing development of power management
support in zephyr. This implementation builds upon an existing
hook interface and adds more enhancements. This was tested
with reference implementations on quark_d2000 and quark_se.

Change-Id: I28092b7ec90ce1f1cc661cf99ca88708910c8eb2
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-02-12 11:20:32 -08:00
Ramesh Thomas 72e248b11b adv_power:Rename PM functions according to coding convention
Renamed functions and labels used in power management code
according to coding convention.  Only doing this to relevant
functions and not touching functions that will be removed in
future patches.

The stack used during resume would be necessary so
renamed that too.

Change-Id: I2f09a349b0f0fd6520c11b4cd73f4c8e1a13f100
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-02-12 10:57:51 -08:00
Benjamin Walsh 038790a945 sys_clock/microkernel: do not announce ticks until microkernel is up
This is a prologue to reverting:

	commit 3c66686
	Author: Benjamin Walsh <benjamin.walsh@windriver.com>
	Date:   Tue Feb 9 17:34:02 2016 -0500

		sys_clock: start the microkernel ticker in the MICROKERNEL init level

to allow the devices initializing in pre-MICROKERNEL init levels to poll
the hi-res clock (sys_cycle_get_32()), which relies on the system clock
having been started.

This change allows starting the system clock in the NANOKERNEL init
level by delaying announcing the ticks until the MICROKERNEL init level.

Change-Id: I43d54bb5e2f182d4edd880da0124a0817f911943
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-11 17:10:49 -05:00
Anas Nashif 1e825f9c0f remove redundant checking for CONFIG_STACK_CANARIES
The file is already guarded with

obj-$(CONFIG_STACK_CANARIES) += compiler_stack_protect.o

So no need to check for CONFIG_STACK_CANARIES again in the file itself.

Change-Id: I09cf274679a1678f02478fca799a3f6507e77211
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-11 18:48:45 +00:00
Peter Mitsis 76357932d8 arm: Enable support for sys_thread_busy_wait()
It is now safe to enable sys_thread_busy_wait() for ARM as an earlier
patch has fixed the build system to link against the correct intrinsics
library.

Change-Id: Ib5ed036d996461b91f372b2b3e8f597a925d3292
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-11 14:13:05 +00:00
Dan Kalowsky 21a99e639d nanokernel : clean up comments
Moving comments back to the 70 character limit.  Also moving some of the
comments up to be included in the doxygen headers instead of inline.

Change-Id: I56a6015e5fd6da81e9a06701217e62e899b6aa62
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-11 01:10:15 +00:00
Juan Manuel Cruz 65ec185f79 logger: include task monitor in kernel event logger
Zephyr includes a Task Monitor feature that allows to
track events on the microkernel server scheduler.
Task monitor is integrated as a profiler point for the
Kernel Event Logger feature.

Change-Id: I7b8be5872439a333f976eada1aa3511d93b46388
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-09 13:53:41 -05:00
Juan Manuel Cruz d481b3ff4c logger: removes TASK_MONITOR_CAPACITY symbol
Task monitor is being tracked as a profiler point of the kernel
event logger. Now, the capacity to register task monitor events
is dictated by KERNEL_EVENT_LOGGER_BUFFER_SIZE symbol.

Change-Id: Ia4fe04c7d46fe41524c53447ad51af2e03ea5a15
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-09 13:03:19 -05:00
Juan Manuel Cruz a641710aea logger: removes old task monitor structures.
Kernel event logger keeps track of task monitor events.
Old structures are not needed anymore.

Change-Id: I2267bdb3c2f27ea87d8675c4ecf0646ea62761ae
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-09 13:03:19 -05:00
Peter Mitsis 61e6f4a299 sys_clock: Lock interrupts when processing announced ticks
Interrupts must be locked when processing announced ticks in
_nano_sys_clock_tick_announce().  This prevents higher priority
interrupts from interrupting the tick announcement and possibly
corrupting the timeout and/or timer queues.

Change-Id: I4e87fc5b3ad36161e0accb50b2691f975f5877e5
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:28 -05: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 dcfd4e96f4 device: remove obsolete DEVICE_DEFINE/INIT_CONFIG_DEFINE()
They have been replaced by DEVICE_INIT().

Change-Id: I06551f37593a3debb7eb221badd267bb5c7040c0
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 2858cbf829 idle: fix tasks waiting when NANO_TIMEOUTS is enabled
Fix an issue where, if a task is pending on a nano timeout, the duration
it wants to wait is not taken into account by the tickless idle code.
This could cause a system to wait forever, or to the limit of the timer
hardware (which is forever, for all intents and purposes).

This fix is to add one field in the nanokernel data structure for one
task to record the amount of ticks it will wait on a nano timeout. Only
one task has to be able to record this information, since, these waits
being looping busy waits, the task of highest priority is the only task
that can be actively waiting with a nano timeout. If a task of lower
priority was previously waiting, and a new task is now waiting, it means
that the wait of the original task has been interrupted, which will
cause said task to run the busy loop on the object again when it gets
scheduled, and the number of ticks it wants to wait has to be recomputed
and recorded again.

Change-Id: Ibcf0f288fc42d96897642cfee00ab7359716703f
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 2fe1a05b74 task monitor: remove ifdef, we check in Makefile already
Change-Id: I507c3e803a0d781e6cb84f03684d1ed0043678b8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:23 -05:00
Peter Mitsis a0e4568760 c++: Add extern "C" { } block to header files
Adds extern "C" { } blocks to header files so that they can be
safely used by C++ source files.

Change-Id: Ia4db0c36a5dac5d3de351184a297d2af0df64532
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:22 -05:00
Andrew Boie 583126adf9 microkernel: remove task_irq_free() API
This is being removed for a few reasons:

- AFAICT this is the only API in Zephyr that follows an allocate/free
model.

- There are no public APIs in the interrupt subsystem for releasing
or reconfiguring an interrupt. This code was relying on arch-specific
private APIs. If we really want to keep this capability we should
make these APIs public and consistent across arches.

- The use-case for this API is not clear, as Zephyr is not intended
for hot-pluggable peripherals. Built-in hardware tends to need its
interrupt for its entire life cycle.

- The current implementation of dynamic interrupts on x86 does not
support freeing a dynamic IRQ that was reserved with
irq_connect_dynamic(), causing this code not to work. To add this
would require reimplementing _get_dynamic_stub() to use a bitfield
or set of bitfields to track unused stubs rather than the simple
counter it uses now.

Change-Id: I7a03c134fb3498b91a1816318a88b293e26b846c
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:21 -05:00
Andrew Boie d9cfbd5a61 interrupts: new static IRQ API
The interrupt API has been redesigned:

- irq_connect() for dynamic interrupts renamed to irq_connect_dynamic().
  It will be used in situations where the new static irq_connect()
  won't work, i.e. the value of arguments can't be computed at build time
- a new API for static interrupts replaces irq_connect(). it is used
  exactly the same way as its dynamic counterpart. The old static irq
  macros will be removed
- Separate stub assembly files are no longer needed as the stubs are now
  generated inline with irq_connect()

ReST documentation updated for the changed API. Some detail about the
IDT in ROM added, and an oblique reference to the internal-only
_irq_handler_set() API removed; we don't talk about internal APIs in
the official documentation.

Change-Id: I280519993da0e0fe671eb537a876f67de33d3cd4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:17 -05:00
Peter Mitsis d63a4f7bf7 nano_timers: Simplify nano_xxx_timer_test() API family
Simplifies the nanokernel timer API so that the timeout parameter must be
specified when invoking nano_isr_timer_test(), nano_fiber_timer_test(),
nano_task_timer_test() and nano_timer_test().

This obsoletes the following APIs:
	nano_fiber_timer_wait()
	nano_task_timer_wait()
	nano_timer_wait()

Note that even the though the new API requires that the timeout parameter
be specified, there are currentl only two acceptable values:
	TICKS_NONE and TICKS_UNLIMITED

Theoretically, the current implementation would allow one to supply a
finite positive value for the timeout and the system would wait up to
that many ticks for the timer to expire. However, it is thought that
that unnecessarily complicates the nanokernel timer model and so it is
left as an unsupported option.  Should that change, then that feature
could be enabled by updating the documentation.

Change-Id: I8835c5342ab5025d6f70fdfbed54a50add7568d7
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:15 -05:00
Peter Mitsis 5c01c09f4d nano_stack: Simplify nano_xxx_stack_pop() API family
Changes the nanokernel stack API so that the timeout parameter must be
specified when invoking nano_isr_stack_pop(), nano_fiber_stack_pop(),
nano_task_stack_pop() and nano_stack_pop().

This obsoletes the following APIs:
	nano_fiber_stack_pop_wait()
	nano_task_stack_pop_wait()
	nano_stack_pop_wait()

Note that even though the new API requires that the timeout parameter
be specified, there are currently only two acceptable values:
	TICKS_NONE and TICKS_UNLIMITED
This nanokernel option does not support CONFIG_NANO_TIMEOUTS.

Change-Id: Ic7f16ee30c3534115ceffa19ef8591ecc5a79080
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:14 -05:00
Peter Mitsis f0b55aa624 nano_lifo: Simplify nano_xxx_lifo_get() API family
Changes the nanokernel LIFO API so that the timeout parameter must be
specified when invoking nano_isr_lifo_get(), nano_fiber_lifo_get(),
nano_task_lifo_get() and nano_lifo_get().

This obsoletes the following APIs:
	nano_fiber_lifo_get_wait()
	nano_fiber_lifo_get_wait_timeout()
	nano_task_lifo_get_wait()
	nano_task_lifo_get_wait_timeout()
	nano_lifo_get_wait()
	nano_lifo_get_wait_timeout()

Change-Id: Ie9f93e46da42ea33c32544c02ab1d70b893cc198
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:14 -05:00
Peter Mitsis 54b782a88b nano_sema: Simplify nano_xxx_sem_take() API family
Changes the nanokernel semaphore API so that the timeout parameter must be
specified when invoking nano_isr_sem_take(), nano_fiber_sem_take(),
nano_task_sem_take() and nano_sem_take().

This obsoletes the following APIs:
	nano_fiber_sem_take_wait()
	nano_fiber_sem_take_wait_timeout()
	nano_task_sem_take_wait()
	nano_task_sem_take_wait_timeout()
	nano_sem_take_wait()
	nano_sem_take_wait_timeout()

Change-Id: If7a4bce1bd8ec8d6410d04f3c16ff1922ff0910e
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:14 -05:00
Peter Mitsis cd6db374de nano_fifo: Simplify nano_xxx_fifo_get() API family
Changes the nanokernel FIFO API so that the timeout parameter must be
specified when invoking nano_isr_fifo_get(), nano_fiber_fifo_get(),
nano_task_fifo_get() and nano_fifo_get().

This obsoletes the following APIs:
	nano_fiber_fifo_get_wait()
	nano_fiber_fifo_get_wait_timeout()
	nano_task_fifo_get_wait()
	nano_task_fifo_get_wait_timeout()
	nano_fifo_get_wait()
	nano_fifo_get_wait_timeout()

Change-Id: Icbd2909292f1ced0bad8a70a075478536a141ef2
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:14 -05:00
Peter Mitsis a6b20d4c04 nano timeouts: Add support macros
The macros _NANO_TIMEOUT_TICK_GET() and _NANO_TIMEOUT_ADD() will be
used in later commits to help simplify the nanokernel APIs.

Change-Id: I668af85d775eab112953d064d9c91de607f60a59
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:14 -05:00
Peter Mitsis 58acef1162 kconfig: Fix INT_LATENCY_BENCHMARK description
Fixes the routine names referenced in the INT_LATENCY_BENCHMARK
kconfig option description.

Change-Id: I74c67a8f54cfc3b0ce75fc390d7ab6bd39561d6f
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:13 -05:00
Peter Mitsis 4146b346b4 x86: streamline irq_lock()/irq_unlock()
The routines _int_latency_start() and _int_latency_stop() have been
replaced by macros that evaluate to nothing when the kernel config
option INT_LATENCY_BENCHMARK is not enabled thereby giving a performance
boost to the x86 versions of irq_lock() and and irq_unlock().

Change-Id: Iabfa7bf001f5b8396e7bcf5eebd6b1aa342bac46
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:13 -05:00
Benjamin Walsh 1ffdea1eb9 idle: add infrastructure for tickless support in nanokernels
An architecture that supports tickless idle in the nanokernel can allow
selecting TICKLESS_IDLE by forcing NANOKERNEL_TICKLESS_IDLE_SUPPORTED to
be enabled.

Change-Id: I4e45b619c599913d40b7bc19902094fb361b1e3b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:13 -05:00
Dirk Brandewie ad99c3f93b kconfig: remove useless tickless idle dependency
Re-applying this patch, which was lost when moving to kbuild:

	commit 64c0f13f9380 ("kconfig: remove useless tickless idle dependency")
	Author: Benjamin Walsh <benjamin.walsh@windriver.com>
	Date:   Mon May 11 15:13:46 2015 -0400

	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: I95edcc7b927dd122b80f376c96233decdcc9afab
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:25:13 -05:00
Benjamin Walsh 38a601e578 idle: add support for nanokernel tickless idle
The architectures need to add support for it in their nano_cpu_idle()
and nano_cpu_atomic_idle() implementations, as well as in their
interrupt entry and exit code.

Change-Id: I44a241c56e624dc8e32e08db29a84489314cd7a4
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:13 -05:00
Daniel Leung 699564c69c microkernel: fix build issue when CONFIG_TASK_MONITOR=y
Note that the A->Comm is a pointer to the microkernel functions,
and thus is highly probable that the high 8-bit is occupied.
Therefore adds a new field in the monitor struct to store the pointer.

Change-Id: I7bcb34108c89a97cc38b2ac411ae4139b62786f3
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:12 -05:00
Dmitriy Korovkin e02a6fe585 init: Move SECONDARY init level to the idle task.
Move SECONDARY init level from essential pseudo-fiber
to the idle task, so the device initialization routines
may use interrupts and wait for interrupts.

Change-Id: I5afa92d8b304de5b295450f0a8a761385b7c2566
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:25:10 -05:00
Peter Mitsis 05e0c02a5d fifo: Simplify task_fifo_get() API family
Changes the FIFO API so that the timeout parameter must be specified
when invoking task_fifo_get() thereby making the following APIs obsolete:
    task_fifo_get_wait()
    task_fifo_get_wait_timeout()
    _task_fifo_get()

Change-Id: Iac626d9d6d4836033e06ffd5a2ca415ab2630b1a
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:06 -05:00
Peter Mitsis 5deb202a8c fifo: Simplify task_fifo_put() API family
Changes the FIFO API so that the timeout parameter must be specified
when invoking task_fifo_put() thereby making the following APIs obsolete:
    task_fifo_put_wait()
    task_fifo_put_wait_timeout()
    _task_fifo_put()

Change-Id: Ifbbfb7018fd9a71551ccba648fda6d2d59d589a6
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:05 -05:00
Peter Mitsis 4eae500445 mutex: Simplify task_mutex_lock() API family
Changes the mutex API so that the timeout parameter must be specified
when invoking task_mutex_lock() thereby obsoleting the following APIs:
    task_mutex_lock_wait()
    task_mutex_lock_wait_timeout()
    _task_mutex_lock()

Change-Id: I15d4bddbdc2707b3cbdab672498170da1c47b8db
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:05 -05:00
Peter Mitsis 9cc9bdcd53 mem_pool: Simplify task_mem_pool_alloc() API family
Changes the mem_pool API so that the timeout parameter must be specified
when invoking task_mem_pool_alloc() thereby obsoleting the following APIs:
	task_mem_pool_alloc_wait()
	task_mem_pool_alloc_wait_alloc()
	_task_mem_pool_alloc()

Change-Id: Ifa88f13bca98ca3c7d0e1a3b64b40a00068619e0
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:05 -05:00
Peter Mitsis e2cb5f5bdd mem_map: Simplify task_mem_map_alloc() API family
Changes the mem_map API so that the timeout parameter must be specified
when invoking task_mem_map_alloc() thereby obsoleting the following APIs:
    task_mem_map_alloc_wait()
    task_mem_map_alloc_wait_alloc()
    _task_mem_map_alloc()

Change-Id: I8905d07fa4b8c3729ca144e8f09e7ad0c7bf0f43
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:05 -05:00
Peter Mitsis f863d66dd8 semgroup: Simplify task_sem_group_take() API family
Changes the semaphore API so that the timeout parameter must be specified
when invoking task_sem_group_take() thereby obsoleting the following APIs:
	task_sem_group_take_wait()
	task_sem_group_take_wait_timeout()
	_task_sem_group_take()

Change-Id: I64e3f4c9f1e74a86b49d4a0e55b82ecee7733220
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:05 -05:00
Peter Mitsis 40eba989e2 semaphore: Simplify task_sem_take() API family
Changes the semaphore API so that the timeout parameter must be specified
when invoking task_sem_take() thereby obsoleting the following APIs:
	task_sem_take_wait()
	task_sem_take_wait_timeout()
	_task_sem_take()

Change-Id: I746d5c966a3b81ffe014333af51aa10ea8a63263
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:05 -05:00
Peter Mitsis 57c7977ecf pipes: Simplify task_pipe_get() API family
Changes the pipe API so that the timeout parameter must be specified
when invoking task_pipe_get() thereby obsoleting the following APIs:
	task_pipe_get_wait()
	task_pipe_get_wait_timeout()
	_task_pipe_get()

Change-Id: If249e57d086fef15fdc1616965f53b310ac9cf9d
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:05 -05:00
Peter Mitsis f5d90e1584 pipes: Simplify task_pipe_put() API family
Changes the pipe API so that the timeout parameter must be specified
when invoking task_pipe_put() thereby obsoletingg the following APIs:
	task_pipe_put_wait()
	task_pipe_put_wait_timeout()
	_task_pipe_put()

Change-Id: Ie5693716828e9d8681434c0d130792279ab97acc
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:05 -05:00
Peter Mitsis 18ea9a4d05 pipe, cosmetic: Put constant in comparisons on the right
Updates comparisons in the pipe code to put the constant on the
right side of the test. This improves compliance with checkpatch.

Change-Id: I8e55afd94e0532dd7a67bd83e737846279654dff
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:05 -05:00
Peter Mitsis d3e4b72da2 mailbox: Simplify task_mbox_data_block_get() API family
Changes the mailbox API so that the timeout parameter must be specified
when invoking task_mbox_data_block_get() thereby obsoleting the
following APIs:
    task_mbox_data_block_get_wait()
    task_mbox_data_block_get_wait_timeout()
    _task_mbox_data_block_get()

Change-Id: I284be505e6de792ba5483611d1299063162550e1
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:05 -05:00
Peter Mitsis a67b7070b7 events: Simplify task_event_recv() API family
Changes the event AIP so that the timeout parameter must be specified
when invoking task_event_recv() thereby making the following APIs obsolete:

	task_event_recv()
	task_event_recv_wait()
	task_event_recv_wait_timeout()
	_task_event_recv()

Change-Id: I165a8efbdedb431fee0c20e9ad1f1942c04124c0
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:05 -05:00
Peter Mitsis 1a163f53b7 task_irq: Simplify task_irq_test() API family
Changes the task IRQ API so that not only does task_irq_test() become
task_irq_wait(), but that the timeout parameter must also be specified.
Use of task_irq_wait() obsoletes the following APIs:
	task_irq_test()
	task_irq_test_wait()
	task_irq_test_wait_timeout()
	_task_irq_test()

Change-Id: Ie4d15f29941429249e9fbb258d29ec2b3ae73a93
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:05 -05:00
Peter Mitsis b4ba8087e7 mailbox: Simplify task_mbox_get() API family
Changes the mailbox API so that the timeout parameter must be specified
when invoking task_mbox_get() thereby obsoleting the following APIs:
    task_mbox_get_wait()
    task_mbox_get_wait_timeout()
    _task_mbox_get()

Change-Id: Ie028223ec342666e61d3d69750aec37dbe2b493e
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:05 -05:00
Peter Mitsis 96116cadbb mailbox: Simplify task_mbox_put() API family
Changes the mailbox API so that the timeout parameter must be specified
when invoking task_mbox_put() thereby obsoleting the following APIs:
	task_mbox_put_wait()
	task_mbox_put_wait_timeout()
	_task_mbox_put()

Change-Id: I174857bdf32fe7e59b79838185666cd557312814
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:05 -05:00
Peter Mitsis 95de74e121 mailbox, cosmetic: Put constant in comparisons on the right
Updates comparisons in the mailbox code to put the constant on the
right side of the test. This improves compliance with checkpatch.

Change-Id: If84cfbe4bbca312fabbb70d45f05675c9c15d011
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:05 -05:00
Dirk Brandewie 88ce5bc8f5 kernel: remove CONFIG_INT_LATENCY_BENCHMARK fences from code path
Add null definitions for the interrupt latency measurement API so we
can remove compile fences in C code.

Change-Id: If86eedf79afcb49002108814dd4fb864956eb667
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:25:04 -05:00
Benjamin Walsh 3181df6db4 kernel: add per-thread errno support
Saves an errno per-thread, retrieved via _get_errno(), instead of
changing the value of a global variable during context switches to avoid
a hit to the context switch performance.

Per-arch asm implementations are provided for maximum performance.

Enabled by default, but can be disabled via the CONFIG_ERRNO option.

Change-Id: I81d57a2e318c94c68eee913ae0d4ca3a3609c7a4
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:24:58 -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
Yonattan Louise c5d86e90a1 Fix logging of interrupt events.
The system crashed if an interrupt occurs before the
kernel event logger is initialized (Error seen on Galileo).
This patch adds a condition to check if the logger is ready
to operate.

Change-Id: I27d7cc31f386780725b0c47a9c92e9c064fc128a
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:24:58 -05:00
Yonattan Louise 8885d093c4 Add support for profiling sleep events in nanokernel.
This patch remove the dependency of the ADVANCE_POWER_MANAGEMENT
for profiling sleep events that was supported only for microkernel.
Allowing us to also use this feature in nanokernel-only systems.

Change-Id: I1761eb6c4d72f477b419dfca5dc152b0fb69ee27
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:24:58 -05:00
Peter Mitsis 78ed31ac01 kernel: Replace nano/task_cycle_get_32()
Replaces calls to nano_cycle_get_32() and task_cycle_get_32()
with sys_cycle_get_32() as that is the preferred API to use.

Change-Id: I0ad1c50083c4cfdd9a26c2f20ba24e065410d90d
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:55 -05:00
Peter Mitsis 92b21c7153 timer: Rename _sys_clock_cycle_get()
Renames _sys_clock_cycle_get() (provided by the timer driver)
to sys_cycle_get_32().  It is the preferred method to read the
hardware clock.

Change-Id: Ifea5213d8c04a8bf7b9114b048c5db0ccee61549
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.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
Peter Mitsis cd9893d563 microkernel: Elminate task_tick_xxx() APIs
Eliminates task_tick_xxx APIs in favor of sys_tick_xxx APIs.
	task_tick_get()    -> sys_tick_get()
	task_tick_get_32() -> sys_tick_get_32()
	task_tick_delta    -> sys_tick_delta()
	task_tick_delta_32 -> sys_tick_delta_32()

Change-Id: Ie8c2bc114a08f091997faaf68f6fc5536b2ba25d
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:54 -05:00
Peter Mitsis c40e84c57a nanokernel: Rename nano_tick_xxx APIs
Renames the following nanokernel tick APIs.
	nano_tick_get()      -> sys_tick_get()
	nano_tick_get_32()   -> sys_tick_get_32()
	nano_tick_delta()    -> sys_tick_delta()
	nano_tick_delta_32() -> sys_tick_delta_32()

Change-Id: Ie969545335d76df94b4e2d200fef86a93596f5e8
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:53 -05:00
Peter Mitsis 7afd7035a2 sys_clock: Replace microkernel _k_sys_clock_tick_count
Replaces microkernel global variable _k_sys_clock_tick_count with the
global variable _sys_clock_tick_count.  This allows both the microkernel
and the nanokernel to use the same variable to track system clock ticks
instead of using two different ones.

Change-Id: Ia4eebf022f59d130ad1882e0e550016527543a45
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:53 -05:00
Peter Mitsis 43b05eb463 sys_clock: Rename _nano_ticks
Renames nanokernel global variable _nano_ticks to _sys_clock_tick_count.

Change-Id: I857407f1f7e8d9fd2eedc1c1696851173e58d2b4
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:53 -05:00
Peter Mitsis 30bf5c05c8 sys_clock: fix _sys_idle_elapsed_ticks type
Fixes the type of global variable _sys_idle_elapsed_ticks such that
both its nanokernel and microkernel definitions are of the same
type--int32_t.

One of the repercussions of this is that code related to the routine
_nano_sys_clock_tick_announce() does not need the application of
typecasting.

Change-Id: I3d7374cd1a32aea7e4651726febde74ebe4ac8ac
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:53 -05:00
Allan Stephens 6b07c1d548 doc: Update descriptions for semaphore APIs
Standardizes appearance, corrects errors, improves readability,
and fils in gaps. Also relocates documentation for internal APIs.

Removes mention of non-existent task_sem_group_take() API from
the Kernel Primer document. The microkernel's semaphore group logic
currently allows a task to take a semaphore from a semaphore group
in a blocking manner.

Change-Id: Ib41a43775a97483a5adc552b70575ae4269aba35
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:24:53 -05:00
Benjamin Walsh 5ce563b3f1 kernel: rename _nano_fiber_schedule()
It's not really scheduling a fiber, it's making it ready. So, rename it
to _nano_fiber_ready().

Change-Id: I34bf67a8f0ea641bb2fd1c47fe8d689fef754cb8
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:24:53 -05:00
Benjamin Walsh fde6458f0b sys_clock: add option for setting timer frequency at runtime
Some timer devices, such as the HPET, read their frequencies at runtime.
All global constant values must be set at runtime in that case.

Change-Id: I408babce6deb857748a87691132d7e27e88f0bb8
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:24:53 -05:00
Benjamin Walsh cdf8123589 sys_clock: remove global variables duplication
Some global variables were duplicated, being defined in either
k_ticker.o or nano_sys_clock.o depending on the type of kernel.
nano_sys_clock.o is always generated, so move the definitions found in
that file from inside the NANOKERNEL guard and remove them from
k_ticker.c to avoid useless duplication.

Change-Id: Iea67f89cad44b29671df7fa4d573105c0bbe3102
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:24:53 -05:00
Peter Mitsis 8c658e11b1 nanokernel: Add task_sleep()
This routine allows the background task to sleep for a specified
number of ticks.

Change-Id: I2533005e3d9a564c2ca0de8333e224743cefb658
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:53 -05:00
Peter Mitsis e63ceae6b4 nanokernel: Move fiber_sleep() to nano_sleep.c
Change-Id: I5faaa44cf40a3d2d31a37e3b84cbef3c8dacff32
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:53 -05:00
Peter Mitsis 699b4ee03d nanokernel: Add generic stack routines
Adds the following generic stack routines:
	nano_stack_push()
	nano_stack_stack_pop()
	nano_stack_pop_wait()

Those routines are convenience wrappers for invoking the task, fiber and
ISR (if applicable) specific implementations.

Change-Id: I6e7bb2ca69bb2e3d5ed955654390746e76e4ab92
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:53 -05:00
Peter Mitsis 836eaee18a nanokernel: Add generic semaphore routines
Adds the following generic semaphore routines:
	nano_sem_take()
	nano_sem_take_wait()

Those routines are convenience wrappers for invoking the task, fiber and
ISR (if applicable) specific implementations.

Change-Id: I09d715d07263eb0ee526231120ba65d1e3feebce
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:53 -05:00
Peter Mitsis 16c7452f6b nanokernel: Add generic lifo routines
Adds the following generic lifo routines:
	nano_lifo_put()
	nano_lifo_get()
	nano_lifo_get_wait()
	nano_lifo_get_wait_timeout()

Those routines are convenience wrappers for invoking the task, fiber and
ISR (if applicable) specific implementations.

Change-Id: I5252e4643fe4772f1309b26c1b3e4319f5035956
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:53 -05:00
Peter Mitsis 829967786c nanokernel: Add generic fifo routine
Adds the following generic fifo routine:
	nano_fifo_get_wait_timeout()

That routine is a convenience wrapper for invoking the task or fiber
specific implementation.

Change-Id: I9bd709ea416db834e2a0c5de81257c363e7db066
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:53 -05:00
Peter Mitsis 3d2afc63c0 nanokernel: Add generic timer routines
Adds the following timer routines:
	nano_isr_timer_start()
	nano_isr_timer_stop()
	nano_isr_timer_test()
	nano_timer_start()
	nano_timer_stop()
	nano_timer_test()
	nano_timer_wait()

Change-Id: Ib93f2ef2ffaa12dea3ddb52e9f3ae758b2987300
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:53 -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
Anas Nashif 401c4da142 kconfig: do not set default for frequency
Force setting the value in the platform kconfig instead of defaulting
to 0.

Change-Id: Iceeb6346afc4217dd09d31c28898e3693b08f781
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:48 -05:00
Benjamin Walsh 15d3ca1de6 events: add __ASSERT()s in APIs to validate event IDs
Event ID are not validated anymore against the maximum event number in
the system, since they are pointers now instead of low integers.
Validation can be useful, but only do it in a debug kernel, with no
penalty to a deployment system.

Change-Id: Ifd8dc8841892f6d19bbcb0c641a655fd0cb6ddb7
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:24:48 -05:00
Allan Stephens dca7f8ccca doc: Update descriptions for memory map APIs
Standardizes appearance, corrects errors, improves readability,
and fills in gaps. Also streamlines descriptions for internal APIs
that don't require the same level of detail as public APIs.

Change-Id: Ic0f8149d14a8dab5e6df28b594c9b2e17f73e7b6
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:24:48 -05:00
Dmitriy Korovkin f1420515a7 irq: Add flags to IRQ_CONNECT_STATIC() macro and irq_connect() function
Flags allow passing IRQ triggering option for x86 architecture.
Each platform defines flags for a particular device and then
device driver uses them when registers the interrupt handler.

The change in API means that device drivers and sample
applications need to use the new API.

IRQ triggering configuration is now handled by device drivers
by using flags passed to interrupt registering API:
IRQ_CONNECT_STATIC() or irq_connect()

Change-Id: Ibc4312ea2b4032a2efc5b913c6389f780a2a11d1
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:24:44 -05:00
Yonattan Louise 16ddcfa43d Fix kernel event logger sample for nanokernel-only systems.
This commit fixes the nanokernel sample of the kernel event logger
that shows the event messages for context switch and interrupt events.

Change-Id: I4e972adb06b81f2f548bbabe8cd6577af633001c
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:24:43 -05:00
Peter Mitsis 9fce2a2209 Remove obsolete ctors section
Remove prototype support for C++ constructors, since it is not well
designed. Device drivers (or other application code) that requires an
automatic initialization capability should use the device initialization
macros instead.

Note: Support for C++ constructors may be re-introduced at a later date.
However, a number of issues need to be settled, such as when the
constructors are invoked and what context they run in. (Running them
during nanokernel initialization, as was previously done, is probably
not the right approach.)

Change-Id: If6d27ac16b485cb39d5ec34084e9d0f1991074f4
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:43 -05:00
Benjamin Walsh 55afb68e83 x86: remove NANOKERNEL guard around nano_cpu_idle()
It can be used by some subsystems even in a microkernel.

Change-Id: I07241aab94ecf67c94dce2d05f2cd774b2a6b044
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:24:43 -05:00
Allan Stephens 0c8965fd99 kernel: Specify alignment of microkernel server command stack items
The microkernel server now relies on the fact that the command packets,
events, and semaphores passed to it via its command stack are 32 bit
aligned. This change explicitly ensures this alignment, rather than
leaving it to the compiler's discretion.

Change-Id: Ied7a0a0b4cc504c924520b72ef2b207b49470448
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:24:42 -05:00
Allan Stephens 7c4b9ce1f7 kernel: Eliminate the need for command packet sets
Revises microkernel semaphore sub-system to allow ISRs and fibers
to give a semaphore without having to define a command packet set.
The microkernel server now supports a 3rd command type on its
command stack, allowing a semaphore to be given in a similar manner
to the one used for the existing "give event" command type.

Change-Id: Ibd7fb1a77949792f72acd20a9ee304d6eabd62f7
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:24:42 -05:00
Anas Nashif 6de1c20809 core: remove NO_ISRS feature
This option is not building and currently not supported, removing
it because there does not seem to be a use case for it.

Change-Id: Idb8ffedf83f43cffc68a01573c6f2d1a90fc40fb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:42 -05:00
Yonattan Louise e378747706 Rename Profiler to Event Logger.
In order to have a name according to the functionality of the feature.
This commit rename any text, function and variable related with the
Profiler name to Event logger.

Change-Id: I4f612cbc7c37965c35a64f06cc3ce5e3249d90e5
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:24:41 -05:00
Allan Stephens 16504c27c1 kernel: Revise microkernel server's recognition of command types
Revises microkernel server command stack processing to allow the
server to support more than 2 types of commands. The lowest 2 bits
of the command now indicate the command's type:

0 - process specified command packet
1 - give specified event (from ISR or fiber)
2 - give specified semaphore (from ISR or fiber)
3 - reserved for future use

Note: Support for type 2 will be provided in a future commit.

Change-Id: I9f83f92a301fb5df3dd479b5d43b187371e11ad8
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:24:41 -05:00
Dan Kalowsky 2a57d02400 checkpatch: warning - spacing
Change-Id: Ia63d6c9d8d3c1bd9c540a039263cb8507af82b1e
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:35 -05:00
Dan Kalowsky 2a63743192 cleanup: removing NOMANUAL
The \NOMANUAL tag is a remnant from days of yore and is no longer
needed or useful.  Cleaning up the code references to this.

Change-Id: I1b8cc9c9560d1dbb711f05fa63fd23386789875c
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:35 -05:00
Dan Kalowsky 72f0a1314e checkpatch: warning - unnecssary_else
Change-Id: I6cc45cfcf09448b8fc988dc56219ea7560636af4
Signed-off-by: Dan Kalowsky <daniel.kalowsky@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
Peter Mitsis 079a0affee Remove kernel configuration option CUSTOM_SECURITY
The Kconfig option CUSTOM_SECURITY is not used anywhere.

Change-Id: Ifac00cd1234ff9498c2f977054a902e0153b6b28
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:34 -05:00
Dan Kalowsky 827f6ba7dc checkpatch: warning - long_line
Change-Id: I7dd5645db1de00ab4bf2ca3c7a8bae906e8d9e54
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:33 -05:00
Dan Kalowsky 7f9080671b checkpatch: warning - suspect_code_indent
Change-Id: I7e920e6de8f4b7a726c03c05edea3cbac69eb374
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:33 -05:00
Dan Kalowsky 890cc2f1ef checkpatch: warning - line_spacing
Change-Id: I2276676142deea21cf8079449ce153f2fb887a8e
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:33 -05:00
Dan Kalowsky e8563c2f97 checkpatch: error - trailing_whitespace
Change-Id: I819d13f0d7a23e3a61dcda6a3ced18810b192158
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:33 -05:00
Dan Kalowsky 9760129627 checkpatch: error - open_brace
Change-Id: Ie655181d5ed11a71cadfa218f396f0b64992ca34
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:33 -05:00
Dan Kalowsky a92e48890c checkpatch: error - global_initialisers
Change-Id: Ib3f69be9f9273e57952a3ebceebc82d84c607c64
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:33 -05:00
Dan Kalowsky da67b29569 checkpatch: warning - block_comment_style
Change-Id: I6da43e41f9c6efee577b70513ec368ae3cce0144
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:33 -05:00
Dan Kalowsky 3a109b1f00 Adding in doxygen comment headers
Moving many of the functions from the old format of inline comments to
the newer doxygen format.

Change-Id: Ib0fe0d8627d7cd90219385a3ab627da8f9637d98
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:33 -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
Yonattan Louise abc2c9e59d OS Awareness: Add nanokernel object tracing.
Add a list for each kind of nanokernel object. And link the object
to the list on the initialization function.

Change-Id: I7a51902a8d1b306ec50d9486e55af286127fcb1a
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:24:32 -05:00
Dan Kalowsky 2e938481ce checkpatch: error - initialised_static
Change-Id: I8f51f861e2250c87c296b697ef5b6610ce644b34
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:31 -05:00
Dan Kalowsky 0182d863cd checkpatch: error - function_without_args
Change-Id: Id020ac7eafbb20352d839565256f0bf47f7fe301
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:31 -05:00
Dan Kalowsky 39063598db checkpatch: error - spacing
Change-Id: Ie6e1c43581dd4b0734625b3a4e59a4ca79619e99
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:31 -05:00
Dan Kalowsky 4518f747af checkpatch: error - trailing_whitespace
Change-Id: I9ccc8aef40de7b66e1899994e3dbc7147df61414
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:31 -05:00
Allan Stephens 83946282a9 init: Optimize device_get_binding()
Improves the efficiency of the search by doing a single pass through
all device objects, rather than searching one level at a time.
Also enhances the comments for this routine.

Change-Id: I6786f24381f03d74d8c559ccbd7aa6a37683a8b7
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:24:30 -05:00
Allan Stephens a860cb7bff init: Support fine-grained device initialization priorities
Introduces the SYS_DEFINE_DEVICE() macro, which supports 5 distinct
levels of device initialization and 100 priorities within each level.

Note: The existing init macros (e.g. nano_early_init()) have been
adapted to utilize the enhanced initialization model, but will
eventually be retired.

Change-Id: If677029d8b711a3fae9b2f32b5470cd97d19aeda
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:24:30 -05:00
Allan Stephens f330d5adfe microkernel: Don't initialize packets in a command packet set
Reworks the internal design of a command packet set so that
the command packet array is split out into a separate variable
lying in uninitialized memory. This shrinks the command packet's
data section footprint to almost nothing.

Note: A side effect of this change is that it is no longer possible
to define a command packet set as a "static" variable since the
CMD_PKT_SET_INSTANCE() macro now generates two variables.

Change-Id: I9c7ebe637edf879758589ff4a26ace1303790bf7
Signed-off-by: Allan Stephens <allan.stephens@windriver.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
Allan Stephens 6ac33f2b9f kernel: Introduce sys_thread_busy_wait() API
Provides a way for a fiber or task to busy wait for a specified
period of time. This is useful in situations where a delay needs
to be performed without switching execution to another context,
such as:

1) It would take longer to switch to another context and then switch
   back again than to simply busy wait.

2) A delay is required by the kernel's main task (i.e. the nanokernel's
   background task or the microkernel's idle task). This task is not
   allowed to voluntarily relinquish the CPU because this would leave
   the kernel with nothing to execute in its place.

Change-Id: Icbe28613014f659e9528893ae58f7b8008c18a61
Original-work-by: Jeff Blais <jeff.blais@windriver.com>
Further-adapted-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:24:28 -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
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
Dirk Brandewie feee30cc71 kernel: kconfig: remove CUSTOM_SECURTIY meta option
Change-Id: I6671760827aa1f0867be3f20a530ca50168ccc4b
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 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 65c6120902 kernel: remove obsolete config option ENHANCED_SECURITY
This option is no longer used in any configuration

Change-Id: I2f9be9f286cff3f38722ae1fe807661a1f99cdcd
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:20 -05:00
Dirk Brandewie 05135ef318 kernel: remove Security options dependency on ENHANCED_SECURITY
ENHANCED_SECURITY is being used to enable security options the
projects that require security options explicitly enable these options
the dependency is not required.

Change-Id: Iec96e32bd7a5faa78672d355aad368f48b0ee087
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:20 -05:00
Dirk Brandewie b2cd0aae54 x86: change the default for ENHANCED_SECURITY to no
Change the default for ENHANCED_SECURITY to no in preparation for the
option to be removed.

Change-Id: Ic46730b187f361226064a3e205f48433b0bebdd7
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:20 -05:00
Dirk Brandewie 4db419b6fa init: rename pure_core_init to pre_kernel_core_init
Change-Id: If61a5bdc9831c7375492446b02ecae513f054de4
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:20 -05:00
Dirk Brandewie f96f61d2f0 init: rename pure_early_init to pre_kernel_early_init
Change-Id: Id52cd7a5c1a715a5c609f88f940ec2e27341d81e
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:20 -05:00
Dirk Brandewie 4365f02391 init: rename pure_late_init to pre_kernel_late_init
Change-Id: I9561315a892933370d60fcf36c10d38078d66233
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:20 -05:00
Dirk Brandewie 58a534b929 init: add pure_core_init level
There are devices that need are part of the architecture core the need
to be initialized prior to devices that are integrated around a core
to make up a complete SOC. Namely the interrupt controller in the SOC
must be configured in order to allow the integrated IP blocks drivers
to initialize correctly.

Change-Id: I0a91e08f98516a7b7dd402ffc6494a071f1326b2
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:20 -05:00
Jesus Sanchez-Palencia bb91977835 Kconfig: Fix EXPERIMENTAL features dependency
Features displayed with "[EXPERIMENTAL]" should depend on
CONFIG_EXPERIMENTAL.

Change-Id: I0a86dff442014caa2fa4629138dbe29e69d5b853
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
2016-02-05 20:24:17 -05:00
Anas Nashif 715946b67c microkernel: do not enable workload monitor by default
Do not enable the feature by default when EXPERIMENTAL features
are enabled.

Change-Id: I0538f9f94bb47a4bc870c8974e80faf273070f91
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:17 -05:00
Anas Nashif 83acfa3efb add kernel default config fragments
The files will have the needed fragments to move a .config
file to either a nano or micro kernel .config. This will let us
get rid of the micro_*_defconfig/nano_*_defconfig in the future
and once the sanitychecks are adapted leaving us with a single
fragment file per platform and thus making it easier to maintain.

Change-Id: If23b32cc259de498816ddc8be15cdd6e0014106a
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
Benjamin Walsh 662c3773f8 pipes: remove lingering mentions of 'remote nodes'
Change-Id: I43fe6b0ba77883e2455ecb1ff78bac7d026145c0
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:36 -05:00
Benjamin Walsh 25d58d6fdb mutex: fix comments still containing the 'node' concept
Also re-indent badly indented code.

Change-Id: Ic08ce5c3b09bc0df9cc404409f871445bbb399fe
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:36 -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
Benjamin Walsh 7bfecd801b fiber: remove fiber from thread list when cancelling delayed start
When THREAD_MONITOR is enabled, not removing the fiber from the thread
list (a) would cause the list to be erroneous, and (b) would cause
corruption of the list if the fiber stack was reused to start a new
fiber (or any other usage really).

Change-Id: I622ffdbd146ec4b0e78b051d1b444fdf35efcd1e
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:36 -05:00
Benjamin Walsh 7b21b2648a nano_context: allow _thread_exit() to be called from a task
Update the documentation of _thread_exit() to reflect the fact that a
task can call it if it does so with interrupts locked. A task or another
fiber cannot preempt a fiber, so a fiber can still call _thread_exit()
without locking interrupts. If a task locks interupts first then calls
it, no fiber or other task can preempt it either.

Change-Id: If8624842fc202a0917b0499458e14f95d7f461df
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:36 -05:00
Andrew Boie 7c43992f22 profiler: use new ring buffer data structure
The profiler now uses the generic ring buffer. The dropped event
count is stored in the ring buffer's value field. The data size only
refers to the extra data attached to the message and NOT any internal
representation of metadata inside the ring buffer, the event_logger
APIs now pass this information along in dedicated parameters.

Change-Id: I1f168e6a05e8d937bf86b2a4cccecbb04b0118c6
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:15:34 -05:00
Andrew Boie f18f102feb nanokernel: add optional ring buffer data type
This patch is based on some code contributed by Dirk Brandewie.

This is a generic data structure for queuing data in a FIFO ring
buffer. Any given data enqueued is annotated with an app-specific
type identifier, and small integral value. Use of a data pointer
is optional if the necessary information can be conveyed in the
annotations. We want all the metadata to fit in a single DWORD.
The ring buffer always contains at least one free dword in the
buffer to correctly distinguish between full and empty queues.

Concurrency control is almost nonexistent; depending on usage,
apps may want to introduce the usage of semaphores and/or mutexes
to preserve the integrity of the ring buffer or provide notifications
when data is available.

Change-Id: I860262d2afc96db4476d4c695a92f7da355ab732
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:15:34 -05:00
Anas Nashif 952cd52e16 doxygen: nanokernel doxygenation
Doxegenize and cleanup headers for nanokernel
 - fibers
 - context
 - timers
 - stacks

Also minor cleanup of x86/arch.h

Change-Id: Ib65568d4ec034b69e8a6214ba4b52a7f719300bb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:34 -05:00
Anas Nashif 4c66d11d8a doxygen: microkernel irq header doxygenation
Change-Id: Ic5beaec272970aac4fbdb442729dae3c0aed5820
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:34 -05:00
Anas Nashif 9b8c50c9c3 doxygen: microkernel timer header doxygenation
Change-Id: Ic828f1e3a7fa19f5ce209d1f175255f4eb2d8681
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:34 -05:00
Anas Nashif b787b600bd doxygen: move task public api docs to header
Change-Id: Iebefc4c4fbdfe6110029cd135fcc4b8ea59d0214
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:34 -05:00
Anas Nashif 387ec49c1e doxygen: move command_packet documentation to header
Change-Id: I27631d742127d0ea04a04330c155fd2b1e196556
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:34 -05:00
Anas Nashif 43894ab272 typo: decribed -> described
Change-Id: I66f32a292329ea139b053e0d1f4a1aad954b664d

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:34 -05:00
Anas Nashif d62d1ac256 doc: document pipe API in header file
Change-Id: Ibac21c7fef5ee3a7313025aa91980cad170e5a0f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:34 -05:00
Anas Nashif 51fe506da4 doc: document memorypool API in header file
Change-Id: I308ae6f3ae5c960b8c572a32fd6bf99573270d90
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:33 -05:00
Yonattan Louise b34fe53414 Rename microkernel struct field 'MovedReq' to 'moved_req'.
Rename field 'MovedReq' of the struct:
- 'k_args_args' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: I3ed7ad0b4fed3791b79ad279ebabf7440b8edf7c
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:31 -05:00
Yonattan Louise f1a4d3af8c Rename microkernel struct field 'Extra' to 'extra'.
Rename field 'Extra' of the struct:
- 'moved_req' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: I86a0873122576486602bd18967748748f7abce12
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:31 -05:00
Yonattan Louise f8826db0c6 Rename microkernel struct field 'Setup' to 'setup'.
Rename field 'Setup' of the struct:
- 'moved_req' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: I2a3013131595b66508c7a6fb6e4b364ceb06a459
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:31 -05:00
Yonattan Louise a743cf6c08 Rename microkernel struct field 'iTotalSize' to 'total_size'.
Rename field 'iTotalSize' of the struct:
- 'moved_req' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: I2422d13699443d9744f882d566da1089943cf3db
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:31 -05:00
Yonattan Louise 4e7993961b Rename microkernel struct field 'Action' to 'action'.
Rename field 'Action' of the struct:
- 'moved_req' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: I3bf9c0c8142bab4f87d0a6e2b6ffe36fa20cb026
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:31 -05:00
Yonattan Louise 09d2e31a14 Rename microkernel struct field 'Sema' to 'sema'.
Rename field 'Sema' of the struct:
- 'moved_req_args_setup' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: I0cb8cab6f8f4dab2a93c4bcb0bee6c40dbbf72bc
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:31 -05:00
Yonattan Louise 0af44eb7c3 Rename microkernel struct field 'ContRcv' to 'continuation_receive'.
Rename field 'ContRcv' of the struct:
- 'moved_req_args_setup' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: Ic8984aa2ed7e62c2ed7a25e825e32b2c55bb7e5d
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:31 -05:00
Yonattan Louise f6b10449c9 Rename microkernel struct field 'ContSnd' to 'continuation_send'.
Rename field 'ContSnd' of the struct:
- 'moved_req_args_setup' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: I2476ad8641819431d13d99f1f55cb80efefa064d
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:31 -05:00
Yonattan Louise 97eed65926 Rename microkernel struct field 'iSize' to 'size'.
Rename field 'iSize' of the struct:
- '_pipe_xfer_ack_arg' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: I8463da22f659df7db1419195224f4fd818af1a03
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:31 -05:00
Yonattan Louise d955d9231e Rename microkernel struct field 'ID' to 'id'.
Rename field 'ID' of the struct:
- '_pipe_xfer_ack_arg' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: I090d0954547b80a58307a95433b59a6f5ed9ffe6
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:31 -05:00
Yonattan Louise d2c77a92d4 Rename microkernel struct field 'pReader' to 'reader_ptr'.
Rename field 'pReader' of the struct:
- '_pipe_xfer_ack_arg' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: Ic6f6c042bdf392c8ccbd407f57cc520fcf6f5f0e
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:31 -05:00
Yonattan Louise ad9fd3419f Rename microkernel struct field 'pWriter' to 'writer_ptr'.
Rename field 'pWriter' of the struct:
- '_pipe_xfer_ack_arg' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: Idc2530faa4c288e9679d65f66809ceff7f7d6d59
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:31 -05:00
Yonattan Louise cbaab8a933 Rename microkernel struct field 'XferType' to 'xfer_type'.
Rename field 'XferType' of the struct:
- '_pipe_xfer_ack_arg' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: Id7097fa65f54e12840b5dd78eaa8991aea8e225c
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:31 -05:00
Yonattan Louise 58cee9eab7 Rename microkernel struct field 'pPipe' to 'pipe_ptr'.
Rename field 'pPipe' of the struct:
- '_pipe_xfer_ack_arg' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: I78c7343e79f25363ba0678f0d1913e5210ac4c77
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:31 -05:00
Yonattan Louise d0e04a1883 Rename microkernel struct field 'iNbrPendXfers' to 'num_pending_xfers'.
Rename field 'iNbrPendXfers' of the struct:
- '_pipe_xfer_req_arg' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: Ie9b4743165ad27ac07e93d7bd8328aba44cf5e89
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:31 -05:00
Yonattan Louise 6aa334d333 Rename microkernel struct field 'iSizeXferred' to 'xferred_size'.
Rename field 'iSizeXferred' of the structs:
- '_pipe_xfer_req_arg' in the file kernel/microkernel/include/micro_private_types.h
- '_pipe_ack_arg' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: I29ab4b7b277453f757f5964628f331e8e1bbe674
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:31 -05:00
Yonattan Louise 9b18643103 Rename microkernel struct field 'Dummy' to 'dummy'.
Rename field 'Dummy' of the structs:
- '_pipe_req_arg' in the file kernel/microkernel/include/micro_private_types.h
- '_pipe_ack_arg' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: I79f7ccf1d0f790109b8337478bb203fd75052e5f
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:31 -05:00
Yonattan Louise 34ea4e2291 Rename microkernel struct field 'ReqType' to 'req_type'.
Rename field 'ReqType' of the structs:
- '_pipe_req_arg' in the file kernel/microkernel/include/micro_private_types.h
- '_pipe_ack_arg' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: I3dbcb122c72509d4024f14d39eac1c28531c2ebb
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:31 -05:00
Yonattan Louise 7e671a63ef Rename microkernel struct field 'Async' to 'async'.
Rename field 'Async' of the structs:
- '_pipe_req_arg' in the file kernel/microkernel/include/micro_private_types.h
- '_pipe_ack_arg' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: I44d2f72b36809b2acc1225e351bdd16bbd0322bc
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:31 -05:00
Yonattan Louise c13eb5d478 Rename microkernel struct field 'Sync' to 'sync'.
Rename field 'Sync' of the struct:
- '_pipe_req_arg' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: Ifbc99dafd21be5f63043191a510e39a02e1b5c32
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:31 -05:00
Yonattan Louise 461ff1ed53 Rename microkernel struct field 'ReqInfo' to 'req_info'.
Rename field 'ReqInfo' of the structs:
- '_pipe_req_arg' in the file kernel/microkernel/include/micro_private_types.h
- '_pipe_xfer_req_arg' in the file kernel/microkernel/include/micro_private_types.h
- '_pipe_ack_arg' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: I48c852656acc8d9306a2a0739f805bbff0d5258c
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise 3e7afe8154 Rename microkernel struct field 'iSizeTotal' to 'total_size'.
Rename field 'iSizeTotal' of the structs:
- 'sync_req' in the file kernel/microkernel/include/micro_private_types.h
- 'async_req' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: Ia1187bb5707a7c858903425d420fcec23380d308
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise e6352f7864 Rename microkernel struct field 'pData' to 'data_ptr'.
Rename field 'pData' of the structs:
- 'sync_req' in the file kernel/microkernel/include/micro_private_types.h
- '_pipe_xfer_req_arg' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: I2759569fc716e5fa6adbc60143203e75ab201e03
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise 97ea1a3c51 Rename microkernel struct field 'Params' to 'params'.
Rename field 'Params' of the struct:
- 'req_info' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: I11c36baa6f0d37f106d5ecdd236ecf216e0ac32e
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise c2b3ab57e6 Rename microkernel struct field 'Tail' to 'tail'.
Rename field 'Tail' of the struct:
- 'k_tqhd' in the file kernel/microkernel/include/micro_private_types.h
- 'List' in the file include/misc/lists.h

Change-Id: If857235ab6ec83fb058e0e2857a2828b8bfd308a
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise 9a8e20c697 Rename microkernel struct field 'Head' to 'head'.
Rename field 'Head' of the struct:
- 'k_tqhd' in the file kernel/microkernel/include/micro_private_types.h
- 'k_args' in the file kernel/microkernel/include/micro_private_types.h
- 'List' in the file include/misc/lists.h

Change-Id: Id7c2bdfc8d928ca835894acd9125c0ec96502ff0
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise 727e3d98d8 Rename struct field 'taskId' to 'task_id'.
Rename field 'taskId' of the struct:
- 'irq_obj_reg_arg' in the file kernel/microkernel/k_irq.c
- 'task_irq_info' in the file kernel/microkernel/k_irq.c

Change-Id: I9e2d1fb84e4c3a0a5c1b9b8fc1fa9073091faf66
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise 995ef816a0 Rename microkernel struct field 'cmdPkt' to 'command_packet'.
Rename field 'cmdPkt' of the struct:
- 'cmd_pkt_set' in the file Include/microkernel/command_packet.h

Change-Id: I60b58f58d44c300387722f0a9f46fc0c83f4cf69
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise 1d41758351 Rename microkernel struct field 'nPkts' to 'num_packets'.
Rename field 'nPkts' of the struct:
- 'cmd_pkt_set' in the file Include/microkernel/command_packet.h

Change-Id: I49d61060fc312d32c7840741c9295de5787d8823
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise 84b88b9ab5 Rename microkernel struct field 'Free' to 'free'.
Rename field 'Free' of the struct:
- '_k_mem_map_struct' in the file include/microkernel/base_api.h

Change-Id: I80362df263d22c786cb0c6c856069394a391e290
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise 6f90cce65e Rename microkernel struct field 'iBufferSize' to 'buffer_size'.
Rename field 'iBufferSize' of the struct:
- '_k_pipe_struct' in the file include/microkernel/base_api.h

Change-Id: I0e0078b2b521cdfb40e42b915a0b79d621edcccc
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise c7574b1a26 Rename microkernel struct field 'ReadMarkers' to 'read_markers'.
Rename field 'ReadMarkers' of the struct:
- '_k_pipe_desc' in the file include/microkernel/base_api.h

Change-Id: I05daa841f6b256079e6102c2da86488c7962a065
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise e3b5e16ba5 Rename microkernel struct field 'WriteMarkers' to 'write_markers'.
Rename field 'WriteMarkers' of the struct:
- '_k_pipe_desc' in the file include/microkernel/base_api.h

Change-Id: I586e3fbb871b254c125908f1f042ca83d7c2a3bf
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise 0c96244667 Rename microkernel struct field 'BuffState' to 'buffer_state'.
Rename field 'BuffState' of the struct:
- '_k_pipe_desc' in the file include/microkernel/base_api.h

Change-Id: I8a0c4e6d7ae3a06b7e6b27777fd7e8c4fb1513e0
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise cf8471a957 Rename microkernel struct field 'bReadWA' to 'wrap_around_read'.
Rename field 'bReadWA' of the struct:
- '_k_pipe_desc' in the file include/microkernel/base_api.h

Change-Id: I92f3b560c7cc0104afeb44b65f80fcda8d89206d
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise ccd7801c5f Rename microkernel struct field 'bWriteWA' to 'wrap_around_write'.
Rename field 'bWriteWA' of the struct:
- '_k_pipe_desc' in the file include/microkernel/base_api.h

Change-Id: I9ae1bbd0561a3cb95251a021b90c7230cfad1fd7
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise 09d7ce554e Rename microkernel struct field 'iNbrPendingWrites' to 'num_pending_writes'.
Rename field 'iNbrPendingWrites' of the struct:
- '_k_pipe_desc' in the file include/microkernel/base_api.h

Change-Id: Id2edba8217e652d2ae741819d33ced2986d4d1a8
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise a16f8e3b4b Rename microkernel struct field 'iAvailDataAWA' to 'available_data_post_wrap_around'.
Rename field 'iAvailDataAWA' of the struct:
- '_k_pipe_desc' in the file include/microkernel/base_api.h

Change-Id: I93aff3b834b4959f48eea36ea5e6764e67175400
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise eeace5aa8f Rename microkernel struct field 'iAvailDataCont' to 'available_data_count'.
Rename field 'iAvailDataCont' of the struct:
- '_k_pipe_desc' in the file include/microkernel/base_api.h

Change-Id: Id2a45f9f838fdc557bfbecbe0a492f95a34517a7
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise 9c220d0040 Rename microkernel struct field 'iNbrPendingReads' to 'num_pending_reads'.
Rename field 'iNbrPendingReads' of the struct:
- '_k_pipe_desc' in the file include/microkernel/base_api.h

Change-Id: I01b28e1286e7d6cb89efe53826807c6793b3976b
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise f16f43a6a6 Rename microkernel struct field 'iFreeSpaceAWA' to 'free_space_post_wrap_around'.
Rename field 'iFreeSpaceAWA' of the struct:
- '_k_pipe_desc' in the file include/microkernel/base_api.h

Change-Id: I8a55d3f0012cbeca4caa4d92024525ede865201f
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise 57bc635397 Rename microkernel struct field 'iFreeSpaceCont' to 'free_space_count'.
Rename field 'iFreeSpaceCont' of the struct:
- '_k_pipe_desc' in the file include/microkernel/base_api.h

Change-Id: Icc9da1162f594349799e3503eafad29d8a2e52a2
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise 51ecb6f1a9 Rename microkernel struct field 'pReadGuard' to 'read_guard'.
Rename field 'pReadGuard' of the struct:
- '_k_pipe_desc' in the file include/microkernel/base_api.h

Change-Id: I8b55d53b1ca85e828a4907d15b556f8875aa40bd
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise df2295a557 Rename microkernel struct field 'pWriteGuard' to 'write_guard'.
Rename field 'pWriteGuard' of the struct:
- '_k_pipe_desc' in the file include/microkernel/base_api.h

Change-Id: I71e615342a800a62612f47b365260fe3bc3d27fd
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise 315c040044 Rename microkernel struct field 'pRead' to 'read_ptr'.
Rename field 'pRead' of the struct:
- '_k_pipe_desc' in the file include/microkernel/base_api.h

Also rename variable instances related to this struct field.

Change-Id: I3fdc8d0c3774b29227d65e33dbd74aabef8df172
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise a9b08dbf94 Rename microkernel struct field 'pWrite' to 'write_ptr'.
Rename field 'pWrite' of the struct:
- '_k_pipe_desc' in the file include/microkernel/base_api.h

Also rename variable instances related to this struct field.

Change-Id: I6b344f5b58e8ce83505016a240e99142d0720d6e
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise 8dcda075e6 Rename microkernel struct field 'pEndOrig' to 'original_end_ptr'.
Rename field 'pEndOrig' of the struct:
- '_k_pipe_desc' in the file include/microkernel/base_api.h

Change-Id: I7a05f3e43ae7942455eb05093f7a0a66585163b6
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise 7b1ccbd5b8 Rename microkernel struct field 'pEnd' to 'end_ptr'.
Rename field 'pEnd' of the struct:
- '_k_pipe_desc' in the file include/microkernel/base_api.h

Change-Id: I858e22e7ecf77de123b93560e3b9ec99c7bb7365
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise d82ffa5194 Rename microkernel struct field 'pBegin' to 'begin_ptr'.
Rename field 'pBegin' of the struct:
- '_k_pipe_desc' in the file include/microkernel/base_api.h

Change-Id: I6567e66cc891d052b3c7faa26b23b41dba8430a5
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise a702a41e0c Rename microkernel struct field 'iBuffSize' to 'buffer_size'.
Rename field 'iBuffSize' of the struct:
- '_k_pipe_desc' in the file include/microkernel/base_api.h

Change-Id: Ife173a65051fecaaa652935b888b9b7921bd75f8
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:30 -05:00
Yonattan Louise 2b4857fb70 Rename microkernel struct field 'aMarkers' to 'markers'.
Rename field 'aMarkers' of the struct:
- '_k_pipe_marker_list' in the file include/microkernel/base_api.h

Change-Id: I47477bed8cb417c10e34ea412e3823db461df694
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 1a9f2b2942 Rename microkernel struct field 'iAWAMarker' to 'post_wrap_around_marker'.
Rename field 'iAWAMarker' of the struct:
- '_k_pipe_marker_list' in the file include/microkernel/base_api.h

Change-Id: I90936fb6744812462ddb56959a106bae80285a21
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 5275e011ff Rename microkernel struct field 'iLastMarker' to 'last_marker'.
Rename field 'iLastMarker' of the struct:
- '_k_pipe_marker_list' in the file include/microkernel/base_api.h

Change-Id: Id1db9432b6ddeaa46877f395e46bd81d17c05d19
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise e4daa37572 Rename microkernel struct field 'iFirstMarker' to 'first_marker'.
Rename field 'iFirstMarker' of the struct:
- '_k_pipe_marker_list' in the file include/microkernel/base_api.h

Change-Id: Ia25fcbf11ad4d842c19e495e345daff53f42a7a7
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 9f212f8cf4 Rename microkernel struct field 'iNbrMarkers' to 'num_markers'.
Rename field 'iNbrMarkers' of the struct:
- '_k_pipe_marker_list' in the file include/microkernel/base_api.h

Change-Id: I5634e2ac1507974f29183bc00011bc25f8d2ab0c
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 3504f49e48 Rename microkernel struct field 'Next' to 'next'.
Rename field 'Next' of the structs:
- '_k_pipe_marker' in the file include/microkernel/base_api.h
- 'Elem' in the file include/misc/lists.h

Change-Id: Id0155d61f1fc607c012d6ddc0d27cfcb6c966c47
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 322f8d12b9 Rename microkernel struct field 'Prev' to 'prev'.
Rename field 'Prev' of the structs:
- '_k_pipe_marker' in the file include/microkernel/base_api.h
- 'Elem' in the file include/misc/lists.h

Change-Id: I64da601298199cf9b1da6ae10d697e5bdfabdc32
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 1e0e132bc0 Rename microkernel struct field 'bXferBusy' to 'buffer_xfer_busy'.
Rename field 'bXferBusy' of the struct:
- '_k_pipe_marker' in the file include/microkernel/base_api.h

Also rename variable instances related to this struct field.

Change-Id: Ib945778ac62094d2d513250e307bf159d640e05c
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 28349e6114 Rename microkernel struct field 'Hmark' to 'high_watermark'.
Rename field 'Hmark' of the structs:
- '_k_fifo_struct' in the file include/microkernel/base_api.h
- '_k_mem_map_struct' in the file include/microkernel/base_api.h

Change-Id: I13be24d3c3654afd5fa1723a32024d0e139a1e80
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 32aecd2818 Rename microkernel struct field 'Nused' to 'num_used'.
Rename field 'Nused' of the structs:
- '_k_fifo_struct' in the file include/microkernel/base_api.h
- '_k_mem_map_struct' in the file include/microkernel/base_api.h

Change-Id: I698b64366fcb5ead77edfd067ddb96d16f1f179b
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 65045271d8 Rename microkernel struct field 'Deqp' to 'dequeue_point'.
Rename field 'Deqp' of the struct:
- '_k_fifo_struct' in the file include/microkernel/base_api.h

Change-Id: I844b8f3f6d0f1f337856d3e1805f4d6cb1d29042
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 474a6a36af Rename microkernel struct field 'Enqp' to 'enqueue_point'.
Rename field 'Enqp' of the struct:
- '_k_fifo_struct' in the file include/microkernel/base_api.h

Change-Id: I182a8be82088b808f8ccedcf76deec249cd4d2c0
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 48b22f169d Rename microkernel struct field 'Endp' to 'end_point'.
Rename field 'Endp' of the struct:
- '_k_fifo_struct' in the file include/microkernel/base_api.h

Change-Id: I83c351cb8a0e33c8a0e49adb63307c2cd71f5395
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 5e9b9214d9 Rename microkernel struct field 'Base' to 'base'.
Rename field 'Base' of the structs:
- '_k_fifo_struct' in the file include/microkernel/base_api.h
- '_k_mem_map_struct' in the file include/microkernel/base_api.h

Change-Id: Id21c01e26c8cad7b6b5ba350b6c9f5d5b78acaae
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 82136f8c0b Rename microkernel struct field 'Esize' to 'element_size'.
Rename field 'Esize' of the structs:
- '_k_fifo_struct' in the file include/microkernel/base_api.h
- '_k_mem_map_struct' in the file include/microkernel/base_api.h

Change-Id: If9a6636cb9dc637e62e8dd5335923ad5067cde5a
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 612baae6ed Rename microkernel struct field 'Confl' to 'num_conflicts'.
Rename field 'Confl' of the struct:
- '_k_mbox_struct' in the file include/microkernel/base_api.h

Change-Id: Ibfcfc933492af947950baf2b89ac25ea6671b749
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 8c7a2db328 Rename microkernel struct field 'Count' to 'count'.
Rename field 'Count' of the structs:
- '_k_mbox_struct' in the file include/microkernel/base_api.h
- '_k_mutex_struct' in the file include/microkernel/base_api.h
- '_k_sem_struct' in the file include/microkernel/base_api.h
- '_k_fifo_struct' in the file include/microkernel/base_api.h
- '_k_pipe_struct' in the file include/microkernel/base_api.h
- '_k_mem_map_struct' in the file include/microkernel/base_api.h
- 'pool_block' in the file kernel/microkernel/include/micro_private_types.h
- 'evstr' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: I85c0c36f89f8189dedb242189ceb1decd8bffcfb
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 1de74fb559 Rename microkernel struct field 'Waiters' to 'waiters'.
Rename field 'Waiters' of the structs:
- '_k_mutex_struct' in the file include/microkernel/base_api.h
- '_k_sem_struct' in the file include/microkernel/base_api.h
- '_k_fifo_struct' in the file include/microkernel/base_api.h
- '_k_mem_map_struct' in the file include/microkernel/base_api.h

Change-Id: I32db6d6213d8a3677c361f7542fdfd5444030c8a
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 375939d1cd Rename microkernel struct field 'Level' to 'level'.
Rename field 'Level' of the struct:
- '_k_mutex_struct' in the file include/microkernel/base_api.h
- '_k_sem_struct' in the file include/microkernel/base_api.h

Change-Id: Iec966b3973db05d37a32b24a2bc546a36bc27b3c
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 92de544c28 Rename microkernel struct field 'OwnerOriginalPrio' to 'original_owner_priority'.
Rename field 'OwnerOriginalPrio' of the struct:
- '_k_mutex_struct' in the file include/microkernel/base_api.h

Change-Id: I7c9f8c9626567dba19a7e1ef593744d50c7f62c4
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise f51a979ef4 Rename microkernel struct field 'OwnerCurrentPrio' to 'current_owner_priority'.
Rename field 'OwnerCurrentPrio' of the struct:
- '_k_mutex_struct' in the file include/microkernel/base_api.h

Change-Id: I31066ea24872a0de8ae7a01ed13b0b85c61637ac
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 4484a85683 Rename microkernel struct field 'Owner' to 'owner'.
Rename field 'Owner' of the struct:
- '_k_mutex_struct' in the file include/microkernel/base_api.h

Change-Id: I05ac935b7ee8d87fd6cbbafc2cab2386305b455c
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise cd8d5f445e Rename microkernel struct field 'Readers' to 'readers'.
Rename field 'Readers' of the struct:
- '_k_mbox_struct' in the file include/microkernel/base_api.h
- '_k_pipe_struct' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: Id8b225d05658127eb4254b47dbf7eb04a9a2e2a2
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 85f442f781 Rename microkernel struct field 'Writers' to 'writers'.
Rename field 'Writers' of the struct:
- '_k_mbox_struct' in the file include/microkernel/base_api.h
- '_k_pipe_struct' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: I3921be133d137e53b9473072e585710233c4d828
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 13d583dc06 Rename microkernel struct field 'Args' to 'args'.
Rename field 'Args' of the struct:
- 'k_proc' in the file include/microkernel/base_api.h
- 'k_args' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: I5847a2f1e9c7dd34dea37857b4fadeb37ced489b
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 3d0f283cb9 Rename microkernel struct field 'fabort' to 'fn_abort'.
Rename field 'fabort' of the struct:
- 'k_proc' in the file include/microkernel/base_api.h

Also rename variable instances related to this struct field.

Change-Id: I9523a567b23c578e73c20810e33a15ba733ba238
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 71da62594c Rename microkernel struct field 'fstart' to 'fn_start'.
Rename field 'fstart' of the struct:
- 'k_proc' in the file include/microkernel/base_api.h

Also rename variable instances related to this struct field.

Change-Id: Ic9750c0bcaefd1dcedfefe94b8cdd31519ab5249
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 36d55187f2 Rename microkernel struct field 'Group' to 'group'.
Rename field 'Group' of the struct:
- 'k_proc' in the file include/microkernel/base_api.h

Change-Id: I0d83ec7e82c67a7c2c37df8bb0a5d83b2109a8ed
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 839c84666f Rename microkernel struct field 'State' to 'state'.
Rename field 'State' of the struct:
- 'k_proc' in the file include/microkernel/base_api.h

Change-Id: I545ad7fa0a9b1f100dfb9a639e6730bee5d30905
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:29 -05:00
Yonattan Louise 617501354c Rename microkernel struct field 'Ident' to 'id'.
Rename field 'Ident' of the struct:
- 'k_proc' in the file include/microkernel/base_api.h

Change-Id: Iec787e0a8aa1791c968b371017cf96211a60cef1
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:28 -05:00
Yonattan Louise de4d3b51fc Rename microkernel struct field 'Prio' to 'priority'.
Rename field 'Prio' of the structs:
- 'k_proc' in the file include/microkernel/base_api.h
- 'Elem' in the file include/misc/lists.h b/include/misc/lists.h

Change-Id: I2fd6966af29b998a3849bcabc5cfee110e76202c
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:28 -05:00
Yonattan Louise 09067bbe5b Rename microkernel struct field 'Back' to 'prev'.
Rename field 'Back' of the structs:
- 'k_proc' in the file include/microkernel/base_api.h
- 'k_timer' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: I0c7cec34ec64462f85f43f8da4e61d4a651ac14e
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:28 -05:00
Yonattan Louise a896d2f859 Rename microkernel struct field 'Forw' to 'next'.
Rename field 'Forw' of the structs:
- 'k_proc' in the file include/microkernel/base_api.h
- 'k_timer' in the file kernel/microkernel/include/micro_private_types.h
- 'k_args' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: Ie45a71943dca9cb16b53bbc345d1ea16f8d7c50b
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:28 -05:00
Yonattan Louise d4a5054a3f Rename microkernel struct field 'poolid' to 'pool_id'.
Rename field 'poolid' of the struct:
- 'kmemory_pool_t' in the file kernel/microkernel/include/micro_private_types.h

Change-Id: I96466891ed2efca8c06bd94b40d15bd478d0de33
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:28 -05:00
Yonattan Louise 5c6ef8fdb5 Profile low condition events.
Add the sleep events point for x86 and ARM arquitectures that gives
information about when the CPU went to sleep mode, when it woke up
and which interrupt causes the CPU to awake.

Change-Id: Iaa06a678eab661357d084ee1f79c4cfcf19bf85d
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:28 -05:00
Yonattan Louise d2108bf084 Profile interrupt events.
Add the interrupt profile points for x86 and ARM arquitectures. This
gives information regarding the time when interrupts occur.

Change-Id: Ic876c0e7f9e8819d53e0578416f09146f4456d3d
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:28 -05:00
Benjamin Walsh bb2ba33f10 sys_clock: move [nano|task]_cycle_get_32 to drivers
The drivers provide _sys_clock_cycle_get(): moving the public APIs to
the drivers allow them to be aliases of it.

Change-Id: Ic5975a048f2b51f94510f0c3cd5e6ab3a8907718
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:27 -05:00
Benjamin Walsh 1611816a7d sys_clock: move header of nano_cycle_get_32 to nanokernel.h
Change-Id: I9c33e46a6142f26633ba4e5812c288ef470cceaa
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:27 -05:00
Benjamin Walsh 87eeaa3249 sys_clock: rename timer_read to _sys_clock_cycle_get
Follow coding conventions.

Change-Id: I3ca5d1cf4eaacfc09d5e8c44c49be447549537c8
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:27 -05:00
Benjamin Walsh fe40133cd5 sys_clock: move API headers from k_ticker.c to ticks.h
Change-Id: Ia8d740df08d3bc5ac8857ca87272360375945c7f
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:27 -05:00
Benjamin Walsh 70540142a9 microkernel: re-institute CONFIG_OBJECT/THREAD_MONITOR
These two were dropped during the conversion to Kbuild.

NOTE: THREAD_MONITOR was originally called CONTEXT_MONITOR.

Change-Id: Id17f51ee5848a9c9aea3cd3c5aa963492efdf4a8
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:27 -05:00
Benjamin Walsh 2d12752637 sys_clock: make public some timing utilities
Make these public:

  - SECONDS(x): macro that gives the number of ticks in x seconds
  - MSEC(x): macro that gives the number of ticks in x milliseconds
  - MSEC_PER_SEC: number of milliseconds per second
  - USEC_PER_MSEC: number of microseconds per millisecond

Change-Id: Ic5dbf9349651a477b066edb0c6b6721da2b7e5bb
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:27 -05:00
Benjamin Walsh 0dcad8331b clarify use of term 'context'
The term 'context' is vague and overloaded. Its usage for 'an execution
context' is now referred as such, in both comments and some APIs' names.
When the execution context can only be a fiber or a task (i.e. not an
ISR), it is referred to as a 'thread', again in comments and everywhere
in the code.

APIs that had their names changed:

  - nano_context_id_t is now nano_thread_id_t
  - context_self_get() is now sys_thread_self_get()
  - context_type_get() is now sys_execution_context_type_get()
  - context_custom_data_set/get() are now
    sys_thread_custom_data_set/get()

The 'context' prefix namespace does not have to be reserved by the
kernel anymore.

The Context Control Structure (CCS) data structure is now the Thread
Control Structure (TCS):

  - struct ccs is now struct tcs
  - tCCS is now tTCS

Change-Id: I7526a76c5b01e7c86333078e2d2e77c9feef5364
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:27 -05:00
Benjamin Walsh eca929daee microkernel: rename K_CREF.proc to 'task'
Remove last remaining legacy naming of 'proc' from the kernel's symbols.

Change-Id: Ide4ff3d06a74c5e6178c01e62a719e81709935c2
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:27 -05:00
Benjamin Walsh 8276c32e7c microkernel: rename K_CREF.task to 'task_id'
This will allow renaming K_CREF.proc to 'task'. It also is really
representing a task ID, i.e. the value a user passes to microkernel
APIs.

Change-Id: If2dd3f1ed5ce93178acd4713ad5497e5b3e0401d
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:27 -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
Dmitriy Korovkin 1bd6c831ee Fix kernel server argument alignment
The stucture elements neet to me 32-bit aligned for ARM platform.

Change-Id: I269753cbfec5e45880833e1fc036921a0f274d23
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:15:25 -05:00
Benjamin Walsh 1bab46dca1 ffs: rename find_[first|last]_set to find_[lsb|msb]_set
The new names reflect better what the functions do: they find the first
bit set starting from the least or most significant bit, i.e. they find
the least or most significant bit set, in a 32-bit word.

Change-Id: I6f0ee4b543f6f37c2f08f7067e14e039c92a6f6a
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:25 -05:00
Benjamin Walsh c4ad73d3b6 ffs: do not use _inline versions of find_[first|last]_set
Standardize on using the find_[first|last]_set (non-inline) symbols
everywhere.

The non-inline versions provide absolutely no benefits, so they will be
removed in a subsequent commit, and the inline versions will have their
_inline suffix removed.

Change-Id: I5b3dee33ffe3878a05e1bb3c6400a8d8c1640ad4
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:25 -05:00
Benjamin Walsh 6469e578cb irq: do not use _inline versions of irq_lock/unlock
Standardize on using the irq_lock/irq_unlock (non-inline) symbols
everywhere.

The non-inline versions provide absolutely no benefits, so they will be
removed in a subsequent commit, and the inline versions will have their
_inline suffix removed.

Change-Id: Ib0b55f450447366468723e065a60adbadf7067a9
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:21 -05:00
Benjamin Walsh a73af53186 timers: prevent duration of 0 in timer_start/restart
Basically, this does not work anymore:

  task_timer_start(<timer>, 0, X, <sem>);

since it does not make much sense to have a timer with an expiry of 0
ticks. The code internally was setting the duration to be equal to the
period anyway. So, to achieve the same behaviour, do this:

  task_timer_start(<timer>, X, X, <sem>);

This has the positive side-effect of removing a small block of logic
that was handling the cases where duration was 0.

Change-Id: Ic4af4a17a129f14af4fea445bcaddabe89c27131
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:21 -05:00
Benjamin Walsh b8693ad72b timers: consolidate task_timer_start/restart()
They use the same logic and _k_server handler, so only have one
implementation of the user-facing API.

Instead of using ENDLIST, create a new internal _USE_CURRENT_SEM symbol
that reflects what the implementation is doing.

Change-Id: I5c50efd15f4e97b778b4b5efd5ec931384a8631f
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:21 -05:00
Benjamin Walsh a5a6ba8e4e microkernel: rename _k_server parameters
Reflect the fact that they are not used.

Change-Id: I6ea83cb2c7532e10988cbf4350edccb78f444328
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:21 -05:00
Benjamin Walsh aa78793e40 microkernel: rename K_swapper to _k_server
Align with the newer terminology used for microkernel internal symbols.

Change-Id: I623b383f90d9e37a49429a79774c7f7a4953bd5f
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:21 -05:00
Benjamin Walsh c1f9fd888d irq: make utility functions private
irq_handler_set, irq_priority_set and irq_disconnect have been made
private by prepending an underscore to their names:

	irq_handler_set -> irq_handler_set
	irq_priority_set -> irq_priority_set
	irq_disconnect -> irq_disconnect

The prototypes have been removed from header files when possible, and
extern statements used in C code where they were called.

_irq_priority_set() for ARM is still in the header file because
IRQ_CONFIG() relies on it.

Change-Id: I2ad585f8156ff80250f6d9eeca4a249a4477fd9d
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:21 -05:00
Benjamin Walsh a34afe9b61 events: remove checks for valid events in service handlers
Doing those checks went against the Zephyr philosophy of no error
checking unless absolutely necessary. Users should ensure themselves the
validity of their inputs to kernel APIs.

Change-Id: I21e5cd07ff9424ad61e81fd9d52ceef0c9584a8c
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:21 -05:00
Benjamin Walsh 751c765079 events: rename task_event_set_handler()
task_event_set_handler -> task_event_handler_set

Align with the "verb at the end" convention.

Change-Id: I8b72d41a20a7fdd4756f90765682e317289a241b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:21 -05:00
Benjamin Walsh 87564a4602 pipes/mailboxes: rename functions using mem blocks
task_pipe_put_async -> task_pipe_block_put

  task_mbox_put_async -> task_mbox_block_put

  task_mbox_data_get_async_block -> task_mbox_data_block_get
  task_mbox_data_get_async_block_wait -> task_mbox_data_block_get_wait
  task_mbox_data_get_async_block_wait_timeout ->
       task_mbox_data_block_get_wait_timeout

Previous names, focusing on 'async', were misleading, because:

- some of those APIs can be used synchronously as well
- other APIs can also do asynchronous transfer, and don't have 'async'
  in their names
- the key concept of these APIs is that they use memory pool blocks
  rather than raw data buffers.

Change-Id: I0c08a6cf950ab23bb4172ce25eb6f9886b037649
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:21 -05:00
Yonattan Louise 520542bef2 Add context switch profile point.
Add the context switch profile point for x86 and ARM arquitectures.

Change-Id: Ib7205059104ed47b96ba75b8cfefec3ff35f6813
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:20 -05:00
Yonattan Louise efd8e246cc Add profiler method.
Add a standardized mechanism to add profiling points to the Kernel
with a single interface for the user to collect the profiling data.

Change-Id: I4fa34ac1b42f73a73ba1fd805e755ee2fd00dff7
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:20 -05:00
Yonattan Louise 8c85c15a2f Add event logger.
Add a log event tool with a single interface for the user to
add/collect the event log data.

Change-Id: Ia4b78836748c5d7e44ba1bdd50c28434e8a55d65
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:20 -05:00
Anas Nashif 0a7ff3b461 doxygen: move nanokernel fiber comments to header
Fix documentation to link to autogenerated API entries.

Change-Id: I0355435c189bff17c4468b1f300dcffcce73e51d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:20 -05:00
Peter Mitsis c963861d47 Remove PIC code, but not PIC disabling code
Removes the non-PIC disabling PIC code as the PIC is not a supported interrupt
controller.  The PIC disabling code remains as it is needed to prevent the
generation of spurious interrupts from the PIC (see CONFIG_SHUTOFF_PIC).

Change-Id: Ic59aa17ab96f34685a5d7b5f24cab391de47edca
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:20 -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 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 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 c290ebaebd Redefine microkernel timer objects identifier type
The opaque timer object id type is now a pointer to
the associated timer structure, rather than an index
into the microkernel's array of timer structures.

This is simply to be consistent with other microkernel
objects, such as semaphore, mutex, and mailbox.

Change-Id: If803e22ae450d4ef28e81e8a5f2451b9c26c6dce
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 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 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
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
Dmitriy Korovkin 28af7ae1d1 Fix microkernel "unaligned write" exception problem on ARM
Fix the structure members alignment to avoid problems
when GCC allocates 1 byte for a member of enum type.

Change-Id: I9f28c72d2e5359216ada921d4d5ce32d55cbdd45
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:14:42 -05:00
Peter Mitsis d2857404f5 Kconfig: fix SYS_CLOCK_HW_CYCLES_PER_SEC dependencies
Fixes the SYS_CLOCK_HW_CYCLES_PER_SEC Kconfig option dependencies such that
it can be overridden by a modified platform configuration file.  This is
particularly important for the LOAPIC timer driver as
SYS_CLOCK_HW_CYCLES_PER_SEC is dependent upon the target's CPU/bus frequency.

Change-Id: I0fb49b4c540888cb1988c76e2a711a85e756f82c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:42 -05:00
Juan Manuel Cruz d51ed25f79 Doxygen: Nanokernel semaphore APIs comments to header files.
This commit moves the comments from the nano_sema.c file to the
nanokernel.h file.

Change-Id: Ia1d517da38807d096b349331da72c9c4a81fb44e
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:42 -05:00
Anas Nashif abeaeacab0 Kconfig: TICKLESS_IDLE_UNSUPPORTED is not used
Change-Id: Id6767a0d6b04eea6b76065d4792245b57fb0a657
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:41 -05:00
Rodrigo Caballero fbf9fb3963 Doxygen: Moves the nanokernel LIFO comments from the .c to the .h file.
Moves the nanokernel LIFO in-code comments to the .h file. The comments
were changed to the Javadoc Doxygen format. A comment per alias was
created based on the original comment.

Change-Id: Iacd6bf1136ceac439d05669ef51cf28b858b306b
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:14:41 -05:00
Peter Mitsis e6b8bc6477 Remove obsolete kernel references to BSP
BSP terminology is obsolete.

Change-Id: Ic23688fbaaf88e037e184c8bbfc7aaa0ba997b31
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:39 -05:00
Peter Mitsis e2e68d3b9f Update comments in ctors.c
Updates the comments in ctors.c to more accurately reflect the current
state of constructors.

Change-Id: I8bea13ac9b56b4d7c6ce793f175666506fffa446
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:39 -05:00
Javier B Perez Hernandez 65c225dae8 Doxygen: microkernel: Move event documentation from c to .h file
Move the comments from k_event.c file to event.h. Only external API information was moved.
Minor changes to adapt comments and parameters.

Change-Id: I05124fc48720105a246826c94f3f21a6e30d6043
Signed-off-by: Javier B Perez Hernandez <javier.b.perez.hernandez@linux.intel.com>
2016-02-05 20:14:39 -05:00
Juan Manuel Cruz ba56372083 Doxygen: Microkernel semaphore APIs comments to header files.
This commit moves the comments from the k_semaphore.c file to the
semaphore.h and kernel_main.h files.

Change-Id: Ica86945e738f1f61b8ed216981bce55351029645
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:38 -05:00
Yonattan Louise 2a763a155a doxygen: memory_map: update in-code documentation
Adds documentation to the header files for memory map
adopting javadoc style.

Change-Id: I25ba2b938ea7dc490af97899b4eb10d16351739a
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:14:38 -05:00
Rodrigo Caballero b7def368ba Doxygen: Move the microkernel FIFO APIs comments to the .h file.
Moves the comments from the k_fifo.c to the fifo.h file. Only the
external API information was moved. Minor edits were performed to adapt
the comments to different parameters and aliases.

Change-Id: I69d2d009f7ec6390e0a2fc9d6a346ddc0111f9f1
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:38 -05:00
Rodrigo Caballero 71f8c6578a Doxygen: Move nanokernel FIFO comments from .c to .h file.
Moves the comments of the nanokernel FIFO external APIs from nano_fifo.c
to nanokernel.h.

Change-Id: Ic31e6da8a2f7a4099adc2e847d237b5a73787a23
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:38 -05:00
Peter Mitsis dfff7463d8 pipe: Fix stray reference to ChBuff
The ChBuff structure no longer exists; it was previously changed to pipe_desc.

Change-Id: Ife72db4a186db1d3af447141fefb47f2136b544f
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:38 -05:00
Peter Mitsis 77f1fee705 pipe: Fix stray reference to K_ProcWR()
The routine K_ProcWR() no longer exists; it was previously changed to
pipe_read_write().

Change-Id: If084a45a8593cfe988ee5db0507695ec2191b409
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:38 -05:00
Peter Mitsis b037c692bb pipe: Rename CHECK_CHBUFF_POINTER() macro
Renames CHECK_CHBUFF_POINTER() macro to CHECK_BUFFER_POINTER() to remove
references to obsolete "channel" terminology.

Change-Id: I3154e7af04cc9afa8b935ddf61555c15c7d2659d
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:38 -05:00
Allan Stephens cca9dfea44 Remove references to defunct _ContextUsrEntryRtn()
This function no longer exists.

Change-Id: I8e4a41b0556e1178b96c64432147d6e1d1bfdcd0
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:37 -05:00
Allan Stephens 80b109ae98 Revise misleading 'channel' references in microkernel server code
There is no need to refer to the server's command stack as a 'channel'.

Change-Id: I5c0fd599ba25478f1c4a9e96c015746b205df469
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:37 -05:00
Allan Stephens 319a648267 Revise 'channel' comments in microkernel's pipe code
These comments now use the newer 'pipe' nomenclature.

Change-Id: Id09b58d7174d7989eaae4dabe0086ab988c7746f
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:37 -05:00
Dirk Brandewie fce979ef3e init: Change _InitHardware() to be called from init system
Change the function signature of _InitHarware() function and rename
the function to a platform specific name now that it will be called
via a function pointer and not by name.

Call the platform *_init() function at PURE_INIT time.

Change-Id: I5168dfea81f406da135d491a2b4a24e8255f418a
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:14:37 -05:00
Dirk Brandewie a88cd0fc34 init: Split pure_init into pure_init_{early,late} levels
Split the pure init level into two phases this allows for easier
migration of the nano kernel init process without resorting to naming
or link order to force the ordering of functions at pure init
time. The need for change was discovered while moving the system
timers to be initialized by the init system.  The base timer driver
(eg. HPET) must be initialised prior to the system clock being enabled
both of which need to happen before nano-kernel init.

Change-Id: I7a2994965e48a891a78268080113ac8fccceb261
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.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 27e01a060a Nanokernel timer uses new driver initialization
Update nanokernel systems to use the new driver initialization model on the
timer driver.

Change-Id: I22d8619f56052f094482d73ab34c9d610492d8c0
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
Daniel Leung 7f998a101b doxygen: mutex: update in-code documentation
() Adds documentation to the header files for mutex.
() Update whole @file documentation in the mutex source
   code to javadoc style, and adds some missing param fields.

Change-Id: Ic54d830ea3382aac94cf93e58cc9eb66e1a241b7
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:14:37 -05:00
Anas Nashif 86446dab4e doxygen: move mailbox comments to header file
Move documentation comments to header file and prep
them for doxygen.

Change-Id: I3180cba7c86af97e3b4c0fceb0e1aa523ed4d219
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:37 -05:00
Peter Mitsis e5700b46ab Rename ChRef union and its fields
Eliminates references to obsolete "channel" terminology and aligns
the names to Zephyr OS naming practices.

Change-Id: Ie4205bda5529a6f8aebfa63aa5a87eb6aef85bc9
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:37 -05:00
Peter Mitsis 9b8352f7e4 Rename pipe get/set utility parameter names
Eliminates references to obsolete "channel" terminology in parameter
names used by the following pipe get/set utitlities:
    _k_pipe_option_get()        _k_pipe_option_set()
    _k_pipe_request_type_get()  _k_pipe_request_type_set()
    _k_pipe_time_type_get()     _k_pipe_time_type_set()

Change-Id: Id6fb803d77d9d775726e67bd48d35e10e908ff61
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:36 -05:00
Peter Mitsis e2ab3249f6 Standardize on names for PIPE_REQUEST_STATUS objects
Eliminates references to obsolete "channel" terminology and improves
code quality by providing consistent variable names.

Change-Id: I8f1c8afe96913f1f97b3c16fd947cfce20f3d7a2
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:36 -05:00
Peter Mitsis 22295bc9a4 Standardize on names for _pipe_xfer_req_arg objects
Eliminates references to obsolete "channel" terminology.
    pipe_xfer_req: used with read/write xfer requests
    pipe_read_req: used with read only xfer requests
    pipe_write_req: used with write only xfer requests

Change-Id: Ia09b7d7b82a568e34adceea3683c8ebde07229a1
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:36 -05:00
Peter Mitsis e2c0574319 Remove unnecessary _pipe_xfer_req_arg pointer definitions
Simplifies routines _k_pipe_put_request() and _k_pipe_get_request() by
avoiding an unnecessary pointer assignment.

Change-Id: I5677826bbbec70124dbc951f102885e5b32aad65
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:36 -05:00
Peter Mitsis 8d37ddef02 Rename k_args_args field ChProc to pipe_xfer_req
Eliminates references to obsolete "channel" terminology and improves
code quality by providing more descriptive names.

Change-Id: Ic5f9f9b482c1769e15563c50241f578bf0d1baa1
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:36 -05:00
Peter Mitsis a9e4f6520b Standardize on names for _pipe_xfer_ack_arg type objects
Eliminates references to obsolete "channel" terminology and improves
code quality by providing more descriptive names.

Change-Id: I4135dfc98c13899ec4d2b0befb23822712c668ae
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:36 -05:00
Peter Mitsis 5f4f274f44 Standardize on names for _pipe_ack_arg type objects
Eliminates references to obsolete "channel" terminology.

Change-Id: Id47826e0c606048b65d42fde284e5ef851c2b147
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:36 -05:00
Peter Mitsis 367d9e9e3f Rename k_args_args field ChReq to pipe_req
Eliminates references to obsolete "channel" terminology.

Change-Id: I0456bfd9a43bd94f83c58dd1f47be50bf393d492
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:36 -05:00
Peter Mitsis a2b866ea74 Standardize on names for pipe_desc type objects
Eliminates references to obsolete "channel" terminology and improves
code quality by providing more descriptive names.

Change-Id: I4c921db1777975210c1ea3d4ab72107ca6d4f589
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:36 -05:00
Peter Mitsis 97580269b3 Rename CHREQ_STATUS to PIPE_REQUEST_STATUS
Eliminates references to obsolete "channel" terminology.

Change-Id: Iff071c619170e118adf83a6b9fa0261e98a2ae01
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:36 -05:00
Peter Mitsis f98898b127 Rename k_chproc structure to _pipe_xfer_req_arg
Eliminates references to obsolete "channel" terminology.

Change-Id: I0bcb7924d4c2f5ce5926baf9c09031c33806c8ac
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:36 -05:00
Peter Mitsis 91f693e4e2 Rename k_chmovedack structure to _pipe_xfer_ack_arg
Eliminates references to obsolete "channel" terminology.

Change-Id: I631349d197e618e8bff1657fd22848b70263bf4f
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:36 -05:00
Peter Mitsis 61f2b49331 Rename k_chack structure to _pipe_ack_arg
Eliminates references to obsolete "channel" terminology.

Change-Id: Id15638160869ad76afb9df352d67ffe6f6a07412
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:36 -05:00
Peter Mitsis a303bdb85b Rename k_chreq structure to _pipe_req_arg
Eliminates references to the obsolete "channel" terminology.

Change-Id: Ic5f375b36fbd234f158a11dfbfd010d3a05a844c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:36 -05:00
Peter Mitsis a376f0f70d Rename chbuff structure to pipe_desc
Not only does this rename eliminate references to the obsolete "channels", it
better identifies the purpose of the structure.

Change-Id: Ib9c730b0e57b51b562ca0b5c1f5c9aaa3bdcce70
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:36 -05:00
Peter Mitsis 7c3bc47caf Eliminate unnecessary copying of k_args_args field
Simplifies routines _task_pipe_get(), _task_pipe_put() and
_task_pipe_put_async() by avoiding unnecessary copying of
k_args_args field.

Change-Id: Ie8b77502d6e1f0e655950f47e766a5e6378d1812
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:36 -05:00
Peter Mitsis 467d5f54d0 Cosmetic: Fix whitespace issues
Fixes whitespace issues to comply with checkpatch.

Change-Id: Ic6501158e06a25d616072611e73575a1dc812dab
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:36 -05:00
Anas Nashif d89bcd300c doxygen: change comment style to match javadoc
Change-Id: I5266caff9ef2ee26c556f6e144eca020ae9169bd
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:33 -05:00
Peter Mitsis 1bafa75ef1 Rename timer_driver() to _sys_clock_driver_init()
The revised name conforms to Zephyr OS naming conventions.

Change-Id: I5bcdaf1df7da9d8ce5787a08b29ead91dd8f24ce
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:33 -05:00
Peter Mitsis 136bef3c5d timer_driver() no longer takes a parameter
Removing the parameter to timer_driver() as it is not used.

Change-Id: I09275287eeb541be0dd315056b4f2bc6cbc2573c
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
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
Peter Mitsis 235bc91746 Remove inappropriate language
Change-Id: I286ae085d71d613c724284f84133b0c097a3175a
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:32 -05:00
Peter Mitsis baec40d3a5 Rename ChxxxSetTimeType() to _k_pipe_time_type_set()
This private API now follows Zephyr OS naming conventions.

Change-Id: I59e2595764fe06ab32b7c4b9468c0f830ff44e9e
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:32 -05:00
Peter Mitsis 999e13ca07 Rename ChxxxGetTimeType() to _k_pipe_time_type_get()
This private API now follows Zephyr OS naming conventions.

Change-Id: I3cf5042acff7b299ffee4189dde1a3ef403b0d84
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:32 -05:00
Peter Mitsis 65e817b94a Inline expansion of ChReqSizeLeft()
The name of the private internal function ChReqSizeLeft() refers to the
obsolete "channels" name.  Furthermore, given both its infrequent use and
its size, it is simpler to expand it inline and get rid of the function
altogether.

Change-Id: I025d8e48e4a4c26f501ed78d63b5c80f7950fe2b
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:32 -05:00
Peter Mitsis 6660021c9c Inline expansion of ChReqSizeXferred()
The name of the private internal function ChReqSizeXferred() refers to the
obsolete "channels" name.  Furthermore, as it is merely a wrapper for getting
the value of the iSizeXferred field, it is simpler to just access the field
directly.

Change-Id: I1e56b434cc6445b52ff72b9304fd9da9b91e7050
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:32 -05:00
Peter Mitsis 1ae6c82fd6 Inline expansion of ChReqGetStatus()
The name of the private internal function ChReqGetStatus() refers to the
obsolete "channel" name.  Furthermore, as it is merely a wrapper for getting
the value of the Status field, it is simpler to just access the field
directly.

Change-Id: Ia48173606ade7b62e4b53f56d759468ced90494a
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:32 -05:00
Peter Mitsis fd36aaf561 Rename ChReqSetStatus() to _k_pipe_request_status_set()
This private API now follows Zephyr OS naming conventions.

Change-Id: Id6fa98bf5c913eebae746e3a63ab5e96fad74e46
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:32 -05:00
Peter Mitsis 4fddab9814 Rename ChxxxSetReqType() to _k_pipe_request_type_set()
This private API now follows Zephyr OS naming conventions.

Change-Id: Ice8b3be8fc91c6e467a42fa5da8e19ced5a5e779
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:32 -05:00
Peter Mitsis 49055d838f Rename ChxxxGetReqType() to _k_pipe_request_type_get()
This private API now follows Zephyr OS naming conventions.

Change-Id: If1ba71b21971285b7ae2544f63c10f0ba261ced9
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:32 -05:00
Peter Mitsis a4bc71bd64 Rename ChxxxSetChOpt() to _k_pipe_option_set()
This private API now follows Zephyr OS naming conventions.

Change-Id: I9797b7eccddc8ce45623a4d0a4ba4cef63bc5e0e
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:32 -05:00
Peter Mitsis 3b4627d008 Rename ChxxxGetChOpt() to _k_pipe_option_get()
This private API now follows Zephyr OS naming conventions.

Change-Id: I01ee78dcf604be90348384733f67766c11ad234e
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:32 -05:00
Peter Mitsis 8da6498afc Rename _UpdateChannelXferStatus() to pipe_xfer_status_update()
This private API now follows Zephyr OS naming conventions.

Change-Id: I9991671ee816bc8f5c2f509015e60b554c671489
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:32 -05:00
Peter Mitsis 3b9f81aa2a Rename ChannelCheck4Intrusion() to pipe_intrusion_check()
This private API now follows Zephyr OS naming conventions.

Change-Id: Ic92cacbcb1adf82946a5828cf60d4d98a95b9d74
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:32 -05:00
Peter Mitsis be8bc7f959 Apply static keyword to ChannelCheck4Intrusion()
The routine ChannelCheck4Intrusion() is only used in k_pipe_buffer.c.

Change-Id: Ib478b24f2c8995bb0e1c13bf4ace3cb868887762
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:32 -05:00
Peter Mitsis 1a12c1a3ab cosmetic: fix whitespace around '*'
Fixes whitespace errors flagged by checkpatch.

Change-Id: I80f6dfeadcf884064b24c46b3649dc46763a976b
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:32 -05:00
Peter Mitsis 594722c256 Rename pipe kernel service commands
Renames pipe kernel service commands so they no longer refer to channels.
	CHENQ_REQ    -> PIPE_PUT_REQUEST
	CHENQ_TMO    -> PIPE_PUT_TIMEOUT
	CHENQ_RPL    -> PIPE_PUT_REPLY
	CHENQ_ACK    -> PIPE_PUT_ACK
	CHDEQ_REQ    -> PIPE_GET_REQUEST
	CHDEQ_TMO    -> PIPE_GET_TIMEOUT
	CHDEQ_RPL    -> PIPE_GET_REPLY
	CHDEQ_ACK    -> PIPE_GET_ACK
	CH_MOVED_ACK -> PIPE_MOVEDATA_ACK

Change-Id: I28946a46199d4eaac331c552092060f04525dd3f
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:28 -05:00
Peter Mitsis 4852f41d9b Rename internal K_ChProcxxx() routines
These private APIs now follow Zephyr OS naming conventions.

Change-Id: I8c8bb9bb6377e7cc2bf08136bd5ef2587c52028d
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:28 -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 c2194ebf81 Eliminate duplicate pipe routine declarations
The pipe kernel service routines are now only declared in kernel_main.h.

Change-Id: I20848b0b72af4a2a6fd3f0bb07f0e0ae546087ae
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:28 -05:00
Peter Mitsis 110a1a812c Update k_pipe_xfer.c summary line
The summary line no longer mis-identifies the file as K_ChProc.c

Change-Id: I0be0e302cd8d91903c60706175fee955d6993ebc
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:28 -05:00
Peter Mitsis b196af97d6 Cosmetic: double space to single space
Fixes two instances where there were two spaces between words instead of one.

Change-Id: I9c50e90868532e820f85888c1b23bd7d44e7e1c1
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:28 -05:00
Peter Mitsis 9f084d7d33 Typo: acknowledgement -> acknowledgment
Changing the spelling to comply with the checkpatch tool.

Change-Id: I7f28fd73bfbc89d91e4d7caccffa2c018dcadf6d
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:28 -05:00
Dirk Brandewie ac3fdf0be1 init: Add init system calls to micro and nano kernel init
Add the call sites for the various init levels defined by the init
system.

These call sites are noops if there is no init proceedure registered
at a given init level.

pre_app_init has been renamed to app_early_init and late_initconfig to
app_late_init to better reflect the ordering and intended use of these
init levels

Change-Id: I71e38d936a97da8fe163f4b7cf0ce6725f1c903e
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:14:27 -05:00
Allan Stephens 478128cf9e Rename kernel's clock_vars.h to sys_clock.h
The revised name better reflects the fact that the file defines
macros in addition to declaring variables. In addition, most of
these APIs use the "sys_clock_" prefix, which aligns well with
the new file name.

Change-Id: Ib33517d4b19ec2455303b87200c677e87640fcbc
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:26 -05:00
Allan Stephens 22364188a4 Rename nanokernel's offsets/common.h to nano_offsets.h
Eliminates unnecessary "offsets" subdirectory, and aligns file
name with gen_offset.h which resides in the same directory.

Change-Id: I8cea3bc54b5ceae3091d4a5c77c59ab826339f75
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:26 -05:00
Allan Stephens e8f50f5717 Rename nanokernel's genOffset.h to gen_offset.h
Eliminates use of non-standard camelCase file name.

Change-Id: I809de5f72b40adfd49cbc128992de934e3ec66e3
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:26 -05:00
Allan Stephens c29d41cab7 Rename nanokernel's nanok.h to nano_private.h
The new name better reflects that this file contains all private
nanokernel APIs that are used by various kernel subsystems.

Change-Id: I4c258d582e93753eec9e575fdb5f9f2109417a0f
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:26 -05:00
Allan Stephens 96d746d3c1 Rename microkernel's minik.h to micro_private.h
The new name better reflects that this file contains all private
microkernel APIs that are used by various kernel subsystems.

Change-Id: I5e52172a9e33aa130ce55ce59e887bba5c1c175a
Signed-off-by: Allan Stephens <allan.stephens@windriver.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 63fae40f7d Eliminate nanokernel's nanometrics.c
File contents moved to the nanokernel initialization file, since
they don't warrant their own distinct source file.

Change-Id: I61329067a077c421e2889c745ea44eef78ce37cb
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:26 -05:00
Allan Stephens b22d902e44 Rename microkernel's global.c to k_init.c
This file contains microkernel initialization code, along with a few
global variables.

Change-Id: Ic4e39c844d39866b38bb6d074e7035d759e073cd
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:25 -05:00
Allan Stephens 570eabf9f8 Add k_ prefix to various microkernel source files
Adds the k_ prefix to files that don't have it. This emphasizes the
fact that the microkernel is the *real* Zephyr OS kernel, rather than
the nanokernel. Also, the k_ and _k_ prefixes are used for many private
microkernel APIs contained within these files, so using the k_ prefix
for these file names makes sense.

Change-Id: If3a5e786edc6503fa8a24f5638ece2e1df021547
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:25 -05:00
Allan Stephens e96164aa30 Rename various microkernel source files
Now spells out the name of the associated microkernel object in full.
Also renames file containing FIFO code to correspond to the associated
public include file (microkernel/fifo.h).

Change-Id: I47f7a2ca01e0feff8f499acda0000fe475e7ee5a
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:25 -05:00
Allan Stephens bba56b1c8a Rename microkernel/cmdPkt.h to command_packet.h
Now spells out the name of the associated microkernel object in full.

Change-Id: I608404a762cf9d1100d58fe80c82c0e40ada2ff1
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:25 -05:00
Allan Stephens f494cc3e9d Rename microkernel/k_types.h to base_api.h
This file defines public microkernel APIs that are utilized
by more than one of the microkernel object types. It contains
both types and symbolic constants.

Change-Id: I2bc39ffe6655e5ddeec1e55c4caee01e02526595
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:25 -05:00
Dmitriy Korovkin 660878e4e2 irq_connect for x86 uses static stub array
In order to provide the same irq_connect() on all platforms
on x86, irq_connect() now uses a static array of interrupt
stubs. Device driver does not need to provide interrupt stub
to irq_connect() function.

Add NUM_DYNAMIC_STUBS configuration parameter, the number
of interrupt stubs used for dynamic interrupt registration.

Modify tests for unified interrupt register API

Tests that deal with interrupts are modified to work
with the new interrupt registration API.

Add CONFIG_NUM_DYNAMIC_STUBS option to dynamic interrupt projects

Projects that use dynamic interrupt handler registration on x86
have to include CONFIG_NUM_DYNAMIC_STUBS parameter in the
configuration.

Change-Id: Ic90c726485521a57cf695fd3edc8cac85d0b827d
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:14:25 -05:00
Peter Mitsis 9bf659afa5 Introduce CPU_CORTEX_M3_M4 option
CPU_CORTEX_M3_M4 replaces CPU_CORTEXM3 as the umbrella option for Cortex M3/M4
processors.

NOTE: Selecting CPU_CORTEXM4 still currently forces the selection of
CPU_CORTEXM3.  Breaking that forced select will be done in a later commit.

Change-Id: I0f36b3a2adc5c6c66db4e9b6353b921199544deb
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:25 -05:00
Benjamin Walsh c6948611cb nanokernel: add CONFIG_NANO_TIMEOUTS
Allow configuring nano timeouts. They are disabled by default.

Change-Id: I9db0b632681ae149295acd3ed81fccdee2c4f91a
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:14:22 -05:00
Benjamin Walsh 924b6e563d nano timers: allow in microkernel, disabled by default
Change-Id: Id17a733196174a8a1fe3b550d6b4c08efe031948
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:14:22 -05:00
Benjamin Walsh 1ae1ca0b39 microkernel: handle nanokernel ticks
The microkernel now announces the nanokernel ticks, and takes them into
account when computing the amount of time to stay in tickless idle.

This allows code linked against a microkernel to use the nanokernel
timers and timeouts.

Change-Id: I9436347e22fe76c2c1a314589ffc041a9a1a99a4
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:14:22 -05:00
Benjamin Walsh 617f9c5b4c nanokernel: allow nano time tracking to be used in microkernels
The nanokernel time tracking code (ticker) can now exist in microkernel
systems. This allows the ticker that drives nano timers and timeouts to
advance the tick count for these in a microkernel, thus allow their
presence there. Previously, nano timers could not be used in a
microkernel.

Change-Id: I17f2b659691a081b0f9bf3961ed030533aa02a15
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:14:22 -05:00
Benjamin Walsh 101fee8dde nanokernel: add interface for obtaining earliest timer deadline
This interface can be called by the microkernel to obtain the earliest
expiring nanokernel between the timers and timeouts, to allow the idle
code to take the correct decision w.r.t. tickless idle.

Change-Id: I9598ec2a0dd013a6a8ccc95d50105bb98ca27f54
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:14:22 -05:00
Benjamin Walsh f5f09608f9 nanokernel: give nano_timer.c ownership of the nano timers list
The system clock code only references it, it should not own it.

Change-Id: I38eb61599eb66458d5a3c3c9713cf11dc14e8a63
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:14:22 -05:00
Benjamin Walsh ab6e153a21 nanokernel: add handling of nano timeouts on tick
Add the necessary call to dequeue the nano timeouts when a tick occurs
in the nanokernel.

Change-Id: I26fdfc4084d7564e232d8240eab8915076deaa31
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:14:22 -05:00
Benjamin Walsh cae5d05342 nano_sys_clock: abstract handling timers expiry
The nanokernel timers and timeouts won't be dependent on each other, so
the expiry handling code needs to be able to only contain the necessary
code depending on what is enabled in the kernel.

Change-Id: Ibb7c31e926a56ebd3e22b8eac6db05faa1c8ddd3
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:14:22 -05:00
Benjamin Walsh 87179c2e36 nanokernel: add NANO_TIMERS option
The nanokernel timers will be available in the microkernel, but can be
disabled if not needed. A kconfig option is needed for that: the option
is enabled by default, and only available in the nanokernel for now. It
will be made available in the microkernel in the future.

Change-Id: I3910affde7bd2e7b25ab0a3c655255a9be01c9b8
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:14:22 -05:00
Benjamin Walsh 72a7b520bb nano_lifo add timeouts support
Add the _timeout() variants to the _get_wait() routines. Those allow
waiting with a timeout. The return values are the same as for the
regular _get() routines: a valid pointer on success, NULL on failure.

Note that the task_ variant is still polling, and the task is not put on
a timeout queue, instead polling for the ticker change in addition to
data arriving on the LIFO.

Change-Id: Iad8fa00b3fa0656fee9a67b2dd8b316e1e8aac74
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:14:22 -05:00
Benjamin Walsh eb2e4aa913 nano_fifo add timeouts support
Add the _timeout() variants to the _get_wait() routines. Those allow
waiting with a timeout. The return values are the same as for the
regular _get() routines: a valid pointer on success, NULL on failure.

Note that the task_ variant is still polling, and the task is not put on
a timeout queue, instead polling for the ticker change in addition to
data arriving on the FIFO.

Change-Id: I6650d0de8494c15698d670442da1e9c8d8c89910
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:14:22 -05:00
Benjamin Walsh 3f671dc68c nano_sema: add timeouts support
Add the _timeout() variants to the _take_wait() routines. Those allow
waiting with a timeout. The return values are the same as for the
regular _take() routines: 1 for success, 0 for failure.

Note that the task_ variant is still polling, and the task is not put on
a timeout queue, instead polling for the ticker change in addition to a
semaphore state change.

Change-Id: Idef357f99a5ca30e20665a25abc54d253a848a52
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:14:22 -05:00
Benjamin Walsh d131bae676 nano_fiber: add fiber delayed start/cancel and sleep
This new API allows starting a fiber with a delay. It returns a handle
to allow cancelling it before the fiber starts, via the cancel API.

It also adds an API allowing a fiber to sleep for a given amount of
ticks.

NOTE: CONFIG_NANO_TIMEOUTS must be enabled.

Change-Id: I608dc47b5f08321cfd0c1dd9bb18d1d77eab87e3
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:14:22 -05:00
Benjamin Walsh 2672025969 nanokernel: add and initialize timeout fields in ccs/s_NANO
s_NANO contains the timeout queue, and each ccs needs a struct
_nano_timeout object that gets linked in the nanokernel timeout queue.

Change-Id: Iad027eaaebcffe190e95f0b9d068f047062559c2
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:14:22 -05:00
Benjamin Walsh bb660ae965 nanokernel: add timeout queue interface
The timeout queue interface will allow having fiber interacting with the
nanokernel objects wait with a timeout. It can be completely excluded
from the kernel if not needed, via the CONFIG_NANO_TIMEOUTS option.

Most of the timeout queue interface is contained within timeout_q.h.
However, this file should never be included directly: rather, the
wait_q.h file is to be included instead, which itself provides NOOP
abstractions for some timeout functions when timeouts are not enabled in
the kernel.

Change-Id: Ifeb1b934e0c71d00c59ebc88a54ab26e49686807
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:14:22 -05:00
Benjamin Walsh f9d34ff899 nanokernel: rename struct s_CCS to struct ccs
Follow coding conventions.

Change-Id: Ie398d66e6255b76b4546aa9c827997b5dfb0743c
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:14:22 -05:00
Benjamin Walsh 6b8589612f sys_clock: rename nanokernel's _do_sys_clock_tick_announce
Rename nanokernel's _do_sys_clock_tick_announce() to
_nano_sys_clock_tick_announce() so that it can be called from the
microkernel tick handling code without name ambiguity.

Change-Id: I2ec9dd92ceda51f00be1dd95bc3239d6b2e82943
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:14:21 -05:00
Allan Stephens ab80db110f Rename enlist_timeout(), delist_timeout(), and force_timeout() APIs
These private APIs now follow Zephyr OS naming conventions.

Change-Id: If9de2528d740eb4ff16a69649564592a5f047c61
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:20 -05:00
Allan Stephens d247c26b20 Rename enlist_timer() and delist_timer() private APIs
APIs now follow Zephyr OS naming conventions.

Change-Id: I554e63b989029e08a1d215c9b5a511a32a91e42c
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:20 -05:00
Allan Stephens a7e20d2b0a Rename set_state_bit() and reset_state_bit() private APIs
APIs now follow Zephyr OS naming conventions.

Change-Id: I154536d2c40784ae83a936c55cf748173343c681
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:19 -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 1860cb636d Rename workload_monitor_calibrate() to _k_workload_monitor_calibrate()
This API now uses an approved Zephyr OS prefix.

Change-Id: I3ec6d3ac3a3b7ae2edd1024a39ce73796f060fba
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:19 -05:00
Allan Stephens e4bc9ce4ab Rename workload_time_slice_set() to sys_workload_time_slice_set()
This API now uses an approved Zephyr OS prefix.

Change-Id: I79c7e82e73653315ba1a609edbf11336694b9dd4
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:19 -05:00
Allan Stephens 6c2da86281 Rename scheduler_time_slice_set() to sys_scheduler_time_slice_set()
This API now uses an approved Zephyr OS prefix.

Change-Id: I1041b982492ea7b76213e3b57cf28a9f17e7fd9d
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:19 -05:00
Allan Stephens fd117970d3 Eliminate duplicate declarations of private microkernel APIs
These declarations do not need to appear in minik.h, since it
already gets them by including kernel_main.h.

Change-Id: I35ff9cc2d371c60a08a7cf8bde289f467a259dea
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:19 -05:00
Allan Stephens 91bb39de6d Remove microkernel task routines from private API
These routines are only referenced in a single file.

Change-Id: I55d2976d1db612bdbb89224b89b84bfcc5b9d707
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:19 -05:00
Allan Stephens 99001f8518 Eliminate duplicate declarations of private microkernel timeout APIs
These 3 declarations no longer appear twice in the same include file.

Change-Id: Ia77b84c29741978bea2d74b44d66e9929d2769c4
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:19 -05:00
Allan Stephens 86e4595da5 Cosmetic changes to private microkernel APIs
- Removes unnecessary comment about API being private.
- Removes misleading comment about processor-specific APIs.
- Makes purpose of "service codes" clearer.

Change-Id: I4715609f328b9fa7f334a1b4c3c21441111f228d
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 a5f2ccf286 Remove microkernel's tick handler from public API
This API is now a private microkernel API.

Change-Id: I5b26aa927d42923f2076d06f9bdfef371572543e
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:19 -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 ad71ba6fa1 Ensure k_args fields are properly aligned and packed
The size of the k_args strcture must be equivalent to ...
    CMD_PKT_SIZE_IN_WORDS * sizeof(uint32_t)

This is complicated by the fact that not only do different compilers treat the
size of 'bool' and 'enum' types differently, they may also pad structures
differently.  Both of these differences have direct impacts on the k_args
structure.  To work around this, the k_args fields 'alloc' and 'Comm' are
forcibly aligned to a 4-byte boundary, while the rest of the k_args structure
is packed.

Change-Id: I722f1a585e5e34a7a7218ed0b214b54fac6d39f7
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:16 -05:00
Allan Stephens 5189844df5 Eliminate VxMicro branding in kernel code
Eliminates references to the obsolete OS name. In most cases the
name is simply removed, as it isn't necessary.

Change-Id: I32f9e7390e436aec008a9454b72657e129d65152
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens 839fb27f41 Cosmetic changes to microkernel task status flags
Revises names and/or descriptions to bring them up to date.

Change-Id: I5c1db102bfa0156526f1524084f5802e6df52a52
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens ef4521396e Don't expose APIs for experimental task monitoring capability
This feature is still under development, so it's APIs shouldn't
be publicly advertised yet. And while they are being relocated,
they are renamed to adhere to kernel coding conventions.

Change-Id: I7a41d98e2fbb3b975fa42814cf64854f8cc0b623
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens 662d02cb33 Remove private context structure from public nanokernel API
The tCCS type doesn't need to be publicly exposed; any public APIs
that need to use this kind of type should be using nano_context_id_t.

Change-Id: Ife1e73c4a21326bf54e2d52bfa1f1281245935a1
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens f5777f87bc Continue consolidation of arch-independent private nanokernel APIs
Eliminates duplication of these entries by the various architecture-
specific include files for private nanokernel APIs.

Change-Id: I711c3b42fe375d1574ce4a540142c3b507b71557
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens bff7fc17fe Begin consolidation of arch-independent private nanokernel APIs
Introduces nano_internal.h, which will declare all architecture-
independent non-public nanokernel APIs. This file is automatically
incorporated by the various architecture-specific include files
for non-public nanokernel APIs, and will not normally be included
directly by any other files.

Change-Id: I9f3de812a5747cc720fa0ff739007315e8d07dd9
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens 69555e8efd Cleanup of nanokernel's fiber scheduling routine
1) Renames routine to conform to kernel naming conventions.
2) Relocates routine declaration to include files for
   non-public nanokernel APIs.
3) Relocates routine definition so that it resides with the
   nanokernel's other fiber manipulation routines.
4) Eliminates an unnecessary argument to the routine.

Change-Id: Ia139280dfea36262ca8417708786b4989f3eaee1
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens 7e7854008f Remove task monitoring symbols from microkernel public API
Since microkernel task monitoring is currently experimental
anything related to it shouldn't appear in a public include file.

Change-Id: Iff0e6137085ed0743fb34e97f5cee1bb98aecaed
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens f547a5b7b8 Eliminate cputype.h and its arch-specific derivatives
Since cputype.h no longer has any meaningful content it can be
eliminated, along with the arch-specific files it incorporated.
(This means that the arch-specific nanokernel public APIs are
now referenced only via cpu.h and its derivatives.)

Change-Id: I7f35b6c3c6c092d61c372ff85d73e49414474938
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens bb9ab0322e Eliminate unnecessary references to cpu.h and cputype.h
Gets rid of places where there is no need to include these files
at all, or places where these files are being indirectly included
due to the inclusion of nanokernel.h.

Change-Id: I7b58148af454b977830c00a6b519a78d0595603b
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:14 -05:00
Allan Stephens d6db256249 Add missing #includes required to reference non-kernel APIs
Several files were not explicitly including APIs that they reference,
which could eventually lead to trouble.

Change-Id: Ib33cadfa658280df3fcb4c670463d41b63097b31
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:14 -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
Allan Stephens 60f6a74efe Eliminate non-standard NULL definitions
Revises kernel so that it uses the standard NULL symbol defined
for C99, rather than having its own custom symbol.

Change-Id: I74342f192e95899a83db879e8b1c8fe89ac8b92d
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:14 -05:00
Allan Stephens 5a4be58707 Eliminate non-standard boolean type support
Revises kernel so that it uses the standard boolean type library
defined for C99, rather than having its own custom boolean type.

Also revises sample projects that used the non-standard type.

Change-Id: Ib41b7f836da25352aa5ae9dfbbfdd29739017b6f
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:14 -05:00
Peter Mitsis 220f1a5b86 Statically initialize _k_command_stack
Helps streamline kernel initialization.

Change-Id: If18660eaa548e82f5487cd9fcd4e0cada0426ca0
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:14 -05:00
Peter Mitsis a2314c607b Made _k_server_command_stack_storage static
The global variable _k_server_command_stack_storage is only referenced in
one file.

Change-Id: I62f327c77dfff2d6c553436f5e77a8053aa93031
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:14 -05:00
Peter Mitsis 4fe98a46f5 Initialize stack area in _NewContext()
Instead of initializing the stack (when INIT_STACKS is enabled) in start_task()
and _fiber_start(), do it in _NewContext().  This helps to both reduce code
duplication AND ensure that all contexts get an initialized stack (previously
the background/idle task's was missed).

Change-Id: If2d50309d2be48fac937f5d0ae96b9de185c0fe2
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:14 -05:00
Dirk Brandewie c9ac95a43a device: Add device model infrastructure
Add infrastructure support having multiple instances of a driver
configured into the system each with its own compile time
configuration information.

Change-Id: I1e447af18311139b43f74fe0439483ccd132b63f
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.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
Peter Mitsis 40b5200c73 Optimizations to _NewContext() and _NewContextInternal()
Since the address of the new context is known before _NewContext() is invoked
(due to it being passed a properly aligned stack), there is no longer any
need for _NewContext to return the pointer to the context.

Furthermore, as a direct result of the properly aligned stack, the pointer to
the new context does not need to be passed as a separate parameter since it
will always match the passed stack pointer.

Change-Id: Ie57a9c4ad17f6f13e8b3f659cd701d4f8950ea97
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:13 -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 6996d2cc2c k_timer optimization: INVALID_OBJECT can not be returned
As it is impossible for GETTIMER() to return a NULL pointer, task_timer_alloc()
will never return INVALID_OBJECT.

Change-Id: I270732f31033d9ce55847dc9324f215680865273
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:13 -05:00
Peter Mitsis f8619b4181 Refactor _Cget() to invoke _NanoFatalErrorHandler()
It is a fatal error if the microkernel is configured with either too few
command packets or too few timer packets.

NOTE: During this refactoring of _Cget(), not only is it renamed to
_nano_fiber_lifo_get_panic(), but it is moved into "nano_lifo.c".

Change-Id: I1d866cda1b444da04877f7eda03762b6e83c9a6f
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:13 -05:00
Peter Mitsis 6b12d608d3 _k_timer_alloc() to use GETTIMER() instead of _Cget()
Improves coding consistency by having _k_timer_alloc() use GETTIMER() instead
of _Cget().

Change-Id: I6575307ab6fe769bcf6dbf7e6c845b6cc4e338bd
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 40a719d584 Add "sys_" prefix to public kernel versioning APIs
Eliminates the need to reserve the "kernel_" prefix in the
kernel namespace. Also, aligns versioning with other APIs
that are neither nanokernel_ or microkernel-specific, such
as the system clock APIs.

Change-Id: I81e43cd03849b45a4b432b0875dc8b1d5862dba9
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:13 -05:00
Allan Stephens 9c5d875ad9 Correct obsolete comment describing format of kernel version
Change-Id: Ife9e6b21ef0c49aa9ce964889813716d238aa55c
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:13 -05:00
Allan Stephens d216a00adc Clean up private APIs that mark context as (non)essential
1) Renames APIs to align them with conventions used by other
   general-context nanokernel APIs.

2) Relocates implementation of these APIs to the architecture-
   independent portion of the nanokernel.

Change-Id: I1aa60029aaa96697cd8fcb594bbae23ba6656661
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:13 -05:00
Allan Stephens 140d314336 Eliminate references to k_memset() and k_memcpy()
Since the kernel now provides a minimal string library, there is
no longer any reason not to use the standard memset() and memcpy()
APIs.

Change-Id: Iad587ace6f41fd94c9c961d13d9322495a7da1be
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:12 -05:00
Allan Stephens cb2d18cc83 Eliminate secure string library routines
These routines are either unused, or are always used in manner
that does not require their added security checking.

Change-Id: I6f484924ebc3d395a20879445a2fcabebf6c5014
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:12 -05:00
Dan Kalowsky c02dd34277 Renaming include/nanokernel to include/arch
Renaming the directory include/nanokernel to be include/arch, which
better reflects the real nature of the directory and the contents
inside.

Change-Id: I2bc33ebc6715e2f0403227a558279fdf52398ade
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:14:12 -05:00
Dmitriy Korovkin ec8a461bfb Introduce public APIs for random number generation
Convert the existing non-public random number generation APIs
into public APIs (i.e. sys_rand32_init and sys_rand32_get).

Change-Id: Id93e81e351a66d02c08cf3f5d2dd54a3b4b213c5
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:14:12 -05:00
Anas Nashif 19e17d47e6 Kconfig: remove extra line from nano kconfig
Change-Id: I9b26d027ed818db5328ff2d8e24dfa8044535a0f

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:11 -05:00
Anas Nashif d76be85cc9 Kconfig: change kernel names in menu
Change-Id: Ib4409cfb8da273b0fd9a40e089d47a1fb0ffe0bc

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
Anas Nashif 99c8755010 Remove channel/
Change-Id: Ib79780a6e82c3bc3ab930ec71e7deebe85005c04
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:10 -05:00
Juan Manuel Cruz a558312562 Kbuild: Remove old API ksymbol disclaimer.
This commit removes an old disclaimer used when the API_*
kconfig symbols were introduced.
Now the API_*  symbols are removed, the disclaimer is not needed.

Change-Id: Icf8bc751a19c530c9ba0014ccaaab3eb0f228155
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.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 757790615b Kbuild: Removing API_* Kconfig symbols.
This commit removes the Kconfig symbols and dependencies,
introduced earlier to handle API's.

Change-Id: Ia8c13db876d1f570b815af1fd25fc0f9a0960f95
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:09 -05:00
Anas Nashif 97f2fe9c49 Rename TICKLESS_KERNEL -> SYS_CLOCK_EXISTS
Change-Id: I2101cbbbda08099483e4b7002b6072758149203c

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:09 -05:00
Anas Nashif 0169beb70f Kbuild: rename nanokernel files
Change-Id: I69edff76922c1dd4f48cf34579bb326ff021d115
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:09 -05:00
Anas Nashif f55f475def Kbuild: Remove obsolete version fragment files
Change-Id: I2ec2b78d003d59a5bd7dfde6f6046393f38fcfb6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:08 -05:00
Anas Nashif 4acde800b0 Kbuild: User kernel instead of TiMo
TiMo is very ambigous, be generic and call it kernel.

Change-Id: I66b3e436afbc89e874f31a89b98cc04aa821c787
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:07 -05:00
Anas Nashif 7245689be3 Kbuild: adapt Makefile/Kconfig to microk.c rename
Change-Id: I1a111799b64dfc440d4fc8f1278e99450fec105e

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:07 -05:00
Anas Nashif bb38b8816d Kbuild: adapt Makefile/Kconfig to microkernel/timer removal
Change-Id: I602015a1065f704907895d83cd0afb52646fdf5d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:07 -05:00
Anas Nashif 52deec0712 Kbuild: adapt Makefile/Kconfig to microkernel/movedata removal
Change-Id: I802a0716b1e7871c70d8c87b3c73d8d23cf114a9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:07 -05:00
Anas Nashif 8140e068f2 Kbuild: adapt Makefile/Kconfig to microkernel/core removal
Change-Id: I816098358cf7c655d32a37c52d08d0b14760a48c

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:06 -05:00
Anas Nashif b805752dea Kbuild: power.c was eliminated
Change-Id: Id16ec0dd2f1758f9d5278b8d6a00cd38dec0bc28

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:06 -05:00
Anas Nashif fd5090aca4 Kbuild: adapt Makefile/Kconfig to kernel/common/ removal
Change-Id: I6e9c17b51034dbf1ab93af0234334a3626c25166

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:06 -05:00
Anas Nashif f749794bce Kbuild: adapt Makefile/Kconfig to task/ removal
Change-Id: I3032909d625c40e6cbbc03e3b4311df9be0c899c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:06 -05:00
Anas Nashif 88950af663 Kbuild: adapt Makefile/Kconfig to core/ removal
Change-Id: I96f8a1798e8d84a4876bcb59f5b93ec134e9a233
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:06 -05:00
Juan Manuel Cruz 6aac05214a Kbuild: Removes the COMMAND_PACKET ksymbol.
This commit removes the COMMAND PACKET kconfig symbol and
leaves the command packet service permanently in the build
process.

Change-Id: I814bb7f2f1a868490c1d0cc8d5cbea87bb39005c
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:06 -05:00
Juan Manuel Cruz 339efe209c Kbuild: Remove ks_moved file from Makefile.
This commit updates the Kbuild to the last change in the tree.
ks_moved.c file was removed from the system.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Ice4f1ec4f3629825640718e760ba025f68ad6355
2016-02-05 20:14:06 -05:00
Juan Manuel Cruz c818cd288c Kbuild: Additional Kconfig symbols.
This commit adds the following Kconfig symbols:
 - INIT_STACKS
 - UART_INTERRUPT_DRIVEN
 - CONSOLE_HANDLER
 - BUILD_TIMESTAMP
 - TICKLESS_KERNEL
 - CONTEXT_CUSTOM_DATA

Change-Id: Id96a7e759c8beac73f27193df07b5c7562379b2f
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:06 -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 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 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
Allan Stephens 5ce539ca21 Relocate misplaced pipe buffer code
Several pipe buffer definitions now reside with the other
pipe buffer code. (One routine is also made non-global,
since it only referenced by the pipe buffer code itself.)

Change-Id: I76785d113edd62c9626a7116c9206472656128ec
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:01 -05:00
Allan Stephens c41b4d24e2 Cosmetic changes to microkernel pipe buffer code
1) Re-orders routines to eliminate the need for forward referencing.
2) Makes routines non-global if they are only referenced by pipe
   buffer code itself.
3) Optimizes out an unnecessary wrapper routine.

Change-Id: I731db9c9125c58d98c5e350bdd1708456e2cf40c
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:01 -05:00
Allan Stephens 11994f52bf Rename and relocate miscellaneous microkernel pipe files
Brings file names into alignment with current naming conventions,
and relocates them to the main microkernel directory.

Note: Since the microkernel/channel directory is now empty, the
build system no longer attempts to build its contents.

Change-Id: I936c7cdf2e08f675dd66a87cacf3b4fa5a7a6441
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:01 -05:00
Allan Stephens ea39fe6c50 Consolidate microkernel pipe marker routines
Relocates several marker-related routines that didn't reside with
the main set of such routines. This move allows one of them to be
made non-global, and the other two to be optimized out (since they
were now just unnecessary wrapper routines).

Change-Id: I517779be1778b032ee08654d244039ef36d30d1c
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:01 -05:00
Allan Stephens 57f462281a Consolidate microkernel pipe buffer routines
Merges buffer-related routines into a single file, which also allows
a number of them to be made non-global (and eliminates the needs for
them to be declared in an include file).

Change-Id: Ib4fcf70afef548fd493540753f996a50c78f7521
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:01 -05:00
Allan Stephens 2cab57c7ab Simplify determination of priority for moving pipe data
Uses a simpler algorithm to choose the lower priority value
(i.e. more urgent value) associated with the sender and receiver.

Change-Id: I4e8d2ff9678dfefdcd9941c96a75105841c73fcd
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:01 -05:00
Allan Stephens f6122e2caf Delete unnecessary microkernel pipe subsystem include file
Relocates non-public symbols to the locations they are really
needed (except for CHAN_DEBUG, which is dropped since it is unused).

Change-Id: I52743959a283fec675aa2b3168ef1a122a27ce55
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:01 -05:00
Allan Stephens bdd9b51999 Consolidate microkernel pipe data transfer routines
Merges related routines into a single file, which also allows a
number of them to be made non-global.

Change-Id: Ib749d3908b86a93bf97c0859861c6eaffe5f5f0a
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:01 -05:00
Allan Stephens 278a5ba641 Consolidate microkernel pipe put and get routines
Merges the routines which process the four command packet types
used to process a pipe "put" operation into a single file, so that
the flow of control can be more easily comprehended. Also merges
the analogous routines which process a pipe "get" operation into
a single file.

Change-Id: I56befa0f9a772b3269fd6ece19f003a5c2578a6f
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:01 -05:00
Allan Stephens e3a7b9d808 Consolidate microkernel pipe public APIs
Merges the four main pipe public APIs into a single file,
similar to what is done for other microkernel object subsystems.

Change-Id: Ib3dab0a9330700d77c9fd6f88500590c0004d7b6
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:01 -05:00
Allan Stephens 12c59a1d70 Eliminate unnecessary initialization of pipe structure fields
There is no need to initialize fields to zero that are already
nulled out by the build system.

Change-Id: Ib37e77aaadb1beee800ad74dcfba7caff932015e
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:01 -05:00
Allan Stephens 4b3e0c9945 Cosmetic cleanup of pipe-related code
1) Eliminates non-functional (i.e. commented out) code.
2) Improves adherence to coding conventions.

Change-Id: I78ad1dd173a49f36c126e1c9f349bace62200174
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:01 -05:00
Allan Stephens 2412e1e50f Limit exposure of non-public pipe types
These structures are only used by the microkernel itself, so they
now reside with other non-public microkernel structures.

Change-Id: I4bbba22e46c5336b7b3c41dcdc76e0d9de4e7e2b
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:01 -05:00
Allan Stephens b2d95338a8 Limit exposure of non-public pipe constants
There's no need to expose option combinations that are only used
internally by the microkernel itself.

Change-Id: I4e2725b060ce5edefdd1918c00fbd915cd67d8dc
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:01 -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 18fa789ca0 Rework constructor macros
Routines are no longer flagged as constructors using the FUNC_CONSTRUCT(level)
macro.  This is because some compilers do not support constructor levels.

To indicate that a routine should be a constructor, the SYS_PREKERNEL_INIT()
macro should be used AFTER the definition of the routine.  For example ...

void my_library_init(void)
{
    ...
}

SYS_PREKERNEL_INIT(my_library_init, 500);

The first parameter to SYS_PREKERNEL_INIT() is the name of the routine.  The
second is the priority level (000...999).  The lower the number, the higher
the priority.  NOTE: It is important that all three digits are specified;
otherwise the linker may put the constructors in an undesired order.

Change-Id: Ic334875c60a453b39c10a2ffdee856b4851cb16c
Signed-off-by: Peter Mitsis <peter.mitsis@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 4a56570f9c Eliminate public use of non-public task structure
Revises several trivial task APIs to avoid exposure of task object
internal fields.

Change-Id: Iefa8028042dff1abd1f447eb1cc1ee49f0c2eda5
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:00 -05:00
Allan Stephens b9e5ff8f9e Eliminate public use of non-public command packet structure
Hard-codes the size of the command packet structure so that the
public microkernel semaphore API can utilize command packet sets
without utilizing non-public microkernel API information.

Also adds code to generate a build error if the hard-coded size
is too small, just in case the size of the command packet changes.
(Can't check for size equality, since the structure size may vary
from one compiler to the next. If the value is too large any extra
space in the command packet set will simply go unused.)

Change-Id: I69e7c2f08e3fe75d74bd712459d5587e22443c04
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
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
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
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
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 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
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
Allan Stephens 103e84abcb Rename hidden TICKLESS_KERNEL config option to SYS_CLOCK_EXISTS
The revised option name more accurately describes its purpose, and
avoids potential confusion with the microkernel's tickless idle
capability. Also, inverting the "polarity" of the option means that
conditional code that references it does not have to use negative
logic, which make the code easier to comprehend.

Change-Id: I0c6f82f077a87a28544048d214efa7020939e566
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 f4e72a4175 Limit exposure of non-public microkernel APIs defined by sysgen
Hides the existence of these routines from everyone but the
microkernel's initialization code.

Change-Id: I5dc0a1395c7f01f39d8f283e4f48b0c95578902e
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 19ec0685df Limit exposure of non-public microkernel object API
The encoding of the microkernel object identifier fields is
something that only the microkernel needs to know.

Change-Id: I3701760cdce5768e082b6d2432b75382f5a2f557
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:55 -05:00
Allan Stephens 6ecfc66152 Limit exposure of non-public microkernel timer APIs
Hides the existence of these APIs from everyone but the
microkernel's timer subsystem itself.

Change-Id: I49482a6e16fee28f1ed3e2244e47df401854c9fc
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:55 -05:00
Allan Stephens 067a47558f Consolidate (most) microkernel non-public API declarations
Relocates the declarations for most non-public microkernel APIs
into the main include file for such APIs (i.e. minik.h), then
eliminates the per-subsystem include files. (The per-subsystem
files don't serve any significant purpose now that the routines
comprising each microkernel subsystem have been consolidated.
In fact, there wasn't a single file that included one of these
files that didn't already include minik.h!)

Note: The channel APIs have not been consolidated yet, as they
require further cleanup. Also, one mailbox API that is used only
by the mailbox subsystem itself is moved there rather than being
placed in minik.h.

Change-Id: Ic7f1ac8a67bd39b685f70379dffff0d0caf1b290
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:55 -05:00
Allan Stephens 8e71a756c9 Limit exposure of microkernel system clock
Hides the existence of the microkernel's tick count variable
from everyone but the microkernel system clock subsystem itself.

Change-Id: I6bd20c28758a52eeac376617dd8d542c03738c2a
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:55 -05:00
Allan Stephens 7890a5960b Limit exposure of microkernel timer lists
Hides the existence of the microkernel timer list variables
from everyone but the microkernel itself.

Change-Id: I81b64040efce849328e860067e37731b755a094d
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:55 -05:00
Allan Stephens 4a77f47a9e Limit exposure of microkernel event list
Hides the existence of the microkernel event list variable from
everyone but the microkernel event subsystem itself.

Change-Id: I5a2ac41ebd8131b85897c60eaae24013f10686f0
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
Allan Stephens 678aea8e65 Delete unnecessary kmemcpy.h file
File no longer has any content.

Change-Id: Ia13f8ea3fe7762a335d03a829f9525c15b484483
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:13:55 -05:00
Yonattan Louise a8571c4b7f Fix checkpatch issue - WARNING:SPACING
Spaces between the function name and the open parenthesis are not allowed.
This commit fixes the case where only one open parenthesis with leading
whitespaces is present in the line.

	#!/bin/bash

	checkpatch_script="$VXMICRO_BASE/scripts/checkpatch.pl --mailback --no-tree -f --emacs --summary-file --show-types --ignore BRACES,PRINTK_WITHOUT_KERN_LEVEL,SPLIT_STRING --max-line-length=100 "

	for file in $(find ./ -name "*.[ch]" ! -path "./scripts/*" ! -path "./host/src/wrsconfig/*");
	do
		# fixing spaces between function name and open parenthesis
		for line in $(eval $checkpatch_script $file | grep "WARNING:SPACING: space prohibited between function name and open parenthesis '('" | cut -d":" -f2)
		do
			echo "$file : $line"
			sed -i ''$line' { /[ \t](.*[ \t](/ b skip_it s/[ \t]*(/(/ ; :skip_it }' $file;
		done;
	done;

Change-Id: I1e026eaee930e297374e5f2f725b78f29824dee3
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:54 -05:00
Yonattan Louise 3f1439bf2d Fix checkpatch issue - ERROR:OPEN_BRACE
The open braces of the 'if','for', 'while' and 'do' statements should be at the end on the
same line of the statement to comply with the defined coding style. E.g.:

	if (x is true) {
		we do y
	}

Change accomplished with the following script:

	#!/bin/bash

	checkpatch_script="$VXMICRO_BASE/scripts/checkpatch.pl --mailback --no-tree -f --emacs --summary-file --show-types --ignore BRACES,PRINTK_WITHOUT_KERN_LEVEL,SPLIT_STRING --max-line-length=100 "

	for file in $(find ./ -name "*.[ch]" ! -path "./scripts/*" ! -path "./host/src/wrsconfig/*" ! -path "*/outdir/*");
	do
		if [ ! -h $file ];
		then
			# obtaining the line's number where the error is reported in a reversed order
			reversed_lines="";
			for line in $(eval $checkpatch_script $file | grep "ERROR:OPEN_BRACE" | cut -d":" -f2)
			do
				reversed_lines="$line $reversed_lines";
			done;

			# fixing the issues in reverse order due to lines can be deleted affecting futher lines
			for line_reported in $(echo $reversed_lines);
			do
				# search for the line where the open brace is
				char_found="";
				let line=$line_reported-1;
				while [ ${#char_found} -eq 0 ]
				do
					let line=$line+1;
					char_found="$(sed -n ''$line' { /{/ p }' $file)";
				done

				let statement_line=$line-1;
				let brace_line=$line;

				# condition to avoid modifying lines that ends with the character "\"
				char_found="$(sed -n ''$statement_line' { /\\$/ p }' $file)";
				if [ ${#char_found} -eq 0 ];
				then
					# fix the issue
					echo "$file : reported on $line_reported (found on $brace_line -> moved to $statement_line)";
					sed -i ''$statement_line' { s/[ \t]*$//; s/\([ \t]*\/\*.*\*\/\)$/ {\1/; /{/ b already_done s/$/ {/; :already_done }; '$brace_line' { s/{[ \t]*//; /^[ \t]*$/ d }; ' $file;
				fi
			done
		fi
	done;

Change-Id: I517c40bb33840ef531f2319354350f578b238abb
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:54 -05:00
Yonattan Louise 2ac4a04b92 Rename __defaultEsf to _default_esf
Updating global variable's name to follow a consistent naming convention.
Explicitly moved from __ to _ by direction of Ben Walsh

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: Idd6f7c3c2fdd818f0a794985f3689705cac3c0a2
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:54 -05:00
Yonattan Louise 0db750f266 Rename cmdpacket to cmd_packet
Updating local 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: Ie65865c480be5b6a678ef4716dade3ee745bd88f
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:53 -05:00