1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (c) 2018-2019, Linaro Limited
4  * Copyright (c) 2020, Arm Limited
5  */
6 
7 #include <kernel/handle.h>
8 #include <kernel/ts_store.h>
9 #include <kernel/user_mode_ctx_struct.h>
10 #include <tee_api_defines.h>
11 #include <tee_api_types.h>
12 #include <types_ext.h>
13 
14 #ifndef KERNEL_LDELF_SYSCALLS_H
15 #define KERNEL_LDELF_SYSCALLS_H
16 
17 struct system_ctx {
18 	struct handle_db db;
19 	const struct ts_store_ops *store_op;
20 };
21 
22 TEE_Result ldelf_syscall_map_zi(vaddr_t *va, size_t num_bytes, size_t pad_begin,
23 				size_t pad_end, unsigned long flags);
24 TEE_Result ldelf_syscall_unmap(vaddr_t va, size_t num_bytes);
25 TEE_Result ldelf_syscall_open_bin(const TEE_UUID *uuid, size_t uuid_size,
26 				  uint32_t *handle);
27 TEE_Result ldelf_syscall_close_bin(unsigned long handle);
28 TEE_Result ldelf_syscall_map_bin(vaddr_t *va, size_t num_bytes,
29 				 unsigned long handle, size_t offs_bytes,
30 				 size_t pad_begin, size_t pad_end,
31 				 unsigned long flags);
32 TEE_Result ldelf_syscall_copy_from_bin(void *dst, size_t offs, size_t num_bytes,
33 				       unsigned long handle);
34 TEE_Result ldelf_syscall_set_prot(unsigned long va, size_t num_bytes,
35 				  unsigned long flags);
36 TEE_Result ldelf_syscall_remap(unsigned long old_va, vaddr_t *new_va,
37 			       size_t num_bytes, size_t pad_begin,
38 			       size_t pad_end);
39 TEE_Result ldelf_syscall_gen_rnd_num(void *buf, size_t num_bytes);
40 void ldelf_sess_cleanup(struct ts_session *sess);
41 
42 #endif /* KERNEL_LDELF_SYSCALLS_H */
43