aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/proc-xscale.S
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-09-06 12:19:08 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-10-01 11:40:52 -0400
commitda0916539d20f257dfa46784357300e49d6bfd00 (patch)
treee581749819a4a7e5aea471c242a51773a360bd1d /arch/arm/mm/proc-xscale.S
parent1ad77a876da48331451698cc4172c90ab9b6372f (diff)
[ARM] Convert set_pte_ext implementions to macros
There are actually only four separate implementations of set_pte_ext. Use assembler macros to insert code for these into the proc-*.S files. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/proc-xscale.S')
-rw-r--r--arch/arm/mm/proc-xscale.S30
1 files changed, 5 insertions, 25 deletions
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
index 2dd85273976f..8d7512f9cba7 100644
--- a/arch/arm/mm/proc-xscale.S
+++ b/arch/arm/mm/proc-xscale.S
@@ -433,20 +433,7 @@ ENTRY(cpu_xscale_switch_mm)
433 */ 433 */
434 .align 5 434 .align 5
435ENTRY(cpu_xscale_set_pte_ext) 435ENTRY(cpu_xscale_set_pte_ext)
436 str r1, [r0], #-2048 @ linux version 436 xscale_set_pte_ext_prologue
437
438 bic r2, r1, #0xff0
439 orr r2, r2, #PTE_TYPE_EXT @ extended page
440
441 eor r3, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY
442
443 tst r3, #L_PTE_USER @ User?
444 orrne r2, r2, #PTE_EXT_AP_URO_SRW @ yes -> user r/o, system r/w
445
446 tst r3, #L_PTE_WRITE | L_PTE_DIRTY @ Write and Dirty?
447 orreq r2, r2, #PTE_EXT_AP_UNO_SRW @ yes -> user n/a, system r/w
448 @ combined with user -> user r/w
449
450 @ 437 @
451 @ Handle the X bit. We want to set this bit for the minicache 438 @ Handle the X bit. We want to set this bit for the minicache
452 @ (U = E = B = W = 0, C = 1) or when write allocate is enabled, 439 @ (U = E = B = W = 0, C = 1) or when write allocate is enabled,
@@ -456,11 +443,10 @@ ENTRY(cpu_xscale_set_pte_ext)
456 @ 443 @
457 @ X = (C & ~W & ~B) | (C & W & B & write_allocate) 444 @ X = (C & ~W & ~B) | (C & W & B & write_allocate)
458 @ 445 @
459 eor ip, r1, #L_PTE_CACHEABLE 446 and ip, r1, #L_PTE_CACHEABLE | L_PTE_WRITE | L_PTE_BUFFERABLE
460 tst ip, #L_PTE_CACHEABLE | L_PTE_WRITE | L_PTE_BUFFERABLE 447 teq ip, #L_PTE_CACHEABLE
461#if PTE_CACHE_WRITE_ALLOCATE 448#if PTE_CACHE_WRITE_ALLOCATE
462 eorne ip, r1, #L_PTE_CACHEABLE | L_PTE_WRITE | L_PTE_BUFFERABLE 449 teqne ip, #L_PTE_CACHEABLE | L_PTE_WRITE | L_PTE_BUFFERABLE
463 tstne ip, #L_PTE_CACHEABLE | L_PTE_WRITE | L_PTE_BUFFERABLE
464#endif 450#endif
465 orreq r2, r2, #PTE_EXT_TEX(1) 451 orreq r2, r2, #PTE_EXT_TEX(1)
466 452
@@ -474,13 +460,7 @@ ENTRY(cpu_xscale_set_pte_ext)
474 teq ip, #L_PTE_USER | L_PTE_CACHEABLE 460 teq ip, #L_PTE_USER | L_PTE_CACHEABLE
475 biceq r2, r2, #PTE_BUFFERABLE 461 biceq r2, r2, #PTE_BUFFERABLE
476 462
477 tst r3, #L_PTE_PRESENT | L_PTE_YOUNG @ Present and Young? 463 xscale_set_pte_ext_epilogue
478 movne r2, #0 @ no -> fault
479
480 str r2, [r0] @ hardware version
481 mov ip, #0
482 mcr p15, 0, r0, c7, c10, 1 @ Clean D cache line
483 mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer
484 mov pc, lr 464 mov pc, lr
485 465
486 466