OSDN Git Service

mm/vmalloc.c: fix align value calculation error
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / include / linux / goldfish.h
1 #ifndef __LINUX_GOLDFISH_H
2 #define __LINUX_GOLDFISH_H
3
4 #include <linux/types.h>
5 #include <linux/io.h>
6
7 /* Helpers for Goldfish virtual platform */
8
9 static inline void gf_write_ptr(const void *ptr, void __iomem *portl,
10                                 void __iomem *porth)
11 {
12         const uintptr_t addr = (uintptr_t)ptr;
13
14         writel((u32)addr, portl);
15 #ifdef CONFIG_64BIT
16         writel(addr >> 32, porth);
17 #endif
18 }
19
20 static inline void gf_write_dma_addr(const dma_addr_t addr,
21                                      void __iomem *portl,
22                                      void __iomem *porth)
23 {
24         writel((u32)addr, portl);
25 #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
26         writel(addr >> 32, porth);
27 #endif
28 }
29
30
31 #endif /* __LINUX_GOLDFISH_H */