From 04e3e4abd310413a0ece5b012ec282b08a245b59 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sat, 29 May 2004 12:53:46 +0100 Subject: [PATCH] [ARM] Move common definitions to asm/memory.h Virtually all the architecture specific memory.h files were defining the same constants and v<->p translations the same way. Move them to asm/memory.h --- include/asm-arm/arch-adifcc/memory.h | 24 ------------------ include/asm-arm/arch-cl7500/memory.h | 22 +++-------------- include/asm-arm/arch-clps711x/memory.h | 27 +++------------------ include/asm-arm/arch-ebsa110/memory.h | 18 +------------- include/asm-arm/arch-ebsa285/memory.h | 14 ++++------- include/asm-arm/arch-epxa10db/memory.h | 25 +++---------------- include/asm-arm/arch-integrator/memory.h | 28 +++------------------ include/asm-arm/arch-iop3xx/memory.h | 23 ------------------ include/asm-arm/arch-ixp4xx/memory.h | 18 -------------- include/asm-arm/arch-l7200/memory.h | 23 ------------------ include/asm-arm/arch-lh7a40x/memory.h | 23 ------------------ include/asm-arm/arch-nexuspci/memory.h | 25 +++---------------- include/asm-arm/arch-omap/memory.h | 25 +++---------------- include/asm-arm/arch-pxa/memory.h | 24 ------------------ include/asm-arm/arch-rpc/memory.h | 22 +++-------------- include/asm-arm/arch-s3c2410/memory.h | 21 +--------------- include/asm-arm/arch-sa1100/memory.h | 25 ------------------- include/asm-arm/arch-shark/memory.h | 18 +------------- include/asm-arm/arch-tbox/memory.h | 21 +--------------- include/asm-arm/arch-versatile/memory.h | 25 +++---------------- include/asm-arm/memory.h | 31 ++++++++++++++++++++++++ 21 files changed, 66 insertions(+), 416 deletions(-) diff --git a/include/asm-arm/arch-adifcc/memory.h b/include/asm-arm/arch-adifcc/memory.h index b2a4b1e4417f..b76187d8d42b 100644 --- a/include/asm-arm/arch-adifcc/memory.h +++ b/include/asm-arm/arch-adifcc/memory.h @@ -7,35 +7,11 @@ #ifndef __ASM_ARCH_MEMORY_H #define __ASM_ARCH_MEMORY_H - -/* - * Task size: 3GB - */ -#define TASK_SIZE (0xbf000000UL) -#define TASK_SIZE_26 (0x04000000UL) - -/* - * This decides where the kernel will search for a free chunk of vm - * space during mmap's. - */ -#define TASK_UNMAPPED_BASE (0x40000000) - -/* - * Page offset: 3GB - */ -#define PAGE_OFFSET (0xc0000000UL) - /* * Physical DRAM offset. */ #define PHYS_OFFSET (0xC0000000UL) -/* - * physical vs virtual ram conversion - */ -#define __virt_to_phys(x) ((x) - PAGE_OFFSET + PHYS_OFFSET) -#define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET) - /* * Virtual view <-> DMA view memory address translations * virt_to_bus: Used to translate the virtual address to an diff --git a/include/asm-arm/arch-cl7500/memory.h b/include/asm-arm/arch-cl7500/memory.h index 60429d0e3a9f..9776bba8e585 100644 --- a/include/asm-arm/arch-cl7500/memory.h +++ b/include/asm-arm/arch-cl7500/memory.h @@ -11,30 +11,14 @@ * 21-Mar-1999 RMK Renamed to memory.h * RMK Added TASK_SIZE and PAGE_OFFSET */ -#ifndef __ASM_ARCH_MMU_H -#define __ASM_ARCH_MMU_H +#ifndef __ASM_ARCH_MEMORY_H +#define __ASM_ARCH_MEMORY_H /* - * Task size: 3GB + * Physical DRAM offset. */ -#define TASK_SIZE (0xbf000000UL) -#define TASK_SIZE_26 (0x04000000UL) - -/* - * This decides where the kernel will search for a free chunk of vm - * space during mmap's. - */ -#define TASK_UNMAPPED_BASE (0x40000000) - -/* - * Page offset: 3GB - */ -#define PAGE_OFFSET (0xc0000000UL) #define PHYS_OFFSET (0x10000000UL) -#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET + PHYS_OFFSET) -#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET - PHYS_OFFSET) - /* * These are exactly the same on the RiscPC as the * physical memory view. diff --git a/include/asm-arm/arch-clps711x/memory.h b/include/asm-arm/arch-clps711x/memory.h index 18110aa0e27e..bd978947db42 100644 --- a/include/asm-arm/arch-clps711x/memory.h +++ b/include/asm-arm/arch-clps711x/memory.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/arch-clps711x/mmu.h + * linux/include/asm-arm/arch-clps711x/memory.h * * Copyright (C) 1999 ARM Limited * @@ -17,35 +17,16 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __ASM_ARCH_MMU_H -#define __ASM_ARCH_MMU_H +#ifndef __ASM_ARCH_MEMORY_H +#define __ASM_ARCH_MEMORY_H #include /* - * Task size: 3GB + * Physical DRAM offset. */ -#define TASK_SIZE (0xbf000000UL) -#define TASK_SIZE_26 (0x04000000UL) - -/* - * This decides where the kernel will search for a free chunk of vm - * space during mmap's. - */ -#define TASK_UNMAPPED_BASE (0x40000000) - -/* - * Page offset: 3GB - */ -#define PAGE_OFFSET (0xc0000000UL) #define PHYS_OFFSET (0xc0000000UL) -/* - * On integrator, the dram is contiguous - */ -#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET + PHYS_OFFSET) -#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET - PHYS_OFFSET) - /* * Virtual view <-> DMA view memory address translations * virt_to_bus: Used to translate the virtual address to an diff --git a/include/asm-arm/arch-ebsa110/memory.h b/include/asm-arm/arch-ebsa110/memory.h index f1f633f497e3..5a9493e12275 100644 --- a/include/asm-arm/arch-ebsa110/memory.h +++ b/include/asm-arm/arch-ebsa110/memory.h @@ -17,26 +17,10 @@ #define __ASM_ARCH_MEMORY_H /* - * Task size: 3GB + * Physical DRAM offset. */ -#define TASK_SIZE (0xbf000000UL) -#define TASK_SIZE_26 (0x04000000UL) - -/* - * This decides where the kernel will search for a free chunk of vm - * space during mmap's. - */ -#define TASK_UNMAPPED_BASE (0x40000000) - -/* - * Page offset: 3GB - */ -#define PAGE_OFFSET (0xc0000000UL) #define PHYS_OFFSET (0x00000000UL) -#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET) -#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET) - /* * We keep this 1:1 so that we don't interfere * with the PCMCIA memory regions diff --git a/include/asm-arm/arch-ebsa285/memory.h b/include/asm-arm/arch-ebsa285/memory.h index 9a3444ae45a7..d0466f9987d3 100644 --- a/include/asm-arm/arch-ebsa285/memory.h +++ b/include/asm-arm/arch-ebsa285/memory.h @@ -16,8 +16,8 @@ * Renamed to memory.h * Moved PAGE_OFFSET and TASK_SIZE here */ -#ifndef __ASM_ARCH_MMU_H -#define __ASM_ARCH_MMU_H +#ifndef __ASM_ARCH_MEMORY_H +#define __ASM_ARCH_MEMORY_H #include @@ -61,7 +61,9 @@ extern unsigned long __bus_to_virt(unsigned long); #endif -#define TASK_SIZE_26 (0x04000000UL) +/* + * Physical DRAM offset. + */ #define PHYS_OFFSET (0x00000000UL) /* @@ -70,10 +72,4 @@ extern unsigned long __bus_to_virt(unsigned long); */ #define TASK_UNMAPPED_BASE ((TASK_SIZE + 0x01000000) / 3) -/* - * The DRAM is always contiguous. - */ -#define __virt_to_phys(vpage) ((unsigned long)(vpage) - PAGE_OFFSET) -#define __phys_to_virt(ppage) ((unsigned long)(ppage) + PAGE_OFFSET) - #endif diff --git a/include/asm-arm/arch-epxa10db/memory.h b/include/asm-arm/arch-epxa10db/memory.h index 6efabdbdae11..3f86bf7f67f0 100644 --- a/include/asm-arm/arch-epxa10db/memory.h +++ b/include/asm-arm/arch-epxa10db/memory.h @@ -17,33 +17,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __ASM_ARCH_MMU_H -#define __ASM_ARCH_MMU_H +#ifndef __ASM_ARCH_MEMORY_H +#define __ASM_ARCH_MEMORY_H /* - * Task size: 3GB + * Physical DRAM offset. */ -#define TASK_SIZE (0xbf000000UL) -#define TASK_SIZE_26 (0x04000000UL) - -/* - * This decides where the kernel will search for a free chunk of vm - * space during mmap's. - */ -#define TASK_UNMAPPED_BASE (0x40000000) - -/* - * Page offset: 3GB - */ -#define PAGE_OFFSET (0xc0000000UL) #define PHYS_OFFSET (0x00000000UL) -/* - * On epxa10, the dram is contiguous - */ -#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET) -#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET) - /* * Virtual view <-> DMA view memory address translations * virt_to_bus: Used to translate the virtual address to an diff --git a/include/asm-arm/arch-integrator/memory.h b/include/asm-arm/arch-integrator/memory.h index 03bf9d0112fa..2087ea7d28a9 100644 --- a/include/asm-arm/arch-integrator/memory.h +++ b/include/asm-arm/arch-integrator/memory.h @@ -1,5 +1,5 @@ /* - * linux/include/asm-arm/arch-integrator/mmu.h + * linux/include/asm-arm/arch-integrator/memory.h * * Copyright (C) 1999 ARM Limited * @@ -17,33 +17,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __ASM_ARCH_MMU_H -#define __ASM_ARCH_MMU_H +#ifndef __ASM_ARCH_MEMORY_H +#define __ASM_ARCH_MEMORY_H /* - * Task size: 3GB + * Physical DRAM offset. */ -#define TASK_SIZE (0xbf000000UL) -#define TASK_SIZE_26 (0x04000000UL) - -/* - * This decides where the kernel will search for a free chunk of vm - * space during mmap's. - */ -#define TASK_UNMAPPED_BASE (0x40000000) - -/* - * Page offset: 3GB - */ -#define PAGE_OFFSET (0xc0000000UL) #define PHYS_OFFSET (0x00000000UL) - -/* - * On integrator, the dram is contiguous - */ -#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET) -#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET) - #define BUS_OFFSET (0x80000000UL) /* diff --git a/include/asm-arm/arch-iop3xx/memory.h b/include/asm-arm/arch-iop3xx/memory.h index 1593436cc8de..a2d077a3b3b5 100644 --- a/include/asm-arm/arch-iop3xx/memory.h +++ b/include/asm-arm/arch-iop3xx/memory.h @@ -9,34 +9,11 @@ #include #include -/* - * Task size: 3GB - */ -#define TASK_SIZE (0xbf000000UL) -#define TASK_SIZE_26 (0x04000000UL) - -/* - * This decides where the kernel will search for a free chunk of vm - * space during mmap's. - */ -#define TASK_UNMAPPED_BASE (0x40000000) - -/* - * Page offset: 3GB - */ -#define PAGE_OFFSET (0xc0000000UL) - /* * Physical DRAM offset. */ #define PHYS_OFFSET (0xa0000000UL) -/* - * physical vs virtual ram conversion - */ -#define __virt_to_phys(x) ((x) - PAGE_OFFSET + PHYS_OFFSET) -#define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET) - /* * Virtual view <-> DMA view memory address translations * virt_to_bus: Used to translate the virtual address to an diff --git a/include/asm-arm/arch-ixp4xx/memory.h b/include/asm-arm/arch-ixp4xx/memory.h index 75318d0b7997..3f6da112712e 100644 --- a/include/asm-arm/arch-ixp4xx/memory.h +++ b/include/asm-arm/arch-ixp4xx/memory.h @@ -7,29 +7,11 @@ #ifndef __ASM_ARCH_MEMORY_H #define __ASM_ARCH_MEMORY_H -#define TASK_SIZE (0xbf000000UL) -#define TASK_SIZE_26 (0x04000000UL) - -/* - * This decides where the kernel will search for a free chunk of vm - * space during mmap's. - */ -#define TASK_UNMAPPED_BASE (0x40000000) - - -#define PAGE_OFFSET (0xc0000000UL) - /* * Physical DRAM offset. */ #define PHYS_OFFSET (0x00000000UL) -/* - * physical vs virtual ram conversion - */ -#define __virt_to_phys(x) ((x) - PAGE_OFFSET + PHYS_OFFSET) -#define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET) - /* * Virtual view <-> DMA view memory address translations * virt_to_bus: Used to translate the virtual address to an diff --git a/include/asm-arm/arch-l7200/memory.h b/include/asm-arm/arch-l7200/memory.h index f9e412384590..c5b9608cb137 100644 --- a/include/asm-arm/arch-l7200/memory.h +++ b/include/asm-arm/arch-l7200/memory.h @@ -12,34 +12,11 @@ #ifndef __ASM_ARCH_MEMORY_H #define __ASM_ARCH_MEMORY_H -/* - * Task size: 3GB - */ -#define TASK_SIZE (0xbf000000UL) -#define TASK_SIZE_26 (0x04000000UL) - -/* - * This decides where the kernel will search for a free chunk of vm - * space during mmap's. - */ -#define TASK_UNMAPPED_BASE (0x40000000) - -/* - * Page offset: 3GB - */ -#define PAGE_OFFSET (0xc0000000UL) - /* * Physical DRAM offset on the L7200 SDB. */ #define PHYS_OFFSET (0xf0000000UL) -/* - * The DRAM is contiguous. - */ -#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET + PHYS_OFFSET) -#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET - PHYS_OFFSET) - #define __virt_to_bus(x) __virt_to_phys(x) #define __bus_to_virt(x) __phys_to_virt(x) diff --git a/include/asm-arm/arch-lh7a40x/memory.h b/include/asm-arm/arch-lh7a40x/memory.h index a73926dcaca2..1a1b1a3d5f96 100644 --- a/include/asm-arm/arch-lh7a40x/memory.h +++ b/include/asm-arm/arch-lh7a40x/memory.h @@ -14,34 +14,11 @@ #define BANKS_PER_NODE 1 /* Define as either 1 or 2 */ -/* - * Task size: 3GB - */ -#define TASK_SIZE (0xbf000000UL) /* 0xc0000000? */ -#define TASK_SIZE_26 (0x04000000UL) - -/* - * This decides where the kernel will search for a free chunk of vm - * space during mmap's. - */ -#define TASK_UNMAPPED_BASE (0x40000000) - -/* - * Page offset: 3GB - */ -#define PAGE_OFFSET (0xc0000000UL) - /* * Physical DRAM offset. */ #define PHYS_OFFSET (0xc0000000UL) -/* - * physical vs virtual ram conversion - */ -#define __virt_to_phys(x) ((x) - PAGE_OFFSET + PHYS_OFFSET) -#define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET) - /* * Virtual view <-> DMA view memory address translations * virt_to_bus: Used to translate the virtual address to an diff --git a/include/asm-arm/arch-nexuspci/memory.h b/include/asm-arm/arch-nexuspci/memory.h index 973fceb9d8fd..85d7c45055f7 100644 --- a/include/asm-arm/arch-nexuspci/memory.h +++ b/include/asm-arm/arch-nexuspci/memory.h @@ -5,34 +5,15 @@ * Copyright (c) 1999 Russell King * */ -#ifndef __ASM_ARCH_MMU_H -#define __ASM_ARCH_MMU_H +#ifndef __ASM_ARCH_MEMORY_H +#define __ASM_ARCH_MEMORY_H /* - * Task size: 3GB + * Physical DRAM offset. */ -#define TASK_SIZE (0xbf000000UL) -#define TASK_SIZE_26 (0x04000000UL) - -/* - * This decides where the kernel will search for a free chunk of vm - * space during mmap's. - */ -#define TASK_UNMAPPED_BASE (0x40000000) - -/* - * Page offset: 3GB - */ -#define PAGE_OFFSET (0xc0000000UL) #define PHYS_OFFSET (0x40000000UL) #define BUS_OFFSET (0xe0000000UL) -/* - * DRAM is contiguous - */ -#define __virt_to_phys(vpage) ((unsigned long)(vpage) - PAGE_OFFSET + PHYS_OFFSET) -#define __phys_to_virt(ppage) ((unsigned long)(ppage) + PAGE_OFFSET - PHYS_OFFSET) - /* * On the PCI bus the DRAM appears at address 0xe0000000 */ diff --git a/include/asm-arm/arch-omap/memory.h b/include/asm-arm/arch-omap/memory.h index fcd1445433fd..106af7555813 100644 --- a/include/asm-arm/arch-omap/memory.h +++ b/include/asm-arm/arch-omap/memory.h @@ -30,25 +30,12 @@ * 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef __ASM_ARCH_MMU_H -#define __ASM_ARCH_MMU_H +#ifndef __ASM_ARCH_MEMORY_H +#define __ASM_ARCH_MEMORY_H /* - * Task size: 3GB + * Physical DRAM offset. */ -#define TASK_SIZE (0xbf000000UL) -#define TASK_SIZE_26 (0x04000000UL) - -/* - * This decides where the kernel will search for a free chunk of vm - * space during mmap's. - */ -#define TASK_UNMAPPED_BASE (0x40000000) - -/* - * Page offset: 3GB - */ -#define PAGE_OFFSET (0xC0000000UL) #define PHYS_OFFSET (0x10000000UL) /* @@ -56,12 +43,6 @@ */ #define OMAP1510_LB_OFFSET (0x30000000UL) -/* - * The DRAM is contiguous. - */ -#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET + PHYS_OFFSET) -#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET - PHYS_OFFSET) - /* * Conversion between SDRAM and fake PCI bus, used by USB * NOTE: Physical address must be converted to Local Bus address diff --git a/include/asm-arm/arch-pxa/memory.h b/include/asm-arm/arch-pxa/memory.h index 5b650b22aa13..427e6ff5c79f 100644 --- a/include/asm-arm/arch-pxa/memory.h +++ b/include/asm-arm/arch-pxa/memory.h @@ -12,35 +12,11 @@ #ifndef __ASM_ARCH_MEMORY_H #define __ASM_ARCH_MEMORY_H - -/* - * Task size: 3GB - */ -#define TASK_SIZE (0xbf000000UL) -#define TASK_SIZE_26 (0x04000000UL) - -/* - * This decides where the kernel will search for a free chunk of vm - * space during mmap's. - */ -#define TASK_UNMAPPED_BASE (0x40000000) - -/* - * Page offset: 3GB - */ -#define PAGE_OFFSET (0xc0000000UL) - /* * Physical DRAM offset. */ #define PHYS_OFFSET (0xa0000000UL) -/* - * physical vs virtual ram conversion - */ -#define __virt_to_phys(x) ((x) - PAGE_OFFSET + PHYS_OFFSET) -#define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET) - /* * Virtual view <-> DMA view memory address translations * virt_to_bus: Used to translate the virtual address to an diff --git a/include/asm-arm/arch-rpc/memory.h b/include/asm-arm/arch-rpc/memory.h index ae7eea67afbf..33fc75cdead0 100644 --- a/include/asm-arm/arch-rpc/memory.h +++ b/include/asm-arm/arch-rpc/memory.h @@ -15,30 +15,14 @@ * 21-Mar-1999 RMK Renamed to memory.h * RMK Added TASK_SIZE and PAGE_OFFSET */ -#ifndef __ASM_ARCH_MMU_H -#define __ASM_ARCH_MMU_H +#ifndef __ASM_ARCH_MEMORY_H +#define __ASM_ARCH_MEMORY_H /* - * Task size: 3GB + * Physical DRAM offset. */ -#define TASK_SIZE (0xbf000000UL) -#define TASK_SIZE_26 (0x04000000UL) - -/* - * This decides where the kernel will search for a free chunk of vm - * space during mmap's. - */ -#define TASK_UNMAPPED_BASE (0x40000000) - -/* - * Page offset: 3GB - */ -#define PAGE_OFFSET (0xc0000000UL) #define PHYS_OFFSET (0x10000000UL) -#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET + PHYS_OFFSET) -#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET - PHYS_OFFSET) - /* * These are exactly the same on the RiscPC as the * physical memory view. diff --git a/include/asm-arm/arch-s3c2410/memory.h b/include/asm-arm/arch-s3c2410/memory.h index c36b533196bb..5321b97468f8 100644 --- a/include/asm-arm/arch-s3c2410/memory.h +++ b/include/asm-arm/arch-s3c2410/memory.h @@ -23,29 +23,10 @@ #define __ASM_ARCH_MEMORY_H /* - * Task size: 3GB - */ -#define TASK_SIZE (0xbf000000UL) -#define TASK_SIZE_26 (0x04000000UL) - -/* - * This decides where the kernel will search for a free chunk of vm - * space during mmap's. - */ -#define TASK_UNMAPPED_BASE (0x40000000) - -/* - * Page offset: 3GB - * * DRAM starts at 0x30000000 -*/ - -#define PAGE_OFFSET (0xc0000000UL) + */ #define PHYS_OFFSET (0x30000000UL) -#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET + PHYS_OFFSET) -#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET - PHYS_OFFSET) - /* * These are exactly the same on the S3C2410 as the * physical memory view. diff --git a/include/asm-arm/arch-sa1100/memory.h b/include/asm-arm/arch-sa1100/memory.h index 59cdbe962f28..38794846b3a3 100644 --- a/include/asm-arm/arch-sa1100/memory.h +++ b/include/asm-arm/arch-sa1100/memory.h @@ -9,36 +9,11 @@ #include -/* - * Task size: 3GB - */ -#define TASK_SIZE (0xbf000000UL) -#define TASK_SIZE_26 (0x04000000UL) - -/* - * This decides where the kernel will search for a free chunk of vm - * space during mmap's. - */ -#define TASK_UNMAPPED_BASE (0x40000000) - -/* - * Page offset: 3GB - */ -#define PAGE_OFFSET (0xc0000000UL) - /* * Physical DRAM offset is 0xc0000000 on the SA1100 */ #define PHYS_OFFSET (0xc0000000UL) -/* - * We take advantage of the fact that physical and virtual address can be the - * same. The NUMA code is handling the large holes that might exist between - * all memory banks. - */ -#define __virt_to_phys(x) (x) -#define __phys_to_virt(x) (x) - /* * Virtual view <-> DMA view memory address translations * virt_to_bus: Used to translate the virtual address to an diff --git a/include/asm-arm/arch-shark/memory.h b/include/asm-arm/arch-shark/memory.h index 4716f4b99ce3..7a06f07f6418 100644 --- a/include/asm-arm/arch-shark/memory.h +++ b/include/asm-arm/arch-shark/memory.h @@ -11,26 +11,10 @@ #define __ASM_ARCH_MEMORY_H /* - * Task size: 3GB + * Physical DRAM offset. */ -#define TASK_SIZE (0xbf000000UL) -#define TASK_SIZE_26 (0x04000000UL) - -/* - * This decides where the kernel will search for a free chunk of vm - * space during mmap's. - */ -#define TASK_UNMAPPED_BASE (0x40000000) - -/* - * Page offset: = 3GB - */ -#define PAGE_OFFSET (0xC0000000UL) #define PHYS_OFFSET (0x08000000UL) -#define __virt_to_phys(vpage) (vpage - PAGE_OFFSET + PHYS_OFFSET) -#define __phys_to_virt(ppage) (ppage - PHYS_OFFSET + PAGE_OFFSET) - #define __virt_to_bus(x) __virt_to_phys(x) #define __bus_to_virt(x) __phys_to_virt(x) diff --git a/include/asm-arm/arch-tbox/memory.h b/include/asm-arm/arch-tbox/memory.h index 330cff0532de..a20479487c9d 100644 --- a/include/asm-arm/arch-tbox/memory.h +++ b/include/asm-arm/arch-tbox/memory.h @@ -8,29 +8,10 @@ #define __ASM_ARCH_MEMORY_H /* - * Task size: 3GB + * Physical DRAM offset. */ -#define TASK_SIZE (0xbf000000UL) -#define TASK_SIZE_26 (0x04000000UL) - -/* - * This decides where the kernel will search for a free chunk of vm - * space during mmap's. - */ -#define TASK_UNMAPPED_BASE (0x40000000) - -/* - * Page offset: 3GB - */ -#define PAGE_OFFSET (0xc0000000UL) #define PHYS_OFFSET (0x80000000UL) -/* - * DRAM is contiguous - */ -#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET + PHYS_OFFSET) -#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET - PHYS_OFFSET) - /* * Bus view is the same as physical view */ diff --git a/include/asm-arm/arch-versatile/memory.h b/include/asm-arm/arch-versatile/memory.h index 91717843278a..7b8b7cc422fa 100644 --- a/include/asm-arm/arch-versatile/memory.h +++ b/include/asm-arm/arch-versatile/memory.h @@ -17,33 +17,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __ASM_ARCH_MMU_H -#define __ASM_ARCH_MMU_H +#ifndef __ASM_ARCH_MEMORY_H +#define __ASM_ARCH_MEMORY_H /* - * Task size: 3GB + * Physical DRAM offset. */ -#define TASK_SIZE (0xbf000000UL) -#define TASK_SIZE_26 (0x04000000UL) - -/* - * This decides where the kernel will search for a free chunk of vm - * space during mmap's. - */ -#define TASK_UNMAPPED_BASE (0x40000000) - -/* - * Page offset: 3GB - */ -#define PAGE_OFFSET (0xc0000000UL) #define PHYS_OFFSET (0x00000000UL) -/* - * On Versatile PB, the dram is contiguous - */ -#define __virt_to_phys(vpage) ((vpage) - PAGE_OFFSET) -#define __phys_to_virt(ppage) ((ppage) + PAGE_OFFSET) - /* * Virtual view <-> DMA view memory address translations * virt_to_bus: Used to translate the virtual address to an diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h index 2cd87b3c24a4..75da0b9c4960 100644 --- a/include/asm-arm/memory.h +++ b/include/asm-arm/memory.h @@ -15,6 +15,37 @@ #include #include +#ifndef TASK_SIZE +/* + * TASK_SIZE - the maximum size of a user space task. + * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area + */ +#define TASK_SIZE (0xbf000000UL) +#define TASK_UNMAPPED_BASE (0x40000000UL) +#endif + +/* + * The maximum size of a 26-bit user space task. + */ +#define TASK_SIZE_26 (0x04000000UL) + +/* + * Page offset: 3GB + */ +#ifndef PAGE_OFFSET +#define PAGE_OFFSET (0xc0000000UL) +#endif + +/* + * Physical vs virtual RAM address space conversion. These are + * private definitions which should NOT be used outside memory.h + * files. Use virt_to_phys/phys_to_virt/__pa/__va instead. + */ +#ifndef __virt_to_phys +#define __virt_to_phys(x) ((x) - PAGE_OFFSET + PHYS_OFFSET) +#define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET) +#endif + /* * The module space lives between the addresses given by TASK_SIZE * and PAGE_OFFSET - it must be within 32MB of the kernel text. -- 2.39.5