blob: 9214564b54bcf59562aba3cd6a50e3209b59cc21 [file] [log] [blame]
Juan Pablo Conde88ffad22024-10-11 21:22:29 -05001/*
2 * Copyright (c) 2024, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#ifndef REALM_HELPERS_H
9#define REALM_HELPERS_H
10
Shruti Gupta91105082024-11-27 05:29:55 +000011#include <realm_rsi.h>
12
Juan Pablo Conde88ffad22024-10-11 21:22:29 -050013/* Generate 64-bit random number */
14unsigned long long realm_rand64(void);
Shruti Gupta5abab762024-11-27 04:57:53 +000015/*
16 * Function to enter Aux Plane from Primary Plane
17 * arg1 == plane index
18 * arg2 == permission index to be used by plane
19 * arg3 == base entrypoint
20 * arg4 == entry flags
21 * aarg5 == run object, needs to be PAGE aligned
22 */
23bool realm_plane_enter(u_register_t plane_index, u_register_t perm_index,
24 u_register_t base, u_register_t flags, rsi_plane_run *run);
25
Shruti Gupta91105082024-11-27 05:29:55 +000026/* This function will call the Host to request IPA of the NS shared buffer */
27u_register_t realm_get_ns_buffer(void);
28
29/* This function will return plane index of current plane */
30unsigned int realm_get_my_plane_num(void);
31
32/** This function will return true for primary plane false for aux plane */
33bool realm_is_plane0(void);
34
Shruti Gupta5abab762024-11-27 04:57:53 +000035/* Function for initializing planes, called at Boot */
36void realm_plane_init(void);
Juan Pablo Conde88ffad22024-10-11 21:22:29 -050037
38#endif /* REALM_HELPERS_H */
39