summaryrefslogtreecommitdiffstats
path: root/bsps/powerpc/shared/exceptions/ppc_exc_print.c
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2023-04-10 17:46:51 -1000
committerChris Johns <chris@contemporary.net.au>2023-04-11 14:55:02 +1000
commit407c87cd88486a0336e73327457776684074d8f1 (patch)
tree62d5e879500ea4001b2f56921c4d8b699e5aec5e /bsps/powerpc/shared/exceptions/ppc_exc_print.c
parentbsps/motorola_powerpc: Change defines from BSP names to avoid clash (diff)
downloadrtems-407c87cd88486a0336e73327457776684074d8f1.tar.bz2
bsps/powerpc: Fix warnings with PPC_SPECIAL_PURPOSE_REGISTER
Diffstat (limited to '')
-rw-r--r--bsps/powerpc/shared/exceptions/ppc_exc_print.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/bsps/powerpc/shared/exceptions/ppc_exc_print.c b/bsps/powerpc/shared/exceptions/ppc_exc_print.c
index e4fcc73cb1..ff231beff9 100644
--- a/bsps/powerpc/shared/exceptions/ppc_exc_print.c
+++ b/bsps/powerpc/shared/exceptions/ppc_exc_print.c
@@ -42,18 +42,23 @@ typedef struct LRFrameRec_ {
static uint32_t ppc_exc_get_DAR_dflt(void)
{
- if (ppc_cpu_is_60x())
- return PPC_SPECIAL_PURPOSE_REGISTER(PPC_DAR);
- else
+ uint32_t val;
+ if (ppc_cpu_is_60x()) {
+ PPC_SPECIAL_PURPOSE_REGISTER(PPC_DAR, val);
+ return val;
+ } else {
switch (ppc_cpu_is_bookE()) {
default:
break;
case PPC_BOOKE_STD:
case PPC_BOOKE_E500:
- return PPC_SPECIAL_PURPOSE_REGISTER(BOOKE_DEAR);
+ PPC_SPECIAL_PURPOSE_REGISTER(BOOKE_DEAR, val);
+ return val;
case PPC_BOOKE_405:
- return PPC_SPECIAL_PURPOSE_REGISTER(PPC405_DEAR);
+ PPC_SPECIAL_PURPOSE_REGISTER(PPC405_DEAR, val);
+ return val;
}
+ }
return 0xdeadbeef;
}
@@ -170,13 +175,13 @@ void _CPU_Exception_frame_print(const CPU_Exception_frame *excPtr)
printk(" %s = 0x%08" PRIx32 "\n", reg, ppc_exc_get_DAR());
}
if (ppc_cpu_is_bookE()) {
- unsigned esr, mcsr;
+ uint32_t esr, mcsr;
if (ppc_cpu_is_bookE() == PPC_BOOKE_405) {
- esr = PPC_SPECIAL_PURPOSE_REGISTER(PPC405_ESR);
- mcsr = PPC_SPECIAL_PURPOSE_REGISTER(PPC405_MCSR);
+ PPC_SPECIAL_PURPOSE_REGISTER(PPC405_ESR, esr);
+ PPC_SPECIAL_PURPOSE_REGISTER(PPC405_MCSR, mcsr);
} else {
- esr = PPC_SPECIAL_PURPOSE_REGISTER(BOOKE_ESR);
- mcsr = PPC_SPECIAL_PURPOSE_REGISTER(BOOKE_MCSR);
+ PPC_SPECIAL_PURPOSE_REGISTER(BOOKE_ESR, esr);
+ PPC_SPECIAL_PURPOSE_REGISTER(BOOKE_MCSR, mcsr);
}
printk(" ESR = 0x%08x\n", esr);
printk(" MCSR = 0x%08x\n", mcsr);