2002-10-31 Joel Sherrill <joel@OARcorp.com>

* m68k-stub.c: Fixed warnings about multi-line strings in asm.
This commit is contained in:
Joel Sherrill
2002-10-31 20:07:42 +00:00
parent 42e42307f1
commit ee55cdb891
2 changed files with 81 additions and 76 deletions

View File

@@ -1,3 +1,7 @@
2002-10-31 Joel Sherrill <joel@OARcorp.com>
* m68k-stub.c: Fixed warnings about multi-line strings in asm.
2002-07-01 Joel Sherrill <joel@OARcorp.com> 2002-07-01 Joel Sherrill <joel@OARcorp.com>
* m68k-stub.c: Eliminated multi-line asm statements for gcc 3.x. * m68k-stub.c: Eliminated multi-line asm statements for gcc 3.x.

View File

@@ -349,75 +349,75 @@ asm(" \n\
move.l lastFrame,%a0 /* last frame pointer */ \n\ move.l lastFrame,%a0 /* last frame pointer */ \n\
"); ");
SAVE_FP_REGS(); SAVE_FP_REGS();
asm(" asm("\n\
lea registers,%a5 /* get address of registers */ lea registers,%a5 /* get address of registers */\n\
move.w (%sp),%d1 /* get status register */ move.w (%sp),%d1 /* get status register */\n\
move.w %d1,66(%a5) /* save sr */ move.w %d1,66(%a5) /* save sr */ \n\
move.l 2(%sp),%a4 /* save pc in a4 for later use */ move.l 2(%sp),%a4 /* save pc in a4 for later use */\n\
move.w 6(%sp),%d0 /* get '020 exception format */ move.w 6(%sp),%d0 /* get '020 exception format */\n\
move.w %d0,%d2 /* make a copy of format word */ move.w %d0,%d2 /* make a copy of format word */\n\
# #\n\
# compute exception number # compute exception number\n\
and.l #0xfff,%d2 /* mask off vector offset */ and.l #0xfff,%d2 /* mask off vector offset */\n\
lsr.w #2,%d2 /* divide by 4 to get vect num */ lsr.w #2,%d2 /* divide by 4 to get vect num */\n\
#if 1 /* #if 1 */\n\
cmp.l #33,%d2 cmp.l #33,%d2\n\
bne nopc_adjust bne nopc_adjust\n\
subq.l #2,%a4 subq.l #2,%a4\n\
nopc_adjust: nopc_adjust:\n\
#endif /* #endif */\n\
move.l %a4,68(%a5) /* save pc in _regisers[] */ move.l %a4,68(%a5) /* save pc in _regisers[] */\n\
\n\
# #\n\
# figure out how many bytes in the stack frame # figure out how many bytes in the stack frame\n\
andi.w #0xf000,%d0 /* mask off format type */ andi.w #0xf000,%d0 /* mask off format type */\n\
rol.w #5,%d0 /* rotate into the low byte *2 */ rol.w #5,%d0 /* rotate into the low byte *2 */\n\
lea exceptionSize,%a1 lea exceptionSize,%a1 \n\
add.w %d0,%a1 /* index into the table */ add.w %d0,%a1 /* index into the table */\n\
move.w (%a1),%d0 /* get number of words in frame */ move.w (%a1),%d0 /* get number of words in frame */\n\
move.w %d0,%d3 /* save it */ move.w %d0,%d3 /* save it */\n\
sub.w %d0,%a0 /* adjust save pointer */ sub.w %d0,%a0 /* adjust save pointer */\n\
sub.w %d0,%a0 /* adjust save pointer(bytes) */ sub.w %d0,%a0 /* adjust save pointer(bytes) */\n\
move.l %a0,%a1 /* copy save pointer */ move.l %a0,%a1 /* copy save pointer */\n\
subq.l #1,%d0 /* predecrement loop counter */ subq.l #1,%d0 /* predecrement loop counter */\n\
# #\n\
# copy the frame # copy the frame\n\
saveFrameLoop: saveFrameLoop:\n\
move.w (%sp)+,(%a1)+ move.w (%sp)+,(%a1)+\n\
dbf %d0,saveFrameLoop dbf %d0,saveFrameLoop\n\
# #\n\
# now that the stack has been clenaed, # now that the stack has been clenaed,\n\
# save the a7 in use at time of exception # save the a7 in use at time of exception\n\
move.l %sp,superStack /* save supervisor sp */ move.l %sp,superStack /* save supervisor sp */\n\
andi.w #0x2000,%d1 /* were we in supervisor mode ? */ andi.w #0x2000,%d1 /* were we in supervisor mode ? */\n\
beq userMode beq userMode \n\
move.l %a7,60(%a5) /* save a7 */ move.l %a7,60(%a5) /* save a7 */\n\
bra a7saveDone bra a7saveDone\n\
userMode: userMode: \n\
move.l %usp,%a1 move.l %usp,%a1 \n\
move.l %a1,60(%a5) /* save user stack pointer */ move.l %a1,60(%a5) /* save user stack pointer */\n\
a7saveDone: a7saveDone:\n\
\n\
# #\n\
# save size of frame # save size of frame\n\
move.w %d3,-(%a0) move.w %d3,-(%a0)\n\
\n\
move.l %d2,-(%a0) /* save vector number */ move.l %d2,-(%a0) /* save vector number */\n\
# #\n\
# save pc causing exception # save pc causing exception\n\
move.l %a4,-(%a0) move.l %a4,-(%a0)\n\
# #\n\
# save old frame link and set the new value # save old frame link and set the new value\n\
move.l lastFrame,%a1 /* last frame pointer */ move.l lastFrame,%a1 /* last frame pointer */\n\
move.l %a1,-(%a0) /* save pointer to prev frame */ move.l %a1,-(%a0) /* save pointer to prev frame */\n\
move.l %a0,lastFrame move.l %a0,lastFrame\n\
\n\
move.l %d2,-(%sp) /* push exception num */ move.l %d2,-(%sp) /* push exception num */\n\
move.l exceptionHook,%a0 /* get address of handler */ move.l exceptionHook,%a0 /* get address of handler */\n\
jbsr (%a0) /* and call it */ jbsr (%a0) /* and call it */\n\
clr.l (%sp) /* replace exception num parm with frame ptr */ clr.l (%sp) /* replace exception num parm with frame ptr */\n\
jbsr _returnFromException /* jbsr, but never returns */ jbsr _returnFromException /* jbsr, but never returns */\n\
"); ");\n\
#else /* mc68000 */ #else /* mc68000 */
/* This function is called when an exception occurs. It translates the /* This function is called when an exception occurs. It translates the
* return address found on the stack into an exception vector # which * return address found on the stack into an exception vector # which
@@ -431,12 +431,12 @@ a7saveDone:
* Return Address MSWord * Return Address MSWord
* Return Address LSWord * Return Address LSWord
*/ */
asm(" asm("\n\
.text .text\n\
.globl _catchException .globl _catchException\n\
_catchException:"); _catchException:");
DISABLE_INTERRUPTS(); DISABLE_INTERRUPTS();
asm(" asm("\
moveml %d0-%d7/%a0-%a6,registers /* save registers */ \n\ moveml %d0-%d7/%a0-%a6,registers /* save registers */ \n\
movel lastFrame,%a0 /* last frame pointer */ \n\ movel lastFrame,%a0 /* last frame pointer */ \n\
"); ");
@@ -665,9 +665,10 @@ char remcomOutBuffer[BUFMAX];
static short error; static short error;
void debug_error(format, parm) void debug_error(
char * format; char * format,
char * parm; char * parm
)
{ {
if (remote_debug) fprintf (stderr,format,parm); if (remote_debug) fprintf (stderr,format,parm);
} }