3 Commits 4602c4d71c ... e037208da1

Autor SHA1 Mensagem Data
  greatbridf e037208da1 fix(exit): skip checking whether the children have an init parent 3 semanas atrás
  greatbridf b8a282ecb6 fix(context): new version rustc says we should use naked_asm 3 semanas atrás
  greatbridf 980f18bf51 fix: add smp boot option to qemu run 3 semanas atrás
3 arquivos alterados com 5 adições e 10 exclusões
  1. 1 1
      Makefile.src
  2. 3 3
      arch/src/x86_64/context.rs
  3. 1 6
      src/kernel/task/thread.rs

+ 1 - 1
Makefile.src

@@ -4,7 +4,7 @@ GDB_BIN=##PLACEHOLDER_2##
 QEMU_ACCELERATION_FLAG=##PLACEHOLDER_3##
 QEMU_DEBUG_FLAG=#-d cpu_reset,int
 QEMU_ARGS=-machine q35 -drive id=disk,file=build/boot.img,format=raw,if=none \
-	-device ahci,id=ahci -device ide-hd,drive=disk,bus=ahci.0 \
+	-device ahci,id=ahci -device ide-hd,drive=disk,bus=ahci.0 -smp 4 \
 	-no-reboot -no-shutdown $(QEMU_ACCELERATION_FLAG) $(QEMU_DEBUG_FLAG)
 
 CROSS_COMPILE=##PLACEHOLDER_4##

+ 3 - 3
arch/src/x86_64/context.rs

@@ -1,4 +1,4 @@
-use core::arch::asm;
+use core::arch::naked_asm;
 
 #[repr(C)]
 #[derive(Debug, Default)]
@@ -48,7 +48,7 @@ impl TaskContext {
 
 #[naked]
 unsafe extern "C" fn _switch_to(current_context_sp: &mut u64, next_context_sp: &mut u64) {
-    asm!(
+    naked_asm!(
         "pushf",
         "push %rbp",
         "push %rbx",
@@ -66,6 +66,6 @@ unsafe extern "C" fn _switch_to(current_context_sp: &mut u64, next_context_sp: &
         "pop %rbp",
         "popf",
         "ret",
-        options(att_syntax, noreturn),
+        options(att_syntax),
     );
 }

+ 1 - 6
src/kernel/task/thread.rs

@@ -512,12 +512,7 @@ impl ProcessList {
 
             inner.children.retain(|_, child| {
                 let child = child.upgrade().unwrap();
-                let mut child_inner = child.process.inner.lock();
-                if child_inner.parent.as_ref().unwrap() == &self.init {
-                    return false;
-                }
-
-                child_inner.parent = Some(self.init.clone());
+                child.process.inner.lock().parent = Some(self.init.clone());
                 init_inner.add_child(&child);
 
                 false