Skip to content

Commit

Permalink
uapi: fixing svc exchange mutable address access (#88)
Browse files Browse the repository at this point in the history
See rust-lang/rust#114447 for more information
about the issue.
  • Loading branch information
pthierry-ledger authored Nov 13, 2024
2 parents 07654f1 + 3dcc21c commit 6b147db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion uapi/uapi/svc_exchange.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-FileCopyrightText: 2023 Ledger SAS
// SPDX-License-Identifier: Apache-2.0

use core::ptr::addr_of_mut;
use crate::systypes::{EraseMode, EraseType, Status};

/// SVC Exchange area len. TODO: to be kconfig-generated
Expand Down Expand Up @@ -100,7 +101,7 @@ pub extern "C" fn clean_svcexchange(erasetype: EraseType, mode: EraseMode) -> St
_ => return Status::Invalid,
}
unsafe {
core::ptr::write_volatile(&mut SVC_EXCHANGE_AREA as *mut [u8; SVC_EXCH_AREA_LEN], [0; SVC_EXCH_AREA_LEN]);
core::ptr::write_volatile(addr_of_mut!(SVC_EXCHANGE_AREA) as *mut [u8; SVC_EXCH_AREA_LEN], [0; SVC_EXCH_AREA_LEN]);
}
Status::Ok
}
Expand Down

0 comments on commit 6b147db

Please sign in to comment.