Commit 0ccc2576 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.3.93

parent 83cfb0f5
......@@ -3179,6 +3179,21 @@ CONFIG_ISDN_DRV_TELES
different D-channel protocol, or non-standard irq/port/shmem
settings.
PCBIT-D support
CONFIG_ISDN_DRV_PCBIT
This enables support for the PCBIT ISDN-cards. This card is
manufactured in Portugal by Octal. For running this card,
additional firmware is necessary, which has to be downloaded into
the card using a utility which is distributed separately.
See Documentation/isdn/README for more information.
Support for AP1000 multicomputer
CONFIG_AP1000
This enables support for a sparc based parallel multi-computer
called an AP1000+. For details on our efforts to port Linux to this
machine see http://cap.anu.edu.au/cap/projects/linux or mail to
hackers@cafe.anu.edu.au
# need an empty line after last entry, for sed script in Configure.
#
......
......@@ -42,7 +42,7 @@ foo \kill}%
%
\title{{\bf Linux Allocated Devices}}
\author{Maintained by H. Peter Anvin $<$hpa@zytor.com$>$}
\date{Last revised: April 10, 1996}
\date{Last revised: April 20, 1996}
\maketitle
%
\noindent
......@@ -74,6 +74,9 @@ that semantically altered versions are not distributed without
permission of the author, assuming the author can be contacted without
an unreasonable effort.
In particular, please don't sent patches for this list to Linus, at
least not without contacting me first.
\section{Major numbers}
\begin{devicelist}
......@@ -160,7 +163,9 @@ an unreasonable effort.
\major{45}{}{char }{isdn4linux ISDN BRI driver}
\major{46}{}{char }{Comtrol Rocketport serial card}
\major{47}{}{char }{Comtrol Rocketport serial card -- alternate devices}
\major{48}{--59}{}{Unallocated}
\major{48}{}{char }{SDL RISCom serial card}
\major{49}{}{char }{SDL RISCom serial card -- alternate devices}
\major{50}{--59}{}{Unallocated}
\major{60}{--63}{}{Local/experimental use}
\major{64}{--119}{}{Unallocated}
\major{120}{--127}{}{Local/experimental use}
......@@ -417,6 +422,9 @@ physical disks.
\minor{133}{/dev/exttrp}{External device trap}
\minor{134}{/dev/apm\_bios}{Advanced Power Management BIOS}
\minor{135}{/dev/rtc}{Real Time Clock}
\minor{136}{/dev/qcam0}{QuickCam on {\file lp0}}
\minor{137}{/dev/qcam1}{QuickCam on {\file lp1}}
\minor{138}{/dev/qcam2}{QuickCam on {\file lp2}}
\end{devicelist}
\noindent
......@@ -557,10 +565,7 @@ number 3).
\minor{0}{/dev/ttyC0}{First Cyclades port}
\minordots
\minor{31}{/dev/ttyC31}{32nd Cyclades port}
\end{devicelist}
\noindent
It would make more sense for these to start at 0...
\begin{devicelist}
\\
\major{ }{}{block}{``Double'' compressed disk}
\minor{0}{/dev/double0}{First compressed disk}
\minordots
......@@ -960,25 +965,28 @@ driver with this number should not cause ill effects to the system
\major{43}{}{char }{isdn4linux virtual modem}
\minor{0}{/dev/ttyI0}{First virtual modem}
\minordots
\minor{15}{/dev/ttyI15}{16th virtual modem}
\minor{63}{/dev/ttyI63}{64th virtual modem}
\end{devicelist}
\begin{devicelist}
\major{44}{}{char }{isdn4linux virtual modem -- alternate devices}
\minor{0}{/dev/cui0}{Callout device corresponding to {\file ttyI0}}
\minordots
\minor{15}{/dev/cui15}{Callout device corresponding to {\file ttyI15}}
\minor{63}{/dev/cui63}{Callout device corresponding to {\file ttyI63}}
\end{devicelist}
\begin{devicelist}
\major{45}{}{char }{isdn4linux ISDN BRI driver}
\minor{0}{/dev/isdn0}{First virtual B channel raw data}
\minordots
\minor{15}{/dev/isdn15}{16th virtual B channel raw data}
\minor{16}{/dev/isdnctrl0}{First channel control/debug}
\minor{63}{/dev/isdn63}{64th virtual B channel raw data}
\minor{64}{/dev/isdnctrl0}{First channel control/debug}
\minordots
\minor{127}{/dev/isdnctrl63}{64th channel control/debug}
\minor{128}{/dev/ippp0}{First SyncPPP device}
\minordots
\minor{31}{/dev/isdnctrl15}{16th channel control/debug}
\minor{128}{/dev/isdninfo}{ISDN monitor interface}
\minor{191}{/dev/ippp63}{64th SyncPPP device}
\minor{255}{/dev/isdninfo}{ISDN monitor interface}
\end{devicelist}
\begin{devicelist}
......@@ -996,7 +1004,21 @@ driver with this number should not cause ill effects to the system
\end{devicelist}
\begin{devicelist}
\major{48}{--59}{}{Unallocated}
\major{48}{}{char }{SDL RISCom serial card}
\minor{0}{/dev/ttyL0}{First RISCom port}
\minor{1}{/dev/ttyL1}{Second RISCom port}
\minordots
\end{devicelist}
\begin{devicelist}
\major{49}{}{char }{SDL RISCom serial card -- alternate devices}
\minor{0}{/dev/cul0}{Callout device corresponding to {\file ttyL0}}
\minor{1}{/dev/cul1}{Callout device corresponding to {\file ttyL1}}
\minordots
\end{devicelist}
\begin{devicelist}
\major{50}{--59}{}{Unallocated}
\end{devicelist}
\begin{devicelist}
......
......@@ -2,14 +2,14 @@
Maintained by H. Peter Anvin <hpa@zytor.com>
Last revised: April 10, 1996
Last revised: April 20, 1996
This list is the successor to Rick Miller's Linux Device List, which
he stopped maintaining when he got busy with other things in 1993. It
is a registry of allocated major device numbers, as well as the
recommended /dev directory nodes for these devices.
The latest version of this list is included with the Linux kernel
The lastest version of this list is included with the Linux kernel
sources in LaTeX and ASCII form. In case of discrepancy, the LaTeX
version is authoritative.
......@@ -31,6 +31,9 @@ that semantically altered versions are not distributed without
permission of the author, assuming the author can be contacted without
an unreasonable effort.
In particular, please don't sent patches for this list to Linus, at
least not without contacting me first.
0 Unnamed devices (e.g. non-device mounts)
0 = reserved as null device number
......@@ -243,6 +246,9 @@ an unreasonable effort.
133 = /dev/exttrp External device trap
134 = /dev/apm_bios Advanced Power Management BIOS
135 = /dev/rtc Real Time Clock
136 = /dev/qcam0 QuickCam on lp0
137 = /dev/qcam1 QuickCam on lp1
138 = /dev/qcam2 QuickCam on lp2
11 char Raw keyboard device
0 = /dev/kbd Raw keyboard device
......@@ -345,9 +351,6 @@ an unreasonable effort.
0 = /dev/ttyC0 First Cyclades port
...
31 = /dev/ttyC31 32nd Cyclades port
It would make more sense for these to start at 0...
block "Double" compressed disk
0 = /dev/double0 First compressed disk
...
......@@ -658,21 +661,26 @@ an unreasonable effort.
43 char isdn4linux virtual modem
0 = /dev/ttyI0 First virtual modem
...
15 = /dev/ttyI15 16th virtual modem
63 = /dev/ttyI63 64th virtual modem
44 char isdn4linux virtual modem - alternate devices
0 = /dev/cui0 Callout device corresponding to ttyI0
...
15 = /dev/cui15 Callout device corresponding to ttyI15
63 = /dev/cui63 Callout device corresponding to ttyI63
45 char isdn4linux ISDN BRI driver
0 = /dev/isdn0 First virtual B channel raw data
...
15 = /dev/isdn15 16th virtual B channel raw data
16 = /dev/isdnctrl0 First channel control/debug
63 = /dev/isdn63 64th virtual B channel raw data
64 = /dev/isdnctrl0 First channel control/debug
...
127 = /dev/isdnctrl63 64th channel control/debug
128 = /dev/ippp0 First SyncPPP device
...
31 = /dev/isdnctrl15 16th channel control/debug
128 = /dev/isdninfo ISDN monitor interface
191 = /dev/ippp63 64th SyncPPP device
255 = /dev/isdninfo ISDN monitor interface
46 char Comtrol Rocketport serial card
0 = /dev/ttyR0 First Rocketport port
......@@ -684,7 +692,17 @@ an unreasonable effort.
1 = /dev/cur1 Callout device corresponding to ttyR1
...
48-59 UNALLOCATED
48 char SDL RISCom serial card
0 = /dev/ttyL0 First RISCom port
1 = /dev/ttyL1 Second RISCom port
...
49 char SDL RISCom serial card - alternate devices
0 = /dev/cul0 Callout device corresponding to ttyL0
1 = /dev/cul1 Callout device corresponding to ttyL1
...
50-59 UNALLOCATED
60-63 LOCAL/EXPERIMENTAL USE
Allocated for local/experimental use. For devices not
......
......@@ -5,7 +5,7 @@ I want to thank all who contributed to this project and especially to:
Thomas Bogendörfer (tsbogend@bigbug.franken.de)
Tester, lots of bugfixes and hints.
Alan Cox ()
Alan Cox (alan@cymru.net)
For help getting into standard-kernel.
Volker Götz (volker@oops.franken.de)
......@@ -24,8 +24,11 @@ Michael Knigge (knick@cove.han.de)
Andreas Kool (akool@Kool.f.EUnet.de)
For contribution of the isdnlog/isdnrep-tool
Pedro Roque Marques
For lot of new ideas and writing a new driver coming soon.
Pedro Roque Marques (roque@di.fc.ul.pt)
For lot of new ideas and the pcbit driver.
Eberhard Moenkeberg (emoenke@gwdg.de)
For testing and help to get into kernel.
Jan den Ouden (denouden@groovin.xs4all.nl)
For contribution of the teles-driver
......
......@@ -44,7 +44,7 @@ README for the ISDN-subsystem
term to that one, which applies to your local ISDN-environment.
When the link-level-module isdn.o is loaded, it supports up to 16
low-level-modules with up to 16 channels. (The number 16 is arbitrarily
low-level-modules with up to 64 channels. (The number 64 is arbitrarily
chosen and can be configured at compile-time --ISDN_MAX in isdn.h).
A low-level-driver can register itself through an interface (which is
defined in isdnif.h) and gets assigned a slot.
......@@ -65,7 +65,7 @@ README for the ISDN-subsystem
In addition the following devices are made available:
32 tty-devices (16 cuix and 16 ttyIx) with integrated modem-emulator:
128 tty-devices (64 cuix and 64 ttyIx) with integrated modem-emulator:
The functionality is almost the same as that of a serial device
(the line-discs are handled by the kernel, which lets you run
SLIP, CSLIP and asynchronous PPP through the devices. We have tested
......@@ -473,6 +473,14 @@ README for the ISDN-subsystem
In this case use ping with the option -i <sec> to increase the interval
between echo-packets.
"isdnctrl cbdelay <InterfaceName> [seconds]"
Sets the delay (default 5 sec) between an incoming call and start of
dialing when callback is enabled.
"isdnctrl cbhup <InterfaceName> [on|off]"
This enables (default) or disables an active hangup (reject) when getting an
incoming call for an interface which is configured for callback.
"isdnctrl encap <InterfaceName> <EncapType>"
Selects the type of packet-encapsulation. The encapsulation can be changed
only while an interface is down.
......@@ -490,6 +498,8 @@ README for the ISDN-subsystem
IP-address: fc:fc:i1:i2:i3:i4, where i1-4 are the IP-addr.-values.
syncppp Synchronous PPP
uihdlc HDLC with UI-frame-header (for use with DOS ISPA, option -h1)
Watching packets, using standard-tcpdump will fail for all encapsulations
except ethernet because tcpdump does not know how to handle packets
without MAC-header. A patch for tcpdump is included in the utility-package
......
------------------------------------------------------------------------------
README file for the PCBIT-D Device Driver.
------------------------------------------------------------------------------
The PCBIT is a Euro ISDN adapter manufactured in Portugal by Octal and
developed in cooperation with Portugal Telecom and Inesc.
The driver interfaces with the standard kernel isdn facilities
originaly developed by Fritz Elfert in the isdn4linux project.
The common versions of the pcbit board require a firmware that is
distributed (and copyrighted) by the manufacturer. To load this
firmware you need "pcbitctl" availiable on the standard isdn4k-utils
package or in the pcbit package availiable in:
ftp://ftp.di.fc.ul.pt/pub/systems/Linux/isdn
Known Limitations:
- The board reset proceeding is at the moment incorrect and will only
allow you to load the firmware after a hard reset.
- Only HDLC in B-channels is supported at the moment. There is now
current support to X.25 in B or D channels nor LAPD in B
channels. The main reason is that this two other protocol modes have,
to my knowledge, very little use. If you want to see them implemented
*do* send me a mail.
- The driver often triggers errors in the board that i and the
manufacturer believe to be caused by bugs in the firmware. The current
version includes several proceedings for error recovery that should
allow normal operation. Plans for the future include cooperation with
the manufacturer in order to solve this problems.
Information/hints/help can be obtained in the linux isdn
mailing list (isdn4linux@hub-wue.franken.de) or directly from me.
regards,
Pedro.
<roque@di.fc.ul.pt>
......@@ -12,7 +12,8 @@ To compile isdn4linux with the sync PPP part, you have
to answer the appropriate question when doing a "make config"
Don't forget to load the slhc.o
module before the isdn.o module, if VJ-compression support
is not compiled into your kernel.
is not compiled into your kernel. (e.g if you have PPP or
CSLIP in the kernel)
Using isdn4linux with sync PPP:
-------------------------------
......@@ -35,18 +36,20 @@ devices .. and so on.
I've implemented one additional option for the ipppd:
'useifip' will get (if set to not 0.0.0.0) the IP address
for the negotiation from the attached network-interface.
(also: ipppd will try to negotiate pointopoint IP as remote IP)
You must disable BSD-compression, this implementation can't
handle compressed packets.
Check the rc.isdn.syncppp file for an example setup script.
Check the etc/rc.isdn.syncppp in the isdn4kernel-util package
for an example setup script.
To use the MPPP stuff, you must configure a slave device
with isdn4linux. Now call the ipppd with the '+mp' option.
To increase the number of links, you must use the
'addlink' option of the isdnctrl tool.
enjoy it,
michael
PS: I also implemented generic MP (RFC 1717). But in the
current isdn4linux link-level driver there is no
(or better say: another) way of doing channel bundling. So,
don't call the ipppd with the `+mp` option to enable
MP negotiation.
simple isdn4linux PPP FAQ .. to be continued .. not 'debugged'
Q: pppd,ipppd, syncPPP , asyncPPP .. what is that ?
what should I use?
A: The pppd is for asynchronous PPP .. asynchron means
here, the framing is character based. (e.g when
using ttyI* or tty* devices)
The ipppd handles PPP packets coming in HDLC
frames (bit based protocol) ... The PPP driver
in isdn4linux pushs all IP packets direct
to the network layer and all PPP protocol
frames to the /dev/ippp* device.
So, the ipppd is a simple externel network
protocol handler.
If you login into a remote machine using the
/dev/ttyI* devices and then enable PPP on the
remote terminal server -> use the 'old' pppd
If your remote side immediately starts to send
frames ... you probably connect to a
syncPPP machine .. use the network device part
of isdn4linux with the 'syncppp' encapsulation
and make sure, that the ipppd is running and
conneted to at least one /dev/ippp*. Check the
isdn4linux manual on how to configure a network device.
Q: when I start the ipppd .. I only get the
error message "this systems lacks PPP support"
A: check that at least the device 'ippp0' exists.
(you can check this e.g with the program 'ifconfig')
The ipppd NEEDS this device under THIS name ..
If this device doesn't exists, use:
isdnctrl addif ippp0
isdnctrl encap ippp0 syncppp
... (see isdn4linux doc for more) ...
A: Maybe you have compiled the ipppd with another
kernel source tree than the kernel you currently
run ...
Q: when I list the netdevices with ifconfig I see, that
my ISDN interface has a HWaddr and IRQ=0 and Base
address = 0
A: The device is a fake ethernetdevice .. ignore IRQ and baseaddr
You need the HWaddr only for ethernet encapsulation.
......@@ -248,6 +248,13 @@ M: mj@k332.feld.cvut.cz
L: linux-kernel@vger.rutgers.edu
S: Maintained
VFAT FILESYSTEM:
P: Gordon Chaffee
M: chaffee@plateau.cs.berkeley.edu
L: linux-kernel@vger.rutgers.edu
W: http://www-plateau.cs.berkeley.edu/people/chaffee
S: Maintained
DIGIBOARD DRIVER:
P: Christoph Lameter
M: clameter@fuller.edu
......
VERSION = 1
PATCHLEVEL = 3
SUBLEVEL = 92
SUBLEVEL = 93
ARCH = i386
......@@ -116,8 +116,7 @@ endif
ARCHIVES =kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o net/network.a
FILESYSTEMS =fs/filesystems.a
DRIVERS =drivers/block/block.a \
drivers/char/char.a \
drivers/net/net.a
drivers/char/char.a
LIBS =$(TOPDIR)/lib/lib.a
SUBDIRS =kernel drivers mm fs net ipc lib
......@@ -125,6 +124,8 @@ ifeq ($(CONFIG_ISDN),y)
DRIVERS := $(DRIVERS) drivers/isdn/isdn.a
endif
DRIVERS := $(DRIVERS) drivers/net/net.a
ifdef CONFIG_CD_NO_IDESCSI
DRIVERS := $(DRIVERS) drivers/cdrom/cdrom.a
endif
......
......@@ -61,7 +61,7 @@ static inline void restore_i387_hard(struct _fpstate *buf)
}
#endif
current->used_math = 1;
current->flags &= PF_USEDFPU;
current->flags &= ~PF_USEDFPU;
memcpy_fromfs(&current->tss.i387.hard, buf, sizeof(*buf));
}
......@@ -133,7 +133,7 @@ static inline struct _fpstate * save_i387_hard(struct _fpstate * buf)
if (current->flags & PF_USEDFPU) {
__asm__ __volatile__("fnsave %0":"=m" (current->tss.i387.hard));
stts();
current->flags &= PF_USEDFPU;
current->flags &= ~PF_USEDFPU;
}
#else
if (current == last_task_used_math) {
......
# $Id: Makefile,v 1.6 1995/11/25 00:57:30 davem Exp $
# $Id: Makefile,v 1.20 1996/04/16 08:02:50 davem Exp $
# sparc/Makefile
#
# Makefile for the architecture dependent flags and dependencies on the
......@@ -30,8 +30,11 @@ ARCHIVES := arch/sparc/kernel/kernel.o arch/sparc/mm/mm.o $(ARCHIVES)
LIBS := $(TOPDIR)/lib/lib.a $(LIBS) $(TOPDIR)/arch/sparc/prom/promlib.a \
$(TOPDIR)/arch/sparc/lib/lib.a
aoutimage: vmlinux
elftoaout -o aoutimage vmlinux
ifdef CONFIG_AP1000
SUBDIRS := $(SUBDIRS) arch/sparc/ap1000
ARCHIVES := $(TOPDIR)/arch/sparc/ap1000/ap1000lib.o $(ARCHIVES)
DRIVERS := $(DRIVERS) drivers/ap1000/ap1000.a
endif
archclean:
rm -f $(TOPDIR)/arch/sparc/boot/boot
......
......@@ -17,5 +17,5 @@ our data area either way because we can be dual purpose.
More will come....
Hopefully I can write this such that it will work on almost all SUN
machines in existence. We'll see ;(
machines in existance. We'll see ;(
/* $Id: empirical.h,v 1.2 1995/11/25 00:57:42 davem Exp $
/* $Id: empirical.h,v 1.1 1996/04/21 10:17:46 davem Exp $
* empirical.h: Nasty hacks....
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
......
/* $Id: init_me.c,v 1.2 1995/11/25 00:57:44 davem Exp $
/* $Id: init_me.c,v 1.3 1996/04/21 10:30:09 davem Exp $
* init_me.c: Initialize empirical constants and gather some info from
* the boot prom.
*
......@@ -11,7 +11,7 @@
#include "empirical.h" /* Don't ask... */
#define DEBUG_INIT_ME /* Tell me what's goin on */
#define DEBUG_INIT_ME /* Tell me what's going on */
unsigned int nwindows; /* Set in bare.S */
unsigned int nwindowsm1;
......
# $Id: config.in,v 1.8 1996/03/01 07:15:47 davem Exp $
# $Id: config.in,v 1.9 1996/04/04 16:30:03 tridge Exp $
# For a description of the syntax of this configuration file,
# see the Configure script.
#
......@@ -7,16 +7,24 @@ mainmenu_name "Kernel configuration of Linux for SparcStations"
mainmenu_option next_comment
comment 'General setup'
# Global things across all Sparc machines.
define_bool CONFIG_SBUS y
define_bool CONFIG_SUN_MOUSE y
define_bool CONFIG_SERIAL y
define_bool CONFIG_SUN_SERIAL y
define_bool CONFIG_SUN_KEYBOARD y
define_bool CONFIG_SUN_CONSOLE y
bool 'Support for AP1000 multicomputer' CONFIG_AP1000
if [ "$CONFIG_AP1000" = "n" ]; then
# Global things across all Sun machines.
define_bool CONFIG_SBUS y
define_bool CONFIG_SUN_MOUSE y
define_bool CONFIG_SERIAL y
define_bool CONFIG_SUN_SERIAL y
define_bool CONFIG_SUN_KEYBOARD y
define_bool CONFIG_SUN_CONSOLE y
define_bool CONFIG_SUN_AUXIO y
define_bool CONFIG_SUN_IO y
fi
define_bool CONFIG_NET_ALIAS n
define_bool CONFIG_BINFMT_AOUT y
bool 'Networking support' CONFIG_NET
bool 'System V IPC' CONFIG_SYSVIPC
tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
......
......@@ -5,21 +5,28 @@
#
# General setup
#
# CONFIG_AP1000 is not set
CONFIG_SBUS=y
CONFIG_SUN_MOUSE=y
CONFIG_SERIAL=y
CONFIG_SUN_SERIAL=y
CONFIG_SUN_KEYBOARD=y
CONFIG_SUN_CONSOLE=y
CONFIG_SUN_AUXIO=y
CONFIG_SUN_IO=y
# CONFIG_NET_ALIAS is not set
CONFIG_BINFMT_AOUT=y
CONFIG_NET=y
CONFIG_SYSVIPC=y
# CONFIG_BINFMT_ELF is not set
CONFIG_BINFMT_ELF=y
#
# Floppy, IDE, and other block devices
#
# CONFIG_BLK_DEV_FD is not set
CONFIG_BLK_DEV_RAM=y
# CONFIG_BLK_DEV_INITRD is not set
# CONFIG_BLK_DEV_LOOP is not set
#
# Networking options
......@@ -46,6 +53,7 @@ CONFIG_IP_NOSR=y
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_AX25 is not set
# CONFIG_BRIDGE is not set
# CONFIG_NETLINK is not set
#
......@@ -58,7 +66,7 @@ CONFIG_SCSI=y
#
CONFIG_BLK_DEV_SD=y
# CONFIG_CHR_DEV_ST is not set
# CONFIG_BLK_DEV_SR is not set
CONFIG_BLK_DEV_SR=y
# CONFIG_CHR_DEV_SG is not set
#
......@@ -66,6 +74,7 @@ CONFIG_BLK_DEV_SD=y
#
# CONFIG_SCSI_MULTI_LUN is not set
CONFIG_SCSI_CONSTANTS=y
# CONFIG_SCSI_AUTO_BIOSP is not set
#
# SCSI low-level drivers
......@@ -96,8 +105,10 @@ CONFIG_EXT2_FS=y
CONFIG_PROC_FS=y
CONFIG_NFS_FS=y
CONFIG_ROOT_NFS=y
CONFIG_RNFS_BOOTP=y
CONFIG_RNFS_RARP=y
# CONFIG_SMB_FS is not set
# CONFIG_ISO9660_FS is not set
CONFIG_ISO9660_FS=y
# CONFIG_HPFS_FS is not set
# CONFIG_SYSV_FS is not set
......
# $Id: Makefile,v 1.22 1996/03/01 07:15:52 davem Exp $
# $Id: Makefile,v 1.29 1996/04/04 16:30:17 tridge Exp $
# Makefile for the linux kernel.
#
# Note! Dependencies are done automagically by 'make dep', which also
......@@ -7,23 +7,56 @@
#
# Note 2! The CFLAGS definitions are now in the main makefile...
ifdef SMP
.S.s:
$(CPP) -D__ASSEMBLY__ $(AFLAGS) -ansi $< -o $*.s
.S.o:
$(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c $< -o $*.o
else
.S.s:
$(CPP) -D__ASSEMBLY__ -ansi $< -o $*.s
.S.o:
$(CC) -D__ASSEMBLY__ -ansi -c $< -o $*.o
endif
all: kernel.o head.o
O_TARGET := kernel.o
O_OBJS := entry.o wof.o wuf.o etrap.o rtrap.o switch.o traps.o irq.o \
process.o signal.o ioport.o setup.o idprom.o mp.o c_mp.o \
IRQ_OBJS := irq.o sun4m_irq.o sun4c_irq.o
O_OBJS := entry.o wof.o wuf.o etrap.o rtrap.o switch.o traps.o ${IRQ_OBJS} \
process.o signal.o ioport.o setup.o idprom.o \
sys_sparc.o sunos_asm.o sparc-stub.o systbls.o sys_sunos.o \
sunos_ioctl.o time.o windows.o cpu.o auxio.o devices.o ksyms.o \
sclow.o
sunos_ioctl.o time.o windows.o cpu.o devices.o ksyms.o \
sclow.o solaris.o tadpole.o tick14.o
ifdef SMP
O_OBJS += trampoline.o smp.o rirq.o
endif
ifdef CONFIG_SUN_AUXIO
O_OBJS += auxio.o
endif
all: kernel.o head.o
ifdef SMP
head.o: head.S
$(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c $*.S -o $*.o
else
head.o: head.S
$(CC) -D__ASSEMBLY__ -ansi -c $*.S -o $*.o
endif
include $(TOPDIR)/Rules.make
......@@ -31,7 +31,7 @@ auxio_probe(void)
/* Map the register both read and write */
auxio_register = (unsigned char *) sparc_alloc_io(auxregs[0].phys_addr, 0,
auxregs[0].reg_size,
"auxiliaryIO",
"auxilliaryIO",
auxregs[0].which_io, 0x0);
/* Fix the address on sun4m and sun4c. */
if((((unsigned long) auxregs[0].phys_addr) & 3) == 3 ||
......
/* $Id: c_mp.c,v 1.3 1995/11/25 00:57:50 davem Exp $
* mp.c: SMP cpu idling and dispatch on the Sparc.
*
* Copyright (C) 1995 David S. Miller
*/
#include <linux/kernel.h>
#include <asm/mp.h>
#include <asm/mbus.h>
struct sparc_percpu *percpu_table;
void
sparc_cpu_init(void)
{
/* We now have our per-cpu mappings ok, and we should
* be good to go.
*/
/* Do cache crap here. */
/* CPU initted, idle the puppy. */
return;
}
extern thiscpus_mid;
void
sparc_cpu_idle(void)
{
int cpuid;
/* cpuid = get_cpuid(); */
cpuid = (thiscpus_mid&(~8));
/* printk("SMP: cpu%d has entered idle loop", cpuid); */
/* Say that we exist and set up. */
percpu_table[cpuid].cpuid = cpuid;
percpu_table[cpuid].cpu_is_alive = 0x1;
percpu_table[cpuid].cpu_is_idling = 0x1;
/* Let other cpus catch up. */
while(linux_smp_still_initting) ;
printk("cpu%d done spinning\n", get_cpuid());
for(;;) ; /* Do something useful here... */
return;
}
......@@ -7,6 +7,7 @@
#include <linux/kernel.h>
#include <asm/oplib.h>
#include <asm/page.h>
#include <asm/head.h>
#include <asm/psr.h>
#include <asm/mbus.h>
......
......@@ -5,6 +5,7 @@
*/
#include <linux/kernel.h>
#include <linux/config.h>
#include <asm/page.h>
#include <asm/oplib.h>
......@@ -15,7 +16,7 @@ struct prom_cpuinfo linux_cpus[NCPUS];
int linux_num_cpus;
extern void cpu_probe(void);
extern void auxio_probe(void);
extern void clock_stop_probe(void); /* tadpole.c */
unsigned long
device_scan(unsigned long mem_start)
......@@ -25,13 +26,21 @@ device_scan(unsigned long mem_start)
int cpu_nds[NCPUS]; /* One node for each cpu */
int cpu_ctr = 0;
#if CONFIG_AP1000
printk("Not scanning device list for CPUs\n");
linux_num_cpus = 1;
return;
#endif
prom_getstring(prom_root_node, "device_type", node_str, sizeof(node_str));
if(strcmp(node_str, "cpu") == 0) {
cpu_nds[0] = prom_root_node;
cpu_ctr++;
} else {
int scan;
scan = prom_getchild(prom_root_node);
prom_printf("root child is %08lx\n", (unsigned long) scan);
nd = 0;
while((scan = prom_getsibling(scan)) != 0) {
prom_getstring(scan, "device_type", node_str, sizeof(node_str));
......@@ -40,6 +49,9 @@ device_scan(unsigned long mem_start)
linux_cpus[cpu_ctr].prom_node = scan;
prom_getproperty(scan, "mid", (char *) &thismid, sizeof(thismid));
linux_cpus[cpu_ctr].mid = thismid;
prom_printf("Found CPU %d <node=%08lx,mid=%d>\n",
cpu_ctr, (unsigned long) scan,
thismid);
cpu_ctr++;
}
};
......@@ -55,7 +67,13 @@ device_scan(unsigned long mem_start)
linux_num_cpus = cpu_ctr;
cpu_probe();
#if CONFIG_SUN_AUXIO
{
extern void auxio_probe(void);
auxio_probe();
}
#endif
clock_stop_probe();
return mem_start;
}
This diff is collapsed.
/* $Id: etrap.S,v 1.16 1996/02/20 07:45:01 davem Exp $
/* $Id: etrap.S,v 1.17 1996/03/07 06:26:43 davem Exp $
* etrap.S: Sparc trap window preparation for entry into the
* Linux kernel.
*
......@@ -65,7 +65,7 @@ tsetup_7win_patch6: and %g2, 0x7f, %g2
* T == Window entered when trap occurred
* S == Window we will need to save if (1<<T) == %wim
*
* Before execution gets here, it must be guaranteed that
* Before execution gets here, it must be guarenteed that
* %l0 contains trap time %psr, %l1 and %l2 contain the
* trap pc and npc, and %l3 contains the trap time %wim.
*/
......@@ -181,7 +181,7 @@ tsetup_patch3: and %g2, 0xff, %g2 ! patched on 7win Sparcs
mov %t_kstack, %sp ! and onto kernel stack
trap_setup_user_spill:
/* A spill occurred from either kernel or user mode
/* A spill occured from either kernel or user mode
* and there exist some user windows to deal with.
* A mask of the currently valid user windows
* is in %g1 upon entry to here.
......@@ -200,7 +200,7 @@ tsetup_patch6: and %g2, 0xff, %g2 ! patched on 7win Sparcs
wr %g2, 0x0, %wim
WRITE_PAUSE
/* Call MMU-architecture dependent stack checking
/* Call MMU-architecture dependant stack checking
* routine.
*/
.globl C_LABEL(tsetup_mmu_patchme)
......
This diff is collapsed.
......@@ -21,7 +21,7 @@ static struct idp_struct idprom_buff;
/* Here is the master table of Sun machines which use some implementation
* of the Sparc CPU and have a meaningful IDPROM machtype value that we
* know about. See asm-sparc/machines.h for empirical constants.
* know about. See asm-sparc/machines.h for imperical constants.
*/
struct Sun_Machine_Models Sun_Machines[NUM_SUN_MACHINES] = {
/* First, Sun4's */
......
/* $Id: ioport.c,v 1.14 1996/01/03 03:34:41 davem Exp $
/* $Id: ioport.c,v 1.17 1996/03/23 02:39:13 davem Exp $
* ioport.c: Simple io mapping allocator.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
......@@ -31,7 +31,7 @@ static long next_free_region = IOBASE_VADDR;
static long dvma_next_free = DVMA_VADDR;
/*
* sparc_alloc_dev:
* sparc_alloc_io:
* Map and allocates an obio device.
* Implements a simple linear allocator, you can force the function
* to use your own mapping, but in practice this should not be used.
......@@ -61,7 +61,7 @@ void *sparc_alloc_io (void *address, void *virtual, int len, char *name,
len += offset;
if(((unsigned long) virtual + len) > (IOBASE_VADDR + IOBASE_LEN)) {
prom_printf("alloc_io: Mapping outside IOBASE area\n");
prom_printf("alloc_io: Mapping ouside IOBASE area\n");
prom_halt();
}
if(check_region ((vaddr | offset), len)) {
......@@ -84,11 +84,11 @@ void *sparc_alloc_io (void *address, void *virtual, int len, char *name,
return (void *) (base_address | offset);
}
/* Does DVMA allocations with PAGE_SIZE granularity. How this basically
/* Does DVMA allocations with PAGE_SIZE granulatity. How this basically
* works is that the ESP chip can do DVMA transfers at ANY address with
* certain size and boundary restrictions. But other devices that are
* certain size and boundry restrictions. But other devices that are
* attached to it and would like to do DVMA have to set things up in
* a special way, if the DVMA sees a device attached to it transfer data
* a special way, if the DVMA see's a device attached to it transfer data
* at addresses above DVMA_VADDR it will grab them, this way it does not
* now have to know the peculiarities of where to read the Lance data
* from. (for example)
......
This diff is collapsed.
......@@ -380,7 +380,7 @@ probe_clock(int fchild)
}
}
/* Probe and map in the Auxiliary I/O register */
/* Probe and map in the Auxiliaary I/O register */
void
probe_auxio(void)
{
......@@ -402,7 +402,7 @@ probe_auxio(void)
prom_apply_obio_ranges(auxregs, 0x1);
/* Map the register both read and write */
sparc_alloc_io(auxregs[0].phys_addr, (void *) AUXIO_VADDR,
auxregs[0].reg_size, "auxiliaryIO", auxregs[0].which_io, 0x0);
auxregs[0].reg_size, "auxilliaryIO", auxregs[0].which_io, 0x0);
}
extern unsigned long probe_memory(void);
......
/* $Id: process.c,v 1.42 1996/02/20 07:45:08 davem Exp $
/* $Id: process.c,v 1.49 1996/04/20 07:37:20 davem Exp $
* linux/arch/sparc/kernel/process.c
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
......@@ -8,6 +8,9 @@
* This file handles the architecture-dependent parts of process handling..
*/
#define __KERNEL_SYSCALLS__
#include <stdarg.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
......@@ -29,11 +32,14 @@
#include <asm/delay.h>
#include <asm/processor.h>
#include <asm/psr.h>
#include <asm/system.h>
extern void fpsave(unsigned long *, unsigned long *, void *, unsigned long *);
int active_ds = USER_DS;
#ifndef __SMP__
/*
* the idle loop on a Sparc... ;)
*/
......@@ -47,8 +53,56 @@ asmlinkage int sys_idle(void)
for (;;) {
schedule();
}
return 0;
}
#else
/*
* the idle loop on a SparcMultiPenguin...
*/
asmlinkage int sys_idle(void)
{
if (current->pid != 0)
return -EPERM;
/* endless idle loop with no priority at all */
current->counter = -100;
schedule();
return 0;
}
/* This is being executed in task 0 'user space'. */
int cpu_idle(void *unused)
{
volatile int *spap = &smp_process_available;
volatile int cval;
current->priority = -50;
while(1) {
if(0==read_smp_counter(spap))
continue;
while(*spap == -1)
;
cli();
/* Acquire exclusive access. */
while((cval = smp_swap(spap, -1)) == -1)
;
if (0==cval) {
/* ho hum, release it. */
smp_process_available = 0;
sti();
continue;
}
/* Something interesting happened, whee... */
smp_swap(spap, (cval - 1));
sti();
idle();
}
}
#endif
extern char saved_command_line[];
void hard_reset_now(void)
......@@ -94,12 +148,20 @@ void show_regs(struct pt_regs * regs)
void exit_thread(void)
{
flush_user_windows();
#ifndef __SMP__
if(last_task_used_math == current) {
#else
if(current->flags & PF_USEDFPU) {
#endif
/* Keep process from leaving FPU in a bogon state. */
put_psr(get_psr() | PSR_EF);
fpsave(&current->tss.float_regs[0], &current->tss.fsr,
&current->tss.fpqueue[0], &current->tss.fpqdepth);
#ifndef __SMP__
last_task_used_math = NULL;
#else
current->flags &= ~PF_USEDFPU;
#endif
}
mmu_exit_hook();
}
......@@ -122,11 +184,20 @@ void flush_thread(void)
current->tss.sstk_info.cur_status = 0;
current->tss.sstk_info.the_stack = 0;
#ifndef __SMP__
if(last_task_used_math == current) {
#else
if(current->flags & PF_USEDFPU) {
#endif
/* Clean the fpu. */
put_psr(get_psr() | PSR_EF);
fpsave(&current->tss.float_regs[0], &current->tss.fsr,
&current->tss.fpqueue[0], &current->tss.fpqdepth);
#ifndef __SMP__
last_task_used_math = NULL;
#else
current->flags &= ~PF_USEDFPU;
#endif
}
memset(&current->tss.reg_window[0], 0,
......@@ -144,7 +215,7 @@ void flush_thread(void)
* Parent --> %o0 == childs pid, %o1 == 0
* Child --> %o0 == parents pid, %o1 == 1
*
* NOTE: We have a separate fork kpsr/kwim because
* NOTE: We have a seperate fork kpsr/kwim because
* the parent could change these values between
* sys_fork invocation and when we reach here
* if the parent should sleep while trying to
......@@ -160,14 +231,25 @@ void copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
struct reg_window *old_stack, *new_stack;
unsigned long stack_offset;
#ifndef __SMP__
if(last_task_used_math == current) {
#else
if(current->flags & PF_USEDFPU) {
#endif
put_psr(get_psr() | PSR_EF);
fpsave(&p->tss.float_regs[0], &p->tss.fsr,
&p->tss.fpqueue[0], &p->tss.fpqdepth);
#ifdef __SMP__
current->flags &= ~PF_USEDFPU;
#endif
}
/* Calculate offset to stack_frame & pt_regs */
stack_offset = ((PAGE_SIZE*2) - TRACEREG_SZ);
if(sparc_cpu_model == sun4c)
stack_offset = ((PAGE_SIZE*3) - TRACEREG_SZ);
else
stack_offset = ((PAGE_SIZE<<2) - TRACEREG_SZ);
if(regs->psr & PSR_PS)
stack_offset -= REGWIN_SZ;
childregs = ((struct pt_regs *) (p->kernel_stack_page + stack_offset));
......
/* rirq.S: Needed to return from an interrupt on SMP with no
* locks held or released.
*
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
*/
#include <asm/cprefix.h>
#include <asm/page.h>
#include <asm/ptrace.h>
#include <asm/psr.h>
#include <asm/asi.h>
#include <asm/smp.h>
#include <asm/contregs.h>
#include <asm/winmacro.h>
#include <asm/asmmacro.h>
#define t_psr l0
#define t_pc l1
#define t_npc l2
#define t_wim l3
#define twin_tmp1 l4
#define twin_tmp2 l5
#define twin_tmp3 l6
/* 7 WINDOW SPARC PATCH INSTRUCTIONS */
.globl rirq_7win_patch1, rirq_7win_patch2, rirq_7win_patch3
.globl rirq_7win_patch4, rirq_7win_patch5
rirq_7win_patch1: srl %t_wim, 0x6, %twin_tmp2
rirq_7win_patch2: and %twin_tmp2, 0x7f, %twin_tmp2
rirq_7win_patch3: srl %g1, 7, %g2
rirq_7win_patch4: srl %g2, 6, %g2
rirq_7win_patch5: and %g1, 0x7f, %g1
/* END OF PATCH INSTRUCTIONS */
.globl ret_irq_entry, rirq_patch1, rirq_patch2
.globl rirq_patch3, rirq_patch4, rirq_patch5
ret_irq_entry:
ld [%sp + REGWIN_SZ + PT_PSR], %t_psr
andcc %t_psr, PSR_PS, %g0
bne ret_irq_kernel
nop
ret_irq_user:
wr %t_psr, 0x0, %psr
WRITE_PAUSE
LOAD_CURRENT(twin_tmp2, twin_tmp1)
ld [%twin_tmp2 + THREAD_W_SAVED], %twin_tmp1
orcc %g0, %twin_tmp1, %g0
be ret_irq_nobufwins
nop
/* User has toasty windows, must grab klock. */
ENTER_SYSCALL
wr %t_psr, PSR_ET, %psr
WRITE_PAUSE
mov 1, %o1
call C_LABEL(try_to_clear_window_buffer)
add %sp, REGWIN_SZ, %o0
/* We have klock, so we must return just like a normal trap. */
b ret_trap_entry
nop
ret_irq_nobufwins:
/* Load up the user's out registers so we can pull
* a window from the stack, if necessary.
*/
LOAD_PT_INS(sp)
/* If there are already live user windows in the
* set we can return from trap safely.
*/
ld [%twin_tmp2 + THREAD_UMASK], %twin_tmp1
orcc %g0, %twin_tmp1, %g0
bne ret_irq_userwins_ok
nop
/* Calculate new %wim, we have to pull a register
* window from the users stack.
*/
ret_irq_pull_one_window:
rd %wim, %t_wim
sll %t_wim, 0x1, %twin_tmp1
rirq_patch1: srl %t_wim, 0x7, %twin_tmp2
or %twin_tmp2, %twin_tmp1, %twin_tmp2
rirq_patch2: and %twin_tmp2, 0xff, %twin_tmp2
wr %twin_tmp2, 0x0, %wim
WRITE_PAUSE
/* Here comes the architecture specific
* branch to the user stack checking routine
* for return from traps.
*/
.globl C_LABEL(rirq_mmu_patchme)
C_LABEL(rirq_mmu_patchme): b C_LABEL(sun4c_reti_stackchk)
andcc %fp, 0x7, %g0
ret_irq_userwins_ok:
LOAD_PT_PRIV(sp, t_psr, t_pc, t_npc)
or %t_pc, %t_npc, %g2
andcc %g2, 0x3, %g0
bne ret_irq_unaligned_pc
nop
LOAD_PT_YREG(sp, g1)
LOAD_PT_GLOBALS(sp)
wr %t_psr, 0x0, %psr
WRITE_PAUSE
jmp %t_pc
rett %t_npc
ret_irq_unaligned_pc:
add %sp, REGWIN_SZ, %o0
ld [%sp + REGWIN_SZ + PT_PC], %o1
ld [%sp + REGWIN_SZ + PT_NPC], %o2
ld [%sp + REGWIN_SZ + PT_PSR], %o3
wr %t_wim, 0x0, %wim ! or else...
WRITE_PAUSE
/* User has unaligned crap, must grab klock. */
ENTER_SYSCALL
wr %t_psr, PSR_ET, %psr
WRITE_PAUSE
call C_LABEL(do_memaccess_unaligned)
nop
/* We have klock, so we must return just like a normal trap. */
b ret_trap_entry
nop
ret_irq_kernel:
wr %t_psr, 0x0, %psr
WRITE_PAUSE
/* Will the rett land us in the invalid window? */
mov 2, %g1
sll %g1, %t_psr, %g1
rirq_patch3: srl %g1, 8, %g2
or %g1, %g2, %g1
rd %wim, %g2
andcc %g2, %g1, %g0
be 1f ! Nope, just return from the trap
nop
/* We have to grab a window before returning. */
sll %g2, 0x1, %g1
rirq_patch4: srl %g2, 7, %g2
or %g1, %g2, %g1
rirq_patch5: and %g1, 0xff, %g1
wr %g1, 0x0, %wim
WRITE_PAUSE
restore %g0, %g0, %g0
LOAD_WINDOW(sp)
save %g0, %g0, %g0
/* Reload the entire frame in case this is from a
* kernel system call or whatever...
*/
1:
LOAD_PT_ALL(sp, t_psr, t_pc, t_npc, g1)
wr %t_psr, 0x0, %psr
WRITE_PAUSE
jmp %t_pc
rett %t_npc
ret_irq_user_stack_is_bolixed:
wr %t_wim, 0x0, %wim
WRITE_PAUSE
/* User has a toasty window, must grab klock. */
ENTER_SYSCALL
wr %t_psr, PSR_ET, %psr
WRITE_PAUSE
call C_LABEL(window_ret_fault)
add %sp, REGWIN_SZ, %o0
/* We have klock, so we must return just like a normal trap. */
b ret_trap_entry
nop
.globl C_LABEL(sun4c_reti_stackchk)
C_LABEL(sun4c_reti_stackchk):
be 1f
and %fp, 0xfff, %g1 ! delay slot
b ret_irq_user_stack_is_bolixed
nop
/* See if we have to check the sanity of one page or two */
1:
add %g1, 0x38, %g1
sra %fp, 29, %g2
add %g2, 0x1, %g2
andncc %g2, 0x1, %g0
be 1f
andncc %g1, 0xff8, %g0
/* %sp is in vma hole, yuck */
b ret_irq_user_stack_is_bolixed
nop
1:
be sun4c_reti_onepage /* Only one page to check */
lda [%fp] ASI_PTE, %g2
sun4c_reti_twopages:
add %fp, 0x38, %g1
sra %g1, 29, %g2
add %g2, 0x1, %g2
andncc %g2, 0x1, %g0
be 1f
lda [%g1] ASI_PTE, %g2
/* Second page is in vma hole */
b ret_irq_user_stack_is_bolixed
nop
1:
srl %g2, 29, %g2
andcc %g2, 0x4, %g0
bne sun4c_reti_onepage
lda [%fp] ASI_PTE, %g2
/* Second page has bad perms */
b ret_irq_user_stack_is_bolixed
nop
sun4c_reti_onepage:
srl %g2, 29, %g2
andcc %g2, 0x4, %g0
bne 1f
nop
/* A page had bad page permissions, losing... */
b ret_irq_user_stack_is_bolixed
nop
/* Whee, things are ok, load the window and continue. */
1:
restore %g0, %g0, %g0
LOAD_WINDOW(sp)
save %g0, %g0, %g0
b ret_irq_userwins_ok
nop
.globl C_LABEL(srmmu_reti_stackchk)
C_LABEL(srmmu_reti_stackchk):
bne ret_irq_user_stack_is_bolixed
sethi %hi(KERNBASE), %g1
cmp %g1, %fp
bleu ret_irq_user_stack_is_bolixed
mov AC_M_SFSR, %g1
lda [%g1] ASI_M_MMUREGS, %g0
lda [%g0] ASI_M_MMUREGS, %g1
or %g1, 0x2, %g1
sta %g1, [%g0] ASI_M_MMUREGS
restore %g0, %g0, %g0
LOAD_WINDOW(sp)
save %g0, %g0, %g0
andn %g1, 0x2, %g1
sta %g1, [%g0] ASI_M_MMUREGS
mov AC_M_SFAR, %g2
lda [%g2] ASI_M_MMUREGS, %g2
mov AC_M_SFSR, %g1
lda [%g1] ASI_M_MMUREGS, %g1
andcc %g1, 0x2, %g0
bne ret_irq_user_stack_is_bolixed
nop
b ret_irq_userwins_ok
nop
/* $Id: rtrap.S,v 1.21 1996/02/20 07:45:11 davem Exp $
/* $Id: rtrap.S,v 1.27 1996/04/03 02:14:41 davem Exp $
* rtrap.S: Return from Sparc trap low-level code.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
......@@ -9,8 +9,10 @@
#include <asm/ptrace.h>
#include <asm/psr.h>
#include <asm/asi.h>
#include <asm/smp.h>
#include <asm/contregs.h>
#include <asm/winmacro.h>
#include <asm/asmmacro.h>
#define t_psr l0
#define t_pc l1
......@@ -90,19 +92,7 @@ ret_trap_continue:
wr %t_psr, 0x0, %psr
WRITE_PAUSE
/* If not current fpu proc, disable fp-ops */
LOAD_CURRENT(twin_tmp2, twin_tmp1)
set C_LABEL(last_task_used_math), %twin_tmp1
ld [%twin_tmp1], %twin_tmp1
cmp %twin_tmp2, %twin_tmp1
be 1f
nop
set PSR_EF, %twin_tmp1
andn %t_psr, %twin_tmp1, %t_psr
st %t_psr, [%sp + REGWIN_SZ + PT_PSR]
1:
ld [%twin_tmp2 + THREAD_W_SAVED], %twin_tmp1
orcc %g0, %twin_tmp1, %g0
be ret_trap_nobufwins
......@@ -163,22 +153,14 @@ ret_trap_userwins_ok:
LOAD_PT_YREG(sp, g1)
LOAD_PT_GLOBALS(sp)
LEAVE_SYSCALL
wr %t_psr, 0x0, %psr
WRITE_PAUSE
jmp %t_pc
rett %t_npc
/* HyperSparc special nop patching, if we are on a hypersparc
* we nop the top two instructions and the first nop coming
* up to be:
* rd %iccr, %g0 <-- flush on-chip instruction cache
* jmp %t_pc
* rett %t_npc
*/
nop
nop
ret_trap_unaligned_pc:
add %sp, REGWIN_SZ, %o0
ld [%sp + REGWIN_SZ + PT_PC], %o1
......@@ -231,6 +213,8 @@ rtrap_patch5: and %g1, 0xff, %g1
1:
LOAD_PT_ALL(sp, t_psr, t_pc, t_npc, g1)
LEAVE_SYSCALL
wr %t_psr, 0x0, %psr
WRITE_PAUSE
......
/* sclow.S: Low level special syscall handling.
* Basically these are cases where we can completely
* Basically these are cases where we can completly
* handle the system call without saving any state
* because we know that the process will not sleep.
*
......
/* $Id: setup.c,v 1.54 1996/02/25 06:49:18 davem Exp $
/* $Id: setup.c,v 1.60 1996/04/04 16:30:28 tridge Exp $
* linux/arch/sparc/kernel/setup.c
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
......@@ -13,6 +13,7 @@
#include <linux/ptrace.h>
#include <linux/malloc.h>
#include <linux/ldt.h>
#include <linux/smp.h>
#include <linux/user.h>
#include <linux/a.out.h>
#include <linux/tty.h>
......@@ -47,7 +48,6 @@ struct screen_info screen_info = {
16 /* orig-video-points */
};
char wp_works_ok = 0;
unsigned int phys_bytes_of_ram, end_of_phys_memory;
unsigned long bios32_init(unsigned long memory_start, unsigned long memory_end)
......@@ -55,7 +55,7 @@ unsigned long bios32_init(unsigned long memory_start, unsigned long memory_end)
return memory_start;
}
/* Typing sync at the prom prompt calls the function pointed to by
/* Typing sync at the prom promptcalls the function pointed to by
* romvec->pv_synchook which I set to the following function.
* This should sync all filesystems and return, for now it just
* prints out pretty messages and returns.
......@@ -63,7 +63,9 @@ unsigned long bios32_init(unsigned long memory_start, unsigned long memory_end)
extern unsigned long trapbase;
extern void breakpoint(void);
#if CONFIG_SUN_CONSOLE
extern void console_restore_palette(void);
#endif
asmlinkage void sys_sync(void); /* it's really int */
/* Pretty sick eh? */
......@@ -78,10 +80,12 @@ void prom_sync_me(void)
"nop\n\t"
"nop\n\t" : : "r" (&trapbase));
#if CONFIG_SUN_CONSOLE
console_restore_palette ();
#endif
prom_printf("PROM SYNC COMMAND...\n");
show_free_areas();
if(current != task[0]) {
if(current->pid != 0) {
sti();
sys_sync();
cli();
......@@ -104,6 +108,29 @@ unsigned int boot_flags;
#define BOOTME_SINGLE 0x2
#define BOOTME_KGDB 0x4
void kernel_enter_debugger(void)
{
if (boot_flags & BOOTME_KGDB) {
printk("KGDB: Entered\n");
breakpoint();
}
}
int obp_system_intr(void)
{
if (boot_flags & BOOTME_KGDB) {
printk("KGDB: system interrupted\n");
breakpoint();
return 1;
}
if (boot_flags & BOOTME_DEBUG) {
printk("OBP: system interrupted\n");
prom_halt();
return 1;
}
return 0;
}
/* This routine does no error checking, make sure your string is sane
* before calling this!
* XXX This is cheese, make generic and better.
......@@ -138,11 +165,19 @@ boot_flags_init(char *commands)
printk("KGDB: Using serial line /dev/tty%c for "
"session\n", commands[i+8]);
boot_flags |= BOOTME_KGDB;
#if CONFIG_SUN_SERIAL
if(commands[i+8]=='a')
rs_kgdb_hook(0);
else if(commands[i+8]=='b')
rs_kgdb_hook(1);
else {
else
#endif
#if CONFIG_AP1000
if(commands[i+8]=='c')
printk("KGDB: ap1000+ debugging\n");
else
#endif
{
printk("KGDB: whoops bogon tty line "
"requested, disabling session\n");
boot_flags &= (~BOOTME_KGDB);
......@@ -177,14 +212,21 @@ static struct pt_regs fake_swapper_regs = { 0, 0, 0, 0, { 0, } };
void setup_arch(char **cmdline_p,
unsigned long * memory_start_p, unsigned long * memory_end_p)
{
int total, i, panic_stuff[2];
int total, i, panic_stuff[2], packed;
#if CONFIG_AP1000
register_console(prom_printf);
((char *)(&cputypval))[4] = 'm'; /* ugly :-( */
#endif
#if 0
/* Always reboot on panic, but give 5 seconds to hit L1-A
* and look at debugging info if desired.
*/
panic_stuff[0] = 1;
panic_stuff[1] = 5;
panic_setup(0, panic_stuff);
#endif
sparc_ttable = (struct tt_entry *) &start;
......@@ -200,20 +242,25 @@ void setup_arch(char **cmdline_p,
if(!strcmp(&cputypval,"sun4e")) { sparc_cpu_model=sun4e; }
if(!strcmp(&cputypval,"sun4u")) { sparc_cpu_model=sun4u; }
printk("ARCH: ");
packed = 0;
switch(sparc_cpu_model)
{
case sun4c:
printk("SUN4C\n");
sun4c_probe_vac();
packed = 0;
break;
case sun4m:
printk("SUN4M\n");
packed = 1;
break;
case sun4d:
printk("SUN4D\n");
packed = 1;
break;
case sun4e:
printk("SUN4E\n");
packed = 0;
break;
case sun4u:
printk("SUN4U\n");
......@@ -238,18 +285,18 @@ void setup_arch(char **cmdline_p,
load_mmu();
total = prom_probe_memory();
*memory_start_p = (((unsigned long) &end));
#if 0
prom_printf("Physical Memory: %d bytes (in hex %08lx)\n", (int) total,
(unsigned long) total);
#endif
for(i=0; sp_banks[i].num_bytes != 0; i++) {
#if 0
printk("Bank %d: base 0x%x bytes %d\n", i,
(unsigned int) sp_banks[i].base_addr,
(int) sp_banks[i].num_bytes);
#endif
end_of_phys_memory = sp_banks[i].base_addr + sp_banks[i].num_bytes;
if(!packed) {
for(i=0; sp_banks[i].num_bytes != 0; i++)
end_of_phys_memory = sp_banks[i].base_addr +
sp_banks[i].num_bytes;
} else {
unsigned int sum = 0;
for(i = 0; sp_banks[i].num_bytes != 0; i++)
sum += sp_banks[i].num_bytes;
end_of_phys_memory = sum;
}
prom_setsync(prom_sync_me);
......@@ -266,6 +313,9 @@ void setup_arch(char **cmdline_p,
{
extern int serial_console; /* in console.c, of course */
#if !CONFIG_SUN_SERIAL
serial_console = 0;
#else
int idev = prom_query_input_device();
int odev = prom_query_output_device();
if (idev == PROMDEV_IKBD && odev == PROMDEV_OSCREEN) {
......@@ -279,6 +329,7 @@ void setup_arch(char **cmdline_p,
prom_printf("Inconsistent console\n");
prom_halt();
}
#endif
}
#if 1
/* XXX ROOT_DEV hack for kgdb - davem XXX */
......@@ -301,6 +352,8 @@ asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on)
extern char *sparc_cpu_type[];
extern char *sparc_fpu_type[];
extern char *smp_info(void);
int get_cpuinfo(char *buffer)
{
int cpuid=get_cpuid();
......@@ -308,23 +361,46 @@ int get_cpuinfo(char *buffer)
return sprintf(buffer, "cpu\t\t: %s\n"
"fpu\t\t: %s\n"
"promlib\t\t: Version %d Revision %d\n"
"wp\t\t: %s\n"
"type\t\t: %s\n"
"Elf Support\t: %s\n" /* I can't remember when I do --ralp */
#ifndef __SMP__
"BogoMips\t: %lu.%02lu\n"
"%s",
#else
"Cpu0Bogo\t: %lu.%02lu\n"
"Cpu1Bogo\t: %lu.%02lu\n"
"Cpu2Bogo\t: %lu.%02lu\n"
"Cpu3Bogo\t: %lu.%02lu\n"
#endif
"%s"
#ifdef __SMP__
"%s"
#endif
,
sparc_cpu_type[cpuid],
sparc_fpu_type[cpuid],
#if CONFIG_AP1000
0, 0,
#else
romvec->pv_romvers, prom_rev,
wp_works_ok ? "yes" : "no",
#endif
&cputypval,
#if CONFIG_BINFMT_ELF
"yes",
#else
"no",
#endif
#ifndef __SMP__
loops_per_sec/500000, (loops_per_sec/5000) % 100,
#else
cpu_data[0].udelay_val/500000, (cpu_data[0].udelay_val/5000)%100,
cpu_data[1].udelay_val/500000, (cpu_data[1].udelay_val/5000)%100,
cpu_data[2].udelay_val/500000, (cpu_data[2].udelay_val/5000)%100,
cpu_data[3].udelay_val/500000, (cpu_data[3].udelay_val/5000)%100,
#endif
mmu_info()
#ifdef __SMP__
, smp_info()
#endif
);
}
/* $Id: signal.c,v 1.28 1995/12/29 21:47:18 davem Exp $
/* $Id: signal.c,v 1.31 1996/04/18 01:00:41 davem Exp $
* linux/arch/sparc/kernel/signal.c
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
......@@ -58,24 +58,25 @@ asmlinkage void do_sigpause(unsigned int set, struct pt_regs *regs)
_sigpause_common(set, regs);
}
asmlinkage void do_sigsuspend(unsigned int *sigmaskp, struct pt_regs *regs)
asmlinkage void do_sigsuspend (struct pt_regs *regs)
{
unsigned int set;
unsigned long mask;
unsigned long set;
/* Manual does not state what is supposed to happen if
* the sigmask ptr is bogus. It does state that EINTR
* is the only valid return value and it indicates
* successful signal delivery. Must investigate.
*/
if(verify_area(VERIFY_READ, sigmaskp, sizeof(unsigned int))) {
set = regs->u_regs [UREG_I0];
mask = current->blocked;
current->blocked = set & _BLOCKABLE;
regs->pc = regs->npc;
regs->npc += 4;
regs->u_regs[UREG_I0] = EFAULT;
while (1) {
current->state = TASK_INTERRUPTIBLE;
schedule();
if (do_signal(mask,regs)){
regs->psr |= PSR_C;
regs->u_regs [UREG_I0] = EINTR;
return;
}
set = *sigmaskp;
_sigpause_common(set, regs);
}
}
asmlinkage void do_sigreturn(struct pt_regs *regs)
......@@ -152,10 +153,12 @@ setup_frame(struct sigaction *sa, struct sigcontext_struct **fp,
(((unsigned long) sframep) >= KERNBASE) ||
((sparc_cpu_model == sun4 || sparc_cpu_model == sun4c) &&
((unsigned long) sframep < 0xe0000000 && (unsigned long) sframep >= 0x20000000))) {
#if 0 /* fills up the console logs... */
printk("%s [%d]: User has trashed signal stack\n",
current->comm, current->pid);
printk("Sigstack ptr %p handler at pc<%08lx> for sig<%d>\n",
sframep, pc, signr);
#endif
/* Don't change signal code and address, so that
* post mortem debuggers can have a look.
*/
......
This diff is collapsed.
/* solaris.c: Solaris binary emulation, whee...
*
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
*/
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <asm/errno.h>
#include <asm/solerrno.h>
unsigned long solaris_xlatb_rorl[] = {
0, SOL_EPERM, SOL_ENOENT, SOL_ESRCH, SOL_EINTR, SOL_EIO,
SOL_ENXIO, SOL_E2BIG, SOL_ENOEXEC, SOL_EBADF, SOL_ECHILD,
SOL_EAGAIN, SOL_ENOMEM, SOL_EACCES, SOL_EFAULT,
SOL_ENOTBLK, SOL_EBUSY, SOL_EEXIST, SOL_EXDEV, SOL_ENODEV,
SOL_ENOTDIR, SOL_EISDIR, SOL_EINVAL, SOL_ENFILE, SOL_EMFILE,
SOL_ENOTTY, SOL_ETXTBSY, SOL_EFBIG, SOL_ENOSPC, SOL_ESPIPE,
SOL_EROFS, SOL_EMLINK, SOL_EPIPE, SOL_EDOM, SOL_ERANGE,
SOL_EWOULDBLOCK, SOL_EINPROGRESS, SOL_EALREADY, SOL_ENOTSOCK,
SOL_EDESTADDRREQ, SOL_EMSGSIZE, SOL_EPROTOTYPE, SOL_ENOPROTOOPT,
SOL_EPROTONOSUPPORT, SOL_ESOCKTNOSUPPORT, SOL_EOPNOTSUPP,
SOL_EPFNOSUPPORT, SOL_EAFNOSUPPORT, SOL_EADDRINUSE,
SOL_EADDRNOTAVAIL, SOL_ENETDOWN, SOL_ENETUNREACH, SOL_ENETRESET,
SOL_ECONNABORTED, SOL_ECONNRESET, SOL_ENOBUFS, SOL_EISCONN,
SOL_ENOTCONN, SOL_ESHUTDOWN, SOL_ETOOMANYREFS, SOL_ETIMEDOUT,
SOL_ECONNREFUSED, SOL_ELOOP, SOL_ENAMETOOLONG, SOL_EHOSTDOWN,
SOL_EHOSTUNREACH, SOL_ENOTEMPTY, SOL_EUSERS, SOL_EUSERS,
SOL_EDQUOT, SOL_ESTALE, SOL_EREMOTE, SOL_ENOSTR, SOL_ETIME,
SOL_ENOSR, SOL_ENOMSG, SOL_EBADMSG, SOL_EIDRM, SOL_EDEADLK,
SOL_ENOLCK, SOL_ENONET, SOL_EINVAL, SOL_ENOLINK, SOL_EADV,
SOL_ESRMNT, SOL_ECOMM, SOL_EPROTO, SOL_EMULTIHOP, SOL_EINVAL,
SOL_EREMCHG, SOL_ENOSYS
};
extern asmlinkage int sys_open(const char *,int,int);
asmlinkage int solaris_open(const char *filename, int flags, int mode)
{
int newflags = flags & 0xf;
flags &= ~0xf;
if(flags & 0x8050)
newflags |= FASYNC;
if(flags & 0x80)
newflags |= O_NONBLOCK;
if(flags & 0x100)
newflags |= O_CREAT;
if(flags & 0x200)
newflags |= O_TRUNC;
if(flags & 0x400)
newflags |= O_EXCL;
if(flags & 0x800)
newflags |= O_NOCTTY;
return sys_open(filename, newflags, mode);
}
/* $Id: sparc-stub.c,v 1.10 1996/02/15 09:12:09 davem Exp $
/* $Id: sparc-stub.c,v 1.15 1996/04/04 12:41:35 davem Exp $
* sparc-stub.c: KGDB support for the Linux kernel.
*
* Modifications to run under Linux
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
*
* This file originally came from the gdb sources, and the
* This file origionally came from the gdb sources, and the
* copyright notices have been retained below.
*/
......@@ -106,7 +106,7 @@
#include <asm/system.h>
#include <asm/vac-ops.h>
#include <asm/kgdb.h>
#include <asm/pgtable.h>
/*
*
* external low-level support routines
......@@ -163,6 +163,10 @@ unsigned long get_sun4csegmap(unsigned long addr)
return entry;
}
static void flush_cache_all_nop(void)
{
}
/* Place where we save old trap entries for restoration */
struct tt_entry kgdb_savettable[256];
typedef void (*trapfunc_t)(void);
......@@ -363,8 +367,12 @@ void
set_debug_traps(void)
{
struct hard_trap_info *ht;
unsigned long flags;
unsigned char c;
save_flags(flags); cli();
flush_cache_all = flush_cache_all_nop;
/* Initialize our copy of the Linux Sparc trap table */
eh_init();
......@@ -386,6 +394,7 @@ set_debug_traps(void)
putDebugChar('+'); /* ack it */
initialized = 1; /* connect! */
restore_flags(flags);
}
/* Convert the SPARC hardware trap type code to a unix signal number. */
......@@ -430,7 +439,7 @@ hexToInt(char **ptr, int *intValue)
}
/*
* This function does all command processing for interfacing to gdb. It
* This function does all command procesing for interfacing to gdb. It
* returns 1 if you should skip the instruction at the trap address, 0
* otherwise.
*/
......@@ -636,18 +645,7 @@ handle_exception (unsigned long *registers)
* breakpoint, and the icache probably has no way of knowing that a data ref to
* some location may have changed something that is in the instruction cache.
*/
/* Only instruction cache flushing on the sun4c/sun4
* for now. We assume control flow during the kgdb
* transaction has not left the context in which it
* was entered.
*/
if((sparc_cpu_model==sun4 || sparc_cpu_model==sun4c) &&
(sun4c_vacinfo.num_bytes && sun4c_vacinfo.on))
sun4c_flush_context();
/* XXX SRMMU and on-chip v8 instruction cache
* XXX flushing goes here!
*/
flush_cache_all();
return;
/* kill the program */
......
/* sun4c_irq.c
* arch/sparc/kernel/sun4c_irq.c:
*
* djhr: Hacked out of irq.c into a CPU dependant version.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
* Copyright (C) 1995 Miguel de Icaza (miguel@nuclecu.unam.mx)
* Copyright (C) 1995 Pete A. Zaitcev (zaitcev@ipmce.su)
* Copyright (C) 1996 Dave Redman (djhr@tadpole.co.uk)
*/
#include <linux/ptrace.h>
#include <linux/errno.h>
#include <linux/linkage.h>
#include <linux/kernel_stat.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/malloc.h>
#include <asm/ptrace.h>
#include <asm/processor.h>
#include <asm/system.h>
#include <asm/psr.h>
#include <asm/vaddrs.h>
#include <asm/timer.h>
#include <asm/openprom.h>
#include <asm/oplib.h>
#include <asm/traps.h>
#include <asm/irq.h>
#include <asm/io.h>
/* Pointer to the interrupt enable byte
*
* Dave Redman (djhr@tadpole.co.uk)
* What you may not be aware of is that entry.S requires this variable.
*
* --- linux_trap_nmi_sun4c --
*
* so don't go making it static, like I tried. sigh.
*/
unsigned char *interrupt_enable = 0;
static void sun4c_disable_irq(unsigned int irq_nr)
{
unsigned long flags;
unsigned char current_mask, new_mask;
save_flags(flags); cli();
irq_nr &= NR_IRQS;
current_mask = *interrupt_enable;
switch(irq_nr) {
case 1:
new_mask = ((current_mask) & (~(SUN4C_INT_E1)));
break;
case 8:
new_mask = ((current_mask) & (~(SUN4C_INT_E8)));
break;
case 10:
new_mask = ((current_mask) & (~(SUN4C_INT_E10)));
break;
case 14:
new_mask = ((current_mask) & (~(SUN4C_INT_E14)));
break;
default:
restore_flags(flags);
return;
}
*interrupt_enable = new_mask;
restore_flags(flags);
}
static void sun4c_enable_irq(unsigned int irq_nr)
{
unsigned long flags;
unsigned char current_mask, new_mask;
save_flags(flags); cli();
irq_nr &= NR_IRQS;
current_mask = *interrupt_enable;
switch(irq_nr) {
case 1:
new_mask = ((current_mask) | SUN4C_INT_E1);
break;
case 8:
new_mask = ((current_mask) | SUN4C_INT_E8);
break;
case 10:
new_mask = ((current_mask) | SUN4C_INT_E10);
break;
case 14:
new_mask = ((current_mask) | SUN4C_INT_E14);
break;
default:
restore_flags(flags);
return;
}
*interrupt_enable = new_mask;
restore_flags(flags);
}
#define TIMER_IRQ 10 /* Also at level 14, but we ignore that one. */
#define PROFILE_IRQ 14 /* Level14 ticker.. used by OBP for polling */
volatile struct sun4c_timer_info *sun4c_timers;
static void sun4c_clear_clock_irq(void)
{
volatile unsigned int clear_intr;
clear_intr = sun4c_timers->timer_limit10;
}
static void sun4c_clear_profile_irq(void )
{
/* Errm.. not sure how to do this.. */
}
static void sun4c_load_profile_irq(unsigned int limit)
{
/* Errm.. not sure how to do this.. */
}
static void sun4c_init_timers(void (*counter_fn)(int, void *, struct pt_regs *))
{
int irq;
/* Map the Timer chip, this is implemented in hardware inside
* the cache chip on the sun4c.
*/
sun4c_timers = sparc_alloc_io ((void *) SUN4C_TIMER_PHYSADDR, 0,
sizeof(struct sun4c_timer_info),
"timer", 0x0, 0x0);
/* Have the level 10 timer tick at 100HZ. We don't touch the
* level 14 timer limit since we are letting the prom handle
* them until we have a real console driver so L1-A works.
*/
sun4c_timers->timer_limit10 = (((1000000/HZ) + 1) << 10);
irq = request_irq(TIMER_IRQ,
counter_fn,
(SA_INTERRUPT | SA_STATIC_ALLOC),
"timer", NULL);
if (irq) {
prom_printf("time_init: unable to attach IRQ%d\n",TIMER_IRQ);
prom_halt();
}
claim_ticker14(NULL, PROFILE_IRQ, 0);
}
static void sun4c_nop(void)
{
}
void sun4c_init_IRQ(void)
{
struct linux_prom_registers int_regs[2];
int ie_node;
ie_node = prom_searchsiblings (prom_getchild(prom_root_node),
"interrupt-enable");
if(ie_node == 0)
panic("Cannot find /interrupt-enable node");
/* Depending on the "address" property is bad news... */
prom_getproperty(ie_node, "reg", (char *) int_regs, sizeof(int_regs));
interrupt_enable = (char *) sparc_alloc_io(int_regs[0].phys_addr, 0,
int_regs[0].reg_size,
"sun4c_interrupts",
int_regs[0].which_io, 0x0);
enable_irq = sun4c_enable_irq;
disable_irq = sun4c_disable_irq;
clear_clock_irq = sun4c_clear_clock_irq;
clear_profile_irq = sun4c_clear_profile_irq;
load_profile_irq = sun4c_load_profile_irq;
init_timers = sun4c_init_timers;
#ifdef __SMP__
set_cpu_int = sun4c_nop;
clear_cpu_int = sun4c_nop;
set_irq_udt = sun4c_nop;
#endif
*interrupt_enable = (SUN4C_INT_ENABLE);
sti();
}
/* sun4m_irq.c
* arch/sparc/kernel/sun4m_irq.c:
*
* djhr: Hacked out of irq.c into a CPU dependant version.
*
* Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
* Copyright (C) 1995 Miguel de Icaza (miguel@nuclecu.unam.mx)
* Copyright (C) 1995 Pete A. Zaitcev (zaitcev@ipmce.su)
* Copyright (C) 1996 Dave Redman (djhr@tadpole.co.uk)
*/
#include <linux/ptrace.h>
#include <linux/errno.h>
#include <linux/linkage.h>
#include <linux/kernel_stat.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/smp.h>
#include <linux/interrupt.h>
#include <linux/malloc.h>
#include <asm/ptrace.h>
#include <asm/processor.h>
#include <asm/system.h>
#include <asm/psr.h>
#include <asm/vaddrs.h>
#include <asm/timer.h>
#include <asm/openprom.h>
#include <asm/oplib.h>
#include <asm/traps.h>
#include <asm/smp.h>
#include <asm/irq.h>
#include <asm/io.h>
static unsigned long dummy;
extern int linux_num_cpus;
struct sun4m_intregs *sun4m_interrupts;
unsigned long *irq_rcvreg = &dummy;
/* These tables only apply for interrupts greater than 15..
*
* any intr value below 0x10 is considered to be a soft-int
* this may be useful or it may not.. but thats how I've done it.
* and it won't clash with what OBP is telling us about devices.
*
* take an encoded intr value and lookup if its valid
* then get the mask bits that match from irq_mask
*/
static unsigned char irq_xlate[32] = {
/* 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f */
0, 0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 5, 6, 0, 0, 7,
0, 0, 8, 9, 0, 10, 0, 11, 0, 12, 0, 13, 0, 14, 0, 0
};
static unsigned long irq_mask[] = {
0, /* illegal index */
SUN4M_INT_SCSI, /* 1 irq 4 */
SUN4M_INT_ETHERNET, /* 2 irq 6 */
SUN4M_INT_VIDEO, /* 3 irq 8 */
SUN4M_INT_REALTIME, /* 4 irq 10 */
SUN4M_INT_FLOPPY, /* 5 irq 11 */
(SUN4M_INT_SERIAL | SUN4M_INT_KBDMS), /* 6 irq 12 */
SUN4M_INT_MODULE_ERR, /* 7 irq 15 */
SUN4M_INT_SBUS(1), /* 8 irq 2 */
SUN4M_INT_SBUS(2), /* 9 irq 3 */
SUN4M_INT_SBUS(3), /* 10 irq 5 */
SUN4M_INT_SBUS(4), /* 11 irq 7 */
SUN4M_INT_SBUS(5), /* 12 irq 9 */
SUN4M_INT_SBUS(6), /* 13 irq 11 */
SUN4M_INT_SBUS(7) /* 14 irq 13 */
};
inline unsigned long sun4m_get_irqmask(unsigned int irq)
{
unsigned long mask;
if (irq > 0x20) {
/* OBIO/SBUS interrupts */
irq &= 0x1f;
mask = irq_mask[irq_xlate[irq]];
if (!mask)
printk("sun4m_get_irqmask: IRQ%d has no valid mask!\n",irq);
} else {
/* Soft Interrupts will come here
* Currently there is no way to trigger them but I'm sure something
* could be cooked up.
*/
irq &= 0xf;
mask = SUN4M_SOFT_INT(irq);
}
return mask;
}
static void sun4m_disable_irq(unsigned int irq_nr)
{
unsigned long mask, flags;
int cpu = smp_processor_id();
mask = sun4m_get_irqmask(irq_nr);
save_flags(flags); cli();
if (irq_nr > 15)
sun4m_interrupts->set = mask;
else
sun4m_interrupts->cpu_intregs[cpu].set = mask;
restore_flags(flags);
}
static void sun4m_enable_irq(unsigned int irq_nr)
{
unsigned long mask, flags;
int cpu = smp_processor_id();
/* Dreadful floppy hack. When we use 0x2b instead of
* 0x0b the system blows (it starts to whistle!).
* So we continue to use 0x0b. Fixme ASAP. --P3
*/
if (irq_nr != 0x0b) {
mask = sun4m_get_irqmask(irq_nr);
save_flags(flags); cli();
if (irq_nr > 15)
sun4m_interrupts->clear = mask;
else
sun4m_interrupts->cpu_intregs[cpu].clear = mask;
restore_flags(flags);
} else {
save_flags(flags); cli();
sun4m_interrupts->clear = SUN4M_INT_FLOPPY;
restore_flags(flags);
}
}
void sun4m_send_ipi(int cpu, int level)
{
unsigned long mask;
mask = sun4m_get_irqmask(level);
sun4m_interrupts->cpu_intregs[cpu].set = mask;
}
void sun4m_clear_ipi(int cpu, int level)
{
unsigned long mask;
mask = sun4m_get_irqmask(level);
sun4m_interrupts->cpu_intregs[cpu].clear = mask;
}
void sun4m_set_udt(int cpu)
{
sun4m_interrupts->undirected_target = cpu;
}
#define OBIO_INTR 0x20
#define TIMER_IRQ (OBIO_INTR | 10)
#define PROFILE_IRQ (OBIO_INTR | 14)
struct sun4m_timer_regs *sun4m_timers;
unsigned int lvl14_resolution = (((1000000/HZ) + 1) << 10);
static void sun4m_clear_clock_irq(void)
{
volatile unsigned int clear_intr;
clear_intr = sun4m_timers->l10_timer_limit;
}
static void sun4m_clear_profile_irq(void)
{
volatile unsigned int clear;
clear = sun4m_timers->cpu_timers[0].l14_timer_limit;
}
static void sun4m_load_profile_irq(unsigned int limit)
{
sun4m_timers->cpu_timers[0].l14_timer_limit = limit;
}
static void sun4m_lvl14_handler(int irq, void *dev_id, struct pt_regs * regs)
{
volatile unsigned int clear;
printk("CPU[%d]: TOOK A LEVEL14!\n", smp_processor_id());
/* we do nothing with this at present
* this is purely to prevent OBP getting its mucky paws
* in linux.
*/
clear = sun4m_timers->cpu_timers[0].l14_timer_limit; /* clear interrupt */
/* reload with value, this allows on the fly retuning of the level14
* timer
*/
sun4m_timers->cpu_timers[0].l14_timer_limit = lvl14_resolution;
}
static void sun4m_init_timers(void (*counter_fn)(int, void *, struct pt_regs *))
{
int reg_count, irq, cpu;
struct linux_prom_registers cnt_regs[PROMREG_MAX];
int obio_node, cnt_node;
cnt_node = 0;
if((obio_node =
prom_searchsiblings (prom_getchild(prom_root_node), "obio")) == 0 ||
(obio_node = prom_getchild (obio_node)) == 0 ||
(cnt_node = prom_searchsiblings (obio_node, "counter")) == 0) {
prom_printf("Cannot find /obio/counter node\n");
prom_halt();
}
reg_count = prom_getproperty(cnt_node, "reg",
(void *) cnt_regs, sizeof(cnt_regs));
reg_count = (reg_count/sizeof(struct linux_prom_registers));
/* Apply the obio ranges to the timer registers. */
prom_apply_obio_ranges(cnt_regs, reg_count);
cnt_regs[4].phys_addr = cnt_regs[reg_count-1].phys_addr;
cnt_regs[4].reg_size = cnt_regs[reg_count-1].reg_size;
cnt_regs[4].which_io = cnt_regs[reg_count-1].which_io;
for(obio_node = 1; obio_node < 4; obio_node++) {
cnt_regs[obio_node].phys_addr =
cnt_regs[obio_node-1].phys_addr + PAGE_SIZE;
cnt_regs[obio_node].reg_size = cnt_regs[obio_node-1].reg_size;
cnt_regs[obio_node].which_io = cnt_regs[obio_node-1].which_io;
}
/* Map the per-cpu Counter registers. */
sun4m_timers = sparc_alloc_io(cnt_regs[0].phys_addr, 0,
PAGE_SIZE*NCPUS, "counters_percpu",
cnt_regs[0].which_io, 0x0);
/* Map the system Counter register. */
sparc_alloc_io(cnt_regs[4].phys_addr, 0,
cnt_regs[4].reg_size,
"counters_system",
cnt_regs[4].which_io, 0x0);
sun4m_timers->l10_timer_limit = (((1000000/HZ) + 1) << 10);
irq = request_irq(TIMER_IRQ,
counter_fn,
(SA_INTERRUPT | SA_STATIC_ALLOC),
"timer", NULL);
if (irq) {
prom_printf("time_init: unable to attach IRQ%d\n",TIMER_IRQ);
prom_halt();
}
/* Can't cope with multiple CPUS yet so no level14 tick events */
#if 0
if (linux_num_cpus > 1)
claim_ticker14(NULL, PROFILE_IRQ, 0);
else
claim_ticker14(sun4m_lvl14_handler, PROFILE_IRQ, lvl14_resolution);
#endif
if(linux_num_cpus > 1) {
for(cpu = 0; cpu < 4; cpu++)
sun4m_timers->cpu_timers[cpu].l14_timer_limit = 0;
sun4m_interrupts->set = SUN4M_INT_E14;
} else {
sun4m_timers->cpu_timers[0].l14_timer_limit = 0;
}
}
void sun4m_init_IRQ(void)
{
int ie_node,i;
struct linux_prom_registers int_regs[PROMREG_MAX];
int num_regs;
cli();
if((ie_node = prom_searchsiblings(prom_getchild(prom_root_node), "obio")) == 0 ||
(ie_node = prom_getchild (ie_node)) == 0 ||
(ie_node = prom_searchsiblings (ie_node, "interrupt")) == 0) {
prom_printf("Cannot find /obio/interrupt node\n");
prom_halt();
}
num_regs = prom_getproperty(ie_node, "reg", (char *) int_regs,
sizeof(int_regs));
num_regs = (num_regs/sizeof(struct linux_prom_registers));
/* Apply the obio ranges to these registers. */
prom_apply_obio_ranges(int_regs, num_regs);
int_regs[4].phys_addr = int_regs[num_regs-1].phys_addr;
int_regs[4].reg_size = int_regs[num_regs-1].reg_size;
int_regs[4].which_io = int_regs[num_regs-1].which_io;
for(ie_node = 1; ie_node < 4; ie_node++) {
int_regs[ie_node].phys_addr = int_regs[ie_node-1].phys_addr + PAGE_SIZE;
int_regs[ie_node].reg_size = int_regs[ie_node-1].reg_size;
int_regs[ie_node].which_io = int_regs[ie_node-1].which_io;
}
/* Map the interrupt registers for all possible cpus. */
sun4m_interrupts = sparc_alloc_io(int_regs[0].phys_addr, 0,
PAGE_SIZE*NCPUS, "interrupts_percpu",
int_regs[0].which_io, 0x0);
/* Map the system interrupt control registers. */
sparc_alloc_io(int_regs[4].phys_addr, 0,
int_regs[4].reg_size, "interrupts_system",
int_regs[4].which_io, 0x0);
sun4m_interrupts->set = ~SUN4M_INT_MASKALL;
for (i=0; i<linux_num_cpus; i++)
sun4m_interrupts->cpu_intregs[i].clear = ~0x17fff;
if (linux_num_cpus > 1) {
/* system wide interrupts go to cpu 0, this should always
* be safe because it is guarenteed to be fitted or OBP doesn't
* come up
*
* Not sure, but writing here on SLAVIO systems may puke
* so I don't do it unless there is more than 1 cpu.
*/
#if 0
printk("Warning:"
"sun4m multiple CPU interrupt code requires work\n");
#endif
irq_rcvreg = &sun4m_interrupts->undirected_target;
sun4m_interrupts->undirected_target = 0;
}
enable_irq = sun4m_enable_irq;
disable_irq = sun4m_disable_irq;
clear_clock_irq = sun4m_clear_clock_irq;
clear_profile_irq = sun4m_clear_profile_irq;
load_profile_irq = sun4m_load_profile_irq;
init_timers = sun4m_init_timers;
#ifdef __SMP__
set_cpu_int = sun4m_send_ipi;
clear_cpu_int = sun4m_clear_ipi;
set_irq_udt = sun4m_set_udt;
#endif
sti();
}
/* $Id: sunos_asm.S,v 1.10 1995/12/26 04:09:33 davem Exp $
/* $Id: sunos_asm.S,v 1.12 1996/04/03 02:14:57 davem Exp $
* sunos_asm.S: SunOS system calls which must have a low-level
* entry point to operate correctly.
*
......@@ -73,8 +73,8 @@ C_LABEL(sunos_execv):
call C_LABEL(sparc_execve)
add %sp, REGWIN_SZ, %o0
st %o0, [%sp + REGWIN_SZ + PT_I0]
b C_LABEL(ret_sys_call)
nop
/* $Id: sunos_ioctl.c,v 1.17 1996/02/10 04:29:20 davem Exp $
/* $Id: sunos_ioctl.c,v 1.18 1996/04/04 12:41:38 davem Exp $
* sunos_ioctl.c: The Linux Operating system: SunOS ioctl compatibility.
*
* Copyright (C) 1995 Miguel de Icaza (miguel@nuclecu.unam.mx)
......@@ -15,6 +15,7 @@
#include <linux/route.h>
#include <linux/sockios.h>
#include <linux/if.h>
#include <linux/netdevice.h>
#include <linux/if_arp.h>
#include <linux/fs.h>
#include <linux/mm.h>
......@@ -52,7 +53,7 @@ asmlinkage int sunos_ioctl (int fd, unsigned long cmd, unsigned long arg)
}
}
/* Binary compatibility is good American knowhow fuckin' up. */
/* Binary compatability is good American knowhow fuckin' up. */
if(cmd == TIOCNOTTY)
return sys_setsid();
......
This diff is collapsed.
/* sys_bsd.c: {net, open}bsd specific system call handling.
*
* Copyright (C) 1995 David S. Miller (davem@caipfs.rutgers.edu)
*/
#include <linux/kernel.h>
#include <asm/ptrace.h>
#include <asm/bsderrno.h>
static int errno_trans[] = {
0,
BSD_EPERM, BSD_ENOENT, BSD_ESRCH, BSD_EINTR, BSD_EIO,
BSD_ENXIO, BSD_E2BIG, BSD_ENOEXEC, BSD_EBADF, BSD_ECHILD,
BSD_EAGAIN, BSD_ENOMEM, BSD_EACCES, BSD_EFAULT, BSD_ENOTBLK,
BSD_EBUSY, BSD_EEXIST, BSD_EXDEV, BSD_ENODEV, BSD_ENOTDIR,
BSD_EISDIR, BSD_EINVAL, BSD_ENFILE, BSD_EMFILE, BSD_ENOTTY,
BSD_ETXTBSY, BSD_EFBIG, BSD_ENOSPC, BSD_ESPIPE, BSD_EROFS,
BSD_EMLINK, BSD_EPIPE, BSD_EDOM, BSD_ERANGE, BSD_EWOULDBLOCK,
BSD_EINPROGRESS, BSD_EALREADY, BSD_ENOTSOCK, BSD_EDESTADDRREQ,
BSD_EMSGSIZE, BSD_EPROTOTYPE, BSD_ENOPROTOOPT, BSD_EPROTONOSUPPORT,
BSD_ESOCKTNOSUPPORT, BSD_EOPNOTSUPP, BSD_EPFNOSUPPORT, BSD_EAFNOSUPPORT,
BSD_EADDRINUSE,
BSD_EADDRNOTAVAIL, BSD_ENETDOWN, BSD_ENETUNREACH, BSD_ENETRESET,
BSD_ECONNABORTED, BSD_ECONNRESET, BSD_ENOBUFS, BSD_EISCONN,
BSD_ENOTCONN, BSD_ESHUTDOWN, BSD_ETOOMANYREFS, BSD_ETIMEDOUT,
BSD_ECONNREFUSED, BSD_ELOOP, BSD_ENAMETOOLONG, BSD_EHOSTDOWN,
BSD_EHOSTUNREACH, BSD_ENOTEMPTY, BSD_EPROCLIM, BSD_EUSERS,
BSD_EDQUOT, BSD_ESTALE, BSD_EREMOTE, BSD_ENOSTR, BSD_ETIME,
BSD_ENOSR, BSD_ENOMSG, BSD_EBADMSG, BSD_EIDRM, BSD_EDEADLK,
BSD_ENOLCK, BSD_ENONET, BSD_ERREMOTE, BSD_ENOLINK, BSD_EADV,
BSD_ESRMNT, BSD_ECOMM, BSD_EPROTO, BSD_EMULTIHOP, BSD_EDOTDOT,
BSD_EREMCHG, BSD_ENOSYS
};
asmlinkage int netbsd_nosys(void)
{
struct pt_regs *regs;
regs = (struct pt_regs *) (current->saved_kernel_stack +
sizeof(struct reg_window));
current->tss.sig_address = regs->pc;
current->tss.sig_desc = regs->u_regs[UREG_G1];
send_sig(SIGSYS, current, 1);
printk("Process makes ni_syscall number %d, register dump:\n",
(int) regs->u_regs[UREG_G1]);
show_regs(regs);
return -BSD_ENOSYS;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -10,3 +10,4 @@ if [ "$CONFIG_INET" != "n" ]; then
fi
dep_tristate 'Teles/NICCY1016PC/Creatix support' CONFIG_ISDN_DRV_TELES $CONFIG_ISDN
dep_tristate 'ICN B1 and B2 support' CONFIG_ISDN_DRV_ICN $CONFIG_ISDN
dep_tristate 'PCBIT-D support' CONFIG_ISDN_DRV_PCBIT $CONFIG_ISDN
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment