1
0
mirror of https://github.com/rcore-os/rCore.git synced 2025-01-19 01:07:05 +04:00

Cargo.lock & format

This commit is contained in:
Liu Xiaoyi 2020-05-13 15:12:15 +08:00
parent 54504eb317
commit 838513e05c
No known key found for this signature in database
GPG Key ID: A04E02BF7E977471
2 changed files with 16 additions and 22 deletions

18
kernel/Cargo.lock generated
View File

@ -91,7 +91,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "bitmap-allocator"
version = "0.1.0"
source = "git+https://github.com/rcore-os/bitmap-allocator#5077c47649c1bfe12606ab222e79c70b54940906"
source = "git+https://github.com/rcore-os/bitmap-allocator?rev=03bd990#03bd9909d0dc85e99f5559b97a163ab81073df83"
dependencies = [
"bit_field 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -332,7 +332,7 @@ version = "0.1.2"
dependencies = [
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"uefi 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
"x86_64 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)",
"x86_64 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)",
"xmas-elf 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -347,7 +347,7 @@ dependencies = [
"bcm2837 2.5.1 (git+https://github.com/rcore-os/bcm2837)",
"bit_field 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"bitmap-allocator 0.1.0 (git+https://github.com/rcore-os/bitmap-allocator)",
"bitmap-allocator 0.1.0 (git+https://github.com/rcore-os/bitmap-allocator?rev=03bd990)",
"bitvec 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"buddy_system_allocator 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)",
@ -692,15 +692,6 @@ dependencies = [
"cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "x86_64"
version = "0.9.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bit_field 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "xmas-elf"
version = "0.7.0"
@ -726,7 +717,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum bit_field 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a165d606cf084741d4ac3a28fb6e9b1eb0bd31f6cd999098cfddb0b2ab381dc0"
"checksum bit_field 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ed8765909f9009617974ab6b7d332625b320b33c326b1e9321382ef1999b5d56"
"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
"checksum bitmap-allocator 0.1.0 (git+https://github.com/rcore-os/bitmap-allocator)" = "<none>"
"checksum bitmap-allocator 0.1.0 (git+https://github.com/rcore-os/bitmap-allocator?rev=03bd990)" = "<none>"
"checksum bitvec 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1fe4300c1d7a9ea6f3e3f39c10b39862bb79e1175c0572b6b49539a30e5562f5"
"checksum buddy_system_allocator 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9e953b958d83e13a44b1ead5b6aaa2a5f854bd5170239a66b606e030a14d018f"
"checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5"
@ -795,6 +786,5 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum x86 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f21eecbd666e3a8edbf0b26d36f270f7a613d8986ca0eafb8205e324f7336dab"
"checksum x86_64 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1f27d9168654aee1b0c1b73746caeb4aa33248f8b8c8f6e100e697fcc2a794b2"
"checksum x86_64 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "5d9e3e26fcb51976eafa310e8f2b7a5a83ae8c185443efe50cbc6534a4fffa0d"
"checksum x86_64 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4206b60c9f99766329b66962aa8ddc01df6c7edd02edc046b7a69d5df9fcdbcf"
"checksum xmas-elf 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e74de9a366f6ab8c405fa6b371d9ac24943921fa14b3d64afcb202065c405f11"
"checksum zero 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5f1bc8a6b2005884962297587045002d8cfb8dcec9db332f4ca216ddc5de82c5"

View File

@ -31,9 +31,9 @@ use crate::arch::interrupt;
use crate::processor;
use core::cell::UnsafeCell;
use core::fmt;
use core::ops::{Deref, DerefMut};
use core::sync::atomic::{AtomicBool, Ordering, AtomicU8};
use core::mem::MaybeUninit;
use core::ops::{Deref, DerefMut};
use core::sync::atomic::{AtomicBool, AtomicU8, Ordering};
pub type SpinLock<T> = Mutex<T, Spin>;
pub type SpinNoIrqLock<T> = Mutex<T, SpinNoIrq>;
@ -146,12 +146,16 @@ impl<T: ?Sized, S: MutexSupport> Mutex<T, S> {
}
pub fn ensure_support(&self) {
let initialization = self.support_initialization.load(Ordering::Relaxed);
if(initialization == 2) { return };
if(
initialization == 1
|| self.support_initialization.compare_and_swap(0, 1, Ordering::Acquire) != 0
) {
let initialization = self.support_initialization.load(Ordering::Relaxed);
if (initialization == 2) {
return;
};
if (initialization == 1
|| self
.support_initialization
.compare_and_swap(0, 1, Ordering::Acquire)
!= 0)
{
// Wait for another thread to initialize
while self.support_initialization.load(Ordering::Acquire) == 1 {
core::sync::atomic::spin_loop_hint();