xref: /aosp_15_r20/external/arm-trusted-firmware/include/lib/extensions/sme.h (revision 54fd6939e177f8ff529b10183254802c76df6d08)
1*54fd6939SJiyong Park /*
2*54fd6939SJiyong Park  * Copyright (c) 2021, ARM Limited and Contributors. All rights reserved.
3*54fd6939SJiyong Park  *
4*54fd6939SJiyong Park  * SPDX-License-Identifier: BSD-3-Clause
5*54fd6939SJiyong Park  */
6*54fd6939SJiyong Park 
7*54fd6939SJiyong Park #ifndef SME_H
8*54fd6939SJiyong Park #define SME_H
9*54fd6939SJiyong Park 
10*54fd6939SJiyong Park #include <stdbool.h>
11*54fd6939SJiyong Park 
12*54fd6939SJiyong Park #include <context.h>
13*54fd6939SJiyong Park 
14*54fd6939SJiyong Park /*
15*54fd6939SJiyong Park  * Maximum value of LEN field in SMCR_ELx. This is different than the maximum
16*54fd6939SJiyong Park  * supported value which is platform dependent. In the first version of SME the
17*54fd6939SJiyong Park  * LEN field is limited to 4 bits but will be expanded in future iterations.
18*54fd6939SJiyong Park  * To support different versions, the code that discovers the supported vector
19*54fd6939SJiyong Park  * lengths will write the max value into SMCR_ELx then read it back to see how
20*54fd6939SJiyong Park  * many bits are implemented.
21*54fd6939SJiyong Park  */
22*54fd6939SJiyong Park #define SME_SMCR_LEN_MAX	U(0x1FF)
23*54fd6939SJiyong Park 
24*54fd6939SJiyong Park void sme_enable(cpu_context_t *context);
25*54fd6939SJiyong Park void sme_disable(cpu_context_t *context);
26*54fd6939SJiyong Park 
27*54fd6939SJiyong Park #endif /* SME_H */
28