File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1
1
//! Types for the Global Descriptor Table and segment selectors.
2
2
3
- use crate :: structures:: { tss:: TaskStateSegment , DescriptorTablePointer } ;
4
3
use crate :: PrivilegeLevel ;
4
+ use crate :: {
5
+ structures:: { tss:: TaskStateSegment , DescriptorTablePointer } ,
6
+ VirtAddr ,
7
+ } ;
5
8
use bit_field:: BitField ;
6
9
use bitflags:: bitflags;
7
10
use core:: fmt;
@@ -169,7 +172,7 @@ impl GlobalDescriptorTable {
169
172
fn pointer ( & self ) -> DescriptorTablePointer {
170
173
use core:: mem:: size_of;
171
174
DescriptorTablePointer {
172
- base : self . table . as_ptr ( ) as u64 ,
175
+ base : VirtAddr :: new ( self . table . as_ptr ( ) as u64 ) ,
173
176
limit : ( self . next_free * size_of :: < u64 > ( ) - 1 ) as u16 ,
174
177
}
175
178
}
Original file line number Diff line number Diff line change @@ -440,7 +440,7 @@ impl InterruptDescriptorTable {
440
440
fn pointer ( & self ) -> DescriptorTablePointer {
441
441
use core:: mem:: size_of;
442
442
DescriptorTablePointer {
443
- base : self as * const _ as u64 ,
443
+ base : VirtAddr :: new ( self as * const _ as u64 ) ,
444
444
limit : ( size_of :: < Self > ( ) - 1 ) as u16 ,
445
445
}
446
446
}
Original file line number Diff line number Diff line change 1
1
//! Representations of various x86 specific structures and descriptor tables.
2
2
3
+ use crate :: VirtAddr ;
4
+
3
5
pub mod gdt;
4
6
5
7
// idt needs `feature(abi_x86_interrupt)`, which is not available on stable rust
@@ -18,5 +20,5 @@ pub struct DescriptorTablePointer {
18
20
/// Size of the DT.
19
21
pub limit : u16 ,
20
22
/// Pointer to the memory region containing the DT.
21
- pub base : u64 ,
23
+ pub base : VirtAddr ,
22
24
}
You can’t perform that action at this time.
0 commit comments