Changeset 301 for soft/giet_vm/giet_kernel
- Timestamp:
- Apr 14, 2014, 6:44:51 PM (11 years ago)
- Location:
- soft/giet_vm/giet_kernel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_kernel/giet.s
r267 r301 56 56 _sys_handler: 57 57 addiu $29, $29, -24 /* 2 slots for SR&EPC, 4 slots for args passing */ 58 mfc0 $26, $12 /* load SR */59 sw $26, 16($29) /* save it in the stack */60 58 mfc0 $27, $14 /* load EPC */ 61 59 addiu $27, $27, 4 /* increment EPC for return address */ … … 73 71 mtc0 $26, $12 /* interrupt enabled */ 74 72 jalr $3 /* jump to the proper syscall */ 75 mtc0 $0, $12 /* interrupt disbled */76 73 77 lw $26, 16($29) /* load SR from stack */ 78 mtc0 $26, $12 /* restore SR */ 74 mfc0 $26, $12 /* load SR */ 75 ori $26, $26, 0x2 /* set EXL bit */ 76 mtc0 $26, $12 77 79 78 lw $26, 20($29) /* load EPC from stack */ 80 79 mtc0 $26, $14 /* restore EPC */ 81 addiu $29, $29, 24/* restore stack pointer */80 addiu $29, $29, 24 /* restore stack pointer */ 82 81 eret /* exit GIET */ 83 82 -
soft/giet_vm/giet_kernel/switch.s
r263 r301 2 2 * This function receives two arguments that are the current task context 3 3 * (virtual) addresses and the next task context (virtual) address. 4 * 5 * This function should be called in a critical section 4 6 * 5 7 * TODO (AG) Il semble possible de limiter le nombre de registres à sauver: … … 18 20 19 21 _task_switch: 20 21 /* enter critical section */22 li $2, 0xFFFFFFFE23 mfc0 $3, $1224 and $3, $3, $225 mtc0 $3, $1226 22 27 23 /* save _current task context */ … … 123 119 mtc2 $26, $0 /* restore PTPR */ 124 120 125 /* exit critical section */126 li $2, 0x00000001127 mfc0 $3, $12128 or $3, $3, $2129 mtc0 $3, $12130 131 121 /* returns to caller */ 132 122 jr $31 -
soft/giet_vm/giet_kernel/sys_handler.c
r294 r301 55 55 &_sys_ukn, /* 0x17 */ 56 56 &_sys_ukn, /* 0x18 */ 57 &_c tx_switch,/* 0x19 */57 &_context_switch, /* 0x19 */ 58 58 &_vobj_get_vbase, /* 0x1A */ 59 59 &_sys_ukn, /* 0x1B */
Note: See TracChangeset
for help on using the changeset viewer.