Changeset 7b213f2 in mainline


Ignore:
Timestamp:
2010-07-22T14:03:56Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ce890ec9
Parents:
0a447ab
Message:

Rearrange mips32 istate_t to contain all registers and in a format suitable for syscalls / parameter passing. (Breaks mips32)

Location:
kernel/arch/mips32
Files:
3 edited

Legend:

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

    r0a447ab r7b213f2  
    6060# define OFFSET_F30     0x5c
    6161#endif /* KERNEL */
    62 
    63 /* istate_t */
    64 #define EOFFSET_AT     0x0
    65 #define EOFFSET_V0     0x4
    66 #define EOFFSET_V1     0x8
    67 #define EOFFSET_A0     0xc
    68 #define EOFFSET_A1     0x10
    69 #define EOFFSET_A2     0x14
    70 #define EOFFSET_A3     0x18
    71 #define EOFFSET_T0     0x1c
    72 #define EOFFSET_T1     0x20
    73 #define EOFFSET_T2     0x24
    74 #define EOFFSET_T3     0x28
    75 #define EOFFSET_T4     0x2c
    76 #define EOFFSET_T5     0x30
    77 #define EOFFSET_T6     0x34
    78 #define EOFFSET_T7     0x38
    79 #define EOFFSET_T8     0x3c
    80 #define EOFFSET_T9     0x40
    81 #define EOFFSET_GP     0x44
    82 #define EOFFSET_SP     0x48
    83 #define EOFFSET_RA     0x4c
    84 #define EOFFSET_LO     0x50
    85 #define EOFFSET_HI     0x54
    86 #define EOFFSET_STATUS 0x58
    87 #define EOFFSET_EPC    0x5c
    88 #define EOFFSET_K1     0x60
    89 #define REGISTER_SPACE 104      /* respect stack alignment */
    9062
    9163#ifdef __ASM__
  • kernel/arch/mips32/include/exception.h

    r0a447ab r7b213f2  
    6060
    6161typedef struct istate {
     62        /*
     63         * The first seven registers are arranged so that the istate structure
     64         * can be used both for exception handlers and for the syscall handler.
     65         */
     66        uint32_t a0;    /* arg1 */
     67        uint32_t a1;    /* arg2 */
     68        uint32_t a2;    /* arg3 */
     69        uint32_t a3;    /* arg4 */
     70        uint32_t t0;    /* arg5 */
     71        uint32_t t1;    /* arg6 */
     72        uint32_t v0;    /* arg7 */
     73        uint32_t v1;
    6274        uint32_t at;
    63         uint32_t v0;
    64         uint32_t v1;
    65         uint32_t a0;
    66         uint32_t a1;
    67         uint32_t a2;
    68         uint32_t a3;
    69         uint32_t t0;
    70         uint32_t t1;
    7175        uint32_t t2;
    7276        uint32_t t3;
     
    7579        uint32_t t6;
    7680        uint32_t t7;
     81        uint32_t s0
     82        uint32_t s1
     83        uint32_t s2
     84        uint32_t s3
     85        uint32_t s4
     86        uint32_t s5
     87        uint32_t s6
     88        uint32_t s7
    7789        uint32_t t8;
    7890        uint32_t t9;
     91        uint32_t kt0;
     92        uint32_t kt1;   /* We use it as thread-local pointer */
    7993        uint32_t gp;
    8094        uint32_t sp;
     95        uint32_t s8;
    8196        uint32_t ra;
    8297       
     
    8499        uint32_t hi;
    85100       
    86         uint32_t status;  /* cp0_status */
    87         uint32_t epc;     /* cp0_epc */
    88         uint32_t k1;      /* We use it as thread-local pointer */
     101        uint32_t status;        /* cp0_status */
     102        uint32_t epc;           /* cp0_epc */
     103
     104        uint32_t alignment;     /* to make sizeof(istate_t) a multiple of 8 */
    89105} istate_t;
    90106
  • kernel/arch/mips32/src/start.S

    r0a447ab r7b213f2  
    5050 */
    5151#define REG_SAVE_MASK 0x1f
     52
     53#define ISTATE_OFFSET_A0        0
     54#define ISTATE_OFFSET_A1        4
     55#define ISTATE_OFFSET_A2        8
     56#define ISTATE_OFFSET_A3        12
     57#define ISTATE_OFFSET_T0        16
     58#define ISTATE_OFFSET_T1        20
     59#define ISTATE_OFFSET_V0        24
     60#define ISTATE_OFFSET_V1        28
     61#define ISTATE_OFFSET_AT        32
     62#define ISTATE_OFFSET_T2        36
     63#define ISTATE_OFFSET_T3        40
     64#define ISTATE_OFFSET_T4        44
     65#define ISTATE_OFFSET_T5        48
     66#define ISTATE_OFFSET_T6        52
     67#define ISTATE_OFFSET_T7        56
     68#define ISTATE_OFFSET_S0        60
     69#define ISTATE_OFFSET_S1        64
     70#define ISTATE_OFFSET_S2        68
     71#define ISTATE_OFFSET_S3        72
     72#define ISTATE_OFFSET_S4        76
     73#define ISTATE_OFFSET_S5        80
     74#define ISTATE_OFFSET_S6        84
     75#define ISTATE_OFFSET_S7        88
     76#define ISTATE_OFFSET_T8        92
     77#define ISTATE_OFFSET_T9        96
     78#define ISTATE_OFFSET_KT0       100
     79#define ISTATE_OFFSET_KT1       104
     80#define ISTATE_OFFSET_GP        108
     81#define ISTATE_OFFSET_SP        112
     82#define ISTATE_OFFSET_S8        116
     83#define ISTATE_OFFSET_RA        120
     84#define ISTATE_OFFSET_LO        124
     85#define ISTATE_OFFSET_HI        128
     86#define ISTATE_OFFSET_STATUS    132
     87#define ISTATE_OFFSET_EPC       136
     88#define ISTATE_OFFSET_ALIGNMENT 140
     89
     90#define ISTATE_SOFT_SIZE        144
    5291
    5392/*
     
    205244        KERNEL_STACK_TO_K0
    206245       
    207         sub $k0, REGISTER_SPACE
    208         sw $sp, EOFFSET_SP($k0)
     246        sub $k0, ISTATE_SOFT_SIZE
     247        sw $sp, ISTATE_OFFSET_SP($k0)
    209248        move $sp, $k0
    210249       
Note: See TracChangeset for help on using the changeset viewer.