mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
cleanup out of place/duplicated constant definitions
This commit is contained in:
parent
28793c2d71
commit
6d858e9fce
5 changed files with 7 additions and 15 deletions
|
|
@ -9,6 +9,7 @@ edition = "2018"
|
|||
description = "Initial kernel loader for Xous"
|
||||
|
||||
[dependencies]
|
||||
xous = "0.9.64"
|
||||
ed25519-dalek-loader = { path = "ed25519-dalek-loader", default-features = false, optional = true }
|
||||
curve25519-dalek-loader = { path = "curve25519-dalek-loader", default-features = false, features = [
|
||||
"u32e_backend",
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ pub const FLG_A: usize = 0x40;
|
|||
pub const FLG_D: usize = 0x80;
|
||||
pub const FLG_P: usize = 0x200;
|
||||
|
||||
pub const SWAP_FLG_WIRED: u32 = 0x1_00;
|
||||
pub const FLG_SWAP_USED: u32 = 0x8000_0000;
|
||||
|
||||
// Locate the hard-wired IFRAM allocations for UDMA
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
#[cfg(feature = "swap")]
|
||||
use xous::arch::{SWAP_CFG_VADDR, SWAP_COUNT_VADDR, SWAP_PT_VADDR};
|
||||
|
||||
#[cfg(feature = "swap")]
|
||||
use crate::swap::*;
|
||||
use crate::*;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ use cramium_hal::udma::{GlobalConfig, Spim, SpimClkPha, SpimClkPol, SpimCs};
|
|||
use rand_chacha::ChaCha8Rng;
|
||||
use rand_chacha::rand_core::RngCore;
|
||||
use rand_chacha::rand_core::SeedableRng;
|
||||
use xous::arch::SWAP_HAL_VADDR;
|
||||
|
||||
use crate::bootconfig::BootConfig;
|
||||
use crate::swap::*;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ use core::mem::size_of;
|
|||
use aes_gcm_siv::Tag;
|
||||
|
||||
use crate::PAGE_SIZE;
|
||||
use crate::SWAP_FLG_WIRED;
|
||||
use crate::SWAPPER_PID;
|
||||
|
||||
/// Virtual address fields:
|
||||
|
|
@ -58,18 +59,6 @@ pub struct RawPage {
|
|||
pub data: [u8; 4096],
|
||||
}
|
||||
|
||||
pub const SWAP_PT_VADDR: usize = 0xE000_0000;
|
||||
// E000_0000 - E100_0000 => 16 MiB of vaddr space for page tables; should be more than enough
|
||||
pub const SWAP_CFG_VADDR: usize = 0xE100_0000;
|
||||
pub const SWAP_RPT_VADDR: usize = 0xE100_1000;
|
||||
pub const SWAP_COUNT_VADDR: usize = 0xE110_0000;
|
||||
pub const SWAP_APP_UART_VADDR: usize = 0xE180_0000;
|
||||
#[cfg(feature = "cramium-soc")]
|
||||
pub const SWAP_APP_UART_IFRAM_VADDR: usize = 0xE180_1000;
|
||||
// open a large aperture from A000-E000 for a potential RAM-mapped swap area: this gives us up to 1GiB swap
|
||||
// space. Please don't actually use all of it: performance will be unimaginably bad.
|
||||
pub const SWAP_HAL_VADDR: usize = 0xA000_0000;
|
||||
|
||||
/// Structure passed by the loader into this process at SWAP_RPT_VADDR
|
||||
#[cfg(feature = "swap")]
|
||||
#[repr(C)]
|
||||
|
|
@ -113,9 +102,6 @@ pub fn derive_usable_swap(swap_len: usize) -> usize {
|
|||
|
||||
pub fn derive_mac_size(swap_len: usize) -> usize { (swap_len / 4096) * size_of::<Tag>() }
|
||||
|
||||
/// This needs to be synchronized with what's in kernel/src/mem.rs
|
||||
pub const SWAP_FLG_WIRED: u32 = 0x1_00;
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue