summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-03-05 13:33:50 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-03-05 13:34:36 +0100
commit1cc32ebc7e1c6b14b6d79293494e5f6bd098f60d (patch)
treed0ca5998b753839531f7af94fbae4e7f94c3b4c4
parent91031346e5cbac0e432d64fbdbeae42f7983cf7a (diff)
downloadserenity-1cc32ebc7e1c6b14b6d79293494e5f6bd098f60d.zip
Kernel: Remove "requested wakeups" feature.
I only needed this to support the WindowServer living inside the kernel. Now that it's been migrated to userspace, this can go. :^)
-rw-r--r--Kernel/Process.cpp10
-rw-r--r--Kernel/Process.h4
-rw-r--r--Kernel/Scheduler.cpp5
3 files changed, 3 insertions, 16 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp
index 43b8d98c58..5d1cd3ceb5 100644
--- a/Kernel/Process.cpp
+++ b/Kernel/Process.cpp
@@ -1029,10 +1029,8 @@ void Process::create_signal_trampolines_if_needed()
*(dword*)code_ptr = Syscall::SC_restore_signal_mask;
code_ptr += sizeof(dword);
*code_ptr++ = 0xcd; // int 0x82
-
// NOTE: Stack alignment padding doesn't matter when returning to ring0.
// Nothing matters really, as we're returning by replacing the entire TSS.
-
*code_ptr++ = 0x82;
*code_ptr++ = 0xb8; // mov eax, <dword>
*(dword*)code_ptr = Syscall::SC_sigreturn;
@@ -2151,14 +2149,13 @@ int Process::sys$select(const Syscall::SC_select_params* params)
return error;
#ifdef DEBUG_IO
- dbgprintf("%s<%u> selecting on (read:%u, write:%u), wakeup_req:%u, timeout=%p\n", name().characters(), pid(), m_select_read_fds.size(), m_select_write_fds.size(), m_wakeup_requested, timeout);
+ dbgprintf("%s<%u> selecting on (read:%u, write:%u), timeout=%p\n", name().characters(), pid(), m_select_read_fds.size(), m_select_write_fds.size(), timeout);
#endif
- if (!m_wakeup_requested && (!timeout || (timeout->tv_sec || timeout->tv_usec))) {
+ if (!timeout || (timeout->tv_sec || timeout->tv_usec)) {
block(BlockedSelect);
Scheduler::yield();
}
- m_wakeup_requested = false;
int markedfds = 0;
@@ -2209,11 +2206,10 @@ int Process::sys$poll(pollfd* fds, int nfds, int timeout)
m_select_write_fds.append(fds[i].fd);
}
- if (!m_wakeup_requested && timeout < 0) {
+ if (timeout < 0) {
block(BlockedSelect);
Scheduler::yield();
}
- m_wakeup_requested = false;
int fds_with_revents = 0;
diff --git a/Kernel/Process.h b/Kernel/Process.h
index 70cc33f220..36e6f0bd19 100644
--- a/Kernel/Process.h
+++ b/Kernel/Process.h
@@ -295,9 +295,6 @@ public:
bool is_superuser() const { return m_euid == 0; }
- bool wakeup_requested() { return m_wakeup_requested; }
- void request_wakeup() { m_wakeup_requested = true; }
-
FPUState& fpu_state() { return m_fpu_state; }
bool has_used_fpu() const { return m_has_used_fpu; }
void set_has_used_fpu(bool b) { m_has_used_fpu = b; }
@@ -406,7 +403,6 @@ private:
RetainPtr<Region> m_display_framebuffer_region;
- dword m_wakeup_requested { false };
bool m_has_used_fpu { false };
};
diff --git a/Kernel/Scheduler.cpp b/Kernel/Scheduler.cpp
index 032ca74ab1..c2c49ecaa9 100644
--- a/Kernel/Scheduler.cpp
+++ b/Kernel/Scheduler.cpp
@@ -99,11 +99,6 @@ bool Scheduler::pick_next()
}
if (process.state() == Process::BlockedSelect) {
- if (process.wakeup_requested()) {
- process.m_wakeup_requested = false;
- process.unblock();
- return true;
- }
if (process.m_select_has_timeout) {
auto now_sec = RTC::now();
auto now_usec = PIT::ticks_since_boot() % 1000;