aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/io/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/io/io.c')
-rw-r--r--src/kernel/io/io.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/kernel/io/io.c b/src/kernel/io/io.c
index ad63c88..2d9d009 100644
--- a/src/kernel/io/io.c
+++ b/src/kernel/io/io.c
@@ -22,6 +22,20 @@ u32 inl(u16 port)
return value;
}
+u32 cpu_flags()
+{
+ u32 flags;
+ asm volatile("pushf\n"
+ "pop %0\n"
+ : "=rm"(flags)::"memory");
+ return flags;
+}
+
+int interrupts_enabled()
+{
+ return (cpu_flags() & 0x200) == 0x200;
+}
+
void cli()
{
asm volatile("cli");