Commit f042bd5d authored by Jeremy Soller's avatar Jeremy Soller

Update for new rust

parent ff2ad432
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "aho-corasick"
version = "0.7.3"
......
use core::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
use core::sync::atomic::{AtomicUsize, Ordering};
use context;
use context::timeout;
......@@ -9,7 +9,7 @@ use scheme::debug::debug_input;
use time;
//resets to 0 in context::switch()
pub static PIT_TICKS: AtomicUsize = ATOMIC_USIZE_INIT;
pub static PIT_TICKS: AtomicUsize = AtomicUsize::new(0);
unsafe fn trigger(irq: u8) {
extern {
......
......@@ -4,7 +4,7 @@
/// defined in other files inside of the `arch` module
use core::slice;
use core::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
use core::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use allocator;
#[cfg(feature = "acpi")]
......@@ -31,11 +31,11 @@ static mut TBSS_TEST_ZERO: usize = 0;
#[thread_local]
static mut TDATA_TEST_NONZERO: usize = 0xFFFF_FFFF_FFFF_FFFF;
pub static KERNEL_BASE: AtomicUsize = ATOMIC_USIZE_INIT;
pub static KERNEL_SIZE: AtomicUsize = ATOMIC_USIZE_INIT;
pub static CPU_COUNT: AtomicUsize = ATOMIC_USIZE_INIT;
pub static AP_READY: AtomicBool = ATOMIC_BOOL_INIT;
static BSP_READY: AtomicBool = ATOMIC_BOOL_INIT;
pub static KERNEL_BASE: AtomicUsize = AtomicUsize::new(0);
pub static KERNEL_SIZE: AtomicUsize = AtomicUsize::new(0);
pub static CPU_COUNT: AtomicUsize = AtomicUsize::new(0);
pub static AP_READY: AtomicBool = AtomicBool::new(false);
static BSP_READY: AtomicBool = AtomicBool::new(false);
#[repr(packed)]
pub struct KernelArgs {
......
use core::mem;
use core::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT};
use core::sync::atomic::AtomicBool;
/// This must be used by the kernel to ensure that context switches are done atomically
/// Compare and exchange this to true when beginning a context switch on any CPU
/// The `Context::switch_to` function will set it back to false, allowing other CPU's to switch
/// This must be done, as no locks can be held on the stack during switch
pub static CONTEXT_SWITCH_LOCK: AtomicBool = ATOMIC_BOOL_INIT;
pub static CONTEXT_SWITCH_LOCK: AtomicBool = AtomicBool::new(false);
#[derive(Clone, Debug)]
pub struct Context {
......
use alloc::sync::Arc;
use alloc::collections::BTreeMap;
use core::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
use core::sync::atomic::{AtomicUsize, Ordering};
use spin::{Once, RwLock, RwLockReadGuard, RwLockWriteGuard};
use context;
......@@ -65,7 +65,7 @@ impl EventQueue {
pub type EventQueueList = BTreeMap<EventQueueId, Arc<EventQueue>>;
// Next queue id
static NEXT_QUEUE_ID: AtomicUsize = ATOMIC_USIZE_INIT;
static NEXT_QUEUE_ID: AtomicUsize = AtomicUsize::new(0);
/// Get next queue id
pub fn next_queue_id() -> EventQueueId {
......
......@@ -41,7 +41,7 @@ extern crate spin;
extern crate slab_allocator;
use alloc::vec::Vec;
use core::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
use core::sync::atomic::{AtomicUsize, Ordering};
use scheme::{FileHandle, SchemeNamespace};
......@@ -113,7 +113,7 @@ static ALLOCATOR: allocator::Allocator = allocator::Allocator;
/// A unique number that identifies the current CPU - used for scheduling
#[thread_local]
static CPU_ID: AtomicUsize = ATOMIC_USIZE_INIT;
static CPU_ID: AtomicUsize = AtomicUsize::new(0);
/// Get the current CPU's scheduling ID
#[inline(always)]
......@@ -122,7 +122,7 @@ pub fn cpu_id() -> usize {
}
/// The count of all CPUs that can have work scheduled
static CPU_COUNT : AtomicUsize = ATOMIC_USIZE_INIT;
static CPU_COUNT : AtomicUsize = AtomicUsize::new(0);
/// Get the number of CPUs currently active
#[inline(always)]
......
use core::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
use core::sync::atomic::{AtomicUsize, Ordering};
use spin::{Once, RwLock, RwLockReadGuard, RwLockWriteGuard};
use arch::debug::Writer;
......@@ -18,7 +18,7 @@ fn init_input() -> WaitQueue<u8> {
WaitQueue::new()
}
static NEXT_ID: AtomicUsize = ATOMIC_USIZE_INIT;
static NEXT_ID: AtomicUsize = AtomicUsize::new(0);
static HANDLES: Once<RwLock<BTreeMap<usize, usize>>> = Once::new();
......
use alloc::sync::{Arc, Weak};
use alloc::collections::{BTreeMap, VecDeque};
use core::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
use core::sync::atomic::{AtomicUsize, Ordering};
use spin::{Mutex, Once, RwLock, RwLockReadGuard, RwLockWriteGuard};
use event;
......@@ -13,7 +13,7 @@ use syscall::data::Stat;
/// Pipes list
pub static PIPE_SCHEME_ID: AtomicSchemeId = ATOMIC_SCHEMEID_INIT;
static PIPE_NEXT_ID: AtomicUsize = ATOMIC_USIZE_INIT;
static PIPE_NEXT_ID: AtomicUsize = AtomicUsize::new(0);
static PIPES: Once<RwLock<(BTreeMap<usize, Arc<PipeRead>>, BTreeMap<usize, Arc<PipeWrite>>)>> = Once::new();
/// Initialize pipes, called if needed
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment