? bcm2835_space.patch ? sys/cscope.out ? sys/arch/arm/arm32/genassym.cf.new Index: build.sh =================================================================== RCS file: /cvsroot/src/build.sh,v retrieving revision 1.323 diff -u -p -r1.323 build.sh --- build.sh 15 Jan 2018 20:39:53 -0000 1.323 +++ build.sh 23 Jan 2018 15:27:58 -0000 @@ -614,7 +614,6 @@ level of source directory" # and with a blank MACHINE_ARCH. # valid_MACHINE_ARCH=' -MACHINE=acorn26 MACHINE_ARCH=arm MACHINE=acorn32 MACHINE_ARCH=arm MACHINE=algor MACHINE_ARCH=mips64el ALIAS=algor64 MACHINE=algor MACHINE_ARCH=mipsel DEFAULT Index: distrib/acorn26/Makefile =================================================================== RCS file: distrib/acorn26/Makefile diff -N distrib/acorn26/Makefile --- distrib/acorn26/Makefile 6 Mar 2007 21:56:47 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,9 +0,0 @@ -# $NetBSD: Makefile,v 1.4 2007/03/06 21:56:47 bouyer Exp $ - -SUBDIR= instkernel cdroms -TARGETS+= release - -iso_image: - ${MAKEDIRTARGET} cdroms iso_image - -.include Index: distrib/acorn26/cdroms/Makefile =================================================================== RCS file: distrib/acorn26/cdroms/Makefile diff -N distrib/acorn26/cdroms/Makefile --- distrib/acorn26/cdroms/Makefile 6 Mar 2007 21:56:47 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,6 +0,0 @@ -# $NetBSD: Makefile,v 1.1 2007/03/06 21:56:47 bouyer Exp $ - -SUBDIR= installcd -TARGETS+= release iso_image - -.include Index: distrib/acorn26/cdroms/installcd/Makefile =================================================================== RCS file: distrib/acorn26/cdroms/installcd/Makefile diff -N distrib/acorn26/cdroms/installcd/Makefile --- distrib/acorn26/cdroms/installcd/Makefile 6 Mar 2007 21:56:48 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,5 +0,0 @@ -# $NetBSD: Makefile,v 1.1 2007/03/06 21:56:48 bouyer Exp $ -CDBASE= acorn26cd # gives ${CDBASE}.iso -CDRELEASE= true # include $RELEASEDIR/$MACHINE - -.include "${.CURDIR}/../../../common/Makefile.bootcd" Index: distrib/acorn26/instkernel/Makefile =================================================================== RCS file: distrib/acorn26/instkernel/Makefile diff -N distrib/acorn26/instkernel/Makefile --- distrib/acorn26/instkernel/Makefile 24 Jan 2017 18:04:01 -0000 1.17 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,37 +0,0 @@ -# $NetBSD: Makefile,v 1.17 2017/01/24 18:04:01 christos Exp $ - -.include -.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" - -IMAGE= ramdisk.fs -IMAGESIZE= 2112k -MAKEFS_FLAGS+= -f 15 - -WARNS= 1 -DBG= -Os - -CRUNCHBIN= ramdiskbin -LISTS= ${.CURDIR}/list ${DISTRIBDIR}/common/list.sysinst -MTREECONF= ${DISTRIBDIR}/common/mtree.common -IMAGEENDIAN= le -MAKEDEVTARGETS= ramdisk -IMAGEDEPENDS= ${CRUNCHBIN} \ - dot.profile \ - ${NETBSDSRCDIR}/etc/group ${NETBSDSRCDIR}/etc/master.passwd \ - ${NETBSDSRCDIR}/etc/netconfig ${DISTRIBDIR}/common/protocols \ - ${DISTRIBDIR}/common/services - -# Use stubs to eliminate some large stuff from libc -HACKSRC= ${DISTRIBDIR}/utils/libhack -.include "${HACKSRC}/Makefile.inc" -${CRUNCHBIN}: libhack.o - -MDSETTARGETS= INSTALL ${IMAGE} - -MDSET_RELEASEDIR= installation/misc - -.include "${DISTRIBDIR}/common/Makefile.crunch" -.include "${DISTRIBDIR}/common/Makefile.makedev" -.include "${DISTRIBDIR}/common/Makefile.image" -.include "${DISTRIBDIR}/common/Makefile.mdset" - -.include Index: distrib/acorn26/instkernel/dot.profile =================================================================== RCS file: distrib/acorn26/instkernel/dot.profile diff -N distrib/acorn26/instkernel/dot.profile --- distrib/acorn26/instkernel/dot.profile 26 Jul 2003 17:06:23 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,64 +0,0 @@ -# $NetBSD: dot.profile,v 1.3 2003/07/26 17:06:23 salo Exp $ -# -# Copyright (c) 1997 Perry E. Metzger -# Copyright (c) 1994 Christopher G. Demetriou -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# 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 for the -# NetBSD Project. See http://www.NetBSD.org/ for -# information about NetBSD. -# 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 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. -# -# <> - -PATH=/sbin:/bin:/usr/bin:/usr/sbin:/ -export PATH -TERM=sun -export TERM -HOME=/ -export HOME - -umask 022 - -ROOTDEV=/dev/md0a - -if [ "X${DONEPROFILE}" = "X" ]; then - DONEPROFILE=YES - export DONEPROFILE - - # set up some sane defaults - echo 'erase ^?, werase ^W, kill ^U, intr ^C' - stty newcrt werase ^W intr ^C kill ^U erase ^? 9600 - echo '' - - # mount the ramdisk read write - mount -u $ROOTDEV / - - # mount the kern_fs so that we can examine the dmesg state - mount -t kernfs /kern /kern - - # run the installation or upgrade script. - sysinst -fi Index: distrib/acorn26/instkernel/list =================================================================== RCS file: distrib/acorn26/instkernel/list diff -N distrib/acorn26/instkernel/list --- distrib/acorn26/instkernel/list 3 Jul 2011 23:11:31 -0000 1.21 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,73 +0,0 @@ -# $NetBSD: list,v 1.21 2011/07/03 23:11:31 tron Exp $ - -SRCDIRS bin sbin external/bsd/less/bin usr.bin usr.sbin - -PROG bin/cat -PROG bin/chmod -PROG bin/cp -PROG bin/dd -PROG bin/df -PROG bin/ed -PROG bin/ln -PROG bin/ls -PROG bin/mkdir -PROG bin/mv -PROG bin/pax usr/bin/tar -PROG bin/pwd -PROG bin/rm -PROG bin/sh -PROG bin/stty -PROG bin/sync - -PROG sbin/chown bin/chgrp -PROG sbin/disklabel -PROG sbin/fsck -PROG sbin/fsck_ffs -PROG sbin/ifconfig -PROG sbin/init -PROG sbin/mknod -PROG sbin/mount -PROG sbin/mount_cd9660 -PROG sbin/mount_ffs -PROG sbin/mount_filecore -PROG sbin/mount_kernfs -PROG sbin/mount_msdos -PROG sbin/mount_nfs -PROG sbin/newfs sbin/mount_mfs -PROG sbin/ping -PROG sbin/reboot sbin/halt -PROG sbin/restore sbin/rrestore -PROG sbin/route -PROG sbin/shutdown -PROG sbin/slattach -PROG sbin/swapctl -PROG sbin/umount - -PROG usr/bin/ftp -PROG usr/bin/gzip usr/bin/gzcat usr/bin/gunzip -PROG usr/bin/less usr/bin/more -PROG usr/bin/sed -PROG usr/bin/tip - -PROG usr/sbin/chroot - -SPECIAL gzip srcdir distrib/utils/x_gzip -SPECIAL ping srcdir distrib/utils/x_ping - -LIBS libhack.o -ledit -lutil -lcurses -lterminfo -lrmt -lcrypt -ll -lm -lz -lprop - -# init invokes the shell as -sh -ARGVLN sh -sh - -# we need the boot blocks /usr/mdec -#COPYDIR ${DESTDIR}/usr/mdec usr/mdec - -# various files that we need in /etc for the install -COPY ${NETBSDSRCDIR}/etc/group etc/group -COPY ${NETBSDSRCDIR}/etc/master.passwd etc/master.passwd -COPY ${NETBSDSRCDIR}/etc/netconfig etc/netconfig -COPY ${DISTRIBDIR}/common/protocols etc/protocols -COPY ${DISTRIBDIR}/common/services etc/services - -# and the installation tools -COPY ${CURDIR}/dot.profile .profile Index: distrib/cdrom/Makefile =================================================================== RCS file: /cvsroot/src/distrib/cdrom/Makefile,v retrieving revision 1.51 diff -u -p -r1.51 Makefile --- distrib/cdrom/Makefile 11 Feb 2017 03:07:06 -0000 1.51 +++ distrib/cdrom/Makefile 23 Jan 2018 15:28:00 -0000 @@ -144,7 +144,6 @@ EASTER_EGG?= /dev/null ##### MACHINE_ARCH for possible shared sets for each (shared) port ##### -MACHINE_ARCH.acorn26= arm MACHINE_ARCH.acorn32= arm MACHINE_ARCH.algor= mipsel MACHINE_ARCH.amiga= m68k Index: distrib/cdrom/current.conf =================================================================== RCS file: /cvsroot/src/distrib/cdrom/current.conf,v retrieving revision 1.12 diff -u -p -r1.12 current.conf --- distrib/cdrom/current.conf 24 Feb 2014 07:23:38 -0000 1.12 +++ distrib/cdrom/current.conf 23 Jan 2018 15:28:00 -0000 @@ -29,7 +29,6 @@ CD_IMAGES= ${targetcd}-${ISO_RELEASE} CD_IMAGES+= multi-cd1-${ISO_RELEASE} CD_IMAGES+= multi-cd2-${ISO_RELEASE} CD_IMAGES+= multi-cd3-${ISO_RELEASE} -CD_IMAGES+= acorn26cd-${ISO_RELEASE} CD_IMAGES+= acorn32cd-${ISO_RELEASE} CD_IMAGES+= algorcd-${ISO_RELEASE} CD_IMAGES+= alphacd-${ISO_RELEASE} @@ -157,7 +156,6 @@ BASE_PORTS.multi-cd2-${ISO_RELEASE} = al BASE_PORTS.multi-cd3-${ISO_RELEASE}= cobalt hpcmips pmax # vax -BASE_PORTS.acorn26cd-${ISO_RELEASE}=acorn26 BASE_PORTS.acorn32cd-${ISO_RELEASE}=acorn32 BASE_PORTS.algorcd-${ISO_RELEASE}=algor BASE_PORTS.alphacd-${ISO_RELEASE}=alpha Index: distrib/notes/Makefile =================================================================== RCS file: /cvsroot/src/distrib/notes/Makefile,v retrieving revision 1.44 diff -u -p -r1.44 Makefile --- distrib/notes/Makefile 24 Feb 2014 07:23:39 -0000 1.44 +++ distrib/notes/Makefile 23 Jan 2018 15:28:00 -0000 @@ -10,7 +10,6 @@ TARGETS+= release SUBDIR= ${RELEASEMACHINE} .endif .else -SUBDIR+= acorn26 SUBDIR+= acorn32 SUBDIR+= alpha SUBDIR+= amd64 Index: distrib/notes/acorn26/Makefile =================================================================== RCS file: distrib/notes/acorn26/Makefile diff -N distrib/notes/acorn26/Makefile --- distrib/notes/acorn26/Makefile 21 Jul 2002 08:14:47 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,5 +0,0 @@ -# $NetBSD: Makefile,v 1.2 2002/07/21 08:14:47 lukem Exp $ - -MERGED_SRCS+= ${COMMON}/sysinst ${COMMON}/xfer - -.include Index: distrib/notes/acorn26/contents =================================================================== RCS file: distrib/notes/acorn26/contents diff -N distrib/notes/acorn26/contents --- distrib/notes/acorn26/contents 19 May 2015 19:30:26 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,266 +0,0 @@ -.\" $NetBSD: contents,v 1.2 2015/05/19 19:30:26 snj Exp $ -.\" -.\" Copyright (c) 1999-2005 The NetBSD Foundation, Inc. -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" 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. -.\" -. -.Ss2 NetBSD/\*M subdirectory structure -The \*M-specific portion of the -.Nx -\*V release is found in the -.Pa \*M -subdirectory of the distribution: -.ie \n[FOR_RELEASE] .Pa \&.../NetBSD-\*V/\*M/ . -.el .Pa Pf \&.../arch/\*M/snapshot/ Ar yyyymmdd/ . -It contains the following files and directories: -.Pp -.(tag INSTALL.html -compact \" top level -. It Pa INSTALL.html -. It Pa INSTALL.ps -. It Pa INSTALL.txt -. It Pa INSTALL.more -Installation notes in various file formats, including this file. -The -.Pa \&.more -file contains underlined text using the -.Xr more 1 -conventions for indicating italic and bold display. -. -.\" MD binary and installation directories --------------------------- -. -. It Pa binary/ -. -. (tag kernel/ -compact \" binary/ -. -. It Pa kernel/ -. -. (tag netbsd.gz -compact \" binary/kernel -. -. It Pa netbsd-GENERIC.gz -. -A gzipped -.Nx -kernel containing code for everything supported in this release. -. -. It Pa netbsd-FOURMEG.gz -. -A somewhat smaller kernel, intended to be usable on systems with -four megabytes of RAM. -. -. tag) \" binary/kernel/ -. It Pa sets/ -\*M binary distribution sets; -see below. -. tag) \" binary/ -. It Pa installation/ -. -. (tag miniroot/ -compact \" installation/ -. -. It Pa misc/ -. -Miscellaneous \*M installation utilities; see -installation section below. -. -. tag) \" installation/ -. -.tag) \" top level -. -.\" ------------------------------------------------------------------ -. -. -.Ss2 Binary distribution sets -.\" -.\" ------------------------------------------------------------------ -.\" XXX: most sets except kern and xserver should be in notes/common -.\" -The -.Nx -\*M -binary distribution sets contain the binaries which -comprise the -.Nx -\*V release for \*M. -The binary distribution sets can be found in the -.Pa \*M/binary/sets -subdirectory -of the -.Nx -\*V -distribution tree, and are as follows: -.(tag xserver \" sets -. -.It Sy base -The -.Nx -\*V -\*M -.Sy base -binary distribution. -You -.Em must -install this distribution set. -It contains the base -.Nx -utilities that are necessary for the -system to run and be minimally functional. -. -.It Sy comp -Things needed for compiling programs. -This set includes the system include files -.Pq Pa /usr/include -and the various system libraries (except the shared -libraries, which are included as part of the -.Sy base -set). -This set also includes the manual pages for -all of the utilities it contains, as well as the -system call and library manual pages. -. -.It Sy etc -This distribution set contains the system -configuration files that reside in -.Pa /etc -and in several other places. -This set -.Em must -be installed if you are installing the system from scratch, but should -.Em not -be used if you are upgrading. -. -.It Sy games -This set includes the games and their manual pages. -. -.\" MD kernel set(s) ------------------------------------------------- -. -.It Sy kern-GENERIC -This set contains a -.Nx*M -\*V -.Li GENERIC -kernel, named -.Pa /netbsd . -You -.Em must -install this distribution set. -. -.\" ------------------------------------------------------------------ -. -.It Sy man -This set includes all of the manual pages for the -binaries and other software contained in the -.Sy base -set. -Note that it does not include any of the manual pages -that are included in the other sets. -. -.It Sy misc -This set includes the system dictionaries, -the typesettable document set, and other files from -.Pa /usr/share . -. -.It Sy modules -This set includes kernel modules to add functionality to a running system. -. -.It Sy text -This set includes -.Nx Ns 's -text processing tools, including -.Xr groff 1 , -all related programs, and their manual pages. -. -.tag) \" sets -. -. -.\" X sets ----------------------------------------------------------- -.\" XXX: XOrg vs XFree -.\" XXX: ports without xserver -.Pp -.Nx -maintains its own set of sources for the X Window System in order to -assure tight integration and compatibility. -These sources are based on X.Org. -Binary sets for the X Window System are distributed with -.Nx . -The sets are: -.(tag xserver \" x sets -. -.It Sy xbase -The basic files needed for a complete X -client environment. -This does not include the X servers. -. -.It Sy xcomp -The extra libraries and include files needed to compile X source code. -. -.It Sy xfont -Fonts needed by the X server and by X clients. -. -.It Sy xetc -Configuration files for X which could be locally modified. -. -.It Sy xserver -The X server. -. -.tag) \" x sets -. -.\" ------------------------------------------------------------------ -. -. -.\" MI DISCUSSION OF BINARY SETS ------------------------------------- -.\" XXX: should be in notes/common -. -.Pp -The \*M binary distribution sets are distributed as gzipped tar files -named with the extension -.Sy .tgz , -e.g. -.Pa base.tgz . -. -. -.Pp -The instructions given for extracting the source sets work equally -well for the binary sets, but it is worth noting that if you use that -method, the filenames stored in the sets are relative and therefore -the files are extracted -.Em below the current directory . -Therefore, if you want to extract the binaries into your system, i.e. -replace the system binaries with them, you have to run the -.Ic "tar -xzpf" -command from the root directory ( -.Pa / -) of your system. -. -. -.\" MD DISCUSSION ---------------------------------------------------- -. -.Pp -There is a copy of the -.Nx Ns /acorn26 -bootloader, -.Ic boot26 , -in the -.Pa installation/misc -subdirectory. -This is a RISC OS relocatable module, and should have its file -type set to ffa (Module) once it's been copied to a RISC OS system. Index: distrib/notes/acorn26/hardware =================================================================== RCS file: distrib/notes/acorn26/hardware diff -N distrib/notes/acorn26/hardware --- distrib/notes/acorn26/hardware 22 Oct 2006 23:52:19 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,72 +0,0 @@ -.\" $NetBSD: hardware,v 1.4 2006/10/22 23:52:19 bjh21 Exp $ -. -.Nx*M -\*V should support all common Acorn machines fitted with -ARM2, ARM3 and ARM250 CPUs. -This includes all Archimedes systems -(except for the A500 and A680 prototypes), -all R-series workstations, the BBC A3000, -the A5000, A4, A3010, A3020 and A4000. -. -.Ss2 Supported devices -.(bullet -offset indent -Memory -.(bullet -compact -at least 8 MB of RAM. -4 MB systems should work, but tend to run out of memory too easily to be -of any use. -.bullet) -.It -On-board video -.Pq Em arcvideo -.It -Standard keyboard and mouse -.Pq Em arckbd -.It -Expansion Cards (AKA -.Dq podules ) . -.(bullet -compact -Acorn AKA25 Ethernet (Ether1, -.Em ei ) -.It -Atomwide Ethernet III (Ether3, -.Em ea ) -.It -i-cubed EtherLan 100-, 200- and 500-series (EtherH, -.Em eh ) -.It -D.T. Software IDE interface -.Pq Em dtide -.It -HCCS IDE interface -.Pq Em hcide -.It -Acorn AKA30, AKA31, or AKA32 SCSI interface -.Pq Em sec -.It -HCCS 8-bit SCSI interface -.Pq Em hcsc -.It -Oak Solutions 16-bit SCSI interface -.Pq Em oak -.bullet) -.Pp -.Em "New machines (A5000, A4, A3010, A3020 and A4000)" -.Em "may support the following, but this is mostly untested" -.It -On-board IDE controller -.Pq Em wdc -.It -Serial port -.Pq Em com -.It -Parallel port -.Pq Em lpt -.bullet) -. -.Pp -.Nx*M -uses the machine's ROM OS to boot, and hence depends slightly on it. -It's been tested with RISC OS 3.10 and RISC OS 3.11, and should work -with other versions of RISC OS as well. -It hasn't been tested with Arthur at all. Index: distrib/notes/acorn26/install =================================================================== RCS file: distrib/notes/acorn26/install diff -N distrib/notes/acorn26/install --- distrib/notes/acorn26/install 25 May 2002 15:46:03 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -.\" $NetBSD: install,v 1.3 2002/05/25 15:46:03 bjh21 Exp $ -. -.so ../common/sysinst Index: distrib/notes/acorn26/prep =================================================================== RCS file: distrib/notes/acorn26/prep diff -N distrib/notes/acorn26/prep --- distrib/notes/acorn26/prep 11 Jul 2002 04:52:48 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -.\" $NetBSD: prep,v 1.4 2002/07/11 04:52:48 scottr Exp $ -. -If you're planning on installing -.Nx*M -on a hard disk, first make sure it's supported (see above). -Then make sure there's nothing you want to keep on it, since -.Nx*M 's -ability to share a hard disk with RISC OS is at best untested. -.Pp -Alternatively, -.Nx*M -can be made to run diskless, getting all its file systems from an NFS server. Index: distrib/notes/acorn26/upgrade =================================================================== RCS file: distrib/notes/acorn26/upgrade diff -N distrib/notes/acorn26/upgrade --- distrib/notes/acorn26/upgrade 23 Apr 2009 01:56:48 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,5 +0,0 @@ -.\" $NetBSD: upgrade,v 1.2 2009/04/23 01:56:48 snj Exp $ -. -.\" No machine-dependent upgrade problems yet. -. -.so ../common/upgrade Index: distrib/notes/acorn26/xfer =================================================================== RCS file: distrib/notes/acorn26/xfer diff -N distrib/notes/acorn26/xfer --- distrib/notes/acorn26/xfer 27 May 2011 17:38:41 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,41 +0,0 @@ -.\" $NetBSD: xfer,v 1.3 2011/05/27 17:38:41 tsutsui Exp $ -.\" -.\" Copyright (c) 1999-2004 The NetBSD Foundation, Inc. -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" 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. -.\" -. -.\" ---------- MD instructions on setting up boot media -. -To boot -.Nx , -you will need the bootloader -.Pq Ic boot26 -and the kernel you wish to boot on a RISC OS file system somewhere. -.Ic boot26 -can boot gzipped kernels, so there's no need to gunzip it. -.Pp -. -.\" --------- MI instructions for getting distribution off installation medium -. -.so ../common/xfer Index: distrib/notes/common/contents =================================================================== RCS file: /cvsroot/src/distrib/notes/common/contents,v retrieving revision 1.171 diff -u -p -r1.171 contents --- distrib/notes/common/contents 11 Jan 2015 04:03:47 -0000 1.171 +++ distrib/notes/common/contents 23 Jan 2018 15:28:00 -0000 @@ -121,12 +121,6 @@ and 2.4 systems (i.e. those that have fl It has a RAM-disk installer. .\} . -.if \n[acorn26] \{\ -. It Pa netbsd-FOURMEG.gz -A somewhat smaller kernel, intended to be usable on systems with -four megabytes of RAM. -.\} -. .if \n[acorn32] \{\ . It Pa netbsd-NC.gz A kernel intended for Acorn Network Computers. @@ -982,19 +976,6 @@ command from the root directory ( .\" ---------------------------- MD DISCUSSION . . -.if \n[acorn26] \{\ -.Pp -There is a copy of the -.Nx Ns /acorn26 -bootloader, -.Ic boot26 , -in the -.Pa installation/misc -subdirectory. -This is a RISC OS relocatable module, and should have its file -type set to ffa (Module) once it's been copied to a RISC OS system. -.\} -. . .if \n[atari] \{\ .Pp Index: distrib/notes/common/macros =================================================================== RCS file: /cvsroot/src/distrib/notes/common/macros,v retrieving revision 1.42 diff -u -p -r1.42 macros --- distrib/notes/common/macros 19 May 2015 19:45:57 -0000 1.42 +++ distrib/notes/common/macros 23 Jan 2018 15:28:00 -0000 @@ -369,7 +369,7 @@ .\" Define registers for MACHINE_ARCHs with multiple or different MACHINEs . .ds A \*M -.if \n[acorn26]:\n[acorn32]:\n[cats]:\n[evbarm]:\n[hpcarm]:\n[iyonix]:\n[netwinder]:\n[shark]:\n[zaurus] .ds A arm +.if \n[acorn32]:\n[cats]:\n[evbarm]:\n[hpcarm]:\n[iyonix]:\n[netwinder]:\n[shark]:\n[zaurus] .ds A arm .if \n[sun2] .ds A m68000 .if \n[amiga]:\n[atari]:\n[cesfic]:\n[hp300]:\n[luna68k]:\n[mac68k]:\n[mvme68k]:\n[news68k]:\n[next68k]:\n[sun3]:\n[x68k] .ds A m68k .if \n[emips]:\n[ews4800mips]:\n[mipsco]:\n[newsmips]:\n[sbmips]:\n[sgimips] .ds A mipseb Index: distrib/notes/common/main =================================================================== RCS file: /cvsroot/src/distrib/notes/common/main,v retrieving revision 1.539 diff -u -p -r1.539 main --- distrib/notes/common/main 25 Oct 2017 18:07:33 -0000 1.539 +++ distrib/notes/common/main 23 Jan 2018 15:28:01 -0000 @@ -41,7 +41,7 @@ . .nr FOR_RELEASE 1 .nr DOC_XR 1 -.ds MACHINE_LIST acorn26 acorn32 algor alpha amd64 amiga amigappc arc atari +.ds MACHINE_LIST acorn32 algor alpha amd64 amiga amigappc arc atari .as MACHINE_LIST " bebox cats cesfic cobalt dreamcast emips evbarm evbmips .as MACHINE_LIST " evbppc evbsh3 ews4800mips hp300 hppa hpcarm hpcmips hpcsh .as MACHINE_LIST " i386 ibmnws iyonix landisk luna68k mac68k macppc mipsco @@ -751,7 +751,7 @@ section near the beginning of this docum .Pp In .Nx -7.0, most ARM ports (all but acorn26, acorn32, and epoc32) have switched +7.0, most ARM ports (all but acorn32, and epoc32) have switched to the official standard ABI .Pq EABI5 which is recommended by ARM for ELF binaries. Index: distrib/notes/common/postinstall =================================================================== RCS file: /cvsroot/src/distrib/notes/common/postinstall,v retrieving revision 1.81 diff -u -p -r1.81 postinstall --- distrib/notes/common/postinstall 19 May 2015 19:30:27 -0000 1.81 +++ distrib/notes/common/postinstall 23 Jan 2018 15:28:01 -0000 @@ -160,7 +160,6 @@ For example: .Pp . .ds IFname le0 -.if \n[acorn26] .ds IFname ei0 .if \n[acorn32] .ds IFname ei0 .if \n[amd64] .ds IFname wm0 .if \n[arc] .ds IFname sn0 Index: distrib/notes/common/sysinst =================================================================== RCS file: /cvsroot/src/distrib/notes/common/sysinst,v retrieving revision 1.106 diff -u -p -r1.106 sysinst --- distrib/notes/common/sysinst 19 May 2015 19:30:27 -0000 1.106 +++ distrib/notes/common/sysinst 23 Jan 2018 15:28:01 -0000 @@ -52,7 +52,7 @@ \n[playstation2]:\n[sandpoint]:\n[sbmips]:\n[sgimips]:\n[x86_64] \{\ . ds part_max p .\} -.if \n[acorn26]:\n[acorn32]:\n[cats]:\n[evbarm]:\n[evbppc]:\n[ews4800mips]:\ +.if \n[acorn32]:\n[cats]:\n[evbarm]:\n[evbppc]:\n[ews4800mips]:\ \n[sandpoint]:\n[shark] \{\ . ds part_usr e .\} @@ -83,7 +83,7 @@ covers many details for the sake of comp Do not let this discourage you; the install program is not hard to use. . -.if !\n[acorn26]:\n[acorn32]:\n[atari]:\n[ews4800mips]:\n[hppa]:\n[mac68k]:\n[macppc]:\n[mvme68k]:\n[news68k]:\n[newsmips]:\n[pmax]:\n[sgimips]:\n[sparc]:\n[sparc64]:\n[x68k] \{\ +.if !\n[acorn32]:\n[atari]:\n[ews4800mips]:\n[hppa]:\n[mac68k]:\n[macppc]:\n[mvme68k]:\n[news68k]:\n[newsmips]:\n[pmax]:\n[sgimips]:\n[sparc]:\n[sparc64]:\n[x68k] \{\ .It .To 2 "Possible hardware problems" .Em Possible hardware problems @@ -97,7 +97,7 @@ Non-removable devices can be disabled wi .Ic boot .Fl c to enter it). -.\} \" !\n[acorn26]:\n[acorn32]:\n[atari]:\n[ews4800mips]:\n[hppa]:\n[mac68k]\:[macppc]:\n[mvme68k]:\n[news68k]:\n[newsmips]:\n[pmax]:\n[sgimips]:\n[sparc]:\n[sparc64]:\n[x68k] +.\} \" !\n[acorn32]:\n[atari]:\n[ews4800mips]:\n[hppa]:\n[mac68k]\:[macppc]:\n[mvme68k]:\n[news68k]:\n[newsmips]:\n[pmax]:\n[sgimips]:\n[sparc]:\n[sparc64]:\n[x68k] .if \n[mac68k] \{\ .It .To 2 "Possible hardware-specific issues" @@ -189,7 +189,7 @@ volume on a netboot server as described .el \{\ .ie \n[mac68k] The Mac OS Booter application and an Installation Kernel .el \{\ -.ie \n[acorn26]:\n[arc]:\n[cats]:\n[evbppc]:\n[macppc]:\n[sparc] \{\ +.ie \n[arc]:\n[cats]:\n[evbppc]:\n[macppc]:\n[sparc] \{\ Some form of bootable media, described above. .\} .el \{\ @@ -210,7 +210,6 @@ An FPU is not required but will be used .ie !\n[amd64] \{\ .It A minimum of -.if \n[acorn26] 8 MB .if \n[alpha] 32 MB .if \n[arc] 16 MB .if \n[atari] 4 MB (TT030/Falcon) or 16 MB (Hades/Milan) @@ -233,7 +232,6 @@ of memory installed. An optical drive. .It A hard drive with at least -.if \n[acorn26] 500 .if \n[acorn32] 500 .if \n[alpha] 700 .if \n[amd64] 700 @@ -344,7 +342,7 @@ kernels while booting. .It The Quick Installation .(bullet -.ie \n[acorn26]:\n[atari]:\n[cats]:\n[evbppc]:\n[hppa]:\n[macppc]:\n[pmax]:\n[sgimips]:\n[sparc]:\n[sparc64] \{\ +.ie \n[atari]:\n[cats]:\n[evbppc]:\n[hppa]:\n[macppc]:\n[pmax]:\n[sgimips]:\n[sparc]:\n[sparc64] \{\ Boot the system as described above. You should be at the .Ic sysinst @@ -640,13 +638,13 @@ As an alternative, try using the Traditi method of installation described in the next section. .\} \" \n[mac68k] .el \{\ -.ie \n[acorn26]:\n[cats]:\n[evbppc]:\n[macppc]:\n[pmax]:\n[sgimips]:\n[sparc]:\n[sparc64] \{\ +.ie \n[cats]:\n[evbppc]:\n[macppc]:\n[pmax]:\n[sgimips]:\n[sparc]:\n[sparc64] \{\ .Pp You may want to read the boot messages, to notice your disk's name and capacity. Its name will be something like .Li sd0 -.if \n[acorn26]:\n[cats]:\n[evbppc]:\n[macppc]:\n[sparc64] \{\ +.if \n[cats]:\n[evbppc]:\n[macppc]:\n[sparc64] \{\ or .Li wd0 .\} @@ -659,7 +657,7 @@ You will also need to know the name, to .Ic sysinst which disk to use. The most important thing to know is that -.if \n[acorn26]:\n[cats]:\n[evbppc]:\n[macppc]:\n[sparc64] \{\ +.if \n[cats]:\n[evbppc]:\n[macppc]:\n[sparc64] \{\ .Li wd0 is .Nx Ns 's @@ -966,7 +964,7 @@ or .Li rz1 .\} .el \{\ -.if \n[acorn26]:\n[alpha]:\n[amd64]:\n[cats]:\n[i386]:\n[mac68k]:\n[macppc]:\n[sparc64] \{\ +.if \n[alpha]:\n[amd64]:\n[cats]:\n[i386]:\n[mac68k]:\n[macppc]:\n[sparc64] \{\ .Li wd0 , .Li wd1 , .\} Index: distrib/sets/lists/base/mi =================================================================== RCS file: /cvsroot/src/distrib/sets/lists/base/mi,v retrieving revision 1.1168 diff -u -p -r1.1168 mi --- distrib/sets/lists/base/mi 14 Jan 2018 22:46:09 -0000 1.1168 +++ distrib/sets/lists/base/mi 23 Jan 2018 15:28:03 -0000 @@ -4360,7 +4360,7 @@ ./usr/share/man/cat3f base-obsolete obsolete ./usr/share/man/cat3lua base-man-share ./usr/share/man/cat4 base-man-share -./usr/share/man/cat4/acorn26 base-man-share +./usr/share/man/cat4/acorn26 base-man-share obsolete ./usr/share/man/cat4/acorn32 base-man-share ./usr/share/man/cat4/alpha base-man-share ./usr/share/man/cat4/amiga base-man-share @@ -4402,7 +4402,7 @@ ./usr/share/man/cat6 base-man-share ./usr/share/man/cat7 base-man-share ./usr/share/man/cat8 base-man-share -./usr/share/man/cat8/acorn26 base-man-share +./usr/share/man/cat8/acorn26 base-man-share obsolete ./usr/share/man/cat8/acorn32 base-man-share ./usr/share/man/cat8/algor base-man-share ./usr/share/man/cat8/alpha base-man-share @@ -4463,7 +4463,7 @@ ./usr/share/man/cat8/x86 base-man-share ./usr/share/man/cat8/x86_64 base-obsolete obsolete ./usr/share/man/cat9 base-man-share -./usr/share/man/cat9/acorn26 base-man-share +./usr/share/man/cat9/acorn26 base-man-share obsolete ./usr/share/man/cat9/alpha base-man-share ./usr/share/man/cat9/amiga base-man-share ./usr/share/man/cat9/arm26 base-obsolete obsolete @@ -4490,7 +4490,7 @@ ./usr/share/man/html3f base-man-share ./usr/share/man/html3lua base-man-share ./usr/share/man/html4 base-man-share -./usr/share/man/html4/acorn26 base-man-share +./usr/share/man/html4/acorn26 base-man-share obsolete ./usr/share/man/html4/acorn32 base-man-share ./usr/share/man/html4/alpha base-man-share ./usr/share/man/html4/amiga base-man-share @@ -4531,7 +4531,7 @@ ./usr/share/man/html6 base-man-share ./usr/share/man/html7 base-man-share ./usr/share/man/html8 base-man-share -./usr/share/man/html8/acorn26 base-man-share +./usr/share/man/html8/acorn26 base-man-share obsolete ./usr/share/man/html8/acorn32 base-man-share ./usr/share/man/html8/algor base-man-share ./usr/share/man/html8/alpha base-man-share @@ -4592,7 +4592,7 @@ ./usr/share/man/html8/x86 base-man-share ./usr/share/man/html8/x86_64 base-obsolete obsolete ./usr/share/man/html9 base-man-share -./usr/share/man/html9/acorn26 base-man-share +./usr/share/man/html9/acorn26 base-man-share obsolete ./usr/share/man/html9/alpha base-man-share ./usr/share/man/html9/amiga base-man-share ./usr/share/man/html9/arm26 base-obsolete obsolete @@ -4621,7 +4621,7 @@ ./usr/share/man/man3f base-man-share ./usr/share/man/man3lua base-man-share ./usr/share/man/man4 base-man-share -./usr/share/man/man4/acorn26 base-man-share +./usr/share/man/man4/acorn26 base-man-share obsolete ./usr/share/man/man4/acorn32 base-man-share ./usr/share/man/man4/alpha base-man-share ./usr/share/man/man4/amiga base-man-share @@ -4663,7 +4663,7 @@ ./usr/share/man/man6 base-man-share ./usr/share/man/man7 base-man-share ./usr/share/man/man8 base-man-share -./usr/share/man/man8/acorn26 base-man-share +./usr/share/man/man8/acorn26 base-man-share obsolete ./usr/share/man/man8/acorn32 base-man-share ./usr/share/man/man8/algor base-man-share ./usr/share/man/man8/alpha base-man-share @@ -4724,7 +4724,7 @@ ./usr/share/man/man8/x86 base-man-share ./usr/share/man/man8/x86_64 base-obsolete obsolete ./usr/share/man/man9 base-man-share -./usr/share/man/man9/acorn26 base-man-share +./usr/share/man/man9/acorn26 base-man-share obsolete ./usr/share/man/man9/alpha base-man-share ./usr/share/man/man9/amiga base-man-share ./usr/share/man/man9/arm26 base-obsolete obsolete Index: distrib/sets/lists/comp/ad.arm =================================================================== RCS file: /cvsroot/src/distrib/sets/lists/comp/ad.arm,v retrieving revision 1.79 diff -u -p -r1.79 ad.arm --- distrib/sets/lists/comp/ad.arm 1 Aug 2017 20:07:43 -0000 1.79 +++ distrib/sets/lists/comp/ad.arm 23 Jan 2018 15:28:03 -0000 @@ -1,5 +1,5 @@ # $NetBSD: ad.arm,v 1.79 2017/08/01 20:07:43 joerg Exp $ -./usr/include/acorn26 comp-c-include +./usr/include/acorn26 comp-c-include obsolete ./usr/include/acorn26/ansi.h comp-obsolete obsolete ./usr/include/acorn26/aout_machdep.h comp-obsolete obsolete ./usr/include/acorn26/asm.h comp-obsolete obsolete @@ -9,7 +9,7 @@ ./usr/include/acorn26/cdefs.h comp-obsolete obsolete ./usr/include/acorn26/cpu.h comp-obsolete obsolete ./usr/include/acorn26/db_machdep.h comp-obsolete obsolete -./usr/include/acorn26/disklabel.h comp-c-include +./usr/include/acorn26/disklabel.h comp-c-include obsolete ./usr/include/acorn26/elf_machdep.h comp-obsolete obsolete ./usr/include/acorn26/endian.h comp-obsolete obsolete ./usr/include/acorn26/endian_machdep.h comp-obsolete obsolete @@ -24,7 +24,7 @@ ./usr/include/acorn26/int_limits.h comp-obsolete obsolete ./usr/include/acorn26/int_mwgwtypes.h comp-obsolete obsolete ./usr/include/acorn26/int_types.h comp-obsolete obsolete -./usr/include/acorn26/intr.h comp-c-include +./usr/include/acorn26/intr.h comp-c-include obsolete ./usr/include/acorn26/ipkdb.h comp-obsolete obsolete ./usr/include/acorn26/irq.h comp-obsolete obsolete ./usr/include/acorn26/limits.h comp-obsolete obsolete @@ -48,7 +48,7 @@ ./usr/include/acorn26/trap.h comp-obsolete obsolete ./usr/include/acorn26/types.h comp-obsolete obsolete ./usr/include/acorn26/varargs.h comp-obsolete obsolete -./usr/include/acorn26/vmparam.h comp-c-include +./usr/include/acorn26/vmparam.h comp-c-include obsolete ./usr/include/acorn26/wchar_limits.h comp-obsolete obsolete ./usr/include/acorn32 comp-c-include ./usr/include/acorn32/ansi.h comp-obsolete obsolete Index: distrib/sets/lists/man/mi =================================================================== RCS file: /cvsroot/src/distrib/sets/lists/man/mi,v retrieving revision 1.1571 diff -u -p -r1.1571 mi --- distrib/sets/lists/man/mi 22 Jan 2018 09:45:32 -0000 1.1571 +++ distrib/sets/lists/man/mi 23 Jan 2018 15:28:05 -0000 @@ -678,16 +678,16 @@ ./usr/share/man/cat4/ac97.0 man-sys-catman .cat ./usr/share/man/cat4/acardide.0 man-sys-catman .cat ./usr/share/man/cat4/aceride.0 man-sys-catman .cat -./usr/share/man/cat4/acorn26/arckbd.0 man-sys-catman .cat +./usr/share/man/cat4/acorn26/arckbd.0 man-sys-catman obsolete ./usr/share/man/cat4/acorn26/arcwskbd.0 man-obsolete obsolete ./usr/share/man/cat4/acorn26/arcwsmouse.0 man-obsolete obsolete -./usr/share/man/cat4/acorn26/cpu.0 man-sys-catman .cat -./usr/share/man/cat4/acorn26/eca.0 man-sys-catman .cat -./usr/share/man/cat4/acorn26/eh.0 man-sys-catman .cat +./usr/share/man/cat4/acorn26/cpu.0 man-sys-catman obsolete +./usr/share/man/cat4/acorn26/eca.0 man-sys-catman obsolete +./usr/share/man/cat4/acorn26/eh.0 man-sys-catman obsolete ./usr/share/man/cat4/acorn26/ei.0 man-obsolete obsolete -./usr/share/man/cat4/acorn26/iobus.0 man-sys-catman .cat +./usr/share/man/cat4/acorn26/iobus.0 man-sys-catman obsolete ./usr/share/man/cat4/acorn26/podulebus.0 man-obsolete obsolete -./usr/share/man/cat4/acorn26/unixbp.0 man-sys-catman .cat +./usr/share/man/cat4/acorn26/unixbp.0 man-sys-catman obsolete ./usr/share/man/cat4/acorn32/asc.0 man-sys-catman .cat ./usr/share/man/cat4/acorn32/autoconf.0 man-sys-catman .cat ./usr/share/man/cat4/acorn32/beep.0 man-obsolete obsolete @@ -2312,11 +2312,11 @@ ./usr/share/man/cat8/ac.0 man-sysutil-catman .cat ./usr/share/man/cat8/accton.0 man-sysutil-catman .cat ./usr/share/man/cat8/acorn26/MAKEDEV.0 man-obsolete obsolete -./usr/share/man/cat8/acorn26/boot.0 man-sys-catman .cat -./usr/share/man/cat8/acorn26/boot26.0 man-sys-catman .cat +./usr/share/man/cat8/acorn26/boot.0 man-sys-catman obsolete +./usr/share/man/cat8/acorn26/boot26.0 man-sys-catman obsolete ./usr/share/man/cat8/acorn26/makedev.0 man-obsolete obsolete -./usr/share/man/cat8/acorn32/MAKEDEV.0 man-obsolete obsolete -./usr/share/man/cat8/acorn32/boot.0 man-sys-catman .cat +./usr/share/man/cat8/acorn32/MAKEDEV.0 man-obsolete .cat +./usr/share/man/cat8/acorn32/boot.0 man-sys-catman obsolete ./usr/share/man/cat8/acorn32/boot32.0 man-sys-catman .cat ./usr/share/man/cat8/acorn32/makedev.0 man-obsolete obsolete ./usr/share/man/cat8/acorn32/nbfs.0 man-sys-catman .cat @@ -3860,14 +3860,14 @@ ./usr/share/man/html4/ac97.html man-sys-htmlman html ./usr/share/man/html4/acardide.html man-sys-htmlman html ./usr/share/man/html4/aceride.html man-sys-htmlman html -./usr/share/man/html4/acorn26/arckbd.html man-sys-htmlman html +./usr/share/man/html4/acorn26/arckbd.html man-sys-htmlman obsolete ./usr/share/man/html4/acorn26/arcwskbd.html man-obsolete obsolete ./usr/share/man/html4/acorn26/arcwsmouse.html man-obsolete obsolete -./usr/share/man/html4/acorn26/cpu.html man-sys-htmlman html -./usr/share/man/html4/acorn26/eca.html man-sys-htmlman html -./usr/share/man/html4/acorn26/eh.html man-sys-htmlman html -./usr/share/man/html4/acorn26/iobus.html man-sys-htmlman html -./usr/share/man/html4/acorn26/unixbp.html man-sys-htmlman html +./usr/share/man/html4/acorn26/cpu.html man-sys-htmlman obsolete +./usr/share/man/html4/acorn26/eca.html man-sys-htmlman obsolete +./usr/share/man/html4/acorn26/eh.html man-sys-htmlman obsolete +./usr/share/man/html4/acorn26/iobus.html man-sys-htmlman obsolete +./usr/share/man/html4/acorn26/unixbp.html man-sys-htmlman obsolete ./usr/share/man/html4/acorn32/asc.html man-sys-htmlman html ./usr/share/man/html4/acorn32/autoconf.html man-sys-htmlman html ./usr/share/man/html4/acorn32/cosc.html man-sys-htmlman html @@ -5342,8 +5342,8 @@ ./usr/share/man/html8/MAKEDEV.local.html man-sysutil-htmlman html ./usr/share/man/html8/ac.html man-sysutil-htmlman html ./usr/share/man/html8/accton.html man-sysutil-htmlman html -./usr/share/man/html8/acorn26/boot.html man-sys-htmlman html -./usr/share/man/html8/acorn26/boot26.html man-sys-htmlman html +./usr/share/man/html8/acorn26/boot.html man-sys-htmlman obsolete +./usr/share/man/html8/acorn26/boot26.html man-sys-htmlman obsolete ./usr/share/man/html8/acorn32/boot.html man-sys-htmlman html ./usr/share/man/html8/acorn32/boot32.html man-sys-htmlman html ./usr/share/man/html8/acorn32/nbfs.html man-sys-htmlman html @@ -6718,16 +6718,16 @@ ./usr/share/man/man4/ac97.4 man-sys-man .man ./usr/share/man/man4/acardide.4 man-sys-man .man ./usr/share/man/man4/aceride.4 man-sys-man .man -./usr/share/man/man4/acorn26/arckbd.4 man-sys-man .man +./usr/share/man/man4/acorn26/arckbd.4 man-sys-man obsolete ./usr/share/man/man4/acorn26/arcwskbd.4 man-obsolete obsolete ./usr/share/man/man4/acorn26/arcwsmouse.4 man-obsolete obsolete -./usr/share/man/man4/acorn26/cpu.4 man-sys-man .man -./usr/share/man/man4/acorn26/eca.4 man-sys-man .man -./usr/share/man/man4/acorn26/eh.4 man-sys-man .man +./usr/share/man/man4/acorn26/cpu.4 man-sys-man obsolete +./usr/share/man/man4/acorn26/eca.4 man-sys-man obsolete +./usr/share/man/man4/acorn26/eh.4 man-sys-man obsolete ./usr/share/man/man4/acorn26/ei.4 man-obsolete obsolete -./usr/share/man/man4/acorn26/iobus.4 man-sys-man .man +./usr/share/man/man4/acorn26/iobus.4 man-sys-man obsolete ./usr/share/man/man4/acorn26/podulebus.4 man-obsolete obsolete -./usr/share/man/man4/acorn26/unixbp.4 man-sys-man .man +./usr/share/man/man4/acorn26/unixbp.4 man-sys-man obsolete ./usr/share/man/man4/acorn32/asc.4 man-sys-man .man ./usr/share/man/man4/acorn32/autoconf.4 man-sys-man .man ./usr/share/man/man4/acorn32/beep.4 man-obsolete obsolete @@ -8351,8 +8351,8 @@ ./usr/share/man/man8/ac.8 man-sysutil-man .man ./usr/share/man/man8/accton.8 man-sysutil-man .man ./usr/share/man/man8/acorn26/MAKEDEV.8 man-obsolete obsolete -./usr/share/man/man8/acorn26/boot.8 man-sys-man .man -./usr/share/man/man8/acorn26/boot26.8 man-sys-man .man +./usr/share/man/man8/acorn26/boot.8 man-sys-man obsolete +./usr/share/man/man8/acorn26/boot26.8 man-sys-man obsolete ./usr/share/man/man8/acorn26/makedev.8 man-obsolete obsolete ./usr/share/man/man8/acorn32/MAKEDEV.8 man-obsolete obsolete ./usr/share/man/man8/acorn32/boot.8 man-sys-man .man Index: distrib/utils/x_disklabel/Makefile =================================================================== RCS file: /cvsroot/src/distrib/utils/x_disklabel/Makefile,v retrieving revision 1.1 diff -u -p -r1.1 Makefile --- distrib/utils/x_disklabel/Makefile 31 Jan 2016 18:56:49 -0000 1.1 +++ distrib/utils/x_disklabel/Makefile 23 Jan 2018 15:28:06 -0000 @@ -20,7 +20,7 @@ LDADD+= -lutil CPPFLAGS+= -DSTRICT_CYLINDER_ALIGNMENT .endif -.if (${MACHINE} == "acorn32" || ${MACHINE} == "acorn26") +.if ${MACHINE} == "acorn32" # Support FileCore boot block CPPFLAGS+= -DUSE_ACORN .endif Index: doc/RESPONSIBLE =================================================================== RCS file: /cvsroot/src/doc/RESPONSIBLE,v retrieving revision 1.119 diff -u -p -r1.119 RESPONSIBLE --- doc/RESPONSIBLE 16 Dec 2017 08:01:34 -0000 1.119 +++ doc/RESPONSIBLE 23 Jan 2018 15:28:06 -0000 @@ -263,7 +263,6 @@ ppp(sync) martin Portmasters: [should be synced with src/distrib/notes/common/main] -acorn26 core acorn32 reinoud amd64 dsl algor core Index: etc/etc.acorn26/MAKEDEV.conf =================================================================== RCS file: etc/etc.acorn26/MAKEDEV.conf diff -N etc/etc.acorn26/MAKEDEV.conf --- etc/etc.acorn26/MAKEDEV.conf 16 Aug 2012 13:31:24 -0000 1.6 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,14 +0,0 @@ -# $NetBSD: MAKEDEV.conf,v 1.6 2012/08/16 13:31:24 abs Exp $ - -all_md) - makedev wscons - makedev wd0 wd1 sd0 sd1 - makedev tty0 lpt0 arcpp0 - makedev cfs - ;; - -ramdisk) - makedev std bpf wd0 wd1 wd2 wd3 md0 md1 sd0 sd1 sd2 sd3 - makedev opty ttyE0 wskbd0 ttyEcfg - makedev cd0 cd1 - ;; Index: etc/etc.acorn26/Makefile.inc =================================================================== RCS file: etc/etc.acorn26/Makefile.inc diff -N etc/etc.acorn26/Makefile.inc --- etc/etc.acorn26/Makefile.inc 18 Mar 2008 04:20:36 -0000 1.10 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,21 +0,0 @@ -# $NetBSD: Makefile.inc,v 1.10 2008/03/18 04:20:36 lukem Exp $ -# -# etc.acorn26/Makefile.inc -- acorn26-specific etc Makefile targets -# - -# If you change the list of distributed kernels, don't forget -# to update the release documentation in distrib/notes/common/contents - -KERNEL_SETS= GENERIC FOURMEG - -BUILD_KERNELS= INSTALL - -INSTALLATION_DIRS+= installation/misc - -snap_md_post: - # install bootloader into installation directory - ${HOST_INSTALL_FILE} -m ${NONBINMODE} ${DESTDIR}/usr/mdec/boot26,ffa \ - ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc - - # compute checksums - ${MAKESUMS} -t ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc 'boot26,ffa' Index: etc/etc.acorn26/ttys =================================================================== RCS file: etc/etc.acorn26/ttys diff -N etc/etc.acorn26/ttys --- etc/etc.acorn26/ttys 13 Jun 2012 20:49:11 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,11 +0,0 @@ -# -# from: @(#)ttys 5.1 (Berkeley) 4/17/89 -# $NetBSD: ttys,v 1.4 2012/06/13 20:49:11 martin Exp $ -# -# name getty type status comments -# -constty "/usr/libexec/getty Pc" wsvt25 off secure -ttyE0 "/usr/libexec/getty Pc" wsvt25 on secure -ttyE1 "/usr/libexec/getty Pc" wsvt25 off secure -ttyE2 "/usr/libexec/getty Pc" wsvt25 off secure -ttyE3 "/usr/libexec/getty Pc" wsvt25 off secure Index: etc/mtree/NetBSD.dist.base =================================================================== RCS file: /cvsroot/src/etc/mtree/NetBSD.dist.base,v retrieving revision 1.166 diff -u -p -r1.166 NetBSD.dist.base --- etc/mtree/NetBSD.dist.base 9 Jan 2018 03:31:14 -0000 1.166 +++ etc/mtree/NetBSD.dist.base 23 Jan 2018 15:28:06 -0000 @@ -872,7 +872,6 @@ ./usr/share/man/cat3 ./usr/share/man/cat3lua ./usr/share/man/cat4 -./usr/share/man/cat4/acorn26 ./usr/share/man/cat4/acorn32 ./usr/share/man/cat4/alpha ./usr/share/man/cat4/amiga @@ -908,7 +907,6 @@ ./usr/share/man/cat6 ./usr/share/man/cat7 ./usr/share/man/cat8 -./usr/share/man/cat8/acorn26 ./usr/share/man/cat8/acorn32 ./usr/share/man/cat8/algor ./usr/share/man/cat8/alpha @@ -961,7 +959,6 @@ ./usr/share/man/cat8/x86 ./usr/share/man/cat9 ./usr/share/man/cat9lua -./usr/share/man/cat9/acorn26 ./usr/share/man/cat9/alpha ./usr/share/man/cat9/amiga ./usr/share/man/cat9/atari @@ -984,7 +981,6 @@ ./usr/share/man/html3f ./usr/share/man/html3lua ./usr/share/man/html4 -./usr/share/man/html4/acorn26 ./usr/share/man/html4/acorn32 ./usr/share/man/html4/alpha ./usr/share/man/html4/amiga @@ -1020,7 +1016,6 @@ ./usr/share/man/html6 ./usr/share/man/html7 ./usr/share/man/html8 -./usr/share/man/html8/acorn26 ./usr/share/man/html8/acorn32 ./usr/share/man/html8/algor ./usr/share/man/html8/alpha @@ -1073,7 +1068,6 @@ ./usr/share/man/html8/x86 ./usr/share/man/html9 ./usr/share/man/html9lua -./usr/share/man/html9/acorn26 ./usr/share/man/html9/alpha ./usr/share/man/html9/amiga ./usr/share/man/html9/atari @@ -1096,7 +1090,6 @@ ./usr/share/man/man3f ./usr/share/man/man3lua ./usr/share/man/man4 -./usr/share/man/man4/acorn26 ./usr/share/man/man4/acorn32 ./usr/share/man/man4/alpha ./usr/share/man/man4/amiga @@ -1132,7 +1125,6 @@ ./usr/share/man/man6 ./usr/share/man/man7 ./usr/share/man/man8 -./usr/share/man/man8/acorn26 ./usr/share/man/man8/acorn32 ./usr/share/man/man8/algor ./usr/share/man/man8/alpha @@ -1185,7 +1177,6 @@ ./usr/share/man/man8/x86 ./usr/share/man/man9 ./usr/share/man/man9lua -./usr/share/man/man9/acorn26 ./usr/share/man/man9/alpha ./usr/share/man/man9/amiga ./usr/share/man/man9/atari Index: external/gpl2/groff/dist/tmac/doc-common =================================================================== RCS file: /cvsroot/src/external/gpl2/groff/dist/tmac/doc-common,v retrieving revision 1.2 diff -u -p -r1.2 doc-common --- external/gpl2/groff/dist/tmac/doc-common 13 Jan 2016 19:01:59 -0000 1.2 +++ external/gpl2/groff/dist/tmac/doc-common 23 Jan 2018 15:28:35 -0000 @@ -257,7 +257,6 @@ . .ds doc-volume-as-alpha alpha .als doc-volume-as-Alpha doc-volume-as-alpha -.ds doc-volume-as-acorn26 acorn26 .ds doc-volume-as-acorn32 acorn32 .ds doc-volume-as-algor algor .ds doc-volume-as-amd64 amd64 Index: external/gpl2/groff/dist/tmac/groff_mdoc.man =================================================================== RCS file: /cvsroot/src/external/gpl2/groff/dist/tmac/groff_mdoc.man,v retrieving revision 1.4 diff -u -p -r1.4 groff_mdoc.man --- external/gpl2/groff/dist/tmac/groff_mdoc.man 21 Nov 2016 20:43:25 -0000 1.4 +++ external/gpl2/groff/dist/tmac/groff_mdoc.man 23 Jan 2018 15:28:35 -0000 @@ -769,7 +769,7 @@ By default, the following architecture k . \# we use `No' to avoid hyphenation .Bd -ragged -offset indent -.No alpha , acorn26 , acorn32 , algor , amd64 , amiga , arc , arm26 , +.No alpha , acorn32 , algor , amd64 , amiga , arc , arm26 , .No arm32 , atari , bebox , cats , cesfic , cobalt , dreamcast , evbarm , .No evbmips , evbppc , evbsh3 , hp300 , hpcmips , hppa , i386 , luna68k , .No m68k , mac68k , macppc , mips , mmeye , mvme68k , mvmeppc , netwinder , Index: external/gpl2/send-pr/dist/send-pr/categories =================================================================== RCS file: /cvsroot/src/external/gpl2/send-pr/dist/send-pr/categories,v retrieving revision 1.2 diff -u -p -r1.2 categories --- external/gpl2/send-pr/dist/send-pr/categories 14 Jan 2016 21:13:20 -0000 1.2 +++ external/gpl2/send-pr/dist/send-pr/categories 23 Jan 2018 15:28:36 -0000 @@ -4,7 +4,6 @@ kern lib misc pkg -port-acorn26 port-acorn32 port-algor port-alpha Index: external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c =================================================================== RCS file: /cvsroot/src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c,v retrieving revision 1.4 diff -u -p -r1.4 arm-nbsd-nat.c --- external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c 30 Nov 2017 15:26:54 -0000 1.4 +++ external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c 23 Jan 2018 15:28:42 -0000 @@ -78,18 +78,18 @@ armnbsd_supply_pcb (struct regcache *reg return 0; /* The stack pointer shouldn't be zero. */ - if (pcb->pcb_un.un_32.pcb32_sp == 0) + if (pcb->pcb_sp == 0) return 0; - read_memory (pcb->pcb_un.un_32.pcb32_sp, (gdb_byte *) &sf, sizeof sf); + read_memory (pcb->pcb_sp, (gdb_byte *) &sf, sizeof sf); regcache_raw_supply (regcache, ARM_PC_REGNUM, &sf.sf_pc); - regcache_raw_supply (regcache, ARM_SP_REGNUM, &pcb->pcb_un.un_32.pcb32_sp); - regcache_raw_supply (regcache, 12, &pcb->pcb_un.un_32.pcb32_r12); - regcache_raw_supply (regcache, 11, &pcb->pcb_un.un_32.pcb32_r11); - regcache_raw_supply (regcache, 10, &pcb->pcb_un.un_32.pcb32_r10); - regcache_raw_supply (regcache, 9, &pcb->pcb_un.un_32.pcb32_r9); - regcache_raw_supply (regcache, 8, &pcb->pcb_un.un_32.pcb32_r8); + regcache_raw_supply (regcache, ARM_SP_REGNUM, &pcb->pcb_sp); + regcache_raw_supply (regcache, 12, &pcb->pcb_r12); + regcache_raw_supply (regcache, 11, &pcb->pcb_r11); + regcache_raw_supply (regcache, 10, &pcb->pcb_r10); + regcache_raw_supply (regcache, 9, &pcb->pcb_r9); + regcache_raw_supply (regcache, 8, &pcb->pcb_r8); regcache_raw_supply (regcache, 7, &sf.sf_r7); regcache_raw_supply (regcache, 6, &sf.sf_r6); regcache_raw_supply (regcache, 5, &sf.sf_r5); Index: sbin/disklabel/Makefile =================================================================== RCS file: /cvsroot/src/sbin/disklabel/Makefile,v retrieving revision 1.72 diff -u -p -r1.72 Makefile --- sbin/disklabel/Makefile 31 Jan 2016 23:11:49 -0000 1.72 +++ sbin/disklabel/Makefile 23 Jan 2018 15:28:53 -0000 @@ -15,7 +15,7 @@ LDADD+= -lutil CPPFLAGS+= -DSTRICT_CYLINDER_ALIGNMENT .endif -.if (${MACHINE} == "acorn32" || ${MACHINE} == "acorn26") +.if ${MACHINE} == "acorn32" # Support FileCore boot block CPPFLAGS+= -DUSE_ACORN .endif Index: sbin/disklabel/main.c =================================================================== RCS file: /cvsroot/src/sbin/disklabel/main.c,v retrieving revision 1.47 diff -u -p -r1.47 main.c --- sbin/disklabel/main.c 9 Mar 2017 00:18:23 -0000 1.47 +++ sbin/disklabel/main.c 23 Jan 2018 15:28:53 -0000 @@ -271,7 +271,6 @@ static const struct disklabel_params { { "or1k", 1, 1, 16, 2, 0, 0, BIG_ENDIAN }, /* or1k */ { "riscv", 1, 1, 16, 2, 0, 0, LITTLE_ENDIAN }, /* riscv */ - { "acorn26", 1, 1, 16, 2, 8, 0, LITTLE_ENDIAN }, /* arm */ { "acorn32", 1, 1, 16, 2, 8, 0, LITTLE_ENDIAN }, /* arm */ { "cats", 1, 1, 16, 2, 8, 0, LITTLE_ENDIAN }, /* arm */ { "evbarm", 1, 1, 16, 2, 8, 0, 0 }, /* arm */ Index: share/examples/disktab/disktab =================================================================== RCS file: /cvsroot/src/share/examples/disktab/disktab,v retrieving revision 1.2 diff -u -p -r1.2 disktab --- share/examples/disktab/disktab 19 Apr 2004 12:44:10 -0000 1.2 +++ share/examples/disktab/disktab 23 Jan 2018 15:28:53 -0000 @@ -49,7 +49,7 @@ floppy288|2.88MB 3.5in Extra High Densit :pb#5760:ob#0:\ :pc#5760:oc#0: -# From former acorn26/acorn32 disktab +# From former acorn32 disktab cfs420a|Conner Peripherals 420MB IDE:\ :dt=ESDI:ty=winchester:se#512:nt#16:ns#63:nc#826: \ Index: share/man/man4/Makefile =================================================================== RCS file: /cvsroot/src/share/man/man4/Makefile,v retrieving revision 1.650 diff -u -p -r1.650 Makefile --- share/man/man4/Makefile 10 Jan 2018 11:08:55 -0000 1.650 +++ share/man/man4/Makefile 23 Jan 2018 15:28:54 -0000 @@ -248,7 +248,7 @@ MLINKS+=zstty.4 zs.4 zstty.4 zsc.4 # This is a hack MLINKS+=edc.4 i386/ed.4 -SUBDIR= man4.acorn26 man4.acorn32 man4.alpha man4.amiga man4.arc man4.atari \ +SUBDIR= man4.acorn32 man4.alpha man4.amiga man4.arc man4.atari \ man4.cobalt man4.dreamcast man4.emips man4.evbarm man4.evbmips \ man4.evbppc \ man4.hp300 man4.hpcarm man4.hpcmips man4.hpcsh man4.hppa man4.i386 \ Index: share/man/man4/ddb.4 =================================================================== RCS file: /cvsroot/src/share/man/man4/ddb.4,v retrieving revision 1.170 diff -u -p -r1.170 ddb.4 --- share/man/man4/ddb.4 28 Dec 2017 23:16:42 -0000 1.170 +++ share/man/man4/ddb.4 23 Jan 2018 15:28:54 -0000 @@ -953,21 +953,6 @@ to indicate that they are part of the ma set (e.g. .Ic machine reboot ) . Some of these commands are: -.Ss ACORN26 -.Bl -tag -width "traptrace" -compact -.It Ic bsw -Writes one or two bytes to the IObus. -Takes an address and a value. -Use the -.Dq b -modifier to write a single byte and the -.Dq h -modifier to write two bytes. -.It Ic frame -Given a trap frame address, print out the trap frame. -.It Ic irqstat -Display the IRQ statistics -.El .Ss ALPHA .Bl -tag -width "traptrace" -compact .It Ic cpu Index: share/man/man4/iic.4 =================================================================== RCS file: /cvsroot/src/share/man/man4/iic.4,v retrieving revision 1.13 diff -u -p -r1.13 iic.4 --- share/man/man4/iic.4 26 Jul 2016 11:08:59 -0000 1.13 +++ share/man/man4/iic.4 23 Jan 2018 15:28:54 -0000 @@ -51,7 +51,6 @@ .Cd "iic* at i2cbus? # evbarm " .Cd "iic* at ichsmb? # amd64 i386 " .Cd "iic* at imxi2c? # evbarm " -.Cd "iic0 at iociic0 # acorn26 " .Cd "iic0 at iomdiic? # acorn32 " .Cd "iic0 at iopiic? # evbarm iyonix " .Cd "iic* at ismt? # amd64 i386 " Index: share/man/man4/podulebus.4 =================================================================== RCS file: /cvsroot/src/share/man/man4/podulebus.4,v retrieving revision 1.3 diff -u -p -r1.3 podulebus.4 --- share/man/man4/podulebus.4 9 Mar 2009 19:24:28 -0000 1.3 +++ share/man/man4/podulebus.4 23 Jan 2018 15:28:54 -0000 @@ -32,8 +32,6 @@ .Nm podulebus .Nd Acorn Expansion Card bus driver .Sh SYNOPSIS -.Cd podulebus0 at ioc0 bank 4 -.Pq Nx Ns /acorn26 .Cd podulebus0 at root .Pq Nx Ns /acorn32 .Sh DESCRIPTION @@ -52,8 +50,6 @@ device. .Nx includes several machine-independent expansion card device drivers. There are also some device drivers which are specific to -.Nx Ns /acorn26 -or .Nx Ns /acorn32 . .Sh HARDWARE The following devices are supported by Index: share/man/man4/man4.acorn26/Makefile =================================================================== RCS file: share/man/man4/man4.acorn26/Makefile diff -N share/man/man4/man4.acorn26/Makefile --- share/man/man4/man4.acorn26/Makefile 14 Feb 2009 10:20:55 -0000 1.6 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,8 +0,0 @@ -# from: @(#)Makefile 5.1 (Berkeley) 2/12/91 -# $NetBSD: Makefile,v 1.6 2009/02/14 10:20:55 bjh21 Exp $ - -MAN= arckbd.4 cpu.4 eca.4 eh.4 iobus.4 unixbp.4 - -MANSUBDIR=/acorn26 - -.include Index: share/man/man4/man4.acorn26/arckbd.4 =================================================================== RCS file: share/man/man4/man4.acorn26/arckbd.4 diff -N share/man/man4/man4.acorn26/arckbd.4 --- share/man/man4/man4.acorn26/arckbd.4 9 Mar 2009 19:24:28 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,63 +0,0 @@ -.\" $NetBSD: arckbd.4,v 1.4 2009/03/09 19:24:28 joerg Exp $ -.\" -.\" Copyright (c) 2000 Ben Harris -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. The name of the author may not 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. -.\" -.Dd February 14, 2009 -.Dt ARCKBD 4 acorn26 -.Os -.Sh NAME -.Nm arckbd -.Nd Archimedes keyboard/mouse driver -.Sh SYNOPSIS -.Cd "arckbd0 at ioc0 bank 0 offset 0x04" -.Cd "wskbd0 at arckbd0" -.Cd "wsmouse0 at arckbd0" -.Sh DESCRIPTION -The -.Nm -driver controls the keyboard on systems supported by -.Nx Ns /acorn26 -and interfaces it to the -.Nm wscons -system. -All communication between user programs and the -.Nm -driver goes through the -.Nm wskbd -and -.Nm wsmouse -drivers. -.Sh SEE ALSO -.Xr wscons 4 , -.Xr wskbd 4 , -.Xr wsmouse 4 -.Sh BUGS -The -.Nm -driver is capable of determining the layout of the keyboard, and noticing when -it changes (if a different keyboard is connected, for instance), but doesn't -know how to pass this information on to -.Nm wscons . Index: share/man/man4/man4.acorn26/cpu.4 =================================================================== RCS file: share/man/man4/man4.acorn26/cpu.4 diff -N share/man/man4/man4.acorn26/cpu.4 --- share/man/man4/man4.acorn26/cpu.4 9 Mar 2009 19:24:28 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,58 +0,0 @@ -.\" $NetBSD: cpu.4,v 1.2 2009/03/09 19:24:28 joerg Exp $ -.\" -.\" Copyright (c) 2000 Ben Harris. -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. The name of the author may not 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. -.\" -.Dd December 11, 2000 -.Dt CPU 4 acorn26 -.Os -.Sh NAME -.Nm cpu -.Nd Device driver for CPU-specific features -.Sh SYNOPSIS -.Cd cpu0 at root flags 0 -.Cd options CPU_ARM2 -.Cd options CPU_ARM250 -.Cd options CPU_ARM3 -.Sh DESCRIPTION -The -.Nm -driver provides a convenient hook for identifying the system's CPU and setting -various parameters relating to it. -.Pp -Setting the bottom bit of the flags will cause the cache on the ARM3 to be -disabled, otherwise it's enabled. -.Pp -The following options are available relating to the -.Nm -driver: -.Bl -ohang -.It Cd options CPU_ARM2 -Enables support for ARM2 CPUs. -.It Cd options CPU_ARM250 -Enables support for ARM2as CPUs (as found in the ARM250). -.It Cd options CPU_ARM3 -Enables support for ARM3 CPUs. -.El Index: share/man/man4/man4.acorn26/eca.4 =================================================================== RCS file: share/man/man4/man4.acorn26/eca.4 diff -N share/man/man4/man4.acorn26/eca.4 --- share/man/man4/man4.acorn26/eca.4 9 Mar 2009 19:24:29 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,76 +0,0 @@ -.\" $NetBSD: eca.4,v 1.2 2009/03/09 19:24:29 joerg Exp $ -.\" -.\" Copyright (c) 2001 Ben Harris -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. The name of the author may not 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. -.\" -.Dd September 11, 2001 -.Dt ECA 4 acorn26 -.Os -.Sh NAME -.Nm eca -.Nd Acorn Econet driver -.Sh SYNOPSIS -.Cd eca0 at ioc0 bank 2 -.Sh DESCRIPTION -The -.Nm -driver provides access to an Econet network through a standard Acorn -Econet module, based on the Motorola 6854 ADLC. It obtains its Econet -station number from the machine's CMOS RAM. -.Sh DIAGNOSTICS -.Bl -diag -.It %s: Tx underrun -Transmission of a frame failed because the driver couldn't get data to -the ADLC fast enough. This might be caused by the network clock rate -being too high, or by the current screen mode using too much of the -data bus's bandwidth. -.It %s: collision -A collision occurred while transmitting a frame. The transmission -should be retried, but currently isn't. -.It %s: incomplete transmission -A transmission failed to complete, but no obvious reason was found. -This should never happen. -.It %s: Rx overrun -Reception of a frame failed because the driver couldn't get data off -the ADLC fast enough. Likely causes are the same as for -.Ql \&Tx underrun -above. -.It %s: Rx abort -A frame being received was aborted before it was complete. This was -probably caused by a problem at the transmitting station. -.It %s: CRC error -A received frame failed its cyclic redundancy check and was discarded. -This is usually due to electrical noise on the network. -.It %s: No clock -The clock signal on the Econet has disappeared. This probably -indicates that the machine is unplugged from the network, or that the -network itself has failed. -.It %s: Oversized frame -A frame larger than the current MTU of the interface was received and -discarded. -.El -.Sh SEE ALSO -.Xr netintro 4 , -.Xr ifconfig 8 Index: share/man/man4/man4.acorn26/eh.4 =================================================================== RCS file: share/man/man4/man4.acorn26/eh.4 diff -N share/man/man4/man4.acorn26/eh.4 --- share/man/man4/man4.acorn26/eh.4 9 Mar 2009 19:24:29 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,72 +0,0 @@ -.\" $NetBSD: eh.4,v 1.3 2009/03/09 19:24:29 joerg Exp $ -.\" -.\" Copyright (c) 2000 Ben Harris -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. The name of the author may not 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. -.\" -.Dd December 22, 2000 -.Dt EH 4 acorn26 -.Os -.Sh NAME -.Nm eh -.Nd i-cubed EtherLan 100/200/500-series (EtherH) Ethernet driver -.Sh SYNOPSIS -.Cd "eh* at podulebus0 slot ?" -.Sh DESCRIPTION -The -.Nm -driver provides access to a 10 Mb/s Ethernet network through an -i-cubed EtherLan 100-series, 200-series or 500-series expansion card. -It also supports the Acorn-badged variants of the same cards, with part -numbers -.Tn AEH75 , -.Tn AEH77 -and -.Tn AEH79 . -.Pp -Media selection on cards supporting multiple media can be accomplished -either using -.Xr ifconfig 8 -or using links on the card. The links override the software and make the -card behave as if only one medium is available. The media available, -subject to the hardware on the card, are: -.Bl -tag -width 10baseFL -.It auto -Automatically select 10BASE-T or 10BASE2. 10BASE-T will be used if a link -beat appears to be present on that interface. Otherwise, 10BASE2 will be used. -.It 10baseT -10BASE-T, 10Mb/s over unshielded twisted pair, RJ45 connector. -.It 10base2 -10BASE2, 10Mb/s over coaxial cable, BNC connector, also called Thinnet. -.El -.Sh SEE ALSO -.Xr ifmedia 4 , -.Xr ne 4 , -.Xr netintro 4 , -.Xr podulebus 4 , -.Xr ifconfig 8 -.Sh BUGS -EtherLan 500-series support is untested. -.Pp -The 10BASE-FL port on the EtherLan 513 will probably be identified as 10BASE2. Index: share/man/man4/man4.acorn26/iobus.4 =================================================================== RCS file: share/man/man4/man4.acorn26/iobus.4 diff -N share/man/man4/man4.acorn26/iobus.4 --- share/man/man4/man4.acorn26/iobus.4 9 Mar 2009 19:24:29 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,57 +0,0 @@ -.\" $NetBSD: iobus.4,v 1.4 2009/03/09 19:24:29 joerg Exp $ -.\" -.\" Copyright (c) 2000 Ben Harris. -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. The name of the author may not 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. -.\" -.Dd April 25, 2001 -.Dt IOBUS 4 acorn26 -.Os -.Sh NAME -.Nm iobus -.Nd Device driver for the I/O bus -.Sh SYNOPSIS -.Cd iobus0 at root -.Sh DESCRIPTION -Systems supported by -.Nx Ns /acorn26 -have a 16-bit I/O bus connected to the CPU bus by bi-directional buffers -managed by the IOC. The -.Nm -driver provides support for this bus. All -.Nx Ns /acorn26 -kernels need this driver. -.Pp -On Archimedes systems, the only device attached at -.Nm -is the IOC. While MEMC podules are physically -.Nm -devices, they're logically treated as being attached to the IOC. On -machines with an IOEB, the Universal Peripheral Controller chip is also -attached at -.Nm . -.Sh SEE ALSO -.\" .Xr ioc 4 , -.Xr podulebus 4 -.\" .Xr upc 4 Index: share/man/man4/man4.acorn26/unixbp.4 =================================================================== RCS file: share/man/man4/man4.acorn26/unixbp.4 diff -N share/man/man4/man4.acorn26/unixbp.4 --- share/man/man4/man4.acorn26/unixbp.4 9 Mar 2009 19:24:29 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,46 +0,0 @@ -.\" $NetBSD: unixbp.4,v 1.2 2009/03/09 19:24:29 joerg Exp $ -.\" -.\" Copyright (c) 2000 Ben Harris -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. The name of the author may not 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. -.\" -.Dd December 9, 2000 -.Dt UNIXBP 4 acorn26 -.Os -.Sh NAME -.Nm unixbp -.Nd Unix Backplane driver -.Sh SYNOPSIS -.Cd unixbp0 at ioc0 bank 6 -.Sh DESCRIPTION -The -.Nm -driver controls the interrupt-masking hardware on the expansion-card -backplane of certain systems. This hardware gives -.Nx -the ability to selectively block interrupts from particular expansion -cards, and to determine which cards are currently generating interrupts by -examining a single register. -.Sh SEE ALSO -.Xr podulebus 4 Index: share/man/man7/hier.7 =================================================================== RCS file: /cvsroot/src/share/man/man7/hier.7,v retrieving revision 1.127 diff -u -p -r1.127 hier.7 --- share/man/man7/hier.7 9 Jan 2018 09:22:25 -0000 1.127 +++ share/man/man7/hier.7 23 Jan 2018 15:28:55 -0000 @@ -744,8 +744,6 @@ Kernel source files. Architecture-specific support. .Pp .Bl -tag -width "playstation2/" -compact -.It Pa acorn26/ -Acorn Archimedes, A-series and R-series systems. .It Pa acorn32/ Acorn RiscPC/A7000 and VLSI RC7500. .It Pa algor/ Index: share/man/man8/Makefile =================================================================== RCS file: /cvsroot/src/share/man/man8/Makefile,v retrieving revision 1.104 diff -u -p -r1.104 Makefile --- share/man/man8/Makefile 24 Feb 2014 07:23:41 -0000 1.104 +++ share/man/man8/Makefile 23 Jan 2018 15:28:55 -0000 @@ -20,7 +20,7 @@ MLINKS+=rc.8 rc.d.8 MLINKS+=rc.8 rc.local.8 MLINKS+=rc.8 rc.shutdown.8 -SUBDIR= man8.acorn26 man8.acorn32 man8.alpha man8.amiga man8.atari \ +SUBDIR= man8.acorn32 man8.alpha man8.amiga man8.atari \ man8.cobalt man8.dreamcast man8.emips man8.evbarm \ man8.hp300 man8.hpcarm man8.hpcmips man8.hpcsh man8.hppa \ man8.mac68k man8.macppc \ Index: share/man/man8/man8.acorn26/Makefile =================================================================== RCS file: share/man/man8/man8.acorn26/Makefile diff -N share/man/man8/man8.acorn26/Makefile --- share/man/man8/man8.acorn26/Makefile 24 Oct 2003 20:26:57 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,7 +0,0 @@ -# $NetBSD: Makefile,v 1.3 2003/10/24 20:26:57 jdolecek Exp $ - -MAN= boot26.8 -MLINKS= boot26.8 boot.8 -MANSUBDIR=/acorn26 - -.include Index: share/man/man8/man8.acorn26/boot26.8 =================================================================== RCS file: share/man/man8/man8.acorn26/boot26.8 diff -N share/man/man8/man8.acorn26/boot26.8 --- share/man/man8/man8.acorn26/boot26.8 3 Jul 2017 21:31:00 -0000 1.8 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,183 +0,0 @@ -.\" $NetBSD: boot26.8,v 1.8 2017/07/03 21:31:00 wiz Exp $ -.\" -.\" Copyright (c) 2000, 2001 Ben Harris -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. The name of the author may not 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. -.\" -.Dd September 4, 2009 -.Dt BOOT26 8 acorn26 -.Os -.Sh NAME -.Nm boot26 -.Nd Bootloader for -.Nx Ns /acorn26 -.Sh SYNOPSIS -.Nm *boot26 -.Op Fl acdqsv -.Op Ar file -.Sh DESCRIPTION -.Nm -is a program that runs under -.Tn RISC OS -and launches the -.Nx Ns /acorn26 -kernel. -It needs to be installed in a RISC OS -filesystem and given file type FFA (Module). -The kernel it is to load also needs to be stored in a -.Tn RISC OS -filesystem. -.Pp -It takes the following options, which set flags in the -.Va boothowto -variable in the booted kernel (see -.Xr boothowto 9 ) : -.Bl -tag -width Fl -.It Fl a -.Pq Dv RB_ASKNAME -Cause the kernel to prompt the user for the name of the device containing the -root filesystem. -This also causes -.Nm -to prompt for the name of the kernel to be loaded. -.It Fl s -.Pq Dv RB_SINGLE -Cause the kernel to ask -.Nm init -to boot into single-user mode. -.It Fl d -.Pq Dv RB_KDB -Cause the kernel to enter the kernel debugger as soon as possible. -.It Fl c -.Pq Dv RB_USERCONF -Enter the in-kernel device configuration manager before attaching any -devices. -.It Fl q -.Pq Dv AB_QUIET -Cause the kernel to emit fewer messages than normal while starting up. -.It Fl v -.Pq Dv AB_VERBOSE -Cause the kernel to emit more messages than normal while starting up. -.El -.Pp -.Nm -attempts to load the kernel from the RISC OS file specified as -.Ar file , -or from -.Pa netbsd -if -.Ar file -is not specified. -The file must be an ELF image, and may have been compressed using -.Xr gzip 1 . -.Ss Use as a module -.Nm -is implemented as a RISC OS relocatable module. -It can be loaded into memory by running -.Ql *RMLoad boot26 . -After this, -.Nx -can be booted by running -.Ql *boot26 -as usual, but the command will be handled by the module. -.Pp -It should also be possible to arrange for -.Nm -to be loaded from ROM (e.g. from the ROM on an expansion card), in which case -.Nx -could be made to boot automatically by making -.Nm -the configured language using -.Ql *Configure Language . -.Ss Screen display -.\" From -When it starts up, -.Nm -displays the current memory map. -Each character in the map represents one page of (physical) RAM. -The ticks along the top are to stop you getting lost. -The characters in the map indicate what the memory's being used for -(actually where it's logically mapped): -.Pp -.Bd -literal -offset indent -0 -> zero-page -+ -> boot26 workspace -* -> Free space (boot26 wants to put the kernel here) -d -> RAM disc -s -> System sprite area -m -> RMA -h -> System heap/stack -f -> Font cache -S -> Screen memory -.Ed -.Pp -On a machine with 32k pages (which is all -.Nx Ns /acorn26 -supports), the left -half of the first line is potential screen memory, and hence not used by -.Nm . -The next page is usually zero page under RISC OS, and is used for -zero page under -.Nx -as well. -The next is usually the system heap under RISC OS, -and is used for process 0's kernel stack under -.Nx . -The next is used for the message buffer under -.Nx . -Pages from there on are used to load -the kernel, and must be free if -.Nm -is to do so successfully. -Future bootloaders should load the kernel into whatever pages are -free, then kick out RISC OS and shuffle them into the right shape. -This is left as an exercise for the enthusiastic reader. -.Sh FILES -.Bl -tag -width Pa -.It Pa /usr/mdec/boot26,ffa -The location of -.Nm -in the -.Nx -filesystem. -.El -.Sh SEE ALSO -.Xr gzip 1 , -.Xr reboot 2 , -.Xr ddb 4 , -.Xr userconf 4 , -.Xr init 8 , -.Xr boothowto 9 -.Sh HISTORY -.Nm -was introduced in -.Nx 1.6 -as a replacement for the original -.Nx Ns /arm26 -bootloader, which was written in BBC BASIC. -.Sh BUGS -.Nm -cannot load kernels from a -.Nx -filesystem. Index: share/mk/bsd.own.mk =================================================================== RCS file: /cvsroot/src/share/mk/bsd.own.mk,v retrieving revision 1.1026 diff -u -p -r1.1026 bsd.own.mk --- share/mk/bsd.own.mk 7 Jan 2018 20:59:25 -0000 1.1026 +++ share/mk/bsd.own.mk 23 Jan 2018 15:28:55 -0000 @@ -572,7 +572,7 @@ OBJC= ${TOOL_OBJC.${ACTIVE_OBJC}} # For each ${MACHINE_CPU}, list the ports that use it. MACHINES.aarch64= evbarm64 MACHINES.alpha= alpha -MACHINES.arm= acorn26 acorn32 cats epoc32 evbarm hpcarm \ +MACHINES.arm= acorn32 cats epoc32 evbarm hpcarm \ iyonix netwinder shark zaurus MACHINES.coldfire= evbcf MACHINES.i386= i386 @@ -1064,9 +1064,6 @@ MKGCCCMDS?= ${MKGCC} # # Exceptions to the above: # -.if ${MACHINE} == "acorn26" # page size is prohibitive -MKKMOD= no -.endif # Rump doesn't work yet on ia64 .if ${MACHINE} == "ia64" Index: sys/arch/Makefile =================================================================== RCS file: /cvsroot/src/sys/arch/Makefile,v retrieving revision 1.45 diff -u -p -r1.45 Makefile --- sys/arch/Makefile 3 Sep 2014 19:27:53 -0000 1.45 +++ sys/arch/Makefile 23 Jan 2018 15:28:55 -0000 @@ -19,7 +19,7 @@ ARCHSUBDIR= powerpc .if ${MACHINE_CPU} == "aarch64" SUBDIR= evbarm64 .elif ${MACHINE_CPU} == "arm" -SUBDIR= acorn26 acorn32 cats epoc32 evbarm hpcarm iyonix netwinder shark zaurus +SUBDIR= acorn32 cats epoc32 evbarm hpcarm iyonix netwinder shark zaurus .else SUBDIR= ${MACHINE} .endif @@ -45,7 +45,7 @@ SUBDIR+= sun68k SUBDIR+= xen .endif -#SUBDIR=aarch64 acorn26 acorn32 algor alpha amiga amigappc arm arc atari \ +#SUBDIR=aarch64 acorn32 algor alpha amiga amigappc arm arc atari \ # bebox \ # cats cesfic cobalt \ # dreamcast \ Index: sys/arch/README =================================================================== RCS file: /cvsroot/src/sys/arch/README,v retrieving revision 1.62 diff -u -p -r1.62 README --- sys/arch/README 31 Mar 2014 11:25:48 -0000 1.62 +++ sys/arch/README 23 Jan 2018 15:28:55 -0000 @@ -1,6 +1,5 @@ $NetBSD: README,v 1.62 2014/03/31 11:25:48 martin Exp $ -acorn26 arm 20000509 Acorn ARM2- and ARM3-based machines acorn32 arm 20011118 Acorn computers Ltd. ARM 6/7/SA based machines algor mipsel,mips64el 20010528 Algorithmics, Ltd. MIPS evaluation boards alpha alpha 19950213 Compaq (formerly Digital Equipment Corp.) Alpha Index: sys/arch/acorn26/Makefile =================================================================== RCS file: sys/arch/acorn26/Makefile diff -N sys/arch/acorn26/Makefile --- sys/arch/acorn26/Makefile 25 Oct 2008 22:27:36 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,34 +0,0 @@ -# $NetBSD: Makefile,v 1.3 2008/10/25 22:27:36 apb Exp $ - -# Makefile for acorn26 tags file and boot blocks - -TACORN26= ../acorn26/tags -SACORN26= ../acorn26/acorn26/*.[ch] ../acorn26/include/*.h \ - ../acorn26/iobus/*.[ch] ../acorn26/ioc/*.[ch] ../arm32/mainbus/*.[ch] \ - ../acorn26/vidc/*.[ch] -AACORN26= ../acorn26/acorn26/*.S ../acorn26/iobus/*.S - -# Directories in which to place tags links -DACORN26= acorn26 include iobus ioc mainbus vidc - -.include "../../kern/Make.tags.inc" - -tags: TAGS - -ctags -wdtf ${TACORN26} ${SACORN26} ${COMM} - egrep "^ENTRY(.*)|^ALTENTRY(.*)" ${AACORN26} | \ - ${TOOL_SED} -e \ - "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$$/;" \ - >> ${TACORN26} - sort -o ${TACORN26} ${TACORN26} - -TAGS: - etags ${SACORN26} ${COMM} ${AACORN26} - -links: - -for i in ${DACORN26}; do \ - cd $$i && rm -f tags; ln -s ../tags tags; done - - -SUBDIR= compile include stand - -.include Index: sys/arch/acorn26/acorn26/autoconf.c =================================================================== RCS file: sys/arch/acorn26/acorn26/autoconf.c diff -N sys/arch/acorn26/acorn26/autoconf.c --- sys/arch/acorn26/acorn26/autoconf.c 18 Aug 2013 16:08:42 -0000 1.10 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,70 +0,0 @@ -/* $NetBSD: autoconf.c,v 1.10 2013/08/18 16:08:42 matt Exp $ */ -/*- - * Copyright (c) 1998, 1999 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * autoconf.c - top level device-finding code - */ - -#include -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.10 2013/08/18 16:08:42 matt Exp $"); - -#include -#include -#include -#include -#include - -#include - -#include -#include - -void -cpu_configure(void) -{ - - irq_init(); - config_rootfound("cpu", NULL); - config_rootfound("arcvideo", NULL); - config_rootfound("iobus", NULL); - spl0(); - fiq_on(); -} - -void -cpu_rootconf(void) -{ - - rootconf(); -} - -void -cpu_dumpconf(void) -{ - - printf("cpu_dumpconf: Doing something here would be useful\n"); -} Index: sys/arch/acorn26/acorn26/bus.c =================================================================== RCS file: sys/arch/acorn26/acorn26/bus.c diff -N sys/arch/acorn26/acorn26/bus.c --- sys/arch/acorn26/acorn26/bus.c 19 Jul 2011 16:05:09 -0000 1.7 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,125 +0,0 @@ -/* $NetBSD: bus.c,v 1.7 2011/07/19 16:05:09 dyoung Exp $ */ -/*- - * Copyright (c) 1999, 2000 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * bus.c - bus space functions for Archimedes I/O bus - */ - -#include -__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.7 2011/07/19 16:05:09 dyoung Exp $"); - -#include -#include -#include -#include - -#include - -bs_protos(iobus); -bs_protos(bs_notimpl); - -struct bus_space iobus_bs_tag = { - .bs_cookie = (void *)2, - .bs_map = iobus_bs_map, .bs_unmap = iobus_bs_unmap, - .bs_subregion = iobus_bs_subregion, - .bs_alloc = iobus_bs_alloc, .bs_free = iobus_bs_free, - .bs_mmap = iobus_bs_mmap, - .bs_barrier = iobus_bs_barrier, - .bs_r_1 = iobus_bs_r_1, .bs_r_2 = iobus_bs_r_2, - .bs_rm_1 = iobus_bs_rm_1, .bs_rm_2 = iobus_bs_rm_2, - .bs_rr_1 = iobus_bs_rr_1, .bs_rr_2 = iobus_bs_rr_2, - .bs_w_1 = iobus_bs_w_1, .bs_w_2 = iobus_bs_w_2, - .bs_wm_1 = iobus_bs_wm_1, .bs_wm_2 = iobus_bs_wm_2, - .bs_wr_1 = iobus_bs_wr_1, .bs_wr_2 = iobus_bs_wr_2, - .bs_sm_1 = iobus_bs_sm_1, .bs_sm_2 = iobus_bs_sm_2, - .bs_sr_1 = iobus_bs_sr_1, .bs_sr_2 = iobus_bs_sr_2, -}; - -int -iobus_bs_map(void *t, bus_addr_t addr, bus_size_t size, - int flags, bus_space_handle_t *bshp) -{ - - if (flags & BUS_SPACE_MAP_LINEAR) - return -1; - *bshp = (u_long)addr; - return 0; -} - -void -iobus_bs_unmap(void *t, bus_space_handle_t bsh, bus_size_t size) -{ - -} - -int -iobus_bs_alloc(void *t, bus_addr_t rstart, bus_addr_t rend, bus_size_t size, - bus_size_t alignment, bus_size_t boundary, int flags, bus_addr_t *bpap, - bus_space_handle_t *bshp) -{ - - return -1; -} - -void -iobus_bs_free(void *t, bus_space_handle_t bsh, bus_size_t size) -{ - -} - -int -iobus_bs_subregion(void *t, bus_space_handle_t bsh, bus_size_t offset, - bus_size_t size, bus_space_handle_t *nbshp) -{ - - *nbshp = bsh + (offset << (int)t); - return 0; -} - -paddr_t -iobus_bs_mmap(void *t, bus_addr_t addr, off_t off, int prot, int flags) -{ - - return -1; -} - -void -iobus_bs_barrier(void *t, bus_space_handle_t bsh, bus_size_t offset, - bus_size_t len, int flags) -{ - -} - -int -bus_space_shift(bus_space_tag_t bst, int shift, bus_space_tag_t *nbstp) -{ - - *nbstp = malloc(sizeof(**nbstp), M_DEVBUF, M_WAITOK); - **nbstp = *bst; - (*nbstp)->bs_cookie = (void *)shift; - return 0; -} Index: sys/arch/acorn26/acorn26/bus_asm.S =================================================================== RCS file: sys/arch/acorn26/acorn26/bus_asm.S diff -N sys/arch/acorn26/acorn26/bus_asm.S --- sys/arch/acorn26/acorn26/bus_asm.S 12 Aug 2013 16:02:50 -0000 1.6 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,458 +0,0 @@ -/* $NetBSD: bus_asm.S,v 1.6 2013/08/12 16:02:50 matt Exp $ */ - -/* - * Copyright (c) 2006 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * Copyright (c) 1997 Mark Brinicombe. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * 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 Mark Brinicombe. - * 4. The name of the company nor the name of the author 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 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. - */ - -#include -RCSID("$NetBSD: bus_asm.S,v 1.6 2013/08/12 16:02:50 matt Exp $") - -/* - * bus_space I/O functions for podulebus - */ - -/* - * read single - */ - -ENTRY(iobus_bs_r_1) - mov r2, r2, lsl r0 - ldrb r0, [r1, r2] - mov pc, lr - -ENTRY(iobus_bs_r_2) - mov r2, r2, lsl r0 - ldr r0, [r1, r2] - bic r0, r0, #0xff000000 - bic r0, r0, #0x00ff0000 - mov pc, lr - -/* - * write single - */ - -ENTRY(iobus_bs_w_1) - mov r2, r2, lsl r0 - strb r3, [r1, r2] - mov pc, lr - -ENTRY(iobus_bs_w_2) - orr r3, r3, r3, lsl #16 - mov r2, r2, lsl r0 - str r3, [r1, r2] - mov pc, lr - -/* - * read multiple - */ - -ENTRY(iobus_bs_rm_1) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - add r0, r1, r2, lsl r0 - ldr r2, [sp, #16] - - /* Make sure that we have a positive length */ - cmp r2, #0x00000000 - ldmdble fp, {fp, sp, pc} - -1: - ldrb r1, [r0] - strb r1, [r3], #0x0001 - subs r2, r2, #0x00000001 - bgt 1b - - ldmdb fp, {fp, sp, pc} - -ENTRY(iobus_bs_rm_2) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - add r0, r1, r2, lsl r0 - ldr r2, [sp, #16] - - /* Make sure that we have a positive length */ - cmp r2, #0x00000000 - ldmdble fp, {fp, sp, pc} - -1: - ldr r1, [r0] - strb r1, [r3], #0x0001 - mov r1, r1, lsr #8 - strb r1, [r3], #0x0001 - subs r2, r2, #0x00000001 - bgt 1b - - ldmdb fp, {fp, sp, pc} - -/* - * write multiple - */ - -ENTRY(iobus_bs_wm_1) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - add r0, r1, r2, lsl r0 - ldr r2, [sp, #16] - - /* Make sure that we have a positive length */ - cmp r2, #0x00000000 - ldmdble fp, {fp, sp, pc} - -1: - ldrb r1, [r3], #0x0001 - strb r1, [r0] - subs r2, r2, #0x00000001 - bgt 1b - - ldmdb fp, {fp, sp, pc} - -ENTRY(iobus_bs_wm_2) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - add r0, r1, r2, lsl r0 - ldr r2, [sp, #16] - - /* Make sure that we have a positive length */ - cmp r2, #0x00000000 - ldmdble fp, {fp, sp, pc} - -1: - ldrb r1, [r3], #0x0001 - ldrb r12, [r3], #1 - orr r1, r1, r12, lsl #8 - orr r1, r1, r1, lsl #16 - str r1, [r0] - subs r2, r2, #0x00000001 - bgt 1b - - ldmdb fp, {fp, sp, pc} - -/* - * read region - */ - -ENTRY(iobus_bs_rr_1) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - add r12, r1, r2, lsl r0 - mov r2, #1 - mov r0, r2, lsl r0 - ldr r2, [sp, #16] - - /* Make sure that we have a positive length */ - cmp r2, #0x00000000 - ldmdble fp, {fp, sp, pc} - -1: - ldrb r1, [r12], r0 - strb r1, [r3], #0x0001 - subs r2, r2, #0x00000001 - bgt 1b - - ldmdb fp, {fp, sp, pc} - - /* - * r0-r7: scratch - * r8: I/O addr - * r9: mem addr - * r10: count - * r12: 0xffff - */ -ENTRY(iobus_bs_rr_2) - mov ip, sp - stmfd sp!, {r4-r10, fp, ip, lr, pc} - sub fp, ip, #4 - add r8, r1, r2, lsl r0 - mov r9, r3 - mov r2, #1 - mov r0, r2, lsl r0 - ldr r10, [sp, #44] - - teq r0, #4 /* Is the step 4? */ - movne r7, r10 /* If not, do the whole lot slowly. */ - rsbeq r7, r9, #0 /* Otherwise, go slowly to a */ - andeq r7, r7, #15 /* 16-byte boundary. */ - moveq r7, r7, lsr #1 /* Convert to uint16_ts */ - sub r10, r10, r7 /* Adjust fast transfer len to match */ - cmp r10, #8 - addlt r7, r7, r10 /* If remaining fast xfer is <8 */ - movlt r10, #0 /* make it zero and correct r7. */ - - /* Make sure that we have a positive length */ - teq r7, #0 - beq 2f - -1: ldr r1, [r8], r0 - strb r1, [r9], #1 - mov r1, r1, lsr #8 - strb r1, [r9], #1 - subs r7, r7, #1 - bgt 1b - -2: teq r10, #0 - ldmdbeq fp, {r4-r10, fp, sp, pc} - - /* - * Fast read_region_2 code. This is at its best when dealing with - * 16-byte-aligned blocks of memory, which is arranged by the code - * above. - */ - mov r12, #0x00ff - orr r12, r12, #0xff00 - sub r10, r10, #7 -2: ldmia r8!, {r0-r7} - subs r10, r10, #8 - and r0, r0, r12 - and r2, r2, r12 - and r4, r4, r12 - and r6, r6, r12 - orr r0, r0, r1, lsl #16 - orr r2, r2, r3, lsl #16 - orr r4, r4, r5, lsl #16 - orr r6, r6, r7, lsl #16 - stmia r9!, {r0, r2, r4, r6} - bgt 2b - adds r7, r10, #7 - ldmdbeq fp, {r4-r10, fp, sp, pc} - mov r0, #4 - mov r10, #0 - b 1b - -/* - * write region - */ - -ENTRY(iobus_bs_wr_1) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - add r12, r1, r2, lsl r0 - mov r2, #1 - mov r0, r2, lsl r0 - ldr r2, [sp, #16] - - /* Make sure that we have a positive length */ - cmp r2, #0x00000000 - ldmdble fp, {fp, sp, pc} - -1: - ldrb r1, [r3], #0x0001 - strb r1, [r12], r0 - subs r2, r2, #0x00000001 - bgt 1b - - ldmdb fp, {fp, sp, pc} - -ENTRY(iobus_bs_wr_2) - mov ip, sp - stmfd sp!, {r4-r10, fp, ip, lr, pc} - sub fp, ip, #4 - add r8, r1, r2, lsl r0 - mov r9, r3 - mov r2, #1 - mov r0, r2, lsl r0 - ldr r10, [sp, #44] - - teq r0, #4 /* Is the step 4? */ - movne r7, r10 /* If not, do the whole lot slowly. */ - rsbeq r7, r9, #0 /* Otherwise, go slowly to a */ - andeq r7, r7, #15 /* 16-byte boundary. */ - moveq r7, r7, lsr #1 /* Convert to uint16_ts */ - sub r10, r10, r7 /* Adjust fast transfer len to match */ - cmp r10, #8 - addlt r7, r7, r10 /* If remaining fast xfer is <8 */ - movlt r10, #0 /* make it zero and correct r7. */ - - /* Make sure that we have a positive length */ - teq r7, #0 - beq 2f - -1: ldrb r1, [r9], #0x0001 - ldrb r4, [r9], #1 - orr r1, r1, r4, lsl #8 - orr r1, r1, r1, lsl #16 - str r1, [r8], r0 - subs r7, r7, #1 - bgt 1b - -2: teq r10, #0 - ldmdbeq fp, {r4-r10, fp, sp, pc} - - /* - * Fast write_region_2 code. This is at its best when dealing with - * 16-byte-aligned blocks of memory, which is arranged by the code - * above. - * - * The EOR trick goes: - * rH = (H)(L) - * eor rL, rH, rH, lsl #16 rL = (H^L)(L) - * eor rH, rH, rL, lsr #16 rH = (H)(L^H^L) = (H)(H) - * eor rL, rL, rH, lsl #16 rL = (H^L^H)(L) = (L)(L) - */ - sub r10, r10, #7 -2: ldmia r9!, {r1, r3, r5, r7} - subs r10, r10, #8 - eor r0, r1, r1, lsl #16 - eor r2, r3, r3, lsl #16 - eor r4, r5, r5, lsl #16 - eor r6, r7, r7, lsl #16 - eor r1, r1, r0, lsr #16 - eor r3, r3, r2, lsr #16 - eor r5, r5, r4, lsr #16 - eor r7, r7, r6, lsr #16 - eor r0, r0, r1, lsl #16 - eor r2, r2, r3, lsl #16 - eor r4, r4, r5, lsl #16 - eor r6, r6, r7, lsl #16 - stmia r8!, {r0-r7} - bgt 2b - adds r7, r10, #7 - ldmdbeq fp, {r4-r10, fp, sp, pc} - mov r0, #4 - mov r10, #0 - b 1b - -/* - * set multiple - */ - -ENTRY(iobus_bs_sm_1) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - add r0, r1, r2, lsl r0 - ldr r2, [sp, #16] - - /* Make sure that we have a positive length */ - cmp r2, #0x00000000 - ldmdble fp, {fp, sp, pc} - -1: - strb r3, [r0] - subs r2, r2, #0x00000001 - bgt 1b - - ldmdb fp, {fp, sp, pc} - -ENTRY(iobus_bs_sm_2) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - add r0, r1, r2, lsl r0 - ldr r2, [sp, #16] - - /* Make sure that we have a positive length */ - cmp r2, #0x00000000 - ldmdble fp, {fp, sp, pc} - - orr r3, r3, r3, lsl #16 -1: - str r3, [r0] - subs r2, r2, #0x00000001 - bgt 1b - - ldmdb fp, {fp, sp, pc} - -/* - * set region - */ - -ENTRY(iobus_bs_sr_1) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - add r12, r1, r2, lsl r0 - mov r2, #1 - mov r0, r2, lsl r0 - ldr r2, [sp, #16] - - /* Make sure that we have a positive length */ - cmp r2, #0x00000000 - ldmdble fp, {fp, sp, pc} - -1: - strb r3, [r12], r0 - subs r2, r2, #0x00000001 - bgt 1b - - ldmdb fp, {fp, sp, pc} - -ENTRY(iobus_bs_sr_2) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - add r12, r1, r2, lsl r0 - mov r2, #1 - mov r0, r2, lsl r0 - ldr r2, [sp, #16] - - /* Make sure that we have a positive length */ - cmp r2, #0x00000000 - ldmdble fp, {fp, sp, pc} - - orr r3, r3, r3, lsl #16 -1: - str r3, [r12], r0 - subs r2, r2, #0x00000001 - bgt 1b - - ldmdb fp, {fp, sp, pc} Index: sys/arch/acorn26/acorn26/conf.c =================================================================== RCS file: sys/arch/acorn26/acorn26/conf.c diff -N sys/arch/acorn26/acorn26/conf.c --- sys/arch/acorn26/acorn26/conf.c 11 Dec 2005 12:16:03 -0000 1.9 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,46 +0,0 @@ -/* $NetBSD: conf.c,v 1.9 2005/12/11 12:16:03 christos Exp $ */ -/*- - * Copyright (c) 1998, 2000 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * conf.c -- Device switch tables and related gumf. - */ - -#include -__KERNEL_RCSID(0, "$NetBSD: conf.c,v 1.9 2005/12/11 12:16:03 christos Exp $"); - -#include -#include -#include - -#include "rs.h" - -struct consdev constab[] = { -#if NRS > 0 - cons_init(rs), -#endif - { 0 } -}; Index: sys/arch/acorn26/acorn26/cons_machdep.c =================================================================== RCS file: sys/arch/acorn26/acorn26/cons_machdep.c diff -N sys/arch/acorn26/acorn26/cons_machdep.c --- sys/arch/acorn26/acorn26/cons_machdep.c 11 Dec 2011 03:19:20 -0000 1.13 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,78 +0,0 @@ -/* $NetBSD: cons_machdep.c,v 1.13 2011/12/11 03:19:20 kiyohara Exp $ */ -/*- - * Copyright (c) 1998 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * cons_machdep.c -- machine dependent console routines - */ - -#include -__KERNEL_RCSID(0, "$NetBSD: cons_machdep.c,v 1.13 2011/12/11 03:19:20 kiyohara Exp $"); - -#include -#include -#include -#include - -#include - -#include "arcvideo.h" -#include "opt_ddb.h" -#include "opt_modular.h" -#include "ksyms.h" - -#ifdef DDB -#include -#include -#include -#endif -#if NKSYMS || defined(DDB) || defined(MODULAR) -#include -#include -#endif - -#if NARCVIDEO > 0 -#include -#endif - -void -consinit(void) -{ - -#if NARCVIDEO > 0 - arccons_init(); -#endif -/* cninit();*/ - -#ifdef DDB - db_machine_init(); -#endif /* DDB */ -#if NKSYMS || defined(DDB) || defined(MODULAR) - ksyms_addsyms_elf(bootconfig.esym - bootconfig.ssym, - (char*)MEMC_PHYS_BASE + bootconfig.ssym, - (char*)MEMC_PHYS_BASE + bootconfig.esym); -#endif -} Index: sys/arch/acorn26/acorn26/cpu.c =================================================================== RCS file: sys/arch/acorn26/acorn26/cpu.c diff -N sys/arch/acorn26/acorn26/cpu.c --- sys/arch/acorn26/acorn26/cpu.c 27 Jun 2013 21:16:20 -0000 1.29 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,304 +0,0 @@ -/* $NetBSD: cpu.c,v 1.29 2013/06/27 21:16:20 christos Exp $ */ - -/*- - * Copyright (c) 2000, 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * cpu.c - high-level CPU detection etc - */ - -#include - -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.29 2013/06/27 21:16:20 christos Exp $"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -static int cpu_match(device_t, cfdata_t, void *); -static void cpu_attach(device_t, device_t, void *); -static int cpu_search(device_t, cfdata_t, const int *, void *); -static register_t cpu_identify(void); -#ifdef CPU_ARM2 -static int arm2_undef_handler(u_int, u_int, struct trapframe *, int); -static int swp_handler(u_int, u_int, struct trapframe *, int); -#endif -#ifdef CPU_ARM3 -static void cpu_arm3_setup(device_t, int); -#endif -static void cpu_delay_calibrate(device_t); - -CFATTACH_DECL_NEW(cpu_root, 0, cpu_match, cpu_attach, NULL, NULL); - -/* cf_flags bits */ -#define CFF_NOCACHE 0x00000001 - -static int -cpu_match(device_t parent, cfdata_t cf, void *aux) -{ - - if (curcpu()->ci_dev == NULL) - return 1; - return 0; -} - -static void -cpu_attach(device_t parent, device_t self, void *aux) -{ - int supported; - - curcpu()->ci_dev = self; - aprint_normal(": "); - curcpu()->ci_arm_cpuid = cpu_identify(); - cputype = curcpu()->ci_arm_cputype = - curcpu()->ci_arm_cpuid & CPU_ID_CPU_MASK; - curcpu()->ci_arm_cpurev = - curcpu()->ci_arm_cpuid & CPU_ID_REVISION_MASK; - - supported = 0; - switch (curcpu()->ci_arm_cputype) { - case CPU_ID_ARM2: - aprint_normal("ARM2"); -#ifdef CPU_ARM2 - supported = 1; - install_coproc_handler(CORE_UNKNOWN_HANDLER, - arm2_undef_handler); -#endif - break; - case CPU_ID_ARM250: - aprint_normal("ARM250"); -#ifdef CPU_ARM250 - supported = 1; -#endif - break; - case CPU_ID_ARM3: - aprint_normal("ARM3 (rev. %u)", curcpu()->ci_arm_cpurev); -#ifdef CPU_ARM3 - supported = 1; - cpu_arm3_setup(self, device_cfdata(self)->cf_flags); -#endif - break; - default: - aprint_normal("Unknown type, ID=0x%08x", - curcpu()->ci_arm_cputype); - break; - } - aprint_normal("\n"); - set_cpufuncs(); - if (!supported) - aprint_error_dev(self, - "WARNING: CPU type not supported by kernel\n"); - config_interrupts(self, cpu_delay_calibrate); - config_search_ia(cpu_search, self, "cpu", NULL); -} - -static int -cpu_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux) -{ - - if (config_match(parent, cf, NULL) > 0) - config_attach(parent, cf, NULL, NULL); - - return 0; -} - -static label_t undef_jmp; - -static int -cpu_undef_handler(u_int addr, u_int insn, struct trapframe *tf, int fault_code) -{ - - longjmp(&undef_jmp); -} - -static register_t -cpu_identify(void) -{ - register_t dummy; - volatile register_t id = CPU_ID_ARM2; - void *cp_core, *cp15; - - cp_core = install_coproc_handler(CORE_UNKNOWN_HANDLER, - cpu_undef_handler); - cp15 = install_coproc_handler(SYSTEM_COPROC, cpu_undef_handler); - if (setjmp(&undef_jmp) == 0) { - /* ARM250 and ARM3 support SWP. */ - __asm volatile ("swp r0, r0, [%0]" : : "r" (&dummy) : "r0"); - id = CPU_ID_ARM250; - /* ARM3 has an internal coprocessor 15 with an ID register. */ - __asm volatile ("mrc 15, 0, %0, cr0, cr0" : "=r" (id)); - } - remove_coproc_handler(cp_core); - remove_coproc_handler(cp15); - return id; -} - -#ifdef CPU_ARM2 -static int -arm2_undef_handler(u_int addr, u_int insn, struct trapframe *frame, - int fault_code) -{ - - if ((insn & 0x0fb00ff0) == 0x01000090) - /* It's a SWP */ - return swp_handler(addr, insn, frame, fault_code); - /* - * Check if the aborted instruction was a SWI (ARM2 bug -- - * ARM3 data sheet p87) and call SWI handler if so. - */ - if ((insn & 0x0f000000) == 0x0f000000) { - swi_handler(frame); - return 0; - } - return 1; -} - -/* - * In order for the following macro to work, any function using it - * must ensure that tf->r15 is copied into getreg(15). This is safe - * with the current trapframe layout on acorn26, but be careful. - */ -#define getreg(r) (((register_t *)&tf->tf_r0)[r]) - -static int -swp_handler(u_int addr, u_int insn, struct trapframe *tf, int fault_code) -{ - struct proc *p = curlwp->l_proc; - int rd, rm, rn, byte; - register_t temp; - void *uaddr; - int err; - - KASSERT(fault_code & FAULT_USER); - rd = (insn & 0x0000f000) >> 12; - rm = (insn & 0x0000000f); - rn = (insn & 0x000f0000) >> 16; - byte = insn & 0x00400000; - - if (rd == 15 || rm == 15 || rn == 15) - /* UNPREDICTABLE. Arbitrarily do nothing. */ - return 0; - uaddr = (void *)getreg(rn); - /* We want the page wired so we won't sleep */ - /* XXX only wire one byte due to weirdness with unaligned words */ - err = uvm_vslock(p->p_vmspace, uaddr, 1, VM_PROT_READ | VM_PROT_WRITE); - if (err != 0) { - ksiginfo_t ksi; - KSI_INIT_TRAP(&ksi); - ksi.ksi_signo = SIGSEGV; - ksi.ksi_addr = uaddr; - ksi.ksi_code = SEGV_MAPERR; - trapsignal(curlwp, &ksi); - return 0; - } - /* I believe the uvm_vslock() guarantees the fetch/store won't fail. */ - if (byte) { - temp = fubyte(uaddr); - subyte(uaddr, getreg(rm)); - getreg(rd) = temp; - } else { - /* - * XXX Unaligned addresses happen to be handled - * appropriately by [fs]uword at present. - */ - temp = fuword(uaddr); - suword(uaddr, getreg(rm)); - getreg(rd) = temp; - } - uvm_vsunlock(p->p_vmspace, uaddr, 1); - return 0; -} -#endif - -#ifdef CPU_ARM3 - -#define ARM3_READ(reg, var) \ - __asm ("mrc 15, 0, %0, cr" __STRING(reg) ", cr0" : "=r" (var)) -#define ARM3_WRITE(reg, val) \ - __asm ("mcr 15, 0, %0, cr" __STRING(reg) ", cr0" : : "r" (val)) - -static void -cpu_arm3_setup(device_t self, int flags) -{ - - /* Disable the cache while we set things up. */ - ARM3_WRITE(ARM3_CP15_CONTROL, ARM3_CTL_SHARED); - if (flags & CFF_NOCACHE) { - aprint_normal(", cache disabled"); - return; - } - /* All RAM and ROM is cacheable. */ - ARM3_WRITE(ARM3_CP15_CACHEABLE, 0xfcffffff); - /* All RAM is updateable. */ - ARM3_WRITE(ARM3_CP15_UPDATEABLE, 0x00ffffff); - /* Nothing is disruptive. We'll do cache flushing manually. */ - ARM3_WRITE(ARM3_CP15_DISRUPTIVE, 0x00000000); - /* Flush the cache and turn it on. */ - ARM3_WRITE(ARM3_CP15_FLUSH, 0); - ARM3_WRITE(ARM3_CP15_CONTROL, ARM3_CTL_CACHE_ON | ARM3_CTL_SHARED); - aprint_normal(", cache enabled"); - cpu_delay_factor = 8; -} -#endif - -/* XXX This should be inlined. */ -void -cpu_cache_flush(void) -{ - -#ifdef CPU_ARM3 -#if defined(CPU_ARM2) || defined(CPU_ARM250) - if ((cputype & CPU_ID_CPU_MASK) == CPU_ID_ARM3) -#endif - ARM3_WRITE(ARM3_CP15_FLUSH, 0); -#endif -} - -int cpu_delay_factor = 1; - -static void -cpu_delay_calibrate(device_t self) -{ - struct timeval startt, end, diff; - - microtime(&startt); - cpu_delayloop(10000); - microtime(&end); - timersub(&end, &startt, &diff); - cpu_delay_factor = 10000 / diff.tv_usec + 1; - aprint_normal_dev(self, "10000 loops in %d microseconds, " - "delay factor = %d\n", - diff.tv_usec, cpu_delay_factor); -} Index: sys/arch/acorn26/acorn26/cpuswitch.c =================================================================== RCS file: sys/arch/acorn26/acorn26/cpuswitch.c diff -N sys/arch/acorn26/acorn26/cpuswitch.c --- sys/arch/acorn26/acorn26/cpuswitch.c 16 Aug 2012 17:35:01 -0000 1.18 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,90 +0,0 @@ -/* $NetBSD: cpuswitch.c,v 1.18 2012/08/16 17:35:01 matt Exp $ */ - -/* - * Copyright (c) 2000 Ben Harris. - * Copyright (C) 1995, 1996 Wolfgang Solfrank. - * Copyright (C) 1995, 1996 TooLs GmbH. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * 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 TooLs GmbH. - * 4. The name of TooLs GmbH may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``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 TOOLS GMBH 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. - */ - -/* - * Some additional routines that happened to be in locore.S traditionally, - * but have no need to be coded in assembly. - */ - -#include -__KERNEL_RCSID(0, "$NetBSD: cpuswitch.c,v 1.18 2012/08/16 17:35:01 matt Exp $"); - -#include "opt_lockdebug.h" - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -/* - * Switch to the indicated lwp. - */ -lwp_t * -cpu_switchto(lwp_t *old, lwp_t *new, bool returning) -{ - struct proc *p2; - - /* - * We enter here with interrupts blocked and sched_lock held. - */ - -#if 0 - printf("cpu_switchto: %p -> %p", old, new); -#endif - - curlwp = new; - - if ((new->l_flag & LW_SYSTEM) == 0) { - /* Check for Restartable Atomic Sequences. */ - p2 = new->l_proc; - if (p2->p_raslist != NULL) { - struct trapframe * const tf = lwp_trapframe(curlwp); - void *pc; - - pc = ras_lookup(p2, (void *)(tf->tf_r15 & R15_PC)); - if (pc != (void *) -1) - tf->tf_r15 = (tf->tf_r15 & ~R15_PC) | - (register_t) pc; - } - } - - return cpu_loswitch(old, new); -} Index: sys/arch/acorn26/acorn26/cpuvar.h =================================================================== RCS file: sys/arch/acorn26/acorn26/cpuvar.h diff -N sys/arch/acorn26/acorn26/cpuvar.h --- sys/arch/acorn26/acorn26/cpuvar.h 24 Dec 2005 20:06:46 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,41 +0,0 @@ -/* $NetBSD: cpuvar.h,v 1.4 2005/12/24 20:06:46 perry Exp $ */ -/*- - * Copyright (c) 2000 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#ifndef _ARM26_CPUVAR_H_ -#define _ARM26_CPUVAR_H_ - -extern register_t cpu_type; -extern int cpu_delay_factor; - -/* Fixed code sequence for reliability */ -#define cpu_delayloop(loops) \ - __asm volatile ("1:subs %0, %0, #1; bne 1b" : : "r" (loops) : "cc") - -extern void cpu_cache_flush(void); - -#endif Index: sys/arch/acorn26/acorn26/db_interface.c =================================================================== RCS file: sys/arch/acorn26/acorn26/db_interface.c diff -N sys/arch/acorn26/acorn26/db_interface.c --- sys/arch/acorn26/acorn26/db_interface.c 13 Sep 2014 18:08:38 -0000 1.21 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,378 +0,0 @@ -/* $NetBSD: db_interface.c,v 1.21 2014/09/13 18:08:38 matt Exp $ */ - -/* - * Copyright (c) 1996 Scott K. Stevens - * - * Mach Operating System - * Copyright (c) 1991,1990 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - * - * From: db_interface.c,v 2.4 1991/02/05 17:11:13 mrt (CMU) - */ - -/* - * Interface to new debugger. - */ - -#include -__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.21 2014/09/13 18:08:38 matt Exp $"); - -#include "opt_ddb.h" - -#include -#include -#include -#include /* just for boothowto */ -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -int db_access_und_sp(const struct db_variable *, db_expr_t *, int); -int db_access_abt_sp(const struct db_variable *, db_expr_t *, int); -int db_access_irq_sp(const struct db_variable *, db_expr_t *, int); -u_int db_fetch_reg(int, db_regs_t *); -int db_trapper(u_int addr, u_int inst, struct trapframe *frame, - int fault_code); - -static void db_write_text(unsigned char *, int ch); - -const struct db_variable db_regs[] = { - { "spsr", (long *)&DDB_REGS->tf_spsr, FCN_NULL, }, - { "r0", (long *)&DDB_REGS->tf_r0, FCN_NULL, }, - { "r1", (long *)&DDB_REGS->tf_r1, FCN_NULL, }, - { "r2", (long *)&DDB_REGS->tf_r2, FCN_NULL, }, - { "r3", (long *)&DDB_REGS->tf_r3, FCN_NULL, }, - { "r4", (long *)&DDB_REGS->tf_r4, FCN_NULL, }, - { "r5", (long *)&DDB_REGS->tf_r5, FCN_NULL, }, - { "r6", (long *)&DDB_REGS->tf_r6, FCN_NULL, }, - { "r7", (long *)&DDB_REGS->tf_r7, FCN_NULL, }, - { "r8", (long *)&DDB_REGS->tf_r8, FCN_NULL, }, - { "r9", (long *)&DDB_REGS->tf_r9, FCN_NULL, }, - { "r10", (long *)&DDB_REGS->tf_r10, FCN_NULL, }, - { "r11", (long *)&DDB_REGS->tf_r11, FCN_NULL, }, - { "r12", (long *)&DDB_REGS->tf_r12, FCN_NULL, }, - { "usr_sp", (long *)&DDB_REGS->tf_usr_sp, FCN_NULL, }, - { "usr_lr", (long *)&DDB_REGS->tf_usr_lr, FCN_NULL, }, - { "svc_sp", (long *)&DDB_REGS->tf_svc_sp, FCN_NULL, }, - { "svc_lr", (long *)&DDB_REGS->tf_svc_lr, FCN_NULL, }, - { "pc", (long *)&DDB_REGS->tf_pc, FCN_NULL, }, -#ifdef __PROG32 - { "und_sp", (long *)&nil, db_access_und_sp, }, - { "abt_sp", (long *)&nil, db_access_abt_sp, }, - { "irq_sp", (long *)&nil, db_access_irq_sp, }, -#endif -}; - -const struct db_variable * const db_eregs = db_regs + sizeof(db_regs)/sizeof(db_regs[0]); - -int db_active = 0; -db_regs_t ddb_regs; /* register state */ - -#ifdef __PROG32 -int -db_access_und_sp(const struct db_variable *vp, db_expr_t *valp, int rw) -{ - - if (rw == DB_VAR_GET) - *valp = get_stackptr(PSR_UND32_MODE); - return 0; -} - -int -db_access_abt_sp(const struct db_variable *vp, db_expr_t valp, int rw) -{ - - if (rw == DB_VAR_GET) - *valp = get_stackptr(PSR_ABT32_MODE); - return 0; -} - -int -db_access_irq_sp(const struct db_variable *vp, db_expr_t *valp, int rw) -{ - - if (rw == DB_VAR_GET) - *valp = get_stackptr(PSR_IRQ32_MODE); - return 0; -} -#endif /* __PROG32 */ - -/* - * kdb_trap - field a TRACE or BPT trap - */ -int -kdb_trap(int type, db_regs_t *regs) -{ - int s; - - switch (type) { - case T_BREAKPOINT: /* breakpoint */ - case -1: /* keyboard interrupt */ - break; - default: - if (db_recover != 0) { - db_error("Faulted in DDB; continuing...\n"); - /*NOTREACHED*/ - } - } - - /* Should switch to kdb`s own stack here. */ - - ddb_regs = *regs; - - s = splhigh(); - db_active++; - cnpollc(true); - db_trap(type, 0/*code*/); - cnpollc(false); - db_active--; - splx(s); - - *regs = ddb_regs; - - return 1; -} - -volatile bool db_validating, db_faulted; - -int -db_validate_address(vaddr_t addr) -{ - - db_faulted = false; - db_validating = true; - (void) *(volatile uint8_t *)addr; - db_validating = false; - return db_faulted; -} - -/* - * Read bytes from kernel address space for debugger. - */ -void -db_read_bytes(vaddr_t addr, size_t size, char *data) -{ - char *src; - - src = (char *)addr; - for (; size > 0; size--) { - if (db_validate_address((u_int)src)) { - db_printf("address %p is invalid\n", src); - return; - } - *data++ = *src++; - } -} - -static void -db_write_text(unsigned char *dst, int ch) -{ - - if (db_validate_address((u_int)dst)) { - db_printf(" address %p not a valid page\n", dst); - return; - } - - *dst = (unsigned char)ch; -} - -/* - * Write bytes to kernel address space for debugger. - */ -void -db_write_bytes(vaddr_t addr, size_t size, const char *data) -{ -#if 0 - extern char _stext_[], _etext[]; -#endif - char *dst; - int loop; - - dst = (char *)addr; - loop = size; - while (--loop >= 0) { -#if 0 /* FIXME */ - if ((dst >= _stext_) && (dst < _etext)) -#endif - db_write_text(dst, *data); -#if 0 - else { - if (db_validate_address((u_int)dst)) { - db_printf("address %p is invalid\n", dst); - return; - } - *dst = *data; - } -#endif - dst++, data++; - } -} - -const struct db_command db_machine_command_table[] = { - { DDB_ADD_CMD("bsw", db_bus_write_cmd, CS_MORE, - "Writes a one or two bytes to the IObus", - "[/bh] [addr]", - " addr:\tIO address to write\n" - " /b:\twrite a single byte\n" - " /h:\twrite two bytes") }, - { DDB_ADD_CMD("frame", db_show_frame_cmd, 0, - "Displays the contents of a trapframe", - "[address]", - " address:\taddress of trapfame to display")}, - { DDB_ADD_CMD("irqstat", db_irqstat_cmd, 0, - "Displays the IRQ statistics", - NULL,NULL) }, - { DDB_ADD_CMD( NULL, NULL, 0, NULL, NULL,NULL) } -}; - -int -db_trapper(u_int addr, u_int inst, trapframe_t *frame, int fault_code) -{ - - if (fault_code == 0) { - if ((inst & ~INSN_COND_MASK) == (BKPT_INST & ~INSN_COND_MASK)) - kdb_trap(T_BREAKPOINT, frame); - else - kdb_trap(-1, frame); - } else - return 1; - return 0; -} - -extern u_int esym; -extern u_int end; - -static struct undefined_handler db_uh; - -void -db_machine_init(void) -{ - - /* - * We get called before malloc() is available, so supply a static - * struct undefined_handler. - */ - db_uh.uh_handler = db_trapper; - install_coproc_handler_static(CORE_UNKNOWN_HANDLER, &db_uh); -} - -u_int -db_fetch_reg(int reg, db_regs_t *regs) -{ - - switch (reg) { - case 0: - return regs->tf_r0; - case 1: - return regs->tf_r1; - case 2: - return regs->tf_r2; - case 3: - return regs->tf_r3; - case 4: - return regs->tf_r4; - case 5: - return regs->tf_r5; - case 6: - return regs->tf_r6; - case 7: - return regs->tf_r7; - case 8: - return regs->tf_r8; - case 9: - return regs->tf_r9; - case 10: - return regs->tf_r10; - case 11: - return regs->tf_r11; - case 12: - return regs->tf_r12; - case 13: - return regs->tf_svc_sp; - case 14: - return regs->tf_svc_lr; - case 15: - return regs->tf_pc; - default: - panic("db_fetch_reg: botch"); - } -} - -u_int -branch_taken(u_int insn, u_int pc, db_regs_t *regs) -{ - u_int addr, nregs; - - switch ((insn >> 24) & 0xf) { - case 0xa: /* b ... */ - case 0xb: /* bl ... */ - addr = ((insn << 2) & 0x03ffffff); - if (addr & 0x02000000) - addr |= 0xfc000000; - return pc + 8 + addr; - case 0x7: /* ldr pc, [pc, reg, lsl #2] */ - addr = db_fetch_reg(insn & 0xf, regs); - addr = pc + 8 + (addr << 2); - db_read_bytes(addr, 4, (char *)&addr); - return addr; - case 0x1: /* mov pc, reg */ - addr = db_fetch_reg(insn & 0xf, regs); - return addr; - case 0x8: /* ldmxx reg, {..., pc} */ - case 0x9: - addr = db_fetch_reg((insn >> 16) & 0xf, regs); - nregs = (insn & 0x5555) + ((insn >> 1) & 0x5555); - nregs = (nregs & 0x3333) + ((nregs >> 2) & 0x3333); - nregs = (nregs + (nregs >> 4)) & 0x0f0f; - nregs = (nregs + (nregs >> 8)) & 0x001f; - switch ((insn >> 23) & 0x3) { - case 0x0: /* ldmda */ - addr = addr - 0; - break; - case 0x1: /* ldmia */ - addr = addr + 0 + ((nregs - 1) << 2); - break; - case 0x2: /* ldmdb */ - addr = addr - 4; - break; - case 0x3: /* ldmib */ - addr = addr + 4 + ((nregs - 1) << 2); - break; - } - db_read_bytes(addr, 4, (char *)&addr); - return addr; - default: - panic("branch_taken: botch"); - } -} Index: sys/arch/acorn26/acorn26/db_machdep.c =================================================================== RCS file: sys/arch/acorn26/acorn26/db_machdep.c diff -N sys/arch/acorn26/acorn26/db_machdep.c --- sys/arch/acorn26/acorn26/db_machdep.c 5 Jan 2013 15:04:00 -0000 1.9 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,109 +0,0 @@ -/* $NetBSD: db_machdep.c,v 1.9 2013/01/05 15:04:00 christos Exp $ */ - -/* - * Copyright (c) 1996 Mark Brinicombe - * - * Mach Operating System - * Copyright (c) 1991,1990 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - */ - -#include -__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.9 2013/01/05 15:04:00 christos Exp $"); - -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include - - -void -db_show_frame_cmd(db_expr_t addr, bool have_addr, db_expr_t count, - const char *modif) -{ - struct trapframe *frame; - - if (!have_addr) { - db_printf("frame address must be specified\n"); - return; - } - - frame = (struct trapframe *)addr; - - db_printf("frame address = %08x ", (u_int)frame); - db_printf("r0 =%08x r1 =%08x r2 =%08x r3 =%08x\n", - frame->tf_r0, frame->tf_r1, frame->tf_r2, frame->tf_r3); - db_printf("r4 =%08x r5 =%08x r6 =%08x r7 =%08x\n", - frame->tf_r4, frame->tf_r5, frame->tf_r6, frame->tf_r7); - db_printf("r8 =%08x r9 =%08x r10=%08x r11=%08x\n", - frame->tf_r8, frame->tf_r9, frame->tf_r10, frame->tf_r11); - db_printf("r12=%08x r13=%08x r14=%08x r15=%08x\n", - frame->tf_r12, frame->tf_r13, frame->tf_r14, frame->tf_r15); -} - - -void -db_bus_write_cmd(db_expr_t addr, bool have_addr, db_expr_t count, - const char *modif) -{ - db_expr_t datum; - bus_space_tag_t iot = &iobus_bs_tag; /* XXX */ - bus_space_handle_t ioh; - - if (!have_addr) - db_error("target address must be specified"); - - bus_space_map(iot, addr, 1, 0, &ioh); - - while (db_expression(&datum)) { - switch (*modif) { - case 'b': - bus_space_write_1(iot, ioh, 0, datum); - break; - case '\0': - case 'h': - bus_space_write_2(iot, ioh, 0, datum); - break; - default: - db_error("bad modifier"); - } - } - bus_space_unmap(iot, ioh, 1); - db_skip_to_eol(); -} - -void -db_irqstat_cmd(db_expr_t addr, bool have_addr, db_expr_t count, - const char *modif) -{ - - irq_stat(db_printf); -} Index: sys/arch/acorn26/acorn26/except.c =================================================================== RCS file: sys/arch/acorn26/acorn26/except.c diff -N sys/arch/acorn26/acorn26/except.c --- sys/arch/acorn26/acorn26/except.c 8 Mar 2014 15:46:20 -0000 1.31 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,519 +0,0 @@ -/* $NetBSD: except.c,v 1.31 2014/03/08 15:46:20 skrll Exp $ */ -/*- - * Copyright (c) 1998, 1999, 2000 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * except.c -- ARM exception handling. - */ - -#include - -__KERNEL_RCSID(0, "$NetBSD: except.c,v 1.31 2014/03/08 15:46:20 skrll Exp $"); - -#include "opt_ddb.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -#include -#include - -#ifdef DEBUG -#include -#endif - -#ifdef DDB -#include -#include -#endif - -void syscall(struct trapframe *); -static void do_fault(struct trapframe *, struct lwp *, struct vm_map *, - vaddr_t, vm_prot_t); -static void data_abort_fixup(struct trapframe *); -static vaddr_t data_abort_address(struct trapframe *, vsize_t *); -static vm_prot_t data_abort_atype(struct trapframe *); -static bool data_abort_usrmode(struct trapframe *); -#ifdef DEBUG -static void printregs(struct trapframe *tf); -#endif -#ifdef DIAGNOSTIC -void checkvectors(void); -#endif - -int want_resched; - -#ifdef DIAGNOSTIC -void -checkvectors(void) -{ - uint32_t *ptr; - - /* Check that the vectors are valid */ - for (ptr = (uint32_t *)0; ptr < (uint32_t *)0x1c; ptr++) - if (*ptr != 0xe59ff114) - panic("CPU vectors mangled"); -} -#endif - -void -prefetch_abort_handler(struct trapframe *tf) -{ - struct lwp * const l = curlwp; - struct proc * const p = l->l_proc; - - /* Enable interrupts if they were enabled before the trap. */ - if ((tf->tf_r15 & R15_IRQ_DISABLE) == 0) - int_on(); - - /* - * XXX Not done yet: - * Check if the page being requested is already present. If - * so, call the undefined instruction handler instead (ARM3 ds - * p15). - */ - - curcpu()->ci_data.cpu_ntrap++; - - if (TRAP_USERMODE(tf)) { - lwp_settrapframe(l, tf); - LWP_CACHE_CREDS(l, p); - } else { -#ifdef DDB - db_printf("Prefetch abort in kernel mode\n"); - kdb_trap(T_FAULT, tf); -#else -#ifdef DEBUG - printf("Prefetch abort:\n"); - printregs(tf); -#endif - panic("prefetch abort in kernel mode"); -#endif - } - - /* User-mode prefetch abort */ - vaddr_t pc = tf->tf_r15 & R15_PC; - - do_fault(tf, l, &p->p_vmspace->vm_map, pc, VM_PROT_EXECUTE); - - userret(l); -} - -void -data_abort_handler(struct trapframe *tf) -{ - struct lwp * const l = curlwp; - struct proc * const p = l->l_proc; - vm_prot_t atype; - bool usrmode, twopages; - struct vm_map *map; - vaddr_t va; - vsize_t asize; - - /* - * Data aborts in kernel mode are possible (copyout etc), so - * we hope the compiler (or programmer) has ensured that - * R14_svc gets saved. - * - * We may need to fix up an STM or LDM instruction. This - * involves seeing if the base was being written back, and if - * so resetting it (by counting the number of registers being - * transferred) before retrying (ARM 2 ds pp 10 & 33). - */ - - /* Enable interrupts if they were enabled before the trap. */ - if ((tf->tf_r15 & R15_IRQ_DISABLE) == 0) - int_on(); - curcpu()->ci_data.cpu_ntrap++; - if ((tf->tf_r15 & R15_MODE) == R15_MODE_USR) { - lwp_settrapframe(l, tf); - LWP_CACHE_CREDS(l, p); - } - data_abort_fixup(tf); - va = data_abort_address(tf, &asize); - atype = data_abort_atype(tf); - usrmode = data_abort_usrmode(tf); - twopages = (trunc_page(va) != round_page(va + asize) - PAGE_SIZE); - if (!usrmode && va >= VM_MIN_KERNEL_ADDRESS) - map = kernel_map; - else - map = &p->p_vmspace->vm_map; - do_fault(tf, l, map, va, atype); - if (twopages) - do_fault(tf, l, map, va + asize - 4, atype); - - if (TRAP_USERMODE(tf)) - userret(l); -} - -/* - * General page fault handler. - */ -void -do_fault(struct trapframe *tf, struct lwp *l, - struct vm_map *map, vaddr_t va, vm_prot_t atype) -{ - int error; - - if (pmap_fault(map->pmap, va, atype)) - return; - - struct pcb * const pcb = lwp_getpcb(l); - void * const onfault = pcb->pcb_onfault; - const bool user = TRAP_USERMODE(tf); - - if (cpu_intr_p()) { - KASSERT(!user); - error = EFAULT; - } else { - pcb->pcb_onfault = NULL; - error = uvm_fault(map, va, atype); - pcb->pcb_onfault = onfault; - } - - if (error != 0) { - ksiginfo_t ksi; - - if (onfault != NULL) { - tf->tf_r0 = error; - tf->tf_r15 = (tf->tf_r15 & ~R15_PC) | - (register_t)onfault; - return; - } -#ifdef DDB - if (db_validating) { - db_faulted = true; - tf->tf_r15 += INSN_SIZE; - return; - } -#endif - if (!user) { -#ifdef DDB - db_printf("Unhandled data abort in kernel mode\n"); - kdb_trap(T_FAULT, tf); -#else -#ifdef DEBUG - printf("Unhandled data abort:\n"); - printregs(tf); -#endif - panic("unhandled data abort in kernel mode"); -#endif - } - - KSI_INIT_TRAP(&ksi); - - if (error == ENOMEM) { - printf("UVM: pid %d (%s), uid %d killed: " - "out of swap\n", - l->l_proc->p_pid, l->l_proc->p_comm, - l->l_cred ? kauth_cred_geteuid(l->l_cred) : -1); - ksi.ksi_signo = SIGKILL; - } else - ksi.ksi_signo = SIGSEGV; - ksi.ksi_code = (error == EPERM) ? SEGV_ACCERR : SEGV_MAPERR; - ksi.ksi_addr = (void *) va; - trapsignal(l, &ksi); - } else if (!user) { - ucas_ras_check(tf); - } -} - -/* - * In order for the following macro to work, any function using it - * must ensure that tf->r15 is copied into getreg(15). This is safe - * with the current trapframe layout on arm26, but be careful. - */ -#define getreg(r) (((register_t *)&tf->tf_r0)[r]) - -/* - * Undo any effects of the aborted instruction that need to be undone - * in order for us to restart it. This is just a case of spotting - * aborted LDMs and STMs and reversing any base writeback. This code - * is derived loosely from the arm32 late-abort fixup. - */ -static void -data_abort_fixup(struct trapframe *tf) -{ - register_t insn; - int rn, count, loop; - - getreg(15) = tf->tf_r15; - /* Get the faulting instruction */ - insn = *(register_t *)(tf->tf_r15 & R15_PC); - if ((insn & 0x0e000000) == 0x08000000 && - (insn & 1 << 21)) { - /* LDM/STM with writeback*/ - rn = (insn >> 16) & 0x0f; - if (rn == 15) - return; /* No writeback on R15 */ - /* Count registers transferred */ - count = 0; - for (loop = 0; loop < 16; ++loop) { - if (insn & (1<tf_r15; - /* Get the faulting instruction */ - insn = *(register_t *)(tf->tf_r15 & R15_PC); - if ((insn & 0x0c000000) == 0x04000000) { - /* Single data transfer */ - *vsp = 1; /* or 4, but it doesn't really matter */ - rn = (insn & 0x000f0000) >> 16; - base = getreg(rn); - if (rn == 15) - base = (base & R15_PC) + 8; - p = insn & 1 << 24; - if (p == 0) - /* Post-indexed, so offset doesn't concern us */ - return base; - u = insn & 1 << 23; - i = insn & 1 << 25; - if (i == 0) { - /* Immediate offset (str r0, [r1, #42]) */ - offset = insn & 0x00000fff; - if (u == 0) - return base - offset; - else - return base + offset; - } - rm = insn & 0x0000000f; - offset = getreg(rm); - if (rm == 15) - offset += 8; - if ((insn & 1 << 4) == 0) - /* immediate shift */ - shift = (insn & 0x00000f80) >> 7; - else - goto croak; /* Undefined instruction */ - switch ((insn & 0x00000060) >> 5) { - case 0: /* Logical left */ - offset = (int)(((u_int)offset) << shift); - break; - case 1: /* Logical Right */ - if (shift == 0) shift = 32; - offset = (int)(((u_int)offset) >> shift); - break; - case 2: /* Arithmetic Right */ - if (shift == 0) shift = 32; - offset = (int)(((int)offset) >> shift); - break; - case 3: - if (shift == 0) /* Rotate Right Extended */ - offset = (int)((tf->tf_r15 & R15_FLAG_C) << 2 | - ((u_int)offset) >> 1); - else /* Rotate Right */ - offset = (int)((u_int)offset >> shift | - (u_int)offset << (32 - shift)); - } - if (u == 0) - return base - offset; - else - return base + offset; - } else if ((insn & 0x0e000000) == 0x08000000) { - int loop, count; - - /* LDM/STM */ - rn = (insn >> 16) & 0x0f; - p = insn & 1 << 24; - u = insn & 1 << 23; - /* Count registers transferred */ - count = 0; - for (loop = 0; loop < 16; ++loop) - if (insn & (1< "); - disassemble(tf->tf_r15 & R15_PC); -#endif - panic("data_abort_address"); -} - -/* - * We need to know whether the page should be mapped as R or R/W. We - * need to disassemble the instruction responsible and determine if it - * was a read or write instruction. This code is based on the arm32 - * version. - */ -static vm_prot_t -data_abort_atype(struct trapframe *tf) -{ - register_t insn; - - insn = *(register_t *)(tf->tf_r15 & R15_PC); - /* STR instruction ? */ - if ((insn & 0x0c100000) == 0x04000000) - return VM_PROT_WRITE; - /* STM or CDT instruction ? */ - else if ((insn & 0x0a100000) == 0x08000000) - return VM_PROT_WRITE; -#if defined(CPU_ARM250) || defined(CPU_ARM3) - /* SWP instruction ? */ - else if ((insn & 0x0fb00ff0) == 0x01000090) - return VM_PROT_READ | VM_PROT_WRITE; -#endif - return VM_PROT_READ; -} - -/* - * Work out what effective mode was in use when a data abort occurred. - */ -static bool -data_abort_usrmode(struct trapframe *tf) -{ - register_t insn; - - if (TRAP_USERMODE(tf)) - return true; - insn = *(register_t *)(tf->tf_r15 & R15_PC); - if ((insn & 0x0d200000) == 0x04200000) - /* LDR[B]T and STR[B]T */ - return true; - return false; -} - -void -address_exception_handler(struct trapframe *tf) -{ - struct lwp * const l = curlwp; - struct pcb * const pcb = lwp_getpcb(l); - ksiginfo_t ksi; - - /* Enable interrupts if they were enabled before the trap. */ - if ((tf->tf_r15 & R15_IRQ_DISABLE) == 0) - int_on(); - - curcpu()->ci_data.cpu_ntrap++; - if (TRAP_USERMODE(tf)) { - lwp_settrapframe(l, tf); - LWP_CACHE_CREDS(l, l->l_proc); - } - - if (pcb->pcb_onfault != NULL) { - tf->tf_r0 = EFAULT; - tf->tf_r15 = (tf->tf_r15 & ~R15_PC) | - (uintptr_t)pcb->pcb_onfault; - return; - } - - vaddr_t pc = tf->tf_r15 & R15_PC; - - if (!TRAP_USERMODE(tf)) { -#ifdef DDB - db_printf("Address exception in kernel mode\n"); - kdb_trap(T_FAULT, tf); -#else -#ifdef DEBUG - printf("Address exception:\n"); - printregs(tf); - printf("pc -> "); - disassemble(pc); -#endif - panic("address exception in kernel mode"); -#endif - } - - KSI_INIT_TRAP(&ksi); - ksi.ksi_signo = SIGSEGV; - ksi.ksi_code = SEGV_MAPERR; - ksi.ksi_addr = (void *) pc; - trapsignal(l, &ksi); - userret(l); -} - -#ifdef DEBUG -static void -printregs(struct trapframe *tf) -{ - - printf("R0 = 0x%08x R1 = 0x%08x R2 = 0x%08x R3 = 0x%08x\n" - "R4 = 0x%08x R5 = 0x%08x R6 = 0x%08x R7 = 0x%08x\n" - "R8 = 0x%08x R9 = 0x%08x R10 = 0x%08x R11 = 0x%08x\n" - "R12 = 0x%08x R13 = 0x%08x R14 = 0x%08x R15 = 0x%08x\n", - tf->tf_r0, tf->tf_r1, tf->tf_r2, tf->tf_r3, - tf->tf_r4, tf->tf_r5, tf->tf_r6, tf->tf_r7, - tf->tf_r8, tf->tf_r9, tf->tf_r10, tf->tf_r11, - tf->tf_r12, tf->tf_r13, tf->tf_r14, tf->tf_r15); -} -#endif - -/* irq_handler is over in irq.c */ Index: sys/arch/acorn26/acorn26/fpu.c =================================================================== RCS file: sys/arch/acorn26/acorn26/fpu.c diff -N sys/arch/acorn26/acorn26/fpu.c --- sys/arch/acorn26/acorn26/fpu.c 27 Oct 2012 17:17:22 -0000 1.14 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,130 +0,0 @@ -/* $NetBSD: fpu.c,v 1.14 2012/10/27 17:17:22 chs Exp $ */ - -/*- - * Copyright (c) 2000, 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * fpu.c - Floating point unit support - */ - -#include - -__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.14 2012/10/27 17:17:22 chs Exp $"); - -#include -#include -#include -#include -#include -#include - - -#include - -#include "opt_fputypes.h" - -static int fpu_match(device_t, cfdata_t, void *); -static void fpu_attach(device_t, device_t, void *); -static register_t fpu_identify(void); - -CFATTACH_DECL_NEW(fpu, sizeof(struct fpu_softc), - fpu_match, fpu_attach, NULL, NULL); - -struct fpu_softc *the_fpu; - -static int -fpu_match(device_t parent, cfdata_t cf, void *aux) -{ - - return the_fpu == NULL && fpu_identify() != 0; -} - -static void -fpu_attach(device_t parent, device_t self, void *aux) -{ - struct fpu_softc *sc = device_private(self); - int supported; - - the_fpu = sc; - printf(": "); - sc->sc_fputype = fpu_identify(); - supported = 0; - switch (sc->sc_fputype) { - case FPSR_SYSID_FPPC: - printf("FPPC/WE32206"); -#ifdef FPU_FPPC - /* XXX Uncomment when we have minimal support. */ - supported = 1; - sc->sc_ctxload = fpctx_load_fppc; - sc->sc_ctxsave = fpctx_save_fppc; - sc->sc_enable = fpu_enable_fppc; - sc->sc_disable = fpu_disable_fppc; -#endif - break; - case FPSR_SYSID_FPA: - printf("FPA"); -#ifdef FPU_FPA - /* XXX Uncomment when we have minimal support. */ - supported = 1; - sc->sc_ctxload = fpctx_load_fpa; - sc->sc_ctxsave = fpctx_save_fpa; - sc->sc_enable = fpu_enable_fpa; - sc->sc_disable = fpu_disable_fpa; -#endif - break; - default: - printf("Unknown type, ID=0x%02x", sc->sc_fputype >> 24); - break; - } - printf("\n"); - if (!supported) - printf("%s: WARNING: FPU type not supported by kernel\n", - device_xname(self)); -} - -static label_t undef_jmp; - -static int -fpu_undef_handler(u_int addr, u_int insn, struct trapframe *tf, int fault_code) -{ - - longjmp(&undef_jmp); -} - -static register_t -fpu_identify(void) -{ - volatile register_t fpsr; - void *uh; - - if (setjmp(&undef_jmp) == 0) { - uh = install_coproc_handler(FPA_COPROC, fpu_undef_handler); - fpsr = 0; - __asm volatile ("rfs %0" : "=r" (fpsr)); - } - remove_coproc_handler(uh); - return fpsr & FPSR_SYSID_MASK; -} Index: sys/arch/acorn26/acorn26/fpu_asm.S =================================================================== RCS file: sys/arch/acorn26/acorn26/fpu_asm.S diff -N sys/arch/acorn26/acorn26/fpu_asm.S --- sys/arch/acorn26/acorn26/fpu_asm.S 28 Aug 2006 14:31:18 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,129 +0,0 @@ -/* $NetBSD: fpu_asm.S,v 1.3 2006/08/28 14:31:18 bjh21 Exp $ */ - -/*- - * Copyright (c) 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * fpu_asm.S - Floating point unit support - */ - -#include - -RCSID("$NetBSD: fpu_asm.S,v 1.3 2006/08/28 14:31:18 bjh21 Exp $") - -#include - -#include "opt_fputypes.h" - -#ifdef FPU_FPA -/* - * void fpctx_save_fpa(struct fpframe *); - */ -ENTRY(fpctx_save_fpa) - rfs r1 - str r1, [r0] - sfm f0, 4, [r0, #(4 + 12 * 0)] - sfm f4, 4, [r0, #(4 + 12 * 4)] - mov pc, lr - -/* - * void fpctx_load_fpa(struct fpframe *); - */ -ENTRY(fpctx_load_fpa) - lfm f0, 4, [r0, #(4 + 12 * 0)] - lfm f4, 4, [r0, #(4 + 12 * 4)] - ldr r1, [r0] - wfs r1 - mov pc, lr - -/* - * void fpu_enable_fpa(void); - */ -ENTRY(fpu_enable_fpa) - mov r0, #FPA_FPCR_EN - wfc r0 - mov pc, lr -#endif - -/* - * void fpu_disable_fpa(void); - */ -ENTRY(fpu_disable_fpa) - mov r0, #0 - wfc r0 - mov pc, lr - -#ifdef FPU_FPPC -/* - * void fpctx_save_fppc(struct fpframe *); - */ -ENTRY(fpctx_save_fppc) - rfs r1 - str r1, [r0] - stfe f0, [r0, #(4 + 12 * 0)] - stfe f1, [r0, #(4 + 12 * 1)] - stfe f2, [r0, #(4 + 12 * 2)] - stfe f3, [r0, #(4 + 12 * 3)] - stfe f4, [r0, #(4 + 12 * 4)] - stfe f5, [r0, #(4 + 12 * 5)] - stfe f6, [r0, #(4 + 12 * 6)] - stfe f7, [r0, #(4 + 12 * 7)] - mov pc, lr - -/* - * void fpctx_load_fppc(struct fpframe *); - */ -ENTRY(fpctx_load_fppc) - ldfe f0, [r0, #(4 + 12 * 0)] - ldfe f1, [r0, #(4 + 12 * 1)] - ldfe f2, [r0, #(4 + 12 * 2)] - ldfe f3, [r0, #(4 + 12 * 3)] - ldfe f4, [r0, #(4 + 12 * 4)] - ldfe f5, [r0, #(4 + 12 * 5)] - ldfe f6, [r0, #(4 + 12 * 6)] - ldfe f7, [r0, #(4 + 12 * 7)] - ldr r1, [r0] - wfs r1 - mov pc, lr - -/* - * void fpu_enable_fppc(void); - */ -ENTRY(fpu_enable_fppc) - rfc r0 - orr r0, r0, #FPPC_FPCR_DA - wfc r0 - mov pc, lr -#endif - -/* - * void fpu_disable_fppc(void); - */ -ENTRY(fpu_disable_fppc) - rfc r0 - bic r0, r0, #FPPC_FPCR_DA - wfc r0 - mov pc, lr Index: sys/arch/acorn26/acorn26/fpuvar.h =================================================================== RCS file: sys/arch/acorn26/acorn26/fpuvar.h diff -N sys/arch/acorn26/acorn26/fpuvar.h --- sys/arch/acorn26/acorn26/fpuvar.h 27 Oct 2012 17:17:22 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,60 +0,0 @@ -/* $NetBSD: fpuvar.h,v 1.4 2012/10/27 17:17:22 chs Exp $ */ - -/*- - * Copyright (c) 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#ifndef _FPUVAR_H -#define _FPUVAR_H - -#include -#include - -struct proc; - -struct fpu_softc { - register_t sc_fputype; - void (*sc_ctxload)(struct fpframe *); - void (*sc_ctxsave)(struct fpframe *); - void (*sc_enable)(void); - void (*sc_disable)(void); - struct proc *sc_owner; -}; - -#ifdef _KERNEL -extern struct fpu_softc *the_fpu; - -void fpctx_save_fpa(struct fpframe *); -void fpctx_load_fpa(struct fpframe *); -void fpu_enable_fpa(void); -void fpu_disable_fpa(void); -void fpctx_save_fppc(struct fpframe *); -void fpctx_load_fppc(struct fpframe *); -void fpu_enable_fppc(void); -void fpu_disable_fppc(void); -#endif - -#endif Index: sys/arch/acorn26/acorn26/genassym.cf =================================================================== RCS file: sys/arch/acorn26/acorn26/genassym.cf diff -N sys/arch/acorn26/acorn26/genassym.cf --- sys/arch/acorn26/acorn26/genassym.cf 16 Aug 2012 16:23:48 -0000 1.13 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,77 +0,0 @@ -# $NetBSD: genassym.cf,v 1.13 2012/08/16 16:23:48 matt Exp $ -# -# Copyright (c) 1999 Ben Harris -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not 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. - -include "eca.h" - -include - -include -include -include -include -include -include -include - -include - -if NECA > 0 -include -endif - -define __PROG26 1 - -define PCB_SF offsetof(struct pcb, pcb_sf) -define PCB_ONFAULT offsetof(struct pcb, pcb_onfault) -define L_PCB offsetof(struct lwp, l_addr) - -define TF_SPSR offsetof(struct trapframe, tf_spsr) -define TF_R0 offsetof(struct trapframe, tf_r0) -define TF_R15 offsetof(struct trapframe, tf_r15) -define TF_SIZE sizeof(struct trapframe) - -define IF_R15 offsetof(struct irqframe, if_r15) -define IF_SIZE sizeof(struct irqframe) - -# Constants required for in_cksum() and friends. -define M_NEXT offsetof(struct mbuf, m_next) -define M_DATA offsetof(struct mbuf, m_data) -define M_LEN offsetof(struct mbuf, m_len) -define IP_SRC offsetof(struct ip, ip_src) -define IP_DST offsetof(struct ip, ip_dst) - -if NECA > 0 -define EFS_FIQHANDLER offsetof(struct eca_fiqstate, efs_fiqhandler) -define EFS_RX_CURMBUF offsetof(struct eca_fiqstate, efs_rx_curmbuf) -define EFS_RX_FIQREGS offsetof(struct eca_fiqstate, efs_rx_fiqregs) -define EFS_RX_FLAGS offsetof(struct eca_fiqstate, efs_rx_flags) -define EFS_RX_MYADDR offsetof(struct eca_fiqstate, efs_rx_myaddr) -define EFS_TX_CURMBUF offsetof(struct eca_fiqstate, efs_tx_curmbuf) -endif - -define CI_ASTPENDING offsetof(struct cpu_info, ci_astpending) -define CI_CURLWP offsetof(struct cpu_info, ci_curlwp) Index: sys/arch/acorn26/acorn26/irq.c =================================================================== RCS file: sys/arch/acorn26/acorn26/irq.c diff -N sys/arch/acorn26/acorn26/irq.c --- sys/arch/acorn26/acorn26/irq.c 11 May 2012 15:39:17 -0000 1.17 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,443 +0,0 @@ -/* $NetBSD: irq.c,v 1.17 2012/05/11 15:39:17 skrll Exp $ */ - -/*- - * Copyright (c) 2000, 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * irq.c - IOC IRQ handler. - */ - -#include -__KERNEL_RCSID(0, "$NetBSD: irq.c,v 1.17 2012/05/11 15:39:17 skrll Exp $"); - -#include -#include -#include /* for cold */ -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include "opt_arm_debug.h" -#include "opt_ddb.h" -#include "opt_flashything.h" -#include "fiq.h" -#include "ioeb.h" -#include "unixbp.h" - -#ifdef DDB -#include -#endif -#if NFIQ > 0 -#include -#endif -#if NIOEB > 0 -#include -#endif -#if NUNIXBP > 0 -#include -#endif - -#define NIRQ 20 -extern char *irqnames[]; - -#if NFIQ > 0 -void (*fiq_downgrade_handler)(void); -int fiq_want_downgrade; -#endif - -/* - * Interrupt masks are held in 32-bit integers. At present, the - * bottom eight bits are interrupt register A on the IOC, and the next - * eight are interrupt register B. After that, on systems with Unix - * backplanes, there are four bits from there. FIQs should - * be represented eventually. - */ - -static uint32_t irqmask[NIPL]; - -LIST_HEAD(irq_handler_head, irq_handler) irq_list_head = - LIST_HEAD_INITIALIZER(irq_list_head); - -struct irq_handler { - LIST_ENTRY(irq_handler) link; - int (*func)(void *); - void *arg; - uint32_t mask; - int irqnum; - int ipl; - int enabled; - struct evcnt *ev; -}; - -inline int hardsplx(int); - -void -irq_init(void) -{ - - irq_genmasks(); -} - -/* - * This is optimised for speed rather than generality. It expects to - * be called an awful lot. - * - * On entry, IRQs are disabled on the CPU. - */ - -void -irq_handler(struct irqframe *irqf) -{ - int s, status, result, stray; - struct irq_handler *h; - - curcpu()->ci_intr_depth++; - KASSERT(the_ioc != NULL); - /* Get the current interrupt state */ - status = ioc_irq_status_full(); -#if NUNIXBP > 0 - status |= unixbp_irq_status_full() << IRQ_UNIXBP_BASE; -#endif - - /* We're already in splhigh, but make sure the kernel knows that. */ - s = splhigh(); - -#if 0 - printf("*"); -#endif - curcpu()->ci_data.cpu_nintr++; - - stray = 1; -#if NFIQ > 0 - /* Check for downgraded FIQs. */ - if (fiq_want_downgrade) { - KASSERT(fiq_downgrade_handler != NULL); - fiq_want_downgrade = 0; - (fiq_downgrade_handler)(); - goto handled; - } -#endif - /* Find the highest-priority requested interrupt. */ - for (h = irq_list_head.lh_first; - h != NULL && h->ipl > s; - h = h->link.le_next) - if (h->enabled && ((status & h->mask) == h->mask)) { - splx(h->ipl); -#if 0 - printf("IRQ %d...", h->irqnum); -#endif - if (h->mask & IOC_IRQ_CLEARABLE_MASK) - ioc_irq_clear(h->mask); -#if NIOEB > 0 - else if ((h->mask & IOEB_IRQ_CLEARABLE_MASK) && - the_ioeb != NULL) - ioeb_irq_clear(h->mask); -#endif - if (h->arg == NULL) - result = (h->func)(irqf); - else - result = (h->func)(h->arg); - if (result == IRQ_HANDLED) { - stray = 0; - h->ev->ev_count++; - break; /* XXX handle others? */ - } - if (result == IRQ_MAYBE_HANDLED) - stray = 0; - } - - if (__predict_false(stray)) { - log(LOG_WARNING, "Stray IRQ, status = 0x%x, spl = %d, " - "mask = 0x%x\n", status, s, irqmask[s]); -#ifdef DDB - Debugger(); -#endif - } -#if NFIQ > 0 -handled: -#endif /* NFIQ > 0 */ - -#if 0 - printf(" handled\n"); - dosoftints(s); /* May lower spl to s + 1, but no lower. */ -#endif - - hardsplx(s); - curcpu()->ci_intr_depth--; - - /* Check if we're in the kernel restartable atomic sequence. */ - if ((irqf->if_r15 & R15_MODE) != R15_MODE_USR) { - char *pc = (char *)(irqf->if_r15 & R15_PC); - extern char _lock_cas[], _lock_cas_end[]; -#ifdef ARM_LOCK_CAS_DEBUG - extern struct evcnt _lock_cas_restart; -#endif - - if (pc > _lock_cas && pc < _lock_cas_end) { - irqf->if_r15 = (irqf->if_r15 & ~R15_PC) | - (register_t)_lock_cas; -#ifdef ARM_LOCK_CAS_DEBUG - _lock_cas_restart.ev_count++; -#endif - } - } - -} - -struct irq_handler * -irq_establish(int irqnum, int ipl, int (*func)(void *), void *arg, - struct evcnt *ev) -{ - struct irq_handler *h, *new; - -#ifdef DIAGNOSTIC - if (irqnum >= NIRQ) - panic("irq_register: bad irq: %d", irqnum); -#endif - new = (struct irq_handler *)malloc(sizeof(struct irq_handler), - M_DEVBUF, M_WAITOK | M_ZERO); - new->irqnum = irqnum; - new->mask = 1 << irqnum; -#if NUNIXBP > 0 - if (irqnum >= IRQ_UNIXBP_BASE) - new->mask |= 1 << IRQ_PIRQ; -#endif - new->ipl = ipl; - new->func = func; - new->arg = arg; - new->enabled = 1; - new->ev = ev; - if (irq_list_head.lh_first == NULL || - irq_list_head.lh_first->ipl <= ipl) { - /* XXX This shouldn't need to be a special case */ - LIST_INSERT_HEAD(&irq_list_head, new, link); - h = NULL; - } else { - for (h = irq_list_head.lh_first; - h->link.le_next != NULL && h->link.le_next->ipl > ipl; - h = h->link.le_next); - LIST_INSERT_AFTER(h, new, link); - } - if (new->mask & IOC_IRQ_CLEARABLE_MASK) - ioc_irq_clear(new->mask); -#if NIOEB > 0 - else if ((h && h->mask & IOEB_IRQ_CLEARABLE_MASK) && the_ioeb != NULL) - ioeb_irq_clear(h->mask); -#endif - irq_genmasks(); - return new; -} - -char const * -irq_string(struct irq_handler *h) -{ - static char irq_string_store[10]; - -#if NUNIXBP > 0 - if (h->irqnum >= IRQ_UNIXBP_BASE) - snprintf(irq_string_store, 9, "IRQ 13.%d", - h->irqnum - IRQ_UNIXBP_BASE); - else -#endif - snprintf(irq_string_store, 9, "IRQ %d", h->irqnum); - irq_string_store[9] = '\0'; - return irq_string_store; -} - -void -irq_disable(struct irq_handler *h) -{ - int s; - - s = splhigh(); - h->enabled = 0; - irq_genmasks(); - splx(s); -} - -void -irq_enable(struct irq_handler *h) -{ - int s; - - s = splhigh(); - h->enabled = 1; - irq_genmasks(); - splx(s); -} - - -void irq_genmasks(void) -{ - struct irq_handler *h; - int s, i; - - /* Paranoia? */ - s = splhigh(); - /* Disable anything we don't understand */ - for (i = 0; i < NIPL; i++) - irqmask[i] = 0; - /* Enable interrupts in levels lower than their own */ - for (h = irq_list_head.lh_first; h != NULL; h = h->link.le_next) - if (h->enabled) { - if ((h->mask & irqmask[IPL_NONE]) == h->mask) - /* Shared interrupt -- use lowest priority. */ - for (i = h->ipl; i < NIPL; i++) - irqmask[i] &= ~h->mask; - else - for (i = 0; i < h->ipl; i++) - irqmask[i] |= h->mask; - } - splx(s); -} - -#ifdef FLASHYTHING -#include -#include - -static const int iplcolours[] = { - VIDC_PALETTE_ENTRY( 0, 0, 0, 0), /* Black: IPL_NONE */ - VIDC_PALETTE_ENTRY( 0, 0, 15, 0), /* Blue: IPL_SOFTCLOCK */ - VIDC_PALETTE_ENTRY( 6, 4, 2, 0), /* Brown: IPL_SOFTNET */ - VIDC_PALETTE_ENTRY(15, 0, 0, 0), /* Red: IPL_BIO */ - VIDC_PALETTE_ENTRY(15, 9, 1, 0), /* Orange: IPL_NET */ - VIDC_PALETTE_ENTRY(15, 15, 0, 0), /* Yellow: IPL_TTY */ - VIDC_PALETTE_ENTRY( 0, 15, 0, 0), /* Green: IPL_IMP */ - VIDC_PALETTE_ENTRY( 5, 8, 14, 0), /* Light Blue: IPL_AUDIO */ - VIDC_PALETTE_ENTRY( 15, 0, 15, 0), /* Magenta: IPL_SERIAL */ - VIDC_PALETTE_ENTRY( 0, 15, 15, 0), /* Cyan: IPL_CLOCK */ - VIDC_PALETTE_ENTRY( 8, 8, 8, 0), /* Grey: IPL_STATCLOCK */ - VIDC_PALETTE_ENTRY( 8, 8, 8, 0), /* Grey: IPL_SCHED */ - VIDC_PALETTE_ENTRY(15, 15, 15, 0), /* White: IPL_HIGH */ -}; -#endif - -int schedbreak = 0; - -#include -#include - -inline int -hardsplx(int s) -{ - int was; - uint32_t mask; - - KASSERT(s < IPL_HIGH); - int_off(); -#ifdef FLASHYTHING - VIDC_WRITE(VIDC_PALETTE_BCOL | iplcolours[s]); -#endif - was = curcpu()->ci_cpl; - mask = irqmask[s]; -#if NFIQ > 0 - if (fiq_want_downgrade) - mask |= IOC_IRQ_1; -#endif - /* Don't try this till we've found the IOC */ - if (the_ioc != NULL) - ioc_irq_setmask(mask); -#if NUNIXBP > 0 - unixbp_irq_setmask(mask >> IRQ_UNIXBP_BASE); -#endif - curcpu()->ci_cpl = s; - int_on(); - return was; -} - -int -splhigh(void) -{ - int was; - - int_off(); -#ifdef FLASHYTHING - VIDC_WRITE(VIDC_PALETTE_BCOL | iplcolours[IPL_HIGH]); -#endif - was = curcpu()->ci_cpl; - curcpu()->ci_cpl = IPL_HIGH; -#ifdef DEBUG - /* Make sure that anything that turns off the I flag gets spotted. */ - if (the_ioc != NULL) - ioc_irq_setmask(0xffff); -#endif - return was; -} - -int -raisespl(int s) -{ - - if (s > curcpu()->ci_cpl) - return hardsplx(s); - else - return curcpu()->ci_cpl; -} - -void -lowerspl(int s) -{ - - if (s < curcpu()->ci_cpl) { -#if 0 - dosoftints(s); -#endif - hardsplx(s); - } -} - -#ifdef DDB -void -irq_stat(void (*pr)(const char *, ...)) -{ - struct irq_handler *h; - int i; - uint32_t last; - - for (h = irq_list_head.lh_first; h != NULL; h = h->link.le_next) - (*pr)("%12s: ipl %2d, IRQ %2d, mask 0x%05x, count %llu\n", - h->ev->ev_group, h->ipl, h->irqnum, - h->mask, h->ev->ev_count); - (*pr)("\n"); - last = -1; - for (i = 0; i < NIPL; i++) - if (irqmask[i] != last) { - (*pr)("ipl %2d: mask 0x%05x\n", i, irqmask[i]); - last = irqmask[i]; - } -} -#endif Index: sys/arch/acorn26/acorn26/locore.S =================================================================== RCS file: sys/arch/acorn26/acorn26/locore.S diff -N sys/arch/acorn26/acorn26/locore.S --- sys/arch/acorn26/acorn26/locore.S 12 Aug 2013 16:02:50 -0000 1.23 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,455 +0,0 @@ -/* $NetBSD: locore.S,v 1.23 2013/08/12 16:02:50 matt Exp $ */ -/* - * Copyright (c) 1998, 1999, 2000 Ben Harris - * Copyright (C) 1994-1997 Mark Brinicombe - * Copyright (C) 1994 Brini - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * 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 Brini. - * 4. The name of Brini may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY BRINI ``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 BRINI 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. - */ -/* - * locore.S - the (physical) start of the kernel and low-level handlers - */ -/* Note that the actual kernel startup is in start.c */ - -#include - -/* RCSID is at the end of the file in case it gets put in the text segment. */ - -#include -#include -#include -#include "assym.h" - -#include -#include - -#include "opt_ddb.h" - -#include "fiq.h" - -/* LINTSTUB: include */ -/* LINTSTUB: include */ - -/* - * MODE_CHANGE_NOP should be inserted between a mode change and a - * banked register (R8--R15) access. - */ -#if defined(CPU_ARM2) || defined(CPU_ARM250) -#define MODE_CHANGE_NOP mov r0, r0 -#else -#define MODE_CHANGE_NOP /* Data sheet says ARM3 doesn't need it */ -#endif - -/* - * USR_LDM_NOP should be inserted between an LDM to the user bank - * and a read from a banked register. (ARM DS sec 6.6.4) - */ -#define USR_LDM_NOP mov r0, r0 - - .text - .balign 4 - -/* - * This is for kvm_mkdb, and should be the address of the beginning - * of the kernel text segment (not necessarily the same as kernbase). - */ - - .global _C_LABEL(kernel_text) -_C_LABEL(kernel_text): - -/* - * Data to be mapped into zero page. - * - * Now, here we could do with the ability to change the assembler's - * idea of where we're assembling to without changing where it puts - * the output. Unfortunately, this kind of thing needs the connivance - * of the linker, which is asking a bit much. Thus... - * - * B and BL can be used normally within zero-page, but not between - * zero-page and the outside world. - * - * LDR can safely be used with a label within zero-page, but not to - * outside. - * - * Absolute references only work to outside. Relative references only - * work to inside. - * - * - * Instructions to copy to the bottom of zero page - * These are the entry point to the system exception routines - * - * They go: - * Reset - * Undefined instruction - * SWI - * Prefetch abort - * Data abort - * Address exception - * IRQ - * FIQ - */ - -/* - * Trap handlers - * - * These take an exception and get up into a state to enter the kernel - * proper. This currently involves fixing up the return address (to - * point to the faulting instruction in all cases), pushing a - * trapframe onto the stack, calling the C handler, restoring the - * (possibly modified) trapframe, and returning to userland. - */ -#define TRAP_REGS r0-r14 - .macro HANDLER handler, lr_fixup - sub lr, lr, #\lr_fixup /* Compensate for prefetch */ - sub sp, sp, #(TF_SIZE-TF_R0) /* Adjust SP */ - str lr, [sp, #(TF_R15-TF_R0)] /* Push return address */ - stmia sp, {TRAP_REGS}^ /* Push user mode registers */ - mov r0, #0 - str r0, [sp, #(TF_SPSR-TF_R0)]! /* Push fake SPSR and adjust SP */ -#if TF_SPSR != 0 /* Shouldn't happen */ - sub sp, sp, #TF_SPSR -#endif - - mov r0, sp /* Supply handler with argument */ - tst lr, #R15_MODE /* If the trap was from USR mode... */ - moveq fp, #0 /* ... this is the end of the stack */ - bl \handler - b pull_trapframe - .endm - -/* - * Generic routine to take a trapframe and return to the context it - * represents. This should probably include AST processing. - * On entry: - * SVC mode. - * IRQs disabled. - * r13_svc points to the trapframe to restore. - * On exit: - * r0-r12, r13_usr, r14_usr and r15 have been restored. - * r13_svc points above the trapframe. - * r14_svc is corrupted. - */ -pull_trapframe: -/* - * AST handling stuff. We have to disable IRQs between loading the - * flag and returning to user mode, since otherwise an IRQ might - * happen in the interim and set the flag again. For simplicity, we - * just leave IRQs off throughout (ast will re-enable them). - */ - ldr lr, [sp, #TF_R15] /* Pull return address and PSR */ - tst lr, #R15_MODE /* Was trap in USR mode? */ - bne 3f /* If not, return */ - ldr r4, =_C_LABEL(cpu_info_store) + CI_ASTPENDING -1: - teqp r15, #(R15_IRQ_DISABLE | R15_MODE_SVC) - ldr r1, [r4] - cmp r1, #0 /* AST pending? */ - beq 2f /* If not, return */ - mov r1, #0 /* Clear astpending */ - str r1, [r4] - mov r0, sp /* Reuse old trapframe */ - bl _C_LABEL(ast) /* Handle AST */ - b 1b /* Try again */ - -#ifndef DIAGNOSTIC -2: - ldr lr, [sp, #TF_R15] /* Pull return address */ -3: /* ... which we may have done above */ - add sp, sp, #TF_R0 /* Skip fake SPSR */ - ldmia sp, {TRAP_REGS}^ /* Restore USR mode registers */ - USR_LDM_NOP - add sp, sp, #(TF_SIZE-TF_R0) /* Adjust SP */ - movs pc, lr -#else /* DIAGNOSTIC */ - /* - * Taking a trap inherently corrupts R14_svc. Rather than leaving - * it with the return address in, we put in a sentinel value that'll - * panic if it's treated as a return address. To do this, we have - * to return via IRQ mode. - */ -2: -3: - adr lr, r14_svc_corrupted /* Sentinel in R14_svc */ - mov r0, sp /* Save for mode switch */ - add sp, sp, #TF_SIZE /* Restore stack pointer */ - teqp r15, #(R15_IRQ_DISABLE | R15_MODE_IRQ) - add r0, r0, #TF_R0 - ldr lr, [r0, #(TF_R15-TF_R0)] /* Fetch return address (R14_irq) */ - ldmia r0, {TRAP_REGS}^ /* Restore USR mode registers */ - USR_LDM_NOP - movs pc, lr /* And return */ - -r14_svc_corrupted: - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - adr r0, .Lr14_panicmsg - bl _C_LABEL(panic) - /* NOTREACHED */ -.Lr14_panicmsg: - .asciz "R14_svc corrupted by trap handler" - .balign 4 -#endif - - .global reset_entry -reset_entry: - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - adr r0, Lreset_panicmsg - bl _C_LABEL(panic) - /* NOTREACHED */ -Lreset_panicmsg: - .asciz "Reset handler called. Branch through zero?" - .balign 4 - - .global undefined_entry -undefined_entry: - HANDLER _C_LABEL(undefinedinstruction), 4 - - .global swi_entry -swi_entry: - HANDLER _C_LABEL(swi_handler), 4 - - .global prefetch_abort_entry -prefetch_abort_entry: - HANDLER _C_LABEL(prefetch_abort_handler), 4 - - .global data_abort_entry -data_abort_entry: - HANDLER _C_LABEL(data_abort_handler), 8 - - .global address_exception_entry -address_exception_entry: - HANDLER _C_LABEL(address_exception_handler), 8 - -/* - * The stack frame messing is different here since we're handling an - * irqframe, not a trapframe. IRQ handlers generally don't need to - * get at the contents of user registers (except R15), so we leave - * them to be saved by irq_handler's prologue. On the other hand, - * IRQs can happen in SVC mode, and we need to do a bit of juggling to - * save R14_svc before we enter the IRQ handler. - * - * The "R15" slot in the irqframe holds the value of R15 to return to. - * Conceptually, IRQs happen at the start of an instruction. - */ - -#define IRQ_REGS_SVC r0-r3, r12, r14 -#define IRQ_REGS_USR r0-r3, r11-r12 - .global irq_entry -irq_entry: - sub r14, r14, #4 /* Fix up return address */ - tst r14, #(R15_MODE) - beq Lirq_from_usr - teqp r15, #(R15_IRQ_DISABLE | R15_MODE_SVC) - MODE_CHANGE_NOP - sub sp, sp, #IF_SIZE /* mark space for irqframe */ - stmia sp, {IRQ_REGS_SVC} /* save SVC mode regs */ - mov r0, sp /* copy frame pointer */ - teqp r15, #(R15_IRQ_DISABLE | R15_MODE_IRQ) - MODE_CHANGE_NOP - str lr, [r0, #IF_R15] /* Finally, save return addr */ - teqp r15, #(R15_IRQ_DISABLE | R15_MODE_SVC) - MODE_CHANGE_NOP - - bl _C_LABEL(irq_handler) - - mov r0, sp - teqp r15, #(R15_IRQ_DISABLE | R15_MODE_IRQ) - MODE_CHANGE_NOP - ldr lr, [r0, #IF_R15] /* Retrieve return address */ - teqp r15, #(R15_IRQ_DISABLE | R15_MODE_SVC) - MODE_CHANGE_NOP - ldmia sp, {IRQ_REGS_SVC} /* Restore SVC registers */ - add sp, sp, #IF_SIZE /* Free irqframe */ - teqp r15, #(R15_IRQ_DISABLE | R15_MODE_IRQ) - MODE_CHANGE_NOP - movs r15, lr /* and return. */ - -Lirq_from_usr: - teqp r15, #(R15_IRQ_DISABLE | R15_MODE_SVC) - MODE_CHANGE_NOP - sub sp, sp, #IF_SIZE /* mark space for irqframe */ - stmia sp, {IRQ_REGS_USR} /* save SVC/USR mode regs */ - mov r0, sp /* copy frame pointer */ - teqp r15, #(R15_IRQ_DISABLE | R15_MODE_IRQ) - MODE_CHANGE_NOP - str lr, [r0, #IF_R15] /* Finally, save return addr */ - teqp r15, #(R15_IRQ_DISABLE | R15_MODE_SVC) - MODE_CHANGE_NOP - - mov fp, #0 /* This is the top of the stack */ - bl _C_LABEL(irq_handler) - - ldr r1, =_C_LABEL(cpu_info_store) + CI_ASTPENDING - ldr r0, [r1] - cmp r0, #0 - bne Lirq_to_ast - mov r0, sp - teqp r15, #(R15_IRQ_DISABLE | R15_MODE_IRQ) - MODE_CHANGE_NOP - ldr lr, [r0, #IF_R15] /* Retrieve return address */ - teqp r15, #(R15_IRQ_DISABLE | R15_MODE_SVC) - MODE_CHANGE_NOP - ldmia sp, {IRQ_REGS_USR} /* Restore SVC/USR registers */ - add sp, sp, #IF_SIZE /* Free irqframe */ - teqp r15, #(R15_IRQ_DISABLE | R15_MODE_IRQ) - MODE_CHANGE_NOP - movs r15, lr /* and return. */ - -Lirq_to_ast: - mov r0, #0 /* Clear astpending */ - str r0, [r1] - ldmia sp, {IRQ_REGS_USR} /* Slurp up irqframe */ - sub sp, sp, #(TF_SIZE - IF_SIZE - TF_R0) - stmia sp, {TRAP_REGS}^ /* Spit out trapframe */ - mov r0, #0 - str r0, [sp, #(TF_SPSR-TF_R0)]! /* Push fake SPSR and adjust SP */ -#if TF_SPSR != 0 /* Shouldn't happen */ - sub sp, sp, #TF_SPSR -#endif - - mov fp, #0 - mov r0, sp - bl _C_LABEL(ast) - b pull_trapframe - -/* LINTSTUB: Func: void int_on(void) */ -ENTRY(int_on) - bics r15, r14, #(R15_IRQ_DISABLE) -/* LINTSTUB: Func: void int_off(void) */ -ENTRY(int_off) - orrs r15, r14, #(R15_IRQ_DISABLE) - /* These are used by mcount */ -/* LINTSTUB: Func: int int_off_save(void) */ -ENTRY_NP(int_off_save) - mov r0, r15 - orrs r15, r14, #(R15_IRQ_DISABLE) -/* LINTSTUB: Func: void int_restore(int i) */ -ENTRY_NP(int_restore) - tst r0, #(R15_IRQ_DISABLE) /* Were IRQs already disabled? */ - bicseq r15, r14, #(R15_IRQ_DISABLE) /* No, enable again */ - movs r15, r14 /* Yes, just return */ -/* LINTSTUB: Func: void fiq_off(void) */ -ENTRY(fiq_off) - orrs r15, r14, #(R15_FIQ_DISABLE) -/* LINTSTUB: Func: void fiq_on(void) */ -ENTRY(fiq_on) - bics r15, r14, #(R15_FIQ_DISABLE) - -ENTRY_NP(set_r15) - mov r3, r14 /* get caller's IRQ state */ - bic r2, r3, r0 - eor r2, r2, r1 - mov r0, r3 /* return old IRQ state */ - movs r15, r2 /* set new state and return */ - -ENTRY_NP(get_r15) - mov r0, r14 - mov r15, lr - -/* - * Low-level context-switch operation. cpu_switchto() is in C -- this - * just handles the bits that can't be done in C. - * - * struct lwp *cpu_loswitch(struct lwp *oldl, struct lwp *newl) - * - * We leave a switchframe on the stack pointed to by and save this in - * oldl's PCB, and return to the context in newl. This should be called at - * splhigh(); - * - * r0 and r1 must be left intact as they're needed by lwp_startup in - * lwp_trampoline - */ -/* LINTSTUB: Func: struct lwp *cpu_loswitch(struct lwp *oldl, struct lwp *newl) */ -ENTRY(cpu_loswitch) - teq r0, #0x00000000 - beq Lswitch_exited - - ldr r3, [r0, #(L_PCB)] - add r3, r3, #PCB_SF /* r3 = oldpcb->pcb_sf */ - - mov r2, sp /* Temporary stack pointer */ - stmfd r2!, {r4-r11, r13-r14} /* Save all relevant registers */ - str r2, [r3] /* Save switchframe pointer */ - -Lswitch_exited: - - ldr r2, [r1, #(L_PCB)] - ldr r3, [r2, #(PCB_SF)] /* r3 = newpcb->pcb_sf */ - - ldmfd r3, {r4-r11, r13-r14} /* Restore from old switchframe */ - mov pc, r14 /* and return */ - -/* - * This funny little routine implements starting a process. - * It's called by cpu_loswitch returning from a faked - * switchframe set up by cpu_lwp_fork(), and gets - * the function it's meant to enter passed in R4 with its - * argument in R5. If that function's NULL, or if it returns, - * we hope there's a trapframe on the stack that'll take us - * back to userland. - * - * cpu_loswitch also ensures that r0 is oldl and r1 is newl - * for our call to lwp_startup. - */ -ENTRY(lwp_trampoline) - mov fp, #0 /* Tie knot in top of stack */ - bl _C_LABEL(lwp_startup) - mov r0, #0 - bl _C_LABEL(lowerspl) /* spl0() */ - cmp r4, #0 /* Function to call? */ - beq Llwp_trampoline_nofunc - mov r0, r5 - mov r14, pc /* Save return address */ - mov pc, r4 /* Call function */ -Llwp_trampoline_nofunc: - b pull_trapframe - -/* LINTSTUB: Func: int setjmp(label_t *l) */ -ENTRY(setjmp) - stmia r0, {r4-r11, r13-r14} /* Save relevant registers */ - mov r0, #0 /* Return 0 */ - mov pc, lr - -/* LINTSTUB: Func: void longjmp(label_t *l) */ -ENTRY(longjmp) - ldmia r0, {r4-r11, r13-r14} /* Restore registers */ - mov r0, #1 /* Return 1 through longjmp */ - mov pc, lr - -#ifdef DDB -/* Enter DDB -- shove registers in a trapframe first */ -/* LINTSTUB: Func: void cpu_Debugger(void) */ -ENTRY(cpu_Debugger) - stmfd r13!, {r14} - .word KERNEL_BREAKPOINT - ldmfd r13!, {pc} -#endif - -RCSID("$NetBSD: locore.S,v 1.23 2013/08/12 16:02:50 matt Exp $") Index: sys/arch/acorn26/acorn26/machdep.c =================================================================== RCS file: sys/arch/acorn26/acorn26/machdep.c diff -N sys/arch/acorn26/acorn26/machdep.c --- sys/arch/acorn26/acorn26/machdep.c 24 Mar 2014 20:06:31 -0000 1.38 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,229 +0,0 @@ -/* $NetBSD: machdep.c,v 1.38 2014/03/24 20:06:31 christos Exp $ */ - -/*- - * Copyright (c) 1998 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * machdep.c -- standard machine-dependent functions - */ - -#include - -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.38 2014/03/24 20:06:31 christos Exp $"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include - -#include - -#include -#include - - -struct vm_map *phys_map = NULL; - -int waittime = -1; - -void -cpu_reboot(int howto, char *b) -{ - - /* If "always halt" was specified as a boot flag, obey. */ - if ((boothowto & RB_HALT) != 0) - howto |= RB_HALT; - - boothowto = howto; - - /* If system is cold, just halt. */ - if (cold) { - boothowto |= RB_HALT; - goto haltsys; - } - - if ((boothowto & RB_NOSYNC) == 0 && waittime < 0) { - waittime = 0; - vfs_shutdown(); - /* - * If we've been adjusting the clock, the todr - * will be out of synch; adjust it now. - */ - resettodr(); - } - - /* Disable interrupts. */ - splhigh(); - -#if 0 - /* XXX Need to implement this */ - if (boothowto & RB_DUMP) - dumpsys(); -#endif - - /* run any shutdown hooks */ - doshutdownhooks(); - - pmf_system_shutdown(boothowto); - -haltsys: - if (howto & RB_HALT) { - printf("system halted\n"); - for (;;); - } else { - printf("rebooting..."); - /* - * On a real reset, the ROM is mapped into address - * zero. On RISC OS 3.11 at least, this can be faked - * by copying the first instruction in the ROM to - * address zero -- it immediately branches into the - * ROM at its usual address, and hence would remove - * the ROM mapped at zero anyway. - * - * In order to convince RISC OS to do a hard reset, we - * fake a *FX 200,2. Note that I don't know if this - * will work on RISC OS <3.10. This is slightly - * suboptimal as it causes RISC OS to zero the whole - * of RAM on startup (farewell, message buffer). If - * anyone can tell me how to fake a control-reset in - * software, I'd be most grateful. - */ - *(volatile uint8_t *)0x9c2 = 2; /* Zero page magic */ - *(volatile uint32_t *)0 - = *(volatile uint32_t *)MEMC_ROM_LOW_BASE; - /* reboot in SVC mode, IRQs and FIQs disabled */ - __asm volatile("movs pc, %0" : : - "r" (R15_MODE_SVC | R15_FIQ_DISABLE | R15_IRQ_DISABLE)); - } - panic("cpu_reboot failed"); -} - -/* - * cpu_startup: allocate memory for variable-sized tables, - * initialize CPU, and do autoconfiguration. - */ -void -cpu_startup(void) -{ - vaddr_t minaddr, maxaddr; - char pbuf[9]; - - /* Stuff to do here: */ - /* initmsgbuf() is called from start() */ - - cpu_setmodel("Archimedes"); - printf("%s%s", copyright, version); - format_bytes(pbuf, sizeof(pbuf), ctob(physmem)); - printf("total memory = %s\n", pbuf); - - /* Various boilerplate memory allocations. */ - minaddr = 0; - - /* - * Allocate a submap for physio - */ - phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr, - 512 * 1024, 0, false, NULL); - - /* - * No need to allocate an mbuf cluster submap. Mbuf clusters - * are allocated via the pool allocator, and we use direct-mapped - * pool pages. - */ - - format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free)); - printf("avail memory = %s\n", pbuf); - -#if 0 - /* Test exception handlers */ - __asm(".word 0x06000010"); /* undefined instruction */ - __asm("swi 0"); /* SWI */ - (*(void (*)(void))(0x00008000))(); /* prefetch abort */ - *(volatile int *)(0x00008000) = 0; /* data abort */ - *(volatile int *)(0x10000000) = 0; /* address exception */ -#endif -} - -/* Read a byte from CMOS RAM. */ -int -cmos_read(int location) -{ - uint8_t val; - - KASSERT(iociic_bootstrap_cookie() != NULL); - if (pcfrtc_bootstrap_read(iociic_bootstrap_cookie(), 0x50, - location, &val, 1) != 0) - return (-1); - return (val); -} - -/* Write a byte to CMOS RAM. */ -int -cmos_write(int location, int value) -{ - uint8_t val = value; - - KASSERT(iociic_bootstrap_cookie() != NULL); - return (pcfrtc_bootstrap_write(iociic_bootstrap_cookie(), 0x50, - location, &val, 1)); -} - -bool -mm_md_direct_mapped_phys(paddr_t paddr, vaddr_t *vaddr) -{ - - *vaddr = (vaddr_t)MEMC_PHYS_BASE + paddr; - return true; -} - -int -mm_md_physacc(paddr_t pa, vm_prot_t prot) -{ - - return (pa > (paddr_t)MEMC_PHYS_BASE + ptoa(physmem)) ? EFAULT : 0; -} - -int -mm_md_kernacc(void *ptr, vm_prot_t prot, bool *handled) -{ - const vaddr_t v = (vaddr_t)ptr; - - *handled = (v >= (vaddr_t)MEMC_PHYS_BASE && - v < (vaddr_t)MEMC_PHYS_BASE + ptoa(physmem)); - return 0; -} Index: sys/arch/acorn26/acorn26/pmap.c =================================================================== RCS file: sys/arch/acorn26/acorn26/pmap.c diff -N sys/arch/acorn26/acorn26/pmap.c --- sys/arch/acorn26/acorn26/pmap.c 28 Oct 2017 00:37:12 -0000 1.39 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,1168 +0,0 @@ -/* $NetBSD: pmap.c,v 1.39 2017/10/28 00:37:12 pgoyette Exp $ */ -/*- - * Copyright (c) 1997, 1998, 2000 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * pmap.c - Interfacing the MEMC to the BSD VM system. - */ - -/* - * The MMU on ARM2 and ARM3 systems is an Acorn custom chip called MEMC - * (Anna to her friends). Each MEMC can handle up to 4MB of local DRAM, - * split into 128 pages. Thus, a system with 16MB of RAM will have four - * MEMCs co-operating to run it. In addition the MMU, the master MEMC - * in a system handles video and sound DMA, the system clocks and the - * address decoding necessary to control accesses to the I/O system, ROMs - * and VIDC. - * - * The memory layout provided by the MEMC is mostly fixed, with the bottom - * 32 MB being logically-mapped RAM and the next 16 MB being physically- - * mapped RAM. - * - * The MEMC provides some rudimentary access control over memory and I/O - * devices. Code running in USR mode is allowed access to ROM and to those - * parts of logical RAM to which it's been granted access. Code running in - * SVC mode can access everything. The fact that SVC-mode code can't be - * prevented from writing to RAM makes it very difficult to emulate modified - * bits for pages that might be accessed from SVC mode. - * - * The page tables in the MEMC are implemented using content-addressable - * memory, with one cell for each physical page. This means that it's - * impossible to have one physical page mapped in two locations. For this - * reason, we try to treat the MEMC as a TLB, and to keep enough information - * around to quickly re-load mappings without troubling uvm_fault(). - * Having multiple physical pages mapped to the same logical page is possible, - * and we arrange to map all unused physical pages in the same place. - * Accessing the logical page in question has undefined results, though, as - * it may end up with multiple DRAMs trying to drive the data bus at once. - * - * The MEMC has variable page sizes, and moreover it's necessary to - * change the page size depending on the amount of DRAM under the - * MEMC's control. This code currently only handles 32k pages. - * - * The bottom 32k of logically-mapped RAM is zero page, and is mapped - * in all address spaces (though it's not accessible in user mode). - * This contains exception vectors. It doesn't appear in any pmap as - * it's never unmapped. - * - * On an ARM3, the cache must be flushed whenever: - * - * 1 - We remove read access to a page, since we need to ensure reads - * will abort. Write access doesn't matter since the cache is - * write-through. - * - * 2 - We write to a page and need to be able to read it elsewhere. - * Since the MEMC can only map each page once, this only occurs - * without case one when one of the accesses is physical and the other - * logical, which I think only happens when doing odd things with - * /dev/mem. In all other cases, a physical page should only be - * accessed through one of its mappings (virtual if it has one, - * physical if it doesn't). pmap_find is useful for this. - * - * We assume the following rules apply: - * - * Accesses to memory managed by user pmaps will always be from USR - * mode, or from LDR/STR with the T bit set (which looks the same to - * the MEMC). - * - * Accesses to memory managed by the kernel pmap will always be from - * SVC mode, and pmap_enter() will be explicitly told what to do to - * the referenced/modified bits. - * - * Breaking these rules (especially the first) is likely to upset - * referenced/modified emulation. - */ - -#include "opt_ddb.h" -#include "opt_uvmhist.h" -#include "arcvideo.h" - -#include - -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.39 2017/10/28 00:37:12 pgoyette Exp $"); - -#include /* for cold */ -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include -#include -#include - -#include - -#ifdef PMAP_DEBUG_MODIFIED -#include -#endif - -/* - * We store all the mapping information in the pv_table, and the pmaps - * just contain references to it. This is suggested in the Daemon - * Book as a sensible thing to do on systems without real page tables. - */ -struct pv_entry { - struct pv_entry *pv_next; - pmap_t pv_pmap; - int pv_ppn; - int pv_lpn; - uint32_t pv_activate; /* MEMC command to activate mapping */ - uint32_t pv_deactivate;/* MEMC command to deactivate mapping */ - vm_prot_t pv_prot; /* requested protection */ - uint8_t pv_ppl; /* Actual PPL */ - uint8_t pv_vflags; /* Per-mapping flags */ -#define PV_WIRED 0x01 /* This is a wired mapping */ -#define PV_UNMANAGED 0x02 /* Mapping was entered by pmap_kenter_*() */ - /* From pv_pflags onwards is per-physical-page state. */ - uint8_t pv_pflags; /* Per-physical-page flags */ -#define PV_REFERENCED 0x01 -#define PV_MODIFIED 0x02 -#ifdef PMAP_DEBUG_MODIFIED - unsigned char pv_md4sum[16]; -#endif -}; - -#define PM_NENTRIES 1024 - -struct pmap { - int pm_count; /* Reference count */ - int pm_flags; -#define PM_ACTIVE 0x00000001 - struct pmap_statistics pm_stats; - struct pv_entry **pm_entries; -}; - -/* - * All physical pages must map to _some_ logical page, even though - * they can have all access disabled. This means we need a logical - * page reseved for this purpose. We use the last page of kernel VM. - */ -#define PMAP_DEAD_PAGE (atop(VM_MAX_KERNEL_ADDRESS) - 1) -#define PMAP_UNMAP_ENTRY_32K(ppn) \ - MEMC_TRANS_ENTRY_32K(ppn, PMAP_DEAD_PAGE, MEMC_PPL_NOACCESS) -#if 0 -{} /* shut up emacs */ -#endif - -/* - * Global array of pv_entries. Dynamically allocated at startup. - */ -struct pv_entry *pv_table; - -/* Kernel pmap -- statically allocated to make life slightly less odd. */ - -static struct pmap kernel_pmap_store; -struct pmap *const kernel_pmap_ptr = &kernel_pmap_store; -struct pv_entry *kernel_pmap_entries[PM_NENTRIES]; - -static bool pmap_initialised = false; - -static struct pool pmap_pool; - -static pmap_t active_pmap; - -UVMHIST_DECL(pmaphist); -#ifdef UVMHIST -static struct uvm_history_ent pmaphistbuf[100]; -#endif - - void pmap_init2(void); - -static void pv_update(struct pv_entry *); -static struct pv_entry *pv_alloc(void); -static void pv_free(struct pv_entry *pv); -static struct pv_entry *pv_get(pmap_t pmap, int ppn, int lpn); -static void pv_release(pmap_t pmap, int ppn, int lpn); - -static int pmap_enter1(pmap_t, vaddr_t, paddr_t, vm_prot_t, u_int, int); - -static void *pmap_find(paddr_t); - -static void pmap_update_page(int); - -#ifdef PMAP_DEBUG_MODIFIED -static void pmap_md4_page(unsigned char [16], paddr_t); -#endif - -/* - * No-one else wanted to take responsibility for the MEMC control register, - * so it's ended up here. - */ - -static register_t memc_control = 0; - -register_t -update_memc(register_t mask, register_t value) -{ - register_t old; - int s; - - s = splhigh(); - old = memc_control; - memc_control &= ~mask; - memc_control |= value & mask; - MEMC_WRITE(memc_control); - splx(s); - return old; -} - -/* - * pmap_bootstrap: first-stage pmap initialisation - * - * This is called very early, and has to get the pmap system into a - * state where pmap_virtual_space and pmap_kenter_pa at least will - * work. If we need memory here, we have to work out how to get it - * ourselves. - */ -void -pmap_bootstrap(int npages, paddr_t zp_physaddr) -{ - int i; - struct pmap *pmap; - size_t pv_table_size; - UVMHIST_FUNC("pmap_bootstrap"); - - UVMHIST_INIT_STATIC(pmaphist, pmaphistbuf); - UVMHIST_CALLED(pmaphist); - /* Set up the bootstrap pv_table */ - pv_table_size = round_page(physmem * sizeof(struct pv_entry)); - pv_table = - (struct pv_entry *)uvm_pageboot_alloc(pv_table_size); - memset(pv_table, 0, pv_table_size); -#ifdef PMAP_DEBUG_MODIFIED - for (i = 0; i < physmem; i++) - pv_table[i].pv_pflags |= PV_MODIFIED; -#endif - - /* Set up the kernel's pmap */ - pmap = pmap_kernel(); - memset(pmap, 0, sizeof(*pmap)); - pmap->pm_count = 1; - pmap->pm_flags = PM_ACTIVE; /* Kernel pmap always is */ - pmap->pm_entries = kernel_pmap_entries; - memset(pmap->pm_entries, 0, sizeof(struct pv_entry *) * PM_NENTRIES); - /* pmap_pinit(pmap); */ - /* Clear the MEMC's page table */ - /* XXX Maybe we should leave zero page alone? */ - for (i=0; i < npages; i++) - MEMC_WRITE(PMAP_UNMAP_ENTRY_32K(i)); - /* TODO: Set up control register? */ - update_memc(0xffffffff, MEMC_CONTROL | MEMC_CTL_PGSZ_32K | - MEMC_CTL_LROMSPD_4N | MEMC_CTL_HROMSPD_4N | -#if NARCVIDEO > 0 - MEMC_CTL_RFRSH_FLYBACK | MEMC_CTL_VIDEODMA -#else - MEMC_CTL_RFRSH_CONTIN -#endif - ); - /* Manually map zero page (it doesn't appear in pmaps) */ - MEMC_WRITE(MEMC_TRANS_ENTRY_32K(atop(zp_physaddr), 0, - MEMC_PPL_NOACCESS)); -} - -vaddr_t -pmap_steal_memory(vsize_t size, vaddr_t *vstartp, vaddr_t *vendp) -{ - vaddr_t addr; - uvm_physseg_t bank; - - UVMHIST_FUNC("pmap_steal_memory"); - - UVMHIST_CALLED(pmaphist); - addr = 0; - size = round_page(size); - for (bank = uvm_physseg_get_first(); - uvm_physseg_valid_p(bank); - bank = uvm_physseg_get_next(bank)) { - if (uvm_physseg_get_avail_start(bank) < uvm_physseg_get_avail_end(bank)) { - paddr_t avail_start = uvm_physseg_get_avail_start(bank); - - addr = (vaddr_t) - ((char*)MEMC_PHYS_BASE + - ptoa(avail_start)); - avail_start++; - uvm_physseg_set_avail_start(bank, avail_start); - - break; - } - } - - return addr; -} - -/* - * pmap_init: second stage pmap initialisation. - * - * Sets up everything that will be needed for normal running. We can - * allocate memory in page-rounded chunks with uvm_km_(z)alloc(), or - * use the pool allocator. malloc is still taboo. - */ -void -pmap_init(void) -{ - UVMHIST_FUNC("pmap_init"); - - UVMHIST_CALLED(pmaphist); - /* All deferred to pmap_create, because malloc() is nice. */ -} - -/* - * pmap_init2: third stage pmap initialisation. - * - * This is invoked the first time pmap_create is called. It sets up the pool - * for allocating user pmaps, and frees some unnecessary memory. - */ -void -pmap_init2(void) -{ - struct pmap *pmap; - struct pv_entry *new_pv_table, *old_pv_table; - size_t pv_table_size; - int lpn; - UVMHIST_FUNC("pmap_init2"); - - UVMHIST_CALLED(pmaphist); - /* We can now call malloc(). Rationalise our memory usage. */ - pv_table_size = physmem * sizeof(struct pv_entry); - new_pv_table = kmem_alloc(pv_table_size, KM_SLEEP); - memcpy(new_pv_table, pv_table, pv_table_size); - old_pv_table = pv_table; - pv_table = new_pv_table; - - /* Fix up the kernel pmap to point at new pv_entries. */ - pmap = pmap_kernel(); - for (lpn = 0; lpn < 1024; lpn++) - if (pmap->pm_entries[lpn] == - old_pv_table + pmap->pm_entries[lpn]->pv_ppn) - pmap->pm_entries[lpn] = - pv_table + pmap->pm_entries[lpn]->pv_ppn; - - uvm_pagefree(PHYS_TO_VM_PAGE( - PMAP_UNMAP_POOLPAGE((vaddr_t)old_pv_table))); - - /* Create pmap pool */ - pool_init(&pmap_pool, sizeof(struct pmap), 0, 0, 0, - "pmappool", NULL, IPL_NONE); - pmap_initialised = 1; -} - -struct pmap * -pmap_create(void) -{ - struct pmap *pmap; - UVMHIST_FUNC("pmap_create"); - - UVMHIST_CALLED(pmaphist); - if (!pmap_initialised) - pmap_init2(); - pmap = pool_get(&pmap_pool, PR_WAITOK); - memset(pmap, 0, sizeof(*pmap)); - pmap->pm_entries = (struct pv_entry **)kmem_zalloc( - sizeof(struct pv_entry *) * PM_NENTRIES, - KM_SLEEP); - pmap->pm_count = 1; - return pmap; -} - -void -pmap_destroy(pmap_t pmap) -{ -#ifdef DIAGNOSTIC - int i; -#endif - UVMHIST_FUNC("pmap_destroy"); - - UVMHIST_CALLED(pmaphist); - if (--pmap->pm_count > 0) - return; - KASSERT((pmap->pm_flags & PM_ACTIVE) == 0); - KASSERT(pmap->pm_stats.resident_count == 0); - KASSERT(pmap->pm_stats.wired_count == 0); -#ifdef DIAGNOSTIC - for (i = 0; i < 1024; i++) - if (pmap->pm_entries[i] != NULL) - panic("pmap_destroy: pmap isn't empty"); -#endif - kmem_free((void *)pmap->pm_entries, - sizeof(struct pv_entry *) * PM_NENTRIES); - pool_put(&pmap_pool, pmap); -} - -long -_pmap_resident_count(pmap_t pmap) -{ - - return pmap->pm_stats.resident_count; -} - -long -_pmap_wired_count(pmap_t pmap) -{ - - return pmap->pm_stats.wired_count; -} - -void -pmap_activate(struct lwp *l) -{ - struct proc *p = l->l_proc; - pmap_t pmap; - UVMHIST_FUNC("pmap_activate"); - - UVMHIST_CALLED(pmaphist); - pmap = p->p_vmspace->vm_map.pmap; - - if (pmap == pmap_kernel()) - return; /* kernel pmap is always active */ - - KASSERT(active_pmap == NULL); - KASSERT((pmap->pm_flags & PM_ACTIVE) == 0); - - active_pmap = pmap; - pmap->pm_flags |= PM_ACTIVE; -} - -void -pmap_deactivate(struct lwp *l) -{ - struct proc *p = l->l_proc; - pmap_t pmap; - int i; - UVMHIST_FUNC("pmap_deactivate"); - - UVMHIST_CALLED(pmaphist); - pmap = p->p_vmspace->vm_map.pmap; - - if (pmap == pmap_kernel()) - return; /* kernel pmap is always active */ - - KASSERT(pmap == active_pmap); - KASSERT(pmap->pm_flags & PM_ACTIVE); - - active_pmap = NULL; - pmap->pm_flags &=~ PM_ACTIVE; - for (i = 0; i < 1024; i++) - if (pmap->pm_entries[i] != NULL) - MEMC_WRITE(pmap->pm_entries[i]->pv_deactivate); - cpu_cache_flush(); -} - -void -pmap_unwire(pmap_t pmap, vaddr_t va) -{ - struct pv_entry *pv; - UVMHIST_FUNC("pmap_unwire"); - - UVMHIST_CALLED(pmaphist); - if (pmap == NULL) return; - pv = pmap->pm_entries[atop(va)]; - if (pv == NULL) return; - if ((pv->pv_vflags & PV_WIRED) == 0) return; - pmap->pm_stats.wired_count--; - pv->pv_vflags &= ~PV_WIRED; -} - -void -pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vaddr_t dst_addr, vsize_t len, vaddr_t src_addr) -{ - UVMHIST_FUNC("pmap_copy"); - - UVMHIST_CALLED(pmaphist); - /* This is allowed to be a no-op. */ -} - -/* - * Update the pv_activate and pv_deactivate fields in a pv_entry to - * match the rest. - */ -static void -pv_update(struct pv_entry *pv) -{ - int ppl; - int pflags; - UVMHIST_FUNC("pv_update"); - - UVMHIST_CALLED(pmaphist); - pflags = pv_table[pv->pv_ppn].pv_pflags; - if (pv->pv_pmap == pmap_kernel()) - /* - * Referenced/modified emulation is almost impossible in - * SVC mode. - */ - ppl = MEMC_PPL_NOACCESS; - else { - if ((pv->pv_prot & VM_PROT_WRITE) && - (pflags & PV_REFERENCED) && (pflags & PV_MODIFIED)) - ppl = MEMC_PPL_RDWR; - else if ((pv->pv_prot & (VM_PROT_READ | VM_PROT_EXECUTE)) && - (pflags & PV_REFERENCED)) - ppl = MEMC_PPL_RDONLY; - else - ppl = MEMC_PPL_NOACCESS; - } - pv->pv_ppl = ppl; - pv->pv_activate = MEMC_TRANS_ENTRY_32K(pv->pv_ppn, pv->pv_lpn, ppl); - pv->pv_deactivate = PMAP_UNMAP_ENTRY_32K(pv->pv_ppn); -} - - -static struct pv_entry * -pv_alloc(void) -{ - return kmem_intr_zalloc(sizeof(struct pv_entry), KM_NOSLEEP); -} - -static void -pv_free(struct pv_entry *pv) -{ - - kmem_intr_free(pv, sizeof(struct pv_entry)); -} - -static struct pv_entry * -pv_get(pmap_t pmap, int ppn, int lpn) -{ - struct pv_entry *pv; - UVMHIST_FUNC("pv_get"); - - UVMHIST_CALLED(pmaphist); - UVMHIST_LOG(pmaphist, "(pmap=%#jx, ppn=%jd, lpn=%jd)", - (uintptr_t)pmap, ppn, lpn, 0); - /* If the head entry's free use that. */ - pv = &pv_table[ppn]; - if (pv->pv_pmap == NULL) { - UVMHIST_LOG(pmaphist, "<-- head (pv=%p)", pv, 0, 0, 0); - pmap->pm_stats.resident_count++; - return pv; - } - /* If this mapping exists already, use that. */ - for (pv = pv; pv != NULL; pv = pv->pv_next) - if (pv->pv_pmap == pmap && pv->pv_lpn == lpn) { - UVMHIST_LOG(pmaphist, "<-- existing (pv=%#jx)", - (uintptr_t)pv, 0, 0, 0); - return pv; - } - /* Otherwise, allocate a new entry and link it in after the head. */ - pv = pv_alloc(); - if (pv == NULL) - return NULL; - pv->pv_next = pv_table[ppn].pv_next; - pv_table[ppn].pv_next = pv; - pmap->pm_stats.resident_count++; - UVMHIST_LOG(pmaphist, "<-- new (pv=%#jx)", (uintptr_t)pv, 0, 0, 0); - return pv; -} - -/* - * Release the pv_entry for a mapping. Code derived from hp300 pmap. - */ -static void -pv_release(pmap_t pmap, int ppn, int lpn) -{ - struct pv_entry *pv, *npv; - UVMHIST_FUNC("pv_release"); - - UVMHIST_CALLED(pmaphist); - UVMHIST_LOG(pmaphist, "(pmap=%#jx, ppn=%jd, lpn=%jd)", - (uintptr_t)pmap, ppn, lpn, 0); - pv = &pv_table[ppn]; - /* - * If it is the first entry on the list, it is actually - * in the header and we must copy the following entry up - * to the header. Otherwise we must search the list for - * the entry. In either case we free the now unused entry. - */ - if (pmap == pv->pv_pmap && lpn == pv->pv_lpn) { - npv = pv->pv_next; - if (npv) { - UVMHIST_LOG(pmaphist, "pv=%#jx; pull-up", - (uintptr_t)pv, 0, 0, 0); - /* Pull up first entry from chain. */ - memcpy(pv, npv, offsetof(struct pv_entry, pv_pflags)); - pv->pv_pmap->pm_entries[pv->pv_lpn] = pv; - pv_free(npv); - } else { - UVMHIST_LOG(pmaphist, "pv=%#jx; empty", - (uintptr_t)pv, 0, 0, 0); - memset(pv, 0, offsetof(struct pv_entry, pv_pflags)); - } - } else { - for (npv = pv->pv_next; npv; npv = npv->pv_next) { - if (pmap == npv->pv_pmap && lpn == npv->pv_lpn) - break; - pv = npv; - } - KASSERT(npv != NULL); - UVMHIST_LOG(pmaphist, "pv=%#jx; tail", (uintptr_t)pv, 0, 0, 0); - pv->pv_next = npv->pv_next; - pv_free(npv); - } - pmap->pm_entries[lpn] = NULL; - pmap->pm_stats.resident_count--; -} - - -/* - * Insert the given physical page (pa) at the specified virtual - * address (va) in the target physical map with the protection - * requested. - * - * NB: This is the only routine which MAY NOT lazy-evaluate or lose - * information. That is, this routine must actually insert this page - * into the given map NOW. - */ - -int -pmap_enter(pmap_t pmap, vaddr_t va, paddr_t pa, vm_prot_t prot, u_int flags) -{ - UVMHIST_FUNC("pmap_enter"); - - UVMHIST_CALLED(pmaphist); - return pmap_enter1(pmap, va, pa, prot, flags, 0); -} - -static int -pmap_enter1(pmap_t pmap, vaddr_t va, paddr_t pa, vm_prot_t prot, u_int flags, - int unmanaged) -{ - int ppn, lpn, s; - struct pv_entry *pv, *ppv; - UVMHIST_FUNC("pmap_enter"); - - UVMHIST_CALLED(pmaphist); - ppn = atop(pa); lpn = atop(va); - - UVMHIST_LOG(pmaphist, "mapping ppn %jd at lpn %jd in pmap %#jx", - ppn, lpn, (uintptr_t)pmap, 0); - s = splvm(); - - /* Remove any existing mapping at this lpn */ - if (pmap->pm_entries[lpn] != NULL && - pmap->pm_entries[lpn]->pv_ppn != ppn) - pmap_remove(pmap, va, va + PAGE_SIZE); - - /* Make a note */ - pv = pv_get(pmap, ppn, lpn); - if (pv == NULL) - panic("pmap_enter1"); - if (pv->pv_vflags & PV_WIRED) - pmap->pm_stats.wired_count--; - ppv = &pv_table[ppn]; - pv->pv_pmap = pmap; - pv->pv_ppn = ppn; - pv->pv_lpn = lpn; - pv->pv_prot = prot; - pv->pv_vflags = 0; - /* pv->pv_pflags = 0; */ - if (flags & PMAP_WIRED) { - pv->pv_vflags |= PV_WIRED; - } - if (unmanaged) - pv->pv_vflags |= PV_UNMANAGED; - else { - /* According to pmap(9), unmanaged mappings don't track r/m */ - if (flags & VM_PROT_WRITE) - ppv->pv_pflags |= PV_REFERENCED | PV_MODIFIED; - else if (flags & (VM_PROT_ALL)) - ppv->pv_pflags |= PV_REFERENCED; - } - pmap_update_page(ppn); - pmap->pm_entries[lpn] = pv; - if (pv->pv_vflags & PV_WIRED) - pmap->pm_stats.wired_count++; - splx(s); - /* Poke the MEMC */ - if (pmap->pm_flags & PM_ACTIVE) - MEMC_WRITE(pv->pv_activate); - - return 0; -} - -/* Remove a range of virtual mappings from a pmap */ -void -pmap_remove(pmap_t pmap, vaddr_t sva, vaddr_t eva) -{ - int slpn, elpn, lpn, s; - struct pv_entry *pv; - UVMHIST_FUNC("pmap_remove"); - - UVMHIST_CALLED(pmaphist); - slpn = atop(sva); elpn = atop(eva); - UVMHIST_LOG(pmaphist, "clearing from lpn %jd to lpn %jd in pmap %#jx", - slpn, elpn - 1, (uintptr_t)pmap, 0); - s = splvm(); - for (lpn = slpn; lpn < elpn; lpn++) { - pv = pmap->pm_entries[lpn]; - if (pv != NULL) { - if (pmap->pm_flags & PM_ACTIVE) { - MEMC_WRITE(pv->pv_deactivate); - cpu_cache_flush(); - } - pmap->pm_entries[lpn] = NULL; - if (pv->pv_vflags & PV_WIRED) - pmap->pm_stats.wired_count--; - pv_release(pmap, pv->pv_ppn, lpn); - } - } - splx(s); -} - -bool -pmap_extract(pmap_t pmap, vaddr_t va, paddr_t *ppa) -{ - struct pv_entry *pv; - UVMHIST_FUNC("pmap_extract"); - - UVMHIST_CALLED(pmaphist); - pv = pmap->pm_entries[atop(va)]; - if (pv == NULL) - return false; - *ppa = ptoa(pv->pv_ppn); - return true; -} - -void -pmap_kenter_pa(vaddr_t va, paddr_t pa, vm_prot_t prot, u_int flags) -{ - UVMHIST_FUNC("pmap_kenter_pa"); - - UVMHIST_CALLED(pmaphist); - pmap_enter1(pmap_kernel(), va, pa, prot, prot | PMAP_WIRED, 1); -} - -void -pmap_kremove(vaddr_t va, vsize_t len) -{ - UVMHIST_FUNC("pmap_kremove"); - - UVMHIST_CALLED(pmaphist); - pmap_remove(pmap_kernel(), va, va+len); -} - -inline bool -pmap_is_modified(struct vm_page *page) -{ - int ppn; - bool rv; -#ifdef PMAP_DEBUG_MODIFIED - unsigned char digest[16]; -#endif - UVMHIST_FUNC("pmap_is_modified"); - - UVMHIST_CALLED(pmaphist); - ppn = atop(VM_PAGE_TO_PHYS(page)); - rv = (pv_table[ppn].pv_pflags & PV_MODIFIED) != 0; -#ifdef PMAP_DEBUG_MODIFIED - if (!rv) { - pmap_md4_page(digest, VM_PAGE_TO_PHYS(page)); - if (memcmp(digest, pv_table[ppn].pv_md4sum, 16) != 0) { - int i; - - printf("page %p modified bit wrong\n", page); - printf("then = "); - for (i = 0; i < 16; i++) - printf("%02x", pv_table[ppn].pv_md4sum[i]); - printf("\n now = "); - for (i = 0; i < 16; i++) - printf("%02x", digest[i]); - printf("\n"); - } - } -#endif - return rv; -} - -inline bool -pmap_is_referenced(struct vm_page *page) -{ - int ppn; - UVMHIST_FUNC("pmap_is_referenced"); - - UVMHIST_CALLED(pmaphist); - ppn = atop(VM_PAGE_TO_PHYS(page)); - return (pv_table[ppn].pv_pflags & PV_REFERENCED) != 0; -} - -static void -pmap_update_page(int ppn) -{ - struct pv_entry *pv; - UVMHIST_FUNC("pmap_update_page"); - - UVMHIST_CALLED(pmaphist); - for (pv = &pv_table[ppn]; pv != NULL; pv = pv->pv_next) - if (pv->pv_pmap != NULL) { - pv_update(pv); - if (pv->pv_pmap->pm_flags & PM_ACTIVE) { - if (pv->pv_activate) - MEMC_WRITE(pv->pv_activate); - else - MEMC_WRITE(pv->pv_deactivate); - } - } -} - -bool -pmap_clear_modify(struct vm_page *page) -{ - int ppn; - bool rv; - struct pv_entry *pv; - UVMHIST_FUNC("pmap_clear_modify"); - - UVMHIST_CALLED(pmaphist); - ppn = atop(VM_PAGE_TO_PHYS(page)); - rv = pmap_is_modified(page); -#ifdef PMAP_DEBUG_MODIFIED - pmap_md4_page(pv_table[ppn].pv_md4sum, ptoa(ppn)); -#endif - if (rv) { - for (pv = &pv_table[ppn]; pv != NULL; pv = pv->pv_next) - if (pv->pv_pmap == pmap_kernel() && - (pv->pv_prot & VM_PROT_WRITE)) - return rv; - pv_table[ppn].pv_pflags &= ~PV_MODIFIED; - pmap_update_page(ppn); - } - return rv; -} - -bool -pmap_clear_reference(struct vm_page *page) -{ - int ppn; - bool rv; - UVMHIST_FUNC("pmap_clear_reference"); - - UVMHIST_CALLED(pmaphist); - ppn = atop(VM_PAGE_TO_PHYS(page)); - rv = pmap_is_referenced(page); - if (rv) { - pv_table[ppn].pv_pflags &= ~PV_REFERENCED; - pmap_update_page(ppn); - } - return rv; -} - -/* - * Work out if a given page fault was our fault (e.g. through - * referenced/modified emulation). If it was, handle it and return - * true. Otherwise, return false. - */ -bool -pmap_fault(struct pmap *pmap, vaddr_t va, vm_prot_t atype) -{ - int lpn, ppn; - struct pv_entry *pv, *ppv; - UVMHIST_FUNC("pmap_fault"); - - UVMHIST_CALLED(pmaphist); - lpn = atop(va); - pv = pmap->pm_entries[lpn]; - if (pv == NULL) - return false; - ppn = pv->pv_ppn; - ppv = &pv_table[ppn]; - UVMHIST_LOG(pmaphist, - "pmap = %#jx, lpn = %jd, ppn = %jd, atype = 0x%jx", - (uintptr_t)pmap, lpn, ppn, atype); - if (pmap != pmap_kernel()) { - if ((ppv->pv_pflags & PV_REFERENCED) == 0) { - ppv->pv_pflags |= PV_REFERENCED; - pmap_update_page(ppn); - return true; - } - if ((atype & VM_PROT_WRITE) && (pv->pv_prot & VM_PROT_WRITE) && - (ppv->pv_pflags & PV_MODIFIED) == 0) { - ppv->pv_pflags |= PV_MODIFIED; - pmap_update_page(ppn); - return true; - } - } - /* - * It wasn't a referenced/modified fault. - * If it looks like the access should have been allowed, try pushing - * the mapping back into the MEMC. - */ - if ((atype & ~pv->pv_prot) == 0) { - MEMC_WRITE(pv->pv_activate); - /* - * If the new mapping is writable, we should flush the cache - * so that stale data for an existing mapping doesn't get - * reused. - * XXX: Should this be done more lazily? - */ - if (pv->pv_prot & VM_PROT_WRITE) - cpu_cache_flush(); - return true; - } - return false; -} - -/* - * Change access permissions on a given physical page. - * - * Pages mapped using pmap_kenter_*() are exempt. - */ -void -pmap_page_protect(struct vm_page *page, vm_prot_t prot) -{ - int ppn; - struct pv_entry *pv, *npv; - UVMHIST_FUNC("pmap_page_protect"); - - UVMHIST_CALLED(pmaphist); - ppn = atop(VM_PAGE_TO_PHYS(page)); - if (prot == VM_PROT_NONE) { - UVMHIST_LOG(pmaphist, "removing ppn %jd\n", ppn, 0, 0, 0); - npv = pv = &pv_table[ppn]; - while (pv != NULL && pv->pv_pmap != NULL) { - if (pv->pv_vflags & PV_UNMANAGED) { - pv = pv->pv_next; - continue; - } - if (pv->pv_pmap->pm_flags & PM_ACTIVE) { - MEMC_WRITE(pv->pv_deactivate); - cpu_cache_flush(); - } - if (pv != &pv_table[ppn]) - npv = pv->pv_next; - pv->pv_pmap->pm_entries[pv->pv_lpn] = NULL; - if (pv->pv_vflags & PV_WIRED) - pv->pv_pmap->pm_stats.wired_count--; - pv_release(pv->pv_pmap, ppn, pv->pv_lpn); - pv = npv; - } - } else if (prot != VM_PROT_ALL) { - for (pv = &pv_table[ppn]; pv != NULL; pv = pv->pv_next) - if (pv->pv_pmap != NULL && - (pv->pv_vflags & PV_UNMANAGED) == 0) { - pv->pv_prot &= prot; - pv_update(pv); - if (pv->pv_pmap->pm_flags & PM_ACTIVE) - MEMC_WRITE(pv->pv_activate); - } - } -} - -paddr_t -pmap_phys_address(paddr_t ppn) -{ - panic("pmap_phys_address not implemented"); -} - -void -pmap_protect(pmap_t pmap, vaddr_t sva, vaddr_t eva, vm_prot_t prot) -{ - struct pv_entry *pv; - int s, slpn, elpn, lpn; - UVMHIST_FUNC("pmap_protect"); - - UVMHIST_CALLED(pmaphist); - if (prot == VM_PROT_NONE) { - pmap_remove(pmap, sva, eva); - return; - } - if (prot & VM_PROT_WRITE) - return; /* apparently we're meant to */ - if (pmap == pmap_kernel()) - return; /* can't restrict kernel w/o unmapping. */ - - slpn = atop(sva); elpn = atop(eva); - s = splvm(); - for (lpn = slpn; lpn < elpn; lpn++) { - pv = pmap->pm_entries[lpn]; - if (pv != NULL) { - pv->pv_prot &= prot; - pv_update(pv); - if (pv->pv_pmap->pm_flags & PM_ACTIVE) - MEMC_WRITE(pv->pv_activate); - } - } - splx(s); -} - -void -pmap_reference(pmap_t pmap) -{ - UVMHIST_FUNC("pmap_reference"); - - UVMHIST_CALLED(pmaphist); - pmap->pm_count++; -} - -/* - * If there were any actions we could delay committing to hardware, - * this would be where they'd be committed. We should perhaps delay - * cache flushes till here, but I've heard rumours that pmap_update() - * isn't called as often as it should be, so I'll play it safe for - * now. - */ -void -pmap_update(struct pmap *pmap) -{ - UVMHIST_FUNC("pmap_update"); - - UVMHIST_CALLED(pmaphist); - /* Do nothing */ -} - -/* - * See if the given physical address has a logical mapping. Return - * its address if so, otherwise return the logical address in MEMC - * physical space. This means that we can safely write here without - * flushing the cache. Only necessary on ARM3. - */ -static void * -pmap_find(paddr_t pa) -{ -#ifdef CPU_ARM3 - struct pv_entry *pv; -#endif - UVMHIST_FUNC("pmap_find"); - - UVMHIST_CALLED(pmaphist); -#ifdef CPU_ARM3 - for (pv = &pv_table[atop(pa)]; pv != NULL; pv = pv->pv_next) - if (pv->pv_pmap != NULL && (pv->pv_pmap->pm_flags & PM_ACTIVE)) - return (void *)ptoa(pv->pv_lpn); -#endif - return (char*)MEMC_PHYS_BASE + pa; -} - -void -pmap_zero_page(paddr_t pa) -{ - UVMHIST_FUNC("pmap_zero_page"); - - UVMHIST_CALLED(pmaphist); - memset(pmap_find(pa), 0, PAGE_SIZE); -} - -void -pmap_copy_page(paddr_t src, paddr_t dest) -{ - UVMHIST_FUNC("pmap_copy_page"); - - UVMHIST_CALLED(pmaphist); - memcpy(pmap_find(dest), pmap_find(src), PAGE_SIZE); -} - -#ifdef PMAP_DEBUG_MODIFIED -static void -pmap_md4_page(unsigned char digest[16], paddr_t pa) -{ - MD4_CTX context; - UVMHIST_FUNC("pmap_md4_page"); - - UVMHIST_CALLED(pmaphist); - MD4Init(&context); - MD4Update(&context, pmap_find(pa), PAGE_SIZE); - MD4Final(digest, &context); -} -#endif - -/* - * This is meant to return the range of kernel vm that is available - * after loading the kernel. Since NetBSD/acorn26 runs the kernel from - * physically-mapped space, we just return all of kernel vm. Oh, - * except for the single page at the end where we map - * otherwise-unmapped pages. - */ -void -pmap_virtual_space(vaddr_t *vstartp, vaddr_t *vendp) -{ - UVMHIST_FUNC("pmap_virtual_space"); - - UVMHIST_CALLED(pmaphist); - if (vstartp != NULL) - *vstartp = VM_MIN_KERNEL_ADDRESS; - if (vendp != NULL) - *vendp = VM_MAX_KERNEL_ADDRESS - PAGE_SIZE; -} - -#ifdef DDB -#include - -void pmap_dump(struct pmap *); - -void -pmap_dump(struct pmap *pmap) -{ - int i; - struct pv_entry *pv; - int pflags; - - db_printf("PMAP %p:\n", pmap); - db_printf("\tcount = %d, flags = %d, " - "resident_count = %ld, wired_count = %ld\n", - pmap->pm_count, pmap->pm_flags, - pmap->pm_stats.resident_count, pmap->pm_stats.wired_count); - for (i = 0; i < 1024; i++) - if ((pv = pmap->pm_entries[i]) != NULL) { - db_printf("\t%03d->%p: ", i, pv); - if (pv->pv_pmap != pmap) - db_printf("pmap=%p!, ", pv->pv_pmap); - db_printf("ppn=%d, lpn=%d, ", - pv->pv_ppn, pv->pv_lpn); - db_printf("act=%08x, deact=%08x,\n", - pv->pv_activate, pv->pv_deactivate); - db_printf("\t\tprot=%c%c%c, ", - pv->pv_prot & VM_PROT_READ ? 'r' : '-', - pv->pv_prot & VM_PROT_WRITE ? 'w' : '-', - pv->pv_prot & VM_PROT_EXECUTE ? 'x' : '-'); - db_printf("ppl="); - switch(pv->pv_ppl) { - case MEMC_PPL_RDWR: - db_printf("rw, "); - break; - case MEMC_PPL_RDONLY: - db_printf("r-, "); - break; - case MEMC_PPL_NOACCESS: - db_printf("--, "); - break; - default: - db_printf("0x%x, ", pv->pv_ppl); - break; - } - db_printf("vflags=%c, ", - pv->pv_vflags & PV_WIRED ? 'W' : '-'); - pflags = pv_table[pv->pv_ppn].pv_pflags; - db_printf("pflags=%c%c\n", - pflags & PV_MODIFIED ? 'M' : '-', - pflags & PV_REFERENCED ? 'R' : '-'); - - } -} -#endif Index: sys/arch/acorn26/acorn26/rscons.c =================================================================== RCS file: sys/arch/acorn26/acorn26/rscons.c diff -N sys/arch/acorn26/acorn26/rscons.c --- sys/arch/acorn26/acorn26/rscons.c 11 Dec 2005 12:16:03 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,101 +0,0 @@ -/* $NetBSD: rscons.c,v 1.4 2005/12/11 12:16:03 christos Exp $ */ -/*- - * Copyright (c) 1997, 1998 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * rscons.c - Really basic routines for the Arc serial port - */ - -#include -__KERNEL_RCSID(0, "$NetBSD: rscons.c,v 1.4 2005/12/11 12:16:03 christos Exp $"); - -#include -#include - -#include -#include - -#define RS_BASE 0x033B0000 - -cons_decl(rs); - -void rscnprobe(cp) - struct consdev *cp; -{ - - /* Be optimistic! */ - cp->cn_pri = CN_NORMAL; - cp->cn_dev = makedev(13, 0); -} - -void rscninit(cp) - struct consdev *cp; -{ - volatile char *rs_base = (volatile char *)RS_BASE; - - /* Reset 6551 */ - rs_base[R6551_RESET<<2] = 1; - /* 9600, 8N1 */ - rs_base[R6551_CONTROL<<2] = R6551_CTL_SBR_9600 | - R6551_CTL_WL_8 | R6551_CTL_RCS_INT; - /* Enable transmission, disable interrupts, set DTR. */ - rs_base[R6551_COMMAND<<2] = R6551_CMD_DTR | R6551_CMD_IRD | - R6551_CMD_TIC_NOIRQ; - /* The 6551 is now sane. Well, as sane as a 6551 can be. */ -} - -int rscngetc(dev) - dev_t dev; -{ - volatile char *rs_base = (volatile char *)RS_BASE; - int c; - - /* Wait for reception */ - while ((rs_base[R6551_STATUS<<2] & R6551_STAT_RDRF) == 0); - c = rs_base[R6551_RX_DATA<<2]; - if (c == '\r') - c = '\n'; - return c; -} - -void rscnputc(dev, c) - dev_t dev; - int c; -{ - volatile char *rs_base = (volatile char *)RS_BASE; - - while (!(rs_base[R6551_STATUS<<2] & R6551_STAT_TDRE)); - /* And it's now ready to transmit. */ - rs_base[R6551_TX_DATA<<2] = c; - /* Wait for it to finish (me? paranoid?) */ - while (!(rs_base[R6551_STATUS<<2] & R6551_STAT_TDRE)); -} - -void rscnpollc(dev, on) - dev_t dev; - int on; -{ -} Index: sys/arch/acorn26/acorn26/start.c =================================================================== RCS file: sys/arch/acorn26/acorn26/start.c diff -N sys/arch/acorn26/acorn26/start.c --- sys/arch/acorn26/acorn26/start.c 22 Dec 2016 14:47:53 -0000 1.21 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,204 +0,0 @@ -/* $NetBSD: start.c,v 1.21 2016/12/22 14:47:53 cherry Exp $ */ -/*- - * Copyright (c) 1998, 2000 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * start.c -- In the beginning... - */ - -#include - -__KERNEL_RCSID(0, "$NetBSD: start.c,v 1.21 2016/12/22 14:47:53 cherry Exp $"); - -#include "opt_modular.h" - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include - -#include "arcvideo.h" -#include "ioc.h" -#include "ksyms.h" - -#if NIOC > 0 -#include -#endif - -extern void main(void); /* XXX Should be in a header file */ - -struct bootconfig bootconfig; - -/* in machdep.h */ -extern i2c_tag_t acorn26_i2c_tag; - -/* We don't pass a command line yet. */ -const char *boot_args = ""; -const char *boot_file = ""; - -#ifdef DIAGNOSTIC -#define BOOT_SANITY 0x89345846 -static int boot_sanity = BOOT_SANITY; -#endif - -#ifndef __ELF__ -/* Odd symbols declared by the linker */ -extern char _stext_, _etext, _sdata_, _edata, _bss_start, _end; -#else /* ELF */ -extern char __bss_start__[], __bss_end__[]; -#endif - -/* - * This is where it all begins. The bootloader is expected to enter - * in an APCS-compliant manner so we don't have to mess around in - * assembler to get things going. - */ -void -start(struct bootconfig *initbootconfig) -{ - int onstack; - vaddr_t v; - - /* - * State of the world as of BBBB 0.02: - * Registers per APCS - * physmem (set up by RISC OS and BBBB): - * 0x02000000 -- 0x02080000 == Screen (potentially) - * 0x02080000 -- 0x02088000 == Zero page - * 0x02088000 -- 0x02090000 == Initial kernel stack - * 0x02090000 -- 0x02098000 == Kernel message buffer - * 0x02098000 -- freebase == Kernel image - * bss is cleared for us - * We re-map zero page to point at the start of the kernel image - * which is in locore.S. - */ - -#define ZP_PHYSADDR ((paddr_t)0x00098000) -#define MSGBUF_PHYSADDR ((paddr_t)0x00090000) - - /* We can't trust the BSS (at least not with my linker) */ - memset(__bss_start__, 0, __bss_end__ - __bss_start__); - - /* Save boot configuration somewhere */ - memcpy(&bootconfig, initbootconfig, sizeof(struct bootconfig)); - - if (bootconfig.magic != BOOT_MAGIC) - panic("bootloader is ancient"); - /* initialise kernel variables */ - boothowto = bootconfig.boothowto; - physmem = bootconfig.npages; - uvmexp.pagesize = bootconfig.nbpp; - uvm_md_init(); - - /* Any others? */ - - /* Set up kernel message buffer */ - /* XXX Should be in cpu_startup, yesno? */ - /* Probably not actually -- the sooner it's run, the better. */ - initmsgbuf((void*)((paddr_t)MEMC_PHYS_BASE + MSGBUF_PHYSADDR), - MSGBUFSIZE); - -#ifdef DIAGNOSTIC - /* - * Check that the linker and loader agree about where - * everything should be loaded. - */ - - if (boot_sanity != BOOT_SANITY) - panic("Bootloader mislaid the data segment"); -#endif - -#if !NKSYMS && !defined(DDB) && !defined(MODULAR) - /* Throw away the symbol table to gain space. */ - if (bootconfig.freebase == bootconfig.esym) { - bootconfig.freebase = bootconfig.ssym; - bootconfig.ssym = bootconfig.esym = 0; - } -#endif - - /* Tell UVM about memory */ -#if NARCVIDEO == 0 - /* - * DMA-able space. If the video driver's configured, it'll - * register this later once it knows how much it's using. - */ - uvm_page_physload(0, atop(MEMC_DMA_MAX), 0, atop(MEMC_DMA_MAX), - VM_FREELIST_LOW); -#endif - /* - * Normal memory -- we expect the bootloader to tell us where - * the kernel ends. - */ - /* Old zero page is unused. */ - uvm_page_physload(atop(MEMC_DMA_MAX), atop(MEMC_DMA_MAX) + 1, - atop(MEMC_DMA_MAX), atop(MEMC_DMA_MAX) + 1, - VM_FREELIST_DEFAULT); - /* Stack, msgbuf, kernel image are used, space above it is unused. */ - uvm_page_physload(atop(MEMC_DMA_MAX) + 1, bootconfig.npages, - atop(round_page(bootconfig.freebase)), - bootconfig.npages, - VM_FREELIST_DEFAULT); - - /* printf("Memory registered with UVM.\n"); */ - - /* Get the MEMC set up and map zero page */ - pmap_bootstrap(bootconfig.npages, ZP_PHYSADDR); - - /* Set up the undefined instruction handlers. */ - undefined_init(); - - splhigh(); - fiq_off(); - - /* - * Locate lwp0's uarea, in the bottom of its kernel stack page. - * That is our current stack page too. - */ - v = round_page((vaddr_t)&onstack) - USPACE; - uvm_lwp_setuarea(&lwp0, v); - memset((void *)v, 0, sizeof(struct pcb)); - - /* TODO: anything else? */ - - main(); - - panic("main() returned"); - /* NOTREACHED */ -} Index: sys/arch/acorn26/acorn26/stubs.c =================================================================== RCS file: sys/arch/acorn26/acorn26/stubs.c diff -N sys/arch/acorn26/acorn26/stubs.c --- sys/arch/acorn26/acorn26/stubs.c 21 Nov 2009 20:32:17 -0000 1.10 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,49 +0,0 @@ -/* $NetBSD: stubs.c,v 1.10 2009/11/21 20:32:17 rmind Exp $ */ -/* - * stubs.c -- functions I haven't written yet - */ - -#include -__KERNEL_RCSID(0, "$NetBSD: stubs.c,v 1.10 2009/11/21 20:32:17 rmind Exp $"); - -#include -#include -#include - -#include - -int -suibyte(void *base, int c) -{ - panic("suibyte not implemented"); -} - -int -suisword(void *base, short c) -{ - panic("suisword not implemented"); -} - -int -suiword(void *base, long c) -{ - panic("suiword not implemented"); -} - -int -fuibyte(const void *base) -{ - panic("fuibyte not implemented"); -} - -int -fuisword(const void *base) -{ - panic("fuisword not implemented"); -} - -long -fuiword(const void *base) -{ - panic("fuiword not implemented"); -} Index: sys/arch/acorn26/acorn26/sys_machdep.c =================================================================== RCS file: sys/arch/acorn26/acorn26/sys_machdep.c diff -N sys/arch/acorn26/acorn26/sys_machdep.c --- sys/arch/acorn26/acorn26/sys_machdep.c 30 Jun 2011 20:09:16 -0000 1.5 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,75 +0,0 @@ -/* $NetBSD: sys_machdep.c,v 1.5 2011/06/30 20:09:16 wiz Exp $ */ - -/* - * Copyright (c) 1995-1997 Mark Brinicombe. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * 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 Mark Brinicombe - * 4. The name of the company nor the name of the author 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 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. - * - * RiscBSD kernel project - * - * sys_machdep.c - * - * Machine dependent syscalls - * - * Created : 10/01/96 - */ - -#include - -__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.5 2011/06/30 20:09:16 wiz Exp $"); - -#include -#include -#include -#include - -#include - -int -sys_sysarch(struct lwp *l, const struct sys_sysarch_args *uap, register_t *retval) -{ - /* { - syscallarg(int) op; - syscallarg(void *) parms; - } */ - int error = 0; - - switch(SCARG(uap, op)) { - case ARM_SYNC_ICACHE: - case ARM_DRAIN_WRITEBUF: - /* These are both no-ops on arm26. */ - break; - default: - error = EINVAL; - break; - } - return (error); -} - -/* End of sys_machdep.c */ Index: sys/arch/acorn26/acorn26/vm_machdep.c =================================================================== RCS file: sys/arch/acorn26/acorn26/vm_machdep.c diff -N sys/arch/acorn26/acorn26/vm_machdep.c --- sys/arch/acorn26/acorn26/vm_machdep.c 16 Aug 2012 17:35:01 -0000 1.29 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,219 +0,0 @@ -/* $NetBSD: vm_machdep.c,v 1.29 2012/08/16 17:35:01 matt Exp $ */ - -/*- - * Copyright (c) 2000, 2001 Ben Harris - * Copyright (c) 1994-1998 Mark Brinicombe. - * Copyright (c) 1994 Brini. - * All rights reserved. - * - * This code is derived from software written for Brini by Mark Brinicombe - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * 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 Mark Brinicombe - * for the NetBSD Project. - * 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 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 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. - */ - -/* - * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. - * All rights reserved. - * - * Author: Chris G. Demetriou - * - * Permission to use, copy, modify and distribute this software and - * its documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND - * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - */ - -#include -__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.29 2012/08/16 17:35:01 matt Exp $"); - -#include -#include -#include /* XXX syscallargs.h uses fhandle_t and fsid_t */ -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -/* - * Finish a fork operation, with thread l2 nearly set up. - * Copy and update the pcb and trap frame, making the child ready to run. - * - * l1 is the thread being forked; if l1 == &lwp0, we are creating - * a kernel thread, and the return path and argument are specified with - * `func' and `arg'. - * - * If an alternate user-level stack is requested (with non-zero values - * in both the stack and stacksize args), set up the user stack pointer - * accordingly. - */ - -/* - * Note: the pcb structure has to be at the start of the uarea -- we start - * the kernel stack from the end. - */ - -void -cpu_lwp_fork(struct lwp *l1, struct lwp *l2, void *stack, size_t stacksize, - void (*func)(void *), void *arg) -{ - struct pcb *pcb1, *pcb2; - struct trapframe *tf; - struct switchframe *sf; - -#if 0 - printf("cpu_lwp_fork: %p -> %p\n", p1, p2); -#endif - pcb1 = lwp_getpcb(l1); - pcb2 = lwp_getpcb(l2); - - /* Copy the pcb */ - *pcb2 = *pcb1; - - /* pmap_activate(l2); XXX Other ports do. Why? */ - - /* Set up the kernel stack */ - tf = (struct trapframe *)(uvm_lwp_getuarea(l2) + USPACE) - 1; - sf = (struct switchframe *)tf - 1; - /* Duplicate old process's trapframe (if it had one) */ - if (lwp_trapframe(l1) == NULL) - memset(tf, 0, sizeof(*tf)); - else - *tf = *lwp_trapframe(l1); - /* If specified, give the child a different stack. */ - if (stack != NULL) - tf->tf_usr_sp = (u_int)stack + stacksize; - lwp_settrapframe(l2, tf); - /* Fabricate a new switchframe */ - memset(sf, 0, sizeof(*sf)); - - sf->sf_r13 = (register_t)tf; /* Initial stack pointer */ - sf->sf_pc = (register_t)lwp_trampoline | R15_MODE_SVC; - - lwp_settrapframe(l2, tf); - pcb2->pcb_sf = sf; - pcb2->pcb_onfault = NULL; - sf->sf_r4 = (register_t)func; - sf->sf_r5 = (register_t)arg; -} - -void -cpu_lwp_free(struct lwp *l, int proc) -{ - - /* Nothing to do here? */ -} - -void -cpu_lwp_free2(struct lwp *l) -{ - - /* Nothing to do here? */ -} - -/* - * Map a user I/O request into kernel virtual address space. - * Note: the pages are already locked by uvm_vslock(), so we - * do not need to pass an access_type to pmap_enter(). - */ -/* This code was originally stolen from the alpha port. */ -int -vmapbuf(struct buf *bp, vsize_t len) -{ - vaddr_t faddr, taddr, off; - paddr_t pa; - struct proc *p; - vm_prot_t prot; - - if ((bp->b_flags & B_PHYS) == 0) - panic("vmapbuf"); - p = bp->b_proc; - bp->b_saveaddr = bp->b_data; - faddr = trunc_page((vaddr_t)bp->b_data); - off = (vaddr_t)bp->b_data - faddr; - len = round_page(off + len); - taddr = uvm_km_alloc(phys_map, len, 0, UVM_KMF_VAONLY | UVM_KMF_WAITVA); - bp->b_data = (void *)(taddr + off); - len = atop(len); - prot = bp->b_flags & B_READ ? VM_PROT_READ | VM_PROT_WRITE : - VM_PROT_READ; - while (len--) { - if (pmap_extract(vm_map_pmap(&p->p_vmspace->vm_map), faddr, - &pa) == false) - panic("vmapbuf: null page frame"); - pmap_enter(vm_map_pmap(phys_map), taddr, trunc_page(pa), - prot, prot | PMAP_WIRED); - faddr += PAGE_SIZE; - taddr += PAGE_SIZE; - } - pmap_update(vm_map_pmap(phys_map)); - - return 0; -} - -/* - * Unmap a previously-mapped user I/O request. - */ -void -vunmapbuf(struct buf *bp, vsize_t len) -{ - vaddr_t addr, off; - - if ((bp->b_flags & B_PHYS) == 0) - panic("vunmapbuf"); - addr = trunc_page((vaddr_t)bp->b_data); - off = (vaddr_t)bp->b_data - addr; - len = round_page(off + len); - pmap_remove(vm_map_pmap(phys_map), addr, addr + len); - pmap_update(vm_map_pmap(phys_map)); - uvm_km_free(phys_map, addr, len, UVM_KMF_VAONLY); - bp->b_data = bp->b_saveaddr; - bp->b_saveaddr = NULL; -} Index: sys/arch/acorn26/compile/Makefile =================================================================== RCS file: sys/arch/acorn26/compile/Makefile diff -N sys/arch/acorn26/compile/Makefile --- sys/arch/acorn26/compile/Makefile 6 Jan 2003 17:40:20 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -# $NetBSD: Makefile,v 1.1 2003/01/06 17:40:20 lukem Exp $ - -.include Index: sys/arch/acorn26/conf/FOURMEG =================================================================== RCS file: sys/arch/acorn26/conf/FOURMEG diff -N sys/arch/acorn26/conf/FOURMEG --- sys/arch/acorn26/conf/FOURMEG 29 Jul 2017 18:08:56 -0000 1.50 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,196 +0,0 @@ -# $NetBSD: FOURMEG,v 1.50 2017/07/29 18:08:56 maxv Exp $ - -# FOURMEG arm26 configuration -- something small - -include "arch/acorn26/conf/std.acorn26" - -#options INCLUDE_CONFIG_FILE # embed config file in kernel binary - -maxusers 2 - -# CPU support -options CPU_ARM2 -options CPU_ARM250 -options CPU_ARM3 - -# Diagnostic/debugging support options -#options DIAGNOSTIC # Cheap kernel consistency checks -#options DEBUG # More expensive checks and printfs -#options DDB # kernel debugger -#options SYSCALL_DEBUG # trace syscall entry/exit -#options SCSIDEBUG -#options UVMHIST - -## Compile the kernel with debugging symbols (`netbsd.gdb' is the debug file), -## such that gdb(1) can be used on a kernel coredump. -#makeoptions DEBUG="-g" - -makeoptions COPTS="-Os -fno-inline" - -# File systems -file-system FFS # Fast file system -#file-system LFS # log-structured file system -file-system MFS # Memory-based file system -#file-system EXT2FS # second extended file system (linux) -#file-system CD9660 # ISO-9660 CD-ROM FS (w/RockRidge extensions) -file-system FILECORE # Acorn filecore file system -#file-system ADOSFS # AmigaDOS-compatible file system -#file-system MSDOSFS # MS-DOS-compatible file system -#file-system NTFS # Windows/NT file system (experimental) -file-system NFS # Sun NFS-compatible file system client -#file-system NULLFS # loopback file system -#file-system OVERLAY # overlay filesystem -#file-system UMAPFS # NULLFS + uid and gid remapping -#file-system UNION # union file system -file-system PROCFS # /proc -file-system KERNFS # /kern -file-system FDESC # /dev/fd -file-system PTYFS # /dev/pts/N support - -# File system options -#options QUOTA # legacy UFS quotas -#options QUOTA2 # new, in-filesystem UFS quotas -#options NFSSERVER # Sun NFS-compatible file system server -options FFS_EI # FFS endianness-independence support -options NFS_V2_ONLY # Make a smaller NFS -options FFS_NO_SNAPSHOT # No FFS snapshot support - -# Executable format options -options EXEC_ELF32 -options EXEC_SCRIPT - -# Networking options -#options GATEWAY # packet forwarding -options INET # Internet protocol suite -options INET6 # IPV6 -#options IPSEC # IP security -#options IPSEC_DEBUG # debug for IP security -#options MROUTING # IP multicast routing -#options PIM # Protocol Independent Multicast -#options NETATALK # AppleTalk networking -#options PPP_BSDCOMP # BSD-Compress compression support for PPP -#options PPP_DEFLATE # Deflate compression support for PPP -#options PPP_FILTER # Active filter support for PPP (requires bpf) -#options TCP_DEBUG # Record last TCP_NDEBUG packets with SO_DEBUG - -#options COMPAT_43 # 4.3BSD compatibility. -options COMPAT_16 # NetBSD 1.6 binary compatibility. -options COMPAT_BSDPTY # /dev/[pt]ty?? ptys. - -# Binary compatibility with previous versions of NetBSD. -# None yet, since NetBSD/arm26 hasn't been released. - -# System V IPC -options SYSVMSG # System V-like message queues -options SYSVSEM # System V-like semaphores -options SYSVSHM # System V-like shared memory - -# Miscellaneous kernel options -options KTRACE # system call tracing, a la ktrace(1) -#options IRQSTATS # manage IRQ statistics -#options SCSIVERBOSE # Verbose SCSI errors -options BUFPAGES=1 -#options USERCONF # userconf(4) support -options PIPE_SOCKETPAIR # smaller, but slower pipe(2) -#options SYSCTL_INCLUDE_DESCR # Include sysctl descriptions in kernel - -# Disable kernel security. -#options INSECURE - -# NFS boot options -options NFS_BOOT_DHCP # superset of BOOTP -options NFS_BOOT_BOOTPARAM -#options NFS_BOOT_RWSIZE=1024 # XXX "ea" driver bug workaround - -# WS console uses DUMB, SUN or VT100 terminal emulation -#options WSEMUL_NODUMB -#options WSEMUL_SUN -#options WSEMUL_VT100 -#options WSDISPLAY_COMPAT_USL # wsconscfg VT handling -options FONT_VT220L8x8 # 8x8 font for console -options RASOPS_SMALL - -config netbsd root on ? type ? -#config netbsd root on sd0 type ffs -#config netbsd root on ? type nfs - -cpu0 at root - -iobus0 at root # 16-bit I/O bus - -ioc0 at iobus0 base 0x200000 # I/O controller - -iociic0 at ioc0 # I^2C serial bus -iic0 at iociic0 - -pcfrtc0 at iic0 addr 0x50 # Real-time clock - -arckbd0 at ioc0 bank 0 offset 0x04 # System keyboard -wskbd0 at arckbd0 -wsmouse0 at arckbd0 - -ioeb0 at ioc0 bank 5 # I/O Extension Block (A5000) -latches0 at ioc0 bank 5 # Printer/FDC control latches (Arc) - -podulebus0 at ioc0 bank 4 # Expansion card bus -unixbp0 at ioc0 bank 6 # Unix Backplane (interrupt routing) - -ei* at podulebus0 slot ? # Acorn AKA25 (Ether1) -ea* at podulebus0 slot ? # Atomwide Ether3 -eh* at podulebus0 slot ? # i-cubed EtherH (E100/200/500) - -dtide* at podulebus0 slot ? # D.T. Software IDE interface -atabus* at dtide? channel ? # ATA bus - -hcide* at podulebus0 slot ? # HCCS IDE interface -atabus* at hcide? channel ? # ATA bus - -hcsc* at podulebus0 slot ? # HCCS 8-bit SCSI interface -scsibus* at hcsc? - -oak* at podulebus0 slot ? # Oak Solutions 16-bit SCSI interface -scsibus* at oak? - -upc0 at iobus0 base 0x010000 # I/O chip on IOEB machines -#com0 at upc0 # Serial port -#lpt0 at upc0 # Parallel port -wdc0 at upc0 # IDE controller -atabus* at wdc? # ATA bus - -wd* at atabus? drive ? # IDE hard discs -atapibus* at atabus? # ATAPI devices -cd* at atapibus? drive ? # ATAPI CD-ROM drives -#sd* at atapibus? drive ? # ATAPI disk drives -#uk* at atapibus? drive ? # ATAPI unknown - -sd* at scsibus? target ? lun ? # SCSI disk drives -#st* at scsibus? target ? lun ? # SCSI tape drives -cd* at scsibus? target ? lun ? # SCSI CD-ROM drives -#ch* at scsibus? target ? lun ? # SCSI auto-changers -#uk* at scsibus? target ? lun ? # SCSI unknown device -#ss* at scsibus? target ? lun ? # SCSI scanner - -arcvideo0 at root # On-board video -wsdisplay0 at arcvideo0 - -#pseudo-device bpfilter -#pseudo-device ccd -#pseudo-device raid # RAIDframe disk driver -#options RAID_AUTOCONFIG # auto-configuration of RAID components -#pseudo-device fss # file system snapshot device -#pseudo-device ipfilter -pseudo-device loop -pseudo-device md -#options MEMORY_DISK_HOOKS -#options MEMORY_DISK_ROOT_SIZE= -#pseudo-device ppp -pseudo-device pty -#pseudo-device sl -#pseudo-device vnd -#pseudo-device gre # generic L3 over IP tunnel -#pseudo-device gif # IPv[46] over IPv[46] tunnel (RFC1933) -#pseudo-device faith # IPv[46] tcp relay translation i/f -#pseudo-device sequencer # MIDI sequencer -pseudo-device wsmux # keyboard/mouse multiplexor -pseudo-device clockctl # user control of clock subsystem - Index: sys/arch/acorn26/conf/GENERIC =================================================================== RCS file: sys/arch/acorn26/conf/GENERIC diff -N sys/arch/acorn26/conf/GENERIC --- sys/arch/acorn26/conf/GENERIC 13 Sep 2017 22:24:42 -0000 1.84 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,277 +0,0 @@ -# $NetBSD: GENERIC,v 1.84 2017/09/13 22:24:42 sevan Exp $ -# -# GENERIC machine description file -# -# This machine description file is used to generate the default NetBSD -# kernel. The generic kernel does not include all options, subsystems -# and device drivers, but should be useful for most applications. -# -# The machine description file can be customised for your specific -# machine to reduce the kernel size and improve its performance. -# -# For further information on compiling NetBSD kernels, see the config(8) -# man page. -# -# For further information on hardware support for this architecture, see -# the intro(4) man page. For further information about kernel options -# for this architecture, see the options(4) man page. For an explanation -# of each device driver in this file see the section 4 man page for the -# device. - -include "arch/acorn26/conf/std.acorn26" - -options INCLUDE_CONFIG_FILE # embed config file in kernel binary - -maxusers 8 - -# CPU support -options CPU_ARM2 -options CPU_ARM250 -options CPU_ARM3 - -# Diagnostic/debugging support options -#options DIAGNOSTIC # Cheap kernel consistency checks -#options DEBUG # More expensive checks and printfs -options DDB # kernel debugger -#options SYSCALL_DEBUG # trace syscall entry/exit -#options SCSIDEBUG -#options UVMHIST - -## Compile the kernel with debugging symbols (`netbsd.gdb' is the debug file), -## such that gdb(1) can be used on a kernel coredump. -#makeoptions DEBUG="-g" - -# File systems -file-system FFS # Fast file system -file-system LFS # log-structured file system -file-system MFS # Memory-based file system -file-system EXT2FS # second extended file system (linux) -file-system CD9660 # ISO-9660 CD-ROM FS (w/RockRidge extensions) -file-system FILECORE # Acorn filecore file system -file-system ADOSFS # AmigaDOS-compatible file system -file-system MSDOSFS # MS-DOS-compatible file system -file-system NTFS # Windows/NT file system (experimental) -file-system NFS # Sun NFS-compatible file system client -file-system NULLFS # loopback file system -file-system OVERLAY # overlay filesystem -file-system PUFFS # Userspace file systems (e.g. ntfs-3g & sshfs) -file-system UMAPFS # NULLFS + uid and gid remapping -#file-system UNION # union file system -file-system PROCFS # /proc -file-system KERNFS # /kern -file-system FDESC # /dev/fd -file-system PTYFS # /dev/pts/N support -file-system TMPFS # Efficient memory file-system -#file-system UDF # experimental - OSTA UDF CD/DVD file-system - -# File system options -options QUOTA # legacy UFS quotas -options QUOTA2 # new, in-filesystem UFS quotas -options NFSSERVER # Sun NFS-compatible file system server -options FFS_EI # FFS endianness-independence support -options WAPBL # File system journaling support -#options UFS_DIRHASH # UFS Large Directory Hashing - Experimental -#options FFS_NO_SNAPSHOT # No FFS snapshot support -options UFS_EXTATTR # Extended attribute support for UFS1 - -# Executable format options -options EXEC_ELF32 -options EXEC_SCRIPT - -# Networking options -options GATEWAY # packet forwarding -options INET # Internet protocol suite -options INET6 # IPV6 -#options IPSEC # IP security -#options IPSEC_DEBUG # debug for IP security -#options MROUTING # IP multicast routing -#options PIM # Protocol Independent Multicast -#options NETATALK # AppleTalk networking -#options PPP_BSDCOMP # BSD-Compress compression support for PPP -#options PPP_DEFLATE # Deflate compression support for PPP -#options PPP_FILTER # Active filter support for PPP (requires bpf) -#options TCP_DEBUG # Record last TCP_NDEBUG packets with SO_DEBUG - -#options ALTQ # Manipulate network interfaces' output queues -#options ALTQ_BLUE # Stochastic Fair Blue -#options ALTQ_CBQ # Class-Based Queueing -#options ALTQ_CDNR # Diffserv Traffic Conditioner -#options ALTQ_FIFOQ # First-In First-Out Queue -#options ALTQ_FLOWVALVE # RED/flow-valve (red-penalty-box) -#options ALTQ_HFSC # Hierarchical Fair Service Curve -#options ALTQ_LOCALQ # Local queueing discipline -#options ALTQ_PRIQ # Priority Queueing -#options ALTQ_RED # Random Early Detection -#options ALTQ_RIO # RED with IN/OUT -#options ALTQ_WFQ # Weighted Fair Queueing - -#options COMPAT_43 # 4.3BSD compatibility. -options COMPAT_16 # NetBSD 1.6 binary compatibility. -options COMPAT_BSDPTY # /dev/[pt]ty?? ptys. - -# Binary compatibility with previous versions of NetBSD. -# None yet, since NetBSD/acorn26 hasn't been released. - -# System V IPC -options SYSVMSG # System V-like message queues -options SYSVSEM # System V-like semaphores -options SYSVSHM # System V-like shared memory - -# Miscellaneous kernel options -options KTRACE # system call tracing, a la ktrace(1) -#options IRQSTATS # manage IRQ statistics -#options SCSIVERBOSE # Verbose SCSI errors -options NTP # Kernel PLL for ntpd(8). -options USERCONF # userconf(4) support -#options PIPE_SOCKETPAIR # smaller, but slower pipe(2) -options SYSCTL_INCLUDE_DESCR # Include sysctl descriptions in kernel - -# Enable experimental buffer queue strategy for better responsiveness under -# high disk I/O load. Use it with caution - it's not proven to be stable yet. -#options BUFQ_READPRIO -#options BUFQ_PRIOCSCAN - -# Disable kernel security. -#options INSECURE - -# NFS boot options -options NFS_BOOT_DHCP # superset of BOOTP -options NFS_BOOT_BOOTPARAM -options NFS_BOOT_RWSIZE=1024 # XXX "ea" driver bug workaround - -# WS console uses DUMB, SUN or VT100 terminal emulation -#options WSEMUL_NODUMB -#options WSEMUL_SUN -options WSEMUL_VT100 -options WSDISPLAY_COMPAT_USL # wsconscfg VT handling -options FONT_VT220L8x8 # 8x8 font for console - -config netbsd root on ? type ? -#config netbsd root on sd0 type ffs -#config netbsd root on ? type nfs - -cpu0 at root - -iobus0 at root # 16-bit I/O bus - -ioc0 at iobus0 base 0x200000 # I/O controller - -iociic0 at ioc0 # I^2C serial bus -iic0 at iociic0 - -pcfrtc0 at iic0 addr 0x50 # Real-time clock - -arckbd0 at ioc0 bank 0 offset 0x04 # System keyboard -wskbd0 at arckbd0 -wsmouse0 at arckbd0 - -ioeb0 at ioc0 bank 5 # I/O Extension Block (A5000) -latches0 at ioc0 bank 5 # Printer/FDC control latches (Arc) - -podulebus0 at ioc0 bank 4 # Expansion card bus -unixbp0 at ioc0 bank 6 # Unix Backplane (interrupt routing) - -ei* at podulebus0 slot ? # Acorn AKA25 (Ether1) -ea* at podulebus0 slot ? # Atomwide Ether3 -eh* at podulebus0 slot ? # i-cubed EtherH (E100/200/500) - -dtide* at podulebus0 slot ? # D.T. Software IDE interface -atabus* at dtide? channel ? # ATA bus - -hcide* at podulebus0 slot ? # HCCS IDE interface -atabus* at hcide? channel ? # ATA bus - -sec* at podulebus0 slot ? # Acorn SCSI interface -scsibus* at sec? - -hcsc* at podulebus0 slot ? # HCCS 8-bit SCSI interface -scsibus* at hcsc? - -oak* at podulebus0 slot ? # Oak Solutions 16-bit SCSI interface -scsibus* at oak? - -esp* at podulebus0 slot ? # Castle SCSI interface -scsibus* at esp? - -upc0 at iobus0 base 0x010000 # I/O chip on IOEB machines -com0 at upc0 # Serial port -lpt0 at upc0 # Parallel port -wdc0 at upc0 # IDE controller -atabus* at wdc? # ATA bus - -wd* at atabus? drive ? # IDE hard discs -atapibus* at atabus? # ATAPI devices - -cd* at atapibus? drive ? # ATAPI CD-ROM drives -sd* at atapibus? drive ? # ATAPI disk drives -uk* at atapibus? drive ? # ATAPI unknown - -sd* at scsibus? target ? lun ? # SCSI disk drives -st* at scsibus? target ? lun ? # SCSI tape drives -cd* at scsibus? target ? lun ? # SCSI CD-ROM drives -ch* at scsibus? target ? lun ? # SCSI auto-changers -uk* at scsibus? target ? lun ? # SCSI unknown device -ss* at scsibus? target ? lun ? # SCSI scanner - -arcvideo0 at root # On-board video -wsdisplay0 at arcvideo0 - -# -# accept filters -pseudo-device accf_data # "dataready" accept filter -pseudo-device accf_http # "httpready" accept filter - -pseudo-device bpfilter -#pseudo-device carp # Common Address Redundancy Protocol -pseudo-device ccd -#pseudo-device cgd # cryptographic disk devices -pseudo-device raid # RAIDframe disk driver -options RAID_AUTOCONFIG # auto-configuration of RAID components -# Options to enable various other RAIDframe RAID types. -# options RF_INCLUDE_EVENODD=1 -# options RF_INCLUDE_RAID5_RS=1 -# options RF_INCLUDE_PARITYLOGGING=1 -# options RF_INCLUDE_CHAINDECLUSTER=1 -# options RF_INCLUDE_INTERDECLUSTER=1 -# options RF_INCLUDE_PARITY_DECLUSTERING=1 -# options RF_INCLUDE_PARITY_DECLUSTERING_DS=1 -pseudo-device fss # file system snapshot device -#pseudo-device ipfilter -pseudo-device loop -pseudo-device md -#options MEMORY_DISK_HOOKS -#options MEMORY_DISK_ROOT_SIZE= -pseudo-device ppp -pseudo-device pppoe # PPP over Ethernet (RFC 2516) -pseudo-device pty # pseudo-terminals -pseudo-device sl -pseudo-device vnd -#options VND_COMPRESSION # compressed vnd(4) -pseudo-device gre # generic L3 over IP tunnel -pseudo-device gif # IPv[46] over IPv[46] tunnel (RFC1933) -pseudo-device faith # IPv[46] tcp relay translation i/f -pseudo-device stf # 6to4 IPv6 over IPv4 encapsulation -pseudo-device vlan # IEEE 802.1q encapsulation -pseudo-device bridge # simple inter-network bridging -#options BRIDGE_IPF # bridge uses IP/IPv6 pfil hooks too -pseudo-device agr # IEEE 802.3ad link aggregation -pseudo-device sequencer # MIDI sequencer -pseudo-device wsmux # keyboard/mouse multiplexor -pseudo-device clockctl # user control of clock subsystem -pseudo-device ksyms # /dev/ksyms -#pseudo-device pf # PF packet filter -#pseudo-device pflog # PF log if -pseudo-device putter # for puffs and pud - -# Veriexec -# -# a pseudo device needed for veriexec -#pseudo-device veriexec -# -# Uncomment the fingerprint methods below that are desired. Note that -# removing fingerprint methods will have almost no impact on the kernel -# code size. -# -#options VERIFIED_EXEC_FP_SHA256 -#options VERIFIED_EXEC_FP_SHA384 -#options VERIFIED_EXEC_FP_SHA512 Index: sys/arch/acorn26/conf/INSTALL =================================================================== RCS file: sys/arch/acorn26/conf/INSTALL diff -N sys/arch/acorn26/conf/INSTALL --- sys/arch/acorn26/conf/INSTALL 29 Jul 2017 18:08:56 -0000 1.45 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,204 +0,0 @@ -# $NetBSD: INSTALL,v 1.45 2017/07/29 18:08:56 maxv Exp $ - -# INSTALL configuration, used to generate installation media - -include "arch/acorn26/conf/std.acorn26" - -maxusers 2 - -# CPU support -options CPU_ARM2 -options CPU_ARM250 -options CPU_ARM3 - -# Diagnostic/debugging support options -#options DIAGNOSTIC # Cheap kernel consistency checks -#options DEBUG # More expensive checks and printfs -#options DDB # kernel debugger -#options SYSCALL_DEBUG # trace syscall entry/exit -#options SCSIDEBUG -#options UVMHIST - -## Compile the kernel with debugging symbols (`netbsd.gdb' is the debug file), -## such that gdb(1) can be used on a kernel coredump. -#makeoptions DEBUG="-g" - -makeoptions COPTS="-Os -fno-inline" - -# File systems -file-system FFS # Fast file system -#file-system LFS # log-structured file system -file-system MFS # Memory-based file system -#file-system EXT2FS # second extended file system (linux) -file-system CD9660 # ISO-9660 CD-ROM FS (w/RockRidge extensions) -file-system FILECORE # Acorn filecore file system -#file-system ADOSFS # AmigaDOS-compatible file system -#file-system MSDOSFS # MS-DOS-compatible file system -#file-system NTFS # Windows/NT file system (experimental) -file-system NFS # Sun NFS-compatible file system client -#file-system NULLFS # loopback file system -#file-system OVERLAY # overlay filesystem -#file-system UMAPFS # NULLFS + uid and gid remapping -#file-system UNION # union file system -#file-system PROCFS # /proc -file-system KERNFS # /kern -#file-system FDESC # /dev/fd -file-system PTYFS # /dev/pts/N support - -# File system options -#options QUOTA # legacy UFS quotas -#options QUOTA2 # new, in-filesystem UFS quotas -#options NFSSERVER # Sun NFS-compatible file system server -options FFS_EI # FFS endianness-independence support -options WAPBL # File system journaling support -options NFS_V2_ONLY # Make a smaller NFS -options FFS_NO_SNAPSHOT # No FFS snapshot support - -# Executable format options -options EXEC_ELF32 -options EXEC_SCRIPT - -# Networking options -#options GATEWAY # packet forwarding -options INET # Internet protocol suite -options INET6 # IPV6 -#options IPSEC # IP security -#options IPSEC_DEBUG # debug for IP security -#options MROUTING # IP multicast routing -#options PIM # Protocol Independent Multicast -#options NETATALK # AppleTalk networking -#options PPP_BSDCOMP # BSD-Compress compression support for PPP -#options PPP_DEFLATE # Deflate compression support for PPP -#options PPP_FILTER # Active filter support for PPP (requires bpf) -#options TCP_DEBUG # Record last TCP_NDEBUG packets with SO_DEBUG - -#options COMPAT_43 # 4.3BSD compatibility. -options COMPAT_BSDPTY # /dev/[pt]ty?? ptys. - -# Binary compatibility with previous versions of NetBSD. -# None yet, since NetBSD/arm26 hasn't been released. - -# System V IPC -#options SYSVMSG # System V-like message queues -#options SYSVSEM # System V-like semaphores -#options SYSVSHM # System V-like shared memory - -# Miscellaneous kernel options -#options KTRACE # system call tracing, a la ktrace(1) -#options IRQSTATS # manage IRQ statistics -#options SCSIVERBOSE # Verbose SCSI errors -options BUFPAGES=2 -options USERCONF # userconf(4) support -options PIPE_SOCKETPAIR # smaller, but slower pipe(2) - -# Disable kernel security. -#options INSECURE - -# NFS boot options -#options NFS_BOOT_DHCP # superset of BOOTP -#options NFS_BOOT_BOOTPARAM -#options NFS_BOOT_RWSIZE=1024 # XXX "ea" driver bug workaround - -# RAM disk root options -# Enable the hooks used for initializing the root memory-disk. -options MEMORY_DISK_HOOKS -options MEMORY_DISK_IS_ROOT # force root on memory disk -options MEMORY_DISK_SERVER=0 # no userspace memory disk support -options MEMORY_DISK_ROOT_SIZE=4224 # size of memory disk, in blocks -options MEMORY_DISK_RBFLAGS=RB_SINGLE # boot in single-user mode - -# WS console uses DUMB, SUN or VT100 terminal emulation -options WSEMUL_NODUMB -options WSEMUL_SUN -#options WSEMUL_VT100 -options WSDISPLAY_DEFAULTSCREENS=1 -#options WSDISPLAY_COMPAT_USL # wsconscfg VT handling -options FONT_VT220L8x8 # 8x8 font for console -options RASOPS_SMALL - -config netbsd root on ? type ? -#config netbsd root on sd0 type ffs -#config netbsd root on ? type nfs - -cpu0 at root - -iobus0 at root # 16-bit I/O bus - -ioc0 at iobus0 base 0x200000 # I/O controller - -iociic0 at ioc0 # I^2C serial bus -iic0 at iociic0 - -pcfrtc0 at iic0 addr 0x50 # Real-time clock - -arckbd0 at ioc0 bank 0 offset 0x04 # System keyboard -wskbd0 at arckbd0 -#wsmouse0 at arckbd0 - -ioeb0 at ioc0 bank 5 # I/O Extension Block (A5000) -latches0 at ioc0 bank 5 # Printer/FDC control latches (Arc) - -podulebus0 at ioc0 bank 4 # Expansion card bus -#unixbp0 at ioc0 bank 6 # Unix Backplane (interrupt routing) - -ei* at podulebus0 slot ? # Acorn AKA25 (Ether1) -ea* at podulebus0 slot ? # Atomwide Ether3 -eh* at podulebus0 slot ? # i-cubed EtherH (E100/200/500) - -dtide* at podulebus0 slot ? # D.T. Software IDE interface -atabus* at dtide? channel ? # ATA bus - -hcide* at podulebus0 slot ? # HCCS IDE interface -atabus* at hcide? channel ? # ATA bus - -sec* at podulebus0 slot ? # Acorn SCSI interface -scsibus* at sec? - -hcsc* at podulebus0 slot ? # HCCS 8-bit SCSI interface -scsibus* at hcsc? - -oak* at podulebus0 slot ? # Oak Solutions 16-bit SCSI interface -scsibus* at oak? - -upc0 at iobus0 base 0x010000 # I/O chip on IOEB machines -#com0 at upc0 # Serial port -#lpt0 at upc0 # Parallel port -wdc0 at upc0 # IDE controller -atapibus* at atabus? # ATA bus - -wd* at atabus? drive ? # IDE hard discs -atapibus* at atabus? # ATAPI devices -cd* at atapibus? drive ? # ATAPI CD-ROM drives -#sd* at atapibus? drive ? # ATAPI disk drives -#uk* at atapibus? drive ? # ATAPI unknown - -sd* at scsibus? target ? lun ? # SCSI disk drives -#st* at scsibus? target ? lun ? # SCSI tape drives -cd* at scsibus? target ? lun ? # SCSI CD-ROM drives -#ch* at scsibus? target ? lun ? # SCSI auto-changers -#uk* at scsibus? target ? lun ? # SCSI unknown device -#ss* at scsibus? target ? lun ? # SCSI scanner - -arcvideo0 at root # On-board video -wsdisplay0 at arcvideo0 - -#pseudo-device bpfilter -#pseudo-device ccd -#pseudo-device raid # RAIDframe disk driver -#options RAID_AUTOCONFIG # auto-configuration of RAID components -#pseudo-device fss # file system snapshot device -#pseudo-device ipfilter -pseudo-device loop -pseudo-device md -#options MEMORY_DISK_HOOKS -#options MEMORY_DISK_ROOT_SIZE= -#pseudo-device ppp -pseudo-device pty -#pseudo-device sl -#pseudo-device vnd -#pseudo-device gre # generic L3 over IP tunnel -#pseudo-device gif # IPv[46] over IPv[46] tunnel (RFC1933) -#pseudo-device faith # IPv[46] tcp relay translation i/f -#pseudo-device sequencer # MIDI sequencer -pseudo-device wsmux # keyboard/mouse multiplexor - Index: sys/arch/acorn26/conf/Makefile.acorn26 =================================================================== RCS file: sys/arch/acorn26/conf/Makefile.acorn26 diff -N sys/arch/acorn26/conf/Makefile.acorn26 --- sys/arch/acorn26/conf/Makefile.acorn26 10 Mar 2013 07:18:19 -0000 1.12 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,114 +0,0 @@ -# $NetBSD: Makefile.acorn26,v 1.12 2013/03/10 07:18:19 christos Exp $ - -# Makefile for NetBSD -# -# This makefile is constructed from a machine description: -# config machineid -# Most changes should be made in the machine description -# /sys/arch/acorn26/conf/``machineid'' -# after which you should do -# config machineid -# Machine generic makefile changes should be made in -# /sys/arch/acorn26/conf/Makefile.i386 -# after which config should be rerun for all machines of that type. -# -# To specify debugging, add the config line: makeoptions DEBUG="-g" -# A better way is to specify -g only for a few files. -# -# makeoptions DEBUGLIST="uvm* trap if_*" - -USETOOLS?= no -NEED_OWN_INSTALL_TARGET?=no -.include - -## -## (1) port identification -## -ARM= $S/arch/arm -ACORN26= $S/arch/acorn26 -GENASSYM_CONF= ${ACORN26}/acorn26/genassym.cf - -## -## (2) compile settings -## -CPPFLAGS+= -Dacorn26 -CWARNFLAGS+= -Wcomment -# We'd like GCC to leave R14 alone as much as possible (so page faults in the -# kernel are safer). -CFLAGS+= -ffixed-r14 -mapcs-frame -fno-omit-frame-pointer -AFLAGS+= -x assembler-with-cpp - -## -## (3) libkern and compat -## -OPT_MODULAR= %MODULAR% -.if !empty(OPT_MODULAR) -KERN_AS= obj -.else -KERN_AS= library -.endif - -## -## (4) local objects, compile rules, and dependencies -## -MD_OBJS= vectors.o locore.o -MD_CFILES= -MD_SFILES= ${ARM}/arm/vectors.S ${ACORN26}/acorn26/locore.S - -locore.o: ${ACORN26}/acorn26/locore.S assym.h - ${NORMAL_S} - -vectors.o: ${ARM}/arm/vectors.S assym.h - ${NORMAL_S} - -bcopyinout.o copyinout.o copystr.o cpu_in_cksum.o fiq_subr.o: assym.h -sigcode.o: assym.h - -## -## (5) link settings -## -TEXTADDR?= 0x02098000 -LINKFORMAT= -N -# Strip ARM mapping symbols from the kernel image, as they interfere -# with ddb. Do it differently if 'makeoptions DEBUG="-g"' was specified. -.if !defined(DEBUG) || empty(DEBUG:M-g*) -SYSTEM_LD_TAIL?= @${OBJCOPY} --strip-symbol='$$a' \ - --strip-symbol='$$t' \ - --strip-symbol='$$d' $@ ;\ - ${SIZE} $@; chmod 755 $@ -.else -STRIPFLAGS=-g --strip-symbol='$$a' --strip-symbol='$$t' --strip-symbol='$$d' -.endif - -## -## (6) port specific target dependencies -## - -## -## (7) misc settings -## - -## -## (8) config(8) generated machinery -## -%INCLUDES - -%OBJS - -%CFILES - -%SFILES - -%LOAD - -%RULES - -## -## (9) port independent kernel machinery -## -.include "$S/conf/Makefile.kern.inc" - -## -## (10) Appending make options. -## -%MAKEOPTIONSAPPEND Index: sys/arch/acorn26/conf/TESTING =================================================================== RCS file: sys/arch/acorn26/conf/TESTING diff -N sys/arch/acorn26/conf/TESTING --- sys/arch/acorn26/conf/TESTING 18 Jan 2009 18:24:23 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,18 +0,0 @@ -# $NetBSD: TESTING,v 1.3 2009/01/18 18:24:23 bjh21 Exp $ -# -# Test kernel, with extra things turned on, including all consistency checks. - -include "arch/acorn26/conf/GENERIC" - -options ARM_LOCK_CAS_DEBUG -options DIAGNOSTIC -options DEBUG -options DDB_ONPANIC=2 # Stack trace on panic - -#fpu0 at cpu0 # Floating point unit (FPPC/FPA10) - -#ssn0 at ioc0 # Unique ID chip (Silicon Serial No) -eca0 at ioc0 bank 2 # Econet module -arcpp0 at ioc0 bank 5 # Parallel printer port (Arc) - -powerrom* at podulebus? slot ? Index: sys/arch/acorn26/conf/files.acorn26 =================================================================== RCS file: sys/arch/acorn26/conf/files.acorn26 diff -N sys/arch/acorn26/conf/files.acorn26 --- sys/arch/acorn26/conf/files.acorn26 11 Dec 2011 03:13:20 -0000 1.16 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,201 +0,0 @@ -# $NetBSD: files.acorn26,v 1.16 2011/12/11 03:13:20 kiyohara Exp $ - -# Copyright (c) 1997, 1998, 2000 Ben Harris -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not 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 file is part of NetBSD/acorn26 -- a port of NetBSD to ARM2/3 machines. - -maxpartitions 8 -maxusers 2 8 64 - -# Display current IPL in screen border -defflag FLASHYTHING - -include "dev/ata/files.ata" -include "dev/scsipi/files.scsipi" - -define fiq - -# CPU -#device cpu { } -attach cpu at root with cpu_root -file arch/acorn26/acorn26/cpu.c cpu - -# Floating-point unit -device fpu -attach fpu at cpu -defflag opt_fputypes.h FPU_FPPC FPU_FPA -file arch/acorn26/acorn26/fpu.c fpu needs-flag -file arch/acorn26/acorn26/fpu_asm.S fpu - -# I/O bus (on the far side of the address and data latches) -device iobus { base = -1 } -attach iobus at root -file arch/acorn26/iobus/iobus.c iobus - -# 82C710/1 on A5000 etc will be at iobus0 base 0x00010000 (and 0x00012000???) - -# I/O controller (Albion) (usually at iobus0 base 0x00200000) -device ioc { [bank = -1], [offset = 0] } -attach ioc at iobus -file arch/acorn26/iobus/ioc.c ioc needs-flag -file arch/acorn26/ioc/ioc_fiq_util.S fiq needs-flag - -# I^2C bus (bit-banged through IOC control register) -device iociic: i2cbus, i2c_bitbang -attach iociic at ioc -file arch/acorn26/ioc/iociic.c iociic - -# DS2401 Silicon Serial Number -device ssn -attach ssn at ioc -file arch/acorn26/ioc/ssn.c ssn - -# I/O Extension Block (usually at ioc0 bank 5) -device ioeb { [offset = -1] } -attach ioeb at ioc -file arch/acorn26/ioc/ioeb.c ioeb needs-flag - -# Latches (random internal use) (usually at ioc0 bank 5) -device latches -attach latches at ioc -file arch/acorn26/ioc/latches.c latches - -# On-board keyboard interface -device arckbd: wskbddev, wsmousedev -attach arckbd at ioc -file arch/acorn26/ioc/arckbd.c arckbd needs-flag -file arch/acorn26/ioc/arckbdmap.c arckbd - -# On-board WD 1772 floppy controller (usually at bank 1 irq 12 fiq 0/1) -# Not to be confused with fdc, which will be the PC-style one on A5k etc. -device wfdc {drive = -1} -attach wfdc at ioc -device wf: disk -attach wf at wfdc -# Steal code from arch/atari/dev/fd{.c,reg.h} - -# Econet module (Motorola 6854) (usually at bank 2 fiq 2) -device eca: fiq, eco, arp, ifnet -attach eca at ioc -file arch/acorn26/ioc/if_eca.c eca needs-flag -file arch/acorn26/ioc/if_eca_fiq.S eca - -# On-board Rockwell 6551 serial (usually at bank 3 irq 10/1) -device rs: tty -attach rs at ioc -file arch/acorn26/acorn26/rscons.c rs needs-flag - -# On-board printer port (usually at bank 5 addr 0x10 irq 0/2) -device arcpp -attach arcpp at ioc -file arch/acorn26/ioc/arcpp.c arcpp needs-flag - - -# Podule interface (podules listed later) (usually at bank 4 irq 13 fiq 6) -# Unix backplanes also use bank 6 -# MEMC podules also use the iobus directly -device unixbp -attach unixbp at ioc - -# NB: files.podulebus must come after unixbp is defined, to get the -# attachments in the right order. -include "dev/podulebus/files.podulebus" -attach podulebus at ioc -file arch/acorn26/podulebus/podulebus.c podulebus -file arch/acorn26/podulebus/podloader_asm.S podloader needs-flag -file arch/acorn26/podulebus/unixbp.c unixbp needs-flag - -# Acorn ST506 interface (usually at bank 5 irq 11, or sometimes on a podule) -device hdc { drive = -1 } -attach hdc at ioc with hdc_ioc -attach hdc at podulebus with hdc_podulebus -device hd: disk -attach hd at hdc - -# VIDC/MEMC audio/video subsystems. -device arcvideo: rasops1, rasops2, rasops4, rasops8, wsemuldisplaydev -attach arcvideo at root -file arch/acorn26/vidc/arcvideo.c arcvideo needs-flag - -device arcaudio: audiobus -attach arcaudio at root - -### -# 82C7xx Universal Peripheral Controller -# - -# This section belongs here -attach upc at iobus with upc_iobus -file arch/acorn26/iobus/upc_iobus.c upc_iobus - -### -# Assorted podules -# - -# i-cubed EtherLAN 100, 200 and 500 -device eh: ether, ifnet, arp, dp8390nic, podloader -attach eh at podulebus -file arch/acorn26/podulebus/if_eh.c eh - -# PowerROM test driver -device powerrom: podloader -attach powerrom at podulebus -file arch/acorn26/podulebus/powerrom.c powerrom - -# Memory disk for installation (or ROM versions?) -file dev/md_root.c memory_disk_hooks - -#### -# Other files -# - -#file dev/cons.c -file dev/cninit.c - -file arch/acorn26/acorn26/db_interface.c ddb -file arch/acorn26/acorn26/db_machdep.c ddb - -file arch/acorn26/acorn26/start.c -file arch/acorn26/acorn26/autoconf.c -file arch/acorn26/acorn26/bus.c -file arch/acorn26/acorn26/bus_asm.S -file arch/acorn26/acorn26/conf.c -file arch/acorn26/acorn26/cons_machdep.c -file arch/acorn26/acorn26/cpuswitch.c -file arch/acorn26/acorn26/except.c -file arch/acorn26/acorn26/irq.c -file arch/acorn26/acorn26/machdep.c -file arch/acorn26/acorn26/pmap.c -#file arch/acorn26/acorn26/rscons.c -file arch/acorn26/acorn26/stubs.c -file arch/acorn26/acorn26/sys_machdep.c -file arch/acorn26/acorn26/vm_machdep.c - -file arch/arm/arm/disksubr.c disk -file arch/arm/arm/disksubr_acorn.c disk -file arch/arm/arm/disksubr_mbr.c disk - -include "arch/acorn26/conf/majors.acorn26" Index: sys/arch/acorn26/conf/majors.acorn26 =================================================================== RCS file: sys/arch/acorn26/conf/majors.acorn26 diff -N sys/arch/acorn26/conf/majors.acorn26 --- sys/arch/acorn26/conf/majors.acorn26 30 Jun 2011 20:09:16 -0000 1.21 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,42 +0,0 @@ -# $NetBSD: majors.acorn26,v 1.21 2011/06/30 20:09:16 wiz Exp $ -# -# Device majors for acorn26 -# - -device-major cons char 0 -device-major ctty char 1 -device-major mem char 2 -device-major swap char 3 block 0 vmswap -device-major pts char 4 pty -device-major ptc char 5 pty -device-major log char 6 -device-major filedesc char 7 -device-major md char 8 block 1 md -device-major vnd char 9 block 2 vnd -device-major ccd char 10 block 3 ccd -device-major wskbd char 11 wskbd -device-major wsmouse char 12 wsmouse -device-major wsmux char 13 wsmux -device-major wsdisplay char 14 wsdisplay -device-major wd char 15 block 4 wd -device-major sd char 16 block 5 sd -device-major cd char 17 block 6 cd -device-major bpf char 18 bpfilter -device-major tun char 19 tun -device-major com char 20 com -device-major lpt char 21 lpt -device-major arcpp char 22 arcpp -device-major ipl char 23 ipfilter -device-major rnd char 24 rnd -device-major vcoda char 25 vcoda -device-major raid char 26 block 7 raid -device-major clockctl char 27 clockctl -device-major cgd char 29 block 8 cgd -device-major ksyms char 30 ksyms -device-major wsfont char 32 wsfont - -device-major nsmb char 98 nsmb - -# Majors up to 143 are reserved for machine-dependent drivers. -# New machine-independent driver majors are assigned in -# sys/conf/majors. Index: sys/arch/acorn26/conf/std.acorn26 =================================================================== RCS file: sys/arch/acorn26/conf/std.acorn26 diff -N sys/arch/acorn26/conf/std.acorn26 --- sys/arch/acorn26/conf/std.acorn26 27 Jan 2008 12:37:11 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,8 +0,0 @@ -# $NetBSD: std.acorn26,v 1.4 2008/01/27 12:37:11 chris Exp $ - -# Standard NetBSD/acorn26 options - -machine acorn26 arm -include "conf/std" # MI standard options -include "arch/arm/conf/std.arm" # arch standard options - Index: sys/arch/acorn26/include/Makefile =================================================================== RCS file: sys/arch/acorn26/include/Makefile diff -N sys/arch/acorn26/include/Makefile --- sys/arch/acorn26/include/Makefile 2 May 2013 03:56:40 -0000 1.13 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,6 +0,0 @@ -# $NetBSD: Makefile,v 1.13 2013/05/02 03:56:40 matt Exp $ - -INCSDIR= /usr/include/acorn26 -INCS= vmparam.h - -.include "../../arm/include/Makefile.common" Index: sys/arch/acorn26/include/ansi.h =================================================================== RCS file: sys/arch/acorn26/include/ansi.h diff -N sys/arch/acorn26/include/ansi.h --- sys/arch/acorn26/include/ansi.h 24 Mar 2002 15:46:52 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: ansi.h,v 1.1 2002/03/24 15:46:52 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/aout_machdep.h =================================================================== RCS file: sys/arch/acorn26/include/aout_machdep.h diff -N sys/arch/acorn26/include/aout_machdep.h --- sys/arch/acorn26/include/aout_machdep.h 24 Mar 2002 15:46:52 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: aout_machdep.h,v 1.1 2002/03/24 15:46:52 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/asm.h =================================================================== RCS file: sys/arch/acorn26/include/asm.h diff -N sys/arch/acorn26/include/asm.h --- sys/arch/acorn26/include/asm.h 24 Mar 2002 15:46:53 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: asm.h,v 1.1 2002/03/24 15:46:53 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/boot.h =================================================================== RCS file: sys/arch/acorn26/include/boot.h diff -N sys/arch/acorn26/include/boot.h --- sys/arch/acorn26/include/boot.h 11 May 2012 15:39:17 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,84 +0,0 @@ -/* $NetBSD: boot.h,v 1.4 2012/05/11 15:39:17 skrll Exp $ */ -/*- - * Copyright (c) 1998 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * boot.h -- Stuff to do with starting the kernel - */ - -#ifndef _ARM26_BOOT_H -#define _ARM26_BOOT_H - -#include - -/* - * Bootloader contract 0.2: - * + APCS conformant entry. - * + SVC mode. - * + Interrupts (IRQ and FIQ) disabled on CPU. - * + CPU caches disabled. - * + Physical memory below 512k is unused except for screen. - * + First three 32k blocks above 512k are zero page, stack and msgbuf. - * + From there to freebase should be preserved unless you know better. - * + From freebase to top of RAM is for general use. - * + VIDC is set up as specified (not really bootloader's job). - */ - -#define BOOT_MAGIC 0x942B7DFE - -struct bootconfig { - uint32_t magic; /* BOOT_MAGIC */ - uint32_t version; /* minor version of structure */ - /* Standard NetBSD boot parameters */ - uint32_t boothowto; /* Reboot flags (single-user etc) */ - uint32_t bootdev; /* Boot device */ - uint32_t ssym; /* Start of debugging symbols */ - uint32_t esym; /* End of debugging symbols */ - /* Parameters gathered by OS_ReadMemMapInfo */ - uint32_t nbpp; /* Machine page size in bytes */ - uint32_t npages; /* Number of pages */ - /* Layout of physical memory. */ - uint32_t txtbase; /* Kernel text base */ - uint32_t txtsize; /* ... and size */ - uint32_t database; /* Ditto for data */ - uint32_t datasize; /* and bss */ - uint32_t bssbase; /* Note that base addresses are */ - uint32_t bsssize; /* "physical" ie bytes above 0x02000000 */ - uint32_t freebase; /* Start of free space */ - /* Framebuffer state -- used to initialise raster console */ - uint32_t xpixels; /* Pixels across screen (XWindLimit + 1) */ - uint32_t ypixels; /* Pixels down screen (YWindLimit + 1) */ - uint32_t bpp; /* Bits per pixel (1 << Log2BPP) */ - uint32_t screenbase; /* Physical base of screen */ - uint32_t screensize; /* Size of framebuffer (TotalScreenSize) */ - uint32_t cpixelrow; /* first free pixel row on screen */ - /* Version 0 ends here */ -}; - -#ifdef _KERNEL -extern struct bootconfig bootconfig; -#endif -#endif Index: sys/arch/acorn26/include/bootconfig.h =================================================================== RCS file: sys/arch/acorn26/include/bootconfig.h diff -N sys/arch/acorn26/include/bootconfig.h --- sys/arch/acorn26/include/bootconfig.h 24 Mar 2002 15:46:53 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: bootconfig.h,v 1.1 2002/03/24 15:46:53 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/bswap.h =================================================================== RCS file: sys/arch/acorn26/include/bswap.h diff -N sys/arch/acorn26/include/bswap.h --- sys/arch/acorn26/include/bswap.h 24 Mar 2002 15:46:54 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: bswap.h,v 1.1 2002/03/24 15:46:54 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/bus_defs.h =================================================================== RCS file: sys/arch/acorn26/include/bus_defs.h diff -N sys/arch/acorn26/include/bus_defs.h --- sys/arch/acorn26/include/bus_defs.h 19 Jul 2011 16:05:10 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,10 +0,0 @@ -/* $NetBSD: bus_defs.h,v 1.1 2011/07/19 16:05:10 dyoung Exp $ */ - -#ifndef _ACORN26_BUS_DEFS_H_ -#define _ACORN26_BUS_DEFS_H_ - -#include - -extern struct bus_space iobus_bs_tag; - -#endif /* _ACORN26_BUS_DEFS_H_ */ Index: sys/arch/acorn26/include/bus_funcs.h =================================================================== RCS file: sys/arch/acorn26/include/bus_funcs.h diff -N sys/arch/acorn26/include/bus_funcs.h --- sys/arch/acorn26/include/bus_funcs.h 19 Jul 2011 16:05:10 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,10 +0,0 @@ -/* $NetBSD: bus_funcs.h,v 1.1 2011/07/19 16:05:10 dyoung Exp $ */ - -#ifndef _ACORN26_BUS_FUNCS_H_ -#define _ACORN26_BUS_FUNCS_H_ - -#include - -int bus_space_shift(bus_space_tag_t, int, bus_space_tag_t *); - -#endif /* _ACORN26_BUS_FUNCS_H_ */ Index: sys/arch/acorn26/include/cdefs.h =================================================================== RCS file: sys/arch/acorn26/include/cdefs.h diff -N sys/arch/acorn26/include/cdefs.h --- sys/arch/acorn26/include/cdefs.h 24 Mar 2002 15:46:55 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: cdefs.h,v 1.1 2002/03/24 15:46:55 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/cpu.h =================================================================== RCS file: sys/arch/acorn26/include/cpu.h diff -N sys/arch/acorn26/include/cpu.h --- sys/arch/acorn26/include/cpu.h 24 Mar 2002 15:46:55 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: cpu.h,v 1.1 2002/03/24 15:46:55 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/db_machdep.h =================================================================== RCS file: sys/arch/acorn26/include/db_machdep.h diff -N sys/arch/acorn26/include/db_machdep.h --- sys/arch/acorn26/include/db_machdep.h 6 Nov 2017 03:47:45 -0000 1.10 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -/* $NetBSD: db_machdep.h,v 1.10 2017/11/06 03:47:45 christos Exp $ */ - -#include - -/* acorn26 uses ELF */ -#define DB_ELF_SYMBOLS - -void db_show_frame_cmd(db_expr_t, bool, db_expr_t, const char *); -void db_bus_write_cmd(db_expr_t, bool, db_expr_t, const char *); -void db_irqstat_cmd(db_expr_t, bool, db_expr_t, const char *); - -extern volatile bool db_validating, db_faulted; Index: sys/arch/acorn26/include/disklabel.h =================================================================== RCS file: sys/arch/acorn26/include/disklabel.h diff -N sys/arch/acorn26/include/disklabel.h --- sys/arch/acorn26/include/disklabel.h 7 May 2013 20:42:45 -0000 1.5 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,7 +0,0 @@ -/* $NetBSD: disklabel.h,v 1.5 2013/05/07 20:42:45 matt Exp $ */ - -#if HAVE_NBTOOL_CONFIG_H -#include -#else -#include -#endif /* HAVE_NBTOOL_CONFIG_H */ Index: sys/arch/acorn26/include/elf_machdep.h =================================================================== RCS file: sys/arch/acorn26/include/elf_machdep.h diff -N sys/arch/acorn26/include/elf_machdep.h --- sys/arch/acorn26/include/elf_machdep.h 24 Mar 2002 15:46:56 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: elf_machdep.h,v 1.1 2002/03/24 15:46:56 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/endian.h =================================================================== RCS file: sys/arch/acorn26/include/endian.h diff -N sys/arch/acorn26/include/endian.h --- sys/arch/acorn26/include/endian.h 24 Mar 2002 15:46:56 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: endian.h,v 1.1 2002/03/24 15:46:56 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/endian_machdep.h =================================================================== RCS file: sys/arch/acorn26/include/endian_machdep.h diff -N sys/arch/acorn26/include/endian_machdep.h --- sys/arch/acorn26/include/endian_machdep.h 24 Mar 2002 15:46:57 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: endian_machdep.h,v 1.1 2002/03/24 15:46:57 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/fiq.h =================================================================== RCS file: sys/arch/acorn26/include/fiq.h diff -N sys/arch/acorn26/include/fiq.h --- sys/arch/acorn26/include/fiq.h 24 Mar 2002 15:46:57 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,50 +0,0 @@ -/* $NetBSD: fiq.h,v 1.1 2002/03/24 15:46:57 bjh21 Exp $ */ - -/*- - * Copyright (c) 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#ifndef _ACORN26_FIQ_H_ -#define _ACORN26_FIQ_H_ -#include - -/* - * These definitions specify how the devices are wired to the IOC - * interrupt lines. - */ -/* All systems */ -#define FIQ_EFIQ IOC_FIQ_FL /* Econet interrupt request */ -#define FIQ_PFIQ IOC_FIQ_IL0 /* Podule FIQ request */ -/* Archimedes systems */ -#define FIQ_FFDQ IOC_FIQ_FH0 /* Floppy disc data request */ -#define FIQ_FFIQ IOC_FIQ_FH1 /* Floppy disc interrupt request */ -/* IOEB systems */ -#define FIQ_FDDRQ IOC_FIQ_FH0 /* Floppy disc data request */ -#define FIQ_SINTR IOC_FIQ_C4 /* Serial line interrupt */ - -extern void (*fiq_downgrade_handler)(void); - -#endif Index: sys/arch/acorn26/include/float.h =================================================================== RCS file: sys/arch/acorn26/include/float.h diff -N sys/arch/acorn26/include/float.h --- sys/arch/acorn26/include/float.h 24 Mar 2002 15:46:57 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: float.h,v 1.1 2002/03/24 15:46:57 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/fpureg.h =================================================================== RCS file: sys/arch/acorn26/include/fpureg.h diff -N sys/arch/acorn26/include/fpureg.h --- sys/arch/acorn26/include/fpureg.h 24 Mar 2002 15:46:58 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,61 +0,0 @@ -/* $NetBSD: fpureg.h,v 1.1 2002/03/24 15:46:58 bjh21 Exp $ */ - -/* - * ARM FPU definitions - */ - -/* System ID byte */ -#define FPSR_SYSID_MASK 0xff000000 -#define FPSR_SYSID_FPPC 0x80000000 -#define FPSR_SYSID_FPA 0x81000000 - -/* Trap enable bits */ -#define FPSR_TE_IVO 0x00010000 /* InValid Operation */ -#define FPSR_TE_DVZ 0x00020000 /* DiVision by Zero */ -#define FPSR_TE_OFL 0x00040000 /* OverFLow */ -#define FPSR_TE_UFL 0x00080000 /* UnderFLow */ -#define FPSR_TE_INX 0x00100000 /* INeXact */ - -/* System control byte (FPA only) */ -#define FPSR_CTL_ND 0x00000100 /* No Denormalised numbers */ -#define FPSR_CTL_NE 0x00000200 /* NaN Exception */ -#define FPSR_CTL_SO 0x00000400 /* Synchronous Operation */ -#define FPSR_CTL_EP 0x00000800 /* Expanded Packed decimal */ -#define FPSR_CTL_AC 0x00001000 /* Alternative C flag */ - -/* Cumulative exception bits */ -#define FPSR_EX_IVO 0x00000001 /* InValid Operation */ -#define FPSR_EX_DVZ 0x00000002 /* DiVision by Zero */ -#define FPSR_EX_OFL 0x00000004 /* OverFLow */ -#define FPSR_EX_UFL 0x00000008 /* UnderFLow */ -#define FPSR_EX_INX 0x00000010 /* INeXact */ - -/* - * FPPC FPCR - */ -#define FPPC_FPCR_DA 0x00000001 /* Disable */ -#define FPPC_FPCR_EX 0x00000002 /* FP exception occurred */ -#define FPPC_FPCR_AS 0x00000004 /* Last exception was async */ -#define FPPC_FPCR_SBM 0x00000010 /* Use supervisor bank 'm' */ -#define FPPC_FPCR_SBN 0x00000020 /* Use supervisor bank 'n' */ -#define FPPC_FPCR_SBD 0x00000040 /* Use supervisor bank 'd' */ -#define FPPC_FPCR_PR 0x00000080 /* Last RMF gave partial remainder */ - -/* - * FPA FPCR - * This is provisional, from the RISC OS 3 PRM - */ -#define FPA_FPCR_S2 0x0000000f /* AU source register 2 */ -#define FPA_FPCR_OP 0x00f08010 /* AU operation code */ -#define FPA_FPCR_RM 0x00000060 /* AU rounding mode */ -#define FPA_FPCR_PR 0x00080080 /* AU precision */ -#define FPA_FPCR_EN 0x00000100 /* Enable FPA */ -#define FPA_FPCR_RE 0x00000200 /* Rounding exception */ -#define FPA_FPCR_AB 0x00000400 /* Asynchronous bounce */ -#define FPA_FPCR_SB 0x00000800 /* Synchronous bounce */ -#define FPA_FPCR_DS 0x00007000 /* AU destination register */ -#define FPA_FPCR_S1 0x00070000 /* AU source register 1 */ -#define FPA_FPCR_EO 0x04000000 /* Exponent overflow */ -#define FPA_FPCR_MO 0x08000000 /* Mantissa overflow */ -#define FPA_FPCR_IE 0x10000000 /* Inexact bit */ -#define FPA_FPCR_RU 0x80000000 /* Rounded up bit */ Index: sys/arch/acorn26/include/frame.h =================================================================== RCS file: sys/arch/acorn26/include/frame.h diff -N sys/arch/acorn26/include/frame.h --- sys/arch/acorn26/include/frame.h 25 Jan 2008 21:23:50 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,115 +0,0 @@ -/* $NetBSD: frame.h,v 1.4 2008/01/25 21:23:50 chris Exp $ */ - -/* - * Copyright (c) 1999 Ben Harris. - * Copyright (c) 1994-1997 Mark Brinicombe. - * Copyright (c) 1994 Brini. - * All rights reserved. - * - * This code is derived from software written for Brini by Mark Brinicombe - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * 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 Brini. - * 4. The name of the company nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY BRINI ``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 BRINI 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. - */ -/* - * frame.h - Stack frames structures - */ - -#ifndef _ARM26_FRAME_H_ -#define _ARM26_FRAME_H_ - -#include - -#ifndef _LOCORE - -#include - -/* - * System stack frames. - */ - -/* - * irqframes just contain registers that APCS specifies the callee - * need not preserve. - */ -typedef struct irqframe { - union { - struct { - register_t if_r0; - register_t if_r1; - register_t if_r2; - register_t if_r3; - register_t if_r12; - register_t if_r14; - } svc; - struct { - register_t if_r0; - register_t if_r1; - register_t if_r2; - register_t if_r3; - register_t if_r11; - register_t if_r12; - } usr; - } if_mode; - register_t if_r15; /* Must be fixed so we know which branch to use */ -} irqframe_t; - -struct clockframe { - struct irqframe cf_if; -}; - -/* - * Switch frame - */ - -struct switchframe { - register_t sf_r4; /* Callee-saved registers */ - register_t sf_r5; - register_t sf_r6; - register_t sf_r7; - register_t sf_r8; - register_t sf_r9; - register_t sf_r10; - register_t sf_r11; /* Frame pointer */ - register_t sf_r13; /* Stack pointer */ - register_t sf_pc; /* Return address */ -}; - -/* - * Floating-point frame. Stores the state of the FPU. - */ - -struct fpframe { - register_t ff_fpsr; - register_t ff_regs[8*3]; -}; - -#endif /* _LOCORE */ - -#endif /* _ARM26_FRAME_H_ */ - -/* End of frame.h */ Index: sys/arch/acorn26/include/ieee.h =================================================================== RCS file: sys/arch/acorn26/include/ieee.h diff -N sys/arch/acorn26/include/ieee.h --- sys/arch/acorn26/include/ieee.h 24 Mar 2002 15:46:59 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: ieee.h,v 1.1 2002/03/24 15:46:59 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/ieeefp.h =================================================================== RCS file: sys/arch/acorn26/include/ieeefp.h diff -N sys/arch/acorn26/include/ieeefp.h --- sys/arch/acorn26/include/ieeefp.h 24 Mar 2002 15:46:59 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: ieeefp.h,v 1.1 2002/03/24 15:46:59 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/int_const.h =================================================================== RCS file: sys/arch/acorn26/include/int_const.h diff -N sys/arch/acorn26/include/int_const.h --- sys/arch/acorn26/include/int_const.h 24 Mar 2002 15:47:00 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: int_const.h,v 1.1 2002/03/24 15:47:00 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/int_fmtio.h =================================================================== RCS file: sys/arch/acorn26/include/int_fmtio.h diff -N sys/arch/acorn26/include/int_fmtio.h --- sys/arch/acorn26/include/int_fmtio.h 24 Mar 2002 15:47:00 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: int_fmtio.h,v 1.1 2002/03/24 15:47:00 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/int_limits.h =================================================================== RCS file: sys/arch/acorn26/include/int_limits.h diff -N sys/arch/acorn26/include/int_limits.h --- sys/arch/acorn26/include/int_limits.h 24 Mar 2002 15:47:00 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: int_limits.h,v 1.1 2002/03/24 15:47:00 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/int_mwgwtypes.h =================================================================== RCS file: sys/arch/acorn26/include/int_mwgwtypes.h diff -N sys/arch/acorn26/include/int_mwgwtypes.h --- sys/arch/acorn26/include/int_mwgwtypes.h 24 Mar 2002 15:47:01 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: int_mwgwtypes.h,v 1.1 2002/03/24 15:47:01 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/int_types.h =================================================================== RCS file: sys/arch/acorn26/include/int_types.h diff -N sys/arch/acorn26/include/int_types.h --- sys/arch/acorn26/include/int_types.h 24 Mar 2002 15:47:01 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: int_types.h,v 1.1 2002/03/24 15:47:01 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/intr.h =================================================================== RCS file: sys/arch/acorn26/include/intr.h diff -N sys/arch/acorn26/include/intr.h --- sys/arch/acorn26/include/intr.h 3 Dec 2007 15:33:02 -0000 1.12 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,103 +0,0 @@ -/* $NetBSD: intr.h,v 1.12 2007/12/03 15:33:02 ad Exp $ */ -/*- - * Copyright (c) 1998, 2000 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * intr.h - Interrupt stuff for the consumption of MI code. - * - * arm26-specific functions are in irq.h - */ - -#ifndef _ARM26_INTR_H_ -#define _ARM26_INTR_H_ - -/* - * These are the different SPL states - * - * Each state has an interrupt mask associated with it which - * indicate which interrupts are allowed. - */ - -#define IPL_NONE 0 -#define IPL_SOFTCLOCK 1 -#define IPL_SOFTNET 2 -#define IPL_SOFTBIO IPL_SOFTNET -#define IPL_SOFTSERIAL IPL_SOFTNET -#define IPL_VM 3 -#define IPL_SCHED 4 -#define IPL_HIGH 4 -#define NIPL IPL_HIGH + 1 - -#if defined(_KERNEL) && !defined(_LOCORE) - -#define splsoftnet() raisespl(IPL_SOFTNET) -#define splsoftbio() splsoftnet() -#define splsoftserial() splsoftnet() -#define splsoftclock() raisespl(IPL_SOFTCLOCK) -#define splvm() raisespl(IPL_VM) -#define splsched() splhigh() - -#define spl0() lowerspl(IPL_NONE) -#define splx(s) lowerspl(s) - -extern int splhigh(void); -extern int raisespl(int); -extern void lowerspl(int); -extern int hardsplx(int); - -typedef uint8_t ipl_t; -typedef struct { - ipl_t _ipl; -} ipl_cookie_t; - -static inline ipl_cookie_t -makeiplcookie(ipl_t ipl) -{ - - return (ipl_cookie_t){._ipl = ipl}; -} - -static inline int -splraiseipl(ipl_cookie_t icookie) -{ - ipl_t newipl = icookie._ipl; - - return ((newipl) == IPL_HIGH) ? splhigh() : raisespl(newipl); -} - -/* - * Interrupt sharing types - * (not currently used on arm26) - */ - -#define IST_UNUSABLE -1 /* interrupt cannot be used */ -#define IST_NONE 0 /* none (dummy) */ -#define IST_PULSE 1 /* pulsed */ -#define IST_EDGE 2 /* edge-triggered */ -#define IST_LEVEL 3 /* level-triggered */ - -#endif /* _KERNEL && !ASSEMBLER */ -#endif Index: sys/arch/acorn26/include/irq.h =================================================================== RCS file: sys/arch/acorn26/include/irq.h diff -N sys/arch/acorn26/include/irq.h --- sys/arch/acorn26/include/irq.h 24 Mar 2002 23:37:43 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,78 +0,0 @@ -/* $NetBSD: irq.h,v 1.2 2002/03/24 23:37:43 bjh21 Exp $ */ -/*- - * Copyright (c) 2000 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#ifndef _ARM26_IRQ_H -#define _ARM26_IRQ_H -#include - -/* return values from interrupt handlers */ -/* These are the same as arm32 uses */ -#define IRQ_HANDLED 1 -#define IRQ_NOT_HANDLED 0 -#define IRQ_MAYBE_HANDLED -1 - -/* - * These definitions specify how the devices are wired to the IOC - * interrupt lines. - */ -/* All systems */ -#define IRQ_PFIQ IOC_IRQ_IL0 /* Podule FIQ request */ -#define IRQ_SIRQ IOC_IRQ_IL1 /* Sound buffer pointer used */ -#define IRQ_PIRQ IOC_IRQ_IL5 /* Podule IRQ request */ -#define IRQ_VFLYBK IOC_IRQ_IR /* Start of display vertical flyback */ -/* Archimedes systems */ -#define IRQ_SLCI IOC_IRQ_IL2 /* Serial line controller interrupt */ -#define IRQ_WIRQ IOC_IRQ_IL3 /* Winchester interrupt request */ -#define IRQ_DCIRQ IOC_IRQ_IL4 /* Disc change interrupt request */ -#define IRQ_PBSY IOC_IRQ_IL6 /* Printer Busy Input */ -#define IRQ_RII IOC_IRQ_IL7 /* Serial line ring indicator input */ -#define IRQ_PACK IOC_IRQ_IF /* Printer acknowledge input */ -/* IOEB systems */ -#define IRQ_SINTR IOC_IRQ_IL2 /* Serial line interrupt */ -#define IRQ_IDEINTR IOC_IRQ_IL3 /* IDE interrupt */ -#define IRQ_FINTR IOC_IRQ_IL4 /* Floppy disc interrupt */ -#define IRQ_LPINTR IOC_IRQ_IL6 /* Parallel port latched interrupt */ -#define IRQ_INDEX IOC_IRQ_IF /* Start of floppy disc index pulse */ - -/* IRQ numbers above 15 are non-IOC IRQs */ -#define IRQ_UNIXBP_BASE 16 - -struct irq_handler; -struct evcnt; - -extern void irq_init(void); -/* irq_handler is declared in machdep.h */ -/* splx, raisespl and lowerspl are declared in intr.h */ -extern struct irq_handler *irq_establish(int, int, int(*)(void *), void *, - struct evcnt *); -extern char const *irq_string(struct irq_handler *); -extern void irq_enable(struct irq_handler *); -extern void irq_disable(struct irq_handler *); -extern void irq_genmasks(void); -extern void irq_stat(void (*)(const char *, ...)); -#endif Index: sys/arch/acorn26/include/limits.h =================================================================== RCS file: sys/arch/acorn26/include/limits.h diff -N sys/arch/acorn26/include/limits.h --- sys/arch/acorn26/include/limits.h 24 Mar 2002 15:47:04 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: limits.h,v 1.1 2002/03/24 15:47:04 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/loadfile_machdep.h =================================================================== RCS file: sys/arch/acorn26/include/loadfile_machdep.h diff -N sys/arch/acorn26/include/loadfile_machdep.h --- sys/arch/acorn26/include/loadfile_machdep.h 6 Aug 2014 21:57:48 -0000 1.5 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,82 +0,0 @@ -/* $NetBSD: loadfile_machdep.h,v 1.5 2014/08/06 21:57:48 joerg Exp $ */ - -/*- - * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Christos Zoulas and Jason R. Thorpe. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 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. - */ - -#ifndef _ARM26_LOADFILE_MACHDEP_H_ -#define _ARM26_LOADFILE_MACHDEP_H_ - -#define BOOT_ELF32 - -#define LOAD_KERNEL (LOAD_ALL & ~LOAD_TEXTA) -#define COUNT_KERNEL (COUNT_ALL & ~COUNT_TEXTA) - -#ifdef _STANDALONE - -#define LOADADDR(a) (((u_long)(a)) + offset) -/* ALIGNENTRY is only for a.out. */ -#define READ(f, b, c) boot26_read((f), (void *)LOADADDR(b), (c)) -#define BCOPY(s, d, c) boot26_memcpy((void *)LOADADDR(d), (s), (c)) -#define BZERO(d, c) boot26_memset((void *)LOADADDR(d), 0, (c)) -#define WARN(a) do { \ - (void)printf a; \ - if (errno) \ - (void)printf(": %s\n", \ - strerror(errno)); \ - else \ - (void)printf("\n"); \ - } while(/* CONSTCOND */0) -#define PROGRESS(a) (void) printf a -#define ALLOC(a) alloc(a) -#define DEALLOC(a, b) dealloc(a, b) -/* OKMAGIC is only for a.out. */ - -extern ssize_t boot26_read(int, void *, size_t); -extern void *boot26_memcpy(void *, const void *, size_t); -extern void *boot26_memset(void *, int, size_t); - -#else - -#define LOADADDR(a) (((u_long)(a)) + offset) -#define ALIGNENTRY(a) ((u_long)(a)) -#define READ(f, b, c) read((f), (void *)LOADADDR(b), (c)) -#define BCOPY(s, d, c) memcpy((void *)LOADADDR(d), (void *)(s), (c)) -#define BZERO(d, c) memset((void *)LOADADDR(d), 0, (c)) -#define WARN(a) warn a -#define PROGRESS(a) /* nothing */ -#define ALLOC(a) malloc(a) -#define DEALLOC(a, b) free(a) -#define OKMAGIC(a) ((a) == OMAGIC) - -ssize_t vread(int, u_long, u_long *, size_t); -void vcopy(u_long, u_long, u_long *, size_t); -void vzero(u_long, u_long *, size_t); - -#endif -#endif Index: sys/arch/acorn26/include/lock.h =================================================================== RCS file: sys/arch/acorn26/include/lock.h diff -N sys/arch/acorn26/include/lock.h --- sys/arch/acorn26/include/lock.h 24 Mar 2002 15:47:05 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: lock.h,v 1.1 2002/03/24 15:47:05 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/machdep.h =================================================================== RCS file: sys/arch/acorn26/include/machdep.h diff -N sys/arch/acorn26/include/machdep.h --- sys/arch/acorn26/include/machdep.h 14 Jan 2009 23:14:48 -0000 1.7 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,65 +0,0 @@ -/* $NetBSD: machdep.h,v 1.7 2009/01/14 23:14:48 bjh21 Exp $ */ -/*- - * Copyright (c) 1998 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * machdep.h - random exported functions that have to be declared somewhere. - */ - -#ifndef _ARM26_MACHDEP_H -#define _ARM26_MACHDEP_H - -struct bootconfig; - -/* start.c */ -extern void start(struct bootconfig *initbootconfig); - -/* except.c */ -extern void undefined_handler(struct trapframe *); -extern void swi_handler(struct trapframe *); -extern void data_abort_handler(struct trapframe *); -extern void prefetch_abort_handler(struct trapframe *); -extern void address_exception_handler(struct trapframe *); - -/* irq.c */ -extern void irq_handler(struct irqframe *irqf); - -/* locore.S */ -extern void int_on(void); -extern void int_off(void); -extern void fiq_on(void); -extern void fiq_off(void); -extern struct lwp *cpu_loswitch(struct lwp *, struct lwp *); -extern void lwp_trampoline(void); /* not quite true */ - -/* pmap.c */ -extern register_t update_memc(register_t, register_t); - -/* rtc.c */ -extern int cmos_read(int); -extern int cmos_write(int, int); - -#endif Index: sys/arch/acorn26/include/math.h =================================================================== RCS file: sys/arch/acorn26/include/math.h diff -N sys/arch/acorn26/include/math.h --- sys/arch/acorn26/include/math.h 24 Mar 2002 15:47:05 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: math.h,v 1.1 2002/03/24 15:47:05 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/mcontext.h =================================================================== RCS file: sys/arch/acorn26/include/mcontext.h diff -N sys/arch/acorn26/include/mcontext.h --- sys/arch/acorn26/include/mcontext.h 17 Jan 2003 21:55:26 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: mcontext.h,v 1.2 2003/01/17 21:55:26 thorpej Exp $ */ - -#include Index: sys/arch/acorn26/include/memcreg.h =================================================================== RCS file: sys/arch/acorn26/include/memcreg.h diff -N sys/arch/acorn26/include/memcreg.h --- sys/arch/acorn26/include/memcreg.h 11 May 2012 15:39:17 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,240 +0,0 @@ -/* $NetBSD: memcreg.h,v 1.4 2012/05/11 15:39:17 skrll Exp $ */ -/*- - * Copyright (c) 1997, 1998 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * memcreg.h - Acorn/ARM MEMC (Anna/VC2304/VL2304/MEMC1A/VL2304A/VL86C110/VY86C110) - * registers - */ - -#ifndef _ARM26_MEMCREG_H -#define _ARM26_MEMCREG_H - -/* - * Accessing the MEMC is a little odd. It's not connected to the data - * bus, so the register and the new value are coded into an address. - * Thus, to set a register, OR together the register specifier and the - * new value, and write any word to the resultant address. - */ - -#define MEMC_WRITE(value) *(volatile uint32_t *)value = 0 - -/* - * This information is mostly derived from: - * MEMC Datasheet - * Published by Acorn Computers Limited. - * Part no 0460,019 - * Issue No 1.0 - * 30 September 1986 - * ISBN 1 85250 025 6 - * - * Thanks must go to Jeanette Draper at ARM Ltd - * for finding it for me. - * - * Information on master/slave MEMCs came from Tony Duell - * , who has a copy of the MEMC1A data - * sheet and might photocopy it for me one day. - */ - -/* General memory-map layout provided by MEMC */ -#define MEMC_PHYS_BASE ((void *)0x02000000) -#define MEMC_IO_BASE ((void *)0x03000000) -#define MEMC_VIDC_BASE ((void *)0x03400000) -#define MEMC_ROM_LOW_BASE ((void *)0x03400000) -#define MEMC_ROM_HIGH_BASE ((void *)0x03800000) - -/* - * Each MEMC can manage 4Mb in 128 pages. The memory map only has - * space for 16Mb of physical RAM. - */ -#define MEMC_MAX_PHYSPAGES 512 - -/* - * DMA address generator control registers. Addresses (>>4) go in - * bits 2-16, and must thus be in the bottom 512k of physical RAM. - */ -#define MEMC_DMA_MAX 0x00080000 -/* Video */ -#define MEMC_VINIT 0x03600000 -#define MEMC_VSTART 0x03620000 -#define MEMC_VEND 0x03640000 -/* Cursor */ -#define MEMC_CINIT 0x03660000 -/* Sound */ -#define MEMC_SSTARTN 0x03680000 -#define MEMC_SENDN 0x036A0000 -#define MEMC_SPTR 0x036C0000 -#define MEMC_SET_PTR(reg,addr) (reg | (addr >> 2)) - -/* MEMC control register (sec 6.5) */ -#define MEMC_CONTROL 0x036E0000 - -/* Page size */ -#define MEMC_CTL_PGSZ_MASK 0x0000000C -#define MEMC_CTL_PGSZ_4K 0x00000000 -#define MEMC_CTL_PGSZ_8K 0x00000004 -#define MEMC_CTL_PGSZ_16K 0x00000008 -#define MEMC_CTL_PGSZ_32K 0x0000000C - -/* ROM speeds; low and high banks, relative to RAM speed */ -#define MEMC_CTL_LROMSPD_MASK 0x00000030 -#define MEMC_CTL_LROMSPD_4N 0x00000000 -#define MEMC_CTL_LROMSPD_3N 0x00000010 -#define MEMC_CTL_LROMSPD_2N 0x00000020 -#define MEMC_CTL_LROMSPD_PAGED 0x00000030 - -#define MEMC_CTL_HROMSPD_MASK 0x000000C0 -#define MEMC_CTL_HROMSPD_4N 0x00000000 -#define MEMC_CTL_HROMSPD_3N 0x00000040 -#define MEMC_CTL_HROMSPD_2N 0x00000080 -#define MEMC_CTL_HROMSPD_PAGED 0x000000C0 - -/* DRAM refresh control */ -#define MEMC_CTL_RFRSH_MASK 0x00000300 -#define MEMC_CTL_RFRSH_NONE 0x00000000 -#define MEMC_CTL_RFRSH_FLYBACK 0x00000100 -#define MEMC_CTL_RFRSH_CONTIN 0x00000300 - -/* Enable video DMA */ -#define MEMC_CTL_VIDEODMA 0x00000400 -/* Enable sound DMA */ -#define MEMC_CTL_SOUNDDMA 0x00000800 -/* Operating System Mode Select */ -#define MEMC_CTL_OSMODE 0x00001000 - -/* Test mode */ -/* This should never be set in a running system */ -#define MEMC_CTL_TESTMODE 0x00002000 - -/* - * Address translation control - */ - -/* Absolute address of translation table */ -#define MEMC_TRANS_BASE 0x03800000 - -/* - * MEMC translation entries are painful, and vary with the page size - * in use. Here, ppn is the physical page number, lpn is the logical - * page number and ppl is the page protection level. - * - * The list of transformations at the start of each macro is copied - * verbatim from the MEMC datasheet (Figure 5) with the exception of - * the entries for PPN[7] and PPN[8]. In dual-MEMC situations, PPN[7] - * selects between master and slave MEMCs, and is mapped to A[7] whatever - * the page size (though Acorn machines always use 32k pages with dual - * MEMCs). The Archimedes 540 can have up to 16Mb of RAM, and arranges - * this by having several address lines go through PALs on their way to the - * MEMCs. The upshot of this is that for the purposes of setting the - * translation tables, PPN[8] maps to A[12]. The A540 always has 32kb pages. - */ - -/* Page protection levels (data sheet section 6.6) */ -/*- - * PPL - * Mode 00 01 10 11 - * SVC R/W R/W R/W R/W - * OS R/W R/W R R - * User R/W R - - - */ - -#define MEMC_PPL_RDWR 0 -#define MEMC_PPL_RDONLY 1 -#define MEMC_PPL_NOACCESS 2 - -/*- - * 4k pages: - * PPN[7] -> A[7] (MEMC1a) - * PPN[6:0] -> A[6:0] - * PPL[1:0] -> A[9:8] - * LPN[12:11] -> A[11:10] - * LPN[10:0] -> A[22:12] - */ -#define MEMC_TRANS_ENTRY_4K(ppn, lpn, ppl) \ - (MEMC_TRANS_BASE | \ - ((ppn) & 0xff) | \ - ((ppl) & 0x3) << 8 | \ - ((lpn) & 0x7ff) << 12 | \ - ((lpn) & 0x1800) >> 1) -/*- - * 8k pages: - * PPN[7] -> A[7] (MEMC1a) - * PPN[6] -> A[0] - * PPN[5:0] -> A[6:1] - * PPL[1:0] -> A[9:8] - * LPN[11:10] -> A[11:10] - * LPN[9:0] -> A[22:13] - */ -#define MEMC_TRANS_ENTRY_8K(ppn, lpn, ppl) \ - (MEMC_TRANS_BASE | \ - ((ppn) & 0x80) | \ - ((ppn) & 0x40) >> 6 | \ - ((ppn) & 0x3f) << 1 | \ - ((ppl) & 0x3) << 8 | \ - ((lpn) & 0xc00)) | \ - ((lpn) & 0x3ff) << 13) -/*- - * 16k pages: - * PPN[7] -> A[7] (MEMC1a) - * PPN[6:5] -> A[1:0] - * PPN[4:0] -> A[6:2] - * PPL[1:0] -> A[9:8] - * LPN[10:9] -> A[11:10] - * LPN[9:0] -> A[22:14] - */ -#define MEMC_TRANS_ENTRY_16K(ppn, lpn, ppl) \ - (MEMC_TRANS_BASE | \ - ((ppn) & 0x80) | \ - ((ppn) & 0x60) >> 5 | \ - ((ppn) & 0x1f) << 2 | \ - ((ppl) & 0x3) << 8 | \ - ((lpn) & 0x600) << 1 | \ - ((lpn) & 0x1ff) << 14) -/*- - * 32k pages (here, the MEMC descends into madness...): - * PPN[8] -> A[12] (A540) - * PPN[7] -> A[7] (MEMC1a) - * PPN[6] -> A[1] - * PPN[5] -> A[2] - * PPN[4] -> A[0] - * PPN[3:0] -> A[6:3] - * PPL[1:0] -> A[9:8] - * LPN[9:8] -> A[11:10] - * LPN[7:0] -> A[22:15] - */ -#define MEMC_TRANS_ENTRY_32K(ppn, lpn, ppl) \ - (MEMC_TRANS_BASE | \ - ((ppn) & 0x100) << 4 | \ - ((ppn) & 0x80) | \ - ((ppn) & 0x40) >> 5 | \ - ((ppn) & 0x20) >> 3 | \ - ((ppn) & 0x10) >> 4 | \ - ((ppn) & 0x0f) << 3 | \ - ((ppl) & 0x3) << 8 | \ - ((lpn) & 0x300) << 2 | \ - ((lpn) & 0x0ff) << 15) - -#endif Index: sys/arch/acorn26/include/mutex.h =================================================================== RCS file: sys/arch/acorn26/include/mutex.h diff -N sys/arch/acorn26/include/mutex.h --- sys/arch/acorn26/include/mutex.h 9 Feb 2007 21:55:00 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: mutex.h,v 1.2 2007/02/09 21:55:00 ad Exp $ */ - -#include Index: sys/arch/acorn26/include/param.h =================================================================== RCS file: sys/arch/acorn26/include/param.h diff -N sys/arch/acorn26/include/param.h --- sys/arch/acorn26/include/param.h 8 Feb 2010 19:02:25 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,89 +0,0 @@ -/* $NetBSD: param.h,v 1.4 2010/02/08 19:02:25 joerg Exp $ */ - -/* - * Copyright (c) 1994,1995 Mark Brinicombe. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * 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 the RiscBSD team. - * 4. The name "RiscBSD" nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY RISCBSD ``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 RISCBSD 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. - */ - -#ifndef _ARM26_PARAM_H_ -#define _ARM26_PARAM_H_ - -#ifdef _KERNEL -#include /* XXX why? */ -#include /* XXX for spl(9) */ -#endif - -#define _MACHINE acorn26 -#define MACHINE "acorn26" - -#define POOL_SUBPAGE 4096 - -#define PGSHIFT 15 /* LOG2(NBPG) */ -#define NBPG (1 << PGSHIFT) /* bytes/page */ -#define PGOFSET (NBPG-1) /* byte offset into page */ - -#define SSIZE 1 /* initial stack size/NBPG */ -#define SINCR 1 /* increment of stack/NBPG */ -#define UPAGES 1 /* pages of u-area */ -#define USPACE (UPAGES * NBPG) /* total size of u-area */ - -#ifndef MSGBUFSIZE -#define MSGBUFSIZE NBPG /* default message buffer size */ -#endif - -/* - * Defaults for lower- and upper-bounds for the kmem_map page count. - * Can be overridden by kernel config options. - */ -#define NKMEMPAGES_MIN_DEFAULT 0 -#define NKMEMPAGES_MAX_DEFAULT 32 - -/* - * Reduce UBC KVM usage from its default (8Mb when I looked). - * Also make sure the window size is at least the page size. - */ -#ifndef UBC_WINSHIFT -#define UBC_WINSHIFT PGSHIFT -#endif -#ifndef UBC_NWINS -#define UBC_NWINS 32 -#endif - -#ifdef _KERNEL -#ifndef _LOCORE -void delay(unsigned); -#define DELAY(x) delay(x) -#endif -#define MAXEXEC 1 -#endif - -#include - -#endif /* _ARM_PARAM_H_ */ Index: sys/arch/acorn26/include/pcb.h =================================================================== RCS file: sys/arch/acorn26/include/pcb.h diff -N sys/arch/acorn26/include/pcb.h --- sys/arch/acorn26/include/pcb.h 24 Mar 2002 15:47:07 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: pcb.h,v 1.1 2002/03/24 15:47:07 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/pmap.h =================================================================== RCS file: sys/arch/acorn26/include/pmap.h diff -N sys/arch/acorn26/include/pmap.h --- sys/arch/acorn26/include/pmap.h 29 Dec 2016 12:54:10 -0000 1.10 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,64 +0,0 @@ -/* $NetBSD: pmap.h,v 1.10 2016/12/29 12:54:10 rin Exp $ */ -/*- - * Copyright (c) 1997, 1998 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * machine/pmap.h - Machine-dependent pmap stuff from MEMC1A - */ - -#ifndef _ARM26_PMAP_H -#define _ARM26_PMAP_H - -#ifdef _KERNEL -#include - -extern void pmap_bootstrap(int, paddr_t); - -extern bool pmap_fault(pmap_t, vaddr_t, vm_prot_t); - -/* These have to be macros, whatever pmap(9) says. */ -#define pmap_resident_count(pmap) _pmap_resident_count(pmap) -#define pmap_wired_count(pmap) _pmap_wired_count(pmap) - -extern long _pmap_resident_count(pmap_t); -extern long _pmap_wired_count(pmap_t); - -static __inline void -pmap_remove_all(struct pmap *pmap) -{ - /* Nothing. */ -} - -/* Save on hassle and kernel VM */ -#define PMAP_MAP_POOLPAGE(pa) ((vaddr_t)MEMC_PHYS_BASE + (pa)) -#define PMAP_UNMAP_POOLPAGE(va) ((va) - (vaddr_t)MEMC_PHYS_BASE) -#define PMAP_STEAL_MEMORY - -#define UVM_PHYSSEG_LEGACY /* for uvm_physseg_set_avail_start */ - -#endif /* _KERNEL */ - -#endif Index: sys/arch/acorn26/include/pmc.h =================================================================== RCS file: sys/arch/acorn26/include/pmc.h diff -N sys/arch/acorn26/include/pmc.h --- sys/arch/acorn26/include/pmc.h 7 Aug 2002 05:14:47 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: pmc.h,v 1.1 2002/08/07 05:14:47 briggs Exp $ */ - -#include Index: sys/arch/acorn26/include/podulebus_machdep.h =================================================================== RCS file: sys/arch/acorn26/include/podulebus_machdep.h diff -N sys/arch/acorn26/include/podulebus_machdep.h --- sys/arch/acorn26/include/podulebus_machdep.h 19 Jul 2011 16:05:10 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,122 +0,0 @@ -/* $NetBSD: podulebus_machdep.h,v 1.3 2011/07/19 16:05:10 dyoung Exp $ */ - -/* - * Copyright (c) 1995 Mark Brinicombe. - * Copyright (c) 1995 Brini. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * 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 Brini. - * 4. The name of the company nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY BRINI ``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 BRINI 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. - * - * RiscBSD kernel project - * - * podulebus.h - * - * Podule bus header file - * - * Created : 26/04/95 - */ - -#include -#include - -struct podulebus_chunk { - int pc_type; - int pc_length; - int pc_offset; - int pc_useloader; -}; - -typedef int podulebus_intr_handle_t; - -struct podulebus_attach_args { - /* bus_space references for the (many) podule spaces */ - bus_space_tag_t pa_easi_t; - bus_space_handle_t pa_easi_h; - bus_space_tag_t pa_mod_t; - bus_space_handle_t pa_mod_h; - bus_space_tag_t pa_fast_t; - bus_space_handle_t pa_fast_h; - bus_space_tag_t pa_medium_t; - bus_space_handle_t pa_medium_h; - bus_space_tag_t pa_slow_t; - bus_space_handle_t pa_slow_h; - bus_space_tag_t pa_sync_t; - bus_space_handle_t pa_sync_h; - - /* Same things as raw addresses (arm32 compat) */ - bus_addr_t pa_easi_base; - bus_addr_t pa_mod_base; - bus_addr_t pa_fast_base; - bus_addr_t pa_medium_base; - bus_addr_t pa_slow_base; - bus_addr_t pa_sync_base; - - podulebus_intr_handle_t pa_ih; - - int pa_slotnum; - int pa_ecid; - int pa_flags1; - int pa_manufacturer; - int pa_product; - struct podulebus_chunk *pa_chunks; - int pa_nchunks; - char *pa_descr; - void *pa_loader; - int pa_slotflags; -#define PA_SLOT_EASI 0x01 /* EASI space available */ -}; - -#define IS_PODULE(pa, man, prod) \ - ((pa)->pa_manufacturer == (man) && (pa)->pa_product == (prod)) - -/* Set the address-bus shift for a bus_space tag. */ - -#define podulebus_shift_tag(tag, shift, tagp) bus_space_shift(tag, shift, tagp) - -#ifdef _KERNEL - -struct evcnt; - -extern void *podulebus_irq_establish(podulebus_intr_handle_t, int, - int (*)(void *), void *, struct evcnt *); - -#endif - -/* arm32 compatibility */ - -#define WriteByte(a, v) bus_space_write_1(2, (a), 0, (v)) -#define WriteShort(a, v) bus_space_write_2(2, (a), 0, (v)) -#define ReadByte(a) bus_space_read_1(2, (a), 0) -#define ReadShort(a) bus_space_read_2(2, (a), 0) - -/* XXX The arm32 version ignores "slot" too. */ -#define matchpodule(pa, man, prod, slot) IS_PODULE(pa, man, prod) - -/* end arm32 compatibility */ - -/* End of podulebus.h */ Index: sys/arch/acorn26/include/proc.h =================================================================== RCS file: sys/arch/acorn26/include/proc.h diff -N sys/arch/acorn26/include/proc.h --- sys/arch/acorn26/include/proc.h 31 Mar 2003 19:53:25 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: proc.h,v 1.4 2003/03/31 19:53:25 thorpej Exp $ */ - -#include Index: sys/arch/acorn26/include/profile.h =================================================================== RCS file: sys/arch/acorn26/include/profile.h diff -N sys/arch/acorn26/include/profile.h --- sys/arch/acorn26/include/profile.h 24 Mar 2002 15:47:08 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: profile.h,v 1.1 2002/03/24 15:47:08 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/ptrace.h =================================================================== RCS file: sys/arch/acorn26/include/ptrace.h diff -N sys/arch/acorn26/include/ptrace.h --- sys/arch/acorn26/include/ptrace.h 24 Mar 2002 15:47:09 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: ptrace.h,v 1.1 2002/03/24 15:47:09 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/reg.h =================================================================== RCS file: sys/arch/acorn26/include/reg.h diff -N sys/arch/acorn26/include/reg.h --- sys/arch/acorn26/include/reg.h 24 Mar 2002 15:47:09 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: reg.h,v 1.1 2002/03/24 15:47:09 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/rwlock.h =================================================================== RCS file: sys/arch/acorn26/include/rwlock.h diff -N sys/arch/acorn26/include/rwlock.h --- sys/arch/acorn26/include/rwlock.h 9 Feb 2007 21:55:00 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: rwlock.h,v 1.2 2007/02/09 21:55:00 ad Exp $ */ - -#include Index: sys/arch/acorn26/include/setjmp.h =================================================================== RCS file: sys/arch/acorn26/include/setjmp.h diff -N sys/arch/acorn26/include/setjmp.h --- sys/arch/acorn26/include/setjmp.h 24 Mar 2002 15:47:10 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: setjmp.h,v 1.1 2002/03/24 15:47:10 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/signal.h =================================================================== RCS file: sys/arch/acorn26/include/signal.h diff -N sys/arch/acorn26/include/signal.h --- sys/arch/acorn26/include/signal.h 24 Mar 2002 15:47:10 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: signal.h,v 1.1 2002/03/24 15:47:10 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/softintr.h =================================================================== RCS file: sys/arch/acorn26/include/softintr.h diff -N sys/arch/acorn26/include/softintr.h --- sys/arch/acorn26/include/softintr.h 24 Mar 2002 23:37:43 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,39 +0,0 @@ -/* $NetBSD: softintr.h,v 1.2 2002/03/24 23:37:43 bjh21 Exp $ */ -/*- - * Copyright (c) 1999 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* Software interrupt priority levels */ - -#ifndef _ARM26_SOFTINTR_H -#define _ARM26_SOFTINTR_H - -#define SOFTIRQ_CLOCK 0 -#define SOFTIRQ_NET 1 -#define SOFTIRQ_SERIAL 2 - -#define SOFTIRQ_BIT(x) (1 << x) - -#endif /* _ARM26_SOFTINTR_H */ Index: sys/arch/acorn26/include/stdarg.h =================================================================== RCS file: sys/arch/acorn26/include/stdarg.h diff -N sys/arch/acorn26/include/stdarg.h --- sys/arch/acorn26/include/stdarg.h 24 Mar 2002 15:47:11 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: stdarg.h,v 1.1 2002/03/24 15:47:11 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/sysarch.h =================================================================== RCS file: sys/arch/acorn26/include/sysarch.h diff -N sys/arch/acorn26/include/sysarch.h --- sys/arch/acorn26/include/sysarch.h 24 Mar 2002 15:47:11 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,4 +0,0 @@ -/* $NetBSD: sysarch.h,v 1.1 2002/03/24 15:47:11 bjh21 Exp $ */ - -#include - Index: sys/arch/acorn26/include/trap.h =================================================================== RCS file: sys/arch/acorn26/include/trap.h diff -N sys/arch/acorn26/include/trap.h --- sys/arch/acorn26/include/trap.h 24 Mar 2002 15:47:11 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: trap.h,v 1.1 2002/03/24 15:47:11 bjh21 Exp $ */ - -#include Index: sys/arch/acorn26/include/types.h =================================================================== RCS file: sys/arch/acorn26/include/types.h diff -N sys/arch/acorn26/include/types.h --- sys/arch/acorn26/include/types.h 7 May 2013 20:42:45 -0000 1.13 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,13 +0,0 @@ -/* $NetBSD: types.h,v 1.13 2013/05/07 20:42:45 matt Exp $ */ - -#ifndef _ACORN26_TYPES_H_ -#define _ACORN26_TYPES_H_ - -#include - -#define __GENERIC_SOFT_INTERRUPTS_ALL_LEVELS -#define __HAVE_MM_MD_DIRECT_MAPPED_PHYS -#define __HAVE_MM_MD_KERNACC -#define __HAVE_OLD_DISKLABEL - -#endif /* _ACORN26_TYPES_H_ */ Index: sys/arch/acorn26/include/vmparam.h =================================================================== RCS file: sys/arch/acorn26/include/vmparam.h diff -N sys/arch/acorn26/include/vmparam.h --- sys/arch/acorn26/include/vmparam.h 13 Feb 2017 09:46:29 -0000 1.14 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,103 +0,0 @@ -/* $NetBSD: vmparam.h,v 1.14 2017/02/13 09:46:29 skrll Exp $ */ - -/* - * Copyright (c) 1988 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University 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 REGENTS 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 REGENTS 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. - */ - -#ifndef _ARM26_VMPARAM_H_ -#define _ARM26_VMPARAM_H_ - -#define __USE_TOPDOWN_VM - -/* - * Page size on the 26-bit ARM CPUs is not variable in the traditional - * sense. We override the PAGE_* definitions to compile-time constants. - */ -#define PAGE_SHIFT 15 -#define PAGE_SIZE (1 << PAGE_SHIFT) -#define PAGE_MASK (PAGE_SIZE - 1) - -#define USRSTACK VM_MAXUSER_ADDRESS - -#define MAXTSIZ (0x007f8000) /* max text size */ -#ifndef DFLDSIZ -#define DFLDSIZ (0x01800000) /* initial data size limit */ -#endif -#ifndef MAXDSIZ -#define MAXDSIZ (0x01800000) /* max data size */ -#endif -#ifndef DFLSSIZ -#define DFLSSIZ (512*1024) /* initial stack size limit */ -#endif -#ifndef MAXSSIZ -#define MAXSSIZ (0x00200000) /* max stack size */ -#endif - -/* - * Override the default pager_map size, there's not enough KVA. - */ -#define PAGER_MAP_DEFAULT_SIZE (1 * 1024 * 1024) - -/* - * Mach derived constants - */ - -/* Need to link some of these with some in param.h */ - -/* - * These specify the range of virtual pages available to user - * processes and to the kernel. This is a bit of a delicate balancing - * act, as we've only got 32Mb between them. There should probably be - * an option to have separate kernel and user spaces to ease this. - */ - -#define KVM_SIZE 0x00800000 /* 8Mb */ - -/* User VM range */ -#define VM_MIN_ADDRESS ((vaddr_t)0x00008000) -#define VM_MAX_ADDRESS ((vaddr_t)0x02000000 - KVM_SIZE) -#define VM_MAXUSER_ADDRESS VM_MAX_ADDRESS - -/* Kernel VM range */ -#define VM_MIN_KERNEL_ADDRESS VM_MAX_ADDRESS -#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0x02000000) -#define VM_MAXKERN_ADDRESS VM_MAX_KERNEL_ADDRESS - -/* Physical memory parameters */ - -#define VM_PHYSSEG_MAX 3 - -#define VM_PHYSSEG_STRAT VM_PSTRAT_BIGFIRST - -#define VM_NFREELIST 2 -#define VM_FREELIST_LOW 1 /* DMA-able memory (bottom 512k phys) */ -#define VM_FREELIST_DEFAULT 0 /* The rest */ - -#endif /* _ARM26_VMPARAM_H_ */ - -/* End of vmparam.h */ Index: sys/arch/acorn26/include/wchar_limits.h =================================================================== RCS file: sys/arch/acorn26/include/wchar_limits.h diff -N sys/arch/acorn26/include/wchar_limits.h --- sys/arch/acorn26/include/wchar_limits.h 11 Dec 2005 12:16:04 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -/* $NetBSD: wchar_limits.h,v 1.2 2005/12/11 12:16:04 christos Exp $ */ - -#include Index: sys/arch/acorn26/iobus/iobus.c =================================================================== RCS file: sys/arch/acorn26/iobus/iobus.c diff -N sys/arch/acorn26/iobus/iobus.c --- sys/arch/acorn26/iobus/iobus.c 19 Jul 2011 16:05:10 -0000 1.16 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,121 +0,0 @@ -/* $NetBSD: iobus.c,v 1.16 2011/07/19 16:05:10 dyoung Exp $ */ -/*- - * Copyright (c) 1998 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * iobus.c - when the IORQ* calls... - */ - -#include -__KERNEL_RCSID(0, "$NetBSD: iobus.c,v 1.16 2011/07/19 16:05:10 dyoung Exp $"); - -#include -#include -#include -#include - -#include - -#include - -#include "locators.h" - -static int iobus_match(device_t parent, cfdata_t cf, void *aux); -static void iobus_attach(device_t parent, device_t self, void *aux); -static int iobus_search_ioc(device_t parent, cfdata_t cf, - const int *ldesc, void *aux); -static int iobus_search(device_t parent, cfdata_t cf, - const int *ldesc, void *aux); -static int iobus_print(void *aux, const char *pnp); - -CFATTACH_DECL_NEW(iobus, 0, iobus_match, iobus_attach, NULL, NULL); - -device_t the_iobus; - -static int -iobus_match(device_t parent, cfdata_t cf, void *aux) -{ - - /* There can be only one! */ - if (the_iobus == NULL) - return 1; - return 0; -} - -static void -iobus_attach(device_t parent, device_t self, void *aux) -{ - - the_iobus = self; - aprint_normal("\n"); - - /* - * Always look for the IOC first, since stuff under there determines - * what else is present. - */ - config_search_ia(iobus_search_ioc, self, "iobus", NULL); - config_search_ia(iobus_search, self, "iobus", NULL); -} - -extern struct bus_space iobus_bs_tag; - -static int -iobus_search_ioc(device_t parent, cfdata_t cf, const int *ldesc, void *aux) -{ - struct iobus_attach_args ioa; - - ioa.ioa_tag = &iobus_bs_tag; - ioa.ioa_base = (bus_addr_t)MEMC_IO_BASE + cf->cf_loc[IOBUSCF_BASE]; - if (strcmp(cf->cf_name, "ioc") == 0 && - config_match(parent, cf, &ioa) > 0) - config_attach(parent, cf, &ioa, iobus_print); - - return 0; -} - -static int -iobus_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux) -{ - struct iobus_attach_args ioa; - - ioa.ioa_tag = &iobus_bs_tag; - ioa.ioa_base = (bus_addr_t)MEMC_IO_BASE + cf->cf_loc[IOBUSCF_BASE]; - if (config_match(parent, cf, &ioa) > 0) - config_attach(parent, cf, &ioa, iobus_print); - - return 0; -} - -static int -iobus_print(void *aux, const char *pnp) -{ - struct iobus_attach_args *ioa = aux; - - if (ioa->ioa_base != IOBUSCF_BASE_DEFAULT) - aprint_normal(" base 0x%06lx", - ioa->ioa_base - (bus_addr_t)MEMC_IO_BASE); - return UNCONF; -} Index: sys/arch/acorn26/iobus/iobusvar.h =================================================================== RCS file: sys/arch/acorn26/iobus/iobusvar.h diff -N sys/arch/acorn26/iobus/iobusvar.h --- sys/arch/acorn26/iobus/iobusvar.h 19 Jul 2011 16:05:10 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,44 +0,0 @@ -/* $NetBSD: iobusvar.h,v 1.3 2011/07/19 16:05:10 dyoung Exp $ */ -/*- - * Copyright (c) 1998 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * iobusvar.h - Things other people need to know about iobus.c - */ - -#ifndef _ARM26_IOBUSVAR_H -#define _ARM26_IOBUSVAR_H - -#include - -/* Structure passed to children of an iobus */ - -struct iobus_attach_args { - bus_space_tag_t ioa_tag; - bus_addr_t ioa_base; -}; - -#endif Index: sys/arch/acorn26/iobus/ioc.c =================================================================== RCS file: sys/arch/acorn26/iobus/ioc.c diff -N sys/arch/acorn26/iobus/ioc.c --- sys/arch/acorn26/iobus/ioc.c 8 Mar 2014 15:46:20 -0000 1.22 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,465 +0,0 @@ -/* $NetBSD: ioc.c,v 1.22 2014/03/08 15:46:20 skrll Exp $ */ - -/*- - * Copyright (c) 1998, 1999, 2000 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * ioc.c - Acorn/ARM I/O Controller (Albion/VC2311/VL2311/VY86C410) - */ - -#include -__KERNEL_RCSID(0, "$NetBSD: ioc.c,v 1.22 2014/03/08 15:46:20 skrll Exp $"); - -#include -#include -#include -#include -#include /* For bootverbose */ -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include "locators.h" - -static int ioc_match(device_t parent, cfdata_t cf, void *aux); -static void ioc_attach(device_t parent, device_t self, void *aux); -static int ioc_search(device_t parent, cfdata_t cf, - const int *ldesc, void *aux); -static int ioc_print(void *aux, const char *pnp); -static int ioc_irq_clock(void *cookie); -static int ioc_irq_statclock(void *cookie); -static u_int ioc_get_timecount(struct timecounter *); - -CFATTACH_DECL_NEW(ioc, sizeof(struct ioc_softc), - ioc_match, ioc_attach, NULL, NULL); - -device_t the_ioc; - -/* - * Autoconfiguration glue - */ - -static int -ioc_match(device_t parent, cfdata_t cf, void *aux) -{ - - /* - * This is tricky. Accessing non-existent devices in iobus - * space can hang the machine (MEMC datasheet section 5.3.3), - * so probes would have to be very delicate. This isn't - * _much_ of a problem with the IOC, since all machines I know - * of have exactly one. - */ - if (the_ioc == NULL) - return 1; - return 0; -} - -static void -ioc_attach(device_t parent, device_t self, void *aux) -{ - struct ioc_softc *sc = device_private(self); - struct iobus_attach_args *ioa = aux; - - sc->sc_dev = the_ioc = self; - sc->sc_bst = ioa->ioa_tag; - if (bus_space_map(ioa->ioa_tag, ioa->ioa_base, 0x00200000, - 0, &(sc->sc_bsh)) != 0) - panic("%s: couldn't map", device_xname(self)); - - /* Now we need to set up bits of the IOC */ - /* Control register: All bits high (input) is probably safe */ - ioc_ctl_write(self, 0xff, 0xff); - /* - * IRQ/FIQ: mask out all, leave clearing latched interrupts - * till someone asks. - */ - ioc_irq_setmask(0); - ioc_fiq_setmask(0); - /*- - * Timers: - * Timers 0/1 are set up by ioc_initclocks (called by cpu_initclocks). - * XXX What if we need timers before then? - * Timer 2 is set up by whatever's connected to BAUD. - * Timer 3 is set up by the arckbd driver. - */ - aprint_normal("\n"); - - config_search_ia(ioc_search, self, "ioc", NULL); -} - -extern struct bus_space ioc_bs_tag; - -static int -ioc_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux) -{ - struct ioc_softc *sc = device_private(parent); - struct ioc_attach_args ioc; - bus_space_tag_t bst = sc->sc_bst; - bus_space_handle_t bsh = sc->sc_bsh; - - ioc.ioc_bank = cf->cf_loc[IOCCF_BANK]; - ioc.ioc_offset = cf->cf_loc[IOCCF_OFFSET]; - ioc.ioc_slow_t = bst; - bus_space_subregion(bst, bsh, (ioc.ioc_bank << IOC_BANK_SHIFT) - + (IOC_TYPE_SLOW << IOC_TYPE_SHIFT) - + (ioc.ioc_offset >> 2), - 1 << IOC_BANK_SHIFT, &ioc.ioc_slow_h); - ioc.ioc_medium_t = bst; - bus_space_subregion(bst, bsh, (ioc.ioc_bank << IOC_BANK_SHIFT) - + (IOC_TYPE_MEDIUM << IOC_TYPE_SHIFT) - + (ioc.ioc_offset >> 2), - 1 << IOC_BANK_SHIFT, &ioc.ioc_medium_h); - ioc.ioc_fast_t = bst; - bus_space_subregion(bst, bsh, (ioc.ioc_bank << IOC_BANK_SHIFT) - + (IOC_TYPE_FAST << IOC_TYPE_SHIFT) - + (ioc.ioc_offset >> 2), - 1 << IOC_BANK_SHIFT, &ioc.ioc_fast_h); - ioc.ioc_sync_t = bst; - bus_space_subregion(bst, bsh, (ioc.ioc_bank << IOC_BANK_SHIFT) - + (IOC_TYPE_SYNC << IOC_TYPE_SHIFT) - + (ioc.ioc_offset >> 2), - 1 << IOC_BANK_SHIFT, &ioc.ioc_sync_h); - if (config_match(parent, cf, &ioc) > 0) - config_attach(parent, cf, &ioc, ioc_print); - - return 0; -} - -static int -ioc_print(void *aux, const char *pnp) -{ - struct ioc_attach_args *ioc = aux; - - if (ioc->ioc_bank != IOCCF_BANK_DEFAULT) - aprint_normal(" bank %d", ioc->ioc_bank); - if (ioc->ioc_offset != IOCCF_OFFSET_DEFAULT) - aprint_normal(" offset 0x%02x", ioc->ioc_offset); - return UNCONF; -} - -/* - * Find out if an interrupt line is currently active - */ - -int -ioc_irq_status(int irq) -{ - struct ioc_softc *sc = device_private(the_ioc); - bus_space_tag_t bst = sc->sc_bst; - bus_space_handle_t bsh = sc->sc_bsh; - - if (irq < 8) - return (bus_space_read_1(bst, bsh, IOC_IRQSTA) & - IOC_IRQA_BIT(irq)) != 0; - else - return (bus_space_read_1(bst, bsh, IOC_IRQSTB) & - IOC_IRQB_BIT(irq)) != 0; -} - -uint32_t -ioc_irq_status_full(void) -{ - struct ioc_softc *sc = device_private(the_ioc); - bus_space_tag_t bst = sc->sc_bst; - bus_space_handle_t bsh = sc->sc_bsh; - -#if 0 /* XXX */ - printf("IRQ mask: 0x%x\n", - bus_space_read_1(bst, bsh, IOC_IRQMSKA) | - (bus_space_read_1(bst, bsh, IOC_IRQMSKB) << 8)); -#endif - return bus_space_read_1(bst, bsh, IOC_IRQRQA) | - (bus_space_read_1(bst, bsh, IOC_IRQRQB) << 8); -} - -void -ioc_irq_setmask(uint32_t mask) -{ - struct ioc_softc *sc = device_private(the_ioc); - bus_space_tag_t bst = sc->sc_bst; - bus_space_handle_t bsh = sc->sc_bsh; - - bus_space_write_1(bst, bsh, IOC_IRQMSKA, mask & 0xff); - bus_space_write_1(bst, bsh, IOC_IRQMSKB, (mask >> 8) & 0xff); -} - -void -ioc_irq_waitfor(int irq) -{ - - while (!ioc_irq_status(irq)); -} - -void -ioc_irq_clear(int mask) -{ - struct ioc_softc *sc = device_private(the_ioc); - bus_space_tag_t bst = sc->sc_bst; - bus_space_handle_t bsh = sc->sc_bsh; - - bus_space_write_1(bst, bsh, IOC_IRQRQA, mask); -} - -#if 0 - -/* - * ioc_get_irq_level: - * - * Find out the current level of an edge-triggered interrupt line. - * Useful for the VIDC driver to know if it's in VSYNC if nothing - * else. - */ - -int ioc_get_irq_level(device_t self, int irq) -{ - struct ioc_softc *sc = device_private(self); - - switch (irq) { - case IOC_IRQ_IF: - return (bus_space_read_1(sc->sc_bst, sc->sc_bsh, IOC_CTL) & - IOC_CTL_NIF) != 0; - case IOC_IRQ_IR: - return (bus_space_read_1(sc->sc_bst, sc->sc_bsh, IOC_CTL) & - IOC_CTL_IR) != 0; - } - panic("ioc_get_irq_level called for irq %d, which isn't edge-triggered", - irq); -} - -#endif /* 0 */ - -/* - * FIQs - */ - -void -ioc_fiq_setmask(uint32_t mask) -{ - struct ioc_softc *sc = device_private(the_ioc); - bus_space_tag_t bst = sc->sc_bst; - bus_space_handle_t bsh = sc->sc_bsh; - - bus_space_write_1(bst, bsh, IOC_FIQMSK, mask); -} - - - -/* - * Counters - */ - -void ioc_counter_start(device_t self, int counter, int value) -{ - struct ioc_softc *sc = device_private(self); - bus_space_tag_t bst = sc->sc_bst; - bus_space_handle_t bsh = sc->sc_bsh; - int tlow, thigh, tgo; - - switch (counter) { - case 0: tlow = IOC_T0LOW; thigh = IOC_T0HIGH; tgo = IOC_T0GO; break; - case 1: tlow = IOC_T1LOW; thigh = IOC_T1HIGH; tgo = IOC_T1GO; break; - case 2: tlow = IOC_T2LOW; thigh = IOC_T2HIGH; tgo = IOC_T2GO; break; - case 3: tlow = IOC_T3LOW; thigh = IOC_T3HIGH; tgo = IOC_T3GO; break; - default: panic("%s: ioc_counter_start: bad counter (%d)", - device_xname(self), counter); - } - bus_space_write_1(bst, bsh, tlow, value & 0xff); - bus_space_write_1(bst, bsh, thigh, value >> 8 & 0xff); - bus_space_write_1(bst, bsh, tgo, 0); -} - -/* Cache to save microtime recalculating it */ -static int t0_count; -/* - * Statistics clock interval and variance, in ticks. Variance must be a - * power of two. Since this gives us an even number, not an odd number, - * we discard one case and compensate. That is, a variance of 1024 would - * give us offsets in [0..1023]. Instead, we take offsets in [1..1023]. - * This is symmetric about the point 512, or statvar/2, and thus averages - * to that value (assuming uniform random numbers). - */ -int statvar = 8192; -int statmin; - -void -cpu_initclocks(void) -{ - struct ioc_softc *sc; - int minint, statint; - - KASSERT(the_ioc != NULL); - sc = device_private(the_ioc); - stathz = hz; /* XXX what _should_ it be? */ - - if (hz == 0 || IOC_TIMER_RATE % hz != 0 || - (t0_count = IOC_TIMER_RATE / hz - 1) > 65535) - panic("ioc_initclocks: Impossible clock rate: %d Hz", hz); - ioc_counter_start(the_ioc, 0, t0_count); - evcnt_attach_dynamic(&sc->sc_clkev, EVCNT_TYPE_INTR, NULL, - device_xname(sc->sc_dev), "clock"); - sc->sc_clkirq = irq_establish(IOC_IRQ_TM0, IPL_CLOCK, ioc_irq_clock, - NULL, &sc->sc_clkev); - sc->sc_tc.tc_get_timecount = ioc_get_timecount; - sc->sc_tc.tc_counter_mask = ~(u_int)0; - sc->sc_tc.tc_frequency = IOC_TIMER_RATE; - sc->sc_tc.tc_name = device_xname(sc->sc_dev); - sc->sc_tc.tc_quality = 100; - sc->sc_tc.tc_priv = sc; - tc_init(&sc->sc_tc); - aprint_verbose_dev(sc->sc_dev, "%d Hz clock interrupting at %s\n", - hz, irq_string(sc->sc_clkirq)); - - if (stathz) { - profhz = stathz; /* Makes life simpler */ - - if (stathz == 0 || IOC_TIMER_RATE % stathz != 0 || - (statint = IOC_TIMER_RATE / stathz - 1) > 65535) - panic("Impossible statclock rate: %d Hz", stathz); - - minint = statint / 2 + 100; - while (statvar > minint) - statvar >>= 1; - statmin = statint - (statvar >> 1); - - ioc_counter_start(the_ioc, 1, statint); - - evcnt_attach_dynamic(&sc->sc_sclkev, EVCNT_TYPE_INTR, NULL, - device_xname(sc->sc_dev), "statclock"); - sc->sc_sclkirq = irq_establish(IOC_IRQ_TM1, IPL_HIGH, - ioc_irq_statclock, NULL, &sc->sc_sclkev); - aprint_verbose_dev(sc->sc_dev, - "%d Hz statclock interrupting at %s\n", - stathz, irq_string(sc->sc_sclkirq)); - } -} - -static int -ioc_irq_clock(void *cookie) -{ - struct ioc_softc *sc = device_private(the_ioc); - - sc->sc_tcbase += t0_count + 1; - hardclock(cookie); - return IRQ_HANDLED; -} - -static int -ioc_irq_statclock(void *cookie) -{ - struct ioc_softc *sc = device_private(the_ioc); - bus_space_tag_t bst = sc->sc_bst; - bus_space_handle_t bsh = sc->sc_bsh; - int r, newint; - - statclock(cookie); - - /* Generate a new randomly-distributed clock period. */ - do { - r = random() & (statvar - 1); - } while (r == 0); - newint = statmin + r; - - /* - * Load the next clock period into the latch, but don't do anything - * with it. It'll be used for the _next_ statclock reload. - */ - bus_space_write_1(bst, bsh, IOC_T1LOW, newint & 0xff); - bus_space_write_1(bst, bsh, IOC_T1HIGH, newint >> 8 & 0xff); - return IRQ_HANDLED; -} - -void -setstatclockrate(int hzrate) -{ - - /* Nothing to do here -- we've forced stathz == profhz above. */ - KASSERT(hzrate == stathz); -} - -/* - * IOC timecounter - * - * We construct a timecounter from timer 0, which is also running the - * hardclock interrupt. Since the timer 0 resets on every hardclock - * interrupt, we keep track of the high-order bits of the counter in - * software, incrementing it on every hardclock. If hardclock - * interrupts are disabled, there's a period where the timer has reset - * but the interrupt handler hasn't incremented the hight-order bits. - * We detect this by checking whether there's a hardclock interrupt - * pending. We take a bit of extra care to ensure that we aren't - * confused by the interrupt happening between our latching the - * timer's count and reading the interrupt flag. - */ -static u_int -ioc_get_timecount(struct timecounter *tc) -{ - struct ioc_softc *sc = tc->tc_priv; - bus_space_tag_t bst = sc->sc_bst; - bus_space_handle_t bsh = sc->sc_bsh; - u_int t0, count; - int s, intpending; - - s = splclock(); - bus_space_write_1(bst, bsh, IOC_T0LATCH, 0); - if (__predict_false((intpending = ioc_irq_status(IOC_IRQ_TM0)))) - bus_space_write_1(bst, bsh, IOC_T0LATCH, 0); - t0 = bus_space_read_1(bst, bsh, IOC_T0LOW); - t0 += bus_space_read_1(bst, bsh, IOC_T0HIGH) << 8; - count = sc->sc_tcbase - t0; - if (intpending) - count += t0_count + 1; - splx(s); - return count; -} - -void -delay(u_int usecs) -{ - - if (usecs <= 10 || cold) - cpu_delayloop(usecs * cpu_delay_factor); - else { - struct timeval start, gap, now, end; - - microtime(&start); - gap.tv_sec = usecs / 1000000; - gap.tv_usec = usecs % 1000000; - timeradd(&start, &gap, &end); - do { - microtime(&now); - } while (timercmp(&now, &end, <)); - } - -} Index: sys/arch/acorn26/iobus/iocreg.h =================================================================== RCS file: sys/arch/acorn26/iobus/iocreg.h diff -N sys/arch/acorn26/iobus/iocreg.h --- sys/arch/acorn26/iobus/iocreg.h 24 Mar 2002 15:47:13 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,160 +0,0 @@ -/* $NetBSD: iocreg.h,v 1.1 2002/03/24 15:47:13 bjh21 Exp $ */ - -/* - * Copyright (c) 1997 Ben Harris. - * Copyright (c) 1994 Mark Brinicombe. - * Copyright (c) 1994 Brini. - * All rights reserved. - * - * This code is derived from software written for Brini by Mark Brinicombe - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * 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 Brini. - * 4. The name of the company nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY BRINI ``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 BRINI 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. - */ - -/* - * iocreg.h - Acorn IOC (Albion/VC2311) registers - * - * Based on arch/arm32/include/iomd.h 1.7: - * Created : 18/09/94 - * Based on kate/display/iomd.h - */ - -#ifndef _ARM26_IOCREG_H -#define _ARM26_IOCREG_H - -/* - * These addresses are intended to be inputs to bus_space functions, - * and as such bits 0-4 here map to A[2:6] on the IOC. - */ - -/* Read Write */ -#define IOC_CTL 0x00 /* Control Control */ -#define IOC_KBDDAT 0x01 /* Kbd receive Kbd send */ - -#define IOC_IRQSTA 0x04 /* IRQ status A - */ -#define IOC_IRQRQA 0x05 /* IRQ request A IRQ clear */ -#define IOC_IRQMSKA 0x06 /* IRQ mask A IRQ mask A */ - -#define IOC_IRQSTB 0x08 /* IRQ status B - */ -#define IOC_IRQRQB 0x09 /* IRQ request B - */ -#define IOC_IRQMSKB 0x0a /* IRQ mask B IRQ mask B */ - -#define IOC_FIQST 0x0c /* FIQ status - */ -#define IOC_FIQRQ 0x0d /* FIQ request - */ -#define IOC_FIQMSK 0x0e /* FIQ mask FIQ mask */ - -#define IOC_T0LOW 0x10 /* T0 count low T0 latch low */ -#define IOC_T0HIGH 0x11 /* T0 count high T0 latch high */ -#define IOC_T0GO 0x12 /* - T0 go command */ -#define IOC_T0LATCH 0x13 /* - T0 latch command */ - -#define IOC_T1LOW 0x14 /* T1 count low T1 latch low */ -#define IOC_T1HIGH 0x15 /* T1 count high T1 latch high */ -#define IOC_T1GO 0x16 /* - T1 go command */ -#define IOC_T1LATCH 0x17 /* - T1 latch command */ - -#define IOC_T2LOW 0x18 /* T2 count low T2 latch low */ -#define IOC_T2HIGH 0x19 /* T2 count high T2 latch high */ -#define IOC_T2GO 0x1a /* - T2 go command */ -#define IOC_T2LATCH 0x1b /* - T2 latch command */ - -#define IOC_T3LOW 0x1c /* T3 count low T3 latch low */ -#define IOC_T3HIGH 0x1d /* T3 count high T3 latch high */ -#define IOC_T3GO 0x1e /* - T3 go command */ -#define IOC_T3LATCH 0x1f /* - T3 latch command */ - -#define IOC_SIZE 0x20 /* Total amount of bus space used by the IOC */ - -/* Control register bits (should most of these be defined here?) */ -#define IOC_CTL_SDA 0x01 /* IIC serial data */ -#define IOC_CTL_SCL 0x02 /* IIC serial clock */ -#define IOC_CTL_FLYBACK 0x80 /* Video flyback */ - -/* Archimdes machines only */ -#define IOC_CTL_FDREADY 0x04 /* Floppy disc ready */ -#define IOC_CTL_SMUTE 0x20 /* Speaker mute */ -#define IOC_CTL_LPTACK 0x40 /* Printer acknowledge */ - -/* IOEB machines only */ -#define IOC_CTL_FDDEN 0x04 /* Floppy disc media density */ -#define IOC_CTL_SSN 0x08 /* Electronic machine number */ -#define IOC_CTL_NINDEX 0x40 /* Floppy disc INDEX* signal */ - -/* Internal control register bits */ -/* These give the current state of the edge-sensitive IRQ lines */ -#define IOC_CTL_NIF 0x40 /* Set if IF* is high (IRQ 2) */ -#define IOC_CTL_IR 0x80 /* Set if IR is high (IRQ 3) */ - -/* IOC definitions of interrupt sources (independent of machine) */ -/* Hmm Interrupt numbers or masks? Numbers for now. */ -#define IOC_IRQ_IL6 0 /* Active low input */ -#define IOC_IRQ_IL7 1 /* Active low input */ -#define IOC_IRQ_IF 2 /* Falling edge-triggered */ -#define IOC_IRQ_IR 3 /* Rising edge-triggered */ -#define IOC_IRQ_POR 4 /* Power-on reset */ -#define IOC_IRQ_TM0 5 /* Timer 0 reloaded */ -#define IOC_IRQ_TM1 6 /* Timer 1 reloaded */ -#define IOC_IRQ_1 7 /* Always interrupt */ -#define IOC_IRQ_IL0 8 /* Active low input */ -#define IOC_IRQ_IL1 9 /* Active low input */ -#define IOC_IRQ_IL2 10 /* Active low input */ -#define IOC_IRQ_IL3 11 /* Active low input */ -#define IOC_IRQ_IL4 12 /* Active low input */ -#define IOC_IRQ_IL5 13 /* Active low input */ -#define IOC_IRQ_STX 14 /* KART transmit finished */ -#define IOC_IRQ_SRX 15 /* KART receive finished */ -#define IOC_IRQA_BIT(n) ((n) < 8 ? 1 << (n) : 0) -#define IOC_IRQB_BIT(n) ((n) < 8 ? 0 : 1 << ((n) - 8)) - -#define IOC_IRQ_CLEARABLE_MASK 0x7c - -/* FIQ sources */ -#define IOC_FIQ_FH0 0 /* Active high input */ -#define IOC_FIQ_FH1 1 /* Active high input */ -#define IOC_FIQ_FL 2 /* Active low input */ -#define IOC_FIQ_C3 3 /* Active low input (also ctl reg) */ -#define IOC_FIQ_C4 4 /* Active low input (also ctl reg) */ -#define IOC_FIQ_C5 5 /* Active low input (also ctl reg) */ -#define IOC_FIQ_IL0 6 /* Active low input (also IRQ) */ -#define IOC_FIQ_1 7 /* Always interrupt */ -#define IOC_FIQ_BIT(n) (1 << (n)) - -/* Cycle types */ -#define IOC_TYPE_SLOW 0 -#define IOC_TYPE_MEDIUM 1 -#define IOC_TYPE_FAST 2 -#define IOC_TYPE_SYNC 3 - -/* Counter decrement rate */ -#define IOC_TIMER_RATE 2000000 /* 2 MHz */ - -/* Archimedes-specific defines */ -#define IOC_TYPE_SHIFT (19 - 2) /* A[20:19] -> T[1:0] */ -#define IOC_BANK_SHIFT (16 - 2) /* A[18:16] -> B[2:0] */ - -#endif Index: sys/arch/acorn26/iobus/iocvar.h =================================================================== RCS file: sys/arch/acorn26/iobus/iocvar.h diff -N sys/arch/acorn26/iobus/iocvar.h --- sys/arch/acorn26/iobus/iocvar.h 11 May 2012 15:39:17 -0000 1.7 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,116 +0,0 @@ -/* $NetBSD: iocvar.h,v 1.7 2012/05/11 15:39:17 skrll Exp $ */ -/*- - * Copyright (c) 1998, 1999 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * iocvar.h - aspects of the IOC driver that are visible to the world. - */ - -#ifndef _ARM26_IOCVAR_H -#define _ARM26_IOCVAR_H - -#include -#include - -/* Structure passed to children of an IOC */ - -struct ioc_attach_args { - /* Means of accessing the device at various speeds */ - bus_space_tag_t ioc_fast_t; - bus_space_handle_t ioc_fast_h; - bus_space_tag_t ioc_medium_t; - bus_space_handle_t ioc_medium_h; - bus_space_tag_t ioc_slow_t; - bus_space_handle_t ioc_slow_h; - bus_space_tag_t ioc_sync_t; - bus_space_handle_t ioc_sync_h; - int ioc_bank; /* only for ioc_print */ - int ioc_offset; -}; - -struct ioc_softc { - device_t sc_dev; - bus_space_tag_t sc_bst; - bus_space_handle_t sc_bsh; - struct irq_handler *sc_clkirq; - struct evcnt sc_clkev; - struct irq_handler *sc_sclkirq; - struct evcnt sc_sclkev; - struct timecounter sc_tc; - u_int sc_tcbase; - uint8_t sc_ctl; -}; - -extern device_t the_ioc; - -/* Public IOC functions */ - -extern int ioc_irq_status(int); -extern void ioc_irq_waitfor(int); -extern void ioc_irq_clear(int); -extern uint32_t ioc_irq_status_full(void); -extern void ioc_irq_setmask(uint32_t); - -extern void ioc_fiq_setmask(uint32_t); - -extern void ioc_counter_start(device_t, int, int); - -/* - * Control Register - */ - -/* - * ioc_ctl_{read,write} - * - * Functions to manipulate the IOC control register. The bottom six - * bits of the control register map to bidirectional pins on the chip. - * The output circuits are open-drain, so a pin is made an input by - * writing '1' to it. - */ - -static inline u_int -ioc_ctl_read(device_t self) -{ - struct ioc_softc *sc = device_private(self); - - return bus_space_read_1(sc->sc_bst, sc->sc_bsh, IOC_CTL); -} - -static inline void -ioc_ctl_write(device_t self, u_int value, u_int mask) -{ - struct ioc_softc *sc = device_private(self); - int s; - bus_space_tag_t bst = sc->sc_bst; - bus_space_handle_t bsh = sc->sc_bsh; - - s = splhigh(); - sc->sc_ctl = (sc->sc_ctl & ~mask) | (value & mask); - bus_space_write_1(bst, bsh, IOC_CTL, sc->sc_ctl); - splx(s); -} - -#endif Index: sys/arch/acorn26/iobus/upc_iobus.c =================================================================== RCS file: sys/arch/acorn26/iobus/upc_iobus.c diff -N sys/arch/acorn26/iobus/upc_iobus.c --- sys/arch/acorn26/iobus/upc_iobus.c 27 Oct 2012 17:17:22 -0000 1.10 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,126 +0,0 @@ -/* $NetBSD: upc_iobus.c,v 1.10 2012/10/27 17:17:22 chs Exp $ */ -/*- - * Copyright (c) 2000 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * upc_iobus.c - attachment of the 82C7xx to the Archimedes I/O bus - */ - -#include -__KERNEL_RCSID(0, "$NetBSD: upc_iobus.c,v 1.10 2012/10/27 17:17:22 chs Exp $"); - -#include -#include - -#include - -#include -#include - -#include -#include - -#include "ioeb.h" - -#if NIOEB > 0 -#include -#endif - -static int upc_iobus_match(device_t , cfdata_t , void *); -static void upc_iobus_attach(device_t , device_t , void *); - -struct upc_iobus_softc { - struct upc_softc sc_upc; - struct evcnt sc_intrcnt4; - struct evcnt sc_intrcntw; - struct evcnt sc_intrcntf; - struct evcnt sc_intrcntp; -}; - -CFATTACH_DECL_NEW(upc_iobus, sizeof(struct upc_iobus_softc), - upc_iobus_match, upc_iobus_attach, NULL, NULL); - -static device_t the_upc_iobus; - -static int -upc_iobus_match(device_t parent, cfdata_t cf, void *aux) -{ - - /* - * As is traditional, probing for iobus devices is impossible - * (The machine hangs if there's nothing there). In this case, - * assume that if there's an IOEB, we've got a UPC too. - */ -#if NIOEB > 0 - if (the_ioeb != NULL && the_upc_iobus == NULL) - return 1; -#endif - return 0; -} - -static void -upc_iobus_attach(device_t parent, device_t self, void *aux) -{ - struct iobus_attach_args *ioa = aux; - struct upc_iobus_softc *sc = device_private(self); - struct upc_softc *upc = &sc->sc_upc; - - upc->sc_dev = self; - upc->sc_iot = ioa->ioa_tag; - bus_space_map(ioa->ioa_tag, ioa->ioa_base, UPC_BUS_SIZE, 0, - &upc->sc_ioh); - upc_attach(upc); - - if (upc->sc_irq4.uih_func != NULL) { - evcnt_attach_dynamic(&sc->sc_intrcnt4, EVCNT_TYPE_INTR, NULL, - device_xname(self), "irq4"); - irq_establish(IOC_IRQ_IL2, upc->sc_irq4.uih_level, - upc->sc_irq4.uih_func, upc->sc_irq4.uih_arg, - &sc->sc_intrcnt4); - } - if (upc->sc_wintr.uih_func != NULL) { - evcnt_attach_dynamic(&sc->sc_intrcntw, EVCNT_TYPE_INTR, NULL, - device_xname(self), "wdc intr"); - irq_establish(IOC_IRQ_IL3, upc->sc_wintr.uih_level, - upc->sc_wintr.uih_func, upc->sc_wintr.uih_arg, - &sc->sc_intrcntw); - } - if (upc->sc_fintr.uih_func != NULL) { - evcnt_attach_dynamic(&sc->sc_intrcntf, EVCNT_TYPE_INTR, NULL, - device_xname(self), "fdc intr"); - irq_establish(IOC_IRQ_IL4, upc->sc_fintr.uih_level, - upc->sc_fintr.uih_func, upc->sc_fintr.uih_arg, - &sc->sc_intrcntf); - } - if (upc->sc_pintr.uih_func != NULL) { - evcnt_attach_dynamic(&sc->sc_intrcntp, EVCNT_TYPE_INTR, NULL, - device_xname(self), "lpt intr"); - irq_establish(IOC_IRQ_IL6, upc->sc_pintr.uih_level, - upc->sc_pintr.uih_func, upc->sc_pintr.uih_arg, - &sc->sc_intrcntp); - } - /* IRQ3 on the 82C71x is not connected */ -} Index: sys/arch/acorn26/ioc/arckbd.c =================================================================== RCS file: sys/arch/acorn26/ioc/arckbd.c diff -N sys/arch/acorn26/ioc/arckbd.c --- sys/arch/acorn26/ioc/arckbd.c 13 Apr 2015 21:18:40 -0000 1.24 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,641 +0,0 @@ -/* $NetBSD: arckbd.c,v 1.24 2015/04/13 21:18:40 riastradh Exp $ */ -/*- - * Copyright (c) 1998, 1999, 2000 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * arckbd.c - Archimedes keyboard driver - */ - -/* - * Most of the information used to write this driver came from the - * A3000 Technical Reference Manual (ISBN 1-85250-074-3). - * - * We keep a queue of one command in the softc for use by the receive - * interrupt handler in case it finds the KART is already transmitting - * a command (presumably as a consequence of a user request) when it - * wants to. I think this is safe in all cases, and it will never - * happen more than once at a time (I hope). - */ - -#include -__KERNEL_RCSID(0, "$NetBSD: arckbd.c,v 1.24 2015/04/13 21:18:40 riastradh Exp $"); - -#include -#include -#include -#include -#include -#include -#include /* For bootverbose */ -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "wskbd.h" -#include "wsmouse.h" - -#include - -/* #define ARCKBD_DEBUG */ - -enum arckbd_state { - AS_HRST, AS_RAK1, AS_RAK2, /* reset protocol */ - AS_IDLE, /* idle, waiting for data */ - AS_KDDA, AS_KUDA, AS_MDAT /* Receiving two-byte message */ -}; - -static const char *arckbd_statenames[] = { - "hrst", "rak1", "rak2", "idle", "kdda", "kuda", "mdat" -}; - -static int arckbd_match(device_t parent, cfdata_t cf, void *aux); -static void arckbd_attach(device_t parent, device_t self, void *aux); -#if 0 /* XXX should be used */ -static kbd_t arckbd_pick_layout(int kbid); -#endif - -static int arckbd_rint(void *self); -static int arckbd_xint(void *self); -static void arckbd_mousemoved(device_t self, int byte1, int byte2); -static void arckbd_keyupdown(device_t self, int byte1, int byte2); -static int arckbd_send(device_t self, int data, - enum arckbd_state newstate, int waitok); - -static int arckbd_enable(void *cookie, int on); -static int arckbd_led_encode(int); -static int arckbd_led_decode(int); -static void arckbd_set_leds(void *cookie, int new_state); -static int arckbd_ioctl(void *cookie, u_long cmd, void *data, int flag, - struct lwp *l); -#if NWSKBD > 0 -static void arckbd_getc(void *cookie, u_int *typep, int *valuep); -static void arckbd_pollc(void *cookie, int poll); -#endif - -static int arcmouse_enable(void *cookie); -static int arcmouse_ioctl(void *cookie, u_long cmd, void *data, int flag, - struct lwp *l); -static void arcmouse_disable(void *cookie); - -struct arckbd_softc { - device_t sc_dev; - bus_space_tag_t sc_bst; - bus_space_handle_t sc_bsh; - u_int sc_mouse_buttons; - enum arckbd_state sc_state; - u_char sc_byteone; - u_char sc_kbid; - device_t sc_wskbddev; - device_t sc_wsmousedev; - struct wskbd_mapdata sc_mapdata; - int sc_cmdqueue; /* Single-command queue */ - enum arckbd_state sc_statequeue; - int sc_cmdqueued; - int sc_flags; - int sc_leds; - u_int sc_poll_type; - int sc_poll_value; - struct irq_handler *sc_xirq; - struct evcnt sc_xev; - struct irq_handler *sc_rirq; - struct evcnt sc_rev; - krndsource_t sc_rnd_source; -}; - -#define AKF_WANTKBD 0x01 -#define AKF_WANTMOUSE 0x02 -#define AKF_SENTRQID 0x04 -#define AKF_SENTLEDS 0x08 -#define AKF_POLLING 0x10 - -CFATTACH_DECL_NEW(arckbd, sizeof(struct arckbd_softc), - arckbd_match, arckbd_attach, NULL, NULL); - -static struct wskbd_accessops arckbd_accessops = { - arckbd_enable, arckbd_set_leds, arckbd_ioctl -}; - -#if NWSKBD > 0 -static struct wskbd_consops arckbd_consops = { - arckbd_getc, arckbd_pollc -}; -#endif - -static struct wsmouse_accessops arcmouse_accessops = { - arcmouse_enable, arcmouse_ioctl, arcmouse_disable -}; - -/* ARGSUSED */ -static int -arckbd_match(device_t parent, cfdata_t cf, void *aux) -{ - - /* Assume presence for now */ - return 1; -} - -static void -arckbd_attach(device_t parent, device_t self, void *aux) -{ - struct arckbd_softc *sc = device_private(self); - struct ioc_attach_args *ioc = aux; - bus_space_tag_t bst; - bus_space_handle_t bsh; - struct wskbddev_attach_args wskbdargs; - struct wsmousedev_attach_args wsmouseargs; - - bst = sc->sc_bst = ioc->ioc_fast_t; - bsh = sc->sc_bsh = ioc->ioc_fast_h; - - sc->sc_dev = self; - evcnt_attach_dynamic(&sc->sc_rev, EVCNT_TYPE_INTR, NULL, - device_xname(sc->sc_dev), "rx intr"); - sc->sc_rirq = irq_establish(IOC_IRQ_SRX, IPL_TTY, arckbd_rint, self, - &sc->sc_rev); - aprint_verbose("\n%s: interrupting at %s (rx)", device_xname(self), - irq_string(sc->sc_rirq)); - - evcnt_attach_dynamic(&sc->sc_xev, EVCNT_TYPE_INTR, NULL, - device_xname(sc->sc_dev), "tx intr"); - sc->sc_xirq = irq_establish(IOC_IRQ_STX, IPL_TTY, arckbd_xint, self, - &sc->sc_xev); - irq_disable(sc->sc_xirq); - aprint_verbose(" and %s (tx)", irq_string(sc->sc_xirq)); - - /* Initialisation of IOC KART per IOC Data Sheet section 6.2.3. */ - - /* Set up IOC counter 3 */ - /* k_BAUD = 1/((latch+1)*16) MHz */ - ioc_counter_start(parent, 3, 62500 / ARCKBD_BAUD - 1); - - /* Read from Rx register and discard. */ - (void)bus_space_read_1(bst, bsh, 0); - - /* Kick the keyboard into life */ - arckbd_send(self, ARCKBD_HRST, AS_HRST, 0); - - sc->sc_mapdata = arckbd_mapdata_default; - sc->sc_mapdata.layout = KB_UK; /* Reasonable default */ - - /* Attach the wskbd console */ - arckbd_cnattach(self); - - aprint_normal("\n"); - - /* XXX We do not ESTIMATE_VALUE because we are feeding two - data streams (mouse, kbd) into the same source. XXX */ - rnd_attach_source(&sc->sc_rnd_source, device_xname(self), - RND_TYPE_TTY, RND_FLAG_DEFAULT); - - wskbdargs.console = 1; /* XXX FIXME */ - wskbdargs.keymap = &sc->sc_mapdata; - wskbdargs.accessops = &arckbd_accessops; - wskbdargs.accesscookie = sc; - sc->sc_wskbddev = config_found_ia(self, "wskbddev", &wskbdargs, NULL); - - wsmouseargs.accessops = &arcmouse_accessops; - wsmouseargs.accesscookie = sc; - sc->sc_wsmousedev = - config_found_ia(self, "wsmousedev", &wsmouseargs, NULL); -} - -#if 0 /* XXX should be used */ -static kbd_t -arckbd_pick_layout(int kbid) -{ - int i; - - for (i = 0; arckbd_kbidtab[i].kbid != 0; i++) { - if (arckbd_kbidtab[i].kbid == kbid) - return arckbd_kbidtab[i].layout; - } - return KB_UK; -} -#endif - -/* - * We don't really _need_ a console keyboard before - * autoconfiguration's finished, so for now this function's written to - * be called from arckbd_attach. The console functions should still - * try not to rely on much, and perhaps one day we should make it - * happen in consinit instead. - */ - -void -arckbd_cnattach(device_t self) -{ -#if NWSKBD > 0 - struct arckbd_softc *sc = device_private(self); - - wskbd_cnattach(&arckbd_consops, sc, &arckbd_mapdata_default); -#endif -} - -#if NWSKBD > 0 -static void -arckbd_getc(void *cookie, u_int *typep, int *valuep) -{ - struct arckbd_softc *sc = cookie; - int s; - - if (!(sc->sc_flags & AKF_POLLING)) - panic("%s: arckbd_getc called with polling disabled", - device_xname(sc->sc_dev)); - while (sc->sc_poll_type == 0) { - if (ioc_irq_status(IOC_IRQ_STX)) - arckbd_xint(sc->sc_dev); - if (ioc_irq_status(IOC_IRQ_SRX)) - arckbd_rint(sc->sc_dev); - } - s = spltty(); - *typep = sc->sc_poll_type; - *valuep = sc->sc_poll_value; - sc->sc_poll_type = 0; - sc->sc_poll_value = 0; - splx(s); -} - -static void -arckbd_pollc(void *cookie, int poll) -{ - struct arckbd_softc *sc = cookie; - int s; - - s = spltty(); - if (poll) { - sc->sc_flags |= AKF_POLLING; - irq_disable(sc->sc_rirq); - irq_disable(sc->sc_xirq); - } else { - sc->sc_flags &= ~AKF_POLLING; - irq_enable(sc->sc_rirq); - irq_enable(sc->sc_xirq); - } - splx(s); -} -#endif - -static int -arckbd_send(device_t self, int data, enum arckbd_state newstate, int waitok) -{ - struct arckbd_softc *sc = device_private(self); - int s, res; - bus_space_tag_t bst = sc->sc_bst; - bus_space_handle_t bsh = sc->sc_bsh; - - s = spltty(); - if (waitok) { - while (!ioc_irq_status(IOC_IRQ_STX)) - if ((sc->sc_flags & AKF_POLLING) == 0) { - res = tsleep(arckbd_send, PWAIT, "kbdsend", 0); - if (res != 0) - return res; - } - } else if (!ioc_irq_status(IOC_IRQ_STX)) { - if (sc->sc_cmdqueued) - panic("%s: queue overflow", device_xname(sc->sc_dev)); - else { - sc->sc_cmdqueue = data; - sc->sc_statequeue = newstate; - sc->sc_cmdqueued = 1; - return 0; - } - } - bus_space_write_1(bst, bsh, 0, data); - sc->sc_state = newstate; -#ifdef ARCKBD_DEBUG - log(LOG_DEBUG, "%s: sent 0x%02x. now in state %s\n", - device_xname(sc->sc_dev), data, arckbd_statenames[newstate]); -#endif - wakeup(&sc->sc_state); - splx(s); - if ((sc->sc_flags & AKF_POLLING) == 0) - irq_enable(sc->sc_xirq); - return 0; -} - -static int -arckbd_xint(void *cookie) -{ - struct arckbd_softc *sc = device_private(cookie); - - irq_disable(sc->sc_xirq); - /* First, process queued commands (acks from the last receive) */ - if (sc->sc_cmdqueued) { - sc->sc_cmdqueued = 0; - arckbd_send(sc->sc_dev, sc->sc_cmdqueue, sc->sc_statequeue, 0); - } else if (sc->sc_state == AS_IDLE) { - /* Do things that need doing after a reset */ - if (!(sc->sc_flags & AKF_SENTRQID)) { - arckbd_send(sc->sc_dev, ARCKBD_RQID, AS_IDLE, 0); - sc->sc_flags |= AKF_SENTRQID; - } else if (!(sc->sc_flags & AKF_SENTLEDS)) { - arckbd_send(sc->sc_dev, ARCKBD_LEDS | sc->sc_leds, - AS_IDLE, 0); - sc->sc_flags |= AKF_SENTLEDS; - } - } else if ((sc->sc_flags & AKF_POLLING) == 0) - wakeup(&arckbd_send); - return IRQ_HANDLED; -} - -static int -arckbd_rint(void *cookie) -{ - device_t self = cookie; - struct arckbd_softc *sc = device_private(self); - bus_space_tag_t bst = sc->sc_bst; - bus_space_handle_t bsh = sc->sc_bsh; - int data; - - data = bus_space_read_1(bst, bsh, 0); -#ifdef ARCKBD_DEBUG - log(LOG_DEBUG, "%s: got 0x%02x in state %s\n", device_xname(self), data, - arckbd_statenames[sc->sc_state]); -#endif - /* Reset protocol */ - if (data == ARCKBD_HRST && sc->sc_state == AS_HRST) - arckbd_send(self, ARCKBD_RAK1, AS_RAK1, 0); - else if (data == ARCKBD_RAK1 && - (sc->sc_state == AS_RAK1 || sc->sc_state == AS_HRST)) - arckbd_send(self, ARCKBD_RAK2, AS_RAK2, 0); - else if (data == ARCKBD_RAK2 && sc->sc_state == AS_RAK2) - arckbd_send(self, ARCKBD_SMAK, AS_IDLE, 0); - - /* - * Note that for data messages, we acknowledge first and - * _then_ process the data. This is important because the - * processing may end up trying to use the keyboard in polled - * mode (e.g. through DDB) and we'd like its state to be - * self-consistent. - */ - - /* Mouse data */ - else if (ARCKBD_IS_MDAT(data) && sc->sc_state == AS_IDLE) { - arckbd_send(self, ARCKBD_BACK, AS_MDAT, 0); - sc->sc_byteone = data; - } else if (ARCKBD_IS_MDAT(data) && sc->sc_state == AS_MDAT) { - arckbd_send(self, ARCKBD_SMAK, AS_IDLE, 0); - arckbd_mousemoved(self, sc->sc_byteone, data); - } - - /* Key down data */ - else if (ARCKBD_IS_KDDA(data) && sc->sc_state == AS_IDLE) { - arckbd_send(self, ARCKBD_BACK, AS_KDDA, 0); - sc->sc_byteone = data; - } else if (ARCKBD_IS_KDDA(data) && sc->sc_state == AS_KDDA) { - arckbd_send(self, ARCKBD_SMAK, AS_IDLE, 0); - arckbd_keyupdown(self, sc->sc_byteone, data); - } - - /* Key up data */ - else if (ARCKBD_IS_KUDA(data) && sc->sc_state == AS_IDLE) { - arckbd_send(self, ARCKBD_BACK, AS_KUDA, 0); - sc->sc_byteone = data; - } else if (ARCKBD_IS_KUDA(data) && sc->sc_state == AS_KUDA) { - arckbd_send(self, ARCKBD_SMAK, AS_IDLE, 0); - arckbd_keyupdown(self, sc->sc_byteone, data); - } - - /* Other cruft */ - else if (ARCKBD_IS_KBID(data)) { - arckbd_send(self, ARCKBD_SMAK, AS_IDLE, 0); - if (sc->sc_kbid != data) { - printf("%s: layout %d\n", - device_xname(self), data & ~ARCKBD_KBID); - sc->sc_kbid = data; - } - } else if (ARCKBD_IS_PDAT(data)) - /* unused -- ignore it */; - else { - /* Protocol error */ - log(LOG_WARNING, "%s: protocol error: got 0x%02x in state %s\n", - device_xname(self), data, arckbd_statenames[sc->sc_state]); - arckbd_send(self, ARCKBD_HRST, AS_HRST, 0); - } - return IRQ_HANDLED; -} - -static void -arckbd_mousemoved(device_t self, int byte1, int byte2) -{ - struct arckbd_softc *sc = device_private(self); - - rnd_add_uint32(&sc->sc_rnd_source, byte1); -#if NWSMOUSE > 0 - if (sc->sc_wsmousedev != NULL) { - int dx, dy; - - /* deltas are 7-bit signed */ - dx = byte1 < 0x40 ? byte1 : byte1 - 0x80; - dy = byte2 < 0x40 ? byte2 : byte2 - 0x80; - wsmouse_input(sc->sc_wsmousedev, - sc->sc_mouse_buttons, - dx, dy, 0, 0, - WSMOUSE_INPUT_DELTA); - } -#endif -} - -static void -arckbd_keyupdown(device_t self, int byte1, int byte2) -{ - struct arckbd_softc *sc = device_private(self); - u_int type; - int value; - - rnd_add_uint32(&sc->sc_rnd_source, byte1); - if ((byte1 & 0x0f) == 7) { - /* Mouse button event */ - /* - * This is all very silly, as the wsmouse driver then - * differentiates the button state to see if there's - * an event worth passing to the user. - * - * Oh well, at least NetBSD and Acorn number their - * mouse buttons the same way. - */ - if (ARCKBD_IS_KDDA(byte1)) - sc->sc_mouse_buttons |= (1 << (byte2 & 0x0f)); - else - sc->sc_mouse_buttons &= ~(1 << (byte2 & 0x0f)); -#if NWSMOUSE > 0 - if (sc->sc_wsmousedev != NULL) - wsmouse_input(sc->sc_wsmousedev, - sc->sc_mouse_buttons, - 0, 0, 0, 0, - WSMOUSE_INPUT_DELTA); -#endif - } else { - type = ARCKBD_IS_KDDA(byte1) ? - WSCONS_EVENT_KEY_DOWN : WSCONS_EVENT_KEY_UP; - value = ((byte1 & 0x0f) << 4) | (byte2 & 0x0f); - if (sc->sc_flags & AKF_POLLING) { - sc->sc_poll_type = type; - sc->sc_poll_value = value; - } -#if NWSKBD > 0 - else if (sc->sc_wskbddev != NULL) - wskbd_input(sc->sc_wskbddev, type, value); -#endif - } -} - -/* - * Keyboard access functions - */ - -static int -arckbd_enable(void *cookie, int on) -{ - struct arckbd_softc *sc = cookie; - - if (on) { - sc->sc_flags |= AKF_WANTKBD; - /* XXX send RQMP? */ - } else - sc->sc_flags &= ~ AKF_WANTKBD; - return 0; -} - -static int -arckbd_led_encode(int wsleds) -{ - int arcleds; - - arcleds = 0; - if (wsleds & WSKBD_LED_CAPS) - arcleds |= ARCKBD_LEDS_CAPSLOCK; - if (wsleds & WSKBD_LED_NUM) - arcleds |= ARCKBD_LEDS_NUMLOCK; - if (wsleds & WSKBD_LED_SCROLL) - arcleds |= ARCKBD_LEDS_SCROLLLOCK; - /* No "compose" LED */ - return arcleds; -} - -static int -arckbd_led_decode(int arcleds) -{ - int wsleds; - - wsleds = 0; - if (arcleds & ARCKBD_LEDS_CAPSLOCK) - wsleds |= WSKBD_LED_CAPS; - if (arcleds & ARCKBD_LEDS_NUMLOCK) - wsleds |= WSKBD_LED_NUM; - if (arcleds & ARCKBD_LEDS_SCROLLLOCK) - wsleds |= WSKBD_LED_SCROLL; - /* No "compose" LED */ - return wsleds; -} - -/* - * Set the LEDs to the requested state. - * - * Be warned: This function gets called from interrupts. - */ -static void -arckbd_set_leds(void *cookie, int new_state) -{ - struct arckbd_softc *sc = cookie; - int s; - - s = spltty(); - sc->sc_leds = arckbd_led_encode(new_state); - if (arckbd_send(sc->sc_dev, ARCKBD_LEDS | sc->sc_leds, AS_IDLE, 0) == 0) - sc->sc_flags |= AKF_SENTLEDS; - splx(s); -} - -/* ARGSUSED */ -static int -arckbd_ioctl(void *cookie, u_long cmd, void *data, int flag, struct lwp *l) -{ - struct arckbd_softc *sc = cookie; - - switch (cmd) { - case WSKBDIO_GTYPE: - *(int *)data = WSKBD_TYPE_ARCHIMEDES; - return 0; - case WSKBDIO_SETLEDS: - arckbd_set_leds(sc, *(int *)data); - return 0; - case WSKBDIO_GETLEDS: - *(int *)data = arckbd_led_decode(sc->sc_leds); - return 0; - } - return EPASSTHROUGH; -} - -/* - * Mouse access functions - */ - -static int -arcmouse_enable(void *cookie) -{ - struct arckbd_softc *sc = cookie; - - sc->sc_flags |= AKF_WANTMOUSE; - /* XXX send RQMP */ - return 0; -} - -/* ARGSUSED */ -static int -arcmouse_ioctl(void *cookie, u_long cmd, void *data, int flag, struct lwp *l) -{ -/* struct arckbd_softc *sc = cookie; */ - - switch (cmd) { - case WSMOUSEIO_GTYPE: - *(int *)data = WSMOUSE_TYPE_ARCHIMEDES; - return 0; - } - return EPASSTHROUGH; -} - -static void -arcmouse_disable(void *cookie) -{ - struct arckbd_softc *sc = cookie; - - sc->sc_flags &= ~AKF_WANTMOUSE; -} Index: sys/arch/acorn26/ioc/arckbdmap.c =================================================================== RCS file: sys/arch/acorn26/ioc/arckbdmap.c diff -N sys/arch/acorn26/ioc/arckbdmap.c --- sys/arch/acorn26/ioc/arckbdmap.c 11 Dec 2005 12:16:04 -0000 1.5 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,233 +0,0 @@ -/* $NetBSD: arckbdmap.c,v 1.5 2005/12/11 12:16:04 christos Exp $ */ -/*- - * Copyright (c) 1998 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * arckbdmap.c - Archimedes keyboard maps - */ - -#include -__KERNEL_RCSID(0, "$NetBSD: arckbdmap.c,v 1.5 2005/12/11 12:16:04 christos Exp $"); - -#include -#include -#include -#include -#include -#include - -#define KC(n) (0xe000 | (n)) /* see wsksymdef.h */ - -/* Arc keycodes are 0xrc where r and c are the row and column codes */ - -static const keysym_t arckbd_keydesc_uk[] = { -/* pos command normal shifted */ - KC(0x00), KS_Cmd_Debugger,KS_Escape, - KC(0x01), KS_Cmd_Screen0, KS_f1, - KC(0x02), KS_Cmd_Screen1, KS_f2, - KC(0x03), KS_Cmd_Screen2, KS_f3, - KC(0x04), KS_Cmd_Screen3, KS_f4, - KC(0x05), KS_Cmd_Screen4, KS_f5, - KC(0x06), KS_Cmd_Screen5, KS_f6, - KC(0x07), KS_Cmd_Screen6, KS_f7, - KC(0x08), KS_Cmd_Screen7, KS_f8, - KC(0x09), KS_Cmd_Screen8, KS_f9, - KC(0x0a), KS_Cmd_Screen9, KS_f10, - KC(0x0b), KS_f11, - KC(0x0c), KS_f12, - KC(0x0d), KS_voidSymbol, /* print: no keysym yet */ - KC(0x0e), KS_Hold_Screen, /* scroll lock */ - KC(0x0f), KS_voidSymbol, /* break: no keysym yet */ - - KC(0x10), KS_grave, KS_asciitilde, - KC(0x11), KS_1, KS_exclam, - KC(0x12), KS_2, KS_at, - KC(0x13), KS_3, KS_numbersign, - KC(0x14), KS_4, KS_dollar, - KC(0x15), KS_5, KS_percent, - KC(0x16), KS_6, KS_asciicircum, - KC(0x17), KS_7, KS_ampersand, - KC(0x18), KS_8, KS_asterisk, - KC(0x19), KS_9, KS_parenleft, - KC(0x1a), KS_0, KS_parenright, - KC(0x1b), KS_minus, KS_underscore, - KC(0x1c), KS_equal, KS_plus, - KC(0x1d), KS_sterling, KS_currency, - KC(0x1e), KS_BackSpace, - KC(0x1f), KS_Insert, - KC(0x20), KS_Home, - KC(0x21), KS_Prior, - KC(0x22), KS_Num_Lock, - KC(0x23), KS_KP_Divide, - KC(0x24), KS_KP_Multiply, - KC(0x25), KS_KP_Numbersign, - - KC(0x26), KS_Tab, - KC(0x27), KS_q, - KC(0x28), KS_w, - KC(0x29), KS_e, - KC(0x2a), KS_r, - KC(0x2b), KS_t, - KC(0x2c), KS_y, - KC(0x2d), KS_u, - KC(0x2e), KS_i, - KC(0x2f), KS_o, - KC(0x30), KS_p, - KC(0x31), KS_bracketleft, KS_braceleft, - KC(0x32), KS_bracketright,KS_braceright, - KC(0x33), KS_backslash, KS_bar, - KC(0x34), KS_Delete, - KC(0x35), KS_End, /* really Copy */ - KC(0x36), KS_Next, - KC(0x37), KS_KP_7, - KC(0x38), KS_KP_8, - KC(0x39), KS_KP_9, - KC(0x3a), KS_KP_Subtract, - - KC(0x3b), KS_Cmd1, KS_Control_L, - KC(0x3c), KS_a, - KC(0x3d), KS_s, - KC(0x3e), KS_d, - KC(0x3f), KS_f, - KC(0x40), KS_g, - KC(0x41), KS_h, - KC(0x42), KS_j, - KC(0x43), KS_k, - KC(0x44), KS_l, - KC(0x45), KS_semicolon, KS_colon, - KC(0x46), KS_apostrophe, KS_quotedbl, - KC(0x47), KS_Return, - KC(0x48), KS_KP_4, - KC(0x49), KS_KP_5, - KC(0x4a), KS_KP_6, - KC(0x4b), KS_KP_Add, - - KC(0x4c), KS_Shift_L, - KC(0x4e), KS_z, - KC(0x4f), KS_x, - KC(0x50), KS_c, - KC(0x51), KS_v, - KC(0x52), KS_b, - KC(0x53), KS_n, - KC(0x54), KS_m, - KC(0x55), KS_comma, KS_less, - KC(0x56), KS_period, KS_greater, - KC(0x57), KS_slash, KS_question, - KC(0x58), KS_Shift_R, - KC(0x59), KS_Up, - KC(0x5a), KS_KP_1, - KC(0x5b), KS_KP_2, - KC(0x5c), KS_KP_3, - - KC(0x5d), KS_Caps_Lock, - KC(0x5e), KS_Cmd2, KS_Alt_L, - KC(0x5f), KS_space, - KC(0x60), KS_Alt_R, - KC(0x61), KS_Control_R, - KC(0x62), KS_Left, - KC(0x63), KS_Down, - KC(0x64), KS_Right, - KC(0x65), KS_KP_0, - KC(0x66), KS_KP_Decimal, - KC(0x67), KS_KP_Enter, - - /* Mouse buttons */ - KC(0x70), KS_voidSymbol, /* left */ - KC(0x71), KS_voidSymbol, /* middle */ - KC(0x72), KS_voidSymbol, /* right */ -}; - -static const keysym_t arckbd_keydesc_no[] = { -/* Based on uk */ - KC(0x12), KS_2, KS_quotedbl, KS_apostrophe, - KC(0x14), KS_4, KS_dollar, KS_currency, - KC(0x16), KS_6, KS_ampersand, - KC(0x17), KS_7, KS_slash, KS_braceleft, - KC(0x18), KS_8, KS_parenleft, KS_bracketleft, - KC(0x19), KS_9, KS_parenright, KS_bracketright, - KC(0x1a), KS_0, KS_equal, KS_braceright, - KC(0x1b), KS_plus, KS_question, - KC(0x1c), KS_less, KS_greater, KS_bar, - KC(0x1d), KS_at, KS_sterling, - KC(0x31), KS_aring, - KC(0x32), KS_asciicircum, KS_asterisk, - KC(0x45), KS_oslash, - KC(0x46), KS_ae, - KC(0x4d), KS_less, KS_greater, - KC(0x55), KS_comma, KS_semicolon, - KC(0x56), KS_period, KS_colon, - KC(0x57), KS_minus, KS_underscore, -}; - -static const keysym_t arckbd_keydesc_se[] = { -/* Based on no */ -/* pos normal shifted altgred */ - KC(0x32), KS_udiaeresis, - KC(0x33), KS_asciicircum, KS_asterisk, KS_backslash, - KC(0x45), KS_odiaeresis, - KC(0x46), KS_adiaeresis, -}; - -static const keysym_t arckbd_keydesc_de[] = { -/* Based on se */ -/* pos normal shifted altgred */ - KC(0x10), KS_asciicircum, KS_degree, - KC(0x12), KS_2, KS_quotedbl, - KC(0x13), KS_3, KS_section, - KC(0x14), KS_4, KS_dollar, - KC(0x1b), KS_ssharp, KS_question, KS_backslash, - KC(0x1c), KS_dead_acute, KS_dead_grave, - KC(0x27), KS_q, KS_Q, KS_at, - KC(0x2c), KS_z, - KC(0x31), KS_udiaeresis, - KC(0x32), KS_plus, KS_asterisk, KS_asciitilde, - KC(0x33), KS_numbersign, KS_apostrophe, - KC(0x4e), KS_y, - KC(0x54), KS_m, KS_M, KS_mu, -}; - -#define KBD_MAP(name, base, map) \ - { name, base, sizeof(map)/sizeof(keysym_t), map } - -static const struct wscons_keydesc arckbd_keydesctab[] = { - KBD_MAP(KB_UK, 0, arckbd_keydesc_uk), - KBD_MAP(KB_NO, KB_UK, arckbd_keydesc_no), - KBD_MAP(KB_SV, KB_NO, arckbd_keydesc_se), - KBD_MAP(KB_DE, KB_SV, arckbd_keydesc_de), - {0}, -}; - -const struct wskbd_mapdata arckbd_mapdata_default = { - arckbd_keydesctab, KB_UK -}; - -const struct arckbd_kbidtab arckbd_kbidtab[] = { - { ARCKBD_KBID_UK, KB_UK }, - { ARCKBD_KBID_NO, KB_NO }, - { ARCKBD_KBID_SE, KB_SV }, - { ARCKBD_KBID_DE, KB_DE }, - { -1 }, -}; Index: sys/arch/acorn26/ioc/arckbdreg.h =================================================================== RCS file: sys/arch/acorn26/ioc/arckbdreg.h diff -N sys/arch/acorn26/ioc/arckbdreg.h --- sys/arch/acorn26/ioc/arckbdreg.h 24 Mar 2002 23:37:44 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,93 +0,0 @@ -/* $NetBSD: arckbdreg.h,v 1.2 2002/03/24 23:37:44 bjh21 Exp $ */ -/*- - * Copyright (c) 1997, 1998 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * arckbdreg.h - Archimedes keyboard codes - */ - -#ifndef _ARCKBDREG_H -#define _ARCKBDREG_H - -#define ARCKBD_HRST 0xff /* keyboard reset */ -#define ARCKBD_RAK1 0xfe /* first reset acknowledge */ -#define ARCKBD_RAK2 0xfd /* second reset acknowledge */ -#define ARCKBD_RQPD 0x40 /* reserved */ -#define ARCKBD_PDAT 0xe0 /* response to RQPD */ -#define ARCKBD_IS_PDAT(d) (((d) & 0xf0) == ARCKBD_PDAT) -#define ARCKBD_RQID 0x20 /* request keyboard ID */ -#define ARCKBD_KBID 0x80 /* keyboard ID (bottom 6 bits) */ -#define ARCKBD_IS_KBID(d) (((d) & 0xc0) == ARCKBD_KBID) -#define ARCKBD_KDDA 0xc0 /* key down data (bottom 4 bits plus next byte) */ -#define ARCKBD_IS_KDDA(d) (((d) & 0xf0) == ARCKBD_KDDA) -#define ARCKBD_KUDA 0xd0 /* key up data (bottom 4 bits plus next byte) */ -#define ARCKBD_IS_KUDA(d) (((d) & 0xf0) == ARCKBD_KUDA) -#define ARCKBD_RQMP 0x22 /* request mouse position */ -#define ARCKBD_MDAT 0x00 /* mouse movement data */ -#define ARCKBD_IS_MDAT(d) (((d) & 0x80) == ARCKBD_MDAT) -#define ARCKBD_BACK 0x3f /* acknowledge first byte of pair */ -#define ARCKBD_NACK 0x30 /* acknowledge -- send no more */ -#define ARCKBD_SACK 0x31 /* acknowledge -- send only keyup/down */ -#define ARCKBD_MACK 0x32 /* acknowledge -- send only mouse events */ -#define ARCKBD_SMAK 0x33 /* acknowledge -- send mouse or kbd events */ -#define ARCKBD_LEDS 0x00 /* Set LEDs: */ -#define ARCKBD_LEDS_CAPSLOCK 0x01 /* Caps lock */ -#define ARCKBD_LEDS_NUMLOCK 0x02 /* Num lock */ -#define ARCKBD_LEDS_SCROLLLOCK 0x04 /* Scroll lock */ -#define ARCKBD_PRST 0x21 /* reserved */ - -#define ARCKBD_BAUD 31250 /* Data rate on keyboard serial link */ - -/* Keyboard ID codes */ - -/* Inferred from the ARMsi documentation */ -#define ARCKBD_KBID_A500 0x80 /* A500 prototype keyboard */ -/* Determined by experiment */ -#define ARCKBD_KBID_UK 0x81 /* Archimedes UK keyboard */ -/* These are from the RISC OS 2 PRM, page 1666: */ -#define ARCKBD_KBID_MASTER 0x82 -#define ARCKBD_KBID_COMPACT 0x83 -#define ARCKBD_KBID_IT 0x84 -#define ARCKBD_KBID_ES 0x85 -#define ARCKBD_KBID_FR 0x86 -#define ARCKBD_KBID_DE 0x87 -#define ARCKBD_KBID_PT 0x88 -#define ARCKBD_KBID_ESPERANTO 0x89 -#define ARCKBD_KBID_GR 0x8a -#define ARCKBD_KBID_SE 0x8b -#define ARCKBD_KBID_FI 0x8c -#define ARCKBD_KBID_DK 0x8e -#define ARCKBD_KBID_NO 0x8f -#define ARCKBD_KBID_IS 0x90 -#define ARCKBD_KBID_CA1 0x91 -#define ARCKBD_KBID_CA2 0x92 -#define ARCKBD_KBID_CA 0x93 -#define ARCKBD_KBID_TR 0x94 -#define ARCKBD_KBID_ARABIC 0x95 -#define ARCKBD_KBID_IE 0x96 -#define ARCKBD_KBID_HK 0x97 - -#endif /* !_ARCKBDREG_H */ Index: sys/arch/acorn26/ioc/arckbdvar.h =================================================================== RCS file: sys/arch/acorn26/ioc/arckbdvar.h diff -N sys/arch/acorn26/ioc/arckbdvar.h --- sys/arch/acorn26/ioc/arckbdvar.h 6 Jan 2009 23:58:00 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,44 +0,0 @@ -/* $NetBSD: arckbdvar.h,v 1.3 2009/01/06 23:58:00 bjh21 Exp $ */ -/*- - * Copyright (c) 1998 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#ifndef _ARCKBDVAR_H -#define _ARCKBDVAR_H - -#include - -struct arckbd_kbidtab { - int kbid; - kbd_t layout; -}; - -extern const struct wskbd_mapdata arckbd_mapdata_default; -extern const struct arckbd_kbidtab arckbd_kbidtab[]; - -extern void arckbd_cnattach(device_t self); - -#endif Index: sys/arch/acorn26/ioc/arcpp.c =================================================================== RCS file: sys/arch/acorn26/ioc/arcpp.c diff -N sys/arch/acorn26/ioc/arcpp.c --- sys/arch/acorn26/ioc/arcpp.c 30 Aug 2015 04:16:18 -0000 1.15 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,337 +0,0 @@ -/* $NetBSD: arcpp.c,v 1.15 2015/08/30 04:16:18 dholland Exp $ */ - -/*- - * Copyright (c) 2001 Ben Harris - * Copyright (c) 1993, 1994 Charles M. Hannum. - * Copyright (c) 1990 William F. Jolitz, TeleMuse - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * 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 software is a component of "386BSD" developed by - * William F. Jolitz, TeleMuse. - * 4. Neither the name of the developer nor the name "386BSD" - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS A COMPONENT OF 386BSD DEVELOPED BY WILLIAM F. JOLITZ - * AND IS INTENDED FOR RESEARCH AND EDUCATIONAL PURPOSES ONLY. THIS - * SOFTWARE SHOULD NOT BE CONSIDERED TO BE A COMMERCIAL PRODUCT. - * THE DEVELOPER URGES THAT USERS WHO REQUIRE A COMMERCIAL PRODUCT - * NOT MAKE USE OF THIS WORK. - * - * FOR USERS WHO WISH TO UNDERSTAND THE 386BSD SYSTEM DEVELOPED - * BY WILLIAM F. JOLITZ, WE RECOMMEND THE USER STUDY WRITTEN - * REFERENCES SUCH AS THE "PORTING UNIX TO THE 386" SERIES - * (BEGINNING JANUARY 1991 "DR. DOBBS JOURNAL", USA AND BEGINNING - * JUNE 1991 "UNIX MAGAZIN", GERMANY) BY WILLIAM F. JOLITZ AND - * LYNNE GREER JOLITZ, AS WELL AS OTHER BOOKS ON UNIX AND THE - * ON-LINE 386BSD USER MANUAL BEFORE USE. A BOOK DISCUSSING THE INTERNALS - * OF 386BSD ENTITLED "386BSD FROM THE INSIDE OUT" WILL BE AVAILABLE LATE 1992. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``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 DEVELOPER 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. - */ - -#include - -__KERNEL_RCSID(0, "$NetBSD: arcpp.c,v 1.15 2015/08/30 04:16:18 dholland Exp $"); - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include "ioeb.h" - -struct arcpp_softc { - device_t sc_dev; - void *sc_aih; /* ACK interrupt handler */ - struct evcnt sc_aintrcnt; /* ... and count */ - void *sc_bih; /* BUSY interrupt handler */ - struct evcnt sc_bintrcnt; /* ... and count */ - size_t sc_count; - void *sc_inbuf; - u_char *sc_cp; - int sc_spinmax; - bus_space_tag_t sc_iot; - bus_space_handle_t sc_ioh; - u_char sc_state; -#define ARCPP_OPEN 0x01 /* device is open */ -#define ARCPP_OBUSY 0x02 /* printer is busy doing output */ -#define ARCPP_INIT 0x04 /* waiting to initialize for open */ - u_char sc_flags; -/*#define ARCPP_AUTOLF 0x20 * automatic LF on CR */ -/*#define ARCPP_NOPRIME 0x40 * don't prime on open */ -/*#define ARCPP_NOINTR 0x80 * do not use interrupt */ - u_char sc_laststatus; -}; - -#define TIMEOUT (hz*16) /* wait up to 16 seconds for a ready */ -#define STEP (hz/4) - -#define ARCPPPRI (PZERO+8) -#define ARCPP_BSIZE 1024 - -extern struct cfdriver arcpp_cd; - -dev_type_open(arcppopen); -dev_type_close(arcppclose); -dev_type_write(arcppwrite); - -const struct cdevsw arcpp_cdevsw = { - .d_open = arcppopen, - .d_close = arcppclose, - .d_read = noread, - .d_write = arcppwrite, - .d_ioctl = noioctl, - .d_stop = nostop, - .d_tty = notty, - .d_poll = nopoll, - .d_mmap = nommap, - .d_kqfilter = nokqfilter, - .d_discard = nodiscard, - .d_flag = 0 -}; - -#define ARCPPUNIT(s) (minor(s) & 0x1f) -#define ARCPPFLAGS(s) (minor(s) & 0xe0) - -static int arcpp_match(device_t, cfdata_t, void *); -static void arcpp_attach(device_t, device_t, void *); - -static int arcppintr(void *); -static int arcpppushbytes(struct arcpp_softc *); - -CFATTACH_DECL_NEW(arcpp, sizeof(struct arcpp_softc), - arcpp_match, arcpp_attach, NULL, NULL); - -static int -arcpp_match(device_t parent, cfdata_t cf, void *aux) -{ - - /* - * The parallel port is write-only, so we can't probe for it. - * Happily, the set of machines it exists on is precisely the - * set that doesn't have IOEBs, so... - */ -#if NIOEB > 0 - if (the_ioeb != NULL) - return 0; -#endif - return 1; -} - -static void -arcpp_attach(device_t parent, device_t self, void *aux) -{ - struct arcpp_softc *sc = device_private(self); - struct ioc_attach_args *ioc = aux; - bus_space_tag_t iot; - bus_space_handle_t ioh; - - sc->sc_dev = self; - - iot = sc->sc_iot = ioc->ioc_fast_t; - ioh = sc->sc_ioh = ioc->ioc_fast_h; - - evcnt_attach_dynamic(&sc->sc_aintrcnt, EVCNT_TYPE_INTR, NULL, - device_xname(self), "ack intr"); - evcnt_attach_dynamic(&sc->sc_bintrcnt, EVCNT_TYPE_INTR, NULL, - device_xname(self), "busy intr"); - sc->sc_aih = irq_establish(IRQ_PACK, IPL_VM, arcppintr, sc, - &sc->sc_aintrcnt); - sc->sc_bih = irq_establish(IRQ_PBSY, IPL_VM, arcppintr, sc, - &sc->sc_bintrcnt); - - /* We're not interested in interrupts while the device is closed. */ - irq_disable(sc->sc_aih); - irq_disable(sc->sc_bih); - - aprint_normal("\n"); -} - -/* - * Wait until the printer's selected and not busy. - */ -int -arcppopen(dev_t dev, int flag, int mode, struct lwp *l) -{ - u_char flags = ARCPPFLAGS(dev); - struct arcpp_softc *sc; - bus_space_tag_t iot; - bus_space_handle_t ioh; - int error, s; - - sc = device_lookup_private(&arcpp_cd, ARCPPUNIT(dev)); - if (sc == NULL) - return ENXIO; - -#ifdef DIAGNOSTIC - if (sc->sc_state) - printf("%s: stat=0x%x not zero\n", device_xname(sc->sc_dev), - sc->sc_state); -#endif - - if (sc->sc_state) - return EBUSY; - - sc->sc_state = ARCPP_INIT; - sc->sc_flags = flags; - iot = sc->sc_iot; - ioh = sc->sc_ioh; - - s = splvm(); - /* wait till ready (printer running diagnostics) */ - irq_enable(sc->sc_bih); - /* XXX Is it really appropriate to time out? */ - error = tsleep((void *)sc, ARCPPPRI | PCATCH, "arcppopen", TIMEOUT); - if (error == EWOULDBLOCK) { - sc->sc_state = 0; - splx(s); - return EBUSY; - } - if (error) { - sc->sc_state = 0; - splx(s); - return error; - } - - sc->sc_inbuf = malloc(ARCPP_BSIZE, M_DEVBUF, M_WAITOK); - sc->sc_count = 0; - - sc->sc_state = ARCPP_OPEN; - - arcppintr(sc); - splx(s); - - return 0; -} - -/* - * Close the device, and free the local line buffer. - */ -int -arcppclose(dev_t dev, int flag, int mode, struct lwp *l) -{ - struct arcpp_softc *sc = device_lookup_private(&arcpp_cd, ARCPPUNIT(dev)); - - if (sc->sc_count) - (void) arcpppushbytes(sc); - - irq_disable(sc->sc_aih); - irq_disable(sc->sc_bih); - sc->sc_state = 0; - free(sc->sc_inbuf, M_DEVBUF); - - return 0; -} - -static int -arcpppushbytes(struct arcpp_softc *sc) -{ - int error; - int s; - - while (sc->sc_count > 0) { - /* if the printer is ready for a char, give it one */ - if ((sc->sc_state & ARCPP_OBUSY) == 0) { - s = splvm(); - arcppintr(sc); - splx(s); - } - error = tsleep((void *)sc, ARCPPPRI | PCATCH, "arcppwr", 0); - if (error) - return error; - } - return 0; -} - -int -arcppwrite(dev_t dev, struct uio *uio, int flags) -{ - struct arcpp_softc *sc = device_lookup_private(&arcpp_cd, ARCPPUNIT(dev)); - size_t n; - int error = 0; - - while ((n = min(ARCPP_BSIZE, uio->uio_resid)) != 0) { - uiomove(sc->sc_cp = sc->sc_inbuf, n, uio); - sc->sc_count = n; - error = arcpppushbytes(sc); - if (error) { - /* - * Return accurate residual if interrupted or timed - * out. - */ - uio->uio_resid += sc->sc_count; - sc->sc_count = 0; - return error; - } - } - return 0; -} - -/* - * Handle printer interrupts which occur when the printer is ready to accept - * another char. - */ -int -arcppintr(void *arg) -{ - struct arcpp_softc *sc = arg; - bus_space_tag_t iot = sc->sc_iot; - bus_space_handle_t ioh = sc->sc_ioh; - - /* is printer online and ready for output */ - if (!ioc_irq_status(IRQ_PBSY)) { - return 0; - } - - if (sc->sc_count) { - /* send char */ - bus_space_write_1(iot, ioh, ARCPP_DATA, *sc->sc_cp++); - DELAY(1); - latchb_update(LATCHB_NPSTB, 0); - DELAY(1); - sc->sc_count--; - latchb_update(LATCHB_NPSTB, LATCHB_NPSTB); - DELAY(1); - sc->sc_state |= ARCPP_OBUSY; - } else - sc->sc_state &= ~ARCPP_OBUSY; - - if (sc->sc_count == 0) - /* none, wake up the top half to get more */ - wakeup((void *)sc); - - return 1; -} Index: sys/arch/acorn26/ioc/arcppreg.h =================================================================== RCS file: sys/arch/acorn26/ioc/arcppreg.h diff -N sys/arch/acorn26/ioc/arcppreg.h --- sys/arch/acorn26/ioc/arcppreg.h 24 Mar 2002 15:47:16 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,10 +0,0 @@ -/* $NetBSD: arcppreg.h,v 1.1 2002/03/24 15:47:16 bjh21 Exp $ */ - -/* - * This file is in the public domain. - */ - -/* Archimedes parallel port registers */ - -/* Offset of data latch from IOC bank base (bus_size_t units) */ -#define ARCPP_DATA 0x04 Index: sys/arch/acorn26/ioc/if_eca.c =================================================================== RCS file: sys/arch/acorn26/ioc/if_eca.c diff -N sys/arch/acorn26/ioc/if_eca.c --- sys/arch/acorn26/ioc/if_eca.c 10 Jun 2016 13:27:10 -0000 1.14 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,547 +0,0 @@ -/* $NetBSD: if_eca.c,v 1.14 2016/06/10 13:27:10 ozaki-r Exp $ */ - -/*- - * Copyright (c) 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#include - -__KERNEL_RCSID(0, "$NetBSD: if_eca.c,v 1.14 2016/06/10 13:27:10 ozaki-r Exp $"); - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include - -static int eca_match(device_t, cfdata_t, void *); -static void eca_attach(device_t, device_t, void *); - -static int eca_init(struct ifnet *); -static void eca_stop(struct ifnet *ifp, int disable); - -static int eca_claimwire(struct ifnet *); -static void eca_txframe(struct ifnet *, struct mbuf *); - -static void eca_tx_downgrade(void); -static void eca_txdone(void *); - -static int eca_init_rxbuf(struct eca_softc *sc, int flags); -static void eca_init_rx_soft(struct eca_softc *sc); -static void eca_init_rx_hard(struct eca_softc *sc); -static void eca_init_rx(struct eca_softc *sc); - -static void eca_rx_downgrade(void); -static void eca_gotframe(void *); - -struct eca_softc *eca_fiqowner; - -CFATTACH_DECL_NEW(eca, sizeof(struct eca_softc), - eca_match, eca_attach, NULL, NULL); - -static int -eca_match(device_t parent, cfdata_t cf, void *aux) -{ - struct ioc_attach_args *ioc = aux; - - /* Econet never uses LOOP mode. */ - if ((bus_space_read_1(ioc->ioc_sync_t, ioc->ioc_sync_h, MC6854_SR1) & - MC6854_SR1_LOOP) != 0) - return 0; - - return 1; -} - -static void -eca_attach(device_t parent, device_t self, void *aux) -{ - struct eca_softc *sc = device_private(self); - struct ioc_attach_args *ioc = aux; - struct ifnet *ifp = &sc->sc_ec.ec_if; - uint8_t myaddr[ECO_ADDR_LEN]; - - sc->sc_dev = self; - sc->sc_iot = ioc->ioc_sync_t; - sc->sc_ioh = ioc->ioc_sync_h; - - myaddr[0] = cmos_read(0x40); - myaddr[1] = 0; - - aprint_normal(": station %s", eco_sprintf(myaddr)); - /* It's traditional to print the clock state at boot. */ - if ((bus_space_read_1(sc->sc_iot, sc->sc_ioh, MC6854_SR2) & - MC6854_SR2_NDCD)) - printf(", no clock"); - - /* Initialise ifnet structure. */ - - strcpy(ifp->if_xname, device_xname(sc->sc_dev)); - ifp->if_softc = sc; - ifp->if_init = eca_init; - ifp->if_stop = eca_stop; - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS; - IFQ_SET_READY(&ifp->if_snd); - sc->sc_ec.ec_claimwire = eca_claimwire; - sc->sc_ec.ec_txframe = eca_txframe; - - sc->sc_rx_soft = softint_establish(IPL_SOFTNET, eca_gotframe, sc); - sc->sc_tx_soft = softint_establish(IPL_SOFTNET, eca_txdone, sc); - if (sc->sc_rx_soft == NULL || sc->sc_tx_soft == NULL) { - aprint_error_dev(sc->sc_dev, - "failed to establish software interrupt\n"); - return; - } - - if_attach(ifp); - eco_ifattach(ifp, myaddr); - - sc->sc_fiqhandler.fh_func = eca_fiqhandler; - sc->sc_fiqhandler.fh_size = eca_efiqhandler - eca_fiqhandler; - sc->sc_fiqhandler.fh_flags = 0; - sc->sc_fiqhandler.fh_regs = &sc->sc_fiqstate.efs_rx_fiqregs; - - aprint_normal("\n"); -} - -static int -eca_init(struct ifnet *ifp) -{ - struct eca_softc *sc = ifp->if_softc; - bus_space_tag_t iot = sc->sc_iot; - bus_space_handle_t ioh = sc->sc_ioh; - int sr1, sr2; - int err; - - if ((err = eco_init(ifp)) != 0) - return err; - - /* Claim the FIQ early, in case we don't get it. */ - if ((err = fiq_claim(&sc->sc_fiqhandler)) != 0) - return err; - - if (sc->sc_rcvmbuf == NULL) { - err = eca_init_rxbuf(sc, M_WAIT); - if (err != 0) - return err; - } - - sc->sc_transmitting = 0; - - /* Interrupts disabled, no DMA, hold Tx and Rx in reset. */ - sc->sc_cr1 = MC6854_CR1_RX_RS | MC6854_CR1_TX_RS; - /* 1-byte transfers, mark idle. */ - sc->sc_cr2 = 0; - /* Nothing exciting. */ - sc->sc_cr3 = 0; - /* single flag, 8 data bits, NRZ */ - sc->sc_cr4 = MC6854_CR4_TX_WL_8BITS | MC6854_CR4_RX_WL_8BITS; - - bus_space_write_1(iot, ioh, MC6854_CR1, sc->sc_cr1); - bus_space_write_1(iot, ioh, MC6854_CR2, sc->sc_cr2); - bus_space_write_1(iot, ioh, MC6854_CR1, sc->sc_cr1 | MC6854_CR1_AC); - bus_space_write_1(iot, ioh, MC6854_CR3, sc->sc_cr3); - bus_space_write_1(iot, ioh, MC6854_CR4, sc->sc_cr4); - bus_space_write_1(iot, ioh, MC6854_CR1, sc->sc_cr1); - - /* Everything's set up. Take chip out of reset. */ - sc->sc_cr1 &= ~(MC6854_CR1_RX_RS | MC6854_CR1_TX_RS); - bus_space_write_1(iot, ioh, MC6854_CR1, sc->sc_cr1); - - /* Read and clear status registers. */ - sr1 = bus_space_read_1(iot, ioh, MC6854_SR1); - sr2 = bus_space_read_1(iot, ioh, MC6854_SR2); - bus_space_write_1(iot, ioh, MC6854_CR2, sc->sc_cr2 | - MC6854_CR2_CLR_RX_ST | MC6854_CR2_CLR_TX_ST); - - /* Set up FIQ registers and enable FIQs */ - eca_init_rx(sc); - - ifp->if_flags |= IFF_RUNNING; - - return 0; -} - -/* - * Check if the network's idle, and if it is, start flag-filling. - */ -static int -eca_claimwire(struct ifnet *ifp) -{ - struct eca_softc *sc = ifp->if_softc; - bus_space_tag_t iot = sc->sc_iot; - bus_space_handle_t ioh = sc->sc_ioh; - - KASSERT(sc->sc_ec.ec_state == ECO_IDLE); - if (bus_space_read_1(iot, ioh, MC6854_SR2) & MC6854_SR2_RX_IDLE) { - /* Start flag fill. */ - sc->sc_cr2 |= MC6854_CR2_RTS | MC6854_CR2_F_M_IDLE; - bus_space_write_1(iot, ioh, MC6854_CR2, sc->sc_cr2); - return 0; - } - return EBUSY; -} - -static void -eca_txframe(struct ifnet *ifp, struct mbuf *m) -{ - struct eca_softc *sc = ifp->if_softc; - bus_space_tag_t iot = sc->sc_iot; - bus_space_handle_t ioh = sc->sc_ioh; - struct fiqregs fr; - - ioc_fiq_setmask(0); - /* Start flag-filling while we work out what to do next. */ - sc->sc_cr2 |= MC6854_CR2_RTS | MC6854_CR2_F_M_IDLE; - bus_space_write_1(iot, ioh, MC6854_CR2, sc->sc_cr2); - sc->sc_fiqstate.efs_fiqhandler = eca_fiqhandler_tx; - sc->sc_transmitting = 1; - sc->sc_txmbuf = m; - fr.fr_r8 = (register_t)sc->sc_ioh; - fr.fr_r9 = (register_t)sc->sc_txmbuf->m_data; - fr.fr_r10 = (register_t)sc->sc_txmbuf->m_len; - fr.fr_r11 = (register_t)&sc->sc_fiqstate; - fiq_setregs(&fr); - sc->sc_fiqstate.efs_tx_curmbuf = sc->sc_txmbuf; - fiq_downgrade_handler = eca_tx_downgrade; - /* Read and clear Tx status. */ - bus_space_read_1(iot, ioh, MC6854_SR1); - bus_space_write_1(iot, ioh, MC6854_CR2, - sc->sc_cr2 | MC6854_CR2_CLR_TX_ST); - sc->sc_cr1 = MC6854_CR1_TIE; - bus_space_write_1(iot, ioh, MC6854_CR1, sc->sc_cr1 | - MC6854_CR1_DISCONTINUE); - ioc_fiq_setmask(IOC_FIQ_BIT(FIQ_EFIQ)); -} - -static void -eca_tx_downgrade(void) -{ - struct eca_softc *sc = eca_fiqowner; - bus_space_tag_t iot = sc->sc_iot; - bus_space_handle_t ioh = sc->sc_ioh; - int sr1; - char buf[128]; - - KASSERT(sc->sc_transmitting); - sc->sc_cr2 = 0; - if (__predict_true(sc->sc_fiqstate.efs_tx_curmbuf == NULL)) { - /* Entire frame got transmitted. */ - } else { - sr1 = bus_space_read_1(iot, ioh, MC6854_SR1); - if (sr1 & MC6854_SR1_TXU) - log(LOG_ERR, "%s: Tx underrun\n", - device_xname(sc->sc_dev)); - else if (sr1 & MC6854_SR1_NCTS) - log(LOG_WARNING, "%s: collision\n", - device_xname(sc->sc_dev)); - else { - log(LOG_ERR, "%s: incomplete transmission\n", - device_xname(sc->sc_dev)); - snprintb(buf, 128, MC6854_SR1_BITS, sr1); - log(LOG_ERR, "%s: SR1 = %s\n", - device_xname(sc->sc_dev), buf); - } - bus_space_write_1(iot, ioh, MC6854_CR2, - sc->sc_cr2 | MC6854_CR2_CLR_TX_ST); - } - sc->sc_txmbuf = NULL; - - /* Code from eca_init_rx_hard(). */ - sc->sc_cr1 = MC6854_CR1_RIE; - fiq_downgrade_handler = eca_rx_downgrade; - sc->sc_transmitting = 0; - eca_fiqowner = sc; - ioc_fiq_setmask(IOC_FIQ_BIT(FIQ_EFIQ)); - /* End code from eca_init_rx_hard(). */ - - softint_schedule(sc->sc_tx_soft); -} - -/* - * Low-priority soft interrupt taken after a frame's been transmitted. - */ -static void -eca_txdone(void *arg) -{ - struct eca_softc *sc = arg; - struct ifnet *ifp = &sc->sc_ec.ec_if; - - m_freem(sc->sc_txmbuf); - sc->sc_txmbuf = NULL; - ifp->if_flags &= ~IFF_OACTIVE; - ifp->if_start(ifp); -} - -/* - * Set up the Rx buffer for the interface. - * flags is M_WAIT or M_DONTWAIT. Returns an errno or 0 for success. - */ -static int -eca_init_rxbuf(struct eca_softc *sc, int flags) -{ - struct mbuf *m, *n; - size_t totlen; - - /* - * The Rx buffer takes the form of a chain of mbufs, set up as - * if they contain data already. The FIQ handler is - * responsible for filling the marked space, and indicating - * how much it's put in there. - */ - - totlen = 0; - m = n = NULL; - while (totlen < sc->sc_ec.ec_if.if_mtu + ECO_HDR_LEN) { - MGETHDR(m, flags, MT_DATA); - if (m == NULL) - return ENOBUFS; - MCLGET(m, flags); - if ((m->m_flags & M_EXT) == 0) { - m_freem(m); - return ENOBUFS; - } - /* XXX may want to tweak for payload alignment here. */ - m->m_len = m->m_ext.ext_size; - m->m_next = n; - totlen += m->m_len; - n = m; - } - - sc->sc_rcvmbuf = m; - return 0; -} - -/* - * Set up the software state necessary for reception, but don't - * actually start receoption. Pushing the state into the hardware is - * left to eca_init_rx_hard() the Tx FIQ handler. - */ -void -eca_init_rx_soft(struct eca_softc *sc) -{ - struct ifnet *ifp = &sc->sc_ec.ec_if; - struct fiqregs *fr = &sc->sc_fiqstate.efs_rx_fiqregs; - - memset(fr, 0, sizeof(*fr)); - fr->fr_r8 = (register_t)sc->sc_ioh; - fr->fr_r9 = (register_t)sc->sc_rcvmbuf->m_data; - fr->fr_r10 = (register_t)ECO_ADDR_LEN; - fr->fr_r11 = (register_t)&sc->sc_fiqstate; - sc->sc_fiqstate.efs_rx_curmbuf = sc->sc_rcvmbuf; - sc->sc_fiqstate.efs_rx_flags = 0; - sc->sc_fiqstate.efs_rx_myaddr = CLLADDR(ifp->if_sadl)[0]; -} - -/* - * Copy state set up by eca_init_rx_soft into the hardware, and reset - * the FIQ handler as appropriate. - * - * This code is functionally duplicated across the Tx FIQ handler and - * eca_tx_downgrade(). Keep them in sync! - */ -void -eca_init_rx_hard(struct eca_softc *sc) -{ - bus_space_tag_t iot = sc->sc_iot; - bus_space_handle_t ioh = sc->sc_ioh; - struct fiqregs *fr = &sc->sc_fiqstate.efs_rx_fiqregs; - - sc->sc_fiqstate.efs_fiqhandler = eca_fiqhandler_rx; - sc->sc_transmitting = 0; - sc->sc_cr1 = MC6854_CR1_RIE; - bus_space_write_1(iot, ioh, MC6854_CR1, sc->sc_cr1); - fiq_setregs(fr); - fiq_downgrade_handler = eca_rx_downgrade; - eca_fiqowner = sc; - ioc_fiq_setmask(IOC_FIQ_BIT(FIQ_EFIQ)); -} - -/* - * Set up the chip and FIQ handler for reception. Assumes the Rx buffer is - * set up already by eca_init_rxbuf(). - */ -void -eca_init_rx(struct eca_softc *sc) -{ - - eca_init_rx_soft(sc); - eca_init_rx_hard(sc); -} - -static void -eca_stop(struct ifnet *ifp, int disable) -{ - struct eca_softc *sc = ifp->if_softc; - bus_space_tag_t iot = sc->sc_iot; - bus_space_handle_t ioh = sc->sc_ioh; - - ifp->if_flags &= ~IFF_RUNNING; - - eco_stop(ifp, disable); - - /* Interrupts disabled, no DMA, hold Tx and Rx in reset. */ - sc->sc_cr1 = MC6854_CR1_RX_RS | MC6854_CR1_TX_RS; - bus_space_write_1(iot, ioh, MC6854_CR1, sc->sc_cr1); - - ioc_fiq_setmask(0); - fiq_downgrade_handler = NULL; - eca_fiqowner = NULL; - fiq_release(&sc->sc_fiqhandler); - if (sc->sc_rcvmbuf != NULL) { - m_freem(sc->sc_rcvmbuf); - sc->sc_rcvmbuf = NULL; - } -} - -/* - * This is a FIQ downgrade handler, and as such is entered at IPL_HIGH with - * FIQs disabled (but still owned by us). - */ -static void -eca_rx_downgrade(void) -{ - struct eca_softc *sc = eca_fiqowner; - - sc->sc_sr2 = bus_space_read_1(sc->sc_iot, sc->sc_ioh, MC6854_SR2); - softint_schedule(sc->sc_rx_soft); -} - -/* - * eca_gotframe() is called if there's something interesting on - * reception. The receiver is turned off now -- it's up to us to - * start it again. - */ -static void -eca_gotframe(void *arg) -{ - struct eca_softc *sc = arg; - struct ifnet *ifp = &sc->sc_ec.ec_if; - bus_space_tag_t iot = sc->sc_iot; - bus_space_handle_t ioh = sc->sc_ioh; - struct fiqregs fr; - int sr2; - struct mbuf *m, *mtail, *n, *reply; - - reply = NULL; - sr2 = sc->sc_sr2; - - /* 1: Is there a valid frame waiting? */ - if ((sr2 & MC6854_SR2_FV) && !(sr2 & MC6854_SR2_OVRN) && - sc->sc_fiqstate.efs_rx_curmbuf != NULL) { - fiq_getregs(&fr); - m = sc->sc_rcvmbuf; - mtail = sc->sc_fiqstate.efs_rx_curmbuf; - /* - * Before we process this buffer, make sure we can get - * a new one. - */ - if (eca_init_rxbuf(sc, M_DONTWAIT) == 0) { - ifp->if_ipackets++; /* XXX packet vs frame? */ - /* Trim the tail of the mbuf chain. */ - mtail->m_len = - (char *)(fr.fr_r9) - mtod(mtail, char *); - m_freem(mtail->m_next); - mtail->m_next = NULL; - /* Set up the header of the chain. */ - m_set_rcvif(m, ifp); - m->m_pkthdr.len = 0; - for (n = m; n != NULL; n = n->m_next) - m->m_pkthdr.len += n->m_len; - reply = eco_inputframe(ifp, m); - } else - ifp->if_iqdrops++; - } - - /* 2: Are there any errors waiting? */ - if (sr2 & MC6854_SR2_OVRN) { - fiq_getregs(&fr); - mtail = sc->sc_fiqstate.efs_rx_curmbuf; - log(LOG_ERR, "%s: Rx overrun (state = %d, len = %ld)\n", - device_xname(sc->sc_dev), sc->sc_ec.ec_state, - (char *)(fr.fr_r9) - mtod(mtail, char *)); - ifp->if_ierrors++; - - /* Discard the rest of the frame. */ - if (!sc->sc_transmitting) - bus_space_write_1(iot, ioh, MC6854_CR1, - sc->sc_cr1 | MC6854_CR1_DISCONTINUE); - } else if (sr2 & MC6854_SR2_RXABT) { - log(LOG_NOTICE, "%s: Rx abort\n", device_xname(sc->sc_dev)); - ifp->if_ierrors++; - } else if (sr2 & MC6854_SR2_ERR) { - log(LOG_NOTICE, "%s: CRC error\n", device_xname(sc->sc_dev)); - ifp->if_ierrors++; - } - - if (__predict_false(sr2 & MC6854_SR2_NDCD)) { - log(LOG_ERR, "%s: No clock\n", device_xname(sc->sc_dev)); - ifp->if_ierrors++; - } - if (sc->sc_fiqstate.efs_rx_curmbuf == NULL) { - log(LOG_NOTICE, "%s: Oversized frame\n", - device_xname(sc->sc_dev)); - ifp->if_ierrors++; - /* Discard the rest of the frame. */ - if (!sc->sc_transmitting) - bus_space_write_1(iot, ioh, MC6854_CR1, - sc->sc_cr1 | MC6854_CR1_DISCONTINUE); - } - - - bus_space_write_1(iot, ioh, MC6854_CR2, - sc->sc_cr2 | MC6854_CR2_CLR_RX_ST); - - if (reply) { - KASSERT(sc->sc_fiqstate.efs_rx_flags & ERXF_FLAGFILL); - eca_init_rx_soft(sc); - eca_txframe(ifp, reply); - } else { - /* KASSERT(!sc->sc_transmitting); */ - if (sc->sc_fiqstate.efs_rx_flags & ERXF_FLAGFILL) - /* Stop flag-filling: we have nothing to send. */ - bus_space_write_1(iot, ioh, MC6854_CR2, - sc->sc_cr2); - /* Set the ADLC up to receive the next frame. */ - eca_init_rx(sc); - /* 3: Is the network idle now? */ - if (sr2 & MC6854_SR2_RX_IDLE) - eco_inputidle(ifp); - } -} Index: sys/arch/acorn26/ioc/if_eca_fiq.S =================================================================== RCS file: sys/arch/acorn26/ioc/if_eca_fiq.S diff -N sys/arch/acorn26/ioc/if_eca_fiq.S --- sys/arch/acorn26/ioc/if_eca_fiq.S 24 Mar 2002 23:17:00 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,159 +0,0 @@ -/* $NetBSD: if_eca_fiq.S,v 1.2 2002/03/24 23:17:00 bjh21 Exp $ */ - -/*- - * Copyright (c) 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#include - -RCSID("$NetBSD: if_eca_fiq.S,v 1.2 2002/03/24 23:17:00 bjh21 Exp $") - -#include -#include - -#include "assym.h" - -ENTRY_NP(eca_fiqhandler) - ldr pc, [r11, #EFS_FIQHANDLER] - .global eca_efiqhandler -_C_LABEL(eca_efiqhandler): - -/* - * Econet Rx FIQ handler registers: - * R8: Address of 6854 - * R9: Data buffer address - * R10: Space left in buffer - * R11: struct eca_fiqstate pointer - * R12: Scratch - * R13: Scratch - */ - -ENTRY(eca_fiqhandler_rx) - /* If there's something in the Rx FIFO, read it now. */ - ldrb r12, [r8, #(MC6854_SR2 << 2)] - tst r12, #MC6854_SR2_OVRN - bne Leca_rx_nodata - tst r12, #MC6854_SR2_RDA - beq Leca_rx_nodata -Leca_rx_loop: - ldrb r12, [r8, #(MC6854_RXFIFO << 2)] - strb r12, [r9], #1 - subs r10, r10, #1 - beq Leca_rx_counter /* Rx buffer full */ - ldrb r12, [r8, #(MC6854_SR2 << 2)] - tst r12, #MC6854_SR2_RDA /* More data? */ - bne Leca_rx_loop -Leca_rx_nodata: - teq r12, #0 /* No more status? */ - subeqs pc, r14, #4 /* Return. */ - tst r12, #MC6854_SR2_FV /* End of frame? */ - ldrne r12, [r11, #EFS_RX_FLAGS] - tstne r12, #ERXF_FLAGFILL /* Want flag fill? */ - movne r12, #(MC6854_CR2_RTS | MC6854_CR2_F_M_IDLE) - strneb r12, [r8, #(MC6854_CR2 << 2)] - b fiq_downgrade - -Leca_rx_counter: - /* If we've already got the header, this indicates end-of-buffer. */ - ldr r12, [r11, #EFS_RX_FLAGS] - tst r12, #ERXF_GOTHDR - bne Leca_rx_full - ldrb r12, [r9, #-2] - ldrb r13, [r11, #EFS_RX_MYADDR] - teq r12, r13 /* Our host */ - ldreqb r12, [r9, #-1] - teqeq r12, #0 /* Local network? */ - ldr r12, [r11, #EFS_RX_FLAGS] - orrne r12, r12, #ERXF_GOTHDR - orreq r12, r12, #(ERXF_GOTHDR | ERXF_FLAGFILL) - str r12, [r11, #EFS_RX_FLAGS] - ldr r12, [r11, #EFS_RX_CURMBUF] - ldr r10, [r12, #M_LEN] - ldr r12, [r12, #M_DATA] - sub r12, r9, r12 /* Amount got already */ - sub r10, r10, r12 - subs pc, r14, #4 - -Leca_rx_full: - /* Rx buffer full. See if there's another mbuf in the chain. */ - ldr r12, [r11, #EFS_RX_CURMBUF] - ldr r12, [r12, #M_NEXT] - str r12, [r11, #EFS_RX_CURMBUF] - teq r12, #0 - beq fiq_downgrade - ldr r9, [r12, #M_DATA] - ldr r10, [r12, #M_LEN] - subs pc, r14, #4 - -/* - * Econet Tx FIQ handler registers: - * R8: Address of 6854 - * R9: Data buffer address - * R10: Data left in buffer - * R11: struct eca_fiqstate pointer - * R12: Scratch - * R13: Scratch - */ -ENTRY(eca_fiqhandler_tx) - ldrb r12, [r8, #(MC6854_SR1 << 2)] - tst r12, #MC6854_SR1_TDRA - beq Leca_tx_nospace -Leca_tx_loop: - ldrb r12, [r9], #1 - strb r12, [r8, #(MC6854_TXFIFOFC << 2)] - subs r10, r10, #1 - beq Leca_tx_nodata - ldrb r12, [r8, #(MC6854_SR1 << 2)] - tst r12, #MC6854_SR1_TDRA - bne Leca_tx_loop -Leca_tx_nospace: - tst r12, #MC6854_SR1_IRQ /* No more status? */ - subeqs pc, r14, #4 /* Return. */ - b fiq_downgrade - -Leca_tx_nodata: - /* We get here when the current data block is empty. */ - ldr r12, [r11, #EFS_TX_CURMBUF] - ldr r12, [r12, #M_NEXT] - str r12, [r11, #EFS_TX_CURMBUF] - teq r12, #0 /* Another mbuf? */ - beq Leca_tx_endofframe - ldr r9, [r12, #M_DATA] /* Line up next mbuf. */ - ldr r10, [r12, #M_LEN] - subs pc, r14, #4 - -Leca_tx_endofframe: - mov r12, #(MC6854_CR2_TX_LAST) /* If not, finish frame... */ - strb r12, [r8, #(MC6854_CR2 << 2)] - /* Code equivalent to parts of eca_init_rx_hard() */ - adr r12, _C_LABEL(eca_fiqhandler_rx) - str r12, [r11, #(EFS_FIQHANDLER)] - mov r12, #(MC6854_CR1_RIE) - strb r12, [r8, #(MC6854_CR1 << 2)] - add r12, r11, #(EFS_RX_FIQREGS) - ldmia r12, {r8-r11} - /* End code equivalent to parts of eca_init_rx_hard() */ - b fiq_downgrade_dont_disable /* ... and report back. */ Index: sys/arch/acorn26/ioc/if_ecavar.h =================================================================== RCS file: sys/arch/acorn26/ioc/if_ecavar.h diff -N sys/arch/acorn26/ioc/if_ecavar.h --- sys/arch/acorn26/ioc/if_ecavar.h 11 May 2012 15:39:18 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,82 +0,0 @@ -/* $NetBSD: if_ecavar.h,v 1.4 2012/05/11 15:39:18 skrll Exp $ */ - -/*- - * Copyright (c) 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#ifndef _ECAVAR_H_ -#define _ECAVAR_H_ - -#ifndef _LOCORE -#include -#include -#include - -#include -#include - -#include - -#include - -struct eca_fiqstate { - void *efs_fiqhandler; - struct mbuf *efs_rx_curmbuf; - struct fiqregs efs_rx_fiqregs; - uint32_t efs_rx_flags; - uint8_t efs_rx_myaddr; - struct mbuf *efs_tx_curmbuf; -}; - -struct eca_softc { - device_t sc_dev; - struct ecocom sc_ec; - uint8_t sc_cr1; - uint8_t sc_cr2; - uint8_t sc_cr3; - uint8_t sc_cr4; - bus_space_tag_t sc_iot; - bus_space_handle_t sc_ioh; - void *sc_rx_soft; - struct fiqhandler sc_fiqhandler; - struct eca_fiqstate sc_fiqstate; - struct mbuf *sc_rcvmbuf; - struct mbuf *sc_txmbuf; - uint8_t sc_sr2; - void *sc_tx_soft; - int sc_transmitting; -}; - -extern char eca_fiqhandler[], eca_efiqhandler[]; -extern char eca_fiqhandler_rx[], eca_fiqhandler_tx[]; - -#endif - -/* Flags for efs_rx_flags. */ -#define ERXF_GOTHDR 0x01 -#define ERXF_FLAGFILL 0x02 - -#endif Index: sys/arch/acorn26/ioc/ioc_fiq_util.S =================================================================== RCS file: sys/arch/acorn26/ioc/ioc_fiq_util.S diff -N sys/arch/acorn26/ioc/ioc_fiq_util.S --- sys/arch/acorn26/ioc/ioc_fiq_util.S 17 Feb 2007 22:31:36 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,67 +0,0 @@ -/* $NetBSD: ioc_fiq_util.S,v 1.2 2007/02/17 22:31:36 pavel Exp $ */ - -/*- - * Copyright (c) 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#include - -RCSID("$NetBSD: ioc_fiq_util.S,v 1.2 2007/02/17 22:31:36 pavel Exp $") - -#include -#include - -/* - * fiq_downgrade should be called in FIQ mode. It uses R12_fiq and R13_fiq - * as scratch registers. When finished, it returns from the FIQ. - */ -ENTRY(fiq_downgrade) - ldr r12, Lioc_base - ldrb r13, [r12, #(IOC_IRQMSKA << 2)] - orr r13, r13, #(1 < -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include -#include - -#include - -struct iociic_softc { - device_t sc_dev; - bus_space_tag_t sc_st; - bus_space_handle_t sc_sh; - - struct i2c_controller sc_i2c; - kmutex_t sc_buslock; - - /* - * The SDA pin is open-drain, so we make it an input by - * writing a 1 to it. - */ - uint32_t sc_ioc_ctl; -}; - -static struct iociic_softc *the_iociic; - -static int iociic_acquire_bus(void *, int); -static void iociic_release_bus(void *, int); - -static int iociic_send_start(void *, int); -static int iociic_send_stop(void *, int); -static int iociic_initiate_xfer(void *, i2c_addr_t, int); -static int iociic_read_byte(void *, uint8_t *, int); -static int iociic_write_byte(void *, uint8_t, int); - -static void -iociic_bb_set_bits(void *cookie, uint32_t bits) -{ - struct iociic_softc *sc = cookie; - - ioc_ctl_write(device_parent(sc->sc_dev), sc->sc_ioc_ctl | bits, - IOC_CTL_SDA | IOC_CTL_SCL); -} - -static void -iociic_bb_set_dir(void *cookie, uint32_t bits) -{ - struct iociic_softc *sc = cookie; - - sc->sc_ioc_ctl = bits; -} - -static uint32_t -iociic_bb_read_bits(void *cookie) -{ - struct iociic_softc *sc = cookie; - - return ioc_ctl_read(device_parent(sc->sc_dev)); -} - -static const struct i2c_bitbang_ops iociic_bbops = { - iociic_bb_set_bits, - iociic_bb_set_dir, - iociic_bb_read_bits, - { - IOC_CTL_SDA, /* SDA */ - IOC_CTL_SCL, /* SCL */ - 0, /* SDA is output */ - IOC_CTL_SDA, /* SDA is input */ - } -}; - -static int -iociic_match(device_t parent, cfdata_t cf, void *aux) -{ - - return 1; -} - -static void -iociic_attach(device_t parent, device_t self, void *aux) -{ - struct iociic_softc *sc = device_private(self); - struct i2cbus_attach_args iba; - - sc->sc_dev = self; - if (the_iociic == NULL) - the_iociic = sc; - - aprint_normal("\n"); - - mutex_init(&sc->sc_buslock, MUTEX_DEFAULT, IPL_NONE); - - sc->sc_i2c.ic_cookie = sc; - sc->sc_i2c.ic_acquire_bus = iociic_acquire_bus; - sc->sc_i2c.ic_release_bus = iociic_release_bus; - sc->sc_i2c.ic_send_start = iociic_send_start; - sc->sc_i2c.ic_send_stop = iociic_send_stop; - sc->sc_i2c.ic_initiate_xfer = iociic_initiate_xfer; - sc->sc_i2c.ic_read_byte = iociic_read_byte; - sc->sc_i2c.ic_write_byte = iociic_write_byte; - - memset(&iba, 0, sizeof(iba)); - iba.iba_tag = &sc->sc_i2c; - (void) config_found_ia(self, "i2cbus", &iba, iicbus_print); -} - -CFATTACH_DECL_NEW(iociic, sizeof(struct iociic_softc), - iociic_match, iociic_attach, NULL, NULL); - -i2c_tag_t -iociic_bootstrap_cookie(void) -{ - - if (the_iociic == NULL) - return NULL; - return &the_iociic->sc_i2c; -} - -static int -iociic_acquire_bus(void *cookie, int flags) -{ - struct iociic_softc *sc = cookie; - - /* XXX What should we do for the polling case? */ - if (flags & I2C_F_POLL) - return (0); - - mutex_enter(&sc->sc_buslock); - return 0; -} - -static void -iociic_release_bus(void *cookie, int flags) -{ - struct iociic_softc *sc = cookie; - - /* XXX See above. */ - if (flags & I2C_F_POLL) - return; - - mutex_exit(&sc->sc_buslock); -} - -static int -iociic_send_start(void *cookie, int flags) -{ - - return i2c_bitbang_send_start(cookie, flags, &iociic_bbops); -} - -static int -iociic_send_stop(void *cookie, int flags) -{ - - return (i2c_bitbang_send_stop(cookie, flags, &iociic_bbops)); -} - -static int -iociic_initiate_xfer(void *cookie, i2c_addr_t addr, int flags) -{ - - return i2c_bitbang_initiate_xfer(cookie, addr, flags, &iociic_bbops); -} - -static int -iociic_read_byte(void *cookie, uint8_t *bytep, int flags) -{ - - return i2c_bitbang_read_byte(cookie, bytep, flags, &iociic_bbops); -} - -static int -iociic_write_byte(void *cookie, uint8_t byte, int flags) -{ - - return i2c_bitbang_write_byte(cookie, byte, flags, &iociic_bbops); -} Index: sys/arch/acorn26/ioc/iociicvar.h =================================================================== RCS file: sys/arch/acorn26/ioc/iociicvar.h diff -N sys/arch/acorn26/ioc/iociicvar.h --- sys/arch/acorn26/ioc/iociicvar.h 11 Dec 2005 12:16:04 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,44 +0,0 @@ -/* $NetBSD: iociicvar.h,v 1.2 2005/12/11 12:16:04 christos Exp $ */ - -/* - * Copyright (c) 2003 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Jason R. Thorpe for Wasabi Systems, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * 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 for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC - * 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. - */ - -#ifndef _ACORN26_IOC_IOCIICVAR_H_ -#define _ACORN26_IOC_IOCIICVAR_H_ - -/* For use during bootstrap. */ -i2c_tag_t iociic_bootstrap_cookie(void); - -#endif /* _ACORN26_IOC_IOCIICVAR_H_ */ Index: sys/arch/acorn26/ioc/ioeb.c =================================================================== RCS file: sys/arch/acorn26/ioc/ioeb.c diff -N sys/arch/acorn26/ioc/ioeb.c --- sys/arch/acorn26/ioc/ioeb.c 27 Oct 2012 17:17:22 -0000 1.8 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,93 +0,0 @@ -/* $NetBSD: ioeb.c,v 1.8 2012/10/27 17:17:22 chs Exp $ */ - -/*- - * Copyright (c) 2000 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#include - -__KERNEL_RCSID(0, "$NetBSD: ioeb.c,v 1.8 2012/10/27 17:17:22 chs Exp $"); - -#include -#include -#include - -#include -#include -#include - -struct ioeb_softc { - bus_space_tag_t sc_iot; - bus_space_handle_t sc_ioh; -}; - -static int ioeb_match(device_t, cfdata_t, void *); -static void ioeb_attach(device_t, device_t, void *); - -CFATTACH_DECL_NEW(ioeb, sizeof(struct ioeb_softc), - ioeb_match, ioeb_attach, NULL, NULL); - -device_t the_ioeb; - -/* IOEB is only four bits wide */ -#define ioeb_read(t, h, o) (bus_space_read_1(t, h, o) & 0xf) - -static int -ioeb_match(device_t parent, cfdata_t cf, void *aux) -{ - struct ioc_attach_args *ioc = aux; - int id; - - id = ioeb_read(ioc->ioc_fast_t, ioc->ioc_fast_h, IOEB_REG_ID); - if (id == IOEB_ID_IOEB) - return 1; - if (id != 0xf) - printf("ioeb_match: ID = %x\n", id); - return 0; -} - -static void -ioeb_attach(device_t parent, device_t self, void *aux) -{ - struct ioeb_softc *sc = device_private(self); - struct ioc_attach_args *ioc = aux; - - if (the_ioeb == NULL) - the_ioeb = self; - sc->sc_iot = ioc->ioc_fast_t; - sc->sc_ioh = ioc->ioc_fast_h; - printf("\n"); -} - -void -ioeb_irq_clear(int mask) -{ - struct ioeb_softc *sc = device_private(the_ioeb); - - /* The IOEB only controls interrupt 0 */ - if (mask & IOEB_IRQ_CLEARABLE_MASK) - bus_space_write_1(sc->sc_iot, sc->sc_ioh, IOEB_REG_INTRCLR, 0); -} Index: sys/arch/acorn26/ioc/ioebreg.h =================================================================== RCS file: sys/arch/acorn26/ioc/ioebreg.h diff -N sys/arch/acorn26/ioc/ioebreg.h --- sys/arch/acorn26/ioc/ioebreg.h 24 Mar 2002 15:47:19 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,40 +0,0 @@ -/* $NetBSD: ioebreg.h,v 1.1 2002/03/24 15:47:19 bjh21 Exp $ */ - -/* - * This file is in the public domain. - * - * Derived from: - * RISC OS 3 Programmer's Reference Manual - * A3010/A3020/A4000 Technical Reference Manual - */ - -/* Acorn IOEB (Input/Output Extension Block) registers */ - -#ifndef _IOEBREG_H_ -#define _IOEBREG_H_ - -/* - * IOEB starts at a rather high offset because it avoids the ranges - * used on older machines. - */ - -#define IOEB_REG_VIDCTL 18 /* Video control latch */ -#define IOEB_REG_ID 20 /* Device ID */ -#define IOEB_REG_SPEED 21 /* Clock speed (A4?) */ -#define IOEB_REG_INTRCLR 22 /* Printer interrupt clear */ -#define IOEB_REG_MONID 28 /* Monitor ID */ -#define IOEB_REG_VGATEST 29 /* VGA test pin/SCART sound ??? */ -#define IOEB_REG_JOY1 30 /* Joystick 1 */ -#define IOEB_REG_JOY2 31 /* Joystick 2 */ - -/* The IOEB is connected to D[3:0], so its internal registers are 4-bit */ -#define IOEB_VIDCTL_HSINV 0x1 /* Invert horizontal sync */ -#define IOEB_VIDCTL_VSINV 0x2 /* Invert vertical sync */ -#define IOEB_VIDCTL_CLK_MASK 0xc /* VIDCLK select */ -#define IOEB_VIDCTL_CLK_24MHZ 0x0 /* 24 MHz */ -#define IOEB_VIDCTL_CLK_25MHZ 0x4 /* 25.175 MHz */ -#define IOEB_VIDCTL_CLK_36MHZ 0x8 /* 36 MHz */ - -#define IOEB_ID_IOEB 0x5 - -#endif Index: sys/arch/acorn26/ioc/ioebvar.h =================================================================== RCS file: sys/arch/acorn26/ioc/ioebvar.h diff -N sys/arch/acorn26/ioc/ioebvar.h --- sys/arch/acorn26/ioc/ioebvar.h 3 Jun 2011 07:08:48 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,38 +0,0 @@ -/* $NetBSD: ioebvar.h,v 1.3 2011/06/03 07:08:48 matt Exp $ */ - -/*- - * Copyright (c) 2000 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#ifndef _IOEBVAR_H_ -#define _IOEBVAR_H_ - -#define IOEB_IRQ_CLEARABLE_MASK 0x0001 - -extern void ioeb_irq_clear(int mask); - -extern device_t the_ioeb; -#endif Index: sys/arch/acorn26/ioc/latches.c =================================================================== RCS file: sys/arch/acorn26/ioc/latches.c diff -N sys/arch/acorn26/ioc/latches.c --- sys/arch/acorn26/ioc/latches.c 8 Mar 2014 15:46:20 -0000 1.9 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,114 +0,0 @@ -/* $NetBSD: latches.c,v 1.9 2014/03/08 15:46:20 skrll Exp $ */ - -/*- - * Copyright (c) 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#include - -__KERNEL_RCSID(0, "$NetBSD: latches.c,v 1.9 2014/03/08 15:46:20 skrll Exp $"); - -#include -#include -#include - -#include -#include -#include -#include - -#include "ioeb.h" - -struct latches_softc { - device_t sc_dev; - bus_space_tag_t sc_iot; - bus_space_handle_t sc_ioh; - uint8_t sc_latcha; - uint8_t sc_latchb; -}; - -static int latches_match(device_t, cfdata_t, void *); -static void latches_attach(device_t, device_t, void *); - -CFATTACH_DECL_NEW(latches, sizeof(struct latches_softc), - latches_match, latches_attach, NULL, NULL); - -device_t the_latches; - -static int -latches_match(device_t parent, cfdata_t cf, void *aux) -{ - - /* - * Latches are write-only, so we can't probe for them. - * Happily, the set of machines they exist on is precisely the - * set that doesn't have IOEBs, so... - */ -#if NIOEB > 0 - if (the_ioeb != NULL) - return 0; -#endif - return 1; -} - -static void -latches_attach(device_t parent, device_t self, void *aux) -{ - struct latches_softc *sc = device_private(self); - struct ioc_attach_args *ioc = aux; - - sc->sc_dev = self; - if (the_latches == NULL) - the_latches = self; - sc->sc_iot = ioc->ioc_fast_t; - sc->sc_ioh = ioc->ioc_fast_h; - - sc->sc_latcha = - LATCHA_NSEL0 | LATCHA_NSEL1 | LATCHA_NSEL2 | LATCHA_NSEL3 | - LATCHA_NSIDE1 | LATCHA_NMOTORON | LATCHA_NINUSE; - sc->sc_latchb = LATCHB_NFDCR | LATCHB_NPSTB; - bus_space_write_1(sc->sc_iot, sc->sc_ioh, LATCH_A, sc->sc_latcha); - bus_space_write_1(sc->sc_iot, sc->sc_ioh, LATCH_B, sc->sc_latchb); - aprint_normal("\n"); -} - -void -latcha_update(uint8_t mask, uint8_t value) -{ - struct latches_softc *sc = device_private(the_latches); - - sc->sc_latcha = (sc->sc_latcha & ~mask) | value; - bus_space_write_1(sc->sc_iot, sc->sc_ioh, LATCH_A, sc->sc_latcha); -} - -void -latchb_update(uint8_t mask, uint8_t value) -{ - struct latches_softc *sc = device_private(the_latches); - - sc->sc_latchb = (sc->sc_latchb & ~mask) | value; - bus_space_write_1(sc->sc_iot, sc->sc_ioh, LATCH_B, sc->sc_latcha); -} Index: sys/arch/acorn26/ioc/latchreg.h =================================================================== RCS file: sys/arch/acorn26/ioc/latchreg.h diff -N sys/arch/acorn26/ioc/latchreg.h --- sys/arch/acorn26/ioc/latchreg.h 24 Mar 2002 23:37:44 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,60 +0,0 @@ -/* $NetBSD: latchreg.h,v 1.2 2002/03/24 23:37:44 bjh21 Exp $ */ -/*- - * Copyright (c) 1997, 1998, 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * latchreg.h - Archimedes internal latches - */ - -#ifndef _LATCHREG_H -#define _LATCHREG_H - -/* Register offsets for latches (bus_space units) */ - -#define LATCH_A 0x10 -#define LATCH_B 0x06 - -/* Latch A controls some of the floppy disc system (all active-low). */ -#define LATCHA_NSEL0 0x01 /* Floppy drive 0 select */ -#define LATCHA_NSEL1 0x02 /* Floppy drive 1 select */ -#define LATCHA_NSEL2 0x04 /* Floppy drive 2 select */ -#define LATCHA_NSEL3 0x08 /* Floppy drive 3 select */ -#define LATCHA_NSIDE1 0x10 /* Floppy side select. */ -#define LATCHA_NMOTORON 0x20 /* Motor on/off */ -#define LATCHA_NINUSE 0x40 /* 'In Use' */ -/* Bit 7 not used */ - -/* Latch B does all sorts of random stuff (mostly active-low). */ -/* Bit 0 reserved */ -#define LATCHB_NDDEN 0x02 /* Floppy disc density setting */ -/* Bit 2 reserved */ -#define LATCHB_NFDCR 0x08 /* Floppy controller reset */ -#define LATCHB_NPSTB 0x10 /* Printer strobe line */ -#define LATCHB_AUX1 0x20 /* Spare (VIDC Enhancer?) */ -#define LATCHB_AUX2 0x40 /* Spare */ -/* Bit 7 not used */ - -#endif /* !_LATCHREG_H */ Index: sys/arch/acorn26/ioc/latchvar.h =================================================================== RCS file: sys/arch/acorn26/ioc/latchvar.h diff -N sys/arch/acorn26/ioc/latchvar.h --- sys/arch/acorn26/ioc/latchvar.h 11 May 2012 15:39:18 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,38 +0,0 @@ -/* $NetBSD: latchvar.h,v 1.3 2012/05/11 15:39:18 skrll Exp $ */ - -/*- - * Copyright (c) 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#ifndef _LATCHVAR_H_ -#define _LATCHVAR_H_ - -extern device_t the_latches; - -extern void latcha_update(uint8_t mask, uint8_t value); -extern void latchb_update(uint8_t mask, uint8_t value); - -#endif Index: sys/arch/acorn26/ioc/ssn.c =================================================================== RCS file: sys/arch/acorn26/ioc/ssn.c diff -N sys/arch/acorn26/ioc/ssn.c --- sys/arch/acorn26/ioc/ssn.c 27 Oct 2012 17:17:23 -0000 1.12 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,181 +0,0 @@ -/* $NetBSD: ssn.c,v 1.12 2012/10/27 17:17:23 chs Exp $ */ - -/*- - * Copyright (c) 2002 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#include -__KERNEL_RCSID(0, "$NetBSD: ssn.c,v 1.12 2012/10/27 17:17:23 chs Exp $"); - -#include -#include -#include -#include - -#include -#include - -#include - -struct ssn_softc { - struct ds_handle sc_dsh; - device_t sc_ioc; - int sc_timebase; -}; - -static int ssn_match(device_t, cfdata_t, void *); -static void ssn_attach(device_t, device_t, void *); - -CFATTACH_DECL_NEW(ssn, sizeof(struct ssn_softc), - ssn_match, ssn_attach, NULL, NULL); - -static int ds_ioc_read_bit(void *); -static void ds_ioc_write_bit(void *, int); -static void ds_ioc_reset(void *); - -static int ds_crc(const uint8_t *data, size_t len); - -static int -ssn_match(device_t parent, cfdata_t cf, void *aux) -{ - - return (1); -} - -static void -ssn_attach(device_t parent, device_t self, void *aux) -{ - struct ssn_softc *sc = device_private(self); - int i; - uint8_t rombuf[8]; - - sc->sc_ioc = parent; - sc->sc_dsh.ds_read_bit = ds_ioc_read_bit; - sc->sc_dsh.ds_write_bit = ds_ioc_write_bit; - sc->sc_dsh.ds_reset = ds_ioc_reset; - sc->sc_dsh.ds_hw_handle = sc; - - sc->sc_dsh.ds_reset(sc->sc_dsh.ds_hw_handle); - - ds_write_byte(&sc->sc_dsh, DS_ROM_READ); - for (i=0; i<8; ++i) - rombuf[i] = ds_read_byte(&sc->sc_dsh); - - printf(": ROM %02x %02x%02x%02x%02x%02x%02x %02x CRC %02x\n", - rombuf[7], rombuf[6], rombuf[5], rombuf[4], - rombuf[3], rombuf[2], rombuf[1], rombuf[0], ds_crc(rombuf, 8)); - -} - -static int -ds_ioc_read_bit(void *cookie) -{ - struct ssn_softc *sc = cookie; - int result; - - /* - * Read is 1--15us low, >60us high. - * Sample 15us after falling edge. - */ - ioc_ctl_write(sc->sc_ioc, 0, IOC_CTL_SSN); - ioc_ctl_write(sc->sc_ioc, IOC_CTL_SSN, IOC_CTL_SSN); - result = (ioc_ctl_read(sc->sc_ioc) & IOC_CTL_SSN) != 0; - DELAY(60); - return result; -} - -static void -ds_ioc_write_bit(void *cookie, int bit) -{ - struct ssn_softc *sc = cookie; - - if (!bit) { - /* Write 0 is 60--120us low, >1us high. */ - ioc_ctl_write(sc->sc_ioc, 0, IOC_CTL_SSN); - DELAY(60); - ioc_ctl_write(sc->sc_ioc, IOC_CTL_SSN, IOC_CTL_SSN); - DELAY(1); - } else { - /* Write 1 is 1--15us low, >60us high. */ - ioc_ctl_write(sc->sc_ioc, 0, IOC_CTL_SSN); - ioc_ctl_write(sc->sc_ioc, IOC_CTL_SSN, IOC_CTL_SSN); - DELAY(60); - } -} - -static void -ds_ioc_reset(void *cookie) -{ - struct ssn_softc *sc = cookie; - int t_pdh, t_pdl; - - /* Reset pulse is >480us low, then >480us high. */ - ioc_ctl_write(sc->sc_ioc, 0, IOC_CTL_SSN); - DELAY(480); - ioc_ctl_write(sc->sc_ioc, IOC_CTL_SSN, IOC_CTL_SSN); - DELAY(60); - if ((ioc_ctl_read(sc->sc_ioc) & IOC_CTL_SSN) != 0) { - printf(": No presence pulse\n"); - return; - } - DELAY(420); - /* Reset again, and time it this time. */ - ioc_ctl_write(sc->sc_ioc, 0, IOC_CTL_SSN); - DELAY(480); - ioc_ctl_write(sc->sc_ioc, IOC_CTL_SSN, IOC_CTL_SSN); - t_pdh = 0; - while ((ioc_ctl_read(sc->sc_ioc) & IOC_CTL_SSN) != 0) - t_pdh++; - t_pdl = 0; - while ((ioc_ctl_read(sc->sc_ioc) & IOC_CTL_SSN) == 0) - t_pdl++; - DELAY(480); - printf(": t_PDH = %d, t_PDL = %d", t_pdh, t_pdl); - sc->sc_timebase = (t_pdh + t_pdl) / 5 + 1; -} - -#define DS_CRC_POLY 0x8c - -static int -ds_crc(const uint8_t *buf, size_t len) -{ - uint8_t c, crc, carry; - size_t i, j; - - crc = 0; - - for (i = 0; i < len; i++) { - c = buf[i]; - for (j = 0; j < 8; j++) { - carry = (crc ^ c) & 0x01; - crc >>= 1; - c >>= 1; - if (carry) - crc ^= DS_CRC_POLY; - } - } - return (crc); -} Index: sys/arch/acorn26/podulebus/if_eh.c =================================================================== RCS file: sys/arch/acorn26/podulebus/if_eh.c diff -N sys/arch/acorn26/podulebus/if_eh.c --- sys/arch/acorn26/podulebus/if_eh.c 11 May 2012 15:39:18 -0000 1.17 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,851 +0,0 @@ -/* $NetBSD: if_eh.c,v 1.17 2012/05/11 15:39:18 skrll Exp $ */ - -/*- - * Copyright (c) 2000 Ben Harris - * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, - * NASA Ames Research Center. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 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. - */ -/* - * Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved. - * - * Copyright (C) 1993, David Greenman. This software may be used, modified, - * copied, distributed, and sold, in both source and binary form provided that - * the above copyright and these terms are retained. Under no circumstances is - * the author responsible for the proper functioning of this software, nor does - * the author assume any responsibility for damages incurred with its use. - */ -/* - * if_eh.c -- driver for i-cubed EtherLan 100-, 200- and 500-series cards. - */ - -#include - -__KERNEL_RCSID(0, "$NetBSD: if_eh.c,v 1.17 2012/05/11 15:39:18 skrll Exp $"); - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#include -#include - -#ifndef __BUS_SPACE_HAS_STREAM_METHODS -#define bus_space_write_stream_2 bus_space_write_2 -#define bus_space_write_multi_stream_2 bus_space_write_multi_2 -#define bus_space_read_multi_stream_2 bus_space_read_multi_2 -#endif /* __BUS_SPACE_HAS_STREAM_METHODS */ - -#include -#include - -#include -#include -#include - -#define EH_MEDIA_2 0 -#define EH_MEDIA_T 1 -#define EH_MEDIA_2_T 2 -#define EH_MEDIA_FL_T 3 - -struct eh_softc { - struct dp8390_softc sc_dp; - bus_space_tag_t sc_datat; - bus_space_handle_t sc_datah; - bus_space_tag_t sc_ctlt; - bus_space_handle_t sc_ctlh; - bus_space_tag_t sc_ctl2t; - bus_space_handle_t sc_ctl2h; - void *sc_ih; - struct evcnt sc_intrcnt; - int sc_flags; -#define EHF_16BIT 0x01 -#define EHF_MAU 0x02 - int sc_type; - int sc_mediaset; - uint8_t sc_ctrl; /* Current control reg state */ -}; - -int eh_write_mbuf(struct dp8390_softc *, struct mbuf *, int); -int eh_ring_copy(struct dp8390_softc *, int, void *, u_short); -void eh_read_hdr(struct dp8390_softc *, int, struct dp8390_ring *); -int eh_test_mem(struct dp8390_softc *); - -void eh_writemem(struct eh_softc *, uint8_t *, int, size_t); -void eh_readmem(struct eh_softc *, int, uint8_t *, size_t); -static void eh_init_card(struct dp8390_softc *); -static int eh_availmedia(struct eh_softc *); -/*static*/ int eh_identifymau(struct eh_softc *); - -void eh_media_init(struct dp8390_softc *); - -/* if_media glue */ -static int eh_mediachange(struct dp8390_softc *); -static void eh_mediastatus(struct dp8390_softc *, struct ifmediareq *); - -/* autoconfiguration glue */ -static int eh_match(device_t, cfdata_t , void *); -static void eh_attach(device_t, device_t, void *); - -CFATTACH_DECL_NEW(eh, sizeof(struct eh_softc), - eh_match, eh_attach, NULL, NULL); - -static int -eh_match(device_t parent, cfdata_t cf, void *aux) -{ - struct podulebus_attach_args *pa = aux; - - switch (pa->pa_product) { - case PODULE_ETHERLAN100: - case PODULE_ETHERLAN100AEH: - case PODULE_ETHERLAN200: - case PODULE_ETHERLAN200AEH: - case PODULE_ETHERLAN500: - case PODULE_ETHERLAN500AEH: - return 1; - } - return 0; -} - -/* XXX 10BASE-FL on E513 */ -static int media_only2[] = { IFM_ETHER | IFM_10_2 }; -static int media_onlyt[] = { IFM_ETHER | IFM_10_T }; -static int media_2andt[] = - { IFM_ETHER | IFM_AUTO, IFM_ETHER | IFM_10_2, IFM_ETHER | IFM_10_T }; -static const struct { - int nmedia; - int *media; -} media_switch[] = { - { 1, media_only2 }, - { 1, media_onlyt }, - { 3, media_2andt } -}; - -static void -eh_attach(device_t parent, device_t self, void *aux) -{ - struct podulebus_attach_args *pa = aux; - struct eh_softc *sc = device_private(self); - struct dp8390_softc *dsc = &sc->sc_dp; - int mediaset, mautype; - int i; - char *ptr; - uint8_t *myaddr; - - dsc->sc_dev = self; - - /* Canonicalise card type. */ - switch (pa->pa_product) { - case PODULE_ETHERLAN100: - case PODULE_ETHERLAN100AEH: - sc->sc_type = PODULE_ETHERLAN100; - break; - case PODULE_ETHERLAN200: - case PODULE_ETHERLAN200AEH: - sc->sc_type = PODULE_ETHERLAN200; - break; - case PODULE_ETHERLAN500: - case PODULE_ETHERLAN500AEH: - sc->sc_type = PODULE_ETHERLAN500; - break; - } - - /* Memory size and width varies. */ - dsc->mem_start = 0; - switch (sc->sc_type) { - case PODULE_ETHERLAN200: - sc->sc_flags |= EHF_MAU; - /* FALLTHROUGH */ - case PODULE_ETHERLAN100: - printf(": 8-bit, 32 KB RAM"); - dsc->mem_size = 0x8000; - break; - case PODULE_ETHERLAN500: - printf(": 16-bit, 64 KB RAM"); - sc->sc_flags |= EHF_16BIT; - dsc->mem_size = 0x10000; - break; - } - - /* Set up bus spaces */ - dsc->sc_regt = pa->pa_mod_t; - bus_space_subregion(dsc->sc_regt, pa->pa_mod_h, EH_DP8390, 0x10, - &dsc->sc_regh); - sc->sc_datat = pa->pa_mod_t; - bus_space_subregion(sc->sc_datat, pa->pa_mod_h, EH_DATA, 1, - &sc->sc_datah); - sc->sc_ctlt = pa->pa_fast_t; - bus_space_subregion(sc->sc_ctlt, pa->pa_fast_h, EH_CTRL, 1, - &sc->sc_ctlh); - sc->sc_ctl2t = pa->pa_fast_t; - bus_space_subregion(sc->sc_ctl2t, pa->pa_fast_h, EH_CTRL2, 1, - &sc->sc_ctl2h); - - /* dsc->cr_proto? */ - /* dsc->rcr_proto? */ - - /* Follow NE2000 driver here. */ - dsc->dcr_reg = ED_DCR_FT1 | ED_DCR_LS; - if (sc->sc_flags & EHF_16BIT) - dsc->dcr_reg |= ED_DCR_WTS; - - /* Set up callbacks */ - dsc->test_mem = eh_test_mem; - dsc->init_card = eh_init_card; - dsc->read_hdr = eh_read_hdr; - /* dsc->recv_int */ - dsc->ring_copy = eh_ring_copy; - dsc->write_mbuf = eh_write_mbuf; - /* dsc->sc_enable */ - /* dsc->sc_disable */ - dsc->sc_mediachange = eh_mediachange; - dsc->sc_mediastatus = eh_mediastatus; - dsc->sc_media_init = eh_media_init; - /* dsc->sc_media_fini */ - - for (i = 0; i < 16; i++) - dsc->sc_reg_map[i] = i; - - sc->sc_ctrl = 0x00; - - if (sc->sc_flags & EHF_MAU) { - mautype = eh_identifymau(sc); - switch (mautype) { - case EH200_MAUID_10_2: - printf(", 10BASE2 MAU"); - mediaset = EH_MEDIA_2; - break; - case EH200_MAUID_10_T: - printf(", 10BASE-T MAU"); - mediaset = EH_MEDIA_T; - break; - default: - printf(", unknown MAU id %d", mautype); - mediaset = EH_MEDIA_2; /* XXX */ - break; - } - } else { - mediaset = eh_availmedia(sc); - switch (mediaset) { - case EH_MEDIA_2: - printf(", 10BASE2 only"); - break; - case EH_MEDIA_T: - printf(", 10BASE-T only"); - break; - case EH_MEDIA_2_T: - printf(", combo 10BASE2/-T"); - break; - } - } - sc->sc_mediaset = mediaset; - printf("\n"); - - /* i-cubed put everything behind the loader. */ - podulebus_initloader(pa); - - /* - * Get the Ethernet address from the device description string. - * This code is stolen from if_ea.c. It should be shared. - */ - myaddr = dsc->sc_enaddr; - if (pa->pa_descr == NULL) { - printf(": No description for Ethernet address\n"); - return; - } - ptr = strchr(pa->pa_descr, '('); - if (ptr == NULL) { - printf(": Ethernet address not found in description\n"); - return; - } - ptr++; - for (i = 0; i < ETHER_ADDR_LEN; i++) { - myaddr[i] = strtoul(ptr, &ptr, 16); - if (*ptr++ != (i == ETHER_ADDR_LEN - 1 ? ')' : ':')) { - printf(": Bad Ethernet address found in " - "description\n"); - return; - } - } - - dp8390_config(dsc); - dp8390_stop(dsc); - - evcnt_attach_dynamic(&sc->sc_intrcnt, EVCNT_TYPE_INTR, NULL, - device_xname(self), "intr"); - sc->sc_ih = podulebus_irq_establish(pa->pa_ih, IPL_NET, dp8390_intr, - &sc->sc_dp, &sc->sc_intrcnt); - if (bootverbose) - aprint_verbose_dev(self, "interrupting at %s\n", - irq_string(sc->sc_ih)); - sc->sc_ctrl |= EH_CTRL_IE; - bus_space_write_1(sc->sc_ctlt, sc->sc_ctlh, 0, sc->sc_ctrl); -} - -static void -eh_init_card(struct dp8390_softc *sc) -{ - - eh_mediachange(sc); -} - -/* - * Write an mbuf chain to the destination NIC memory address using programmed - * I/O. - */ -int -eh_write_mbuf(struct dp8390_softc *dsc, struct mbuf *m, int buf) -{ - struct eh_softc *sc = (struct eh_softc *)dsc; - bus_space_tag_t nict = dsc->sc_regt; - bus_space_handle_t nich = dsc->sc_regh; - bus_space_tag_t datat = sc->sc_datat; - bus_space_handle_t datah = sc->sc_datah; - int savelen, padlen; - int maxwait = 100; /* about 120us */ - - savelen = m->m_pkthdr.len; - if (savelen < ETHER_MIN_LEN - ETHER_CRC_LEN) { - padlen = ETHER_MIN_LEN - ETHER_CRC_LEN - savelen; - savelen = ETHER_MIN_LEN - ETHER_CRC_LEN; - } else - padlen = 0; - - /* - * Set-up procedure per DP83902A data sheet: - * I) Write a non-zero value into RBCR0. - * II) Set bits RD2, RD1, and RD0 to 0, 0, and 1. - * III) Set RBCR0, 1 and RSAR0, 1. - * IV) Issue the Remote Write DMA Command (RD2, RD1, RD0 = 0, 1, 0). - */ - - /* Select page 0 registers. */ - - NIC_BARRIER(nict, nich); - bus_space_write_1(nict, nich, ED_P0_CR, - ED_CR_RD2 | ED_CR_PAGE_0 | ED_CR_STA); - NIC_BARRIER(nict, nich); - - /* Write random number. Linux writes several, follow them. */ - bus_space_write_1(nict, nich, ED_P0_RBCR0, 123); - bus_space_write_1(nict, nich, ED_P0_RBCR1, 123); - bus_space_write_1(nict, nich, ED_P0_RSAR0, 123); - bus_space_write_1(nict, nich, ED_P0_RSAR1, 123); - NIC_BARRIER(nict, nich); - - /* Linux has a 1us pause here. Follow them. */ - DELAY(1); - - /* Select DMA read (see above) */ - bus_space_write_1(nict, nich, ED_P0_CR, - ED_CR_RD0 | ED_CR_PAGE_0 | ED_CR_STA); - NIC_BARRIER(nict, nich); - - /* Reset remote DMA complete flag. */ - bus_space_write_1(nict, nich, ED_P0_ISR, ED_ISR_RDC); - NIC_BARRIER(nict, nich); - - /* Set up DMA byte count. */ - bus_space_write_1(nict, nich, ED_P0_RBCR0, savelen); - bus_space_write_1(nict, nich, ED_P0_RBCR1, savelen >> 8); - - /* Set up destination address in NIC mem. */ - bus_space_write_1(nict, nich, ED_P0_RSAR0, buf); - bus_space_write_1(nict, nich, ED_P0_RSAR1, buf >> 8); - - /* Set remote DMA write. */ - NIC_BARRIER(nict, nich); - bus_space_write_1(nict, nich, - ED_P0_CR, ED_CR_RD1 | ED_CR_PAGE_0 | ED_CR_STA); - NIC_BARRIER(nict, nich); - - /* - * Transfer the mbuf chain to the NIC memory. NE2000 cards - * require that data be transferred as words, and only words, - * so that case requires some extra code to patch over odd-length - * mbufs. - */ - if ((sc->sc_flags & EHF_16BIT) == 0) { - /* NE1000s are easy. */ - for (; m != 0; m = m->m_next) - if (m->m_len) - bus_space_write_multi_1(datat, datah, 0, - mtod(m, uint8_t *), m->m_len); - if (padlen) { - for(; padlen > 0; padlen--) - bus_space_write_1(datat, datah, 0, 0); - } - } else { - /* NE2000s are a bit trickier. */ - uint8_t *data, savebyte[2]; - int l, leftover; -#ifdef DIAGNOSTIC - uint8_t *lim; -#endif - /* Start out with no leftover data. */ - leftover = 0; - savebyte[0] = savebyte[1] = 0; - - for (; m != 0; m = m->m_next) { - l = m->m_len; - if (l == 0) - continue; - data = mtod(m, uint8_t *); -#ifdef DIAGNOSTIC - lim = data + l; -#endif - while (l > 0) { - if (leftover) { - /* - * Data left over (from mbuf or - * realignment). Buffer the next - * byte, and write it and the - * leftover data out. - */ - savebyte[1] = *data++; - l--; - bus_space_write_stream_2(datat, datah, - 0, - *(uint16_t *)savebyte); - leftover = 0; - } else if (BUS_SPACE_ALIGNED_POINTER(data, - uint16_t) == 0) { - /* - * Unaligned data; buffer the next - * byte. - */ - savebyte[0] = *data++; - l--; - leftover = 1; - } else { - /* - * Aligned data; output contiguous - * words as much as we can, then - * buffer the remaining byte, if any. - */ - leftover = l & 1; - l &= ~1; - bus_space_write_multi_stream_2(datat, - datah, 0, - (uint16_t *)data, l >> 1); - data += l; - if (leftover) - savebyte[0] = *data++; - l = 0; - } - } - if (l < 0) - panic("eh_write_mbuf: negative len"); -#ifdef DIAGNOSTIC - if (data != lim) - panic("eh_write_mbuf: data != lim"); -#endif - } - if (leftover) { - savebyte[1] = 0; - bus_space_write_stream_2(datat, datah, 0, - *(uint16_t *)savebyte); - } - if (padlen) { - for(; padlen > 0; padlen -= 2) - bus_space_write_stream_2(datat, datah, 0, 0); - } - } - NIC_BARRIER(nict, nich); - - /* - * Wait for remote DMA to complete. This is necessary because on the - * transmit side, data is handled internally by the NIC in bursts, and - * we can't start another remote DMA until this one completes. Not - * waiting causes really bad things to happen - like the NIC wedging - * the bus. - */ - while (((bus_space_read_1(nict, nich, ED_P0_ISR) & ED_ISR_RDC) != - ED_ISR_RDC) && --maxwait) { - bus_space_read_1(nict, nich, ED_P0_CRDA1); - bus_space_read_1(nict, nich, ED_P0_CRDA0); - NIC_BARRIER(nict, nich); - DELAY(1); - } - - if (maxwait == 0) { - log(LOG_WARNING, - "%s: remote transmit DMA failed to complete " - "(RSAR=0x%04x, RBCR=0x%04x, CRDA=0x%02x%02x)\n", - device_xname(dsc->sc_dev), buf, savelen, - bus_space_read_1(nict, nich, ED_P0_CRDA1), - bus_space_read_1(nict, nich, ED_P0_CRDA0)); - dp8390_reset(dsc); - } - - return (savelen); -} - -/* - * Given a source and destination address, copy 'amout' of a packet from - * the ring buffer into a linear destination buffer. Takes into account - * ring-wrap. - */ -int -eh_ring_copy(struct dp8390_softc *dsc, int src, void *dst_arg, u_short amount) -{ - struct eh_softc *sc = (struct eh_softc *)dsc; - u_short tmp_amount; - uint8_t *dst = dst_arg; - - /* Does copy wrap to lower addr in ring buffer? */ - if (src + amount > dsc->mem_end) { - tmp_amount = dsc->mem_end - src; - - /* Copy amount up to end of NIC memory. */ - eh_readmem(sc, src, dst, tmp_amount); - - amount -= tmp_amount; - src = dsc->mem_ring; - dst += tmp_amount; - } - - eh_readmem(sc, src, dst, amount); - - return (src + amount); -} - -void -eh_read_hdr(struct dp8390_softc *dsc, int buf, struct dp8390_ring *hdr) -{ - struct eh_softc *sc = (struct eh_softc *)dsc; - - eh_readmem(sc, buf, (uint8_t *)hdr, sizeof(struct dp8390_ring)); -#if BYTE_ORDER == BIG_ENDIAN - hdr->count = bswap16(hdr->count); -#endif -} - -int -eh_test_mem(struct dp8390_softc *dsc) -{ - struct eh_softc *sc = (struct eh_softc *)dsc; - uint8_t block[256]; - int ptr, mem_end; - - mem_end = dsc->mem_start + dsc->mem_size; - memset(block, 0, 256); - for (ptr = dsc->mem_start; ptr < mem_end; ptr+=256) - eh_writemem(sc, block, ptr, 256); - return 0; -} - -/* - * Given a NIC memory source address and a host memory destination address, - * copy 'amount' from NIC to host using programmed i/o. The 'amount' is - * rounded up to a word - ok as long as mbufs are word sized. - */ -void -eh_readmem(struct eh_softc *sc, int src, uint8_t *dst, size_t amount) -{ - bus_space_tag_t nict = sc->sc_dp.sc_regt; - bus_space_handle_t nich = sc->sc_dp.sc_regh; - bus_space_tag_t datat = sc->sc_datat; - bus_space_handle_t datah = sc->sc_datah; - - /* Select page 0 registers. */ - NIC_BARRIER(nict, nich); - bus_space_write_1(nict, nich, ED_P0_CR, - ED_CR_RD2 | ED_CR_PAGE_0 | ED_CR_STA); - NIC_BARRIER(nict, nich); - - /* Round up to a word if necessary. */ - if ((sc->sc_flags & EHF_16BIT) && (amount & 1)) - ++amount; - - /* Set up DMA byte count. */ - bus_space_write_1(nict, nich, ED_P0_RBCR0, amount); - bus_space_write_1(nict, nich, ED_P0_RBCR1, amount >> 8); - - /* Set up source address in NIC mem. */ - bus_space_write_1(nict, nich, ED_P0_RSAR0, src); - bus_space_write_1(nict, nich, ED_P0_RSAR1, src >> 8); - - NIC_BARRIER(nict, nich); - bus_space_write_1(nict, nich, ED_P0_CR, - ED_CR_RD0 | ED_CR_PAGE_0 | ED_CR_STA); - NIC_BARRIER(nict, nich); - - if (sc->sc_flags & EHF_16BIT) { -#ifdef DIAGNOSTIC - if (!ALIGNED_POINTER(dst, uint16_t)) - panic("eh_readmem"); -#endif - bus_space_read_multi_stream_2(datat, datah, 0, - (uint16_t *)dst, amount >> 1); - } else - bus_space_read_multi_1(datat, datah, 0, dst, amount); -} - -void -eh_writemem(struct eh_softc *sc, uint8_t *src, int dst, size_t len) -{ - bus_space_tag_t nict = sc->sc_dp.sc_regt; - bus_space_handle_t nich = sc->sc_dp.sc_regh; - bus_space_tag_t datat = sc->sc_datat; - bus_space_handle_t datah = sc->sc_datah; - int maxwait = 100; /* about 120us */ - - /* - * Set-up procedure per DP83902A data sheet: - * I) Write a non-zero value into RBCR0. - * II) Set bits RD2, RD1, and RD0 to 0, 0, and 1. - * III) Set RBCR0, 1 and RSAR0, 1. - * IV) Issue the Remote Write DMA Command (RD2, RD1, RD0 = 0, 1, 0). - */ - - /* Select page 0 registers. */ - - NIC_BARRIER(nict, nich); - bus_space_write_1(nict, nich, ED_P0_CR, - ED_CR_RD2 | ED_CR_PAGE_0 | ED_CR_STA); - NIC_BARRIER(nict, nich); - - /* Write random number. Linux writes several, follow them. */ - bus_space_write_1(nict, nich, ED_P0_RBCR0, 123); - bus_space_write_1(nict, nich, ED_P0_RBCR1, 123); - bus_space_write_1(nict, nich, ED_P0_RSAR0, 123); - bus_space_write_1(nict, nich, ED_P0_RSAR1, 123); - NIC_BARRIER(nict, nich); - - /* Select DMA read (see above) */ - bus_space_write_1(nict, nich, ED_P0_CR, - ED_CR_RD0 | ED_CR_PAGE_0 | ED_CR_STA); - NIC_BARRIER(nict, nich); - - /* Linux has a 1us pause here. Follow them. */ - DELAY(1); - - /* Reset remote DMA complete flag. */ - bus_space_write_1(nict, nich, ED_P0_ISR, ED_ISR_RDC); - NIC_BARRIER(nict, nich); - - /* Set up DMA byte count. */ - bus_space_write_1(nict, nich, ED_P0_RBCR0, len); - bus_space_write_1(nict, nich, ED_P0_RBCR1, len >> 8); - - /* Set up destination address in NIC mem. */ - bus_space_write_1(nict, nich, ED_P0_RSAR0, dst); - bus_space_write_1(nict, nich, ED_P0_RSAR1, dst >> 8); - - /* Set remote DMA write. */ - NIC_BARRIER(nict, nich); - bus_space_write_1(nict, nich, - ED_P0_CR, ED_CR_RD1 | ED_CR_PAGE_0 | ED_CR_STA); - NIC_BARRIER(nict, nich); - - if (sc->sc_flags & EHF_16BIT) { -#ifdef DIAGNOSTIC - if (!ALIGNED_POINTER(dst, uint16_t)) - panic("eh_writemem"); -#endif - bus_space_write_multi_stream_2(datat, datah, 0, - (uint16_t *)src, len >> 1); - } else - bus_space_write_multi_1(datat, datah, 0, src, len); - - /* - * Wait for remote DMA to complete. This is necessary because on the - * transmit side, data is handled internally by the NIC in bursts, and - * we can't start another remote DMA until this one completes. Not - * waiting causes really bad things to happen - like the NIC wedging - * the bus. - */ - while (((bus_space_read_1(nict, nich, ED_P0_ISR) & ED_ISR_RDC) != - ED_ISR_RDC) && --maxwait) - DELAY(1); - - if (maxwait == 0) - printf("eh_writemem: failed to complete " - "(RSAR=0x%04x, RBCR=0x%04x, CRDA=0x%02x%02x)\n", - dst, (u_int)len, - bus_space_read_1(nict, nich, ED_P0_CRDA1), - bus_space_read_1(nict, nich, ED_P0_CRDA0)); -} - -/* - * Work out the media types available on the current card. - * - * We try to switch to each of 10BASE2 and 10BASE-T in turn. If the card - * only supports one type, the media select line will be tied to select - * that, so it won't move when we push it. - * - * The media select jumpers (at least on the EtherLan 100) have the same - * effect. - */ - -int -eh_availmedia(struct eh_softc *sc) -{ - - /* Set the card to use AUI (10BASE2 or 10BASE-FL) */ - bus_space_write_1(sc->sc_ctlt, sc->sc_ctlh, 0, - sc->sc_ctrl & ~EH_CTRL_MEDIA); - /* Check whether that worked */ - if ((bus_space_read_1(sc->sc_ctl2t, sc->sc_ctl2h, 0) & - EH_CTRL2_10B2) == 0) { - bus_space_write_1(sc->sc_ctlt, sc->sc_ctlh, 0, sc->sc_ctrl); - return EH_MEDIA_T; - } - - /* Try 10BASE-T and see if that works */ - bus_space_write_1(sc->sc_ctlt, sc->sc_ctlh, 0, - sc->sc_ctrl | EH_CTRL_MEDIA); - if ((bus_space_read_1(sc->sc_ctl2t, sc->sc_ctl2h, 0) & - EH_CTRL2_10B2)) { - bus_space_write_1(sc->sc_ctlt, sc->sc_ctlh, 0, sc->sc_ctrl); - return EH_MEDIA_2; - } - - /* If both of them worked, this is a combo card. */ - bus_space_write_1(sc->sc_ctlt, sc->sc_ctlh, 0, sc->sc_ctrl); - return EH_MEDIA_2_T; -} - -/* - * Identify the MAU attached to an EtherLan 200-series network slot card. - * - * Follows the protocol described at the back of the Acorn A3020 and A4000 - * Network Interface Specification. - */ -int -eh_identifymau(struct eh_softc *sc) -{ - int id; - bus_space_tag_t ctlt; - bus_space_handle_t ctlh; - - ctlt = sc->sc_ctlt; - ctlh = sc->sc_ctlh; - /* Reset: Output 1 for a nominal 100us. */ - /* XXX For some reason, a read is necessary between writes. */ - bus_space_read_1(ctlt, ctlh, 0); - bus_space_write_1(ctlt, ctlh, 0, EH200_CTRL_MAU); - DELAY(200000); - for (id = 0; id < 128; id++) { - /* Output 0 for 10us. */ - /* XXX For some reason, a read is necessary between writes. */ - bus_space_read_1(ctlt, ctlh, 0); - bus_space_write_1(ctlt, ctlh, 0, 0); - DELAY(10); - /* Read state. */ - if (bus_space_read_1(ctlt, ctlh, 0) & EH200_CTRL_MAU) - break; - /* Output 1 for 10us. */ - bus_space_write_1(ctlt, ctlh, 0, EH200_CTRL_MAU); - DELAY(10); - } - return id; -} - -void -eh_media_init(struct dp8390_softc *dsc) -{ - struct eh_softc *sc = (struct eh_softc *) dsc; - int i; - - ifmedia_init(&dsc->sc_media, 0, dp8390_mediachange, dp8390_mediastatus); - for (i = 0; i < media_switch[sc->sc_mediaset].nmedia; i++) - ifmedia_add(&dsc->sc_media, - media_switch[sc->sc_mediaset].media[i], 0, NULL); - ifmedia_set(&dsc->sc_media, media_switch[sc->sc_mediaset].media[0]); -} - -/* - * Medium selection has changed. - */ -int -eh_mediachange(struct dp8390_softc *dsc) -{ - struct eh_softc *sc = (struct eh_softc *)dsc; - struct ifmedia *ifm = &dsc->sc_media; - - switch (IFM_SUBTYPE(ifm->ifm_cur->ifm_media)) { - case IFM_AUTO: - /* Auto-media logic from Linux */ - sc->sc_ctrl |= EH_CTRL_MEDIA; - bus_space_write_1(sc->sc_ctlt, sc->sc_ctlh, 0, sc->sc_ctrl); - DELAY(1000); /* XXX Long enough for hub to respond? */ - if ((bus_space_read_1(sc->sc_ctlt, sc->sc_ctlh, 0) & - EH_CTRL_NOLINK) == 0) - break; - /* FALLTHROUGH */ - case IFM_10_2: - sc->sc_ctrl &= ~EH_CTRL_MEDIA; - bus_space_write_1(sc->sc_ctlt, sc->sc_ctlh, 0, sc->sc_ctrl); - break; - case IFM_10_T: - sc->sc_ctrl |= EH_CTRL_MEDIA; - bus_space_write_1(sc->sc_ctlt, sc->sc_ctlh, 0, sc->sc_ctrl); - break; -#ifdef DIAGNOSTIC - default: - panic("eh_mediachange"); -#endif - } - return 0; -} - -/* - * Return current medium and status. - */ -void -eh_mediastatus(struct dp8390_softc *dsc, struct ifmediareq *ifmr) -{ - struct eh_softc *sc = (struct eh_softc *)dsc; - int ctrl2; - - /* XXX 10BASE-FL on E513? */ - /* Read the actual medium currently in use. */ - ctrl2 = bus_space_read_1(sc->sc_ctl2t, sc->sc_ctl2h, 0); - if (ctrl2 & EH_CTRL2_10B2) { - ifmr->ifm_active = IFM_ETHER | IFM_10_2; - } else { - ifmr->ifm_active = IFM_ETHER | IFM_10_T; - ifmr->ifm_status = IFM_AVALID; - if ((bus_space_read_1(sc->sc_ctlt, sc->sc_ctlh, 0) & - EH_CTRL_NOLINK) == 0) - ifmr->ifm_status |= IFM_ACTIVE; - } - -} Index: sys/arch/acorn26/podulebus/if_ehreg.h =================================================================== RCS file: sys/arch/acorn26/podulebus/if_ehreg.h diff -N sys/arch/acorn26/podulebus/if_ehreg.h --- sys/arch/acorn26/podulebus/if_ehreg.h 24 Mar 2002 15:47:22 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,62 +0,0 @@ -/* $NetBSD: if_ehreg.h,v 1.1 2002/03/24 15:47:22 bjh21 Exp $ */ - -/* - * This file is in the public domain - */ - -#ifndef _IF_EHREG_H -#define _IF_EHREG_H - -/* - * Register definitions for i-cubed EtherLan 100-, 200-, and 500-series cards. - */ - -/* - * Addr r/w Descr - * SYNC+0x0000 r ROM data - * SYNC+0x0000 w ROM page latch - * FAST+0x0800 r/w AUX1 - * FAST+0x2800 r/w AUX2 - * MEMC+0x0000 r/w MX98902A registers - * MEMC+0x0200 r/w MX98902A data - * - * AUX1 bits: - * 0 r Interrupt status - * 0 w Interrupt enable - * 1 r (E100) Link beat (0 = link, 1 = no link) - * 1 w (E100) Media select (0 = 10b2, 1 = 10bT) - * 1 r (E200) MAU ID input (from MAU) - * 1 w (E200) MAU ID output (to MAU) - * - * AUX2 bits: - * 0 r Media sense (0 = 10bT, 1 = 10b2) - */ - -/* Loosely derived from Linux drivers/acorn/net/etherh.c. */ - -/* All offsets in bus_size units */ -#define EH_DP8390 0x000 /* MEMC space */ -#define EH_DATA 0x200 /* MEMC space */ -#define EH_CTRL 0x200 /* FAST space */ -#define EH_CTRL2 0xa00 /* FAST space */ - -/* Bits of the control register */ -#define EH_CTRL_IE 0x01 /* Interrupt enable (W) */ -#define EH_CTRL_IS 0x01 /* Interrupt status (R) */ -#define EH_CTRL_MEDIA 0x02 /* Media select (0 = 10b2, 1 = 10bT) (W) */ -#define EH_CTRL_NOLINK 0x02 /* Link beat detect (R) */ - -/* - * The EtherLan 200 is strange. A write to AUX1 following another write has - * the effect described above, but a write following a read affects this: - */ -#define EH200_CTRL_MAU 0x02 /* MAU input/output */ - -/* Bits of control register 2 */ -#define EH_CTRL2_10B2 0x01 /* Media sense (0 = 10bT, 1 = 10b2) (R) */ - -/* EtherLan 200 MAU types */ -#define EH200_MAUID_10_T 2 -#define EH200_MAUID_10_2 3 -#define EH200_MAUID_10_5 4 -#endif Index: sys/arch/acorn26/podulebus/podloader_asm.S =================================================================== RCS file: sys/arch/acorn26/podulebus/podloader_asm.S diff -N sys/arch/acorn26/podulebus/podloader_asm.S --- sys/arch/acorn26/podulebus/podloader_asm.S 28 Aug 2006 14:31:18 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,64 +0,0 @@ -/* $NetBSD: podloader_asm.S,v 1.3 2006/08/28 14:31:18 bjh21 Exp $ */ - -/*- - * Copyright (c) 2000 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#include - -RCSID("$NetBSD: podloader_asm.S,v 1.3 2006/08/28 14:31:18 bjh21 Exp $") - -#include - -/* - * register_t _podloader_call(register_t r0, register_t r1, register_t r11, - * void *loader, int entry) - * - * Podule loader register assignments: - * R0 Write/Read data - * R1 Address - * R2-R3 Scratch - * R4-R9 Preserved - * R10 Scratch - * R11 Hardware address, preserved - * R12 Preserved - * R13 Stack pointer, preserved - */ -ENTRY(_podloader_call) - mov ip, sp - stmfd sp!, {r4, r5, fp, ip, lr, pc} - sub fp, ip, #4 - ldr r4, [fp, #4] /* fetch entry */ - stmfd sp!, {fp} /* Save FP, since that's R11 */ - mov r11, r2 - mov lr, pc - add pc, r3, r4, lsl #2 /* Call loader */ - ldmfd sp!, {fp} - adrvs r0, Lpodloader_panicmsg - blvs _C_LABEL(panic) - ldmdb fp, {r4, r5, fp, sp, pc} -Lpodloader_panicmsg: - .asciz "podloader_call" Index: sys/arch/acorn26/podulebus/podulebus.c =================================================================== RCS file: sys/arch/acorn26/podulebus/podulebus.c diff -N sys/arch/acorn26/podulebus/podulebus.c --- sys/arch/acorn26/podulebus/podulebus.c 18 Aug 2013 16:08:42 -0000 1.21 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,382 +0,0 @@ -/* $NetBSD: podulebus.c,v 1.21 2013/08/18 16:08:42 matt Exp $ */ - -/*- - * Copyright (c) 2000 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#include -__KERNEL_RCSID(0, "$NetBSD: podulebus.c,v 1.21 2013/08/18 16:08:42 matt Exp $"); - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include -#include -#include -#include - -#include "locators.h" - -#include "podloader.h" -#include "unixbp.h" - -#if NUNIXBP > 0 -#include -#endif - -static int podulebus_match(device_t, cfdata_t, void *); -static void podulebus_attach(device_t, device_t , void *); -static void podulebus_probe_podule(device_t, int); -static int podulebus_print(void *, char const *); -static int podulebus_submatch(device_t, cfdata_t, const int *, void *); -static void podulebus_read_chunks(struct podulebus_attach_args *, int); -static uint8_t *podulebus_get_chunk(struct podulebus_attach_args *, int); -#if NPODLOADER > 0 -void podloader_read_region(struct podulebus_attach_args *pa, u_int src, - uint8_t *dest, size_t length); -extern register_t _podloader_call(register_t, register_t, register_t, - void *, int); -#endif - -struct podulebus_softc { - device_t sc_dev; - struct ioc_attach_args sc_ioc; -}; - -CFATTACH_DECL_NEW(podulebus, sizeof(struct podulebus_softc), - podulebus_match, podulebus_attach, NULL, NULL); - -/* ARGSUSED */ -static int -podulebus_match(device_t parent, cfdata_t cf, void *aux) -{ - - /* We can't usefully probe for this */ - return 1; -} - -static void -podulebus_attach(device_t parent, device_t self, void *aux) -{ - int i; - struct podulebus_softc *sc = device_private(self); - struct ioc_attach_args *ioc = aux; - - sc->sc_dev = self; - sc->sc_ioc = *ioc; - aprint_normal("\n"); - - /* Iterate over the podules attaching them */ - for (i = 0; i < MAX_PODULES; i++) - podulebus_probe_podule(self, i); -} - -static void -podulebus_probe_podule(device_t self, int slotnum) -{ - struct podulebus_softc *sc = device_private(self); - bus_space_tag_t id_bst; - bus_space_handle_t id_bsh; - int ecid, w; - uint8_t extecid[EXTECID_SIZE]; - struct podulebus_attach_args pa; - - memset(&pa, 0, sizeof(pa)); - id_bst = sc->sc_ioc.ioc_sync_t; - bus_space_subregion(id_bst, sc->sc_ioc.ioc_sync_h, - slotnum * PODULE_GAP, PODULE_GAP, &id_bsh); - ecid = bus_space_read_1(id_bst, id_bsh, 0); - /* Skip empty or strange slots */ - if (ecid & (ECID_NOTPRESENT | ECID_NONCONF)) - return; - if ((ecid & ECID_ID_MASK) == ECID_ID_EXTEND) { - pa.pa_fast_t = sc->sc_ioc.ioc_fast_t; - bus_space_subregion(pa.pa_fast_t, sc->sc_ioc.ioc_fast_h, - slotnum * PODULE_GAP, PODULE_GAP, - &pa.pa_fast_h); - pa.pa_medium_t = sc->sc_ioc.ioc_medium_t; - bus_space_subregion(pa.pa_medium_t, sc->sc_ioc.ioc_medium_h, - slotnum * PODULE_GAP, PODULE_GAP, - &pa.pa_medium_h); - pa.pa_slow_t = sc->sc_ioc.ioc_slow_t; - bus_space_subregion(pa.pa_slow_t, sc->sc_ioc.ioc_slow_h, - slotnum * PODULE_GAP, PODULE_GAP, - &pa.pa_slow_h); - pa.pa_sync_t = sc->sc_ioc.ioc_sync_t; - bus_space_subregion(pa.pa_sync_t, sc->sc_ioc.ioc_sync_h, - slotnum * PODULE_GAP, PODULE_GAP, - &pa.pa_sync_h); - /* XXX This is a hack! */ - pa.pa_mod_t = &iobus_bs_tag; - bus_space_map(pa.pa_mod_t, - (bus_addr_t)MEMC_IO_BASE + slotnum * (PODULE_GAP << 2), - (PODULE_GAP << 2), 0, &pa.pa_mod_h); - bus_space_read_region_1(id_bst, id_bsh, 0, - extecid, EXTECID_SIZE); - /* XXX If you thought that was a hack... */ - pa.pa_mod_base = pa.pa_mod_h; - pa.pa_fast_base = pa.pa_fast_h; - pa.pa_medium_base = pa.pa_medium_h; - pa.pa_slow_base = pa.pa_slow_h; - pa.pa_sync_base = pa.pa_sync_h; - pa.pa_ecid = ecid; - pa.pa_flags1 = extecid[EXTECID_F1]; - pa.pa_manufacturer = (extecid[EXTECID_MLO] | - extecid[EXTECID_MHI] << 8); - pa.pa_product = (extecid[EXTECID_PLO] | - extecid[EXTECID_PHI] << 8); - pa.pa_slotnum = slotnum; - pa.pa_ih = slotnum; - if (pa.pa_flags1 & EXTECID_F1_CD) { - w = pa.pa_flags1 & EXTECID_F1_W_MASK; - if (w != EXTECID_F1_W_8BIT) { - /* RISC OS 3 can't handle this either. */ - aprint_error("%s:%d: ROM is not 8 bits wide; " - "ignoring it\n", - device_xname(self), pa.pa_slotnum); - } else { - podulebus_read_chunks(&pa, 0); - pa.pa_descr = podulebus_get_chunk(&pa, - CHUNK_DEV_DESCR); - } - } - pa.pa_slotflags = 0; - config_found_sm_loc(self, "podulebus", NULL, &pa, - podulebus_print, podulebus_submatch); - if (pa.pa_chunks) - free(pa.pa_chunks, M_DEVBUF); - if (pa.pa_descr) - free(pa.pa_descr, M_DEVBUF); - if (pa.pa_loader) - free(pa.pa_loader, M_DEVBUF); - } else - aprint_normal("%s:%d: non-extended podule ignored.\n", - device_xname(self), slotnum); -} - -static void -podulebus_read_chunks(struct podulebus_attach_args *pa, int useloader) -{ - uint8_t chunk[8]; - u_int ptr, nchunks, type, length, offset; - - nchunks = pa->pa_nchunks; - if (useloader) - ptr = 0; - else - ptr = EXTECID_SIZE + IRQPTR_SIZE; - for (;;) { -#if NPODLOADER > 0 - if (useloader) - podloader_read_region(pa, ptr, chunk, 8); - else -#endif - bus_space_read_region_1(pa->pa_sync_t, pa->pa_sync_h, - ptr, chunk, 8); - ptr += 8; - type = chunk[0]; - length = chunk[1] | chunk[2] << 8 | chunk[3] << 16; - if (length == 0) - break; - offset = chunk[4] | chunk[5] << 8 | - chunk[6] << 16 | chunk[7] << 24; - if ((offset + length) > PODULE_GAP) - continue; - nchunks++; - pa->pa_chunks = realloc(pa->pa_chunks, - nchunks * sizeof(*pa->pa_chunks), - M_DEVBUF, M_WAITOK); - pa->pa_chunks[nchunks-1].pc_type = type; - pa->pa_chunks[nchunks-1].pc_length = length; - pa->pa_chunks[nchunks-1].pc_offset = offset; - pa->pa_chunks[nchunks-1].pc_useloader = useloader; - } - pa->pa_nchunks = nchunks; -} - -static uint8_t * -podulebus_get_chunk(struct podulebus_attach_args *pa, int type) -{ - int i; - struct podulebus_chunk *pc; - uint8_t *chunk; - - for (i = 0; i < pa->pa_nchunks; i++) { - pc = &pa->pa_chunks[i]; - if (pc->pc_type == type) { - chunk = malloc( pc->pc_length + 1, M_DEVBUF, M_WAITOK); -#if NPODLOADER > 0 - if (pc->pc_useloader) - podloader_read_region(pa, pc->pc_offset, chunk, - pc->pc_length); - else -#endif - bus_space_read_region_1(pa->pa_sync_t, - pa->pa_sync_h, pc->pc_offset, chunk, - pc->pc_length); - chunk[pc->pc_length] = 0; - return chunk; - } - } - return NULL; -} - -#if NPODLOADER > 0 -int -podulebus_initloader(struct podulebus_attach_args *pa) -{ - - if (pa->pa_loader != NULL) - return 0; - pa->pa_loader = podulebus_get_chunk(pa, CHUNK_RISCOS_LOADER); - if (pa->pa_loader == NULL) - return -1; - podulebus_read_chunks(pa, 1); - if (pa->pa_descr) - free(pa->pa_descr, M_DEVBUF); - pa->pa_descr = podulebus_get_chunk(pa, CHUNK_DEV_DESCR); - return 0; -} - -static register_t -podloader_call(register_t r0, register_t r1, register_t r11, void *loader, - int entry) -{ - int s; - register_t result; - - s = splhigh(); - result = _podloader_call(r0, r1, r11, loader, entry); - splx(s); - return result; -} - -int -podloader_readbyte(struct podulebus_attach_args *pa, u_int addr) -{ - - return podloader_call(0, addr, pa->pa_sync_base, pa->pa_loader, 0); -} - -void -podloader_writebyte(struct podulebus_attach_args *pa, u_int addr, int val) -{ - - podloader_call(val, addr, pa->pa_sync_base, pa->pa_loader, 1); -} - -void -podloader_reset(struct podulebus_attach_args *pa) -{ - - podloader_call(0, 0, pa->pa_sync_base, pa->pa_loader, 2); -} - -int -podloader_callloader(struct podulebus_attach_args *pa, u_int r0, u_int r1) -{ - - return podloader_call(r0, r1, pa->pa_sync_base, pa->pa_loader, 3); -} - -void -podloader_read_region(struct podulebus_attach_args *pa, u_int src, - uint8_t *dest, size_t length) -{ - - while (length--) - *dest++ = podloader_readbyte(pa, src++); - podloader_reset(pa); -} -#endif - -static int -podulebus_print(void *aux, char const *pnp) -{ - struct podulebus_attach_args *pa = aux; - char *p, *q; - - if (pnp) { - if (pa->pa_descr) { - /* Restrict description to ASCII graphic characters. */ - for (p = q = pa->pa_descr; *p != '\0'; p++) - if (*p >= 32 && *p < 126) - *q++ = *p; - *q++ = 0; - aprint_normal("%s", pa->pa_descr); - } else - aprint_normal("podule"); - aprint_normal(" <%04x:%04x> at %s", - pa->pa_manufacturer, pa->pa_product, pnp); - } - aprint_normal(" slot %d", pa->pa_slotnum); - return UNCONF; -} - -static int -podulebus_submatch(device_t parent, cfdata_t cf, const int *ldesc, void *aux) -{ - struct podulebus_attach_args *pa = aux; - - if (cf->cf_loc[PODULEBUSCF_SLOT] == PODULEBUSCF_SLOT_DEFAULT || - cf->cf_loc[PODULEBUSCF_SLOT] == pa->pa_slotnum) - return config_match(parent, cf, aux); - return 0; -} - -void * -podulebus_irq_establish(podulebus_intr_handle_t slot, int ipl, - int (*func)(void *), void *arg, struct evcnt *ev) -{ - - /* XXX: support for checking IRQ bit on podule? */ -#if NUNIXBP > 0 - if (the_unixbp != NULL) - return irq_establish(IRQ_UNIXBP_BASE + slot, ipl, func, arg, - ev); -#endif - return irq_establish(IRQ_PIRQ, ipl, func, arg, ev); -} - -void -podulebus_readcmos(struct podulebus_attach_args *pa, uint8_t *c) -{ - int i; - - for (i = 0; i < 4; i++) - c[i] = cmos_read(PODULE_CMOS_BASE + - pa->pa_slotnum * PODULE_CMOS_PERSLOT + i); -} Index: sys/arch/acorn26/podulebus/podulebusreg.h =================================================================== RCS file: sys/arch/acorn26/podulebus/podulebusreg.h diff -N sys/arch/acorn26/podulebus/podulebusreg.h --- sys/arch/acorn26/podulebus/podulebusreg.h 22 May 2002 22:43:17 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,66 +0,0 @@ -/* $NetBSD: podulebusreg.h,v 1.2 2002/05/22 22:43:17 bjh21 Exp $ */ - -/* - * 2000 Ben Harris - * - * This file is in the public domain. - */ - -#ifndef _PODULEBUSREG_H_ -#define _PODULEBUSREG_H_ - -#define MAX_PODULES 4 -#define PODULE_GAP (0x4000 >> 2) - -/* Podule CMOS bytes */ -#define PODULE_CMOS_BASE (112 + 0x40) -#define PODULE_CMOS_PERSLOT 4 - -/* Podule identity byte (ECId) flags */ -#define ECID_IRQING 0x01 -#define ECID_NOTPRESENT 0x02 -#define ECID_FIQING 0x04 -#define ECID_ID_MASK 0x78 -#define ECID_ID_SHIFT 3 -#define ECID_ID_EXTEND 0x00 -#define ECID_NONCONF 0x80 - -/* Extended ECId bytes */ -#define EXTECID_F1 1 -#define EXTECID_F1_CD 0x01 -#define EXTECID_F1_IS 0x02 -#define EXTECID_F1_W_MASK 0xc0 -#define EXTECID_F1_W_8BIT 0x00 -#define EXTECID_F1_W_16BIT 0x40 -#define EXTECID_F1_W_32BIT 0x80 - -#define EXTECID_PLO 3 -#define EXTECID_PHI 4 -#define EXTECID_MLO 5 -#define EXTECID_MHI 6 - -#define EXTECID_SIZE 8 - -/* Extended interrupt pointers */ -#define IRQPTR_SIZE 8 - -/* Chunk types */ -#define CHUNK_RISCOS_LOADER 0x80 -#define CHUNK_RISCOS_MODULE 0x81 -#define CHUNK_RISCOS_BBCROM 0x82 -#define CHUNK_RISCOS_SPRITE 0x83 -#define CHUNK_OS1_LOADER 0x90 -#define CHUNK_RISCIX_LOADER 0xa0 -#define CHUNK_HELIOS 0xa3 -#define CHUNK_DEV_LINK 0xf0 -#define CHUNK_DEV_SERIAL 0xf1 /* ASCII string */ -#define CHUNK_DEV_DATE 0xf2 /* ASCII string */ -#define CHUNK_DEV_MODS 0xf3 /* ASCII string */ -#define CHUNK_DEV_PLACE 0xf4 /* ASCII string */ -#define CHUNK_DEV_DESCR 0xf5 /* ASCII string */ -#define CHUNK_DEV_PARTNO 0xf6 /* ASCII string */ -#define CHUNK_DEV_EADDR 0xf7 /* Six bytes */ -#define CHUNK_DEV_HWREV 0xf8 /* Four-byte LE word */ -#define CHUNK_DEV_ROMCRC 0xf9 - -#endif Index: sys/arch/acorn26/podulebus/powerrom.c =================================================================== RCS file: sys/arch/acorn26/podulebus/powerrom.c diff -N sys/arch/acorn26/podulebus/powerrom.c --- sys/arch/acorn26/podulebus/powerrom.c 4 Jan 2009 01:02:29 -0000 1.5 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,41 +0,0 @@ -/* $NetBSD: powerrom.c,v 1.5 2009/01/04 01:02:29 bjh21 Exp $ */ - -/* Test driver to see if we can talk to PowerROMs */ - -#include - -__KERNEL_RCSID(0, "$NetBSD: powerrom.c,v 1.5 2009/01/04 01:02:29 bjh21 Exp $"); - -#include -#include -#include -#include - -struct powerrom_softc { - device_t sc_dev; -}; - -int powerrom_match(device_t, cfdata_t, void *); -void powerrom_attach(device_t, device_t, void *); - -CFATTACH_DECL_NEW(powerrom, sizeof(struct powerrom_softc), - powerrom_match, powerrom_attach, NULL, NULL); - -int -powerrom_match(device_t parent, cfdata_t cf, void *aux) -{ - struct podulebus_attach_args *pa = aux; - - return (pa->pa_product == PODULE_ALSYSTEMS_SCSI); -} - -void -powerrom_attach(device_t parent, device_t self, void *aux) -{ - struct podulebus_attach_args *pa = aux; - - if (podulebus_initloader(pa) == 0) - aprint_normal_dev(self, "card id = 0x%x", - podloader_callloader(pa, 0, 0)); - aprint_normal("\n"); -} Index: sys/arch/acorn26/podulebus/unixbp.c =================================================================== RCS file: sys/arch/acorn26/podulebus/unixbp.c diff -N sys/arch/acorn26/podulebus/unixbp.c --- sys/arch/acorn26/podulebus/unixbp.c 19 Jul 2011 16:05:11 -0000 1.8 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,109 +0,0 @@ -/* $NetBSD: unixbp.c,v 1.8 2011/07/19 16:05:11 dyoung Exp $ */ - -/*- - * Copyright (c) 2000 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * unixbp.c - driver for the Unix Backplane, found in the R140 etc - */ - -#include - -__KERNEL_RCSID(0, "$NetBSD: unixbp.c,v 1.8 2011/07/19 16:05:11 dyoung Exp $"); - -#include -#include -#include - -#include -#include -#include - -struct unixbp_softc { - device_t sc_dev; - bus_space_tag_t sc_iot; - bus_space_handle_t sc_ioh; -}; - -static int unixbp_match(device_t, cfdata_t, void *); -static void unixbp_attach(device_t, device_t, void *); - -CFATTACH_DECL_NEW(unixbp, sizeof(struct unixbp_softc), - unixbp_match, unixbp_attach, NULL, NULL); - -device_t the_unixbp; - -static int -unixbp_match(device_t parent, cfdata_t cf, void *aux) -{ - struct ioc_attach_args *ioc = aux; - bus_space_tag_t bst = ioc->ioc_fast_t; - bus_space_handle_t bsh = ioc->ioc_fast_h; - - /* Ask to disable all interrupts and check the request lines go low. */ - bus_space_write_1(bst, bsh, UNIXBP_REG_MASK, 0); - if ((bus_space_read_1(bst, bsh, UNIXBP_REG_REQUEST) & 0xf) != 0) - return 0; - /* Re-enable interrupts. */ - bus_space_write_1(bst, bsh, UNIXBP_REG_MASK, 0xf); - return 1; -} - -static void -unixbp_attach(device_t parent, device_t self, void *aux) -{ - struct ioc_attach_args *ioc = aux; - struct unixbp_softc *sc = device_private(self); - - sc->sc_dev = self; - if (the_unixbp == NULL) - the_unixbp = self; - sc->sc_iot = ioc->ioc_fast_t; - sc->sc_ioh = ioc->ioc_fast_h; - - aprint_normal("\n"); -} - -int -unixbp_irq_status_full(void) -{ - struct unixbp_softc *sc = device_private(the_unixbp); - - if (sc == NULL) - return 0; - return bus_space_read_1(sc->sc_iot, sc->sc_ioh, UNIXBP_REG_REQUEST) - & 0xf; -} - -void -unixbp_irq_setmask(int mask) -{ - struct unixbp_softc *sc = device_private(the_unixbp); - - if (sc == NULL) - return; - bus_space_write_1(sc->sc_iot, sc->sc_ioh, UNIXBP_REG_MASK, mask & 0xf); -} Index: sys/arch/acorn26/podulebus/unixbpreg.h =================================================================== RCS file: sys/arch/acorn26/podulebus/unixbpreg.h diff -N sys/arch/acorn26/podulebus/unixbpreg.h --- sys/arch/acorn26/podulebus/unixbpreg.h 24 Mar 2002 15:47:23 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,15 +0,0 @@ -/* $NetBSD: unixbpreg.h,v 1.1 2002/03/24 15:47:23 bjh21 Exp $ */ - -/* - * This file is in the public domain. - */ - -/* Acorn "Unix Backplane" registers */ - -#ifndef _UNIXBPREG_H_ -#define _UNIXBPREG_H_ - -#define UNIXBP_REG_REQUEST 0 /* Enabled _and_ active */ -#define UNIXBP_REG_MASK 1 - -#endif Index: sys/arch/acorn26/podulebus/unixbpvar.h =================================================================== RCS file: sys/arch/acorn26/podulebus/unixbpvar.h diff -N sys/arch/acorn26/podulebus/unixbpvar.h --- sys/arch/acorn26/podulebus/unixbpvar.h 29 Jul 2012 00:07:11 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,41 +0,0 @@ -/* $NetBSD: unixbpvar.h,v 1.4 2012/07/29 00:07:11 matt Exp $ */ - -/*- - * Copyright (c) 2000 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * Unix Backplane interface - */ - -#ifndef _UNIXBP_H -#define _UNIXBP_H - -extern int unixbp_irq_status_full(void); -extern void unixbp_irq_setmask(int); - -extern device_t the_unixbp; - -#endif Index: sys/arch/acorn26/stand/Makefile =================================================================== RCS file: sys/arch/acorn26/stand/Makefile diff -N sys/arch/acorn26/stand/Makefile --- sys/arch/acorn26/stand/Makefile 1 May 2013 22:36:52 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,11 +0,0 @@ -# $NetBSD: Makefile,v 1.2 2013/05/01 22:36:52 matt Exp $ - -.include - -.if empty(MACHINE_ARCH:Mearm*) && ${TARGET_ENDIANNESS} == "1234" - -SUBDIR= boot26 - -.endif - -.include Index: sys/arch/acorn26/stand/Makefile.buildboot =================================================================== RCS file: sys/arch/acorn26/stand/Makefile.buildboot diff -N sys/arch/acorn26/stand/Makefile.buildboot --- sys/arch/acorn26/stand/Makefile.buildboot 8 Apr 2017 19:53:19 -0000 1.23 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,82 +0,0 @@ -# $NetBSD: Makefile.buildboot,v 1.23 2017/04/08 19:53:19 christos Exp $ - -S?= ${.CURDIR}/../../../.. - -.PATH: ${.CURDIR}/../lib - -KLINK_MACHINE= acorn26 -SRCS= ${PROGSOURCE} -NOMAN=# defined -BINDIR=/usr/mdec -BINMODE=444 -FILESDIR=/usr/mdec - -# XXX SHOULD NOT NEED TO DEFINE THESE! -LIBCRT0= -LIBCRTI= -LIBC= -LIBCRTBEGIN= -LIBCRTEND= - -RISCOSTYPE ?= ff8 - -.include "${S}/conf/newvers_stand.mk" - -.include -.include - - -CPUFLAGS= -CPPFLAGS+= -D_STANDALONE -DHIMEM=0x28000 -CPPFLAGS+= -I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../.. -CPPFLAGS+= -I${.CURDIR}/../lib -CPPFLAGS+= ${ARM_APCS_FLAGS} -march=armv2 -CPPFLAGS+= -marm -CFLAGS= -O2 -CFLAGS+= -ffreestanding -fno-unwind-tables -CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes - -### find out what to use for libkern -KERN_AS= library -.include "${S}/lib/libkern/Makefile.inc" -LIBKERN= ${KERNLIB} - -### find out what to use for libz -Z_AS= library -.include "${S}/lib/libz/Makefile.inc" -LIBZ= ${ZLIB} - -### find out what to use for libsa -SA_AS= library -SAMISCMAKEFLAGS+= SA_INCLUDE_NET=no SA_USE_LOADFILE=yes SA_USE_CREAD=yes -CPPFLAGS+= -DLIBSA_NO_RAW_ACCESS \ - -DLIBSA_SINGLE_FILESYSTEM=riscos \ - -DLIBSA_NO_FS_WRITE \ - -DHEAP_VARIABLE -.include "${S}/lib/libsa/Makefile.inc" -LIBSA= ${SALIB} - -### find out what to use for libriscos -RISCOS_AS= library -.include "${S}/arch/acorn26/stand/lib/Makefile.inc" -LIBRISCOS= ${RISCOSLIB} - -RELOC=8000 -# -N (OMAGIC) since we don't need a gap between text and data. -LINKFLAGS=-N - -${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBRISCOS} - ${_MKTARGET_LINK} - ${LD} -o ${.TARGET} ${LINKFLAGS} -Ttext ${RELOC} ${OBJS} \ - ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBRISCOS} ${LIBSA} - ${SIZE} ${.TARGET} - -${PROG},${RISCOSTYPE}: ${PROG} - ${OBJCOPY} --output-target=binary ${.ALLSRC} ${.TARGET} - -realall: ${PROG},${RISCOSTYPE} - -CLEANFILES+= ${PROG},${RISCOSTYPE} -FILES+= ${PROG},${RISCOSTYPE} - -.include Index: sys/arch/acorn26/stand/boot26/Makefile =================================================================== RCS file: sys/arch/acorn26/stand/boot26/Makefile diff -N sys/arch/acorn26/stand/boot26/Makefile --- sys/arch/acorn26/stand/boot26/Makefile 11 Dec 2005 12:16:05 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,14 +0,0 @@ -# $NetBSD: Makefile,v 1.3 2005/12/11 12:16:05 christos Exp $ - -PROG= boot26 -PROGSOURCE= rmheader.S rmvers.c srt0.S boot26.c start.S -NEWVERSWHAT= "RISC OS Boot" -RISCOSTYPE= ffa - -rmvers.c: ${.CURDIR}/version - ${HOST_SH} ${.CURDIR}/../lib/newvers_rm.sh ${.CURDIR}/version "NetBSD Boot" -.PHONY: rmvers.c - -CLEANFILES+= rmvers.c - -.include "../Makefile.buildboot" Index: sys/arch/acorn26/stand/boot26/boot26.c =================================================================== RCS file: sys/arch/acorn26/stand/boot26/boot26.c diff -N sys/arch/acorn26/stand/boot26/boot26.c --- sys/arch/acorn26/stand/boot26/boot26.c 11 Jun 2016 06:24:36 -0000 1.7 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,305 +0,0 @@ -/* $NetBSD: boot26.c,v 1.7 2016/06/11 06:24:36 dholland Exp $ */ - -/*- - * Copyright (c) 1998, 1999, 2000, 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#include -#include -#include -#include -#include -#include -#include - -extern const char bootprog_rev[]; -extern const char bootprog_name[]; - -int debug = 1; - -enum pgstatus { FREE, USED_RISCOS, USED_KERNEL, USED_BOOT }; - -int nbpp; -struct os_mem_map_request *pginfo; -enum pgstatus *pgstatus; - -u_long marks[MARK_MAX]; - -char fbuf[80]; - -void get_mem_map(struct os_mem_map_request *, enum pgstatus *, int); -int vdu_var(int); - -extern void start_kernel(struct bootconfig *, u_int, u_int); - -int -main(int argc, char **argv) -{ - int npages, howto; - int i, j; - char *file; - struct bootconfig bootconfig; - int crow; - int ret; - - printf(">> %s, Revision %s\n", bootprog_name, bootprog_rev); - - os_read_mem_map_info(&nbpp, &npages); - if (debug) - printf("Machine has %d pages of %d KB each. " - "Total RAM: %d MB\n", npages, nbpp >> 10, - (npages * nbpp) >> 20); - - /* Need one extra for teminator in OS_ReadMemMapEntries. */ - pginfo = alloc((npages + 1) * sizeof(*pginfo)); - if (pginfo == NULL) - panic("cannot alloc pginfo array"); - memset(pginfo, 0, npages * sizeof(*pginfo)); - pgstatus = alloc(npages * sizeof(*pgstatus)); - if (pgstatus == NULL) - panic("cannot alloc pgstatus array"); - memset(pgstatus, 0, npages * sizeof(*pgstatus)); - - get_mem_map(pginfo, pgstatus, npages); - - howto = 0; - file = NULL; - for (i = 1; i < argc; i++) - if (argv[i][0] == '-') - for (j = 1; argv[i][j]; j++) - BOOT_FLAG(argv[i][j], howto); - else - if (file) - panic("Too many files!"); - else - file = argv[i]; - if (file == NULL) { - if (howto & RB_ASKNAME) { - printf("boot: "); - kgets(fbuf, sizeof(fbuf)); - file = fbuf; - } else - file = "netbsd"; - } - printf("Booting %s (howto = 0x%x)\n", file, howto); - - ret = loadfile(file, marks, LOAD_KERNEL); - if (ret == -1) - panic("Kernel load failed"); - close(ret); - - printf("Starting at 0x%lx\n", marks[MARK_ENTRY]); - - memset(&bootconfig, 0, sizeof(bootconfig)); - bootconfig.magic = BOOT_MAGIC; - bootconfig.version = 0; - bootconfig.boothowto = howto; - bootconfig.bootdev = -1; - bootconfig.ssym = (void *)marks[MARK_SYM] - MEMC_PHYS_BASE; - bootconfig.esym = (void *)marks[MARK_END] - MEMC_PHYS_BASE; - bootconfig.nbpp = nbpp; - bootconfig.npages = npages; - bootconfig.freebase = (void *)marks[MARK_END] - MEMC_PHYS_BASE; - bootconfig.xpixels = vdu_var(os_MODEVAR_XWIND_LIMIT) + 1; - bootconfig.ypixels = vdu_var(os_MODEVAR_YWIND_LIMIT) + 1; - bootconfig.bpp = 1 << vdu_var(os_MODEVAR_LOG2_BPP); - bootconfig.screenbase = (void *)vdu_var(os_VDUVAR_DISPLAY_START) + - vdu_var(os_VDUVAR_TOTAL_SCREEN_SIZE) - MEMC_PHYS_BASE; - bootconfig.screensize = vdu_var(os_VDUVAR_TOTAL_SCREEN_SIZE); - os_byte(osbyte_OUTPUT_CURSOR_POSITION, 0, 0, NULL, &crow); - bootconfig.cpixelrow = crow * vdu_var(os_VDUVAR_TCHAR_SPACEY); - - if (bootconfig.bpp < 8) - printf("WARNING: Current screen mode has fewer than eight " - "bits per pixel.\n" - " Console display may not work correctly " - "(or at all).\n"); - /* Tear down RISC OS... */ - - /* NetBSD will want the cache off initially. */ - xcache_control(0, 0, NULL); - - /* Dismount all filesystems. */ - xosfscontrol_shutdown(); - - /* Ask device drivers to reset devices. */ - service_pre_reset(); - - /* Disable interrupts. */ - os_int_off(); - - start_kernel(&bootconfig, marks[MARK_ENTRY], 0x02090000); - - return 0; -} - -void -get_mem_map(struct os_mem_map_request *pginfo, enum pgstatus *pgstatus, - int npages) -{ - int i; - - for (i = 0; i < npages; i++) - pginfo[i].page_no = i; - pginfo[npages].page_no = -1; - os_read_mem_map_entries(pginfo); - - if (debug) - printf("--------/-------/-------/-------\n"); - for (i = 0; i < npages; i++) { - pgstatus[i] = USED_RISCOS; - if (pginfo[i].access == os_AREA_ACCESS_NONE) { - if (debug) printf("."); - } else { - if (pginfo[i].map < (void *)0x0008000) { - if (debug) printf("0"); - } else if (pginfo[i].map < (void *)HIMEM) { - pgstatus[i] = USED_BOOT; - if (debug) printf("+"); - } else if (pginfo[i].map < (void *)0x1000000) { - if (pginfo[i].access == - os_AREA_ACCESS_READ_WRITE) { - pgstatus[i] = FREE; - if (debug) printf("*"); - } else { - if (debug) printf("a"); - } - } else if (pginfo[i].map < (void *)0x1400000) { - if (debug) printf("d"); - } else if (pginfo[i].map < (void *)0x1800000) { - if (debug) printf("s"); - } else if (pginfo[i].map < (void *)0x1c00000) { - if (debug) printf("m"); - } else if (pginfo[i].map < (void *)0x1e00000) { - if (debug) printf("h"); - } else if (pginfo[i].map < (void *)0x1f00000) { - if (debug) printf("f"); - } else if (pginfo[i].map < (void *)0x2000000) { - if (debug) printf("S"); - } - } - if (i % 32 == 31 && debug) - printf("\n"); - } -} - -/* - * Return the address of a page that will end up corresponding to the - * target address when the kernel boots. "target" is expected to be - * in the MEMC physical RAM area (0x02000000--0x02ffffff). It need - * not be page-aligned. The return value is in the logical RAM area, - * and either points to a mapping of the requested page or to a - * mapping of another page which will be copied to the requested page - * after RISC OS is shut down. - * - * At present, there's no relocation mechanism, so we panic if its use - * is required. - */ -static void * -get_page(void *target) -{ - int ppn; - - ppn = ((void *)target - MEMC_PHYS_BASE) / nbpp; - if (pgstatus[ppn] != FREE) - panic("Page %d not free", ppn); - return pginfo[ppn].map; -} - -ssize_t -boot26_read(int f, void *addr, size_t size) -{ - void *fragaddr; - size_t fragsize; - ssize_t retval, total; - - total = 0; - while (size > 0) { - fragaddr = get_page(addr) + ((u_int)addr % nbpp); - fragsize = nbpp - ((u_int)addr % nbpp); - if (fragsize > size) - fragsize = size; - retval = read(f, fragaddr, fragsize); - if (retval < 0) - return retval; - total += retval; - if (retval < fragsize) - return total; - addr += fragsize; - size -= fragsize; - } - return total; -} - -void * -boot26_memcpy(void *dst, const void *src, size_t size) -{ - void *fragaddr; - size_t fragsize; - void *addr = dst; - - while (size > 0) { - fragaddr = get_page(addr) + ((u_int)addr % nbpp); - fragsize = nbpp - ((u_int)addr % nbpp); - if (fragsize > size) - fragsize = size; - memcpy(fragaddr, src, fragsize); - addr += fragsize; - src += fragsize; - size -= fragsize; - } - return dst; -} - -void * -boot26_memset(void *dst, int c, size_t size) -{ - void *fragaddr; - size_t fragsize; - void *addr = dst; - - while (size > 0) { - fragaddr = get_page(addr) + ((u_int)addr % nbpp); - fragsize = nbpp - ((u_int)addr % nbpp); - if (fragsize > size) - fragsize = size; - memset(fragaddr, c, fragsize); - addr += fragsize; - size -= fragsize; - } - return dst; -} - -int -vdu_var(int var) -{ - int varlist[2], vallist[2]; - - varlist[0] = var; - varlist[1] = -1; - os_read_vdu_variables(varlist, vallist); - return vallist[0]; -} Index: sys/arch/acorn26/stand/boot26/rmheader.S =================================================================== RCS file: sys/arch/acorn26/stand/boot26/rmheader.S diff -N sys/arch/acorn26/stand/boot26/rmheader.S --- sys/arch/acorn26/stand/boot26/rmheader.S 13 Jun 2002 22:30:22 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,88 +0,0 @@ -/* $NetBSD: rmheader.S,v 1.2 2002/06/13 22:30:22 bjh21 Exp $ */ - -/*- - * Copyright (c) 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -/* - * Relocatable module header for boot26. - */ - -#include - -rmbase: - b rmstart /* Start code */ - .word 0 /* Initialisation code */ - .word 0 /* Finalisation code */ - .word 0 /* Service call handler */ - .word rmtitle - rmbase /* Title string */ - .word rmhelp - rmbase /* Help string */ - .word rmcmdtbl - rmbase /* Help and command keyword table */ - -rmtitle: - .asciz "boot26" - .align -rmstart: - /* - * This entry point is called when we're started up as an application, - * so we're allowed to use application workspace. This is good, - * because most of our code is linked to run at 0x8000. - */ - mov r0, #0x8000 - adr r1, rmbase - ldr r2, Lsize -Lcopyloop: - ldr r3, [r1], #4 - str r3, [r0], #4 - subs r2, r2, #4 - bgt Lcopyloop - ldr r0, Lstart - mov pc, r0 - -Lsize: - .word end - rmbase -Lstart: - .word _start - -rmcmdtbl: - .asciz "boot26" /* Command text */ - .align - .word rmcmd_boot26 - rmbase /* Command code */ - .byte 0x00 /* Min 0 parameters */ - .byte 0x00 /* No GSTransed parameters */ - .byte 0xff /* Max 255 parameters */ - .byte 0x00 /* Normal command */ - .word 0 /* No syntax message */ - .word 0 /* No help message */ - -rmcmd_boot26: - /* We're called with r0 -> command tail. */ - stmfd r13!, {r14} - mov r2, r0 - mov r0, #2 - adr r1, rmtitle - swi XOS_Module - ldmfd r13!, {pc} Index: sys/arch/acorn26/stand/boot26/start.S =================================================================== RCS file: sys/arch/acorn26/stand/boot26/start.S diff -N sys/arch/acorn26/stand/boot26/start.S --- sys/arch/acorn26/stand/boot26/start.S 24 Mar 2002 15:47:25 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,37 +0,0 @@ -/* $NetBSD: start.S,v 1.1 2002/03/24 15:47:25 bjh21 Exp $ */ - -/*- - * Copyright (c) 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#include -#include - -ENTRY(start_kernel) - swi OS_EnterOS - mov sp, r2 /* Set up initial kernel stack */ - mov fp, #0 /* of which this is the top. */ - mov pc, r1 /* GO! */ Index: sys/arch/acorn26/stand/boot26/version =================================================================== RCS file: sys/arch/acorn26/stand/boot26/version diff -N sys/arch/acorn26/stand/boot26/version --- sys/arch/acorn26/stand/boot26/version 13 Jun 2002 22:30:22 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,15 +0,0 @@ - $NetBSD: version,v 1.4 2002/06/13 22:30:22 bjh21 Exp $ - -0.90: Experimental C version -0.91: General cleanup -1.0: loadfile() update: ELF symbols no longer need backward seeks. -1.1: Now wrapped in a relocatable module. -1.2: *boot26 available after loading module. -1.3: loadfile() update to avoid backwards seeks for ELF Program Headers. -1.4: get_page() abstracted. -1.5: bump HIMEM to 0x28000 so .gz kernels work on 16 MB machines -#1.6: reserved for 1.6 branch -#1.7: reserved for 1.6 branch -#1.8: reserved for 1.6 branch -#1.9: reserved for 1.6 branch -1.10: make start offset into a branch so we can be *Load'ed and *Go'ne Index: sys/arch/acorn26/stand/lib/Makefile =================================================================== RCS file: sys/arch/acorn26/stand/lib/Makefile diff -N sys/arch/acorn26/stand/lib/Makefile --- sys/arch/acorn26/stand/lib/Makefile 22 Mar 2016 08:25:22 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,24 +0,0 @@ -# $NetBSD: Makefile,v 1.4 2016/03/22 08:25:22 mrg Exp $ - -S?= ${.CURDIR}/../../../../ - -LIB= riscos -NOPIC=# defined -NOPROFILE=# defined - -CPPFLAGS= -I$S/lib/libsa ${RISCOSCPPFLAGS} ${RISCOSMISCCPPFLAGS} -#CPPFLAGS+= -DDISK_DEBUG -#CPPFLAGS+= -DNO_DISKLABEL -#CPPFLAGS+= -DSAVE_MEMORY - -SRCS= srt1.c devopen.c -SRCS+= riscoscalls.S riscoscons.c riscoserrors.c riscosfile.c - -.include -.undef DESTDIR -.include - -lib${LIB}.o:: ${OBJS:O} - @echo building standard ${LIB} library - @rm -f lib${LIB}.o - @${LD} -r -o lib${LIB}.o `lorder ${OBJS} | tsort` Index: sys/arch/acorn26/stand/lib/Makefile.inc =================================================================== RCS file: sys/arch/acorn26/stand/lib/Makefile.inc diff -N sys/arch/acorn26/stand/lib/Makefile.inc --- sys/arch/acorn26/stand/lib/Makefile.inc 22 Mar 2016 08:25:22 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,56 +0,0 @@ -# $NetBSD: Makefile.inc,v 1.4 2016/03/22 08:25:22 mrg Exp $ -# -# Configuration variables (default values are below): -# -# S must be set to the top of the 'sys' tree. -# RISCOSDST may be set to the location of the directory where library -# objects are to be built. Defaults to ${.OBJDIR}/lib/riscos. -# RISCOSMISCCPPFLAGS -# Miscellaneous cpp flags to be passed to the library's Makefile -# when building. -# RISCOSMISCMAKEFLAGS -# Miscellaneous flags to be passed to the library's Makefile when -# building. See library's Makefile for more details about -# supported flags and their default values. - -# Default values: -RISCOSDST?= ${.OBJDIR}/lib/riscos - -RISCOSDIR= ${S}/arch/acorn26/stand/lib -RISCOSLIB= ${RISCOSDST}/libriscos.a - -RISCOSMAKE= \ - cd ${RISCOSDIR} && MAKEOBJDIRPREFIX= && unset MAKEOBJDIRPREFIX && \ - MAKEOBJDIR=${RISCOSDST} ${MAKE} \ - CC=${CC:Q} CFLAGS=${CFLAGS:Q} \ - AS=${AS:Q} AFLAGS=${AFLAGS:Q} \ - LD=${LD:Q} STRIP=${STRIP:Q} \ - MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH:Q} \ - RISCOSCPPFLAGS=${CPPFLAGS:S@^-I.@-I../../.@g:Q} \ - RISCOSMISCCPPFLAGS=${RISCOSMISCCPPFLAGS:Q} \ - ${RISCOSMISCMAKEFLAGS} - -${RISCOSLIB}: .NOTMAIN .MAKE __always_make_riscoslib - @echo making sure the riscos library is up to date... - @${RISCOSMAKE} libriscos.a - -clean: .NOTMAIN cleanriscoslib -cleanriscoslib: .NOTMAIN - @echo cleaning the riscos library objects - @if [ -d "${RISCOSDST}" ]; then ${RISCOSMAKE} clean; fi - -cleandir distclean: .NOTMAIN cleandirriscoslib -cleandirriscoslib: .NOTMAIN - @echo cleandiring the riscos library objects - @if [ -d "${RISCOSDST}" ]; then ${RISCOSMAKE} cleandir; fi - -depend: .NOTMAIN dependriscoslib -dependriscoslib: .NOTMAIN .MAKE __always_make_riscoslib - @echo depending the riscos library objects - @${RISCOSMAKE} depend - -__always_make_riscoslib: .NOTMAIN - @mkdir -p ${RISCOSDST} - -.PHONY: __always_make_riscoslib -.PHONY: cleanriscoslib cleandirriscoslib dependriscoslib Index: sys/arch/acorn26/stand/lib/devopen.c =================================================================== RCS file: sys/arch/acorn26/stand/lib/devopen.c diff -N sys/arch/acorn26/stand/lib/devopen.c --- sys/arch/acorn26/stand/lib/devopen.c 24 Mar 2002 15:47:26 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,40 +0,0 @@ -/* $NetBSD: devopen.c,v 1.1 2002/03/24 15:47:26 bjh21 Exp $ */ - -/*- - * Copyright (c) 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#include - -int -devopen(struct open_file *f, const char *fname, char **file) -{ - - /* We don't support any devices yet. */ - f->f_flags |= F_NODEV; - *file = (char *)fname; - return 0; -} Index: sys/arch/acorn26/stand/lib/newvers_rm.sh =================================================================== RCS file: sys/arch/acorn26/stand/lib/newvers_rm.sh diff -N sys/arch/acorn26/stand/lib/newvers_rm.sh --- sys/arch/acorn26/stand/lib/newvers_rm.sh 30 Apr 2008 13:10:59 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,46 +0,0 @@ -#! /bin/sh - -# -# $NetBSD: newvers_rm.sh,v 1.4 2008/04/30 13:10:59 martin Exp $ -# -# Copyright (c) 2000 The NetBSD Foundation, Inc. -# All rights reserved. -# -# This code is derived from software contributed to The NetBSD Foundation -# by Jaromir Dolecek. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# 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. - -# Script for generating of rmvers.c file from given template. -# Used for generating a RISC OS module header. -# -# Called as: -# sh newvers_rm.sh VERSION_FILE MODULENAME - -set -e - -r=`awk -F: '$1 ~ /^[0-9.]*$/ { it = $1; } END { print it }' $1` -r=`echo $r | sed 's/\.\([0-9]\)$/.0\1/'` - -t=`date +"%d %b %Y"` - -echo "const char rmhelp[] = \"$2\\t${r} (${t})\";" > rmvers.c - Index: sys/arch/acorn26/stand/lib/riscoscalls.S =================================================================== RCS file: sys/arch/acorn26/stand/lib/riscoscalls.S diff -N sys/arch/acorn26/stand/lib/riscoscalls.S --- sys/arch/acorn26/stand/lib/riscoscalls.S 21 Aug 2013 06:07:26 -0000 1.5 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,318 +0,0 @@ -/* $NetBSD: riscoscalls.S,v 1.5 2013/08/21 06:07:26 matt Exp $ */ - -/*- - * Copyright (c) 2001 Ben Harris - * Copyright (c) 2002 Reinoud Zandijk - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#include -#include - -ENTRY(os_writec) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - swi OS_WriteC - ldmdb fp, {fp, sp, pc} - -ENTRY(os_new_line) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - swi OS_NewLine - ldmdb fp, {fp, sp, pc} - -ENTRY(os_readc) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - swi OS_ReadC - ldmdb fp, {fp, sp, pc} - -ENTRY(os_cli) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - swi OS_CLI - ldmdb fp, {fp, sp, pc} - -ENTRY(xos_cli) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - swi XOS_CLI - movvc r0, #0 - ldmdb fp, {fp, sp, pc} - -ENTRY(os_byte) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - swi OS_Byte - teq r3, #0 - strne r1, [r3] - ldr r3, [fp, #4] - teq r3, #0 - strne r2, [r3] - ldmdb fp, {fp, sp, pc} - -ENTRY(os_word) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - swi OS_Word - ldmdb fp, {fp, sp, pc} - -ENTRY(xosargs_read) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - mov r3, r2 - swi OS_Args - ldmdbvs fp, {fp, sp, pc} - teq r3, #0 - strne r2, [r3] - mov r0, #0 - ldmdb fp, {fp, sp, pc} - -ENTRY(xosargs_set) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - swi OS_Args - movvc r0, #0 - ldmdb fp, {fp, sp, pc} - -ENTRY(xosgbpb_write) - mov ip, sp - stmfd sp!, {r4, fp, ip, lr, pc} - sub fp, ip, #4 - mov ip, r3 - mov r3, r2 - mov r2, r1 - mov r1, r0 - mov r0, #OSGBPB_Write - swi XOS_GBPB - teq ip, #0 - strne r3, [ip] - movvc r0, #0 - ldmdb fp, {r4, fp, sp, pc} - -ENTRY(xosgbpb_read) - mov ip, sp - stmfd sp!, {r4, fp, ip, lr, pc} - sub fp, ip, #4 - mov ip, r3 - mov r3, r2 - mov r2, r1 - mov r1, r0 - mov r0, #OSGBPB_Read - swi XOS_GBPB - teq ip, #0 - strne r3, [ip] - movvc r0, #0 - ldmdb fp, {r4, fp, sp, pc} - -ENTRY(xosfind_close) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - mov r1, r0 - mov r0, #OSFind_Close - swi XOS_Find - movvc r0, #0 - ldmdb fp, {fp, sp, pc} - -ENTRY(xosfind_open) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - swi XOS_Find - ldmdbvs fp, {fp, sp, pc} - teq r3, #0 - strne r0, [r3] - mov r0, #0 - ldmdb fp, {fp, sp, pc} - -ENTRY(os_get_env) - mov ip, sp - stmfd sp!, {r4, fp, ip, lr, pc} - sub fp, ip, #4 - mov r3, r0 - mov r4, r1 - swi OS_GetEnv - teq r3, #0 - strne r1, [r3] - teq r4, #0 - strne r2, [r4] - ldmdb fp, {r4, fp, sp, pc} - -ENTRY(os_exit) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - mov r2, r1 - ldr r1, Labex - swi OS_Exit - ldmdb fp, {fp, sp, pc} -Labex: - .ascii "ABEX" - -ENTRY(os_int_off) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - swi OS_IntOff - ldmdb fp, {fp, sp, pc} - -ENTRY(os_enter_os) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - swi OS_EnterOS - ldmdb fp, {fp, sp, pc} - -ENTRY(xosfscontrol_shutdown) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - mov r0, #OSFSControl_Shutdown - swi XOS_FSControl - movvc r0, #0 - ldmdb fp, {fp, sp, pc} - -ENTRY(service_pre_reset) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - mov r1, #Service_PreReset - swi OS_ServiceCall - ldmdb fp, {fp, sp, pc} - -ENTRY(os_read_vdu_variables) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - swi OS_ReadVduVariables - ldmdb fp, {fp, sp, pc} - -ENTRY(xos_swi_number_from_string) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - mov r2, r1 - mov r1, r0 - swi XOS_SWINumberFromString - ldmdbvs fp, {fp, sp, pc} - str r0, [r2] - mov r0, #0 - ldmdb fp, {fp, sp, pc} - -ENTRY(os_read_mem_map_info) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - mov r2, r0 - mov r3, r1 - swi OS_ReadMemMapInfo - teq r2, #0 - strne r0, [r2] - teq r3, #0 - strne r1, [r3] - ldmdb fp, {fp, sp, pc} - -ENTRY(os_readsysinfo) - mov ip, sp - stmfd sp!, {r4-r9, fp, ip, lr, pc} - sub fp, ip, #4 - mov r9, r5 - mov r8, r4 - mov r7, r3 - mov r6, r2 - mov r5, r1 - swi OS_ReadSysInfo - teq r5, #0 - strne r0, [r5] - teq r6, #0 - strne r1, [r6] - teq r7, #0 - strne r2, [r7] - ldr r1, [ip, #0] - teq r1, #0 - strne r3, [r1] - ldr r1, [ip, #4] - teq r1, #0 - strne r4, [r1] - ldmdb fp, {r4-r9, fp, sp, pc} - -ENTRY(os_read_mem_map_entries) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - swi OS_ReadMemMapEntries - ldmdb fp, {fp, sp, pc} - -ENTRY(osmemory_read_arrangement_table_size) - mov ip, sp - stmfd sp!, {r4, fp, ip, lr, pc} - sub fp, ip, #4 - mov r3, r0 - mov r4, r1 - mov r0, #OSMemory_ReadArrangementTableSize - swi OS_Memory - cmp r3, #0 - strne r1, [r3] - cmp r4, #0 - strne r2, [r4] - ldmdb fp, {r4, fp, sp, pc} - -ENTRY(osmemory_read_arrangement_table) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - mov r1, r0 - mov r0, #OSMemory_ReadArrangementTable - swi OS_Memory - ldmdb fp, {fp, sp, pc} - -ENTRY(osmemory_page_op) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - add r0, r0, #OSMemory_PageOp - swi OS_Memory - ldmdb fp, {fp, sp, pc} - -ENTRY(xcache_control) - mov ip, sp - stmfd sp!, {fp, ip, lr, pc} - sub fp, ip, #4 - swi XCache_Control - ldmdbvs fp, {fp, sp, pc} - teq r2, #0 - strne r0, [r2] - mov r0, #0 - ldmdb fp, {fp, sp, pc} Index: sys/arch/acorn26/stand/lib/riscoscalls.h =================================================================== RCS file: sys/arch/acorn26/stand/lib/riscoscalls.h diff -N sys/arch/acorn26/stand/lib/riscoscalls.h --- sys/arch/acorn26/stand/lib/riscoscalls.h 11 May 2012 15:39:18 -0000 1.5 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,325 +0,0 @@ -/* $NetBSD: riscoscalls.h,v 1.5 2012/05/11 15:39:18 skrll Exp $ */ - -/*- - * Copyright (c) 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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 file defines the interface for the veneers over RISC OS SWIs used - * by libsa. Only those SWIs actually needed by libsa are included. In - * general, the interface is based on the one provided by OsLib, though - * this implementation is independent. - */ - -#define OS_WriteC 0x000000 -#define XOS_WriteC 0x020000 -#define OS_NewLine 0x000003 -#define XOS_NewLine 0x020003 -#define OS_ReadC 0x000004 -#define XOS_ReadC 0x020004 -#define OS_CLI 0x000005 -#define XOS_CLI 0x020005 -#define OS_Byte 0x000006 -#define XOS_Byte 0x020006 -#define OS_Word 0x000007 -#define XOS_Word 0x020007 -#define OS_Args 0x000009 -#define XOS_Args 0x020009 -#define OS_GBPB 0x00000c -#define XOS_GBPB 0x02000c -#define OS_Find 0x00000d -#define XOS_Find 0x02000d -#define OS_GetEnv 0x000010 -#define XOS_GetEnv 0x020010 -#define OS_Exit 0x000011 -#define XOS_Exit 0x020011 -#define OS_IntOff 0x000014 -#define XOS_IntOff 0x020014 -#define OS_EnterOS 0x000016 -#define XOS_EnterOS 0x020016 -#define OS_Module 0x00001e -#define XOS_Module 0x02001e -#define OS_FSControl 0x000029 -#define XOS_FSControl 0x020029 -#define OS_ServiceCall 0x000030 -#define XOS_ServiceCall 0x020030 -#define OS_ReadVduVariables 0x000031 -#define XOS_ReadVduVariables 0x020031 -#define OS_SWINumberFromString 0x000039 -#define XOS_SWINumberFromString 0x020039 -#define OS_ReadMemMapInfo 0x000051 -#define XOS_ReadMemMapInfo 0x020051 -#define OS_ReadMemMapEntries 0x000052 -#define XOS_ReadMemMapEntries 0x020052 -#define OS_ReadSysInfo 0x000058 -#define XOS_ReadSysInfo 0x020058 -#define OS_Memory 0x000068 -#define XOS_Memory 0x020068 - -#define Cache_Control 0x000280 -#define XCache_Control 0x020280 - -#ifndef __ASSEMBLER__ -typedef struct os_error { - uint32_t errnum; - char errmess[252]; -} os_error; - -/* Errors talking to the console may as well be fatal. */ - -extern void os_writec(int); -extern void os_new_line(void); -extern int os_readc(void); -#endif - -/* OS_CLI */ - -#ifndef __ASSEMBLER__ -extern void os_cli(char *); -extern os_error *xos_cli(char *); -#endif - -/* OS_Byte */ - -#define osbyte_OUTPUT_CURSOR_POSITION 165 - -#ifndef __ASSEMBLER__ -extern void os_byte(int, int, int, int *, int *); -#endif - -/* OS_Word */ - -#define osword_WRITE_SCREEN_ADDRESS 22 - -#ifndef __ASSEMBLER__ -extern void os_word(int, char *); -#endif - -/* OS_Args */ - -#define OSArgs_ReadPtr 0 -#define OSArgs_SetPtr 1 -#define OSArgs_ReadExt 2 -#define OSArgs_SetExt 3 -#define OSArgs_ReadAllocation 4 -#define OSArgs_ReadEOFStatus 5 - -#ifndef __ASSEMBLER__ -extern os_error *xosargs_read(int, int, int *); -extern os_error *xosargs_set(int, int, int); - -#define xosargs_read_ptr(f, vp) xosargs_read(OSArgs_ReadPtr, (f), (vp)) -#define xosargs_set_ptr(f, v) xosargs_set(OSArgs_SetPtr, (f), (v)) -#define xosargs_read_ext(f, vp) xosargs_read(OSArgs_ReadExt, (f), (vp)) -#define xosargs_set_ext(f, v) xosargs_set(OSArgs_SetExt, (f), (v)) -#define xosargs_read_allocation(f, vp) \ - xosargs_read(OSArgs_ReadAllocation, (f), (vp)) -#define xosargs_read_eof_status(f, vp) \ - xosargs_read(OSArgs_ReadEOFStatus, (f), (vp)) -#endif - -/* OS_GBPB */ - -#define OSGBPB_WriteAt 1 -#define OSGBPB_Write 2 -#define OSGBPB_ReadAt 3 -#define OSGBPB_Read 4 - -#ifndef __ASSEMBLER__ -extern os_error *xosgbpb_write(int, char const *, int, int *); -extern os_error *xosgbpb_read(int, char *, int, int *); -#endif - -/* OS_Find */ - -#define OSFind_Close 0x00 -#define OSFind_Openin 0x40 -#define OSFind_Openout 0x80 -#define OSFind_Openup 0xc0 - -#define osfind_PATH 0x01 -#define osfind_PATH_VAR 0x02 -#define osfind_NO_PATH 0x03 -#define osfind_ERROR_IF_DIR 0x04 -#define osfind_ERROR_IF_ABSENT 0x08 - -#ifndef __ASSEMBLER__ -extern os_error *xosfind_close(int); -extern os_error *xosfind_open(int, char const *, char const *, int *); -#endif - -/* OS_ReadSysInfo */ - -#define OSReadSysInfo_ReadConfiguredScreenSize 0x00 -#define OSReadSysInfo_ReadMonitorInfo 0x01 -#define OSReadSysInfo_ReadChipPresenceAndId 0x02 -#define OSReadSysInfo_ReadSuperIOFeatures 0x03 - -#define osreadsysinfo_IOEB_ASIC_PRESENT 0x01 -#define osreadsysinfo_SUPERIO_PRESENT 0x02 -#define osreadsysinfo_LCD_ASIC_PRESENT 0x04 - -#ifndef __ASSEMBLER__ -extern void os_readsysinfo(int what, int *r0, int *r1, int *r2, int *r3, int *r4); -#define os_readsysinfo_configured_screensize(s) \ - os_readsysinfo(OSReadSysInfo_ReadConfiguredScreenSize, (s), 0, 0, 0, 0) - -#define os_readsysinfo_monitor_info(mode, type, sync) \ - os_readsysinfo(OSReadSysInfo_ReadMonitorInfo, (mode), (type), (sync), 0, 0) - -#define os_readsysinfo_chip_presence(ioeb, superio, lcd) \ - os_readsysinfo(OSReadSysInfo_ReadChipPresenceAndId, (ioeb), (superio), (lcd), 0, 0) - -#define os_readsysinfo_unique_id(low, high) \ - os_readsysinfo(OSReadSysInfo_ReadChipPresenceAndId, 0, 0, 0, (low), (high)) - -#define os_readsysinfo_superio_features(basic, extra) \ - os_readsysinfo(OSReadSysInfo_ReadSuperIOFeatures, (basic), (extra), 0, 0, 0) - -#endif - -/* OS_Memory */ - -#define OSMemory_PageOp 0x00 -#define OSMemory_ReadArrangementTableSize 0x06 -#define OSMemory_ReadArrangementTable 0x07 -#define OSMemory_ReadSize 0x08 -#define OSMemory_ReadController 0x09 - -#define osmemory_GIVEN_PAGE_NO 0x0100 -#define osmemory_GIVEN_LOG_ADDR 0x0200 -#define osmemory_GIVEN_PHYS_ADDR 0x0400 -#define osmemory_RETURN_PAGE_NO 0x0800 -#define osmemory_RETURN_LOG_ADDR 0x1000 -#define osmemory_RETURN_PHYS_ADDR 0x2000 - -#define osmemory_TYPE 0xf00 -#define osmemory_TYPE_SHIFT 8 -#define osmemory_TYPE_ABSENT 0x0 -#define osmemory_TYPE_DRAM 0x1 -#define osmemory_TYPE_VRAM 0x2 -#define osmemory_TYPE_ROM 0x3 -#define osmemory_TYPE_IO 0x4 -/* 5, 6, 7 are undefined */ -#define osmemory_TYPE_ALLOCATABLE_MASK 0x8 /* bit signaling allocatable */ - - -#ifndef __ASSEMBLER__ -struct page_info { - int pagenumber; - int logical; - int physical; -}; - -extern void osmemory_read_arrangement_table_size(int *size, int *nbpp); -extern void osmemory_read_arrangement_table(unsigned char *block); -extern void osmemory_page_op(int fromto, struct page_info *block, int num_pages); -#endif - -/* Misc */ -#ifndef __ASSEMBLER__ -extern char *os_get_env(void **, void **); - -extern void os_exit(os_error const *, int) __attribute__((noreturn)); - -extern void os_int_off(void); - -extern void os_enter_os(void); -#endif - -#define OSFSControl_Shutdown 23 - -#ifndef __ASSEMBLER__ -extern os_error *xosfscontrol_shutdown(void); -#endif - -#define Service_PreReset 0x45 - -#ifndef __ASSEMBLER__ -extern void service_pre_reset(void); -#endif - -#define os_MODEVAR_LOG2_BPP 9 -#define os_MODEVAR_XWIND_LIMIT 11 -#define os_MODEVAR_YWIND_LIMIT 12 -#define os_VDUVAR_DISPLAY_START 149 -#define os_VDUVAR_TOTAL_SCREEN_SIZE 150 -#define os_VDUVAR_TCHAR_SPACEY 170 - -#ifndef __ASSEMBLER__ -extern void os_read_vdu_variables(const int *, int *); - -extern os_error *xos_swi_number_from_string(char const *, int *); - -extern void os_read_mem_map_info(int *, int *); - -struct os_mem_map_request { - int page_no; - void *map; - int access; -#define os_AREA_ACCESS_READ_WRITE 0 -#define os_AREA_ACCESS_READ_ONLY 1 -#define os_AREA_ACCESS_NONE 3 -}; - -extern void os_read_mem_map_entries(struct os_mem_map_request *); - -extern os_error xcache_control(u_int, u_int, u_int *); - -struct filecore_disc { - uint8_t log2secsize; - uint8_t secspertrack; - uint8_t heads; - uint8_t density; - uint8_t idlen; - uint8_t log2bpmp; - uint8_t skew; - uint8_t bootoption; - uint8_t lowsector; - uint8_t nzones; - uint16_t zone_spare; - uint32_t root; - uint32_t disc_size; - uint16_t disc_id; - char disc_name[10]; - uint32_t disc_type; - uint32_t disc_size_hi; - uint8_t share_size; - uint8_t big_flag; - uint8_t reserved[22]; -}; - -#endif - -/* RISC OS Error numbers */ - -#define error_IS_ADIR 0xa8 -#define error_TOO_MANY_OPEN_FILES 0xc0 -#define error_FILE_NOT_FOUND 0xd6 - -#ifndef __ASSEMBLER__ -extern int riscos_errno(os_error *); -#endif Index: sys/arch/acorn26/stand/lib/riscoscons.c =================================================================== RCS file: sys/arch/acorn26/stand/lib/riscoscons.c diff -N sys/arch/acorn26/stand/lib/riscoscons.c --- sys/arch/acorn26/stand/lib/riscoscons.c 24 Mar 2002 15:47:27 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,48 +0,0 @@ -/* $NetBSD: riscoscons.c,v 1.1 2002/03/24 15:47:27 bjh21 Exp $ */ - -/*- - * Copyright (c) 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#include -#include - -int -getchar(void) -{ - - return os_readc(); -} - -void -putchar(int c) -{ - - if (c == '\n') - os_new_line(); - else - os_writec(c); -} Index: sys/arch/acorn26/stand/lib/riscosdisk.c =================================================================== RCS file: sys/arch/acorn26/stand/lib/riscosdisk.c diff -N sys/arch/acorn26/stand/lib/riscosdisk.c --- sys/arch/acorn26/stand/lib/riscosdisk.c 21 Mar 2014 16:41:15 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,69 +0,0 @@ -/* $NetBSD: riscosdisk.c,v 1.2 2014/03/21 16:41:15 christos Exp $ */ - -/*- - * Copyright (c) 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#include -#include - -#include - -struct riscosdisk { - int drive; - /* SWI numbers */ - int describe_disc; - int disc_op; -}; - -int -rodisk_open(struct open_file *f, ...) -{ - va_list ap; - char const *fsname; - int drive; - size_t buflen; - char *buf; - struct riscosdisk *rd; - - va_start(ap, f); - fsname = va_arg(ap, char const *); - drive = va_arg(ap, int); - va_end(ap); - - rd = (struct riscosdisk *) alloc(sizeof(*rd)); - - buflen = strlen(fsname) + 13; - buf = alloc(buflen); - snprintf(buf, buflen, "%s_DescribeDisc", fsname); - if (xos_swi_number_from_string(buf, &rd->describe_disc) != NULL) - return ENODEV; - snprintf(buf, buflen, "%s_DiscOp", fsname); - if (xos_swi_number_from_string(buf, &rd->disc_op) != NULL) - return ENODEV; - - - Index: sys/arch/acorn26/stand/lib/riscosdisk.h =================================================================== RCS file: sys/arch/acorn26/stand/lib/riscosdisk.h diff -N sys/arch/acorn26/stand/lib/riscosdisk.h --- sys/arch/acorn26/stand/lib/riscosdisk.h 24 Mar 2002 15:47:28 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,33 +0,0 @@ -/* $NetBSD: riscosdisk.h,v 1.1 2002/03/24 15:47:28 bjh21 Exp $ */ - -/*- - * Copyright (c) 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -int rodisk_strategy(void *, int, daddr_t, size_t, void *, size_t *); -int rodisk_open(struct open_file *, ...); -int rodisk_close(struct open_file *); -int rodisk_ioctl(struct open_file *, u_long, void *); Index: sys/arch/acorn26/stand/lib/riscoserrors.c =================================================================== RCS file: sys/arch/acorn26/stand/lib/riscoserrors.c diff -N sys/arch/acorn26/stand/lib/riscoserrors.c --- sys/arch/acorn26/stand/lib/riscoserrors.c 24 Mar 2002 15:47:28 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,48 +0,0 @@ -/* $NetBSD: riscoserrors.c,v 1.1 2002/03/24 15:47:28 bjh21 Exp $ */ - -/*- - * Copyright (c) 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#include -#include - -int -riscos_errno(os_error *error) -{ - - printf("%s\n", error->errmess); - switch (error->errnum) { - case error_IS_ADIR: - return EISDIR; - case error_TOO_MANY_OPEN_FILES: - return ENFILE; - case error_FILE_NOT_FOUND: - return ENOENT; - default: - return EIO; - } -} Index: sys/arch/acorn26/stand/lib/riscosfile.c =================================================================== RCS file: sys/arch/acorn26/stand/lib/riscosfile.c diff -N sys/arch/acorn26/stand/lib/riscosfile.c --- sys/arch/acorn26/stand/lib/riscosfile.c 25 Jan 2006 18:28:25 -0000 1.5 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,195 +0,0 @@ -/* $NetBSD: riscosfile.c,v 1.5 2006/01/25 18:28:25 christos Exp $ */ - -/*- - * Copyright (c) 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#include -#include -#include -#include - -struct riscosfile { - int file; -}; - -int -riscos_open(const char *path, struct open_file *f) -{ - struct riscosfile *rf; - os_error *error; - int flags; - - rf = (struct riscosfile *) alloc(sizeof(*rf)); - if (!rf) - return -1; - - switch (f->f_flags & (F_READ | F_WRITE)) { - case F_READ: - flags = OSFind_Openin; - break; - case F_WRITE: - flags = OSFind_Openout; - break; - case F_READ | F_WRITE: - flags = OSFind_Openup; - break; - default: - /* Erm... */ - return EINVAL; - } - - error = xosfind_open(flags | osfind_ERROR_IF_DIR | - osfind_ERROR_IF_ABSENT, path, NULL, &rf->file); - if (error) { - dealloc(rf, sizeof(*rf)); - return riscos_errno(error); - } - f->f_fsdata = rf; - return 0; -} - -#ifndef LIBSA_NO_FS_CLOSE -int -riscos_close(struct open_file *f) -{ - struct riscosfile *rf; - struct os_error *error; - int err = 0; - - rf = f->f_fsdata; - - error = xosfind_close(rf->file); - if (error) - err = riscos_errno(error); - dealloc(rf, sizeof(*rf)); - return err; -} -#endif - -int -riscos_read(struct open_file *f, void *buf, size_t size, size_t *residp) -{ - struct riscosfile *rf; - int resid; - os_error *error; - - rf = f->f_fsdata; - -#ifndef LIBSA_NO_TWIDDLE - twiddle(); -#endif - error = xosgbpb_read(rf->file, buf, size, &resid); - *residp = resid; - if (error) - return riscos_errno(error); - return 0; -} - -#ifndef LIBSA_NO_FS_WRITE -int -riscos_write(struct open_file *f, void *buf, size_t size, size_t *residp) -{ - struct riscosfile *rf; - int resid; - os_error *error; - - rf = f->f_fsdata; - -#ifndef LIBSA_NO_TWIDDLE - twiddle(); -#endif - error = xosgbpb_write(rf->file, buf, size, &resid); - *residp = resid; - if (error) - return riscos_errno(error); - return 0; -} -#endif - -int -riscos_stat(struct open_file *f, struct stat *sb) -{ - struct riscosfile *rf; - os_error *error; - int extent; - - rf = f->f_fsdata; - - error = xosargs_read_ext(rf->file, &extent); - if (error) - return riscos_errno(error); - - sb->st_mode = S_IFREG | 0444; - sb->st_nlink = 1; - sb->st_uid = 0; - sb->st_gid = 0; - sb->st_size = extent; - return 0; -} - -#ifndef LIBSA_NO_FS_SEEK -off_t -riscos_seek(struct open_file *f, off_t offset, int where) -{ - struct riscosfile *rf; - int base, result; - os_error *error; - - rf = f->f_fsdata; - - switch (where) { - case SEEK_SET: - base = 0; - break; - case SEEK_CUR: - error = xosargs_read_ptr(rf->file, &base); - if (error) - goto err; - break; - case SEEK_END: - error = xosargs_read_ext(rf->file, &base); - if (error) - goto err; - break; - default: - errno = EOFFSET; - return -1; - } - offset = base + offset; - error = xosargs_set_ptr(rf->file, offset); - if (error) - goto err; - error = xosargs_read_ptr(rf->file, &result); - if (error) - goto err; - return result; - -err: - errno = riscos_errno(error); - return -1; -} -#endif Index: sys/arch/acorn26/stand/lib/riscosfile.h =================================================================== RCS file: sys/arch/acorn26/stand/lib/riscosfile.h diff -N sys/arch/acorn26/stand/lib/riscosfile.h --- sys/arch/acorn26/stand/lib/riscosfile.h 11 Dec 2005 12:16:05 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,35 +0,0 @@ -/* $NetBSD: riscosfile.h,v 1.3 2005/12/11 12:16:05 christos Exp $ */ - -/*- - * Copyright (c) 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -int riscos_open(const char *, struct open_file *); -int riscos_read(struct open_file *, void *, size_t, size_t *); -int riscos_close(struct open_file *); -int riscos_write(struct open_file *, void *, size_t, size_t *); -int riscos_stat(struct open_file *, struct stat *); -off_t riscos_seek(struct open_file *, off_t, int); Index: sys/arch/acorn26/stand/lib/srt0.S =================================================================== RCS file: sys/arch/acorn26/stand/lib/srt0.S diff -N sys/arch/acorn26/stand/lib/srt0.S --- sys/arch/acorn26/stand/lib/srt0.S 24 Mar 2002 15:47:28 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,36 +0,0 @@ -/* $NetBSD: srt0.S,v 1.1 2002/03/24 15:47:28 bjh21 Exp $ */ - -/*- - * Copyright (c) 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#include -#include - -ENTRY(_start) - mov sp, #HIMEM - mov fp, #0 - bl __start Index: sys/arch/acorn26/stand/lib/srt1.c =================================================================== RCS file: sys/arch/acorn26/stand/lib/srt1.c diff -N sys/arch/acorn26/stand/lib/srt1.c --- sys/arch/acorn26/stand/lib/srt1.c 14 Jan 2009 23:14:48 -0000 1.5 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,144 +0,0 @@ -/* $NetBSD: srt1.c,v 1.5 2009/01/14 23:14:48 bjh21 Exp $ */ - -/* - * Copyright (c) 2001 Ben Harris. - * Copyright (c) 1996 - * Matthias Drochner. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 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. - */ - -/* Command-line parsing from i386 doscommain.c */ - -#include -#include -#include - -static int -whitespace(char c) -{ - if ((c == '\0') || (c == ' ') || (c == '\t') - || (c == '\r') || (c == '\n')) - return (1); - return (0); -} - -enum state {skipping, doing_arg, doing_long_arg}; - -/* build argv/argc, start real main() */ -void __start(void); -int splitargs(char *, int, char**); -extern int main(int, char**); - -extern char edata[], end[]; - -void -__start(void) -{ - int argc; - char *args, **argv; - - /* Clear BSS */ - memset(edata, 0, end - edata); - - /* Define heap. */ - setheap(end, (void *)(HIMEM - 0x1000)); - - args = os_get_env(NULL, NULL); - - argc = splitargs(args, 0, NULL); - argv = alloc(argc * sizeof(*argv)); - if (argv == NULL) - panic("alloc of argv failed"); - argc = splitargs(args, 1, argv); - - /* start real main() */ - os_exit(NULL, main(argc, argv)); -} - -int -splitargs(char *args, int really, char **argv) -{ - int argc, i; - enum state s; - - argc = 0; - s = skipping; - - for (i = 0; args[i]; i++){ - - if (whitespace(args[i])) { - if (s == doing_arg) { - /* end of argument word */ - if (really) - args[i] = '\0'; - s = skipping; - } - continue; - } - - if (args[i] == '"') { - /* start or end long arg - * (end only if next char is whitespace) - * XXX but '" ' cannot be in argument - */ - switch (s) { - case skipping: - /* next char begins new argument word */ - if (really) - argv[argc] = &args[i + 1]; - argc++; - s = doing_long_arg; - break; - case doing_long_arg: - if (whitespace(args[i + 1])) { - if (really) - args[i] = '\0'; - s = skipping; - } - break; - case doing_arg: - /* ignore in the middle of arguments */ - default: - break; - } - continue; - } - - /* all other characters */ - if (s == skipping) { - /* begin new argument word */ - if (really) - argv[argc] = &args[i]; - argc++; - s = doing_arg; - } - } - if (s != skipping && really) - args[i] = '\0'; /* to be sure */ - return argc; -} - -void _rtt(void) -{ - - os_exit(NULL, 0); -} Index: sys/arch/acorn26/vidc/arcvideo.c =================================================================== RCS file: sys/arch/acorn26/vidc/arcvideo.c diff -N sys/arch/acorn26/vidc/arcvideo.c --- sys/arch/acorn26/vidc/arcvideo.c 11 May 2012 15:39:18 -0000 1.17 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,428 +0,0 @@ -/* $NetBSD: arcvideo.c,v 1.17 2012/05/11 15:39:18 skrll Exp $ */ -/*- - * Copyright (c) 1998, 2000 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * arcvideo.c - Archimedes video system driver. - */ - -/* - * The Arc video system is rather closely tied into the heart of the - * machine, being partly controlled by the MEMC. Similarly, this - * driver will probably end up with its tentacles throughout the - * kernel, though in theory it should be possible to leave it out. - */ - -#include -__KERNEL_RCSID(0, "$NetBSD: arcvideo.c,v 1.17 2012/05/11 15:39:18 skrll Exp $"); - -#include -#include -#include -#include /* For bootverbose */ -#include -#include - -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -static int arcvideo_match(device_t parent, cfdata_t cf, void *aux); -static void arcvideo_attach(device_t parent, device_t self, void *aux); -#if 0 -static int arcvideo_setmode(device_t self, struct arcvideo_mode *mode); -static void arcvideo_await_vsync(device_t self); -#endif -static int arcvideo_ioctl(void *cookie, void *vs, u_long cmd, void *data, - int flag, struct lwp *l); -static paddr_t arcvideo_mmap(void *cookie, void *vs, off_t off, int prot); -static int arcvideo_alloc_screen(void *cookie, const struct wsscreen_descr *scr, - void **scookiep, int *curxp, int *curyp, - long *defattrp); -static void arcvideo_free_screen(void *cookie, void *scookie); -static int arcvideo_show_screen(void *cookie, void *scookie, int waitok, - void (*cb)(void *, int, int), - void *cbarg); -static int arcvideo_load_font(void *cookie, void *scookie, - struct wsdisplay_font *); -static void arccons_8bpp_hack(struct rasops_info *ri); - -struct arcvideo_softc { - device_t sc_dev; - uint32_t sc_vidc_ctl; - int sc_flags; -#define AV_VIDEO_ON 0x01 -}; - -CFATTACH_DECL_NEW(arcvideo, sizeof(struct arcvideo_softc), - arcvideo_match, arcvideo_attach, NULL, NULL); - -device_t the_arcvideo; - -static struct rasops_info arccons_ri; - -static struct wsscreen_descr arcscreen; - -static struct wsdisplay_accessops arcvideo_accessops = { - arcvideo_ioctl, arcvideo_mmap, arcvideo_alloc_screen, - arcvideo_free_screen, arcvideo_show_screen, arcvideo_load_font -}; - -static int arcvideo_isconsole = 0; - -static int -arcvideo_match(device_t parent, cfdata_t cf, void *aux) -{ - - /* A system can't sensibly have more than one VIDC. */ - if (the_arcvideo == NULL) - return 1; - return 0; -} - -static void -arcvideo_attach(device_t parent, device_t self, void *aux) -{ - struct wsemuldisplaydev_attach_args da; - struct wsscreen_list scrdata; - const struct wsscreen_descr *screenp; - struct arcvideo_softc *sc = device_private(self); - - sc->sc_dev = the_arcvideo = self; - if (arcvideo_isconsole) { - struct rasops_info *ri = &arccons_ri; - long defattr; - - if (rasops_init(ri, 1000, 1000) < 0) - panic("rasops_init failed"); - - /* Take rcons stuff and put it in arcscreen */ - /* XXX shouldn't this kind of thing be done by rcons_init? */ - arcscreen.name = "arccons"; - arcscreen.ncols = ri->ri_cols; - arcscreen.nrows = ri->ri_rows; - arcscreen.textops = &ri->ri_ops; - arcscreen.fontwidth = ri->ri_font->fontwidth; - arcscreen.fontheight = ri->ri_font->fontheight; - arcscreen.capabilities = ri->ri_caps; - - if ((ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr) != 0) - panic("allocattr failed"); - wsdisplay_cnattach(&arcscreen, ri, 0, 0, defattr); - } else { - aprint_error(": Not console -- I can't cope with this!\n"); - return; - } - - sc->sc_flags = AV_VIDEO_ON; - /* Detect monitor type? */ - /* Reset VIDC */ - - aprint_verbose(": VSYNC interrupts at IRQ %d", IOC_IRQ_IR); - - aprint_normal("\n"); - - scrdata.nscreens = 1; - scrdata.screens = &screenp; - screenp = &arcscreen; - - da.console = arcvideo_isconsole; - da.scrdata = &scrdata; - da.accessops = &arcvideo_accessops; - da.accesscookie = sc; - - config_found(self, &da, wsemuldisplaydevprint); -} - -#if 0 -static int -arcvideo_setmode(device_t self, struct arcvideo_mode *mode) -{ - struct arcvideo_softc *sc = device_private(self); - uint32_t newctl, ctlmask; - uint32_t newhswr, newhbsr, newhdsr, newhder, newhber, newhcr, newhir; - uint32_t newvswr, newvbsr, newvdsr, newvder, newvber, newvcr; - - newctl = 0; - /* Dot clock */ - /* XXX: should this be abstracted a little to allow for - variable VIDCLKs? */ - switch (mode->timings.pixelrate) { - case 8000000: - newctl |= VIDC_CTL_DOTCLOCK_8MHZ; - break; - case 12000000: - newctl |= VIDC_CTL_DOTCLOCK_12MHZ; - break; - case 16000000: - newctl |= VIDC_CTL_DOTCLOCK_16MHZ; - break; - case 24000000: - newctl |= VIDC_CTL_DOTCLOCK_24MHZ; - break; - default: - return ENXIO; - }; - /* Bits per pixel */ - switch (mode->bpp) { - case 1: - newctl |= VIDC_CTL_BPP_ONE; - break; - case 2: - newctl |= VIDC_CTL_BPP_TWO; - break; - case 4: - newctl |= VIDC_CTL_BPP_FOUR; - break; - case 8: - newctl |= VIDC_CTL_BPP_EIGHT; - break; - default: - return EINVAL; - } - /* DMA timings */ - /* XXX: should work this out from pixelrate, bpp and MCLK rate. */ - newctl |= VIDC_CTL_DMARQ_37; - - ctlmask = ~(VIDC_CTL_DOTCLOCK_MASK - | VIDC_CTL_BPP_MASK - | VIDC_CTL_DMARQ_MASK); - - newhswr = (mode->timings.hsw - 2) / 2 << 14; - newhbsr = (mode->timings.hbs - 1) / 2 << 14; - switch (mode->bpp) { - case 8: - newhdsr = (mode->timings.hds - 5) / 2 << 14; - newhder = (mode->timings.hde - 5) / 2 << 14; - break; - case 4: - newhdsr = (mode->timings.hds - 7) / 2 << 14; - newhder = (mode->timings.hde - 7) / 2 << 14; - break; - case 2: - newhdsr = (mode->timings.hds - 11) / 2 << 14; - newhder = (mode->timings.hde - 11) / 2 << 14; - break; - case 1: - newhdsr = (mode->timings.hds - 19) / 2 << 14; - newhder = (mode->timings.hde - 19) / 2 << 14; - break; - } - newhber = (mode->timings.hbe - 1) / 2 << 14; - newhcr = (mode->timings.hc - 2) / 2 << 14; - newhir = mode->timings.hc / 4 << 14; - newvswr = (mode->timings.vsw - 1) << 14; - newvbsr = (mode->timings.vbs - 1) << 14; - newvdsr = (mode->timings.vds - 1) << 14; - newvder = (mode->timings.vde - 1) << 14; - newvber = (mode->timings.vbe - 1) << 14; - newvcr = (mode->timings.vc - 1) << 14; - arcvideo_await_vsync(self); - spltty(); /* XXX audio? */ - newctl |= sc->sc_vidc_ctl & ctlmask; - VIDC_WRITE(VIDC_CONTROL | newctl); - sc->sc_vidc_ctl = newctl; - VIDC_WRITE(VIDC_VCR | newvcr); - VIDC_WRITE(VIDC_VSWR | newvswr); - VIDC_WRITE(VIDC_VBSR | newvbsr); - VIDC_WRITE(VIDC_VDSR | newvdsr); - VIDC_WRITE(VIDC_VDER | newvder); - VIDC_WRITE(VIDC_VBER | newvber); - VIDC_WRITE(VIDC_HCR | newhcr); - VIDC_WRITE(VIDC_HIR | newhir); - VIDC_WRITE(VIDC_HSWR | newhswr); - VIDC_WRITE(VIDC_HBSR | newhbsr); - VIDC_WRITE(VIDC_HDSR | newhdsr); - VIDC_WRITE(VIDC_HDER | newhder); - VIDC_WRITE(VIDC_HBER | newhber); - return 0; -} - -static void -arcvideo_await_vsync(device_t self) -{ - - panic("arcvideo_await_vsync not implemented"); -} -#endif - -/* - * In the standard RISC OS 8-bit palette (which we use), the bits go - * BGgRbrTt, feeding RrTt, GgTt and BbTt to the DACs. The top four of - * these bits are fixed in hardware. - * - * The following table is the closest match I can get to the colours - * at the top of rasops.c. - */ - -static uint8_t rasops_cmap_8bpp[] = { - 0x00, 0x10, 0x40, 0x50, 0x80, 0x90, 0xc0, 0xfc, - 0xd0, 0x17, 0x63, 0x77, 0x8b, 0x9f, 0xeb, 0xff, -}; - -void -arccons_init(void) -{ - struct rasops_info *ri = &arccons_ri; - int i; - - MEMC_WRITE(MEMC_SET_PTR(MEMC_VSTART, 0)); - MEMC_WRITE(MEMC_SET_PTR(MEMC_VINIT, 0)); - MEMC_WRITE(MEMC_SET_PTR(MEMC_VEND, 0x00080000)); - - /* TODO: We should really set up the VIDC ourselves here. */ - - /* Set up arccons_ri */ - memset(ri, 0, sizeof(*ri)); - ri->ri_depth = bootconfig.bpp; - ri->ri_bits = (u_char *)(MEMC_PHYS_BASE); - ri->ri_width = bootconfig.xpixels; - ri->ri_height = bootconfig.ypixels; - ri->ri_stride = ((bootconfig.xpixels * bootconfig.bpp + 31) >> 5) << 2; - ri->ri_flg = RI_CENTER | ((bootconfig.screenbase != 0) ? RI_CLEAR : 0); - - /* Register video memory with UVM now we know how much we're using. */ - uvm_page_physload(0, atop(MEMC_DMA_MAX), - atop(round_page(ri->ri_height * ri->ri_stride)), - atop(MEMC_DMA_MAX), VM_FREELIST_LOW); - - if (ri->ri_depth == 8) - arccons_8bpp_hack(&arccons_ri); - else if (ri->ri_depth == 4) - for (i = 0; i < 1 << ri->ri_depth; i++) - VIDC_WRITE(VIDC_PALETTE_LCOL(i) | - VIDC_PALETTE_ENTRY(rasops_cmap[3*i + 0] >> 4, - rasops_cmap[3*i + 1] >> 4, - rasops_cmap[3*i + 2] >> 4, 0)); - - /* That should be all */ - arcvideo_isconsole = 1; -} - -/* - * The following is a gross hack because the rasops code has no way - * for us to specify the devcmap if we don't want the default. I think - * it assumes that all 8-bit displays are PseudoColor. - */ - -static void -arccons_8bpp_hack(struct rasops_info *ri) -{ - int i, c; - - for (i = 0; i < 16; i++) { - c = rasops_cmap_8bpp[i]; - ri->ri_devcmap[i] = c | (c<<8) | (c<<16) | (c<<24); - } -} - - -/* wsdisplay access functions */ - -static int -arcvideo_ioctl(void *cookie, void *vs, u_long cmd, void *data, int flag, - struct lwp *l) -{ - struct arcvideo_softc *sc = cookie; - - switch (cmd) { - case WSDISPLAYIO_GTYPE: - *(u_int *)data = WSDISPLAY_TYPE_VIDC; - return 0; - case WSDISPLAYIO_GVIDEO: - if (sc->sc_flags & AV_VIDEO_ON) - *(u_int *)data = WSDISPLAYIO_VIDEO_ON; - else - *(u_int *)data = WSDISPLAYIO_VIDEO_OFF; - return 0; - case WSDISPLAYIO_SVIDEO: - switch (*(u_int *)data) { - case WSDISPLAYIO_VIDEO_OFF: - sc->sc_flags &= ~AV_VIDEO_ON; - update_memc(MEMC_CTL_VIDEODMA | MEMC_CTL_RFRSH_MASK, - MEMC_CTL_RFRSH_CONTIN); - return 0; - case WSDISPLAYIO_VIDEO_ON: - sc->sc_flags |= AV_VIDEO_ON; - update_memc(MEMC_CTL_VIDEODMA | MEMC_CTL_RFRSH_MASK, - MEMC_CTL_VIDEODMA | - MEMC_CTL_RFRSH_FLYBACK); - return 0; - } - } - return EPASSTHROUGH; -} - -static paddr_t -arcvideo_mmap(void *cookie, void *vs, off_t off, int prot) -{ - - return ENODEV; -} - -static int -arcvideo_alloc_screen(void *cookie, const struct wsscreen_descr *scr, - void **scookiep, int *curxp, int *curyp, long *defattrp) -{ - - return ENODEV; -} - -static void -arcvideo_free_screen(void *cookie, void *scookie) -{ - - panic("arcvideo_free_screen not implemented"); -} - -static int -arcvideo_show_screen(void *cookie, void *scookie, int waitok, - void (*cb)(void *cbarg, int error, int waitok), void *cbarg) -{ - - /* Do nothing, since there can only be one screen. */ - return 0; -} - -static int -arcvideo_load_font(void *cookie, void *emulcookie, struct wsdisplay_font *font) -{ - - return EPASSTHROUGH; -} Index: sys/arch/acorn26/vidc/arcvideovar.h =================================================================== RCS file: sys/arch/acorn26/vidc/arcvideovar.h diff -N sys/arch/acorn26/vidc/arcvideovar.h --- sys/arch/acorn26/vidc/arcvideovar.h 14 Jan 2009 23:14:48 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,46 +0,0 @@ -/* $NetBSD: arcvideovar.h,v 1.3 2009/01/14 23:14:48 bjh21 Exp $ */ -/*- - * Copyright (c) 1998 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ - -#ifndef _ARM26_ARCVIDEOVAR_H -#define _ARM26_ARCVIDEOVAR_H - -struct arcvideo_timings { - int pixelrate; /* in Hz */ - int hsw, hbs, hds, hde, hbe, hc; /* In pixels */ - int vsw, vbs, vds, vde, vbe, vc; /* In rasters */ -}; - -struct arcvideo_mode { - struct arcvideo_timings timings; - int bpp; - int sync_pol; -}; - -extern void arccons_init(void); - -#endif Index: sys/arch/acorn26/vidc/vidcreg.h =================================================================== RCS file: sys/arch/acorn26/vidc/vidcreg.h diff -N sys/arch/acorn26/vidc/vidcreg.h --- sys/arch/acorn26/vidc/vidcreg.h 11 May 2012 15:39:18 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,153 +0,0 @@ -/* $NetBSD: vidcreg.h,v 1.3 2012/05/11 15:39:18 skrll Exp $ */ - -/*- - * Copyright (c) 1998, 2001 Ben Harris - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not 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. - */ -/* - * vidcreg.h - Acorn/ARM VIDC (Arabella) registers - */ - -#ifndef _ARM26_VIDCREG_H -#define _ARM26_VIDCREG_H - -/* - * The VIDC is accessed by writing words to addresses starting at - * MEMC_VIDC_BASE definied in memcreg.h. - * - * As with the MEMC, the value is the logical OR of the register - * specifier and the new value. - */ - -/* Palette entries */ - -#define VIDC_PALETTE 0x00000000 -#define VIDC_PALETTE_LCOL(n) (n << 26) -#define VIDC_PALETTE_BCOL 0x40000000 -#define VIDC_PALETTE_CCOL(n) (0x40000000 + (n << 26)) - -#define VIDC_PALETTE_ENTRY(r, g, b, s) ((s != 0) << 12 | b << 8 | g << 4 | r) - -/* Stereo image registers */ -/* They're in the order 70123456 */ -#define VIDC_SIR(n) (0x60000000 + ((n + 1) % 8 << 26)) -#define VIDC_STEREO_L100 1 -#define VIDC_STEREO_L83 2 -#define VIDC_STEREO_L67 3 -#define VIDC_STEREO_C 4 -#define VIDC_STEREO_R67 5 -#define VIDC_STEREO_R83 6 -#define VIDC_STEREO_R100 7 - -/* Video timing register */ -#define VIDC_HCR 0x80000000 -#define VIDC_HSWR 0x84000000 -#define VIDC_HBSR 0x88000000 -#define VIDC_HDSR 0x8c000000 -#define VIDC_HDER 0x90000000 -#define VIDC_HBER 0x94000000 -#define VIDC_HCSR 0x98000000 -#define VIDC_HIR 0x9c000000 - -#define VIDC_VCR 0xa0000000 -#define VIDC_VSWR 0xa4000000 -#define VIDC_VBSR 0xa8000000 -#define VIDC_VDSR 0xac000000 -#define VIDC_VDER 0xb0000000 -#define VIDC_VBER 0xb4000000 -#define VIDC_VCSR 0xb8000000 -#define VIDC_VCER 0xbc000000 - -/* - * Horizontal timings have units of two pixels (except HCSR). - * Vertical timings have units of a raster. Most have to have one or - * two subtracted from them. - */ -#define VIDC_VIDTIMING(x) (x << 14) -#define VIDC_HCS(x) (x << 13) -#define VIDC_HCS_HIRES(x) (x << 11) - -/* Sound frequency register */ -#define VIDC_SFR 0xc0000000 -/* Units are us */ -#define VIDC_SF(x) (x & 0x100) - -/* Control register */ -#define VIDC_CONTROL 0xe0000000 - -#define VIDC_CTL_DOTCLOCK_MASK 0x00000003 -#define VIDC_CTL_DOTCLOCK_8MHZ 0x00000000 -#define VIDC_CTL_DOTCLOCK_12MHZ 0x00000001 -#define VIDC_CTL_DOTCLOCK_16MHZ 0x00000002 -#define VIDC_CTL_DOTCLOCK_24MHZ 0x00000003 - -#define VIDC_CTL_BPP_MASK 0x0000000c -#define VIDC_CTL_BPP_ONE 0x00000000 -#define VIDC_CTL_BPP_TWO 0x00000004 -#define VIDC_CTL_BPP_FOUR 0x00000008 -#define VIDC_CTL_BPP_EIGHT 0x0000000c - -#define VIDC_CTL_DMARQ_MASK 0x00000030 -#define VIDC_CTL_DMARQ_04 0x00000000 -#define VIDC_CTL_DMARQ_15 0x00000010 -#define VIDC_CTL_DMARQ_26 0x00000020 -#define VIDC_CTL_DMARQ_37 0x00000030 - -#define VIDC_CTL_INTERLACE 0x00000040 - -#define VIDC_CTL_CSYNC 0x00000080 - -#define VIDC_CTL_TEST_MASK 0x0000c100 -#define VIDC_CTL_TEST_OFF 0x00000000 -#define VIDC_CTL_TEST_MODE0 0x00004000 -#define VIDC_CTL_TEST_MODE1 0x00008000 -#define VIDC_CTL_TEST_MODE2 0x0000c000 -#define VIDC_CTL_TEST_MODE3 0x00000100 - -#define VIDC_WRITE(value) *(volatile uint32_t *)MEMC_VIDC_BASE = value - -/* - * VIDC audio format is mu-law, but with the bits in a strange order. - * - * VIDC1 has: - * D[7] sign - * D[6:4] chord select - * D[3:0] point on chord - * so 0x00 -> +0, 0x7f -> +inf, 0x80 -> -0, 0xff -> -inf - * - * VIDC2 has: - * D[7:5] chord select - * D[4:1] point on chord - * D[0] sign - * so 0x00 -> +0, 0xfe -> +inf, 0x01 -> -0, 0xff -> -inf - * - * Normal mu-law appears to have: - * 0x00 -> -inf, 0x7f -> -0, 0x80 -> +inf, 0xff -> +0 - * Thus VIDC1 is NOT(mu-law), while VIDC2 is NOT(mu-law)<<1 | NOT(mu-law)>>7. - * - * I think the A500 uses VIDC1 and the Archimedes uses VIDC2. - */ - -#endif Index: sys/arch/acorn26/vidc/vidmodes.c =================================================================== RCS file: sys/arch/acorn26/vidc/vidmodes.c diff -N sys/arch/acorn26/vidc/vidmodes.c --- sys/arch/acorn26/vidc/vidmodes.c 11 Dec 2005 12:16:05 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,52 +0,0 @@ -/* $NetBSD: vidmodes.c,v 1.3 2005/12/11 12:16:05 christos Exp $ */ -/* - * XFree86 modes are: - * Modeline "name" dotclock hdisp hsyncstart hsyncend htotal \ - * vdisp vsyncstart vsyncend vtotal flags - * - * hswr = hsyncend - hsyncstart - * hdsr = htotal - hsyncstart - * hder = hdsr + hdisp - * hcr = htotal - * Same for vertical. XFree doesn't do borders. - */ - -#include -__KERNEL_RCSID(0, "$NetBSD: vidmodes.c,v 1.3 2005/12/11 12:16:05 christos Exp $"); - -/* RISC OS Mode 0 etc (I think) 640x256 @ 50Hz, 15.6kHz hsync */ -struct arcvideo_timings timing_std640x256 = { - 16000000, - 72, 217, 265, 905, 953, 1024, - 3, 21, 39, 295, 312, 312 -}; - -/* - * # 640x400 @ 70 Hz, 31.5 kHz hsync - * Modeline "640x400" 25.175 640 664 760 800 400 409 411 450 - */ -struct arcvideo_timings timing_vga640x400 = { - 25175000, - 96, 136, 136, 776, 776, 800, - 2, 41, 41, 441, 441, 450 -}; - -/* - * # 640x480 @ 60 Hz, 31.5 kHz hsync - * Modeline "640x480" 25.175 640 664 760 800 480 491 493 525 - */ -struct arcvideo_timings timing_vga640x480 = { - 25175000, - 96, 136, 136, 776, 776, 800, - 2, 34, 34, 514, 514, 525 -}; - -/* - * # 800x600 @ 56 Hz, 35.15 kHz hsync - * ModeLine "800x600" 36 800 824 896 1024 600 601 603 625 - */ -struct arcvideo_timings timing_svga800x600 = { - 36000000, - 72, 200, 200, 1000, 1000, 1024, - 2, 24, 24, 624, 624, 625 -}; Index: sys/arch/arm/arm/arm_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/arm/arm/arm_machdep.c,v retrieving revision 1.52 diff -u -p -r1.52 arm_machdep.c --- sys/arch/arm/arm/arm_machdep.c 23 Jul 2017 13:35:15 -0000 1.52 +++ sys/arch/arm/arm/arm_machdep.c 23 Jan 2018 15:28:55 -0000 @@ -104,20 +104,16 @@ __KERNEL_RCSID(0, "$NetBSD: arm_machdep. char machine[] = MACHINE; /* from */ char machine_arch[] = MACHINE_ARCH; /* from */ -#ifdef __PROG32 extern const uint32_t undefinedinstruction_bounce[]; -#endif /* Our exported CPU info; we can have only one. */ struct cpu_info cpu_info_store = { .ci_cpl = IPL_HIGH, .ci_curlwp = &lwp0, -#ifdef __PROG32 .ci_undefsave[2] = (register_t) undefinedinstruction_bounce, #if defined(ARM_MMU_EXTENDED) && KERNEL_PID != 0 .ci_pmap_asid_cur = KERNEL_PID, #endif -#endif }; #ifdef MULTIPROCESSOR @@ -182,7 +178,6 @@ setregs(struct lwp *l, struct exec_packa tf->tf_usr_lr = pack->ep_entry; tf->tf_svc_lr = 0x77777777; /* Something we can see */ tf->tf_pc = pack->ep_entry; -#ifdef __PROG32 #if defined(__ARMEB__) /* * If we are running on ARMv7, we need to set the E bit to force @@ -197,7 +192,6 @@ setregs(struct lwp *l, struct exec_packa if (pack->ep_entry & 1) tf->tf_spsr |= PSR_T_bit; #endif -#endif /* __PROG32 */ l->l_md.md_flags = 0; #ifdef EXEC_AOUT Index: sys/arch/arm/arm/ast.c =================================================================== RCS file: /cvsroot/src/sys/arch/arm/arm/ast.c,v retrieving revision 1.29 diff -u -p -r1.29 ast.c --- sys/arch/arm/arm/ast.c 12 May 2017 05:46:39 -0000 1.29 +++ sys/arch/arm/arm/ast.c 23 Jan 2018 15:28:55 -0000 @@ -60,10 +60,6 @@ __KERNEL_RCSID(0, "$NetBSD: ast.c,v 1.29 #include -#ifdef acorn26 -#include -#endif - /* * Prototypes */ @@ -113,17 +109,9 @@ ast(struct trapframe *tf) { struct lwp * const l = curlwp; -#ifdef acorn26 - /* Enable interrupts if they were enabled before the trap. */ - if ((tf->tf_r15 & R15_IRQ_DISABLE) == 0) - int_on(); -#else /* Interrupts were restored by exception_exit. */ -#endif -#ifdef __PROG32 KASSERT(VALID_R15_PSR(tf->tf_pc, tf->tf_spsr)); -#endif #ifdef __HAVE_PREEMPTION kpreempt_disable(); Index: sys/arch/arm/arm/bcopyinout.S =================================================================== RCS file: /cvsroot/src/sys/arch/arm/arm/bcopyinout.S,v retrieving revision 1.20 diff -u -p -r1.20 bcopyinout.S --- sys/arch/arm/arm/bcopyinout.S 18 Aug 2013 06:28:18 -0000 1.20 +++ sys/arch/arm/arm/bcopyinout.S 23 Jan 2018 15:28:55 -0000 @@ -57,14 +57,8 @@ RCSID("$NetBSD: bcopyinout.S,v 1.20 2013 .text .align 0 -#ifdef __PROG32 #define SAVE_REGS stmfd sp!, {r4-r11} #define RESTORE_REGS ldmfd sp!, {r4-r11} -#else -/* Need to save R14_svc because it'll get trampled if we take a page fault. */ -#define SAVE_REGS stmfd sp!, {r4-r11, r14} -#define RESTORE_REGS ldmfd sp!, {r4-r11, r14} -#endif #if defined(__XSCALE__) || defined(_ARM_ARCH_6) #define HELLOCPP # @@ -682,7 +676,6 @@ ENTRY(kcopy) END(kcopy) #endif /* !__XSCALE__ */ -#ifdef __PROG32 /* * int badaddr_read_1(const uint8_t *src, uint8_t *dest) * @@ -754,4 +747,3 @@ ENTRY(badaddr_read_4) 1: str ip, [r2, #PCB_ONFAULT] RET END(badaddr_read_4) -#endif /* __PROG32 */ Index: sys/arch/arm/arm/compat_16_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/arm/arm/compat_16_machdep.c,v retrieving revision 1.17 diff -u -p -r1.17 compat_16_machdep.c --- sys/arch/arm/arm/compat_16_machdep.c 18 Aug 2013 06:50:31 -0000 1.17 +++ sys/arch/arm/arm/compat_16_machdep.c 23 Jan 2018 15:28:56 -0000 @@ -63,9 +63,7 @@ __KERNEL_RCSID(0, "$NetBSD: compat_16_ma #include #include -#ifndef acorn26 #include -#endif /* * Send an interrupt to process. @@ -178,10 +176,8 @@ sendsig_sigcontext(const ksiginfo_t *ksi switch (ps->sa_sigdesc[sig].sd_vers) { case 0: /* legacy on-stack sigtramp */ tf->tf_usr_lr = (int)p->p_sigctx.ps_sigcode; -#ifndef acorn26 /* XXX This should not be needed. */ cpu_icache_sync_all(); -#endif break; case 1: tf->tf_usr_lr = (int)ps->sa_sigdesc[sig].sd_tramp; Index: sys/arch/arm/arm/copystr.S =================================================================== RCS file: /cvsroot/src/sys/arch/arm/arm/copystr.S,v retrieving revision 1.11 diff -u -p -r1.11 copystr.S --- sys/arch/arm/arm/copystr.S 18 Aug 2013 06:28:18 -0000 1.11 +++ sys/arch/arm/arm/copystr.S 23 Jan 2018 15:28:56 -0000 @@ -86,14 +86,8 @@ ENTRY(copystr) RET END(copystr) -#ifdef __PROG32 #define SAVE_REGS push {r3-r6} #define RESTORE_REGS pop {r3-r6} -#else -/* Need to save R14_svc because it'll get trampled if we take a page fault. */ -#define SAVE_REGS stmfd sp!, {r4-r6, r14} -#define RESTORE_REGS ldmfd sp!, {r4-r6, r14} -#endif /* * r0 - user space address Index: sys/arch/arm/arm/cpu_in_cksum.S =================================================================== RCS file: /cvsroot/src/sys/arch/arm/arm/cpu_in_cksum.S,v retrieving revision 1.11 diff -u -p -r1.11 cpu_in_cksum.S --- sys/arch/arm/arm/cpu_in_cksum.S 15 Feb 2015 17:21:08 -0000 1.11 +++ sys/arch/arm/arm/cpu_in_cksum.S 23 Jan 2018 15:28:56 -0000 @@ -156,9 +156,6 @@ END(cpu_in_cksum) */ /* LINTSTUB: Ignore */ ASENTRY_NP(arm_cksumdata) -#ifdef __PROG26 - str lr, [sp, #-4]! /* for SVC26 mode */ -#endif #ifdef __XSCALE__ pld [r0] /* Pre-fetch the start of the buffer */ #endif @@ -185,11 +182,7 @@ ASENTRY_NP(arm_cksumdata) rsb r7, r7, #0x04 subs r1, r1, r7 /* Enough bytes left to make it? */ bgt .Lcksumdata_wordaligned -#ifdef __PROG26 - ldreq pc, [sp], #4 /* done */ -#else RETc(eq) /* done */ -#endif adds r1, r1, r7 /* undo sub */ subs r7, r7, r1 lsls r7, r7, #3 @@ -200,11 +193,7 @@ ASENTRY_NP(arm_cksumdata) lsls r2, r2, r7 lsrs r2, r2, r7 #endif -#ifdef __PROG26 - ldr pc, [sp], #4 /* done */ -#else RET /* done */ -#endif /* Buffer is now word aligned */ .Lcksumdata_wordaligned: @@ -296,11 +285,7 @@ ASENTRY_NP(arm_cksumdata) #endif adds r1, r1, #0x40 -#ifdef __PROG26 - ldreq pc, [sp], #4 -#else RETc(eq) -#endif cmp r1, #0x20 #ifdef __XSCALE__ @@ -333,11 +318,7 @@ ASENTRY_NP(arm_cksumdata) #endif adcs r2, r2, #0x00 subs r1, r1, #0x20 -#ifdef __PROG26 - ldreq pc, [sp], #4 -#else RETc(eq) -#endif .Lcksumdata_less_than_32: /* There are less than 32 bytes left */ @@ -383,11 +364,7 @@ ASENTRY_NP(arm_cksumdata) /* Deal with < 4 bytes remaining */ .Lcksumdata_lessthan4: adds r1, r1, #0x04 -#ifdef __PROG26 - ldreq pc, [sp], #4 -#else RETc(eq) -#endif /* Deal with 1 to 3 remaining bytes, possibly misaligned */ .Lcksumdata_endgame: @@ -403,9 +380,5 @@ ASENTRY_NP(arm_cksumdata) #endif adds r2, r2, r3 adcs r2, r2, #0x00 -#ifdef __PROG26 - ldr pc, [sp], #4 -#else RET -#endif ASEND(arm_cksumdata) Index: sys/arch/arm/arm/db_trace.c =================================================================== RCS file: /cvsroot/src/sys/arch/arm/arm/db_trace.c,v retrieving revision 1.32 diff -u -p -r1.32 db_trace.c --- sys/arch/arm/arm/db_trace.c 25 Apr 2017 09:02:04 -0000 1.32 +++ sys/arch/arm/arm/db_trace.c 23 Jan 2018 15:28:56 -0000 @@ -148,11 +148,7 @@ db_stack_trace_print(db_expr_t addr, boo (char *)&pcbb); pcb = &pcbb; #endif -#ifdef acorn26 - frame = (uint32_t *)(pcb->pcb_sf->sf_r11); -#else - frame = (uint32_t *)(pcb->pcb_un.un_32.pcb32_r11); -#endif + frame = (uint32_t *)(pcb->pcb_r11); (*pr)("at %p\n", frame); } else frame = (uint32_t *)(addr); @@ -174,11 +170,7 @@ db_stack_trace_print(db_expr_t addr, boo * In theory, the SCP isn't guaranteed to be in the function * that generated the stack frame. We hope for the best. */ -#ifdef __PROG26 - scp = frame[FR_SCP] & R15_PC; -#else scp = frame[FR_SCP]; -#endif pc = scp; while (count--) { @@ -187,26 +179,15 @@ db_stack_trace_print(db_expr_t addr, boo uint32_t *rp; const char *sep; -#ifdef __PROG26 - scp = frame[FR_SCP] & R15_PC; -#else scp = frame[FR_SCP]; -#endif (*pr)("%p: ", lastframe); db_printsym(pc, DB_STGY_PROC, pr); if (trace_full) { (*pr)("\n\t"); -#ifdef __PROG26 - (*pr)("pc =0x%08x rlv=0x%08x (", pc, - frame[FR_RLV] & R15_PC); - db_printsym(frame[FR_RLV] & R15_PC, DB_STGY_PROC, pr); - (*pr)(")\n"); -#else (*pr)("pc =0x%08x rlv=0x%08x (", pc, frame[FR_RLV]); db_printsym(frame[FR_RLV], DB_STGY_PROC, pr); (*pr)(")\n"); -#endif (*pr)("\trsp=0x%08x rfp=0x%08x", frame[FR_RSP], frame[FR_RFP]); } @@ -242,11 +223,7 @@ db_stack_trace_print(db_expr_t addr, boo */ if (frame[FR_RFP] == 0) break; /* Top of stack */ -#ifdef __PROG26 - pc = frame[FR_RLV] & R15_PC; -#else pc = frame[FR_RLV]; -#endif frame = (uint32_t *)(frame[FR_RFP]); Index: sys/arch/arm/arm/fiq.c =================================================================== RCS file: /cvsroot/src/sys/arch/arm/arm/fiq.c,v retrieving revision 1.7 diff -u -p -r1.7 fiq.c --- sys/arch/arm/arm/fiq.c 12 Jun 2013 21:34:12 -0000 1.7 +++ sys/arch/arm/arm/fiq.c 23 Jan 2018 15:28:56 -0000 @@ -44,9 +44,7 @@ __KERNEL_RCSID(0, "$NetBSD: fiq.c,v 1.7 #include #include -#ifdef __PROG32 #include -#endif TAILQ_HEAD(, fiqhandler) fiqhandler_stack = TAILQ_HEAD_INITIALIZER(fiqhandler_stack); @@ -54,13 +52,8 @@ TAILQ_HEAD(, fiqhandler) fiqhandler_stac extern char fiqvector[]; extern char fiq_nullhandler[], fiq_nullhandler_end[]; -#ifdef __PROG32 #define IRQ_BIT I32_bit #define FIQ_BIT F32_bit -#else -#define IRQ_BIT R15_IRQ_DISABLE -#define FIQ_BIT R15_FIQ_DISABLE -#endif /* __PROG32 */ #ifndef ARM_HAS_VBAR /* @@ -82,12 +75,10 @@ fiq_installhandler(void *func, size_t si memcpy(fiqvector, func, size); -#ifdef __PROG32 #if !defined(__ARM_FIQ_INDIRECT) vector_page_setprot(VM_PROT_READ); #endif cpu_icache_sync_range((vaddr_t) fiqvector, size); -#endif } /* Index: sys/arch/arm/arm/fiq_subr.S =================================================================== RCS file: /cvsroot/src/sys/arch/arm/arm/fiq_subr.S,v retrieving revision 1.6 diff -u -p -r1.6 fiq_subr.S --- sys/arch/arm/arm/fiq_subr.S 2 Dec 2013 18:36:10 -0000 1.6 +++ sys/arch/arm/arm/fiq_subr.S 23 Jan 2018 15:28:56 -0000 @@ -51,7 +51,6 @@ #define MODE_CHANGE_NOP /* Data sheet says ARM3 doesn't need it */ #endif -#ifdef __PROG32 #ifdef _ARM_ARCH_6 #define SWITCH_TO_FIQ_MODE \ cps #PSR_FIQ32_MODE @@ -63,15 +62,7 @@ orr r2, r2, #(PSR_FIQ32_MODE) ; \ msr cpsr_all, r2 #endif -#else -#define SWITCH_TO_FIQ_MODE ; \ - mov r1, r15 ; \ - bic r2, r1, #(R15_MODE) ; \ - teqp r2, #(R15_MODE_FIQ) ; \ - MODE_CHANGE_NOP -#endif /* __PROG32 */ -#ifdef __PROG32 #ifdef _ARM_ARCH_6 #define BACK_TO_SVC_MODE \ cps #PSR_SVC32_MODE @@ -79,11 +70,6 @@ #define BACK_TO_SVC_MODE \ msr cpsr_all, r3 #endif -#else -#define BACK_TO_SVC_MODE ; \ - teqp r1, #0 ; \ - MODE_CHANGE_NOP -#endif /* __PROG32 */ /* * fiq_getregs: Index: sys/arch/arm/arm/fusu.S =================================================================== RCS file: /cvsroot/src/sys/arch/arm/arm/fusu.S,v retrieving revision 1.3 diff -u -p -r1.3 fusu.S --- sys/arch/arm/arm/fusu.S 18 Aug 2013 06:28:18 -0000 1.3 +++ sys/arch/arm/arm/fusu.S 23 Jan 2018 15:28:56 -0000 @@ -41,17 +41,7 @@ #include -/* - * On PROG26 systems (i.e. acorn26) taking a page fault corrupts R14_svc. - * To prevent this causing a problem, we save R14 in R12 in these functions. - */ -#ifdef __PROG26 -#define SAVE_R14 mov ip, lr -#define FUSU_RET mov pc, ip -#else -#define SAVE_R14 /* do nothing */ #define FUSU_RET mov pc, lr -#endif /* * fuword(void *uaddr); @@ -59,7 +49,6 @@ */ ENTRY(fuword) - SAVE_R14 GET_CURPCB(r2) #ifdef DIAGNOSTIC @@ -84,7 +73,6 @@ END(fuword) */ ENTRY(fusword) - SAVE_R14 GET_CURPCB(r2) #ifdef DIAGNOSTIC @@ -120,7 +108,6 @@ ENTRY(fuswintr) mvnne r0, #0x00000000 movne pc, lr - SAVE_R14 GET_CURPCB(r2) #ifdef DIAGNOSTIC @@ -160,7 +147,6 @@ _C_LABEL(block_userspace_access): */ ENTRY(fubyte) - SAVE_R14 GET_CURPCB(r2) #ifdef DIAGNOSTIC @@ -224,7 +210,6 @@ END(fusubailout) */ ENTRY(suword) - SAVE_R14 GET_CURPCB(r2) #ifdef DIAGNOSTIC @@ -255,7 +240,6 @@ ENTRY(suswintr) mvnne r0, #0x00000000 movne pc, lr - SAVE_R14 GET_CURPCB(r2) #ifdef DIAGNOSTIC @@ -286,7 +270,6 @@ END(suswintr) */ ENTRY(susword) - SAVE_R14 GET_CURPCB(r2) #ifdef DIAGNOSTIC @@ -317,7 +300,6 @@ END(susword) */ ENTRY(subyte) - SAVE_R14 GET_CURPCB(r2) #ifdef DIAGNOSTIC Index: sys/arch/arm/arm/lock_cas.S =================================================================== RCS file: /cvsroot/src/sys/arch/arm/arm/lock_cas.S,v retrieving revision 1.11 diff -u -p -r1.11 lock_cas.S --- sys/arch/arm/arm/lock_cas.S 18 Aug 2013 06:28:18 -0000 1.11 +++ sys/arch/arm/arm/lock_cas.S 23 Jan 2018 15:28:56 -0000 @@ -109,14 +109,8 @@ STRONG_ALIAS(_atomic_cas_ptr_ni,_lock_ca STRONG_ALIAS(atomic_cas_ptr_ni,_lock_cas) #endif /* !_ARM_ARCH_6 */ -#ifdef __PROG32 #define SAVE_REGS push {r4-r5} #define RESTORE_REGS pop {r4-r5} -#else -/* Need to save R14_svc because it'll get trampled if we take a page fault. */ -#define SAVE_REGS stmfd sp!, {r4-r6, r14} -#define RESTORE_REGS ldmfd sp!, {r4-r6, r14} -#endif /* * int ucas_32(volatile int32_t *uptr, int32_t old, int32_t new, int32_t *ret); Index: sys/arch/arm/arm/process_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/arm/arm/process_machdep.c,v retrieving revision 1.32 diff -u -p -r1.32 process_machdep.c --- sys/arch/arm/arm/process_machdep.c 16 Mar 2017 16:13:20 -0000 1.32 +++ sys/arch/arm/arm/process_machdep.c 23 Jan 2018 15:28:56 -0000 @@ -193,7 +193,6 @@ process_write_regs(struct lwp *l, const memcpy(&tf->tf_r0, regs->r, sizeof(regs->r)); tf->tf_usr_sp = regs->r_sp; tf->tf_usr_lr = regs->r_lr; -#ifdef __PROG32 tf->tf_pc = regs->r_pc; tf->tf_spsr &= ~(PSR_FLAGS | PSR_T_bit); tf->tf_spsr |= regs->r_cpsr & PSR_FLAGS; @@ -202,12 +201,6 @@ process_write_regs(struct lwp *l, const tf->tf_spsr |= PSR_T_bit; #endif KASSERT(VALID_R15_PSR(tf->tf_pc, tf->tf_spsr)); -#else /* __PROG26 */ - if ((regs->r_pc & (R15_MODE | R15_IRQ_DISABLE | R15_FIQ_DISABLE)) != 0) - return EPERM; - - tf->tf_r15 = regs->r_pc; -#endif return 0; } @@ -233,7 +226,6 @@ process_set_pc(struct lwp *l, void *addr struct trapframe * const tf = lwp_trapframe(l); KASSERT(tf != NULL); -#ifdef __PROG32 tf->tf_pc = (int)addr; #ifdef THUMB_CODE if (((int)addr) & 1) @@ -241,12 +233,6 @@ process_set_pc(struct lwp *l, void *addr else tf->tf_spsr &= ~PSR_T_bit; #endif -#else /* __PROG26 */ - /* Only set the PC, not the PSR */ - if (((register_t)addr & R15_PC) != (register_t)addr) - return EINVAL; - tf->tf_r15 = (tf->tf_r15 & ~R15_PC) | (register_t)addr; -#endif return 0; } Index: sys/arch/arm/arm/sig_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/arm/arm/sig_machdep.c,v retrieving revision 1.49 diff -u -p -r1.49 sig_machdep.c --- sys/arch/arm/arm/sig_machdep.c 24 Mar 2015 08:38:29 -0000 1.49 +++ sys/arch/arm/arm/sig_machdep.c 23 Jan 2018 15:28:56 -0000 @@ -58,9 +58,7 @@ __KERNEL_RCSID(0, "$NetBSD: sig_machdep. #include #include -#ifndef acorn26 #include -#endif void * getframe(struct lwp *l, int sig, int *onstack) @@ -200,10 +198,8 @@ cpu_getmcontext(struct lwp *l, mcontext_ mcp->_mc_tlsbase = (uintptr_t)l->l_private; *flags |= _UC_TLSBASE; -#ifdef __PROG32 const struct pcb * const pcb = lwp_getpcb(l); mcp->_mc_user_tpid = pcb->pcb_user_pid_rw; -#endif } int @@ -273,10 +269,8 @@ cpu_setmcontext(struct lwp *l, const mco l->l_sigstk.ss_flags &= ~SS_ONSTACK; mutex_exit(p->p_lock); -#ifdef __PROG32 struct pcb * const pcb = lwp_getpcb(l); pcb->pcb_user_pid_rw = mcp->_mc_user_tpid; -#endif return (0); } Index: sys/arch/arm/arm/syscall.c =================================================================== RCS file: /cvsroot/src/sys/arch/arm/arm/syscall.c,v retrieving revision 1.63 diff -u -p -r1.63 syscall.c --- sys/arch/arm/arm/syscall.c 18 Jan 2018 14:18:23 -0000 1.63 +++ sys/arch/arm/arm/syscall.c 23 Jan 2018 15:28:56 -0000 @@ -90,10 +90,6 @@ __KERNEL_RCSID(0, "$NetBSD: syscall.c,v #include #include -#ifdef acorn26 -#include -#endif - void swi_handler(trapframe_t *tf) { @@ -105,17 +101,8 @@ swi_handler(trapframe_t *tf) * Since all syscalls *should* come from user mode it will always * be safe to enable them, but check anyway. */ -#ifdef acorn26 - if ((tf->tf_r15 & R15_IRQ_DISABLE) == 0) - int_on(); -#else KASSERT(VALID_R15_PSR(tf->tf_pc, tf->tf_spsr)); restore_interrupts(tf->tf_spsr & IF32_bits); -#endif - -#ifdef acorn26 - tf->tf_pc += INSN_SIZE; -#endif #ifndef THUMB_CODE /* @@ -148,11 +135,7 @@ swi_handler(trapframe_t *tf) else #endif { -#ifdef __PROG32 insn = read_insn(tf->tf_pc - INSN_SIZE, true); -#else - insn = read_insn((tf->tf_r15 & R15_PC) - INSN_SIZE, true); -#endif } KASSERTMSG(tf == lwp_trapframe(l), "tf %p vs %p", tf, lwp_trapframe(l)); @@ -258,11 +241,7 @@ syscall(struct trapframe *tf, lwp_t *l, tf->tf_r0 = rval[0]; tf->tf_r1 = rval[1]; -#ifdef __PROG32 tf->tf_spsr &= ~PSR_C_bit; /* carry bit */ -#else - tf->tf_r15 &= ~R15_FLAG_C; /* carry bit */ -#endif break; case ERESTART: @@ -284,11 +263,7 @@ syscall(struct trapframe *tf, lwp_t *l, default: bad: tf->tf_r0 = error; -#ifdef __PROG32 tf->tf_spsr |= PSR_C_bit; /* carry bit */ -#else - tf->tf_r15 |= R15_FLAG_C; /* carry bit */ -#endif break; } @@ -302,11 +277,7 @@ child_return(void *arg) struct trapframe * const tf = lwp_trapframe(l); tf->tf_r0 = 0; -#ifdef __PROG32 tf->tf_spsr &= ~PSR_C_bit; /* carry bit */ -#else - tf->tf_r15 &= ~R15_FLAG_C; /* carry bit */ -#endif userret(l); ktrsysret(SYS_fork, 0, 0); Index: sys/arch/arm/arm/undefined.c =================================================================== RCS file: /cvsroot/src/sys/arch/arm/arm/undefined.c,v retrieving revision 1.60 diff -u -p -r1.60 undefined.c --- sys/arch/arm/arm/undefined.c 2 Jul 2017 16:16:44 -0000 1.60 +++ sys/arch/arm/arm/undefined.c 23 Jan 2018 15:28:56 -0000 @@ -85,10 +85,6 @@ __KERNEL_RCSID(0, "$NetBSD: undefined.c, #include #endif -#ifdef acorn26 -#include -#endif - static int gdb_trapper(u_int, u_int, struct trapframe *, int); LIST_HEAD(, undefined_handler) undefined_handlers[NUM_UNKNOWN_HANDLERS]; @@ -305,14 +301,8 @@ undefinedinstruction(trapframe_t *tf) #endif /* Enable interrupts if they were enabled before the exception. */ -#ifdef acorn26 - if ((tf->tf_r15 & R15_IRQ_DISABLE) == 0) - int_on(); -#else restore_interrupts(tf->tf_spsr & IF32_bits); -#endif -#ifndef acorn26 #ifdef THUMB_CODE if (tf->tf_spsr & PSR_T_bit) tf->tf_pc -= THUMB_INSN_SIZE; @@ -321,22 +311,13 @@ undefinedinstruction(trapframe_t *tf) { tf->tf_pc -= INSN_SIZE; } -#endif -#ifdef __PROG26 - fault_pc = tf->tf_r15 & R15_PC; -#else fault_pc = tf->tf_pc; -#endif /* Get the current lwp/proc structure or lwp0/proc0 if there is none. */ l = curlwp; -#ifdef __PROG26 - if ((tf->tf_r15 & R15_MODE) == R15_MODE_USR) { -#else if ((tf->tf_spsr & PSR_MODE) == PSR_USR32_MODE) { -#endif user = 1; LWP_CACHE_CREDS(l, l->l_proc); } else Index: sys/arch/arm/arm32/genassym.cf =================================================================== RCS file: /cvsroot/src/sys/arch/arm/arm32/genassym.cf,v retrieving revision 1.76 diff -u -p -r1.76 genassym.cf --- sys/arch/arm/arm32/genassym.cf 12 Jul 2017 09:49:08 -0000 1.76 +++ sys/arch/arm/arm32/genassym.cf 23 Jan 2018 15:28:56 -0000 @@ -168,15 +168,15 @@ define LW_SYSTEM LW_SYSTEM define P_RASLIST offsetof(struct proc, p_raslist) -define PCB_R8 offsetof(struct pcb, pcb_un.un_32.pcb32_r8) -define PCB_R9 offsetof(struct pcb, pcb_un.un_32.pcb32_r9) -define PCB_R10 offsetof(struct pcb, pcb_un.un_32.pcb32_r10) -define PCB_R11 offsetof(struct pcb, pcb_un.un_32.pcb32_r11) -define PCB_R12 offsetof(struct pcb, pcb_un.un_32.pcb32_r12) -define PCB_KSP offsetof(struct pcb, pcb_un.un_32.pcb32_sp) -define PCB_LR offsetof(struct pcb, pcb_un.un_32.pcb32_lr) -define PCB_PC offsetof(struct pcb, pcb_un.un_32.pcb32_pc) -define PCB_USER_PID_RW offsetof(struct pcb, pcb_un.un_32.pcb32_user_pid_rw) +define PCB_R8 offsetof(struct pcb, pcb_r8) +define PCB_R9 offsetof(struct pcb, pcb_r9) +define PCB_R10 offsetof(struct pcb, pcb_r10) +define PCB_R11 offsetof(struct pcb, pcb_r11) +define PCB_R12 offsetof(struct pcb, pcb_r12) +define PCB_KSP offsetof(struct pcb, pcb_sp) +define PCB_LR offsetof(struct pcb, pcb_lr) +define PCB_PC offsetof(struct pcb, pcb_pc) +define PCB_USER_PID_RW offsetof(struct pcb, pcb_user_pid_rw) define PCB_ONFAULT offsetof(struct pcb, pcb_onfault) define PCB_VFP_FPEXC offsetof(struct pcb, pcb_vfp.vfp_fpexc) Index: sys/arch/arm/conf/files.arm =================================================================== RCS file: /cvsroot/src/sys/arch/arm/conf/files.arm,v retrieving revision 1.137 diff -u -p -r1.137 files.arm --- sys/arch/arm/conf/files.arm 17 Jan 2018 20:30:16 -0000 1.137 +++ sys/arch/arm/conf/files.arm 23 Jan 2018 15:28:56 -0000 @@ -198,8 +198,6 @@ file arch/arm/arm/sig_machdep.c file arch/arm/arm/sigcode.S file arch/arm/arm/syscall.c file arch/arm/arm/undefined.c -# vectors.S gets included manually by Makefile.acorn26, since it needs -# to be at the start of the text segment on those machines. file arch/arm/arm/vectors.S arm32 # files common to arm32 implementations Index: sys/arch/arm/include/armreg.h =================================================================== RCS file: /cvsroot/src/sys/arch/arm/include/armreg.h,v retrieving revision 1.116 diff -u -p -r1.116 armreg.h --- sys/arch/arm/include/armreg.h 20 Dec 2017 15:22:14 -0000 1.116 +++ sys/arch/arm/include/armreg.h 23 Jan 2018 15:28:56 -0000 @@ -78,10 +78,6 @@ #define PSR_T_bit (1 << 5) /* Thumb state */ #define PSR_MODE 0x0000001f /* mode mask */ -#define PSR_USR26_MODE 0x00000000 -#define PSR_FIQ26_MODE 0x00000001 -#define PSR_IRQ26_MODE 0x00000002 -#define PSR_SVC26_MODE 0x00000003 #define PSR_USR32_MODE 0x00000010 #define PSR_FIQ32_MODE 0x00000011 #define PSR_IRQ32_MODE 0x00000012 @@ -93,28 +89,6 @@ #define PSR_SYS32_MODE 0x0000001f #define PSR_32_MODE 0x00000010 -#define PSR_IN_USR_MODE(psr) (!((psr) & 3)) /* XXX */ -#define PSR_IN_32_MODE(psr) ((psr) & PSR_32_MODE) - -/* In 26-bit modes, the PSR is stuffed into R15 along with the PC. */ - -#define R15_MODE 0x00000003 -#define R15_MODE_USR 0x00000000 -#define R15_MODE_FIQ 0x00000001 -#define R15_MODE_IRQ 0x00000002 -#define R15_MODE_SVC 0x00000003 - -#define R15_PC 0x03fffffc - -#define R15_FIQ_DISABLE 0x04000000 -#define R15_IRQ_DISABLE 0x08000000 - -#define R15_FLAGS 0xf0000000 -#define R15_FLAG_N 0x80000000 -#define R15_FLAG_Z 0x40000000 -#define R15_FLAG_C 0x20000000 -#define R15_FLAG_V 0x10000000 - /* * Co-processor 15: The system control co-processor. */ Index: sys/arch/arm/include/cpu.h =================================================================== RCS file: /cvsroot/src/sys/arch/arm/include/cpu.h,v retrieving revision 1.94 diff -u -p -r1.94 cpu.h --- sys/arch/arm/include/cpu.h 16 Dec 2017 00:37:51 -0000 1.94 +++ sys/arch/arm/include/cpu.h 23 Jan 2018 15:28:56 -0000 @@ -88,11 +88,7 @@ extern int cpu_fpu_present; * CLKF_USERMODE: Return TRUE/FALSE (1/0) depending on whether the * frame came from USR mode or not. */ -#ifdef __PROG32 #define CLKF_USERMODE(cf) (((cf)->cf_tf.tf_spsr & PSR_MODE) == PSR_USR32_MODE) -#else -#define CLKF_USERMODE(cf) (((cf)->cf_if.if_r15 & R15_MODE) == R15_MODE_USR) -#endif /* * CLKF_INTR: True if we took the interrupt from inside another @@ -110,20 +106,12 @@ extern int cpu_fpu_present; /* * CLKF_PC: Extract the program counter from a clockframe */ -#ifdef __PROG32 #define CLKF_PC(frame) (frame->cf_tf.tf_pc) -#else -#define CLKF_PC(frame) (frame->cf_if.if_r15 & R15_PC) -#endif /* * LWP_PC: Find out the program counter for the given lwp. */ -#ifdef __PROG32 #define LWP_PC(l) (lwp_trapframe(l)->tf_pc) -#else -#define LWP_PC(l) (lwp_trapframe(l)->tf_r15 & R15_PC) -#endif /* * Per-CPU information. For now we assume one CPU. @@ -275,11 +263,7 @@ cpu_dosoftints(void) #endif } -#ifdef __PROG32 void cpu_proc_fork(struct proc *, struct proc *); -#else -#define cpu_proc_fork(p1, p2) -#endif /* * Scheduling glue @@ -315,12 +299,10 @@ void cpu_set_curpri(int); */ vaddr_t cpu_uarea_alloc_idlelwp(struct cpu_info *); -#ifndef acorn26 /* * cpu device glue (belongs in cpuvar.h) */ void cpu_attach(device_t, cpuid_t); -#endif #endif /* !_LOCORE */ Index: sys/arch/arm/include/cpufunc.h =================================================================== RCS file: /cvsroot/src/sys/arch/arm/include/cpufunc.h,v retrieving revision 1.77 diff -u -p -r1.77 cpufunc.h --- sys/arch/arm/include/cpufunc.h 16 Jul 2016 01:49:42 -0000 1.77 +++ sys/arch/arm/include/cpufunc.h 23 Jan 2018 15:28:56 -0000 @@ -245,7 +245,6 @@ u_int cpufunc_faultaddress (void); /* * Macros for manipulating CPU interrupts */ -#ifdef __PROG32 static __inline uint32_t __set_cpsr_c(uint32_t bic, uint32_t eor) __attribute__((__unused__)); static __inline uint32_t disable_interrupts(uint32_t mask) __attribute__((__unused__)); static __inline uint32_t enable_interrupts(uint32_t mask) __attribute__((__unused__)); @@ -360,28 +359,10 @@ cpsid(register_t psw) #endif } -#else /* ! __PROG32 */ -#define disable_interrupts(mask) \ - (set_r15((mask) & (R15_IRQ_DISABLE | R15_FIQ_DISABLE), \ - (mask) & (R15_IRQ_DISABLE | R15_FIQ_DISABLE))) - -#define enable_interrupts(mask) \ - (set_r15((mask) & (R15_IRQ_DISABLE | R15_FIQ_DISABLE), 0)) - -#define restore_interrupts(old_r15) \ - (set_r15((R15_IRQ_DISABLE | R15_FIQ_DISABLE), \ - (old_r15) & (R15_IRQ_DISABLE | R15_FIQ_DISABLE))) -#endif /* __PROG32 */ -#ifdef __PROG32 /* Functions to manipulate the CPSR. */ u_int SetCPSR(u_int, u_int); u_int GetCPSR(void); -#else -/* Functions to manipulate the processor control bits in r15. */ -u_int set_r15(u_int, u_int); -u_int get_r15(void); -#endif /* __PROG32 */ /* Index: sys/arch/arm/include/db_machdep.h =================================================================== RCS file: /cvsroot/src/sys/arch/arm/include/db_machdep.h,v retrieving revision 1.25 diff -u -p -r1.25 db_machdep.h --- sys/arch/arm/include/db_machdep.h 6 Nov 2017 03:47:45 -0000 1.25 +++ sys/arch/arm/include/db_machdep.h 23 Jan 2018 15:28:57 -0000 @@ -57,13 +57,8 @@ extern db_regs_t *ddb_regp; #define ddb_regs (*ddb_regp) #endif -#ifdef __PROG26 -#define PC_REGS(regs) ((regs)->tf_r15 & R15_PC) -#define PC_ADVANCE(regs) ((regs)->tf_r15 += BKPT_SIZE) -#else #define PC_REGS(regs) ((regs)->tf_pc) #define PC_ADVANCE(r) ((r)->tf_r15 += BKPT_SIZE) -#endif #define BKPT_ADDR(addr) (addr) /* breakpoint address */ #if defined(DDB) Index: sys/arch/arm/include/frame.h =================================================================== RCS file: /cvsroot/src/sys/arch/arm/include/frame.h,v retrieving revision 1.19 diff -u -p -r1.19 frame.h --- sys/arch/arm/include/frame.h 25 Apr 2017 09:01:38 -0000 1.19 +++ sys/arch/arm/include/frame.h 23 Jan 2018 15:28:57 -0000 @@ -79,11 +79,7 @@ typedef struct trapframe { #define tf_r14 tf_usr_lr #define tf_r15 tf_pc -#ifdef __PROG32 #define TRAP_USERMODE(tf) (((tf)->tf_spsr & PSR_MODE) == PSR_USR32_MODE) -#elif defined(__PROG26) -#define TRAP_USERMODE(tf) (((tf)->tf_r15 & R15_MODE) == R15_MODE_USR) -#endif /* * Signal frame. Pushed onto user stack before calling sigcode. Index: sys/arch/arm/include/locore.h =================================================================== RCS file: /cvsroot/src/sys/arch/arm/include/locore.h,v retrieving revision 1.28 diff -u -p -r1.28 locore.h --- sys/arch/arm/include/locore.h 24 Aug 2017 14:19:36 -0000 1.28 +++ sys/arch/arm/include/locore.h 23 Jan 2018 15:28:57 -0000 @@ -66,7 +66,7 @@ #if defined(_ARM_ARCH_6) #define IRQdisable cpsid i #define IRQenable cpsie i -#elif defined(__PROG32) +#else #define IRQdisable \ stmfd sp!, {r0} ; \ mrs r0, cpsr ; \ @@ -80,8 +80,6 @@ bic r0, r0, #(I32_bit) ; \ msr cpsr_c, r0 ; \ ldmfd sp!, {r0} -#else -/* Not yet used in 26-bit code */ #endif #if defined (TPIDRPRW_IS_CURCPU) @@ -106,20 +104,14 @@ #include -#ifdef __PROG32 #define IRQdisable __set_cpsr_c(I32_bit, I32_bit); #define IRQenable __set_cpsr_c(I32_bit, 0); -#else -#define IRQdisable set_r15(R15_IRQ_DISABLE, R15_IRQ_DISABLE); -#define IRQenable set_r15(R15_IRQ_DISABLE, 0); -#endif /* * Validate a PC or PSR for a user process. Used by various system calls * that take a context passed by the user and restore it. */ -#ifdef __PROG32 #ifdef __NO_FIQ #define VALID_R15_PSR(r15,psr) \ (((psr) & PSR_MODE) == PSR_USR32_MODE && ((psr) & I32_bit) == 0) @@ -127,11 +119,6 @@ #define VALID_R15_PSR(r15,psr) \ (((psr) & PSR_MODE) == PSR_USR32_MODE && ((psr) & IF32_bits) == 0) #endif -#else -#define VALID_R15_PSR(r15,psr) \ - (((r15) & R15_MODE) == R15_MODE_USR && \ - ((r15) & (R15_IRQ_DISABLE | R15_FIQ_DISABLE)) == 0) -#endif /* * Translation Table Base Register Share/Cache settings @@ -141,7 +128,6 @@ /* The address of the vector page. */ extern vaddr_t vector_page; -#ifdef __PROG32 void arm32_vector_init(vaddr_t, int); #define ARM_VEC_RESET (1 << 0) @@ -155,14 +141,11 @@ void arm32_vector_init(vaddr_t, int); #define ARM_NVEC 8 #define ARM_VEC_ALL 0xffffffff -#endif /* __PROG32 */ -#ifndef acorn26 /* * cpu device glue (belongs in cpuvar.h) */ void cpu_attach(device_t, cpuid_t); -#endif /* 1 == use cpu_sleep(), 0 == don't */ extern int cpu_do_powersave; Index: sys/arch/arm/include/pcb.h =================================================================== RCS file: /cvsroot/src/sys/arch/arm/include/pcb.h,v retrieving revision 1.27 diff -u -p -r1.27 pcb.h --- sys/arch/arm/include/pcb.h 11 Jan 2013 14:04:55 -0000 1.27 +++ sys/arch/arm/include/pcb.h 23 Jan 2018 15:28:57 -0000 @@ -41,55 +41,30 @@ #include #include -struct pcb_arm32 { +#define pcb_ksp pcb_sp + +struct pcb { /* * WARNING! - * cpuswitchto.S relies on pcb32_r8 being quad-aligned in struct pcb + * cpuswitchto.S relies on pcb_r8 being quad-aligned * (due to the use of "strd" when compiled for XSCALE) */ - u_int pcb32_r8 __aligned(8); /* used */ - u_int pcb32_r9; /* used */ - u_int pcb32_r10; /* used */ - u_int pcb32_r11; /* used */ - u_int pcb32_r12; /* used */ - u_int pcb32_sp; /* used */ - u_int pcb32_lr; - u_int pcb32_pc; + u_int pcb_r8 __aligned(8); /* used */ + u_int pcb_r9; /* used */ + u_int pcb_r10; /* used */ + u_int pcb_r11; /* used */ + u_int pcb_r12; /* used */ + u_int pcb_sp; /* used */ + u_int pcb_lr; + u_int pcb_pc; /* * ARMv6 has two user thread/process id registers which can hold * any 32bit quanttiies. */ - u_int pcb32_user_pid_rw; /* p15, 0, Rd, c13, c0, 2 */ - u_int pcb32_user_pid_ro; /* p15, 0, Rd, c13, c0, 3 */ -}; -#define pcb_pagedir pcb_un.un_32.pcb32_pagedir -#define pcb_pl1vec pcb_un.un_32.pcb32_pl1vec -#define pcb_l1vec pcb_un.un_32.pcb32_l1vec -#define pcb_dacr pcb_un.un_32.pcb32_dacr -#define pcb_cstate pcb_un.un_32.pcb32_cstate -#define pcb_user_pid_rw pcb_un.un_32.pcb32_user_pid_rw -#ifdef __PROG32 -#define pcb_ksp pcb_un.un_32.pcb32_sp -#endif - -struct pcb_arm26 { - struct switchframe *pcb26_sf; -}; -#define pcb_sf pcb_un.un_26.pcb26_sf -#ifdef __PROG26 -#define pcb_ksp pcb_sf.sf_r13 -#endif + u_int pcb_user_pid_rw; /* p15, 0, Rd, c13, c0, 2 */ + u_int pcb_user_pid_ro; /* p15, 0, Rd, c13, c0, 3 */ -/* - * WARNING! - * See warning for struct pcb_arm32, above, before changing struct pcb! - */ -struct pcb { - union { - struct pcb_arm32 un_32; - struct pcb_arm26 un_26; - } pcb_un; void * pcb_onfault; /* On fault handler */ struct vfpreg pcb_vfp; /* VFP registers */ struct vfpreg pcb_kernel_vfp; /* kernel VFP state */ Index: sys/arch/arm/include/profile.h =================================================================== RCS file: /cvsroot/src/sys/arch/arm/include/profile.h,v retrieving revision 1.17 diff -u -p -r1.17 profile.h --- sys/arch/arm/include/profile.h 11 Jan 2015 20:52:57 -0000 1.17 +++ sys/arch/arm/include/profile.h 23 Jan 2018 15:28:57 -0000 @@ -169,12 +169,6 @@ #endif #ifdef _KERNEL -#ifdef __PROG26 -extern int int_off_save(void); -extern void int_restore(int); -#define MCOUNT_ENTER (s = int_off_save()) -#define MCOUNT_EXIT int_restore(s) -#else #include /* * splhigh() and splx() are heavyweight, and call mcount(). Therefore @@ -184,5 +178,4 @@ extern void int_restore(int); */ #define MCOUNT_ENTER s = __set_cpsr_c(0x0080, 0x0080); /* kill IRQ */ #define MCOUNT_EXIT __set_cpsr_c(0xffffffff, s); /* restore old value */ -#endif /* !acorn26 */ #endif /* _KERNEL */ Index: sys/arch/arm/include/arm26/Makefile =================================================================== RCS file: sys/arch/arm/include/arm26/Makefile diff -N sys/arch/arm/include/arm26/Makefile --- sys/arch/arm/include/arm26/Makefile 26 Nov 2002 23:30:12 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,7 +0,0 @@ -# $NetBSD: Makefile,v 1.2 2002/11/26 23:30:12 lukem Exp $ - -INCSDIR= /usr/include/arm/arm26 - -INCS= types.h - -.include Index: sys/arch/arm/include/arm26/types.h =================================================================== RCS file: sys/arch/arm/include/arm26/types.h diff -N sys/arch/arm/include/arm26/types.h --- sys/arch/arm/include/arm26/types.h 22 Nov 2001 17:59:57 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,47 +0,0 @@ -/* $NetBSD: types.h,v 1.1 2001/11/22 17:59:57 thorpej Exp $ */ - -/* - * Copyright (c) 2001 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Jason R. Thorpe for Wasabi Systems, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * 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 for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC - * 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. - */ - -#ifndef _ARM_ARM26_TYPES_H_ -#define _ARM_ARM26_TYPES_H_ - -#ifdef _KERNEL -#define __PROG26 /* indicate 26-bit mode */ -#endif - -#include /* pull in generic ARM definitions */ - -#endif /* _ARM_ARM26_TYPES_H_ */ Index: sys/arch/arm/include/arm32/pmap.h =================================================================== RCS file: /cvsroot/src/sys/arch/arm/include/arm32/pmap.h,v retrieving revision 1.153 diff -u -p -r1.153 pmap.h --- sys/arch/arm/include/arm32/pmap.h 22 Oct 2017 20:35:32 -0000 1.153 +++ sys/arch/arm/include/arm32/pmap.h 23 Jan 2018 15:28:57 -0000 @@ -396,8 +396,6 @@ int pmap_fault_fixup(pmap_t, vaddr_t, vm int pmap_prefetchabt_fixup(void *); bool pmap_get_pde_pte(pmap_t, vaddr_t, pd_entry_t **, pt_entry_t **); bool pmap_get_pde(pmap_t, vaddr_t, pd_entry_t **); -struct pcb; -void pmap_set_pcb_pagedir(pmap_t, struct pcb *); void pmap_debug(int); void pmap_postinit(void); Index: sys/arch/arm/include/arm32/types.h =================================================================== RCS file: /cvsroot/src/sys/arch/arm/include/arm32/types.h,v retrieving revision 1.11 diff -u -p -r1.11 types.h --- sys/arch/arm/include/arm32/types.h 7 May 2013 23:01:55 -0000 1.11 +++ sys/arch/arm/include/arm32/types.h 23 Jan 2018 15:28:57 -0000 @@ -39,7 +39,6 @@ #define _ARM_ARM32_TYPES_H_ #ifdef _KERNEL -#define __PROG32 /* indicate 32-bit mode */ #ifdef _KERNEL_OPT #include "opt_arm32_pmap.h" Index: sys/arch/arm/xscale/becc_intr.h =================================================================== RCS file: /cvsroot/src/sys/arch/arm/xscale/becc_intr.h,v retrieving revision 1.6 diff -u -p -r1.6 becc_intr.h --- sys/arch/arm/xscale/becc_intr.h 5 Feb 2014 19:03:45 -0000 1.6 +++ sys/arch/arm/xscale/becc_intr.h 23 Jan 2018 15:28:57 -0000 @@ -45,7 +45,6 @@ #include #include -#ifdef __PROG32 static inline void __attribute__((__unused__)) becc_set_intrmask(void) { @@ -103,7 +102,6 @@ becc_spllower(int ipl) becc_splx(becc_imask[ipl]); return (old); } -#endif /* __PROG32 */ #if !defined(EVBARM_SPL_NOINLINE) Index: sys/arch/arm/xscale/i80321_intr.h =================================================================== RCS file: /cvsroot/src/sys/arch/arm/xscale/i80321_intr.h,v retrieving revision 1.11 diff -u -p -r1.11 i80321_intr.h --- sys/arch/arm/xscale/i80321_intr.h 4 Feb 2014 18:51:16 -0000 1.11 +++ sys/arch/arm/xscale/i80321_intr.h 23 Jan 2018 15:28:57 -0000 @@ -49,7 +49,6 @@ #include -#ifdef __PROG32 static inline void __attribute__((__unused__)) i80321_set_intrmask(void) { @@ -112,7 +111,6 @@ i80321_spllower(int ipl) return(old); } -#endif /* __PROG32 */ #if !defined(EVBARM_SPL_NOINLINE) Index: sys/arch/arm/xscale/pxa2x0_intr.h =================================================================== RCS file: /cvsroot/src/sys/arch/arm/xscale/pxa2x0_intr.h,v retrieving revision 1.14 diff -u -p -r1.14 pxa2x0_intr.h --- sys/arch/arm/xscale/pxa2x0_intr.h 4 Feb 2014 18:51:16 -0000 1.14 +++ sys/arch/arm/xscale/pxa2x0_intr.h 23 Jan 2018 15:28:57 -0000 @@ -59,7 +59,6 @@ extern vaddr_t pxaic_base; /* Shared wi extern volatile int intr_mask; extern int pxa2x0_imask[]; -#ifdef __PROG32 /* * Cotulla's integrated ICU doesn't have IRQ0..7, so @@ -129,7 +128,6 @@ find_first_bit(uint32_t bits) return 31 - __builtin_clz(bits); } -#endif /* __PROG32 */ int _splraise(int); int _spllower(int); Index: sys/arch/iyonix/TODO =================================================================== RCS file: /cvsroot/src/sys/arch/iyonix/TODO,v retrieving revision 1.2 diff -u -p -r1.2 TODO --- sys/arch/iyonix/TODO 11 Dec 2005 12:17:51 -0000 1.2 +++ sys/arch/iyonix/TODO 23 Jan 2018 15:28:58 -0000 @@ -12,5 +12,5 @@ TODO list for NetBSD/iyonix: * RISC OS compatibility * Share more code with other ARM ports -* Share bootloader with acorn32/acorn26 +* Share bootloader with acorn32 Index: sys/arch/usermode/usermode/vm_machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/usermode/usermode/vm_machdep.c,v retrieving revision 1.4 diff -u -p -r1.4 vm_machdep.c --- sys/arch/usermode/usermode/vm_machdep.c 27 Dec 2011 14:55:31 -0000 1.4 +++ sys/arch/usermode/usermode/vm_machdep.c 23 Jan 2018 15:29:00 -0000 @@ -41,7 +41,7 @@ __KERNEL_RCSID(0, "$NetBSD: vm_machdep.c * Note: the pages are already locked by uvm_vslock(), so we * do not need to pass an access_type to pmap_enter(). */ -/* This code was originally stolen from the alpha/acorn26 port. */ +/* This code was originally stolen from the alpha port. */ int vmapbuf(struct buf *bp, vsize_t len) Index: sys/compat/linux/arch/arm/linux_sys_machdep.c =================================================================== RCS file: /cvsroot/src/sys/compat/linux/arch/arm/linux_sys_machdep.c,v retrieving revision 1.14 diff -u -p -r1.14 linux_sys_machdep.c --- sys/compat/linux/arch/arm/linux_sys_machdep.c 7 Jul 2010 01:30:33 -0000 1.14 +++ sys/compat/linux/arch/arm/linux_sys_machdep.c 23 Jan 2018 15:29:00 -0000 @@ -59,7 +59,6 @@ linux_sys_breakpoint(struct lwp *l, cons int linux_sys_cacheflush(struct lwp *l, const struct linux_sys_cacheflush_args *uap, register_t *retval) { -#ifndef acorn26 /* { syscallarg(uintptr_t) from; syscallarg(uintptr_t) to; @@ -68,7 +67,6 @@ linux_sys_cacheflush(struct lwp *l, cons cpu_icache_sync_range(SCARG(uap, from), SCARG(uap, to) - SCARG(uap, from) + 1); -#endif *retval = 0; return 0; } Index: sys/dev/ic/ncr5380var.h =================================================================== RCS file: /cvsroot/src/sys/dev/ic/ncr5380var.h,v retrieving revision 1.33 diff -u -p -r1.33 ncr5380var.h --- sys/dev/ic/ncr5380var.h 28 Jul 2012 00:43:23 -0000 1.33 +++ sys/dev/ic/ncr5380var.h 23 Jan 2018 15:29:00 -0000 @@ -38,14 +38,14 @@ */ /* - * Currently acorn26, amd64, alpha, i386, mips, news68k, sparc, sun2, and vax + * Currently amd64, alpha, i386, mips, news68k, sparc, sun2, and vax * use real bus space: * acorn32: csa driver; easy to convert * mac68k: sbc driver; easy to convert * pc532: ncr driver; need bus.h first * sun3: si driver; need bus.h first */ -#if defined(acorn26) || \ +#if \ defined(__alpha__) || \ defined(__amd64__) || \ defined(__i386__) || \ Index: sys/modules/Makefile.assym =================================================================== RCS file: /cvsroot/src/sys/modules/Makefile.assym,v retrieving revision 1.5 diff -u -p -r1.5 Makefile.assym --- sys/modules/Makefile.assym 11 May 2015 21:26:41 -0000 1.5 +++ sys/modules/Makefile.assym 23 Jan 2018 15:29:03 -0000 @@ -12,12 +12,8 @@ CPPFLAGS+= -DPPC_OEA .endif .if (!empty(MACHINE_ARCH:Mearm*) || !empty(MACHINE_ARCH:Marm*)) -.if ${MACHINE} == "acorn26" -GENASSYM_DIR= $S/arch/acorn26/acorn26 -.else GENASSYM_DIR= $S/arch/arm/arm32 .endif -.endif .if exists($S/arch/${MACHINE}/${MACHINE}/genassym.cf) GENASSYM_DIR?= $S/arch/${MACHINE}/${MACHINE} Index: sys/sys/mman.h =================================================================== RCS file: /cvsroot/src/sys/sys/mman.h,v retrieving revision 1.52 diff -u -p -r1.52 mman.h --- sys/sys/mman.h 6 May 2017 21:34:52 -0000 1.52 +++ sys/sys/mman.h 23 Jan 2018 15:29:04 -0000 @@ -104,7 +104,7 @@ typedef __off_t off_t; /* file offset /* * Alignment (expressed in log2). Must be >= log2(PAGE_SIZE) and - * < # bits in a pointer (26 (acorn26), 32 or 64). + * < # bits in a pointer (32 or 64). */ #define MAP_ALIGNED(n) ((n) << MAP_ALIGNMENT_SHIFT) #define MAP_ALIGNMENT_SHIFT 24 Index: tools/headerlist =================================================================== RCS file: /cvsroot/src/tools/headerlist,v retrieving revision 1.14 diff -u -p -r1.14 headerlist --- tools/headerlist 23 Feb 2016 11:43:57 -0000 1.14 +++ tools/headerlist 23 Jan 2018 15:29:04 -0000 @@ -5,8 +5,6 @@ ./aarch64/include/disklabel.h ./aarch64/include/elf_machdep.h -./acorn26/include/disklabel.h -./acorn26/include/elf_machdep.h ./acorn32/include/disklabel.h ./acorn32/include/elf_machdep.h ./algor/include/disklabel.h Index: usr.sbin/crash/Makefile =================================================================== RCS file: /cvsroot/src/usr.sbin/crash/Makefile,v retrieving revision 1.37 diff -u -p -r1.37 Makefile --- usr.sbin/crash/Makefile 21 Jul 2017 20:58:44 -0000 1.37 +++ usr.sbin/crash/Makefile 23 Jan 2018 15:29:05 -0000 @@ -18,7 +18,7 @@ DPADD+= ${LIBUTIL} ${LIBKVM} ${LIBEDIT} || ${MACHINE} == "i386" \ || ${MACHINE} == "sparc" \ || ${MACHINE} == "sparc64" \ - || (${MACHINE_CPU} == "arm" && ${MACHINE} != "acorn26") \ + || ${MACHINE_CPU} == "arm" \ || ${MACHINE_ARCH} == "m68k" SRCS+= db_trace.c .if ${MACHINE_ARCH} != "m68k" Index: usr.sbin/sysinst/Makefile =================================================================== RCS file: /cvsroot/src/usr.sbin/sysinst/Makefile,v retrieving revision 1.2 diff -u -p -r1.2 Makefile --- usr.sbin/sysinst/Makefile 26 Jul 2014 19:56:30 -0000 1.2 +++ usr.sbin/sysinst/Makefile 23 Jan 2018 15:29:05 -0000 @@ -12,7 +12,6 @@ SUBDIR+=arch/dummy .if ALL_MACHINES -SUBDIR = arch/acorn26 SUBDIR += arch/acorn32 SUBDIR += arch/alpha SUBDIR += arch/amd64 Index: usr.sbin/sysinst/arch/acorn26/Makefile =================================================================== RCS file: usr.sbin/sysinst/arch/acorn26/Makefile diff -N usr.sbin/sysinst/arch/acorn26/Makefile --- usr.sbin/sysinst/arch/acorn26/Makefile 26 Jul 2014 19:30:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,8 +0,0 @@ -# $NetBSD: Makefile,v 1.1 2014/07/26 19:30:44 dholland Exp $ -# -# Makefile for acorn26 -# - -MD_OPTIONS= AOUT2ELF - -.include "../../Makefile.inc" Index: usr.sbin/sysinst/arch/acorn26/md.c =================================================================== RCS file: usr.sbin/sysinst/arch/acorn26/md.c diff -N usr.sbin/sysinst/arch/acorn26/md.c --- usr.sbin/sysinst/arch/acorn26/md.c 26 Jul 2014 19:30:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,5 +0,0 @@ -/* $NetBSD: md.c,v 1.1 2014/07/26 19:30:44 dholland Exp $ */ - -/* md.c -- Machine specific code for acorn26 */ - -#include "../acorn32/md.c" Index: usr.sbin/sysinst/arch/acorn26/md.h =================================================================== RCS file: usr.sbin/sysinst/arch/acorn26/md.h diff -N usr.sbin/sysinst/arch/acorn26/md.h --- usr.sbin/sysinst/arch/acorn26/md.h 26 Jul 2014 19:30:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,69 +0,0 @@ -/* $NetBSD: md.h,v 1.1 2014/07/26 19:30:44 dholland Exp $ */ - -/* - * Copyright 1997 Piermont Information Systems Inc. - * All rights reserved. - * - * Based on code written by Philip A. Nelson for Piermont Information - * Systems Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of Piermont Information Systems Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``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 PIERMONT INFORMATION SYSTEMS INC. 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. - * - */ - -/* md.h -- Machine specific definitions for the acorn26 */ - -/* Constants and defines */ - -/* Megs required for a full X installation. */ -#define XNEEDMB 60 - -#define PART_REST PART_D -#define PART_USR PART_E -#define PART_FIRST_FREE PART_F - -/* - * Default filesets to fetch and install during installation - * or upgrade. The standard sets are: - * base etc comp games man misc tests text xbase xcomp xetc xfont xserver - */ - -#define SET_KERNEL_1_NAME "kern-GENERIC" -#define SET_KERNEL_2_NAME "kern-FOURMEG" - -/* - * Machine-specific command to write a new label to a disk. - * For example, acorn32 uses "/sbin/disklabel -w -r", just like acorn32 - * miniroot scripts, though this may leave a bogus incore label. - * Sun ports should probably use DISKLABEL_CMD "/sbin/disklabel -w" - * to get incore to ondisk inode translation for the Sun proms. - * If not defined, we assume the port does not support disklabels and - * hand-edited disklabel will NOT be written by MI code. - */ -#define DISKLABEL_CMD "disklabel -w -r" - -/* - * prototypes for MD code. - */ Index: usr.sbin/sysinst/arch/acorn26/menus.md.en =================================================================== RCS file: usr.sbin/sysinst/arch/acorn26/menus.md.en diff -N usr.sbin/sysinst/arch/acorn26/menus.md.en --- usr.sbin/sysinst/arch/acorn26/menus.md.en 26 Jul 2014 19:30:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,37 +0,0 @@ -/* $NetBSD: menus.md.en,v 1.1 2014/07/26 19:30:44 dholland Exp $ */ - -/* - * Copyright 1997 Piermont Information Systems Inc. - * All rights reserved. - * - * Based on code written by Philip A. Nelson for Piermont Information - * Systems Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of Piermont Information Systems Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``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 PIERMONT INFORMATION SYSTEMS INC. 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. - * - */ - -/* acorn26 machine dependent menus, english */ - Index: usr.sbin/sysinst/arch/acorn26/menus.md.es =================================================================== RCS file: usr.sbin/sysinst/arch/acorn26/menus.md.es diff -N usr.sbin/sysinst/arch/acorn26/menus.md.es --- usr.sbin/sysinst/arch/acorn26/menus.md.es 26 Jul 2014 19:30:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,37 +0,0 @@ -/* $NetBSD: menus.md.es,v 1.1 2014/07/26 19:30:44 dholland Exp $ */ - -/* - * Copyright 1997 Piermont Information Systems Inc. - * All rights reserved. - * - * Based on code written by Philip A. Nelson for Piermont Information - * Systems Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of Piermont Information Systems Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``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 PIERMONT INFORMATION SYSTEMS INC. 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. - * - */ - -/* acorn26 machine dependent menus, spanish */ - Index: usr.sbin/sysinst/arch/acorn26/menus.md.fr =================================================================== RCS file: usr.sbin/sysinst/arch/acorn26/menus.md.fr diff -N usr.sbin/sysinst/arch/acorn26/menus.md.fr --- usr.sbin/sysinst/arch/acorn26/menus.md.fr 26 Jul 2014 19:30:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,37 +0,0 @@ -/* $NetBSD: menus.md.fr,v 1.1 2014/07/26 19:30:44 dholland Exp $ */ - -/* - * Copyright 1997 Piermont Information Systems Inc. - * All rights reserved. - * - * Based on code written by Philip A. Nelson for Piermont Information - * Systems Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of Piermont Information Systems Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``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 PIERMONT INFORMATION SYSTEMS INC. 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. - * - */ - -/* acorn26 machine dependent menus, french */ - Index: usr.sbin/sysinst/arch/acorn26/menus.md.pl =================================================================== RCS file: usr.sbin/sysinst/arch/acorn26/menus.md.pl diff -N usr.sbin/sysinst/arch/acorn26/menus.md.pl --- usr.sbin/sysinst/arch/acorn26/menus.md.pl 26 Jul 2014 19:30:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,39 +0,0 @@ -/* $NetBSD: menus.md.pl,v 1.1 2014/07/26 19:30:44 dholland Exp $ */ -/* Based on english version: */ -/* NetBSD: menus.md.en,v 1.3 2002/02/14 15:28:31 reinoud Exp */ - -/* - * Copyright 1997 Piermont Information Systems Inc. - * All rights reserved. - * - * Based on code written by Philip A. Nelson for Piermont Information - * Systems Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of Piermont Information Systems Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``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 PIERMONT INFORMATION SYSTEMS INC. 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. - * - */ - -/* acorn26 machine dependent menus, Polish */ - Index: usr.sbin/sysinst/arch/acorn26/msg.md.de =================================================================== RCS file: usr.sbin/sysinst/arch/acorn26/msg.md.de diff -N usr.sbin/sysinst/arch/acorn26/msg.md.de --- usr.sbin/sysinst/arch/acorn26/msg.md.de 26 Jul 2014 19:30:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,78 +0,0 @@ -/* $NetBSD: msg.md.de,v 1.1 2014/07/26 19:30:44 dholland Exp $ */ - -/* - * Copyright 1997 Piermont Information Systems Inc. - * All rights reserved. - * - * Based on code written by Philip A. Nelson for Piermont Information - * Systems Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of Piermont Information Systems Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``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 PIERMONT INFORMATION SYSTEMS INC. 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. - * - */ - -/* acorn26 machine dependent messages, German */ - - -message md_hello -{ -} - -message md_may_remove_boot_medium -{Wenn Sie von einer Diskette gebootet haben, können Sie diese jetzt -enfernen. -} - -message badreadbb -{Kann den Bootblock des Filecores nicht lesen -} - -message badreadriscix -{Kann die RISCiX Partitionstabelle nicht lesen -} - -message notnetbsdriscix -{Keine NetBSD Partition in der RISCiX Partitionstabelle gefunden - erstellen -eines Labels nicht möglich. -} - -message notnetbsd -{Keine NetBSD Partition gefunden (eine Nur-Filecore Platte?) - erstellen eines -Labels nicht möglich. -} - -message dobootblks -{Installiere die Bootblöcke auf %s ... -} - -message set_kernel_1 -{Kernel (GENERIC)} -message set_kernel_2 -{Kernel (GENERIC_FOURMEG)} - - -message arm32fspart -{Dies sind die NetBSD Partitionen auf %s (Größe und Offset in %s): -} Index: usr.sbin/sysinst/arch/acorn26/msg.md.en =================================================================== RCS file: usr.sbin/sysinst/arch/acorn26/msg.md.en diff -N usr.sbin/sysinst/arch/acorn26/msg.md.en --- usr.sbin/sysinst/arch/acorn26/msg.md.en 26 Jul 2014 19:30:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,75 +0,0 @@ -/* $NetBSD: msg.md.en,v 1.1 2014/07/26 19:30:44 dholland Exp $ */ - -/* - * Copyright 1997 Piermont Information Systems Inc. - * All rights reserved. - * - * Based on code written by Philip A. Nelson for Piermont Information - * Systems Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of Piermont Information Systems Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``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 PIERMONT INFORMATION SYSTEMS INC. 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. - * - */ - -/* acorn26 machine dependent messages, english */ - - -message md_hello -{ -} - -message md_may_remove_boot_medium -{If you booted from a floppy, you may now remove the disk. -} - -message badreadbb -{Cannot read filecore boot block -} - -message badreadriscix -{Cannot read RISCiX partition table -} - -message notnetbsdriscix -{No NetBSD partition found in RISCiX partition table - Cannot label -} - -message notnetbsd -{No NetBSD partition found (filecore only disk ?) - Cannot label -} - -message dobootblks -{Installing boot blocks on %s.... -} - -message set_kernel_1 -{Kernel (GENERIC)} -message set_kernel_2 -{Kernel (GENERIC_FOURMEG)} - - -message arm32fspart -{We now have your NetBSD partitions on %s as follows (Size and Offset in %s): -} Index: usr.sbin/sysinst/arch/acorn26/msg.md.es =================================================================== RCS file: usr.sbin/sysinst/arch/acorn26/msg.md.es diff -N usr.sbin/sysinst/arch/acorn26/msg.md.es --- usr.sbin/sysinst/arch/acorn26/msg.md.es 26 Jul 2014 19:30:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,78 +0,0 @@ -/* $NetBSD: msg.md.es,v 1.1 2014/07/26 19:30:44 dholland Exp $ */ - -/* - * Copyright 1997 Piermont Information Systems Inc. - * All rights reserved. - * - * Based on code written by Philip A. Nelson for Piermont Information - * Systems Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of Piermont Information Systems Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``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 PIERMONT INFORMATION SYSTEMS INC. 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. - * - */ - -/* acorn26 machine dependent messages, english */ - - -message md_hello -{ -} - -message md_may_remove_boot_medium -{Si ha iniciado desde disquette, ahora debería retirar el disco. -} - -message badreadbb -{No se puede leer bloque de arranque filecore -} - -message badreadriscix -{No se puede leer la tabla de particiones RISCiX -} - -message notnetbsdriscix -{No se ha encontrado ninguna partición NetBSD en la tabla de -particiones RISCiX - No se puede etiquetar -} - -message notnetbsd -{No se ha encontrado ninguna partición NetBSD (¿disco solo de filecore?) - - No se puede etiquetar -} - -message dobootblks -{Instalando bloques de arranque en %s... -} - -message set_kernel_1 -{Nucleo (GENERIC)} -message set_kernel_2 -{Nucleo (GENERIC_FOURMEG)} - - -message arm32fspart -{Ahora tenemos nuestras particiones NetBSD en % como sigue (Tamaño y -Compensación en %s): -} Index: usr.sbin/sysinst/arch/acorn26/msg.md.fr =================================================================== RCS file: usr.sbin/sysinst/arch/acorn26/msg.md.fr diff -N usr.sbin/sysinst/arch/acorn26/msg.md.fr --- usr.sbin/sysinst/arch/acorn26/msg.md.fr 26 Jul 2014 19:30:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,77 +0,0 @@ -/* $NetBSD: msg.md.fr,v 1.1 2014/07/26 19:30:44 dholland Exp $ */ - -/* - * Copyright 1997 Piermont Information Systems Inc. - * All rights reserved. - * - * Based on code written by Philip A. Nelson for Piermont Information - * Systems Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of Piermont Information Systems Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``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 PIERMONT INFORMATION SYSTEMS INC. 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. - * - */ - -/* acorn26 machine dependent messages, french */ - - -message md_hello -{ -} - -message md_may_remove_boot_medium -{Si vous avez démarré sur une disquette, vous pouvez maintenant la retirer. -} - -message badreadbb -{Impossible de lire le contenu du secteur de démarrage -} - -message badreadriscix -{Impossible de lire la table de partitions RISCiX -} - -message notnetbsdriscix -{Aucune partition NetBSD trouvée dans la table de partitions RISCiX. Impossible -de créer un label. -} - -message notnetbsd -{Aucune partition NetBSD trouvée (disque filecore uniquement ?). Impossible -de créer un label. -} - -message dobootblks -{Installation des blocs de démarrage sur %s ... -} - -message set_kernel_1 -{Kernel (GENERIC)} -message set_kernel_2 -{Kernel (GENERIC_FOURMEG)} - -message arm32fspart -{Nous avons maintenant vos partitions NetBSD sur %s comme suit -(taille et Offset en %s) : -} Index: usr.sbin/sysinst/arch/acorn26/msg.md.pl =================================================================== RCS file: usr.sbin/sysinst/arch/acorn26/msg.md.pl diff -N usr.sbin/sysinst/arch/acorn26/msg.md.pl --- usr.sbin/sysinst/arch/acorn26/msg.md.pl 26 Jul 2014 19:30:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,76 +0,0 @@ -/* $NetBSD: msg.md.pl,v 1.1 2014/07/26 19:30:44 dholland Exp $ */ -/* Based on english version: */ -/* NetBSD: msg.md.en,v 1.2 2002/04/02 17:11:21 thorpej Exp */ - -/* - * Copyright 1997 Piermont Information Systems Inc. - * All rights reserved. - * - * Based on code written by Philip A. Nelson for Piermont Information - * Systems Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of Piermont Information Systems Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``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 PIERMONT INFORMATION SYSTEMS INC. 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. - * - */ - -/* acorn26 machine dependent messages, Polish */ - - -message md_hello -{ -} - -message md_may_remove_boot_medium -{Jesli uruchomiles komputer z dyskietki, mozesz ja teraz wyciagnac. -} - -message badreadbb -{Nie moge przeczytac bootbloku filecore -} - -message badreadriscix -{Nie moge przeczytac tablicy partycji RISCiX -} - -message notnetbsdriscix -{Nie znalazlem partycji NetBSD w tablicy partycji RISCiX - Nie moge nazwac -} - -message notnetbsd -{Nie znalazlem partycji NetBSD (dysk filecore?) - Nie moge nazwac -} - -message dobootblks -{Instalowanie bootblokow na %s.... -} - -message set_kernel_1 -{Kernel (GENERIC)} -message set_kernel_2 -{Kernel (GENERIC_FOURMEG)} - -message arm32fspart -{Partycje NetBSD na dysku %s wygladaja teraz tak (Rozmiary i Przesuniecia w %s): -} Index: usr.sbin/sysinst/arch/acorn32/md.c =================================================================== RCS file: /cvsroot/src/usr.sbin/sysinst/arch/acorn32/md.c,v retrieving revision 1.2 diff -u -p -r1.2 md.c --- usr.sbin/sysinst/arch/acorn32/md.c 3 Aug 2014 16:09:38 -0000 1.2 +++ usr.sbin/sysinst/arch/acorn32/md.c 23 Jan 2018 15:29:05 -0000 @@ -32,7 +32,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* md.c -- arm32 machine specific routines - also used by acorn26 */ +/* md.c -- arm32 machine specific routines */ #include #include