1 /* 2 * Copyright (c) 2020 Google, Inc. 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining 5 * a copy of this software and associated documentation files 6 * (the "Software"), to deal in the Software without restriction, 7 * including without limitation the rights to use, copy, modify, merge, 8 * publish, distribute, sublicense, and/or sell copies of the Software, 9 * and to permit persons to whom the Software is furnished to do so, 10 * subject to the following conditions: 11 * 12 * The above copyright notice and this permission notice shall be 13 * included in all copies or substantial portions of the Software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 */ 23 24 #pragma once 25 26 /** 27 * SMC_SC_TEST_VERSION - Return supported test API version. 28 * @r1: Version supported by client. 29 * 30 * Returns version supported by trusty test. 31 * 32 * If multiple versions are supported, the client should start by calling 33 * SMC_SC_TEST_VERSION with the largest version it supports. Trusty will then 34 * return a version it supports. If the client does not support the version 35 * returned by trusty and the version returned is less than the version 36 * requested, repeat the call with the largest supported version less than the 37 * last returned version. 38 */ 39 #define SMC_SC_TEST_VERSION SMC_STDCALL_NR(SMC_ENTITY_TEST, 0) 40 41 /** 42 * SMC_SC_TEST_SHARED_MEM_RW - Test shared memory buffer. 43 * @r1/r2: Shared memory id. 44 * @r3: Size. 45 * 46 * Check that buffer contains the 64 bit integer sqequnce [0, 1, 2, ..., 47 * @r3 / 8 - 1] and modify sequence to [@r3, @r3 - 1, @r3 - 2, ..., 48 * @r3 - (@r3 / 8 - 1)]. 49 * 50 * Return: 0 on success. SM_ERR_INVALID_PARAMETERS is buffer does not contain 51 * expected input pattern. SM_ERR_INTERNAL_FAILURE if @r1/r2 could not be 52 * mapped. 53 */ 54 #define SMC_SC_TEST_SHARED_MEM_RW SMC_STDCALL_NR(SMC_ENTITY_TEST, 1) 55 56 /** 57 * SMC_SC_TEST_CLOBBER_SVE - Test save and restore of SVE/SIMD registers during 58 * an TFTF <-> TF-A <-> Trusty roundtrip for all participants when multiple cpus 59 * are involved. 60 * 61 * Return: 0 on success. 1 on "technical" error. 2 if registers have not 62 * recovered expected value. 63 */ 64 #define SMC_SC_TEST_CLOBBER_SVE SMC_STDCALL_NR(SMC_ENTITY_TEST, 2) 65 66 #define TRUSTY_STDCALLTEST_API_VERSION 1 67