aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/goldfish.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/goldfish.h')
-rw-r--r--include/linux/goldfish.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/linux/goldfish.h b/include/linux/goldfish.h
index 2835c150c3ff..265a099cd3b8 100644
--- a/include/linux/goldfish.h
+++ b/include/linux/goldfish.h
@@ -2,14 +2,20 @@
2#ifndef __LINUX_GOLDFISH_H 2#ifndef __LINUX_GOLDFISH_H
3#define __LINUX_GOLDFISH_H 3#define __LINUX_GOLDFISH_H
4 4
5#include <linux/kernel.h>
6#include <linux/types.h>
7#include <linux/io.h>
8
5/* Helpers for Goldfish virtual platform */ 9/* Helpers for Goldfish virtual platform */
6 10
7static inline void gf_write_ptr(const void *ptr, void __iomem *portl, 11static inline void gf_write_ptr(const void *ptr, void __iomem *portl,
8 void __iomem *porth) 12 void __iomem *porth)
9{ 13{
10 writel((u32)(unsigned long)ptr, portl); 14 const unsigned long addr = (unsigned long)ptr;
15
16 writel(lower_32_bits(addr), portl);
11#ifdef CONFIG_64BIT 17#ifdef CONFIG_64BIT
12 writel((unsigned long)ptr >> 32, porth); 18 writel(upper_32_bits(addr), porth);
13#endif 19#endif
14} 20}
15 21
@@ -17,9 +23,9 @@ static inline void gf_write_dma_addr(const dma_addr_t addr,
17 void __iomem *portl, 23 void __iomem *portl,
18 void __iomem *porth) 24 void __iomem *porth)
19{ 25{
20 writel((u32)addr, portl); 26 writel(lower_32_bits(addr), portl);
21#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT 27#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
22 writel(addr >> 32, porth); 28 writel(upper_32_bits(addr), porth);
23#endif 29#endif
24} 30}
25 31