Home | History | Annotate | Download | only in cryptocell
      1 /*
      2  * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
      3  *
      4  * SPDX-License-Identifier: BSD-3-Clause
      5  */
      6 
      7 #ifndef CC_PAL_TYPES_H
      8 #define CC_PAL_TYPES_H
      9 
     10 /*!
     11 @file
     12 @brief This file contains platform-dependent definitions and types.
     13 */
     14 
     15 #include "cc_pal_types_plat.h"
     16 
     17 typedef enum {
     18 	CC_FALSE = 0,
     19 	CC_TRUE = 1
     20 } CCBool;
     21 
     22 #define CC_SUCCESS		0UL
     23 #define CC_FAIL			1UL
     24 
     25 #define CC_1K_SIZE_IN_BYTES	1024
     26 #define CC_BITS_IN_BYTE		8
     27 #define CC_BITS_IN_32BIT_WORD	32
     28 #define CC_32BIT_WORD_SIZE	(sizeof(uint32_t))
     29 
     30 #define CC_OK			CC_SUCCESS
     31 
     32 #define CC_UNUSED_PARAM(prm)	((void)prm)
     33 
     34 #define CC_MAX_UINT32_VAL	(0xFFFFFFFF)
     35 
     36 #define CALC_FULL_BYTES(numBits)		(((numBits) + (CC_BITS_IN_BYTE - 1))/CC_BITS_IN_BYTE)
     37 #define CALC_FULL_32BIT_WORDS(numBits)		(((numBits) + (CC_BITS_IN_32BIT_WORD - 1))/CC_BITS_IN_32BIT_WRD)
     38 #define CALC_32BIT_WORDS_FROM_BYTES(sizeBytes)	(((sizeBytes) + CC_32BIT_WORD_SIZE - 1)/CC_32BIT_WORD_SIZE)
     39 
     40 #endif
     41