Skip to content

Commit

Permalink
Mark some funcs inline(always) (-168 bytes ROM size)
Browse files Browse the repository at this point in the history
  • Loading branch information
korran committed Jul 28, 2023
1 parent a00604a commit acd6d87
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions image/verify/src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@ impl<Env: ImageVerificationEnv> ImageVerifier<Env> {
}

/// Verify Owner Signature
// Inlined to reduce ROM size
#[inline(always)]
fn verify_owner_ecc_sig(
&mut self,
digest: &ImageDigest,
Expand Down Expand Up @@ -688,6 +690,8 @@ impl<Env: ImageVerificationEnv> ImageVerifier<Env> {
/// Calculates a digest of the vendor key that signed the image.
///
/// TODO: include the LMS key in the digest.
// Inlined to reduce ROM size
#[inline(always)]
fn make_vendor_key_digest(&mut self, info: &HeaderInfo) -> CaliptraResult<ImageDigest> {
let range = ImageManifest::vendor_ecc_pub_key_range(info.vendor_ecc_pub_key_idx);

Expand Down
2 changes: 2 additions & 0 deletions rom/dev/src/flow/cold_reset/fw_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ impl FirmwareProcessor {
/// * `env` - ROM Environment
/// * `manifest` - Manifest
/// * `txn` - Mailbox Receive Transaction
// Inlined to reduce ROM size
#[inline(always)]
fn load_image(manifest: &ImageManifest, txn: &mut MailboxRecvTxn) -> CaliptraResult<()> {
cprintln!(
"[afmc] Loading FMC at address 0x{:08x} len {}",
Expand Down
2 changes: 2 additions & 0 deletions rom/dev/src/flow/cold_reset/idev_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ impl InitDevIdLayer {
///
/// * `env` - ROM Environment
/// * `output` - DICE Output
// Inlined to reduce ROM size
#[inline(always)]
fn generate_csr(env: &mut RomEnv, output: &DiceOutput) -> CaliptraResult<()> {
//
// Generate the CSR if requested via Manufacturing Service Register
Expand Down

0 comments on commit acd6d87

Please sign in to comment.