Lines Matching +full:t0 +full:- +full:out

2  * Copyright (c) 2012-2015 Wind River Systems, Inc.
4 * SPDX-License-Identifier: Apache-2.0
42 #define UNKNOWN_COMMAND -1
43 #define INVALID_BEHAVIOUR -2
54 * The Cortex-M use the SYSTICK exception for the system timer, which is
75 /* Cortex-M1 and Nios II do have a power saving instruction, so k_cpu_idle()
138 if (arch_current_thread()->base.prio < 0) { in isr_handler()
225 uint64_t t0, dt; in _test_kernel_cpu_idle() local
236 t0 = k_uptime_ticks(); in _test_kernel_cpu_idle()
251 dt = k_uptime_ticks() - t0; in _test_kernel_cpu_idle()
252 zassert_true(abs((int32_t) (dt - dur)) <= slop, in _test_kernel_cpu_idle()
294 * - The kernel architecture provide an idle function to be run when the system
296 * - This routine tests the k_cpu_atomic_idle() routine
299 * - Functional and black box testing
300 * - Interface testing
303 * - HAS_POWERSAVE_INSTRUCTION is set
306 * - N/A
309 * -# Record system time before cpu enters idle state
310 * -# Enter cpu idle state by k_cpu_atomic_idle()
311 * -# Record system time after cpu idle state is interrupted
312 * -# Compare the two system time values.
315 * - cpu enters idle state for a given time
318 * - Success if the cpu enters idle state, failure otherwise.
321 * - N/A
340 * - The kernel architecture provide an idle function to be run when the system
342 * - This routine tests the k_cpu_idle() routine
345 * - Functional and black box testing
346 * - Interface testing
349 * - HAS_POWERSAVE_INSTRUCTION is set
352 * - N/A
355 * -# Record system time before cpu enters idle state
356 * -# Enter cpu idle state by k_cpu_idle()
357 * -# Record system time after cpu idle state is interrupted
358 * -# Compare the two system time values.
361 * - cpu enters idle state for a given time
364 * - Success if the cpu enters idle state, failure otherwise.
367 * - N/A
428 * Re-enable interrupts before returning (for both success and failure in _test_kernel_interrupts()
459 * - To verify kernel architecture layer shall provide a mechanism to
461 * - This routine tests the routines for disabling and enabling interrupts.
465 * - Interface testing, function and black box testing,
469 * - CONFIG_TICKLESS_KERNEL is not set.
472 * - N/A
475 * -# Do action to align to a tick boundary.
476 * -# Left shift 4 bits for the value of counts.
477 * -# Call irq_lock() and restore its return value to imask.
478 * -# Call sys_clock_tick_get_32() and store its return value to tick.
479 * -# Repeat counts of calling sys_clock_tick_get_32().
480 * -# Call sys_clock_tick_get_32() and store its return value to tick2.
481 * -# Call irq_unlock() with parameter imask.
482 * -# Check if tick is equal to tick2.
483 * -# Repeat counts of calling sys_clock_tick_get_32().
484 * -# Call sys_clock_tick_get_32() and store its return value to tick2.
485 * -# Check if tick is NOT equal to tick2.
488 * - The ticks shall not increase while interrupt locked.
491 * - Successful if check points in test procedure are all passed, otherwise
495 * - N/A
506 _test_kernel_interrupts(irq_lock_wrapper, irq_unlock_wrapper, -1); in ZTEST()
516 * - To verify the kernel architecture layer shall provide a mechanism to
519 * - This routine tests the routines for disabling and enabling interrupts.
523 * - Interface testing, function and black box testing,
527 * - TICK_IRQ is defined.
530 * - N/A
533 * -# Do action to align to a tick boundary.
534 * -# Left shift 4 bit for the value of counts.
535 * -# Call irq_disable() and restore its return value to imask.
536 * -# Call sys_clock_tick_get_32() and store its return value to tick.
537 * -# Repeat counts of calling sys_clock_tick_get_32().
538 * -# Call sys_clock_tick_get_32() and store its return value to tick2.
539 * -# Call irq_enable() with parameter imask.
540 * -# Check if tick is equal to tick2.
541 * -# Repeat counts of calling sys_clock_tick_get_32().
542 * -# Call sys_clock_tick_get_32() and store its return value to tick2.
543 * -# Check if tick is NOT equal to tick2.
546 * - The ticks shall not increase while interrupt locked.
549 * - Successful if check points in test procedure are all passed, otherwise
553 * - Note that this test works by disabling the timer interrupt
579 * - Thread context handles derived from context switches must be able to be
583 * - Functional and black box testing
584 * - Interface testing
587 * - N/A
590 * - N/A
593 * -# Set priority of current thread to 0 as a preemptible thread
594 * -# Trap to interrupt context, get thread id of the interrupted thread and
596 * -# Return to thread context and make sure this context is interrupted by
598 * -# Pass command to isr to check whether the isr is executed in interrupt
600 * -# When return to thread context, check the return value of command.
603 * - Thread context restored upon interrupt exit
606 * - Success if context of thread restored correctly, failure otherwise.
609 * - N/A
646 zassert_false(arch_current_thread()->base.prio < 0, in ZTEST()
648 arch_current_thread()->base.prio); in ZTEST()
686 zassert_false((arch_current_thread()->base.prio >= 0), in _test_kernel_thread()
721 k_thread_priority_set(self_thread_id, self_thread_id->base.prio + 1); in thread_helper()
756 K_PRIO_COOP(THREAD_PRIORITY - 1), 0, K_NO_WAIT); in k_yield_entry()
784 k_thread_priority_set(self_thread_id, self_thread_id->base.prio - 1); in k_yield_entry()
866 * time out and report an error.) in busy_wait_thread()
872 /* a thread sleeps and times out, then reports through a fifo */
883 timestamp = k_uptime_get() - timestamp; in thread_sleep()
888 TC_ERROR("timestamp out of range, got %d\n", (int)timestamp); in thread_sleep()
904 timeout->q_order, timeout->timeout); in delayed_thread()
930 zassert_false(rv, " *** thread timed out waiting for " "k_busy_wait()"); in ZTEST()
956 zassert_equal(rv, 0, " *** thread timed out waiting for thread on " in ZTEST()
975 zassert_equal(data->timeout_order, i, in ZTEST()
977 "expected %d)\n", data->timeout_order, i); in ZTEST()
980 data->q_order, data->timeout); in ZTEST()
1035 zassert_equal(data->timeout_order, i, in ZTEST()
1037 "expected %d)\n", data->timeout_order, i); in ZTEST()
1040 "as expected\n", data->q_order, data->timeout, in ZTEST()
1041 data->timeout_order); in ZTEST()