diff --git a/api/Cargo.toml b/api/Cargo.toml index 06cee6cc25..f8326cc863 100644 --- a/api/Cargo.toml +++ b/api/Cargo.toml @@ -15,3 +15,6 @@ caliptra-emu-types.workspace = true caliptra-registers.workspace = true caliptra-api-types.workspace = true ureg.workspace = true + +[features] +"hw-1.0" = ["caliptra-registers/hw-1.0"] diff --git a/api/src/soc_mgr.rs b/api/src/soc_mgr.rs index 2f20ab4f40..51dc967bd5 100644 --- a/api/src/soc_mgr.rs +++ b/api/src/soc_mgr.rs @@ -13,6 +13,8 @@ use core::mem; use ureg::MmioMut; use zerocopy::{AsBytes, FromBytes}; +pub const NUM_PAUSERS: usize = 5; + /// Implementation of the `SocManager` trait for a `RealSocManager`. /// /// # Example @@ -77,6 +79,10 @@ pub trait SocManager { /// Set up valid PAUSERs for mailbox access. fn setup_mailbox_users(&mut self, apb_pausers: &[u32]) -> Result<(), CaliptraApiError> { + if apb_pausers.len() > NUM_PAUSERS { + return Err(CaliptraApiError::UnableToSetPauser); + } + for (idx, apb_pauser) in apb_pausers.iter().enumerate() { if self .soc_ifc()