fix bug in inline assembler
This commit is contained in:
parent
b9b962ea73
commit
50b8068a78
1 changed files with 8 additions and 8 deletions
|
@ -89,23 +89,23 @@ int arch_fork(task_t* task)
|
|||
esp += (uint32_t) kstacks[id];
|
||||
|
||||
state = (struct state*) (esp - sizeof(struct state) + 2*sizeof(size_t));
|
||||
memset(state, 0x00, sizeof(struct state) - 2*sizeof(size_t));
|
||||
|
||||
asm volatile ("pusha");
|
||||
asm volatile ("pop %0" : "=r"(state->edi));
|
||||
asm volatile ("pusha; pop %0" : "=r"(state->edi));
|
||||
asm volatile ("pop %0" : "=r"(state->esi));
|
||||
asm volatile ("pop %0" : "=r"(state->ebp));
|
||||
#ifdef WITH_FRAME_POINTER
|
||||
state->ebp -= (uint32_t) kstacks[curr_task->id];
|
||||
state->ebp += (uint32_t) kstacks[id];
|
||||
#endif
|
||||
asm volatile ("add $4, %%esp" ::: "%esp");
|
||||
state->esp = (uint32_t) state;
|
||||
task->stack = (size_t*) state;
|
||||
asm volatile ("pop %0" : "=r"(state->ebx));
|
||||
asm volatile ("pop %0" : "=r"(state->edx));
|
||||
asm volatile ("pop %0" : "=r"(state->ecx));
|
||||
asm volatile ("pop %0" : "=r"(state->eax));
|
||||
|
||||
#ifdef WITH_FRAME_POINTER
|
||||
state->ebp -= (uint32_t) kstacks[curr_task->id];
|
||||
state->ebp += (uint32_t) kstacks[id];
|
||||
#endif
|
||||
state->esp = (uint32_t) state;
|
||||
task->stack = (size_t*) state;
|
||||
state->int_no = 0xB16B00B5;
|
||||
state->error = 0xC03DB4B3;
|
||||
state->cs = cs;
|
||||
|
|
Loading…
Add table
Reference in a new issue