Changeset 3fde837 in mainline for kernel/arch/ppc32/src/exception.S


Ignore:
Timestamp:
2014-08-28T14:27:12Z (10 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
07e28f8
Parents:
0871296
Message:

Construct proper stack frame linkage when the previous mode was kernel.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ppc32/src/exception.S

    r0871296 r3fde837  
    254254.org 0x4000
    255255jump_to_kernel:
     256        mfsrr1 r5
     257        andi. r5, r5, MSR_PR
     258        bne 1f
     259                # Previous mode was kernel.
     260                # We can construct a proper frame linkage.
     261               
     262                mfsrr0 r12
     263                stw r12, ISTATE_OFFSET_LR_FRAME(sp)
     264                mfsprg2 r12
     265                stw r12, ISTATE_OFFSET_SP_FRAME(sp)
     266        1:
     267
    256268        lis r12, iret@ha
    257269        addi r12, r12, iret@l
    258270        mtlr r12
    259        
     271
    260272        lis r12, exc_dispatch@ha
    261273        addi r12, r12, exc_dispatch@l
    262274        mtsrr0 r12
    263        
     275
     276        mfmsr r12
    264277        mfsrr1 r5
    265 
    266         andi. r5, r5, MSR_PR
    267 
    268278        andi. r5, r5, MSR_FP
    269         mfmsr r12
    270279        or r12, r12, r5         # Propagate MSR_FP from SRR1 to MSR
    271         ori r12, r12, (MSR_IR | MSR_DR)@l
     280        ori r12, r12, (MSR_IR | MSR_DR)
    272281        mtsrr1 r12
    273282       
     
    290299        mfmsr r12
    291300        or r12, r12, r0         # Propagate MSR_FP from SRR1 to MSR
    292         ori r12, r12, (MSR_IR | MSR_DR)@l
     301        ori r12, r12, (MSR_IR | MSR_DR)
    293302        mtsrr1 r12
    294303       
Note: See TracChangeset for help on using the changeset viewer.