usrWdbTaskDsp.c
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:2k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* usrWdbTaskDsp.c - optional DSP support for the task WDB agent */
  2. /* Copyright 1998-2000 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01a,16nov00,zl  written based on usrWdbTaskFpp.c
  7. */
  8. /*
  9. DESCRIPTION
  10. This library configures the task mode WDB agent's DSP support.
  11. */
  12. /* externals */
  13. extern FUNCPTR wdbTaskDspRegsSet;
  14. extern FUNCPTR wdbTaskDspRegsGet;
  15. extern BOOL     wdbTgtHasDsp (void);
  16. /* forward static declarations */
  17. static STATUS _wdbTaskDspRegsSet (WDB_CTX * pContext, char * pRegSet);
  18. static STATUS _wdbTaskDspRegsGet (WDB_CTX * pContext, char ** ppRegSet);
  19. /******************************************************************************
  20. *
  21. * _wdbTaskDspRegsSet - set a tasks DSP regs
  22. */
  23. static STATUS _wdbTaskDspRegsSet
  24.     (
  25.     WDB_CTX *    pContext,
  26.     char *       pRegSet
  27.     )
  28.     {
  29.     WIND_TCB * pTcb = taskTcb (pContext->contextId);
  30.     if ((pTcb == NULL) || (pTcb->pDspContext == NULL))
  31.         return (ERROR);
  32.     bcopy (pRegSet, (char *)(pTcb->pDspContext), sizeof (DSP_CONTEXT));
  33.     return (OK);
  34.     }
  35. /******************************************************************************
  36. *
  37. * _wdbTaskDspRegsGet - Get a tasks DSP regs
  38. */
  39. static STATUS _wdbTaskDspRegsGet
  40.     (
  41.     WDB_CTX *           pContext,
  42.     char **             ppRegSet
  43.     )
  44.     {
  45.     WIND_TCB * pTcb = taskTcb (pContext->contextId);
  46.     if ((pTcb == NULL) || (pTcb->pDspContext == NULL))
  47.         return (ERROR);
  48.     *ppRegSet = (char *) pTcb->pDspContext;
  49.     return (OK);
  50.     }
  51. /******************************************************************************
  52. *
  53. * wdbTaskDspInit - initialize DSP support
  54. *
  55. * This routine initializes DSP support for the task mode agent.
  56. *
  57. * NOMANUAL
  58. */
  59. void wdbTaskDspInit (void)
  60.     {
  61.     /* install task mode DSP get/set routines */
  62.     if (wdbTgtHasDsp())
  63. {
  64. wdbTaskDspRegsSet = _wdbTaskDspRegsSet;
  65. wdbTaskDspRegsGet = _wdbTaskDspRegsGet;
  66. }
  67.     }