1 /*
2  * SPDX-License-Identifier: BSD-3-Clause
3  * SPDX-FileCopyrightText: Copyright TF-RMM Contributors.
4  */
5 
6 #ifndef REALM_ATTEST_H
7 #define REALM_ATTEST_H
8 
9 #include <rsi-walk.h>
10 #include <stdbool.h>
11 
12 struct rec;
13 
14 struct attest_result {
15 	/*
16 	 * If true, RMM should repeat the operation.
17 	 *
18 	 * If false, contents of @access are valid.
19 	 */
20 	bool incomplete;
21 
22 	/*
23 	 * Result of RTT walk performed by RSI command.
24 	 */
25 	struct rsi_walk_result walk_result;
26 
27 	/*
28 	 * If @incomplete is false and @walk_result.abort is false,
29 	 * @smc_result contains GPR values to be returned to the Realm.
30 	 */
31 	struct smc_result smc_res;
32 };
33 
34 unsigned long handle_rsi_read_measurement(struct rec *rec);
35 unsigned long handle_rsi_extend_measurement(struct rec *rec);
36 unsigned long handle_rsi_attest_token_init(struct rec *rec);
37 void attest_realm_token_sign_continue_start(void);
38 void handle_rsi_attest_token_continue(struct rec *rec,
39 				      struct attest_result *res);
40 void attest_realm_token_sign_continue_finish(void);
41 
42 #endif /* REALM_ATTEST_H */
43