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


Ignore:
Timestamp:
2014-08-28T13:59:43Z (10 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3fde837
Parents:
beb16cfa
Message:

Base the detection of the previous mode on SRR1.PR rather than on SP.

File:
1 edited

Legend:

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

    rbeb16cfa r0871296  
    3131#include <arch/mm/page.h>
    3232#include <arch/istate_struct.h>
     33#include <arch/stack.h>
    3334#include <align.h>
    34 #include <arch/stack.h>
    3535
    3636.section K_UNMAPPED_TEXT_START, "ax"
     
    4545        mtsprg2 sp
    4646       
    47         # check whether SP is in kernel
    48        
    49         andis. sp, sp, 0x8000
     47        # check whether the previous mode was user or kernel
     48       
     49        mfsrr1 sp # use sp as a temporary register to hold SRR1
     50        andi. sp, sp, MSR_PR
    5051        bne 1f
    51        
    52                 # stack is in user-space
    53                
    54                 mfsprg0 sp
    55        
    56         b 2f
    57        
    58         1:
    59        
    60                 # stack is in kernel
     52                # previous mode was kernel
    6153               
    6254                mfsprg2 sp
    6355                subis sp, sp, 0x8000
    64        
     56        b 2f
     57       
     58        1:
     59                # previous mode was user
     60               
     61                mfsprg0 sp
    6562        2:
    6663       
     
    266263       
    267264        mfsrr1 r5
     265
     266        andi. r5, r5, MSR_PR
     267
    268268        andi. r5, r5, MSR_FP
    269269        mfmsr r12
Note: See TracChangeset for help on using the changeset viewer.