diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2013-02-02 13:32:07 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2013-02-02 13:32:07 +0000 |
commit | 22cba234393e85cacb460dd6e3f6aadc75278969 (patch) | |
tree | 2a2b3982e48ded6f3aa6d8d4539b9873d7c5d4d9 /sys | |
parent | bfb23955a64b7aa0e072e92cbfc69f31228df265 (diff) |
Kernel bits for m68k/ELF, mostly from NetBSD. In addition, the `pmod' symbel
in fpsp has to be renamed due to a clash with other parts of the kernel.
Diffstat (limited to 'sys')
41 files changed, 1712 insertions, 1561 deletions
diff --git a/sys/arch/m68k/060sp/Makefile b/sys/arch/m68k/060sp/Makefile index 1d650401c5f..73852dd6739 100644 --- a/sys/arch/m68k/060sp/Makefile +++ b/sys/arch/m68k/060sp/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.6 2007/10/18 18:08:02 deraadt Exp $ +# $OpenBSD: Makefile,v 1.7 2013/02/02 13:32:05 miod Exp $ # $NetBSD: Makefile,v 1.3 1996/12/31 22:44:13 veego Exp $ # .if ${MACHINE_ARCH} == "m68k" @@ -13,7 +13,8 @@ LD= ld sh ${.CURDIR}/asm2gas ${.IMPSRC} >${.TARGET} 060sp.o: netbsd.S inetbsd.S fnetbsd.S isp.S fpsp.S copyright.S - $(AS) -I${.CURDIR} -o ${.TARGET} ${.CURDIR}/netbsd.S + $(CC) ${AFLAGS} -m68060 ${CPPFLAGS} -I${.CURDIR} -I. \ + -c -o ${.TARGET} ${.CURDIR}/netbsd.S clean cleandir: rm -f 060sp.o isp.S fpsp.S diff --git a/sys/arch/m68k/060sp/asm2gas b/sys/arch/m68k/060sp/asm2gas index 55f974058f3..cc5117e4466 100644 --- a/sys/arch/m68k/060sp/asm2gas +++ b/sys/arch/m68k/060sp/asm2gas @@ -1,9 +1,13 @@ #!/bin/sh -# $OpenBSD: asm2gas,v 1.2 1996/05/30 22:13:58 niklas Exp $ -# $NetBSD: asm2gas,v 1.3 1994/10/26 07:48:49 cgd Exp $ +# $OpenBSD: asm2gas,v 1.3 2013/02/02 13:32:05 miod Exp $ +# $NetBSD: asm2gas,v 1.6 2000/12/06 21:31:05 is Exp $ # -# Copyright (c) 1994 Charles Hannum. All rights reserved. +# Copyright (c) 1998 The NetBSD Foundation, Inc. +# All rights reserved. +# +# This code is derived from software contributed to The NetBSD Foundation +# by Charles M. Hannum. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -15,20 +19,23 @@ # documentation and/or other materials provided with the distribution. # 3. All advertising materials mentioning features or use of this software # must display the following acknowledgement: -# This product includes software developed by Charles Hannum. -# 4. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. +# This product includes software developed by the NetBSD +# Foundation, Inc. and its contributors. +# 4. Neither the name of The NetBSD Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. # -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. # # This ugly script converts assembler code from Motorola's format to a @@ -132,33 +139,102 @@ cat $1 | sed -e ' ' | sed -e ' # operand conversion - s/\([^_a-zA-Z0-9]\)FPIAR\([^_a-zA-Z0-9]\)/\1FPI\2/g - s/\([^_a-zA-Z0-9]\)FPIAR\([^_a-zA-Z0-9]\)/\1FPI\2/g - s/\([^_a-zA-Z0-9]\)FPIAR$/\1FPI/g - s/\([^_a-zA-Z0-9]\)fpiar\([^_a-zA-Z0-9]\)/\1fpi\2/g - s/\([^_a-zA-Z0-9]\)fpiar\([^_a-zA-Z0-9]\)/\1fpi\2/g - s/\([^_a-zA-Z0-9]\)fpiar$/\1fpi/g + s/\([^_a-zA-Z0-9]\)FPIAR\([^_a-zA-Z0-9]\)/\1%FPI\2/g + s/\([^_a-zA-Z0-9]\)FPIAR$/\1%FPI/g + s/\([^_a-zA-Z0-9]\)fpiar\([^_a-zA-Z0-9]\)/\1%fpi\2/g + s/\([^_a-zA-Z0-9]\)fpiar$/\1%fpi/g + s/\([^_a-zA-Z0-9]\)FPCR\([^_a-zA-Z0-9]\)/\1%FPCR\2/g + s/\([^_a-zA-Z0-9]\)FPCR$/\1%FPCR/g + s/\([^_a-zA-Z0-9]\)fpcr\([^_a-zA-Z0-9]\)/\1%fpcr\2/g + s/\([^_a-zA-Z0-9]\)fpcr$/\1%fpcr/g + s/\([^_a-zA-Z0-9]\)FPSR\([^_a-zA-Z0-9]\)/\1%FPSR\2/g + s/\([^_a-zA-Z0-9]\)FPSR$/\1%FPSR/g + s/\([^_a-zA-Z0-9]\)fpsr\([^_a-zA-Z0-9]\)/\1%fpsr\2/g + s/\([^_a-zA-Z0-9]\)fpsr$/\1%fpsr/g + # RCS Id + s/\$\(NetBSD.*\)\$/\1/g + s/\$\(OpenBSD.*\)\$/\1/g s/\$/0x/g s/#:/#:0x/g - s/-(\([sSpPaA][pPcC0-7]\))/\1@-/g - s/(\([sSpPaA][pPcC0-7]\))+/\1@+/g - s/\([-+A-Za-z0-9_]*\)(\([sSpPaA][pPcC0-7]\)\([),]\)/\2@(\1\3/g + s/\([^[:alnum:]_]\)\([dDaA][0-7]\)\([^[:alnum:]_]\)/\1%\2\3/g + s/\([^[:alnum:]_]\)\([fF][pP][0-7]\)\([^[:alnum:]_]\)/\1%\2\3/g + s/\([^[:alnum:]_]\)\(sp\)\([^[:alnum:]_]\)/\1%\2\3/g + s/\([^[:alnum:]_]\)\(pc\)\([^[:alnum:]_]\)/\1%\2\3/g + + s/\([^[:alnum:]_]\)\([dDaA][0-7]\)$/\1%\2/g + s/\([^[:alnum:]_]\)\([fF][pP][0-7]\)$/\1%\2/g + s/\([^[:alnum:]_]\)\(sp\)$/\1%\2/g + + s/\(,\)\([dDaA][0-7]\)/\1%\2/g + s/\(,\)\([fF][pP][0-7]\)/\1%\2/g + + s/-(\(%[sSpPaA][pPcC0-7]\))/\1@-/g + s/(\(%[sSpPaA][pPcC0-7]\))+/\1@+/g + s/\([-+A-Za-z0-9_]*\)(\(%[sSpPaA][pPcC0-7]\)\([),]\)/\2@(\1\3/g s/\.\([bBwWlL])\)/:\1/g s/\.\([bBwWlL]\)\*\([0-9][0-9]*)\)/:\1:\2/g s/\*\([0-9][0-9]*\))/:l:\1)/g s/{\([0-9][0-9]*\):\([0-9][0-9]*\)}/{#\1:#\2}/g - s/{\([dD][0-7]\):\([0-9][0-9]*\)}/{\1:#\2}/g + s/{\(%[dD][0-7]\):\([0-9][0-9]*\)}/{\1:#\2}/g + s/{\([dD][0-7]\):\([0-9][0-9]*\)}/{%\1:#\2}/g + s/{\([dD][0-7]\):\(%[dD][0-9]*\)}/{%\1:\2}/g + + s/\(-\)\([dDaA][0-7]\)\([^_a-zA-Z0-9]\)/\1%\2\3/g + s/\(-\)\([fF][pP][0-7]\)\([^_a-zA-Z0-9]\)/\1%\2\3/g + + s/\(\/\)\([dDaA][0-7]\)\([^_a-zA-Z0-9]\)/\1%\2\3/g + s/\(\/\)\([fF][pP][0-7]\)\([^_a-zA-Z0-9]\)/\1%\2\3/g s/@(0*)/@/g s/(,/(/g;s/:)/)/g # make up for a gas bug /^ fmovemx /{ - s/ \([fF][pP][0-7]\),/ \1-\1,/ - s/,\([fF][pP][0-7]\) /,\1-\1 / - s/,\([fF][pP][0-7]\)$/,\1-\1/ + s/ \(%[fF][pP][0-7]\),/ \1-\1,/ + s/,\(%[fF][pP][0-7]\) /,\1-\1 / + s/,\(%[fF][pP][0-7]\)$/,\1-\1/ } +' | sed -e ' + # Floating point literal conversion + + s/:0x41dfffffffc00000/0r2147483647.0/g + s/:0xc1e0000000000000/0r-2147483648.0/g + s/:0x41dfffffffe00000/0r2147483647.5/g + s/:0xc1e0000000100000/0r-2147483648.5/g + s/:0x46fffe00/0r32767.0/g + s/:0xc7000000/0r-32768.0/g + s/:0x46ffff00/0r32767.5/g + s/:0xc7000080/0r-32768.5/g + s/:0x42fe0000/0r127.0/g + s/:0xc3000000/0r-128.0/g + s/:0x42ff0000/0r127.5/g + s/:0xc3008000/0r-128.5/g + s/:0x3F800000/0r1.0/g + s/:0x00000000/0r0.0/g + s/:0xBF800000/0r-1.0/g + s/:0x3F000000/0r0.5/g + s/:0x3E800000/0r0.25/g + s/:0x42B8AA3B/0r92.332481384277343750/g + s/:0xBC317218/0r-0.0108304247260093688964843750/g + s/:0x3AB60B70/0r0.001388890668749809265136718750/g + s/:0x3C088895/0r0.0083333449438214302062988281250/g + s/:0x42B8AA3B/0r92.332481384277343750/g + s/:0x3950097B/0r0.0001983995753107592463493347167968750/g + s/:0x3AB60B6A/0r0.001388889970257878303527832031250/g + s/:0x2F30CAA8/0r1.60791047143504783889511600136756896972656250e-10/g + s/:0x310F8290/0r2.0883454965314740547910332679748535156250e-09/g + s/:0x32D73220/0r2.5052088403754169121384620666503906250e-08/g + s/:0x3493F281/0r2.755732850800995947793126106262207031250e-07/g + s/:0x40000000/0r2.0/g + s/:0x42800000/0r6.40e+01/g + s/:0x3C800000/0r1.56250e-02/g + s/fadds #:0x00800000,%[fF][pP]0/ .long 0xf23c4422,0x00800000/ + s/fsubs #:0x00800000,%[fF][pP]0/ .long 0xf23c4428,0x00800000/ + s/fsubs #:0x00800000,%[fF][pP]1/ .long 0xf23c44a8,0x00800000/ + s/fmoves #:0x80000000,%[fF][pP]0/ .long 0xf23c4400,0x80000000/ + s/fmoves #:0x00000000,%[fF][pP]0/ .long 0xf23c4400,0x00000000/ + ' diff --git a/sys/arch/m68k/060sp/copyright.S b/sys/arch/m68k/060sp/copyright.S index d646b4d2d6f..f947617392d 100644 --- a/sys/arch/m68k/060sp/copyright.S +++ b/sys/arch/m68k/060sp/copyright.S @@ -1,7 +1,7 @@ -# -# $OpenBSD: copyright.S,v 1.2 1996/05/30 22:14:01 niklas Exp $ -# $NetBSD: copyright.S,v 1.2 1996/05/16 15:37:49 is Exp $ -# +|# +|# $OpenBSD: copyright.S,v 1.3 2013/02/02 13:32:05 miod Exp $ +|# $NetBSD: copyright.S,v 1.2 1996/05/16 15:37:49 is Exp $ +|# .ascii "MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP\n" .ascii "M68000 Hi-Performance Microprocessor Division\n" diff --git a/sys/arch/m68k/060sp/fnetbsd.S b/sys/arch/m68k/060sp/fnetbsd.S index baf70d048f9..e3f3ab76eaf 100644 --- a/sys/arch/m68k/060sp/fnetbsd.S +++ b/sys/arch/m68k/060sp/fnetbsd.S @@ -1,354 +1,337 @@ -# -# $OpenBSD: fnetbsd.S,v 1.2 1996/05/30 22:14:05 niklas Exp $ -# $NetBSD: fnetbsd.S,v 1.2 1996/05/15 21:16:45 is Exp $ -# -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP -# M68000 Hi-Performance Microprocessor Division -# M68060 Software Package Production Release -# -# M68060 Software Package Copyright (C) 1993, 1994, 1995, 1996 Motorola Inc. -# All rights reserved. -# -# THE SOFTWARE is provided on an "AS IS" basis and without warranty. -# To the maximum extent permitted by applicable law, -# MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, -# INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS -# FOR A PARTICULAR PURPOSE and any warranty against infringement with -# regard to the SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF) -# and any accompanying written materials. -# -# To the maximum extent permitted by applicable law, -# IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER -# (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, -# BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) -# ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE. -# -# Motorola assumes no responsibility for the maintenance and support -# of the SOFTWARE. -# -# You are hereby granted a copyright license to use, modify, and distribute the -# SOFTWARE so long as this entire notice is retained without alteration -# in any modified and/or redistributed versions, and that such modified -# versions are clearly identified as such. -# No licenses are granted by implication, estoppel or otherwise under any -# patents or trademarks of Motorola, Inc. -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Derived from: -# fskeleton.s -# -# This file contains: -# (1) example "Call-out"s -# (2) example package entry code -# (3) example "Call-out" table -# - - -################################# -# (1) EXAMPLE CALL-OUTS # -# # -# _060_fpsp_done() # -# _060_real_ovfl() # -# _060_real_unfl() # -# _060_real_operr() # -# _060_real_snan() # -# _060_real_dz() # -# _060_real_inex() # -# _060_real_bsun() # -# _060_real_fline() # -# _060_real_fpu_disabled() # -# _060_real_trap() # -################################# - -# -# _060_fpsp_done(): -# -# This is the main exit point for the 68060 Floating-Point -# Software Package. For a normal exit, all 060FPSP routines call this -# routine. The operating system can do system dependent clean-up or -# simply execute an "rte" as with the sample code below. -# - .global _060_fpsp_done -_060_fpsp_done: +/* + * $OpenBSD: fnetbsd.S,v 1.3 2013/02/02 13:32:05 miod Exp $ + * $NetBSD: fnetbsd.S,v 1.2 1996/05/15 21:16:45 is Exp $ + * + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP + * M68000 Hi-Performance Microprocessor Division + * M68060 Software Package Production Release + * + * M68060 Software Package Copyright (C) 1993, 1994, 1995, 1996 Motorola Inc. + * All rights reserved. + * + * THE SOFTWARE is provided on an "AS IS" basis and without warranty. + * To the maximum extent permitted by applicable law, + * MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, + * INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS + * FOR A PARTICULAR PURPOSE and any warranty against infringement with + * regard to the SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF) + * and any accompanying written materials. + * + * To the maximum extent permitted by applicable law, + * IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER + * (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, + * BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) + * ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE. + * + * Motorola assumes no responsibility for the maintenance and support + * of the SOFTWARE. + * + * You are hereby granted a copyright license to use, modify, and distribute the + * SOFTWARE so long as this entire notice is retained without alteration + * in any modified and/or redistributed versions, and that such modified + * versions are clearly identified as such. + * No licenses are granted by implication, estoppel or otherwise under any + * patents or trademarks of Motorola, Inc. + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * Derived from: + * fskeleton.s + * + * This file contains: + * (1) example "Call-out"s + * (2) example package entry code + * (3) example "Call-out" table + */ + + +/******************************** + * (1) EXAMPLE CALL-OUTS * + * * + * _060_fpsp_done() * + * _060_real_ovfl() * + * _060_real_unfl() * + * _060_real_operr() * + * _060_real_snan() * + * _060_real_dz() * + * _060_real_inex() * + * _060_real_bsun() * + * _060_real_fline() * + * _060_real_fpu_disabled() * + * _060_real_trap() * + ********************************/ + +/* + * _060_fpsp_done(): + * + * This is the main exit point for the 68060 Floating-Point + * Software Package. For a normal exit, all 060FPSP routines call this + * routine. The operating system can do system dependent clean-up or + * simply execute an "rte" as with the sample code below. + */ +ASENTRY_NOPROFILE(_060_fpsp_done) rte -# -# _060_real_ovfl(): -# -# This is the exit point for the 060FPSP when an enabled overflow exception -# is present. The routine below should point to the operating system handler -# for enabled overflow conditions. The exception stack frame is an overflow -# stack frame. The FP state frame holds the EXCEPTIONAL OPERAND. -# -# The sample routine below simply clears the exception status bit and -# does an "rte". -# - .global _060_real_ovfl -_060_real_ovfl: - fsave sp@- - movew #0x6000,sp@(0x2) - frestore sp@+ - jmp _fpfault - -# -# _060_real_unfl(): -# -# This is the exit point for the 060FPSP when an enabled underflow exception -# is present. The routine below should point to the operating system handler -# for enabled underflow conditions. The exception stack frame is an underflow -# stack frame. The FP state frame holds the EXCEPTIONAL OPERAND. -# -# The sample routine below simply clears the exception status bit and -# does an "rte". -# - .global _060_real_unfl -_060_real_unfl: - fsave sp@- - movew #0x6000,sp@(0x2) - frestore sp@+ - jmp _fpfault - -# -# _060_real_operr(): -# -# This is the exit point for the 060FPSP when an enabled operand error exception -# is present. The routine below should point to the operating system handler -# for enabled operand error exceptions. The exception stack frame is an operand error -# stack frame. The FP state frame holds the source operand of the faulting -# instruction. -# -# The sample routine below simply clears the exception status bit and -# does an "rte". -# - .global _060_real_operr -_060_real_operr: - fsave sp@- - movew #0x6000,sp@(0x2) - frestore sp@+ - jmp _fpfault - -# -# _060_real_snan(): -# -# This is the exit point for the 060FPSP when an enabled signalling NaN exception -# is present. The routine below should point to the operating system handler -# for enabled signalling NaN exceptions. The exception stack frame is a signalling NaN -# stack frame. The FP state frame holds the source operand of the faulting -# instruction. -# -# The sample routine below simply clears the exception status bit and -# does an "rte". -# - .global _060_real_snan -_060_real_snan: - fsave sp@- - movew #0x6000,sp@(0x2) - frestore sp@+ - jmp _fpfault - -# -# _060_real_dz(): -# -# This is the exit point for the 060FPSP when an enabled divide-by-zero exception -# is present. The routine below should point to the operating system handler -# for enabled divide-by-zero exceptions. The exception stack frame is a divide-by-zero -# stack frame. The FP state frame holds the source operand of the faulting -# instruction. -# -# The sample routine below simply clears the exception status bit and -# does an "rte". -# - .global _060_real_dz -_060_real_dz: - fsave sp@- - movew #0x6000,sp@(0x2) - frestore sp@+ - jmp _fpfault - -# -# _060_real_inex(): -# -# This is the exit point for the 060FPSP when an enabled inexact exception -# is present. The routine below should point to the operating system handler -# for enabled inexact exceptions. The exception stack frame is an inexact -# stack frame. The FP state frame holds the source operand of the faulting -# instruction. -# -# The sample routine below simply clears the exception status bit and -# does an "rte". -# - .global _060_real_inex -_060_real_inex: - fsave sp@- - movew #0x6000,sp@(0x2) - frestore sp@+ - jmp _fpfault - -# -# _060_real_bsun(): -# -# This is the exit point for the 060FPSP when an enabled bsun exception -# is present. The routine below should point to the operating system handler -# for enabled bsun exceptions. The exception stack frame is a bsun -# stack frame. -# -# The sample routine below clears the exception status bit, clears the NaN -# bit in the FPSR, and does an "rte". The instruction that caused the -# bsun will now be re-executed but with the NaN FPSR bit cleared. -# - .global _060_real_bsun -_060_real_bsun: - fsave sp@- - - fmovel fpsr,sp@- - andib #0xfe,sp@ - fmovel sp@+,fpsr - - addl #0xc,sp - jmp _fpfault - -# -# _060_real_fline(): -# -# This is the exit point for the 060FPSP when an F-Line Illegal exception is -# encountered. Three different types of exceptions can enter the F-Line exception -# vector number 11: FP Unimplemented Instructions, FP implemented instructions when -# the FPU is disabled, and F-Line Illegal instructions. The 060FPSP module -# _fpsp_fline() distinguishes between the three and acts appropriately. F-Line -# Illegals branch here. -# - .global _060_real_fline -_060_real_fline: - jmp _fpfault - -# -# _060_real_fpu_disabled(): -# -# This is the exit point for the 060FPSP when an FPU disabled exception is -# encountered. Three different types of exceptions can enter the F-Line exception -# vector number 11: FP Unimplemented Instructions, FP implemented instructions when -# the FPU is disabled, and F-Line Illegal instructions. The 060FPSP module -# _fpsp_fline() distinguishes between the three and acts appropriately. FPU disabled -# exceptions branch here. -# -# The sample code below enables the FPU, sets the PC field in the exception stack -# frame to the PC of the instruction causing the exception, and does an "rte". -# The execution of the instruction then proceeds with an enabled floating-point -# unit. -# - .global _060_real_fpu_disabled -_060_real_fpu_disabled: - movel d0,sp@- |# enabled the fpu +/* + * _060_real_ovfl(): + * + * This is the exit point for the 060FPSP when an enabled overflow exception + * is present. The routine below should point to the operating system handler + * for enabled overflow conditions. The exception stack frame is an overflow + * stack frame. The FP state frame holds the EXCEPTIONAL OPERAND. + * + * The sample routine below simply clears the exception status bit and + * does an "rte". + */ +ASENTRY_NOPROFILE(_060_real_ovfl) + fsave %sp@- + movew #0x6000,%sp@(0x2) + frestore %sp@+ + jmp _C_LABEL(fpfault) + +/* + * _060_real_unfl(): + * + * This is the exit point for the 060FPSP when an enabled underflow exception + * is present. The routine below should point to the operating system handler + * for enabled underflow conditions. The exception stack frame is an underflow + * stack frame. The FP state frame holds the EXCEPTIONAL OPERAND. + * + * The sample routine below simply clears the exception status bit and + * does an "rte". + */ +ASENTRY_NOPROFILE(_060_real_unfl) + fsave %sp@- + movew #0x6000,%sp@(0x2) + frestore %sp@+ + jmp _C_LABEL(fpfault) + +/* + * _060_real_operr(): + * + * This is the exit point for the 060FPSP when an enabled operand error exception + * is present. The routine below should point to the operating system handler + * for enabled operand error exceptions. The exception stack frame is an operand error + * stack frame. The FP state frame holds the source operand of the faulting + * instruction. + * + * The sample routine below simply clears the exception status bit and + * does an "rte". + */ +ASENTRY_NOPROFILE(_060_real_operr) + fsave %sp@- + movew #0x6000,%sp@(0x2) + frestore %sp@+ + jmp _C_LABEL(fpfault) + +/* + * _060_real_snan(): + * + * This is the exit point for the 060FPSP when an enabled signalling NaN exception + * is present. The routine below should point to the operating system handler + * for enabled signalling NaN exceptions. The exception stack frame is a signalling NaN + * stack frame. The FP state frame holds the source operand of the faulting + * instruction. + * + * The sample routine below simply clears the exception status bit and + * does an "rte". + */ +ASENTRY_NOPROFILE(_060_real_snan) + fsave %sp@- + movew #0x6000,%sp@(0x2) + frestore %sp@+ + jmp _C_LABEL(fpfault) + +/* + * _060_real_dz(): + * + * This is the exit point for the 060FPSP when an enabled divide-by-zero exception + * is present. The routine below should point to the operating system handler + * for enabled divide-by-zero exceptions. The exception stack frame is a divide-by-zero + * stack frame. The FP state frame holds the source operand of the faulting + * instruction. + * + * The sample routine below simply clears the exception status bit and + * does an "rte". + */ +ASENTRY_NOPROFILE(_060_real_dz) + fsave %sp@- + movew #0x6000,%sp@(0x2) + frestore %sp@+ + jmp _C_LABEL(fpfault) + +/* + * _060_real_inex(): + * + * This is the exit point for the 060FPSP when an enabled inexact exception + * is present. The routine below should point to the operating system handler + * for enabled inexact exceptions. The exception stack frame is an inexact + * stack frame. The FP state frame holds the source operand of the faulting + * instruction. + * + * The sample routine below simply clears the exception status bit and + * does an "rte". + */ +ASENTRY_NOPROFILE(_060_real_inex) + fsave %sp@- + movew #0x6000,%sp@(0x2) + frestore %sp@+ + jmp _C_LABEL(fpfault) + +/* + * _060_real_bsun(): + * + * This is the exit point for the 060FPSP when an enabled bsun exception + * is present. The routine below should point to the operating system handler + * for enabled bsun exceptions. The exception stack frame is a bsun + * stack frame. + * + * The sample routine below clears the exception status bit, clears the NaN + * bit in the FPSR, and does an "rte". The instruction that caused the + * bsun will now be re-executed but with the NaN FPSR bit cleared. + */ +ASENTRY_NOPROFILE(_060_real_bsun) + fsave %sp@- + + fmovel %fpsr,%sp@- + andib #0xfe,%sp@ + fmovel %sp@+,%fpsr + + addl #0xc,%sp + jmp _C_LABEL(fpfault) + +/* + * _060_real_fline(): + * + * This is the exit point for the 060FPSP when an F-Line Illegal exception is + * encountered. Three different types of exceptions can enter the F-Line exception + * vector number 11: FP Unimplemented Instructions, FP implemented instructions when + * the FPU is disabled, and F-Line Illegal instructions. The 060FPSP module + * _fpsp_fline() distinguishes between the three and acts appropriately. F-Line + * Illegals branch here. + */ +ASENTRY_NOPROFILE(_060_real_fline) + jmp _C_LABEL(fpfault) + +/* + * _060_real_fpu_disabled(): + * + * This is the exit point for the 060FPSP when an FPU disabled exception is + * encountered. Three different types of exceptions can enter the F-Line exception + * vector number 11: FP Unimplemented Instructions, FP implemented instructions when + * the FPU is disabled, and F-Line Illegal instructions. The 060FPSP module + * _fpsp_fline() distinguishes between the three and acts appropriately. FPU disabled + * exceptions branch here. + * + * The sample code below enables the FPU, sets the PC field in the exception stack + * frame to the PC of the instruction causing the exception, and does an "rte". + * The execution of the instruction then proceeds with an enabled floating-point + * unit. + */ +ASENTRY_NOPROFILE(_060_real_fpu_disabled) + movel %d0,%sp@- |# enabled the fpu .short 0x4e7a,0x0808 |* movec.l pcr,d0 - bclr #0x1,d0 + bclr #0x1,%d0 .short 0x4e7b,0x0808 |* movec.l d0,pcr - movel sp@+,d0 + movel %sp@+,%d0 - movel sp@(0xc),sp@(0x2) |# set "Current PC" + movel %sp@(0xc),%sp@(0x2) |# set "Current PC" rte -# -# _060_real_trap(): -# -# This is the exit point for the 060FPSP when an emulated "ftrapcc" instruction -# discovers that the trap condition is true and it should branch to the operating -# system handler for the trap exception vector number 7. -# -# The sample code below simply executes an "rte". -# - .global _060_real_trap -_060_real_trap: +/* + * _060_real_trap(): + * + * This is the exit point for the 060FPSP when an emulated "ftrapcc" instruction + * discovers that the trap condition is true and it should branch to the operating + * system handler for the trap exception vector number 7. + * + * The sample code below simply executes an "rte". + */ +ASENTRY_NOPROFILE(_060_real_trap) rte -############################################################################# +/*****************************************************************************/ -################################## -# (2) EXAMPLE PACKAGE ENTRY CODE # -################################## +/********************************** + * (2) EXAMPLE PACKAGE ENTRY CODE * + **********************************/ - .global _060_fpsp_snan -_060_fpsp_snan: - bral _FP_CALL_TOP+0x80+0x00 +ASENTRY_NOPROFILE(_060_fpsp_snan) + bral _C_LABEL(FP_CALL_TOP)+0x80+0x00 - .global _060_fpsp_operr -_060_fpsp_operr: - bral _FP_CALL_TOP+0x80+0x08 +ASENTRY_NOPROFILE(_060_fpsp_operr) + bral _C_LABEL(FP_CALL_TOP)+0x80+0x08 - .global _060_fpsp_ovfl -_060_fpsp_ovfl: - bral _FP_CALL_TOP+0x80+0x10 +ASENTRY_NOPROFILE(_060_fpsp_ovfl) + bral _C_LABEL(FP_CALL_TOP)+0x80+0x10 - .global _060_fpsp_unfl -_060_fpsp_unfl: - bral _FP_CALL_TOP+0x80+0x18 +ASENTRY_NOPROFILE(_060_fpsp_unfl) + bral _C_LABEL(FP_CALL_TOP)+0x80+0x18 - .global _060_fpsp_dz -_060_fpsp_dz: - bral _FP_CALL_TOP+0x80+0x20 +ASENTRY_NOPROFILE(_060_fpsp_dz) + bral _C_LABEL(FP_CALL_TOP)+0x80+0x20 - .global _060_fpsp_inex -_060_fpsp_inex: - bral _FP_CALL_TOP+0x80+0x28 +ASENTRY_NOPROFILE(_060_fpsp_inex) + bral _C_LABEL(FP_CALL_TOP)+0x80+0x28 - .global _060_fpsp_fline -_060_fpsp_fline: - bral _FP_CALL_TOP+0x80+0x30 +ASENTRY_NOPROFILE(_060_fpsp_fline) + bral _C_LABEL(FP_CALL_TOP)+0x80+0x30 - .global _060_fpsp_unsupp -_060_fpsp_unsupp: - bral _FP_CALL_TOP+0x80+0x38 +ASENTRY_NOPROFILE(_060_fpsp_unsupp) + bral _C_LABEL(FP_CALL_TOP)+0x80+0x38 - .global _060_fpsp_effadd -_060_fpsp_effadd: - bral _FP_CALL_TOP+0x80+0x40 +ASENTRY_NOPROFILE(_060_fpsp_effadd) + bral _C_LABEL(FP_CALL_TOP)+0x80+0x40 -############################################################################# +/*****************************************************************************/ -################################ -# (3) EXAMPLE CALL-OUT SECTION # -################################ +/******************************** + * (3) EXAMPLE CALL-OUT SECTION * + ********************************/ -# The size of this section MUST be 128 bytes!!! +/* + * The size of this section MUST be 128 bytes!!! + */ - .global _FP_CALL_TOP -_FP_CALL_TOP: - .long _060_real_bsun-_FP_CALL_TOP - .long _060_real_snan-_FP_CALL_TOP - .long _060_real_operr-_FP_CALL_TOP - .long _060_real_ovfl-_FP_CALL_TOP - .long _060_real_unfl-_FP_CALL_TOP - .long _060_real_dz-_FP_CALL_TOP - .long _060_real_inex-_FP_CALL_TOP - .long _060_real_fline-_FP_CALL_TOP - .long _060_real_fpu_disabled-_FP_CALL_TOP - .long _060_real_trap-_FP_CALL_TOP - .long _060_real_trace-_FP_CALL_TOP - .long _060_real_access-_FP_CALL_TOP - .long _060_fpsp_done-_FP_CALL_TOP +GLOBAL(FP_CALL_TOP) + .long _ASM_LABEL(_060_real_bsun)-_C_LABEL(FP_CALL_TOP) + .long _ASM_LABEL(_060_real_snan)-_C_LABEL(FP_CALL_TOP) + .long _ASM_LABEL(_060_real_operr)-_C_LABEL(FP_CALL_TOP) + .long _ASM_LABEL(_060_real_ovfl)-_C_LABEL(FP_CALL_TOP) + .long _ASM_LABEL(_060_real_unfl)-_C_LABEL(FP_CALL_TOP) + .long _ASM_LABEL(_060_real_dz)-_C_LABEL(FP_CALL_TOP) + .long _ASM_LABEL(_060_real_inex)-_C_LABEL(FP_CALL_TOP) + .long _ASM_LABEL(_060_real_fline)-_C_LABEL(FP_CALL_TOP) + .long _ASM_LABEL(_060_real_fpu_disabled)-_C_LABEL(FP_CALL_TOP) + .long _ASM_LABEL(_060_real_trap)-_C_LABEL(FP_CALL_TOP) + .long _ASM_LABEL(_060_real_trace)-_C_LABEL(FP_CALL_TOP) + .long _ASM_LABEL(_060_real_access)-_C_LABEL(FP_CALL_TOP) + .long _ASM_LABEL(_060_fpsp_done)-_C_LABEL(FP_CALL_TOP) .long 0x00000000,0x00000000,0x00000000 - .long _060_imem_read-_FP_CALL_TOP - .long _060_dmem_read-_FP_CALL_TOP - .long _060_dmem_write-_FP_CALL_TOP - .long _060_imem_read_word-_FP_CALL_TOP - .long _060_imem_read_long-_FP_CALL_TOP - .long _060_dmem_read_byte-_FP_CALL_TOP - .long _060_dmem_read_word-_FP_CALL_TOP - .long _060_dmem_read_long-_FP_CALL_TOP - .long _060_dmem_write_byte-_FP_CALL_TOP - .long _060_dmem_write_word-_FP_CALL_TOP - .long _060_dmem_write_long-_FP_CALL_TOP + .long _ASM_LABEL(_060_imem_read)-_C_LABEL(FP_CALL_TOP) + .long _ASM_LABEL(_060_dmem_read)-_C_LABEL(FP_CALL_TOP) + .long _ASM_LABEL(_060_dmem_write)-_C_LABEL(FP_CALL_TOP) + .long _ASM_LABEL(_060_imem_read_word)-_C_LABEL(FP_CALL_TOP) + .long _ASM_LABEL(_060_imem_read_long)-_C_LABEL(FP_CALL_TOP) + .long _ASM_LABEL(_060_dmem_read_byte)-_C_LABEL(FP_CALL_TOP) + .long _ASM_LABEL(_060_dmem_read_word)-_C_LABEL(FP_CALL_TOP) + .long _ASM_LABEL(_060_dmem_read_long)-_C_LABEL(FP_CALL_TOP) + .long _ASM_LABEL(_060_dmem_write_byte)-_C_LABEL(FP_CALL_TOP) + .long _ASM_LABEL(_060_dmem_write_word)-_C_LABEL(FP_CALL_TOP) + .long _ASM_LABEL(_060_dmem_write_long)-_C_LABEL(FP_CALL_TOP) .long 0x00000000 .long 0x00000000,0x00000000,0x00000000,0x00000000 -############################################################################# +/*****************************************************************************/ -# 060 FPSP KERNEL PACKAGE NEEDS TO GO HERE!!! +/* + * 060 FPSP KERNEL PACKAGE NEEDS TO GO HERE!!! + */ - .include "fpsp.S" +#include "fpsp.S" diff --git a/sys/arch/m68k/060sp/inetbsd.S b/sys/arch/m68k/060sp/inetbsd.S index 1ff14ab9af8..272d8426c4a 100644 --- a/sys/arch/m68k/060sp/inetbsd.S +++ b/sys/arch/m68k/060sp/inetbsd.S @@ -1,292 +1,280 @@ -# -# $OpenBSD: inetbsd.S,v 1.2 1996/05/30 22:14:42 niklas Exp $ -# $NetBSD: inetbsd.S,v 1.2 1996/05/15 21:16:44 is Exp $ -# -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP -# M68000 Hi-Performance Microprocessor Division -# M68060 Software Package Production Release -# -# M68060 Software Package Copyright (C) 1993, 1994, 1995, 1996 Motorola Inc. -# All rights reserved. -# -# THE SOFTWARE is provided on an "AS IS" basis and without warranty. -# To the maximum extent permitted by applicable law, -# MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, -# INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS -# FOR A PARTICULAR PURPOSE and any warranty against infringement with -# regard to the SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF) -# and any accompanying written materials. -# -# To the maximum extent permitted by applicable law, -# IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER -# (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, -# BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) -# ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE. -# -# Motorola assumes no responsibility for the maintenance and support -# of the SOFTWARE. -# -# You are hereby granted a copyright license to use, modify, and distribute the -# SOFTWARE so long as this entire notice is retained without alteration -# in any modified and/or redistributed versions, and that such modified -# versions are clearly identified as such. -# No licenses are granted by implication, estoppel or otherwise under any -# patents or trademarks of Motorola, Inc. -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Derived from: -# iskeleton.s -# -# This file contains: -# (1) example "Call-out"s -# (2) example package entry code -# (3) example "Call-out" table -# - - -################################# -# (1) EXAMPLE CALL-OUTS # -# # -# _060_isp_done() # -# _060_real_chk() # -# _060_real_divbyzero() # -# # -# _060_real_cas() # -# _060_real_cas2() # -# _060_real_lock_page() # -# _060_real_unlock_page() # -################################# - -# -# _060_isp_done(): -# -# This is and example main exit point for the Unimplemented Integer -# Instruction exception handler. For a normal exit, the -# _isp_unimp() branches to here so that the operating system -# can do any clean-up desired. The stack frame is the -# Unimplemented Integer Instruction stack frame with -# the PC pointing to the instruction following the instruction -# just emulated. -# To simply continue execution at the next instruction, just -# do an "rte". -# - .global _060_isp_done -_060_isp_done: +/* + *$OpenBSD: inetbsd.S,v 1.3 2013/02/02 13:32:05 miod Exp $ + *$NetBSD: inetbsd.S,v 1.2 1996/05/15 21:16:44 is Exp $ + * + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP + *M68000 Hi-Performance Microprocessor Division + *M68060 Software Package Production Release + * + *M68060 Software Package Copyright (C) 1993, 1994, 1995, 1996 Motorola Inc. + *All rights reserved. + * + *THE SOFTWARE is provided on an "AS IS" basis and without warranty. + *To the maximum extent permitted by applicable law, + *MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, + *INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS + *FOR A PARTICULAR PURPOSE and any warranty against infringement with + *regard to the SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF) + *and any accompanying written materials. + * + *To the maximum extent permitted by applicable law, + *IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER + *(INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, + *BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) + *ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE. + * + *Motorola assumes no responsibility for the maintenance and support + *of the SOFTWARE. + * + *You are hereby granted a copyright license to use, modify, and distribute the + *SOFTWARE so long as this entire notice is retained without alteration + *in any modified and/or redistributed versions, and that such modified + *versions are clearly identified as such. + *No licenses are granted by implication, estoppel or otherwise under any + *patents or trademarks of Motorola, Inc. + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + *Derived from: + *iskeleton.s + * + *This file contains: + * (1) example "Call-out"s + * (2) example package entry code + * (3) example "Call-out" table + */ + + +/******************************** + *(1) EXAMPLE CALL-OUTS * + * * + *_060_isp_done() * + *_060_real_chk() * + *_060_real_divbyzero() * + * * + *_060_real_cas() * + *_060_real_cas2() * + *_060_real_lock_page() * + *_060_real_unlock_page() * + ********************************/ + +/* + *_060_isp_done(): + * + *This is and example main exit point for the Unimplemented Integer + *Instruction exception handler. For a normal exit, the + *_isp_unimp() branches to here so that the operating system + *can do any clean-up desired. The stack frame is the + *Unimplemented Integer Instruction stack frame with + *the PC pointing to the instruction following the instruction + *just emulated. + *To simply continue execution at the next instruction, just + *do an "rte". + */ +ASENTRY_NOPROFILE(_060_isp_done) rte -# -# _060_real_chk(): -# -# This is an alternate exit point for the Unimplemented Integer -# Instruction exception handler. If the instruction was a "chk2" -# and the operand was out of bounds, then _isp_unimp() creates -# a CHK exception stack frame from the Unimplemented Integer Instrcution -# stack frame and branches to this routine. -# - .global _060_real_chk -_060_real_chk: - tstb sp@ |# is tracing enabled? +/* + *_060_real_chk(): + * + *This is an alternate exit point for the Unimplemented Integer + *Instruction exception handler. If the instruction was a "chk2" + *and the operand was out of bounds, then _isp_unimp() creates + *a CHK exception stack frame from the Unimplemented Integer Instrcution + *stack frame and branches to this routine. + */ +ASENTRY_NOPROFILE(_060_real_chk) + tstb %sp@ |# is tracing enabled? bpls real_chk_end |# no -# -# CHK FRAME TRACE FRAME -# ***************** ***************** -# * Current PC * * Current PC * -# ***************** ***************** -# * 0x2 * 0x018 * * 0x2 * 0x024 * -# ***************** ***************** -# * Next * * Next * -# * PC * * PC * -# ***************** ***************** -# * SR * * SR * -# ***************** ***************** -# - moveb #0x24,sp@(0x7) |# set trace vecno - bral _060_real_trace +/* + * CHK FRAME TRACE FRAME + * ***************** ***************** + * * Current PC * * Current PC * + * ***************** ***************** + * * 0x2 * 0x018 * * 0x2 * 0x024 * + * ***************** ***************** + * * Next * * Next * + * * PC * * PC * + * ***************** ***************** + * * SR * * SR * + * ***************** ***************** + */ + moveb #0x24,%sp@(0x7) |# set trace vecno + bral _ASM_LABEL(_060_real_trace) real_chk_end: - jmp _chkinst - -# -# _060_real_divbyzero: -# -# This is an alternate exit point for the Unimplemented Integer -# Instruction exception handler isp_unimp(). If the instruction is a 64-bit -# integer divide where the source operand is a zero, then the _isp_unimp() -# creates a Divide-by-zero exception stack frame from the Unimplemented -# Integer Instruction stack frame and branches to this routine. -# -# Remember that a trace exception may be pending. The code below performs -# no action associated with the "chk" exception. If tracing is enabled, -# then it create a Trace exception stack frame from the "chk" exception -# stack frame and branches to the _real_trace() entry point. -# - .global _060_real_divbyzero -_060_real_divbyzero: - tstb sp@ |# is tracing enabled? - bpls real_divbyzero_end |# no - -# -# DIVBYZERO FRAME TRACE FRAME -# ***************** ***************** -# * Current PC * * Current PC * -# ***************** ***************** -# * 0x2 * 0x014 * * 0x2 * 0x024 * -# ***************** ***************** -# * Next * * Next * -# * PC * * PC * -# ***************** ***************** -# * SR * * SR * -# ***************** ***************** -# - moveb #0x24,sp@(0x7) |# set trace vecno - bral _060_real_trace + jmp _C_LABEL(chkinst) + +/* + *_060_real_divbyzero: + * + *This is an alternate exit point for the Unimplemented Integer + *Instruction exception handler isp_unimp(). If the instruction is a 64-bit + *integer divide where the source operand is a zero, then the _isp_unimp() + *creates a Divide-by-zero exception stack frame from the Unimplemented + *Integer Instruction stack frame and branches to this routine. + * + *Remember that a trace exception may be pending. The code below performs + *no action associated with the "chk" exception. If tracing is enabled, + *then it create a Trace exception stack frame from the "chk" exception + *stack frame and branches to the _real_trace() entry point. + */ +ASENTRY_NOPROFILE(_060_real_divbyzero) + tstb %sp@ |# is tracing enabled? + bpls real_divbyzero_end |# no + +/* + * DIVBYZERO FRAME TRACE FRAME + * ***************** ***************** + * * Current PC * * Current PC * + * ***************** ***************** + * * 0x2 * 0x014 * * 0x2 * 0x024 * + * ***************** ***************** + * * Next * * Next * + * * PC * * PC * + * ***************** ***************** + * * SR * * SR * + * ***************** ***************** + */ + moveb #0x24,%sp@(0x7) |# set trace vecno + bral _ASM_LABEL(_060_real_trace) real_divbyzero_end: - jmp _zerodiv - -########################### - -# -# _060_real_cas(): -# -# Entry point for the selected cas emulation code implementation. -# If the implementation provided by the 68060ISP is sufficient, -# then this routine simply re-enters the package through _isp_cas. -# - .global _060_real_cas -_060_real_cas: - bral _I_CALL_TOP+0x80+0x08 - -# -# _060_real_cas2(): -# -# Entry point for the selected cas2 emulation code implementation. -# If the implementation provided by the 68060ISP is sufficient, -# then this routine simply re-enters the package through _isp_cas2. -# - .global _060_real_cas2 -_060_real_cas2: - bral _I_CALL_TOP+0x80+0x10 - -# -# _060_lock_page(): -# -# Entry point for the operating system's routine to "lock" a page -# from being paged out. This routine is needed by the cas/cas2 -# algorithms so that no page faults occur within the "core" code -# region. Note: the routine must lock two pages if the operand -# spans two pages. -# NOTE: THE ROUTINE SHOULD RETURN AN FSLW VALUE IN D0 ON FAILURE -# SO THAT THE 060SP CAN CREATE A PROPER ACCESS ERROR FRAME. -# Arguments: -# a0 = operand address -# d0 = `xxxxxxff -> supervisor| `xxxxxx00 -> user -# d1 = `xxxxxxff -> longword| `xxxxxx00 -> word -# Expected outputs: -# d0 = 0 -> success| non-zero -> failure -# - .global _060_real_lock_page -_060_real_lock_page: - clrl d0 + jmp _C_LABEL(zerodiv) + +/***************************/ + +/* + *_060_real_cas(): + * + *Entry point for the selected cas emulation code implementation. + *If the implementation provided by the 68060ISP is sufficient, + *then this routine simply re-enters the package through _isp_cas. + */ +ASENTRY_NOPROFILE(_060_real_cas) + bral _C_LABEL(I_CALL_TOP)+0x80+0x08 + +/* + *_060_real_cas2(): + * + *Entry point for the selected cas2 emulation code implementation. + *If the implementation provided by the 68060ISP is sufficient, + *then this routine simply re-enters the package through _isp_cas2. + */ +ASENTRY_NOPROFILE(_060_real_cas2) + bral _C_LABEL(I_CALL_TOP)+0x80+0x10 + +/* + *_060_lock_page(): + * + *Entry point for the operating system's routine to "lock" a page + *from being paged out. This routine is needed by the cas/cas2 + *algorithms so that no page faults occur within the "core" code + *region. Note: the routine must lock two pages if the operand + *spans two pages. + *NOTE: THE ROUTINE SHOULD RETURN AN FSLW VALUE IN D0 ON FAILURE + *SO THAT THE 060SP CAN CREATE A PROPER ACCESS ERROR FRAME. + *Arguments: + * a0 = operand address + * d0 = `xxxxxxff -> supervisor| `xxxxxx00 -> user + * d1 = `xxxxxxff -> longword| `xxxxxx00 -> word + *Expected outputs: + * d0 = 0 -> success| non-zero -> failure + */ +ASENTRY_NOPROFILE(_060_real_lock_page) + clrl %d0 rts -# -# _060_unlock_page(): -# -# Entry point for the operating system's routine to "unlock" a -# page that has been "locked" previously with _real_lock_page. -# Note: the routine must unlock two pages if the operand spans -# two pages. -# Arguments: -# a0 = operand address -# d0 = `xxxxxxff -> supervisor| `xxxxxx00 -> user -# d1 = `xxxxxxff -> longword| `xxxxxx00 -> word -# - .global _060_real_unlock_page -_060_real_unlock_page: - clrl d0 +/* + *_060_unlock_page(): + * + *Entry point for the operating system's routine to "unlock" a + *page that has been "locked" previously with _real_lock_page. + *Note: the routine must unlock two pages if the operand spans + *two pages. + *Arguments: + * a0 = operand address + * d0 = `xxxxxxff -> supervisor| `xxxxxx00 -> user + * d1 = `xxxxxxff -> longword| `xxxxxx00 -> word + */ +ASENTRY_NOPROFILE(_060_real_unlock_page) + clrl %d0 rts -############################################################################ +/****************************************************************************/ -################################## -# (2) EXAMPLE PACKAGE ENTRY CODE # -################################## +/********************************* + *(2) EXAMPLE PACKAGE ENTRY CODE * + *********************************/ - .global _060_isp_unimp -_060_isp_unimp: - bral _I_CALL_TOP+0x80+0x00 +ASENTRY_NOPROFILE(_060_isp_unimp) + bral _C_LABEL(I_CALL_TOP)+0x80+0x00 - .global _060_isp_cas -_060_isp_cas: - bral _I_CALL_TOP+0x80+0x08 +ASENTRY_NOPROFILE(_060_isp_cas) + bral _C_LABEL(I_CALL_TOP)+0x80+0x08 - .global _060_isp_cas2 -_060_isp_cas2: - bral _I_CALL_TOP+0x80+0x10 +ASENTRY_NOPROFILE(_060_isp_cas2) + bral _C_LABEL(I_CALL_TOP)+0x80+0x10 - .global _060_isp_cas_finish -_060_isp_cas_finish: - bral _I_CALL_TOP+0x80+0x18 +ASENTRY_NOPROFILE(_060_isp_cas_finish) + bral _C_LABEL(I_CALL_TOP)+0x80+0x18 - .global _060_isp_cas2_finish -_060_isp_cas2_finish: - bral _I_CALL_TOP+0x80+0x20 +ASENTRY_NOPROFILE(_060_isp_cas2_finish) + bral _C_LABEL(I_CALL_TOP)+0x80+0x20 - .global _060_isp_cas_inrange -_060_isp_cas_inrange: - bral _I_CALL_TOP+0x80+0x28 +ASENTRY_NOPROFILE(_060_isp_cas_inrange) + bral _C_LABEL(I_CALL_TOP)+0x80+0x28 - .global _060_isp_cas_terminate -_060_isp_cas_terminate: - bral _I_CALL_TOP+0x80+0x30 +ASENTRY_NOPROFILE(_060_isp_cas_terminate) + bral _C_LABEL(I_CALL_TOP)+0x80+0x30 - .global _060_isp_cas_restart -_060_isp_cas_restart: - bral _I_CALL_TOP+0x80+0x38 +ASENTRY_NOPROFILE(_060_isp_cas_restart) + bral _C_LABEL(I_CALL_TOP)+0x80+0x38 -############################################################################ +/****************************************************************************/ -################################ -# (3) EXAMPLE CALL-OUT SECTION # -################################ +/******************************* + *(3) EXAMPLE CALL-OUT SECTION * + *******************************/ -# The size of this section MUST be 128 bytes!!! +/* + *The size of this section MUST be 128 bytes!!! + */ - .global _I_CALL_TOP -_I_CALL_TOP: - .long _060_real_chk-_I_CALL_TOP - .long _060_real_divbyzero-_I_CALL_TOP - .long _060_real_trace-_I_CALL_TOP - .long _060_real_access-_I_CALL_TOP - .long _060_isp_done-_I_CALL_TOP +GLOBAL(I_CALL_TOP) + .long _ASM_LABEL(_060_real_chk)-_C_LABEL(I_CALL_TOP) + .long _ASM_LABEL(_060_real_divbyzero)-_C_LABEL(I_CALL_TOP) + .long _ASM_LABEL(_060_real_trace)-_C_LABEL(I_CALL_TOP) + .long _ASM_LABEL(_060_real_access)-_C_LABEL(I_CALL_TOP) + .long _ASM_LABEL(_060_isp_done)-_C_LABEL(I_CALL_TOP) - .long _060_real_cas-_I_CALL_TOP - .long _060_real_cas2-_I_CALL_TOP - .long _060_real_lock_page-_I_CALL_TOP - .long _060_real_unlock_page-_I_CALL_TOP + .long _ASM_LABEL(_060_real_cas)-_C_LABEL(I_CALL_TOP) + .long _ASM_LABEL(_060_real_cas2)-_C_LABEL(I_CALL_TOP) + .long _ASM_LABEL(_060_real_lock_page)-_C_LABEL(I_CALL_TOP) + .long _ASM_LABEL(_060_real_unlock_page)-_C_LABEL(I_CALL_TOP) .long 0x00000000,0x00000000,0x00000000,0x00000000 .long 0x00000000,0x00000000,0x00000000 - .long _060_imem_read-_I_CALL_TOP - .long _060_dmem_read-_I_CALL_TOP - .long _060_dmem_write-_I_CALL_TOP - .long _060_imem_read_word-_I_CALL_TOP - .long _060_imem_read_long-_I_CALL_TOP - .long _060_dmem_read_byte-_I_CALL_TOP - .long _060_dmem_read_word-_I_CALL_TOP - .long _060_dmem_read_long-_I_CALL_TOP - .long _060_dmem_write_byte-_I_CALL_TOP - .long _060_dmem_write_word-_I_CALL_TOP - .long _060_dmem_write_long-_I_CALL_TOP + .long _ASM_LABEL(_060_imem_read)-_C_LABEL(I_CALL_TOP) + .long _ASM_LABEL(_060_dmem_read)-_C_LABEL(I_CALL_TOP) + .long _ASM_LABEL(_060_dmem_write)-_C_LABEL(I_CALL_TOP) + .long _ASM_LABEL(_060_imem_read_word)-_C_LABEL(I_CALL_TOP) + .long _ASM_LABEL(_060_imem_read_long)-_C_LABEL(I_CALL_TOP) + .long _ASM_LABEL(_060_dmem_read_byte)-_C_LABEL(I_CALL_TOP) + .long _ASM_LABEL(_060_dmem_read_word)-_C_LABEL(I_CALL_TOP) + .long _ASM_LABEL(_060_dmem_read_long)-_C_LABEL(I_CALL_TOP) + .long _ASM_LABEL(_060_dmem_write_byte)-_C_LABEL(I_CALL_TOP) + .long _ASM_LABEL(_060_dmem_write_word)-_C_LABEL(I_CALL_TOP) + .long _ASM_LABEL(_060_dmem_write_long)-_C_LABEL(I_CALL_TOP) .long 0x00000000 .long 0x00000000,0x00000000,0x00000000,0x00000000 -############################################################################ +/****************************************************************************/ -# 060 INTEGER KERNEL PACKAGE MUST GO HERE!!! +/* + *060 INTEGER KERNEL PACKAGE MUST GO HERE!!! + */ - .include "isp.S" +#include "isp.S" diff --git a/sys/arch/m68k/060sp/netbsd.S b/sys/arch/m68k/060sp/netbsd.S index fe9e15449f1..6a86914c92e 100644 --- a/sys/arch/m68k/060sp/netbsd.S +++ b/sys/arch/m68k/060sp/netbsd.S @@ -1,377 +1,365 @@ -# -# $OpenBSD: netbsd.S,v 1.3 1997/07/06 07:46:19 downsj Exp $ -# $NetBSD: netbsd.S,v 1.3 1997/06/27 23:32:09 is Exp $ -# -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP -# M68000 Hi-Performance Microprocessor Division -# M68060 Software Package Production Release -# -# M68060 Software Package Copyright (C) 1993, 1994, 1995, 1996 Motorola Inc. -# All rights reserved. -# -# THE SOFTWARE is provided on an "AS IS" basis and without warranty. -# To the maximum extent permitted by applicable law, -# MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, -# INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS -# FOR A PARTICULAR PURPOSE and any warranty against infringement with -# regard to the SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF) -# and any accompanying written materials. -# -# To the maximum extent permitted by applicable law, -# IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER -# (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, -# BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) -# ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE. -# -# Motorola assumes no responsibility for the maintenance and support -# of the SOFTWARE. -# -# You are hereby granted a copyright license to use, modify, and distribute the -# SOFTWARE so long as this entire notice is retained without alteration -# in any modified and/or redistributed versions, and that such modified -# versions are clearly identified as such. -# No licenses are granted by implication, estoppel or otherwise under any -# patents or trademarks of Motorola, Inc. -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Derived from: -# os.s -# -# This file contains: -# - example "Call-Out"s required by both the ISP and FPSP. -# +/* + * $OpenBSD: netbsd.S,v 1.4 2013/02/02 13:32:05 miod Exp $ + * $NetBSD: netbsd.S,v 1.3 1997/06/27 23:32:09 is Exp $ + * + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP + * M68000 Hi-Performance Microprocessor Division + * M68060 Software Package Production Release + * + * M68060 Software Package Copyright (C) 1993, 1994, 1995, 1996 Motorola Inc. + * All rights reserved. + * + * THE SOFTWARE is provided on an "AS IS" basis and without warranty. + * To the maximum extent permitted by applicable law, + * MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, + * INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS + * FOR A PARTICULAR PURPOSE and any warranty against infringement with + * regard to the SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF) + * and any accompanying written materials. + * + * To the maximum extent permitted by applicable law, + * IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER + * (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, + * BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) + * ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE. + * + * Motorola assumes no responsibility for the maintenance and support + * of the SOFTWARE. + * + * You are hereby granted a copyright license to use, modify, and distribute the + * SOFTWARE so long as this entire notice is retained without alteration + * in any modified and/or redistributed versions, and that such modified + * versions are clearly identified as such. + * No licenses are granted by implication, estoppel or otherwise under any + * patents or trademarks of Motorola, Inc. + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * Derived from: + * os.s + * + * This file contains: + * - example "Call-Out"s required by both the ISP and FPSP. + */ -# -# make the copyright notice appear in the binary: -# - .include "copyright.S" +#include <machine/asm.h> -################################# -# EXAMPLE CALL-OUTS # -# # -# _060_dmem_write() # -# _060_dmem_read() # -# _060_imem_read() # -# _060_dmem_read_byte() # -# _060_dmem_read_word() # -# _060_dmem_read_long() # -# _060_imem_read_word() # -# _060_imem_read_long() # -# _060_dmem_write_byte() # -# _060_dmem_write_word() # -# _060_dmem_write_long() # -# # -# _060_real_trace() # -# _060_real_access() # -################################# +/* + * make the copyright notice appear in the binary: + */ +#include "copyright.S" -# -# Each IO routine checks to see if the memory write/read is to/from user -# or supervisor application space. The examples below use simple "move" -# instructions for supervisor mode applications and call _copyin()/_copyout() -# for user mode applications. -# When installing the 060SP, the _copyin()/_copyout() equivalents for a -# given operating system should be substituted. -# -# The addresses within the 060SP are guaranteed to be on the stack. -# The result is that Unix processes are allowed to sleep as a consequence -# of a page fault during a _copyout. -# +/******************************** + * EXAMPLE CALL-OUTS * + * * + * _060_dmem_write() * + * _060_dmem_read() * + * _060_imem_read() * + * _060_dmem_read_byte() * + * _060_dmem_read_word() * + * _060_dmem_read_long() * + * _060_imem_read_word() * + * _060_imem_read_long() * + * _060_dmem_write_byte() * + * _060_dmem_write_word() * + * _060_dmem_write_long() * + * * + * _060_real_trace() * + * _060_real_access() * + ********************************/ -# -# _060_dmem_write(): -# -# Writes to data memory while in supervisor mode. -# -# INPUTS: -# a0 - supervisor source address -# a1 - user destination address -# d0 - number of bytes to write -# a6@(0x4),bit5 - 1 = supervisor mode, 0 = user mode -# OUTPUTS: -# d1 - 0 = success, !0 = failure -# - .global _060_dmem_write -_060_dmem_write: - btst #0x5,a6@(0x4) |# check for supervisor state +/* + * Each IO routine checks to see if the memory write/read is to/from user + * or supervisor application space. The examples below use simple "move" + * instructions for supervisor mode applications and call _copyin()/_copyout() + * for user mode applications. + * When installing the 060SP, the _copyin()/_copyout() equivalents for a + * given operating system should be substituted. + * + * The addresses within the 060SP are guaranteed to be on the stack. + * The result is that Unix processes are allowed to sleep as a consequence + * of a page fault during a _copyout. + */ + +/* + * _060_dmem_write(): + * + * Writes to data memory while in supervisor mode. + * + * INPUTS: + * a0 - supervisor source address + * a1 - user destination address + * d0 - number of bytes to write + * a6@(0x4),bit5 - 1 = supervisor mode, 0 = user mode + * OUTPUTS: + * d1 - 0 = success, !0 = failure + */ +ASENTRY_NOPROFILE(_060_dmem_write) + btst #0x5,%a6@(0x4) |# check for supervisor state beqs user_write super_write: - moveb a0@+,a1@+ |# copy 1 byte - subql #0x1,d0 |# decr byte counter + moveb %a0@+,%a1@+ |# copy 1 byte + subql #0x1,%d0 |# decr byte counter bnes super_write |# quit if ctr = 0 - clrl d1 |# return success + clrl %d1 |# return success rts user_write: - movel d0,sp@- |# pass: counter - movel a1,sp@- |# pass: user dst - movel a0,sp@- |# pass: supervisor src - bsrl _copyout |# write byte to user mem - movel d0,d1 |# return success - addl #0xc,sp |# clear 3 lw params + movel %d0,%sp@- |# pass: counter + movel %a1,%sp@- |# pass: user dst + movel %a0,%sp@- |# pass: supervisor src + bsrl _C_LABEL(copyout) |# write byte to user mem + movel %d0,%d1 |# return success + addl #0xc,%sp |# clear 3 lw params rts -# -# _060_imem_read(), _060_dmem_read(): -# -# Reads from data/instruction memory while in supervisor mode. -# -# INPUTS: -# a0 - user source address -# a1 - supervisor destination address -# d0 - number of bytes to read -# a6@(0x4),bit5 - 1 = supervisor mode, 0 = user mode -# OUTPUTS: -# d1 - 0 = success, !0 = failure -# - .global _060_imem_read - .global _060_dmem_read -_060_imem_read: -_060_dmem_read: - btst #0x5,a6@(0x4) |# check for supervisor state +/* + * _060_imem_read(), _060_dmem_read(): + * + * Reads from data/instruction memory while in supervisor mode. + * + * INPUTS: + * a0 - user source address + * a1 - supervisor destination address + * d0 - number of bytes to read + * a6@(0x4),bit5 - 1 = supervisor mode, 0 = user mode + * OUTPUTS: + * d1 - 0 = success, !0 = failure + */ +ASENTRY_NOPROFILE(_060_imem_read) +ASENTRY_NOPROFILE(_060_dmem_read) + btst #0x5,%a6@(0x4) |# check for supervisor state beqs user_read super_read: - moveb a0@+,a1@+ |# copy 1 byte - subql #0x1,d0 |# decr byte counter + moveb %a0@+,%a1@+ |# copy 1 byte + subql #0x1,%d0 |# decr byte counter bnes super_read |# quit if ctr = 0 - clrl d1 |# return success + clrl %d1 |# return success rts user_read: - movel d0,sp@- |# pass: counter - movel a1,sp@- |# pass: super dst - movel a0,sp@- |# pass: user src - bsrl _copyin |# read byte from user mem - movel d0,d1 |# return success - addl #0xc,sp |# clear 3 lw params + movel %d0,%sp@- |# pass: counter + movel %a1,%sp@- |# pass: super dst + movel %a0,%sp@- |# pass: user src + bsrl _C_LABEL(copyin) |# read byte from user mem + movel %d0,%d1 |# return success + addl #0xc,%sp |# clear 3 lw params rts -# -# _060_dmem_read_byte(): -# -# Read a data byte from user memory. -# -# INPUTS: -# a0 - user source address -# a6@(0x4),bit5 - 1 = supervisor mode, 0 = user mode -# OUTPUTS: -# d0 - data byte in d0 -# d1 - 0 = success, !0 = failure -# - .global _060_dmem_read_byte -_060_dmem_read_byte: - btst #0x5,a6@(0x4) |# check for supervisor state +/* + * _060_dmem_read_byte(): + * + * Read a data byte from user memory. + * + * INPUTS: + * a0 - user source address + * a6@(0x4),bit5 - 1 = supervisor mode, 0 = user mode + * OUTPUTS: + * d0 - data byte in d0 + * d1 - 0 = success, !0 = failure + */ +ASENTRY_NOPROFILE(_060_dmem_read_byte) + btst #0x5,%a6@(0x4) |# check for supervisor state bnes dmrbs |# supervisor dmrbu: - clrl sp@- |# clear space on stack for result - movel #0x1,sp@- |# pass: # bytes to copy - pea sp@(0x7) |# pass: dst addr (stack) - movel a0,sp@- |# pass: src addr (user mem) - bsrl _copyin |# "copy in" the data - movel d0,d1 |# return success - addl #0xc,sp |# delete params - movel sp@+,d0 |# put answer in d0 + clrl %sp@- |# clear space on stack for result + movel #0x1,%sp@- |# pass: # bytes to copy + pea %sp@(0x7) |# pass: dst addr (stack) + movel %a0,%sp@- |# pass: src addr (user mem) + bsrl _C_LABEL(copyin) |# "copy in" the data + movel %d0,%d1 |# return success + addl #0xc,%sp |# delete params + movel %sp@+,%d0 |# put answer in d0 rts dmrbs: - clrl d0 |# clear whole longword - moveb a0@,d0 |# fetch super byte - clrl d1 |# return success + clrl %d0 |# clear whole longword + moveb %a0@,%d0 |# fetch super byte + clrl %d1 |# return success rts -# -# _060_imem_read_word(): -# Read an instruction word from user memory. -# -# _060_dmem_read_word(): -# Read a data word from user memory. -# -# INPUTS: -# a0 - user source address -# a6@(0x4),bit5 - 1 = supervisor mode, 0 = user mode -# OUTPUTS: -# d0 - data word in d0 -# d1 - 0 = success, !0 = failure -# - .global _060_imem_read_word - .global _060_dmem_read_word +/* + * _060_imem_read_word(): + * Read an instruction word from user memory. + * + * _060_dmem_read_word(): + * Read a data word from user memory. + * + * INPUTS: + * a0 - user source address + * a6@(0x4),bit5 - 1 = supervisor mode, 0 = user mode + * OUTPUTS: + * d0 - data word in d0 + * d1 - 0 = success, !0 = failure + */ -_060_imem_read_word: -_060_dmem_read_word: - btst #0x5,a6@(0x4) |# check for supervisor state +ASENTRY_NOPROFILE(_060_imem_read_word) +ASENTRY_NOPROFILE(_060_dmem_read_word) + btst #0x5,%a6@(0x4) |# check for supervisor state bnes dmrws |# supervisor dmrwu: - clrl sp@- |# clear result space on stack - movel #0x2,sp@- |# pass: # bytes to copy - pea sp@(0x6) |# pass: dst addr (stack) - movel a0,sp@- |# pass: src addr (user mem) - bsrl _copyin |# "copy in" the data - movel d0,d1 |# return success - addl #0xc,sp |# delete params - movel sp@+,d0 |# put answer in d0 + clrl %sp@- |# clear result space on stack + movel #0x2,%sp@- |# pass: # bytes to copy + pea %sp@(0x6) |# pass: dst addr (stack) + movel %a0,%sp@- |# pass: src addr (user mem) + bsrl _C_LABEL(copyin) |# "copy in" the data + movel %d0,%d1 |# return success + addl #0xc,%sp |# delete params + movel %sp@+,%d0 |# put answer in d0 rts dmrws: - clrl d0 |# clear whole longword - movew a0@,d0 |# fetch super word - clrl d1 |# return success + clrl %d0 |# clear whole longword + movew %a0@,%d0 |# fetch super word + clrl %d1 |# return success rts -# -# _060_imem_read_long(): -# Read an instruction longword from user memory. -# -# _060_dmem_read_long(): -# Read an data longword from user memory. -# - -# -# INPUTS: -# a0 - user source address -# a6@(0x4),bit5 - 1 = supervisor mode, 0 = user mode -# OUTPUTS: -# d0 - data longword in d0 -# d1 - 0 = success, !0 = failure -# +/* + * _060_imem_read_long(): + * Read an instruction longword from user memory. + * + * _060_dmem_read_long(): + * Read an data longword from user memory. + * - .global _060_dmem_read_long - .global _060_imem_read_long + * + * INPUTS: + * a0 - user source address + * a6@(0x4),bit5 - 1 = supervisor mode, 0 = user mode + * OUTPUTS: + * d0 - data longword in d0 + * d1 - 0 = success, !0 = failure + */ -_060_imem_read_long: -_060_dmem_read_long: - btst #0x5,a6@(0x4) |# check for supervisor state +ASENTRY_NOPROFILE(_060_imem_read_long) +ASENTRY_NOPROFILE(_060_dmem_read_long) + btst #0x5,%a6@(0x4) |# check for supervisor state bnes dmrls |# supervisor dmrlu: - subql #0x4,sp |# clear result space on stack - movel #0x4,sp@- |# pass: # bytes to copy - pea sp@(0x4) |# pass: dst addr (stack) - movel a0,sp@- |# pass: src addr (user mem) - bsrl _copyin |# "copy in" the data - movel d0,d1 |# return success - addl #0xc,sp |# delete params - movel sp@+,d0 |# put answer in d0 + subql #0x4,%sp |# clear result space on stack + movel #0x4,%sp@- |# pass: # bytes to copy + pea %sp@(0x4) |# pass: dst addr (stack) + movel %a0,%sp@- |# pass: src addr (user mem) + bsrl _C_LABEL(copyin) |# "copy in" the data + movel %d0,%d1 |# return success + addl #0xc,%sp |# delete params + movel %sp@+,%d0 |# put answer in d0 rts dmrls: - movel a0@,d0 |# fetch super longword - clrl d1 |# return success + movel %a0@,%d0 |# fetch super longword + clrl %d1 |# return success rts -# -# _060_dmem_write_byte(): -# -# Write a data byte to user memory. -# -# INPUTS: -# a0 - user destination address -# d0 - data byte in d0 -# a6@(0x4),bit5 - 1 = supervisor mode, 0 = user mode -# OUTPUTS: -# d1 - 0 = success, !0 = failure -# - .global _060_dmem_write_byte -_060_dmem_write_byte: - btst #0x5,a6@(0x4) |# check for supervisor state +/* + * _060_dmem_write_byte(): + * + * Write a data byte to user memory. + * + * INPUTS: + * a0 - user destination address + * d0 - data byte in d0 + * a6@(0x4),bit5 - 1 = supervisor mode, 0 = user mode + * OUTPUTS: + * d1 - 0 = success, !0 = failure + */ +ASENTRY_NOPROFILE(_060_dmem_write_byte) + btst #0x5,%a6@(0x4) |# check for supervisor state bnes dmwbs |# supervisor dmwbu: - movel d0,sp@- |# put src on stack - movel #0x1,sp@- |# pass: # bytes to copy - movel a0,sp@- |# pass: dst addr (user mem) - pea sp@(0xb) |# pass: src addr (stack) - bsrl _copyout |# "copy out" the data - movel d0,d1 |# return success - addl #0x10,sp |# delete params + src + movel %d0,%sp@- |# put src on stack + movel #0x1,%sp@- |# pass: # bytes to copy + movel %a0,%sp@- |# pass: dst addr (user mem) + pea %sp@(0xb) |# pass: src addr (stack) + bsrl _C_LABEL(copyout) |# "copy out" the data + movel %d0,%d1 |# return success + addl #0x10,%sp |# delete params + src rts dmwbs: - moveb d0,a0@ |# store super byte - clrl d1 |# return success + moveb %d0,%a0@ |# store super byte + clrl %d1 |# return success rts -# -# _060_dmem_write_word(): -# -# Write a data word to user memory. -# -# INPUTS: -# a0 - user destination address -# d0 - data word in d0 -# a6@(0x4),bit5 - 1 = supervisor mode, 0 = user mode -# OUTPUTS: -# d1 - 0 = success, !0 = failure -# - .global _060_dmem_write_word -_060_dmem_write_word: - btst #0x5,a6@(0x4) |# check for supervisor state +/* + * _060_dmem_write_word(): + * + * Write a data word to user memory. + * + * INPUTS: + * a0 - user destination address + * d0 - data word in d0 + * a6@(0x4),bit5 - 1 = supervisor mode, 0 = user mode + * OUTPUTS: + * d1 - 0 = success, !0 = failure + */ +ASENTRY_NOPROFILE(_060_dmem_write_word) + btst #0x5,%a6@(0x4) |# check for supervisor state bnes dmwws |# supervisor dmwwu: - movel d0,sp@- |# put src on stack - movel #0x2,sp@- |# pass: # bytes to copy - movel a0,sp@- |# pass: dst addr (user mem) - pea sp@(0xa) |# pass: src addr (stack) - bsrl _copyout |# "copy out" the data - movel d0,d1 |# return success - addl #0x10,sp |# delete params + src + movel %d0,%sp@- |# put src on stack + movel #0x2,%sp@- |# pass: # bytes to copy + movel %a0,%sp@- |# pass: dst addr (user mem) + pea %sp@(0xa) |# pass: src addr (stack) + bsrl _C_LABEL(copyout) |# "copy out" the data + movel %d0,%d1 |# return success + addl #0x10,%sp |# delete params + src rts dmwws: - movew d0,a0@ |# store super word - clrl d1 |# return success + movew %d0,%a0@ |# store super word + clrl %d1 |# return success rts -# -# _060_dmem_write_long(): -# -# Write a data longword to user memory. -# -# INPUTS: -# a0 - user destination address -# d0 - data longword in d0 -# a6@(0x4),bit5 - 1 = supervisor mode, 0 = user mode -# OUTPUTS: -# d1 - 0 = success, !0 = failure -# - .global _060_dmem_write_long -_060_dmem_write_long: - btst #0x5,a6@(0x4) |# check for supervisor state +/* + * _060_dmem_write_long(): + * + * Write a data longword to user memory. + * + * INPUTS: + * a0 - user destination address + * d0 - data longword in d0 + * a6@(0x4),bit5 - 1 = supervisor mode, 0 = user mode + * OUTPUTS: + * d1 - 0 = success, !0 = failure + */ +ASENTRY_NOPROFILE(_060_dmem_write_long) + btst #0x5,%a6@(0x4) |# check for supervisor state bnes dmwls |# supervisor dmwlu: - movel d0,sp@- |# put src on stack - movel #0x4,sp@- |# pass: # bytes to copy - movel a0,sp@- |# pass: dst addr (user mem) - pea sp@(0x8) |# pass: src addr (stack) - bsrl _copyout |# "copy out" the data - movel d0,d1 |# return success - addl #0x10,sp |# delete params + src + movel %d0,%sp@- |# put src on stack + movel #0x4,%sp@- |# pass: # bytes to copy + movel %a0,%sp@- |# pass: dst addr (user mem) + pea %sp@(0x8) |# pass: src addr (stack) + bsrl _C_LABEL(copyout) |# "copy out" the data + movel %d0,%d1 |# return success + addl #0x10,%sp |# delete params + src rts dmwls: - movel d0,a0@ |# store super longword - clrl d1 |# return success + movel %d0,%a0@ |# store super longword + clrl %d1 |# return success rts -############################################################################ +/*###########################################################################/ -# -# _060_real_trace(): -# -# This is the exit point for the 060FPSP when an instruction is being traced -# and there are no other higher priority exceptions pending for this instruction -# or they have already been processed. -# -# The sample code below simply executes an "rte". -# - .global _060_real_trace,_trace -_060_real_trace: - jra _trace +/* + * _060_real_trace(): + * + * This is the exit point for the 060FPSP when an instruction is being traced + * and there are no other higher priority exceptions pending for this instruction + * or they have already been processed. + * + * The sample code below simply executes an "rte". + */ +ASENTRY_NOPROFILE(_060_real_trace) + jra _C_LABEL(trace) -# -# _060_real_access(): -# -# This is the exit point for the 060FPSP when an access error exception -# is encountered. The routine below should point to the operating system -# handler for access error exceptions. The exception stack frame is an -# 8-word access error frame. -# -# We jump directly to the 68060 buserr handler. -# If we had a sane ld, we could use use that entry point directly... -# - .globl _060_real_access,_buserr60 -_060_real_access: - jra _buserr60 +/* + * _060_real_access(): + * + * This is the exit point for the 060FPSP when an access error exception + * is encountered. The routine below should point to the operating system + * handler for access error exceptions. The exception stack frame is an + * 8-word access error frame. + * + * We jump directly to the 68060 buserr handler. + * If we had a sane ld, we could use use that entry point directly... + */ +ASENTRY_NOPROFILE(_060_real_access) + jra _C_LABEL(buserr60) - .include "inetbsd.S" - .include "fnetbsd.S" +#include "inetbsd.S" +#include "fnetbsd.S" diff --git a/sys/arch/m68k/fpsp/asm2gas b/sys/arch/m68k/fpsp/asm2gas index f47d5ced735..8257fe0eaae 100644 --- a/sys/arch/m68k/fpsp/asm2gas +++ b/sys/arch/m68k/fpsp/asm2gas @@ -1,9 +1,13 @@ #!/bin/sh -# $OpenBSD: asm2gas,v 1.2 1996/05/29 21:05:24 niklas Exp $ -# $NetBSD: asm2gas,v 1.3 1994/10/26 07:48:49 cgd Exp $ +# $OpenBSD: asm2gas,v 1.3 2013/02/02 13:32:05 miod Exp $ +# $NetBSD: asm2gas,v 1.6 2000/12/06 21:31:05 is Exp $ # -# Copyright (c) 1994 Charles Hannum. All rights reserved. +# Copyright (c) 1998 The NetBSD Foundation, Inc. +# All rights reserved. +# +# This code is derived from software contributed to The NetBSD Foundation +# by Charles M. Hannum. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -15,20 +19,23 @@ # documentation and/or other materials provided with the distribution. # 3. All advertising materials mentioning features or use of this software # must display the following acknowledgement: -# This product includes software developed by Charles Hannum. -# 4. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. +# This product includes software developed by the NetBSD +# Foundation, Inc. and its contributors. +# 4. Neither the name of The NetBSD Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. # -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. # # This ugly script converts assembler code from Motorola's format to a @@ -132,33 +139,105 @@ cat $1 | sed -e ' ' | sed -e ' # operand conversion - s/\([^_a-zA-Z0-9]\)FPIAR\([^_a-zA-Z0-9]\)/\1FPI\2/g - s/\([^_a-zA-Z0-9]\)FPIAR\([^_a-zA-Z0-9]\)/\1FPI\2/g - s/\([^_a-zA-Z0-9]\)FPIAR$/\1FPI/g - s/\([^_a-zA-Z0-9]\)fpiar\([^_a-zA-Z0-9]\)/\1fpi\2/g - s/\([^_a-zA-Z0-9]\)fpiar\([^_a-zA-Z0-9]\)/\1fpi\2/g - s/\([^_a-zA-Z0-9]\)fpiar$/\1fpi/g + s/\([^_a-zA-Z0-9]\)FPIAR\([^_a-zA-Z0-9]\)/\1%FPI\2/g + s/\([^_a-zA-Z0-9]\)FPIAR$/\1%FPI/g + s/\([^_a-zA-Z0-9]\)fpiar\([^_a-zA-Z0-9]\)/\1%fpi\2/g + s/\([^_a-zA-Z0-9]\)fpiar$/\1%fpi/g + s/\([^_a-zA-Z0-9]\)FPCR\([^_a-zA-Z0-9]\)/\1%FPCR\2/g + s/\([^_a-zA-Z0-9]\)FPCR$/\1%FPCR/g + s/\([^_a-zA-Z0-9]\)fpcr\([^_a-zA-Z0-9]\)/\1%fpcr\2/g + s/\([^_a-zA-Z0-9]\)fpcr$/\1%fpcr/g + s/\([^_a-zA-Z0-9]\)FPSR\([^_a-zA-Z0-9]\)/\1%FPSR\2/g + s/\([^_a-zA-Z0-9]\)FPSR$/\1%FPSR/g + s/\([^_a-zA-Z0-9]\)fpsr\([^_a-zA-Z0-9]\)/\1%fpsr\2/g + s/\([^_a-zA-Z0-9]\)fpsr$/\1%fpsr/g + ## RCSId + s/\$\(NetBSD.*\)\$/\1/g + s/\$\(OpenBSD.*\)\$/\1/g s/\$/0x/g s/#:/#:0x/g - s/-(\([sSpPaA][pPcC0-7]\))/\1@-/g - s/(\([sSpPaA][pPcC0-7]\))+/\1@+/g - s/\([-+A-Za-z0-9_]*\)(\([sSpPaA][pPcC0-7]\)\([),]\)/\2@(\1\3/g + s/\([^[:alnum:]_]\)\([dDaA][0-7]\)\([^[:alnum:]_]\)/\1%\2\3/g + s/\([^[:alnum:]_]\)\([fF][pP][0-7]\)\([^[:alnum:]_]\)/\1%\2\3/g + s/\([^[:alnum:]_]\)\(sp\)\([^[:alnum:]_]\)/\1%\2\3/g + s/\([^[:alnum:]_]\)\(pc\)\([^[:alnum:]_]\)/\1%\2\3/g + + s/\([^[:alnum:]_]\)\([dDaA][0-7]\)$/\1%\2/g + s/\([^[:alnum:]_]\)\([fF][pP][0-7]\)$/\1%\2/g + s/\([^[:alnum:]_]\)\(sp\)$/\1%\2/g + + s/\(,\)\([dDaA][0-7]\)/\1%\2/g + s/\(,\)\([fF][pP][0-7]\)/\1%\2/g + + s/-(\(%[sSpPaA][pPcC0-7]\))/\1@-/g + s/(\(%[sSpPaA][pPcC0-7]\))+/\1@+/g + s/\([-+A-Za-z0-9_]*\)(\(%[sSpPaA][pPcC0-7]\)\([),]\)/\2@(\1\3/g s/\.\([bBwWlL])\)/:\1/g s/\.\([bBwWlL]\)\*\([0-9][0-9]*)\)/:\1:\2/g s/\*\([0-9][0-9]*\))/:l:\1)/g s/{\([0-9][0-9]*\):\([0-9][0-9]*\)}/{#\1:#\2}/g - s/{\([dD][0-7]\):\([0-9][0-9]*\)}/{\1:#\2}/g + s/{\(%[dD][0-7]\):\([0-9][0-9]*\)}/{\1:#\2}/g + s/{\([dD][0-7]\):\([0-9][0-9]*\)}/{%\1:#\2}/g + s/{\([dD][0-7]\):\(%[dD][0-9]*\)}/{%\1:\2}/g + + s/\(-\)\([dDaA][0-7]\)\([^_a-zA-Z0-9]\)/\1%\2\3/g + s/\(-\)\([fF][pP][0-7]\)\([^_a-zA-Z0-9]\)/\1%\2\3/g + + s/\(\/\)\([dDaA][0-7]\)\([^_a-zA-Z0-9]\)/\1%\2\3/g + s/\(\/\)\([fF][pP][0-7]\)\([^_a-zA-Z0-9]\)/\1%\2\3/g s/@(0*)/@/g s/(,/(/g;s/:)/)/g # make up for a gas bug /^ fmovemx /{ - s/ \([fF][pP][0-7]\),/ \1-\1,/ - s/,\([fF][pP][0-7]\) /,\1-\1 / - s/,\([fF][pP][0-7]\)$/,\1-\1/ + s/ \(%[fF][pP][0-7]\),/ \1-\1,/ + s/,\(%[fF][pP][0-7]\) /,\1-\1 / + s/,\(%[fF][pP][0-7]\)$/,\1-\1/ } + + # symbol name collision with kernel + s/pmod/_fpsp_pmod/g +' | sed -e ' + # Floating point literal conversion + + s/:0x41dfffffffc00000/0r2147483647.0/g + s/:0xc1e0000000000000/0r-2147483648.0/g + s/:0x41dfffffffe00000/0r2147483647.5/g + s/:0xc1e0000000100000/0r-2147483648.5/g + s/:0x46fffe00/0r32767.0/g + s/:0xc7000000/0r-32768.0/g + s/:0x46ffff00/0r32767.5/g + s/:0xc7000080/0r-32768.5/g + s/:0x42fe0000/0r127.0/g + s/:0xc3000000/0r-128.0/g + s/:0x42ff0000/0r127.5/g + s/:0xc3008000/0r-128.5/g + s/:0x3F800000/0r1.0/g + s/:0x00000000/0r0.0/g + s/:0xBF800000/0r-1.0/g + s/:0x3F000000/0r0.5/g + s/:0x3E800000/0r0.25/g + s/:0x42B8AA3B/0r92.332481384277343750/g + s/:0xBC317218/0r-0.0108304247260093688964843750/g + s/:0x3AB60B70/0r0.001388890668749809265136718750/g + s/:0x3C088895/0r0.0083333449438214302062988281250/g + s/:0x42B8AA3B/0r92.332481384277343750/g + s/:0x3950097B/0r0.0001983995753107592463493347167968750/g + s/:0x3AB60B6A/0r0.001388889970257878303527832031250/g + s/:0x2F30CAA8/0r1.60791047143504783889511600136756896972656250e-10/g + s/:0x310F8290/0r2.0883454965314740547910332679748535156250e-09/g + s/:0x32D73220/0r2.5052088403754169121384620666503906250e-08/g + s/:0x3493F281/0r2.755732850800995947793126106262207031250e-07/g + s/:0x40000000/0r2.0/g + s/:0x42800000/0r6.40e+01/g + s/:0x3C800000/0r1.56250e-02/g + s/fadds #:0x00800000,%[fF][pP]0/ .long 0xf23c4422,0x00800000/ + s/fsubs #:0x00800000,%[fF][pP]0/ .long 0xf23c4428,0x00800000/ + s/fsubs #:0x00800000,%[fF][pP]1/ .long 0xf23c44a8,0x00800000/ + s/fmoves #:0x80000000,%[fF][pP]0/ .long 0xf23c4400,0x80000000/ + s/fmoves #:0x00000000,%[fF][pP]0/ .long 0xf23c4400,0x00000000/ + ' diff --git a/sys/arch/m68k/fpsp/bindec.sa b/sys/arch/m68k/fpsp/bindec.sa index 7ef5cb0788a..534b42ce64a 100644 --- a/sys/arch/m68k/fpsp/bindec.sa +++ b/sys/arch/m68k/fpsp/bindec.sa @@ -1,4 +1,4 @@ -* $OpenBSD: bindec.sa,v 1.3 2001/09/20 17:02:30 mpech Exp $ +* $OpenBSD: bindec.sa,v 1.4 2013/02/02 13:32:05 miod Exp $ * $NetBSD: bindec.sa,v 1.3 1994/10/26 07:48:51 cgd Exp $ * MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP @@ -511,11 +511,12 @@ A9_str: fmove.x (a0),fp0 ;load X from memory fabs.x fp0 ;use abs(X) tst.w d5 ;LAMBDA is in lower word of d5 - bne.b sc_mul ;if neg (LAMBDA = 1), scale by mul + bne.b short_sc_mul ;if neg (LAMBDA = 1), scale by mul fdiv.x fp1,fp0 ;calculate X / SCALE -> Y to fp0 bra.b A10_st ;branch to A10 sc_mul: +short_sc_mul: tst.b BINDEC_FLG(a6) ;check for denorm beq.b A9_norm ;if norm, continue with mul fmovem.x fp1,-(a7) ;load ETEMP with 10^ISCALE diff --git a/sys/arch/m68k/fpsp/decbin.sa b/sys/arch/m68k/fpsp/decbin.sa index cbd32d764e2..40b57d6b1e4 100644 --- a/sys/arch/m68k/fpsp/decbin.sa +++ b/sys/arch/m68k/fpsp/decbin.sa @@ -1,4 +1,4 @@ -* $OpenBSD: decbin.sa,v 1.3 2001/09/20 17:02:30 mpech Exp $ +* $OpenBSD: decbin.sa,v 1.4 2013/02/02 13:32:05 miod Exp $ * $NetBSD: decbin.sa,v 1.2 1994/10/26 07:48:59 cgd Exp $ * MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP @@ -256,7 +256,7 @@ nextlw: * m_sign: btst #31,(a0) ;test sign of the mantissa - beq.b ap_st_z ;if clear, go to append/strip zeros + beq.b short_ap_st_z ;if clear, go to append/strip zeros fneg.x fp0 ;if set, negate fp0 * @@ -310,11 +310,12 @@ m_sign: * This section handles a positive adjusted exponent. * ap_st_z: +short_ap_st_z: move.l L_SCR1(a6),d1 ;load expA for range test cmp.l #27,d1 ;test is with 27 ble.w pwrten ;if abs(expA) <28, skip ap/st zeros btst #30,(a0) ;check sign of exp - bne.b ap_st_n ;if neg, go to neg side + bne.b short_ap_st_n ;if neg, go to neg side clr.l d1 ;zero count reg move.l (a0),d4 ;load lword 1 to d4 bfextu d4{28:4},d0 ;get M16 in d0 @@ -362,11 +363,12 @@ ap_p_en: tst.l d0 ;check if d0 is zero bne.b ap_p_el ;if not, get next bit fmul.x fp1,fp0 ;mul mantissa by 10**(no_bits_shifted) - bra.b pwrten ;go calc pwrten + bra.b short_pwrten ;go calc pwrten * * This section handles a negative adjusted exponent. * ap_st_n: +short_ap_st_n: clr.l d1 ;clr counter moveq.l #2,d5 ;set up d5 to point to lword 3 move.l (a0,d5.L*4),d4 ;get lword 3 @@ -455,6 +457,7 @@ ap_n_en: * * pwrten: +short_pwrten: move.l USER_FPCR(a6),d3 ;get user's FPCR bfextu d3{26:2},d2 ;isolate rounding mode bits move.l (a0),d4 ;reload 1st bcd word to d4 diff --git a/sys/arch/m68k/fpsp/do_func.sa b/sys/arch/m68k/fpsp/do_func.sa index 9be93ed0412..4b637c5a8b6 100644 --- a/sys/arch/m68k/fpsp/do_func.sa +++ b/sys/arch/m68k/fpsp/do_func.sa @@ -1,4 +1,4 @@ -* $OpenBSD: do_func.sa,v 1.2 1996/05/29 21:05:27 niklas Exp $ +* $OpenBSD: do_func.sa,v 1.3 2013/02/02 13:32:05 miod Exp $ * $NetBSD: do_func.sa,v 1.2 1994/10/26 07:49:02 cgd Exp $ * MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP @@ -103,7 +103,7 @@ not_fmovecr: move.w CMDREG1B(a6),d0 and.l #$7F,d0 cmpi.l #$38,d0 ;if the extension is >= $38, - bge.b serror ;it is illegal + bge.b short_serror ;it is illegal bfextu STAG(a6){0:3},d1 lsl.l #3,d0 ;make room for STAG add.l d1,d0 ;combine for final index into table @@ -119,6 +119,7 @@ not_fmovecr: * xdef serror serror: +short_serror: st.b STORE_FLG(a6) rts * diff --git a/sys/arch/m68k/fpsp/get_op.sa b/sys/arch/m68k/fpsp/get_op.sa index fba2c01d16f..2c0d50b0757 100644 --- a/sys/arch/m68k/fpsp/get_op.sa +++ b/sys/arch/m68k/fpsp/get_op.sa @@ -1,4 +1,4 @@ -* $OpenBSD: get_op.sa,v 1.2 1996/05/29 21:05:29 niklas Exp $ +* $OpenBSD: get_op.sa,v 1.3 2013/02/02 13:32:05 miod Exp $ * $NetBSD: get_op.sa,v 1.3 1994/10/26 07:49:09 cgd Exp $ * MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP @@ -197,7 +197,7 @@ PTENRP: get_op: clr.b DY_MO_FLG(a6) tst.b UFLG_TMP(a6) ;test flag for unsupp/unimp state - beq.b uni_getop + beq.b short_uni_getop uns_getop: btst.b #direction_bit,CMDREG1B(a6) @@ -219,6 +219,7 @@ uns_notpacked: bra.b dst_ex_dnrm ;else, handle destination unnorm/dnrm uni_getop: +short_uni_getop: bfextu CMDREG1B(a6){0:6},d0 ;get opclass and src fields cmpi.l #$17,d0 ;if op class and size fields are $17, * ;it is FMOVECR; if not, continue diff --git a/sys/arch/m68k/fpsp/netbsd.sa b/sys/arch/m68k/fpsp/netbsd.sa index b473d4b9b2b..1295a25e6ff 100644 --- a/sys/arch/m68k/fpsp/netbsd.sa +++ b/sys/arch/m68k/fpsp/netbsd.sa @@ -1,4 +1,4 @@ -* $OpenBSD: netbsd.sa,v 1.5 2004/01/27 16:16:27 miod Exp $ +* $OpenBSD: netbsd.sa,v 1.6 2013/02/02 13:32:05 miod Exp $ * $NetBSD: netbsd.sa,v 1.3 1997/04/25 02:26:04 thorpej Exp $ * MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP @@ -74,7 +74,7 @@ SKELETON IDNT 2,1 Motorola 040 Floating Point Software Package * * XXX Note, this is NOT valid Motorola syntax, but what else can we do? * -#include "../include/asm.h" +#include <machine/asm.h> xref b1238_fix @@ -128,21 +128,21 @@ inex: addq.l #4,sp frestore (sp)+ unlk a6 - bra fpsp_snan + bra.l fpsp_snan inex_ckofl: btst.b #ovfl_bit,2(sp) ;test for ovfl beq inex_ckufl addq.l #4,sp frestore (sp)+ unlk a6 - bra fpsp_ovfl + bra.l fpsp_ovfl inex_ckufl: btst.b #unfl_bit,2(sp) ;test for unfl beq not_b1232 addq.l #4,sp frestore (sp)+ unlk a6 - bra fpsp_unfl + bra.l fpsp_unfl * * We do not have the bug 1232 case. Clean up the stack and call diff --git a/sys/arch/m68k/fpsp/util.sa b/sys/arch/m68k/fpsp/util.sa index 607ed462610..d7ca7421cf2 100644 --- a/sys/arch/m68k/fpsp/util.sa +++ b/sys/arch/m68k/fpsp/util.sa @@ -1,4 +1,4 @@ -* $OpenBSD: util.sa,v 1.2 1996/05/29 21:05:45 niklas Exp $ +* $OpenBSD: util.sa,v 1.3 2013/02/02 13:32:05 miod Exp $ * $NetBSD: util.sa,v 1.3 1994/10/26 07:50:20 cgd Exp $ * MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP @@ -164,20 +164,20 @@ ovf_e1_exc: * ovf_fsgl: clr.l d0 - bra.b ovf_res + bra.b short_ovf_res ovff_sgl: move.l #$00000001,d0 ;set single - bra.b ovf_res + bra.b short_ovf_res ovff_dbl: move.l #$00000002,d0 ;set double - bra.b ovf_res + bra.b short_ovf_res * * The precision is in the fpcr. * ovf_fpcr: bfextu FPCR_MODE(a6){0:2},d0 ;set round precision - bra.b ovf_res + bra.b short_ovf_res * * @@ -206,6 +206,7 @@ ovf_r_x3: * xdef ovf_res ovf_res: +short_ovf_res: lsl.l #2,d0 ;move round precision to d0{3:2} bfextu FPCR_MODE(a6){2:2},d1 ;set round mode or.l d1,d0 ;index is fmt:mode in d0{3:0} diff --git a/sys/arch/m68k/fpsp/x_store.sa b/sys/arch/m68k/fpsp/x_store.sa index c4f017f6820..8736695fe30 100644 --- a/sys/arch/m68k/fpsp/x_store.sa +++ b/sys/arch/m68k/fpsp/x_store.sa @@ -1,4 +1,4 @@ -* $OpenBSD: x_store.sa,v 1.2 1996/05/29 21:05:49 niklas Exp $ +* $OpenBSD: x_store.sa,v 1.3 2013/02/02 13:32:05 miod Exp $ * $NetBSD: x_store.sa,v 1.3 1994/10/26 07:50:29 cgd Exp $ * MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP @@ -118,7 +118,7 @@ opc011: tst.l d0 ;if dest format is extended beq.w dest_ext ;then branch cmpi.l #1,d0 ;if dest format is single - beq.b dest_sgl ;then branch + beq.b short_dest_sgl ;then branch * * fall through to dest_dbl * @@ -226,6 +226,7 @@ dbl_wrt: * 31 22 0 * dest_sgl: +short_dest_sgl: clr.l d0 move.w LOCAL_EX(a1),d0 ;get exponent sub.w #$3fff,d0 ;subtract extended precision bias diff --git a/sys/arch/m68k/include/asm.h b/sys/arch/m68k/include/asm.h index 640f5b12a95..1290bdf1af0 100644 --- a/sys/arch/m68k/include/asm.h +++ b/sys/arch/m68k/include/asm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asm.h,v 1.9 2011/03/23 16:54:35 pirofti Exp $ */ +/* $OpenBSD: asm.h,v 1.10 2013/02/02 13:32:06 miod Exp $ */ /* $NetBSD: asm.h,v 1.13 1997/04/24 22:49:39 thorpej Exp $ */ /* @@ -42,16 +42,13 @@ #ifndef _M68K_ASM_H_ #define _M68K_ASM_H_ -#ifdef __ELF__ -#define _C_LABEL(name) name -#else -#ifdef __STDC__ -#define _C_LABEL(name) _ ## name +#if defined(PIC) +#define PIC_PLT(name) name@PLTPC #else -#define _C_LABEL(name) _/**/name -#endif /* __STDC__ */ +#define PIC_PLT(name) name #endif +#define _C_LABEL(name) name #define _ASM_LABEL(name) name #ifndef _KERNEL @@ -63,7 +60,7 @@ #endif #ifdef GPROF -#define _PROF_PROLOG link a6,#0; jbsr mcount; unlk a6 +#define _PROF_PROLOG link %a6,#0; jbsr mcount; unlk %a6 #else #define _PROF_PROLOG #endif @@ -97,21 +94,9 @@ .asciz x ; \ .even -#ifdef __ELF__ #define WEAK_ALIAS(alias,sym) \ .weak alias; \ alias = sym -#else -#ifdef __STDC__ -#define WEAK_ALIAS(alias,sym) \ - .weak _##alias; \ - _##alias = _##sym -#else -#define WEAK_ALIAS(alias,sym) \ - .weak _/**/alias; \ - _/**/alias = _/**/sym -#endif -#endif /* * Global variables of whatever sort. diff --git a/sys/arch/m68k/include/cdefs.h b/sys/arch/m68k/include/cdefs.h index 83d16b8a29d..8cfc0ed5f10 100644 --- a/sys/arch/m68k/include/cdefs.h +++ b/sys/arch/m68k/include/cdefs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cdefs.h,v 1.9 2006/01/10 00:04:04 millert Exp $ */ +/* $OpenBSD: cdefs.h,v 1.10 2013/02/02 13:32:06 miod Exp $ */ /* * Written by J.T. Conklin <jtc@wimsey.com> 01/17/95. @@ -13,14 +13,12 @@ #define __warn_references(sym,msg) #define __weak_alias(alias,sym) __lint_equal__(sym,alias) #elif defined(__GNUC__) && defined(__STDC__) -#define __indr_reference(sym,alias) \ - __asm__(".stabs \"_" #alias "\",11,0,0,0"); \ - __asm__(".stabs \"_" #sym "\",1,0,0,0") -#define __warn_references(sym,msg) \ - __asm__(".stabs \"" msg "\",30,0,0,0"); \ - __asm__(".stabs \"_" #sym "\",1,0,0,0") #define __weak_alias(alias,sym) \ - __asm__(".weak _" #alias "; _" #alias "= _" __STRING(sym)) + __asm__(".weak " __STRING(alias) " ; " \ + __STRING(alias) " = " __STRING(sym)) +#define __warn_references(sym,msg) \ + __asm__(".section .gnu.warning." __STRING(sym) \ + " ; .ascii \"" msg "\" ; .text") #endif #endif /* !_M68K_CDEFS_H_ */ diff --git a/sys/arch/m68k/include/db_machdep.h b/sys/arch/m68k/include/db_machdep.h index 250d1cf354c..19d385b4233 100644 --- a/sys/arch/m68k/include/db_machdep.h +++ b/sys/arch/m68k/include/db_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: db_machdep.h,v 1.11 2010/11/27 19:57:23 miod Exp $ */ +/* $OpenBSD: db_machdep.h,v 1.12 2013/02/02 13:32:06 miod Exp $ */ /* $NetBSD: db_machdep.h,v 1.20 1997/06/26 01:26:58 thorpej Exp $ */ /* @@ -102,9 +102,7 @@ int kdb_trap(int, db_regs_t *); #endif /* _KERNEL */ -/* - * We use a.out symbols in DDB. - */ -#define DB_AOUT_SYMBOLS +#define DB_ELF_SYMBOLS +#define DB_ELFSIZE 32 #endif /* _M68K_DB_MACHDEP_H_ */ diff --git a/sys/arch/m68k/include/profile.h b/sys/arch/m68k/include/profile.h index f81db56eb9f..c1e42123f80 100644 --- a/sys/arch/m68k/include/profile.h +++ b/sys/arch/m68k/include/profile.h @@ -1,4 +1,4 @@ -/* $OpenBSD: profile.h,v 1.6 2003/06/02 23:27:48 millert Exp $ */ +/* $OpenBSD: profile.h,v 1.7 2013/02/02 13:32:06 miod Exp $ */ /* $NetBSD: profile.h,v 1.3 1995/03/26 17:08:37 briggs Exp $ */ /* @@ -35,10 +35,10 @@ #define _MCOUNT_DECL static __inline void _mcount #define MCOUNT \ -extern void mcount(void) __asm("mcount"); void mcount() { \ +extern void mcount(void) __asm("__mcount"); void mcount() { \ int selfpc, frompcindex; \ - __asm("movl a6@(4),%0" : "=r" (selfpc)); \ - __asm("movl a6@(0)@(4),%0" : "=r" (frompcindex)); \ + __asm("movl %%a6@(4),%0" : "=r" (selfpc)); \ + __asm("movl %%a6@(0)@(4),%0" : "=r" (frompcindex)); \ _mcount(frompcindex, selfpc); \ } @@ -50,9 +50,9 @@ extern void mcount(void) __asm("mcount"); void mcount() { \ * recursively. */ #define MCOUNT_ENTER \ - __asm("movw sr,%0" : "=g" (s)); \ - __asm("movw #0x2700,sr") + __asm("movw %%sr,%0" : "=g" (s)); \ + __asm("movw #0x2700,%sr") #define MCOUNT_EXIT \ - __asm("movw %0,sr" : : "g" (s)) + __asm("movw %0,%%sr" : : "g" (s)) #endif /* _KERNEL */ diff --git a/sys/arch/m68k/include/psl.h b/sys/arch/m68k/include/psl.h index bf75afae893..8b9d5c42ca6 100644 --- a/sys/arch/m68k/include/psl.h +++ b/sys/arch/m68k/include/psl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: psl.h,v 1.9 2009/03/15 20:40:25 miod Exp $ */ +/* $OpenBSD: psl.h,v 1.10 2013/02/02 13:32:06 miod Exp $ */ /* $NetBSD: psl.h,v 1.5 1994/10/26 07:50:50 cgd Exp $ */ /* @@ -86,7 +86,7 @@ ({ \ register int _spl_r; \ \ - __asm __volatile ("clrl %0; movew sr,%0; movew %1,sr" : \ + __asm __volatile ("clrl %0; movew %%sr,%0; movew %1,%%sr" : \ "=&d" (_spl_r) : "di" (s)); \ _spl_r; \ }) @@ -96,15 +96,15 @@ register int _spl_r; \ \ __asm __volatile (" \ - clrl d0 ; \ - movw sr,d0 ; \ - movl d0,%0 ; \ - andw #0x700,d0 ; \ - movw %1,d1 ; \ - andw #0x700,d1 ; \ - cmpw d0,d1 ; \ + clrl %%d0 ; \ + movw %%sr,%%d0 ; \ + movl %%d0,%0 ; \ + andw #0x700,%%d0 ; \ + movw %1,%%d1 ; \ + andw #0x700,%%d1 ; \ + cmpw %%d0,%%d1 ; \ jle 1f ; \ - movw %1,sr ; \ + movw %1,%%sr ; \ 1:" : \ "=&d" (_spl_r) : \ "di" (s) : \ diff --git a/sys/arch/m68k/include/reloc.h b/sys/arch/m68k/include/reloc.h new file mode 100644 index 00000000000..a718b9a5973 --- /dev/null +++ b/sys/arch/m68k/include/reloc.h @@ -0,0 +1,47 @@ +/* $OpenBSD: reloc.h,v 1.1 2013/02/02 13:32:06 miod Exp $ */ +/* $NetBSD: elf_machdep.h,v 1.8 2009/05/30 05:56:52 skrll Exp $ */ + +/* m68k relocation types */ +#define R_68K_NONE 0 +#define R_68K_32 1 +#define R_68K_16 2 +#define R_68K_8 3 +#define R_68K_PC32 4 +#define R_68K_PC16 5 +#define R_68K_PC8 6 +#define R_68K_GOT32 7 +#define R_68K_GOT16 8 +#define R_68K_GOT8 9 +#define R_68K_GOT32O 10 +#define R_68K_GOT16O 11 +#define R_68K_GOT8O 12 +#define R_68K_PLT32 13 +#define R_68K_PLT16 14 +#define R_68K_PLT8 15 +#define R_68K_PLT32O 16 +#define R_68K_PLT16O 17 +#define R_68K_PLT8O 18 +#define R_68K_COPY 19 +#define R_68K_GLOB_DAT 20 +#define R_68K_JMP_SLOT 21 +#define R_68K_RELATIVE 22 + +/* TLS relocations */ +#define R_68K_TLS_GD32 25 +#define R_68K_TLS_GD16 26 +#define R_68K_TLS_GD8 27 +#define R_68K_TLS_LDM32 28 +#define R_68K_TLS_LDM16 29 +#define R_68K_TLS_LDM8 30 +#define R_68K_TLS_LDO32 31 +#define R_68K_TLS_LDO16 32 +#define R_68K_TLS_LDO8 33 +#define R_68K_TLS_IE32 34 +#define R_68K_TLS_IE16 35 +#define R_68K_TLS_IE8 36 +#define R_68K_TLS_LE32 37 +#define R_68K_TLS_LE16 38 +#define R_68K_TLS_LE8 39 +#define R_68K_TLS_DTPMOD32 40 +#define R_68K_TLS_DTPREL32 41 +#define R_68K_TLS_TPREL32 42 diff --git a/sys/arch/m68k/m68k/bcopy.s b/sys/arch/m68k/m68k/bcopy.s index b4ba2ea6c86..2fdd0bb6ff5 100644 --- a/sys/arch/m68k/m68k/bcopy.s +++ b/sys/arch/m68k/m68k/bcopy.s @@ -1,4 +1,4 @@ -/* $OpenBSD: bcopy.s,v 1.3 2007/11/24 20:58:26 deraadt Exp $ */ +/* $OpenBSD: bcopy.s,v 1.4 2013/02/02 13:32:06 miod Exp $ */ /* $NetBSD: bcopy.s,v 1.1 1997/03/17 19:44:33 gwr Exp $ */ /*- @@ -52,71 +52,71 @@ */ ALTENTRY(memmove, memcpy) ENTRY(memcpy) - movl sp@(12),d0 | get count + movl %sp@(12),%d0 | get count jeq Lbccpyexit | if zero, return - movl sp@(8), a0 | src address - movl sp@(4), a1 | dest address + movl %sp@(8), %a0 | src address + movl %sp@(4), %a1 | dest address jra Lbcdocopy | jump into bcopy ALTENTRY(ovbcopy, bcopy) ENTRY(bcopy) - movl sp@(12),d0 | get count + movl %sp@(12),%d0 | get count jeq Lbccpyexit | if zero, return - movl sp@(4),a0 | src address - movl sp@(8),a1 | dest address + movl %sp@(4),%a0 | src address + movl %sp@(8),%a1 | dest address Lbcdocopy: - cmpl a1,a0 | src before dest? + cmpl %a1,%a0 | src before dest? jlt Lbccpyback | yes, copy backwards (avoids overlap) - movl a0,d1 - btst #0,d1 | src address odd? + movl %a0,%d1 + btst #0,%d1 | src address odd? jeq Lbccfeven | no, go check dest - movb a0@+,a1@+ | yes, copy a byte - subql #1,d0 | update count + movb %a0@+,%a1@+ | yes, copy a byte + subql #1,%d0 | update count jeq Lbccpyexit | exit if done Lbccfeven: - movl a1,d1 - btst #0,d1 | dest address odd? + movl %a1,%d1 + btst #0,%d1 | dest address odd? jne Lbccfbyte | yes, must copy by bytes - movl d0,d1 | no, get count - lsrl #2,d1 | convert to longwords + movl %d0,%d1 | no, get count + lsrl #2,%d1 | convert to longwords jeq Lbccfbyte | no longwords, copy bytes - subql #1,d1 | set up for dbf + subql #1,%d1 | set up for dbf Lbccflloop: - movl a0@+,a1@+ | copy longwords - dbf d1,Lbccflloop | til done - andl #3,d0 | get remaining count + movl %a0@+,%a1@+ | copy longwords + dbf %d1,Lbccflloop | til done + andl #3,%d0 | get remaining count jeq Lbccpyexit | done if none Lbccfbyte: - subql #1,d0 | set up for dbf + subql #1,%d0 | set up for dbf Lbccfbloop: - movb a0@+,a1@+ | copy bytes - dbf d0,Lbccfbloop | til done + movb %a0@+,%a1@+ | copy bytes + dbf %d0,Lbccfbloop | til done Lbccpyexit: rts Lbccpyback: - addl d0,a0 | add count to src - addl d0,a1 | add count to dest - movl a0,d1 - btst #0,d1 | src address odd? + addl %d0,%a0 | add count to src + addl %d0,%a1 | add count to dest + movl %a0,%d1 + btst #0,%d1 | src address odd? jeq Lbccbeven | no, go check dest - movb a0@-,a1@- | yes, copy a byte - subql #1,d0 | update count + movb %a0@-,%a1@- | yes, copy a byte + subql #1,%d0 | update count jeq Lbccpyexit | exit if done Lbccbeven: - movl a1,d1 - btst #0,d1 | dest address odd? + movl %a1,%d1 + btst #0,%d1 | dest address odd? jne Lbccbbyte | yes, must copy by bytes - movl d0,d1 | no, get count - lsrl #2,d1 | convert to longwords + movl %d0,%d1 | no, get count + lsrl #2,%d1 | convert to longwords jeq Lbccbbyte | no longwords, copy bytes - subql #1,d1 | set up for dbf + subql #1,%d1 | set up for dbf Lbccblloop: - movl a0@-,a1@- | copy longwords - dbf d1,Lbccblloop | til done - andl #3,d0 | get remaining count + movl %a0@-,%a1@- | copy longwords + dbf %d1,Lbccblloop | til done + andl #3,%d0 | get remaining count jeq Lbccpyexit | done if none Lbccbbyte: - subql #1,d0 | set up for dbf + subql #1,%d0 | set up for dbf Lbccbbloop: - movb a0@-,a1@- | copy bytes - dbf d0,Lbccbbloop | til done + movb %a0@-,%a1@- | copy bytes + dbf %d0,Lbccbbloop | til done rts diff --git a/sys/arch/m68k/m68k/copy.s b/sys/arch/m68k/m68k/copy.s index 70a49a4870e..3820f117907 100644 --- a/sys/arch/m68k/m68k/copy.s +++ b/sys/arch/m68k/m68k/copy.s @@ -1,4 +1,4 @@ -/* $OpenBSD: copy.s,v 1.18 2006/11/29 13:22:07 miod Exp $ */ +/* $OpenBSD: copy.s,v 1.19 2013/02/02 13:32:06 miod Exp $ */ /* $NetBSD: copy.s,v 1.30 1998/03/04 06:39:14 thorpej Exp $ */ /*- @@ -82,53 +82,53 @@ Lbadfc: */ ENTRY(copyin) CHECK_SFC - movl sp@(12),d0 | check count + movl %sp@(12),%d0 | check count beq Lciret | == 0, don't do anything - movl d2,sp@- | save scratch register - movl _C_LABEL(curpcb),a0 | set fault handler - movl #Lcifault,a0@(PCB_ONFAULT) - movl sp@(8),a0 | src address - movl sp@(12),a1 | dest address - movl a0,d1 - btst #0,d1 | src address odd? + movl %d2,%sp@- | save scratch register + movl _C_LABEL(curpcb),%a0 | set fault handler + movl #Lcifault,%a0@(PCB_ONFAULT) + movl %sp@(8),%a0 | src address + movl %sp@(12),%a1 | dest address + movl %a0,%d1 + btst #0,%d1 | src address odd? beq Lcieven | no, skip alignment - movsb a0@+,d2 | yes, copy a byte - movb d2,a1@+ - subql #1,d0 | adjust count + movsb %a0@+,%d2 | yes, copy a byte + movb %d2,%a1@+ + subql #1,%d0 | adjust count beq Lcidone | count 0, all done Lcieven: - movl a1,d1 - btst #0,d1 | dest address odd? + movl %a1,%d1 + btst #0,%d1 | dest address odd? bne Lcibytes | yes, must copy bytes - movl d0,d1 | OK, both even. Get count - lsrl #2,d1 | and convert to longwords + movl %d0,%d1 | OK, both even. Get count + lsrl #2,%d1 | and convert to longwords beq Lcibytes | count 0, skip longword loop - subql #1,d1 | predecrement for dbf + subql #1,%d1 | predecrement for dbf Lcilloop: - movsl a0@+,d2 | copy a longword - movl d2,a1@+ - dbf d1,Lcilloop | decrement low word of count - subil #0x10000,d1 | decrement high word of count + movsl %a0@+,%d2 | copy a longword + movl %d2,%a1@+ + dbf %d1,Lcilloop | decrement low word of count + subil #0x10000,%d1 | decrement high word of count bcc Lcilloop - andl #3,d0 | what remains + andl #3,%d0 | what remains beq Lcidone | nothing, all done Lcibytes: - subql #1,d0 | predecrement for dbf + subql #1,%d0 | predecrement for dbf Lcibloop: - movsb a0@+,d2 | copy a byte - movb d2,a1@+ - dbf d0,Lcibloop | decrement low word of count - subil #0x10000,d0 | decrement high word of count + movsb %a0@+,%d2 | copy a byte + movb %d2,%a1@+ + dbf %d0,Lcibloop | decrement low word of count + subil #0x10000,%d0 | decrement high word of count bcc Lcibloop - clrl d0 | no error + clrl %d0 | no error Lcidone: - movl _C_LABEL(curpcb),a0 | clear fault handler - clrl a0@(PCB_ONFAULT) - movl sp@+,d2 | restore scratch register + movl _C_LABEL(curpcb),%a0 | clear fault handler + clrl %a0@(PCB_ONFAULT) + movl %sp@+,%d2 | restore scratch register Lciret: rts Lcifault: - moveq #EFAULT,d0 | got a fault + moveq #EFAULT,%d0 | got a fault bra Lcidone /* @@ -144,53 +144,53 @@ Lcifault: */ ENTRY(copyout) CHECK_DFC - movl sp@(12),d0 | check count + movl %sp@(12),%d0 | check count beq Lcoret | == 0, don't do anything - movl d2,sp@- | save scratch register - movl _C_LABEL(curpcb),a0 | set fault handler - movl #Lcofault,a0@(PCB_ONFAULT) - movl sp@(8),a0 | src address - movl sp@(12),a1 | dest address - movl a0,d1 - btst #0,d1 | src address odd? + movl %d2,%sp@- | save scratch register + movl _C_LABEL(curpcb),%a0 | set fault handler + movl #Lcofault,%a0@(PCB_ONFAULT) + movl %sp@(8),%a0 | src address + movl %sp@(12),%a1 | dest address + movl %a0,%d1 + btst #0,%d1 | src address odd? beq Lcoeven | no, skip alignment - movb a0@+,d2 | yes, copy a byte - movsb d2,a1@+ - subql #1,d0 | adjust count + movb %a0@+,%d2 | yes, copy a byte + movsb %d2,%a1@+ + subql #1,%d0 | adjust count beq Lcodone | count 0, all done Lcoeven: - movl a1,d1 - btst #0,d1 | dest address odd? + movl %a1,%d1 + btst #0,%d1 | dest address odd? bne Lcobytes | yes, must copy bytes - movl d0,d1 | OK, both even. Get count - lsrl #2,d1 | and convert to longwords + movl %d0,%d1 | OK, both even. Get count + lsrl #2,%d1 | and convert to longwords beq Lcobytes | count 0, skip longword loop - subql #1,d1 | predecrement for dbf + subql #1,%d1 | predecrement for dbf Lcolloop: - movl a0@+,d2 | copy a longword - movsl d2,a1@+ - dbf d1,Lcolloop | decrement low word of count - subil #0x10000,d1 | decrement high word of count + movl %a0@+,%d2 | copy a longword + movsl %d2,%a1@+ + dbf %d1,Lcolloop | decrement low word of count + subil #0x10000,%d1 | decrement high word of count bcc Lcolloop - andl #3,d0 | what remains + andl #3,%d0 | what remains beq Lcodone | nothing, all done Lcobytes: - subql #1,d0 | predecrement for dbf + subql #1,%d0 | predecrement for dbf Lcobloop: - movb a0@+,d2 | copy a byte - movsb d2,a1@+ - dbf d0,Lcobloop | decrement low word of count - subil #0x10000,d0 | decrement high word of count + movb %a0@+,%d2 | copy a byte + movsb %d2,%a1@+ + dbf %d0,Lcobloop | decrement low word of count + subil #0x10000,%d0 | decrement high word of count bcc Lcobloop - clrl d0 | no error + clrl %d0 | no error Lcodone: - movl _C_LABEL(curpcb),a0 | clear fault handler - clrl a0@(PCB_ONFAULT) - movl sp@+,d2 | restore scratch register + movl _C_LABEL(curpcb),%a0 | clear fault handler + clrl %a0@(PCB_ONFAULT) + movl %sp@+,%d2 | restore scratch register Lcoret: rts Lcofault: - moveq #EFAULT,d0 + moveq #EFAULT,%d0 bra Lcodone /* @@ -200,25 +200,25 @@ Lcofault: * string is too long, return ENAMETOOLONG; else return 0. */ ENTRY(copystr) - movl sp@(4),a0 | a0 = fromaddr - movl sp@(8),a1 | a1 = toaddr - clrl d0 - movl sp@(12),d1 | count + movl %sp@(4),%a0 | a0 = fromaddr + movl %sp@(8),%a1 | a1 = toaddr + clrl %d0 + movl %sp@(12),%d1 | count beq Lcsdone | nothing to copy - subql #1,d1 | predecrement for dbeq + subql #1,%d1 | predecrement for dbeq Lcsloop: - movb a0@+,a1@+ | copy a byte - dbeq d1,Lcsloop | decrement low word of count + movb %a0@+,%a1@+ | copy a byte + dbeq %d1,Lcsloop | decrement low word of count beq Lcsdone | copied null, exit - subil #0x10000,d1 | decrement high word of count + subil #0x10000,%d1 | decrement high word of count bcc Lcsloop | more room, keep going - moveq #ENAMETOOLONG,d0 | ran out of space + moveq #ENAMETOOLONG,%d0 | ran out of space Lcsdone: - tstl sp@(16) | length desired? + tstl %sp@(16) | length desired? beq Lcsret - subl sp@(4),a0 | yes, calculate length copied - movl sp@(16),a1 | store at return location - movl a0,a1@ + subl %sp@(4),%a0 | yes, calculate length copied + movl %sp@(16),%a1 | store at return location + movl %a0,%a1@ Lcsret: rts @@ -231,40 +231,40 @@ Lcsret: */ ENTRY(copyinstr) CHECK_SFC - movl _C_LABEL(curpcb),a0 | set fault handler - movl #Lcisfault,a0@(PCB_ONFAULT) - movl sp@(4),a0 | a0 = fromaddr - movl sp@(8),a1 | a1 = toaddr - clrl d0 - movl sp@(12),d1 | count + movl _C_LABEL(curpcb),%a0 | set fault handler + movl #Lcisfault,%a0@(PCB_ONFAULT) + movl %sp@(4),%a0 | a0 = fromaddr + movl %sp@(8),%a1 | a1 = toaddr + clrl %d0 + movl %sp@(12),%d1 | count beq Lcistoolong | nothing to copy - subql #1,d1 | predecrement for dbeq + subql #1,%d1 | predecrement for dbeq Lcisloop: - movsb a0@+,d0 | copy a byte - movb d0,a1@+ - dbeq d1,Lcisloop | decrement low word of count + movsb %a0@+,%d0 | copy a byte + movb %d0,%a1@+ + dbeq %d1,Lcisloop | decrement low word of count beq Lcisdone | copied null, exit - subil #0x10000,d1 | decrement high word of count + subil #0x10000,%d1 | decrement high word of count bcc Lcisloop | more room, keep going Lcistoolong: - moveq #ENAMETOOLONG,d0 | ran out of space + moveq #ENAMETOOLONG,%d0 | ran out of space Lcisnull: - cmpl sp@(8),a1 | do not attempt to clear last byte + cmpl %sp@(8),%a1 | do not attempt to clear last byte beq Lcisdone | if we faulted on first write - subql #1, a1 - clrb a1@+ | clear last byte + subql #1, %a1 + clrb %a1@+ | clear last byte Lcisdone: - tstl sp@(16) | length desired? + tstl %sp@(16) | length desired? beq Lcisexit - subl sp@(4),a0 | yes, calculate length copied - movl sp@(16),a1 | store at return location - movl a0,a1@ + subl %sp@(4),%a0 | yes, calculate length copied + movl %sp@(16),%a1 | store at return location + movl %a0,%a1@ Lcisexit: - movl _C_LABEL(curpcb),a0 | clear fault handler - clrl a0@(PCB_ONFAULT) + movl _C_LABEL(curpcb),%a0 | clear fault handler + clrl %a0@(PCB_ONFAULT) rts Lcisfault: - moveq #EFAULT,d0 + moveq #EFAULT,%d0 bra Lcisnull /* @@ -276,35 +276,35 @@ Lcisfault: */ ENTRY(copyoutstr) CHECK_DFC - movl _C_LABEL(curpcb),a0 | set fault handler - movl #Lcosfault,a0@(PCB_ONFAULT) - movl sp@(4),a0 | a0 = fromaddr - movl sp@(8),a1 | a1 = toaddr - clrl d0 - movl sp@(12),d1 | count + movl _C_LABEL(curpcb),%a0 | set fault handler + movl #Lcosfault,%a0@(PCB_ONFAULT) + movl %sp@(4),%a0 | a0 = fromaddr + movl %sp@(8),%a1 | a1 = toaddr + clrl %d0 + movl %sp@(12),%d1 | count beq Lcostoolong | nothing to copy - subql #1,d1 | predecrement for dbeq + subql #1,%d1 | predecrement for dbeq Lcosloop: - movb a0@+,d0 | copy a byte - movsb d0,a1@+ - dbeq d1,Lcosloop | decrement low word of count + movb %a0@+,%d0 | copy a byte + movsb %d0,%a1@+ + dbeq %d1,Lcosloop | decrement low word of count beq Lcosdone | copied null, exit - subil #0x10000,d1 | decrement high word of count + subil #0x10000,%d1 | decrement high word of count bcc Lcosloop | more room, keep going Lcostoolong: - moveq #ENAMETOOLONG,d0 | ran out of space + moveq #ENAMETOOLONG,%d0 | ran out of space Lcosdone: - tstl sp@(16) | length desired? + tstl %sp@(16) | length desired? beq Lcosexit - subl sp@(4),a0 | yes, calculate length copied - movl sp@(16),a1 | store at return location - movl a0,a1@ + subl %sp@(4),%a0 | yes, calculate length copied + movl %sp@(16),%a1 | store at return location + movl %a0,%a1@ Lcosexit: - movl _C_LABEL(curpcb),a0 | clear fault handler - clrl a0@(PCB_ONFAULT) + movl _C_LABEL(curpcb),%a0 | clear fault handler + clrl %a0@(PCB_ONFAULT) rts Lcosfault: - moveq #EFAULT,d0 + moveq #EFAULT,%d0 bra Lcosdone /* @@ -318,22 +318,22 @@ Lcosfault: * page fault. */ ENTRY(kcopy) - link a6,#-4 - movl _C_LABEL(curpcb),a0 | set fault handler - movl a0@(PCB_ONFAULT),a6@(-4) | save old handler first - movl #Lkcfault,a0@(PCB_ONFAULT) - movl a6@(16),sp@- | push len - movl a6@(12),sp@- | push dst - movl a6@(8),sp@- | push src + link %a6,#-4 + movl _C_LABEL(curpcb),%a0 | set fault handler + movl %a0@(PCB_ONFAULT),%a6@(-4) | save old handler first + movl #Lkcfault,%a0@(PCB_ONFAULT) + movl %a6@(16),%sp@- | push len + movl %a6@(12),%sp@- | push dst + movl %a6@(8),%sp@- | push src jbsr _C_LABEL(bcopy) | copy it - addl #12,sp | pop args - clrl d0 | success! + addl #12,%sp | pop args + clrl %d0 | success! Lkcdone: - movl _C_LABEL(curpcb),a0 | restore fault handler - movl a6@(-4),a0@(PCB_ONFAULT) - unlk a6 + movl _C_LABEL(curpcb),%a0 | restore fault handler + movl %a6@(-4),%a0@(PCB_ONFAULT) + unlk %a6 rts Lkcfault: - addl #16,sp | pop args and return address - moveq #EFAULT,d0 | indicate a fault + addl #16,%sp | pop args and return address + moveq #EFAULT,%d0 | indicate a fault bra Lkcdone diff --git a/sys/arch/m68k/m68k/copypage.s b/sys/arch/m68k/m68k/copypage.s index 8662694a9ea..e931bc9766c 100644 --- a/sys/arch/m68k/m68k/copypage.s +++ b/sys/arch/m68k/m68k/copypage.s @@ -1,4 +1,4 @@ -/* $OpenBSD: copypage.s,v 1.5 2008/06/26 05:42:11 ray Exp $ */ +/* $OpenBSD: copypage.s,v 1.6 2013/02/02 13:32:06 miod Exp $ */ /* $NetBSD: copypage.s,v 1.4 1997/05/30 01:34:49 jtc Exp $ */ /*- @@ -49,13 +49,13 @@ */ #if defined(M68040) || defined(M68060) ENTRY(copypage040) - movl sp@(4),a0 | source address - movl sp@(8),a1 | destination address - movw #NBPG/32-1,d0 | number of 32 byte chunks - 1 + movl %sp@(4),%a0 | source address + movl %sp@(8),%a1 | destination address + movw #NBPG/32-1,%d0 | number of 32 byte chunks - 1 Lm16loop: .long 0xf6209000 | move16 a0@+,a1@+ .long 0xf6209000 | move16 a0@+,a1@+ - dbf d0,Lm16loop + dbf %d0,Lm16loop rts #endif /* M68040 || M68060 */ @@ -65,19 +65,19 @@ Lm16loop: * Optimized version of bcopy for a single page-aligned NBPG byte copy. */ ENTRY(copypage) - movl sp@(4),a0 | source address - movl sp@(8),a1 | destination address - movw #NBPG/32-1,d0 | number of 32 byte chunks - 1 + movl %sp@(4),%a0 | source address + movl %sp@(8),%a1 | destination address + movw #NBPG/32-1,%d0 | number of 32 byte chunks - 1 Lmlloop: - movl a0@+,a1@+ - movl a0@+,a1@+ - movl a0@+,a1@+ - movl a0@+,a1@+ - movl a0@+,a1@+ - movl a0@+,a1@+ - movl a0@+,a1@+ - movl a0@+,a1@+ - dbf d0,Lmlloop + movl %a0@+,%a1@+ + movl %a0@+,%a1@+ + movl %a0@+,%a1@+ + movl %a0@+,%a1@+ + movl %a0@+,%a1@+ + movl %a0@+,%a1@+ + movl %a0@+,%a1@+ + movl %a0@+,%a1@+ + dbf %d0,Lmlloop rts /* @@ -86,27 +86,27 @@ Lmlloop: * Optimized version of bzero for a single page-aligned NBPG byte zero. */ ENTRY(zeropage) - movl sp@(4),a0 | dest address - movql #NBPG/256-1,d0 | number of 256 byte chunks - 1 - movml d2-d7,sp@- - movql #0,d1 - movql #0,d2 - movql #0,d3 - movql #0,d4 - movql #0,d5 - movql #0,d6 - movql #0,d7 - movl d1,a1 - lea a0@(NBPG),a0 + movl %sp@(4),%a0 | dest address + movql #NBPG/256-1,%d0 | number of 256 byte chunks - 1 + movml %d2-%d7,%sp@- + movql #0,%d1 + movql #0,%d2 + movql #0,%d3 + movql #0,%d4 + movql #0,%d5 + movql #0,%d6 + movql #0,%d7 + movl %d1,%a1 + lea %a0@(NBPG),%a0 Lzloop: - movml d1-d7/a1,a0@- - movml d1-d7/a1,a0@- - movml d1-d7/a1,a0@- - movml d1-d7/a1,a0@- - movml d1-d7/a1,a0@- - movml d1-d7/a1,a0@- - movml d1-d7/a1,a0@- - movml d1-d7/a1,a0@- - dbf d0,Lzloop - movml sp@+,d2-d7 + movml %d1-%d7/%a1,%a0@- + movml %d1-%d7/%a1,%a0@- + movml %d1-%d7/%a1,%a0@- + movml %d1-%d7/%a1,%a0@- + movml %d1-%d7/%a1,%a0@- + movml %d1-%d7/%a1,%a0@- + movml %d1-%d7/%a1,%a0@- + movml %d1-%d7/%a1,%a0@- + dbf %d0,Lzloop + movml %sp@+,%d2-%d7 rts diff --git a/sys/arch/m68k/m68k/oc_cksum.s b/sys/arch/m68k/m68k/oc_cksum.s index d445298e75c..ae94906f28f 100644 --- a/sys/arch/m68k/m68k/oc_cksum.s +++ b/sys/arch/m68k/m68k/oc_cksum.s @@ -1,4 +1,4 @@ -| $OpenBSD: oc_cksum.s,v 1.3 2003/06/04 22:08:15 deraadt Exp $ +| $OpenBSD: oc_cksum.s,v 1.4 2013/02/02 13:32:06 miod Exp $ | $NetBSD: oc_cksum.s,v 1.4 1994/10/26 07:51:13 cgd Exp $ | Copyright (c) 1988 Regents of the University of California. @@ -92,10 +92,10 @@ .text ENTRY(oc_cksum) - movl sp@(4),a0 | get buffer ptr - movl sp@(8),d1 | get byte count - movl sp@(12),d0 | get starting value - movl d2,sp@- | free a reg + movl %sp@(4),%a0 | get buffer ptr + movl %sp@(8),%d1 | get byte count + movl %sp@(12),%d0 | get starting value + movl %d2,%sp@- | free a reg | test for possible 1, 2 or 3 bytes of excess at end | of buffer. The usual case is no excess (the usual @@ -104,81 +104,81 @@ ENTRY(oc_cksum) | first because we're about the trash the low order | bits of the count in d1.) - btst #0,d1 + btst #0,%d1 jne L5 | if one or three bytes excess - btst #1,d1 + btst #1,%d1 jne L7 | if two bytes excess L1: - movl d1,d2 - lsrl #6,d1 | make cnt into # of 64 byte chunks - andl #0x3c,d2 | then find fractions of a chunk - negl d2 - andb #0xf,cc | clear X - jmp pc@(L3-.-2:b,d2) + movl %d1,%d2 + lsrl #6,%d1 | make cnt into # of 64 byte chunks + andl #0x3c,%d2 | then find fractions of a chunk + negl %d2 + andb #0xf,%cc | clear X + jmp %pc@(L3-.-2:b,%d2) L2: - movl a0@+,d2 - addxl d2,d0 - movl a0@+,d2 - addxl d2,d0 - movl a0@+,d2 - addxl d2,d0 - movl a0@+,d2 - addxl d2,d0 - movl a0@+,d2 - addxl d2,d0 - movl a0@+,d2 - addxl d2,d0 - movl a0@+,d2 - addxl d2,d0 - movl a0@+,d2 - addxl d2,d0 - movl a0@+,d2 - addxl d2,d0 - movl a0@+,d2 - addxl d2,d0 - movl a0@+,d2 - addxl d2,d0 - movl a0@+,d2 - addxl d2,d0 - movl a0@+,d2 - addxl d2,d0 - movl a0@+,d2 - addxl d2,d0 - movl a0@+,d2 - addxl d2,d0 - movl a0@+,d2 - addxl d2,d0 + movl %a0@+,%d2 + addxl %d2,%d0 + movl %a0@+,%d2 + addxl %d2,%d0 + movl %a0@+,%d2 + addxl %d2,%d0 + movl %a0@+,%d2 + addxl %d2,%d0 + movl %a0@+,%d2 + addxl %d2,%d0 + movl %a0@+,%d2 + addxl %d2,%d0 + movl %a0@+,%d2 + addxl %d2,%d0 + movl %a0@+,%d2 + addxl %d2,%d0 + movl %a0@+,%d2 + addxl %d2,%d0 + movl %a0@+,%d2 + addxl %d2,%d0 + movl %a0@+,%d2 + addxl %d2,%d0 + movl %a0@+,%d2 + addxl %d2,%d0 + movl %a0@+,%d2 + addxl %d2,%d0 + movl %a0@+,%d2 + addxl %d2,%d0 + movl %a0@+,%d2 + addxl %d2,%d0 + movl %a0@+,%d2 + addxl %d2,%d0 L3: - dbra d1,L2 | (NB- dbra doesn't affect X) + dbra %d1,L2 | (NB- dbra doesn't affect X) - movl d0,d1 | fold 32 bit sum to 16 bits - swap d1 | (NB- swap doesn't affect X) - addxw d1,d0 + movl %d0,%d1 | fold 32 bit sum to 16 bits + swap %d1 | (NB- swap doesn't affect X) + addxw %d1,%d0 jcc L4 - addw #1,d0 + addw #1,%d0 L4: - andl #0xffff,d0 - movl sp@+,d2 + andl #0xffff,%d0 + movl %sp@+,%d2 rts L5: | deal with 1 or 3 excess bytes at the end of the buffer. - btst #1,d1 + btst #1,%d1 jeq L6 | if 1 excess | 3 bytes excess - clrl d2 - movw a0@(-3,d1:l),d2 | add in last full word then drop - addl d2,d0 | through to pick up last byte + clrl %d2 + movw %a0@(-3,%d1:l),%d2 | add in last full word then drop + addl %d2,%d0 | through to pick up last byte L6: | 1 byte excess - clrl d2 - movb a0@(-1,d1:l),d2 - lsll #8,d2 - addl d2,d0 + clrl %d2 + movb %a0@(-1,%d1:l),%d2 + lsll #8,%d2 + addl %d2,%d0 jra L1 L7: | 2 bytes excess - clrl d2 - movw a0@(-2,d1:l),d2 - addl d2,d0 + clrl %d2 + movw %a0@(-2,%d1:l),%d2 + addl %d2,%d0 jra L1 diff --git a/sys/arch/m68k/m68k/sigcode.s b/sys/arch/m68k/m68k/sigcode.s index ad3c276b279..8f14386ba0b 100644 --- a/sys/arch/m68k/m68k/sigcode.s +++ b/sys/arch/m68k/m68k/sigcode.s @@ -1,4 +1,4 @@ -/* $OpenBSD: sigcode.s,v 1.3 2003/06/02 23:27:48 millert Exp $ */ +/* $OpenBSD: sigcode.s,v 1.4 2013/02/02 13:32:06 miod Exp $ */ /* $NetBSD: sigcode.s,v 1.2 1997/04/25 02:22:03 thorpej Exp $ */ /* @@ -65,13 +65,13 @@ .data .align 2 GLOBAL(sigcode) - movl sp@(12),a0 | signal handler addr (4 bytes) - jsr a0@ | call signal handler (2 bytes) - addql #4,sp | pop signal number (2 bytes) + movl %sp@(12),%a0 | signal handler addr (4 bytes) + jsr %a0@ | call signal handler (2 bytes) + addql #4,%sp | pop signal number (2 bytes) GLOBAL(sigcodetrap) trap #1 | special syscall entry (2 bytes) - movl d0,sp@(4) | save errno (4 bytes) - moveq #SYS_exit,d0 | syscall == exit (2 bytes) + movl %d0,%sp@(4) | save errno (4 bytes) + moveq #SYS_exit,%d0 | syscall == exit (2 bytes) trap #0 | exit(errno) (2 bytes) .align 2 GLOBAL(esigcode) diff --git a/sys/arch/m68k/m68k/sigreturn.s b/sys/arch/m68k/m68k/sigreturn.s index 781178d1172..53e4a7c4e58 100644 --- a/sys/arch/m68k/m68k/sigreturn.s +++ b/sys/arch/m68k/m68k/sigreturn.s @@ -1,4 +1,4 @@ -/* $OpenBSD: sigreturn.s,v 1.3 2003/06/02 23:27:48 millert Exp $ */ +/* $OpenBSD: sigreturn.s,v 1.4 2013/02/02 13:32:06 miod Exp $ */ /* $NetBSD: sigreturn.s,v 1.2 1997/04/25 02:22:04 thorpej Exp $ */ /* @@ -52,33 +52,33 @@ * larger) original stack frame. */ ASENTRY_NOPROFILE(sigreturn) - lea sp@(-84),sp | leave enough space for largest frame - movl sp@(84),sp@ | move up current 8 byte frame - movl sp@(88),sp@(4) - movl #84,sp@- | default: adjust by 84 bytes - moveml #0xFFFF,sp@- | save user registers - movl usp,a0 | save the user SP - movl a0,sp@(FR_SP) | in the savearea - movl #SYS_sigreturn,sp@- | push syscall number + lea %sp@(-84),%sp | leave enough space for largest frame + movl %sp@(84),%sp@ | move up current 8 byte frame + movl %sp@(88),%sp@(4) + movl #84,%sp@- | default: adjust by 84 bytes + moveml #0xFFFF,%sp@- | save user registers + movl %usp,%a0 | save the user SP + movl %a0,%sp@(FR_SP) | in the savearea + movl #SYS_sigreturn,%sp@- | push syscall number jbsr _C_LABEL(syscall) | handle it - addql #4,sp | pop syscall# - movl sp@(FR_SP),a0 | grab and restore - movl a0,usp | user SP - lea sp@(FR_HW),a1 | pointer to HW frame - movw sp@(FR_ADJ),d0 | do we need to adjust the stack? + addql #4,%sp | pop syscall# + movl %sp@(FR_SP),%a0 | grab and restore + movl %a0,%usp | user SP + lea %sp@(FR_HW),%a1 | pointer to HW frame + movw %sp@(FR_ADJ),%d0 | do we need to adjust the stack? jeq Lsigr1 | no, just continue - moveq #92,d1 | total size - subw d0,d1 | - hole size = frame size - lea a1@(92),a0 | destination - addw d1,a1 | source - lsrw #1,d1 | convert to word count - subqw #1,d1 | minus 1 for dbf + moveq #92,%d1 | total size + subw %d0,%d1 | - hole size = frame size + lea %a1@(92),%a0 | destination + addw %d1,%a1 | source + lsrw #1,%d1 | convert to word count + subqw #1,%d1 | minus 1 for dbf Lsigrlp: - movw a1@-,a0@- | copy a word - dbf d1,Lsigrlp | continue - movl a0,a1 | new HW frame base + movw %a1@-,%a0@- | copy a word + dbf %d1,Lsigrlp | continue + movl %a0,%a1 | new HW frame base Lsigr1: - movl a1,sp@(FR_SP) | new SP value - moveml sp@+,#0x7FFF | restore user registers - movl sp@,sp | and our SP + movl %a1,%sp@(FR_SP) | new SP value + moveml %sp@+,#0x7FFF | restore user registers + movl %sp@,%sp | and our SP jra _ASM_LABEL(rei) | all done diff --git a/sys/arch/m68k/m68k/support.s b/sys/arch/m68k/m68k/support.s index 433f05ff302..09c7112f17c 100644 --- a/sys/arch/m68k/m68k/support.s +++ b/sys/arch/m68k/m68k/support.s @@ -1,4 +1,4 @@ -/* $OpenBSD: support.s,v 1.3 2006/02/22 22:16:07 miod Exp $ */ +/* $OpenBSD: support.s,v 1.4 2013/02/02 13:32:06 miod Exp $ */ /* $NetBSD: support.s,v 1.1 1997/03/16 10:47:33 thorpej Exp $ */ /* @@ -54,15 +54,15 @@ * non-local gotos */ ENTRY(setjmp) - movl sp@(4),a0 | savearea pointer - moveml #0xFCFC,a0@ | save d2-d7/a2-a7 - movl sp@,a0@(48) | and return address - moveq #0,d0 | return 0 + movl %sp@(4),%a0 | savearea pointer + moveml #0xFCFC,%a0@ | save d2-d7/a2-a7 + movl %sp@,%a0@(48) | and return address + moveq #0,%d0 | return 0 rts ENTRY(longjmp) - movl sp@(4),a0 - moveml a0@+,#0xFCFC - movl a0@,sp@ - moveq #1,d0 + movl %sp@(4),%a0 + moveml %a0@+,#0xFCFC + movl %a0@,%sp@ + moveq #1,%d0 rts diff --git a/sys/arch/m68k/m68k/trap_subr.s b/sys/arch/m68k/m68k/trap_subr.s index b7e1811624f..4ed693c8b1b 100644 --- a/sys/arch/m68k/m68k/trap_subr.s +++ b/sys/arch/m68k/m68k/trap_subr.s @@ -1,4 +1,4 @@ -/* $OpenBSD: trap_subr.s,v 1.2 2003/06/02 23:27:48 millert Exp $ */ +/* $OpenBSD: trap_subr.s,v 1.3 2013/02/02 13:32:06 miod Exp $ */ /* $NetBSD: trap_subr.s,v 1.2 1997/06/04 22:12:43 is Exp $ */ /* @@ -51,17 +51,17 @@ * Registers have been saved, and type for trap() placed in d0. */ ASENTRY_NOPROFILE(fault) - movl usp,a0 | get and save - movl a0,sp@(FR_SP) | the user stack pointer - clrl sp@- | no VA arg - clrl sp@- | or code arg - movl d0,sp@- | push trap type + movl %usp,%a0 | get and save + movl %a0,%sp@(FR_SP) | the user stack pointer + clrl %sp@- | no VA arg + clrl %sp@- | or code arg + movl %d0,%sp@- | push trap type jbsr _C_LABEL(trap) | handle trap - lea sp@(12),sp | pop value args - movl sp@(FR_SP),a0 | restore - movl a0,usp | user SP - moveml sp@+,#0x7FFF | restore most user regs - addql #8,sp | pop SP and stack adjust + lea %sp@(12),%sp | pop value args + movl %sp@(FR_SP),%a0 | restore + movl %a0,%usp | user SP + moveml %sp@+,#0x7FFF | restore most user regs + addql #8,%sp | pop SP and stack adjust jra _ASM_LABEL(rei) | all done /* @@ -71,26 +71,26 @@ ASENTRY(faultstkadj) jbsr _C_LABEL(trap) | handle the error /* for 68060 Branch Prediction Error handler */ _ASM_LABEL(faultstkadjnotrap): - lea sp@(12),sp | pop value args + lea %sp@(12),%sp | pop value args /* for new 68060 Branch Prediction Error handler */ _ASM_LABEL(faultstkadjnotrap2): - movl sp@(FR_SP),a0 | restore user SP - movl a0,usp | from save area - movw sp@(FR_ADJ),d0 | need to adjust stack? + movl %sp@(FR_SP),%a0 | restore user SP + movl %a0,%usp | from save area + movw %sp@(FR_ADJ),%d0 | need to adjust stack? jne 1f | yes, go to it - moveml sp@+,#0x7FFF | no, restore most user regs - addql #8,sp | toss SSP and stkadj + moveml %sp@+,#0x7FFF | no, restore most user regs + addql #8,%sp | toss SSP and stkadj jra _ASM_LABEL(rei) | all done 1: - lea sp@(FR_HW),a1 | pointer to HW frame - addql #8,a1 | source pointer - movl a1,a0 | source - addw d0,a0 | + hole size = dest pointer - movl a1@-,a0@- | copy - movl a1@-,a0@- | 8 bytes - movl a0,sp@(FR_SP) | new SSP - moveml sp@+,#0x7FFF | restore user registers - movl sp@,sp | and our SP + lea %sp@(FR_HW),%a1 | pointer to HW frame + addql #8,%a1 | source pointer + movl %a1,%a0 | source + addw %d0,%a0 | + hole size = dest pointer + movl %a1@-,%a0@- | copy + movl %a1@-,%a0@- | 8 bytes + movl %a0,%sp@(FR_SP) | new SSP + moveml %sp@+,#0x7FFF | restore user registers + movl %sp@,%sp | and our SP jra _ASM_LABEL(rei) | all done /* @@ -98,33 +98,33 @@ _ASM_LABEL(faultstkadjnotrap2): * and require no post-trap stack adjustment. */ ENTRY_NOPROFILE(illinst) - clrl sp@- - moveml #0xFFFF,sp@- - moveq #T_ILLINST,d0 + clrl %sp@- + moveml #0xFFFF,%sp@- + moveq #T_ILLINST,%d0 jra _ASM_LABEL(fault) ENTRY_NOPROFILE(zerodiv) - clrl sp@- - moveml #0xFFFF,sp@- - moveq #T_ZERODIV,d0 + clrl %sp@- + moveml #0xFFFF,%sp@- + moveq #T_ZERODIV,%d0 jra _ASM_LABEL(fault) ENTRY_NOPROFILE(chkinst) - clrl sp@- - moveml #0xFFFF,sp@- - moveq #T_CHKINST,d0 + clrl %sp@- + moveml #0xFFFF,%sp@- + moveq #T_CHKINST,%d0 jra _ASM_LABEL(fault) ENTRY_NOPROFILE(trapvinst) - clrl sp@- - moveml #0xFFFF,sp@- - moveq #T_TRAPVINST,d0 + clrl %sp@- + moveml #0xFFFF,%sp@- + moveq #T_TRAPVINST,%d0 jra _ASM_LABEL(fault) ENTRY_NOPROFILE(privinst) - clrl sp@- - moveml #0xFFFF,sp@- - moveq #T_PRIVINST,d0 + clrl %sp@- + moveml #0xFFFF,%sp@- + moveq #T_PRIVINST,%d0 jra _ASM_LABEL(fault) /* @@ -133,23 +133,23 @@ ENTRY_NOPROFILE(privinst) * stack adjustment. */ ENTRY_NOPROFILE(coperr) - clrl sp@- | stack adjust count - moveml #0xFFFF,sp@- - movl usp,a0 | get and save - movl a0,sp@(FR_SP) | the user stack pointer - clrl sp@- | no VA arg - clrl sp@- | or code arg - movl #T_COPERR,sp@- | push trap type + clrl %sp@- | stack adjust count + moveml #0xFFFF,%sp@- + movl %usp,%a0 | get and save + movl %a0,%sp@(FR_SP) | the user stack pointer + clrl %sp@- | no VA arg + clrl %sp@- | or code arg + movl #T_COPERR,%sp@- | push trap type jra _ASM_LABEL(faultstkadj) | call trap and deal with stack | adjustments ENTRY_NOPROFILE(fmterr) - clrl sp@- | stack adjust count - moveml #0xFFFF,sp@- - movl usp,a0 | get and save - movl a0,sp@(FR_SP) | the user stack pointer - clrl sp@- | no VA arg - clrl sp@- | or code arg - movl #T_FMTERR,sp@- | push trap type + clrl %sp@- | stack adjust count + moveml #0xFFFF,%sp@- + movl %usp,%a0 | get and save + movl %a0,%sp@(FR_SP) | the user stack pointer + clrl %sp@- | no VA arg + clrl %sp@- | or code arg + movl #T_FMTERR,%sp@- | push trap type jra _ASM_LABEL(faultstkadj) | call trap and deal with stack | adjustments diff --git a/sys/lib/libkern/arch/m68k/bcmp.S b/sys/lib/libkern/arch/m68k/bcmp.S index ddcbf5a46d2..4c2f2b4ebb1 100644 --- a/sys/lib/libkern/arch/m68k/bcmp.S +++ b/sys/lib/libkern/arch/m68k/bcmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: bcmp.S,v 1.4 2007/11/24 19:38:04 deraadt Exp $ */ +/* $OpenBSD: bcmp.S,v 1.5 2013/02/02 13:32:06 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -46,38 +46,38 @@ * - use nested DBcc instructions or use one and limit size to 64K */ ENTRY(bcmp) - movl sp@(4),a0 | string 1 - movl sp@(8),a1 | string 2 - movl sp@(12),d0 | length + movl %sp@(4),%a0 | string 1 + movl %sp@(8),%a1 | string 2 + movl %sp@(12),%d0 | length beq bcdone | if zero, nothing to do - movl a0,d1 - btst #0,d1 | string 1 address odd? + movl %a0,%d1 + btst #0,%d1 | string 1 address odd? beq bceven | no, skip alignment - cmpmb a0@+,a1@+ | yes, compare a byte + cmpmb %a0@+,%a1@+ | yes, compare a byte bne bcnoteq | not equal, return non-zero - subql #1,d0 | adjust count + subql #1,%d0 | adjust count beq bcdone | count 0, reutrn zero bceven: - movl a1,d1 - btst #0,d1 | string 2 address odd? + movl %a1,%d1 + btst #0,%d1 | string 2 address odd? bne bcbloop | yes, no hope for alignment, compare bytes - movl d0,d1 | no, both even - lsrl #2,d1 | convert count to longword count + movl %d0,%d1 | no, both even + lsrl #2,%d1 | convert count to longword count beq bcbloop | count 0, skip longword loop bclloop: - cmpml a0@+,a1@+ | compare a longword + cmpml %a0@+,%a1@+ | compare a longword bne bcnoteq | not equal, return non-zero - subql #1,d1 | adjust count + subql #1,%d1 | adjust count bne bclloop | still more, keep comparing - andl #3,d0 | what remains + andl #3,%d0 | what remains beq bcdone | nothing, all done bcbloop: - cmpmb a0@+,a1@+ | compare a byte + cmpmb %a0@+,%a1@+ | compare a byte bne bcnoteq | not equal, return non-zero - subql #1,d0 | adjust count + subql #1,%d0 | adjust count bne bcbloop | still more, keep going rts bcnoteq: - moveq #1,d0 + moveq #1,%d0 bcdone: rts diff --git a/sys/lib/libkern/arch/m68k/bzero.S b/sys/lib/libkern/arch/m68k/bzero.S index 8557998ba1d..b61d55ff2a1 100644 --- a/sys/lib/libkern/arch/m68k/bzero.S +++ b/sys/lib/libkern/arch/m68k/bzero.S @@ -1,4 +1,4 @@ -/* $OpenBSD: bzero.S,v 1.4 2007/11/24 19:38:04 deraadt Exp $ */ +/* $OpenBSD: bzero.S,v 1.5 2013/02/02 13:32:06 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -45,28 +45,28 @@ * - use nested DBcc instructions or use one and limit size to 64K */ ENTRY(bzero) - movl sp@(4),a0 | destination - movl sp@(8),d0 | count + movl %sp@(4),%a0 | destination + movl %sp@(8),%d0 | count beq bzdone | nothing to do - movl a0,d1 - btst #0,d1 | address odd? + movl %a0,%d1 + btst #0,%d1 | address odd? beq bzeven | no, skip alignment - clrb a0@+ | yes, clear a byte - subql #1,d0 | adjust count + clrb %a0@+ | yes, clear a byte + subql #1,%d0 | adjust count beq bzdone | if zero, all done bzeven: - movl d0,d1 - lsrl #2,d1 | convert to longword count + movl %d0,%d1 + lsrl #2,%d1 | convert to longword count beq bzbloop | no longwords, skip loop bzlloop: - clrl a0@+ | clear a longword - subql #1,d1 | adjust count + clrl %a0@+ | clear a longword + subql #1,%d1 | adjust count bne bzlloop | still more, keep going - andl #3,d0 | what remains + andl #3,%d0 | what remains beq bzdone | nothing, all done bzbloop: - clrb a0@+ | clear a byte - subql #1,d0 | adjust count + clrb %a0@+ | clear a byte + subql #1,%d0 | adjust count bne bzbloop | still more, keep going bzdone: rts diff --git a/sys/lib/libkern/arch/m68k/ffs.S b/sys/lib/libkern/arch/m68k/ffs.S index 970db7568cc..cca620e30f9 100644 --- a/sys/lib/libkern/arch/m68k/ffs.S +++ b/sys/lib/libkern/arch/m68k/ffs.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs.S,v 1.4 2007/11/24 19:38:04 deraadt Exp $ */ +/* $OpenBSD: ffs.S,v 1.5 2013/02/02 13:32:06 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -38,11 +38,11 @@ #include "DEFS.h" ENTRY(ffs) - movl sp@(4),d0 - movl d0,d1 - negl d0 - andl d0,d1 - movql #32,d0 - bfffo d1{#0:#32},d1 - subl d1,d0 + movl %sp@(4),%d0 + movl %d0,%d1 + negl %d0 + andl %d0,%d1 + movql #32,%d0 + bfffo %d1{#0:#32},%d1 + subl %d1,%d0 rts diff --git a/sys/lib/libkern/arch/m68k/htonl.S b/sys/lib/libkern/arch/m68k/htonl.S index 22d8aaca2c1..d13088cd286 100644 --- a/sys/lib/libkern/arch/m68k/htonl.S +++ b/sys/lib/libkern/arch/m68k/htonl.S @@ -1,4 +1,4 @@ -/* $OpenBSD: htonl.S,v 1.4 2007/11/25 18:25:35 deraadt Exp $ */ +/* $OpenBSD: htonl.S,v 1.5 2013/02/02 13:32:06 miod Exp $ */ /* $NetBSD: htonl.S,v 1.2 1994/10/26 06:39:27 cgd Exp $ */ /*- @@ -41,5 +41,5 @@ ALTENTRY(ntohl, _htonl) ALTENTRY(bswap32, _htonl) ENTRY(htonl) - movl sp@(4),d0 + movl %sp@(4),%d0 rts diff --git a/sys/lib/libkern/arch/m68k/htons.S b/sys/lib/libkern/arch/m68k/htons.S index d9b4a308931..6fd535f8e74 100644 --- a/sys/lib/libkern/arch/m68k/htons.S +++ b/sys/lib/libkern/arch/m68k/htons.S @@ -1,4 +1,4 @@ -/* $OpenBSD: htons.S,v 1.4 2007/11/25 18:25:35 deraadt Exp $ */ +/* $OpenBSD: htons.S,v 1.5 2013/02/02 13:32:06 miod Exp $ */ /* $NetBSD: htons.S,v 1.2 1994/10/26 06:39:27 cgd Exp $ */ /*- @@ -41,6 +41,6 @@ ALTENTRY(ntohs, _htons) ALTENTRY(bswap16, _htons) ENTRY(htons) - clrl d0 - movw sp@(6),d0 + clrl %d0 + movw %sp@(6),%d0 rts diff --git a/sys/lib/libkern/arch/m68k/memcmp.S b/sys/lib/libkern/arch/m68k/memcmp.S index cefea2a60fa..e9d032cc426 100644 --- a/sys/lib/libkern/arch/m68k/memcmp.S +++ b/sys/lib/libkern/arch/m68k/memcmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: memcmp.S,v 1.3 2007/11/24 19:38:04 deraadt Exp $ */ +/* $OpenBSD: memcmp.S,v 1.4 2013/02/02 13:32:06 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -46,47 +46,47 @@ * - use nested DBcc instructions or use one and limit size to 64K */ ENTRY(memcmp) - movl sp@(4),a0 | string 1 - movl sp@(8),a1 | string 2 - movl sp@(12),d0 | length + movl %sp@(4),%a0 | string 1 + movl %sp@(8),%a1 | string 2 + movl %sp@(12),%d0 | length beq bcdone | if zero, nothing to do - movl a0,d1 - btst #0,d1 | string 1 address odd? + movl %a0,%d1 + btst #0,%d1 | string 1 address odd? beq bceven | no, skip alignment - cmpmb a0@+,a1@+ | yes, compare a byte + cmpmb %a0@+,%a1@+ | yes, compare a byte bne bcnoteq | not equal, return non-zero - subql #1,d0 | adjust count + subql #1,%d0 | adjust count beq bcdone | count 0, reutrn zero bceven: - movl a1,d1 - btst #0,d1 | string 2 address odd? + movl %a1,%d1 + btst #0,%d1 | string 2 address odd? bne bcbloop | yes, no hope for alignment, compare bytes - movl d0,d1 | no, both even - lsrl #2,d1 | convert count to longword count + movl %d0,%d1 | no, both even + lsrl #2,%d1 | convert count to longword count beq bcbloop | count 0, skip longword loop bclloop: - cmpml a0@+,a1@+ | compare a longword + cmpml %a0@+,%a1@+ | compare a longword bne bcnoteql | not equal, return non-zero - subql #1,d1 | adjust count + subql #1,%d1 | adjust count bne bclloop | still more, keep comparing - andl #3,d0 | what remains + andl #3,%d0 | what remains beq bcdone | nothing, all done bcbloop: - cmpmb a0@+,a1@+ | compare a byte + cmpmb %a0@+,%a1@+ | compare a byte bne bcnoteq | not equal, return non-zero - subql #1,d0 | adjust count + subql #1,%d0 | adjust count bne bcbloop | still more, keep going rts bcnoteql: - subql #4,a0 - subql #4,a1 - movl #4,d0 + subql #4,%a0 + subql #4,%a1 + movl #4,%d0 jra bcbloop bcnoteq: - clrl d0 - clrl d1 - movb a0@-,d0 - movb a1@-,d1 - subl d1,d0 + clrl %d0 + clrl %d1 + movb %a0@-,%d0 + movb %a1@-,%d1 + subl %d1,%d0 bcdone: rts diff --git a/sys/lib/libkern/arch/m68k/memset.S b/sys/lib/libkern/arch/m68k/memset.S index e2ecdc5f7b1..75b4b38d352 100644 --- a/sys/lib/libkern/arch/m68k/memset.S +++ b/sys/lib/libkern/arch/m68k/memset.S @@ -1,4 +1,4 @@ -/* $OpenBSD: memset.S,v 1.3 2007/11/24 19:38:04 deraadt Exp $ */ +/* $OpenBSD: memset.S,v 1.4 2013/02/02 13:32:06 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -45,55 +45,55 @@ * - use nested DBcc instructions or use one and limit size to 64K */ ENTRY(memset) - movl d2,sp@- - movl sp@(8),a0 | destination - movl sp@(16),d0 | count + movl %d2,%sp@- + movl %sp@(8),%a0 | destination + movl %sp@(16),%d0 | count beq bzdone | nothing to do - movb sp@(15),d2 | character - movl a0,d1 - btst #0,d1 | address odd? + movb %sp@(15),%d2 | character + movl %a0,%d1 + btst #0,%d1 | address odd? beq bzeven | no, skip alignment - movb d2,a0@+ | set one byte - subql #1,d0 | adjust count + movb %d2,%a0@+ | set one byte + subql #1,%d0 | adjust count beq bzdone | if zero, all done bzeven: - cmpl #15,d0 + cmpl #15,%d0 ble bzbloop | too small to be worthwhile - clrl d1 | replicate byte to fill longword - movb d2,d1 - movl d1,d2 - lsll #8,d1 - orl d1,d2 - lsll #8,d1 - orl d1,d2 - lsll #8,d1 - orl d1,d2 - movl d0,d1 | convert to longword count - lsrl #2,d1 + clrl %d1 | replicate byte to fill longword + movb %d2,%d1 + movl %d1,%d2 + lsll #8,%d1 + orl %d1,%d2 + lsll #8,%d1 + orl %d1,%d2 + lsll #8,%d1 + orl %d1,%d2 + movl %d0,%d1 | convert to longword count + lsrl #2,%d1 #ifdef DEBUG - moveml #0xffff,sp@- - movl d2,sp@- - movl d1,sp@- - movl d0,sp@- - movl a0,sp@- - movl #foo,sp@- - jsr _printf - addl #20,sp - moveml sp@+,#0xffff + moveml #0xffff,%sp@- + movl %d2,%sp@- + movl %d1,%sp@- + movl %d0,%sp@- + movl %a0,%sp@- + movl #foo,%sp@- + jsr _C_LABEL(printf) + addl #20,%sp + moveml %sp@+,#0xffff #endif bzlloop: - movl d2,a0@+ | set one longword - subql #1,d1 | adjust count + movl %d2,%a0@+ | set one longword + subql #1,%d1 | adjust count bne bzlloop | still more, keep going - andl #3,d0 | what remains + andl #3,%d0 | what remains beq bzdone | nothing, all done bzbloop: - movb d2,a0@+ | set one byte - subql #1,d0 | adjust count + movb %d2,%a0@+ | set one byte + subql #1,%d0 | adjust count bne bzbloop | still more, keep going bzdone: - movl sp@(8),d0 | return destination - movl sp@+,d2 + movl %sp@(8),%d0 | return destination + movl %sp@+,%d2 rts #ifdef DEBUG diff --git a/sys/lib/libkern/arch/m68k/scanc.S b/sys/lib/libkern/arch/m68k/scanc.S index d315640318f..7f3dfeeb713 100644 --- a/sys/lib/libkern/arch/m68k/scanc.S +++ b/sys/lib/libkern/arch/m68k/scanc.S @@ -1,4 +1,4 @@ -/* $OpenBSD: scanc.S,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: scanc.S,v 1.4 2013/02/02 13:32:06 miod Exp $ */ /* $NetBSD: scanc.S,v 1.2 1994/10/26 06:39:31 cgd Exp $ */ /* @@ -45,20 +45,20 @@ * scanc(count, startc, table, mask) */ ENTRY(scanc) - movl sp@(4),d0 | get length + movl %sp@(4),%d0 | get length jeq Lscdone | nothing to do, return - movl sp@(8),a0 | start of scan - movl sp@(12),a1 | table to compare with - movb sp@(19),d1 | and mask to use - movw d2,sp@- | need a scratch register - clrw d2 | clear it out - subqw #1,d0 | adjust for dbra + movl %sp@(8),%a0 | start of scan + movl %sp@(12),%a1 | table to compare with + movb %sp@(19),%d1 | and mask to use + movw %d2,%sp@- | need a scratch register + clrw %d2 | clear it out + subqw #1,%d0 | adjust for dbra Lscloop: - movb a0@+,d2 | get character - movb a1@(0,d2:w),d2 | get table entry - andb d1,d2 | mask it - dbne d0,Lscloop | keep going til no more or non-zero - addqw #1,d0 | overshot by one - movw sp@+,d2 | restore scratch + movb %a0@+,%d2 | get character + movb %a1@(0,%d2:w),%d2 | get table entry + andb %d1,%d2 | mask it + dbne %d0,Lscloop | keep going til no more or non-zero + addqw #1,%d0 | overshot by one + movw %sp@+,%d2 | restore scratch Lscdone: rts diff --git a/sys/lib/libkern/arch/m68k/skpc.S b/sys/lib/libkern/arch/m68k/skpc.S index f5cea15ced1..f932807b473 100644 --- a/sys/lib/libkern/arch/m68k/skpc.S +++ b/sys/lib/libkern/arch/m68k/skpc.S @@ -1,4 +1,4 @@ -/* $OpenBSD: skpc.S,v 1.3 2003/06/02 23:28:08 millert Exp $ */ +/* $OpenBSD: skpc.S,v 1.4 2013/02/02 13:32:06 miod Exp $ */ /* $NetBSD: skpc.S,v 1.2 1994/10/26 06:39:32 cgd Exp $ */ /* @@ -45,14 +45,14 @@ * skpc(mask, count, startc) */ ENTRY(skpc) - movl sp@(8),d0 | get length + movl %sp@(8),%d0 | get length jeq Lskdone | nothing to do, return - movb sp@(7),d1 | mask to use - movl sp@(12),a0 | where to start - subqw #1,d0 | adjust for dbcc + movb %sp@(7),%d1 | mask to use + movl %sp@(12),%a0 | where to start + subqw #1,%d0 | adjust for dbcc Lskloop: - cmpb a0@+,d1 | compate with mask - dbne d0,Lskloop | keep going til no more or zero - addqw #1,d0 | overshot by one + cmpb %a0@+,%d1 | compare with mask + dbne %d0,Lskloop | keep going til no more or zero + addqw #1,%d0 | overshot by one Lskdone: rts diff --git a/sys/lib/libkern/arch/m68k/strcmp.S b/sys/lib/libkern/arch/m68k/strcmp.S index 8305c1c3430..758470f448f 100644 --- a/sys/lib/libkern/arch/m68k/strcmp.S +++ b/sys/lib/libkern/arch/m68k/strcmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: strcmp.S,v 1.4 2007/11/24 19:38:04 deraadt Exp $ */ +/* $OpenBSD: strcmp.S,v 1.5 2013/02/02 13:32:06 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -42,17 +42,17 @@ * right?? */ ENTRY(strcmp) - movl sp@(4),a0 | a0 = string1 - movl sp@(8),a1 | a1 = string2 + movl %sp@(4),%a0 | a0 = string1 + movl %sp@(8),%a1 | a1 = string2 scloop: - movb a0@+,d0 | get *string1 - cmpb a1@+,d0 | compare a byte + movb %a0@+,%d0 | get *string1 + cmpb %a1@+,%d0 | compare a byte bne scexit | not equal, break out - tstb d0 | at end of string1? + tstb %d0 | at end of string1? bne scloop | no, keep going - moveq #0,d0 | strings are equal + moveq #0,%d0 | strings are equal rts scexit: - subb a1@-,d0 | *string1 - *string2 - extbl d0 + subb %a1@-,%d0 | *string1 - *string2 + extbl %d0 rts diff --git a/sys/lib/libkern/arch/m68k/strlen.S b/sys/lib/libkern/arch/m68k/strlen.S index a7f4a301464..7afc6449ca1 100644 --- a/sys/lib/libkern/arch/m68k/strlen.S +++ b/sys/lib/libkern/arch/m68k/strlen.S @@ -1,4 +1,4 @@ -/* $OpenBSD: strlen.S,v 1.4 2007/11/24 19:38:04 deraadt Exp $ */ + /*- * Copyright (c) 1990 The Regents of the University of California. @@ -36,10 +36,10 @@ #include "DEFS.h" ENTRY(strlen) - moveq #-1,d0 - movl sp@(4),a0 | string + moveq #-1,%d0 + movl %sp@(4),%a0 | string slloop: - addql #1,d0 | increment count - tstb a0@+ | null? + addql #1,%d0 | increment count + tstb %a0@+ | null? bne slloop | no, keep going rts diff --git a/sys/lib/libkern/arch/m68k/strncmp.S b/sys/lib/libkern/arch/m68k/strncmp.S index 724e0772986..ee7727a7916 100644 --- a/sys/lib/libkern/arch/m68k/strncmp.S +++ b/sys/lib/libkern/arch/m68k/strncmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: strncmp.S,v 1.4 2007/11/24 19:38:04 deraadt Exp $ */ +/* $OpenBSD: strncmp.S,v 1.5 2013/02/02 13:32:06 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -42,22 +42,22 @@ * right?? */ ENTRY(strncmp) - movl sp@(12),d1 | count + movl %sp@(12),%d1 | count beq scdone | nothing to do - movl sp@(4),a0 | a0 = string1 - movl sp@(8),a1 | a1 = string2 + movl %sp@(4),%a0 | a0 = string1 + movl %sp@(8),%a1 | a1 = string2 scloop: - movb a0@+,d0 | get *string1 - cmpb a1@+,d0 | compare a byte + movb %a0@+,%d0 | get *string1 + cmpb %a1@+,%d0 | compare a byte bne scexit | not equal, break out - tstb d0 | at end of string1? + tstb %d0 | at end of string1? beq scdone | yes, all done - subql #1,d1 | no, adjust count + subql #1,%d1 | no, adjust count bne scloop | more to do, keep going scdone: - moveq #0,d0 | strings are equal + moveq #0,%d0 | strings are equal rts scexit: - subb a1@-,d0 | *string1 - *string2 - extbl d0 + subb %a1@-,%d0 | *string1 - *string2 + extbl %d0 rts diff --git a/sys/lib/libkern/arch/m68k/strncpy.S b/sys/lib/libkern/arch/m68k/strncpy.S index 93abe58adf7..d9d9363024c 100644 --- a/sys/lib/libkern/arch/m68k/strncpy.S +++ b/sys/lib/libkern/arch/m68k/strncpy.S @@ -1,4 +1,4 @@ -/* $OpenBSD: strncpy.S,v 1.4 2007/11/24 19:38:04 deraadt Exp $ */ +/* $OpenBSD: strncpy.S,v 1.5 2013/02/02 13:32:06 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -36,20 +36,20 @@ #include "DEFS.h" ENTRY(strncpy) - movl sp@(4),d0 | return value is toaddr - movl sp@(12),d1 | count + movl %sp@(4),%d0 | return value is toaddr + movl %sp@(12),%d1 | count beq scdone | nothing to do - movl sp@(8),a0 | a0 = fromaddr - movl d0,a1 | a1 = toaddr + movl %sp@(8),%a0 | a0 = fromaddr + movl %d0,%a1 | a1 = toaddr scloop: - movb a0@+,a1@+ | copy a byte + movb %a0@+,%a1@+ | copy a byte beq scploop | copied null, go pad if necessary - subql #1,d1 | adjust count + subql #1,%d1 | adjust count bne scloop | more room, keep going scdone: rts scploop: - subql #1,d1 | adjust count + subql #1,%d1 | adjust count beq scdone | no more room, all done - clrb a1@+ | clear a byte + clrb %a1@+ | clear a byte jra scploop | keep going |