1 /*
2 * Copyright (c) 2011-2013, 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 */
40 #ifndef OMX_PACKET_H
41 #define OMX_PACKET_H
44 /*
45 * ======== OMX_Packet ========
46 *
47 * OMX_Packet.desc: the package descriptor field. Note that the
48 * format is different for out-bound and in-bound messages.
49 *
50 * out-bound message descriptor
51 *
52 * Bits Description
53 * --------------------------------------------------------------------
54 * [15:12] reserved
55 * [11:8] omx message type
56 * [7:0] omx client protocol version
57 *
58 *
59 * in-bound message descriptor
60 *
61 * Bits Description
62 * --------------------------------------------------------------------
63 * [15:12] reserved
64 * [11:8] omx server status code
65 * [7:0] omx server protocol version
66 */
68 /* message type values */
69 #define OMX_DESC_MSG 0x1 // exec sync command
70 #define OMX_DESC_SYM_ADD 0x3 // symbol add message
71 #define OMX_DESC_SYM_IDX 0x4 // query symbox index
72 #define OMX_DESC_CMD 0x5 // exec non-blocking command.
73 #define OMX_DESC_TYPE_MASK 0x0F00 // field mask
74 #define OMX_DESC_TYPE_SHIFT 8 // field shift width
76 /* omx server status codes must be 0 - 15, it has to fit in a 4-bit field */
77 #define OMXSERVER_STATUS_SUCCESS ((uint16_t)0) // success
78 #define OMXSERVER_STATUS_INVALID_FXN ((uint16_t)1) // invalid fxn index
79 #define OMXSERVER_STATUS_SYMBOL_NOT_FOUND ((uint16_t)2) // symbol not found
80 #define OMXSERVER_STATUS_INVALID_MSG_TYPE ((uint16_t)3) // invalid msg type
81 #define OMXSERVER_STATUS_MSG_FXN_ERR ((uint16_t)4) // msg function error
82 #define OMXSERVER_STATUS_ERROR ((uint16_t)5) // general failure
83 #define OMXSERVER_STATUS_UNPROCESSED ((uint16_t)6) // unprocessed message
85 /* the packet structure (actual message sent to omx service) */
86 struct omx_packet {
87 UInt16 desc; // descriptor, and omx service status
88 UInt16 msg_id; // id, can be used to distinguish async replies.
89 UInt32 flags; // Set to a fixed value for now.
90 UInt32 fxn_idx; // Index into OMX service's fxn table.
91 Int32 result; // The OMX function's return value is here.
92 UInt32 data_size; // Set to max size of data in and out of the fxn.
93 UInt32 data[1]; // Payload of data_size char's passed to fxn.
94 };
96 /* define this here to remove size of data[1] field. */
97 #define OMXPACKETSIZE (5 * sizeof(UInt32))
99 #define OMX_POOLID_JOBID_NONE (0x00008000)
100 #define OMX_INVALIDFXNIDX ((UInt32)(0xFFFFFFFF))
102 #endif /* OMX_PACKET_H */