mmu.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * File : mmu.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006, RT-Thread Development Team
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. */
  21. #ifndef __MMU_H__
  22. #define __MMU_H__
  23. #include <rtthread.h>
  24. #define DESC_SEC (0x2)
  25. #define CB (3<<2) //cache_on, write_back
  26. #define CNB (2<<2) //cache_on, write_through
  27. #define NCB (1<<2) //cache_off,WR_BUF on
  28. #define NCNB (0<<2) //cache_off,WR_BUF off
  29. #define AP_RW (3<<10) //supervisor=RW, user=RW
  30. #define AP_RO (2<<10) //supervisor=RW, user=RO
  31. #define DOMAIN_FAULT (0x0)
  32. #define DOMAIN_CHK (0x1)
  33. #define DOMAIN_NOTCHK (0x3)
  34. #define DOMAIN0 (0x0<<5)
  35. #define DOMAIN1 (0x1<<5)
  36. #define DOMAIN0_ATTR (DOMAIN_CHK<<0)
  37. #define DOMAIN1_ATTR (DOMAIN_FAULT<<2)
  38. #define RW_CB (AP_RW|DOMAIN0|CB|DESC_SEC) /* Read/Write, cache, write back */
  39. #define RW_CNB (AP_RW|DOMAIN0|CNB|DESC_SEC) /* Read/Write, cache, write through */
  40. #define RW_NCNB (AP_RW|DOMAIN0|NCNB|DESC_SEC) /* Read/Write without cache and write buffer */
  41. #define RW_FAULT (AP_RW|DOMAIN1|NCNB|DESC_SEC) /* Read/Write without cache and write buffer */
  42. void rt_hw_mmu_init(void);
  43. #endif