arm-trusted-firmware/include/lib/extensions/sysreg128.h
Govindraj Raja 306551362c feat(d128): add support for FEAT_D128
This patch disables trapping to EL3 when the FEAT_D128
specific registers are accessed by setting the SCR_EL3.D128En bit.

If FEAT_D128 is implemented, then FEAT_SYSREG128 is implemented.
With FEAT_SYSREG128 certain system registers are treated as 128-bit,
so we should be context saving and restoring 128-bits instead of 64-bit
when FEAT_D128 is enabled.

FEAT_SYSREG128 adds support for MRRS and MSRR instruction which
helps us to read write to 128-bit system register.
Refer to Arm Architecture Manual for further details.

Change the FVP platform to default to handling this as a dynamic option
so the right decision can be made by the code at runtime.

Change-Id: I1a53db5eac29e56c8fbdcd4961ede3abfcb2411a
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2024-10-24 14:51:55 -05:00

36 lines
714 B
C

/*
* Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef SYSREG128_H
#define SYSREG128_H
#ifndef __ASSEMBLER__
#if ENABLE_FEAT_D128
#include <stdint.h>
typedef uint128_t sysreg_t;
#define PAR_EL1_D128 (((sysreg_t)(1ULL)) << (64))
#define _DECLARE_SYSREG128_READ_FUNC(_name) \
uint128_t read_ ## _name(void);
#define _DECLARE_SYSREG128_WRITE_FUNC(_name) \
void write_ ## _name(uint128_t v);
#define DECLARE_SYSREG128_RW_FUNCS(_name) \
_DECLARE_SYSREG128_READ_FUNC(_name) \
_DECLARE_SYSREG128_WRITE_FUNC(_name)
#else
typedef uint64_t sysreg_t;
#endif /* ENABLE_FEAT_D128 */
#endif /* __ASSEMBLER__ */
#endif /* SYSREG128_H */