Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Rust toolchain to nightly-2021-03-04 #93

Merged
merged 6 commits into from
Mar 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ dist: xenial
language: rust

rust:
- nightly-2020-10-01
- nightly-2021-03-04
env:
- RUSTFLAGS="-D warnings"

24 changes: 8 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -26,10 +26,10 @@ coreboot = []

[dependencies]
bitflags = "1.2"
x86_64 = "0.13.1"
x86_64 = "0.13.2"
atomic_refcell = "0.1"
r-efi = "3.2.0"
uart_16550 = "0.2.10"
uart_16550 = "0.2.12"
linked_list_allocator = "0.8.11"

[dev-dependencies]
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2020-10-01
nightly-2021-03-04
2 changes: 1 addition & 1 deletion src/efi/block.rs
Original file line number Diff line number Diff line change
@@ -190,7 +190,7 @@ impl<'a> BlockWrapper<'a> {
AllocateType::AllocateAnyPages,
MemoryType::LoaderData,
((size + super::PAGE_SIZE as usize - 1) / super::PAGE_SIZE as usize) as u64,
0 as u64,
0_u64,
);

let bw = new_address as *mut BlockWrapper;
3 changes: 2 additions & 1 deletion src/efi/file.rs
Original file line number Diff line number Diff line change
@@ -136,6 +136,7 @@ pub extern "win64" fn set_position(_: *mut FileProtocol, _: u64) -> Status {
Status::UNSUPPORTED
}

#[allow(unused)]
struct FileInfo {
size: u64,
file_size: u64,
@@ -212,7 +213,7 @@ impl<'a> FileSystemWrapper<'a> {
AllocateType::AllocateAnyPages,
MemoryType::LoaderData,
((size + super::PAGE_SIZE as usize - 1) / super::PAGE_SIZE as usize) as u64,
0 as u64,
0_u64,
);

if status == Status::SUCCESS {
17 changes: 9 additions & 8 deletions src/fat.rs
Original file line number Diff line number Diff line change
@@ -104,6 +104,7 @@ pub struct Filesystem<'a> {
first_fat_sector: u32,
first_data_sector: u32,
data_sector_count: u32,
#[allow(unused)]
data_cluster_count: u32,
root_cluster: u32, // FAT32 only
}
@@ -675,7 +676,7 @@ mod tests {
Err(super::Error::EndOfFile) => {
break;
}
Err(e) => panic!(e),
Err(e) => panic!("{:?}", e),
}
}

@@ -713,7 +714,7 @@ mod tests {
Err(super::Error::EndOfFile) => {
break;
}
Err(e) => panic!(e),
Err(e) => panic!("{:?}", e),
}
}

@@ -730,7 +731,7 @@ mod tests {
Err(super::Error::EndOfFile) => {
break;
}
Err(e) => panic!(e),
Err(e) => panic!("{:?}", e),
}
}

@@ -748,7 +749,7 @@ mod tests {
Err(super::Error::EndOfFile) => {
break;
}
Err(e) => panic!(e),
Err(e) => panic!("{:?}", e),
}
}
assert_eq!(bytes_so_far, f.size);
@@ -769,10 +770,10 @@ mod tests {
assert_eq!(f.sectors, 1_046_528);
assert_eq!(f.fat_type, super::FatType::FAT16);
}
Err(e) => panic!(e),
Err(e) => panic!("{:?}", e),
}
}
Err(e) => panic!(e),
Err(e) => panic!("{:?}", e),
}
}

@@ -788,10 +789,10 @@ mod tests {
assert_eq!(file.active_cluster, 166);
assert_eq!(file.size, 92789);
}
Err(e) => panic!(e),
Err(e) => panic!("{:?}", e),
}
}
Err(e) => panic!(e),
Err(e) => panic!("{:?}", e),
}
}

2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
// limitations under the License.

#![feature(alloc_error_handler)]
#![feature(global_asm, const_in_array_repeat_expressions)]
#![feature(global_asm)]
#![cfg_attr(not(test), no_std)]
#![cfg_attr(not(test), no_main)]
#![cfg_attr(test, allow(unused_imports, dead_code))]
3 changes: 2 additions & 1 deletion src/paging.rs
Original file line number Diff line number Diff line change
@@ -6,14 +6,15 @@ use x86_64::{

// Amount of memory we identity map in setup(), max 512 GiB.
const ADDRESS_SPACE_GIB: usize = 4;
const TABLE: PageTable = PageTable::new();

// Put the Page Tables in static muts to make linking easier
#[no_mangle]
static mut L4_TABLE: PageTable = PageTable::new();
#[no_mangle]
static mut L3_TABLE: PageTable = PageTable::new();
#[no_mangle]
static mut L2_TABLES: [PageTable; ADDRESS_SPACE_GIB] = [PageTable::new(); ADDRESS_SPACE_GIB];
static mut L2_TABLES: [PageTable; ADDRESS_SPACE_GIB] = [TABLE; ADDRESS_SPACE_GIB];

pub fn setup() {
// SAFETY: This function is idempontent and only writes to static memory and
2 changes: 1 addition & 1 deletion src/part.rs
Original file line number Diff line number Diff line change
@@ -199,7 +199,7 @@ pub mod tests {
assert_eq!(start, 2048);
assert_eq!(end, 1_048_575);
}
Err(e) => panic!(e),
Err(e) => panic!("{:?}", e),
}
}
}