summaryrefslogtreecommitdiffstats
path: root/c/src/lib/librtems++/rtemsStatusCode.cc
blob: e8e3f965bab10793a65ba9718dd86cf182d0b396 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
  ------------------------------------------------------------------------
  $Id$
  ------------------------------------------------------------------------

  COPYRIGHT (c) 1997
  Objective Design Systems Ltd Pty (ODS)
  All rights reserved (R) Objective Design Systems Ltd Pty
  
  The license and distribution terms for this file may be found in the
  file LICENSE in this distribution or at
  http://www.OARcorp.com/rtems/license.html.

  ------------------------------------------------------------------------

  See header file.

  ------------------------------------------------------------------------
*/

#include <rtems++/rtemsStatusCode.h>

/* ----
    Status Code string table
*/

static char *status_strings[RTEMS_STATUS_CODES_LAST + 1] =
{
  "RTEMS[00] successful completion",
  "RTEMS[01] task exitted, returned from a thread",
  "RTEMS[02] multiprocessing not configured",
  "RTEMS[03] invalid object name",
  "RTEMS[04] invalid object id",
  "RTEMS[05] too many",
  "RTEMS[06] timed out waiting",
  "RTEMS[07] object deleted while waiting",
  "RTEMS[08] specified size was invalid",
  "RTEMS[09] address specified is invalid",
  "RTEMS[10] number was invalid",
  "RTEMS[11] item has not been initialized",
  "RTEMS[12] resources still outstanding",
  "RTEMS[13] request not satisfied",
  "RTEMS[14] thread is in wrong state",
  "RTEMS[15] thread already in state",
  "RTEMS[16] illegal on calling thread",
  "RTEMS[17] illegal for remote object",
  "RTEMS[18] called from wrong environment",
  "RTEMS[19] invalid thread priority",
  "RTEMS[20] invalid date/time",
  "RTEMS[21] invalid node id",
  "RTEMS[22] directive not configured",
  "RTEMS[23] not owner of resource",
  "RTEMS[24] directive not implemented",
  "RTEMS[25] RTEMS inconsistency detected",
  "RTEMS[26] could not get enough memory"
};

/* ----
    StatusCode
*/

const char *rtemsStatusCode::last_status_string()
{
  return status_string(last_status);
}

const char *rtemsStatusCode::status_string(rtems_status_code status_code)
{
  // mapped from "rtems/rtems/status.h"
  if (status_code <= RTEMS_STATUS_CODES_LAST)
  {
    return status_strings[status_code];
  }

  return "unknown status code";
}