forked from Imagelibrary/rtems
2002-07-01 Joel Sherrill <joel@OARcorp.com>
* m68k-stub.c: Eliminated multi-line asm statements for gcc 3.x.
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
2002-07-01 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
|
* m68k-stub.c: Eliminated multi-line asm statements for gcc 3.x.
|
||||||
|
|
||||||
2002-06-25 Thomas Doerfler <Thomas.Doerfler@imd-systems.de>
|
2002-06-25 Thomas Doerfler <Thomas.Doerfler@imd-systems.de>
|
||||||
|
|
||||||
* Added m68k serial stub that is thread aware.
|
* Added m68k serial stub that is thread aware.
|
||||||
|
|||||||
@@ -261,33 +261,33 @@ void m68k_stub_dummy_asm_wrapper()
|
|||||||
* that the C compiler manages sections properly
|
* that the C compiler manages sections properly
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
asm("
|
asm("\n\
|
||||||
.globl return_to_super
|
.globl return_to_super \n\
|
||||||
return_to_super:
|
return_to_super: \n\
|
||||||
move.l registers+60,%sp /* get new stack pointer */
|
move.l registers+60,%sp /* get new stack pointer */ \n\
|
||||||
move.l lastFrame,%a0 /* get last frame info */
|
move.l lastFrame,%a0 /* get last frame info */ \n\
|
||||||
bra return_to_any
|
bra return_to_any \n\
|
||||||
|
\n\
|
||||||
.globl _return_to_user
|
.globl _return_to_user \n\
|
||||||
return_to_user:
|
return_to_user: \n\
|
||||||
move.l registers+60,%a0 /* get usp */
|
move.l registers+60,%a0 /* get usp */ \n\
|
||||||
move.l %a0,%usp /* set usp */
|
move.l %a0,%usp /* set usp */ \n\
|
||||||
move.l superStack,%sp /* get original stack pointer */
|
move.l superStack,%sp /* get original stack pointer */ \n\
|
||||||
|
\n\
|
||||||
return_to_any:
|
return_to_any: \n\
|
||||||
move.l lastFrame,%a0 /* get last frame info */
|
move.l lastFrame,%a0 /* get last frame info */ \n\
|
||||||
move.l (%a0)+,lastFrame /* link in previous frame */
|
move.l (%a0)+,lastFrame /* link in previous frame */ \n\
|
||||||
addq.l #8,%a0 /* skip over pc, vector#*/
|
addq.l #8,%a0 /* skip over pc, vector#*/ \n\
|
||||||
move.w (%a0)+,%d0 /* get # of words in cpu frame */
|
move.w (%a0)+,%d0 /* get # of words in cpu frame */ \n\
|
||||||
add.w %d0,%a0 /* point to end of data */
|
add.w %d0,%a0 /* point to end of data */ \n\
|
||||||
add.w %d0,%a0 /* point to end of data */
|
add.w %d0,%a0 /* point to end of data */ \n\
|
||||||
move.l %a0,%a1
|
move.l %a0,%a1 \n\
|
||||||
#
|
# \n\
|
||||||
# copy the stack frame
|
# copy the stack frame \n\
|
||||||
subq.l #1,%d0
|
subq.l #1,%d0 \n\
|
||||||
copyUserLoop:
|
copyUserLoop: \n\
|
||||||
move.w -(%a1),-(%sp)
|
move.w -(%a1),-(%sp) \n\
|
||||||
dbf %d0,copyUserLoop
|
dbf %d0,copyUserLoop \n\
|
||||||
");
|
");
|
||||||
RESTORE_FP_REGS()
|
RESTORE_FP_REGS()
|
||||||
asm(" movem.l registers,%d0-%d7/%a0-%a6");
|
asm(" movem.l registers,%d0-%d7/%a0-%a6");
|
||||||
@@ -300,22 +300,22 @@ copyUserLoop:
|
|||||||
/* if the previous interrupt level was 7 then we're already servicing */
|
/* if the previous interrupt level was 7 then we're already servicing */
|
||||||
/* this interrupt and an rte is in order to return to the debugger. */
|
/* this interrupt and an rte is in order to return to the debugger. */
|
||||||
/* For the 68000, the offset for sr is 6 due to the jsr return address */
|
/* For the 68000, the offset for sr is 6 due to the jsr return address */
|
||||||
asm("
|
asm(" \n\
|
||||||
.text
|
.text \n\
|
||||||
.globl _debug_level7
|
.globl _debug_level7 \n\
|
||||||
_debug_level7:
|
_debug_level7: \n\
|
||||||
move.w %d0,-(%sp)");
|
move.w %d0,-(%sp)");
|
||||||
#if M68K_HAS_VBR
|
#if M68K_HAS_VBR
|
||||||
asm(" move.w 2(%sp),%d0");
|
asm(" move.w 2(%sp),%d0");
|
||||||
#else
|
#else
|
||||||
asm(" move.w 6(%sp),%d0");
|
asm(" move.w 6(%sp),%d0");
|
||||||
#endif
|
#endif
|
||||||
asm(" andi.w #0x700,%d0
|
asm(" andi.w #0x700,%d0 \n\
|
||||||
cmpi.w #0x700,%d0
|
cmpi.w #0x700,%d0 \n\
|
||||||
beq already7
|
beq already7 \n\
|
||||||
move.w (%sp)+,%d0
|
move.w (%sp)+,%d0 \n\
|
||||||
bra _catchException
|
bra _catchException \n\
|
||||||
already7:
|
already7: \n\
|
||||||
move.w (%sp)+,%d0");
|
move.w (%sp)+,%d0");
|
||||||
#if !M68K_HAS_VBR
|
#if !M68K_HAS_VBR
|
||||||
asm(" lea 4(%sp),%sp"); /* pull off 68000 return address */
|
asm(" lea 4(%sp),%sp"); /* pull off 68000 return address */
|
||||||
@@ -339,14 +339,14 @@ asm(" rte");
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
asm("
|
asm(" \n\
|
||||||
.text
|
.text \n\
|
||||||
.globl _catchException
|
.globl _catchException \n\
|
||||||
_catchException:");
|
_catchException:");
|
||||||
DISABLE_INTERRUPTS();
|
DISABLE_INTERRUPTS();
|
||||||
asm("
|
asm(" \n\
|
||||||
movem.l %d0-%d7/%a0-%a6,registers /* save registers */
|
movem.l %d0-%d7/%a0-%a6,registers /* save registers */ \n\
|
||||||
move.l lastFrame,%a0 /* last frame pointer */
|
move.l lastFrame,%a0 /* last frame pointer */ \n\
|
||||||
");
|
");
|
||||||
SAVE_FP_REGS();
|
SAVE_FP_REGS();
|
||||||
asm("
|
asm("
|
||||||
|
|||||||
Reference in New Issue
Block a user