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

VxWorks

开发平台:

C/C++

  1. /* sun.h - miscellaneous SUN constants */
  2. /* Copyright 1984-1992 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. ------------------
  6. 02b,22sep92,rrr  added support for c++
  7. 02a,04jul92,jcf  cleaned up.
  8. 01d,26may92,rrr  the tree shuffle
  9. 01c,04oct91,rrr  passed through the ansification filter
  10.   -changed copyright notice
  11. 01b,05oct90,shl  added copyright notice.
  12.                  made #endif ANSI style.
  13. 01a,28apr89,gae  created.
  14. */
  15. #ifndef __INCsunh
  16. #define __INCsunh
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. #define NBPG 0x2000
  21. #define SYSBASE         0x0F000000
  22. #define MMU_PAGESIZE    0x2000          /* 8192 bytes */
  23. #define MMU_PAGESHIFT   13              /* log2(MMU_PAGESIZE) */
  24. #define MMU_PAGEOFFSET  (MMU_PAGESIZE-1)/* Mask of address bits in page */
  25. #define MMU_PAGEMASK    (~MMU_PAGEOFFSET)
  26. #define PAGESIZE        0x2000          /* All of the above, for logical */
  27. #define PAGESHIFT       13
  28. #define PAGEOFFSET      (PAGESIZE - 1)
  29. #define PAGEMASK        (~PAGEOFFSET)
  30. #define ptob(x)         ((x) << PAGESHIFT)
  31. #define btop(x)         (((unsigned)(x)) >> PAGESHIFT)
  32. #define btopr(x)        ((((unsigned)(x) + PAGEOFFSET) >> PAGESHIFT))
  33. /* memory space types */
  34. #define SUN_MEM         0x0                     /* Main Memory/ video memory */
  35. #define SUN_IO          0x1                     /* SUN I/O space */
  36. #define SUN_VME16       0x2                     /* VME 16 bit data space */
  37. #define SUN_VME32       0x3                     /* VME 32 bit data space */
  38. #ifdef __cplusplus
  39. }
  40. #endif
  41. #endif /* __INCsunh */