summaryrefslogtreecommitdiff
path: root/tools/testing/memblock
diff options
context:
space:
mode:
authorKefeng Wang <wangkefeng.wang@huawei.com>2022-09-07 11:26:43 +0300
committerAndrew Morton <akpm@linux-foundation.org>2022-10-04 00:03:04 +0300
commitfc5dfebc8055426299739dd1a7828af9638c94fb (patch)
treee7f862d88ce868ce7a7c7206c1d1e17169b57dba /tools/testing/memblock
parentee0913c4719610204315a0d8a35122c6233249e0 (diff)
downloadlinux-fc5dfebc8055426299739dd1a7828af9638c94fb.tar.xz
memblock tests: add new pageblock related macro
Add new pageblock_start_pfn() and pageblock_align() macro which are needed by memblock tests. Link: https://lkml.kernel.org/r/20220907082643.186979-1-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Cc: David Hildenbrand <david@redhat.com> Cc: Mike Rapoport <rppt@linux.ibm.com> Cc: Oscar Salvador <osalvador@suse.de> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'tools/testing/memblock')
-rw-r--r--tools/testing/memblock/linux/mmzone.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/memblock/linux/mmzone.h b/tools/testing/memblock/linux/mmzone.h
index 7c2eb5c9bb54..e65f89b12f1c 100644
--- a/tools/testing/memblock/linux/mmzone.h
+++ b/tools/testing/memblock/linux/mmzone.h
@@ -22,6 +22,8 @@ enum zone_type {
#define pageblock_order (MAX_ORDER - 1)
#define pageblock_nr_pages BIT(pageblock_order)
+#define pageblock_align(pfn) ALIGN((pfn), pageblock_nr_pages)
+#define pageblock_start_pfn(pfn) ALIGN_DOWN((pfn), pageblock_nr_pages)
struct zone {
atomic_long_t managed_pages;