Skip to content

Commit df73047

Browse files
committed
Fix build errors
1 parent d1a307f commit df73047

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/v86/src/gdt.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ impl GlobalDescriptorTable {
4848
limit: (self.table.len() * size_of::<u64>() - 1) as u16,
4949
};
5050

51-
llvm_asm!("lgdt ($0)" :: "r" (&ptr) : "memory");
51+
unsafe {
52+
llvm_asm!("lgdt ($0)" :: "r" (&ptr) : "memory");
53+
}
5254
}
5355

5456
#[inline]
@@ -156,13 +158,13 @@ impl Descriptor {
156158
Descriptor(val)
157159
}
158160

159-
fn with_flat_limit(self) -> Self {
161+
fn with_flat_limit(mut self) -> Self {
160162
// limit_low
161163
self.0.set_bits(0..16, 0xffff);
162164
// limit high
163165
self.0.set_bits(48..52, 0xff);
164166
// granularity
165-
self.0 |= DescriptorFlags::GRANULARITY;
167+
self.0 |= DescriptorFlags::GRANULARITY.bits();
166168

167169
self
168170
}
@@ -238,7 +240,7 @@ pub struct Stack {
238240
}
239241

240242
impl Stack {
241-
fn zero() -> Self {
243+
const fn zero() -> Self {
242244
Stack { esp: 0, ss: 0 }
243245
}
244246
}

src/v86/src/idt.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use core::marker::PhantomData;
2+
use bit_field::BitField;
23

34
/// An Interrupt Descriptor Table with 32 entries.
45
#[derive(Clone)]

0 commit comments

Comments
 (0)