1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef __LINUX_GOLDFISH_H 3 #define __LINUX_GOLDFISH_H 4 5 #include <linux/types.h> 6 #include <linux/io.h> 7 8 /* Helpers for Goldfish virtual platform */ 9 10 static inline void gf_write_ptr(const void *ptr, void __iomem *portl, 11 void __iomem *porth) 12 { 13 writel((u32)(unsigned long)ptr, portl); 14 #ifdef CONFIG_64BIT 15 writel((unsigned long)ptr >> 32, porth); 16 #endif 17 } 18 19 static inline void gf_write_dma_addr(const dma_addr_t addr, 20 void __iomem *portl, 21 void __iomem *porth) 22 { 23 writel((u32)addr, portl); 24 #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT 25 writel(addr >> 32, porth); 26 #endif 27 } 28 29 30 #endif /* __LINUX_GOLDFISH_H */ 31