@@ -488,13 +488,8 @@ __fixup_pv_table:
488488 add r5 , r5 , r3 @ adjust table end address
489489 add r7 , r7 , r3 @ adjust __pv_phys_offset address
490490 str r8 , [ r7 ] @ save computed PHYS_OFFSET to __pv_phys_offset
491- #ifndef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT
492491 mov r6 , r3 , lsr # 24 @ constant for add / sub instructions
493492 teq r3 , r6 , lsl # 24 @ must be 16MiB aligned
494- #else
495- mov r6 , r3 , lsr # 16 @ constant for add / sub instructions
496- teq r3 , r6 , lsl # 16 @ must be 64kiB aligned
497- #endif
498493THUMB( it ne @ cross section branch )
499494 bne __error
500495 str r6 , [ r7 , # 4 ] @ save to __pv_offset
@@ -510,20 +505,8 @@ ENDPROC(__fixup_pv_table)
510505 .text
511506__fixup_a_pv_table:
512507#ifdef CONFIG_THUMB2_KERNEL
513- #ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT
514- lsls r0 , r6 , # 24
515- lsr r6 , # 8
516- beq 1f
517- clz r7 , r0
518- lsr r0 , # 24
519- lsl r0 , r7
520- bic r0 , 0x0080
521- lsrs r7 , # 1
522- orrcs r0 , # 0x0080
523- orr r0 , r0 , r7 , lsl # 12
524- #endif
525- 1 : lsls r6 , # 24
526- beq 4f
508+ lsls r6 , # 24
509+ beq 2f
527510 clz r7 , r6
528511 lsr r6 , # 24
529512 lsl r6 , r7
@@ -532,43 +515,25 @@ __fixup_a_pv_table:
532515 orrcs r6 , # 0x0080
533516 orr r6 , r6 , r7 , lsl # 12
534517 orr r6 , # 0x4000
535- b 4f
536- 2 : @ at this point the C flag is always clear
537- add r7 , r3
538- #ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT
539- ldrh ip , [ r7 ]
540- tst ip , 0x0400 @ the i bit tells us LS or MS byte
541- beq 3f
542- cmp r0 , # 0 @ set C flag , and ...
543- biceq ip , 0x0400 @ immediate zero value has a special encoding
544- streqh ip , [ r7 ] @ th at requires the i bit cleared
545- #endif
546- 3 : ldrh ip , [ r7 , # 2 ]
518+ b 2f
519+ 1 : add r7 , r3
520+ ldrh ip , [ r7 , # 2 ]
547521 and ip , 0x8f00
548- orrcc ip , r6 @ mask in offset bits 31 - 24
549- orrcs ip , r0 @ mask in offset bits 23 - 16
522+ orr ip , r6 @ mask in offset bits 31 - 24
550523 strh ip , [ r7 , # 2 ]
551- 4 : cmp r4 , r5
524+ 2 : cmp r4 , r5
552525 ldrcc r7 , [ r4 ], # 4 @ use branch for delay slot
553- bcc 2b
526+ bcc 1b
554527 bx lr
555528#else
556- #ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT
557- and r0 , r6 , # 255 @ offset bits 23 - 16
558- mov r6 , r6 , lsr # 8 @ offset bits 31 - 24
559- #else
560- mov r0 , # 0 @ just in case...
561- #endif
562- b 3f
563- 2 : ldr ip , [ r7 , r3 ]
529+ b 2f
530+ 1 : ldr ip , [ r7 , r3 ]
564531 bic ip , ip , # 0x000000ff
565- tst ip , # 0x400 @ rotate shift tells us LS or MS byte
566- orrne ip , ip , r6 @ mask in offset bits 31 - 24
567- orreq ip , ip , r0 @ mask in offset bits 23 - 16
532+ orr ip , ip , r6 @ mask in offset bits 31 - 24
568533 str ip , [ r7 , r3 ]
569- 3 : cmp r4 , r5
534+ 2 : cmp r4 , r5
570535 ldrcc r7 , [ r4 ], # 4 @ use branch for delay slot
571- bcc 2b
536+ bcc 1b
572537 mov pc , lr
573538#endif
574539ENDPROC(__fixup_a_pv_table)
0 commit comments