physaddr.c (7ae9fb1b7ecbb5d85d07857943f677fd1a559b18) physaddr.c (3335068f87217ea59d08f462187dc856652eea15)
1// SPDX-License-Identifier: GPL-2.0
2
3#include <linux/types.h>
4#include <linux/mmdebug.h>
5#include <linux/mm.h>
6#include <asm/page.h>
7#include <asm/sections.h>
8

--- 19 unchanged lines hidden (view full) ---

28 * Boundary checking aginst the kernel image mapping.
29 * __pa_symbol should only be used on kernel symbol addresses.
30 */
31 VIRTUAL_BUG_ON(x < kernel_start || x > kernel_end);
32
33 return __va_to_pa_nodebug(x);
34}
35EXPORT_SYMBOL(__phys_addr_symbol);
1// SPDX-License-Identifier: GPL-2.0
2
3#include <linux/types.h>
4#include <linux/mmdebug.h>
5#include <linux/mm.h>
6#include <asm/page.h>
7#include <asm/sections.h>
8

--- 19 unchanged lines hidden (view full) ---

28 * Boundary checking aginst the kernel image mapping.
29 * __pa_symbol should only be used on kernel symbol addresses.
30 */
31 VIRTUAL_BUG_ON(x < kernel_start || x > kernel_end);
32
33 return __va_to_pa_nodebug(x);
34}
35EXPORT_SYMBOL(__phys_addr_symbol);
36
37phys_addr_t linear_mapping_va_to_pa(unsigned long x)
38{
39 BUG_ON(!kernel_map.va_pa_offset);
40
41 return ((unsigned long)(x) - kernel_map.va_pa_offset);
42}
43EXPORT_SYMBOL(linear_mapping_va_to_pa);
44
45void *linear_mapping_pa_to_va(unsigned long x)
46{
47 BUG_ON(!kernel_map.va_pa_offset);
48
49 return ((void *)((unsigned long)(x) + kernel_map.va_pa_offset));
50}
51EXPORT_SYMBOL(linear_mapping_pa_to_va);