From 159042d5eb5b549b561530767a2fabcfe2a585bb Mon Sep 17 00:00:00 2001 From: jmcmullan Date: Sun, 21 Jul 2013 21:40:40 +0000 Subject: [PATCH] m68k-amiga: Cleanup gdbstop, add FlushMem Should FlushMem go to workbench/c/ ? Signed-off-by: Jason S. McMullan git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@47749 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- arch/m68k-amiga/c/FlushMem.c | 28 ++++++++++++++++++++++++++++ arch/m68k-amiga/c/gdbstop.c | 16 +++++++--------- arch/m68k-amiga/c/mmakefile.src | 13 ++++++------- 3 files changed, 41 insertions(+), 16 deletions(-) create mode 100644 arch/m68k-amiga/c/FlushMem.c diff --git a/arch/m68k-amiga/c/FlushMem.c b/arch/m68k-amiga/c/FlushMem.c new file mode 100644 index 0000000000..598962499d --- /dev/null +++ b/arch/m68k-amiga/c/FlushMem.c @@ -0,0 +1,28 @@ +#include +#include + +#include + +#define BUG(x) do { const char *cp = x; while (*cp) { RawPutChar(*cp); cp++; } } while (0) + +void flushall(struct ExecBase *SysBase) +{ + APTR ptr; + ptr = AllocMem(0x7fffffff, MEMF_ANY); + if (ptr) { + flushall(SysBase); + FreeMem(ptr, 0x7fffffff); + } +} + +AROS_SH0H(FlushMem, 1.0, "Flush all expungable memory") +{ + AROS_SHCOMMAND_INIT + + BUG("---- FlushMem: Begin\n"); + flushall(SysBase); + BUG("---- FlushMem: End\n"); + return RETURN_OK; + + AROS_SHCOMMAND_EXIT +} diff --git a/arch/m68k-amiga/c/gdbstop.c b/arch/m68k-amiga/c/gdbstop.c index eb3b8b7010..d1ae96a41c 100644 --- a/arch/m68k-amiga/c/gdbstop.c +++ b/arch/m68k-amiga/c/gdbstop.c @@ -1,17 +1,15 @@ #include #include +#include -int main(int argc, char **argv) +AROS_SH0H(GdbStop, 1.0, "Issue a debugger breakpoint") { - APTR DOSBase; + AROS_SHCOMMAND_INIT - if ((DOSBase = OpenLibrary("dos.library", 0))) { - asm volatile ("trap #1\n"); - PutStr("Back from GDB breakpoint\n"); - CloseLibrary(DOSBase); - } else { - return RETURN_ERROR; - } + asm volatile ("trap #1\n"); + PutStr("Back from trap #1 breakpoint\n"); return RETURN_OK; + + AROS_SHCOMMAND_EXIT } diff --git a/arch/m68k-amiga/c/mmakefile.src b/arch/m68k-amiga/c/mmakefile.src index 559ac5033b..774902ae6e 100644 --- a/arch/m68k-amiga/c/mmakefile.src +++ b/arch/m68k-amiga/c/mmakefile.src @@ -14,14 +14,14 @@ USER_AFLAGS := -I$(GENINCDIR) -Os #MM kernel-kernel-includes \ #MM linklibs \ #MM workbench-c-m68k-gdbstub \ -#MM workbench-c-m68k-gdbstop \ +#MM workbench-c-m68k-misc \ #MM workbench-c-m68k-setpatcharos \ #MM workbench-c-m68k-arosbootstrap \ #MM workbench-c-m68k-mmudump \ #MM workbench-c-m68k-setpatch #MM- workbench-c-m68k-quick: workbench-c-m68k-gdbstub-quick \ -#MM workbench-c-m68k-gdbstop-quick \ +#MM workbench-c-m68k-misc-quick \ #MM workbench-c-m68k-setpatcharos-quick \ #MM workbench-c-m68k-arosbootstrap-quick \ #MM workbench-c-m68k-mmudump-quick \ @@ -29,8 +29,6 @@ USER_AFLAGS := -I$(GENINCDIR) -Os #MM workbench-c-m68k-gdbstub : linklibs-loadseg -#MM workbench-c-m68k-gdbstop : linklibs-loadseg - #MM workbench-c-m68k-arosbootstrap : linklibs-loadseg #MM workbench-c-m68k-setpatcharos : linklibs-loadseg @@ -45,10 +43,11 @@ FILES := gdbstub files=$(FILES) targetdir=$(AROS_C) \ detach=yes -FILES := gdbstop +FILES := gdbstop FlushMem -%build_progs mmake=workbench-c-m68k-gdbstop \ - files=$(FILES) targetdir=$(AROS_C) +%build_progs mmake=workbench-c-m68k-misc \ + files=$(FILES) targetdir=$(AROS_C) \ + usestartup=no CFILES := SetPatchAROS AFILES := newstackswap -- 2.11.4.GIT