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

VxWorks

开发平台:

C/C++

  1. /*
  2. **  File:  dptarget.h     
  3. **  Description:
  4. ** This file contains 'C' language definitions to ease the use of
  5. ** the dualport RAM features of the NetROM.
  6. **
  7. **      Copyright (c) 1996 Applied Microsystems Corp.
  8. **                          All Rights Reserved
  9. **
  10. ** Redistribution and use in source and binary forms are permitted 
  11. ** provided that the above copyright notice and this paragraph are 
  12. ** duplicated in all such forms and that any documentation,
  13. ** advertising materials, and other materials related to such
  14. ** distribution and use acknowledge that the software was developed 
  15. ** by Applied Microsystems Corp. (the Company).  The name of the 
  16. ** Company may not be used to endorse or promote products derived
  17. ** from this software without specific prior written permission. 
  18. ** THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 
  19. ** IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  20. ** WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 
  21. **
  22. **  Modification History:
  23. **  8-21-95 sch Change READ_ and WRITE_POD so they don't do
  24. **                   multiplies.  Speeds things up a bit and some
  25. **                   29Ks don't have a multiply instruction.
  26. **
  27. */
  28. #ifndef _dptarget_h
  29. #define _dptarget_h
  30. /* target-native data storage */
  31. typedef unsigned long   uInt32; /* 32 bits unsigned */
  32. typedef unsigned short  uInt16; /* 16 bits unsigned */
  33. typedef short           Int16; /* 16 bits signed */
  34. typedef unsigned char   uChar; /* 8 bits unsigned */
  35. /* prevents private stuff from appearing in the link map */
  36. #define STATIC static
  37. /* macro to allow other processes to run in a multitasking system */
  38. #ifdef vxworks
  39. #include "taskLib.h"
  40. #define YIELD_CPU() taskDelay(1) /* closest thing in VxWorks */
  41. #else
  42. #define YIELD_CPU()
  43. #endif
  44. /* Size (in bytes) of the ram-based routine used by read-only target
  45.  * systems to communicate with NetROM while NetROM sets emulation
  46.  * memory.  See the routine ra_setmem_sendval().  */
  47. #define RA_SETMEM_RTN_SIZE 512
  48. /* dualport access macros */
  49. #define READ_POD(cp, addr) 
  50.   (* ((volatile uChar *) ((cp)->dpbase + ((cp)->width * (addr)) + (cp)->index)))
  51. #define WRITE_POD(cp, addr, val) 
  52.   (* ((volatile uChar *) ((cp)->dpbase + ((cp)->width * (addr)) + (cp)->index))) = (val)
  53. /* include target-independent stuff */
  54. #include "wdb/dualport.h"
  55. #endif /* _dptarget_h */