[0074691a] | 1 | /* |
---|
| 2 | ------------------------------------------------------------------------ |
---|
| 3 | $Id$ |
---|
| 4 | ------------------------------------------------------------------------ |
---|
| 5 | |
---|
| 6 | COPYRIGHT (c) 1997 |
---|
| 7 | Objective Design Systems Ltd Pty (ODS) |
---|
| 8 | All rights reserved (R) Objective Design Systems Ltd Pty |
---|
| 9 | |
---|
| 10 | The license and distribution terms for this file may be found in the |
---|
| 11 | file LICENSE in this distribution or at |
---|
| 12 | http://www.OARcorp.com/rtems/license.html. |
---|
| 13 | |
---|
| 14 | ------------------------------------------------------------------------ |
---|
| 15 | |
---|
| 16 | See header file. |
---|
| 17 | |
---|
| 18 | ------------------------------------------------------------------------ |
---|
| 19 | */ |
---|
| 20 | |
---|
| 21 | #include <rtems++/rtemsStatusCode.h> |
---|
| 22 | |
---|
| 23 | /* ---- |
---|
| 24 | Status Code string table |
---|
| 25 | */ |
---|
| 26 | |
---|
| 27 | static char *status_strings[RTEMS_STATUS_CODES_LAST + 1] = |
---|
| 28 | { |
---|
| 29 | "RTEMS[00] successful completion", |
---|
| 30 | "RTEMS[01] task exitted, returned from a thread", |
---|
| 31 | "RTEMS[02] multiprocessing not configured", |
---|
| 32 | "RTEMS[03] invalid object name", |
---|
| 33 | "RTEMS[04] invalid object id", |
---|
| 34 | "RTEMS[05] too many", |
---|
| 35 | "RTEMS[06] timed out waiting", |
---|
| 36 | "RTEMS[07] object deleted while waiting", |
---|
| 37 | "RTEMS[08] specified size was invalid", |
---|
| 38 | "RTEMS[09] address specified is invalid", |
---|
| 39 | "RTEMS[10] number was invalid", |
---|
| 40 | "RTEMS[11] item has not been initialized", |
---|
| 41 | "RTEMS[12] resources still outstanding", |
---|
| 42 | "RTEMS[13] request not satisfied", |
---|
| 43 | "RTEMS[14] thread is in wrong state", |
---|
| 44 | "RTEMS[15] thread already in state", |
---|
| 45 | "RTEMS[16] illegal on calling thread", |
---|
| 46 | "RTEMS[17] illegal for remote object", |
---|
| 47 | "RTEMS[18] called from wrong environment", |
---|
| 48 | "RTEMS[19] invalid thread priority", |
---|
| 49 | "RTEMS[20] invalid date/time", |
---|
| 50 | "RTEMS[21] invalid node id", |
---|
| 51 | "RTEMS[22] directive not configured", |
---|
| 52 | "RTEMS[23] not owner of resource", |
---|
| 53 | "RTEMS[24] directive not implemented", |
---|
| 54 | "RTEMS[25] RTEMS inconsistency detected", |
---|
| 55 | "RTEMS[26] could not get enough memory" |
---|
| 56 | }; |
---|
| 57 | |
---|
| 58 | /* ---- |
---|
| 59 | StatusCode |
---|
| 60 | */ |
---|
| 61 | |
---|
| 62 | const char *rtemsStatusCode::last_status_string() |
---|
| 63 | { |
---|
| 64 | return status_string(last_status); |
---|
| 65 | } |
---|
| 66 | |
---|
| 67 | const char *rtemsStatusCode::status_string(rtems_status_code status_code) |
---|
| 68 | { |
---|
| 69 | // mapped from "rtems/rtems/status.h" |
---|
| 70 | if (status_code <= RTEMS_STATUS_CODES_LAST) |
---|
| 71 | { |
---|
| 72 | return status_strings[status_code]; |
---|
| 73 | } |
---|
| 74 | |
---|
| 75 | return "unknown status code"; |
---|
| 76 | } |
---|
| 77 | |
---|