summaryrefslogtreecommitdiffstats
path: root/gdb/sh-stub.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2003-05-17 00:31:50 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2003-05-17 00:31:50 +0000
commit1dc42d1fcbe293513c45cdef1a0278ae3e4ecf1a (patch)
tree103b25b68573d34e3cde9c2a3553ce9eb8352362 /gdb/sh-stub.c
parente96a085af8b51d20b0925f50abb8dcc2798291e0 (diff)
downloadrockbox-1dc42d1fcbe293513c45cdef1a0278ae3e4ecf1a.tar.gz
rockbox-1dc42d1fcbe293513c45cdef1a0278ae3e4ecf1a.tar.bz2
rockbox-1dc42d1fcbe293513c45cdef1a0278ae3e4ecf1a.zip
Now compiles without newlib. Refined the Makefile a little.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3674 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'gdb/sh-stub.c')
-rw-r--r--gdb/sh-stub.c40
1 files changed, 37 insertions, 3 deletions
diff --git a/gdb/sh-stub.c b/gdb/sh-stub.c
index 7a717e0ac5..61c63596bc 100644
--- a/gdb/sh-stub.c
+++ b/gdb/sh-stub.c
@@ -166,8 +166,11 @@
#include "sh7034.h"
#include <string.h>
-#include <setjmp.h>
-#include <signal.h>
+
+typedef int jmp_buf[20];
+
+void longjmp(jmp_buf __jmpb, int __retval);
+int setjmp(jmp_buf __jmpb);
/* We need to undefine this from the sh7034.h file */
#undef GBR
@@ -411,7 +414,12 @@ static char remcomOutBuffer[BUFMAX];
#define ATA_NSECTOR (*((volatile unsigned char*)0x06100102))
#define ATA_COMMAND (*((volatile unsigned char*)0x06100107))
+
+#ifdef RECORDER
+#define ATA_CONTROL (*((volatile unsigned char*)0x06200206))
+#else
#define ATA_CONTROL (*((volatile unsigned char*)0x06200306))
+#endif
#define ATA_ALT_STATUS ATA_CONTROL
#define STATUS_BSY 0x80
@@ -690,6 +698,12 @@ void handle_buserror (void)
longjmp (remcomEnv, 1);
}
+#define SIGINT 2 /* interrupt */
+#define SIGILL 4 /* illegal instruction (not reset when caught) */
+#define SIGTRAP 5 /* trace trap (not reset when caught) */
+#define SIGEMT 7 /* EMT instruction */
+#define SIGBUS 10 /* bus error */
+
/*
* this function takes the SH-1 exception number and attempts to
* translate this number into a unix compatible signal value
@@ -1509,8 +1523,13 @@ void init_serial (void)
/* Set communication to be async, 8-bit data,
no parity, 1 stop bit and use internal clock */
SMR1 = 0;
-/* BRR1 = SYSCLOCK / (9600 * 32) - 1;*/
+
+#ifdef RECORDER
+ #warning 115200
+ BRR1 = 2; /* 115200 */
+#else
BRR1 = 9; /* 38400 */
+#endif
SCR1 &= ~(SCI_CKE1 | SCI_CKE0);
@@ -1575,3 +1594,18 @@ void handleError (char theSSR)
/* Clear all error bits, otherwise the receiver will stop */
SSR1 &= ~(SCI_ORER | SCI_PER | SCI_FER);
}
+
+void *memcpy(void *dest, const void *src0, size_t n)
+{
+ char *dst = (char *) dest;
+ char *src = (char *) src0;
+
+ void *save = dest;
+
+ while(n--)
+ {
+ *dst++ = *src++;
+ }
+
+ return save;
+}