1 /*
2  * Copyright (C) 2021-2022 Intel Corporation.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef TEE_H_
8 #define TEE_H_
9 
10 #include <asm/guest/vm.h>
11 #include <asm/vm_config.h>
12 #include <ptdev.h>
13 
14 #define TEE_FIXED_NONSECURE_VECTOR 0x29U
15 
16 /* If the RDI equals to this value, then this is a RETURN after FIQ DONE */
17 #define OPTEE_RETURN_FIQ_DONE	0xBE000006UL
18 
19 /* This value tells OPTEE that this switch to TEE is due to secure interrupt */
20 #define OPTEE_FIQ_ENTRY	0xB20000FFUL
21 
22 int is_tee_vm(struct acrn_vm *vm);
23 int is_ree_vm(struct acrn_vm *vm);
24 void prepare_tee_vm_memmap(struct acrn_vm *vm, const struct acrn_vm_config *vm_config);
25 void handle_x86_tee_int(struct ptirq_remapping_info *entry, uint16_t pcpu_id);
26 
27 #endif /* TEE_H_ */
28