Fix target #[cfg]s
This commit is contained in:
parent
a057630186
commit
c8399685ff
@ -10,10 +10,10 @@ authors = ["Mark Poliakov <mark@alnyan.me>"]
|
|||||||
core = { version = "1.0.0", optional = true, package = "rustc-std-workspace-core" }
|
core = { version = "1.0.0", optional = true, package = "rustc-std-workspace-core" }
|
||||||
compiler_builtins = { version = "0.1", optional = true }
|
compiler_builtins = { version = "0.1", optional = true }
|
||||||
|
|
||||||
|
|
||||||
[target.'cfg(unix)'.dependencies]
|
[target.'cfg(unix)'.dependencies]
|
||||||
libc = { version = "0.2.140", default-features = false }
|
libc = { version = "0.2.140", default-features = false }
|
||||||
|
[target.'cfg(not(unix))'.dependencies]
|
||||||
[target.'cfg(target_os = "yggdrasil")'.dependencies]
|
|
||||||
yggdrasil-rt = { git = "https://git.alnyan.me/yggdrasil/yggdrasil-rt.git", default-features = false }
|
yggdrasil-rt = { git = "https://git.alnyan.me/yggdrasil/yggdrasil-rt.git", default-features = false }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
generic_const_exprs,
|
generic_const_exprs,
|
||||||
arbitrary_self_types,
|
arbitrary_self_types,
|
||||||
strict_provenance,
|
strict_provenance,
|
||||||
|
exposed_provenance,
|
||||||
let_chains,
|
let_chains,
|
||||||
test,
|
test,
|
||||||
allocator_api
|
allocator_api
|
||||||
|
@ -49,7 +49,7 @@ pub fn map_pages(count: usize) -> Option<NonNull<u8>> {
|
|||||||
NonNull::new(address as *mut u8)
|
NonNull::new(address as *mut u8)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "yggdrasil")]
|
#[cfg(not(unix))]
|
||||||
{
|
{
|
||||||
use yggdrasil_rt::mem::MappingSource;
|
use yggdrasil_rt::mem::MappingSource;
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ pub fn unmap_pages(address: NonNull<u8>, count: usize) {
|
|||||||
unsafe {
|
unsafe {
|
||||||
libc::munmap(address.as_ptr() as _, count * PAGE_SIZE);
|
libc::munmap(address.as_ptr() as _, count * PAGE_SIZE);
|
||||||
}
|
}
|
||||||
#[cfg(target_os = "yggdrasil")]
|
#[cfg(not(unix))]
|
||||||
{
|
{
|
||||||
unsafe {
|
unsafe {
|
||||||
yggdrasil_rt::sys::unmap_memory(address.addr().into(), count * PAGE_SIZE).unwrap();
|
yggdrasil_rt::sys::unmap_memory(address.addr().into(), count * PAGE_SIZE).unwrap();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user