1 /* 2 * Copyright (c) 2022 Huawei Technologies SASU 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #include <stddef.h> 8 #include <stdint.h> 9 #include <zephyr/kernel.h> 10 11 #include "user.h" 12 context_switch_yield(void * p1,void * p2,void * p3)13void context_switch_yield(void *p1, void *p2, void *p3) 14 { 15 uint32_t nb_threads = (uint32_t)(uintptr_t) p1; 16 uint32_t rounds = NB_YIELDS / nb_threads; 17 18 while (rounds--) { 19 k_yield(); 20 } 21 } 22