1 /* *********************************************************************
2 * Broadcom Common Firmware Environment (CFE)
4 * Error strings File: cfe_error.h
6 * This file contains a mapping from error codes to strings
8 * Author: Mitch Lichtenberg (mpl@broadcom.com)
10 *********************************************************************
12 * Copyright 2000,2001,2002,2003
13 * Broadcom Corporation. All rights reserved.
15 * This software is furnished under license and may be used and
16 * copied only in accordance with the following terms and
17 * conditions. Subject to these conditions, you may download,
18 * copy, install, use, modify and distribute modified or unmodified
19 * copies of this software in source and/or binary form. No title
20 * or ownership is transferred hereby.
22 * 1) Any source code used, modified or distributed must reproduce
23 * and retain this copyright notice and list of conditions
24 * as they appear in the source file.
26 * 2) No right is granted to use any trade name, trademark, or
27 * logo of Broadcom Corporation. The "Broadcom Corporation"
28 * name may not be used to endorse or promote products derived
29 * from this software without the prior written permission of
30 * Broadcom Corporation.
32 * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
33 * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
34 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
35 * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
36 * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
37 * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
38 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
39 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
40 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
41 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
42 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
43 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
44 * THE POSSIBILITY OF SUCH DAMAGE.
45 ********************************************************************* */
48 #include "lib_types.h"
50 #include "cfe_error.h"
52 /* *********************************************************************
54 ********************************************************************* */
57 typedef struct errmap_s
{
62 /* *********************************************************************
64 ********************************************************************* */
66 errmap_t cfe_errorstrings
[] = {
69 {CFE_ERR_INV_COMMAND
,"Invalid command"},
70 {CFE_ERR_EOF
,"End of file reached"},
71 {CFE_ERR_IOERR
,"I/O error"},
72 {CFE_ERR_NOMEM
,"Insufficient memory"},
73 {CFE_ERR_DEVNOTFOUND
,"Device not found"},
74 {CFE_ERR_DEVOPEN
,"Device is open"},
75 {CFE_ERR_INV_PARAM
,"Invalid parameter"},
76 {CFE_ERR_ENVNOTFOUND
,"Environment variable not found"},
77 {CFE_ERR_ENVREADONLY
,"Environment variable is read-only"},
78 {CFE_ERR_NOTELF
,"Not an ELF-format executable"},
79 {CFE_ERR_NOT32BIT
,"Not a 32-bit executable"},
80 {CFE_ERR_WRONGENDIAN
,"Executable is wrong-endian"},
81 {CFE_ERR_BADELFVERS
,"Invalid ELF file version"},
82 {CFE_ERR_NOTMIPS
,"Not a MIPS ELF file"},
83 {CFE_ERR_BADELFFMT
,"Invalid ELF file"},
84 {CFE_ERR_BADADDR
,"Section would load outside available DRAM"},
85 {CFE_ERR_FILENOTFOUND
,"File not found"},
86 {CFE_ERR_UNSUPPORTED
,"Unsupported function"},
87 {CFE_ERR_HOSTUNKNOWN
,"Host name unknown"},
88 {CFE_ERR_TIMEOUT
,"Timeout occured"},
89 {CFE_ERR_PROTOCOLERR
,"Network protocol error"},
90 {CFE_ERR_NETDOWN
,"Network is down"},
91 {CFE_ERR_NONAMESERVER
,"No name server configured"},
92 {CFE_ERR_NOHANDLES
,"No more handles"},
93 {CFE_ERR_ALREADYBOUND
,"Already bound"},
94 {CFE_ERR_CANNOTSET
,"Cannot set network parameter"},
95 {CFE_ERR_NOMORE
,"No more enumerated items"},
96 {CFE_ERR_BADFILESYS
,"File system not recognized"},
97 {CFE_ERR_FSNOTAVAIL
,"File system not available"},
98 {CFE_ERR_INVBOOTBLOCK
,"Invalid boot block on disk"},
99 {CFE_ERR_WRONGDEVTYPE
,"Device type is incorrect for boot method"},
100 {CFE_ERR_BBCHECKSUM
,"Boot block checksum is invalid"},
101 {CFE_ERR_BOOTPROGCHKSUM
,"Boot program checksum is invalid"},
102 {CFE_ERR_LDRNOTAVAIL
, "Loader is not available"},
103 {CFE_ERR_NOTREADY
, "Device is not ready"},
104 {CFE_ERR_GETMEM
, "Cannot get memory at specified address"},
105 {CFE_ERR_SETMEM
, "Cannot set memory at specified address"},
106 {CFE_ERR_NOTCONN
, "Socket is not connected"},
107 {CFE_ERR_ADDRINUSE
, "Address is in use"},
108 {CFE_ERR_INTR
, "Interrupted"},
112 /* *********************************************************************
115 * Returns the text corresponding to a CFE error code
121 * string description of error
122 ********************************************************************* */
124 const char *cfe_errortext(int err
)
126 errmap_t
*e
= cfe_errorstrings
;
129 if (e
->errcode
== err
) return e
->string
;
133 return (const char *) "Unknown error";