/drivers/staging/tidspbridge/include/dspbridge/nodepriv.h

https://bitbucket.org/slukk/jb-tsm-kernel-4.2 · C Header · 182 lines · 54 code · 15 blank · 113 comment · 0 complexity · 4c69157299c11fbf2b1f0a5993be4b7b MD5 · raw file

  1. /*
  2. * nodepriv.h
  3. *
  4. * DSP-BIOS Bridge driver support functions for TI OMAP processors.
  5. *
  6. * Private node header shared by NODE and DISP.
  7. *
  8. * Copyright (C) 2005-2006 Texas Instruments, Inc.
  9. *
  10. * This package is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 as
  12. * published by the Free Software Foundation.
  13. *
  14. * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  15. * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  16. * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  17. */
  18. #ifndef NODEPRIV_
  19. #define NODEPRIV_
  20. #include <dspbridge/strmdefs.h>
  21. #include <dspbridge/nodedefs.h>
  22. #include <dspbridge/nldrdefs.h>
  23. /* DSP address of node environment structure */
  24. typedef u32 nodeenv;
  25. /*
  26. * Node create structures
  27. */
  28. /* Message node */
  29. struct node_msgargs {
  30. u32 max_msgs; /* Max # of simultaneous messages for node */
  31. u32 seg_id; /* Segment for allocating message buffers */
  32. u32 notify_type; /* Notify type (SEM_post, SWI_post, etc.) */
  33. u32 arg_length; /* Length in 32-bit words of arg data block */
  34. u8 *pdata; /* Argument data for node */
  35. };
  36. struct node_strmdef {
  37. u32 buf_size; /* Size of buffers for SIO stream */
  38. u32 num_bufs; /* max # of buffers in SIO stream at once */
  39. u32 seg_id; /* Memory segment id to allocate buffers */
  40. u32 timeout; /* Timeout for blocking SIO calls */
  41. u32 buf_alignment; /* Buffer alignment */
  42. char *sz_device; /* Device name for stream */
  43. };
  44. /* Task node */
  45. struct node_taskargs {
  46. struct node_msgargs node_msg_args;
  47. s32 prio;
  48. u32 stack_size;
  49. u32 sys_stack_size;
  50. u32 stack_seg;
  51. u32 dsp_heap_res_addr; /* DSP virtual heap address */
  52. u32 dsp_heap_addr; /* DSP virtual heap address */
  53. u32 heap_size; /* Heap size */
  54. u32 gpp_heap_addr; /* GPP virtual heap address */
  55. u32 profile_id; /* Profile ID */
  56. u32 num_inputs;
  57. u32 num_outputs;
  58. u32 dais_arg; /* Address of iAlg object */
  59. struct node_strmdef *strm_in_def;
  60. struct node_strmdef *strm_out_def;
  61. };
  62. /*
  63. * ======== node_createargs ========
  64. */
  65. struct node_createargs {
  66. union {
  67. struct node_msgargs node_msg_args;
  68. struct node_taskargs task_arg_obj;
  69. } asa;
  70. };
  71. /*
  72. * ======== node_get_channel_id ========
  73. * Purpose:
  74. * Get the channel index reserved for a stream connection between the
  75. * host and a node. This index is reserved when node_connect() is called
  76. * to connect the node with the host. This index should be passed to
  77. * the CHNL_Open function when the stream is actually opened.
  78. * Parameters:
  79. * hnode: Node object allocated from node_allocate().
  80. * dir: Input (DSP_TONODE) or output (DSP_FROMNODE).
  81. * index: Stream index.
  82. * chan_id: Location to store channel index.
  83. * Returns:
  84. * 0: Success.
  85. * -EFAULT: Invalid hnode.
  86. * -EPERM: Not a task or DAIS socket node.
  87. * -EINVAL: The node's stream corresponding to index and dir
  88. * is not a stream to or from the host.
  89. * Requires:
  90. * node_init(void) called.
  91. * Valid dir.
  92. * chan_id != NULL.
  93. * Ensures:
  94. */
  95. extern int node_get_channel_id(struct node_object *hnode,
  96. u32 dir, u32 index, u32 *chan_id);
  97. /*
  98. * ======== node_get_strm_mgr ========
  99. * Purpose:
  100. * Get the STRM manager for a node.
  101. * Parameters:
  102. * hnode: Node allocated with node_allocate().
  103. * strm_man: Location to store STRM manager on output.
  104. * Returns:
  105. * 0: Success.
  106. * -EFAULT: Invalid hnode.
  107. * Requires:
  108. * strm_man != NULL.
  109. * Ensures:
  110. */
  111. extern int node_get_strm_mgr(struct node_object *hnode,
  112. struct strm_mgr **strm_man);
  113. /*
  114. * ======== node_get_timeout ========
  115. * Purpose:
  116. * Get the timeout value of a node.
  117. * Parameters:
  118. * hnode: Node allocated with node_allocate(), or DSP_HGPPNODE.
  119. * Returns:
  120. * Node's timeout value.
  121. * Requires:
  122. * Valid hnode.
  123. * Ensures:
  124. */
  125. extern u32 node_get_timeout(struct node_object *hnode);
  126. /*
  127. * ======== node_get_type ========
  128. * Purpose:
  129. * Get the type (device, message, task, or XDAIS socket) of a node.
  130. * Parameters:
  131. * hnode: Node allocated with node_allocate(), or DSP_HGPPNODE.
  132. * Returns:
  133. * Node type: NODE_DEVICE, NODE_TASK, NODE_XDAIS, or NODE_GPP.
  134. * Requires:
  135. * Valid hnode.
  136. * Ensures:
  137. */
  138. extern enum node_type node_get_type(struct node_object *hnode);
  139. /*
  140. * ======== get_node_info ========
  141. * Purpose:
  142. * Get node information without holding semaphore.
  143. * Parameters:
  144. * hnode: Node allocated with node_allocate(), or DSP_HGPPNODE.
  145. * Returns:
  146. * Node info: priority, device owner, no. of streams, execution state
  147. * NDB properties.
  148. * Requires:
  149. * Valid hnode.
  150. * Ensures:
  151. */
  152. extern void get_node_info(struct node_object *hnode,
  153. struct dsp_nodeinfo *node_info);
  154. /*
  155. * ======== node_get_load_type ========
  156. * Purpose:
  157. * Get the load type (dynamic, overlay, static) of a node.
  158. * Parameters:
  159. * hnode: Node allocated with node_allocate(), or DSP_HGPPNODE.
  160. * Returns:
  161. * Node type: NLDR_DYNAMICLOAD, NLDR_OVLYLOAD, NLDR_STATICLOAD
  162. * Requires:
  163. * Valid hnode.
  164. * Ensures:
  165. */
  166. extern enum nldr_loadtype node_get_load_type(struct node_object *hnode);
  167. #endif /* NODEPRIV_ */