dsp_hal.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737
  1. /*
  2. * Copyright (c) 1997-2015, Actions Semi Co., Inc.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef __DSP_HAL_H__
  7. #define __DSP_HAL_H__
  8. #include <zephyr.h>
  9. #include <mem_manager.h>
  10. #include <string.h>
  11. #include <errno.h>
  12. #include <soc_dsp.h>
  13. #include <dsp_hal_defs.h>
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. typedef int (*dsp_session_buf_read_fn)(void *, void *, unsigned int);
  18. typedef int (*dsp_session_buf_write_fn)(void *, const void *, unsigned int);
  19. /* session information to initialize a session */
  20. struct dsp_session_info {
  21. /* session id */
  22. unsigned int type;
  23. /* allowed functions (bitfield) */
  24. unsigned int func_allowed;
  25. /* dsp image name */
  26. const char *main_dsp;
  27. const char *sub_dsp;
  28. };
  29. struct dsp_session;
  30. struct dsp_session_buf;
  31. /* dsp session ops */
  32. /**
  33. * @brief open the global session
  34. *
  35. * session can be open multiple times, thus, the parameter "info" will be
  36. * ignored if this is not the first open.
  37. *
  38. * @param info session information
  39. *
  40. * @return Address of global session
  41. */
  42. struct dsp_session *dsp_open_global_session(struct dsp_session_info *info);
  43. /**
  44. * @brief close the global session
  45. *
  46. * @return N/A
  47. */
  48. void dsp_close_global_session(struct dsp_session *session);
  49. /**
  50. * @brief get session (task) state
  51. *
  52. * @param session Address of session
  53. *
  54. * @return the state (DSP_TASK_x) of session
  55. */
  56. int dsp_session_get_state(struct dsp_session *session);
  57. /**
  58. * @brief get session run error
  59. *
  60. * @param session Address of session
  61. *
  62. * @return the error code of session
  63. */
  64. int dsp_session_get_error(struct dsp_session *session);
  65. /**
  66. * @brief dump session information
  67. *
  68. * @param session Address of session
  69. *
  70. * @return N/A
  71. */
  72. void dsp_session_dump(struct dsp_session *session);
  73. /**
  74. * @brief submit session command
  75. *
  76. * @param session Address of session
  77. * @param command Command to submit
  78. *
  79. * @return 0 if succeed, the others if failed
  80. */
  81. int dsp_session_submit_command(struct dsp_session *session, struct dsp_command *command);
  82. /**
  83. * @brief submit session command without data
  84. *
  85. * @param session Address of session
  86. * @param command Command to submit
  87. *
  88. * @return 0 if succeed, the others if failed
  89. */
  90. static inline int dsp_session_submit_simple_command(struct dsp_session *session, unsigned int id, struct k_sem *sem)
  91. {
  92. struct dsp_command command = {
  93. .id = id,
  94. .sem = (uint32_t)sem,
  95. .size = 0,
  96. };
  97. return dsp_session_submit_command(session, &command);;
  98. }
  99. /**
  100. * @brief query session command finished
  101. *
  102. * @param session Address of session
  103. * @param command Command to query
  104. *
  105. * @return the query result
  106. */
  107. bool dsp_session_command_finished(struct dsp_session *session, struct dsp_command *command);
  108. /**
  109. * @brief kick dsp, since data ready
  110. *
  111. * @param session Address of session
  112. *
  113. * @return 0 if succeed, the others if failed
  114. */
  115. int dsp_session_kick(struct dsp_session *session);
  116. /**
  117. * @brief wait dsp for data output
  118. *
  119. * @param session Address of session
  120. * @param timout Waiting period to take the semaphore (in milliseconds),
  121. * or one of the special values K_NO_WAIT and K_FOREVER.
  122. *
  123. * @retval 0 Wait succeed.
  124. * @retval -ENOTSUP Waiting not supported, since wait_sem of sessoin_info
  125. * not configured when opening session.
  126. * @retval -EBUSY Returned without waiting.
  127. * @retval -EAGAIN Waiting period timed out.
  128. */
  129. int dsp_session_wait(struct dsp_session *session, int timout);
  130. /**
  131. * @brief Define and initialize a dsp command without data.
  132. *
  133. * The command can be accessed outside the module where it is defined using:
  134. *
  135. * @code extern struct dsp_command <name>; @endcode
  136. *
  137. * @param name Name of the command.
  138. * @param cmd_id Command id.
  139. * @param sem_obj Semaphore object for synchronization.
  140. */
  141. #define DSP_COMMAND_DEFINE(name, cmd_id, sem_obj) \
  142. struct dsp_command name = { \
  143. .id = cmd_id, \
  144. .sem = (uint32_t)sem_obj, \
  145. .size = 0, \
  146. }
  147. /**
  148. * @brief Initialize allocate and initialize a dsp command.
  149. *
  150. * This routine allocate and initializes a dsp command.
  151. *
  152. * @param id Command id.
  153. * @param sem Address of semaphore object for synchronization.
  154. * @param size Size of command data.
  155. * @param data Address of command data.
  156. *
  157. * @return Address of command.
  158. */
  159. static inline struct dsp_command *dsp_command_alloc(unsigned int id,
  160. struct k_sem *sem, size_t size, const void *data)
  161. {
  162. struct dsp_command *command = mem_malloc(sizeof(*command) + size);
  163. if (command) {
  164. command->id = (uint16_t)id;
  165. command->sem = (uint32_t)sem;
  166. command->size = size;
  167. if (data)
  168. memcpy(command->data, data, size);
  169. }
  170. return command;
  171. }
  172. /**
  173. * @brief Free a dsp command.
  174. *
  175. * This routine free a dsp command.
  176. *
  177. * @param command Address of command.
  178. *
  179. * @return N/A
  180. */
  181. static inline void dsp_command_free(struct dsp_command *command)
  182. {
  183. mem_free((void *)command);
  184. }
  185. /**
  186. * @brief submit command DSP_CMD_NULL.
  187. *
  188. * This routine submit command DSP_CMD_NULL.
  189. *
  190. * @param session Address of the session.
  191. * @param sem Address of semaphore object for synchronization.
  192. *
  193. * @return Command result.
  194. */
  195. static inline int dsp_session_submit_null(struct dsp_session *session, struct k_sem *sem)
  196. {
  197. DSP_COMMAND_DEFINE(command, DSP_CMD_NULL, sem);
  198. return dsp_session_submit_command(session, &command);
  199. }
  200. /**
  201. * @brief Initialize a session with command DSP_CMD_SESSION_INIT
  202. *
  203. * This routine initialize a session using command DSP_CMD_SESSION_INIT.
  204. *
  205. * @param session Address of the session.
  206. * @param size Size of prarameters.
  207. * @param params Address of prarameters.
  208. *
  209. * @return Command result.
  210. */
  211. static inline int dsp_session_init(struct dsp_session *session, size_t size, const void *params)
  212. {
  213. struct dsp_command *command = dsp_command_alloc(DSP_CMD_SESSION_INIT, NULL, size, params);
  214. int res = -ENOMEM;
  215. if (command) {
  216. res = dsp_session_submit_command(session, command);
  217. dsp_command_free(command);
  218. }
  219. return res;
  220. }
  221. /**
  222. * @brief Begin a session with command DSP_CMD_SESSION_BEGIN
  223. *
  224. * This routine begin a session using command DSP_CMD_SESSION_BEGIN without params.
  225. *
  226. * @param session Address of the session.
  227. * @param sem Address of semaphore object for synchronization.
  228. *
  229. * @return Command result.
  230. */
  231. static inline int dsp_session_begin(struct dsp_session *session, struct k_sem *sem)
  232. {
  233. DSP_COMMAND_DEFINE(command, DSP_CMD_SESSION_BEGIN, sem);
  234. return dsp_session_submit_command(session, &command);
  235. }
  236. /**
  237. * @brief End a session with command DSP_CMD_SESSION_END.
  238. *
  239. * This routine end a session using command DSP_CMD_SESSION_END without params.
  240. *
  241. * @param session Address of the session.
  242. * @param sem Address of semaphore object for synchronization.
  243. *
  244. * @return Command result.
  245. */
  246. static inline int dsp_session_end(struct dsp_session *session, struct k_sem *sem)
  247. {
  248. DSP_COMMAND_DEFINE(command, DSP_CMD_SESSION_END, sem);
  249. return dsp_session_submit_command(session, &command);
  250. }
  251. /**
  252. * @brief Configure a session function with command DSP_CMD_FUNCTION_CONFIG.
  253. *
  254. * This routine configure a function using command DSP_CMD_FUNCTION_CONFIG.
  255. *
  256. * @param session Address of the session.
  257. * @param func Session function ID.
  258. * @param conf Function specific configure ID.
  259. * @param size Size of prarameters.
  260. * @param params Address of prarameters.
  261. *
  262. * @return Command result.
  263. */
  264. static inline int dsp_session_config_func(struct dsp_session *session,
  265. unsigned int func, unsigned int conf, size_t size, const void *params)
  266. {
  267. struct dsp_command *command = dsp_command_alloc(DSP_CMD_FUNCTION_CONFIG, NULL, size + 8, NULL);
  268. int res = -ENOMEM;
  269. if (command) {
  270. command->data[0] = func;
  271. command->data[1] = conf;
  272. memcpy(&command->data[2], params, size);
  273. res = dsp_session_submit_command(session, command);
  274. dsp_command_free(command);
  275. }
  276. return res;
  277. }
  278. /**
  279. * @brief Enable a session function with command DSP_CMD_FUNCTION_ENABLE.
  280. *
  281. * This routine enable a function using command DSP_CMD_FUNCTION_ENABLE without params.
  282. *
  283. * @param session Address of the session.
  284. * @param func Session function ID.
  285. * @param sem Address of semaphore object for synchronization.
  286. *
  287. * @return Command result.
  288. */
  289. static inline int dsp_session_enable_func_sync(struct dsp_session *session, unsigned int func, struct k_sem *sem)
  290. {
  291. struct dsp_command *command = dsp_command_alloc(DSP_CMD_FUNCTION_ENABLE, sem, 4, &func);
  292. int res = -ENOMEM;
  293. if (command) {
  294. res = dsp_session_submit_command(session, command);
  295. dsp_command_free(command);
  296. }
  297. return res;
  298. }
  299. /**
  300. * @brief Enable a session function with command DSP_CMD_FUNCTION_ENABLE.
  301. *
  302. * This routine enable a function using command DSP_CMD_FUNCTION_ENABLE without params.
  303. *
  304. * @param session Address of the session.
  305. * @param func Session function ID.
  306. *
  307. * @return Command result.
  308. */
  309. static inline int dsp_session_enable_func(struct dsp_session *session, unsigned int func)
  310. {
  311. return dsp_session_enable_func_sync(session, func, NULL);
  312. }
  313. /**
  314. * @brief Disable a session function with command DSP_CMD_FUNCTION_DISABLE.
  315. *
  316. * This routine disable a function using command DSP_CMD_FUNCTION_DISABLE without params.
  317. *
  318. * @param session Address of the session.
  319. * @param func Session function ID.
  320. * @param sem Address of semaphore object for synchronization.
  321. *
  322. * @return Command result.
  323. */
  324. static inline int dsp_session_disable_func_sync(struct dsp_session *session, unsigned int func, struct k_sem *sem)
  325. {
  326. struct dsp_command *command = dsp_command_alloc(DSP_CMD_FUNCTION_DISABLE, sem, 4, &func);
  327. int res = -ENOMEM;
  328. if (command) {
  329. res = dsp_session_submit_command(session, command);
  330. dsp_command_free(command);
  331. }
  332. return res;
  333. }
  334. /**
  335. * @brief Disable a session function with command DSP_CMD_FUNCTION_DISABLE.
  336. *
  337. * This routine disable a function using command DSP_CMD_FUNCTION_DISABLE without params.
  338. *
  339. * @param session Address of the session.
  340. * @param func Session function ID.
  341. *
  342. * @return Command result.
  343. */
  344. static inline int dsp_session_disable_func(struct dsp_session *session, unsigned int func)
  345. {
  346. return dsp_session_disable_func_sync(session, func, NULL);
  347. }
  348. /**
  349. * @brief Pause a session function with command DSP_CMD_FUNCTION_PAUSE.
  350. *
  351. * This routine pause a function using command DSP_CMD_FUNCTION_PAUSE without params.
  352. *
  353. * @param session Address of the session.
  354. * @param func Session function ID.
  355. * @param sem Address of semaphore object for synchronization.
  356. *
  357. * @return Command result.
  358. */
  359. static inline int dsp_session_pause_func_sync(struct dsp_session *session, unsigned int func, struct k_sem *sem)
  360. {
  361. struct dsp_command *command = dsp_command_alloc(DSP_CMD_FUNCTION_PAUSE, sem, 4, &func);
  362. int res = -ENOMEM;
  363. if (command) {
  364. res = dsp_session_submit_command(session, command);
  365. dsp_command_free(command);
  366. }
  367. return res;
  368. }
  369. /**
  370. * @brief Pause a session function with command DSP_CMD_FUNCTION_PAUSE.
  371. *
  372. * This routine pause a function using command DSP_CMD_FUNCTION_PAUSE without params.
  373. *
  374. * @param session Address of the session.
  375. * @param func Session function ID.
  376. *
  377. * @return Command result.
  378. */
  379. static inline int dsp_session_pause_func(struct dsp_session *session, unsigned int func)
  380. {
  381. return dsp_session_pause_func_sync(session, func, NULL);
  382. }
  383. /**
  384. * @brief Resume a session function with command DSP_CMD_FUNCTION_RESUME.
  385. *
  386. * This routine resume a function using command DSP_CMD_FUNCTION_RESUME without params.
  387. *
  388. * @param session Address of the session.
  389. * @param func Session function ID.
  390. * @param sem Address of semaphore object for synchronization.
  391. *
  392. * @return Command result.
  393. */
  394. static inline int dsp_session_resume_func_sync(struct dsp_session *session, unsigned int func, struct k_sem *sem)
  395. {
  396. struct dsp_command *command = dsp_command_alloc(DSP_CMD_FUNCTION_RESUME, sem, 4, &func);
  397. int res = -ENOMEM;
  398. if (command) {
  399. res = dsp_session_submit_command(session, command);
  400. dsp_command_free(command);
  401. }
  402. return res;
  403. }
  404. /**
  405. * @brief Resume a session function with command DSP_CMD_FUNCTION_RESUME.
  406. *
  407. * This routine resume a function using command DSP_CMD_FUNCTION_RESUME without params.
  408. *
  409. * @param session Address of the session.
  410. * @param func Session function ID.
  411. *
  412. * @return Command result.
  413. */
  414. static inline int dsp_session_resume_func(struct dsp_session *session, unsigned int func)
  415. {
  416. return dsp_session_resume_func_sync(session, func, NULL);
  417. }
  418. /**
  419. * @brief Debug a session function with command DSP_CMD_FUNCTION_DEBUG.
  420. *
  421. * This routine debug a function using command DSP_CMD_FUNCTION_DEBUG.
  422. *
  423. * @param session Address of the session.
  424. * @param func Session function ID.
  425. * @param size Size of debug options.
  426. * @param options Address of debug options.
  427. *
  428. * @return Command result.
  429. */
  430. static inline int dsp_session_debug_func(struct dsp_session *session,
  431. unsigned int func, size_t size, const void *options)
  432. {
  433. struct dsp_command *command = dsp_command_alloc(DSP_CMD_FUNCTION_DEBUG, NULL, size + 4, NULL);
  434. int res = -ENOMEM;
  435. if (command) {
  436. command->data[0] = func;
  437. memcpy(&command->data[1], options, size);
  438. res = dsp_session_submit_command(session, command);
  439. dsp_command_free(command);
  440. }
  441. return res;
  442. }
  443. /**
  444. * @brief get samples count of specific function
  445. *
  446. * This function must export samples_count information to cpu side.
  447. *
  448. * @param session Address of session
  449. * @param func Session function ID
  450. *
  451. * @return samples count
  452. */
  453. unsigned int dsp_session_get_samples_count(struct dsp_session *session, unsigned int func);
  454. /**
  455. * @brief get lost count of specific function
  456. *
  457. * This function must export datalost_count information to cpu side.
  458. *
  459. * @param session Address of session
  460. * @param func Session function ID
  461. *
  462. * @return lost count
  463. */
  464. unsigned int dsp_session_get_datalost_count(struct dsp_session *session, unsigned int func);
  465. /**
  466. * @brief get raw stream count of specific function
  467. *
  468. * This function must export raw_count information to cpu side.
  469. * For encoder, this is the encoded stream amount.
  470. * For decoder, this is the decoded stream amount.
  471. *
  472. * @param session Address of session
  473. * @param func Session function ID
  474. *
  475. * @return lost count
  476. */
  477. unsigned int dsp_session_get_raw_count(struct dsp_session *session, unsigned int func);
  478. /**
  479. * @brief get dsp session recoder param
  480. *
  481. * This function must export recoder param to cpu side.
  482. *
  483. * @param session Address of session
  484. * @param param_type encoder sub module type
  485. * @param param param address
  486. *
  487. * @return lost count
  488. */
  489. int dsp_session_get_recoder_param(struct dsp_session *session, int param_type, void *param);
  490. /**
  491. * @brief get dsp session recoder param
  492. *
  493. * This function must export recoder param to cpu side.
  494. *
  495. * @param session Address of session
  496. * @param function_type function type
  497. *
  498. * @return function is runable or not
  499. */
  500. int dsp_session_get_function_runable(struct dsp_session *session, int function_type);
  501. /**
  502. * @brief get dsp session recoder param
  503. *
  504. * This function must export recoder param to cpu side.
  505. *
  506. * @param session Address of session
  507. * @param function_type function type
  508. *
  509. * @return function is enabled or not
  510. */
  511. int dsp_session_get_function_enable(struct dsp_session *session, int function_type);
  512. /* dsp session buffer ops */
  513. /**
  514. * @brief Initialiize a dsp session buffer.
  515. *
  516. * This routine initialize a dsp session buffer with external buffer backstore.
  517. *
  518. * @param session Address of session.
  519. * @param data Address of external buffer backstore.
  520. * @param size Size of session buffer, must be mutiple of 2.
  521. *
  522. * @return Address of session buffer
  523. */
  524. struct dsp_session_buf *dsp_session_buf_init(struct dsp_session *session, void *data, unsigned int size);
  525. /* dsp session buffer ops */
  526. /**
  527. * @brief clone a dsp session buffer.
  528. *
  529. * This routine clone a dsp session buffer from external buffer backstore.
  530. *
  531. * @param session Address of session.
  532. * @param buf external dsp session buf
  533. *
  534. * @return Address of new session buffer
  535. */
  536. struct dsp_session_buf *dsp_session_buf_clone(struct dsp_session *session, struct dsp_session_buf *buf);
  537. /**
  538. * @brief Destroy a dsp session buffer
  539. *
  540. * This routine dstroy a dsp session buffer, which has external buffer backstore.
  541. *
  542. * @param session Address of session.
  543. *
  544. * @return Address of session buffer
  545. */
  546. void dsp_session_buf_destroy(struct dsp_session_buf *buf);
  547. /* dsp session buffer ops */
  548. /**
  549. * @brief Allocate a dsp session buffer.
  550. *
  551. * This routine allocate a dsp session buffer.
  552. *
  553. * @param session Address of session.
  554. * @param size Size of session buffer, must be mutiple of 2.
  555. *
  556. * @return Address of session buffer
  557. */
  558. struct dsp_session_buf *dsp_session_buf_alloc(struct dsp_session *session, unsigned int size);
  559. /**
  560. * @brief Free a dsp session buffer.
  561. *
  562. * This routine free a dsp session buffer.
  563. *
  564. * @param buf Address of session buffer.
  565. *
  566. * @return N/A
  567. */
  568. void dsp_session_buf_free(struct dsp_session_buf *buf);
  569. /**
  570. * @brief Reset a dsp session buffer.
  571. *
  572. * This routine reset a dsp session buffer.
  573. *
  574. * @param buf Address of session buffer.
  575. *
  576. * @return N/A.
  577. */
  578. void dsp_session_buf_reset(struct dsp_session_buf *buf);
  579. /**
  580. * @brief Read a dsp session buffer.
  581. *
  582. * This routine read a dsp session buffer.
  583. *
  584. * @param buf Address of session buffer.
  585. * @param data Address of data buffer.
  586. * @param size Size of data.
  587. *
  588. * @return number of bytes successfully read.
  589. */
  590. int dsp_session_buf_read(struct dsp_session_buf *buf, void *data, unsigned int size);
  591. /**
  592. * @brief Write a dsp session buffer.
  593. *
  594. * This routine write a dsp session buffer.
  595. *
  596. * @param buf Address of session buffer.
  597. * @param data Address of data buffer.
  598. * @param size Size of data..
  599. *
  600. * @return number of bytes successfully written.
  601. */
  602. int dsp_session_buf_write(struct dsp_session_buf *buf, const void *data, unsigned int size);
  603. /**
  604. * @brief Read a dsp session buffer to stream.
  605. *
  606. * This routine read a dsp session buffer.
  607. *
  608. * @param buf Address of session buffer.
  609. * @param stream Handle of stream.
  610. * @param size Size of data.
  611. * @param stream_write Stream write ops.
  612. *
  613. * @return number of bytes successfully read.
  614. */
  615. int dsp_session_buf_read_to_stream(struct dsp_session_buf *buf,
  616. void *stream, unsigned int size,
  617. dsp_session_buf_write_fn stream_write);
  618. /**
  619. * @brief Write a dsp session buffer from stream.
  620. *
  621. * This routine read a dsp session buffer.
  622. *
  623. * @param buf Address of session buffer.
  624. * @param stream Handle of stream.
  625. * @param size Size of data.
  626. * @param stream_write Stream read ops.
  627. *
  628. * @return number of bytes successfully written.
  629. */
  630. int dsp_session_buf_write_from_stream(struct dsp_session_buf *buf,
  631. void *stream, unsigned int size,
  632. dsp_session_buf_read_fn stream_read);
  633. /**
  634. * @brief Determine size of a dsp session buffer.
  635. *
  636. * @param buf Address of session buffer.
  637. *
  638. * @return Session buffer size.
  639. */
  640. unsigned int dsp_session_buf_size(struct dsp_session_buf *buf);
  641. /**
  642. * @brief Determine free space a dsp session buffer.
  643. *
  644. * @param buf Address of session buffer.
  645. *
  646. * @return Session buffer free space.
  647. */
  648. unsigned int dsp_session_buf_space(struct dsp_session_buf *buf);
  649. /**
  650. * @brief Determine length of a dsp session buffer.
  651. *
  652. * @param buf Address of session buffer.
  653. *
  654. * @return Session buffer data length.
  655. */
  656. unsigned int dsp_session_buf_length(struct dsp_session_buf *buf);
  657. /**
  658. * @brief Drop all data of a dsp session buffer
  659. *
  660. * @param buf Address of ring buffer.
  661. *
  662. * @return number of elements dropped in elements.
  663. */
  664. size_t dsp_session_buf_drop_all(struct dsp_session_buf *buf);
  665. int dsp_session_buf_read_to_buffer(struct dsp_session_buf *buf, void *buffer, unsigned int size);
  666. int dsp_session_buf_write_from_buffer(struct dsp_session_buf *buf, void *buffer, unsigned int size);
  667. #ifdef __cplusplus
  668. }
  669. #endif
  670. #endif /* __DSP_HAL_H__ */