diff options
Diffstat (limited to 'include/asm-ppc64/lmb.h')
-rw-r--r-- | include/asm-ppc64/lmb.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/asm-ppc64/lmb.h b/include/asm-ppc64/lmb.h index cb368bf0f264..de91e034bd98 100644 --- a/include/asm-ppc64/lmb.h +++ b/include/asm-ppc64/lmb.h | |||
@@ -56,4 +56,26 @@ extern void lmb_dump_all(void); | |||
56 | 56 | ||
57 | extern unsigned long io_hole_start; | 57 | extern unsigned long io_hole_start; |
58 | 58 | ||
59 | static inline unsigned long | ||
60 | lmb_size_bytes(struct lmb_region *type, unsigned long region_nr) | ||
61 | { | ||
62 | return type->region[region_nr].size; | ||
63 | } | ||
64 | static inline unsigned long | ||
65 | lmb_size_pages(struct lmb_region *type, unsigned long region_nr) | ||
66 | { | ||
67 | return lmb_size_bytes(type, region_nr) >> PAGE_SHIFT; | ||
68 | } | ||
69 | static inline unsigned long | ||
70 | lmb_start_pfn(struct lmb_region *type, unsigned long region_nr) | ||
71 | { | ||
72 | return type->region[region_nr].base >> PAGE_SHIFT; | ||
73 | } | ||
74 | static inline unsigned long | ||
75 | lmb_end_pfn(struct lmb_region *type, unsigned long region_nr) | ||
76 | { | ||
77 | return lmb_start_pfn(type, region_nr) + | ||
78 | lmb_size_pages(type, region_nr); | ||
79 | } | ||
80 | |||
59 | #endif /* _PPC64_LMB_H */ | 81 | #endif /* _PPC64_LMB_H */ |