drivers: eliminate nano/micro kernel usage

Jira: ZEP-1415

Change-Id: I4a009ff57edb799750175aef574a865589f96c14
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2016-12-19 18:41:17 -05:00 committed by Anas Nashif
parent 31862e3a63
commit 3d8e86c12c
15 changed files with 39 additions and 69 deletions

View file

@ -105,9 +105,9 @@ config GP_GLOBAL
help
Use global pointer relative offsets for small globals declared
anywhere in the executable. Note that if any small globals that are put
in alternate sections (such as _k_task_list_ptr in the microkernel)
they must be declared in headers with proper __attribute__((section)) or
the linker will error out.
in alternate sections (such as _k_task_list_ptr) they must be declared
in headers with proper __attribute__((section)) or the linker will
error out.
config GP_ALL_DATA
bool "All data global pointer references"

View file

@ -18,7 +18,7 @@
#include <errno.h>
#include <nanokernel.h>
#include <kernel.h>
#include <misc/util.h>
#define SYS_LOG_NO_NEWLINE
#define SYS_LOG_LEVEL CONFIG_SYS_LOG_ADC_LEVEL

View file

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <nanokernel.h>
#include <kernel.h>
#include <sys_io.h>
#include <board.h>
#include <init.h>

View file

@ -20,7 +20,7 @@
#include <errno.h>
#include <nanokernel.h>
#include <kernel.h>
#include <misc/util.h>
#include <gpio.h>

View file

@ -21,7 +21,7 @@
#ifndef _GPIO_PCAL9535A_H_
#define _GPIO_PCAL9535A_H_
#include <nanokernel.h>
#include <kernel.h>
#include <gpio.h>
#include <i2c.h>

View file

@ -21,7 +21,7 @@
#define __GPIO_SCH_H__
#include <stdint.h>
#include <nanokernel.h>
#include <kernel.h>
#include <gpio.h>
#define GPIO_SCH_REG_GEN (0x00)

View file

@ -16,7 +16,7 @@
#include <errno.h>
#include <nanokernel.h>
#include <kernel.h>
#include <board.h>
#include <i2c.h>

View file

@ -15,7 +15,7 @@
* limitations under the License.
*/
#include <nanokernel.h>
#include <kernel.h>
#include <device.h>
#include <init.h>
#include <pinmux.h>

View file

@ -26,7 +26,7 @@
#include <stdio.h>
#endif
#include <nanokernel.h>
#include <kernel.h>
#include <stdbool.h>
#include <errno.h>

View file

@ -179,7 +179,7 @@ config SYSTEM_CLOCK_INIT_PRIORITY
default 0
help
This options can be used to set a specific initialization priority
value for the system clock driver. As drivers on nanokernel
initialization level might need the clock to be running already, you
should let the default value as it is (0).
value for the system clock driver. As driver initialization might need
the clock to be running already, you should let the default value as it
is (0).
endmenu

View file

@ -27,14 +27,6 @@
* The systick device provides a 24-bit clear-on-write, decrementing,
* wrap-on-zero counter. Only edge sensitive triggered interrupt is supported.
*
* \INTERNAL PACKAGING DETAILS
* The systick device driver is part of the microkernel in both a monolithic
* kernel system and a split kernel system; it is not included in the
* nanokernel portion of a split kernel.
*
* The device driver is also part of a nanokernel-only system, but omits more
* complex capabilities (such as tickless idle support) that are only used in
* conjunction with a microkernel.
*/
#include <kernel.h>
@ -199,7 +191,7 @@ static ALWAYS_INLINE void sysTickReloadSet(
* @brief System clock tick handler
*
* This routine handles the system clock tick interrupt. A TICK_EVENT event
* is pushed onto the microkernel stack.
* is pushed onto the kernel stack.
*
* The symbol for this routine is either _timer_int_handler.
*
@ -455,9 +447,8 @@ void _timer_idle_exit(void)
if (timer_mode == TIMER_MODE_PERIODIC) {
/*
* The timer interrupt handler is handling a completed tickless
* idle
* or this has been called by mistake; there's nothing to do
* here.
* idle or this has been called by mistake; there's nothing to
* do here.
*/
return;
}
@ -477,11 +468,10 @@ void _timer_idle_exit(void)
timer_mode = TIMER_MODE_PERIODIC;
/*
* Announce elapsed ticks to the microkernel. Note we are
* guaranteed
* Announce elapsed ticks to the kernel. Note we are guaranteed
* that the timer ISR will execute before the tick event is
* serviced,
* so _sys_idle_elapsed_ticks is adjusted to account for it.
* serviced, so _sys_idle_elapsed_ticks is adjusted to account
* for it.
*/
_sys_idle_elapsed_ticks = idle_original_ticks - 1;
_sys_clock_tick_announce();
@ -498,16 +488,15 @@ void _timer_idle_exit(void)
if (remaining == 0) {
/*
* Idle was interrupted on a tick boundary. Re-set the
* timer to
* its default value and mode.
* timer to its default value and mode.
*/
sysTickReloadSet(default_load_value);
timer_mode = TIMER_MODE_PERIODIC;
} else if (count > remaining) {
/*
* There is less time remaining to the next tick
* boundary than
* time left for idle. Leave in "one shot" mode.
* boundary than time left for idle. Leave in "one
* shot" mode.
*/
sysTickReloadSet(remaining);
}

View file

@ -47,11 +47,8 @@
* non-timer interrupt to occur. When the CPU ceases idling the driver
* determines how many complete ticks have elapsed, reprograms the timer so that
* it expires on the next tick, and announces the number of elapsed ticks (if
* any) to the microkernel.
* any) to the kernel.
*
* In a nanokernel-only system this device driver omits more complex
* capabilities (such as tickless idle support) that are only used with a
* microkernel.
*/
#include <kernel.h>
@ -232,7 +229,7 @@ static uint64_t _hpetMainCounterAtomic(void)
* @brief System clock tick handler
*
* This routine handles the system clock tick interrupt. A TICK_EVENT event
* is pushed onto the microkernel stack.
* is pushed onto the kernel stack.
*
* @return N/A
*/
@ -365,9 +362,9 @@ void _timer_idle_exit(void)
_sys_idle_elapsed_ticks = programmed_ticks - 1;
/*
* Announce elapsed ticks to the microkernel. Note we are
* guaranteed that the timer ISR will execute first before the
* tick event is serviced.
* Announce elapsed ticks to the kernel. Note we are guaranteed
* that the timer ISR will execute first before the tick event
* is serviced.
*/
_sys_clock_tick_announce();
@ -387,7 +384,7 @@ void _timer_idle_exit(void)
* and program the timer for the tick after that
*
* note: a premature tick declaration has no significant impact on
* the microkernel, which gets informed of the correct number of elapsed
* the kernel, which gets informed of the correct number of elapsed
* ticks when the following tick finally occurs; however, any ISRs that
* access _sys_idle_elapsed_ticks to determine the current time may be
* misled during the (very brief) interval before the tick-in-progress
@ -419,7 +416,7 @@ void _timer_idle_exit(void)
_sys_idle_elapsed_ticks = elapsedTicks;
if (_sys_idle_elapsed_ticks) {
/* Announce elapsed ticks to the microkernel */
/* Announce elapsed ticks to the kernel */
_sys_clock_tick_announce();
}

View file

@ -249,15 +249,6 @@ static inline uint32_t initial_count_register_get(void)
}
#endif /* CONFIG_TICKLESS_IDLE */
/**
*
* @brief System clock tick handler
*
* This routine handles the system clock tick interrupt. A TICK_EVENT event
* is pushed onto the microkernel stack.
*
* @return N/A
*/
void _timer_int_handler(void *unused /* parameter is not used */
)
{
@ -432,7 +423,7 @@ void _timer_idle_exit(void)
_sys_idle_elapsed_ticks = programmed_full_ticks;
/*
* Announce elapsed ticks to the microkernel. Note we are guaranteed
* Announce elapsed ticks to the kernel. Note we are guaranteed
* that the timer ISR will execute before the tick event is serviced.
* (The timer ISR reprograms the timer for the next tick.)
*/

View file

@ -19,19 +19,12 @@
* @brief Initialize system clock driver
*
* Initializing the timer driver is done in this module to reduce code
* duplication. Although both nanokernel and microkernel systems initialize
* the timer driver at the same point, the two systems differ in when the system
* can begin to process system clock ticks. A nanokernel system can process
* system clock ticks once the driver has initialized. However, in a
* microkernel system all system clock ticks are deferred (and stored on the
* kernel server command stack) until the kernel server fiber starts and begins
* processing any queued ticks.
* duplication.
*/
#include <kernel.h>
#include <init.h>
#include <drivers/system_timer.h>
SYS_DEVICE_DEFINE("sys_clock", _sys_clock_driver_init,
sys_clock_device_ctrl, POST_KERNEL,
CONFIG_SYSTEM_CLOCK_INIT_PRIORITY);
SYS_DEVICE_DEFINE("sys_clock", _sys_clock_driver_init, sys_clock_device_ctrl,
POST_KERNEL, CONFIG_SYSTEM_CLOCK_INIT_PRIORITY);

View file

@ -422,8 +422,7 @@ config INIT_STACKS
This option instructs the kernel to initialize stack areas with a
known value (0xaa) before they are first used, so that the high
water mark can be easily determined. This applies to the stack areas
for both tasks and fibers, as well as for the microkernel server's command
stack.
for threads.
config XIP
bool
@ -440,11 +439,12 @@ config RING_BUFFER
prompt "Enable ring buffers"
default n
help
Enable usage of ring buffers. Similar to nanokernel FIFOs but manage
their own buffer memory and can store arbitrary data. For optimal
performance, use buffer sizes that are a power of 2.
Enable usage of ring buffers. This is similar to kernel FIFOs but ring
buffers manage their own buffer memory and can store arbitrary data.
For optimal performance, use buffer sizes that are a power of 2.
menu "Initialization Priorities"
config KERNEL_INIT_PRIORITY_OBJECTS
int
prompt "Kernel objects initialization priority"