Fix compilation on mipsel

master
Jiajie Chen 6 years ago
parent 81fde731d0
commit ad2f02388c

@ -5,7 +5,6 @@ use crate::drivers::{Driver, DRIVERS, NET_DRIVERS};
use crate::memory::active_table;
use alloc::collections::BTreeMap;
use alloc::sync::Arc;
use core::cmp::Ordering;
use pci::*;
use rcore_memory::{paging::PageTable, PAGE_SIZE};
use spin::Mutex;

@ -53,8 +53,8 @@ impl FileLike {
impl fmt::Debug for FileLike {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
FileLike::File(file) => write!(f, "File {:?}", file),
FileLike::Socket(_) => write!(f, "Socket"),
FileLike::File(file) => write!(f, "File({:?})", file),
FileLike::Socket(_) => write!(f, "Socket(..)"),
}
}
}

@ -3,9 +3,6 @@ use alloc::{sync::Arc, vec::Vec};
use rcore_fs::vfs::*;
use rcore_fs_sfs::SimpleFileSystem;
#[cfg(target_arch = "x86_64")]
use crate::arch::driver::ide;
pub use self::file::*;
pub use self::file_like::*;
pub use self::pipe::Pipe;

@ -18,9 +18,8 @@ use crate::consts::{KERNEL_OFFSET, MEMORY_OFFSET};
use crate::process::process_unsafe;
use crate::sync::SpinNoIrqLock;
use alloc::boxed::Box;
use alloc::vec::Vec;
use bitmap_allocator::BitAlloc;
use buddy_system_allocator::{Heap, LockedHeap};
use buddy_system_allocator::Heap;
use lazy_static::*;
use log::*;
pub use rcore_memory::memory_set::{handler::*, MemoryArea, MemoryAttr};
@ -149,13 +148,18 @@ pub fn init_heap() {
}
pub fn enlarge_heap(heap: &mut Heap) {
info!("Enlarging heap to avoid oom");
let mut page_table = active_table();
let mut addrs = [(0, 0); 32];
let mut addr_len = 0;
#[cfg(target_arch = "x86_64")]
let va_offset = KERNEL_OFFSET + 0xe0000000;
#[cfg(not(target_arch = "x86_64"))]
let va_offset = KERNEL_OFFSET + 0x00e00000;
for i in 0..16384 {
let page = alloc_frame().unwrap();
let va = KERNEL_OFFSET + 0xe0000000 + page;
let va = va_offset + page;
if addr_len > 0 {
let (ref mut addr, ref mut len) = addrs[addr_len - 1];
if *addr - PAGE_SIZE == va {

@ -13,7 +13,7 @@ use xmas_elf::{
};
use crate::arch::interrupt::{Context, TrapFrame};
use crate::fs::{FileHandle, FileLike, INodeExt, OpenOptions, FOLLOW_MAX_DEPTH};
use crate::fs::{FileHandle, FileLike, OpenOptions, FOLLOW_MAX_DEPTH};
use crate::memory::{
ByFrame, Delay, File, GlobalFrameAlloc, KernelStack, MemoryAttr, MemorySet, Read,
};

@ -1,7 +1,6 @@
//! Kernel shell
use crate::drivers::CMDLINE;
use crate::fs::{INodeExt, ROOT_INODE};
use crate::fs::ROOT_INODE;
use crate::process::*;
use alloc::string::String;
use alloc::vec::Vec;
@ -40,6 +39,7 @@ pub fn add_user_shell() {
#[cfg(feature = "run_cmdline")]
pub fn add_user_shell() {
use crate::drivers::CMDLINE;
let cmdline = CMDLINE.read();
let inode = ROOT_INODE.lookup(&cmdline).unwrap();
processor().manager().add(Thread::new_user(

@ -1,4 +1,4 @@
use rcore_memory::memory_set::handler::{ByFrame, Delay, File};
use rcore_memory::memory_set::handler::{Delay, File};
use rcore_memory::memory_set::MemoryAttr;
use rcore_memory::paging::PageTable;
use rcore_memory::Page;

@ -2,7 +2,6 @@
use super::fs::IoVecs;
use super::*;
use crate::drivers::SOCKET_ACTIVITY;
use crate::fs::FileLike;
use crate::net::{
Endpoint, LinkLevelEndpoint, NetlinkEndpoint, NetlinkSocketState, PacketSocketState,

Loading…
Cancel
Save