diff options
author | 2019-10-11 19:11:38 -0700 | |
---|---|---|
committer | 2019-10-11 19:11:55 -0700 | |
commit | 1962925cdc9e8146329cee5662e80cfe6f6fab74 (patch) | |
tree | c732b3a7eeec98e598a8e1cd4e89f22f1c5f2d1c /src/bits64/segmentation.rs | |
parent | 292fab7b00a741b1eb60361b2efb4b3a6eff2720 (diff) | |
download | rust-x86-1962925cdc9e8146329cee5662e80cfe6f6fab74.tar.gz rust-x86-1962925cdc9e8146329cee5662e80cfe6f6fab74.tar.zst rust-x86-1962925cdc9e8146329cee5662e80cfe6f6fab74.zip |
Add ist() method for DescriptorBuilder.
Diffstat (limited to 'src/bits64/segmentation.rs')
-rw-r--r-- | src/bits64/segmentation.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/bits64/segmentation.rs b/src/bits64/segmentation.rs index d246f0f..6d58a80 100644 --- a/src/bits64/segmentation.rs +++ b/src/bits64/segmentation.rs @@ -59,9 +59,10 @@ impl Descriptor64 { impl GateDescriptorBuilder<u64> for DescriptorBuilder { fn tss_descriptor(base: u64, limit: u64, available: bool) -> DescriptorBuilder { - let typ = match available { - true => DescriptorType::System64(SystemDescriptorTypes64::TssAvailable), - false => DescriptorType::System64(SystemDescriptorTypes64::TssBusy), + let typ = if available { + DescriptorType::System64(SystemDescriptorTypes64::TssAvailable) + } else { + DescriptorType::System64(SystemDescriptorTypes64::TssBusy) }; DescriptorBuilder::with_base_limit(base, limit).set_type(typ) @@ -105,6 +106,11 @@ impl BuildDescriptor<Descriptor64> for DescriptorBuilder { { assert!(!self.db); } + + if typ == SystemDescriptorTypes64::InterruptGate { + desc.set_ist(self.ist); + } + typ as u8 } Some(DescriptorType::System32(_typ)) => { |