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>
This commit is contained in:
Benjamin Walsh 2015-08-12 15:37:58 -04:00 committed by Anas Nashif
commit aa78793e40
15 changed files with 36 additions and 36 deletions

View file

@ -36,8 +36,8 @@ The ARM Cortex-M architecture provides its own _TaskAbort() to deal with
different CPU modes (handler vs thread) when a task aborts. When its entry different CPU modes (handler vs thread) when a task aborts. When its entry
point returns or when it aborts itself, the CPU is in thread mode and must point returns or when it aborts itself, the CPU is in thread mode and must
call the equivalent of task_abort(<self>), but when in handler mode, the call the equivalent of task_abort(<self>), but when in handler mode, the
CPU must queue a packet to K_swapper(), then exit handler mode to queue the CPU must queue a packet to _k_server(), then exit handler mode to queue the
PendSV exception and cause the immediate context switch to K_swapper. PendSV exception and cause the immediate context switch to _k_server.
*/ */
#ifdef CONFIG_MICROKERNEL #ifdef CONFIG_MICROKERNEL

View file

@ -75,9 +75,9 @@ extern void fiber_event_send(kevent_t event);
* @brief Set event handler request * @brief Set event handler request
* *
* This routine specifies the event handler that runs (in the context of the * This routine specifies the event handler that runs (in the context of the
* K_swapper fiber) when the associated event is signaled. Specifying a non-NULL * microkernel server fiber) when the associated event is signaled. Specifying
* handler installs a new handler, while specifying a NULL event handler removes * a non-NULL handler installs a new handler, while specifying a NULL event
* the existing event handler. * handler removes the existing event handler.
* *
* A new event handler cannot be installed if one already exists for that event; * A new event handler cannot be installed if one already exists for that event;
* the old handler must be removed first. However, it is permitted to replace * the old handler must be removed first. However, it is permitted to replace

View file

@ -76,7 +76,7 @@ config INIT_STACKS
This option instructs the kernel to initialize stack areas with a This option instructs the kernel to initialize stack areas with a
known value (0xaa) before they are first used, so that the high known value (0xaa) before they are first used, so that the high
water mark can be easily determined. This applies to the stack areas water mark can be easily determined. This applies to the stack areas
for both tasks and fibers, as well as for the K_swapper's command for both tasks and fibers, as well as for the microkernel server's command
stack. stack.
config XIP config XIP

View file

@ -34,12 +34,12 @@ menu "Microkernel Options"
config MICROKERNEL_SERVER_STACK_SIZE config MICROKERNEL_SERVER_STACK_SIZE
int int
prompt "Microkernel server fiber (K_swapper) stack size" prompt "Microkernel server fiber (_k_server) stack size"
default 1024 default 1024
depends on MICROKERNEL depends on MICROKERNEL
help help
This option specifies the size of the stack used by the microkernel This option specifies the size of the stack used by the microkernel
server fiber, whose entry point is K_swapper(). This must be able server fiber, whose entry point is _k_server(). This must be able
to handle the deepest call stack for internal handling of microkernel to handle the deepest call stack for internal handling of microkernel
config MICROKERNEL_SERVER_PRIORITY config MICROKERNEL_SERVER_PRIORITY
@ -66,12 +66,12 @@ config PRIORITY_CEILING
config COMMAND_STACK_SIZE config COMMAND_STACK_SIZE
int int
prompt "K_swapper command stack size (in packets)" prompt "Microkernel server command stack size (in packets)"
default 64 default 64
depends on MICROKERNEL depends on MICROKERNEL
help help
This option specifies the maximum number of command packets that This option specifies the maximum number of command packets that
can be queued up for processing by the kernel's K_swapper fiber. can be queued up for processing by the kernel's _k_server fiber.
config NUM_COMMAND_PACKETS config NUM_COMMAND_PACKETS
int int
@ -82,7 +82,7 @@ config NUM_COMMAND_PACKETS
This option specifies the number of packets in the command packet pool. This option specifies the number of packets in the command packet pool.
This pool needs to be large enough to accommodate all in-flight This pool needs to be large enough to accommodate all in-flight
asynchronous command requests as well as those internally issued by asynchronous command requests as well as those internally issued by
the microkernel server fiber (K_swapper). the microkernel server fiber (_k_server).
config NUM_TIMER_PACKETS config NUM_TIMER_PACKETS
int int

View file

@ -95,7 +95,7 @@ cmdPkt_t *_cmd_pkt_get(
/** /**
* *
* @brief Send command packet to be processed by K_swapper * @brief Send command packet to be processed by _k_server
* *
* @return N/A * @return N/A
*/ */

View file

@ -65,7 +65,7 @@ struct nano_stack _k_command_stack = {NULL,
_k_server_command_stack_storage}; _k_server_command_stack_storage};
extern void K_swapper(int i1, int i2); extern void _k_server(int i1, int i2);
void _k_kernel_init(void) void _k_kernel_init(void)
{ {
@ -88,7 +88,7 @@ void _k_kernel_init(void)
task_fiber_start(_k_server_stack, task_fiber_start(_k_server_stack,
CONFIG_MICROKERNEL_SERVER_STACK_SIZE, CONFIG_MICROKERNEL_SERVER_STACK_SIZE,
K_swapper, _k_server,
0, 0,
0, 0,
CONFIG_MICROKERNEL_SERVER_PRIORITY, CONFIG_MICROKERNEL_SERVER_PRIORITY,

View file

@ -244,8 +244,8 @@ static int _k_task_irq_alloc(
* This routine connects a task IRQ object to a system interrupt based * This routine connects a task IRQ object to a system interrupt based
* upon the specified IRQ and priority values. * upon the specified IRQ and priority values.
* *
* IRQ allocation is done via K_swapper so that simultaneous allocation * IRQ allocation is done via the microkernel server fiber so that simultaneous
* requests are single-threaded. * allocation requests are single-threaded.
* *
* @return assigned interrupt vector if successful, INVALID_VECTOR if not * @return assigned interrupt vector if successful, INVALID_VECTOR if not
*/ */

View file

@ -36,7 +36,7 @@ This module provides a "do nothing" kernel service.
This service is primarily used by other kernel services that need a way to This service is primarily used by other kernel services that need a way to
resume the execution of a kernel request that could not be completed in a resume the execution of a kernel request that could not be completed in a
single invocation of the K_swapper fiber. However, it can also be used by single invocation of the _k_server fiber. However, it can also be used by
a task to measure the overhead involved in issuing a kernel service request. a task to measure the overhead involved in issuing a kernel service request.
*/ */
@ -60,7 +60,7 @@ void _k_nop(struct k_args *A)
* *
* @brief "do nothing" kernel request * @brief "do nothing" kernel request
* *
* This routine is a request for the K_swapper to run a "do nothing" routine. * This routine is a request for the _k_server to run a "do nothing" routine.
* *
* @return N/A * @return N/A
*/ */

View file

@ -38,7 +38,7 @@
* @brief Process an "offload to fiber" request * @brief Process an "offload to fiber" request
* *
* This routine simply invokes the requested function from within the context * This routine simply invokes the requested function from within the context
* of the K_swapper() fiber and saves the result. * of the _k_server() fiber and saves the result.
* *
* @return N/A * @return N/A
*/ */
@ -50,13 +50,13 @@ void _k_offload_to_fiber(struct k_args *A)
/** /**
* *
* @brief Issue a custom call from within K_swapper() * @brief Issue a custom call from within the microkernel server fiber
* *
* @func: function to call from within K_swapper() * @func: function to call from within the microkernel server fiber
* @argp: argument to pass to custom function * @argp: argument to pass to custom function
* *
* This routine issues a request to execute a function from within the context * This routine issues a request to execute a function from within the context
* of the K_swapper() fiber. * of the microkernel server fiber.
* *
* @return return value from custom <func> call * @return return value from custom <func> call
*/ */

View file

@ -97,7 +97,7 @@ static struct k_proc *next_task_select(void)
* @return Does not return. * @return Does not return.
*/ */
FUNC_NORETURN void K_swapper(int parameter1, /* not used */ FUNC_NORETURN void _k_server(int parameter1, /* not used */
int parameter2 /* not used */ int parameter2 /* not used */
) )
{ {
@ -169,7 +169,7 @@ FUNC_NORETURN void K_swapper(int parameter1, /* not used */
} }
/* /*
* Code analyzers may complain that K_swapper() uses an infinite loop * Code analyzers may complain that _k_server() uses an infinite loop
* unless we indicate that this is intentional * unless we indicate that this is intentional
*/ */

View file

@ -297,7 +297,7 @@ void sys_scheduler_time_slice_set(int32_t t, kpriority_t p)
* *
* @brief Handle elapsed ticks calculation request * @brief Handle elapsed ticks calculation request
* *
* This routine, called by K_swapper(), handles the request for calculating the * This routine, called by _k_server(), handles the request for calculating the
* time elapsed since the specified reference time. * time elapsed since the specified reference time.
* *
* @return N/A * @return N/A

View file

@ -213,7 +213,7 @@ void _k_timer_list_update(int ticks)
* *
* @brief Handle timer allocation request * @brief Handle timer allocation request
* *
* This routine, called by K_swapper(), handles the request for allocating a * This routine, called by _k_server(), handles the request for allocating a
* timer. * timer.
* *
* @param P Pointer to timer allocation request arguments. * @param P Pointer to timer allocation request arguments.
@ -255,7 +255,7 @@ ktimer_t task_timer_alloc(void)
* *
* @brief Handle timer deallocation request * @brief Handle timer deallocation request
* *
* This routine, called by K_swapper(), handles the request for deallocating a * This routine, called by _k_server(), handles the request for deallocating a
* timer. * timer.
* *
* @return N/A * @return N/A
@ -298,7 +298,7 @@ void task_timer_free(ktimer_t timer)
* *
* @brief Handle start timer request * @brief Handle start timer request
* *
* This routine, called by K_swapper(), handles the start timer request from * This routine, called by _k_server(), handles the start timer request from
* both task_timer_start() and task_timer_restart(). * both task_timer_start() and task_timer_restart().
* *
* @param P Pointer to timer start request arguments. * @param P Pointer to timer start request arguments.
@ -410,7 +410,7 @@ void task_timer_restart(ktimer_t timer, int32_t duration, int32_t period)
* *
* @brief Handle stop timer request * @brief Handle stop timer request
* *
* This routine, called by K_swapper(), handles the request for stopping a * This routine, called by _k_server(), handles the request for stopping a
* timer. * timer.
* *
* @return N/A * @return N/A
@ -449,7 +449,7 @@ void task_timer_stop(ktimer_t timer)
* *
* @brief Handle internally issued task wakeup request * @brief Handle internally issued task wakeup request
* *
* This routine, called by K_swapper(), handles the request for waking a task * This routine, called by _k_server(), handles the request for waking a task
* at the end of its sleep period. * at the end of its sleep period.
* *
* @return N/A * @return N/A
@ -471,7 +471,7 @@ void _k_task_wakeup(struct k_args *P)
* *
* @brief Handle task sleep request * @brief Handle task sleep request
* *
* This routine, called by K_swapper(), handles the request for putting a task * This routine, called by _k_server(), handles the request for putting a task
* to sleep. * to sleep.
* *
* @return N/A * @return N/A

View file

@ -11,7 +11,7 @@ The project can be built using several configurations:
minimal (a "do nothing" image that has support for few kernel capabilities) minimal (a "do nothing" image that has support for few kernel capabilities)
------- -------
- Idle task is only task in system. - Idle task is only task in system.
- K_swapper is only fiber in system. - _k_server is only fiber in system.
- No system timer support. - No system timer support.
- ISR for the spurious interrupt handling is present. - ISR for the spurious interrupt handling is present.
- IDT and stack memory sizes are very limited. - IDT and stack memory sizes are very limited.
@ -83,7 +83,7 @@ minimal
------- -------
This configuration does NOT produce any output. To observe its operation, This configuration does NOT produce any output. To observe its operation,
invoke it using gdb and observe that: invoke it using gdb and observe that:
- the kernel's timer ISR & K_swapper increment "K_LowTime" on a regular basis - the kernel's timer ISR & _k_server increment "K_LowTime" on a regular basis
- nano_cpu_idle() is invoked by the idle task each time K_LowTime is incremented - nano_cpu_idle() is invoked by the idle task each time K_LowTime is incremented
regular regular

View file

@ -6,10 +6,10 @@ This test verifies that the microkernel task_offload_to_fiber() API operates as
expected. expected.
This test has two tasks that increment a counter. The routine that This test has two tasks that increment a counter. The routine that
increments the counter is invoked from K_swapper() due to the two tasks increments the counter is invoked from _k_server() due to the two tasks
calling task_offload_to_fiber(). The final result of the counter is expected calling task_offload_to_fiber(). The final result of the counter is expected
to be the the number of times task_offload_to_fiber() was called to increment to be the the number of times task_offload_to_fiber() was called to increment
the counter as the incrementing was done in the context of K_swapper(). the counter as the incrementing was done in the context of _k_server().
This is done with time slicing both disabled and enabled to ensure that the This is done with time slicing both disabled and enabled to ensure that the
result always matches the number of times task_offload_to_fiber() is called. result always matches the number of times task_offload_to_fiber() is called.

View file

@ -47,7 +47,7 @@ static uint32_t altTaskIterations = 0;
/** /**
* *
* @brief Routine to be called from K_swapper() * @brief Routine to be called from _k_server()
* *
* This routine increments the global variable <criticalVar>. * This routine increments the global variable <criticalVar>.
* *