mali_kbase_mmu_mode.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. *
  3. * (C) COPYRIGHT 2014-2015 ARM Limited. All rights reserved.
  4. *
  5. * This program is free software and is provided to you under the terms of the
  6. * GNU General Public License version 2 as published by the Free Software
  7. * Foundation, and any use by you of this program is subject to the terms
  8. * of such GNU licence.
  9. *
  10. * A copy of the licence is included with the program, and can also be obtained
  11. * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  12. * Boston, MA 02110-1301, USA.
  13. *
  14. */
  15. #ifndef _MALI_KBASE_MMU_MODE_
  16. #define _MALI_KBASE_MMU_MODE_
  17. #include <linux/types.h>
  18. /* Forward declarations */
  19. struct kbase_context;
  20. struct kbase_device;
  21. struct kbase_as;
  22. struct kbase_mmu_setup;
  23. struct kbase_mmu_mode {
  24. void (*update)(struct kbase_context *kctx);
  25. void (*get_as_setup)(struct kbase_context *kctx,
  26. struct kbase_mmu_setup * const setup);
  27. void (*disable_as)(struct kbase_device *kbdev, int as_nr);
  28. phys_addr_t (*pte_to_phy_addr)(u64 entry);
  29. int (*ate_is_valid)(u64 ate);
  30. int (*pte_is_valid)(u64 pte);
  31. void (*entry_set_ate)(u64 *entry, phys_addr_t phy, unsigned long flags);
  32. void (*entry_set_pte)(u64 *entry, phys_addr_t phy);
  33. void (*entry_invalidate)(u64 *entry);
  34. };
  35. struct kbase_mmu_mode const *kbase_mmu_mode_get_lpae(void);
  36. struct kbase_mmu_mode const *kbase_mmu_mode_get_aarch64(void);
  37. #endif // ifndef _MALI_KBASE_MMU_MODE_