diff options
author | LEROY Christophe <christophe.leroy@c-s.fr> | 2014-09-19 04:36:09 -0400 |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-11-07 19:10:41 -0500 |
commit | d14068035c3f6fd0d6514e061e4324a277be83e2 (patch) | |
tree | c78a9eb07df63f1b087c930c83a617f12f8a440a | |
parent | 33fb845a6f019001b8ca3f532eb1a4de34547f42 (diff) |
powerpc/8xx: Use PAGE size related consts
For PAGE size related operations, use PAGE size consts in order to be able to
use different page size in the futur.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Scott Wood <scottwood@freescale.com>
-rw-r--r-- | arch/powerpc/kernel/head_8xx.S | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S index 3eea29ad1fcf..e126adf15528 100644 --- a/arch/powerpc/kernel/head_8xx.S +++ b/arch/powerpc/kernel/head_8xx.S | |||
@@ -294,9 +294,9 @@ InstructionTLBMiss: | |||
294 | mtspr SPRN_SPRG_SCRATCH2, r10 | 294 | mtspr SPRN_SPRG_SCRATCH2, r10 |
295 | mfspr r10, SPRN_SRR0 /* Get effective address of fault */ | 295 | mfspr r10, SPRN_SRR0 /* Get effective address of fault */ |
296 | #ifdef CONFIG_8xx_CPU15 | 296 | #ifdef CONFIG_8xx_CPU15 |
297 | addi r11, r10, 0x1000 | 297 | addi r11, r10, PAGE_SIZE |
298 | tlbie r11 | 298 | tlbie r11 |
299 | addi r11, r10, -0x1000 | 299 | addi r11, r10, -PAGE_SIZE |
300 | tlbie r11 | 300 | tlbie r11 |
301 | #endif | 301 | #endif |
302 | 302 | ||
@@ -315,7 +315,8 @@ InstructionTLBMiss: | |||
315 | ori r11, r11, (swapper_pg_dir-PAGE_OFFSET)@l | 315 | ori r11, r11, (swapper_pg_dir-PAGE_OFFSET)@l |
316 | 3: | 316 | 3: |
317 | #endif | 317 | #endif |
318 | rlwinm r10, r10, 12, 20, 29 /* Extract level 1 index */ | 318 | /* Extract level 1 index */ |
319 | rlwinm r10, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29 | ||
319 | lwzx r11, r10, r11 /* Get the level 1 entry */ | 320 | lwzx r11, r10, r11 /* Get the level 1 entry */ |
320 | rlwinm. r10, r11,0,0,19 /* Extract page descriptor page address */ | 321 | rlwinm. r10, r11,0,0,19 /* Extract page descriptor page address */ |
321 | beq 2f /* If zero, don't try to find a pte */ | 322 | beq 2f /* If zero, don't try to find a pte */ |
@@ -327,7 +328,8 @@ InstructionTLBMiss: | |||
327 | DO_8xx_CPU6(0x2b80, r3) | 328 | DO_8xx_CPU6(0x2b80, r3) |
328 | mtspr SPRN_MI_TWC, r11 /* Set segment attributes */ | 329 | mtspr SPRN_MI_TWC, r11 /* Set segment attributes */ |
329 | mfspr r11, SPRN_SRR0 /* Get effective address of fault */ | 330 | mfspr r11, SPRN_SRR0 /* Get effective address of fault */ |
330 | rlwinm r11, r11, 22, 20, 29 /* Extract level 2 index */ | 331 | /* Extract level 2 index */ |
332 | rlwinm r11, r11, 32 - (PAGE_SHIFT - 2), 32 - PAGE_SHIFT, 29 | ||
331 | lwzx r10, r10, r11 /* Get the pte */ | 333 | lwzx r10, r10, r11 /* Get the pte */ |
332 | 334 | ||
333 | #ifdef CONFIG_SWAP | 335 | #ifdef CONFIG_SWAP |
@@ -387,7 +389,8 @@ DataStoreTLBMiss: | |||
387 | lis r11, (swapper_pg_dir-PAGE_OFFSET)@h | 389 | lis r11, (swapper_pg_dir-PAGE_OFFSET)@h |
388 | ori r11, r11, (swapper_pg_dir-PAGE_OFFSET)@l | 390 | ori r11, r11, (swapper_pg_dir-PAGE_OFFSET)@l |
389 | 3: | 391 | 3: |
390 | rlwinm r10, r10, 12, 20, 29 /* Extract level 1 index */ | 392 | /* Extract level 1 index */ |
393 | rlwinm r10, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29 | ||
391 | lwzx r11, r10, r11 /* Get the level 1 entry */ | 394 | lwzx r11, r10, r11 /* Get the level 1 entry */ |
392 | rlwinm. r10, r11,0,0,19 /* Extract page descriptor page address */ | 395 | rlwinm. r10, r11,0,0,19 /* Extract page descriptor page address */ |
393 | beq 2f /* If zero, don't try to find a pte */ | 396 | beq 2f /* If zero, don't try to find a pte */ |
@@ -396,8 +399,8 @@ DataStoreTLBMiss: | |||
396 | */ | 399 | */ |
397 | mfspr r10, SPRN_MD_EPN /* Get address of fault */ | 400 | mfspr r10, SPRN_MD_EPN /* Get address of fault */ |
398 | /* Extract level 2 index */ | 401 | /* Extract level 2 index */ |
399 | rlwinm r10, r10, 22, 20, 29 | 402 | rlwinm r10, r10, 32 - (PAGE_SHIFT - 2), 32 - PAGE_SHIFT, 29 |
400 | rlwimi r10, r11, 0, 0, 19 /* Add level 2 base */ | 403 | rlwimi r10, r11, 0, 0, 32 - PAGE_SHIFT - 1 /* Add level 2 base */ |
401 | lwz r10, 0(r10) /* Get the pte */ | 404 | lwz r10, 0(r10) /* Get the pte */ |
402 | 405 | ||
403 | ori r11, r11, 1 /* Set valid bit in physical L2 page */ | 406 | ori r11, r11, 1 /* Set valid bit in physical L2 page */ |
@@ -530,18 +533,20 @@ FixupDAR:/* Entry point for dcbx workaround. */ | |||
530 | beq- 3f /* Branch if user space */ | 533 | beq- 3f /* Branch if user space */ |
531 | lis r11, (swapper_pg_dir-PAGE_OFFSET)@h | 534 | lis r11, (swapper_pg_dir-PAGE_OFFSET)@h |
532 | ori r11, r11, (swapper_pg_dir-PAGE_OFFSET)@l | 535 | ori r11, r11, (swapper_pg_dir-PAGE_OFFSET)@l |
533 | 3: rlwinm r10, r10, 12, 20, 29 /* Extract level 1 index */ | 536 | /* Extract level 1 index */ |
537 | 3: rlwinm r10, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29 | ||
534 | lwzx r11, r10, r11 /* Get the level 1 entry */ | 538 | lwzx r11, r10, r11 /* Get the level 1 entry */ |
535 | rlwinm r10, r11,0,0,19 /* Extract page descriptor page address */ | 539 | rlwinm r10, r11,0,0,19 /* Extract page descriptor page address */ |
536 | mfspr r11, SPRN_SRR0 /* Get effective address of fault */ | 540 | mfspr r11, SPRN_SRR0 /* Get effective address of fault */ |
537 | rlwinm r11, r11, 22, 20, 29 /* Extract level 2 index */ | 541 | /* Extract level 2 index */ |
542 | rlwinm r11, r11, 32 - (PAGE_SHIFT - 2), 32 - PAGE_SHIFT, 29 | ||
538 | lwzx r11, r10, r11 /* Get the pte */ | 543 | lwzx r11, r10, r11 /* Get the pte */ |
539 | #ifdef CONFIG_8xx_CPU6 | 544 | #ifdef CONFIG_8xx_CPU6 |
540 | lwz r3, 8(r0) /* restore r3 from memory */ | 545 | lwz r3, 8(r0) /* restore r3 from memory */ |
541 | #endif | 546 | #endif |
542 | /* concat physical page address(r11) and page offset(r10) */ | 547 | /* concat physical page address(r11) and page offset(r10) */ |
543 | mfspr r10, SPRN_SRR0 | 548 | mfspr r10, SPRN_SRR0 |
544 | rlwimi r11, r10, 0, 20, 31 | 549 | rlwimi r11, r10, 0, 32 - PAGE_SHIFT, 31 |
545 | lwz r11,0(r11) | 550 | lwz r11,0(r11) |
546 | /* Check if it really is a dcbx instruction. */ | 551 | /* Check if it really is a dcbx instruction. */ |
547 | /* dcbt and dcbtst does not generate DTLB Misses/Errors, | 552 | /* dcbt and dcbtst does not generate DTLB Misses/Errors, |
@@ -917,12 +922,13 @@ set_dec_cpu6: | |||
917 | .globl sdata | 922 | .globl sdata |
918 | sdata: | 923 | sdata: |
919 | .globl empty_zero_page | 924 | .globl empty_zero_page |
925 | .align PAGE_SHIFT | ||
920 | empty_zero_page: | 926 | empty_zero_page: |
921 | .space 4096 | 927 | .space PAGE_SIZE |
922 | 928 | ||
923 | .globl swapper_pg_dir | 929 | .globl swapper_pg_dir |
924 | swapper_pg_dir: | 930 | swapper_pg_dir: |
925 | .space 4096 | 931 | .space PGD_TABLE_SIZE |
926 | 932 | ||
927 | /* Room for two PTE table poiners, usually the kernel and current user | 933 | /* Room for two PTE table poiners, usually the kernel and current user |
928 | * pointer to their respective root page table (pgdir). | 934 | * pointer to their respective root page table (pgdir). |