forked from rcore-os/zCore
When run on unix, 'map_range' := true. Now it can run into component_manager
This commit is contained in:
parent
51027916c0
commit
23a6193783
3
Makefile
3
Makefile
|
@ -104,3 +104,6 @@ baremetal-test:
|
||||||
baremetal-test-rv64:
|
baremetal-test-rv64:
|
||||||
@make -C zCore baremetal-test-rv64 arch=riscv64 mode=release linux=1 ROOTPROC=$(ROOTPROC) | tee -a stdout-baremetal-test-rv64 | tee stdout-rv64
|
@make -C zCore baremetal-test-rv64 arch=riscv64 mode=release linux=1 ROOTPROC=$(ROOTPROC) | tee -a stdout-baremetal-test-rv64 | tee stdout-rv64
|
||||||
|
|
||||||
|
## JUST FOR TEST, delete it later
|
||||||
|
run:
|
||||||
|
cargo run -p zircon-loader -- prebuilt/zircon/x64 LOG=warn:TERM=xterm-256color:console.shell=true:virtcon.disable=true
|
|
@ -20,4 +20,5 @@ async-std = { version = "1.9", features = ["attributes"], optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["std"]
|
default = ["std"]
|
||||||
std = ["env_logger", "structopt", "async-std", "kernel-hal-unix", "zircon-object/aspace-separate"]
|
std = ["env_logger", "structopt", "async-std", "kernel-hal-unix",
|
||||||
|
"zircon-object/aspace-separate", "zircon-syscall/std"]
|
||||||
|
|
|
@ -8,7 +8,11 @@ description = "Zircon syscalls implementation"
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
#hypervisor = ["zircon-object/hypervisor"]
|
# hypervisor = ["zircon-object/hypervisor"]
|
||||||
|
default = []
|
||||||
|
deny-page-fault = []
|
||||||
|
std = ["deny-page-fault"]
|
||||||
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
|
@ -18,3 +22,4 @@ numeric-enum-macro = "0.2"
|
||||||
zircon-object = { path = "../zircon-object" }
|
zircon-object = { path = "../zircon-object" }
|
||||||
kernel-hal = { path = "../kernel-hal" }
|
kernel-hal = { path = "../kernel-hal" }
|
||||||
futures = { version = "0.3", default-features = false, features = ["alloc", "async-await"] }
|
futures = { version = "0.3", default-features = false, features = ["alloc", "async-await"] }
|
||||||
|
|
||||||
|
|
|
@ -128,12 +128,16 @@ impl Syscall<'_> {
|
||||||
mapping_flags.set(MMUFlags::READ, options.contains(VmOptions::PERM_READ));
|
mapping_flags.set(MMUFlags::READ, options.contains(VmOptions::PERM_READ));
|
||||||
mapping_flags.set(MMUFlags::WRITE, options.contains(VmOptions::PERM_WRITE));
|
mapping_flags.set(MMUFlags::WRITE, options.contains(VmOptions::PERM_WRITE));
|
||||||
mapping_flags.set(MMUFlags::EXECUTE, options.contains(VmOptions::PERM_EXECUTE));
|
mapping_flags.set(MMUFlags::EXECUTE, options.contains(VmOptions::PERM_EXECUTE));
|
||||||
info!(
|
|
||||||
"mmuflags: {:?}, is_specific {:?}",
|
|
||||||
mapping_flags, is_specific
|
|
||||||
);
|
|
||||||
let overwrite = options.contains(VmOptions::SPECIFIC_OVERWRITE);
|
let overwrite = options.contains(VmOptions::SPECIFIC_OVERWRITE);
|
||||||
|
#[cfg(feature = "deny-page-fault")]
|
||||||
|
let map_range = true;
|
||||||
|
#[cfg(not(feature = "deny-page-fault"))]
|
||||||
let map_range = options.contains(VmOptions::MAP_RANGE);
|
let map_range = options.contains(VmOptions::MAP_RANGE);
|
||||||
|
|
||||||
|
info!(
|
||||||
|
"mmuflags: {:?}, is_specific {:?}, overwrite {:?}, map_range {:?}",
|
||||||
|
mapping_flags, is_specific, overwrite, map_range
|
||||||
|
);
|
||||||
if map_range && overwrite {
|
if map_range && overwrite {
|
||||||
return Err(ZxError::INVALID_ARGS);
|
return Err(ZxError::INVALID_ARGS);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue