addrspace.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * This file is subject to the terms and conditions of the GNU General Public
  3.  * License.  See the file "COPYING" in the main directory of this archive
  4.  * for more details.
  5.  *
  6.  * Copyright (C) 1999 by Kaz Kojima
  7.  *
  8.  * Defitions for the address spaces of the SH CPUs.
  9.  */
  10. #ifndef __ASM_SH_ADDRSPACE_H
  11. #define __ASM_SH_ADDRSPACE_H
  12. /* Memory segments (32bit Priviledged mode addresses)  */
  13. #define P0SEG 0x00000000
  14. #define P1SEG 0x80000000
  15. #define P2SEG 0xa0000000
  16. #define P3SEG 0xc0000000
  17. #define P4SEG 0xe0000000
  18. #if defined(__sh3__)
  19. /* Should fill here */
  20. #elif defined(__SH4__)
  21. /* Detailed P4SEG  */
  22. #define P4SEG_STORE_QUE (P4SEG)
  23. #define P4SEG_IC_ADDR 0xf0000000
  24. #define P4SEG_IC_DATA 0xf1000000
  25. #define P4SEG_ITLB_ADDR 0xf2000000
  26. #define P4SEG_ITLB_DATA 0xf3000000
  27. #define P4SEG_OC_ADDR 0xf4000000
  28. #define P4SEG_OC_DATA 0xf5000000
  29. #define P4SEG_TLB_ADDR 0xf6000000
  30. #define P4SEG_TLB_DATA 0xf7000000
  31. #define P4SEG_REG_BASE 0xff000000
  32. #endif
  33. /* Returns the privileged segment base of a given address  */
  34. #define PXSEG(a) (((unsigned long)(a)) & 0xe0000000)
  35. /* Returns the physical address of a PnSEG (n=1,2) address   */
  36. #define PHYSADDR(a) (((unsigned long)(a)) & 0x1fffffff)
  37. /*
  38.  * Map an address to a certain privileged segment
  39.  */
  40. #define P1SEGADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P1SEG))
  41. #define P2SEGADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P2SEG))
  42. #define P3SEGADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P3SEG))
  43. #define P4SEGADDR(a) ((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P4SEG))
  44. #endif /* __ASM_SH_ADDRSPACE_H */