mtkpasr_drv.h 843 B

12345678910111213141516171819202122232425
  1. #ifndef _MTKPASR_DRV_H_
  2. #define _MTKPASR_DRV_H_
  3. #define IN_RANGE(s, e, rs, re) (s >= rs && e <= re)
  4. /*-- Data structures */
  5. /* Bank information (1 PASR unit) */
  6. struct mtkpasr_bank {
  7. unsigned long start_pfn; /* The 1st pfn */
  8. unsigned long end_pfn; /* The pfn after the last valid one */
  9. unsigned long free; /* The number of free pages */
  10. int segment; /* Corresponding to which segment */
  11. int rank; /* Associated rank */
  12. };
  13. /* MTKPASR internal functions */
  14. extern int __init mtkpasr_init_range(unsigned long start_pfn, unsigned long end_pfn);
  15. /* Give bank, this function will return its (start_pfn, end_pfn) and corresponding rank */
  16. extern int __init query_bank_rank_information(int bank, unsigned long *spfn, unsigned long *epfn, int *segn);
  17. /* The number of pages in one PASR bank */
  18. extern unsigned long bank_pfns;
  19. #endif