summaryrefslogtreecommitdiff
path: root/Kernel/Thread.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-08-19 21:53:53 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-19 23:22:02 +0200
commit961f727448019047433ac1b045f8075f269ba9f7 (patch)
tree25f3972636525b96df35941cb72fc7a03e6f78e5 /Kernel/Thread.h
parent3f5a42b3dd05e56794e5a1394c6e008c15b3f58e (diff)
downloadserenity-961f727448019047433ac1b045f8075f269ba9f7.zip
Kernel: Consolidate a bunch of i386/x86_64 code paths
Add some arch-specific getters and setters that allow us to merge blocks that were previously specific to either ARCH(I386) or ARCH(X86_64).
Diffstat (limited to 'Kernel/Thread.h')
-rw-r--r--Kernel/Thread.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/Kernel/Thread.h b/Kernel/Thread.h
index c78c13b6d0..602058b4da 100644
--- a/Kernel/Thread.h
+++ b/Kernel/Thread.h
@@ -105,11 +105,23 @@ struct ThreadRegisters {
FlatPtr rsp0;
#endif
FlatPtr cs;
+
#if ARCH(I386)
FlatPtr eflags;
+ FlatPtr flags() const { return eflags; }
+ void set_flags(FlatPtr value) { eflags = value; }
+ void set_sp(FlatPtr value) { esp = value; }
+ void set_sp0(FlatPtr value) { esp0 = value; }
+ void set_ip(FlatPtr value) { eip = value; }
#else
FlatPtr rflags;
+ FlatPtr flags() const { return rflags; }
+ void set_flags(FlatPtr value) { rflags = value; }
+ void set_sp(FlatPtr value) { rsp = value; }
+ void set_sp0(FlatPtr value) { rsp0 = value; }
+ void set_ip(FlatPtr value) { rip = value; }
#endif
+
FlatPtr cr3;
FlatPtr ip() const