Updated dependencies (incl. major version bumps) and Rust toolchain.

master
James T. Martin 2020-10-24 15:06:03 -07:00
parent 78bb8f0fdd
commit cca76dc53f
Signed by: james
GPG Key ID: 4B7F3DA9351E577C
3 changed files with 25 additions and 25 deletions

38
Cargo.lock generated
View File

@ -2,9 +2,9 @@
# It is not intended for manual editing.
[[package]]
name = "autocfg"
version = "1.0.0"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d"
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
[[package]]
name = "bit_field"
@ -14,9 +14,9 @@ checksum = "ed8765909f9009617974ab6b7d332625b320b33c326b1e9321382ef1999b5d56"
[[package]]
name = "bit_field"
version = "0.10.0"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a165d606cf084741d4ac3a28fb6e9b1eb0bd31f6cd999098cfddb0b2ab381dc0"
checksum = "dcb6dd1c2376d2e096796e234a70e17e94cc2d5d54ff8ce42b28cef1d0d359a4"
[[package]]
name = "bitflags"
@ -43,8 +43,8 @@ checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]]
name = "compiler_builtins"
version = "0.1.32"
source = "git+https://github.com/rust-lang/compiler-builtins#f3846bc05da87b8a71cd1a5a6ff9d980f46b2d0f"
version = "0.1.36"
source = "git+https://github.com/rust-lang/compiler-builtins#33ad3669db0ac78a917aee787304d1391b6dc676"
[[package]]
name = "log"
@ -76,9 +76,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.19"
version = "1.0.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12"
checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71"
dependencies = [
"unicode-xid",
]
@ -94,9 +94,9 @@ dependencies = [
[[package]]
name = "syn"
version = "1.0.35"
version = "1.0.48"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb7f4c519df8c117855e19dd8cc851e89eb746fe7a73f0157e0d95fdec5369b0"
checksum = "cc371affeffc477f42a221a1e4297aedcea33d47d19b61455588bd9d8f6b19ac"
dependencies = [
"proc-macro2",
"quote",
@ -105,18 +105,18 @@ dependencies = [
[[package]]
name = "ucs2"
version = "0.3.1"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85061f4e43545a613c0da6b87725bf23f8da8613cf2473719c4f71a270c4ce8a"
checksum = "bad643914094137d475641b6bab89462505316ec2ce70907ad20102d28a79ab8"
dependencies = [
"bit_field 0.10.0",
"bit_field 0.10.1",
]
[[package]]
name = "uefi"
version = "0.4.7"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08fcd8a8b1c2488ea5adb67f3840584557a7089150c6f209148567397f767e12"
checksum = "43cbf498e073acb4d1f5bd59b5347757b495163ecfce9d18db81c44b99a542fa"
dependencies = [
"bitflags",
"log",
@ -126,9 +126,9 @@ dependencies = [
[[package]]
name = "uefi-macros"
version = "0.3.2"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a69fa8dd920e84d783769c44560484ade81f6c765cde2e1cc46c754ddf95947"
checksum = "3dcca10ca861f34a320d178f3fdb29ffbf05087fc2c70d2a99860e3329bee1a8"
dependencies = [
"proc-macro2",
"quote",
@ -143,9 +143,9 @@ checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
[[package]]
name = "x86_64"
version = "0.11.1"
version = "0.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9144cdef072afe8afcbc511be8f421de5b3eb9f4b8ff7abff369bee38f91e7e3"
checksum = "d5b4b42dbabe13b69023e1a1407d395f1a1a33df76e9a9efdbe303acc907e292"
dependencies = [
"bit_field 0.9.0",
"bitflags",

View File

@ -15,11 +15,11 @@ version = "0.4.11"
default-features = false
[dependencies.num-integer]
version = "0.1.36"
version = "0.1.43"
default-features = false
[target.'cfg(target_os = "uefi")'.dependencies]
uefi = "0.4.7"
uefi = "0.6.0"
[target.'cfg(target_arch = "x86_64")'.dependencies]
x86_64 = "0.11.1"
x86_64 = "0.12.2"

View File

@ -2,7 +2,7 @@ use alloc::alloc::GlobalAlloc;
use alloc::vec::Vec;
use core::alloc::Layout;
use core::cell::UnsafeCell;
use uefi::table::boot::MemoryMapIter;
use uefi::table::boot::MemoryDescriptor;
// TODO: Support granularity better than pages.
// TODO: Use an allocation algorithm that isn't absolute garbage!!
@ -39,7 +39,7 @@ impl StandardAllocator {
/// by default, it will behave as though every page were allocated.
/// Use `populate` to fill the allocator with actual data
/// using the map that UEFI provides when you exit boot services.
pub fn new(mmap: &mut MemoryMapIter) -> StandardAllocator {
pub fn new<'buf>(mmap: &mut impl ExactSizeIterator<Item = &'buf MemoryDescriptor>) -> StandardAllocator {
// Try to find the largest physical address
// and create a bitmap allowing the allocation of that much memory.
let greatest_physical_page =
@ -55,7 +55,7 @@ impl StandardAllocator {
}
}
pub fn populate(&mut self, mmap: &mut MemoryMapIter) {
pub fn populate<'buf>(&mut self, mmap: &mut impl ExactSizeIterator<Item = &'buf MemoryDescriptor>) {
let self_pages = unsafe { &mut *self.pages.get() };
// Mark all unsable memory as free for allocations.
for entry in mmap {