[ipc/ipcdev.git] / qnx / src / ipc3x_dev / ti / syslink / samples / hlos / rpmsg-omx / usr / omx_packet.h
1 /*
2 * Copyright (c) 2011, Texas Instruments Incorporated
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * * Neither the name of Texas Instruments Incorporated nor the names of
17 * its contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32 /*
33 * omx_packet.h
34 *
35 * This is the packet structure for messages to/from OMX servers created by the
36 * ServiceMgr on BIOS.
37 *
38 */
39 #ifndef OMX_PACKET_H
40 #define OMX_PACKET_H
42 /*
43 * ======== OMX_Packet ========
44 *
45 * OMX_Packet.desc: the package descriptor field. Note that the
46 * format is different for out-bound and in-bound messages.
47 *
48 * out-bound message descriptor
49 *
50 * Bits Description
51 * --------------------------------------------------------------------
52 * [15:12] reserved
53 * [11:8] omx message type
54 * [7:0] omx client protocol version
55 *
56 *
57 * in-bound message descriptor
58 *
59 * Bits Description
60 * --------------------------------------------------------------------
61 * [15:12] reserved
62 * [11:8] omx server status code
63 * [7:0] omx server protocol version
64 */
66 /* message type values */
67 #define OMX_DESC_MSG 0x1 // exec sync command
68 #define OMX_DESC_SYM_ADD 0x3 // symbol add message
69 #define OMX_DESC_SYM_IDX 0x4 // query symbox index
70 #define OMX_DESC_CMD 0x5 // exec non-blocking command.
71 #define OMX_DESC_TYPE_MASK 0x0F00 // field mask
72 #define OMX_DESC_TYPE_SHIFT 8 // field shift width
74 /* omx server status codes must be 0 - 15, it has to fit in a 4-bit field */
75 #define OMXSERVER_STATUS_SUCCESS ((uint16_t)0) // success
76 #define OMXSERVER_STATUS_INVALID_FXN ((uint16_t)1) // invalid fxn index
77 #define OMXSERVER_STATUS_SYMBOL_NOT_FOUND ((uint16_t)2) // symbol not found
78 #define OMXSERVER_STATUS_INVALID_MSG_TYPE ((uint16_t)3) // invalid msg type
79 #define OMXSERVER_STATUS_MSG_FXN_ERR ((uint16_t)4) // msg function error
80 #define OMXSERVER_STATUS_ERROR ((uint16_t)5) // general failure
81 #define OMXSERVER_STATUS_UNPROCESSED ((uint16_t)6) // unprocessed message
83 /* the packet structure (actual message sent to omx service) */
84 typedef struct {
85 uint16_t desc; // descriptor, and omx service status
86 uint16_t msg_id; // id, can be used to distinguish async replies.
87 uint32_t flags; // Set to a fixed value for now.
88 uint32_t fxn_idx; // Index into OMX service's fxn table.
89 int32_t result; // The OMX function's return value is here.
90 uint32_t data_size; // Set to max size of data in and out of the fxn.
91 uint32_t data[0]; // Payload of data_size char's passed to fxn.
92 } omx_packet;
94 #define OMX_POOLID_JOBID_NONE (0x00008000)
95 #define OMX_INVALIDFXNIDX ((uint32_t)(0xFFFFFFFF))
97 #endif /* OMX_PACKET_H */