xref: /optee_os/lib/libutee/include/pta_invoke_tests.h (revision 1bb929836182ecb96d2d9d268daa807c67596396)
1*1bb92983SJerome Forissier /* SPDX-License-Identifier: BSD-2-Clause */
2620e4edfSEtienne Carriere /*
3620e4edfSEtienne Carriere  * Copyright (c) 2017, Linaro Limited
4620e4edfSEtienne Carriere  * All rights reserved.
5620e4edfSEtienne Carriere  *
6620e4edfSEtienne Carriere  * Redistribution and use in source and binary forms, with or without
7620e4edfSEtienne Carriere  * modification, are permitted provided that the following conditions are met:
8620e4edfSEtienne Carriere  *
9620e4edfSEtienne Carriere  * 1. Redistributions of source code must retain the above copyright notice,
10620e4edfSEtienne Carriere  * this list of conditions and the following disclaimer.
11620e4edfSEtienne Carriere  *
12620e4edfSEtienne Carriere  * 2. Redistributions in binary form must reproduce the above copyright notice,
13620e4edfSEtienne Carriere  * this list of conditions and the following disclaimer in the documentation
14620e4edfSEtienne Carriere  * and/or other materials provided with the distribution.
15620e4edfSEtienne Carriere  *
16620e4edfSEtienne Carriere  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17620e4edfSEtienne Carriere  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18620e4edfSEtienne Carriere  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19620e4edfSEtienne Carriere  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20620e4edfSEtienne Carriere  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21620e4edfSEtienne Carriere  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22620e4edfSEtienne Carriere  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23620e4edfSEtienne Carriere  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24620e4edfSEtienne Carriere  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25620e4edfSEtienne Carriere  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26620e4edfSEtienne Carriere  * POSSIBILITY OF SUCH DAMAGE.
27620e4edfSEtienne Carriere  */
28620e4edfSEtienne Carriere 
29620e4edfSEtienne Carriere #ifndef __PTA_INVOKE_TESTS_H
30620e4edfSEtienne Carriere #define __PTA_INVOKE_TESTS_H
31620e4edfSEtienne Carriere 
32620e4edfSEtienne Carriere #define PTA_INVOKE_TESTS_UUID \
33620e4edfSEtienne Carriere 		{ 0xd96a5b40, 0xc3e5, 0x21e3, \
34620e4edfSEtienne Carriere 			{ 0x87, 0x94, 0x10, 0x02, 0xa5, 0xd5, 0xc6, 0x1b } }
35620e4edfSEtienne Carriere 
36620e4edfSEtienne Carriere /* Trace some hello string. Parameters are not used/checked. */
37620e4edfSEtienne Carriere #define PTA_INVOKE_TESTS_CMD_TRACE		0
38620e4edfSEtienne Carriere 
39620e4edfSEtienne Carriere /*
40620e4edfSEtienne Carriere  * Types of parameter drives the test sequences:
41620e4edfSEtienne Carriere  * - test on value parameters
42620e4edfSEtienne Carriere  * - test on SHM memory reference parameters
43620e4edfSEtienne Carriere  * - test on SDP memory reference parameters
44620e4edfSEtienne Carriere  */
45620e4edfSEtienne Carriere #define PTA_INVOKE_TESTS_CMD_PARAMS		1
46620e4edfSEtienne Carriere 
47620e4edfSEtienne Carriere /* Run some core internal tests. Parameters are not used/checked. */
48620e4edfSEtienne Carriere #define PTA_INVOKE_TESTS_CMD_SELF_TESTS		2
49620e4edfSEtienne Carriere 
50620e4edfSEtienne Carriere /*
51620e4edfSEtienne Carriere  * Secure data path: check that pTA can copy data from non-secure shared memory
52620e4edfSEtienne Carriere  * to SDP secure memory
53620e4edfSEtienne Carriere  *
54620e4edfSEtienne Carriere  * [in]     memref[0]        source (non-secure shared memory)
55620e4edfSEtienne Carriere  * [out]    memref[1]        destination (SDP secure memory)
56620e4edfSEtienne Carriere  */
57620e4edfSEtienne Carriere #define PTA_INVOKE_TESTS_CMD_COPY_NSEC_TO_SEC	3
58620e4edfSEtienne Carriere 
59620e4edfSEtienne Carriere /*
60620e4edfSEtienne Carriere  * Secure data path: check that pTA can read data from SDP secure memory and
61620e4edfSEtienne Carriere  * write it back. Data are processed so that client check the expected
62620e4edfSEtienne Carriere  * read/write sequence succeed.
63620e4edfSEtienne Carriere  *
64620e4edfSEtienne Carriere  * [in/out]     memref[0]        SDP secure buffer to read from and write to
65620e4edfSEtienne Carriere  */
66620e4edfSEtienne Carriere #define PTA_INVOKE_TESTS_CMD_READ_MODIFY_SEC	4
67620e4edfSEtienne Carriere 
68620e4edfSEtienne Carriere /*
69620e4edfSEtienne Carriere  * Secure data path: check that pTA can copy data from SDP secure memory to
70620e4edfSEtienne Carriere  * non-secure shared memory
71620e4edfSEtienne Carriere  *
72620e4edfSEtienne Carriere  * [in]     memref[0]        source (SDP secure memory)
73620e4edfSEtienne Carriere  * [out]    memref[1]        destination (non-secure shared memory)
74620e4edfSEtienne Carriere  */
75620e4edfSEtienne Carriere #define PTA_INVOKE_TESTS_CMD_COPY_SEC_TO_NSEC	5
76620e4edfSEtienne Carriere 
77040bc0f0SJens Wiklander /*
78040bc0f0SJens Wiklander  * Tests FS hash-tree corner cases in error handling
79040bc0f0SJens Wiklander  */
80040bc0f0SJens Wiklander #define PTA_INVOKE_TESTS_CMD_FS_HTREE		6
81040bc0f0SJens Wiklander 
825209c97aSJens Wiklander /*
835209c97aSJens Wiklander  * Tests mutex
845209c97aSJens Wiklander  *
855209c97aSJens Wiklander  * [in]  value[0].a	Test function PTA_MUTEX_TEST_*
865209c97aSJens Wiklander  * [in]  value[0].b	delay number
875209c97aSJens Wiklander  * [out] value[1].a	before lock concurency
885209c97aSJens Wiklander  * [out] value[1].b	during lock concurency
895209c97aSJens Wiklander  */
905209c97aSJens Wiklander #define PTA_MUTEX_TEST_WRITER			0
915209c97aSJens Wiklander #define PTA_MUTEX_TEST_READER			1
925209c97aSJens Wiklander #define PTA_INVOKE_TESTS_CMD_MUTEX		7
935209c97aSJens Wiklander 
94620e4edfSEtienne Carriere #endif /*__PTA_INVOKE_TESTS_H*/
95620e4edfSEtienne Carriere 
96