summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/m68k/ods68302/startup
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2004-04-21 10:43:04 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2004-04-21 10:43:04 +0000
commit6128a4aa5e791ed4e0a655bfd346a52d92da7883 (patch)
treeaf53ca3f67ce405b6fbc6c98399c8e0c87e01a9e /c/src/lib/libbsp/m68k/ods68302/startup
parent2004-04-20 Ralf Corsepius <ralf_corsepius@rtems.org> (diff)
downloadrtems-6128a4aa5e791ed4e0a655bfd346a52d92da7883.tar.bz2
Remove stray white spaces.
Diffstat (limited to 'c/src/lib/libbsp/m68k/ods68302/startup')
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c6
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/cpuboot.c22
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/debugport.c18
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/gdb-hooks.c10
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/m68302scc.c30
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/m68k-stub.c282
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/memcheck.c2
-rw-r--r--c/src/lib/libbsp/m68k/ods68302/startup/trace.c18
8 files changed, 194 insertions, 194 deletions
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c b/c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c
index eb5bde8e54..09c38108d0 100644
--- a/c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c
+++ b/c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c
@@ -19,7 +19,7 @@
#include <bsp.h>
#include <rtems/libio.h>
#include <rtems/libcsupport.h>
-
+
/*
* The original table from the application and our copy of it with
* some changes.
@@ -36,7 +36,7 @@ char *rtems_progname;
/*
* Use the shared implementations of the following routines
*/
-
+
void bsp_postdriver_hook(void);
void bsp_libc_init( void *, uint32_t, int );
void bsp_pretasking_hook(void); /* m68k version */
@@ -54,7 +54,7 @@ void bsp_start( void )
extern unsigned long _M68k_Ramsize;
_M68k_Ramsize = (unsigned long)&_RamSize; /* RAM size set in linker script */
-
+
#if 0
Cpu_table.interrupt_vector_table = (mc68000_isr *) 0/*&M68Kvec*/;
#endif
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/cpuboot.c b/c/src/lib/libbsp/m68k/ods68302/startup/cpuboot.c
index 29fdcf9de9..25fd3ddc75 100644
--- a/c/src/lib/libbsp/m68k/ods68302/startup/cpuboot.c
+++ b/c/src/lib/libbsp/m68k/ods68302/startup/cpuboot.c
@@ -26,9 +26,9 @@
This code executes with a valid C environment. That is the data
section has been intialised and the bss section set to 0. This phase
performs any special card initialisation and then calls boot card.
-
+
$Id$
-
+
*/
/*****************************************************************************/
@@ -62,12 +62,12 @@ void boot_phase_1()
WRITE_OR(CSEL_1, CSEL_1_SIZE, CSEL_1_WAIT_STATES, OR_MASK_RW, OR_MASK_FC);
WRITE_BR(CSEL_1, CSEL_1_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED);
#endif
-
+
#if defined(CSEL_2)
WRITE_OR(CSEL_2, CSEL_2_SIZE, CSEL_2_WAIT_STATES, OR_MASK_RW, OR_MASK_FC);
WRITE_BR(CSEL_2, CSEL_2_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED);
#endif
-
+
m302.reg.ipr = m302.reg.imr = m302.reg.isr = 0;
m302.reg.gimr = 0x0080;
@@ -86,7 +86,7 @@ void boot_phase_1()
#if defined(LED_CONTROL)
LED_CONTROL(LED_1_RED, LED_2_OFF, LED_3_OFF, LED_4_OFF,
LED_5_OFF, LED_6_OFF, LED_7_OFF, LED_8_OFF);
-#endif
+#endif
}
/*
@@ -96,15 +96,15 @@ void boot_phase_1()
void boot_phase_2(void)
{
uint32_t stack;
-
+
#if defined(LED_CONTROL)
LED_CONTROL(LED_1_RED, LED_2_RED, LED_3_OFF, LED_4_OFF,
LED_5_OFF, LED_6_OFF, LED_7_OFF, LED_8_OFF);
#endif
-
+
WRITE_BR(CSEL_ROM, _ROM_BASE, BR_READ_ONLY, BR_FC_NULL, BR_ENABLED);
WRITE_BR(CSEL_RAM, _RAM_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED);
-
+
#if defined(LED_CONTROL)
LED_CONTROL(LED_1_GREEN, LED_2_RED, LED_3_OFF, LED_4_OFF,
LED_5_OFF, LED_6_OFF, LED_7_OFF, LED_8_OFF);
@@ -130,11 +130,11 @@ void boot_phase_3(void)
set_debug_traps();
breakpoint();
}
-
+
debug_port_banner();
-
+
/* FIXME : add RAM and ROM checks */
-
+
/* boot the bsp, what ever this means */
boot_card();
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/debugport.c b/c/src/lib/libbsp/m68k/ods68302/startup/debugport.c
index be9da857b5..7ef16eb9a8 100644
--- a/c/src/lib/libbsp/m68k/ods68302/startup/debugport.c
+++ b/c/src/lib/libbsp/m68k/ods68302/startup/debugport.c
@@ -3,7 +3,7 @@
High Level Debug Port Functions
$Id$
-
+
*/
/*****************************************************************************/
@@ -28,10 +28,10 @@ unsigned char debug_port_status(const unsigned char status)
{
if (!initialised)
{
- initialised = 1;
+ initialised = 1;
debug_port_initialise();
}
-
+
return scc_status(CONSOLE_PORT, status);
}
@@ -39,10 +39,10 @@ unsigned char debug_port_in(void)
{
if (!initialised)
{
- initialised = 1;
+ initialised = 1;
debug_port_initialise();
}
-
+
return scc_in(CONSOLE_PORT);
}
@@ -50,10 +50,10 @@ void debug_port_out(const unsigned char character)
{
if (!initialised)
{
- initialised = 1;
+ initialised = 1;
debug_port_initialise();
}
-
+
scc_out(CONSOLE_PORT, character);
}
@@ -137,7 +137,7 @@ void debug_port_printf(const char *format, ...)
written = vsprintf(buffer, format, args);
/* try an trap format buffer overflows */
- if ((buffer[BUFFER_SIZE - 2] != '\xAA') ||
+ if ((buffer[BUFFER_SIZE - 2] != '\xAA') ||
(buffer[BUFFER_SIZE - 1] != '\x55'))
{
debug_port_write("debug port buffer overflow, halting...");
@@ -155,7 +155,7 @@ void debug_port_printf(const char *format, ...)
void debug_port_banner(void)
{
#define CARD_LABEL "ods68302-" #VARIANT
-
+
debug_port_write("\n\n\r");
debug_port_write(_Copyright_Notice);
debug_port_write("\n\r " CARD_ID "\n\r");
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/gdb-hooks.c b/c/src/lib/libbsp/m68k/ods68302/startup/gdb-hooks.c
index 3c3cb72582..957535389a 100644
--- a/c/src/lib/libbsp/m68k/ods68302/startup/gdb-hooks.c
+++ b/c/src/lib/libbsp/m68k/ods68302/startup/gdb-hooks.c
@@ -1,7 +1,7 @@
/*****************************************************************************/
/*
$Id$
-
+
Hooks for GDB
*/
@@ -21,7 +21,7 @@ void putDebugChar(char ch)
scc_initialise(DEBUG_PORT, DEBUG_BAUD, 0);
initialised = 1;
}
-
+
scc_out(DEBUG_PORT, ch);
}
@@ -34,8 +34,8 @@ char getDebugChar(void)
}
while (!scc_status(DEBUG_PORT, 0));
-
- return scc_in(DEBUG_PORT);
+
+ return scc_in(DEBUG_PORT);
}
/*
@@ -65,7 +65,7 @@ static GDB_HANDLER_ENTRY gdb_jump_table[256];
void exceptionHandler(unsigned int vector, void *handler)
{
uint32_t *interrupt_table = 0;
-
+
gdb_jump_table[vector].move_a7 = M68K_MOVE_A7;
gdb_jump_table[vector].format_id = vector;
gdb_jump_table[vector].jmp = M68K_JMP;
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/m68302scc.c b/c/src/lib/libbsp/m68k/ods68302/startup/m68302scc.c
index 542ad8d9ad..4b7c7d9440 100644
--- a/c/src/lib/libbsp/m68k/ods68302/startup/m68302scc.c
+++ b/c/src/lib/libbsp/m68k/ods68302/startup/m68302scc.c
@@ -1,7 +1,7 @@
/*****************************************************************************/
/*
$Id$
-
+
M68302 SCC Polled Driver
*/
@@ -27,29 +27,29 @@ static const uint16_t baud_clocks[] =
(SYSTEM_CLOCK / ( 57600 * 16)),
(SYSTEM_CLOCK / (115700 * 16))
};
-
+
void scc_initialise(int channel, int baud, int translate)
{
uint16_t scon;
-
+
if (channel < M68302_SCC_COUNT)
{
scc[channel] = &m302.scc1 + channel;
scc_reg[channel] = &m302.reg.scc[channel];
scc_translate[channel] = translate;
-
+
scon = (baud_clocks[baud] & 0xF800) == 0 ? 0 : 1;
scon |= (((baud_clocks[baud] / (1 + scon * 3)) - 1) << 1) & 0x0FFE;
-
+
scc_reg[channel]->scon = scon;
scc_reg[channel]->scm = 0x0171;
- scc[channel]->bd.tx[0].status = 0x2000;
+ scc[channel]->bd.tx[0].status = 0x2000;
scc[channel]->bd.tx[0].length = 0;
scc[channel]->bd.tx[0].buffer =
(uint8_t*) &(scc[channel]->bd.tx[1].buffer);
- scc[channel]->bd.rx[0].status = 0x2000;
+ scc[channel]->bd.rx[0].status = 0x2000;
scc[channel]->bd.rx[0].length = 0;
scc[channel]->bd.rx[0].buffer =
(uint8_t*) &(scc[channel]->bd.rx[1].buffer);
@@ -73,7 +73,7 @@ void scc_initialise(int channel, int baud, int translate)
scc_reg[channel]->sccm = 0x15;
scc_reg[channel]->scm = 0x17d;
- }
+ }
}
unsigned char scc_status(int channel, unsigned char status)
@@ -84,7 +84,7 @@ unsigned char scc_status(int channel, unsigned char status)
if ((channel < M68302_SCC_COUNT) && scc[channel])
{
- rx_status = scc[channel]->bd.rx[0].status;
+ rx_status = scc[channel]->bd.rx[0].status;
if ((rx_status & 0x8000) == 0)
{
@@ -98,7 +98,7 @@ unsigned char scc_status(int channel, unsigned char status)
}
}
}
-
+
return 0;
}
@@ -115,11 +115,11 @@ unsigned char scc_in(int channel)
c = *(scc[channel]->bd.rx[0].buffer);
scc[channel]->bd.rx[0].status = 0xa000;
-
+
return c;
}
}
-
+
return 0;
}
@@ -139,11 +139,11 @@ void scc_out(int channel, unsigned char character)
scc[channel]->bd.tx[0].status = 0xa000;
if (scc_translate[channel])
- {
+ {
if (character == '\n')
- {
+ {
scc_out(channel, '\r');
}
}
- }
+ }
}
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/m68k-stub.c b/c/src/lib/libbsp/m68k/ods68302/startup/m68k-stub.c
index cf9b4c2e39..95e404677f 100644
--- a/c/src/lib/libbsp/m68k/ods68302/startup/m68k-stub.c
+++ b/c/src/lib/libbsp/m68k/ods68302/startup/m68k-stub.c
@@ -1,9 +1,9 @@
/****************************************************************************
- THIS SOFTWARE IS NOT COPYRIGHTED
-
+ THIS SOFTWARE IS NOT COPYRIGHTED
+
HP offers the following for use in the public domain. HP makes no
- warranty with regard to the software or it's performance and the
+ warranty with regard to the software or it's performance and the
user accepts the software "AS IS" with all faults.
HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD
@@ -13,22 +13,22 @@
****************************************************************************/
/****************************************************************************
- * Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $
+ * Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $
*
- * Module name: remcom.c $
+ * Module name: remcom.c $
* Revision: 1.34 $
* Date: 91/03/09 12:29:49 $
* Contributor: Lake Stevens Instrument Division$
- *
+ *
* Description: low level support for gdb debugger. $
*
* Considerations: only works on target hardware $
*
* Written by: Glenn Engel $
- * ModuleState: Experimental $
+ * ModuleState: Experimental $
*
* NOTES: See Below $
- *
+ *
* To enable debugger support, two things need to happen. One, a
* call to set_debug_traps() is necessary in order to allow any breakpoints
* or error conditions to be properly intercepted and reported to gdb.
@@ -39,15 +39,15 @@
* there either should be a standard breakpoint instruction, or the protocol
* should be extended to provide some means to communicate which breakpoint
* instruction is in use (or have the stub insert the breakpoint).
- *
+ *
* Some explanation is probably necessary to explain how exceptions are
* handled. When an exception is encountered the 68000 pushes the current
* program counter and status register onto the supervisor stack and then
* transfers execution to a location specified in it's vector table.
* The handlers for the exception vectors are hardwired to jmp to an address
- * given by the relation: (exception - 256) * 6. These are decending
+ * given by the relation: (exception - 256) * 6. These are decending
* addresses starting from -6, -12, -18, ... By allowing 6 bytes for
- * each entry, a jsr, jmp, bsr, ... can be used to enter the exception
+ * each entry, a jsr, jmp, bsr, ... can be used to enter the exception
* handler. Using a jsr to handle an exception has an added benefit of
* allowing a single handler to service several exceptions and use the
* return address as the key differentiation. The vector number can be
@@ -59,50 +59,50 @@
* For 68020 machines, the ability to have a return address around just
* so the vector can be determined is not necessary because the '020 pushes an
* extra word onto the stack containing the vector offset
- *
+ *
* Because gdb will sometimes write to the stack area to execute function
* calls, this program cannot rely on using the supervisor stack so it
- * uses it's own stack area reserved in the int array remcomStack.
- *
+ * uses it's own stack area reserved in the int array remcomStack.
+ *
*************
*
* The following gdb commands are supported:
- *
+ *
* command function Return value
- *
+ *
* g return the value of the CPU registers hex data or ENN
* G set the value of the CPU registers OK or ENN
- *
+ *
* mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN
* MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN
- *
+ *
* c Resume at current address SNN ( signal NN)
* cAA..AA Continue at address AA..AA SNN
- *
+ *
* s Step one instruction SNN
* sAA..AA Step one instruction from AA..AA SNN
- *
+ *
* k kill
*
* ? What was the last sigval ? SNN (signal NN)
- *
- * All commands and responses are sent with a packet which includes a
- * checksum. A packet consists of
- *
+ *
+ * All commands and responses are sent with a packet which includes a
+ * checksum. A packet consists of
+ *
* $<packet info>#<checksum>.
- *
+ *
* where
* <packet info> :: <characters representing the command or response>
* <checksum> :: < two hex digits computed as modulo 256 sum of <packetinfo>>
- *
+ *
* When a packet is received, it is first acknowledged with either '+' or '-'.
* '+' indicates a successful transfer. '-' indicates a failed transfer.
- *
+ *
* Example:
- *
+ *
* Host: Reply:
* $m0,10#2a +$00010203040506070809101112131415#42
- *
+ *
* $Id$
*
****************************************************************************/
@@ -116,7 +116,7 @@
/************************************************************************
*
- * external low-level support routines
+ * external low-level support routines
*/
typedef void (*ExceptionHook)(int); /* pointer to function with int parm */
typedef void (*Function)(void); /* pointer to a function */
@@ -153,15 +153,15 @@ void breakpoint(void);
static char initialized; /* boolean flag. != 0 means we've been initialized */
int remote_debug;
-/* debug > 0 prints ill-formed commands in valid packets & checksum errors */
+/* debug > 0 prints ill-formed commands in valid packets & checksum errors */
static const char hexchars[]="0123456789abcdef";
/* there are 180 bytes of registers on a 68020 w/68881 */
/* many of the fpa registers are 12 byte (96 bit) registers */
#define NUMREGBYTES 180
-enum regnames {D0,D1,D2,D3,D4,D5,D6,D7,
- A0,A1,A2,A3,A4,A5,A6,A7,
+enum regnames {D0,D1,D2,D3,D4,D5,D6,D7,
+ A0,A1,A2,A3,A4,A5,A6,A7,
PS,PC,
FP0,FP1,FP2,FP3,FP4,FP5,FP6,FP7,
FPCONTROL,FPSTATUS,FPIADDR
@@ -205,7 +205,7 @@ static int* stackPtr = &remcomStack[STACKSIZE/sizeof(int) - 1];
/*
* In many cases, the system will want to continue exception processing
- * when a continue command is given.
+ * when a continue command is given.
* oldExceptionHook is a function to invoke in this case.
*/
@@ -351,11 +351,11 @@ extern void _catchException(void);
* stack on entry: stack on exit:
* N bytes of junk exception # MSWord
* Exception Format Word exception # MSWord
- * Program counter LSWord
- * Program counter MSWord
- * Status Register
- *
- *
+ * Program counter LSWord
+ * Program counter MSWord
+ * Status Register
+ *
+ *
*/
asm(" \n\
.text\n\
@@ -371,7 +371,7 @@ asm("\n\
moveml %d0-%d7/%a0-%a6,registers /* save registers */\n\
movel lastFrame,%a0 /* last frame pointer */\n\
");
-SAVE_FP_REGS();
+SAVE_FP_REGS();
asm("\n\
lea registers,%a5 /* get address of registers */\n\
movew %sp@,%d1 /* get status register */\n\
@@ -445,14 +445,14 @@ a7saveDone:\n\
/* This function is called when an exception occurs. It translates the
* return address found on the stack into an exception vector # which
* is then handled by either handle_exception or a system handler.
- * _catchException provides a front end for both.
+ * _catchException provides a front end for both.
*
* stack on entry: stack on exit:
- * Program counter MSWord exception # MSWord
+ * Program counter MSWord exception # MSWord
* Program counter LSWord exception # MSWord
- * Status Register
- * Return Address MSWord
- * Return Address LSWord
+ * Status Register
+ * Return Address MSWord
+ * Return Address LSWord
*/
asm("\n\
.text\n\
@@ -466,7 +466,7 @@ asm("\n\
movel lastFrame,%a0 /* last frame pointer */\n\
");
-SAVE_FP_REGS();
+SAVE_FP_REGS();
asm("\n\
moveq.l #0,%d2\n\
movew %sp@+,%d2\n\
@@ -566,7 +566,7 @@ void _returnFromException(Frame *frame)
frame->pc = registers[(int) PC];
if (registers[(int) PS] & 0x2000)
- {
+ {
/* return to supervisor mode... */
return_to_super();
}
@@ -592,15 +592,15 @@ void getpacket(char *buffer)
int i;
int count;
char ch;
-
+
do {
/* wait around for the start character, ignore all other characters */
- while ((ch = (getDebugChar() & 0x7f)) != '$');
+ while ((ch = (getDebugChar() & 0x7f)) != '$');
checksum = 0;
xmitcsum = -1;
-
+
count = 0;
-
+
/* now, read until a # or end of buffer is found */
while (count < BUFMAX) {
ch = getDebugChar() & 0x7f;
@@ -618,8 +618,8 @@ void getpacket(char *buffer)
debug_port_printf ("bad checksum. My count = 0x%x, sent=0x%x. buf=%s\n",
checksum,xmitcsum,buffer);
}
-
- if (checksum != xmitcsum) putDebugChar('-'); /* failed checksum */
+
+ if (checksum != xmitcsum) putDebugChar('-'); /* failed checksum */
else {
putDebugChar('+'); /* successful transfer */
/* if a sequence char is present, reply the sequence ID */
@@ -629,13 +629,13 @@ void getpacket(char *buffer)
/* remove sequence chars from buffer */
count = strlen(buffer);
for (i=3; i <= count; i++) buffer[i-3] = buffer[i];
- }
- }
- }
- } while (checksum != xmitcsum);
+ }
+ }
+ }
+ } while (checksum != xmitcsum);
}
-/* send the packet in buffer. The host get's one chance to read it.
+/* send the packet in buffer. The host get's one chance to read it.
This routine does not wait for a positive acknowledge. */
@@ -645,25 +645,25 @@ putpacket(char *buffer)
unsigned char checksum;
int count;
char ch;
-
+
/* $<packet info>#<checksum>. */
do {
putDebugChar('$');
checksum = 0;
count = 0;
-
+
while ((ch=buffer[count])) {
if (! putDebugChar(ch)) return;
checksum += ch;
count += 1;
}
-
+
putDebugChar('#');
putDebugChar(hexchars[checksum >> 4]);
putDebugChar(hexchars[checksum % 16]);
} while (1 == 0); /* (getDebugChar() != '+'); */
-
+
}
char remcomInBuffer[BUFMAX];
@@ -676,16 +676,16 @@ char *mem2hex(char *mem, char *buf, int count)
{
int i;
unsigned char ch;
-
+
if (remote_debug)
- debug_port_printf("mem=0x%x, count=0x%x\n", mem, count);
-
+ debug_port_printf("mem=0x%x, count=0x%x\n", mem, count);
+
for (i=0;i<count;i++) {
ch = *mem++;
*buf++ = hexchars[ch >> 4];
*buf++ = hexchars[ch % 16];
}
- *buf = 0;
+ *buf = 0;
return(buf);
}
@@ -695,10 +695,10 @@ char *hex2mem(char *buf, char *mem, int count)
{
int i;
unsigned char ch;
-
+
if (remote_debug)
- debug_port_printf("mem=0x%x, count=0x%x\n", mem, count);
-
+ debug_port_printf("mem=0x%x, count=0x%x\n", mem, count);
+
for (i=0;i<count;i++) {
ch = hex(*buf++) << 4;
ch = ch + hex(*buf++);
@@ -715,7 +715,7 @@ void handle_buserror()
longjmp(remcomEnv,1);
}
-/* this function takes the 68000 exception number and attempts to
+/* this function takes the 68000 exception number and attempts to
translate this number into a unix compatible signal value */
int computeSignal(int exceptionVector)
{
@@ -752,7 +752,7 @@ int computeSignal(int exceptionVector)
case 52: sigval = 8; break; /* operand error */
case 53: sigval = 8; break; /* overflow */
case 54: sigval = 8; break; /* NAN */
- default:
+ default:
sigval = 7; /* "software generated"*/
}
return (sigval);
@@ -766,7 +766,7 @@ int hexToInt(char **ptr, int *intValue)
{
int numChars = 0;
int hexValue;
-
+
*intValue = 0;
while (**ptr)
@@ -779,7 +779,7 @@ int hexToInt(char **ptr, int *intValue)
}
else
break;
-
+
(*ptr)++;
}
@@ -796,11 +796,11 @@ void handle_exception(int exceptionVector)
char * ptr;
int newPC;
Frame *frame;
-
+
if (remote_debug)
- printf("vector=%d, sr=0x%x, pc=0x%x\n",
+ printf("vector=%d, sr=0x%x, pc=0x%x\n",
exceptionVector,
- registers[ PS ],
+ registers[ PS ],
registers[ PC ]);
/* reply to host that an exception has occurred */
@@ -810,9 +810,9 @@ void handle_exception(int exceptionVector)
remcomOutBuffer[2] = hexchars[sigval % 16];
remcomOutBuffer[3] = 0;
- putpacket(remcomOutBuffer);
+ putpacket(remcomOutBuffer);
- while (1==1) {
+ while (1==1) {
error = 0;
remcomOutBuffer[0] = 0;
getpacket(remcomInBuffer);
@@ -821,19 +821,19 @@ void handle_exception(int exceptionVector)
remcomOutBuffer[1] = hexchars[sigval >> 4];
remcomOutBuffer[2] = hexchars[sigval % 16];
remcomOutBuffer[3] = 0;
- break;
+ break;
case 'd' :
remote_debug = !(remote_debug); /* toggle debug flag */
debug_port_printf("debug mode ");
if (remote_debug)
- {
+ {
debug_port_printf("on\n");
}
else
- {
+ {
debug_port_printf("off\n");
- }
- break;
+ }
+ break;
case 'g' : /* return the value of the CPU registers */
mem2hex((char*) registers, remcomOutBuffer, NUMREGBYTES);
break;
@@ -841,18 +841,18 @@ void handle_exception(int exceptionVector)
hex2mem(&remcomInBuffer[1], (char*) registers, NUMREGBYTES);
strcpy(remcomOutBuffer,"OK");
break;
-
+
/* mAA..AA,LLLL Read LLLL bytes at address AA..AA */
- case 'm' :
+ case 'm' :
if (setjmp(remcomEnv) == 0)
{
- exceptionHandler(2,handle_buserror);
+ exceptionHandler(2,handle_buserror);
/* TRY TO READ %x,%x. IF SUCCEED, SET PTR = 0 */
ptr = &remcomInBuffer[1];
if (hexToInt(&ptr,&addr))
if (*(ptr++) == ',')
- if (hexToInt(&ptr,&length))
+ if (hexToInt(&ptr,&length))
{
ptr = 0;
mem2hex((char*) addr, remcomOutBuffer, length);
@@ -863,24 +863,24 @@ void handle_exception(int exceptionVector)
strcpy(remcomOutBuffer,"E01");
if (remote_debug)
printf("malformed read memory command: %s",remcomInBuffer);
- }
- }
+ }
+ }
else {
- exceptionHandler(2,_catchException);
+ exceptionHandler(2,_catchException);
strcpy(remcomOutBuffer,"E03");
if (remote_debug)
printf("bus error");
- }
-
+ }
+
/* restore handler for bus error */
- exceptionHandler(2,_catchException);
+ exceptionHandler(2,_catchException);
break;
-
+
/* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
- case 'M' :
+ case 'M' :
if (setjmp(remcomEnv) == 0) {
- exceptionHandler(2,handle_buserror);
-
+ exceptionHandler(2,handle_buserror);
+
/* TRY TO READ '%x,%x:'. IF SUCCEED, SET PTR = 0 */
ptr = &remcomInBuffer[1];
if (hexToInt(&ptr,&addr))
@@ -897,43 +897,43 @@ void handle_exception(int exceptionVector)
strcpy(remcomOutBuffer,"E02");
if (remote_debug)
printf("malformed write memory command: %s",remcomInBuffer);
- }
- }
+ }
+ }
else {
- exceptionHandler(2,_catchException);
+ exceptionHandler(2,_catchException);
strcpy(remcomOutBuffer,"E03");
if (remote_debug)
printf("bus error");
- }
+ }
/* restore handler for bus error */
- exceptionHandler(2,_catchException);
+ exceptionHandler(2,_catchException);
break;
-
+
/* cAA..AA Continue at address AA..AA(optional) */
/* sAA..AA Step one instruction from AA..AA(optional) */
- case 'c' :
- case 's' :
+ case 'c' :
+ case 's' :
/* try to read optional parameter, pc unchanged if no parm */
ptr = &remcomInBuffer[1];
if (hexToInt(&ptr,&addr))
registers[ PC ] = addr;
-
+
newPC = registers[ PC];
-
+
/* clear the trace bit */
registers[ PS ] &= 0x7fff;
-
+
/* set the trace bit if we're stepping */
if (remcomInBuffer[0] == 's') registers[ PS ] |= 0x8000;
-
+
/*
* look for newPC in the linked list of exception frames.
* if it is found, use the old frame it. otherwise,
* fake up a dummy frame in returnFromException().
*/
if (remote_debug) debug_port_printf("new pc = 0x%x\n",newPC);
-
+
frame = lastFrame;
while (frame)
{
@@ -951,24 +951,24 @@ void handle_exception(int exceptionVector)
(frame->exceptionPC == newPC)) break;
if (frame == frame->previous)
{
- frame = 0; /* no match found */
- break;
+ frame = 0; /* no match found */
+ break;
}
frame = frame->previous;
}
-
+
/*
* If we found a match for the PC AND we are not returning
* as a result of a breakpoint (33),
* trace exception (9), nmi (31), jmp to
* the old exception handler as if this code never ran.
*/
- if (frame)
+ if (frame)
{
- if ((frame->exceptionVector != 9) &&
- (frame->exceptionVector != 31) &&
+ if ((frame->exceptionVector != 9) &&
+ (frame->exceptionVector != 31) &&
(frame->exceptionVector != 33))
- {
+ {
/*
* invoke the previous handler.
*/
@@ -986,13 +986,13 @@ void handle_exception(int exceptionVector)
_returnFromException( frame ); /* this is a jump */
}
}
- }
+ }
/* if we couldn't find a frame, create one */
if (frame == 0)
{
frame = lastFrame -1 ;
-
+
/* by using a bunch of print commands with breakpoints,
it's possible for the frame stack to creep down. If it creeps
too far, give up and reset it to the top. Normal use should
@@ -1001,28 +1001,28 @@ void handle_exception(int exceptionVector)
if ((unsigned int) (frame-2) < (unsigned int) &gdbFrameStack)
{
initializeRemcomErrorFrame();
- frame = lastFrame;
+ frame = lastFrame;
}
frame->previous = lastFrame;
lastFrame = frame;
- frame = 0; /* null so _return... will properly initialize it */
- }
-
+ frame = 0; /* null so _return... will properly initialize it */
+ }
+
_returnFromException( frame ); /* this is a jump */
break;
-
+
/* kill the program */
case 'k' :
/* reset the board */
WATCHDOG_TRIGGER();
while (1 == 1);
break;
-
- } /* switch */
-
+
+ } /* switch */
+
/* reply to the request */
- putpacket(remcomOutBuffer);
+ putpacket(remcomOutBuffer);
}
}
@@ -1033,13 +1033,13 @@ void initializeRemcomErrorFrame()
lastFrame->previous = lastFrame;
}
-/* this function is used to set up exception handlers for tracing and
+/* this function is used to set up exception handlers for tracing and
breakpoints */
void set_debug_traps()
{
extern void _debug_level7(void);
extern void remcomHandler(void);
-
+
int exception;
initializeRemcomErrorFrame();
@@ -1047,39 +1047,39 @@ void set_debug_traps()
registers[ PC ] = 0x400;
registers[ PS ] = 0x2700;
-
+
for (exception = 2; exception <= 30; exception++)
- exceptionHandler(exception,_catchException);
+ exceptionHandler(exception,_catchException);
/* level 7 interrupt */
- exceptionHandler(31,_debug_level7);
-
+ exceptionHandler(31,_debug_level7);
+
for (exception = 32; exception <= 47; exception++)
- exceptionHandler(exception,_catchException);
+ exceptionHandler(exception,_catchException);
/* exclude the unassigned, reserved vector locations */
-
+
for (exception = 64; exception <= 255; exception++)
- exceptionHandler(exception,_catchException);
+ exceptionHandler(exception,_catchException);
if (oldExceptionHook != (ExceptionHook) remcomHandler)
{
oldExceptionHook = exceptionHook;
exceptionHook = (ExceptionHook) remcomHandler;
}
-
+
initialized = 1;
-#if defined(UPDATE_DISPLAY)
+#if defined(UPDATE_DISPLAY)
UPDATE_DISPLAY("gdb ");
-#endif
+#endif
}
/* This function will generate a breakpoint exception. It is used at the
beginning of a program to sync up with a debugger and can be used
otherwise as a quick means to stop program execution and "break" into
the debugger. */
-
+
void breakpoint()
{
if (initialized) BREAKPOINT();
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/memcheck.c b/c/src/lib/libbsp/m68k/ods68302/startup/memcheck.c
index 4341a88e37..140a62e1e5 100644
--- a/c/src/lib/libbsp/m68k/ods68302/startup/memcheck.c
+++ b/c/src/lib/libbsp/m68k/ods68302/startup/memcheck.c
@@ -8,7 +8,7 @@
The boot test is a minimal, non-desctructive.
The partial memory test performs a scetion at a time, and gets
called in a repeated fashion to completely check the memory,
-
+
*/
/*****************************************************************************/
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/trace.c b/c/src/lib/libbsp/m68k/ods68302/startup/trace.c
index a712c0bb52..7d0945bc9a 100644
--- a/c/src/lib/libbsp/m68k/ods68302/startup/trace.c
+++ b/c/src/lib/libbsp/m68k/ods68302/startup/trace.c
@@ -1,7 +1,7 @@
/*****************************************************************************/
/*
$Id$
-
+
Trace Exception dumps a back trace to the debug serial port
*/
@@ -135,13 +135,13 @@ void trace_exception(unsigned long d0,
}
else
{
- debug_port_out(' ');
+ debug_port_out(' ');
}
-
+
ch = (*(((char*) &index) + index) >> 4) & 0x0F;
-
+
if (ch < 10)
- {
+ {
ch += '0';
}
else
@@ -152,9 +152,9 @@ void trace_exception(unsigned long d0,
debug_port_out((char) ch);
ch = *(((char*) &index) + index) & 0x0F;
-
+
if (ch < 10)
- {
+ {
ch += '0';
}
else
@@ -167,9 +167,9 @@ void trace_exception(unsigned long d0,
debug_port_write("\nhalting cpu...");
#if defined(UPDATE_DISPLAY)
- UPDATE_DISPLAY("HALT");
+ UPDATE_DISPLAY("HALT");
#endif
-
+
WATCHDOG_TRIGGER();
while (1 == 1);
}