mirror of
https://github.com/rcore-os/rCore.git
synced 2024-11-25 17:33:28 +04:00
parent
6544093dc6
commit
22d29a6257
@ -32,6 +32,12 @@ trap_from_kernel:
|
|||||||
* k1 = old stack pointer
|
* k1 = old stack pointer
|
||||||
* sp = kernel stack */
|
* sp = kernel stack */
|
||||||
|
|
||||||
|
#ifdef board_thinpad
|
||||||
|
#define TRAPFRAME_SIZE 304
|
||||||
|
#else
|
||||||
|
#define TRAPFRAME_SIZE 176
|
||||||
|
#endif
|
||||||
|
|
||||||
# align stack pointer
|
# align stack pointer
|
||||||
andi k0, sp, 0xf
|
andi k0, sp, 0xf
|
||||||
beqz k0, sp_aligned
|
beqz k0, sp_aligned
|
||||||
@ -39,18 +45,12 @@ trap_from_kernel:
|
|||||||
|
|
||||||
la k0, 0xfffffff0
|
la k0, 0xfffffff0
|
||||||
and k0, sp, k0
|
and k0, sp, k0
|
||||||
sw sp, -176(k0)
|
sw sp, -TRAPFRAME_SIZE(k0)
|
||||||
move sp, k0
|
move sp, k0
|
||||||
|
|
||||||
sp_aligned:
|
sp_aligned:
|
||||||
# allocate 38 / 70 words for trapframe + 6 extra words
|
# allocate 38 / 70 words for trapframe + 6 extra words
|
||||||
|
|
||||||
#ifdef board_thinpad
|
|
||||||
#define TRAPFRAME_SIZE 304
|
|
||||||
#else
|
|
||||||
#define TRAPFRAME_SIZE 176
|
|
||||||
#endif
|
|
||||||
|
|
||||||
addiu sp, sp, -TRAPFRAME_SIZE
|
addiu sp, sp, -TRAPFRAME_SIZE
|
||||||
|
|
||||||
# save general registers
|
# save general registers
|
||||||
|
Loading…
Reference in New Issue
Block a user