1 /*
2  * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 /*!
8  @addtogroup cc_pal_pm
9  @{
10  */
11 
12 /*!
13  @file
14  @brief This file contains the definitions and APIs for power-management
15  implementation.
16 
17  This is a placeholder for platform-specific power management implementation.
18  The module should be updated whether CryptoCell is active or not,
19  to notify the external PMU when CryptoCell might be powered down.
20  */
21 
22 #ifndef _CC_PAL_PM_H
23 #define _CC_PAL_PM_H
24 
25 
26 /*
27 ******** Function pointer definitions **********
28 */
29 
30 
31 /*----------------------------
32       PUBLIC FUNCTIONS
33 -----------------------------------*/
34 
35 /*!
36  @brief This function initiates an atomic counter.
37 
38  @return Void.
39  */
40 void CC_PalPowerSaveModeInit(void);
41 
42 /*!
43  @brief This function returns the number of active registered CryptoCell
44  operations.
45 
46  @return The value of the atomic counter.
47  */
48 int32_t CC_PalPowerSaveModeStatus(void);
49 
50 /*!
51  @brief This function updates the atomic counter on each call to CryptoCell.
52 
53  On each call to CryptoCell, the counter is increased. At the end of each operation
54  the counter is decreased.
55  Once the counter is zero, an external callback is called.
56 
57  @return \c 0 on success.
58  @return A non-zero value on failure.
59  */
60 CCError_t CC_PalPowerSaveModeSelect(
61         /*! [in] TRUE: CryptoCell is active. FALSE: CryptoCell is idle. */
62         CCBool isPowerSaveMode
63         );
64 
65 
66 /*!
67  @}
68  */
69 #endif
70