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

VxWorks

开发平台:

C/C++

  1. /* usrWdbTaskFpp.c - optional floating point support for the task WDB agent */
  2. /* Copyright 1998 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01a,22may98,dbt  taken from 01a of usrWdbFpp.c
  7. */
  8. /*
  9. DESCRIPTION
  10. This library configures the task mode WDB agent's hardware floating point
  11. support.
  12. */
  13. /* externals */
  14. extern FUNCPTR wdbTaskFpRegsSet;
  15. extern FUNCPTR wdbTaskFpRegsGet;
  16. extern BOOL     wdbTgtHasFpp (void);
  17. /* forward static declarations */
  18. static STATUS _wdbTaskFpRegsSet (WDB_CTX * pContext, char * pRegSet);
  19. static STATUS _wdbTaskFpRegsGet (WDB_CTX * pContext, char ** ppRegSet);
  20. /******************************************************************************
  21. *
  22. * _wdbTaskFpRegsSet - set a tasks fpp regs
  23. */
  24. static STATUS _wdbTaskFpRegsSet
  25.     (
  26.     WDB_CTX *    pContext,
  27.     char *       pRegSet
  28.     )
  29.     {
  30.     WIND_TCB * pTcb = taskTcb (pContext->contextId);
  31.     if ((pTcb == NULL) || (pTcb->pFpContext == NULL))
  32.         return (ERROR);
  33.     bcopy (pRegSet, (char *)(pTcb->pFpContext), sizeof (FP_CONTEXT));
  34.     return (OK);
  35.     }
  36. /******************************************************************************
  37. *
  38. * _wdbTaskFpRegsGet - Get a tasks fpp regs
  39. */
  40. static STATUS _wdbTaskFpRegsGet
  41.     (
  42.     WDB_CTX *           pContext,
  43.     char **             ppRegSet
  44.     )
  45.     {
  46.     WIND_TCB * pTcb = taskTcb (pContext->contextId);
  47.     if ((pTcb == NULL) || (pTcb->pFpContext == NULL))
  48.         return (ERROR);
  49.     *ppRegSet = (char *) pTcb->pFpContext;
  50.     return (OK);
  51.     }
  52. /******************************************************************************
  53. *
  54. * wdbTaskFppInit - initialize hardware floating point support
  55. *
  56. * This routine initializes hardware floating point support for the task
  57. * mode agent.
  58. *
  59. * NOMANUAL
  60. */
  61. void wdbTaskFppInit (void)
  62.     {
  63.     /* install task mode fpp get/set routines */
  64.     if (wdbTgtHasFpp())
  65. {
  66. wdbTaskFpRegsSet = _wdbTaskFpRegsSet;
  67. wdbTaskFpRegsGet = _wdbTaskFpRegsGet;
  68. }
  69.     }