Ensure that MMIO memory is mapped without caching

This commit is contained in:
Jeremy Soller
2019-04-08 20:22:01 -06:00
parent e090281086
commit 7afaadabd9
11 changed files with 169 additions and 184 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ use std::{env, usize};
use std::fs::File;
use std::io::{Read, Write};
use std::os::unix::io::FromRawFd;
use syscall::{EVENT_READ, PHYSMAP_WRITE, Event, Packet, SchemeBlockMut};
use syscall::{EVENT_READ, PHYSMAP_NO_CACHE, PHYSMAP_WRITE, Event, Packet, SchemeBlockMut};
use scheme::DiskScheme;
@@ -30,7 +30,7 @@ fn main() {
// Daemonize
if unsafe { syscall::clone(0).unwrap() } == 0 {
let address = unsafe { syscall::physmap(bar, 4096, PHYSMAP_WRITE).expect("ahcid: failed to map address") };
let address = unsafe { syscall::physmap(bar, 4096, PHYSMAP_WRITE | PHYSMAP_NO_CACHE).expect("ahcid: failed to map address") };
{
let scheme_name = format!("disk/{}", name);
let socket_fd = syscall::open(