Change comment style to match the rest of locore.
This commit is contained in:
parent
989a13ef22
commit
bc743704d0
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: copy.s,v 1.18 1995/02/08 17:32:13 mycroft Exp $ */
|
/* $NetBSD: copy.s,v 1.19 1995/02/08 17:38:03 mycroft Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1994, 1995 Charles Hannum.
|
* Copyright (c) 1994, 1995 Charles Hannum.
|
||||||
|
@ -64,54 +64,54 @@
|
||||||
* - longword align when possible (only on the 68020)
|
* - longword align when possible (only on the 68020)
|
||||||
*/
|
*/
|
||||||
ENTRY(copyin)
|
ENTRY(copyin)
|
||||||
movl sp@(12),d0 /* check count */
|
movl sp@(12),d0 | check count
|
||||||
beq ciabort /* <= 0, don't do anything */
|
beq ciabort | == 0, don't do anything
|
||||||
#ifdef MAPPEDCOPY
|
#ifdef MAPPEDCOPY
|
||||||
.globl _mappedcopysize,_mappedcopyin
|
.globl _mappedcopysize,_mappedcopyin
|
||||||
cmpl _mappedcopysize,d0 | size >= mappedcopysize
|
cmpl _mappedcopysize,d0 | size >= mappedcopysize
|
||||||
bcc _mappedcopyin | yes, go do it the new way
|
bcc _mappedcopyin | yes, go do it the new way
|
||||||
#endif
|
#endif
|
||||||
movl d2,sp@-
|
movl d2,sp@-
|
||||||
movl _curpcb,a0 /* set fault handler */
|
movl _curpcb,a0 | set fault handler
|
||||||
movl #cifault,a0@(PCB_ONFAULT)
|
movl #cifault,a0@(PCB_ONFAULT)
|
||||||
movl sp@(8),a0 /* src address */
|
movl sp@(8),a0 | src address
|
||||||
movl sp@(12),a1 /* dest address */
|
movl sp@(12),a1 | dest address
|
||||||
USER_SFC
|
USER_SFC
|
||||||
movl a0,d1
|
movl a0,d1
|
||||||
btst #0,d1 /* src address odd? */
|
btst #0,d1 | src address odd?
|
||||||
beq cieven /* no, skip alignment */
|
beq cieven | no, skip alignment
|
||||||
movsb a0@+,d2 /* yes, copy a byte */
|
movsb a0@+,d2 | yes, copy a byte
|
||||||
movb d2,a1@+
|
movb d2,a1@+
|
||||||
subql #1,d0 /* adjust count */
|
subql #1,d0 | adjust count
|
||||||
beq cidone /* count 0, all done */
|
beq cidone | count 0, all done
|
||||||
cieven:
|
cieven:
|
||||||
movl a1,d1
|
movl a1,d1
|
||||||
btst #0,d1 /* dest address odd? */
|
btst #0,d1 | dest address odd?
|
||||||
bne cibytes /* yes, no hope for alignment, copy bytes */
|
bne cibytes | yes, no hope for alignment, copy bytes
|
||||||
movl d0,d1 /* no, both even */
|
movl d0,d1 | no, both even
|
||||||
lsrl #2,d1 /* convert count to longword count */
|
lsrl #2,d1 | convert count to longword count
|
||||||
beq cibytes /* count 0, skip longword loop */
|
beq cibytes | count 0, skip longword loop
|
||||||
subql #1,d1 /* predecrement for dbf */
|
subql #1,d1 | predecrement for dbf
|
||||||
cilloop:
|
cilloop:
|
||||||
movsl a0@+,d2 /* copy a longword */
|
movsl a0@+,d2 | copy a longword
|
||||||
movl d2,a1@+
|
movl d2,a1@+
|
||||||
dbf d1,cilloop /* decrement low word of count */
|
dbf d1,cilloop | decrement low word of count
|
||||||
subil #0x10000,d1 /* decrement high word of count */
|
subil #0x10000,d1 | decrement high word of count
|
||||||
bcc cilloop
|
bcc cilloop
|
||||||
andl #3,d0 /* what remains */
|
andl #3,d0 | what remains
|
||||||
beq cidone /* nothing, all done */
|
beq cidone | nothing, all done
|
||||||
cibytes:
|
cibytes:
|
||||||
subql #1,d0 /* predecrement for dbf */
|
subql #1,d0 | predecrement for dbf
|
||||||
cibloop:
|
cibloop:
|
||||||
movsb a0@+,d2 /* copy a byte */
|
movsb a0@+,d2 | copy a byte
|
||||||
movb d2,a1@+
|
movb d2,a1@+
|
||||||
dbf d0,cibloop /* decrement low word of count */
|
dbf d0,cibloop | decrement low word of count
|
||||||
subil #0x10000,d0 /* decrement high word of count */
|
subil #0x10000,d0 | decrement high word of count
|
||||||
bcc cibloop
|
bcc cibloop
|
||||||
clrl d0 /* no error */
|
clrl d0 | no error
|
||||||
cidone:
|
cidone:
|
||||||
KERNEL_SFC
|
KERNEL_SFC
|
||||||
movl _curpcb,a0 /* clear fault handler */
|
movl _curpcb,a0 | clear fault handler
|
||||||
clrl a0@(PCB_ONFAULT)
|
clrl a0@(PCB_ONFAULT)
|
||||||
movl sp@+,d2
|
movl sp@+,d2
|
||||||
ciabort:
|
ciabort:
|
||||||
|
@ -129,54 +129,54 @@ cifault:
|
||||||
* - longword align when possible (only on the 68020)
|
* - longword align when possible (only on the 68020)
|
||||||
*/
|
*/
|
||||||
ENTRY(copyout)
|
ENTRY(copyout)
|
||||||
movl sp@(12),d0 /* check count */
|
movl sp@(12),d0 | check count
|
||||||
beq coabort /* <= 0, don't do anything */
|
beq coabort | == 0, don't do anything
|
||||||
#ifdef MAPPEDCOPY
|
#ifdef MAPPEDCOPY
|
||||||
.globl _mappedcopysize,_mappedcopyout
|
.globl _mappedcopysize,_mappedcopyout
|
||||||
cmpl _mappedcopysize,d0 | size >= mappedcopysize
|
cmpl _mappedcopysize,d0 | size >= mappedcopysize
|
||||||
bcc _mappedcopyout | yes, go do it the new way
|
bcc _mappedcopyout | yes, go do it the new way
|
||||||
#endif
|
#endif
|
||||||
movl d2,sp@-
|
movl d2,sp@-
|
||||||
movl _curpcb,a0 /* set fault handler */
|
movl _curpcb,a0 | set fault handler
|
||||||
movl #cofault,a0@(PCB_ONFAULT)
|
movl #cofault,a0@(PCB_ONFAULT)
|
||||||
movl sp@(8),a0 /* src address */
|
movl sp@(8),a0 | src address
|
||||||
movl sp@(12),a1 /* dest address */
|
movl sp@(12),a1 | dest address
|
||||||
USER_DFC
|
USER_DFC
|
||||||
movl a0,d1
|
movl a0,d1
|
||||||
btst #0,d1 /* src address odd? */
|
btst #0,d1 | src address odd?
|
||||||
beq coeven /* no, skip alignment */
|
beq coeven | no, skip alignment
|
||||||
movb a0@+,d2 /* yes, copy a byte */
|
movb a0@+,d2 | yes, copy a byte
|
||||||
movsb d2,a1@+
|
movsb d2,a1@+
|
||||||
subql #1,d0 /* adjust count */
|
subql #1,d0 | adjust count
|
||||||
beq codone /* count 0, all done */
|
beq codone | count 0, all done
|
||||||
coeven:
|
coeven:
|
||||||
movl a1,d1
|
movl a1,d1
|
||||||
btst #0,d1 /* dest address odd? */
|
btst #0,d1 | dest address odd?
|
||||||
bne cobytes /* yes, no hope for alignment, copy bytes */
|
bne cobytes | yes, no hope for alignment, copy bytes
|
||||||
movl d0,d1 /* no, both even */
|
movl d0,d1 | no, both even
|
||||||
lsrl #2,d1 /* convert count to longword count */
|
lsrl #2,d1 | convert count to longword count
|
||||||
beq cobytes /* count 0, skip longword loop */
|
beq cobytes | count 0, skip longword loop
|
||||||
subql #1,d1 /* predecrement for dbf */
|
subql #1,d1 | predecrement for dbf
|
||||||
colloop:
|
colloop:
|
||||||
movl a0@+,d2 /* copy a longword */
|
movl a0@+,d2 | copy a longword
|
||||||
movsl d2,a1@+
|
movsl d2,a1@+
|
||||||
dbf d1,colloop /* decrement low word of count */
|
dbf d1,colloop | decrement low word of count
|
||||||
subil #0x10000,d1 /* decrement high word of count */
|
subil #0x10000,d1 | decrement high word of count
|
||||||
bcc colloop
|
bcc colloop
|
||||||
andl #3,d0 /* what remains */
|
andl #3,d0 | what remains
|
||||||
beq codone /* nothing, all done */
|
beq codone | nothing, all done
|
||||||
cobytes:
|
cobytes:
|
||||||
subql #1,d0 /* predecrement for dbf */
|
subql #1,d0 | predecrement for dbf
|
||||||
cobloop:
|
cobloop:
|
||||||
movb a0@+,d2 /* copy a byte */
|
movb a0@+,d2 | copy a byte
|
||||||
movsb d2,a1@+
|
movsb d2,a1@+
|
||||||
dbf d0,cobloop /* decrement low word of count */
|
dbf d0,cobloop | decrement low word of count
|
||||||
subil #0x10000,d0 /* decrement high word of count */
|
subil #0x10000,d0 | decrement high word of count
|
||||||
bcc cobloop
|
bcc cobloop
|
||||||
clrl d0 /* no error */
|
clrl d0 | no error
|
||||||
codone:
|
codone:
|
||||||
KERNEL_DFC
|
KERNEL_DFC
|
||||||
movl _curpcb,a0 /* clear fault handler */
|
movl _curpcb,a0 | clear fault handler
|
||||||
clrl a0@(PCB_ONFAULT)
|
clrl a0@(PCB_ONFAULT)
|
||||||
movl sp@+,d2
|
movl sp@+,d2
|
||||||
coabort:
|
coabort:
|
||||||
|
@ -186,55 +186,55 @@ cofault:
|
||||||
jra codone
|
jra codone
|
||||||
|
|
||||||
ENTRY(copystr)
|
ENTRY(copystr)
|
||||||
movl sp@(4),a0 /* a0 = fromaddr */
|
movl sp@(4),a0 | a0 = fromaddr
|
||||||
movl sp@(8),a1 /* a1 = toaddr */
|
movl sp@(8),a1 | a1 = toaddr
|
||||||
clrl d0
|
clrl d0
|
||||||
movl sp@(12),d1 /* count */
|
movl sp@(12),d1 | count
|
||||||
beq csdone /* nothing to do */
|
beq csdone | nothing to do
|
||||||
subql #1,d1 /* predecrement for dbeq */
|
subql #1,d1 | predecrement for dbeq
|
||||||
csloop:
|
csloop:
|
||||||
movb a0@+,a1@+ /* copy a byte */
|
movb a0@+,a1@+ | copy a byte
|
||||||
dbeq d1,csloop /* decrement low word of count */
|
dbeq d1,csloop | decrement low word of count
|
||||||
beq csdone /* copied null, exit */
|
beq csdone | copied null, exit
|
||||||
subil #0x10000,d1 /* decrement high word of count */
|
subil #0x10000,d1 | decrement high word of count
|
||||||
bcc csloop /* more room, keep going */
|
bcc csloop | more room, keep going
|
||||||
moveq #ENAMETOOLONG,d0 /* ran out of space */
|
moveq #ENAMETOOLONG,d0 | ran out of space
|
||||||
csdone:
|
csdone:
|
||||||
tstl sp@(16) /* length desired? */
|
tstl sp@(16) | length desired?
|
||||||
beq csexit
|
beq csexit
|
||||||
subl sp@(4),a0 /* yes, calculate length copied */
|
subl sp@(4),a0 | yes, calculate length copied
|
||||||
movl sp@(16),a1 /* return location */
|
movl sp@(16),a1 | return location
|
||||||
movl a0,a1@
|
movl a0,a1@
|
||||||
csexit:
|
csexit:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
ENTRY(copyinstr)
|
ENTRY(copyinstr)
|
||||||
movl _curpcb,a0 /* set fault handler */
|
movl _curpcb,a0 | set fault handler
|
||||||
movl #cisfault,a0@(PCB_ONFAULT)
|
movl #cisfault,a0@(PCB_ONFAULT)
|
||||||
movl sp@(4),a0 /* a0 = fromaddr */
|
movl sp@(4),a0 | a0 = fromaddr
|
||||||
movl sp@(8),a1 /* a1 = toaddr */
|
movl sp@(8),a1 | a1 = toaddr
|
||||||
USER_SFC
|
USER_SFC
|
||||||
clrl d0
|
clrl d0
|
||||||
movl sp@(12),d1 /* count */
|
movl sp@(12),d1 | count
|
||||||
beq cisdone /* nothing to do */
|
beq cisdone | nothing to do
|
||||||
subql #1,d1 /* predecrement for dbeq */
|
subql #1,d1 | predecrement for dbeq
|
||||||
cisloop:
|
cisloop:
|
||||||
movsb a0@+,d0 /* copy a byte */
|
movsb a0@+,d0 | copy a byte
|
||||||
movb d0,a1@+
|
movb d0,a1@+
|
||||||
dbeq d1,cisloop /* decrement low word of count */
|
dbeq d1,cisloop | decrement low word of count
|
||||||
beq cisdone /* copied null, exit */
|
beq cisdone | copied null, exit
|
||||||
subil #0x10000,d1 /* decrement high word of count */
|
subil #0x10000,d1 | decrement high word of count
|
||||||
bcc cisloop /* more room, keep going */
|
bcc cisloop | more room, keep going
|
||||||
moveq #ENAMETOOLONG,d0 /* ran out of space */
|
moveq #ENAMETOOLONG,d0 | ran out of space
|
||||||
cisdone:
|
cisdone:
|
||||||
tstl sp@(16) /* length desired? */
|
tstl sp@(16) | length desired?
|
||||||
beq cisexit
|
beq cisexit
|
||||||
subl sp@(4),a0 /* yes, calculate length copied */
|
subl sp@(4),a0 | yes, calculate length copied
|
||||||
movl sp@(16),a1 /* return location */
|
movl sp@(16),a1 | return location
|
||||||
movl a0,a1@
|
movl a0,a1@
|
||||||
cisexit:
|
cisexit:
|
||||||
KERNEL_SFC
|
KERNEL_SFC
|
||||||
movl _curpcb,a0 /* clear fault handler */
|
movl _curpcb,a0 | clear fault handler
|
||||||
clrl a0@(PCB_ONFAULT)
|
clrl a0@(PCB_ONFAULT)
|
||||||
rts
|
rts
|
||||||
cisfault:
|
cisfault:
|
||||||
|
@ -242,32 +242,32 @@ cisfault:
|
||||||
jra cisdone
|
jra cisdone
|
||||||
|
|
||||||
ENTRY(copyoutstr)
|
ENTRY(copyoutstr)
|
||||||
movl _curpcb,a0 /* set fault handler */
|
movl _curpcb,a0 | set fault handler
|
||||||
movl #cosfault,a0@(PCB_ONFAULT)
|
movl #cosfault,a0@(PCB_ONFAULT)
|
||||||
movl sp@(4),a0 /* a0 = fromaddr */
|
movl sp@(4),a0 | a0 = fromaddr
|
||||||
movl sp@(8),a1 /* a1 = toaddr */
|
movl sp@(8),a1 | a1 = toaddr
|
||||||
USER_DFC
|
USER_DFC
|
||||||
clrl d0
|
clrl d0
|
||||||
movl sp@(12),d1 /* count */
|
movl sp@(12),d1 | count
|
||||||
beq cosdone /* nothing to do */
|
beq cosdone | nothing to do
|
||||||
subql #1,d1 /* predecrement for dbeq */
|
subql #1,d1 | predecrement for dbeq
|
||||||
cosloop:
|
cosloop:
|
||||||
movb a0@+,d0 /* copy a byte */
|
movb a0@+,d0 | copy a byte
|
||||||
movsb d0,a1@+
|
movsb d0,a1@+
|
||||||
dbeq d1,cosloop /* decrement low word of count */
|
dbeq d1,cosloop | decrement low word of count
|
||||||
beq cosdone /* copied null, exit */
|
beq cosdone | copied null, exit
|
||||||
subil #0x10000,d1 /* decrement high word of count */
|
subil #0x10000,d1 | decrement high word of count
|
||||||
bcc cosloop /* more room, keep going */
|
bcc cosloop | more room, keep going
|
||||||
moveq #ENAMETOOLONG,d0 /* ran out of space */
|
moveq #ENAMETOOLONG,d0 | ran out of space
|
||||||
cosdone:
|
cosdone:
|
||||||
tstl sp@(16) /* length desired? */
|
tstl sp@(16) | length desired?
|
||||||
beq cosexit
|
beq cosexit
|
||||||
subl sp@(4),a0 /* yes, calculate length copied */
|
subl sp@(4),a0 | yes, calculate length copied
|
||||||
movl sp@(16),a1 /* return location */
|
movl sp@(16),a1 | return location
|
||||||
movl a0,a1@
|
movl a0,a1@
|
||||||
cosexit:
|
cosexit:
|
||||||
KERNEL_DFC
|
KERNEL_DFC
|
||||||
movl _curpcb,a0 /* clear fault handler */
|
movl _curpcb,a0 | clear fault handler
|
||||||
clrl a0@(PCB_ONFAULT)
|
clrl a0@(PCB_ONFAULT)
|
||||||
rts
|
rts
|
||||||
cosfault:
|
cosfault:
|
||||||
|
@ -321,8 +321,7 @@ Lfdone:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
/* Just like Lferr, but the address is different (& exported). */
|
/* Just like Lferr, but the address is different (& exported). */
|
||||||
.globl _fubail
|
ENTRY(fubail)
|
||||||
_fubail:
|
|
||||||
moveq #-1,d0
|
moveq #-1,d0
|
||||||
jra Lfdone
|
jra Lfdone
|
||||||
|
|
||||||
|
@ -374,7 +373,6 @@ Lsdone:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
/* Just like Lserr, but the address is different (& exported). */
|
/* Just like Lserr, but the address is different (& exported). */
|
||||||
.globl _subail
|
ENTRY(subail)
|
||||||
_subail:
|
|
||||||
moveq #-1,d0
|
moveq #-1,d0
|
||||||
jra Lsdone
|
jra Lsdone
|
||||||
|
|
Loading…
Reference in New Issue