blob: 546e766969530d87b6ecf137a69138479c08ca88 [file] [log] [blame]
Soby Mathewb4c6df42022-11-09 11:13:29 +00001/*
2 * SPDX-License-Identifier: BSD-3-Clause
3 * SPDX-FileCopyrightText: Copyright TF-RMM Contributors.
4 */
5
6#ifndef RUN_H
7#define RUN_H
8
AlexeiFedorovf72ab302023-04-27 16:45:04 +01009struct granule;
10struct rec_aux_data;
11
12void init_rec_aux_data(struct rec_aux_data *aux_data, void *rec_aux,
13 unsigned long num_aux);
14void *map_rec_aux(struct granule *rec_aux_pages[], unsigned long num_aux);
15void unmap_rec_aux(void *rec_aux, unsigned long num_aux);
Arunachalam Ganapathyf6491212023-02-23 16:04:34 +000016
Soby Mathewb4c6df42022-11-09 11:13:29 +000017/*
18 * Function to enter Realm with `regs` pointing to GP Regs to be
19 * restored/saved when entering/exiting the Realm. This function
20 * returns with the Realm exception code which is populated by
21 * Realm_exit() on aarch64.
22 */
23int run_realm(unsigned long *regs);
24
Arunachalam Ganapathyf6491212023-02-23 16:04:34 +000025/*
26 * Configure CPTR_EL2 register to not trap FPU or SVE access for Realm and
27 * restore the saved SIMD state from memory to registers.
28 */
29void rec_simd_enable_restore(struct rec *rec);
30
Arunachalam Ganapathy51119932023-03-23 12:32:49 +000031/*
32 * Save the current SIMD state from registers to memory and configure CPTR_EL2
33 * register to trap FPU or SVE access for Realm.
34 */
35void rec_simd_save_disable(struct rec *rec);
36
Soby Mathewb4c6df42022-11-09 11:13:29 +000037#endif /* RUN_H */