1 /* receiver.c */
2 
3 /*
4  * Copyright (c) 1997-2010,2013-2014 Wind River Systems, Inc.
5  *
6  * SPDX-License-Identifier: Apache-2.0
7  */
8 
9 /*
10  *	File Naming information.
11  *	------------------------
12  *	Files that end with:
13  *		_B : Is a file that contains a benchmark function
14  *		_R : Is a file that contains the receiver task
15  *			 of a benchmark function
16  */
17 
18 #include "receiver.h"
19 
20 BENCH_DMEM char data_recv[MESSAGE_SIZE] = { 0 };
21 
22 void dequtask(void);
23 void waittask(void);
24 void mailrecvtask(void);
25 void piperecvtask(void);
26 
27 /**
28  * @brief Main function of the task that receives data in the test
29  */
recvtask(void * p1,void * p2,void * p3)30 void recvtask(void *p1, void *p2, void *p3)
31 {
32 	bool skip_mbox = (bool)(uintptr_t)(p1);
33 
34 	ARG_UNUSED(p2);
35 	ARG_UNUSED(p3);
36 
37 	/* order must be compatible with master.c ! */
38 
39 	k_sem_take(&STARTRCV, K_FOREVER);
40 	dequtask();
41 
42 	k_sem_take(&STARTRCV, K_FOREVER);
43 	waittask();
44 
45 	if (!skip_mbox) {
46 		k_sem_take(&STARTRCV, K_FOREVER);
47 		mailrecvtask();
48 	}
49 
50 	k_sem_take(&STARTRCV, K_FOREVER);
51 	piperecvtask();
52 }
53