File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
src/aero_kernel/src/arch/x86_64 Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -80,8 +80,9 @@ sysret_fork_init:
80
80
81
81
o64 sysret
82
82
83
- ; This function is responsible for switching from the current context to the new one and
84
- ; also save the current state in the previous context so there is a restore point.
83
+ ; extern "C" fn task_spinup(prev: &mut Context, next: &mut Context)
84
+ ;
85
+ ; Saves the current context into `prev` and restore the context from `next`.
85
86
task_spinup:
86
87
pushfq
87
88
@@ -112,4 +113,5 @@ task_spinup:
112
113
113
114
popfq
114
115
116
+ ; Resume the next thread.
115
117
ret
Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ use core::ptr::Unique;
28
28
use crate :: fs:: cache:: DirCacheItem ;
29
29
use crate :: mem:: paging:: * ;
30
30
use crate :: syscall:: { ExecArgs , RegistersFrame , SyscallFrame } ;
31
- use crate :: userland:: vm:: { LoadedBinary , Vm } ;
32
- use crate :: utils:: StackHelper ;
31
+ use crate :: userland:: vm:: Vm ;
32
+ use crate :: utils:: { io , StackHelper } ;
33
33
34
34
use super :: controlregs;
35
35
use super :: gdt:: Ring ;
@@ -278,7 +278,9 @@ impl ArchTask {
278
278
context_switch_rsp : VirtAddr :: new ( switch_stack as u64 ) ,
279
279
address_space : new_address_space,
280
280
rpl : Ring :: Ring3 ,
281
- fs_base : VirtAddr :: zero ( ) ,
281
+
282
+ // The FS base is inherited from the parent process.
283
+ fs_base : self . fs_base . clone ( ) ,
282
284
} )
283
285
}
284
286
You can’t perform that action at this time.
0 commit comments