xlat_tables_arch.h 782 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (c) 2017-2018, Arm Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef XLAT_TABLES_ARCH_H
  7. #define XLAT_TABLES_ARCH_H
  8. #ifdef __aarch64__
  9. #include "aarch64/xlat_tables_aarch64.h"
  10. #else
  11. #include "aarch32/xlat_tables_aarch32.h"
  12. #endif
  13. /*
  14. * Evaluates to 1 if the given physical address space size is a power of 2,
  15. * or 0 if it's not.
  16. */
  17. #define CHECK_PHY_ADDR_SPACE_SIZE(size) \
  18. (IS_POWER_OF_TWO(size))
  19. /*
  20. * Compute the number of entries required at the initial lookup level to address
  21. * the whole virtual address space.
  22. */
  23. #define GET_NUM_BASE_LEVEL_ENTRIES(addr_space_size) \
  24. ((addr_space_size) >> \
  25. XLAT_ADDR_SHIFT(GET_XLAT_TABLE_LEVEL_BASE(addr_space_size)))
  26. #endif /* XLAT_TABLES_ARCH_H */