mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
move error definition to api crate, fixes hosted ci
This commit is contained in:
parent
f2371f49eb
commit
44a53e590a
4 changed files with 15 additions and 17 deletions
|
|
@ -20,6 +20,17 @@ pub const RRAM_STORAGE_LEN: usize = 0x3D_A000;
|
||||||
pub const SWAP_START_UF2: usize = 0x7000_0000;
|
pub const SWAP_START_UF2: usize = 0x7000_0000;
|
||||||
pub const SWAP_UF2_LEN: usize = 0x0800_0000; // 128 MiB
|
pub const SWAP_UF2_LEN: usize = 0x0800_0000; // 128 MiB
|
||||||
|
|
||||||
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, num_derive::FromPrimitive, num_derive::ToPrimitive)]
|
||||||
|
pub enum OneWayErr {
|
||||||
|
OutOfBounds,
|
||||||
|
IncFail,
|
||||||
|
InvalidCoding,
|
||||||
|
// used to report messaging errors in xous environments
|
||||||
|
InternalError,
|
||||||
|
// used to indicate things are OK in xous environments
|
||||||
|
None,
|
||||||
|
}
|
||||||
|
|
||||||
// Define a trait with just the offset
|
// Define a trait with just the offset
|
||||||
pub trait OneWayEncoding: TryFrom<u32> {
|
pub trait OneWayEncoding: TryFrom<u32> {
|
||||||
const OFFSET: usize;
|
const OFFSET: usize;
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@
|
||||||
//! In the case of baremetal targets of course everything is mapped, so these
|
//! In the case of baremetal targets of course everything is mapped, so these
|
||||||
//! restrictions are not a concern.
|
//! restrictions are not a concern.
|
||||||
|
|
||||||
use bao1x_api::OneWayEncoding;
|
|
||||||
use bao1x_api::bollard;
|
use bao1x_api::bollard;
|
||||||
use bao1x_api::offsets::*;
|
use bao1x_api::offsets::*;
|
||||||
|
use bao1x_api::{OneWayEncoding, OneWayErr};
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
use xous::MemoryRange;
|
use xous::MemoryRange;
|
||||||
|
|
||||||
|
|
@ -30,17 +30,6 @@ pub const ONEWAY_MAX_VALUE: u32 = 10_0000;
|
||||||
/// a single boot attempt.
|
/// a single boot attempt.
|
||||||
pub const ONEWAY_MAX_DELTA: u32 = 512;
|
pub const ONEWAY_MAX_DELTA: u32 = 512;
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, num_derive::FromPrimitive, num_derive::ToPrimitive)]
|
|
||||||
pub enum OneWayErr {
|
|
||||||
OutOfBounds,
|
|
||||||
IncFail,
|
|
||||||
InvalidCoding,
|
|
||||||
// used to report messaging errors in xous environments
|
|
||||||
InternalError,
|
|
||||||
// used to indicate things are OK in xous environments
|
|
||||||
None,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct OneWayCounter {
|
pub struct OneWayCounter {
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
mapping: MemoryRange,
|
mapping: MemoryRange,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
use bao1x_api::{BackupFlags, OneWayEncoding};
|
use bao1x_api::{BackupFlags, OneWayEncoding, OneWayErr};
|
||||||
pub use cipher::{
|
pub use cipher::{
|
||||||
BlockBackend, BlockCipher, BlockClosure, BlockDecrypt, BlockEncrypt, BlockSizeUser, ParBlocksSizeUser,
|
BlockBackend, BlockCipher, BlockClosure, BlockDecrypt, BlockEncrypt, BlockSizeUser, ParBlocksSizeUser,
|
||||||
consts::U16, generic_array::GenericArray, inout::InOut,
|
consts::U16, generic_array::GenericArray, inout::InOut,
|
||||||
|
|
@ -10,8 +10,6 @@ use xous_ipc::Buffer;
|
||||||
pub(crate) type BatchBlocks = GenericArray<Block, U16>;
|
pub(crate) type BatchBlocks = GenericArray<Block, U16>;
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
|
|
||||||
use bao1x_hal::acram::*;
|
|
||||||
|
|
||||||
#[derive(Debug)] // there is no confidential information in the external structure; it's safe to Debug it
|
#[derive(Debug)] // there is no confidential information in the external structure; it's safe to Debug it
|
||||||
pub struct Keystore {
|
pub struct Keystore {
|
||||||
conn: CID,
|
conn: CID,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
use bao1x_api::BackupFlags;
|
use bao1x_api::{BackupFlags, OneWayErr};
|
||||||
use bao1x_hal::acram::{MAX_ONEWAY_COUNTERS, OneWayErr};
|
use bao1x_hal::acram::MAX_ONEWAY_COUNTERS;
|
||||||
use bao1x_hal::board::{BOOKEND_END, BOOKEND_START};
|
use bao1x_hal::board::{BOOKEND_END, BOOKEND_START};
|
||||||
use bao1x_hal::rram::Reram;
|
use bao1x_hal::rram::Reram;
|
||||||
use keystore_api::*;
|
use keystore_api::*;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue