memblock.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * linux/arch/unicore32/include/asm/memblock.h
  3. *
  4. * Code specific to PKUnity SoC and UniCore ISA
  5. *
  6. * Copyright (C) 2001-2010 GUAN Xue-tao
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #ifndef __UNICORE_MEMBLOCK_H__
  13. #define __UNICORE_MEMBLOCK_H__
  14. /*
  15. * Memory map description
  16. */
  17. # define NR_BANKS 8
  18. struct membank {
  19. unsigned long start;
  20. unsigned long size;
  21. unsigned int highmem;
  22. };
  23. struct meminfo {
  24. int nr_banks;
  25. struct membank bank[NR_BANKS];
  26. };
  27. extern struct meminfo meminfo;
  28. #define for_each_bank(iter, mi) \
  29. for (iter = 0; iter < (mi)->nr_banks; iter++)
  30. #define bank_pfn_start(bank) __phys_to_pfn((bank)->start)
  31. #define bank_pfn_end(bank) __phys_to_pfn((bank)->start + (bank)->size)
  32. #define bank_pfn_size(bank) ((bank)->size >> PAGE_SHIFT)
  33. #define bank_phys_start(bank) ((bank)->start)
  34. #define bank_phys_end(bank) ((bank)->start + (bank)->size)
  35. #define bank_phys_size(bank) ((bank)->size)
  36. extern void uc32_memblock_init(struct meminfo *);
  37. #endif