1 /* 2 * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef __AMU_H__ 8 #define __AMU_H__ 9 10 #include <sys/cdefs.h> /* for CASSERT() */ 11 #include <cassert.h> 12 #include <platform_def.h> 13 14 /* All group 0 counters */ 15 #define AMU_GROUP0_COUNTERS_MASK 0xf 16 17 #ifdef PLAT_AMU_GROUP1_COUNTERS_MASK 18 #define AMU_GROUP1_COUNTERS_MASK PLAT_AMU_GROUP1_COUNTERS_MASK 19 #else 20 #define AMU_GROUP1_COUNTERS_MASK 0 21 #endif 22 23 #ifdef PLAT_AMU_GROUP1_NR_COUNTERS 24 #define AMU_GROUP1_NR_COUNTERS PLAT_AMU_GROUP1_NR_COUNTERS 25 #else 26 #define AMU_GROUP1_NR_COUNTERS 0 27 #endif 28 29 CASSERT(AMU_GROUP1_COUNTERS_MASK <= 0xffff, invalid_amu_group1_counters_mask); 30 CASSERT(AMU_GROUP1_NR_COUNTERS <= 16, invalid_amu_group1_nr_counters); 31 32 void amu_enable(int el2_unused); 33 34 #endif /* __AMU_H__ */ 35