summaryrefslogtreecommitdiff
path: root/Kernel/i386.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2018-11-08 16:09:05 +0100
committerAndreas Kling <awesomekling@gmail.com>2018-11-08 16:09:05 +0100
commit992769c9d4610de85e0dd88d53a0008e9bcba090 (patch)
treea5786a064df0eeefa7267c915bafc287a72aa3ff /Kernel/i386.h
parentabdf24cb7316994614ecfe50d83d40934dc0f7e5 (diff)
downloadserenity-992769c9d4610de85e0dd88d53a0008e9bcba090.zip
Make Process::for_each...() functions inline and allocation-free.
AK::Function is very handy, but costs us an 8-byte allocation. Let's not have kmalloc() calls in the scheduler hot path.
Diffstat (limited to 'Kernel/i386.h')
-rw-r--r--Kernel/i386.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Kernel/i386.h b/Kernel/i386.h
index 10ad9ea4ba..0eaae76ce0 100644
--- a/Kernel/i386.h
+++ b/Kernel/i386.h
@@ -92,6 +92,11 @@ static inline dword cpuFlags()
return flags;
}
+inline bool are_interrupts_enabled()
+{
+ return cpuFlags() & 0x200;
+}
+
class InterruptDisabler {
public:
InterruptDisabler()