diff --git a/kernel/src/platform/cramium/mod.rs b/kernel/src/platform/cramium/mod.rs index c1eac021b..e3ae5bbb2 100644 --- a/kernel/src/platform/cramium/mod.rs +++ b/kernel/src/platform/cramium/mod.rs @@ -1,4 +1,5 @@ // SPDX-FileCopyrightText: 2022 Foundation Devices, Inc. +// SPDX-FileCopyrightText: 2024 bunnie // SPDX-License-Identifier: Apache-2.0 pub mod rand; diff --git a/kernel/src/platform/cramium/rand.rs b/kernel/src/platform/cramium/rand.rs index d0d35c2bd..68d87a693 100644 --- a/kernel/src/platform/cramium/rand.rs +++ b/kernel/src/platform/cramium/rand.rs @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2020 Sean Cross // SPDX-FileCopyrightText: 2022 Foundation Devices, Inc. +// SPDX-FileCopyrightText: 2024 bunnie // SPDX-License-Identifier: Apache-2.0 use cramium_hal::sce; diff --git a/kernel/src/platform/cramium/uart.rs b/kernel/src/platform/cramium/uart.rs index bccda71ce..caad82a39 100644 --- a/kernel/src/platform/cramium/uart.rs +++ b/kernel/src/platform/cramium/uart.rs @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2020 Sean Cross // SPDX-FileCopyrightText: 2022 Foundation Devices, Inc. +// SPDX-FileCopyrightText: 2024 bunnie // SPDX-License-Identifier: Apache-2.0 use utralib::generated::*; diff --git a/kernel/src/swap.rs b/kernel/src/swap.rs index d367f7ec3..96b201377 100644 --- a/kernel/src/swap.rs +++ b/kernel/src/swap.rs @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2024 bunnie +// SPDX-License-Identifier: Apache-2.0 + use loader::swap::SWAP_FLG_WIRED; use loader::swap::SWAP_RPT_VADDR; use xous_kernel::SWAPPER_PID; @@ -9,6 +12,16 @@ use crate::arch::mem::PAGE_SIZE; use crate::mem::MemoryManager; use crate::services::SystemServices; +/// This structure is a copy of what's defined in the loader's swap module. The reason +/// we can't condense the two APIs is because PID is actually defined differently in the +/// kernel than in the loader: a PID for the loader is a `u8`. A PID for the kernel is a +/// NonZeroU8. Thus the APIs are not compatible, and we have to maintain two sets of +/// calls. +/// +/// Also, critically, `SwapAlloc` in the kernel needs an `update` and `reparent` call, +/// which increments `next_epoch` -- these can't be migrated into the swapper, and Rust +/// does not allow extensions to types that aren't native to your crate. So, we're left +/// with redundant copies of the structure definition. pub struct SwapAlloc { timestamp: u32, /// virtual_page_number[19:0] | flags[3:0] | pid[7:0]