use USER_CPPFLAGS
[AROS.git] / arch / m68k-all / exec / alert_cpu.c
blobf05c183f332ef4244d69738b2ffc0c8ef0e93675
1 /*
2 Copyright © 2010-2018, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: CPU context parsing routines.
6 Lang: english
7 */
9 #include <string.h>
11 #include <exec/rawfmt.h>
13 #include "exec_intern.h"
14 #include "exec_util.h"
16 AROS_UFP3(UBYTE*, SegTrack,
17 AROS_UFPA(ULONG, Address, A0),
18 AROS_UFPA(ULONG*, SegNum, A1),
19 AROS_UFPA(ULONG*, Offset, A2));
21 struct SegSem
23 struct SignalSemaphore seg_Semaphore;
24 APTR seg_Find;
26 #define SEG_SEM "SegTracker"
28 char *FormatCPUContext(char *buffer, struct ExceptionContext *ctx, struct ExecBase *SysBase)
30 struct SegSem *segSem;
31 VOID_FUNC dest = buffer ? RAWFMTFUNC_STRING : RAWFMTFUNC_SERIAL;
32 char *buf;
34 RawDoFmt("D0: %08lx %08lx %08lx %08lx\n"
35 "D4: %08lx %08lx %08lx %08lx\n"
36 "A0: %08lx %08lx %08lx %08lx\n"
37 "A4: %08lx %08lx %08lx %08lx\n"
38 "SR: %04x\n"
39 "PC: %08lx", (RAWARG)ctx, dest, buffer);
40 buf = buffer + strlen(buffer);
42 segSem = (struct SegSem *)FindSemaphore(SEG_SEM);
43 if (segSem) {
44 ULONG SegNum, SegOffset, SegList;
45 Forbid();
46 UBYTE *name = AROS_UFC3(UBYTE*, segSem->seg_Find,
47 AROS_UFCA(ULONG, ctx->pc, A0),
48 AROS_UFCA(ULONG*, &SegNum, A1),
49 AROS_UFCA(ULONG*, &SegOffset, A2));
50 if (name) {
51 AROS_UFC3(UBYTE*, segSem->seg_Find,
52 AROS_UFCA(ULONG, ctx->pc, A0),
53 AROS_UFCA(ULONG*, &SegList, A1),
54 AROS_UFCA(ULONG*, &SegList, A2));
55 buf = NewRawDoFmt("\nSegTracker: %s\nHunk %ld, Offset $%08lx, SegList $%08lx\n", dest, buf, name, SegNum, SegOffset, SegList);
57 Permit();
59 return buf - 1;
62 /* Unwind a single stack frame */
63 APTR UnwindFrame(APTR fp, APTR *caller)
65 return NULL;