xref: /optee_os/lib/libutee/include/pta_invoke_tests.h (revision 1bb929836182ecb96d2d9d268daa807c67596396)
1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (c) 2017, Linaro Limited
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright notice,
10  * this list of conditions and the following disclaimer.
11  *
12  * 2. Redistributions in binary form must reproduce the above copyright notice,
13  * this list of conditions and the following disclaimer in the documentation
14  * and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26  * POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef __PTA_INVOKE_TESTS_H
30 #define __PTA_INVOKE_TESTS_H
31 
32 #define PTA_INVOKE_TESTS_UUID \
33 		{ 0xd96a5b40, 0xc3e5, 0x21e3, \
34 			{ 0x87, 0x94, 0x10, 0x02, 0xa5, 0xd5, 0xc6, 0x1b } }
35 
36 /* Trace some hello string. Parameters are not used/checked. */
37 #define PTA_INVOKE_TESTS_CMD_TRACE		0
38 
39 /*
40  * Types of parameter drives the test sequences:
41  * - test on value parameters
42  * - test on SHM memory reference parameters
43  * - test on SDP memory reference parameters
44  */
45 #define PTA_INVOKE_TESTS_CMD_PARAMS		1
46 
47 /* Run some core internal tests. Parameters are not used/checked. */
48 #define PTA_INVOKE_TESTS_CMD_SELF_TESTS		2
49 
50 /*
51  * Secure data path: check that pTA can copy data from non-secure shared memory
52  * to SDP secure memory
53  *
54  * [in]     memref[0]        source (non-secure shared memory)
55  * [out]    memref[1]        destination (SDP secure memory)
56  */
57 #define PTA_INVOKE_TESTS_CMD_COPY_NSEC_TO_SEC	3
58 
59 /*
60  * Secure data path: check that pTA can read data from SDP secure memory and
61  * write it back. Data are processed so that client check the expected
62  * read/write sequence succeed.
63  *
64  * [in/out]     memref[0]        SDP secure buffer to read from and write to
65  */
66 #define PTA_INVOKE_TESTS_CMD_READ_MODIFY_SEC	4
67 
68 /*
69  * Secure data path: check that pTA can copy data from SDP secure memory to
70  * non-secure shared memory
71  *
72  * [in]     memref[0]        source (SDP secure memory)
73  * [out]    memref[1]        destination (non-secure shared memory)
74  */
75 #define PTA_INVOKE_TESTS_CMD_COPY_SEC_TO_NSEC	5
76 
77 /*
78  * Tests FS hash-tree corner cases in error handling
79  */
80 #define PTA_INVOKE_TESTS_CMD_FS_HTREE		6
81 
82 /*
83  * Tests mutex
84  *
85  * [in]  value[0].a	Test function PTA_MUTEX_TEST_*
86  * [in]  value[0].b	delay number
87  * [out] value[1].a	before lock concurency
88  * [out] value[1].b	during lock concurency
89  */
90 #define PTA_MUTEX_TEST_WRITER			0
91 #define PTA_MUTEX_TEST_READER			1
92 #define PTA_INVOKE_TESTS_CMD_MUTEX		7
93 
94 #endif /*__PTA_INVOKE_TESTS_H*/
95 
96