inline the pll check

this prevents it from being a single area that has to be patched
to bypass the pll check
This commit is contained in:
bunnie 2025-12-04 15:30:43 +08:00
parent 1c210b3541
commit 9e5c57b7de
No known key found for this signature in database

View file

@ -17,6 +17,7 @@ const DELAY_MARGIN_BITS: u64 = 8;
/// off the PLL it is (a) harder to glitch the clock, because skipping a beat on the external
/// crystal doesn't *stop* the PLL and (b) harder to glitch the code because the CPU is running
/// much faster and the timing of the glitch has to be more precise.
#[inline(always)]
pub fn check_pll() {
let cgu = CSR::new(utra::sysctrl::HW_SYSCTRL_BASE as *mut u32);
if cgu.r(utra::sysctrl::SFR_CGUSEL0) & 1 == 0 {