import PULS_20160108
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / include / trustzone / tz_cross / tz_error_strings.h
1 /*
2 * Helper to implement TZ_GetErrorString in MTEE/KREE/UREE
3 * Please don't include this.
4 */
5
6 #ifndef __TZ_ERROR_STRINGS__
7 #define __TZ_ERROR_STRINGS__
8
9 static const char *TZ_ErrorStrings[] = {
10 "The operation was successful.",
11 "Non-specific cause.",
12 "Access privileges are not sufficient.",
13 "The operation was cancelled.",
14 "Concurrent accesses caused conflict.",
15 "Too much data for the requested operation was passed.",
16 "Input data was of invalid format.",
17 "Input parameters were invalid.",
18 "Operation is not valid in the current state.",
19 "The requested data item is not found.",
20 "The requested operation should exist but is not yet implemented.",
21 "The requested operation is valid but is not supported in this Implementation.",
22 "Expected data was missing.",
23 "System ran out of resources.",
24 "The system is busy working on something else.",
25 "Communication with a remote party failed.",
26 "A security fault was detected.",
27 "The supplied buffer is too short for the generated output.",
28 "The handle is invalid.",
29 "Unknown error.",
30 };
31 #define TZ_ErrorStrings_num (sizeof(TZ_ErrorStrings)/sizeof(TZ_ErrorStrings[0]))
32
33
34 static const char *_TZ_GetErrorString(TZ_RESULT res)
35 {
36 unsigned int num;
37
38 if (res == 0)
39 return TZ_ErrorStrings[0];
40
41 num = ((unsigned int)res & 0xffff) + 1;
42 if (num > (TZ_ErrorStrings_num-1))
43 num = TZ_ErrorStrings_num-1;
44 return TZ_ErrorStrings[num];
45 }
46
47 #endif /* __TZ_ERROR_STRINGS__ */