u32 PMU Res Uptime (u8 rsrc)
- Set min_mask and max_mask to 0
- Write rsrc to register 0x602
- Read register 0x628, right shift by 8, mask with 0xFF and save as up
Call PMU Res Deps with (1 << rsrc), FALSE as arguments and save output as deps
- Loop 31 times with i as index
If deps & (1 << i) is zero
- Continue
Call PMU Res Deps with (1 << i), TRUE as arguments, complement the result, AND with deps, and save result as deps
Call PMU Res Masks with &min_mask, &max_mask as arguments
- Complement min_mask, AND with deps, and save as deps
- Set dmax to 0
- Loop 31 times with i as index
If deps & (1 << i) is zero
- Continue
Set dup to the output of PMU Res Uptime with i as argument (recursive call)
If dmax < dup
- Set dmax to dup
- Return up + dmax + 2