aboutsummaryrefslogtreecommitdiff
path: root/src/bits64/task.rs
diff options
context:
space:
mode:
authorGravatar Colin Finck <mail@colinfinck.de> 2017-10-19 17:11:29 +0200
committerGravatar Colin Finck <mail@colinfinck.de> 2017-10-19 17:11:29 +0200
commit1e78c7f4b8e705cc6687191afa39090ecbe35dfd (patch)
treeb61b02cc2611fedcf43e77c369ed77890faf4030 /src/bits64/task.rs
parent8428a8d70a04534451f8ce858af5481b4d2f4211 (diff)
downloadrust-x86-1e78c7f4b8e705cc6687191afa39090ecbe35dfd.tar.gz
rust-x86-1e78c7f4b8e705cc6687191afa39090ecbe35dfd.tar.zst
rust-x86-1e78c7f4b8e705cc6687191afa39090ecbe35dfd.zip
Split up shared::segmentation into bits32::segmentation and bits64::segmentation and implement specifics of each architecture.
- Provide two functions new_memory and new_tss to comfortably create memory and TSS descriptors. The x86-64 version of new_tss outputs an array of 2 descriptors to account for the upper bits of the TSS pointer address. - Add a bitness parameter to the x86-64 version of new_memory to allow creating segments for 32-bit and 64-bit code. - Fix a copy-pasta mistake in the x86 version of set_cs.
Diffstat (limited to 'src/bits64/task.rs')
-rw-r--r--src/bits64/task.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/bits64/task.rs b/src/bits64/task.rs
index 1d98bad..c7dc781 100644
--- a/src/bits64/task.rs
+++ b/src/bits64/task.rs
@@ -1,16 +1,11 @@
//! Helpers to program the task state segment.
//! See Intel 3a, Chapter 7, Section 7
-use shared::segmentation;
-
-pub type TaskStateDescriptorLow = segmentation::SegmentDescriptor;
-pub type TaskStateDescriptorHigh = u64;
-
/// In 64-bit mode the TSS holds information that is not
/// directly related to the task-switch mechanism,
/// but is used for finding kernel level stack
/// if interrupts arrive while in kernel mode.
-#[derive(Debug)]
+#[derive(Clone, Copy, Debug)]
#[repr(C, packed)]
pub struct TaskStateSegment {
pub reserved: u32,