Summary of what this includes:
initialization:
Copy from nano_init.c, with the following changes:
- the main thread is the continuation of the init thread, but an idle
thread is created as well
- _main() initializes threads in groups and starts the EXE group
- the ready queues are initialized
- the main thread is marked as non-essential once the system init is
done
- a weak main() symbol is provided if the application does not provide a
main() function
scheduler:
Not an exhaustive list, but basically provide primitives for:
- adding/removing a thread to/from a wait queue
- adding/removing a thread to/from the ready queue
- marking thread as ready
- locking/unlocking the scheduler
- instead of locking interrupts
- getting/setting thread priority
- checking what state (coop/preempt) a thread is currenlty running in
- rescheduling threads
- finding what thread is the next to run
- yielding/sleeping/aborting sleep
- finding the current thread
threads:
- Add operationns on threads, such as creating and starting them.
standardized handling of kernel object return codes:
- Kernel objects now cause _Swap() to return the following values:
0 => operation successful
-EAGAIN => operation timed out
-Exxxxx => operation failed for another reason
- The thread's swap_data field can be used to return any additional
information required to complete the operation, such as the actual
result of a successful operation.
timeouts:
- same as nano timeouts, renamed to simply 'timeouts'
- the kernel is still tick-based, but objects take timeout values in
ms for forward compatibility with a tickless kernel.
semaphores:
- Port of the nanokernel semaphores, which have the same basic behaviour
as the microkernel ones. Semaphore groups are not yet implemented.
- These semaphores are enhanced in that they accept an initial count and a
count limit. This allows configuring them as binary semaphores, and also
provisioning them without having to "give" the semaphore multiple times
before using them.
mutexes:
- Straight port of the microkernel mutexes. An init function is added to
allow defining them at runtime.
pipes:
- straight port
timers:
- amalgamation of nano and micro timers, with all functionalities
intact.
events:
- re-implementation, using semaphores and workqueues.
mailboxes:
- straight port
message queues:
- straight port of microkernel FIFOs
memory maps:
- straight port
workqueues:
- Basically, have all APIs follow the k_ naming rule, and use the _timeout
subsystem from the unified kernel directory, and not the _nano_timeout
one.
stacks:
- Port of the nanokernel stacks. They can now have multiple threads
pending on them and threads can wait with a timeout.
LIFOs:
- Straight port of the nanokernel LIFOs.
FIFOs:
- Straight port of the nanokernel FIFOs.
Work by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Peter Mitsis <peter.mitsis@windriver.com>
Allan Stephens <allan.stephens@windriver.com>
Benjamin Walsh <benjamin.walsh@windriver.com>
Change-Id: Id3cadb3694484ab2ca467889cfb029be3cd3a7d6
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This allows running the sanitycheck with:
--tag unified_capable -x KERNEL_TYPE=unified
to run the unified kernel with the tests it is currently known to be
able to run.
Change-Id: Ic145fc6adca162745887672372226fd67447b34a
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
- Use a more limited range of priorities, since the current
implementation of the unified kernel only works with 32 priorities
total. Instead of starting at 10 and going up by 5 up to 50, start
at 5 and go up by 1 up to 12.
- The definition of kmutex_t has changed from a uint32_t to a struct
k_mutex *, causing this to not work anymore:
const kmutex_t private_mutex;
since this makes the object constant instead of the reference to it.
Private object must be referenced like this instead:
kmutex_t const private_mutex;
since const is left-associative.
Change-Id: I9d70bfa3944ea46033a6b49251a4993e9bd2b588
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
The test does not run out-of-the-box currently, mark it with a #error.
Change-Id: Ia720c674290e59e95db1c2948c508c0464caa672
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
isr wrapper names conflicted with real kernel APIs.
Change-Id: Ia85245fcd3025f9d15175523982883e16e97010c
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Fixes test_sema/microkernel so that the variable assigned the return
value from task_sem_group_take() is of type 'ksem_t' instead of 'int'.
Work by: Peter Mitsis <peter.mitsis@windriver.com>
Change-Id: Iee9f321a6bd51ca3bc0cd8b0c7eceae8a5bf7ce0
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Test is poking into microkernel private data structuresa, but the
unified kernel provides an API to retrieve that value.
Abstract the call in the microkernel case to minic the unified kernel
API.
Work by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Change-Id: Ic3195d470fda178164268d9c71c55a2a6daa61a3
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Fixing issues with the test itself really:
- reply_timeout semaphore was not initialized, causing its limit value
to be 0 on unified kernel
- There is no API to set a fiber's priority after it is started in a
nanokernel. However, tcs.prio can be written to and this works without
issues. On unified kernel, this does not work however because the
thread has to move between linked lists representing each priority in
the ready queue.
Change-Id: I3c5585da05cbc4ac3d2f0f9ae0297d24d41b1309
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Not implemented yet, prevent access to APIs.
Change-Id: I112c1cdee2ad516a0dcffa3239623c61a089d9bc
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
KERNEL_V2 enables the MICROKERNEL flag, but we want the nanokernel
ticker in the unified kernel.
Change-Id: I04e2d31d3834f2d7142bfe0ce9e3334a2faf6fb3
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
They must provide the k_cycles_get_32() API and must not refer to
command packets: the latter do not exist on unified kernels.
Change-Id: Ia354dc060e5ad2595850f97da82d8feb590d16b7
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This allows current code to build but using the definitions from
kernel.h instead of the original headers.
Change-Id: I8f51a83bab4448cd63aa6c54b8e357a8ad6cc1e2
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Workqueues will be brought in as a first-class unified kernel object,
not a misc functionality. Do not use the contents of the header file
when building a unified kernel, but kernel.h instead.
Change-Id: I649558fee92b6565ada0eee81bde9f542a468f9f
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Macro should not use {}, since atomic_t is a scalar type rather
than a structure.
Work by: Allan Stephens <allan.stephens@windriver.com>
Change-Id: Id0991b6ecf841e07015cad01351701bb61b4333c
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
The x86 architecture port is fitted with support for the unified kernel,
namely:
- the interrupt exit code now calls _Swap() if the current
thread is not a coop thread and if the scheduler is not locked
- there is no 'task' fields in the _nanokernel anymore: _Swap()
now calls _get_next_ready_thread instead
- the _nanokernel.fiber field is replaced by a more sophisticated
ready_q, based on the microkernel's priority-bitmap-based one
- nano_private includes nano_internal.h from the unified directory
- the FIBER, TASK and PREEMPTIBLE flags do not exist anymore: the thread
priority drives the behaviour
- the tcs uses a dlist for queuing in both ready and wait queues instead
of a custom singly-linked list
- other new fields in the tcs include a schedule-lock count, a
back-pointer to init data (when the task is static) and a pointer to
swap data, needed when a thread pending on _Swap() must be passed more
then just one value (e.g. k_stack_pop() needs an error code and data)
- fiberRtnValueSet() is aliased to _set_thread_return_value since it
also operates on preempt threads now
- _set_thread_return_value_with_data() sets the swap_data field in
addition to a return value from _Swap()
- convenience aliases are created for shorter names:
- _current is defined as _nanokernel.current
- _ready_q is defined as _nanokernel.ready_q
- _Swap() sets the threads's return code to -EAGAIN before swapping out
to prevent timeouts to have to set it (solves hard issues in some
kernel objects).
- Floating point support.
Note that, in _Swap(), the register holding the thread to be swapped in has
been changed from %ecx to %eax in both the legacy kernel and the unified kernel
to take advantage of the fact that the return value of _get_next_ready_thread()
is stored in %eax, and this avoids moving it to %ecx.
Work by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Allan Stephens <allan.stephens@windriver.com>
Benjamin Walsh <benjamin.walsh@windriver.com>
Change-Id: I4ce2bd47bcdc62034c669b5e889fc0f29480c43b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Loading the _nanokernel address in %edi rather than in %eax allows
calling funtions in _Swap() without having to restore it, since %eax is
used for the return value. %edi is a callee-saved register and does not
have to be restored.
Change-Id: I338086d8e15857e835d5d7487de975791926f869
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
The ARM architecture port is fitted with support for the unified kernel,
namely:
- the interrupt/exception exit code now pends PendSV if the current
thread is not a coop thread and if the scheduler is not locked
- fiber_abort is replaced by k_thread_abort(), which takes a thread ID
as a parameter (i.e. does not only operate on the current thread)
- the _nanokernel.flags cache of _current.flags is not used anymore
(could be a source of bugs) and is not needed in the scheduling algo
- there is no 'task' field in the _nanokernel anymore: PendSV not calls
_get_next_ready_thread instead
- the _nanokernel.fiber field is replaced by a more sophisticated
ready_q, based on the microkernel's priority-bitmap-based one
- thread initialization initializes new fields in the tcs, and does not
initialize obsolete ones
- nano_private includes nano_internal.h from the unified directory
- The FIBER, TASK and PREEMPTIBLE flags do not exist anymore: the thread
priority drives the behaviour
- the tcs uses a dlist for queuing in both ready and wait queues instead
of a custom singly-linked list
- other new fields in the tcs include a schedule-lock count, a
back-pointer to init data (when the task is static) and a pointer to
swap data, needed when a thread pending on _Swap() must be passed more
then just one value (e.g. k_stack_pop() needs an error code and data)
- the 'fiber' and 'task' fields of _nanokernel are replaced with an O(1)
ready queue (taken from the microkernel)
- fiberRtnValueSet() is aliased to _set_thread_return_value since it
also operates on preempt threads now
- _set_thread_return_value_with_data() sets the swap_data field in
addition to a return value from _Swap()
- convenience aliases are created for shorter names:
- _current is defined as _nanokernel.current
- _ready_q is defined as _nanokernel.ready_q
- _Swap() sets the threads's return code to -EAGAIN before swapping out
to prevent timeouts to have to set it (solves hard issues in some
kernel objects).
Change-Id: I36c03c362bc2908dae064ec67e6b8469fc573983
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Changes needed to build system to build a unified kernel:
- NUM_COMMAND_PACKETS, NUM_TIMER_PACKETS, NUM_TASK_PRIRITIES must be
passed to sysgen to avoid modifying it. Simply set them to 0. The
unified build does not need them.
- Pass a different kernel type to sysgen if building for a unified
kernel.
- Build kernel_main.c if building an MDEF file (micro/unified).
- The location of the include files for building offsets.h is different
for unified kernels and nano/micro kernels.
Change-Id: I46b30a2b5ffc3ca675b3413150643b92c117c2c8
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
They use data that is unavailable to the unified kernel, and are not
used anymore really. For now, only compile them when CONFIG_GDB_INFO=y,
and never enable CONFIG_GDB_INFO when building the unified kernel.
These files should go away when the unified kernel is made the only
kernel type.
Change-Id: I0a2a917dd453ecaae729125008756e0f676df16d
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Needs to sort out differences between microkernel and unified MDEF
syntax.
Change-Id: I8f7cb192bdd90c0f9c40593cfbd0aa86b12c7c74
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Cleaner than positional parameters, easier to add new arguments.
Change-Id: I30e85f7b2643775c1006564d18da115599688e88
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Easier to build logic for when an MDEF file is to be parsed since
unified kernel needs to do it as well. Can also be useful for testing,
when toggling between static and dynamic objects in the same test case.
Change-Id: I51eb8919e18443516ade13caab04698d37d91803
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Kernel makes use of __DATE__ and __TIME__ to get its build time.
Change-Id: I34b07a413cd79b2e9c34a2eae5803b9bb837e4ee
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Allow appending a list to another list. The list being appended can be
either a slist or the head and tail of a singly-linked list with the
same node format as the slist.
Change-Id: I14410d2b793e1d9f893ff4e7ce097bee4a93a4be
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
More straightforward than doing sys_slist_peek_head() followed by
sys_slist_remove().
Also add a version that does not check if the list is non-empty to be
used when the list is known bo be non-empty.
Change-Id: I8fd10e20e2c84c7d8972c9207f3d4917884808cb
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Used for operating on all elements of a doubly-linked list.
Change-Id: I9eae26ef6d24ce497dbb3acc8a699598d1547bde
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This edit to the doxygen.config file causes Doxygen to treat
__deprecated as a predefined macro, which expands to nothing.
See https://wiki.zephyrproject.org/view/Function_Documentation#Workarounds
for further information about this workaround.
Change-Id: I8e344cf65d7ff45609d5dd9a0caec14df9799d46
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Boards that cannot support microkernel applications for memory resources
are excluded from microkernel build test.
qemu nios2 board is excluded from nanokernel because the Altera JTAG
UART not implemented yet
The kernel even logger buffer size for nanokernel was reduced from 1000
elements to 500 to allow the sample to fit in the Quark D2000 board.
Jira: ZEP-698
Change-Id: I0c5cc4c0bfc27940a758dcdd8ff0e01ad7f4b88c
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
The sample applications for task profiling requires a default
project configuration file that can be used as reference for
any other board.
Quark SE dev board has some optional optimizations that can
be added using the prj_quark_se_devboard.conf file.
Some redundant symbols were removed to simplify the reading
of the configuration.
Jira: ZEP-698
Change-Id: I71d584d4454392e740f8b7a2c2f47206b76c3abf
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
According to commit b71a8a4591 and Jira: ZEP-733
(libc: remove stddef.h which is provided by the compiler),
the stddef.h in zephyr code is removed and it's provided
by the compiler. The original stddef.h includes two head
files, null.h and size_t.h, which are also useless now.
So remove these two deprecated files, in case conflicting
definition.
Change-Id: Ie7163fdbd23c32759425b50f3deff2a57cc051a9
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
Some regular expressions used to ignore outputs could use some extra
documentation to clarify what was being ignored.
Change-Id: Iabf3ce6964a89cdb7f9bbe8d99a3b4b8f98da59b
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
No need to ignore these issues any more.
Change-Id: I943f12753b7b80e50b1006146d3c7d4b4137584e
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
On systems with fixed IRQ-to-vector mapping (like Quark D2000),
if multiple drivers tried to use the same IRQ line, gen_idt would
report an IDT vector collision rather than multiple IRQ line collision,
which is much less intuitive.
Move the IRQ line validation to before the vector validation to report
an easier to understand error.
Change-Id: I3930d8df38391e4708db5486e4bd4527d33c4cce
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This is a better choice of default; on Mint Valley using IRQ 0
for the timer collides with the DMA Error IRQ line.
Issue: ZEP-849
Change-Id: I14cb60fbe548488198813b2351e0ed1f07c2d07d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
LOAPIC timer driver is used by both LOAPIC and MVIC, but the
correct #define needs to be used for the IRQ line.
Issue: ZEP-848
Change-Id: Ib682dd95c08ba437d1ff409e0e0352944d13b633
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Changed help message to be in compliance with the rest of sensors.
Change-Id: Ia18f7623eda5f86fe6f7d99ac934f1a9beda55a8
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
Commit 3e63a74514 did not revert properly
things.
Change-Id: I792d5698966542ce2cfb9f858c56b30c392f02a2
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Some samples were including nullsec.c, simplerdc.c and
framer-nullmac.c, those files are not needed but introduce some
symbol dependencies, causing link to fail when optimization is not
-Os, e.g. when compiling with CONFIG_DEBUG.
Change-Id: Id227470a4517e8e2c3b9af942b0893783075cd40
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
Some make implementations have different implementations for
notdir and absdir functions.
notdir may require that his parameter do not finish with "\".
absdir may fail when given a windows formated path as input.
The path that is given to notdir as parameter is removed from
the final "\" and abspath is replaced with realpath when the
input given can be a windows formated path.
Jira: ZEP-762
Change-Id: Ic83e3526fc5234decb3192ab1f9f538addf9a76e
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>