thermosphere: seriaLog => debugLog, add DEBUG macro

This commit is contained in:
TuxSH
2019-07-31 02:30:17 +02:00
parent abe524fd79
commit 6cbf5628d4
5 changed files with 28 additions and 19 deletions

View File

@@ -20,7 +20,7 @@
#include "smc.h"
#include "core_ctx.h"
#include "log.h"
#include "debug_log.h"
bool spsrEvaluateConditionCode(u64 spsr, u32 conditionCode)
{
@@ -50,18 +50,21 @@ void dumpStackFrame(const ExceptionStackFrame *frame, bool sameEl)
{
#ifndef NDEBUG
for (u32 i = 0; i < 30; i += 2) {
serialLog("x%u\t\t%016llx\t\tx%u\t\t%016llx\n", i, frame->x[i], i + 1, frame->x[i + 1]);
DEBUG("x%u\t\t%016llx\t\tx%u\t\t%016llx\n", i, frame->x[i], i + 1, frame->x[i + 1]);
}
serialLog("x30\t\t%016llx\n\n", frame->x[30]);
serialLog("elr_el2\t\t%016llx\n", frame->elr_el2);
serialLog("spsr_el2\t%016llx\n", frame->spsr_el2);
DEBUG("x30\t\t%016llx\n\n", frame->x[30]);
DEBUG("elr_el2\t\t%016llx\n", frame->elr_el2);
DEBUG("spsr_el2\t%016llx\n", frame->spsr_el2);
if (sameEl) {
serialLog("sp_el2\t\t%016llx\n", frame->sp_el2);
DEBUG("sp_el2\t\t%016llx\n", frame->sp_el2);
} else {
serialLog("sp_el0\t\t%016llx\n", frame->sp_el0);
DEBUG("sp_el0\t\t%016llx\n", frame->sp_el0);
}
serialLog("sp_el1\t\t%016llx\n", frame->sp_el1);
DEBUG("sp_el1\t\t%016llx\n", frame->sp_el1);
#else
(void)frame;
(void)sameEl;
#endif
}
@@ -119,7 +122,7 @@ void handleLowerElSyncException(ExceptionStackFrame *frame, ExceptionSyndromeReg
break;
default:
serialLog("Lower EL sync exception, EC = 0x%02llx IL=%llu ISS=0x%06llx\n", (u64)esr.ec, esr.il, esr.iss);
DEBUG("Lower EL sync exception, EC = 0x%02llx IL=%llu ISS=0x%06llx\n", (u64)esr.ec, esr.il, esr.iss);
dumpStackFrame(frame, false);
break;
}
@@ -127,11 +130,11 @@ void handleLowerElSyncException(ExceptionStackFrame *frame, ExceptionSyndromeReg
void handleSameElSyncException(ExceptionStackFrame *frame, ExceptionSyndromeRegister esr)
{
serialLog("Same EL sync exception on core %x, EC = 0x%02llx IL=%llu ISS=0x%06llx\n", currentCoreCtx->coreId, (u64)esr.ec, esr.il, esr.iss);
DEBUG("Same EL sync exception on core %x, EC = 0x%02llx IL=%llu ISS=0x%06llx\n", currentCoreCtx->coreId, (u64)esr.ec, esr.il, esr.iss);
dumpStackFrame(frame, true);
}
void handleUnknownException(u32 offset)
{
serialLog("Unknown exception on core %x! (offset 0x%03lx)\n", offset, currentCoreCtx->coreId);
DEBUG("Unknown exception on core %x! (offset 0x%03lx)\n", offset, currentCoreCtx->coreId);
}