Skip to content
Snippets Groups Projects
Commit c3f38be7 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Use core intrinsics instead of memset

parent 99a15e79
No related branches found
No related tags found
No related merge requests found
use alloc::arc::{Arc, Weak}; use alloc::arc::{Arc, Weak};
use collections::VecDeque; use collections::VecDeque;
use core::intrinsics;
use spin::Mutex; use spin::Mutex;
use arch::externs::memset;
use arch::memory::Frame; use arch::memory::Frame;
use arch::paging::{ActivePageTable, InactivePageTable, Page, PageIter, PhysicalAddress, VirtualAddress}; use arch::paging::{ActivePageTable, InactivePageTable, Page, PageIter, PhysicalAddress, VirtualAddress};
use arch::paging::entry::{self, EntryFlags}; use arch::paging::entry::{self, EntryFlags};
...@@ -202,7 +202,9 @@ impl Memory { ...@@ -202,7 +202,9 @@ impl Memory {
if clear { if clear {
assert!(flush && self.flags.contains(entry::WRITABLE)); assert!(flush && self.flags.contains(entry::WRITABLE));
unsafe { memset(self.start_address().get() as *mut u8, 0, self.size); } unsafe {
intrinsics::write_bytes(self.start_address().get() as *mut u8, 0, self.size);
}
} }
} }
...@@ -300,7 +302,9 @@ impl Memory { ...@@ -300,7 +302,9 @@ impl Memory {
if clear { if clear {
assert!(flush); assert!(flush);
unsafe { memset((self.start.get() + self.size) as *mut u8, 0, new_size - self.size); } unsafe {
intrinsics::write_bytes((self.start.get() + self.size) as *mut u8, 0, new_size - self.size);
}
} }
} else if new_size < self.size { } else if new_size < self.size {
let mut flush_all = false; let mut flush_all = false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment