Rename hidden TICKLESS_KERNEL config option to SYS_CLOCK_EXISTS

The revised option name more accurately describes its purpose, and
avoids potential confusion with the microkernel's tickless idle
capability. Also, inverting the "polarity" of the option means that
conditional code that references it does not have to use negative
logic, which make the code easier to comprehend.

Change-Id: I0c6f82f077a87a28544048d214efa7020939e566
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
This commit is contained in:
Allan Stephens 2015-05-12 09:01:47 -04:00 committed by Anas Nashif
commit 103e84abcb
18 changed files with 54 additions and 54 deletions

View file

@ -49,7 +49,7 @@ extern int _task_event_recv(kevent_t event, int32_t time);
#define task_event_recv(event) _task_event_recv(event, TICKS_NONE)
#define task_event_recv_wait(event) _task_event_recv(event, TICKS_UNLIMITED)
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
#define task_event_recv_wait_timeout(event, time) _task_event_recv(event, time)
#endif

View file

@ -46,14 +46,14 @@ extern int _task_fifo_ioctl(kfifo_t queue, int op);
#define task_fifo_put(q, p) _task_fifo_put(q, p, TICKS_NONE)
#define task_fifo_put_wait(q, p) _task_fifo_put(q, p, TICKS_UNLIMITED)
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
#define task_fifo_put_wait_timeout(q, p, t) _task_fifo_put(q, p, t)
#endif
#define task_fifo_get(q, p) _task_fifo_get(q, p, TICKS_NONE)
#define task_fifo_get_wait(q, p) _task_fifo_get(q, p, TICKS_UNLIMITED)
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
#define task_fifo_get_wait_timeout(q, p, t) _task_fifo_get(q, p, t)
#endif

View file

@ -61,14 +61,14 @@ extern int _task_mbox_data_get_async_block(struct k_msg *M,
#define task_mbox_put(b, p, m) _task_mbox_put(b, p, m, TICKS_NONE)
#define task_mbox_put_wait(b, p, m) _task_mbox_put(b, p, m, TICKS_UNLIMITED)
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
#define task_mbox_put_wait_timeout(b, p, m, t) _task_mbox_put(b, p, m, t)
#endif
#define task_mbox_get(b, m) _task_mbox_get(b, m, TICKS_NONE)
#define task_mbox_get_wait(b, m) _task_mbox_get(b, m, TICKS_UNLIMITED)
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
#define task_mbox_get_wait_timeout(b, m, t) _task_mbox_get(b, m, t)
#endif
@ -79,7 +79,7 @@ extern int _task_mbox_data_get_async_block(struct k_msg *M,
#define task_mbox_data_get_async_block_wait(m, b, p) \
_task_mbox_data_get_async_block(m, b, p, TICKS_UNLIMITED)
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
#define task_mbox_data_get_async_block_wait_timeout(m, b, p, t) \
_task_mbox_data_get_async_block(m, b, p, t)
#endif

View file

@ -45,7 +45,7 @@ extern void _task_mem_map_free(kmemory_map_t mmap, void **mptr);
#define task_mem_map_alloc_wait(m, p) _task_mem_map_alloc(m, p, TICKS_UNLIMITED)
#define task_mem_map_free(m, p) _task_mem_map_free(m, p)
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
#define task_mem_map_alloc_wait_timeout(m, p, t) _task_mem_map_alloc(m, p, t)
#endif

View file

@ -43,7 +43,7 @@ extern void _task_mutex_unlock(kmutex_t);
#define task_mutex_lock(m) _task_mutex_lock(m, TICKS_NONE)
#define task_mutex_lock_wait(m) _task_mutex_lock(m, TICKS_UNLIMITED)
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
#define task_mutex_lock_wait_timeout(m, t) _task_mutex_lock(m, t)
#endif

View file

@ -45,7 +45,7 @@ extern void task_mem_pool_defragment(kmemory_pool_t pid);
#define task_mem_pool_alloc(b, pid, s) _task_mem_pool_alloc(b, pid, s, TICKS_NONE)
#define task_mem_pool_alloc_wait(b, pid, s) _task_mem_pool_alloc(b, pid, s, TICKS_UNLIMITED)
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
#define task_mem_pool_alloc_wait_timeout(b, pid, s, t) _task_mem_pool_alloc(b, pid, s, t)
#endif

View file

@ -54,7 +54,7 @@ extern ksem_t _task_sem_group_take(ksemg_t semagroup, int32_t time);
#define task_sem_take_wait(s) _task_sem_take(s, TICKS_UNLIMITED)
#define task_sem_group_take_wait(g) _task_sem_group_take(g, TICKS_UNLIMITED)
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
#define task_sem_take_wait_timeout(s, t) _task_sem_take(s, t)
#define task_sem_group_take_wait_timeout(g, t) _task_sem_group_take(g, t)
#endif

View file

@ -56,7 +56,7 @@ extern void task_irq_free(kirq_t irq_obj);
#define task_irq_test(irq_obj) _task_irq_test(irq_obj, TICKS_NONE)
#define task_irq_test_wait(irq_obj) _task_irq_test(irq_obj, TICKS_UNLIMITED)
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
#define task_irq_test_wait_timeout(irq_obj, time) _task_irq_test(irq_obj, time)
#endif

View file

@ -144,7 +144,7 @@ void _k_event_test(struct k_args *A)
A->Ctxt.proc = _k_current_task;
E->waiter = A;
set_state_bit(_k_current_task, TF_EVNT);
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (A->Time.ticks == TICKS_UNLIMITED) {
A->Time.timer = NULL;
} else {
@ -216,7 +216,7 @@ void _k_do_event_signal(kevent_t event)
}
/* if proc waiting, will be rescheduled */
if (((A) != NULL) && (E->status != 0)) {
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (A->Time.timer != NULL) {
delist_timeout(A->Time.timer);
A->Comm = NOP;

View file

@ -391,7 +391,7 @@ void _k_mbox_send_request(struct k_args *Writer)
}
CopyReader->Forw = NULL;
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (CopyReader->Time.timer != NULL) {
/*
* The reader was trying to handshake with
@ -453,7 +453,7 @@ void _k_mbox_send_request(struct k_args *Writer)
/* Put the letter into the mailbox */
INSERT_ELM(MailBox->Writers, CopyWriter);
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (CopyWriter->Time.ticks == TICKS_UNLIMITED) {
/* This is a wait operation; there is no timer. */
CopyWriter->Time.timer = NULL;
@ -556,7 +556,7 @@ void _k_mbox_receive_ack(struct k_args *pCopyReader)
void _k_mbox_receive_reply(struct k_args *pCopyReader)
{
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
FREETIMER(pCopyReader->Time.timer);
REMOVE_ELM(pCopyReader);
pCopyReader->Time.rcode = RC_TIME;
@ -617,7 +617,7 @@ void _k_mbox_receive_request(struct k_args *Reader)
}
CopyWriter->Forw = NULL;
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (CopyWriter->Time.timer != NULL) {
/*
* The writer was trying to handshake with
@ -669,7 +669,7 @@ void _k_mbox_receive_request(struct k_args *Reader)
/* Put the letter into the mailbox */
INSERT_ELM(MailBox->Readers, CopyReader);
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (CopyReader->Time.ticks == TICKS_UNLIMITED) {
/* This is a wait operation; there is no timer. */
CopyReader->Time.timer = NULL;
@ -760,7 +760,7 @@ void _task_mbox_put_async(kmbox_t mbox, /* mailbox to which to send message */
M->mailbox = mbox;
M->extra.sema = sema;
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
A.Time.timer = NULL;
#endif
A.Prio = prio;

View file

@ -119,7 +119,7 @@ void _k_mem_map_alloc(struct k_args *A)
A->Ctxt.proc = _k_current_task;
set_state_bit(_k_current_task, TF_ALLO);
INSERT_ELM(M->Waiters, A);
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (A->Time.ticks == TICKS_UNLIMITED)
A->Time.timer = NULL;
else {
@ -177,7 +177,7 @@ void _k_mem_map_dealloc(struct k_args *A)
*(X->Args.a1.mptr) = M->Free;
M->Free = *(char **)(M->Free);
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (X->Time.timer) {
delist_timeout(X->Time.timer);
X->Comm = NOP;

View file

@ -453,7 +453,7 @@ void _k_block_waiters_get(struct k_args *A)
/* reschedule task */
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (curr_task->Time.timer) {
delist_timeout(curr_task->Time.timer);
}
@ -541,7 +541,7 @@ void _k_mem_pool_block_get(struct k_args *A)
/* INSERT_ELM (P->frag_tab[offset].Waiters, A); */
INSERT_ELM(P->Waiters, A);
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (A->Time.ticks == TICKS_UNLIMITED) {
A->Time.timer = NULL;
} else {

View file

@ -77,7 +77,7 @@ void _k_mutex_lock_reply(
struct k_args *A /* pointer to mutex lock reply request arguments */
)
{
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
struct mutex_struct *Mutex; /* pointer to internal mutex structure */
struct k_args *PrioChanger; /* used to change a task's priority level */
struct k_args *FirstWaiter; /* pointer to first task in wait queue */
@ -221,7 +221,7 @@ void _k_mutex_lock_request(struct k_args *A /* pointer to mutex lock
set_state_bit(_k_current_task, TF_LOCK);
/* Note: Mutex->Waiters is a priority sorted list */
INSERT_ELM(Mutex->Waiters, A);
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (A->Time.ticks == TICKS_UNLIMITED) {
/* Request will not time out */
A->Time.timer = NULL;
@ -360,7 +360,7 @@ void _k_mutex_unlock(struct k_args *A /* pointer to mutex unlock
Mutex->OwnerCurrentPrio = X->Prio;
Mutex->OwnerOriginalPrio = X->Prio;
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (X->Time.timer) {
/*
* Trigger a call to _k_mutex_lock_reply()--it will
@ -376,7 +376,7 @@ void _k_mutex_unlock(struct k_args *A /* pointer to mutex unlock
*/
X->Time.rcode = RC_OK;
reset_state_bit(X->Ctxt.proc, TF_LOCK);
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
}
#endif
} else {

View file

@ -45,7 +45,7 @@
void _k_fifo_enque_reply(struct k_args *A)
{
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (A->Time.timer)
FREETIMER(A->Time.timer);
if (unlikely(A->Comm == ENQ_TMO)) {
@ -87,7 +87,7 @@ void _k_fifo_enque_request(struct k_args *A)
p = W->Args.q1.data;
k_memcpy(p, q, w);
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (W->Time.timer) {
force_timeout(W);
W->Comm = DEQ_RPL;
@ -96,7 +96,7 @@ void _k_fifo_enque_request(struct k_args *A)
W->Time.rcode = RC_OK;
reset_state_bit(W->Ctxt.proc, TF_DEQU);
}
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
}
#endif
else {
@ -124,7 +124,7 @@ void _k_fifo_enque_request(struct k_args *A)
A->Prio = _k_current_task->Prio;
set_state_bit(_k_current_task, TF_ENQU);
INSERT_ELM(Q->Waiters, A);
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (A->Time.ticks == TICKS_UNLIMITED)
A->Time.timer = NULL;
else {
@ -172,7 +172,7 @@ int _task_fifo_put(kfifo_t queue, /* FIFO queue */
void _k_fifo_deque_reply(struct k_args *A)
{
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (A->Time.timer)
FREETIMER(A->Time.timer);
if (unlikely(A->Comm == DEQ_TMO)) {
@ -230,7 +230,7 @@ void _k_fifo_deque_request(struct k_args *A)
else
Q->Enqp = p;
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (W->Time.timer) {
force_timeout(W);
W->Comm = ENQ_RPL;
@ -238,7 +238,7 @@ void _k_fifo_deque_request(struct k_args *A)
#endif
W->Time.rcode = RC_OK;
reset_state_bit(W->Ctxt.proc, TF_ENQU);
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
}
#endif
#ifdef CONFIG_OBJECT_MONITOR
@ -253,7 +253,7 @@ void _k_fifo_deque_request(struct k_args *A)
set_state_bit(_k_current_task, TF_DEQU);
INSERT_ELM(Q->Waiters, A);
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (A->Time.ticks == TICKS_UNLIMITED)
A->Time.timer = NULL;
else {
@ -316,7 +316,7 @@ void _k_fifo_ioctl(struct k_args *A)
while ((X = Q->Waiters)) {
Q->Waiters = X->Forw;
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (likely(X->Time.timer)) {
force_timeout(X);
X->Comm = ENQ_RPL;
@ -324,7 +324,7 @@ void _k_fifo_ioctl(struct k_args *A)
#endif
X->Time.rcode = RC_FAIL;
reset_state_bit(X->Ctxt.proc, TF_ENQU);
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
}
#endif
}

View file

@ -59,7 +59,7 @@ static void signal_semaphore(int n, struct sem_struct *S)
while (A && S->Level) {
X = A->Forw;
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (A->Comm == WAITSREQ || A->Comm == WAITSTMO)
#else
if (A->Comm == WAITSREQ)
@ -70,7 +70,7 @@ static void signal_semaphore(int n, struct sem_struct *S)
Y->Forw = X;
else
S->Waiters = X;
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (A->Time.timer) {
force_timeout(A);
A->Comm = WAITSRPL;
@ -78,7 +78,7 @@ static void signal_semaphore(int n, struct sem_struct *S)
#endif
A->Time.rcode = RC_OK;
reset_state_bit(A->Ctxt.proc, TF_SEMA);
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
}
#endif
}
@ -224,7 +224,7 @@ void _k_sem_group_wait_timeout(struct k_args *A)
{
ksem_t *L;
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (A->Time.timer)
FREETIMER(A->Time.timer);
#endif
@ -261,7 +261,7 @@ void _k_sem_group_ready(struct k_args *R)
if (A->Args.s1.sema == ENDLIST) {
A->Args.s1.sema = R->Args.s1.sema;
A->Comm = WAITMTMO;
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (A->Time.timer)
force_timeout(A);
else
@ -280,7 +280,7 @@ void _k_sem_group_ready(struct k_args *R)
void _k_sem_wait_reply(struct k_args *A)
{
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (A->Time.timer)
FREETIMER(A->Time.timer);
if (A->Comm == WAITSTMO) {
@ -367,7 +367,7 @@ void _k_sem_group_wait_any(struct k_args *A)
A->Ctxt.proc = _k_current_task;
set_state_bit(_k_current_task, TF_LIST);
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (A->Time.ticks != TICKS_NONE) {
if (A->Time.ticks == TICKS_UNLIMITED)
A->Time.timer = NULL;
@ -402,7 +402,7 @@ void _k_sem_wait_request(struct k_args *A)
A->Prio = _k_current_task->Prio;
set_state_bit(_k_current_task, TF_SEMA);
INSERT_ELM(S->Waiters, A);
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (A->Time.ticks == TICKS_UNLIMITED)
A->Time.timer = NULL;
else {

View file

@ -60,7 +60,7 @@ static kpriority_t slice_prio =
int32_t _sys_idle_elapsed_ticks = 0; /* Initial value must be 0 */
#endif
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
int sys_clock_us_per_tick = 1000000 / sys_clock_ticks_per_sec;
int sys_clock_hw_cycles_per_tick =
sys_clock_hw_cycles_per_sec / sys_clock_ticks_per_sec;

View file

@ -37,7 +37,7 @@
#include <sections.h>
#include <drivers/system_timer.h>
#ifndef CONFIG_TICKLESS_KERNEL
#ifdef CONFIG_SYS_CLOCK_EXISTS
int sys_clock_us_per_tick = 1000000 / sys_clock_ticks_per_sec;
int sys_clock_hw_cycles_per_tick =
sys_clock_hw_cycles_per_sec / sys_clock_ticks_per_sec;

View file

@ -113,18 +113,18 @@ config SYS_CLOCK_HW_CYCLES_PER_SEC
Frequency of the hardware timer used for the system clock
(in Hz).
config TICKLESS_KERNEL
config SYS_CLOCK_EXISTS
bool
# omit prompt to signify a "hidden" option
default y if (SYS_CLOCK_TICKS_PER_SEC = 0)
default n
default n if (SYS_CLOCK_TICKS_PER_SEC = 0)
default y
help
This option specifies that the kernel lacks timer support.
This option specifies that system clock support is enabled.
config NUM_TIMER_PACKETS
int
prompt "Number of timer packets" if !TICKLESS_KERNEL
default 0 if TICKLESS_KERNEL
prompt "Number of timer packets" if SYS_CLOCK_EXISTS
default 0 if !SYS_CLOCK_EXISTS
default 10
depends on MICROKERNEL
help
@ -135,7 +135,7 @@ config TIMESLICING
bool
prompt "Task time slicing"
default y
depends on MICROKERNEL && !TICKLESS_KERNEL
depends on MICROKERNEL && SYS_CLOCK_EXISTS
help
This option enables time slicing between tasks of equal priority.