]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Drivers/ArmScmiDxe/ArmScmiPerformanceProtocolPrivate.h
ArmPkg: Apply uncrustify changes
[mirror_edk2.git] / ArmPkg / Drivers / ArmScmiDxe / ArmScmiPerformanceProtocolPrivate.h
1 /** @file
2
3 Copyright (c) 2017-2021, Arm Limited. All rights reserved.
4
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 System Control and Management Interface V1.0
8 http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/
9 DEN0056A_System_Control_and_Management_Interface.pdf
10 **/
11
12 #ifndef ARM_SCMI_PERFORMANCE_PROTOCOL_PRIVATE_H_
13 #define ARM_SCMI_PERFORMANCE_PROTOCOL_PRIVATE_H_
14
15 #include <Protocol/ArmScmiPerformanceProtocol.h>
16
17 // Number of performance levels returned by a call to the SCP, Lvls Bits[11:0]
18 #define NUM_PERF_LEVELS_MASK 0x0FFF
19 #define NUM_PERF_LEVELS(Lvls) (Lvls & NUM_PERF_LEVELS_MASK)
20
21 // Number of performance levels remaining after a call to the SCP, Lvls Bits[31:16]
22 #define NUM_REMAIN_PERF_LEVELS_SHIFT 16
23 #define NUM_REMAIN_PERF_LEVELS(Lvls) (Lvls >> NUM_REMAIN_PERF_LEVELS_SHIFT)
24
25 /** Return values for ScmiMessageIdPerformanceDescribeLevels command.
26 SCMI Spec section 4.5.2.5
27 **/
28 typedef struct {
29 UINT32 NumLevels;
30
31 // NOTE: Since EDK2 does not allow flexible array member [] we declare
32 // here array of 1 element length. However below is used as a variable
33 // length array.
34 SCMI_PERFORMANCE_LEVEL PerfLevel[1]; // Offset to array of performance levels
35 } PERF_DESCRIBE_LEVELS;
36
37 /** Initialize performance management protocol and install on a given Handle.
38
39 @param[in] Handle Handle to install performance management
40 protocol.
41
42 @retval EFI_SUCCESS Performance protocol installed successfully.
43 **/
44 EFI_STATUS
45 ScmiPerformanceProtocolInit (
46 IN EFI_HANDLE *Handle
47 );
48
49 #endif /* ARM_SCMI_PERFORMANCE_PROTOCOL_PRIVATE_H_ */