summaryrefslogtreecommitdiff
path: root/gdb/sh-stub.c
diff options
context:
space:
mode:
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 @@
166 166
167#include "sh7034.h" 167#include "sh7034.h"
168#include <string.h> 168#include <string.h>
169#include <setjmp.h> 169
170#include <signal.h> 170typedef int jmp_buf[20];
171
172void longjmp(jmp_buf __jmpb, int __retval);
173int setjmp(jmp_buf __jmpb);
171 174
172/* We need to undefine this from the sh7034.h file */ 175/* We need to undefine this from the sh7034.h file */
173#undef GBR 176#undef GBR
@@ -411,7 +414,12 @@ static char remcomOutBuffer[BUFMAX];
411 414
412#define ATA_NSECTOR (*((volatile unsigned char*)0x06100102)) 415#define ATA_NSECTOR (*((volatile unsigned char*)0x06100102))
413#define ATA_COMMAND (*((volatile unsigned char*)0x06100107)) 416#define ATA_COMMAND (*((volatile unsigned char*)0x06100107))
417
418#ifdef RECORDER
419#define ATA_CONTROL (*((volatile unsigned char*)0x06200206))
420#else
414#define ATA_CONTROL (*((volatile unsigned char*)0x06200306)) 421#define ATA_CONTROL (*((volatile unsigned char*)0x06200306))
422#endif
415#define ATA_ALT_STATUS ATA_CONTROL 423#define ATA_ALT_STATUS ATA_CONTROL
416 424
417#define STATUS_BSY 0x80 425#define STATUS_BSY 0x80
@@ -690,6 +698,12 @@ void handle_buserror (void)
690 longjmp (remcomEnv, 1); 698 longjmp (remcomEnv, 1);
691} 699}
692 700
701#define SIGINT 2 /* interrupt */
702#define SIGILL 4 /* illegal instruction (not reset when caught) */
703#define SIGTRAP 5 /* trace trap (not reset when caught) */
704#define SIGEMT 7 /* EMT instruction */
705#define SIGBUS 10 /* bus error */
706
693/* 707/*
694 * this function takes the SH-1 exception number and attempts to 708 * this function takes the SH-1 exception number and attempts to
695 * translate this number into a unix compatible signal value 709 * translate this number into a unix compatible signal value
@@ -1509,8 +1523,13 @@ void init_serial (void)
1509 /* Set communication to be async, 8-bit data, 1523 /* Set communication to be async, 8-bit data,
1510 no parity, 1 stop bit and use internal clock */ 1524 no parity, 1 stop bit and use internal clock */
1511 SMR1 = 0; 1525 SMR1 = 0;
1512/* BRR1 = SYSCLOCK / (9600 * 32) - 1;*/ 1526
1527#ifdef RECORDER
1528 #warning 115200
1529 BRR1 = 2; /* 115200 */
1530#else
1513 BRR1 = 9; /* 38400 */ 1531 BRR1 = 9; /* 38400 */
1532#endif
1514 1533
1515 SCR1 &= ~(SCI_CKE1 | SCI_CKE0); 1534 SCR1 &= ~(SCI_CKE1 | SCI_CKE0);
1516 1535
@@ -1575,3 +1594,18 @@ void handleError (char theSSR)
1575 /* Clear all error bits, otherwise the receiver will stop */ 1594 /* Clear all error bits, otherwise the receiver will stop */
1576 SSR1 &= ~(SCI_ORER | SCI_PER | SCI_FER); 1595 SSR1 &= ~(SCI_ORER | SCI_PER | SCI_FER);
1577} 1596}
1597
1598void *memcpy(void *dest, const void *src0, size_t n)
1599{
1600 char *dst = (char *) dest;
1601 char *src = (char *) src0;
1602
1603 void *save = dest;
1604
1605 while(n--)
1606 {
1607 *dst++ = *src++;
1608 }
1609
1610 return save;
1611}