File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -322,7 +322,6 @@ impl Descriptor {
322
322
iomap_size : u16 ,
323
323
) -> Descriptor {
324
324
use self :: DescriptorFlags as Flags ;
325
- use core:: mem:: size_of;
326
325
327
326
let ptr = tss as * const _ as u64 ;
328
327
@@ -331,10 +330,10 @@ impl Descriptor {
331
330
low. set_bits ( 16 ..40 , ptr. get_bits ( 0 ..24 ) ) ;
332
331
low. set_bits ( 56 ..64 , ptr. get_bits ( 24 ..32 ) ) ;
333
332
// limit (the `-1` is needed since the bound is inclusive)
334
- let iomap_limit = tss. iomap_base as u64 + iomap_size as u64 - 1 ;
333
+ let iomap_limit = tss. iomap_base as u64 + iomap_size as u64 ;
335
334
low. set_bits (
336
335
0 ..16 ,
337
- cmp:: max ( mem:: size_of :: < TaskStateSegment > ( ) as u64 , iomap_limit) ,
336
+ cmp:: max ( mem:: size_of :: < TaskStateSegment > ( ) as u64 , iomap_limit) - 1 ,
338
337
) ;
339
338
// type (0b1001 = available 64-bit tss)
340
339
low. set_bits ( 40 ..44 , 0b1001 ) ;
You can’t perform that action at this time.
0 commit comments