summaryrefslogtreecommitdiffstats
path: root/arch/arm64/include/asm/trans_pgd.h
diff options
context:
space:
mode:
authorPavel Tatashin <pasha.tatashin@soleen.com>2021-01-25 20:19:09 +0100
committerWill Deacon <will@kernel.org>2021-01-27 16:41:12 +0100
commit50f53fb721817a6efa541cca24f1b7caa84801c1 (patch)
tree6a4b44e8dc0471a45c7aeaf1216ce2b9cccf404c /arch/arm64/include/asm/trans_pgd.h
parentarm64: hibernate: move page handling function to new trans_pgd.c (diff)
downloadlinux-50f53fb721817a6efa541cca24f1b7caa84801c1.tar.xz
linux-50f53fb721817a6efa541cca24f1b7caa84801c1.zip
arm64: trans_pgd: make trans_pgd_map_page generic
kexec is going to use a different allocator, so make trans_pgd_map_page to accept allocator as an argument, and also kexec is going to use a different map protection, so also pass it via argument. Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com> Reviewed-by: Matthias Brugger <mbrugger@suse.com> Link: https://lore.kernel.org/r/20210125191923.1060122-5-pasha.tatashin@soleen.com Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/include/asm/trans_pgd.h')
-rw-r--r--arch/arm64/include/asm/trans_pgd.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/arch/arm64/include/asm/trans_pgd.h b/arch/arm64/include/asm/trans_pgd.h
index 23153c13d1ce..b46409b25234 100644
--- a/arch/arm64/include/asm/trans_pgd.h
+++ b/arch/arm64/include/asm/trans_pgd.h
@@ -12,10 +12,25 @@
#include <linux/types.h>
#include <asm/pgtable-types.h>
+/*
+ * trans_alloc_page
+ * - Allocator that should return exactly one zeroed page, if this
+ * allocator fails, trans_pgd_create_copy() and trans_pgd_map_page()
+ * return -ENOMEM error.
+ *
+ * trans_alloc_arg
+ * - Passed to trans_alloc_page as an argument
+ */
+
+struct trans_pgd_info {
+ void * (*trans_alloc_page)(void *arg);
+ void *trans_alloc_arg;
+};
+
int trans_pgd_create_copy(pgd_t **dst_pgdp, unsigned long start,
unsigned long end);
-int trans_pgd_map_page(pgd_t *trans_pgd, void *page, unsigned long dst_addr,
- pgprot_t pgprot);
+int trans_pgd_map_page(struct trans_pgd_info *info, pgd_t *trans_pgd,
+ void *page, unsigned long dst_addr, pgprot_t pgprot);
#endif /* _ASM_TRANS_TABLE_H */