RTEMS
statustext.c
Go to the documentation of this file.
1 
7 /*
8  * Copyright (c) 2014 embedded brains GmbH. All rights reserved.
9  *
10  * embedded brains GmbH
11  * Dornierstr. 4
12  * 82178 Puchheim
13  * Germany
14  * <rtems@embedded-brains.de>
15  *
16  * The license and distribution terms for this file may be
17  * found in the file LICENSE in this distribution or at
18  * http://www.rtems.org/license/LICENSE.
19  */
20 
21 #ifdef HAVE_CONFIG_H
22 #include "config.h"
23 #endif
24 
25 #include <rtems.h>
26 
27 static const char *const status_code_text[] = {
28  "RTEMS_SUCCESSFUL",
29  "RTEMS_TASK_EXITTED",
30  "RTEMS_MP_NOT_CONFIGURED",
31  "RTEMS_INVALID_NAME",
32  "RTEMS_INVALID_ID",
33  "RTEMS_TOO_MANY",
34  "RTEMS_TIMEOUT",
35  "RTEMS_OBJECT_WAS_DELETED",
36  "RTEMS_INVALID_SIZE",
37  "RTEMS_INVALID_ADDRESS",
38  "RTEMS_INVALID_NUMBER",
39  "RTEMS_NOT_DEFINED",
40  "RTEMS_RESOURCE_IN_USE",
41  "RTEMS_UNSATISFIED",
42  "RTEMS_INCORRECT_STATE",
43  "RTEMS_ALREADY_SUSPENDED",
44  "RTEMS_ILLEGAL_ON_SELF",
45  "RTEMS_ILLEGAL_ON_REMOTE_OBJECT",
46  "RTEMS_CALLED_FROM_ISR",
47  "RTEMS_INVALID_PRIORITY",
48  "RTEMS_INVALID_CLOCK",
49  "RTEMS_INVALID_NODE",
50  "RTEMS_NOT_CONFIGURED",
51  "RTEMS_NOT_OWNER_OF_RESOURCE",
52  "RTEMS_NOT_IMPLEMENTED",
53  "RTEMS_INTERNAL_ERROR",
54  "RTEMS_NO_MEMORY",
55  "RTEMS_IO_ERROR",
56  "RTEMS_INTERRUPTED",
57  "RTEMS_PROXY_BLOCKING"
58 };
59 
61 {
62  size_t i = code;
63  const char *text = "?";
64 
65  if ( i < RTEMS_ARRAY_SIZE( status_code_text ) ) {
66  text = status_code_text [i];
67  }
68 
69  return text;
70 }
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:82
const char * rtems_status_text(rtems_status_code code)
Returns a text describing the specified status code.
Definition: statustext.c:60
This header file defines the RTEMS Classic API.
#define RTEMS_ARRAY_SIZE(_array)
Returns the element count of the specified array.
Definition: basedefs.h:459