1
0
mirror of https://github.com/rcore-os/rCore.git synced 2024-11-25 17:33:28 +04:00

Revert "Revert "Fix trapframe.""

This reverts commit 6a83de7846.
This commit is contained in:
Harry Chen 2019-05-14 00:11:25 +08:00
parent 6544093dc6
commit 22d29a6257

View File

@ -32,6 +32,12 @@ trap_from_kernel:
* k1 = old stack pointer
* sp = kernel stack */
#ifdef board_thinpad
#define TRAPFRAME_SIZE 304
#else
#define TRAPFRAME_SIZE 176
#endif
# align stack pointer
andi k0, sp, 0xf
beqz k0, sp_aligned
@ -39,18 +45,12 @@ trap_from_kernel:
la k0, 0xfffffff0
and k0, sp, k0
sw sp, -176(k0)
sw sp, -TRAPFRAME_SIZE(k0)
move sp, k0
sp_aligned:
# 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
# save general registers