summaryrefslogtreecommitdiff
path: root/Kernel/i8253.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2018-11-01 13:15:46 +0100
committerAndreas Kling <awesomekling@gmail.com>2018-11-01 13:15:46 +0100
commit3e532ac7b6ffeb5c0b0034a7fb2035c4c5756b25 (patch)
treea587862246012ed41a46e47d50fc218bbc75e539 /Kernel/i8253.cpp
parent4e60551aec48297c29bda3718ade03b4e4063080 (diff)
downloadserenity-3e532ac7b6ffeb5c0b0034a7fb2035c4c5756b25.zip
Process now maps regions immediately when they are allocated.
This avoids having to do a separate MM.mapRegionsForTask() pass. Also, more Task => Process renaming that I apparently hadn't saved yet.
Diffstat (limited to 'Kernel/i8253.cpp')
-rw-r--r--Kernel/i8253.cpp22
1 files changed, 4 insertions, 18 deletions
diff --git a/Kernel/i8253.cpp b/Kernel/i8253.cpp
index 8a9e466f1f..0ab08f6527 100644
--- a/Kernel/i8253.cpp
+++ b/Kernel/i8253.cpp
@@ -2,7 +2,7 @@
#include "i386.h"
#include "IO.h"
#include "VGA.h"
-#include "Task.h"
+#include "Process.h"
#include "system.h"
#include "PIC.h"
@@ -77,8 +77,6 @@ void clock_handle()
if (current->tick())
return;
- //return;
-
auto& regs = *reinterpret_cast<RegisterDump*>(state_dump);
current->tss().gs = regs.gs;
current->tss().fs = regs.fs;
@@ -95,31 +93,19 @@ void clock_handle()
current->tss().cs = regs.cs;
current->tss().eflags = regs.eflags;
- // Compute task ESP.
+ // Compute process stack pointer.
// Add 12 for CS, EIP, EFLAGS (interrupt mechanic)
-
- // FIXME: Hmm. Should we add an extra 8 here for SS:ESP in some cases?
- // If this IRQ occurred while in a user task, wouldn't that also push the stack ptr?
current->tss().esp = regs.esp + 12;
-
current->tss().ss = regs.ss;
if ((current->tss().cs & 3) != 0) {
-#if 0
- dbgprintf("clock'ed across to ring0\n");
- dbgprintf("code: %w:%x\n", current->tss().cs, current->tss().eip);
- dbgprintf(" stk: %w:%x\n", current->tss().ss, current->tss().esp);
- dbgprintf("astk: %w:%x\n", regs.ss_if_crossRing, regs.esp_if_crossRing);
- //HANG;
-#endif
current->tss().ss = regs.ss_if_crossRing;
current->tss().esp = regs.esp_if_crossRing;
}
- // Prepare a new task to run;
- if (!scheduleNewTask())
+ if (!scheduleNewProcess())
return;
- Task::prepForIRETToNewTask();
+ Process::prepForIRETToNewProcess();
// Set the NT (nested task) flag.
asm(