Lines Matching +full:long +full:- +full:delay +full:- +full:ms
4 * SPDX-License-Identifier: Apache-2.0
32 volatile int sync_count = -1;
55 static volatile int thread_started[MAX_NUM_THREADS - 1];
63 int ret = arch_curr_cpu()->id; in curr_cpu()
101 * faster than the other thread so long as it is fairly in t2_fn()
140 t2_count = -1; in ZTEST()
141 while (t2_count == -1) { in ZTEST()
193 while (sync_count == -1) { in ZTEST()
220 for (int i = 0; i < num_threads - 1; i++) { in spin_for_threads_exit()
221 volatile uint8_t *p = &tinfo[i].tid->base.thread_state; in spin_for_threads_exit()
230 k_thread_entry_t thread_entry, int delay) in spawn_threads() argument
242 tinfo[i].priority = prio - 1; in spawn_threads()
249 K_MSEC(delay)); in spawn_threads()
250 if (delay) { in spawn_threads()
251 /* Increase delay for each thread */ in spawn_threads()
252 delay = delay + 10; in spawn_threads()
297 * - The ztest thread has cooperative priority.
298 * - From ztest thread we spawn N number of cooperative threads, where N = number of CPUs.
299 * - The spawned cooperative are executing infinite loop (so they occupy CPU core until they are
301 * - We have (number of CPUs - 1) spawned threads run and executing infinite loop, as current CPU
304 * - We abort spawned threads one-by-one from the ztest thread.
305 * - At the first k_thread_abort call the ztest thread will be preempted by the remaining spawned
309 * - We expect that all spawned threads will be aborted successfully.
311 * This was the test case for zephyrproject-rtos/zephyr#58040 issue where this test caused system
321 zassert_true(arch_current_thread()->base.prio < 0, in ZTEST()
323 zassert_true(arch_current_thread()->base.prio > SPAWN_AB_PRIO, in ZTEST()
339 /* At this time we have (number of CPUs - 1) spawned threads run and executing infinite loop in ZTEST()
344 /* Abort all spawned threads one-by-one. At the first k_thread_abort call the context in ZTEST()
359 * @brief Test cooperative threads non-preemption
388 for (int i = 0; i < num_threads - 1; i++) { in ZTEST()
392 zassert_true(tinfo[num_threads - 1].executed == 0, in ZTEST()
562 spawn_threads(K_PRIO_COOP(10), num_threads - 1, !EQUAL_PRIORITY, in ZTEST()
566 wakeup_on_start_thread(num_threads - 1); in ZTEST()
569 check_wokeup_threads(num_threads - 1); in ZTEST()
572 abort_threads(num_threads - 1); in ZTEST()
584 int cpu_id = -1; in thread_get_cpu_entry()
593 cpu_id = curr_cpu->id; in thread_get_cpu_entry()
611 * - To verify architecture layer provides a mechanism to return a pointer to the
617 * - Interface testing, function and block box testing,
621 * - CONFIG_SMP=y, and the HW platform must support SMP.
624 * - N/A
627 * -# In main thread, call arch_curr_cpu() to get it's member "id",then store it
629 * -# Spawn a thread t2, and pass the stored thread_id to it, then call
631 * -# In thread t2, call arch_curr_cpu() to get pointer of current cpu data. Then
633 * -# Store the member id via accessing pointer of current cpu data to var cpu_id.
634 * -# Check if cpu_id is not equaled to bsp_id that we pass into thread.
635 * -# Call k_busy_wait() and loop forever.
636 * -# In main thread, terminate the thread t2 before exit.
639 * - The pointer of current cpu data that we got from function call is correct.
642 * - Successful if the check of step 3,5 are all passed.
643 * - Failure if one of the check of step 3,5 is failed.
646 * - This test using for the platform that support SMP, in our current scenario
665 _cpu_id = arch_curr_cpu()->id; in ZTEST()
696 * - To verify architecture layer provides a mechanism to issue an interprocessor
703 * - Interface testing, function and block box testing,
707 * - CONFIG_SMP=y, and the HW platform must support SMP.
708 * - CONFIG_TRACE_SCHED_IPI=y was set.
711 * - N/A
714 * -# In main thread, given a global variable sched_ipi_has_called equaled zero.
715 * -# Call arch_sched_broadcast_ipi() then sleep for 100ms.
716 * -# In z_sched_ipi() handler, increment the sched_ipi_has_called.
717 * -# In main thread, check the sched_ipi_has_called is not equaled to zero.
718 * -# Repeat step 1 to 4 for 3 times.
721 * - The pointer of current cpu data that we got from function call is correct.
724 * - Successful if the check of step 4 are all passed.
725 * - Failure if one of the check of step 4 is failed.
728 * - This test using for the platform that support SMP, in our current scenario
874 zassert_equal(arch_current_thread()->base.global_lock_count, 0, in t2_mutex_lock()
876 arch_current_thread()->base.global_lock_count); in t2_mutex_lock()
880 zassert_equal(arch_current_thread()->base.global_lock_count, 0, in t2_mutex_lock()
882 arch_current_thread()->base.global_lock_count); in t2_mutex_lock()
890 zassert_equal(arch_current_thread()->base.global_lock_count, 0, in t2_mutex_lock()
892 arch_current_thread()->base.global_lock_count); in t2_mutex_lock()
1012 global_cnt--; in inc_global_cnt()
1059 printk("type %d: cnt %d, spend %u ms\n", type, global_cnt, in run_concurrency()
1060 k_cyc_to_ms_ceil32(end_t - start_t)); in run_concurrency()
1070 * @details Validate the global lock and unlock API of SMP are thread-safe.
1076 * - No any lock used
1077 * - Use global irq lock
1078 * - Use semaphore
1079 * - Use mutex
1114 if (tevent[id].signal->result != 0x55) { in process_events()
1118 tevent[id].signal->signaled = 0; in process_events()
1196 counter--; in check_affinity()