Commit graph

59 commits

Author SHA1 Message Date
David Leach db36b146e1 kernel: Remove supported size comments from HEAP_MEM_POOL_SIZE
The mempool implementation doesn't require specific sizes and can
support arbitrary sizes up to the limit of available memory. The
Kconfig documentation on this configuration was confusing user.

Fixes #20418

Signed-off-by: David Leach <david.leach@nxp.com>
2020-07-24 10:19:47 +02:00
Anas Nashif 0ff33d1ae7 doc: fix usage of :c:type
Fixing issues with recent versions of breathe 4.19.2:

 WARNING: Unparseable C cross-reference: 'struct device'
 Invalid C declaration: Expected identifier in nested name, got keyword:
 struct [error at 6]
   struct device
     ------^

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-16 15:44:50 -04:00
Anas Nashif 568211738d doc: replace lifo/fifo with LIFO/FIFO
Replace all occurances of lifo/fifo with LIFO/FIFO to be consistent.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-15 14:01:33 -04:00
Jukka Rissanen 4363c566ed doc: kernel: Add sys_sem APIs to kernel documentation
The kernel documentation was missing sys_sem APIs.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-06-24 15:38:47 -04:00
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Carles Cufi 3318ad3dfb doc: kernel: Fix invalid use of K_NO_WAIT
K_THREAD_DEFINE can no longer use K_NO_WAIT to specify the delay after
the timer API rework. Fix the documentation to use 0 and add a note.

Fixes #25697.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-06-02 18:03:06 +02:00
Stephanos Ioannidis aaf93205bb kconfig: Rename CONFIG_FP_SHARING to CONFIG_FPU_SHARING
This commit renames the Kconfig `FP_SHARING` symbol to `FPU_SHARING`,
since this symbol specifically refers to the hardware FPU sharing
support by means of FPU context preservation, and the "FP" prefix is
not fully descriptive of that; leaving room for ambiguity.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-08 10:58:33 +02:00
Andy Ross e20e6f4beb doc: Add k_heap/sys_heap docs
We have a new heap implementation replacing mem_pool.  Add docs on its
API and internals, and add a deprecation note to the mem_pool section.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-05-07 17:17:52 -07:00
Andy Ross c310be876b doc: Rewrite clocks and timing sections
The recent work with k_timeout_t has invalidated much of the existing
timing documentation.  Rewrite the section focusing on the new API,
adding details on the internals and driver-facing API.  Includes a
porting guide for legacy applications and subsystems.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-05-07 17:17:52 -07:00
Anas Nashif 262bf14c63 doc: kernel: add section about queues
We did not have any reference to queues and doxygen information were not
linked correctly. Add a placeholder and pull in doxygen data so whenever
someone adds a reference, a link is created.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-02 15:41:43 -04:00
Stephanos Ioannidis 0e6ede8929 kconfig: Rename CONFIG_FLOAT to CONFIG_FPU
This commit renames the Kconfig `FLOAT` symbol to `FPU`, since this
symbol only indicates that the hardware Floating Point Unit (FPU) is
used and does not imply and/or indicate the general availability of
toolchain-level floating point support (i.e. this symbol is not
selected when building for an FPU-less platform that supports floating
point operations through the toolchain-provided software floating point
library).

Moreover, given that the symbol that indicates the availability of FPU
is named `CPU_HAS_FPU`, it only makes sense to use "FPU" in the name of
the symbol that enables the FPU.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-27 19:03:44 +02:00
Corey Wharton 58232d58e0 riscv: Add support for floating point
This change adds full shared floating point support for the RISCV
architecture with minimal impact on threads with floating point
support not enabled.

Signed-off-by: Corey Wharton <coreyw7@fb.com>
2020-04-22 16:39:48 -07:00
Peter Bigot fadd98aad2 sys: add generic asynchronous notification infrastructure
k_poll() for a signal is often desired for notification of completion
of asynchronous operations, but there are APIs where it may be
necessary to invoke "asynchronous" operations from contexts where
sleep is disallowed, or before the kernel has been initialized.
Extract the general notification solution from the on-off service into
a utility that can be used for other APIs.

Also move documentation out to a resource management section.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-06 16:41:41 +02:00
Oleg Zhurakivskyy c408fa88a3 toolchain: common: Merge build assert macros
In order to de-duplicate 2 macros with the same use,
merge BUILD_ASSERT(), BUILD_ASSERT_MSG() into one macro.

Make BUILD_ASSERT_MSG() deprecated.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-03-31 07:18:06 +02:00
Ioannis Glaropoulos b61ba8df4a doc: reference: kernel: remove inconsistent comment for k_cpu_idle
k_cpu_idle() API does not need to be invoked with interrupts
unlocked; it is actually invoked with interrupts locked by
the kernel CPU idling mechanism. In most architectures, the
function is, actually, un-locking interrupts itself. We need
to remove this comment from the documentation of the CPU
idle API. We add a note about the un-locking of interrupts.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-03-20 11:53:14 +01:00
Carles Cufi cd38fb1610 Revert "toolchain: common: Merge build assert macros"
This reverts commit 974aa3add4.

Pull Request #23437 was merged by mistake with an invalid manifest.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-03-19 18:45:13 +01:00
Oleg Zhurakivskyy 974aa3add4 toolchain: common: Merge build assert macros
In order to de-duplicate 2 macros with the same use,
merge BUILD_ASSERT(), BUILD_ASSERT_MSG() into one macro.

Make BUILD_ASSERT_MSG() deprecated.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-03-19 15:47:53 +01:00
Carles Cufi bf41dd943b doc: reference: Clean up and restructure a bit
Name all subsystem reference consistently with an '_api' postfix and
clean up naming and folder structure in some cases.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-03-18 11:47:24 +01:00
Andrew Boie 806c8af660 doc: add k_thread_join() to documentation
Added to the section covering thread termination.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-03-13 08:42:43 -04:00
Ulf Magnusson 47963cae3f doc: dts: Add lots of documentation for generated macros
Add detailed documentation for macros that get generated by
gen_defines.py. Covers properties, interrupts, phandle-arrays, clocks,
buses, flash partitions, SPI, etc.

Should be relatively complete now, though there might be overlooked
details.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Co-Authored-By: Kumar Gala <kumar.gala@linaro.org>
Co-Authored-By: Marti Bolivar <marti.bolivar@nordicsemi.no>
2020-02-18 15:24:59 -06:00
Peter A. Bigot 1964bf08bb lib: os: onoff: add API for on-off service request and release management
There are various situations where it's necessary to support turning
devices on or off at runtime, includin power rails, clocks, other
peripherals, and binary device power management.  The complexity of
properly managing multiple consumers of a device in a multithreaded
system suggests that a shared implementation is desirable.  This
commit provides an API that supports managing on-off resources.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-29 14:08:46 +01:00
Peter Bigot 76995b61ac doc: scheduler: define reschedule point
This term needs to be defined to support documenting the effect of
various API calls on scheduler selection of the running thread.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-27 16:05:07 +01:00
Ioannis Glaropoulos c393f3f87a doc: interrupts: add documentation section for zero-latency IRQs
Add a simple documentation section for the Zero-Latency
IRQs feature supported by the kernel.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-01-08 19:57:56 -05:00
Ioannis Glaropoulos 0eb93c201b doc: list dynamic direct interrupts as ARM supported API
Document that the Dynamic Direct interrupts feature is
implemented and supported as an ARM-only API.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-01-08 10:15:09 -08:00
David B. Kinder 17299f0734 doc: document python build scripts
We have a collection of python scripts that are part of our build
system.  This PR collects docstring comments added to these scripts into
a summary document.  Previous references to just the script name in
other documentation are updated to point to this build tool
documentation.

Some of the scripts needed an update to be processed (via include
directives) consistently.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-02 17:09:29 -05:00
Ulf Magnusson 984bfae831 global: Remove leading/trailing blank lines in files
Remove leading/trailing blank lines in .c, .h, .py, .rst, .yml, and
.yaml files.

Will avoid failures with the new CI test in
https://github.com/zephyrproject-rtos/ci-tools/pull/112, though it only
checks changed files.

Move the 'target-notes' target in boards/xtensa/odroid_go/doc/index.rst
to get rid of the trailing blank line there. It was probably misplaced.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-11 19:17:27 +01:00
Peter Bigot 40ac3c4663 docs: kernel: standardize thread state capitalization
All states in the thread state diagram were initial-cap except
"suspended".  Make it Suspended for consistency.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-11-21 09:00:26 +01:00
Andy Ross 52d6e5983f doc/kernel/smp: Add initialization diagram
Add a simple block diagram detailing the SMP initialization flow.  Not
pretty, but hopefully reasonable.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-11-14 19:13:27 -05:00
Anas Nashif 8b089d2699 doc: kernel: use kconfig documentation in main kernel doc
Documentation about scheduling options was burried in the Kconfig help.
It has better visibility as part of the scheduling section of the main
kernel reference pages.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-11-14 09:15:38 -05:00
Andy Ross 8892406c1d kernel/sys_clock.h: Deprecate and convert uses of old conversions
Mark the old time conversion APIs deprecated, leave compatibility
macros in place, and replace all usage with the new API.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-11-08 11:08:58 +01:00
Andrew Boie 4f77c2ad53 kernel: rename z_arch_ to arch_
Promote the private z_arch_* namespace, which specifies
the interface between the core kernel and the
architecture code, to a new top-level namespace named
arch_*.

This allows our documentation generation to create
online documentation for this set of interfaces,
and this set of interfaces is worth treating in a
more formal way anyway.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-11-07 15:21:46 -08:00
Christoph Reiter a92a35c2f3 doc: fix list formatting in ring_buffer
There is one level of spaces too much which leads to incorrect
formatting.

Signed-off-by: Christoph Reiter <christoph.reiter@infineon.com>
2019-10-15 09:54:39 -07:00
Håkon Øye Amundsen f20127c137 doc: use simpler words for describing scheduling
Use simple terms when possible.
'inhibit' -> 'prevent'
'supplanted' -> 'replaced'

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2019-10-08 10:21:39 -07:00
Andy Ross bb746e6ec4 doc/reference/kernel: Add SMP archtecture doc
SMP had API-level docs, but no architecture-level description.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-10-04 13:24:40 -07:00
Piotr Zięcik 19d8349aa5 kernel: Introduce k_work_poll
This commit adds new k_work_poll interface. It allows to
submit given work to a workqueue automatically when one of the
watched pollable objects changes its state.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-10-04 17:15:17 +02:00
Anas Nashif d803a534c0 docs: kernel: thread documentation enhancements and cleanup
Moving all thread docs into 1 page was a bit too much. Split the section
a bit and remove redundant and useless sections and move some thread
related documentation from the scheduling page to threads (thread states
and priorities).

Add a new figure for thread states.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-25 04:42:51 -04:00
Anas Nashif 25cd3f9f54 docs: kernel: K_FP_REGS is not x86 only
We have more architectures support float now.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-25 04:42:51 -04:00
Andrew Boie 4ce988ab43 doc: provide error handling documentation
We don't really have docs on how fatal errors are induced
or handled. Provide some documentation that covers:

- Assertions (runtime and build)
- Kernel panic and oops conditions
- Stack overflows
- Other exceptions
- Exception handling policy

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-09-23 23:45:08 +02:00
Daniel Leung 863548cf19 doc: mailbox: fix typos and clarify meaning of struct field
This fixes some typos. Also fix the meaning of a struct field
where the confusion caused by copy-and-paste from another
field.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-09-07 10:01:34 -04:00
Marti Bolivar 47f36afdb9 doc: change kernel reference toctree maxdepth to 1
This makes the index cleaner.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-08-30 13:55:38 +02:00
Marti Bolivar 1e34ea950c doc: add summary table for kernel data passing
Add a table summarizing the key characteristics of each
of the data passing objects.

It is useful for readers to have an overview they can skim without
having to read each section in detail.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-08-30 13:55:38 +02:00
Marti Bolivar e9c858abc8 doc: split kernel reference toctrees
Splitting these up by area helps make the sidebar a bit easier to
navigate, and will also let us insert additional overview information
about each area.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-08-30 13:55:38 +02:00
Wayne Ren a39f5a8cab doc: add doc of arc floating point support
add doc of arc floating point support

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-08-01 18:09:35 -07:00
Anas Nashif 2a1682e7b3 doc: scheduler: add diagrams illustrating scheduler
Add some diagrams showing the different scheduling algorithms we
support.

The diagrams were made using draw.io and can be edit using draw.io.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-18 18:07:17 -04:00
Anas Nashif 9058ef167d doc: move schedling doc to its own section
Move scheduler documentation to its own section.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-18 18:07:17 -04:00
Ioannis Glaropoulos 0bae5a48d4 doc: reference: float: document ARM thread tag recommendation
This commit adds a short note in reference/kernel/other/float.
The note instructs to apply pre-tagging of ARM threads to
indicate that they indend to use the FP services.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-06-27 18:07:03 -07:00
Nicolas Pitre 659fa0d57d lifo/fifo: first word is not always first 4 bytes
The first word is used as a pointer, meaning it is 64 bits on 64-bit
systems. To reserve it, it has to be either a pointer, a long, or an
intptr_t. Not an int nor an u32_t.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-26 09:08:42 -04:00
Charles E. Youse 3dc7c7a6ea drivers/interrupt_controller/mvic.c: remove MVIC interrupt controller
The Quark D2000 is the only x86 with an MVIC, and since support for
it has been dropped, the interrupt controller is orphaned. Removed.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-25 08:06:43 -04:00
Nicolas Pitre 3d51f7c266 k_stack: make it 64-bit compatible
The k_stack data type cannot be u32_t on a 64-bit system as it is
often used to store pointers. Let's define a dedicated type for stack
data values, namely stack_data_t, which can be adjusted accordingly.
For now it is defined to uintptr_t which is the integer type large
enough to hold a pointer, meaning it is equivalent to u32_t on 32-bit
systems and u64_t on 64-bit systems.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-14 05:46:29 -04:00
Ioannis Glaropoulos d281e12569 doc: kernel: rework doc section of shared FP registers mode
This commit rewrites the documentation section describing
the Shared FP registers mode for Cortex-M to align with the
latest architecture rework of Shared FP mode.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-06-12 09:17:45 -07:00