aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2017-03-06 02:15:28 +0100
committerRobin Krahl <robin.krahl@ireas.org>2017-03-06 02:15:28 +0100
commit28301499381cb541eec4eb99f61e3d1a193c5a2d (patch)
treeec59121d1b3a83d66d9105c3e0b828f49a56dc10 /core
parent9113c143c377876cc750e007e99f76c844bc95e8 (diff)
downloadgarmos-28301499381cb541eec4eb99f61e3d1a193c5a2d.tar.gz
garmos-28301499381cb541eec4eb99f61e3d1a193c5a2d.tar.bz2
gdt: expose code segment offset in GDT
gdt_get_code_offset() returns the offset of the code segment in the GDT relative to the address of the GDT itself. This offset is for example required when setting the interrupt desriptor table.
Diffstat (limited to 'core')
-rw-r--r--core/gdt.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/gdt.c b/core/gdt.c
index 708e2c5..b59bf9e 100644
--- a/core/gdt.c
+++ b/core/gdt.c
@@ -74,3 +74,8 @@ void gdt_init(void)
gdtset(gdtp);
}
+
+uint16_t gdt_get_code_offset(void)
+{
+ return GDT_SGMT_CODE * sizeof(*gdt);
+}