1 /* 2 * Arm SCP/MCP Software 3 * Copyright (c) 2023, Arm Limited and Contributors. All rights reserved. 4 * 5 * SPDX-License-Identifier: BSD-3-Clause 6 * 7 * Description: 8 * AMU interface 9 */ 10 11 #ifndef INTERFACE_AMU_H 12 #define INTERFACE_AMU_H 13 14 #include <fwk_id.h> 15 16 #include <stddef.h> 17 18 /*! 19 * \addtogroup GroupInterfaces Interfaces 20 * \{ 21 */ 22 23 /*! 24 * \defgroup GroupAmu Activity Monitor Unit counters interface 25 * 26 * \brief Interface definition for AMU drivers. 27 * 28 * \details This interface should be implemented by drivers to access 29 * AMU counters. 30 * \{ 31 */ 32 33 /*! 34 * \defgroup GroupAmuApis APIs 35 * \{ 36 */ 37 38 /*! 39 * \brief AMU API to retrieve the AMU counters. 40 */ 41 struct amu_api { 42 /*! 43 * \brief Get the AMU counters value starting from the given counter ID 44 * 45 * \param start_counter_id ID of the counter to start from. 46 * \param[out] counter_buff Pointer to a buffer to be filled with the 47 * counters values. 48 * \param num_counter The number of the counters requested. 49 * 50 * \note \b counter_buff must have space for \b num_counter elements. 51 * \retval ::FWK_E_PARAM One or more parameters were invalid. 52 * \retval ::FWK_E_RANGE Number of counters requested is out of range. 53 * \retval ::FWK_SUCCESS The request was successfully completed. 54 * \return One of the standard framework status codes. 55 */ 56 int (*get_counters)( 57 fwk_id_t start_counter_id, 58 uint64_t *counter_buff, 59 size_t num_counter); 60 }; 61 62 /*! 63 * \} 64 */ 65 66 /*! 67 * \} 68 */ 69 70 /*! 71 * \} 72 */ 73 74 #endif /* INTERFACE_AMU_H */ 75