Skip to content

Commit 96d5e49

Browse files
authored
Merge pull request #1279 from NickeZ/nickez/arm64-support
Nickez/arm64 support
2 parents c8f800e + 8c6646b commit 96d5e49

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/rust/bitbox02/src/random.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub fn mcu_32_bytes(out: &mut [u8; 32]) {
1717
unsafe { bitbox02_sys::random_32_bytes_mcu(out.as_mut_ptr()) }
1818
}
1919

20-
#[cfg(target_arch = "x86_64")]
20+
#[cfg(not(target_arch = "arm"))]
2121
pub fn mcu_32_bytes(out: &mut [u8; 32]) {
2222
extern "C" {
2323
fn rand() -> util::c_types::c_int;

src/rust/util/src/c_types.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,22 @@ pub type c_int = i32;
2727

2828
#[cfg(target_arch = "x86_64")]
2929
pub type c_uint = u64;
30+
#[cfg(target_arch = "aarch64")]
31+
pub type c_uint = u64;
3032
#[cfg(target_arch = "arm")]
3133
pub type c_uint = u32;
3234

3335
#[cfg(target_arch = "x86_64")]
3436
pub type c_long = i64;
37+
#[cfg(target_arch = "aarch64")]
38+
pub type c_long = i64;
3539
#[cfg(target_arch = "arm")]
3640
pub type c_long = i32;
3741

3842
#[cfg(target_arch = "x86_64")]
3943
pub type c_ulong = u64;
44+
#[cfg(target_arch = "aarch64")]
45+
pub type c_ulong = u64;
4046
#[cfg(target_arch = "arm")]
4147
pub type c_ulong = u32;
4248

src/securechip/securechip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ static ATCA_STATUS _lock_slot(securechip_slot_t slot)
220220
static ATCA_STATUS _factory_setup(void)
221221
{
222222
if (_interface_functions == NULL) {
223-
return SC_ERR_IFS;
223+
return (ATCA_STATUS)SC_ERR_IFS;
224224
}
225225
bool is_config_locked = false;
226226
ATCA_STATUS result = atcab_is_locked(LOCK_ZONE_CONFIG, &is_config_locked);

0 commit comments

Comments
 (0)