File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,9 @@ impl GlobalDescriptorTable {
48
48
limit : ( self . table . len ( ) * size_of :: < u64 > ( ) - 1 ) as u16 ,
49
49
} ;
50
50
51
- llvm_asm ! ( "lgdt ($0)" :: "r" ( & ptr) : "memory" ) ;
51
+ unsafe {
52
+ llvm_asm ! ( "lgdt ($0)" :: "r" ( & ptr) : "memory" ) ;
53
+ }
52
54
}
53
55
54
56
#[ inline]
@@ -156,13 +158,13 @@ impl Descriptor {
156
158
Descriptor ( val)
157
159
}
158
160
159
- fn with_flat_limit ( self ) -> Self {
161
+ fn with_flat_limit ( mut self ) -> Self {
160
162
// limit_low
161
163
self . 0 . set_bits ( 0 ..16 , 0xffff ) ;
162
164
// limit high
163
165
self . 0 . set_bits ( 48 ..52 , 0xff ) ;
164
166
// granularity
165
- self . 0 |= DescriptorFlags :: GRANULARITY ;
167
+ self . 0 |= DescriptorFlags :: GRANULARITY . bits ( ) ;
166
168
167
169
self
168
170
}
@@ -238,7 +240,7 @@ pub struct Stack {
238
240
}
239
241
240
242
impl Stack {
241
- fn zero ( ) -> Self {
243
+ const fn zero ( ) -> Self {
242
244
Stack { esp : 0 , ss : 0 }
243
245
}
244
246
}
Original file line number Diff line number Diff line change 1
1
use core:: marker:: PhantomData ;
2
+ use bit_field:: BitField ;
2
3
3
4
/// An Interrupt Descriptor Table with 32 entries.
4
5
#[ derive( Clone ) ]
You can’t perform that action at this time.
0 commit comments