From a3ee1df87feddec339c710068e0922a40c6fd494 Mon Sep 17 00:00:00 2001 From: Amlal Date: Wed, 7 May 2025 10:25:43 +0200 Subject: feat(modules/MBCI): add tiemout for memory test. Signed-off-by: Amlal --- dev/modules/MBCI/MBCI.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'dev') diff --git a/dev/modules/MBCI/MBCI.h b/dev/modules/MBCI/MBCI.h index f2bd7f71..37c18f79 100644 --- a/dev/modules/MBCI/MBCI.h +++ b/dev/modules/MBCI/MBCI.h @@ -99,7 +99,14 @@ typedef UInt32 MBCIAuthKeyType; /// @internal inline BOOL busi_test_mmio(_Input volatile struct IMBCIHost* host, const UInt32 test) { host->MMIOTest = test; - while (host->MMIOTest == test); + UInt16 timeout = 0UL; + + while (host->MMIOTest == test) { + ++timeout; + + if (timeout > 0x1000) + return NO; + } return host->MMIOTest == 0; } -- cgit v1.2.3