aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/entry.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/parisc/kernel/entry.S')
-rw-r--r--arch/parisc/kernel/entry.S60
1 files changed, 48 insertions, 12 deletions
diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
index 0db9fdcb7709..ae3e70cd1e14 100644
--- a/arch/parisc/kernel/entry.S
+++ b/arch/parisc/kernel/entry.S
@@ -505,6 +505,18 @@
505 STREG \pte,0(\ptep) 505 STREG \pte,0(\ptep)
506 .endm 506 .endm
507 507
508 /* bitshift difference between a PFN (based on kernel's PAGE_SIZE)
509 * to a CPU TLB 4k PFN (4k => 12 bits to shift) */
510 #define PAGE_ADD_SHIFT (PAGE_SHIFT-12)
511
512 /* Drop prot bits and convert to page addr for iitlbt and idtlbt */
513 .macro convert_for_tlb_insert20 pte
514 extrd,u \pte,(63-ASM_PFN_PTE_SHIFT)+(63-58)+PAGE_ADD_SHIFT,\
515 64-PAGE_SHIFT-PAGE_ADD_SHIFT,\pte
516 depdi _PAGE_SIZE_ENCODING_DEFAULT,63,\
517 (63-58)+PAGE_ADD_SHIFT,\pte
518 .endm
519
508 /* Convert the pte and prot to tlb insertion values. How 520 /* Convert the pte and prot to tlb insertion values. How
509 * this happens is quite subtle, read below */ 521 * this happens is quite subtle, read below */
510 .macro make_insert_tlb spc,pte,prot 522 .macro make_insert_tlb spc,pte,prot
@@ -544,8 +556,7 @@
544 depi 1,12,1,\prot 556 depi 1,12,1,\prot
545 557
546 /* Drop prot bits and convert to page addr for iitlbt and idtlbt */ 558 /* Drop prot bits and convert to page addr for iitlbt and idtlbt */
547 extrd,u \pte,(63-ASM_PFN_PTE_SHIFT)+(63-58),64-PAGE_SHIFT,\pte 559 convert_for_tlb_insert20 \pte
548 depdi _PAGE_SIZE_ENCODING_DEFAULT,63,63-58,\pte
549 .endm 560 .endm
550 561
551 /* Identical macro to make_insert_tlb above, except it 562 /* Identical macro to make_insert_tlb above, except it
@@ -563,8 +574,8 @@
563 574
564 /* Get rid of prot bits and convert to page addr for iitlba */ 575 /* Get rid of prot bits and convert to page addr for iitlba */
565 576
566 depi _PAGE_SIZE_ENCODING_DEFAULT,31,ASM_PFN_PTE_SHIFT,\pte 577 depi 0,31,ASM_PFN_PTE_SHIFT,\pte
567 extru \pte,24,25,\pte 578 SHRREG \pte,(ASM_PFN_PTE_SHIFT-(31-26)),\pte
568 .endm 579 .endm
569 580
570 /* This is for ILP32 PA2.0 only. The TLB insertion needs 581 /* This is for ILP32 PA2.0 only. The TLB insertion needs
@@ -1244,10 +1255,9 @@ nadtlb_check_flush_20w:
1244 depdi,z 7,7,3,prot 1255 depdi,z 7,7,3,prot
1245 depdi 1,10,1,prot 1256 depdi 1,10,1,prot
1246 1257
1247 /* Get rid of prot bits and convert to page addr for idtlbt */ 1258 /* Drop prot bits from pte and convert to page addr for idtlbt */
1259 convert_for_tlb_insert20 pte
1248 1260
1249 depdi 0,63,12,pte
1250 extrd,u pte,56,52,pte
1251 idtlbt pte,prot 1261 idtlbt pte,prot
1252 1262
1253 rfir 1263 rfir
@@ -1337,8 +1347,8 @@ nadtlb_check_flush_11:
1337 1347
1338 /* Get rid of prot bits and convert to page addr for idtlba */ 1348 /* Get rid of prot bits and convert to page addr for idtlba */
1339 1349
1340 depi 0,31,12,pte 1350 depi 0,31,ASM_PFN_PTE_SHIFT,pte
1341 extru pte,24,25,pte 1351 SHRREG pte,(ASM_PFN_PTE_SHIFT-(31-26)),pte
1342 1352
1343 mfsp %sr1,t0 /* Save sr1 so we can use it in tlb inserts */ 1353 mfsp %sr1,t0 /* Save sr1 so we can use it in tlb inserts */
1344 mtsp spc,%sr1 1354 mtsp spc,%sr1
@@ -1403,10 +1413,9 @@ nadtlb_check_flush_20:
1403 depdi,z 7,7,3,prot 1413 depdi,z 7,7,3,prot
1404 depdi 1,10,1,prot 1414 depdi 1,10,1,prot
1405 1415
1406 /* Get rid of prot bits and convert to page addr for idtlbt */ 1416 /* Drop prot bits from pte and convert to page addr for idtlbt */
1417 convert_for_tlb_insert20 pte
1407 1418
1408 depdi 0,63,12,pte
1409 extrd,u pte,56,32,pte
1410 idtlbt pte,prot 1419 idtlbt pte,prot
1411 1420
1412 rfir 1421 rfir
@@ -2176,6 +2185,33 @@ syscall_do_resched:
2176ENDPROC(syscall_exit) 2185ENDPROC(syscall_exit)
2177 2186
2178 2187
2188#ifdef CONFIG_FUNCTION_TRACER
2189 .import ftrace_function_trampoline,code
2190ENTRY(_mcount)
2191 copy %r3, %arg2
2192 b ftrace_function_trampoline
2193 nop
2194ENDPROC(_mcount)
2195
2196ENTRY(return_to_handler)
2197 load32 return_trampoline, %rp
2198 copy %ret0, %arg0
2199 copy %ret1, %arg1
2200 b ftrace_return_to_handler
2201 nop
2202return_trampoline:
2203 copy %ret0, %rp
2204 copy %r23, %ret0
2205 copy %r24, %ret1
2206
2207.globl ftrace_stub
2208ftrace_stub:
2209 bv %r0(%rp)
2210 nop
2211ENDPROC(return_to_handler)
2212#endif /* CONFIG_FUNCTION_TRACER */
2213
2214
2179get_register: 2215get_register:
2180 /* 2216 /*
2181 * get_register is used by the non access tlb miss handlers to 2217 * get_register is used by the non access tlb miss handlers to