11//! Types for the Global Descriptor Table and segment selectors.
22
33pub use crate :: registers:: segmentation:: SegmentSelector ;
4- use crate :: structures:: tss:: TaskStateSegment ;
4+ use crate :: structures:: tss:: { InvalidIoMap , TaskStateSegment } ;
55use crate :: PrivilegeLevel ;
66use bit_field:: BitField ;
77use bitflags:: bitflags;
88use core:: { cmp, fmt, mem} ;
99// imports for intra-doc links
1010#[ cfg( doc) ]
1111use crate :: registers:: segmentation:: { Segment , CS , SS } ;
12- use crate :: structures:: tss:: InvalidIoMap ;
1312
1413#[ cfg( all( feature = "instructions" , target_arch = "x86_64" ) ) ]
1514use core:: sync:: atomic:: { AtomicU64 as EntryValue , Ordering } ;
@@ -450,23 +449,23 @@ impl Descriptor {
450449 iomap : & ' static [ u8 ] ,
451450 ) -> Result < Descriptor , InvalidIoMap > {
452451 if iomap. len ( ) > 8193 {
453- return Err ( InvalidIoMap :: TooLong { len : iomap. len ( ) } )
452+ return Err ( InvalidIoMap :: TooLong { len : iomap. len ( ) } ) ;
454453 }
455454
456455 let base = iomap. as_ptr ( ) as usize - tss as * const _ as usize ;
457456 if base > 0xdfff {
458- return Err ( InvalidIoMap :: TooFarFromTss { distance : base } )
457+ return Err ( InvalidIoMap :: TooFarFromTss { distance : base } ) ;
459458 }
460459
461460 let last_byte = * iomap. last ( ) . unwrap_or ( & 0xff ) ;
462461 if last_byte != 0xff {
463- return Err ( InvalidIoMap :: InvalidTerminatingByte { byte : last_byte } )
462+ return Err ( InvalidIoMap :: InvalidTerminatingByte { byte : last_byte } ) ;
464463 }
465464
466465 if tss. iomap_base != base as u16 {
467466 return Err ( InvalidIoMap :: InvalidBase {
468467 expected : base as u16 ,
469- got : tss. iomap_base
468+ got : tss. iomap_base ,
470469 } ) ;
471470 }
472471
@@ -481,10 +480,7 @@ impl Descriptor {
481480 /// There must be a valid IO map at `(tss as *const u8).offset(tss.iomap_base)`
482481 /// of length `iomap_size`, with the terminating `0xFF` byte. Additionally, `iomap_base` must
483482 /// not exceed `0xDFFF`.
484- unsafe fn tss_segment_raw (
485- tss : * const TaskStateSegment ,
486- iomap_size : u16 ,
487- ) -> Descriptor {
483+ unsafe fn tss_segment_raw ( tss : * const TaskStateSegment , iomap_size : u16 ) -> Descriptor {
488484 use self :: DescriptorFlags as Flags ;
489485
490486 let ptr = tss as u64 ;
0 commit comments