- if (gHaltLog && gHaltTimeMaxPanic && (deltaTime >= gHaltTimeMaxPanic))
- {
- panic("%s total %d ms:%s\n", ctx.LogString, deltaTime, gHaltLog);
+
+ checkShutdownTimeout();
+}
+
+bool IOPMrootDomain::checkShutdownTimeout()
+{
+ AbsoluteTime elapsedTime;
+ uint32_t deltaTime = computeDeltaTimeMS(&gHaltStartTime, &elapsedTime);
+
+ if (gHaltTimeMaxPanic && (deltaTime >= gHaltTimeMaxPanic)) {
+ return true;
+ }
+ return false;
+}
+
+void IOPMrootDomain::panicWithShutdownLog(uint32_t timeoutInMs)
+{
+ if (gHaltLog) {
+ if ((gHaltRestartCtx.phase == kNotifyPriorityClients) && gHaltRestartCtx.handler) {
+ halt_log_enter("Blocked on priority client", (void *)gHaltRestartCtx.handler, mach_absolute_time() - gHaltStartTime);
+ }
+ panic("%s timed out in phase '%s'. Total %d ms:%s",
+ gHaltRestartCtx.LogString, shutdownPhase2String(gHaltRestartCtx.phase), timeoutInMs, gHaltLog);
+ }
+ else {
+ panic("%s timed out in phase \'%s\'. Total %d ms",
+ gHaltRestartCtx.LogString, shutdownPhase2String(gHaltRestartCtx.phase), timeoutInMs);