switch to ELF naming for local labels.

This commit is contained in:
chs 2013-09-07 19:06:29 +00:00
parent c2a70ce464
commit 18ec38ea7c
23 changed files with 448 additions and 449 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: divsi3.S,v 1.4 2013/07/16 23:24:18 matt Exp $ */
/* $NetBSD: divsi3.S,v 1.5 2013/09/07 19:06:29 chs Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -39,7 +39,7 @@
#if 0
RCSID("from: @(#)divsi3.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: divsi3.S,v 1.4 2013/07/16 23:24:18 matt Exp $")
RCSID("$NetBSD: divsi3.S,v 1.5 2013/09/07 19:06:29 chs Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -62,9 +62,9 @@ ENTRY(__divsi3)
2: eorl %d1, %d0
bpl 3f | branch if sgn(divisor) == sgn(dividend)
movel (%sp)+, %a0 | pop return address
pea (Lret,%pc) | push our return address
pea (.Lret,%pc) | push our return address
3: jmp _C_LABEL(__udivsi3)
Lret: negl %d0 | negate quotient
.Lret: negl %d0 | negate quotient
jmp (%a0)
END(__divsi3)
#endif /* __mc68010__ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: modsi3.S,v 1.5 2013/07/16 23:24:18 matt Exp $ */
/* $NetBSD: modsi3.S,v 1.6 2013/09/07 19:06:29 chs Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -39,7 +39,7 @@
#if 0
RCSID("from: @(#)modsi3.s 5.1 (Berkeley) 6/7/90")
#else
RCSID("$NetBSD: modsi3.S,v 1.5 2013/07/16 23:24:18 matt Exp $")
RCSID("$NetBSD: modsi3.S,v 1.6 2013/09/07 19:06:29 chs Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -59,13 +59,13 @@ ENTRY(__modsi3)
bpl 1f
negl 4(%sp) | store abs(divisor)
1: movel (%sp), %d0 | load the dividend
pea (Lret,%pc) | push our return address
pea (.Lret,%pc) | push our return address
bpl 2f
negl 4(%sp) | store abs(dividend)
subql #2, (%sp) | adjust return address
2: jmp _C_LABEL(__udivsi3)
negl %d1 | negate modulus
Lret: movl %d1, %d0 | move modulus into %d0
.Lret: movl %d1, %d0 | move modulus into %d0
jmp (%a0)
END(__modsi3)
#endif /* __mc68010__ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcmp.S,v 1.5 2013/07/18 22:42:50 matt Exp $ */
/* $NetBSD: bcmp.S,v 1.6 2013/09/07 19:06:29 chs Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -68,7 +68,7 @@
#if 0
RCSID("from: @(#)bcmp.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: bcmp.S,v 1.5 2013/07/18 22:42:50 matt Exp $")
RCSID("$NetBSD: bcmp.S,v 1.6 2013/09/07 19:06:29 chs Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -95,7 +95,7 @@ ENTRY(bcmp)
* if the string is too short.
*/
cmpl #8,%d1
jlt Lbcbyte
jlt .Lbcbyte
#ifdef __mc68010__
/*
@ -106,91 +106,91 @@ ENTRY(bcmp)
movl %a0,%d0
addl %a1,%d0
btst #0,%d0
jne Lbcbyte
jne .Lbcbyte
#endif /* __mc68010__ */
/* word align */
movl %a0,%d0
btst #0,%d0
jeq Lbcalgndw
jeq .Lbcalgndw
CMPMB((%a0)+,(%a1)+)
jne Lbcnoteq
jne .Lbcnoteq
subql #1,%d1
Lbcalgndw:
.Lbcalgndw:
/* long word align */
btst #1,%d0
jeq Lbcalgndl
jeq .Lbcalgndl
CMPMW((%a0)+,(%a1)+)
jne Lbcnoteq
jne .Lbcnoteq
subql #2,%d1
Lbcalgndl:
.Lbcalgndl:
/* compare by 8 longwords */
movl %d1,%d0
lsrl #5,%d0 | cnt = len / 32
jeq Lbclong | if (cnt)
jeq .Lbclong | if (cnt)
andl #31,%d1 | len %= 32
subql #1,%d0 | set up for dbf
Lbc32loop:
.Lbc32loop:
CMPML((%a0)+,(%a1)+) | compare 1 of 8 longwords
jne Lbcnoteq | not equal, return non-zero
jne .Lbcnoteq | not equal, return non-zero
CMPML((%a0)+,(%a1)+) | compare 2 of 8 longwords
jne Lbcnoteq
jne .Lbcnoteq
CMPML((%a0)+,(%a1)+) | compare 3 of 8 longwords
jne Lbcnoteq
jne .Lbcnoteq
CMPML((%a0)+,(%a1)+) | compare 4 of 8 longwords
jne Lbcnoteq
jne .Lbcnoteq
CMPML((%a0)+,(%a1)+) | compare 5 of 8 longwords
jne Lbcnoteq
jne .Lbcnoteq
CMPML((%a0)+,(%a1)+) | compare 6 of 8 longwords
jne Lbcnoteq
jne .Lbcnoteq
CMPML((%a0)+,(%a1)+) | compare 7 of 8 longwords
jne Lbcnoteq
jne .Lbcnoteq
CMPML((%a0)+,(%a1)+) | compare 8 of 8 longwords
jne Lbcnoteq
jne .Lbcnoteq
#ifndef __mcoldfire__
dbf %d0,Lbc32loop | till done
dbf %d0,.Lbc32loop | till done
clrw %d0
#endif
subql #1,%d0
jcc Lbc32loop
jcc .Lbc32loop
Lbclong:
.Lbclong:
/* compare by longwords */
movl %d1,%d0
lsrl #2,%d0 | cnt = len / 4
jeq Lbcbyte | if (cnt)
jeq .Lbcbyte | if (cnt)
subql #1,%d0 | set up for dbf
Lbclloop:
.Lbclloop:
CMPML((%a0)+,(%a1)+) | compare a longword
jne Lbcnoteq | not equal, return non-zero
jne .Lbcnoteq | not equal, return non-zero
#ifdef __mcoldfire__
subql #1,%d0 | decrement
jcc Lbclloop | till done
jcc .Lbclloop | till done
#else
dbf %d0,Lbclloop | till done
dbf %d0,.Lbclloop | till done
#endif
andl #3,%d1 | len %= 4
jeq Lbcdone
jeq .Lbcdone
subql #1,%d1 | set up for dbf
Lbcbloop:
.Lbcbloop:
CMPMB((%a0)+,(%a1)+) | compare a byte
jne Lbcnoteq | not equal, return non-zero
Lbcbyte:
jne .Lbcnoteq | not equal, return non-zero
.Lbcbyte:
#ifdef __mcoldfire__
subql #1,%d0 | decrement
jcc Lbcbloop | till done
jcc .Lbcbloop | till done
#else
dbf %d1,Lbcbloop
dbf %d1,.Lbcbloop
#endif
Lbcdone:
.Lbcdone:
#ifdef __mcoldfire__
movl (%sp)+,%d2 | restore temp
#endif
movql #0,%d0
rts
Lbcnoteq:
.Lbcnoteq:
movql #1,%d0
rts
END(bcmp)

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcopy.S,v 1.5 2013/07/18 22:42:50 matt Exp $ */
/* $NetBSD: bcopy.S,v 1.6 2013/09/07 19:06:29 chs Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -68,7 +68,7 @@
#if 0
RCSID("from: @(#)bcopy.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: bcopy.S,v 1.5 2013/07/18 22:42:50 matt Exp $")
RCSID("$NetBSD: bcopy.S,v 1.6 2013/09/07 19:06:29 chs Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -92,14 +92,14 @@ ENTRY(XCOPY)
movl 12(%sp),%d1 | count
cmpl %a1,%a0 | src after dest?
jlt Lbcback | yes, must copy backwards
jlt .Lbcback | yes, must copy backwards
/*
* It isn't worth the overhead of aligning to {long}word boundries
* if the string is too short.
*/
cmpl #8,%d1
jlt Lbcfbyte
jlt .Lbcfbyte
#ifdef __mc68010__
/*
@ -110,29 +110,29 @@ ENTRY(XCOPY)
movl %a0,%d0
addl %a1,%d0
btst #0,%d0
jne Lbcfbyte
jne .Lbcfbyte
#endif /* __mc68010__ */
/* word align */
movl %a1,%d0
btst #0,%d0 | if (dst & 1)
jeq Lbcfalgndw |
jeq .Lbcfalgndw |
movb (%a0)+,(%a1)+ | *(char *)dst++ = *(char *) src++
subql #1,%d1 | len--
Lbcfalgndw:
.Lbcfalgndw:
/* long word align */
btst #1,%d0 | if (dst & 2)
jeq Lbcfalgndl
jeq .Lbcfalgndl
movw (%a0)+,(%a1)+ | *(short *)dst++ = *(short *) dst++
subql #2,%d1 | len -= 2
Lbcfalgndl:
.Lbcfalgndl:
/* copy by 8 longwords */
movel %d1,%d0
lsrl #5,%d0 | cnt = len / 32
jeq Lbcflong | if (cnt)
jeq .Lbcflong | if (cnt)
andl #31,%d1 | len %= 32
subql #1,%d0 | set up for dbf
Lbcf32loop:
.Lbcf32loop:
movl (%a0)+,(%a1)+ | copy 8 long words
movl (%a0)+,(%a1)+
movl (%a0)+,(%a1)+
@ -142,40 +142,40 @@ Lbcf32loop:
movl (%a0)+,(%a1)+
movl (%a0)+,(%a1)+
#ifndef __mcoldfire__
dbf %d0,Lbcf32loop | till done
dbf %d0,.Lbcf32loop | till done
clrw %d0
#endif
subql #1,%d0
jcc Lbcf32loop
jcc .Lbcf32loop
Lbcflong:
.Lbcflong:
/* copy by longwords */
movel %d1,%d0
lsrl #2,%d0 | cnt = len / 4
jeq Lbcfbyte | if (cnt)
jeq .Lbcfbyte | if (cnt)
subql #1,%d0 | set up for dbf
Lbcflloop:
.Lbcflloop:
movl (%a0)+,(%a1)+ | copy longwords
#ifdef __mcoldfire__
subql #1,%d0 | decrement
jcc Lbcflloop | til done
jcc .Lbcflloop | til done
#else
dbf %d0,Lbcflloop | til done
dbf %d0,.Lbcflloop | til done
#endif
andl #3,%d1 | len %= 4
jeq Lbcdone
jeq .Lbcdone
subql #1,%d1 | set up for dbf
Lbcfbloop:
.Lbcfbloop:
movb (%a0)+,(%a1)+ | copy bytes
Lbcfbyte:
.Lbcfbyte:
#ifdef __mcoldfire__
subql #1,%d0 | decrement
jcc Lbcfbloop | til done
jcc .Lbcfbloop | til done
#else
dbf %d1,Lbcfbloop | till done
dbf %d1,.Lbcfbloop | till done
#endif
Lbcdone:
.Lbcdone:
#if defined(MEMCOPY) || defined(MEMMOVE)
movl 4(%sp),%d0 | dest address
#if defined(__SVR4_ABI__)
@ -185,7 +185,7 @@ Lbcdone:
rts
Lbcback:
.Lbcback:
addl %d1,%a0 | src pointer to end
addl %d1,%a1 | dest pointer to end
@ -194,7 +194,7 @@ Lbcback:
* if the string is too short.
*/
cmpl #8,%d1
jlt Lbcbbyte
jlt .Lbcbbyte
#ifdef __mc68010__
/*
@ -205,29 +205,29 @@ Lbcback:
movl %a0,%d0
addl %a1,%d0
btst #0,%d0
jne Lbcbbyte
jne .Lbcbbyte
#endif /* __mc68010__ */
/* word align */
movl %a1,%d0
btst #0,%d0 | if (dst & 1)
jeq Lbcbalgndw |
jeq .Lbcbalgndw |
movb -(%a0),-(%a1) | *(char *)dst-- = *(char *) src--
subql #1,%d1 | len--
Lbcbalgndw:
.Lbcbalgndw:
/* long word align */
btst #1,%d0 | if (dst & 2)
jeq Lbcbalgndl
jeq .Lbcbalgndl
movw -(%a0),-(%a1) | *(short *)dst-- = *(short *) dst--
subql #2,%d1 | len -= 2
Lbcbalgndl:
.Lbcbalgndl:
/* copy by 8 longwords */
movel %d1,%d0
lsrl #5,%d0 | cnt = len / 32
jeq Lbcblong | if (cnt)
jeq .Lbcblong | if (cnt)
andl #31,%d1 | len %= 32
subql #1,%d0 | set up for dbf
Lbcb32loop:
.Lbcb32loop:
movl -(%a0),-(%a1) | copy 8 long words
movl -(%a0),-(%a1)
movl -(%a0),-(%a1)
@ -237,38 +237,38 @@ Lbcb32loop:
movl -(%a0),-(%a1)
movl -(%a0),-(%a1)
#ifndef __mcoldfire__
dbf %d0,Lbcb32loop | till done
dbf %d0,.Lbcb32loop | till done
clrw %d0
#endif
subql #1,%d0
jcc Lbcb32loop
jcc .Lbcb32loop
Lbcblong:
.Lbcblong:
/* copy by longwords */
movel %d1,%d0
lsrl #2,%d0 | cnt = len / 4
jeq Lbcbbyte | if (cnt)
jeq .Lbcbbyte | if (cnt)
subql #1,%d0 | set up for dbf
Lbcblloop:
.Lbcblloop:
movl -(%a0),-(%a1) | copy longwords
#ifdef __mcoldfire__
subql #1,%d0 | decrement
jcc Lbcblloop | til done
jcc .Lbcblloop | til done
#else
dbf %d0,Lbcblloop | til done
dbf %d0,.Lbcblloop | til done
#endif
andl #3,%d1 | len %= 4
jeq Lbcdone
jeq .Lbcdone
subql #1,%d1 | set up for dbf
Lbcbbloop:
.Lbcbbloop:
movb -(%a0),-(%a1) | copy bytes
Lbcbbyte:
.Lbcbbyte:
#ifdef __mcoldfire__
subql #1,%d0 | decrement
jcc Lbcbbloop | til done
jcc .Lbcbbloop | til done
#else
dbf %d1,Lbcbbloop | till done
dbf %d1,.Lbcbbloop | till done
#endif
#if defined(MEMCOPY) || defined(MEMMOVE)

View File

@ -1,4 +1,4 @@
/* $NetBSD: bzero.S,v 1.5 2013/07/18 22:42:50 matt Exp $ */
/* $NetBSD: bzero.S,v 1.6 2013/09/07 19:06:29 chs Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -68,7 +68,7 @@
#if 0
RCSID("from: @(#)bzero.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: bzero.S,v 1.5 2013/07/18 22:42:50 matt Exp $")
RCSID("$NetBSD: bzero.S,v 1.6 2013/09/07 19:06:29 chs Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -84,28 +84,28 @@ ENTRY(bzero)
* if the string is too short.
*/
cmpl #8,%d1
jlt Lbzbyte
jlt .Lbzbyte
/* word align */
movl %a0,%d0
btst #0,%d0 | if (dst & 1)
jeq Lbzalgndw |
jeq .Lbzalgndw |
movb %d2,(%a0)+ | *(char *)dst++ = 0
subql #1,%d1 | len--
Lbzalgndw:
.Lbzalgndw:
/* long word align */
btst #1,%d0 | if (dst & 2)
jeq Lbzalgndl |
jeq .Lbzalgndl |
movw %d2,(%a0)+ | *(short *)dst++ = 0
subql #2,%d1 | len -= 2
Lbzalgndl:
.Lbzalgndl:
/* zero by 8 longwords */
movel %d1,%d0
lsrl #5,%d0 | cnt = len / 32
jeq Lbzlong | if (cnt)
jeq .Lbzlong | if (cnt)
andl #31,%d1 | len %= 32
subql #1,%d0 | set up for dbf
Lbz32loop:
.Lbz32loop:
movl %d2,(%a0)+ | zero 8 long words
movl %d2,(%a0)+
movl %d2,(%a0)+
@ -115,40 +115,40 @@ Lbz32loop:
movl %d2,(%a0)+
movl %d2,(%a0)+
#ifndef __mcoldfire__
dbf %d0,Lbz32loop | till done
dbf %d0,.Lbz32loop | till done
clrw %d0
#endif
subql #1,%d0
jcc Lbz32loop
jcc .Lbz32loop
Lbzlong:
.Lbzlong:
/* copy by longwords */
movel %d1,%d0
lsrl #2,%d0 | cnt = len / 4
jeq Lbzbyte | if (cnt)
jeq .Lbzbyte | if (cnt)
subql #1,%d0 | set up for dbf
Lbzlloop:
.Lbzlloop:
movl %d2,(%a0)+ | clear longwords
#ifdef __mcoldfire__
subql #1,%d0 | decrement
jcc Lbzlloop | till done
jcc .Lbzlloop | till done
#else
dbf %d0,Lbzlloop | till done
dbf %d0,.Lbzlloop | till done
#endif
andl #3,%d1 | len %= 4
jeq Lbzdone
jeq .Lbzdone
subql #1,%d1 | set up for dbf
Lbzbloop:
.Lbzbloop:
movb %d2,(%a0)+ | zero bytes
Lbzbyte:
.Lbzbyte:
#ifdef __mcoldfire__
subql #1,%d0 | decrement
jcc Lbzbloop | till done
jcc .Lbzbloop | till done
#else
dbf %d1,Lbzbloop | till done
dbf %d1,.Lbzbloop | till done
#endif
Lbzdone:
.Lbzdone:
movl (%sp)+,%d2
rts
END(bzero)

View File

@ -1,4 +1,4 @@
/* $NetBSD: ffs.S,v 1.5 2013/07/18 22:42:50 matt Exp $ */
/* $NetBSD: ffs.S,v 1.6 2013/09/07 19:06:29 chs Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -39,7 +39,7 @@
#if 0
RCSID("from: @(#)ffs.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: ffs.S,v 1.5 2013/07/18 22:42:50 matt Exp $")
RCSID("$NetBSD: ffs.S,v 1.6 2013/09/07 19:06:29 chs Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -69,26 +69,26 @@ END(ffs)
ENTRY(ffs)
clrl %d0
movl 4(%sp),%d1
jeq L2 | return 0 if 0
L1:
jeq .L2 | return 0 if 0
.L1:
addql #1,%d0
lsrl #1,%d1 | shift low bit into carry
jcc L1 | keep looping while carry is clear.
L2:
jcc .L1 | keep looping while carry is clear.
.L2:
rts
#else /* __mc68010__ */
ENTRY(ffs)
movl 4(%sp),%d0
jeq L2
jeq .L2
movql #31,%d1
L1:
.L1:
lsrl #1,%d0
dbcs %d1,L1
dbcs %d1,.L1
movql #32,%d0
subl %d1,%d0
L2:
.L2:
rts
END(ffs)

View File

@ -1,4 +1,4 @@
/* $NetBSD: memcmp.S,v 1.4 2013/07/18 22:42:50 matt Exp $ */
/* $NetBSD: memcmp.S,v 1.5 2013/09/07 19:06:29 chs Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -39,7 +39,7 @@
#if 0
RCSID("from: @(#)bcmp.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: memcmp.S,v 1.4 2013/07/18 22:42:50 matt Exp $")
RCSID("$NetBSD: memcmp.S,v 1.5 2013/09/07 19:06:29 chs Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -70,46 +70,46 @@ ENTRY(memcmp)
#ifdef __mcoldfire__
movl %d2,-(%sp) | save temp
#endif
jeq bcdone | if zero, nothing to do
jeq .Lbcdone | if zero, nothing to do
movl %a0,%d1
btst #0,%d1 | string 1 address odd?
jeq bceven | no, skip alignment
jeq .Lbceven | no, skip alignment
CMPMB((%a0)+,(%a1)+) | yes, compare a byte
jne bcnoteq | not equal, return non-zero
jne .Lbcnoteq | not equal, return non-zero
subql #1,%d0 | adjust count
jeq bcdone | count 0, reutrn zero
bceven:
jeq .Lbcdone | count 0, reutrn zero
.Lbceven:
movl %a1,%d1
btst #0,%d1 | string 2 address odd?
jne bcbloop | yes, no hope for alignment, compare bytes
jne .Lbcbloop | yes, no hope for alignment, compare bytes
movl %d0,%d1 | no, both even
lsrl #2,%d1 | convert count to longword count
jeq bcbloop | count 0, skip longword loop
bclloop:
jeq .Lbcbloop | count 0, skip longword loop
.Lbclloop:
CMPML((%a0)+,(%a1)+) | compare a longword
jne bcnoteql | not equal, return non-zero
jne .Lbcnoteql | not equal, return non-zero
subql #1,%d1 | adjust count
jne bclloop | still more, keep comparing
jne .Lbclloop | still more, keep comparing
andl #3,%d0 | what remains
jeq bcdone | nothing, all done
bcbloop:
jeq .Lbcdone | nothing, all done
.Lbcbloop:
CMPMB((%a0)+,(%a1)+) | compare a byte
jne bcnoteq | not equal, return non-zero
jne .Lbcnoteq | not equal, return non-zero
subql #1,%d0 | adjust count
jne bcbloop | still more, keep going
jne .Lbcbloop | still more, keep going
rts
bcnoteql:
.Lbcnoteql:
subql #4,%a0
subql #4,%a1
movl #4,%d0
jra bcbloop
bcnoteq:
jra .Lbcbloop
.Lbcnoteq:
clrl %d0
clrl %d1
movb -(%a0),%d0
movb -(%a1),%d1
subl %d1,%d0
bcdone:
.Lbcdone:
#ifdef __mcoldfire__
movl (%sp)+,%sp | restore temp
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: memset.S,v 1.6 2013/07/19 16:42:12 matt Exp $ */
/* $NetBSD: memset.S,v 1.7 2013/09/07 19:06:29 chs Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -68,7 +68,7 @@
#if 0
RCSID("from: @(#)bzero.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: memset.S,v 1.6 2013/07/19 16:42:12 matt Exp $")
RCSID("$NetBSD: memset.S,v 1.7 2013/09/07 19:06:29 chs Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -83,7 +83,7 @@ ENTRY(memset)
* if the string is too short.
*/
cmpl #15,%d1
jlt Lbzbyte
jlt .Lbzbyte
clrl %d0
moveb %d2,%d0
@ -98,25 +98,25 @@ ENTRY(memset)
/* word align */
movl %a0,%d0
btst #0,%d0 | if (dst & 1)
jeq Lbzalgndw |
jeq .Lbzalgndw |
movb %d2,(%a0)+ | *(char *)dst++ = X
subql #1,%d1 | len--
addql #1,%d0
Lbzalgndw:
.Lbzalgndw:
#ifndef __mc68010__
/* long word align */
btst #1,%d0 | if (dst & 2)
jeq Lbzalgndl |
jeq .Lbzalgndl |
movw %d2,(%a0)+ | *(short *)dst++ = X
subql #2,%d1 | len -= 2
Lbzalgndl:
.Lbzalgndl:
/* set by 8 longwords */
movel %d1,%d0
lsrl #5,%d0 | cnt = len / 32
jeq Lbzlong | if (cnt)
jeq .Lbzlong | if (cnt)
andl #31,%d1 | len %= 32
subql #1,%d0 | set up for dbf
Lbz32loop:
.Lbz32loop:
movl %d2,(%a0)+ | set 8 long words
movl %d2,(%a0)+
movl %d2,(%a0)+
@ -126,45 +126,45 @@ Lbz32loop:
movl %d2,(%a0)+
movl %d2,(%a0)+
#ifndef __mcoldfire__
dbf %d0,Lbz32loop | till done
dbf %d0,.Lbz32loop | till done
clrw %d0
#endif
subql #1,%d0
jcc Lbz32loop
jcc .Lbz32loop
#endif /* !__mc68010__ */
Lbzlong:
.Lbzlong:
/* set by longwords */
movel %d1,%d0
lsrl #2,%d0 | cnt = len / 4
jeq Lbzbyte | if (cnt)
jeq .Lbzbyte | if (cnt)
subql #1,%d0 | set up for dbf
Lbzlloop:
.Lbzlloop:
movl %d2,(%a0)+ | clear longwords
#ifndef __mcoldfire__
dbf %d0,Lbzlloop | till done
dbf %d0,.Lbzlloop | till done
#endif
#ifdef __mc68010__
clrw %d0
#endif /* __mc68010__ */
#if defined(__m68010) || defined(__mcoldfire__)
subql #1,%d0
jcc Lbzlloop
jcc .Lbzlloop
#endif /* __mc68010__ || __mcoldfire__ */
andl #3,%d1 | len %= 4
jeq Lbzdone
jeq .Lbzdone
subql #1,%d1 | set up for dbf
Lbzbloop:
.Lbzbloop:
movb %d2,(%a0)+ | set bytes
Lbzbyte:
.Lbzbyte:
#ifdef __mcoldfire__
subql #1,%d1 | decrement
jcc Lbzbloop | till done
jcc .Lbzbloop | till done
#else
dbf %d1,Lbzbloop | till done
dbf %d1,.Lbzbloop | till done
#endif
Lbzdone:
.Lbzdone:
movl 8(%sp),%d0 | return destination
#ifdef __SVR4_ABI__
moveal %d0,%a0

View File

@ -1,4 +1,4 @@
/* $NetBSD: strcat.S,v 1.3 2013/07/16 23:24:19 matt Exp $ */
/* $NetBSD: strcat.S,v 1.4 2013/09/07 19:06:29 chs Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -39,7 +39,7 @@
#if 0
RCSID("from: @(#)strcpy.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: strcat.S,v 1.3 2013/07/16 23:24:19 matt Exp $")
RCSID("$NetBSD: strcat.S,v 1.4 2013/09/07 19:06:29 chs Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -47,13 +47,13 @@ ENTRY(strcat)
movl 8(%sp),%a0 | a0 = fromaddr
movl 4(%sp),%d0 | return value is toaddr
movl %d0,%a1 | a1 = toaddr
Lslloop:
.Lslloop:
tstb (%a1)+ | null?
jne Lslloop | no, keep going
jne .Lslloop | no, keep going
subql #1,%a1
Lscloop:
.Lscloop:
movb (%a0)+,(%a1)+ | copy a byte
jne Lscloop | copied non-null, keep going
jne .Lscloop | copied non-null, keep going
#ifdef __SVR4_ABI__
moveal %d0,%a0
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: strcmp.S,v 1.6 2013/07/19 16:42:12 matt Exp $ */
/* $NetBSD: strcmp.S,v 1.7 2013/09/07 19:06:29 chs Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -33,7 +33,7 @@
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: strcmp.S,v 1.6 2013/07/19 16:42:12 matt Exp $")
RCSID("$NetBSD: strcmp.S,v 1.7 2013/09/07 19:06:29 chs Exp $")
#endif /* LIBC_SCCS and not lint */
#ifdef __mcoldfire__
@ -47,28 +47,28 @@
ENTRY(strcmp)
movl 4(%sp),%a0
movl 8(%sp),%a1
L1: /* unrolled by 4 for 680[23]0's */
.L1: /* unrolled by 4 for 680[23]0's */
GETC((%a0)+,%d1)
jeq L2
jeq .L2
SUBC((%a1)+,%d1)
jne L3
jne .L3
GETC((%a0)+,%d1)
jeq L2
jeq .L2
SUBC((%a1)+,%d1)
jne L3
jne .L3
GETC((%a0)+,%d1)
jeq L2
jeq .L2
SUBC((%a1)+,%d1)
jne L3
jne .L3
GETC((%a0)+,%d1)
jeq L2
jeq .L2
SUBC((%a1)+,%d1)
jeq L1
jeq .L1
L3:
.L3:
#ifdef __mcoldfire__
movl %d1,%d0
#else
@ -78,7 +78,7 @@ L3:
#endif
rts
L2: movq #0,%d0
.L2: movq #0,%d0
movb (%a1),%d0
negl %d0
rts

View File

@ -1,4 +1,4 @@
/* $NetBSD: strcpy.S,v 1.3 2013/07/16 23:24:19 matt Exp $ */
/* $NetBSD: strcpy.S,v 1.4 2013/09/07 19:06:29 chs Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -39,7 +39,7 @@
#if 0
RCSID("from: @(#)strcpy.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: strcpy.S,v 1.3 2013/07/16 23:24:19 matt Exp $")
RCSID("$NetBSD: strcpy.S,v 1.4 2013/09/07 19:06:29 chs Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -47,9 +47,9 @@ ENTRY(strcpy)
movl 8(%sp),%a0 | a0 = fromaddr
movl 4(%sp),%d0 | return value is toaddr
movl %d0,%a1 | a1 = toaddr
Lscloop:
.Lscloop:
movb (%a0)+,(%a1)+ | copy a byte
jne Lscloop | copied non-null, keep going
jne .Lscloop | copied non-null, keep going
#ifdef __SVR4_ABI__
moveal %d0,%a0
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: strlen.S,v 1.3 2013/07/16 23:24:19 matt Exp $ */
/* $NetBSD: strlen.S,v 1.4 2013/09/07 19:06:29 chs Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -39,7 +39,7 @@
#if 0
RCSID("from: @(#)strlen.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: strlen.S,v 1.3 2013/07/16 23:24:19 matt Exp $")
RCSID("$NetBSD: strlen.S,v 1.4 2013/09/07 19:06:29 chs Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
@ -47,9 +47,9 @@ ENTRY(strlen)
movl 4(%sp),%a0 | string
movl %a0,%d0
notl %d0
Lslloop:
.Lslloop:
tstb (%a0)+ | null?
jne Lslloop | no, keep going
jne .Lslloop | no, keep going
addl %a0,%d0
rts
END(strlen)

View File

@ -1,4 +1,4 @@
/* $NetBSD: strncmp.S,v 1.6 2013/07/19 16:42:12 matt Exp $ */
/* $NetBSD: strncmp.S,v 1.7 2013/09/07 19:06:29 chs Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -33,7 +33,7 @@
#include <machine/asm.h>
#if defined(LIBC_SCCS) && !defined(lint)
RCSID("$NetBSD: strncmp.S,v 1.6 2013/07/19 16:42:12 matt Exp $")
RCSID("$NetBSD: strncmp.S,v 1.7 2013/09/07 19:06:29 chs Exp $")
#endif /* LIBC_SCCS and not lint */
@ -47,47 +47,47 @@
ENTRY(strncmp)
movl 12(%sp),%d0
jeq L4
jeq .L4
movl 4(%sp),%a0
movl 8(%sp),%a1
#ifdef __coldfire__
movl %d2,-(%sp) | save temp
#endif
L1: /* unroll by 4 for m680[23]0's */
.L1: /* unroll by 4 for m680[23]0's */
GETC((%a0)+,%d1)
jeq L2
jeq .L2
SUBC((%a1)+,%d1)
jne L3
jne .L3
subql #1,%d0
jeq L4
jeq .L4
GETC((%a0)+,%d1)
jeq L2
jeq .L2
SUBC((%a1)+,%d1)
jne L3
jne .L3
subql #1,%d0
jeq L4
jeq .L4
GETC((%a0)+,%d1)
jeq L2
jeq .L2
SUBC((%a1)+,%d1)
jne L3
jne .L3
subql #1,%d0
jeq L4
jeq .L4
GETC((%a0)+,%d1)
jeq L2
jeq .L2
SUBC((%a1)+,%d1)
jne L3
jne .L3
subql #1,%d0
jne L1
jne .L1
#ifdef __mcoldfire__
movl (%sp)+,%d2 | restore temp
#endif
L4: rts
.L4: rts
L2: SUBC((%a1),%d1)
L3:
.L2: SUBC((%a1),%d1)
.L3:
#ifdef __mcoldfire__
movl (%sp)+,%d2 | restore temp
movl %d1,%d0

View File

@ -1,4 +1,4 @@
/* $NetBSD: strncpy.S,v 1.4 2013/07/18 22:42:50 matt Exp $ */
/* $NetBSD: strncpy.S,v 1.5 2013/09/07 19:06:29 chs Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -39,42 +39,42 @@
#if 0
RCSID("from: @(#)strncpy.s 5.1 (Berkeley) 5/12/90")
#else
RCSID("$NetBSD: strncpy.S,v 1.4 2013/07/18 22:42:50 matt Exp $")
RCSID("$NetBSD: strncpy.S,v 1.5 2013/09/07 19:06:29 chs Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
ENTRY(strncpy)
movl 4(%sp),%d0 | return value is toaddr
movl 12(%sp),%d1 | count
jeq Lscdone | nothing to do
jeq .Lscdone | nothing to do
movl 8(%sp),%a0 | a0 = fromaddr
movl %d0,%a1 | a1 = toaddr
subql #1,%d1
Lscloop:
.Lscloop:
movb (%a0)+,(%a1)+ | copy a byte
#ifndef __mcoldfire__
dbeq %d1,Lscloop | loop through low word of d1
dbeq %d1,.Lscloop | loop through low word of d1
#endif
jeq Lscpadding | copied null, padding if necessary
jeq .Lscpadding | copied null, padding if necessary
#ifndef __mcoldfire__
clrw %d1 | clear low word of d1
#endif
subql #1,%d1 | adjust count for long copies
jcc Lscloop | more room, keep going
Lscdone:
jcc .Lscloop | more room, keep going
.Lscdone:
#ifdef __SVR4_ABI__
moveal %d0,%a0
#endif
rts
Lscploop:
.Lscploop:
clrb (%a1)+ | clear a byte
#ifndef __mcoldfire__
dbra %d1,Lscploop | keep going
dbra %d1,.Lscploop | keep going
clrw %d1
#endif
Lscpadding:
.Lscpadding:
subql #1,%d1
jcc Lscploop
jra Lscdone
jcc .Lscploop
jra .Lscdone
END(strncpy)

View File

@ -1,4 +1,4 @@
/* $NetBSD: compat_13_sigreturn13.s,v 1.6 2013/08/01 13:42:52 matt Exp $ */
/* $NetBSD: compat_13_sigreturn13.s,v 1.7 2013/09/07 19:06:29 chs Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -62,18 +62,18 @@ ENTRY_NOPROFILE(m68k_compat_13_sigreturn13_stub)
movl %a0,%usp | user SP
lea FR_HW(%sp),%a1 | pointer to HW frame
movw FR_ADJ(%sp),%d0 | do we need to adjust the stack?
jeq Lc13sigr1 | no, just continue
jeq .Lc13sigr1 | no, just continue
moveq #92,%d1 | total size
subw %d0,%d1 | - hole size = frame size
lea 92(%a1),%a0 | destination
addw %d1,%a1 | source
lsrw #1,%d1 | convert to word count
subqw #1,%d1 | minus 1 for dbf
Lc13sigrlp:
.Lc13sigrlp:
movw -(%a1),-(%a0) | copy a word
dbf %d1,Lc13sigrlp | continue
dbf %d1,.Lc13sigrlp | continue
movl %a0,%a1 | new HW frame base
Lc13sigr1:
.Lc13sigr1:
movl %a1,FR_SP(%sp) | new SP value
moveml (%sp)+,#0x7FFF | restore user registers
movl (%sp),%sp | and our SP

View File

@ -1,4 +1,4 @@
/* $NetBSD: compat_16_sigreturn14.s,v 1.4 2013/08/01 13:42:52 matt Exp $ */
/* $NetBSD: compat_16_sigreturn14.s,v 1.5 2013/09/07 19:06:29 chs Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -62,18 +62,18 @@ ENTRY_NOPROFILE(m68k_compat_16_sigreturn14_stub)
movl %a0,%usp | user SP
lea FR_HW(%sp),%a1 | pointer to HW frame
movw FR_ADJ(%sp),%d0 | do we need to adjust the stack?
jeq Lsigr1 | no, just continue
jeq .Lsigr1 | no, just continue
moveq #92,%d1 | total size
subw %d0,%d1 | - hole size = frame size
lea 92(%a1),%a0 | destination
addw %d1,%a1 | source
lsrw #1,%d1 | convert to word count
subqw #1,%d1 | minus 1 for dbf
Lsigrlp:
.Lsigrlp:
movw -(%a1),-(%a0) | copy a word
dbf %d1,Lsigrlp | continue
dbf %d1,.Lsigrlp | continue
movl %a0,%a1 | new HW frame base
Lsigr1:
.Lsigr1:
movl %a1,FR_SP(%sp) | new SP value
moveml (%sp)+,#0x7FFF | restore user registers
movl (%sp),%sp | and our SP

View File

@ -1,4 +1,4 @@
/* $NetBSD: copy.s,v 1.44 2013/07/22 17:52:21 matt Exp $ */
/* $NetBSD: copy.s,v 1.45 2013/09/07 19:06:29 chs Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -97,11 +97,11 @@
* The diagnostics: CHECK_SFC, CHECK_DFC
* will verify that the sfc/dfc register values are correct.
*/
Lbadfc:
.Lbadfc:
PANIC("copy.s: bad sfc or dfc")
jra Lbadfc
#define CHECK_SFC movec %sfc,%d0; subql #FC_USERD,%d0; bne Lbadfc
#define CHECK_DFC movec %dfc,%d0; subql #FC_USERD,%d0; bne Lbadfc
jra .Lbadfc
#define CHECK_SFC movec %sfc,%d0; subql #FC_USERD,%d0; bne .Lbadfc
#define CHECK_DFC movec %dfc,%d0; subql #FC_USERD,%d0; bne .Lbadfc
#else /* DIAGNOSTIC */
#define CHECK_SFC
#define CHECK_DFC
@ -121,56 +121,56 @@ Lbadfc:
ENTRY(copyin)
CHECK_SFC
movl 12(%sp),%d0 | check count
jeq Lciret | == 0, don't do anything
jeq .Lciret | == 0, don't do anything
#ifdef MAPPEDCOPY
cmpl _C_LABEL(mappedcopysize),%d0 | size >= mappedcopysize
jcc _C_LABEL(mappedcopyin) | yes, go do it the new way
#endif
movl %d2,-(%sp) | save scratch register
GETCURPCB(%a0) | set fault handler
movl #Lcifault,PCB_ONFAULT(%a0)
movl #.Lcifault,PCB_ONFAULT(%a0)
movl 8(%sp),%a0 | src address
movl 12(%sp),%a1 | dest address
movl %a0,%d1
btst #0,%d1 | src address odd?
jeq Lcieven | no, skip alignment
jeq .Lcieven | no, skip alignment
movsb (%a0)+,%d2 | yes, copy a byte
movb %d2,(%a1)+
subql #1,%d0 | adjust count
jeq Lcidone | count 0, all done
Lcieven:
jeq .Lcidone | count 0, all done
.Lcieven:
movl %a1,%d1
btst #0,%d1 | dest address odd?
jne Lcibytes | yes, must copy bytes
jne .Lcibytes | yes, must copy bytes
movl %d0,%d1 | OK, both even. Get count
lsrl #2,%d1 | and convert to longwords
jeq Lcibytes | count 0, skip longword loop
jeq .Lcibytes | count 0, skip longword loop
subql #1,%d1 | predecrement for dbf
Lcilloop:
.Lcilloop:
movsl (%a0)+,%d2 | copy a longword
movl %d2,(%a1)+
dbf %d1,Lcilloop | decrement low word of count
dbf %d1,.Lcilloop | decrement low word of count
subil #0x10000,%d1 | decrement high word of count
jcc Lcilloop
jcc .Lcilloop
andl #3,%d0 | what remains
jeq Lcidone | nothing, all done
Lcibytes:
jeq .Lcidone | nothing, all done
.Lcibytes:
subql #1,%d0 | predecrement for dbf
Lcibloop:
.Lcibloop:
movsb (%a0)+,%d2 | copy a byte
movb %d2,(%a1)+
dbf %d0,Lcibloop | decrement low word of count
dbf %d0,.Lcibloop | decrement low word of count
subil #0x10000,%d0 | decrement high word of count
jcc Lcibloop
jcc .Lcibloop
clrl %d0 | no error
Lcidone:
.Lcidone:
GETCURPCB(%a0) | clear fault handler
clrl PCB_ONFAULT(%a0)
movl (%sp)+,%d2 | restore scratch register
Lciret:
.Lciret:
rts
Lcifault:
jra Lcidone
.Lcifault:
jra .Lcidone
/*
* copyout(void *from, void *to, size_t len);
@ -186,56 +186,56 @@ Lcifault:
ENTRY(copyout)
CHECK_DFC
movl 12(%sp),%d0 | check count
jeq Lcoret | == 0, don't do anything
jeq .Lcoret | == 0, don't do anything
#ifdef MAPPEDCOPY
cmpl _C_LABEL(mappedcopysize),%d0 | size >= mappedcopysize
jcc _C_LABEL(mappedcopyout) | yes, go do it the new way
#endif
movl %d2,-(%sp) | save scratch register
GETCURPCB(%a0) | set fault handler
movl #Lcofault,PCB_ONFAULT(%a0)
movl #.Lcofault,PCB_ONFAULT(%a0)
movl 8(%sp),%a0 | src address
movl 12(%sp),%a1 | dest address
movl %a0,%d1
btst #0,%d1 | src address odd?
jeq Lcoeven | no, skip alignment
jeq .Lcoeven | no, skip alignment
movb (%a0)+,%d2 | yes, copy a byte
movsb %d2,(%a1)+
subql #1,%d0 | adjust count
jeq Lcodone | count 0, all done
Lcoeven:
jeq .Lcodone | count 0, all done
.Lcoeven:
movl %a1,%d1
btst #0,%d1 | dest address odd?
jne Lcobytes | yes, must copy bytes
jne .Lcobytes | yes, must copy bytes
movl %d0,%d1 | OK, both even. Get count
lsrl #2,%d1 | and convert to longwords
jeq Lcobytes | count 0, skip longword loop
jeq .Lcobytes | count 0, skip longword loop
subql #1,%d1 | predecrement for dbf
Lcolloop:
movl (%a0)+,%d2 | copy a longword
.Lcolloop:
movl (%a0)+,%d2 | copy a longword
movsl %d2,(%a1)+
dbf %d1,Lcolloop | decrement low word of count
dbf %d1,.Lcolloop | decrement low word of count
subil #0x10000,%d1 | decrement high word of count
jcc Lcolloop
jcc .Lcolloop
andl #3,%d0 | what remains
jeq Lcodone | nothing, all done
Lcobytes:
jeq .Lcodone | nothing, all done
.Lcobytes:
subql #1,%d0 | predecrement for dbf
Lcobloop:
.Lcobloop:
movb (%a0)+,%d2 | copy a byte
movsb %d2,(%a1)+
dbf %d0,Lcobloop | decrement low word of count
dbf %d0,.Lcobloop | decrement low word of count
subil #0x10000,%d0 | decrement high word of count
jcc Lcobloop
jcc .Lcobloop
clrl %d0 | no error
Lcodone:
.Lcodone:
GETCURPCB(%a0) | clear fault handler
clrl PCB_ONFAULT(%a0)
movl (%sp)+,%d2 | restore scratch register
Lcoret:
.Lcoret:
rts
Lcofault:
jra Lcodone
.Lcofault:
jra .Lcodone
/*
* copystr(void *from, void *to, size_t maxlen, size_t *lencopied);
@ -248,23 +248,23 @@ ENTRY(copystr)
movl 8(%sp),%a1 | a1 = toaddr
clrl %d0
movl 12(%sp),%d1 | count
jeq Lcstoolong | nothing to copy
jeq .Lcstoolong | nothing to copy
subql #1,%d1 | predecrement for dbeq
Lcsloop:
.Lcsloop:
movb (%a0)+,(%a1)+ | copy a byte
dbeq %d1,Lcsloop | decrement low word of count
jeq Lcsdone | copied null, exit
dbeq %d1,.Lcsloop | decrement low word of count
jeq .Lcsdone | copied null, exit
subil #0x10000,%d1 | decrement high word of count
jcc Lcsloop | more room, keep going
Lcstoolong:
jcc .Lcsloop | more room, keep going
.Lcstoolong:
moveq #ENAMETOOLONG,%d0 | ran out of space
Lcsdone:
tstl 16(%sp) | length desired?
jeq Lcsret
.Lcsdone:
tstl 16(%sp) | length desired?
jeq .Lcsret
subl 4(%sp),%a0 | yes, calculate length copied
movl 16(%sp),%a1 | store at return location
movl %a0,(%a1)
Lcsret:
.Lcsret:
rts
/*
@ -277,34 +277,34 @@ Lcsret:
ENTRY(copyinstr)
CHECK_SFC
GETCURPCB(%a0) | set fault handler
movl #Lcisfault,PCB_ONFAULT(%a0)
movl #.Lcisfault,PCB_ONFAULT(%a0)
movl 4(%sp),%a0 | a0 = fromaddr
movl 8(%sp),%a1 | a1 = toaddr
clrl %d0
movl 12(%sp),%d1 | count
jeq Lcistoolong | nothing to copy
jeq .Lcistoolong | nothing to copy
subql #1,%d1 | predecrement for dbeq
Lcisloop:
.Lcisloop:
movsb (%a0)+,%d0 | copy a byte
movb %d0,(%a1)+
dbeq %d1,Lcisloop | decrement low word of count
jeq Lcisdone | copied null, exit
dbeq %d1,.Lcisloop | decrement low word of count
jeq .Lcisdone | copied null, exit
subil #0x10000,%d1 | decrement high word of count
jcc Lcisloop | more room, keep going
Lcistoolong:
jcc .Lcisloop | more room, keep going
.Lcistoolong:
moveq #ENAMETOOLONG,%d0 | ran out of space
Lcisdone:
.Lcisdone:
tstl 16(%sp) | length desired?
jeq Lcisexit
jeq .Lcisexit
subl 4(%sp),%a0 | yes, calculate length copied
movl 16(%sp),%a1 | store at return location
movl %a0,(%a1)
Lcisexit:
.Lcisexit:
GETCURPCB(%a0) | clear fault handler
clrl PCB_ONFAULT(%a0)
rts
Lcisfault:
jra Lcisdone
.Lcisfault:
jra .Lcisdone
/*
* copyoutstr(void *from, void *to, size_t maxlen, size_t *lencopied);
@ -316,34 +316,34 @@ Lcisfault:
ENTRY(copyoutstr)
CHECK_DFC
GETCURPCB(%a0) | set fault handler
movl #Lcosfault,PCB_ONFAULT(%a0)
movl #.Lcosfault,PCB_ONFAULT(%a0)
movl 4(%sp),%a0 | a0 = fromaddr
movl 8(%sp),%a1 | a1 = toaddr
clrl %d0
movl 12(%sp),%d1 | count
jeq Lcostoolong | nothing to copy
jeq .Lcostoolong | nothing to copy
subql #1,%d1 | predecrement for dbeq
Lcosloop:
.Lcosloop:
movb (%a0)+,%d0 | copy a byte
movsb %d0,(%a1)+
dbeq %d1,Lcosloop | decrement low word of count
jeq Lcosdone | copied null, exit
dbeq %d1,.Lcosloop | decrement low word of count
jeq .Lcosdone | copied null, exit
subil #0x10000,%d1 | decrement high word of count
jcc Lcosloop | more room, keep going
Lcostoolong:
jcc .Lcosloop | more room, keep going
.Lcostoolong:
moveq #ENAMETOOLONG,%d0 | ran out of space
Lcosdone:
.Lcosdone:
tstl 16(%sp) | length desired?
jeq Lcosexit
jeq .Lcosexit
subl 4(%sp),%a0 | yes, calculate length copied
movl 16(%sp),%a1 | store at return location
movl %a0,(%a1)
Lcosexit:
.Lcosexit:
GETCURPCB(%a0) | clear fault handler
clrl PCB_ONFAULT(%a0)
rts
Lcosfault:
jra Lcosdone
.Lcosfault:
jra .Lcosdone
/*
* kcopy(const void *src, void *dst, size_t len);
@ -359,21 +359,21 @@ ENTRY(kcopy)
link %a6,#-4
GETCURPCB(%a0) | set fault handler
movl PCB_ONFAULT(%a0),-4(%a6) | save old handler first
movl #Lkcfault,PCB_ONFAULT(%a0)
movl #.Lkcfault,PCB_ONFAULT(%a0)
movl 16(%a6),-(%sp) | push len
movl 8(%a6),-(%sp) | push src
movl 12(%a6),-(%sp) | push dst
jbsr _C_LABEL(memcpy) | copy it
addl #12,%sp | pop args
clrl %d0 | success!
Lkcdone:
.Lkcdone:
GETCURPCB(%a0) | restore fault handler
movl -4(%a6),PCB_ONFAULT(%a0)
unlk %a6
rts
Lkcfault:
.Lkcfault:
addl #16,%sp | pop args and return address
jra Lkcdone
jra .Lkcdone
/*
* fuword(void *uaddr);
@ -383,9 +383,9 @@ ENTRY(fuword)
CHECK_SFC
movl 4(%sp),%a0 | address to read
GETCURPCB(%a1) | set fault handler
movl #Lferr,PCB_ONFAULT(%a1)
movl #.Lferr,PCB_ONFAULT(%a1)
movsl (%a0),%d0 | do read from user space
jra Lfdone
jra .Lfdone
/*
* fusword(void *uaddr);
@ -395,10 +395,10 @@ ENTRY(fusword)
CHECK_SFC
movl 4(%sp),%a0 | address to read
GETCURPCB(%a1) | set fault handler
movl #Lferr,PCB_ONFAULT(%a1)
movl #.Lferr,PCB_ONFAULT(%a1)
moveq #0,%d0
movsw (%a0),%d0 | do read from user space
jra Lfdone
jra .Lfdone
/*
* fuswintr(void *uaddr);
@ -412,7 +412,7 @@ ENTRY(fuswintr)
movl #_C_LABEL(fubail),PCB_ONFAULT(%a1)
moveq #0,%d0
movsw (%a0),%d0 | do read from user space
jra Lfdone
jra .Lfdone
/*
* fubyte(void *uaddr);
@ -422,10 +422,10 @@ ENTRY(fubyte)
CHECK_SFC
movl 4(%sp),%a0 | address to read
GETCURPCB(%a1) | set fault handler
movl #Lferr,PCB_ONFAULT(%a1)
movl #.Lferr,PCB_ONFAULT(%a1)
moveq #0,%d0
movsb (%a0),%d0 | do read from user space
jra Lfdone
jra .Lfdone
/*
* Error routine for fuswintr. The fault handler in trap.c
@ -436,9 +436,9 @@ ENTRY(fubyte)
*/
ENTRY(fubail)
nop
Lferr:
.Lferr:
moveq #-1,%d0 | error indicator
Lfdone:
.Lfdone:
clrl PCB_ONFAULT(%a1) | clear fault handler
rts
@ -451,10 +451,10 @@ ENTRY(suword)
movl 4(%sp),%a0 | address to write
movl 8(%sp),%d0 | value to put there
GETCURPCB(%a1) | set fault handler
movl #Lserr,PCB_ONFAULT(%a1)
movl #.Lserr,PCB_ONFAULT(%a1)
movsl %d0,(%a0) | do write to user space
moveq #0,%d0 | indicate no fault
jra Lsdone
jra .Lsdone
/*
* susword(void *uaddr, short x);
@ -465,10 +465,10 @@ ENTRY(susword)
movl 4(%sp),%a0 | address to write
movw 10(%sp),%d0 | value to put there
GETCURPCB(%a1) | set fault handler
movl #Lserr,PCB_ONFAULT(%a1)
movl #.Lserr,PCB_ONFAULT(%a1)
movsw %d0,(%a0) | do write to user space
moveq #0,%d0 | indicate no fault
jra Lsdone
jra .Lsdone
/*
* suswintr(void *uaddr, short x);
@ -483,7 +483,7 @@ ENTRY(suswintr)
movl #_C_LABEL(subail),PCB_ONFAULT(%a1)
movsw %d0,(%a0) | do write to user space
moveq #0,%d0 | indicate no fault
jra Lsdone
jra .Lsdone
/*
* subyte(void *uaddr, char x);
@ -494,10 +494,10 @@ ENTRY(subyte)
movl 4(%sp),%a0 | address to write
movb 11(%sp),%d0 | value to put there
GETCURPCB(%a1) | set fault handler
movl #Lserr,PCB_ONFAULT(%a1)
movl #.Lserr,PCB_ONFAULT(%a1)
movsb %d0,(%a0) | do write to user space
moveq #0,%d0 | indicate no fault
jra Lsdone
jra .Lsdone
/*
* Error routine for suswintr. The fault handler in trap.c
@ -508,9 +508,9 @@ ENTRY(subyte)
*/
ENTRY(subail)
nop
Lserr:
.Lserr:
moveq #-1,%d0 | error indicator
Lsdone:
.Lsdone:
clrl PCB_ONFAULT(%a1) | clear fault handler
rts
@ -524,23 +524,23 @@ ENTRY(ucas_32)
CHECK_SFC
CHECK_DFC
GETCURPCB(%a1)
movl #Lucasfault,PCB_ONFAULT(%a1) | set fault handler
movl #.Lucasfault,PCB_ONFAULT(%a1) | set fault handler
movl 4(%sp),%a0 | a0 = uptr
_C_LABEL(ucas_32_ras_start):
movl 8(%sp),%d0 | d0 = old
movsl (%a0),%d1 | d1 = *uptr
cmpl %d0,%d1 | does *uptr == old?
jne Lucasdiff | if not, don't change it
jne .Lucasdiff | if not, don't change it
movl 12(%sp),%d0 | d0 = new
movsl %d0,(%a0) | *uptr = new
nop | pipeline sync
_C_LABEL(ucas_32_ras_end):
Lucasdiff:
.Lucasdiff:
movl 16(%sp),%a0 | a0 = ret
movl %d1,(%a0) | *ret = d1 (old *uptr)
clrl %d0 | return 0
Lucasfault:
.Lucasfault:
clrl PCB_ONFAULT(%a1) | clear fault handler
rts

View File

@ -1,4 +1,4 @@
/* $NetBSD: copypage.s,v 1.15 2013/08/01 13:42:52 matt Exp $ */
/* $NetBSD: copypage.s,v 1.16 2013/09/07 19:06:29 chs Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -53,10 +53,10 @@ ENTRY(copypage040)
movl 4(%sp),%a0 | source address
movl 8(%sp),%a1 | destiniation address
movw #PAGE_SIZE/32-1,%d0 | number of 32 byte chunks - 1
Lm16loop:
.Lm16loop:
.long 0xf6209000 | move16 (%a0)+,(%a1)+
.long 0xf6209000 | move16 (%a0)+,(%a1)+
dbf %d0,Lm16loop
dbf %d0,.Lm16loop
rts
#endif /* M68040 || M68060 */
@ -70,7 +70,7 @@ ENTRY(copypage)
movl 8(%sp),%a1 | destiniation address
#ifndef __mc68010__
movw #PAGE_SIZE/32-1,%d0 | number of 32 byte chunks - 1
Lmlloop:
.Lmlloop:
movl (%a0)+,(%a1)+
movl (%a0)+,(%a1)+
movl (%a0)+,(%a1)+
@ -79,12 +79,12 @@ Lmlloop:
movl (%a0)+,(%a1)+
movl (%a0)+,(%a1)+
movl (%a0)+,(%a1)+
dbf %d0,Lmlloop
dbf %d0,.Lmlloop
#else /* __mc68010__ */
movw #PAGE_SIZE/4-1,%d0 | number of 4 byte chunks - 1
Lmlloop:
.Lmlloop:
movl (%a0)+,(%a1)+
dbf %d0,Lmlloop | use the 68010 loop mode
dbf %d0,.Lmlloop | use the 68010 loop mode
#endif /* __mc68010__ */
rts
@ -107,7 +107,7 @@ ENTRY(zeropage)
movql #0,%d7
movl %d1,%a1
lea PAGE_SIZE(%a0),%a0
Lzloop:
.Lzloop:
movml %d1-%d7/%a1,-(%a0)
movml %d1-%d7/%a1,-(%a0)
movml %d1-%d7/%a1,-(%a0)
@ -116,12 +116,12 @@ Lzloop:
movml %d1-%d7/%a1,-(%a0)
movml %d1-%d7/%a1,-(%a0)
movml %d1-%d7/%a1,-(%a0)
dbf %d0,Lzloop
dbf %d0,.Lzloop
movml (%sp)+,%d2-%d7
#else /* __mc68010__ */
movw #PAGE_SIZE/4-1,%d0 | number of 4 byte chunks - 1
Lzloop:
.Lzloop:
clrl (%a0)+
dbf %d0,Lzloop | use the 68010 loop mode
dbf %d0,.Lzloop | use the 68010 loop mode
#endif /* __mc68010__ */
rts

View File

@ -1,4 +1,4 @@
| $NetBSD: oc_cksum.s,v 1.8 2013/07/22 03:37:17 matt Exp $
| $NetBSD: oc_cksum.s,v 1.9 2013/09/07 19:06:29 chs Exp $
| Copyright (c) 1988 Regents of the University of California.
| All rights reserved.
@ -104,10 +104,10 @@ ENTRY(oc_cksum)
| bits of the count in d1.)
btst #0,%d1
jne L5 | if one or three bytes excess
jne .L5 | if one or three bytes excess
btst #1,%d1
jne L7 | if two bytes excess
L1:
jne .L7 | if two bytes excess
.L1:
#ifdef __mcoldfire__
movq #-4,%d2 | mask to clear bottom two bits
andl %d2,%d1 | longword truncate length
@ -125,8 +125,8 @@ L1:
negl %d2
andb #0xf,%cc | clear X
#endif
jmp (L3-.-2:b,%pc,%d2)
L2:
jmp (.L3-.-2:b,%pc,%d2)
.L2:
movl (%a0)+,%d2
addxl %d2,%d0
movl (%a0)+,%d2
@ -159,12 +159,12 @@ L2:
addxl %d2,%d0
movl (%a0)+,%d2
addxl %d2,%d0
L3:
.L3:
#ifdef __mcoldfire__
cmpal %a0,%a1 | cmpa doesn't affect X
bne L2 | loop until reached
bne .L2 | loop until reached
#else
dbra %d1,L2 | (NB- dbra doesn't affect X)
dbra %d1,.L2 | (NB- dbra doesn't affect X)
#endif
movl %d0,%d1 | fold 32 bit sum to 16 bits
@ -173,14 +173,14 @@ L3:
mvzw %d1,%d1 | zero extend %d1 (doesn't affect X)
mvzw %d0,%d0 | zero extend %d0 (doesn't affect X)
addxl %d1,%d0 |
jcc L4
jcc .L4
addql #1,%d0
#else
addxw %d1,%d0
jcc L4
jcc .L4
addw #1,%d0
#endif
L4:
.L4:
#ifdef __mcoldfire__
mvzw %d0,%d0
#else
@ -189,9 +189,9 @@ L4:
movl (%sp)+,%d2
rts
L5: | deal with 1 or 3 excess bytes at the end of the buffer.
.L5: | deal with 1 or 3 excess bytes at the end of the buffer.
btst #1,%d1
jeq L6 | if 1 excess
jeq .L6 | if 1 excess
| 3 bytes excess
#ifdef __mcoldfire__
@ -202,7 +202,7 @@ L5: | deal with 1 or 3 excess bytes at the end of the buffer.
#endif
addl %d2,%d0 | through to pick up last byte
L6: | 1 byte excess
.L6: | 1 byte excess
#ifdef __mcoldfire__
mvzb (-1,%a0,%d1:l),%d2
#else
@ -211,9 +211,9 @@ L6: | 1 byte excess
#endif
lsll #8,%d2
addl %d2,%d0
jra L1
jra .L1
L7: | 2 bytes excess
.L7: | 2 bytes excess
#ifdef __mcoldfire__
mvzw (-2,%a0,%d1:l),%d2
#else
@ -221,4 +221,4 @@ L7: | 2 bytes excess
movw (-2,%a0,%d1:l),%d2
#endif
addl %d2,%d0
jra L1
jra .L1

View File

@ -1,4 +1,4 @@
/* $NetBSD: reenter_syscall.s,v 1.3 2013/08/01 13:42:52 matt Exp $ */
/* $NetBSD: reenter_syscall.s,v 1.4 2013/09/07 19:06:29 chs Exp $ */
/*
* Written by ITOH Yasufumi.
@ -35,8 +35,8 @@ ENTRY_NOPROFILE(reenter_syscall)
| copy down frame (16*4 + 2 + 2 + 2 + 4 + 2 = 76 bytes = 19 longs)
moveq #19-1,%d0
Lcpfr: movel (%a0)+,(%a1)+
dbra %d0,Lcpfr
.Lcpfr: movel (%a0)+,(%a1)+
dbra %d0,.Lcpfr
movew %d1,%sp@(16*4+2) | set stack adjust count
movel (%sp),-(%sp) | push syscall no (original d0 value)
@ -44,13 +44,12 @@ Lcpfr: movel (%a0)+,(%a1)+
addql #4,%sp | pop syscall no
#ifdef DEBUG
tstw %sp@(16*4+2) | stack adjust must be zero
jeq Ladjzero
jeq .Ladjzero
PANIC("reenter_syscall")
Ladjzero:
.Ladjzero:
#endif
moveal %sp@(15*4),%a0 | grab and restore
movel %a0,%usp | user SP
moveml (%sp)+,#0x7FFF | restore user registers
addql #8,%sp | pop SP and stack adjust
jra _ASM_LABEL(rei) | rte

View File

@ -1,4 +1,4 @@
/* $NetBSD: switch_subr.s,v 1.30 2013/08/01 13:42:52 matt Exp $ */
/* $NetBSD: switch_subr.s,v 1.31 2013/09/07 19:06:29 chs Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation.
@ -95,7 +95,7 @@ ENTRY(cpu_switchto)
#else
tstl %a1 | Old LWP exited?
#endif
jeq Lcpu_switch_noctxsave | Yup. Don't bother saving context
jeq .Lcpu_switch_noctxsave | Yup. Don't bother saving context
/*
* Save state of previous process in its pcb.
@ -111,37 +111,37 @@ ENTRY(cpu_switchto)
#ifdef FPCOPROC
#ifdef FPU_EMULATE
tstl _C_LABEL(fputype) | Do we have an FPU?
jeq Lcpu_switch_nofpsave | No Then don't attempt save.
jeq .Lcpu_switch_nofpsave | No Then don't attempt save.
#endif
lea PCB_FPCTX(%a1),%a2 | pointer to FP save area
fsave (%a2) | save FP state
#if defined(M68020) || defined(M68030) || defined(M68040)
#if defined(M68060)
cmpl #FPU_68060,_C_LABEL(fputype)
jeq Lcpu_switch_savfp60
jeq .Lcpu_switch_savfp60
#endif
tstb (%a2) | null state frame?
jeq Lcpu_switch_nofpsave | yes, all done
jeq .Lcpu_switch_nofpsave | yes, all done
fmovem %fp0-%fp7,FPF_REGS(%a2) | save FP general registers
fmovem %fpcr/%fpsr/%fpi,FPF_FPCR(%a2) | save FP control registers
#if defined(M68060)
jra Lcpu_switch_nofpsave
jra .Lcpu_switch_nofpsave
#endif
#endif
#if defined(M68060)
Lcpu_switch_savfp60:
.Lcpu_switch_savfp60:
tstb 2(%a2) | null state frame?
jeq Lcpu_switch_nofpsave | yes, all done
jeq .Lcpu_switch_nofpsave | yes, all done
fmovem %fp0-%fp7,FPF_REGS(%a2) | save FP general registers
fmovem %fpcr,FPF_FPCR(%a2) | save FP control registers
fmovem %fpsr,FPF_FPSR(%a2)
fmovem %fpi,FPF_FPI(%a2)
#endif
Lcpu_switch_nofpsave:
.Lcpu_switch_nofpsave:
#endif /* FPCOPROC */
#endif /* !_M68K_CUSTOM_FPU_CTX */
Lcpu_switch_noctxsave:
.Lcpu_switch_noctxsave:
movl 8(%sp),%a0 | get newlwp
movl %a0,_C_LABEL(curlwp)
movl L_PCB(%a0),%a1 | get its pcb
@ -167,14 +167,14 @@ Lcpu_switch_noctxsave:
movl VM_PMAP(%a2),%a2 | pmap = vm->vm_map.pmap
movl PM_A_PHYS(%a2),%d0 | phys = pmap->pm_a_phys
cmpl 4(%a3),%d0 | == kernel_crp.rp_addr ?
jeq Lsame_mmuctx | skip loadcrp/flush
jeq .Lsame_mmuctx | skip loadcrp/flush
/* OK, it is a new MMU context. Load it up. */
movl %d0,4(%a3)
movl #CACHE_CLR,%d0
movc %d0,%cacr | invalidate cache(s)
pflusha | flush entire TLB
pmove (%a3),%crp | load new user root pointer
Lsame_mmuctx:
.Lsame_mmuctx:
#endif /* !defined(_SUN3X_) || defined(PMAP_DEBUG) */
#else /* !defined(sun2) && !defined(sun3) */
/*
@ -224,43 +224,43 @@ Lsame_mmuctx:
#ifdef FPCOPROC
#ifdef FPU_EMULATE
tstl _C_LABEL(fputype) | Do we have an FPU?
jeq Lcpu_switch_nofprest | No Then don't attempt restore.
jeq .Lcpu_switch_nofprest | No Then don't attempt restore.
#endif
lea PCB_FPCTX(%a1),%a0 | pointer to FP save area
#if defined(M68020) || defined(M68030) || defined(M68040)
#if defined(M68060)
cmpl #FPU_68060,_C_LABEL(fputype)
jeq Lcpu_switch_resfp60rest1
jeq .Lcpu_switch_resfp60rest1
#endif
tstb (%a0) | null state frame?
jeq Lcpu_switch_resfprest | yes, easy
jeq .Lcpu_switch_resfprest | yes, easy
fmovem FPF_FPCR(%a0),%fpcr/%fpsr/%fpi | restore FP control registers
fmovem FPF_REGS(%a0),%fp0-%fp7 | restore FP general registers
#if defined(M68060)
jra Lcpu_switch_resfprest
jra .Lcpu_switch_resfprest
#endif
#endif
#if defined(M68060)
Lcpu_switch_resfp60rest1:
.Lcpu_switch_resfp60rest1:
tstb 2(%a0) | null state frame?
jeq Lcpu_switch_resfprest | yes, easy
jeq .Lcpu_switch_resfprest | yes, easy
fmovem FPF_FPCR(%a0),%fpcr | restore FP control registers
fmovem FPF_FPSR(%a0),%fpsr
fmovem FPF_FPI(%a0),%fpi
fmovem FPF_REGS(%a0),%fp0-%fp7 | restore FP general registers
#endif
Lcpu_switch_resfprest:
.Lcpu_switch_resfprest:
frestore (%a0) | restore state
#endif /* FPCOPROC */
#endif /* !_M68K_CUSTOM_FPU_CTX */
Lcpu_switch_nofprest:
.Lcpu_switch_nofprest:
movl %d1,%d0
movl %d0,%a0
rts
Lcpu_switch_badsw:
.Lcpu_switch_badsw:
PANIC("switch")
/*NOTREACHED*/
@ -281,33 +281,33 @@ ENTRY(savectx)
#ifdef FPCOPROC
#ifdef FPU_EMULATE
tstl _C_LABEL(fputype) | Do we have FPU?
jeq Lsavectx_nofpsave | No? Then don't save state.
jeq .Lsavectx_nofpsave | No? Then don't save state.
#endif
lea PCB_FPCTX(%a1),%a0 | pointer to FP save area
fsave (%a0) | save FP state
#if defined(M68020) || defined(M68030) || defined(M68040)
#if defined(M68060)
cmpl #FPU_68060,_C_LABEL(fputype)
jeq Lsavectx_savfp60
jeq .Lsavectx_savfp60
#endif
tstb (%a0) | null state frame?
jeq Lsavectx_nofpsave | yes, all done
jeq .Lsavectx_nofpsave | yes, all done
fmovem %fp0-%fp7,FPF_REGS(%a0) | save FP general registers
fmovem %fpcr/%fpsr/%fpi,FPF_FPCR(%a0) | save FP control registers
#if defined(M68060)
jra Lsavectx_nofpsave
jra .Lsavectx_nofpsave
#endif
#endif
#if defined(M68060)
Lsavectx_savfp60:
.Lsavectx_savfp60:
tstb 2(%a0) | null state frame?
jeq Lsavectx_nofpsave | yes, all done
jeq .Lsavectx_nofpsave | yes, all done
fmovem %fp0-%fp7,FPF_REGS(%a0) | save FP general registers
fmovem %fpcr,FPF_FPCR(%a0) | save FP control registers
fmovem %fpsr,FPF_FPSR(%a0)
fmovem %fpi,FPF_FPI(%a0)
#endif
Lsavectx_nofpsave:
.Lsavectx_nofpsave:
#endif /* FPCOPROC */
#endif /* !_M68K_CUSTOM_FPU_CTX */
moveq #0,%d0 | return 0
@ -355,25 +355,25 @@ ENTRY(m68881_save)
#if defined(M68020) || defined(M68030) || defined(M68040)
#if defined(M68060)
cmpl #FPU_68060,_C_LABEL(fputype)
jeq Lm68060fpsave
jeq .Lm68060fpsave
#endif
Lm68881fpsave:
.Lm68881fpsave:
tstb (%a0) | null state frame?
jeq Lm68881sdone | yes, all done
jeq .Lm68881sdone | yes, all done
fmovem %fp0-%fp7,FPF_REGS(%a0) | save FP general registers
fmovem %fpcr/%fpsr/%fpi,FPF_FPCR(%a0) | save FP control registers
Lm68881sdone:
.Lm68881sdone:
rts
#endif
#if defined(M68060)
Lm68060fpsave:
.Lm68060fpsave:
tstb 2(%a0) | null state frame?
jeq Lm68060sdone | yes, all done
jeq .Lm68060sdone | yes, all done
fmovem %fp0-%fp7,FPF_REGS(%a0) | save FP general registers
fmovem %fpcr,FPF_FPCR(%a0) | save FP control registers
fmovem %fpsr,FPF_FPSR(%a0)
fmovem %fpi,FPF_FPI(%a0)
Lm68060sdone:
.Lm68060sdone:
rts
#endif
@ -382,26 +382,26 @@ ENTRY(m68881_restore)
#if defined(M68020) || defined(M68030) || defined(M68040)
#if defined(M68060)
cmpl #FPU_68060,_C_LABEL(fputype)
jeq Lm68060fprestore
jeq .Lm68060fprestore
#endif
Lm68881fprestore:
.Lm68881fprestore:
tstb (%a0) | null state frame?
jeq Lm68881rdone | yes, easy
jeq .Lm68881rdone | yes, easy
fmovem FPF_FPCR(%a0),%fpcr/%fpsr/%fpi | restore FP control registers
fmovem FPF_REGS(%a0),%fp0-%fp7 | restore FP general registers
Lm68881rdone:
.Lm68881rdone:
frestore (%a0) | restore state
rts
#endif
#if defined(M68060)
Lm68060fprestore:
.Lm68060fprestore:
tstb 2(%a0) | null state frame?
jeq Lm68060fprdone | yes, easy
jeq .Lm68060fprdone | yes, easy
fmovem FPF_FPCR(%a0),%fpcr | restore FP control registers
fmovem FPF_FPSR(%a0),%fpsr
fmovem FPF_FPI(%a0),%fpi
fmovem FPF_REGS(%a0),%fp0-%fp7 | restore FP general registers
Lm68060fprdone:
.Lm68060fprdone:
frestore (%a0) | restore state
rts
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.167 2013/07/16 07:31:40 jklos Exp $ */
/* $NetBSD: locore.s,v 1.168 2013/09/07 19:06:29 chs Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -754,13 +754,13 @@ ENTRY_NOPROFILE(trap0)
jbsr _C_LABEL(syscall) | handle it
addql #4,%sp | pop syscall arg
tstl _C_LABEL(astpending)
jne Lrei2
jne .Lrei2
tstb _C_LABEL(ssir)
jeq Ltrap1
jeq .Ltrap1
movw #SPL1,%sr
tstb _C_LABEL(ssir)
jne Lsir1
Ltrap1:
jne .Lsir1
.Ltrap1:
movl %sp@(FR_SP),%a0 | grab and restore
movl %a0,%usp | %USP
moveml %sp@+,#0x7FFF | restore most registers
@ -999,16 +999,16 @@ ENTRY_NOPROFILE(rtclock_intr)
ASENTRY_NOPROFILE(rei)
tstl _C_LABEL(astpending) | AST pending?
jeq Lchksir | no, go check for SIR
Lrei1:
jeq .Lchksir | no, go check for SIR
.Lrei1:
btst #5,%sp@ | yes, are we returning to user mode?
jne Lchksir | no, go check for SIR
jne .Lchksir | no, go check for SIR
movw #PSL_LOWIPL,%sr | lower SPL
clrl %sp@- | stack adjust
moveml #0xFFFF,%sp@- | save all registers
movl %usp,%a1 | including
movl %a1,%sp@(FR_SP) | %USP
Lrei2:
.Lrei2:
clrl %sp@- | VA == none
clrl %sp@- | code == none
movl #T_ASTFLT,%sp@- | type == async system trap
@ -1018,11 +1018,11 @@ Lrei2:
movl %sp@(FR_SP),%a0 | restore %USP
movl %a0,%usp | from save area
movw %sp@(FR_ADJ),%d0 | need to adjust stack?
jne Laststkadj | yes, go to it
jne .Laststkadj | yes, go to it
moveml %sp@+,#0x7FFF | no, restore most user regs
addql #8,%sp | toss %SP and stack adjust
rte | and do real RTE
Laststkadj:
.Laststkadj:
lea %sp@(FR_HW),%a1 | pointer to HW frame
addql #8,%a1 | source pointer
movl %a1,%a0 | source
@ -1033,23 +1033,23 @@ Laststkadj:
moveml %sp@+,#0x7FFF | restore user registers
movl %sp@,%sp | and our %SP
rte | and do real RTE
Lchksir:
.Lchksir:
tstb _C_LABEL(ssir) | SIR pending?
jeq Ldorte | no, all done
jeq .Ldorte | no, all done
movl %d0,%sp@- | need a scratch register
movw %sp@(4),%d0 | get SR
andw #PSL_IPL7,%d0 | mask all but IPL
jne Lnosir | came from interrupt, no can do
jne .Lnosir | came from interrupt, no can do
movl %sp@+,%d0 | restore scratch register
Lgotsir:
.Lgotsir:
movw #SPL1,%sr | prevent others from servicing int
tstb _C_LABEL(ssir) | too late?
jeq Ldorte | yes, oh well...
jeq .Ldorte | yes, oh well...
clrl %sp@- | stack adjust
moveml #0xFFFF,%sp@- | save all registers
movl %usp,%a1 | including
movl %a1,%sp@(FR_SP) | %USP
Lsir1:
.Lsir1:
clrl %sp@- | VA == none
clrl %sp@- | code == none
movl #T_SSIR,%sp@- | type == software interrupt
@ -1061,9 +1061,9 @@ Lsir1:
moveml %sp@+,#0x7FFF | and all remaining registers
addql #8,%sp | pop %SP and stack adjust
rte
Lnosir:
.Lnosir:
movl %sp@+,%d0 | restore scratch register
Ldorte:
.Ldorte:
rte | real return
/*
@ -1161,13 +1161,13 @@ ENTRY(spl0)
movw %sr,%d0 | get old SR for return
movw #PSL_LOWIPL,%sr | restore new SR
tstb _C_LABEL(ssir) | software interrupt pending?
jeq Lspldone | no, all done
jeq .Lspldone | no, all done
subql #4,%sp | make room for RTE frame
movl %sp@(4),%sp@(2) | position return address
clrw %sp@(6) | set frame type 0
movw #PSL_LOWIPL,%sp@ | and new SR
jra Lgotsir | go handle it
Lspldone:
jra .Lgotsir | go handle it
.Lspldone:
rts
/*
@ -1189,30 +1189,30 @@ ALTENTRY(_delay, _delay)
ENTRY(delay)
movl %sp@(4),%d0 | get microseconds to delay
cmpl #0x40000,%d0 | is it a "large" delay?
bls Ldelayshort | no, normal calculation
bls .Ldelayshort | no, normal calculation
movql #0x7f,%d1 | adjust for scaled multipler (to
addl %d1,%d0 | avoid overflow)
lsrl #7,%d0
mulul _C_LABEL(delay_factor),%d0 | calculate number of loop iterations
bra Ldelaysetup | go do it!
Ldelayshort:
bra .Ldelaysetup | go do it!
.Ldelayshort:
mulul _C_LABEL(delay_factor),%d0 | calculate number of loop iterations
lsrl #7,%d0 | adjust for scaled multiplier
Ldelaysetup:
jeq Ldelayexit | bail out if nothing to do
.Ldelaysetup:
jeq .Ldelayexit | bail out if nothing to do
movql #0,%d1 | put bits 15-0 in %d1 for the
movw %d0,%d1 | inner loop, and move bits
movw #0,%d0 | 31-16 to the low-order word
subql #1,%d1 | of %d0 for the outer loop
swap %d0
Ldelay:
.Ldelay:
tstl _C_LABEL(delay_flag) | this never changes for delay()!
dbeq %d1,Ldelay | (used only for timing purposes)
dbeq %d0,Ldelay
dbeq %d1,.Ldelay | (used only for timing purposes)
dbeq %d0,.Ldelay
addqw #1,%d1 | adjust end count and
swap %d0 | return the longword result
orl %d1,%d0
Ldelayexit:
.Ldelayexit:
rts
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: pramasm.s,v 1.8 2001/11/20 03:19:43 chs Exp $ */
/* $NetBSD: pramasm.s,v 1.9 2013/09/07 19:06:29 chs Exp $ */
/*
* RTC toolkit version 1.08b, copyright 1995, erik vogan
@ -223,7 +223,7 @@ ENTRY(setPramTimeII)
* routines, above.
*/
ENTRY(readClock)
ENTRY_NOPROFILE(readClock)
moveml #0x7cc0,%sp@- | store off the regs we need
moveq #00,%d0 | zero out our result reg
readagan:
@ -251,7 +251,7 @@ gotTime:
moveml %sp@+,#0x033e | restore our regs
rts | and return to caller
ENTRY(writeClock)
ENTRY_NOPROFILE(writeClock)
moveml #0x78c0,%sp@- | store off the regs we need
moveq #03,%d4 | set our count down reg to 4
movel #0x00550035,%d1 | de-write-protect the PRAM
@ -271,7 +271,7 @@ putSecb:
moveml %sp@+,#0x031e | restore our regs
rts | and return to caller
ENTRY(PRAMacc)
ENTRY_NOPROFILE(PRAMacc)
moveml #0xf8c0,%sp@- | store off the regs we'll use
moveq #00,%d3 | zero out our command reg
moveq #00,%d4 | zero out our count reg too
@ -348,7 +348,7 @@ tagain:
moveml %sp@+,#0x031f | restore all our registers
rts | and return to our gracious caller
ENTRY(Transfer)
ENTRY_NOPROFILE(Transfer)
movew %sr,%sp@- | store the SR (we'll change it!)
oriw #0x0700,%sr | disable all interrupts
moveal _C_LABEL(Via1Base),%a1 | move VIA1 addr in reference reg