From eba0cfa6b0bef4f2e73c8630a7efa3944df8b0f8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 04:56:35 +0200 Subject: Adding upstream version 1:2.0.27. Signed-off-by: Daniel Baumann --- kexec/phys_to_virt.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 kexec/phys_to_virt.c (limited to 'kexec/phys_to_virt.c') diff --git a/kexec/phys_to_virt.c b/kexec/phys_to_virt.c new file mode 100644 index 0000000..5e8c4e3 --- /dev/null +++ b/kexec/phys_to_virt.c @@ -0,0 +1,16 @@ +#include "kexec.h" +#include "crashdump.h" + +/** + * phys_to_virt() - translate physical address to virtual address + * @paddr: physical address to translate + * + * For most architectures physical address is simply virtual address minus + * PAGE_OFFSET. Architectures that don't follow this convention should provide + * their own implementation. + */ +unsigned long +phys_to_virt(struct crash_elf_info *elf_info, unsigned long long paddr) +{ + return paddr + elf_info->page_offset; +} -- cgit v1.2.3