diff --git a/tests/benchmarks/app_kernel/prj.conf b/tests/benchmarks/app_kernel/prj.conf index 57cd1f1544e65c0..ac968ba0fe9dd81 100644 --- a/tests/benchmarks/app_kernel/prj.conf +++ b/tests/benchmarks/app_kernel/prj.conf @@ -16,9 +16,6 @@ CONFIG_CBPRINTF_FP_SUPPORT=y # Can only run under 1 CPU CONFIG_MP_MAX_NUM_CPUS=1 -# Enable pipes -CONFIG_PIPES=y - CONFIG_APPLICATION_DEFINED_SYSCALL=y CONFIG_TIMING_FUNCTIONS=y diff --git a/tests/benchmarks/app_kernel/prj_user.conf b/tests/benchmarks/app_kernel/prj_user.conf index fd222e6fb14409a..d64c95ecd8fed7d 100644 --- a/tests/benchmarks/app_kernel/prj_user.conf +++ b/tests/benchmarks/app_kernel/prj_user.conf @@ -16,9 +16,6 @@ CONFIG_CBPRINTF_FP_SUPPORT=y # Can only run under 1 CPU CONFIG_MP_MAX_NUM_CPUS=1 -# Enable pipes -CONFIG_PIPES=y - CONFIG_APPLICATION_DEFINED_SYSCALL=y CONFIG_TIMING_FUNCTIONS=y CONFIG_USERSPACE=y diff --git a/tests/benchmarks/app_kernel/src/master.c b/tests/benchmarks/app_kernel/src/master.c index 541be64040ccb38..a7ebee3cc9bfb9a 100644 --- a/tests/benchmarks/app_kernel/src/master.c +++ b/tests/benchmarks/app_kernel/src/master.c @@ -23,7 +23,7 @@ BENCH_BMEM char msg[MAX_MSG]; BENCH_BMEM char data_bench[MESSAGE_SIZE]; -BENCH_DMEM struct k_pipe *test_pipes[] = {&PIPE_NOBUFF, &PIPE_SMALLBUFF, &PIPE_BIGBUFF}; +BENCH_DMEM struct k_pipe *test_pipes[] = {&PIPE_SMALLBUFF, &PIPE_BIGBUFF}; BENCH_BMEM char sline[SLINE_LEN + 1]; /* @@ -70,7 +70,6 @@ K_MBOX_DEFINE(MAILB1); K_MUTEX_DEFINE(DEMO_MUTEX); -K_PIPE_DEFINE(PIPE_NOBUFF, 0, 4); K_PIPE_DEFINE(PIPE_SMALLBUFF, 256, 4); K_PIPE_DEFINE(PIPE_BIGBUFF, 4096, 4); @@ -188,7 +187,7 @@ int main(void) k_thread_access_grant(&recv_thread, &DEMOQX1, &DEMOQX4, &DEMOQX192, &MB_COMM, &CH_COMM, &SEM0, &SEM1, &SEM2, &SEM3, &SEM4, &STARTRCV, &DEMO_MUTEX, - &PIPE_NOBUFF, &PIPE_SMALLBUFF, &PIPE_BIGBUFF); + &PIPE_SMALLBUFF, &PIPE_BIGBUFF); k_thread_start(&recv_thread); k_thread_start(&test_thread); @@ -212,7 +211,7 @@ int main(void) k_thread_access_grant(&test_thread, &DEMOQX1, &DEMOQX4, &DEMOQX192, &MB_COMM, &CH_COMM, &SEM0, &SEM1, &SEM2, &SEM3, &SEM4, &STARTRCV, &DEMO_MUTEX, - &PIPE_NOBUFF, &PIPE_SMALLBUFF, &PIPE_BIGBUFF); + &PIPE_SMALLBUFF, &PIPE_BIGBUFF); k_thread_start(&recv_thread); k_thread_start(&test_thread); @@ -236,11 +235,11 @@ int main(void) k_thread_access_grant(&test_thread, &DEMOQX1, &DEMOQX4, &DEMOQX192, &MB_COMM, &CH_COMM, &SEM0, &SEM1, &SEM2, &SEM3, &SEM4, &STARTRCV, &DEMO_MUTEX, - &PIPE_NOBUFF, &PIPE_SMALLBUFF, &PIPE_BIGBUFF); + &PIPE_SMALLBUFF, &PIPE_BIGBUFF); k_thread_access_grant(&recv_thread, &DEMOQX1, &DEMOQX4, &DEMOQX192, &MB_COMM, &CH_COMM, &SEM0, &SEM1, &SEM2, &SEM3, &SEM4, &STARTRCV, &DEMO_MUTEX, - &PIPE_NOBUFF, &PIPE_SMALLBUFF, &PIPE_BIGBUFF); + &PIPE_SMALLBUFF, &PIPE_BIGBUFF); k_thread_start(&recv_thread); k_thread_start(&test_thread); diff --git a/tests/benchmarks/app_kernel/src/pipe_b.c b/tests/benchmarks/app_kernel/src/pipe_b.c index 3589b73806af558..0ec99b3c535c4a1 100644 --- a/tests/benchmarks/app_kernel/src/pipe_b.c +++ b/tests/benchmarks/app_kernel/src/pipe_b.c @@ -90,7 +90,7 @@ void pipe_test(void) PRINT_STRING(dashline); for (putsize = 8U; putsize <= MESSAGE_SIZE_PIPE; putsize <<= 1) { - for (pipe = 0; pipe < 3; pipe++) { + for (pipe = 0; pipe < 2; pipe++) { putcount = NR_OF_PIPE_RUNS; pipeput(test_pipes[pipe], _ALL_N, putsize, putcount, &puttime[pipe]); @@ -125,7 +125,7 @@ void pipe_test(void) for (putsize = 8U; putsize <= (MESSAGE_SIZE_PIPE); putsize <<= 1) { putcount = MESSAGE_SIZE_PIPE / putsize; - for (pipe = 0; pipe < 3; pipe++) { + for (pipe = 0; pipe < 2; pipe++) { pipeput(test_pipes[pipe], _1_TO_N, putsize, putcount, &puttime[pipe]); /* size*count == MESSAGE_SIZE_PIPE */ @@ -171,16 +171,10 @@ int pipeput(struct k_pipe *pipe, for (i = 0; option == _1_TO_N || (i < count); i++) { size_t sizexferd = 0; size_t size2xfer = MIN(size, size2xfer_total - sizexferd_total); - int ret; - size_t mim_num_of_bytes = 0; - if (option == _ALL_N) { - mim_num_of_bytes = size2xfer; - } - ret = k_pipe_put(pipe, data_bench, size2xfer, - &sizexferd, mim_num_of_bytes, K_FOREVER); + sizexferd = k_pipe_write(pipe, data_bench, size2xfer, K_FOREVER); - if (ret != 0) { + if (sizexferd < 0) { return 1; } if (option == _ALL_N && sizexferd != size2xfer) { diff --git a/tests/benchmarks/app_kernel/src/pipe_r.c b/tests/benchmarks/app_kernel/src/pipe_r.c index 653e66491fae051..5f6d93e3acd05cf 100644 --- a/tests/benchmarks/app_kernel/src/pipe_r.c +++ b/tests/benchmarks/app_kernel/src/pipe_r.c @@ -36,7 +36,7 @@ void piperecvtask(void) /* matching (ALL_N) */ for (getsize = 8; getsize <= MESSAGE_SIZE_PIPE; getsize <<= 1) { - for (pipe = 0; pipe < 3; pipe++) { + for (pipe = 0; pipe < 2; pipe++) { getcount = NR_OF_PIPE_RUNS; pipeget(test_pipes[pipe], _ALL_N, getsize, getcount, &gettime); @@ -52,7 +52,7 @@ void piperecvtask(void) /* non-matching (1_TO_N) */ for (getsize = (MESSAGE_SIZE_PIPE); getsize >= 8; getsize >>= 1) { getcount = MESSAGE_SIZE_PIPE / getsize; - for (pipe = 0; pipe < 3; pipe++) { + for (pipe = 0; pipe < 2; pipe++) { /* size*count == MESSAGE_SIZE_PIPE */ pipeget(test_pipes[pipe], _1_TO_N, getsize, getcount, &gettime); @@ -95,12 +95,9 @@ int pipeget(struct k_pipe *pipe, enum pipe_options option, int size, int count, for (i = 0; option == _1_TO_N || (i < count); i++) { size_t sizexferd = 0; size_t size2xfer = MIN(size, size2xfer_total - sizexferd_total); - int ret; - ret = k_pipe_get(pipe, data_recv, size2xfer, - &sizexferd, option, K_FOREVER); - - if (ret != 0) { + sizexferd = k_pipe_read(pipe, data_recv, size2xfer, K_FOREVER); + if (sizexferd < 0) { return 1; } diff --git a/tests/kernel/mem_protect/mem_protect/prj.conf b/tests/kernel/mem_protect/mem_protect/prj.conf index ffb1d6279ef2b64..8d6da5a325aa878 100644 --- a/tests/kernel/mem_protect/mem_protect/prj.conf +++ b/tests/kernel/mem_protect/mem_protect/prj.conf @@ -4,4 +4,3 @@ CONFIG_ZTEST_STACK_SIZE=2048 CONFIG_MAX_THREAD_BYTES=4 CONFIG_TEST_USERSPACE=y CONFIG_APPLICATION_DEFINED_SYSCALL=y -CONFIG_PIPES=y diff --git a/tests/kernel/mem_protect/userspace/prj.conf b/tests/kernel/mem_protect/userspace/prj.conf index c963d1f7f94b7ef..06b36cf8efd26ac 100644 --- a/tests/kernel/mem_protect/userspace/prj.conf +++ b/tests/kernel/mem_protect/userspace/prj.conf @@ -3,4 +3,3 @@ CONFIG_ZTEST=y CONFIG_INIT_STACKS=y CONFIG_APPLICATION_DEFINED_SYSCALL=y CONFIG_TEST_USERSPACE=y -CONFIG_PIPES=y diff --git a/tests/kernel/mem_protect/userspace/src/main.c b/tests/kernel/mem_protect/userspace/src/main.c index 08b3932c7adfaf2..918e6e7fe61b7cd 100644 --- a/tests/kernel/mem_protect/userspace/src/main.c +++ b/tests/kernel/mem_protect/userspace/src/main.c @@ -664,8 +664,6 @@ ZTEST(userspace, test_user_mode_enter) /* Define and initialize pipe. */ K_PIPE_DEFINE(kpipe, PIPE_LEN, BYTES_TO_READ_WRITE); -K_APP_BMEM(default_part) static size_t bytes_written_read; - /** * @brief Test to write to kobject using pipe * @@ -679,8 +677,7 @@ ZTEST_USER(userspace, test_write_kobject_user_pipe) */ set_fault(K_ERR_KERNEL_OOPS); - k_pipe_get(&kpipe, &test_revoke_sem, BYTES_TO_READ_WRITE, - &bytes_written_read, 1, K_NO_WAIT); + k_pipe_read(&kpipe, (uint8_t *)&test_revoke_sem, BYTES_TO_READ_WRITE, K_NO_WAIT); zassert_unreachable("System call memory write validation " "did not fault"); @@ -699,8 +696,7 @@ ZTEST_USER(userspace, test_read_kobject_user_pipe) */ set_fault(K_ERR_KERNEL_OOPS); - k_pipe_put(&kpipe, &test_revoke_sem, BYTES_TO_READ_WRITE, - &bytes_written_read, 1, K_NO_WAIT); + k_pipe_write(&kpipe, (uint8_t *)&test_revoke_sem, BYTES_TO_READ_WRITE, K_NO_WAIT); zassert_unreachable("System call memory read validation " "did not fault"); diff --git a/tests/kernel/mutex/mutex_error_case/prj.conf b/tests/kernel/mutex/mutex_error_case/prj.conf index d144e826538b8cb..3fc9377dc690071 100644 --- a/tests/kernel/mutex/mutex_error_case/prj.conf +++ b/tests/kernel/mutex/mutex_error_case/prj.conf @@ -3,4 +3,3 @@ CONFIG_IRQ_OFFLOAD=y CONFIG_TEST_USERSPACE=y CONFIG_MP_MAX_NUM_CPUS=1 CONFIG_ZTEST_FATAL_HOOK=y -CONFIG_PIPES=y diff --git a/tests/kernel/obj_core/obj_core/prj.conf b/tests/kernel/obj_core/obj_core/prj.conf index 6c006bcb8e97501..95b1c1624c4c987 100644 --- a/tests/kernel/obj_core/obj_core/prj.conf +++ b/tests/kernel/obj_core/obj_core/prj.conf @@ -1,5 +1,4 @@ CONFIG_ZTEST=y CONFIG_OBJ_CORE=y CONFIG_EVENTS=y -CONFIG_PIPES=y CONFIG_SYS_MEM_BLOCKS=y diff --git a/tests/kernel/obj_core/obj_core_stats_api/prj.conf b/tests/kernel/obj_core/obj_core_stats_api/prj.conf index d163a31e10510c3..1012c240aeb8988 100644 --- a/tests/kernel/obj_core/obj_core_stats_api/prj.conf +++ b/tests/kernel/obj_core/obj_core_stats_api/prj.conf @@ -1,6 +1,5 @@ CONFIG_ZTEST=y CONFIG_OBJ_CORE=y CONFIG_OBJ_CORE_STATS=y -CONFIG_PIPES=y CONFIG_SCHED_THREAD_USAGE=y CONFIG_SCHED_THREAD_USAGE_ANALYSIS=y diff --git a/tests/kernel/obj_tracking/prj.conf b/tests/kernel/obj_tracking/prj.conf index 38956d679530a03..04860b00cd2b956 100644 --- a/tests/kernel/obj_tracking/prj.conf +++ b/tests/kernel/obj_tracking/prj.conf @@ -3,5 +3,4 @@ CONFIG_IRQ_OFFLOAD=y CONFIG_TRACING=y CONFIG_TRACING_OBJECT_TRACKING=y CONFIG_TRACING_NONE=y -CONFIG_PIPES=y CONFIG_EVENTS=y diff --git a/tests/kernel/semaphore/semaphore/prj.conf b/tests/kernel/semaphore/semaphore/prj.conf index e193f5f626dd2ab..1ae0b78bdbff639 100644 --- a/tests/kernel/semaphore/semaphore/prj.conf +++ b/tests/kernel/semaphore/semaphore/prj.conf @@ -2,5 +2,4 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_TEST_USERSPACE=y CONFIG_ZTEST_FATAL_HOOK=y -CONFIG_PIPES=y CONFIG_MAX_THREAD_BYTES=3 diff --git a/tests/kernel/semaphore/semaphore/src/main.c b/tests/kernel/semaphore/semaphore/src/main.c index 97816a3a47af794..83c35bfaac84fe3 100644 --- a/tests/kernel/semaphore/semaphore/src/main.c +++ b/tests/kernel/semaphore/semaphore/src/main.c @@ -980,7 +980,6 @@ void sem_multiple_take_and_timeouts_helper(void *p1, void *p2, void *p3) { int timeout = POINTER_TO_INT(p1); int64_t start_ticks, end_ticks, diff_ticks; - size_t bytes_written; start_ticks = k_uptime_get(); @@ -994,8 +993,7 @@ void sem_multiple_take_and_timeouts_helper(void *p1, void *p2, void *p3) "time mismatch - expected at least %d, got %lld", timeout, diff_ticks); - k_pipe_put(&timeout_info_pipe, &timeout, sizeof(int), - &bytes_written, sizeof(int), K_FOREVER); + k_pipe_write(&timeout_info_pipe, (uint8_t *)&timeout, sizeof(int), K_FOREVER); } @@ -1011,7 +1009,6 @@ ZTEST(semaphore_1cpu, test_sem_multiple_take_and_timeouts) } static uint32_t timeout; - size_t bytes_read; k_sem_reset(&simple_sem); k_pipe_flush(&timeout_info_pipe); @@ -1028,8 +1025,7 @@ ZTEST(semaphore_1cpu, test_sem_multiple_take_and_timeouts) } for (int i = 0; i < TOTAL_THREADS_WAITING; i++) { - k_pipe_get(&timeout_info_pipe, &timeout, sizeof(int), - &bytes_read, sizeof(int), K_FOREVER); + k_pipe_read(&timeout_info_pipe, (uint8_t *)&timeout, sizeof(int), K_FOREVER); zassert_equal(timeout, QSEC2MS(i + 1), "timeout did not occur properly: %d != %d", timeout, QSEC2MS(i + 1)); @@ -1043,10 +1039,10 @@ ZTEST(semaphore_1cpu, test_sem_multiple_take_and_timeouts) void sem_multi_take_timeout_diff_sem_helper(void *p1, void *p2, void *p3) { + int rc; int timeout = POINTER_TO_INT(p1); struct k_sem *sema = p2; int64_t start_ticks, end_ticks, diff_ticks; - size_t bytes_written; struct timeout_info info = { .timeout = timeout, .sema = sema @@ -1064,8 +1060,10 @@ void sem_multi_take_timeout_diff_sem_helper(void *p1, void *p2, void *p3) "time mismatch - expected at least %d, got %lld", timeout, diff_ticks); - k_pipe_put(&timeout_info_pipe, &info, sizeof(struct timeout_info), - &bytes_written, sizeof(struct timeout_info), K_FOREVER); + rc = k_pipe_write(&timeout_info_pipe, (uint8_t *)&info, sizeof(struct timeout_info), + K_FOREVER); + zassert_true(rc == sizeof(struct timeout_info), + "k_pipe_write failed: %d", rc); } /** @@ -1075,11 +1073,11 @@ void sem_multi_take_timeout_diff_sem_helper(void *p1, void *p2, void *p3) */ ZTEST(semaphore, test_sem_multi_take_timeout_diff_sem) { + int rc; if (IS_ENABLED(CONFIG_KERNEL_COHERENCE)) { ztest_test_skip(); } - size_t bytes_read; struct timeout_info seq_info[] = { { SEC2MS(2), &simple_sem }, { SEC2MS(1), &multiple_thread_sem }, @@ -1108,13 +1106,10 @@ ZTEST(semaphore, test_sem_multi_take_timeout_diff_sem) } for (int i = 0; i < TOTAL_THREADS_WAITING; i++) { - k_pipe_get(&timeout_info_pipe, - &retrieved_info, - sizeof(struct timeout_info), - &bytes_read, - sizeof(struct timeout_info), - K_FOREVER); - + rc = k_pipe_read(&timeout_info_pipe, (uint8_t *)&retrieved_info, + sizeof(struct timeout_info), K_FOREVER); + zassert_true(rc == sizeof(struct timeout_info), + "k_pipe_read failed: %d", rc); zassert_true(retrieved_info.timeout == SEC2MS(i + 1), "timeout did not occur properly");