mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-09-04 20:19:47 +08:00 
			
		
		
		
	 05933aac7b
			
		
	
	
		05933aac7b
		
	
	
	
	
		
			
			With the SGI SN2 machvec removal most of the indirections are unused now, so remove them. This includes the entire removal of the mmio read*/write* macros as the generic ones are identical to the asm-generic/io.h version. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lkml.kernel.org/r/20190813072514.23299-17-hch@lst.de Signed-off-by: Tony Luck <tony.luck@intel.com>
		
			
				
	
	
		
			52 lines
		
	
	
		
			935 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			52 lines
		
	
	
		
			935 B
		
	
	
	
		
			C
		
	
	
	
	
	
| // SPDX-License-Identifier: GPL-2.0
 | |
| #include <linux/module.h>
 | |
| #include <linux/types.h>
 | |
| 
 | |
| #include <asm/io.h>
 | |
| 
 | |
| /*
 | |
|  * Copy data from IO memory space to "real" memory space.
 | |
|  * This needs to be optimized.
 | |
|  */
 | |
| void memcpy_fromio(void *to, const volatile void __iomem *from, long count)
 | |
| {
 | |
| 	char *dst = to;
 | |
| 
 | |
| 	while (count) {
 | |
| 		count--;
 | |
| 		*dst++ = readb(from++);
 | |
| 	}
 | |
| }
 | |
| EXPORT_SYMBOL(memcpy_fromio);
 | |
| 
 | |
| /*
 | |
|  * Copy data from "real" memory space to IO memory space.
 | |
|  * This needs to be optimized.
 | |
|  */
 | |
| void memcpy_toio(volatile void __iomem *to, const void *from, long count)
 | |
| {
 | |
| 	const char *src = from;
 | |
| 
 | |
| 	while (count) {
 | |
| 		count--;
 | |
| 		writeb(*src++, to++);
 | |
| 	}
 | |
| }
 | |
| EXPORT_SYMBOL(memcpy_toio);
 | |
| 
 | |
| /*
 | |
|  * "memset" on IO memory space.
 | |
|  * This needs to be optimized.
 | |
|  */
 | |
| void memset_io(volatile void __iomem *dst, int c, long count)
 | |
| {
 | |
| 	unsigned char ch = (char)(c & 0xff);
 | |
| 
 | |
| 	while (count) {
 | |
| 		count--;
 | |
| 		writeb(ch, dst);
 | |
| 		dst++;
 | |
| 	}
 | |
| }
 | |
| EXPORT_SYMBOL(memset_io);
 |