TA-REF
tee_internal_api_extensions.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2/*
3 * Copyright (c) 2014, STMicroelectronics International N.V.
4 */
5
6#ifndef TEE_INTERNAL_API_EXTENSIONS_H
7#define TEE_INTERNAL_API_EXTENSIONS_H
8
9/* trace support */
10#include <trace.h>
11#include <stdio.h>
13#include <tee_api_types.h>
14
17/* Hint implementation defines */
18
19#ifndef DOXYGEN_SHOULD_SKIP_THIS
20#define TEE_USER_MEM_HINT_NO_FILL_ZERO 0x80000000
21#endif /*DOXYGEN_SHOULD_SKIP_THIS*/
22
23/*
24 * Cache maintenance support (TA requires the CACHE_MAINTENANCE property)
25 *
26 * TEE_CacheClean() Write back to memory any dirty data cache lines. The line
27 * is marked as not dirty. The valid bit is unchanged.
28 *
29 * TEE_CacheFlush() Purges any valid data cache lines. Any dirty cache lines
30 * are first written back to memory, then the cache line is
31 * invalidated.
32 *
33 * TEE_CacheInvalidate() Invalidate any valid data cache lines. Any dirty line
34 * are not written back to memory.
35 */
36TEE_Result TEE_CacheClean(char *buf, size_t len);
37TEE_Result TEE_CacheFlush(char *buf, size_t len);
38TEE_Result TEE_CacheInvalidate(char *buf, size_t len);
39
40/*
41 * tee_map_zi() - Map zero initialized memory
42 * @len: Number of bytes
43 * @flags: 0 or TEE_MEMORY_ACCESS_ANY_OWNER to allow sharing with other TAs
44 *
45 * Returns valid pointer on success or NULL on error.
46 */
47void *tee_map_zi(size_t len, uint32_t flags);
48
49/*
50 * tee_unmap() - Unmap previously mapped memory
51 * @buf: Buffer
52 * @len: Number of bytes
53 *
54 * Note that supplied @buf and @len has to match exactly what has
55 * previously been returned by tee_map_zi().
56 *
57 * Return TEE_SUCCESS on success or TEE_ERRROR_* on failure.
58 */
59TEE_Result tee_unmap(void *buf, size_t len);
60
61/*
62 * Convert a UUID string @s into a TEE_UUID @uuid
63 * Expected format for @s is: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
64 * 'x' being any hexadecimal digit (0-9a-fA-F)
65 */
67
68#endif
uint32_t TEE_Result
Definition: tee_api_types.h:43
TEE_Result TEE_CacheFlush(char *buf, size_t len)
size_t tee_user_mem_check_heap(void)
TEE_Result tee_unmap(void *buf, size_t len)
TEE_Result TEE_CacheInvalidate(char *buf, size_t len)
void * tee_map_zi(size_t len, uint32_t flags)
TEE_Result tee_uuid_from_str(TEE_UUID *uuid, const char *s)
TEE_Result TEE_CacheClean(char *buf, size_t len)
void tee_user_mem_mark_heap(void)
Definition: tee_api_types.h:45