strcpy (remcomOutBuffer, "OK");
break;
}
- strcpy (remcomOutBuffer, "P01");
+ strcpy (remcomOutBuffer, "E01");
break;
}
case 'G': /* set the value of the CPU registers - return OK */
static unsigned long crc32_table[256] = {0, 0};
static unsigned long
-crc32 (buf, len, crc)
- unsigned char *buf;
- int len;
- unsigned long crc;
+crc32 (unsigned char *buf, int len, unsigned long crc)
{
if (! crc32_table[1])
{
}
static int
-hex(ch)
- unsigned char ch;
+hex (unsigned char ch)
{
if ((ch >= 'a') && (ch <= 'f')) return (ch-'a'+10);
if ((ch >= '0') && (ch <= '9')) return (ch-'0');
/* scan for the sequence $<data>#<checksum> */
unsigned char *
-getpacket ()
+getpacket (void)
{
unsigned char *buffer = &remcomInBuffer[0];
unsigned char checksum;
/* send the packet in buffer. */
static void
-putpacket(buffer)
- unsigned char *buffer;
+putpacket (unsigned char *buffer)
{
unsigned char checksum;
int count;
static void (*volatile mem_fault_routine)() = 0;
static void
-set_mem_err ()
+set_mem_err (void)
{
mem_err = 1;
}
whether there's anything connected to the expansion bus. */
static int
-mem_safe (addr)
- unsigned char *addr;
+mem_safe (unsigned char *addr)
{
#define BAD_RANGE_ONE_START ((unsigned char *) 0x600000)
#define BAD_RANGE_ONE_END ((unsigned char *) 0xa00000)
to mem_fault, they won't get restored, so there better not be any
saved). */
static int
-get_char (addr)
- unsigned char *addr;
+get_char (unsigned char *addr)
{
#if 1
if (mem_fault_routine && !mem_safe(addr))
}
static void
-set_char (addr, val)
- unsigned char *addr;
- unsigned char val;
+set_char (unsigned char *addr, unsigned char val)
{
#if 1
if (mem_fault_routine && !mem_safe (addr))
a fault; if zero treat a fault like any other fault in the stub. */
static unsigned char *
-mem2hex(mem, buf, count, may_fault)
- unsigned char* mem;
- unsigned char* buf;
- int count;
- int may_fault;
+mem2hex (unsigned char *mem, unsigned char *buf, int count, int may_fault)
{
int i;
unsigned char ch;
Return a pointer to the character AFTER the last byte written. */
static unsigned char*
-hex2mem(buf, mem, count, may_fault)
- unsigned char* buf;
- unsigned char* mem;
- int count;
- int may_fault;
+hex2mem (unsigned char *buf, unsigned char *mem, int count, int may_fault)
{
int i;
unsigned char ch;
COUNT is the total number of bytes to write into
memory. */
static unsigned char *
-bin2mem (buf, mem, count, may_fault)
- unsigned char *buf;
- unsigned char *mem;
- int count;
- int may_fault;
+bin2mem (unsigned char *buf, unsigned char *mem, int count, int may_fault)
{
int i;
unsigned char ch;
translate this number into a unix compatible signal value */
static int
-computeSignal(exceptionVector)
- int exceptionVector;
+computeSignal (int exceptionVector)
{
int sigval;
switch (exceptionVector) {
/* RETURN NUMBER OF CHARS PROCESSED */
/**********************************************/
static int
-hexToInt(ptr, intValue)
- unsigned char **ptr;
- int *intValue;
+hexToInt (unsigned char **ptr, int *intValue)
{
int numChars = 0;
int hexValue;
*/
static int
-isShortBranch(instr)
- unsigned char *instr;
+isShortBranch (unsigned char *instr)
{
unsigned char instr0 = instr[0] & 0x7F; /* mask off high bit */
}
static int
-isLongBranch(instr)
- unsigned char *instr;
+isLongBranch (unsigned char *instr)
{
if (instr[0] == 0xFC || instr[0] == 0xFD || /* BRA, BNC, BL, BC */
instr[0] == 0xFE || instr[0] == 0xFF) /* 24 bit relative */
((((int) addr & 2) || (((unsigned char *) addr)[0] & 0x80) == 0) ? 2 : 4)
static int
-isBranch(instr)
- unsigned char *instr;
+isBranch (unsigned char *instr)
{
if (INSTRUCTION_SIZE(instr) == 2)
return isShortBranch(instr);
}
static int
-willBranch(instr, branchCode)
- unsigned char *instr;
+willBranch (unsigned char *instr, int branchCode)
{
switch (branchCode)
{
}
static int
-branchDestination(instr, branchCode)
- unsigned char *instr;
+branchDestination (unsigned char *instr, int branchCode)
{
switch (branchCode) {
default:
}
static void
-branchSideEffects(instr, branchCode)
- unsigned char *instr;
- int branchCode;
+branchSideEffects (unsigned char *instr, int branchCode)
{
switch (branchCode)
{
just "continue continuing". */
static int
-finish_from_step()
+finish_from_step (void)
{
if (stepping.stepping) /* anything to do? */
{
but doing stash_registers in C isn't straightforward. */
static void
-cleanup_stash ()
+cleanup_stash (void)
{
psw = (struct PSWreg *) ®isters[PSW]; /* fields of PSW register */
psw->sm = psw->bsm; /* fix up pre-trap values of psw fields */
NUM is the trap/exception number. */
static void
-process_exception (num)
- int num;
+process_exception (int num)
{
cleanup_stash ();
asm volatile ("
/* this function is used to set up exception handlers for tracing and
breakpoints */
void
-set_debug_traps()
+set_debug_traps (void)
{
/* extern void remcomHandler(); */
int i;
#define BREAKPOINT() asm volatile (" trap #2");
void
-breakpoint()
+breakpoint (void)
{
if (initialized)
BREAKPOINT();
Returns: the char */
static int
-gdb_putchar(ch)
- int ch;
+gdb_putchar (int ch)
{
char buf[4];
Returns: number of bytes written */
static int
-gdb_write(data, len)
- char *data;
- int len;
+gdb_write (char *data, int len)
{
char *buf, *cpy;
int i;
Returns: the length of the string */
static int
-gdb_puts(str)
- char *str;
+gdb_puts (char *str)
{
return gdb_write(str, strlen(str));
}
will cause the optional second string to be inserted. */
static void
-gdb_error(format, parm)
- char * format;
- char * parm;
+gdb_error (char *format, char *parm)
{
char buf[400], *cpy;
int len;