/arch/unicore32/include/asm/memblock.h

http://github.com/mirrors/linux · C Header · 43 lines · 23 code · 9 blank · 11 comment · 1 complexity · 2eb5a0704312d6b6b1e8e3dd19de9bcf MD5 · raw file

  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * linux/arch/unicore32/include/asm/memblock.h
  4. *
  5. * Code specific to PKUnity SoC and UniCore ISA
  6. *
  7. * Copyright (C) 2001-2010 GUAN Xue-tao
  8. */
  9. #ifndef __UNICORE_MEMBLOCK_H__
  10. #define __UNICORE_MEMBLOCK_H__
  11. /*
  12. * Memory map description
  13. */
  14. # define NR_BANKS 8
  15. struct membank {
  16. unsigned long start;
  17. unsigned long size;
  18. unsigned int highmem;
  19. };
  20. struct meminfo {
  21. int nr_banks;
  22. struct membank bank[NR_BANKS];
  23. };
  24. extern struct meminfo meminfo;
  25. #define for_each_bank(iter, mi) \
  26. for (iter = 0; iter < (mi)->nr_banks; iter++)
  27. #define bank_pfn_start(bank) __phys_to_pfn((bank)->start)
  28. #define bank_pfn_end(bank) __phys_to_pfn((bank)->start + (bank)->size)
  29. #define bank_pfn_size(bank) ((bank)->size >> PAGE_SHIFT)
  30. #define bank_phys_start(bank) ((bank)->start)
  31. #define bank_phys_end(bank) ((bank)->start + (bank)->size)
  32. #define bank_phys_size(bank) ((bank)->size)
  33. extern void uc32_memblock_init(struct meminfo *);
  34. #endif