1 /*
2  * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef _CC_INT_GENERAL_DEFS_H
8 #define _CC_INT_GENERAL_DEFS_H
9 
10 /*!
11 @file
12 @brief This file contains internal general definitions of the CryptoCell runtime SW APIs.
13 @defgroup cc_general_defs CryptoCell general definitions
14 @{
15 @ingroup cryptocell_api
16 
17 */
18 
19 #ifdef __cplusplus
20 extern "C"
21 {
22 #endif
23 
24 
25 /************************ Macros ******************************/
26 
27 /* check if fatal error bit is set to ON */
28 #define CC_IS_FATAL_ERR_ON(rc)\
29 do {\
30         uint32_t regVal = 0;\
31     regVal = CC_HAL_READ_REGISTER(CC_REG_OFFSET(HOST_RGF, HOST_AO_LOCK_BITS));\
32             rc = CC_REG_FLD_GET(0, HOST_AO_LOCK_BITS, HOST_FATAL_ERR, regVal);\
33             rc = (rc == 1)?CC_TRUE:CC_FALSE;\
34 }while(0)
35 
36 
37 #ifdef __cplusplus
38 }
39 #endif
40 /**
41 @}
42  */
43 #endif
44 
45 
46 
47