sdp_hdr.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. *
  3. Copyright (c) Eicon Networks, 2002.
  4. *
  5. This source file is supplied for the use with
  6. Eicon Networks range of DIVA Server Adapters.
  7. *
  8. Eicon File Revision : 2.1
  9. *
  10. This program is free software; you can redistribute it and/or modify
  11. it under the terms of the GNU General Public License as published by
  12. the Free Software Foundation; either version 2, or (at your option)
  13. any later version.
  14. *
  15. This program is distributed in the hope that it will be useful,
  16. but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
  17. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  18. See the GNU General Public License for more details.
  19. *
  20. You should have received a copy of the GNU General Public License
  21. along with this program; if not, write to the Free Software
  22. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  23. *
  24. */
  25. #ifndef __DIVA_SOFT_DSP_TASK_ENTRY_H__
  26. #define __DIVA_SOFT_DSP_TASK_ENTRY_H__
  27. /*
  28. The soft DSP image is described by binary header contained on begin of this
  29. image:
  30. OFFSET FROM IMAGE START | VARIABLE
  31. ------------------------------------------------------------------------
  32. DIVA_MIPS_TASK_IMAGE_LINK_OFFS | link to the next image
  33. ----------------------------------------------------------------------
  34. DIVA_MIPS_TASK_IMAGE_GP_OFFS | image gp register value, void*
  35. ----------------------------------------------------------------------
  36. DIVA_MIPS_TASK_IMAGE_ENTRY_OFFS | diva_mips_sdp_task_entry_t*
  37. ----------------------------------------------------------------------
  38. DIVA_MIPS_TASK_IMAGE_LOAD_ADDR_OFFS | image image start address (void*)
  39. ----------------------------------------------------------------------
  40. DIVA_MIPS_TASK_IMAGE_END_ADDR_OFFS | image image end address (void*)
  41. ----------------------------------------------------------------------
  42. DIVA_MIPS_TASK_IMAGE_ID_STRING_OFFS | image id string char[...];
  43. ----------------------------------------------------------------------
  44. */
  45. #define DIVA_MIPS_TASK_IMAGE_LINK_OFFS 0x6C
  46. #define DIVA_MIPS_TASK_IMAGE_GP_OFFS 0x70
  47. #define DIVA_MIPS_TASK_IMAGE_ENTRY_OFFS 0x74
  48. #define DIVA_MIPS_TASK_IMAGE_LOAD_ADDR_OFFS 0x78
  49. #define DIVA_MIPS_TASK_IMAGE_END_ADDR_OFFS 0x7c
  50. #define DIVA_MIPS_TASK_IMAGE_ID_STRING_OFFS 0x80
  51. /*
  52. This function is called in order to set GP register of this task
  53. This function should be always called before any function of the
  54. task is called
  55. */
  56. typedef void (*diva_task_set_prog_gp_proc_t)(void *new_gp);
  57. /*
  58. This function is called to clear .bss at task initialization step
  59. */
  60. typedef void (*diva_task_sys_reset_proc_t)(void);
  61. /*
  62. This function is called in order to provide GP of master call to
  63. task, that will be used by calls from the task to the master
  64. */
  65. typedef void (*diva_task_set_main_gp_proc_t)(void *main_gp);
  66. /*
  67. This function is called to provide address of 'dprintf' function
  68. to the task
  69. */
  70. typedef word (*diva_prt_proc_t)(char *, ...);
  71. typedef void (*diva_task_set_prt_proc_t)(diva_prt_proc_t fn);
  72. /*
  73. This function is called to set task PID
  74. */
  75. typedef void (*diva_task_set_pid_proc_t)(dword id);
  76. /*
  77. This function is called for run-time task init
  78. */
  79. typedef int (*diva_task_run_time_init_proc_t)(void*, dword);
  80. /*
  81. This function is called from system scheduler or from timer
  82. */
  83. typedef void (*diva_task_callback_proc_t)(void);
  84. /*
  85. This callback is used by task to get current time im mS
  86. */
  87. typedef dword (*diva_task_get_tick_count_proc_t)(void);
  88. typedef void (*diva_task_set_get_time_proc_t)(\
  89. diva_task_get_tick_count_proc_t fn);
  90. typedef struct _diva_mips_sdp_task_entry {
  91. diva_task_set_prog_gp_proc_t set_gp_proc;
  92. diva_task_sys_reset_proc_t sys_reset_proc;
  93. diva_task_set_main_gp_proc_t set_main_gp_proc;
  94. diva_task_set_prt_proc_t set_dprintf_proc;
  95. diva_task_set_pid_proc_t set_pid_proc;
  96. diva_task_run_time_init_proc_t run_time_init_proc;
  97. diva_task_callback_proc_t task_callback_proc;
  98. diva_task_callback_proc_t timer_callback_proc;
  99. diva_task_set_get_time_proc_t set_get_time_proc;
  100. void *last_entry_proc;
  101. } diva_mips_sdp_task_entry_t;
  102. /*
  103. 'last_entry_proc' should be set to zero and is used for future extensuios
  104. */
  105. typedef struct _diva_mips_sw_task {
  106. diva_mips_sdp_task_entry_t sdp_entry;
  107. void *sdp_gp_reg;
  108. void *own_gp_reg;
  109. } diva_mips_sw_task_t;
  110. #if !defined(DIVA_BRI2F_SDP_1_NAME)
  111. #define DIVA_BRI2F_SDP_1_NAME "sdp0.2q0"
  112. #endif
  113. #if !defined(DIVA_BRI2F_SDP_2_NAME)
  114. #define DIVA_BRI2F_SDP_2_NAME "sdp1.2q0"
  115. #endif
  116. #endif