From 03261851a10dd2d6900a0a00a7515a0a46fb5d76 Mon Sep 17 00:00:00 2001 From: Ranjith Kumaran Date: Fri, 17 Mar 2000 22:48:54 +0000 Subject: 20000317 sourceware import --- libgloss/m32r/trapmon0.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 libgloss/m32r/trapmon0.c (limited to 'libgloss/m32r/trapmon0.c') diff --git a/libgloss/m32r/trapmon0.c b/libgloss/m32r/trapmon0.c new file mode 100644 index 000000000..44bf6a586 --- /dev/null +++ b/libgloss/m32r/trapmon0.c @@ -0,0 +1,53 @@ +/* + * Mon2000 Trap handler (syscall interface). + * + * This trap handler is linked into the mon2000 libgloss (libmon). + */ +#include +#include "syscall.h" + +int __trap0 (int function, int p1, int p2, int p3, struct _reent *r) +{ + int rc = 0; + + switch (function) { + case SYS_exit: + /* loop so GDB can't go past system exit call */ + while (1) { + asm volatile (" + ldi r0, #0 + trap #15 ; return control to Mon2000"); + } + break; + + case SYS_write: + { + int i; + + for( i=0; i