use copymem.i to copy kernel

This commit is contained in:
Laurent Vivier 2004-06-07 22:13:00 +00:00
parent f71c1048cd
commit ecfd051646
4 changed files with 35 additions and 12 deletions

View File

@ -35,14 +35,14 @@ second.o: $(OBJS) ld.script
MMU030_asm.o: MMU030_asm.S
$(AS) $(ASFLAGS) -m68030 -o $@ $^
enter_kernel030.o: enter_kernel030.S
$(AS) $(ASFLAGS) -m68030 -o $@ $^
enter_kernel030.o: enter_kernel030.S copymem.i
$(AS) $(ASFLAGS) -m68030 -o $@ $<
MMU040_asm.o: MMU040_asm.S
$(AS) $(ASFLAGS) -m68040 -o $@ $^
enter_kernel040.o: enter_kernel040.S
$(AS) $(ASFLAGS) -m68040 -o $@ $^
enter_kernel040.o: enter_kernel040.S copymem.i
$(AS) $(ASFLAGS) -m68040 -o $@ $<
.c.o:
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $^

25
second/copymem.i Normal file
View File

@ -0,0 +1,25 @@
/*
*
* (c) 2004 Laurent Vivier <LaurentVivier@wanadoo.fr>
*
*/
.macro copymem src, dst, size
cmpa.l \src, \dst
bgt.s 1f
0:
move.b (\src)+,(\dst)+
subq.l #1,\size
bge.s 0b
bra 4f
1:
adda.l \size, \src
adda.l \size, \dst
2:
move.b -(\src),-(\dst)
subq.l #1,\size
bge.s 2b
4:
.endm

View File

@ -4,6 +4,8 @@
*
*/
.include "copymem.i"
.align 4
.global enter_kernel030
@ -37,10 +39,7 @@ enter_kernel030:
move.l %a2, %a1
copy_loop:
move.b (%a0)+, (%a2)+
subq.l #1, %d0
bge.s copy_loop
copymem %a0, %a2, %d0
/* jump into kernel */

View File

@ -4,6 +4,8 @@
*
*/
.include "copymem.i"
.align 4
.global enter_kernel040
@ -35,10 +37,7 @@ enter_kernel040:
move.l %a2, %a1
copy_loop:
move.b (%a0)+, (%a2)+
subq.l #1, %d0
bge.s copy_loop
copymem %a0, %a2, %d0
/* jump into kernel */