add memory barriers to seralize load and store operations
=> required to clone a task
This commit is contained in:
parent
837bc3ebe1
commit
6013c2ec4d
1 changed files with 2 additions and 0 deletions
|
@ -67,7 +67,9 @@ int arch_fork(task_t* task)
|
||||||
id = task->id;
|
id = task->id;
|
||||||
|
|
||||||
// copy kernel stack of the current task
|
// copy kernel stack of the current task
|
||||||
|
mb();
|
||||||
memcpy(kstacks[id], kstacks[curr_task->id], KERNEL_STACK_SIZE);
|
memcpy(kstacks[id], kstacks[curr_task->id], KERNEL_STACK_SIZE);
|
||||||
|
mb();
|
||||||
|
|
||||||
#ifdef CONFIG_X86_32
|
#ifdef CONFIG_X86_32
|
||||||
asm volatile ("mov %%esp, %0" : "=r"(esp));
|
asm volatile ("mov %%esp, %0" : "=r"(esp));
|
||||||
|
|
Loading…
Add table
Reference in a new issue