aboutsummaryrefslogtreecommitdiff
path: root/src/task.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/task.rs')
-rw-r--r--src/task.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/task.rs b/src/task.rs
new file mode 100644
index 0000000..b0dd2ff
--- /dev/null
+++ b/src/task.rs
@@ -0,0 +1,9 @@
+//! Helpers to program the task state segment.
+//! See Intel 3a, Chapter 7
+
+pub use ::segmentation;
+
+/// Load the task state register.
+pub unsafe fn load_tr(sel: segmentation::SegmentSelector) {
+ asm!("ltr $0" :: "r" (sel.bits()));
+}