mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 17:44:19 +00:00

TRP is a small test payload that implements Realm Monitor Management (RMM) functionalities. RMM runs in the Realm world (R-EL2) and manages the execution of Realm VMs and their interaction with the hypervisor in Normal world. TRP is used to test the interface between RMM and Normal world software, known as Realm Management Interface (RMI). Current functions includes returning RMM version and transitioning granules from Non-secure to Realm world and vice versa. More information about RMM can be found at: https://developer.arm.com/documentation/den0125/latest Signed-off-by: Zelalem Aweke <zelalem.aweke@arm.com> Change-Id: Ic7b9a1e1f3142ef6458d40150d0b4ba6bd723ea2
50 lines
1.2 KiB
C
50 lines
1.2 KiB
C
/*
|
|
* Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef TRP_PRIVATE_H
|
|
#define TRP_PRIVATE_H
|
|
|
|
/* Definitions to help the assembler access the SMC/ERET args structure */
|
|
#define TRP_ARGS_SIZE TRP_ARGS_END
|
|
#define TRP_ARG0 0x0
|
|
#define TRP_ARG1 0x8
|
|
#define TRP_ARG2 0x10
|
|
#define TRP_ARG3 0x18
|
|
#define TRP_ARG4 0x20
|
|
#define TRP_ARG5 0x28
|
|
#define TRP_ARG6 0x30
|
|
#define TRP_ARG7 0x38
|
|
#define TRP_ARGS_END 0x40
|
|
|
|
#ifndef __ASSEMBLER__
|
|
|
|
#include <stdint.h>
|
|
|
|
/* Data structure to hold SMC arguments */
|
|
typedef struct trp_args {
|
|
uint64_t regs[TRP_ARGS_END >> 3];
|
|
} __aligned(CACHE_WRITEBACK_GRANULE) trp_args_t;
|
|
|
|
#define write_trp_arg(args, offset, val) (((args)->regs[offset >> 3]) \
|
|
= val)
|
|
|
|
/* Definitions for RMI VERSION */
|
|
#define RMI_ABI_VERSION_MAJOR U(0x0)
|
|
#define RMI_ABI_VERSION_MINOR U(0x0)
|
|
#define RMI_ABI_VERSION ((RMI_ABI_VERSION_MAJOR << 16) | \
|
|
RMI_ABI_VERSION_MINOR)
|
|
|
|
/* Helper to issue SMC calls to BL31 */
|
|
uint64_t trp_smc(trp_args_t *);
|
|
|
|
/* The main function to executed only by Primary CPU */
|
|
void trp_main(void);
|
|
|
|
/* Setup TRP. Executed only by Primary CPU */
|
|
void trp_setup(void);
|
|
|
|
#endif /* __ASSEMBLER__ */
|
|
#endif /* TRP_PRIVATE_H */
|