aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / vendor / zeroize / src / aarch64.rs
| 1 | //! [`Zeroize`] impls for ARM64 SIMD registers. |
| 2 | |
| 3 | use crate::{Zeroize, optimization_barrier, volatile_write}; |
| 4 | |
| 5 | use core::arch::aarch64::*; |
| 6 | |
| 7 | macro_rules! impl_zeroize_for_simd_register { |
| 8 | ($($type:ty),* $(,)?) => { |
| 9 | $( |
| 10 | impl Zeroize for $type { |
| 11 | #[inline] |
| 12 | fn zeroize(&mut self) { |
| 13 | volatile_write(self, unsafe { core::mem::zeroed() }); |
| 14 | optimization_barrier(self); |
| 15 | } |
| 16 | } |
| 17 | )+ |
| 18 | }; |
| 19 | } |
| 20 | |
| 21 | // TODO(tarcieri): other NEON register types? |
| 22 | impl_zeroize_for_simd_register! { |
| 23 | uint8x8_t, |
| 24 | uint8x16_t, |
| 25 | uint16x4_t, |
| 26 | uint16x8_t, |
| 27 | uint32x2_t, |
| 28 | uint32x4_t, |
| 29 | uint64x1_t, |
| 30 | uint64x2_t, |
| 31 | } |