Lines Matching +full:x +full:- +full:y
1 // SPDX-License-Identifier: GPL-2.0
15 unsigned long __phys_addr(unsigned long x) in __phys_addr() argument
17 unsigned long y = x - __START_KERNEL_map; in __phys_addr() local
19 /* use the carry flag to determine if x was < __START_KERNEL_map */ in __phys_addr()
20 if (unlikely(x > y)) { in __phys_addr()
21 x = y + phys_base; in __phys_addr()
23 VIRTUAL_BUG_ON(y >= KERNEL_IMAGE_SIZE); in __phys_addr()
25 x = y + (__START_KERNEL_map - PAGE_OFFSET); in __phys_addr()
27 /* carry flag will be set if starting x was >= PAGE_OFFSET */ in __phys_addr()
28 VIRTUAL_BUG_ON((x > y) || !phys_addr_valid(x)); in __phys_addr()
31 return x; in __phys_addr()
35 unsigned long __phys_addr_symbol(unsigned long x) in __phys_addr_symbol() argument
37 unsigned long y = x - __START_KERNEL_map; in __phys_addr_symbol() local
40 VIRTUAL_BUG_ON(y >= KERNEL_IMAGE_SIZE); in __phys_addr_symbol()
42 return y + phys_base; in __phys_addr_symbol()
47 bool __virt_addr_valid(unsigned long x) in __virt_addr_valid() argument
49 unsigned long y = x - __START_KERNEL_map; in __virt_addr_valid() local
51 /* use the carry flag to determine if x was < __START_KERNEL_map */ in __virt_addr_valid()
52 if (unlikely(x > y)) { in __virt_addr_valid()
53 x = y + phys_base; in __virt_addr_valid()
55 if (y >= KERNEL_IMAGE_SIZE) in __virt_addr_valid()
58 x = y + (__START_KERNEL_map - PAGE_OFFSET); in __virt_addr_valid()
60 /* carry flag will be set if starting x was >= PAGE_OFFSET */ in __virt_addr_valid()
61 if ((x > y) || !phys_addr_valid(x)) in __virt_addr_valid()
65 return pfn_valid(x >> PAGE_SHIFT); in __virt_addr_valid()
72 unsigned long __phys_addr(unsigned long x) in __phys_addr() argument
74 unsigned long phys_addr = x - PAGE_OFFSET; in __phys_addr()
76 VIRTUAL_BUG_ON(x < PAGE_OFFSET); in __phys_addr()
77 VIRTUAL_BUG_ON(__vmalloc_start_set && is_vmalloc_addr((void *) x)); in __phys_addr()
81 BUG_ON(slow_virt_to_phys((void *)x) != phys_addr); in __phys_addr()
88 bool __virt_addr_valid(unsigned long x) in __virt_addr_valid() argument
90 if (x < PAGE_OFFSET) in __virt_addr_valid()
92 if (__vmalloc_start_set && is_vmalloc_addr((void *) x)) in __virt_addr_valid()
94 if (x >= FIXADDR_START) in __virt_addr_valid()
96 return pfn_valid((x - PAGE_OFFSET) >> PAGE_SHIFT); in __virt_addr_valid()