Commit graph

18576 commits

Author SHA1 Message Date
Benjamin Walsh
5586c6a1a1 sys_clock: add missing fiber system clock APIs
tick_get(), tick_get_32() and cycle_get_32() APIs were missing for
fibers.

Change-Id: Ic03880714f9f83f57b5c0599bc04b680fabea533
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:27 -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
e80d06deed arch: rename context.c files to thread.
Also for ARC, rename context_wrapper.S to thread_entry_wrapper.S.

Change-Id: I83318ae352a688996f8436cf3252f6108ec23dc5
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:27 -05:00
Benjamin Walsh
97f2622f55 arm: rename instances of CortexM
Directory names: CortexM -> cortex_m
Code comments: CortexM -> Cortex-M

Change-Id: If946ed25fac863e0be9dbb6f6c275199402b0b0a
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:27 -05:00
Benjamin Walsh
ed3a1e2f51 nanokernel: remove very last remnants of objects named 'chan'
Hopefully, this is the very last time a nanokernel object will have been
referred to by the 'channel' terminology.

Change-Id: Ied6243220803492af174571bfed328da007f2c5d
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
4dca2dfad3 util: make is_power_of_two() a public utility
Somewhat useful utility that should only have one implementation, so it
can impede on the normally-available application namespace.

Change-Id: I085850177c231fdf58634f97e897c4d2e1a5cffb
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
849865046b benchmark/app_kernel: fix useless comment
The comment did not convey anything, as it was a relic from before a
previous renaming. Use the SECONDS(x) macro to make everything clearer.

Change-Id: Ia757061c4083d7567df5b214326c2cf8b6804fbf
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:27 -05:00
Benjamin Walsh
b981326ae9 microkernel: remove last remnants of 'process' from text
There is no concept of a "process" in the system, so remove last
mentions of that concept from free-form text (doc, comments, macro
parameter names).

Change-Id: Ic1b73371c448ed93b0db46bc9bb412d1e1dbc8bd
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
Benjamin Walsh
c45fc04952 doc: clean rule removes 'xml' and 'latex' dirs
These are generated directories.

Change-Id: I0359b5dac128b194bc48604444b2e7f08caa6675
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:27 -05:00
Daniel Leung
ed9cdac197 i2c: change inline functions to static inline
When compiling with optimization level 0 (-O0), the linker complains
about missing references to uart functions. This is due to compiler
treating this functions as extern, since -O0 disables function inlining,
as described in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49653

So change the declaration to static inline.

Change-Id: I5963153dc1efd22083b6b91ae2b70c11d602c6c6
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:26 -05:00
Peter Mitsis
ea2a07a50e doc: Add nanokernel fiber code sample
Adds an example showing how to start a fiber from a task.

Change-Id: I5728d9b48650c60ab265924f436f78696849b915
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:26 -05:00
Daniel Leung
94718c7392 uart: change inline functions to static inline
When compiling with optimization level 0 (-O0), the linker complains
about missing references to uart functions. This is due to compiler
treating this functions as extern, since -O0 disables function inlining,
as described in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49653

So change the declaration to static inline.

Change-Id: I59607cffbd1cae141a9eeaca699549ebf8203061
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:26 -05:00
Juan Manuel Cruz
ea0c810bc5 kbuild: environmental vars rebuild
This commit allows kbuild to rebuild if the following environmental
variables change: KERNEL_TYPE, PLATFORM_CONFIG, ARCH.

Change-Id: Ibab0392b6eb362a5423bce149c013235b75d3140
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:15:26 -05:00
Rodrigo Caballero
33b13dc70d Doc: Restructures the documentation collaboration content.
Changes the names and file structure for all documentation collaboration
relevant content. Updates the cross-references and figures where
applicable. Content was changed as little as possible.

Change-Id: I8b3c59368fa288a43c87793bf731c7d8883df3ab
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:15:26 -05:00
Rodrigo Caballero
3acf84edab Doc: Restructures the communication collaboration content.
Changes the names and file structure for all communication relevant
content. Updates the cross-references and figures where applicable.
Content was changed as little as possible.

Change-Id: Icd19d2f17a9ab0f11373a0d8a175d8c95ac0f44b
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:15:26 -05:00
Rodrigo Caballero
03d2a4fcbc Doc: Moves and renames files into the new file structure.
The collaboration content files have been placed in three folders. One
for communication, one for code collaboration and one for documentation
collaboration. This change only moves and renames the files. The
cross-references and file paths within the files have NOT ben change.
That is comming on the next change.

Change-Id: Ic09a51878ab432561bc394a4464570cc51a28d69
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:15:26 -05:00
Juan Manuel Cruz
044bfc60c5 build: INIT_STACKS memset fix.
This commit fixes an issue with INIT_STACKS configuration option.
k_memset is substituted by the libc memset routine to initialize a
block of memory.

Change-Id: Ic3e286d0976f618110b2828f6da76417b868aef0
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:15:26 -05:00
Anas Nashif
0e46b81faf doc: add documentation of kconfig variables
The configuration option documentation is autogenerated from
Kconfig files. This list right now applies only for x86.

Change-Id: Ibfc84324bb5e2206362d3bca6ab28aee0109f429
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:26 -05:00
Anas Nashif
4ca0b0b96b add missing includes from toolchain
Change-Id: Ic60955df6644d2a15897c6b6c082890b2ccd2371
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:26 -05:00
Fabien Chereau
6d1ee7e8bf build: avoids link error when CCACHE is not activated
Change-Id: I31d7578cc20b9b64c7c144935f93576b6349597e
Signed-off-by: Fabien Chereau <fabien.chereau@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:26 -05:00
Peter Mitsis
f5f78432ed x86: fix basic_atom's SYS_CLOCK_HW_CYCLES_PER_SEC
The Kconfig option SYS_CLOCK_HW_CYCLES_PER_SEC for the basic_atom platform
configuration was mistakenly left at 900000000.  That value was necessary
when basic_atom used the LOAPIC_TIMER, but as it now uses the HPET, it must
use 25000000.

Change-Id: If2735895edfe2f67905bf57e4008efbee50084f7
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:26 -05:00
Daniel Leung
8729b3c802 k20: sim: clean up camel case and doxygen for file description
This converts away from camel case according to the coding style.
Also, the file description has been made into doxygen style.

Change-Id: Ib4dd85a4a96e4e87279c92fa243d3f860ebe63f2
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:26 -05:00
Daniel Leung
e180fa0ff4 serial: stellaris: cosmetic changes to comments
Converts the file description to doxygen format, and updates
the information inside. Also removes empty lines.

Change-Id: I3866843a31e30e1dd464b27cafc830900d8dce4f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:26 -05:00
Daniel Leung
3104503d25 serial: stellaris: clean up camel case and function declarations
Clean up variables and function arguments to conform to coding style.
Also align the function argument list.

Change-Id: I49eff429bfa369c8a544d8171e35a41523995aa3
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:26 -05:00
Daniel Leung
bd2e264d26 serial: k20: cosmetic changes to comments
Converts the file description to doxygen format, and updates
the information inside. Also removes empty lines, updates
the comments for function, and adds missing comments.

Change-Id: I7610e8667cd85feb0c4c853b44880f7e29b6c05a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:26 -05:00
Daniel Leung
e424f1bee1 serial: k20: clean up camel case and function declarations
Clean up variables and function arguments to conform to coding
style. Also align the function argument list.

Note that this only changes the parts related to UART.

Change-Id: I84a6ba88963784f6ddc77d5bda653a7d2de6a72b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:26 -05:00
Daniel Leung
7f07e50aa3 serial: ns16550: cosmetic changes to comments
Converts the file description to doxygen format, and updates
the information inside. Also removes empty lines, and updates
the comments for function.

Change-Id: I97672996510fec1c92a30f78d6f088f02279fb44
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:26 -05:00
Daniel Leung
44d4c2277a serial: ns16550: clean up camel case and function declarations
Clean up variables and function arguments to conform to coding
style. Also align the function argument list.

Change-Id: I0787558abe899e9376ede0ee5c5ac5728c42254d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:26 -05:00
Allan Stephens
9020d7654e doc: Revise description for microkernel semaphore objects
Revises and supplements information on concepts and use cases.

Change-Id: I1ae8f9382b6fd98af59f2a8ef555830981807d5d
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:15:26 -05:00
Allan Stephens
f55bbbcc31 doc: Revise description for microkernel event objects
Revises and supplements information on concepts, use cases, and
how to define an event.

Change-Id: I1de8c87d069288c14d6f378d96590fcc3d569801
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:15:26 -05:00
Allan Stephens
1201a73002 doc: Reorder listing of microkernel synchronization objects
Now ordered from most basic semaphore type (events) to most complex
semaphore type (mutexes).

Change-Id: I4cf69ee2b87b10b8d962f963b3631d9bdae608e9
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:15:26 -05:00
Allan Stephens
61fa627f74 doc: Terminology change - signalling -> synchronization
The kernel's services previously referred to as "signalling services",
which include object types such as semaphores, events, and mutexes,
are now referred to as "synchronization services". This term more
clearly conveys their use as a means to synchronize the operation
of two or more entities within the kernel.

Change-Id: Id24b96f2daf7d866a2d134c222e3d0b6fc568f5a
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:15:26 -05:00
Allan Stephens
a6c11231ad doc: Fix typo in microkernel task documentation
Corrects example code by eliminating unneeded characters.

Change-Id: I9bbc8a19b6b66807a366a2d514d62495b9371046
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:15:26 -05:00
Dmitriy Korovkin
fa05dcee01 Make HPET use level-triggered interrupts on galileo platform
In order to cover maximum of code, make different platforms
use different driver configuration. This way basic_atom uses
legacy emulation combined with edge-triggered interrupts while
galileo platform uses normal mode combined with level-triggered
interrupts.

Change-Id: Ib80553dbb16cf6bbe61ee5e41788031037f41860
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:15:26 -05:00
Dmitriy Korovkin
c1c867af08 Fix HPET interrupt triggering for basic_atom platform
HPET in legacy emulation mode uses rising edge triggered
interrupts on real hardware.

Change-Id: I4f734a5147864b492618a887e1d0d780e6e17aa8
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:15:26 -05:00
Dmitriy Korovkin
35e31e9c0c Fix level triggered interrupt handling
Fix the option that enables level triggered interrupts usage.
It depends on CONFIG_HPET_TIMER_LEVEL_HIGH and CONFIG_HPET_TIMER_LEVEL_LOW
configuration parameters.

Change-Id: I3529b1e57b1625e6f0f4b05d9c15eb563e9c4f83
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:15:26 -05:00
Dmitriy Korovkin
93b0ced44b Order hardware and device initialization
The initialization procedures need to be called in the
following order:
- basic hardware initialization;
- devices initialization;
- hardware clock initialization, that the kernel needs to
  run the kernel server.
This way, the board initialization routines is placed
to the pure_early_init level to make sure it runs first,
all device initialization procedures run at pure_init level,
so they are initialized early enough to be used for debugging
if needed. Hardware clock initialization is placed on
nano_early_init level to make sure hardware clock is initialized
just before the kernel server starts.

Change-Id: Ieecf9f0252c47c621b7208969687dc1113fc2ad0
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:15:26 -05:00
Allan Stephens
d44e380496 doc: Clean up instructions for defining microkernel objects
Revise instructions to take advantage of the "public object"
and "private object" terminology now covered in the kernel
overview documentation. Also incorporates some missing information
the users need to be aware of when defining certain object types.

Change-Id: Ic0b359baf4443714c80200fdaff9cf2d253e6b99
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:15:26 -05:00
Allan Stephens
b18b992980 doc: Enhance "About Zephyr" into to mention licensing
Mentions the open source nature of the Zephyr kernel and its
permissive licensing right up front, to help encourage potential
users who are concerned about GPL-type licenses.

Change-Id: I9250aae3caf5329cc58f547f381c32a94843ea03
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:15:25 -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
Dmitriy Korovkin
a34780f663 Fix system hardware clock frequency for FRDM k64f platform
The board runs with 120 MHz CPU frequency, the systick
uses CPU frequncy. This way 120MHz is a correct value.

Change-Id: If47f1ce6371fb7202ececb4d5f8f7c984aa66598
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:15:25 -05:00