mirror of
				https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
				synced 2025-10-31 16:38:31 +00:00 
			
		
		
		
	 9eb7115bcc
			
		
	
	
		9eb7115bcc
		
	
	
	
	
		
			
			This patch takes out IO mapping macros from mach/io.h and puts them in
mach/hardware.h avoiding need to include mach/io.h in various files such as
serial.h, vmalloc.h etc.
The main reason to avoid inclusion of mach/io.h is, when default in/out macros
are overridden by machine specific functions (e.g., in case of PCI I/O), they
result into linker error. An example snippet and error snapshot is listed below.
Following code in mach/io.h:
	#define inl(p)  my_inl()
	static inline unsigned int my_inl(unsigned int addr)
	{
		if (IS_PCI_IO(addr))
			return pci_inl ();
		else
			return le32_to_cpu(__raw_readl(__typesafe_io(addr)));
	}
leads to error:
	LD      arch/arm/boot/compressed/vmlinux
	arch/arm/boot/compressed/misc.o: In function `my_inl':
	misc.c:(.text+0x2744): undefined reference to `pci_inl'
	make[2]: *** [arch/arm/boot/compressed/vmlinux] Error 1
This is because mach/io.h gets included in arch/arm/boot/compressed/misc.c
through mach/serial.h but pci.c file, which defines 'pci_inl' doesn't get built
into compressed vmlinux.
Signed-off-by: Hemant Pedanekar <hemantp@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
		
	
			
		
			
				
	
	
		
			15 lines
		
	
	
		
			481 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			481 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /*
 | |
|  * DaVinci vmalloc definitions
 | |
|  *
 | |
|  * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
 | |
|  *
 | |
|  * 2007 (c) MontaVista Software, Inc. This file is licensed under
 | |
|  * the terms of the GNU General Public License version 2. This program
 | |
|  * is licensed "as is" without any warranty of any kind, whether express
 | |
|  * or implied.
 | |
|  */
 | |
| #include <mach/hardware.h>
 | |
| 
 | |
| /* Allow vmalloc range until the IO virtual range minus a 2M "hole" */
 | |
| #define VMALLOC_END	  (IO_VIRT - (2<<20))
 |