1b0104773SPascal Brand /* 2b0104773SPascal Brand * Copyright (c) 2014, STMicroelectronics International N.V. 3b0104773SPascal Brand * All rights reserved. 4b0104773SPascal Brand * 5b0104773SPascal Brand * Redistribution and use in source and binary forms, with or without 6b0104773SPascal Brand * modification, are permitted provided that the following conditions are met: 7b0104773SPascal Brand * 8b0104773SPascal Brand * 1. Redistributions of source code must retain the above copyright notice, 9b0104773SPascal Brand * this list of conditions and the following disclaimer. 10b0104773SPascal Brand * 11b0104773SPascal Brand * 2. Redistributions in binary form must reproduce the above copyright notice, 12b0104773SPascal Brand * this list of conditions and the following disclaimer in the documentation 13b0104773SPascal Brand * and/or other materials provided with the distribution. 14b0104773SPascal Brand * 15b0104773SPascal Brand * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16b0104773SPascal Brand * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17b0104773SPascal Brand * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18b0104773SPascal Brand * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 19b0104773SPascal Brand * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20b0104773SPascal Brand * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21b0104773SPascal Brand * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22b0104773SPascal Brand * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23b0104773SPascal Brand * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24b0104773SPascal Brand * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25b0104773SPascal Brand * POSSIBILITY OF SUCH DAMAGE. 26b0104773SPascal Brand */ 27b0104773SPascal Brand 28b0104773SPascal Brand #ifndef TEE_INTERNAL_API_EXTENSIONS_H 29b0104773SPascal Brand #define TEE_INTERNAL_API_EXTENSIONS_H 30b0104773SPascal Brand 31b0104773SPascal Brand /* trace support */ 324de4bebcSJens Wiklander #include <trace.h> 33cebdec51SJens Wiklander #include <stdio.h> 34*dd3247beSEtienne Carriere #include <tee_api_defines_extensions.h> 35fa530828SPascal Brand #include <tee_api_types.h> 36b0104773SPascal Brand 37b0104773SPascal Brand void tee_user_mem_mark_heap(void); 38b0104773SPascal Brand size_t tee_user_mem_check_heap(void); 39b0104773SPascal Brand /* Hint implementation defines */ 40b0104773SPascal Brand #define TEE_USER_MEM_HINT_NO_FILL_ZERO 0x80000000 41b0104773SPascal Brand 42fa530828SPascal Brand /* 43fa530828SPascal Brand * Cache maintenance support (TA requires the CACHE_MAINTENANCE property) 44fa530828SPascal Brand * 45fa530828SPascal Brand * TEE_CacheClean() Write back to memory any dirty data cache lines. The line 46fa530828SPascal Brand * is marked as not dirty. The valid bit is unchanged. 47fa530828SPascal Brand * 48fa530828SPascal Brand * TEE_CacheFlush() Purges any valid data cache lines. Any dirty cache lines 49fa530828SPascal Brand * are first written back to memory, then the cache line is 50fa530828SPascal Brand * invalidated. 51fa530828SPascal Brand * 52fa530828SPascal Brand * TEE_CacheInvalidate() Invalidate any valid data cache lines. Any dirty line 53fa530828SPascal Brand * are not written back to memory. 54fa530828SPascal Brand */ 55fa530828SPascal Brand TEE_Result TEE_CacheClean(char *buf, size_t len); 56fa530828SPascal Brand TEE_Result TEE_CacheFlush(char *buf, size_t len); 57fa530828SPascal Brand TEE_Result TEE_CacheInvalidate(char *buf, size_t len); 58fa530828SPascal Brand 59b0104773SPascal Brand #endif 60