1 | /* |
---|
2 | * Message Queue Manager |
---|
3 | * |
---|
4 | * |
---|
5 | * COPYRIGHT (c) 1989-1999. |
---|
6 | * On-Line Applications Research Corporation (OAR). |
---|
7 | * |
---|
8 | * The license and distribution terms for this file may be |
---|
9 | * found in the file LICENSE in this distribution or at |
---|
10 | * http://www.OARcorp.com/rtems/license.html. |
---|
11 | * |
---|
12 | * $Id$ |
---|
13 | */ |
---|
14 | |
---|
15 | #include <rtems/system.h> |
---|
16 | #include <rtems/score/sysstate.h> |
---|
17 | #include <rtems/score/chain.h> |
---|
18 | #include <rtems/score/isr.h> |
---|
19 | #include <rtems/score/coremsg.h> |
---|
20 | #include <rtems/score/object.h> |
---|
21 | #include <rtems/score/states.h> |
---|
22 | #include <rtems/score/thread.h> |
---|
23 | #include <rtems/score/wkspace.h> |
---|
24 | #if defined(RTEMS_MULTIPROCESSING) |
---|
25 | #include <rtems/score/mpci.h> |
---|
26 | #endif |
---|
27 | #include <rtems/rtems/status.h> |
---|
28 | #include <rtems/rtems/attr.h> |
---|
29 | #include <rtems/rtems/message.h> |
---|
30 | #include <rtems/rtems/options.h> |
---|
31 | #include <rtems/rtems/support.h> |
---|
32 | |
---|
33 | /*PAGE |
---|
34 | * |
---|
35 | * _Message_queue_Translate_core_message_queue_return_code |
---|
36 | * |
---|
37 | * Input parameters: |
---|
38 | * the_message_queue_status - message_queue status code to translate |
---|
39 | * |
---|
40 | * Output parameters: |
---|
41 | * rtems status code - translated RTEMS status code |
---|
42 | * |
---|
43 | */ |
---|
44 | |
---|
45 | rtems_status_code _Message_queue_Translate_core_return_code_[] = { |
---|
46 | RTEMS_SUCCESSFUL, /* CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL */ |
---|
47 | RTEMS_INVALID_SIZE, /* CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE */ |
---|
48 | RTEMS_TOO_MANY, /* CORE_MESSAGE_QUEUE_STATUS_TOO_MANY */ |
---|
49 | RTEMS_UNSATISFIED, /* CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED */ |
---|
50 | RTEMS_UNSATISFIED, /* CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT */ |
---|
51 | RTEMS_OBJECT_WAS_DELETED, /* CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED */ |
---|
52 | RTEMS_TIMEOUT /* CORE_MESSAGE_QUEUE_STATUS_TIMEOUT */ |
---|
53 | }; |
---|
54 | |
---|
55 | rtems_status_code _Message_queue_Translate_core_message_queue_return_code ( |
---|
56 | unsigned32 status |
---|
57 | ) |
---|
58 | { |
---|
59 | #if defined(RTEMS_MULTIPROCESSING) |
---|
60 | if ( status == THREAD_STATUS_PROXY_BLOCKING ) |
---|
61 | return RTEMS_PROXY_BLOCKING; |
---|
62 | else |
---|
63 | #endif |
---|
64 | if ( status > CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ) |
---|
65 | return RTEMS_INTERNAL_ERROR; |
---|
66 | else |
---|
67 | return _Message_queue_Translate_core_return_code_[status]; |
---|
68 | } |
---|