Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1555946
| From | Laura Abbott <labbott@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCHv7 08/11] arm64: Move some macros under #ifndef __ASSEMBLY__ |
| Date | 2017-01-10 22:40 +0100 |
| Message-ID | <sYcj8-6ul-43@gated-at.bofh.it> (permalink) |
| References | <sYcj7-6ul-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Several macros for various x_to_y exist outside the bounds of an
__ASSEMBLY__ guard. Move them in preparation for support for
CONFIG_DEBUG_VIRTUAL.
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Laura Abbott <labbott@redhat.com>
---
arch/arm64/include/asm/memory.h | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h
index bfe6328..f80a8e4 100644
--- a/arch/arm64/include/asm/memory.h
+++ b/arch/arm64/include/asm/memory.h
@@ -102,25 +102,6 @@
#endif
/*
- * Physical vs virtual RAM address space conversion. These are
- * private definitions which should NOT be used outside memory.h
- * files. Use virt_to_phys/phys_to_virt/__pa/__va instead.
- */
-#define __virt_to_phys(x) ({ \
- phys_addr_t __x = (phys_addr_t)(x); \
- __x & BIT(VA_BITS - 1) ? (__x & ~PAGE_OFFSET) + PHYS_OFFSET : \
- (__x - kimage_voffset); })
-
-#define __phys_to_virt(x) ((unsigned long)((x) - PHYS_OFFSET) | PAGE_OFFSET)
-#define __phys_to_kimg(x) ((unsigned long)((x) + kimage_voffset))
-
-/*
- * Convert a page to/from a physical address
- */
-#define page_to_phys(page) (__pfn_to_phys(page_to_pfn(page)))
-#define phys_to_page(phys) (pfn_to_page(__phys_to_pfn(phys)))
-
-/*
* Memory types available.
*/
#define MT_DEVICE_nGnRnE 0
@@ -187,6 +168,25 @@ static inline unsigned long kaslr_offset(void)
#define PHYS_PFN_OFFSET (PHYS_OFFSET >> PAGE_SHIFT)
/*
+ * Physical vs virtual RAM address space conversion. These are
+ * private definitions which should NOT be used outside memory.h
+ * files. Use virt_to_phys/phys_to_virt/__pa/__va instead.
+ */
+#define __virt_to_phys(x) ({ \
+ phys_addr_t __x = (phys_addr_t)(x); \
+ __x & BIT(VA_BITS - 1) ? (__x & ~PAGE_OFFSET) + PHYS_OFFSET : \
+ (__x - kimage_voffset); })
+
+#define __phys_to_virt(x) ((unsigned long)((x) - PHYS_OFFSET) | PAGE_OFFSET)
+#define __phys_to_kimg(x) ((unsigned long)((x) + kimage_voffset))
+
+/*
+ * Convert a page to/from a physical address
+ */
+#define page_to_phys(page) (__pfn_to_phys(page_to_pfn(page)))
+#define phys_to_page(phys) (pfn_to_page(__phys_to_pfn(phys)))
+
+/*
* Note: Drivers should NOT use these. They are the wrong
* translation for translating DMA addresses. Use the driver
* DMA support - see dma-mapping.h.
--
2.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCHv7 00/11] CONFIG_DEBUG_VIRTUAL for arm64 Laura Abbott <labbott@redhat.com> - 2017-01-10 22:40 +0100 [PATCHv7 11/11] arm64: Add support for CONFIG_DEBUG_VIRTUAL Laura Abbott <labbott@redhat.com> - 2017-01-10 22:40 +0100 [PATCHv7 06/11] mm/usercopy: Switch to using lm_alias Laura Abbott <labbott@redhat.com> - 2017-01-10 22:40 +0100 [PATCHv7 09/11] arm64: Add cast for virt_to_pfn Laura Abbott <labbott@redhat.com> - 2017-01-10 22:40 +0100 [PATCHv7 02/11] mm/cma: Cleanup highmem check Laura Abbott <labbott@redhat.com> - 2017-01-10 22:40 +0100 [PATCHv7 08/11] arm64: Move some macros under #ifndef __ASSEMBLY__ Laura Abbott <labbott@redhat.com> - 2017-01-10 22:40 +0100 [PATCHv7 10/11] arm64: Use __pa_symbol for kernel symbols Laura Abbott <labbott@redhat.com> - 2017-01-10 22:40 +0100 Re: [PATCHv7 00/11] CONFIG_DEBUG_VIRTUAL for arm64 Will Deacon <will.deacon@arm.com> - 2017-01-12 18:40 +0100
csiph-web