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_ERROR_H__ 8 #define __CC_ERROR_H__ 9 10 #ifdef __KERNEL__ 11 #include <linux/types.h> 12 #define INT32_MAX 0x7FFFFFFFL 13 #else 14 #include <stdint.h> 15 #endif 16 17 18 typedef enum CCSymRetCode { 19 CC_RET_OK = 0, /* No error */ 20 CC_RET_UNSUPP_ALG, /* Unsupported algorithm */ 21 CC_RET_UNSUPP_ALG_MODE, /* Unsupported algorithm mode */ 22 CC_RET_UNSUPP_OPERATION, /* Unsupported operation */ 23 CC_RET_UNSUPP_HWKEY, /* Unsupported hw key */ 24 CC_RET_INV_HWKEY, /* invalid hw key */ 25 CC_RET_INVARG, /* Invalid parameter */ 26 CC_RET_INVARG_KEY_SIZE, /* Invalid key size */ 27 CC_RET_INVARG_CTX_IDX, /* Invalid context index */ 28 CC_RET_INVARG_CTX, /* Bad or corrupted context */ 29 CC_RET_INVARG_BAD_ADDR, /* Bad address */ 30 CC_RET_INVARG_INCONSIST_DMA_TYPE, /* DIN is inconsist with DOUT DMA type */ 31 CC_RET_PERM, /* Operation not permitted */ 32 CC_RET_NOEXEC, /* Execution format error */ 33 CC_RET_BUSY, /* Resource busy */ 34 CC_RET_NOMEM, /* Out of memory */ 35 CC_RET_OSFAULT, /* Internal TEE_OS error */ 36 CCSYMCRYPTO_RET_RESERVE32 = INT32_MAX /* assure this enum is 32b */ 37 }CCSymRetCode_t; 38 39 40 #endif /*__CC_ERROR_H__*/ 41