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

VxWorks

开发平台:

C/C++

  1. /* visionTmdAsmXscale.c - Wind River visionTMD Interupt routines */
  2. /* Copyright 1988-2002 Wind River Systems Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01d,26apr01,g_h  Fix syntax error from LONG to ULONG
  7. 01c,21dec01,g_h  Rename to visionTmdAsmXscale.c
  8. 01b,30nov01,g_h  Cleaning for T2.2
  9. 01a,19nov01,g_h  Adapted from visionTMDAsmPPC.c ver 01e
  10. */
  11. /*
  12. DESCRIPTION
  13. These low-level IO interface routines which signal the emulation
  14. product that we desire to initialize/initiate/complete IO.
  15. */
  16. #include "vxWorks.h"
  17. #include "drv/wdb/vision/visionTmdDrv.h"
  18. /* externals */
  19. IMPORT unsigned long txDesc; /* Duplicate location of the XMIT space */
  20. IMPORT unsigned long rxDesc; /* Duplicate location of the RECV space */
  21. /* forward declarations */
  22. LOCAL void tmdXSCALESignalSubDescReady (ULONG lrxDesc, ULONG ltxDesc);
  23. #if (CPU == XSCALE)
  24. /***************************************************************************
  25. *
  26. * tmdXSCALESignalDescReady - inform emulator the location of Rx/Tx 
  27. *                            descriptors
  28. *
  29. * This routine inform emulator the location of Rx/Tx descriptors.
  30. *
  31. * RETURNS: N/A
  32. */
  33. void tmdXSCALESignalDescReady
  34.     (
  35.     void
  36.     )
  37.     {
  38.     tmdXSCALESignalSubDescReady (rxDesc, txDesc);
  39.     }
  40. #endif /* (CPU == XSCALE) */
  41. #if (CPU == XSCALE)
  42. /***************************************************************************
  43. *
  44. * tmdXSCALEignalTxReady - inform emulator the location of Rx/Tx 
  45. *                         descriptors.
  46. *
  47. * This routine inform emulator the location of Rx/Tx descriptors.
  48. *
  49. * RETURNS: N/A
  50. */         
  51. void tmdXSCALESignalTxReady
  52.     (
  53.     void
  54.     )
  55.     {
  56.     _WRS_ASM("txBdmBgnd:                     ");
  57.     _WRS_ASM("      .long 0xE1200070         ");
  58.     }
  59. #endif /* (CPU == XSCALE) */
  60. #if (CPU == XSCALE)
  61. /***************************************************************************
  62. *
  63. * tmdXSCALESignalRxReady - inform emulator the location of Rx/Tx 
  64. *                          descriptors.
  65. *
  66. * This routine inform emulator the location of Rx/Tx descriptors.
  67. *
  68. * RETURNS: N/A
  69. */                                                                              
  70. void tmdXSCALESignalRxReady
  71.     (
  72.     void
  73.     )                                                
  74.     {
  75.     return;
  76.     }
  77. #endif /* (CPU == XSCALE) */
  78. #if (CPU == XSCALE)
  79. /***************************************************************************
  80. *
  81. * tmdXSCALESignalSubDescReady - inform emulator the location of Rx/Tx 
  82. *                                 descriptors.
  83. *
  84. * This routine inform emulator the location of Rx/Tx descriptors.
  85. *
  86. * RETURNS: N/A
  87. */                                                                              
  88. LOCAL void tmdXSCALESignalSubDescReady
  89.     (
  90.     ULONG lrxDesc, 
  91.     ULONG ltxDesc
  92.     )
  93.     {
  94.     /* Setup rxDesc Ptr into R2 */
  95.     _WRS_ASM("     MOV   r2,r0              ");
  96.     /* Setup txDesc Ptr into R1 */
  97.     _WRS_ASM("     MOV   r1,r1              ");
  98.     /* Set R0 to init command (0x5c5c5c5c) */
  99.     _WRS_ASM("      MOV   r0,#0x5c           ");
  100.     _WRS_ASM("      ADD   r0,r0,r0,lsl #0x8  ");
  101.     _WRS_ASM("      ADD   r0,r0,r0,lsl #0x10 ");
  102.     /* Setup R3 to point to Tx function */
  103.     _WRS_ASM("      LDR   r3,=txBdmBgnd;     ");
  104.     /* Notify emulator via software breakpoint */
  105.     _WRS_ASM("      .long 0xE1200070         "); 
  106.     _WRS_ASM("      MOV   pc, lr             ");
  107.     _WRS_ASM("      .ltorg                   ");
  108.     }
  109. #endif /* (CPU == XSCALE) */