Merge branch 'nommu' of master.kernel.org:/home/rmk/linux-2.6-arm

* 'nommu' of master.kernel.org:/home/rmk/linux-2.6-arm:
[ARM] nommu: backtrace code must not reference a discarded section
[ARM] nommu: Initial uCLinux support for MMU-based CPUs
[ARM] nommu: prevent Xscale-based machines being selected
[ARM] nommu: export flush_dcache_page()
[ARM] nommu: remove fault-armv, mmap and mm-armv files from nommu build
[ARM] Remove TABLE_SIZE, and several unused function prototypes
[ARM] nommu: Provide a simple flush_dcache_page implementation
[ARM] nommu: add arch/arm/Kconfig-nommu to Kconfig files
[ARM] nommu: add stubs for ioremap and friends
[ARM] nommu: avoid selecting TLB and CPU specific copy code
[ARM] nommu: uaccess tweaks
[ARM] nommu: adjust headers for !MMU ARM systems
[ARM] nommu: we need the TLS register emulation for nommu mode

+675 -172
+9
arch/arm/Kconfig
··· 188 188 189 189 config ARCH_IOP3XX 190 190 bool "IOP3xx-based" 191 + depends on MMU 191 192 select PCI 192 193 help 193 194 Support for Intel's IOP3XX (XScale) family of processors. 194 195 195 196 config ARCH_IXP4XX 196 197 bool "IXP4xx-based" 198 + depends on MMU 197 199 help 198 200 Support for Intel's IXP4XX (XScale) family of processors. 199 201 200 202 config ARCH_IXP2000 201 203 bool "IXP2400/2800-based" 204 + depends on MMU 202 205 select PCI 203 206 help 204 207 Support for Intel's IXP2400/2800 (XScale) family of processors. 205 208 206 209 config ARCH_IXP23XX 207 210 bool "IXP23XX-based" 211 + depends on MMU 208 212 select PCI 209 213 help 210 214 Support for Intel's IXP23xx (XScale) family of processors. ··· 233 229 234 230 config ARCH_PXA 235 231 bool "PXA2xx-based" 232 + depends on MMU 236 233 select ARCH_MTD_XIP 237 234 help 238 235 Support for Intel's PXA2XX processor line. ··· 343 338 bool 344 339 depends on CPU_XSCALE && !XSCALE_PMU_TIMER 345 340 default y 341 + 342 + if !MMU 343 + source "arch/arm/Kconfig-nommu" 344 + endif 346 345 347 346 endmenu 348 347
+5 -2
arch/arm/kernel/armksyms.c
··· 109 109 EXPORT_SYMBOL(__memzero); 110 110 111 111 /* user mem (segment) */ 112 + EXPORT_SYMBOL(__strnlen_user); 113 + EXPORT_SYMBOL(__strncpy_from_user); 114 + 115 + #ifdef CONFIG_MMU 112 116 EXPORT_SYMBOL(__copy_from_user); 113 117 EXPORT_SYMBOL(__copy_to_user); 114 118 EXPORT_SYMBOL(__clear_user); 115 - EXPORT_SYMBOL(__strnlen_user); 116 - EXPORT_SYMBOL(__strncpy_from_user); 117 119 118 120 EXPORT_SYMBOL(__get_user_1); 119 121 EXPORT_SYMBOL(__get_user_2); ··· 125 123 EXPORT_SYMBOL(__put_user_2); 126 124 EXPORT_SYMBOL(__put_user_4); 127 125 EXPORT_SYMBOL(__put_user_8); 126 + #endif 128 127 129 128 /* crypto hash */ 130 129 EXPORT_SYMBOL(sha_transform);
+8
arch/arm/kernel/vmlinux.lds.S
··· 80 80 *(.exit.text) 81 81 *(.exit.data) 82 82 *(.exitcall.exit) 83 + #ifndef CONFIG_MMU 84 + *(.fixup) 85 + *(__ex_table) 86 + #endif 83 87 } 84 88 85 89 .text : { /* Real text segment */ ··· 91 87 *(.text) 92 88 SCHED_TEXT 93 89 LOCK_TEXT 90 + #ifdef CONFIG_MMU 94 91 *(.fixup) 92 + #endif 95 93 *(.gnu.warning) 96 94 *(.rodata) 97 95 *(.rodata.*) ··· 148 142 */ 149 143 . = ALIGN(32); 150 144 __start___ex_table = .; 145 + #ifdef CONFIG_MMU 151 146 *(__ex_table) 147 + #endif 152 148 __stop___ex_table = .; 153 149 154 150 /*
+8 -5
arch/arm/lib/Makefile
··· 6 6 7 7 lib-y := backtrace.o changebit.o csumipv6.o csumpartial.o \ 8 8 csumpartialcopy.o csumpartialcopyuser.o clearbit.o \ 9 - copy_page.o delay.o findbit.o memchr.o memcpy.o \ 9 + delay.o findbit.o memchr.o memcpy.o \ 10 10 memmove.o memset.o memzero.o setbit.o \ 11 11 strncpy_from_user.o strnlen_user.o \ 12 12 strchr.o strrchr.o \ 13 13 testchangebit.o testclearbit.o testsetbit.o \ 14 - getuser.o putuser.o clear_user.o \ 15 14 ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \ 16 15 ucmpdi2.o lib1funcs.o div64.o sha1.o \ 17 16 io-readsb.o io-writesb.o io-readsl.o io-writesl.o 18 17 18 + mmu-y := clear_user.o copy_page.o getuser.o putuser.o 19 + 19 20 # the code in uaccess.S is not preemption safe and 20 21 # probably faster on ARMv3 only 21 22 ifeq ($(CONFIG_PREEMPT),y) 22 - lib-y += copy_from_user.o copy_to_user.o 23 + mmu-y += copy_from_user.o copy_to_user.o 23 24 else 24 25 ifneq ($(CONFIG_CPU_32v3),y) 25 - lib-y += copy_from_user.o copy_to_user.o 26 + mmu-y += copy_from_user.o copy_to_user.o 26 27 else 27 - lib-y += uaccess.o 28 + mmu-y += uaccess.o 28 29 endif 29 30 endif 31 + 32 + lib-$(CONFIG_MMU) += $(mmu-y) 30 33 31 34 ifeq ($(CONFIG_CPU_32v3),y) 32 35 lib-y += io-readsw-armv3.o io-writesw-armv3.o
+1 -4
arch/arm/lib/backtrace.S
··· 97 97 b 1007f 98 98 99 99 /* 100 - * Fixup for LDMDB 100 + * Fixup for LDMDB. Note that this must not be in the fixup section. 101 101 */ 102 - .section .fixup,"ax" 103 - .align 0 104 102 1007: ldr r0, =.Lbad 105 103 mov r1, frame 106 104 bl printk 107 105 ldmfd sp!, {r4 - r8, pc} 108 106 .ltorg 109 - .previous 110 107 111 108 .section __ex_table,"a" 112 109 .align 3
+35 -32
arch/arm/mm/Kconfig
··· 15 15 select CPU_32v3 16 16 select CPU_CACHE_V3 17 17 select CPU_CACHE_VIVT 18 - select CPU_COPY_V3 19 - select CPU_TLB_V3 18 + select CPU_COPY_V3 if MMU 19 + select CPU_TLB_V3 if MMU 20 20 help 21 21 The ARM610 is the successor to the ARM3 processor 22 22 and was produced by VLSI Technology Inc. ··· 31 31 select CPU_32v3 32 32 select CPU_CACHE_V3 33 33 select CPU_CACHE_VIVT 34 - select CPU_COPY_V3 35 - select CPU_TLB_V3 34 + select CPU_COPY_V3 if MMU 35 + select CPU_TLB_V3 if MMU 36 36 help 37 37 A 32-bit RISC microprocessor based on the ARM7 processor core 38 38 designed by Advanced RISC Machines Ltd. The ARM710 is the ··· 50 50 select CPU_ABRT_LV4T 51 51 select CPU_CACHE_V4 52 52 select CPU_CACHE_VIVT 53 - select CPU_COPY_V4WT 54 - select CPU_TLB_V4WT 53 + select CPU_COPY_V4WT if MMU 54 + select CPU_TLB_V4WT if MMU 55 55 help 56 56 A 32-bit RISC processor with 8kByte Cache, Write Buffer and 57 57 MMU built around an ARM7TDMI core. ··· 68 68 select CPU_ABRT_EV4T 69 69 select CPU_CACHE_V4WT 70 70 select CPU_CACHE_VIVT 71 - select CPU_COPY_V4WB 72 - select CPU_TLB_V4WBI 71 + select CPU_COPY_V4WB if MMU 72 + select CPU_TLB_V4WBI if MMU 73 73 help 74 74 The ARM920T is licensed to be produced by numerous vendors, 75 75 and is used in the Maverick EP9312 and the Samsung S3C2410. ··· 89 89 select CPU_ABRT_EV4T 90 90 select CPU_CACHE_V4WT 91 91 select CPU_CACHE_VIVT 92 - select CPU_COPY_V4WB 93 - select CPU_TLB_V4WBI 92 + select CPU_COPY_V4WB if MMU 93 + select CPU_TLB_V4WBI if MMU 94 94 help 95 95 The ARM922T is a version of the ARM920T, but with smaller 96 96 instruction and data caches. It is used in Altera's ··· 108 108 select CPU_ABRT_EV4T 109 109 select CPU_CACHE_V4WT 110 110 select CPU_CACHE_VIVT 111 - select CPU_COPY_V4WB 112 - select CPU_TLB_V4WBI 111 + select CPU_COPY_V4WB if MMU 112 + select CPU_TLB_V4WBI if MMU 113 113 help 114 114 The ARM925T is a mix between the ARM920T and ARM926T, but with 115 115 different instruction and data caches. It is used in TI's OMAP ··· 126 126 select CPU_32v5 127 127 select CPU_ABRT_EV5TJ 128 128 select CPU_CACHE_VIVT 129 - select CPU_COPY_V4WB 130 - select CPU_TLB_V4WBI 129 + select CPU_COPY_V4WB if MMU 130 + select CPU_TLB_V4WBI if MMU 131 131 help 132 132 This is a variant of the ARM920. It has slightly different 133 133 instruction sequences for cache and TLB operations. Curiously, ··· 144 144 select CPU_ABRT_EV4T 145 145 select CPU_CACHE_V4WT 146 146 select CPU_CACHE_VIVT 147 - select CPU_COPY_V4WB 148 - select CPU_TLB_V4WBI 147 + select CPU_COPY_V4WB if MMU 148 + select CPU_TLB_V4WBI if MMU 149 149 help 150 150 The ARM1020 is the 32K cached version of the ARM10 processor, 151 151 with an addition of a floating-point unit. ··· 161 161 select CPU_ABRT_EV4T 162 162 select CPU_CACHE_V4WT 163 163 select CPU_CACHE_VIVT 164 - select CPU_COPY_V4WB 165 - select CPU_TLB_V4WBI 164 + select CPU_COPY_V4WB if MMU 165 + select CPU_TLB_V4WBI if MMU 166 166 depends on n 167 167 168 168 # ARM1022E ··· 172 172 select CPU_32v5 173 173 select CPU_ABRT_EV4T 174 174 select CPU_CACHE_VIVT 175 - select CPU_COPY_V4WB # can probably do better 176 - select CPU_TLB_V4WBI 175 + select CPU_COPY_V4WB if MMU # can probably do better 176 + select CPU_TLB_V4WBI if MMU 177 177 help 178 178 The ARM1022E is an implementation of the ARMv5TE architecture 179 179 based upon the ARM10 integer core with a 16KiB L1 Harvard cache, ··· 189 189 select CPU_32v5 190 190 select CPU_ABRT_EV5T # But need Jazelle, but EV5TJ ignores bit 10 191 191 select CPU_CACHE_VIVT 192 - select CPU_COPY_V4WB # can probably do better 193 - select CPU_TLB_V4WBI 192 + select CPU_COPY_V4WB if MMU # can probably do better 193 + select CPU_TLB_V4WBI if MMU 194 194 help 195 195 The ARM1026EJ-S is an implementation of the ARMv5TEJ architecture 196 196 based upon the ARM10 integer core. ··· 207 207 select CPU_ABRT_EV4 208 208 select CPU_CACHE_V4WB 209 209 select CPU_CACHE_VIVT 210 - select CPU_COPY_V4WB 211 - select CPU_TLB_V4WB 210 + select CPU_COPY_V4WB if MMU 211 + select CPU_TLB_V4WB if MMU 212 212 help 213 213 The Intel StrongARM(R) SA-110 is a 32-bit microprocessor and 214 214 is available at five speeds ranging from 100 MHz to 233 MHz. ··· 227 227 select CPU_ABRT_EV4 228 228 select CPU_CACHE_V4WB 229 229 select CPU_CACHE_VIVT 230 - select CPU_TLB_V4WB 230 + select CPU_TLB_V4WB if MMU 231 231 232 232 # XScale 233 233 config CPU_XSCALE ··· 237 237 select CPU_32v5 238 238 select CPU_ABRT_EV5T 239 239 select CPU_CACHE_VIVT 240 - select CPU_TLB_V4WBI 240 + select CPU_TLB_V4WBI if MMU 241 241 242 242 # XScale Core Version 3 243 243 config CPU_XSC3 ··· 247 247 select CPU_32v5 248 248 select CPU_ABRT_EV5T 249 249 select CPU_CACHE_VIVT 250 - select CPU_TLB_V4WBI 250 + select CPU_TLB_V4WBI if MMU 251 251 select IO_36 252 252 253 253 # ARMv6 ··· 258 258 select CPU_ABRT_EV6 259 259 select CPU_CACHE_V6 260 260 select CPU_CACHE_VIPT 261 - select CPU_COPY_V6 262 - select CPU_TLB_V6 261 + select CPU_COPY_V6 if MMU 262 + select CPU_TLB_V6 if MMU 263 263 264 264 # ARMv6k 265 265 config CPU_32v6K ··· 277 277 # This defines the compiler instruction set which depends on the machine type. 278 278 config CPU_32v3 279 279 bool 280 - select TLS_REG_EMUL if SMP 280 + select TLS_REG_EMUL if SMP || !MMU 281 281 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP 282 282 283 283 config CPU_32v4 284 284 bool 285 - select TLS_REG_EMUL if SMP 285 + select TLS_REG_EMUL if SMP || !MMU 286 286 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP 287 287 288 288 config CPU_32v5 289 289 bool 290 - select TLS_REG_EMUL if SMP 290 + select TLS_REG_EMUL if SMP || !MMU 291 291 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP 292 292 293 293 config CPU_32v6 ··· 334 334 config CPU_CACHE_VIPT 335 335 bool 336 336 337 + if MMU 337 338 # The copy-page model 338 339 config CPU_COPY_V3 339 340 bool ··· 372 371 373 372 config CPU_TLB_V6 374 373 bool 374 + 375 + endif 375 376 376 377 # 377 378 # CPU supports 36-bit I/O
+8 -2
arch/arm/mm/Makefile
··· 2 2 # Makefile for the linux arm-specific parts of the memory manager. 3 3 # 4 4 5 - obj-y := consistent.o extable.o fault-armv.o \ 6 - fault.o flush.o init.o ioremap.o mmap.o \ 5 + obj-y := consistent.o extable.o fault.o init.o \ 6 + iomap.o 7 + 8 + obj-$(CONFIG_MMU) += fault-armv.o flush.o ioremap.o mmap.o \ 7 9 mm-armv.o 10 + 11 + ifneq ($(CONFIG_MMU),y) 12 + obj-y += nommu.o 13 + endif 8 14 9 15 obj-$(CONFIG_MODULES) += proc-syms.o 10 16
-2
arch/arm/mm/init.c
··· 26 26 #include <asm/mach/arch.h> 27 27 #include <asm/mach/map.h> 28 28 29 - #define TABLE_SIZE (2 * PTRS_PER_PTE * sizeof(pte_t)) 30 - 31 29 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 32 30 33 31 extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
+55
arch/arm/mm/iomap.c
··· 1 + /* 2 + * linux/arch/arm/mm/iomap.c 3 + * 4 + * Map IO port and PCI memory spaces so that {read,write}[bwl] can 5 + * be used to access this memory. 6 + */ 7 + #include <linux/module.h> 8 + #include <linux/pci.h> 9 + #include <linux/ioport.h> 10 + 11 + #include <asm/io.h> 12 + 13 + #ifdef __io 14 + void __iomem *ioport_map(unsigned long port, unsigned int nr) 15 + { 16 + return __io(port); 17 + } 18 + EXPORT_SYMBOL(ioport_map); 19 + 20 + void ioport_unmap(void __iomem *addr) 21 + { 22 + } 23 + EXPORT_SYMBOL(ioport_unmap); 24 + #endif 25 + 26 + #ifdef CONFIG_PCI 27 + void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) 28 + { 29 + unsigned long start = pci_resource_start(dev, bar); 30 + unsigned long len = pci_resource_len(dev, bar); 31 + unsigned long flags = pci_resource_flags(dev, bar); 32 + 33 + if (!len || !start) 34 + return NULL; 35 + if (maxlen && len > maxlen) 36 + len = maxlen; 37 + if (flags & IORESOURCE_IO) 38 + return ioport_map(start, len); 39 + if (flags & IORESOURCE_MEM) { 40 + if (flags & IORESOURCE_CACHEABLE) 41 + return ioremap(start, len); 42 + return ioremap_nocache(start, len); 43 + } 44 + return NULL; 45 + } 46 + EXPORT_SYMBOL(pci_iomap); 47 + 48 + void pci_iounmap(struct pci_dev *dev, void __iomem *addr) 49 + { 50 + if ((unsigned long)addr >= VMALLOC_START && 51 + (unsigned long)addr < VMALLOC_END) 52 + iounmap(addr); 53 + } 54 + EXPORT_SYMBOL(pci_iounmap); 55 + #endif
-47
arch/arm/mm/ioremap.c
··· 176 176 vunmap((void *)(PAGE_MASK & (unsigned long)addr)); 177 177 } 178 178 EXPORT_SYMBOL(__iounmap); 179 - 180 - #ifdef __io 181 - void __iomem *ioport_map(unsigned long port, unsigned int nr) 182 - { 183 - return __io(port); 184 - } 185 - EXPORT_SYMBOL(ioport_map); 186 - 187 - void ioport_unmap(void __iomem *addr) 188 - { 189 - } 190 - EXPORT_SYMBOL(ioport_unmap); 191 - #endif 192 - 193 - #ifdef CONFIG_PCI 194 - #include <linux/pci.h> 195 - #include <linux/ioport.h> 196 - 197 - void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) 198 - { 199 - unsigned long start = pci_resource_start(dev, bar); 200 - unsigned long len = pci_resource_len(dev, bar); 201 - unsigned long flags = pci_resource_flags(dev, bar); 202 - 203 - if (!len || !start) 204 - return NULL; 205 - if (maxlen && len > maxlen) 206 - len = maxlen; 207 - if (flags & IORESOURCE_IO) 208 - return ioport_map(start, len); 209 - if (flags & IORESOURCE_MEM) { 210 - if (flags & IORESOURCE_CACHEABLE) 211 - return ioremap(start, len); 212 - return ioremap_nocache(start, len); 213 - } 214 - return NULL; 215 - } 216 - EXPORT_SYMBOL(pci_iomap); 217 - 218 - void pci_iounmap(struct pci_dev *dev, void __iomem *addr) 219 - { 220 - if ((unsigned long)addr >= VMALLOC_START && 221 - (unsigned long)addr < VMALLOC_END) 222 - iounmap(addr); 223 - } 224 - EXPORT_SYMBOL(pci_iounmap); 225 - #endif
+39
arch/arm/mm/nommu.c
··· 1 + /* 2 + * linux/arch/arm/mm/nommu.c 3 + * 4 + * ARM uCLinux supporting functions. 5 + */ 6 + #include <linux/module.h> 7 + #include <linux/mm.h> 8 + #include <linux/pagemap.h> 9 + 10 + #include <asm/cacheflush.h> 11 + #include <asm/io.h> 12 + #include <asm/page.h> 13 + 14 + void flush_dcache_page(struct page *page) 15 + { 16 + __cpuc_flush_dcache_page(page_address(page)); 17 + } 18 + EXPORT_SYMBOL(flush_dcache_page); 19 + 20 + void __iomem *__ioremap_pfn(unsigned long pfn, unsigned long offset, 21 + size_t size, unsigned long flags) 22 + { 23 + if (pfn >= (0x100000000ULL >> PAGE_SHIFT)) 24 + return NULL; 25 + return (void __iomem *) (offset + (pfn << PAGE_SHIFT)); 26 + } 27 + EXPORT_SYMBOL(__ioremap_pfn); 28 + 29 + void __iomem *__ioremap(unsigned long phys_addr, size_t size, 30 + unsigned long flags) 31 + { 32 + return (void __iomem *)phys_addr; 33 + } 34 + EXPORT_SYMBOL(__ioremap); 35 + 36 + void __iounmap(void __iomem *addr) 37 + { 38 + } 39 + EXPORT_SYMBOL(__iounmap);
+9
arch/arm/mm/proc-arm1020.S
··· 3 3 * 4 4 * Copyright (C) 2000 ARM Limited 5 5 * Copyright (C) 2000 Deep Blue Solutions Ltd. 6 + * hacked for non-paged-MM by Hyok S. Choi, 2003. 6 7 * 7 8 * This program is free software; you can redistribute it and/or modify 8 9 * it under the terms of the GNU General Public License as published by ··· 102 101 mov ip, #0 103 102 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches 104 103 mcr p15, 0, ip, c7, c10, 4 @ drain WB 104 + #ifdef CONFIG_MMU 105 105 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs 106 + #endif 106 107 mrc p15, 0, ip, c1, c0, 0 @ ctrl register 107 108 bic ip, ip, #0x000f @ ............wcam 108 109 bic ip, ip, #0x1100 @ ...i...s........ ··· 362 359 */ 363 360 .align 5 364 361 ENTRY(cpu_arm1020_switch_mm) 362 + #ifdef CONFIG_MMU 365 363 #ifndef CONFIG_CPU_DCACHE_DISABLE 366 364 mcr p15, 0, r3, c7, c10, 4 367 365 mov r1, #0xF @ 16 segments ··· 387 383 mcr p15, 0, r1, c7, c10, 4 @ drain WB 388 384 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer 389 385 mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs 386 + #endif /* CONFIG_MMU */ 390 387 mov pc, lr 391 388 392 389 /* ··· 397 392 */ 398 393 .align 5 399 394 ENTRY(cpu_arm1020_set_pte) 395 + #ifdef CONFIG_MMU 400 396 str r1, [r0], #-2048 @ linux version 401 397 402 398 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY ··· 427 421 mcr p15, 0, r0, c7, c10, 1 @ clean D entry 428 422 #endif 429 423 mcr p15, 0, r0, c7, c10, 4 @ drain WB 424 + #endif /* CONFIG_MMU */ 430 425 mov pc, lr 431 426 432 427 __INIT ··· 437 430 mov r0, #0 438 431 mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 439 432 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 433 + #ifdef CONFIG_MMU 440 434 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 435 + #endif 441 436 mrc p15, 0, r0, c1, c0 @ get control register v4 442 437 ldr r5, arm1020_cr1_clear 443 438 bic r0, r0, r5
+9
arch/arm/mm/proc-arm1020e.S
··· 3 3 * 4 4 * Copyright (C) 2000 ARM Limited 5 5 * Copyright (C) 2000 Deep Blue Solutions Ltd. 6 + * hacked for non-paged-MM by Hyok S. Choi, 2003. 6 7 * 7 8 * This program is free software; you can redistribute it and/or modify 8 9 * it under the terms of the GNU General Public License as published by ··· 102 101 mov ip, #0 103 102 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches 104 103 mcr p15, 0, ip, c7, c10, 4 @ drain WB 104 + #ifdef CONFIG_MMU 105 105 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs 106 + #endif 106 107 mrc p15, 0, ip, c1, c0, 0 @ ctrl register 107 108 bic ip, ip, #0x000f @ ............wcam 108 109 bic ip, ip, #0x1100 @ ...i...s........ ··· 347 344 */ 348 345 .align 5 349 346 ENTRY(cpu_arm1020e_switch_mm) 347 + #ifdef CONFIG_MMU 350 348 #ifndef CONFIG_CPU_DCACHE_DISABLE 351 349 mcr p15, 0, r3, c7, c10, 4 352 350 mov r1, #0xF @ 16 segments ··· 371 367 mcr p15, 0, r1, c7, c10, 4 @ drain WB 372 368 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer 373 369 mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs 370 + #endif 374 371 mov pc, lr 375 372 376 373 /* ··· 381 376 */ 382 377 .align 5 383 378 ENTRY(cpu_arm1020e_set_pte) 379 + #ifdef CONFIG_MMU 384 380 str r1, [r0], #-2048 @ linux version 385 381 386 382 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY ··· 409 403 #ifndef CONFIG_CPU_DCACHE_DISABLE 410 404 mcr p15, 0, r0, c7, c10, 1 @ clean D entry 411 405 #endif 406 + #endif /* CONFIG_MMU */ 412 407 mov pc, lr 413 408 414 409 __INIT ··· 419 412 mov r0, #0 420 413 mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 421 414 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 415 + #ifdef CONFIG_MMU 422 416 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 417 + #endif 423 418 mrc p15, 0, r0, c1, c0 @ get control register v4 424 419 ldr r5, arm1020e_cr1_clear 425 420 bic r0, r0, r5
+9
arch/arm/mm/proc-arm1022.S
··· 3 3 * 4 4 * Copyright (C) 2000 ARM Limited 5 5 * Copyright (C) 2000 Deep Blue Solutions Ltd. 6 + * hacked for non-paged-MM by Hyok S. Choi, 2003. 6 7 * 7 8 * This program is free software; you can redistribute it and/or modify 8 9 * it under the terms of the GNU General Public License as published by ··· 91 90 mov ip, #0 92 91 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches 93 92 mcr p15, 0, ip, c7, c10, 4 @ drain WB 93 + #ifdef CONFIG_MMU 94 94 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs 95 + #endif 95 96 mrc p15, 0, ip, c1, c0, 0 @ ctrl register 96 97 bic ip, ip, #0x000f @ ............wcam 97 98 bic ip, ip, #0x1100 @ ...i...s........ ··· 336 333 */ 337 334 .align 5 338 335 ENTRY(cpu_arm1022_switch_mm) 336 + #ifdef CONFIG_MMU 339 337 #ifndef CONFIG_CPU_DCACHE_DISABLE 340 338 mov r1, #(CACHE_DSEGMENTS - 1) << 5 @ 16 segments 341 339 1: orr r3, r1, #(CACHE_DENTRIES - 1) << 26 @ 64 entries ··· 353 349 mcr p15, 0, r1, c7, c10, 4 @ drain WB 354 350 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer 355 351 mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs 352 + #endif 356 353 mov pc, lr 357 354 358 355 /* ··· 363 358 */ 364 359 .align 5 365 360 ENTRY(cpu_arm1022_set_pte) 361 + #ifdef CONFIG_MMU 366 362 str r1, [r0], #-2048 @ linux version 367 363 368 364 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY ··· 391 385 #ifndef CONFIG_CPU_DCACHE_DISABLE 392 386 mcr p15, 0, r0, c7, c10, 1 @ clean D entry 393 387 #endif 388 + #endif /* CONFIG_MMU */ 394 389 mov pc, lr 395 390 396 391 __INIT ··· 401 394 mov r0, #0 402 395 mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 403 396 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 397 + #ifdef CONFIG_MMU 404 398 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 399 + #endif 405 400 mrc p15, 0, r0, c1, c0 @ get control register v4 406 401 ldr r5, arm1022_cr1_clear 407 402 bic r0, r0, r5
+9
arch/arm/mm/proc-arm1026.S
··· 3 3 * 4 4 * Copyright (C) 2000 ARM Limited 5 5 * Copyright (C) 2000 Deep Blue Solutions Ltd. 6 + * hacked for non-paged-MM by Hyok S. Choi, 2003. 6 7 * 7 8 * This program is free software; you can redistribute it and/or modify 8 9 * it under the terms of the GNU General Public License as published by ··· 91 90 mov ip, #0 92 91 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches 93 92 mcr p15, 0, ip, c7, c10, 4 @ drain WB 93 + #ifdef CONFIG_MMU 94 94 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs 95 + #endif 95 96 mrc p15, 0, ip, c1, c0, 0 @ ctrl register 96 97 bic ip, ip, #0x000f @ ............wcam 97 98 bic ip, ip, #0x1100 @ ...i...s........ ··· 330 327 */ 331 328 .align 5 332 329 ENTRY(cpu_arm1026_switch_mm) 330 + #ifdef CONFIG_MMU 333 331 mov r1, #0 334 332 #ifndef CONFIG_CPU_DCACHE_DISABLE 335 333 1: mrc p15, 0, r15, c7, c14, 3 @ test, clean, invalidate ··· 342 338 mcr p15, 0, r1, c7, c10, 4 @ drain WB 343 339 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer 344 340 mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs 341 + #endif 345 342 mov pc, lr 346 343 347 344 /* ··· 352 347 */ 353 348 .align 5 354 349 ENTRY(cpu_arm1026_set_pte) 350 + #ifdef CONFIG_MMU 355 351 str r1, [r0], #-2048 @ linux version 356 352 357 353 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY ··· 380 374 #ifndef CONFIG_CPU_DCACHE_DISABLE 381 375 mcr p15, 0, r0, c7, c10, 1 @ clean D entry 382 376 #endif 377 + #endif /* CONFIG_MMU */ 383 378 mov pc, lr 384 379 385 380 ··· 391 384 mov r0, #0 392 385 mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 393 386 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 387 + #ifdef CONFIG_MMU 394 388 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 395 389 mcr p15, 0, r4, c2, c0 @ load page table pointer 390 + #endif 396 391 #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH 397 392 mov r0, #4 @ explicitly disable writeback 398 393 mcr p15, 7, r0, c15, c0, 0
+15
arch/arm/mm/proc-arm6_7.S
··· 2 2 * linux/arch/arm/mm/proc-arm6,7.S 3 3 * 4 4 * Copyright (C) 1997-2000 Russell King 5 + * hacked for non-paged-MM by Hyok S. Choi, 2003. 5 6 * 6 7 * This program is free software; you can redistribute it and/or modify 7 8 * it under the terms of the GNU General Public License version 2 as ··· 200 199 */ 201 200 ENTRY(cpu_arm6_switch_mm) 202 201 ENTRY(cpu_arm7_switch_mm) 202 + #ifdef CONFIG_MMU 203 203 mov r1, #0 204 204 mcr p15, 0, r1, c7, c0, 0 @ flush cache 205 205 mcr p15, 0, r0, c2, c0, 0 @ update page table ptr 206 206 mcr p15, 0, r1, c5, c0, 0 @ flush TLBs 207 + #endif 207 208 mov pc, lr 208 209 209 210 /* ··· 217 214 .align 5 218 215 ENTRY(cpu_arm6_set_pte) 219 216 ENTRY(cpu_arm7_set_pte) 217 + #ifdef CONFIG_MMU 220 218 str r1, [r0], #-2048 @ linux version 221 219 222 220 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY ··· 236 232 movne r2, #0 237 233 238 234 str r2, [r0] @ hardware version 235 + #endif /* CONFIG_MMU */ 239 236 mov pc, lr 240 237 241 238 /* ··· 248 243 ENTRY(cpu_arm7_reset) 249 244 mov r1, #0 250 245 mcr p15, 0, r1, c7, c0, 0 @ flush cache 246 + #ifdef CONFIG_MMU 251 247 mcr p15, 0, r1, c5, c0, 0 @ flush TLB 248 + #endif 252 249 mov r1, #0x30 253 250 mcr p15, 0, r1, c1, c0, 0 @ turn off MMU etc 254 251 mov pc, r0 ··· 260 253 .type __arm6_setup, #function 261 254 __arm6_setup: mov r0, #0 262 255 mcr p15, 0, r0, c7, c0 @ flush caches on v3 256 + #ifdef CONFIG_MMU 263 257 mcr p15, 0, r0, c5, c0 @ flush TLBs on v3 264 258 mov r0, #0x3d @ . ..RS BLDP WCAM 265 259 orr r0, r0, #0x100 @ . ..01 0011 1101 260 + #else 261 + mov r0, #0x3c @ . ..RS BLDP WCA. 262 + #endif 266 263 mov pc, lr 267 264 .size __arm6_setup, . - __arm6_setup 268 265 269 266 .type __arm7_setup, #function 270 267 __arm7_setup: mov r0, #0 271 268 mcr p15, 0, r0, c7, c0 @ flush caches on v3 269 + #ifdef CONFIG_MMU 272 270 mcr p15, 0, r0, c5, c0 @ flush TLBs on v3 273 271 mcr p15, 0, r0, c3, c0 @ load domain access register 274 272 mov r0, #0x7d @ . ..RS BLDP WCAM 275 273 orr r0, r0, #0x100 @ . ..01 0111 1101 274 + #else 275 + mov r0, #0x7c @ . ..RS BLDP WCA. 276 + #endif 276 277 mov pc, lr 277 278 .size __arm7_setup, . - __arm7_setup 278 279
+12
arch/arm/mm/proc-arm720.S
··· 4 4 * Copyright (C) 2000 Steve Hill (sjhill@cotw.com) 5 5 * Rob Scott (rscott@mtrob.fdns.net) 6 6 * Copyright (C) 2000 ARM Limited, Deep Blue Solutions Ltd. 7 + * hacked for non-paged-MM by Hyok S. Choi, 2004. 7 8 * 8 9 * This program is free software; you can redistribute it and/or modify 9 10 * it under the terms of the GNU General Public License as published by ··· 30 29 * out of 'proc-arm6,7.S' per RMK discussion 31 30 * 07-25-2000 SJH Added idle function. 32 31 * 08-25-2000 DBS Updated for integration of ARM Ltd version. 32 + * 04-20-2004 HSC modified for non-paged memory management mode. 33 33 */ 34 34 #include <linux/linkage.h> 35 35 #include <linux/init.h> ··· 77 75 * the new. 78 76 */ 79 77 ENTRY(cpu_arm720_switch_mm) 78 + #ifdef CONFIG_MMU 80 79 mov r1, #0 81 80 mcr p15, 0, r1, c7, c7, 0 @ invalidate cache 82 81 mcr p15, 0, r0, c2, c0, 0 @ update page table ptr 83 82 mcr p15, 0, r1, c8, c7, 0 @ flush TLB (v4) 83 + #endif 84 84 mov pc, lr 85 85 86 86 /* ··· 93 89 */ 94 90 .align 5 95 91 ENTRY(cpu_arm720_set_pte) 92 + #ifdef CONFIG_MMU 96 93 str r1, [r0], #-2048 @ linux version 97 94 98 95 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY ··· 112 107 movne r2, #0 113 108 114 109 str r2, [r0] @ hardware version 110 + #endif 115 111 mov pc, lr 116 112 117 113 /* ··· 123 117 ENTRY(cpu_arm720_reset) 124 118 mov ip, #0 125 119 mcr p15, 0, ip, c7, c7, 0 @ invalidate cache 120 + #ifdef CONFIG_MMU 126 121 mcr p15, 0, ip, c8, c7, 0 @ flush TLB (v4) 122 + #endif 127 123 mrc p15, 0, ip, c1, c0, 0 @ get ctrl register 128 124 bic ip, ip, #0x000f @ ............wcam 129 125 bic ip, ip, #0x2100 @ ..v....s........ ··· 138 130 __arm710_setup: 139 131 mov r0, #0 140 132 mcr p15, 0, r0, c7, c7, 0 @ invalidate caches 133 + #ifdef CONFIG_MMU 141 134 mcr p15, 0, r0, c8, c7, 0 @ flush TLB (v4) 135 + #endif 142 136 mrc p15, 0, r0, c1, c0 @ get control register 143 137 ldr r5, arm710_cr1_clear 144 138 bic r0, r0, r5 ··· 166 156 __arm720_setup: 167 157 mov r0, #0 168 158 mcr p15, 0, r0, c7, c7, 0 @ invalidate caches 159 + #ifdef CONFIG_MMU 169 160 mcr p15, 0, r0, c8, c7, 0 @ flush TLB (v4) 161 + #endif 170 162 mrc p15, 0, r0, c1, c0 @ get control register 171 163 ldr r5, arm720_cr1_clear 172 164 bic r0, r0, r5
+9
arch/arm/mm/proc-arm920.S
··· 3 3 * 4 4 * Copyright (C) 1999,2000 ARM Limited 5 5 * Copyright (C) 2000 Deep Blue Solutions Ltd. 6 + * hacked for non-paged-MM by Hyok S. Choi, 2003. 6 7 * 7 8 * This program is free software; you can redistribute it and/or modify 8 9 * it under the terms of the GNU General Public License as published by ··· 98 97 mov ip, #0 99 98 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches 100 99 mcr p15, 0, ip, c7, c10, 4 @ drain WB 100 + #ifdef CONFIG_MMU 101 101 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs 102 + #endif 102 103 mrc p15, 0, ip, c1, c0, 0 @ ctrl register 103 104 bic ip, ip, #0x000f @ ............wcam 104 105 bic ip, ip, #0x1100 @ ...i...s........ ··· 320 317 */ 321 318 .align 5 322 319 ENTRY(cpu_arm920_switch_mm) 320 + #ifdef CONFIG_MMU 323 321 mov ip, #0 324 322 #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH 325 323 mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache ··· 341 337 mcr p15, 0, ip, c7, c10, 4 @ drain WB 342 338 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer 343 339 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs 340 + #endif 344 341 mov pc, lr 345 342 346 343 /* ··· 351 346 */ 352 347 .align 5 353 348 ENTRY(cpu_arm920_set_pte) 349 + #ifdef CONFIG_MMU 354 350 str r1, [r0], #-2048 @ linux version 355 351 356 352 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY ··· 378 372 mov r0, r0 379 373 mcr p15, 0, r0, c7, c10, 1 @ clean D entry 380 374 mcr p15, 0, r0, c7, c10, 4 @ drain WB 375 + #endif /* CONFIG_MMU */ 381 376 mov pc, lr 382 377 383 378 __INIT ··· 388 381 mov r0, #0 389 382 mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 390 383 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 384 + #ifdef CONFIG_MMU 391 385 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 386 + #endif 392 387 mrc p15, 0, r0, c1, c0 @ get control register v4 393 388 ldr r5, arm920_cr1_clear 394 389 bic r0, r0, r5
+9
arch/arm/mm/proc-arm922.S
··· 4 4 * Copyright (C) 1999,2000 ARM Limited 5 5 * Copyright (C) 2000 Deep Blue Solutions Ltd. 6 6 * Copyright (C) 2001 Altera Corporation 7 + * hacked for non-paged-MM by Hyok S. Choi, 2003. 7 8 * 8 9 * This program is free software; you can redistribute it and/or modify 9 10 * it under the terms of the GNU General Public License as published by ··· 100 99 mov ip, #0 101 100 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches 102 101 mcr p15, 0, ip, c7, c10, 4 @ drain WB 102 + #ifdef CONFIG_MMU 103 103 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs 104 + #endif 104 105 mrc p15, 0, ip, c1, c0, 0 @ ctrl register 105 106 bic ip, ip, #0x000f @ ............wcam 106 107 bic ip, ip, #0x1100 @ ...i...s........ ··· 324 321 */ 325 322 .align 5 326 323 ENTRY(cpu_arm922_switch_mm) 324 + #ifdef CONFIG_MMU 327 325 mov ip, #0 328 326 #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH 329 327 mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache ··· 345 341 mcr p15, 0, ip, c7, c10, 4 @ drain WB 346 342 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer 347 343 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs 344 + #endif 348 345 mov pc, lr 349 346 350 347 /* ··· 355 350 */ 356 351 .align 5 357 352 ENTRY(cpu_arm922_set_pte) 353 + #ifdef CONFIG_MMU 358 354 str r1, [r0], #-2048 @ linux version 359 355 360 356 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY ··· 382 376 mov r0, r0 383 377 mcr p15, 0, r0, c7, c10, 1 @ clean D entry 384 378 mcr p15, 0, r0, c7, c10, 4 @ drain WB 379 + #endif /* CONFIG_MMU */ 385 380 mov pc, lr 386 381 387 382 __INIT ··· 392 385 mov r0, #0 393 386 mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 394 387 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 388 + #ifdef CONFIG_MMU 395 389 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 390 + #endif 396 391 mrc p15, 0, r0, c1, c0 @ get control register v4 397 392 ldr r5, arm922_cr1_clear 398 393 bic r0, r0, r5
+10
arch/arm/mm/proc-arm925.S
··· 9 9 * Update for Linux-2.6 and cache flush improvements 10 10 * Copyright (C) 2004 Nokia Corporation by Tony Lindgren <tony@atomide.com> 11 11 * 12 + * hacked for non-paged-MM by Hyok S. Choi, 2004. 13 + * 12 14 * This program is free software; you can redistribute it and/or modify 13 15 * it under the terms of the GNU General Public License as published by 14 16 * the Free Software Foundation; either version 2 of the License, or ··· 124 122 mov ip, #0 125 123 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches 126 124 mcr p15, 0, ip, c7, c10, 4 @ drain WB 125 + #ifdef CONFIG_MMU 127 126 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs 127 + #endif 128 128 mrc p15, 0, ip, c1, c0, 0 @ ctrl register 129 129 bic ip, ip, #0x000f @ ............wcam 130 130 bic ip, ip, #0x1100 @ ...i...s........ ··· 373 369 */ 374 370 .align 5 375 371 ENTRY(cpu_arm925_switch_mm) 372 + #ifdef CONFIG_MMU 376 373 mov ip, #0 377 374 #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH 378 375 mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache ··· 388 383 mcr p15, 0, ip, c7, c10, 4 @ drain WB 389 384 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer 390 385 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs 386 + #endif 391 387 mov pc, lr 392 388 393 389 /* ··· 398 392 */ 399 393 .align 5 400 394 ENTRY(cpu_arm925_set_pte) 395 + #ifdef CONFIG_MMU 401 396 str r1, [r0], #-2048 @ linux version 402 397 403 398 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY ··· 427 420 mcr p15, 0, r0, c7, c10, 1 @ clean D entry 428 421 #endif 429 422 mcr p15, 0, r0, c7, c10, 4 @ drain WB 423 + #endif /* CONFIG_MMU */ 430 424 mov pc, lr 431 425 432 426 __INIT ··· 446 438 mov r0, #0 447 439 mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 448 440 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 441 + #ifdef CONFIG_MMU 449 442 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 443 + #endif 450 444 451 445 #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH 452 446 mov r0, #4 @ disable write-back on caches explicitly
+9
arch/arm/mm/proc-arm926.S
··· 3 3 * 4 4 * Copyright (C) 1999-2001 ARM Limited 5 5 * Copyright (C) 2000 Deep Blue Solutions Ltd. 6 + * hacked for non-paged-MM by Hyok S. Choi, 2003. 6 7 * 7 8 * This program is free software; you can redistribute it and/or modify 8 9 * it under the terms of the GNU General Public License as published by ··· 86 85 mov ip, #0 87 86 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches 88 87 mcr p15, 0, ip, c7, c10, 4 @ drain WB 88 + #ifdef CONFIG_MMU 89 89 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs 90 + #endif 90 91 mrc p15, 0, ip, c1, c0, 0 @ ctrl register 91 92 bic ip, ip, #0x000f @ ............wcam 92 93 bic ip, ip, #0x1100 @ ...i...s........ ··· 332 329 */ 333 330 .align 5 334 331 ENTRY(cpu_arm926_switch_mm) 332 + #ifdef CONFIG_MMU 335 333 mov ip, #0 336 334 #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH 337 335 mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache ··· 345 341 mcr p15, 0, ip, c7, c10, 4 @ drain WB 346 342 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer 347 343 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs 344 + #endif 348 345 mov pc, lr 349 346 350 347 /* ··· 355 350 */ 356 351 .align 5 357 352 ENTRY(cpu_arm926_set_pte) 353 + #ifdef CONFIG_MMU 358 354 str r1, [r0], #-2048 @ linux version 359 355 360 356 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY ··· 384 378 mcr p15, 0, r0, c7, c10, 1 @ clean D entry 385 379 #endif 386 380 mcr p15, 0, r0, c7, c10, 4 @ drain WB 381 + #endif 387 382 mov pc, lr 388 383 389 384 __INIT ··· 394 387 mov r0, #0 395 388 mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 396 389 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 390 + #ifdef CONFIG_MMU 397 391 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 392 + #endif 398 393 399 394 400 395 #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
+11
arch/arm/mm/proc-sa110.S
··· 2 2 * linux/arch/arm/mm/proc-sa110.S 3 3 * 4 4 * Copyright (C) 1997-2002 Russell King 5 + * hacked for non-paged-MM by Hyok S. Choi, 2003. 5 6 * 6 7 * This program is free software; you can redistribute it and/or modify 7 8 * it under the terms of the GNU General Public License version 2 as ··· 68 67 mov ip, #0 69 68 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches 70 69 mcr p15, 0, ip, c7, c10, 4 @ drain WB 70 + #ifdef CONFIG_MMU 71 71 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs 72 + #endif 72 73 mrc p15, 0, ip, c1, c0, 0 @ ctrl register 73 74 bic ip, ip, #0x000f @ ............wcam 74 75 bic ip, ip, #0x1100 @ ...i...s........ ··· 133 130 */ 134 131 .align 5 135 132 ENTRY(cpu_sa110_switch_mm) 133 + #ifdef CONFIG_MMU 136 134 str lr, [sp, #-4]! 137 135 bl v4wb_flush_kern_cache_all @ clears IP 138 136 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer 139 137 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs 140 138 ldr pc, [sp], #4 139 + #else 140 + mov pc, lr 141 + #endif 141 142 142 143 /* 143 144 * cpu_sa110_set_pte(ptep, pte) ··· 150 143 */ 151 144 .align 5 152 145 ENTRY(cpu_sa110_set_pte) 146 + #ifdef CONFIG_MMU 153 147 str r1, [r0], #-2048 @ linux version 154 148 155 149 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY ··· 172 164 mov r0, r0 173 165 mcr p15, 0, r0, c7, c10, 1 @ clean D entry 174 166 mcr p15, 0, r0, c7, c10, 4 @ drain WB 167 + #endif 175 168 mov pc, lr 176 169 177 170 __INIT ··· 182 173 mov r10, #0 183 174 mcr p15, 0, r10, c7, c7 @ invalidate I,D caches on v4 184 175 mcr p15, 0, r10, c7, c10, 4 @ drain write buffer on v4 176 + #ifdef CONFIG_MMU 185 177 mcr p15, 0, r10, c8, c7 @ invalidate I,D TLBs on v4 178 + #endif 186 179 mrc p15, 0, r0, c1, c0 @ get control register v4 187 180 ldr r5, sa110_cr1_clear 188 181 bic r0, r0, r5
+11
arch/arm/mm/proc-sa1100.S
··· 2 2 * linux/arch/arm/mm/proc-sa1100.S 3 3 * 4 4 * Copyright (C) 1997-2002 Russell King 5 + * hacked for non-paged-MM by Hyok S. Choi, 2003. 5 6 * 6 7 * This program is free software; you can redistribute it and/or modify 7 8 * it under the terms of the GNU General Public License version 2 as ··· 78 77 mov ip, #0 79 78 mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches 80 79 mcr p15, 0, ip, c7, c10, 4 @ drain WB 80 + #ifdef CONFIG_MMU 81 81 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs 82 + #endif 82 83 mrc p15, 0, ip, c1, c0, 0 @ ctrl register 83 84 bic ip, ip, #0x000f @ ............wcam 84 85 bic ip, ip, #0x1100 @ ...i...s........ ··· 145 142 */ 146 143 .align 5 147 144 ENTRY(cpu_sa1100_switch_mm) 145 + #ifdef CONFIG_MMU 148 146 str lr, [sp, #-4]! 149 147 bl v4wb_flush_kern_cache_all @ clears IP 150 148 mcr p15, 0, ip, c9, c0, 0 @ invalidate RB 151 149 mcr p15, 0, r0, c2, c0, 0 @ load page table pointer 152 150 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs 153 151 ldr pc, [sp], #4 152 + #else 153 + mov pc, lr 154 + #endif 154 155 155 156 /* 156 157 * cpu_sa1100_set_pte(ptep, pte) ··· 163 156 */ 164 157 .align 5 165 158 ENTRY(cpu_sa1100_set_pte) 159 + #ifdef CONFIG_MMU 166 160 str r1, [r0], #-2048 @ linux version 167 161 168 162 eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY ··· 185 177 mov r0, r0 186 178 mcr p15, 0, r0, c7, c10, 1 @ clean D entry 187 179 mcr p15, 0, r0, c7, c10, 4 @ drain WB 180 + #endif 188 181 mov pc, lr 189 182 190 183 __INIT ··· 195 186 mov r0, #0 196 187 mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 197 188 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 189 + #ifdef CONFIG_MMU 198 190 mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 191 + #endif 199 192 mrc p15, 0, r0, c1, c0 @ get control register v4 200 193 ldr r5, sa1100_cr1_clear 201 194 bic r0, r0, r5
+7
arch/arm/mm/proc-v6.S
··· 2 2 * linux/arch/arm/mm/proc-v6.S 3 3 * 4 4 * Copyright (C) 2001 Deep Blue Solutions Ltd. 5 + * Modified by Catalin Marinas for noMMU support 5 6 * 6 7 * This program is free software; you can redistribute it and/or modify 7 8 * it under the terms of the GNU General Public License version 2 as ··· 89 88 * - we are not using split page tables 90 89 */ 91 90 ENTRY(cpu_v6_switch_mm) 91 + #ifdef CONFIG_MMU 92 92 mov r2, #0 93 93 ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id 94 94 #ifdef CONFIG_SMP ··· 99 97 mcr p15, 0, r2, c7, c10, 4 @ drain write buffer 100 98 mcr p15, 0, r0, c2, c0, 0 @ set TTB 0 101 99 mcr p15, 0, r1, c13, c0, 1 @ set context ID 100 + #endif 102 101 mov pc, lr 103 102 104 103 /* ··· 122 119 * 1111 0 1 1 r/w r/w 123 120 */ 124 121 ENTRY(cpu_v6_set_pte) 122 + #ifdef CONFIG_MMU 125 123 str r1, [r0], #-2048 @ linux version 126 124 127 125 bic r2, r1, #0x000003f0 ··· 149 145 150 146 str r2, [r0] 151 147 mcr p15, 0, r0, c7, c10, 1 @ flush_pte 148 + #endif 152 149 mov pc, lr 153 150 154 151 ··· 199 194 mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache 200 195 mcr p15, 0, r0, c7, c15, 0 @ clean+invalidate cache 201 196 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer 197 + #ifdef CONFIG_MMU 202 198 mcr p15, 0, r0, c8, c7, 0 @ invalidate I + D TLBs 203 199 mcr p15, 0, r0, c2, c0, 2 @ TTB control register 204 200 #ifdef CONFIG_SMP 205 201 orr r4, r4, #TTB_RGN_WBWA|TTB_S @ mark PTWs shared, outer cacheable 206 202 #endif 207 203 mcr p15, 0, r4, c2, c0, 1 @ load TTB1 204 + #endif /* CONFIG_MMU */ 208 205 #ifdef CONFIG_VFP 209 206 mrc p15, 0, r0, c1, c0, 2 210 207 orr r0, r0, #(0xf << 20)
+4
include/asm-arm/bugs.h
··· 10 10 #ifndef __ASM_BUGS_H 11 11 #define __ASM_BUGS_H 12 12 13 + #ifdef CONFIG_MMU 13 14 extern void check_writebuffer_bugs(void); 14 15 15 16 #define check_bugs() check_writebuffer_bugs() 17 + #else 18 + #define check_bugs() do { } while (0) 19 + #endif 16 20 17 21 #endif
+7
include/asm-arm/domain.h
··· 50 50 #define domain_val(dom,type) ((type) << (2*(dom))) 51 51 52 52 #ifndef __ASSEMBLY__ 53 + 54 + #ifdef CONFIG_MMU 53 55 #define set_domain(x) \ 54 56 do { \ 55 57 __asm__ __volatile__( \ ··· 67 65 thread->cpu_domain = domain | domain_val(dom, type); \ 68 66 set_domain(thread->cpu_domain); \ 69 67 } while (0) 68 + 69 + #else 70 + #define set_domain(x) do { } while (0) 71 + #define modify_domain(dom,type) do { } while (0) 72 + #endif 70 73 71 74 #endif 72 75 #endif /* !__ASSEMBLY__ */
+4 -5
include/asm-arm/mach/map.h
··· 16 16 unsigned int type; 17 17 }; 18 18 19 - struct meminfo; 20 - 21 19 #define MT_DEVICE 0 22 20 #define MT_CACHECLEAN 1 23 21 #define MT_MINICLEAN 2 ··· 26 28 #define MT_IXP2000_DEVICE 7 27 29 #define MT_NONSHARED_DEVICE 8 28 30 29 - extern void create_memmap_holes(struct meminfo *); 30 - extern void memtable_init(struct meminfo *); 31 + #ifdef CONFIG_MMU 31 32 extern void iotable_init(struct map_desc *, int); 32 - extern void setup_io_desc(void); 33 + #else 34 + #define iotable_init(map,num) do { } while (0) 35 + #endif
+57 -18
include/asm-arm/memory.h
··· 2 2 * linux/include/asm-arm/memory.h 3 3 * 4 4 * Copyright (C) 2000-2002 Russell King 5 + * modification for nommu, Hyok S. Choi, 2004 5 6 * 6 7 * This program is free software; you can redistribute it and/or modify 7 8 * it under the terms of the GNU General Public License version 2 as ··· 27 26 #include <asm/arch/memory.h> 28 27 #include <asm/sizes.h> 29 28 29 + #ifdef CONFIG_MMU 30 + 30 31 #ifndef TASK_SIZE 31 32 /* 32 33 * TASK_SIZE - the maximum size of a user space task. ··· 49 46 #ifndef PAGE_OFFSET 50 47 #define PAGE_OFFSET UL(0xc0000000) 51 48 #endif 49 + 50 + /* 51 + * The module space lives between the addresses given by TASK_SIZE 52 + * and PAGE_OFFSET - it must be within 32MB of the kernel text. 53 + */ 54 + #define MODULE_END (PAGE_OFFSET) 55 + #define MODULE_START (MODULE_END - 16*1048576) 56 + 57 + #if TASK_SIZE > MODULE_START 58 + #error Top of user space clashes with start of module space 59 + #endif 60 + 61 + /* 62 + * The XIP kernel gets mapped at the bottom of the module vm area. 63 + * Since we use sections to map it, this macro replaces the physical address 64 + * with its virtual address while keeping offset from the base section. 65 + */ 66 + #define XIP_VIRT_ADDR(physaddr) (MODULE_START + ((physaddr) & 0x000fffff)) 67 + 68 + #else /* CONFIG_MMU */ 69 + 70 + /* 71 + * The limitation of user task size can grow up to the end of free ram region. 72 + * It is difficult to define and perhaps will never meet the original meaning 73 + * of this define that was meant to. 74 + * Fortunately, there is no reference for this in noMMU mode, for now. 75 + */ 76 + #ifndef TASK_SIZE 77 + #define TASK_SIZE (CONFIG_DRAM_SIZE) 78 + #endif 79 + 80 + #ifndef TASK_UNMAPPED_BASE 81 + #define TASK_UNMAPPED_BASE UL(0x00000000) 82 + #endif 83 + 84 + #ifndef PHYS_OFFSET 85 + #define PHYS_OFFSET (CONFIG_DRAM_BASE) 86 + #endif 87 + 88 + #ifndef END_MEM 89 + #define END_MEM (CONFIG_DRAM_BASE + CONFIG_DRAM_SIZE) 90 + #endif 91 + 92 + #ifndef PAGE_OFFSET 93 + #define PAGE_OFFSET (PHYS_OFFSET) 94 + #endif 95 + 96 + /* 97 + * The module can be at any place in ram in nommu mode. 98 + */ 99 + #define MODULE_END (END_MEM) 100 + #define MODULE_START (PHYS_OFFSET) 101 + 102 + #endif /* !CONFIG_MMU */ 52 103 53 104 /* 54 105 * Size of DMA-consistent memory region. Must be multiple of 2M, ··· 127 70 */ 128 71 #define __phys_to_pfn(paddr) ((paddr) >> PAGE_SHIFT) 129 72 #define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT) 130 - 131 - /* 132 - * The module space lives between the addresses given by TASK_SIZE 133 - * and PAGE_OFFSET - it must be within 32MB of the kernel text. 134 - */ 135 - #define MODULE_END (PAGE_OFFSET) 136 - #define MODULE_START (MODULE_END - 16*1048576) 137 - 138 - #if TASK_SIZE > MODULE_START 139 - #error Top of user space clashes with start of module space 140 - #endif 141 - 142 - /* 143 - * The XIP kernel gets mapped at the bottom of the module vm area. 144 - * Since we use sections to map it, this macro replaces the physical address 145 - * with its virtual address while keeping offset from the base section. 146 - */ 147 - #define XIP_VIRT_ADDR(physaddr) (MODULE_START + ((physaddr) & 0x000fffff)) 148 73 149 74 #ifndef __ASSEMBLY__ 150 75
+16
include/asm-arm/mmu.h
··· 1 1 #ifndef __ARM_MMU_H 2 2 #define __ARM_MMU_H 3 3 4 + #ifdef CONFIG_MMU 5 + 4 6 typedef struct { 5 7 #if __LINUX_ARM_ARCH__ >= 6 6 8 unsigned int id; ··· 13 11 #define ASID(mm) ((mm)->context.id & 255) 14 12 #else 15 13 #define ASID(mm) (0) 14 + #endif 15 + 16 + #else 17 + 18 + /* 19 + * From nommu.h: 20 + * Copyright (C) 2002, David McCullough <davidm@snapgear.com> 21 + * modified for 2.6 by Hyok S. Choi <hyok.choi@samsung.com> 22 + */ 23 + typedef struct { 24 + struct vm_list_struct *vmlist; 25 + unsigned long end_brk; 26 + } mm_context_t; 27 + 16 28 #endif 17 29 18 30 #endif
+2
include/asm-arm/mmu_context.h
··· 82 82 switch_mm(struct mm_struct *prev, struct mm_struct *next, 83 83 struct task_struct *tsk) 84 84 { 85 + #ifdef CONFIG_MMU 85 86 unsigned int cpu = smp_processor_id(); 86 87 87 88 if (prev != next) { ··· 92 91 if (cache_is_vivt()) 93 92 cpu_clear(cpu, prev->cpu_vm_mask); 94 93 } 94 + #endif 95 95 } 96 96 97 97 #define deactivate_mm(tsk,mm) do { } while (0)
+51
include/asm-arm/page-nommu.h
··· 1 + /* 2 + * linux/include/asm-arm/page-nommu.h 3 + * 4 + * Copyright (C) 2004 Hyok S. Choi 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License version 2 as 8 + * published by the Free Software Foundation. 9 + */ 10 + #ifndef _ASMARM_PAGE_NOMMU_H 11 + #define _ASMARM_PAGE_NOMMU_H 12 + 13 + #if !defined(CONFIG_SMALL_TASKS) && PAGE_SHIFT < 13 14 + #define KTHREAD_SIZE (8192) 15 + #else 16 + #define KTHREAD_SIZE PAGE_SIZE 17 + #endif 18 + 19 + #define get_user_page(vaddr) __get_free_page(GFP_KERNEL) 20 + #define free_user_page(page, addr) free_page(addr) 21 + 22 + #define clear_page(page) memset((page), 0, PAGE_SIZE) 23 + #define copy_page(to,from) memcpy((to), (from), PAGE_SIZE) 24 + 25 + #define clear_user_page(page, vaddr, pg) clear_page(page) 26 + #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) 27 + 28 + /* 29 + * These are used to make use of C type-checking.. 30 + */ 31 + typedef unsigned long pte_t; 32 + typedef unsigned long pmd_t; 33 + typedef unsigned long pgd_t[2]; 34 + typedef unsigned long pgprot_t; 35 + 36 + #define pte_val(x) (x) 37 + #define pmd_val(x) (x) 38 + #define pgd_val(x) ((x)[0]) 39 + #define pgprot_val(x) (x) 40 + 41 + #define __pte(x) (x) 42 + #define __pmd(x) (x) 43 + #define __pgprot(x) (x) 44 + 45 + /* to align the pointer to the (next) page boundary */ 46 + #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) 47 + 48 + extern unsigned long memory_start; 49 + extern unsigned long memory_end; 50 + 51 + #endif
+8
include/asm-arm/page.h
··· 23 23 24 24 #ifndef __ASSEMBLY__ 25 25 26 + #ifndef CONFIG_MMU 27 + 28 + #include "page-nommu.h" 29 + 30 + #else 31 + 26 32 #include <asm/glue.h> 27 33 28 34 /* ··· 176 170 177 171 /* the upper-most page table pointer */ 178 172 extern pmd_t *top_pmd; 173 + 174 + #endif /* CONFIG_MMU */ 179 175 180 176 #include <asm/memory.h> 181 177
+6 -2
include/asm-arm/pgalloc.h
··· 16 16 #include <asm/cacheflush.h> 17 17 #include <asm/tlbflush.h> 18 18 19 + #define check_pgt_cache() do { } while (0) 20 + 21 + #ifdef CONFIG_MMU 22 + 19 23 #define _PAGE_USER_TABLE (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_USER)) 20 24 #define _PAGE_KERNEL_TABLE (PMD_TYPE_TABLE | PMD_BIT4 | PMD_DOMAIN(DOMAIN_KERNEL)) 21 25 ··· 35 31 36 32 #define pgd_alloc(mm) get_pgd_slow(mm) 37 33 #define pgd_free(pgd) free_pgd_slow(pgd) 38 - 39 - #define check_pgt_cache() do { } while (0) 40 34 41 35 /* 42 36 * Allocate one PTE table. ··· 127 125 { 128 126 __pmd_populate(pmdp, page_to_pfn(ptep) << PAGE_SHIFT | _PAGE_USER_TABLE); 129 127 } 128 + 129 + #endif /* CONFIG_MMU */ 130 130 131 131 #endif
+123
include/asm-arm/pgtable-nommu.h
··· 1 + /* 2 + * linux/include/asm-arm/pgtable-nommu.h 3 + * 4 + * Copyright (C) 1995-2002 Russell King 5 + * Copyright (C) 2004 Hyok S. Choi 6 + * 7 + * This program is free software; you can redistribute it and/or modify 8 + * it under the terms of the GNU General Public License version 2 as 9 + * published by the Free Software Foundation. 10 + */ 11 + #ifndef _ASMARM_PGTABLE_NOMMU_H 12 + #define _ASMARM_PGTABLE_NOMMU_H 13 + 14 + #ifndef __ASSEMBLY__ 15 + 16 + #include <linux/config.h> 17 + #include <linux/slab.h> 18 + #include <asm/processor.h> 19 + #include <asm/page.h> 20 + #include <asm/io.h> 21 + 22 + /* 23 + * Trivial page table functions. 24 + */ 25 + #define pgd_present(pgd) (1) 26 + #define pgd_none(pgd) (0) 27 + #define pgd_bad(pgd) (0) 28 + #define pgd_clear(pgdp) 29 + #define kern_addr_valid(addr) (1) 30 + #define pmd_offset(a, b) ((void *)0) 31 + /* FIXME */ 32 + /* 33 + * PMD_SHIFT determines the size of the area a second-level page table can map 34 + * PGDIR_SHIFT determines what a third-level page table entry can map 35 + */ 36 + #define PGDIR_SHIFT 21 37 + 38 + #define PGDIR_SIZE (1UL << PGDIR_SHIFT) 39 + #define PGDIR_MASK (~(PGDIR_SIZE-1)) 40 + /* FIXME */ 41 + 42 + #define PAGE_NONE __pgprot(0) 43 + #define PAGE_SHARED __pgprot(0) 44 + #define PAGE_COPY __pgprot(0) 45 + #define PAGE_READONLY __pgprot(0) 46 + #define PAGE_KERNEL __pgprot(0) 47 + 48 + //extern void paging_init(struct meminfo *, struct machine_desc *); 49 + #define swapper_pg_dir ((pgd_t *) 0) 50 + 51 + #define __swp_type(x) (0) 52 + #define __swp_offset(x) (0) 53 + #define __swp_entry(typ,off) ((swp_entry_t) { ((typ) | ((off) << 7)) }) 54 + #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) 55 + #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 56 + 57 + 58 + typedef pte_t *pte_addr_t; 59 + 60 + static inline int pte_file(pte_t pte) { return 0; } 61 + 62 + /* 63 + * ZERO_PAGE is a global shared page that is always zero: used 64 + * for zero-mapped memory areas etc.. 65 + */ 66 + #define ZERO_PAGE(vaddr) (virt_to_page(0)) 67 + 68 + /* 69 + * Mark the prot value as uncacheable and unbufferable. 70 + */ 71 + #define pgprot_noncached(prot) __pgprot(0) 72 + #define pgprot_writecombine(prot) __pgprot(0) 73 + 74 + 75 + /* 76 + * These would be in other places but having them here reduces the diffs. 77 + */ 78 + extern unsigned int kobjsize(const void *objp); 79 + extern int is_in_rom(unsigned long); 80 + 81 + /* 82 + * No page table caches to initialise. 83 + */ 84 + #define pgtable_cache_init() do { } while (0) 85 + #define io_remap_page_range remap_page_range 86 + #define io_remap_pfn_range remap_pfn_range 87 + 88 + #define MK_IOSPACE_PFN(space, pfn) (pfn) 89 + #define GET_IOSPACE(pfn) 0 90 + #define GET_PFN(pfn) (pfn) 91 + 92 + 93 + /* 94 + * All 32bit addresses are effectively valid for vmalloc... 95 + * Sort of meaningless for non-VM targets. 96 + */ 97 + #define VMALLOC_START 0 98 + #define VMALLOC_END 0xffffffff 99 + 100 + #define FIRST_USER_ADDRESS (0) 101 + 102 + #else 103 + 104 + /* 105 + * dummy tlb and user structures. 106 + */ 107 + #define v3_tlb_fns (0) 108 + #define v4_tlb_fns (0) 109 + #define v4wb_tlb_fns (0) 110 + #define v4wbi_tlb_fns (0) 111 + #define v6_tlb_fns (0) 112 + 113 + #define v3_user_fns (0) 114 + #define v4_user_fns (0) 115 + #define v4_mc_user_fns (0) 116 + #define v4wb_user_fns (0) 117 + #define v4wt_user_fns (0) 118 + #define v6_user_fns (0) 119 + #define xscale_mc_user_fns (0) 120 + 121 + #endif /*__ASSEMBLY__*/ 122 + 123 + #endif /* _ASMARM_PGTABLE_H */
+9 -1
include/asm-arm/pgtable.h
··· 11 11 #define _ASMARM_PGTABLE_H 12 12 13 13 #include <asm-generic/4level-fixup.h> 14 + #include <asm/proc-fns.h> 15 + 16 + #ifndef CONFIG_MMU 17 + 18 + #include "pgtable-nommu.h" 19 + 20 + #else 14 21 15 22 #include <asm/memory.h> 16 - #include <asm/proc-fns.h> 17 23 #include <asm/arch/vmalloc.h> 18 24 19 25 /* ··· 383 377 #define pgtable_cache_init() do { } while (0) 384 378 385 379 #endif /* !__ASSEMBLY__ */ 380 + 381 + #endif /* CONFIG_MMU */ 386 382 387 383 #endif /* _ASMARM_PGTABLE_H */
+4
include/asm-arm/proc-fns.h
··· 165 165 166 166 #include <asm/memory.h> 167 167 168 + #ifdef CONFIG_MMU 169 + 168 170 #define cpu_switch_mm(pgd,mm) cpu_do_switch_mm(virt_to_phys(pgd),mm) 169 171 170 172 #define cpu_get_pgd() \ ··· 177 175 pg &= ~0x3fff; \ 178 176 (pgd_t *)phys_to_virt(pg); \ 179 177 }) 178 + 179 + #endif 180 180 181 181 #endif /* __ASSEMBLY__ */ 182 182 #endif /* __KERNEL__ */
+87 -52
include/asm-arm/uaccess.h
··· 41 41 extern int fixup_exception(struct pt_regs *regs); 42 42 43 43 /* 44 + * These two are intentionally not defined anywhere - if the kernel 45 + * code generates any references to them, that's a bug. 46 + */ 47 + extern int __get_user_bad(void); 48 + extern int __put_user_bad(void); 49 + 50 + /* 44 51 * Note that this is actually 0x1,0000,0000 45 52 */ 46 53 #define KERNEL_DS 0x00000000 47 - #define USER_DS TASK_SIZE 48 - 49 54 #define get_ds() (KERNEL_DS) 55 + 56 + #ifdef CONFIG_MMU 57 + 58 + #define USER_DS TASK_SIZE 50 59 #define get_fs() (current_thread_info()->addr_limit) 51 60 52 - static inline void set_fs (mm_segment_t fs) 61 + static inline void set_fs(mm_segment_t fs) 53 62 { 54 63 current_thread_info()->addr_limit = fs; 55 64 modify_domain(DOMAIN_KERNEL, fs ? DOMAIN_CLIENT : DOMAIN_MANAGER); ··· 84 75 : "cc"); \ 85 76 flag; }) 86 77 87 - #define access_ok(type,addr,size) (__range_ok(addr,size) == 0) 88 - 89 78 /* 90 79 * Single-value transfer routines. They automatically use the right 91 80 * size if we just have the right pointer type. Note that the functions ··· 94 87 * fixup code, but there are a few places where it intrudes on the 95 88 * main code path. When we only write to user space, there is no 96 89 * problem. 97 - * 98 - * The "__xxx" versions of the user access functions do not verify the 99 - * address space - it must have been done previously with a separate 100 - * "access_ok()" call. 101 - * 102 - * The "xxx_error" versions set the third argument to EFAULT if an 103 - * error occurs, and leave it unchanged on success. Note that these 104 - * versions are void (ie, don't return a value as such). 105 90 */ 106 - 107 91 extern int __get_user_1(void *); 108 92 extern int __get_user_2(void *); 109 93 extern int __get_user_4(void *); 110 - extern int __get_user_bad(void); 111 94 112 95 #define __get_user_x(__r2,__p,__e,__s,__i...) \ 113 96 __asm__ __volatile__ ( \ ··· 128 131 __e; \ 129 132 }) 130 133 134 + extern int __put_user_1(void *, unsigned int); 135 + extern int __put_user_2(void *, unsigned int); 136 + extern int __put_user_4(void *, unsigned int); 137 + extern int __put_user_8(void *, unsigned long long); 138 + 139 + #define __put_user_x(__r2,__p,__e,__s) \ 140 + __asm__ __volatile__ ( \ 141 + __asmeq("%0", "r0") __asmeq("%2", "r2") \ 142 + "bl __put_user_" #__s \ 143 + : "=&r" (__e) \ 144 + : "0" (__p), "r" (__r2) \ 145 + : "ip", "lr", "cc") 146 + 147 + #define put_user(x,p) \ 148 + ({ \ 149 + const register typeof(*(p)) __r2 asm("r2") = (x); \ 150 + const register typeof(*(p)) __user *__p asm("r0") = (p);\ 151 + register int __e asm("r0"); \ 152 + switch (sizeof(*(__p))) { \ 153 + case 1: \ 154 + __put_user_x(__r2, __p, __e, 1); \ 155 + break; \ 156 + case 2: \ 157 + __put_user_x(__r2, __p, __e, 2); \ 158 + break; \ 159 + case 4: \ 160 + __put_user_x(__r2, __p, __e, 4); \ 161 + break; \ 162 + case 8: \ 163 + __put_user_x(__r2, __p, __e, 8); \ 164 + break; \ 165 + default: __e = __put_user_bad(); break; \ 166 + } \ 167 + __e; \ 168 + }) 169 + 170 + #else /* CONFIG_MMU */ 171 + 172 + /* 173 + * uClinux has only one addr space, so has simplified address limits. 174 + */ 175 + #define USER_DS KERNEL_DS 176 + 177 + #define segment_eq(a,b) (1) 178 + #define __addr_ok(addr) (1) 179 + #define __range_ok(addr,size) (0) 180 + #define get_fs() (KERNEL_DS) 181 + 182 + static inline void set_fs(mm_segment_t fs) 183 + { 184 + } 185 + 186 + #define get_user(x,p) __get_user(x,p) 187 + #define put_user(x,p) __put_user(x,p) 188 + 189 + #endif /* CONFIG_MMU */ 190 + 191 + #define access_ok(type,addr,size) (__range_ok(addr,size) == 0) 192 + 193 + /* 194 + * The "__xxx" versions of the user access functions do not verify the 195 + * address space - it must have been done previously with a separate 196 + * "access_ok()" call. 197 + * 198 + * The "xxx_error" versions set the third argument to EFAULT if an 199 + * error occurs, and leave it unchanged on success. Note that these 200 + * versions are void (ie, don't return a value as such). 201 + */ 131 202 #define __get_user(x,ptr) \ 132 203 ({ \ 133 204 long __gu_err = 0; \ ··· 276 211 : "+r" (err), "=&r" (x) \ 277 212 : "r" (addr), "i" (-EFAULT) \ 278 213 : "cc") 279 - 280 - extern int __put_user_1(void *, unsigned int); 281 - extern int __put_user_2(void *, unsigned int); 282 - extern int __put_user_4(void *, unsigned int); 283 - extern int __put_user_8(void *, unsigned long long); 284 - extern int __put_user_bad(void); 285 - 286 - #define __put_user_x(__r2,__p,__e,__s) \ 287 - __asm__ __volatile__ ( \ 288 - __asmeq("%0", "r0") __asmeq("%2", "r2") \ 289 - "bl __put_user_" #__s \ 290 - : "=&r" (__e) \ 291 - : "0" (__p), "r" (__r2) \ 292 - : "ip", "lr", "cc") 293 - 294 - #define put_user(x,p) \ 295 - ({ \ 296 - const register typeof(*(p)) __r2 asm("r2") = (x); \ 297 - const register typeof(*(p)) __user *__p asm("r0") = (p);\ 298 - register int __e asm("r0"); \ 299 - switch (sizeof(*(__p))) { \ 300 - case 1: \ 301 - __put_user_x(__r2, __p, __e, 1); \ 302 - break; \ 303 - case 2: \ 304 - __put_user_x(__r2, __p, __e, 2); \ 305 - break; \ 306 - case 4: \ 307 - __put_user_x(__r2, __p, __e, 4); \ 308 - break; \ 309 - case 8: \ 310 - __put_user_x(__r2, __p, __e, 8); \ 311 - break; \ 312 - default: __e = __put_user_bad(); break; \ 313 - } \ 314 - __e; \ 315 - }) 316 214 317 215 #define __put_user(x,ptr) \ 318 216 ({ \ ··· 382 354 : "cc") 383 355 384 356 357 + #ifdef CONFIG_MMU 385 358 extern unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n); 386 359 extern unsigned long __copy_to_user(void __user *to, const void *from, unsigned long n); 387 360 extern unsigned long __clear_user(void __user *addr, unsigned long n); 361 + #else 362 + #define __copy_from_user(to,from,n) (memcpy(to, (void __force *)from, n), 0) 363 + #define __copy_to_user(to,from,n) (memcpy((void __force *)to, from, n), 0) 364 + #define __clear_user(addr,n) (memset((void __force *)addr, 0, n), 0) 365 + #endif 366 + 388 367 extern unsigned long __strncpy_from_user(char *to, const char __user *from, unsigned long count); 389 368 extern unsigned long __strnlen_user(const char __user *s, long n); 390 369