1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (c) 2015, Linaro Limited
4  * All rights reserved.
5  */
6 
7 #ifndef TA_CONCURRENT_H
8 #define TA_CONCURRENT_H
9 
10 /* This UUID is generated with the ITU-T UUID generator at
11    http://www.itu.int/ITU-T/asn1/uuid.html */
12 #define TA_CONCURRENT_UUID { 0xe13010e0, 0x2ae1, 0x11e5, \
13 	{ 0x89, 0x6a, 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } }
14 
15 struct ta_concurrent_shm {
16 	uint32_t active_count;
17 };
18 
19 /*
20  * Busy loops and updates max concurrency.  params[0].memref should contain
21  * a struct ta_concurent_shm which can be used to tell how many instances
22  * of this function is running in parallel.
23  *
24  * in/out	params[0].memref
25  * in/out	params[1].value.a	(input) number times to calcule the hash
26  * in/out	params[1].value.b	(output) max concurency
27  */
28 
29 #define TA_CONCURRENT_CMD_BUSY_LOOP	0
30 
31 /*
32  * Calculates a sha-256 hash over param[2].memref and stores the result in
33  * params[3].memref. params[0].memref should contain a struct
34  * ta_concurent_shm which can be used to tell how many instances of this
35  * function is running in parallel.
36  *
37  * in/out	params[0].memref
38  * in/out	params[1].value.a	(input) number times to calcule the hash
39  * in/out	params[1].value.b	(output) max concurency
40  * in		params[2].memref
41  * out		params[3].memref
42  */
43 #define TA_CONCURRENT_CMD_SHA256	1
44 
45 #endif /*TA_OS_TEST_H */
46