Changeset 4177e70 in mainline


Ignore:
Timestamp:
2018-07-17T22:09:50Z (6 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
58093d9
Parents:
db51219f
Message:

mips: We use K1 register for thread pointer, so we must treat it as a preserved register.

Location:
kernel/arch/mips32
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/mips32/include/arch/context_struct.h

    rdb51219f r4177e70  
    4242#define CONTEXT_OFFSET_S8  0x28
    4343#define CONTEXT_OFFSET_GP  0x2c
    44 #define CONTEXT_OFFSET_IPL 0x30
    45 #define CONTEXT_SIZE       0x34
     44#define CONTEXT_OFFSET_TP  0x30
     45#define CONTEXT_OFFSET_IPL 0x34
     46#define CONTEXT_SIZE       0x38
    4647
    4748#ifndef __ASSEMBLER__
     
    6364        uint32_t s8;
    6465        uint32_t gp;
     66        /* We use the K1 register for userspace thread pointer. */
     67        uint32_t tp;
    6568        ipl_t ipl;
    6669} context_t;
  • kernel/arch/mips32/src/context.S

    rdb51219f r4177e70  
    4747        sw $s8, CONTEXT_OFFSET_S8($a0)
    4848        sw $gp, CONTEXT_OFFSET_GP($a0)
     49        sw $k1, CONTEXT_OFFSET_TP($a0)
    4950
    5051        sw $ra, CONTEXT_OFFSET_PC($a0)
     
    6768        lw $s8, CONTEXT_OFFSET_S8($a0)
    6869        lw $gp, CONTEXT_OFFSET_GP($a0)
     70        lw $k1, CONTEXT_OFFSET_TP($a0)
    6971
    7072        lw $ra, CONTEXT_OFFSET_PC($a0)
  • kernel/arch/mips32/src/start.S

    rdb51219f r4177e70  
    264264        mfc0 $t2, $status
    265265        sw $t3, ISTATE_OFFSET_EPC($sp)  /* save EPC */
    266         sw $k1, ISTATE_OFFSET_KT1($sp)  /* save $k1 not saved on context switch */
    267266
    268267        and $t4, $t2, REG_SAVE_MASK  /* save only KSU, EXL, ERL, IE */
     
    300299        /* restore epc + 4 */
    301300        lw $t2, ISTATE_OFFSET_EPC($sp)
    302         lw $k1, ISTATE_OFFSET_KT1($sp)
    303301        addi $t2, $t2, 4
    304302        mtc0 $t2, $epc
Note: See TracChangeset for help on using the changeset viewer.