1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2015-2021, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  *
7  * Description:
8  *     Standard return codes.
9  */
10 
11 #ifndef FWK_STATUS_H
12 #define FWK_STATUS_H
13 
14 /*!
15  * \addtogroup GroupLibFramework Framework
16  * \{
17  */
18 
19 /*!
20  * \defgroup GroupStatus Return Codes
21  * \{
22  */
23 
24 /*! Success, request is pending */
25 #define FWK_PENDING         1
26 
27 /*! Success */
28 #define FWK_SUCCESS         0
29 
30 /*! Invalid parameter(s) */
31 #define FWK_E_PARAM         -1
32 
33 /*! Invalid alignment */
34 #define FWK_E_ALIGN         -2
35 
36 /*! Invalid size */
37 #define FWK_E_SIZE          -3
38 
39 /*! Invalid handler or callback */
40 #define FWK_E_HANDLER       -4
41 
42 /*! Invalid access or permission denied */
43 #define FWK_E_ACCESS        -5
44 
45 /*! Value out of range */
46 #define FWK_E_RANGE         -6
47 
48 /*! Operation timed out */
49 #define FWK_E_TIMEOUT       -7
50 
51 /*! Memory allocation failed */
52 #define FWK_E_NOMEM         -8
53 
54 /*! Invalid power state */
55 #define FWK_E_PWRSTATE      -9
56 
57 /*! Not supported or disabled */
58 #define FWK_E_SUPPORT       -10
59 
60 /*! Device error */
61 #define FWK_E_DEVICE        -11
62 
63 /*! Handler or resource busy */
64 #define FWK_E_BUSY          -12
65 
66 /*! OS error response */
67 #define FWK_E_OS            -13
68 
69 /*! Unexpected or invalid data */
70 #define FWK_E_DATA          -14
71 
72 /*! Invalid state for the device or component */
73 #define FWK_E_STATE         -15
74 
75 /*! Accessing an uninitialized resource */
76 #define FWK_E_INIT          -16
77 
78 /*! Configuration overwritten */
79 #define FWK_E_OVERWRITTEN   -17
80 
81 /*! Unrecoverable error */
82 #define FWK_E_PANIC         -18
83 
84 /*!
85  * \brief Return a human readable string representation of a status code.
86  *
87  * \param status Status code value.
88  *
89  * \return String representation of \p status
90  */
91 const char *fwk_status_str(int status);
92 
93 /*!
94  * \}
95  */
96 
97 /*!
98  * \}
99  */
100 
101 #endif /* FWK_STATUS_H */
102