Commit 001e3f20 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.3.55

parent 81e6c66d
......@@ -543,7 +543,7 @@ D: The Linux Support Team Erlangen
N: Markus Kuhn
E: mskuhn@cip.informatik.uni-erlangen.de
W: http://wwwcip.informatik.uni-erlangen.de/user/mskuhn
D: Unicode, time, standards
D: Unicode, real-time, time, standards
S: Schlehenweg 9
S: D-91080 Uttenreuth
S: Germany
......@@ -902,10 +902,10 @@ D: several improvements to system programs
S: Oldenburg, Germany
N: Darren Senn
E: sinster@scintilla.santa-clara.ca.us
E: sinster@darkwater.com
D: Whatever I notice needs doing (so far: itimers, /proc)
S: 620 Park View Drive #206
S: Santa Clara, California 95054
S: POB 64132
S: Sunnyvale, CA 94088-4132
S: USA
N: Rick Sladkey
......
This diff is collapsed.
This README belongs to release 3.9 or newer of the SoundBlaster Pro
This README belongs to release 4.1 or newer of the SoundBlaster Pro
(Matsushita, Kotobuki, Panasonic, CreativeLabs, Longshine and TEAC)
CD-ROM driver for Linux.
......@@ -28,6 +28,9 @@ CR-574 is an IDE/ATAPI drive.
The Longshine LCS-7260 is a double-speed drive which uses the "old"
Matsushita command set. It is supported - with help by Serge Robyns.
Vertos ("Elitegroup Computer Systems", ECS) has a similar drive - support
has started; come in contact if you have such a "Vertos 100" or "ECS-AT"
drive.
There exists an "IBM External ISA CD-ROM Drive" which in fact is a CR-563
with a special controller board. This drive is supported (the interface is
......@@ -36,10 +39,12 @@ an internal drive, and you can use it as an internal, too - f.e. plug it into
a soundcard).
CreativeLabs has a new drive "CD200" and a similar drive "CD200F". The latter
is made by Funai and sometimes named "E2550UA". Support is under construction
- CD200F should work, CD200 is still giving problems.
Drive detection and playing audio should work. I need qualified feedback
about the bugs within the data functions or a drive (I never saw a CD200).
is made by Funai and sometimes named "E2550UA", newer models may be named
"MK4015". The CD200F drives should fully work.
CD200 drives without "F" are still giving problems: drive detection and
playing audio should work, data access will result in errors. I need qualified
feedback about the bugs within the data functions or a drive (I never saw a
CD200).
The quad-speed TEAC CD-55A drive is supported, but still does not reach "full
speed". The data rate already reaches 500 kB/sec if you set SBP_BUFFER_FRAMES
......@@ -63,21 +68,21 @@ the IDE/ATAPI user questions disappear).
This driver will work with the soundcard interfaces (SB Pro, SB 16, Galaxy,
SoundFX, Mozart, ...) and with the "no-sound" cards (Panasonic CI-101P,
SoundFX, Mozart, MAD16 ...) and with the "no-sound" cards (Panasonic CI-101P,
LaserMate, WDH-7001C, Longshine LCS-6853, TEAC ...).
It finally works now with the "configurable" interface "Sequoia S-1000", too,
which is found on the Spea Media FX and Ensonic Soundscape sound cards. You
have to specify the type "SBPRO 2" and the true CDROM port address with it,
not the "configuration port" address.
It works with the "configurable" interface "Sequoia S-1000", too, which is
used on the Spea Media FX and Ensonic Soundscape sound cards. You have to
specify the type "SBPRO 2" and the true CDROM port address with it, not the
"configuration port" address.
If you have a sound card which needs a "configuration driver" instead of
jumpers for interface types and addresses (like Mozart cards) - those
drivers get invoked before the DOS CDROM driver in your CONFIG.SYS, typical
names are "cdsetup.sys" and "mztinit.sys" -, let the sound driver do the
CDROM port configuration (the leading comments within
linux/drivers/sound/mad16.c are just for you!). Hannu Savolainen's mad16.c
code is able to set up my Mozart card - I simply had to add
CDROM port configuration (the leading comments in linux/drivers/sound/mad16.c
are just for you!). Hannu Savolainen's mad16.c code is able to set up my
Mozart card - I simply had to add
#define MAD16_CONF 0x06
#define MAD16_CDSEL 0x03
to configure the CDROM interface for type "Panasonic" (LaserMate) and address
......@@ -133,8 +138,11 @@ different address and a second cable.
The driver supports reading of data from the CD and playing of audio tracks.
The audio part should run with WorkMan, xcdplayer, with the "non-X11" products
CDplayer and WorkBone - tell me if it is not compatible with other software.
The only accepted measure for correctness with the audio functions is the
"cdtester" utility (appended) - most audio player programmers seem to be
better musicians than programmers. ;-)
With the CR-562 and CR-563 drives, the reading of audio frames is possible.
With the CR-56x and the CD200 drives, the reading of audio frames is possible.
This is implemented by an IOCTL function which reads READ_AUDIO frames of
2352 bytes at once (configurable with the "READ_AUDIO" define, default is 0).
Reading the same frame a second time gives different data; the frame data
......@@ -163,8 +171,8 @@ XA (PhotoCD) disks with "old" drives give only 50 kB/sec.
This release consists of
- this README file
- the driver file linux/drivers/block/sbpcd.c
- the stub files linux/drivers/block/sbpcd[234].c
- the driver file linux/drivers/cdrom/sbpcd.c
- the stub files linux/drivers/cdrom/sbpcd[234].c
- the header file linux/include/linux/sbpcd.h.
......@@ -185,9 +193,9 @@ To install:
Most "compatible" sound cards (almost all "non-CreativeLabs" cards)
need "SBPRO 0".
The "no-sound" board from OmniCd needs the "SBPRO 1" setup.
All other "no-sound" boards need the "SBPRO 0" setup.
Possibly some TEAC "no-sound" boards need the "SBPRO 1" setup.
The Spea Media FX sound card needs "SBPRO 2".
All other "no-sound" boards need the "SBPRO 0" setup.
The Spea Media FX and Ensoniq SoundScape cards need "SBPRO 2".
sbpcd.c holds some examples in its auto-probe list.
If you configure "SBPRO" wrong, the playing of audio CDs will work,
but you will not be able to mount a data CD.
......@@ -200,10 +208,10 @@ To install:
or
sbpcd=0x320,LaserMate
or
sbpcd=0x330,SPEA
sbpcd=0x338,SoundScape
This is especially useful if you install a fresh distribution.
If the second parameter is a number, it gets taken as the type
setting; 0 is "LaserMate", 1 is "SoundBlaster".
setting; 0 is "LaserMate", 1 is "SoundBlaster", 2 is "SoundScape".
So, for example
sbpcd=0x230,1
is equivalent to
......@@ -257,7 +265,7 @@ Using sbpcd as a "loadable module":
If you do NOT select "Matsushita/Panasonic CDROM driver support" during the
"make config" of your kernel, you can build the "loadable module" sbpcd.o.
Read /usr/src/linux/README.modules on this.
Read /usr/src/linux/Documentation/modules.txt on this.
If sbpcd gets used as a module, the support of more than one interface
card (i.e. drives 4...15) is disabled.
......@@ -266,6 +274,8 @@ You can specify interface address and type with the "insmod" command like:
# insmod /usr/src/linux/modules/sbpcd.o sbpcd=0x340,0
or
# insmod /usr/src/linux/modules/sbpcd.o sbpcd=0x230,1
or
# insmod /usr/src/linux/modules/sbpcd.o sbpcd=0x338,2
where the last number represents the SBPRO setting (no strings allowed here).
......@@ -281,7 +291,7 @@ No DMA and no IRQ is used.
To reduce or increase the amount of kernel messages, edit sbpcd.c and play
with the "DBG_xxx" switches (initialization of the variable "sbpcd_debug").
Don't forget to reflect what you do; enabling all DBG_xxx switches at once
may crash your system.
may crash your system, and each message line is accompanied by a delay.
The driver uses the "variable BLOCK_SIZE" feature. To use it, you have to
specify "block=2048" as a mount option. Doing this will disable the direct
......@@ -518,9 +528,7 @@ drives are mostly telling there is no UPC/EAN code on disk or there is, but it
is an all-zero number. I guess now almost no CD holds such a number.
Bug reports, comments, wishes, donations (technical information is a donation,
too :-) etc. to
emoenke@gwdg.de
or to my FIDO address: Eberhard Moenkeberg, 2:2437/210.27
too :-) etc. to emoenke@gwdg.de.
SnailMail address, preferable for CD editors if they want to submit a free
"cooperation" copy:
......
......@@ -42,7 +42,7 @@ foo \kill}%
%
\title{{\bf Linux Allocated Devices}}
\author{Maintained by H. Peter Anvin $<$hpa@storm.net$>$}
\date{Last revised: December 17, 1995}
\date{Last revised: January 5, 1996}
\maketitle
%
\noindent
......@@ -149,7 +149,10 @@ an unreasonable effort.
\major{39}{}{char }{Reserved for ncpfs $<$lendecke@namu01.gwdg.de$>$}
\major{40}{--41}{}{Unallocated}
\major{42}{}{}{Demo/sample use}
\major{43}{--59}{}{Unallocated}
\major{43}{}{char }{isdn4linux virtual modem}
\major{44}{}{char }{isdn4linux virtual modem -- alternate devices}
\major{45}{}{char }{isdn4linux ISDN BRI driver}
\major{46}{--59}{}{Unallocated}
\major{60}{--63}{}{Local/experimental use}
\major{64}{--119}{}{Unallocated}
\major{120}{--127}{}{Local/experimental use}
......@@ -673,9 +676,14 @@ disk (same as SCSI.)
\major{29}{}{char }{Universal frame buffer}
\minor{0}{/dev/fb0current}{First frame buffer}
\minor{1}{/dev/fb0autodetect}{}
\minor{24}{/dev/fb0user0}{}
\minordots
\minor{31}{/dev/fb0user7}{}
\minor{32}{/dev/fb1current}{Second frame buffer}
\minor{33}{/dev/fb1autodetect}{}
\minor{56}{/dev/fb1user0}{}
\minordots
\minor{63}{/dev/fb1user7}{}
\minordots
\end{devicelist}
......@@ -683,9 +691,11 @@ disk (same as SCSI.)
The universal frame buffer device is currently supported only on
Linux/68k. The {\file current} device accesses the frame buffer at
current resolution; the {\file autodetect} one at bootup (default)
resolution. Minor numbers 2--31 within each frame buffer assignment
resolution. Minor numbers 2--23 within each frame buffer assignment
are used for specific device-dependent resolutions. There appears to
be no standard naming for these devices.
be no standard naming for these devices. Finally, 24--31 within each
device are reserved for user-selected modes, usually entered at boot
time.
\begin{devicelist}
\major{ }{}{block}{Aztech/Orchid/Okano/Wearnes CD-ROM}
......@@ -868,7 +878,32 @@ driver with this number should not cause ill effects to the system
(bugs excepted.)
\begin{devicelist}
\major{43}{--59}{}{Unallocated}
\major{43}{}{char }{isdn4linux virtual modem}
\minor{0}{/dev/ttyI0}{First virtual modem}
\minordots
\minor{15}{/dev/ttyI15}{16th 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}}
\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}
\minordots
\minor{31}{/dev/isdnctrl15}{16th channel control/debug}
\minor{128}{/dev/isdninfo}{ISDN monitor interface}
\end{devicelist}
\begin{devicelist}
\major{46}{--59}{}{Unallocated}
\end{devicelist}
\begin{devicelist}
......@@ -972,7 +1007,8 @@ point to the ``cooked'' devices ({\file /dev/st*} and {\file
({\file /dev/sg*}.)
{\file /dev/mouse} may point to a dialout (alternate) TTY device, a
hardware mouse device, or a socket for a mouse driver program.
hardware mouse device, or a socket for a mouse driver program
(e.g. {\file /dev/gpmdata}.)
\subsection{Sockets and pipes}
......@@ -982,6 +1018,7 @@ Common entries are:
\begin{nodelist}
\node{/dev/printer}{socket}{{\file lpd} local socket}
\node{/dev/log}{socket}{{\file syslog} local socket}
\node{/dev/gpmdata}{socket}{{\file gpm} mouse multiplexer}
\end{nodelist}
\end{document}
......
LINUX ALLOCATED DEVICES
Maintained by H. Peter Anvin <Peter.Anvin@linux.org>
Maintained by H. Peter Anvin <hpa@storm.net>
Last revised: December 17, 1995
Last revised: January 5, 1996
This list is the successor to Rick Miller's Linux Device List, which
he stopped maintaining when he lost network access in 1993. It is a
......@@ -439,10 +439,14 @@ an unreasonable effort.
29 char Universal frame buffer
0 = /dev/fb0current First frame buffer
1 = /dev/fb0autodetect
24 = /dev/fb0user0
...
31 = /dev/fb0user7
32 = /dev/fb1current Second frame buffer
33 = /dev/fb1autodetect
56 = /dev/fb1user0
...
63 = /dev/fb1user7
block Aztech/Orchid/Okano/Wearnes CD-ROM
0 = /dev/aztcd Aztech CD-ROM
......@@ -450,9 +454,11 @@ an unreasonable effort.
supported on Linux/68k. The "current" device accesses
the fame buffer at current resolution; the
"autodetect" one at bootup (default) resolution.
Minor numbers 2-31 within each frame buffer assignment
Minor numbers 2-23 within each frame buffer assignment
are used for specific device-dependent resolutions.
There appears to be no standard naming for these devices.
Finally, 2-31 within each device are reserved for
user-selected modes, usually entered at boot time.
30 char iBCS-2 compatibility devices
0 = /dev/socksys Socket access
......@@ -589,7 +595,26 @@ an unreasonable effort.
removal of a driver with this number should not cause
ill effects to the system (bugs excepted.)
43-59 UNALLOCATED
43 char isdn4linux virtual modem
0 = /dev/ttyI0 First virtual modem
...
15 = /dev/ttyI15 16th 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
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
...
31 = /dev/isdnctrl15 16th channel control/debug
128 = /dev/isdninfo ISDN monitor interface
46-59 UNALLOCATED
60-63 LOCAL/EXPERIMENTAL USE
Allocated for local/experimental use. For devices not
......@@ -670,7 +695,7 @@ For SCSI devices, /dev/tape and /dev/cdrom should point to the
SCSI devices (/dev/sg*).
/dev/mouse may point to a dialout (alternate) TTY device, a hardware
mouse device, or a socket for a mouse driver program.
mouse device, or a socket for a mouse driver program (e.g. /dev/gpmdata).
Sockets and pipes
......@@ -678,3 +703,4 @@ Non-transient sockets and named pipes may exist in /dev. Common entries are:
/dev/printer socket lpd local socket
/dev/log socket syslog local socket
/dev/gpmdata socket gpm mouse multiplexer
VERSION = 1
PATCHLEVEL = 3
SUBLEVEL = 54
SUBLEVEL = 55
ARCH = i386
......@@ -309,7 +309,7 @@ mrproper: clean
distclean: mrproper
rm -f core `find . \( -name '*.orig' -o -name '*~' -o -name '*.bak' \
-o -name '#*#' -o -name '.*.orig' \) -print`
-o -name '#*#' -o -name '.*.orig' \) -print` TAGS
backup: mrproper
......
......@@ -110,9 +110,8 @@ CONFIGURING the kernel:
under some circumstances lead to problems: probing for a
nonexistent controller card may confuse your other controllers
- compiling the kernel with "-m486" for a number of 486-specific
will result in a kernel that still works on a 386: it may be
slightly larger and possibly slower by an insignificant amount,
but it should not hurt performance.
will result in a kernel that does NOT work on a 386. The
kernel will detect this on bootup, and give up.
- A kernel with math-emulation compiled in will still use the
coprocessor if one is present: the math emulation will just
never get used in that case. The kernel will be slightly larger,
......@@ -137,7 +136,9 @@ COMPILING the kernel:
upgrade your compiler, remember to get the new binutils package too
(for as/ld/nm and company). Do not use gcc-2.6.0; it has a few serious
bugs. Some problems have been reported occasionally with 2.6.3 as well,
so use that version at your own risk.
so use that version at your own risk. Specifying "-fno-strength-reduce"
in the CFLAGS of the main Makefile may help to work around a known
bug in gcc.
- do a "make zImage" to create a compressed kernel image. If you want
to make a bootdisk (without root filesystem or lilo), insert a floppy
......
#include <sys/types.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/sched.h>
......
......@@ -657,10 +657,18 @@ ENTRY(sys_call_table)
.long SYMBOL_NAME(sys_readv) /* 145 */
.long SYMBOL_NAME(sys_writev)
.long SYMBOL_NAME(sys_getsid)
.long 0
.long SYMBOL_NAME(sys_fdatasync)
.long 0
.long SYMBOL_NAME(sys_mlock) /* 150 */
.long SYMBOL_NAME(sys_munlock)
.long SYMBOL_NAME(sys_mlockall)
.long SYMBOL_NAME(sys_munlockall)
.space (NR_syscalls-154)*4
.long SYMBOL_NAME(sys_sched_setparam)
.long SYMBOL_NAME(sys_sched_getparam) /* 155 */
.long SYMBOL_NAME(sys_sched_setscheduler)
.long SYMBOL_NAME(sys_sched_getscheduler)
.long SYMBOL_NAME(sys_sched_yield)
.long SYMBOL_NAME(sys_sched_get_priority_max)
.long SYMBOL_NAME(sys_sched_get_priority_min) /* 160 */
.long SYMBOL_NAME(sys_sched_rr_get_interval)
.space (NR_syscalls-162)*4
......@@ -3633,7 +3633,8 @@ static char get_fdc_version(void)
return FDC_8272A; /* 8272a/765 don't know DUMPREGS */
}
if (r != 10) {
printk("FDC init: DUMPREGS: unexpected return of %d bytes.\n", r);
printk("FDC %d init: DUMPREGS: unexpected return of %d bytes.\n",
fdc, r);
return FDC_UNKNOWN;
}
output_byte(FD_VERSION);
......@@ -3643,7 +3644,8 @@ static char get_fdc_version(void)
return FDC_82072; /* 82072 doesn't know VERSION */
}
if ((r != 1) || (reply_buffer[0] != 0x90)) {
printk("FDC init: VERSION: unexpected return of %d bytes.\n", r);
printk("FDC %d init: VERSION: unexpected return of %d bytes.\n",
fdc, r);
return FDC_UNKNOWN;
}
output_byte(FD_UNLOCK);
......@@ -3653,13 +3655,15 @@ static char get_fdc_version(void)
return FDC_82077_ORIG; /* Pre-1991 82077 doesn't know LOCK/UNLOCK */
}
if ((r != 1) || (reply_buffer[0] != 0x00)) {
printk("FDC init: UNLOCK: unexpected return of %d bytes.\n", r);
printk("FDC %d init: UNLOCK: unexpected return of %d bytes.\n",
fdc, r);
return FDC_UNKNOWN;
}
output_byte(FD_PARTID);
r = result();
if (r != 1) {
printk("FDC init: PARTID: unexpected return of %d bytes.\n",r);
printk("FDC %d init: PARTID: unexpected return of %d bytes.\n",
fdc, r);
return FDC_UNKNOWN;
}
if (reply_buffer[0] == 0x80) {
......@@ -3671,7 +3675,7 @@ static char get_fdc_version(void)
output_byte(FD_SAVE);
r = result();
if (r != 17) {
printk("FDC init: SAVE: unexpected return of %d bytes.\n",r);
printk("FDC %d init: SAVE: unexpected return of %d bytes.\n",fdc,r);
return FDC_UNKNOWN;
}
if (!(reply_buffer[0] & 0x40)) {
......@@ -3684,9 +3688,13 @@ static char get_fdc_version(void)
case 0x1:
printk("FDC %d is a 44pin 82078\n",fdc);
return FDC_82078;
case 0x3:
printk("FDC %d is a National Semiconductor PC87306\n",fdc);
return FDC_87306;
default:
printk("FDC %d init: PARTID returned an unknown ID: %d.\n", fdc, reply_buffer[0] >> 5);
return FDC_UNKNOWN;
printk("FDC %d init: Unknown 82077 variant, PARTID = %d.\n",
fdc, reply_buffer[0] >> 5);
return FDC_82077_UNKN;
}
} /* get_fdc_version */
......
......@@ -371,7 +371,7 @@ void rd_load()
if (rd_prompt) {
printk(KERN_NOTICE
"VFS: Insert ramdisk floppy and press ENTER\n");
"VFS: Insert root floppy disk to be loaded into ramdisk and press ENTER\n");
wait_for_keypress();
}
......
......@@ -3,7 +3,7 @@
#
tristate 'Sony CDU31A/CDU33A CDROM support' CONFIG_CDU31A
tristate 'Standard Mitsumi [no XA/Multisession] CDROM support' CONFIG_MCD
tristate 'Experimental Mitsumi [XA/MultiSession] support' CONFIG_MCDX
tristate 'Mitsumi [XA/MultiSession] CDROM support' CONFIG_MCDX
tristate 'Matsushita/Panasonic/Creative, Longshine, TEAC CDROM support' CONFIG_SBPCD
if [ "$CONFIG_SBPCD" = "y" ]; then
bool 'Matsushita/Panasonic, ... second CDROM controller support' CONFIG_SBPCD2
......@@ -18,5 +18,5 @@ tristate 'Aztech/Orchid/Okano/Wearnes/TXC (non IDE) CDROM support' CONFIG_AZTCD
tristate 'Sony CDU535 CDROM support' CONFIG_CDU535
tristate 'Goldstar R420 CDROM support' CONFIG_GSCD
tristate 'Philips/LMS CM206 CDROM support' CONFIG_CM206
tristate 'Experimental Optics Storage DOLPHIN 8000AT CDROM support' CONFIG_OPTCD
tristate 'Experimental Sanyo H94A CDROM support' CONFIG_SJCD
tristate 'Optics Storage DOLPHIN 8000AT CDROM support' CONFIG_OPTCD
tristate 'Sanyo H94A CDROM support' CONFIG_SJCD
This diff is collapsed.
......@@ -59,6 +59,7 @@ static int softdog_open(struct inode *inode, struct file *file)
*/
watchdog_ticktock.expires=jiffies+TIMER_MARGIN;
add_timer(&watchdog_ticktock);
timer_alive++;
return 0;
}
......@@ -111,5 +112,5 @@ void watchdog_init(void)
mouse_register(&softdog_mouse);
init_timer(&watchdog_ticktock);
watchdog_ticktock.function=watchdog_fire;
printk("Software Watchdog Timer: 0.02\n");
printk("Software Watchdog Timer: 0.03\n");
}
......@@ -1177,6 +1177,7 @@ normal_init (Scsi_Host_Template *tpnt, int board, int chip,
char chip_str[80];
int script_len = 0, dsa_len = 0, size = 0, max_cmd_size = 0,
schedule_size = 0, ok = 0;
void *tmp;
options |= perm_options;
......@@ -1221,14 +1222,7 @@ normal_init (Scsi_Host_Template *tpnt, int board, int chip,
tpnt->sg_tablesize +
3 /* Current startup / termination required per phase */
) *
8 /* Each instruction is eight bytes */
+ (sizeof(void *) - sizeof(u32)); /* to ensure proper alignment */
/* Note that alignment will be guaranteed, since we put the command
allocated at probe time after the fixed-up SCSI script, which
consists of 32 bit words, aligned on a 32 bit boundary. But
on a 64bit machine we need 8 byte alignment for hostdata->free, so
we add in another 4 bytes to take care of potential misalignment
*/
8 /* Each instruction is eight bytes */;
/* Allocate fixed part of hostdata, dynamic part to hold appropriate
SCSI SCRIPT(tm) plus a single, maximum-sized NCR53c7x0_cmd structure.
......@@ -1251,8 +1245,14 @@ normal_init (Scsi_Host_Template *tpnt, int board, int chip,
after all device driver initialization).
*/
size = sizeof(struct NCR53c7x0_hostdata) + script_len + max_cmd_size +
schedule_size;
size = sizeof(struct NCR53c7x0_hostdata) + script_len +
/* Note that alignment will be guaranteed, since we put the command
allocated at probe time after the fixed-up SCSI script, which
consists of 32 bit words, aligned on a 32 bit boundary. But
on a 64bit machine we need 8 byte alignment for hostdata->free, so
we add in another 4 bytes to take care of potential misalignment
*/
(sizeof(void *) - sizeof(u32)) + max_cmd_size + schedule_size;
instance = scsi_register (tpnt, size);
if (!instance)
......@@ -1321,15 +1321,9 @@ normal_init (Scsi_Host_Template *tpnt, int board, int chip,
hostdata->max_cmd_size = max_cmd_size;
hostdata->num_cmds = 1;
/* Initialize single command */
hostdata->free = (struct NCR53c7x0_cmd *)
(hostdata->script + hostdata->script_count);
/*
* FIXME: This is wrong. If we add max_cmd_size to hostdata->free
* once it's been rounded up, we end up going past the end of what
* we allocated.
*/
hostdata->free = ROUNDUP(hostdata->free, void *);
hostdata->free->real = (void *) hostdata->free;
tmp = (hostdata->script + hostdata->script_count);
hostdata->free = ROUNDUP(tmp, void *);
hostdata->free->real = tmp;
hostdata->free->size = max_cmd_size;
hostdata->free->free = NULL;
hostdata->free->next = NULL;
......@@ -2165,8 +2159,10 @@ abnormal_finished (struct NCR53c7x0_cmd *cmd, int result) {
if (left < 0)
printk ("scsi%d: loop detected in host running list for scsi pid %ld\n",
host->host_no, c->pid);
else if (linux_search)
else if (linux_search) {
*linux_prev = linux_search->next;
--hostdata->busy[c->target][c->lun];
}
/* Return the NCR command structure to the free list */
cmd->next = hostdata->free;
......@@ -2863,7 +2859,9 @@ NCR53c8x0_dstat_sir_intr (struct Scsi_Host *host, struct
#endif
#ifdef A_int_debug_panic
case A_int_debug_panic:
panic("scsi%d : int_debug_panic received\n", host->host_no);
printk("scsi%d : int_debug_panic received\n", host->host_no);
print_lots (host);
return SPECIFIC_INT_PANIC;
#endif
#ifdef A_int_debug_saved
case A_int_debug_saved:
......@@ -3376,15 +3374,16 @@ NCR53c8x0_soft_reset (struct Scsi_Host *host) {
NCR53c7x0_write8(STEST3_REG_800, STEST3_800_TE);
}
/*
* Function static struct NCR53c7x0_cmd *allocate_cmd (Scsi_Cmnd *cmd)
*
* Purpose : Return the first free NCR53c7x0_cmd structure (which are
* reused in a LIFO maner to minimize cache thrashing).
*
* Side effects : If we don't have enough NCR53c7x0_cmd structures,
* allocate more. Teach programmers not to drink and hack.
* Side effects : If we haven't yet scheduled allocation of NCR53c7x0_cmd
* structures for this device, do so. Attempt to complete all scheduled
* allocations using kmalloc(), putting NCR53c7x0_cmd structures on
* the free list. Teach programmers not to drink and hack.
*
* Inputs : cmd - SCSI command
*
......@@ -3410,19 +3409,27 @@ allocate_cmd (Scsi_Cmnd *cmd) {
(1 << cmd->lun)) ? "allready allocated" : "not allocated");
/*
* Under Linux 1.2.x, kmalloc() and friends are unavailable until after
* device driver initialization has happened. Calling kmalloc()
* during scsi device initialization will print a "cannot get free page"
* message. To avoid too many of these, we'll forget about trying
* to allocate command structures until AFTER initialization.
* If we have not yet reserved commands for this I_T_L nexus, and
* the device exists (as indicated by permanant Scsi_Cmnd structures
* being allocated under 1.3.x, or being outside of scan_scsis in
* 1.2.x), do so now.
*/
if (!(hostdata->cmd_allocated[cmd->target] & (1 << cmd->lun)) &&
#ifdef LINUX_1_2
if (!in_scan_scsis)
!in_scan_scsis
#else
cmd->device && cmd->device->has_cmdblocks
#endif
) {
if ((hostdata->extra_allocate + hostdata->num_cmds) < host->can_queue)
hostdata->extra_allocate += host->cmd_per_lun;
hostdata->cmd_allocated[cmd->target] |= (1 << cmd->lun);
}
for (; hostdata->extra_allocate > 0 ; --hostdata->extra_allocate,
++hostdata->num_cmds) {
/* kmalloc() can allocate any size, but historically has returned
unaligned addresses, so we need to allow for alignment */
/* historically, kmalloc has returned unaligned addresses; pad so we
have enough room to ROUNDUP */
size = hostdata->max_cmd_size + sizeof (void *);
/* FIXME: for ISA bus '7xx chips, we need to or GFP_DMA in here */
real = kmalloc (size, GFP_ATOMIC);
......@@ -4446,29 +4453,9 @@ NCR53c7x0_intr (int irq, struct pt_regs * regs) {
print_command (tmp->cmnd);
}
#if 0
hostdata->options &= ~OPTION_DEBUG_INTR;
#endif
/*
* If we have not yet reserved commands for this I_T_L nexus, and the
* command completed successfully, reserve NCR53c7x0_cmd structures
* which will be allocated the next time we run the allocate
* routine.
*/
if (!(hostdata->cmd_allocated[tmp->target] &
(1 << tmp->lun)) &&
status_byte(tmp->result) == GOOD) {
if ((hostdata->extra_allocate + hostdata->num_cmds)
< host->can_queue) {
hostdata->extra_allocate +=
host->cmd_per_lun;
}
hostdata->cmd_allocated[tmp->target] |=
(1 << tmp->lun);
}
tmp->scsi_done(tmp);
goto restart;
......@@ -5183,7 +5170,7 @@ intr_dma (struct Scsi_Host *host, struct NCR53c7x0_cmd *cmd) {
printk(KERN_ALERT "scsi%d : unexpected single step interrupt at\n"
" ", host->host_no);
print_insn (host, dsp, KERN_ALERT "", 1);
printk(KERN_ALERT " mail drew@colorado.edu\n");
printk(KERN_ALERT " mail drew@PoohSticks.ORG\n");
FATAL (host);
}
}
......@@ -5808,6 +5795,14 @@ print_dsa (struct Scsi_Host *host, u32 *dsa, const char *prefix) {
dsa[hostdata->dsa_msgout / sizeof(u32) + 1],
bus_to_virt (dsa[hostdata->dsa_msgout / sizeof(u32) + 1]));
/*
* Only print messages if they're sane in length so we don't
* blow the kernel printk buffer on something which won't buy us
* anything.
*/
if (dsa[hostdata->dsa_msgout / sizeof(u32)] <
sizeof (hostdata->free->select))
for (i = dsa[hostdata->dsa_msgout / sizeof(u32)],
ptr = bus_to_virt (dsa[hostdata->dsa_msgout / sizeof(u32) + 1]);
i > 0 && !check_address ((unsigned long) ptr, 1);
......@@ -5953,12 +5948,15 @@ print_lots (struct Scsi_Host *host) {
sbcl = NCR53c7x0_read8 (SBCL_REG);
printk ("scsi%d : DCMD|DBC=0x%x, DSA=0x%lx (virt 0x%p)\n"
printk ("scsi%d : DCMD|DBC=0x%x, DNAD=0x%x (virt 0x%p)\n"
" DSA=0x%lx (virt 0x%p)\n"
" DSPS=0x%x, TEMP=0x%x (virt 0x%p), DMODE=0x%x\n"
" SXFER=0x%x, SCNTL3=0x%x\n"
" %s%s%sphase=%s, %d bytes in SCSI FIFO\n"
" STEST0=0x%x\n",
host->host_no, dbc_dcmd, virt_to_bus(dsa), dsa,
host->host_no, dbc_dcmd, NCR53c7x0_read32(DNAD_REG),
bus_to_virt(NCR53c7x0_read32(DNAD_REG)),
virt_to_bus(dsa), dsa,
NCR53c7x0_read32(DSPS_REG), NCR53c7x0_read32(TEMP_REG),
bus_to_virt (NCR53c7x0_read32(TEMP_REG)),
(int) NCR53c7x0_read8(hostdata->dmode),
......
......@@ -67,7 +67,7 @@ extern int NCR53c7xx_release(struct Scsi_Host *);
#endif
#ifdef LINUX_1_2
#define NCR53c7xx {NULL, NULL, "NCR53c{7,8}xx (rel 14)", NCR53c7xx_detect,\
#define NCR53c7xx {NULL, NULL, "NCR53c{7,8}xx (rel 17)", NCR53c7xx_detect,\
NULL, /* info */ NULL, /* command, deprecated */ NULL, \
NCR53c7xx_queue_command, NCR53c7xx_abort, NCR53c7xx_reset, \
NULL /* slave attach */, scsicam_bios_param, /* can queue */ 24, \
......@@ -75,7 +75,7 @@ extern int NCR53c7xx_release(struct Scsi_Host *);
/* present */ 0, /* unchecked isa dma */ 0, DISABLE_CLUSTERING}
#else
#define NCR53c7xx {NULL, NULL, NULL, NULL, \
"NCR53c{7,8}xx (rel 14)", NCR53c7xx_detect,\
"NCR53c{7,8}xx (rel 17)", NCR53c7xx_detect,\
NULL, /* info */ NULL, /* command, deprecated */ NULL, \
NCR53c7xx_queue_command, NCR53c7xx_abort, NCR53c7xx_reset, \
NULL /* slave attach */, scsicam_bios_param, /* can queue */ 24, \
......@@ -1447,8 +1447,6 @@ struct NCR53c7x0_hostdata {
volatile u16 initiate_wdtr;
/* Bit fielded list of targets we've talked to. */
volatile u16 talked_to;
/* Bit fielded list of targets that answered */
volatile u16 answered;
/* Array of bit-fielded lun lists that we need to request_sense */
volatile unsigned char request_sense[16];
......
......@@ -1110,16 +1110,23 @@ selected:
;
; 2. The NCR53c810 was selected or reselected by another device.
;
; 3. The bus was allready busy since we were selected or reselected
; before starting the command.
wait_reselect_failed:
#ifdef EVENTS
INT int_EVENT_RESELECT_FAILED
#endif
; Check selected bit.
MOVE SIST0 & 0x20 TO SFBR
JUMP selected, IF 0x20
; Reading CTEST2 clears the SIG_P bit in the ISTAT register.
MOVE CTEST2 & 0x40 TO SFBR
JUMP schedule, IF 0x40
; Check connected bit.
; FIXME: this needs to change if we support target mode
MOVE ISTAT & 0x08 TO SFBR
JUMP reselected, IF 0x08
; FIXME : Something bogus happened, and we shouldn't fail silently.
#if 0
JUMP schedule
......@@ -1141,6 +1148,11 @@ select_failed:
; Reading CTEST2 clears the SIG_P bit in the ISTAT register.
MOVE CTEST2 & 0x40 TO SFBR
JUMP select, IF 0x40
; Check connected bit.
; FIXME: this needs to change if we support target mode
; FIXME: is this really necessary?
MOVE ISTAT & 0x08 TO SFBR
JUMP reselected, IF 0x08
; FIXME : Something bogus happened, and we shouldn't fail silently.
#if 0
JUMP schedule
......
This diff is collapsed.
......@@ -115,7 +115,7 @@ setup-linux:
sound.o: local.h $(FIXEDOBJS) sound.a
-rm -f sound.o
$(LD) -dc -r -o sound.o $(FIXEDOBJS) sound.a
$(LD) -r -o sound.o $(FIXEDOBJS) sound.a
modules: local.h sound.o
ln -fs `pwd`/sound.o $(TOPDIR)/modules/sound.o
......@@ -28,6 +28,7 @@
#include <linux/pagemap.h>
#include <linux/swapctl.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <asm/system.h>
#include <asm/segment.h>
......@@ -263,6 +264,21 @@ asmlinkage int sys_fsync(unsigned int fd)
return 0;
}
asmlinkage int sys_fdatasync(unsigned int fd)
{
struct file * file;
struct inode * inode;
if (fd>=NR_OPEN || !(file=current->files->fd[fd]) || !(inode=file->f_inode))
return -EBADF;
if (!file->f_op || !file->f_op->fsync)
return -EINVAL;
/* this needs further work, at the moment it is identical to fsync() */
if (file->f_op->fsync(inode,file))
return -EIO;
return 0;
}
void invalidate_buffers(kdev_t dev)
{
int i;
......
......@@ -41,7 +41,7 @@ void ext2_put_inode (struct inode * inode)
#define inode_bmap(inode, nr) ((inode)->u.ext2_i.i_data[(nr)])
static int block_bmap (struct buffer_head * bh, int nr)
static inline int block_bmap (struct buffer_head * bh, int nr)
{
int tmp;
......
......@@ -13,6 +13,8 @@
#include <linux/fcntl.h>
#include <linux/stat.h>
#include <linux/locks.h>
#include <linux/mm.h>
#include <linux/pagemap.h>
#include <asm/segment.h>
#include <asm/system.h>
......
......@@ -131,7 +131,6 @@ struct proc_dir_entry proc_net = {
NULL, NULL
};
#ifdef CONFIG_SCSI
struct proc_dir_entry proc_scsi = {
PROC_SCSI, 4, "scsi",
S_IFDIR | S_IRUGO | S_IXUGO, 2, 0, 0,
......@@ -139,7 +138,6 @@ struct proc_dir_entry proc_scsi = {
NULL, NULL,
NULL, &proc_root, NULL
};
#endif
int proc_register(struct proc_dir_entry * dir, struct proc_dir_entry * dp)
{
......
#ifndef __ALPHA_MMU_CONTEXT_H
#define __ALPHA_MMU_CONTEXT_H
/*
* get a new mmu context..
*
* Copyright (C) 1996, Linus Torvalds
*/
#include <asm/pgtable.h>
/*
* The maximum ASN's the processor supports. On the EV4 this doesn't
* matter as the pal-code doesn't use the ASNs anyway, on the EV5
* EV5 this is 127.
*/
#define MAX_ASN 127
#define ASN_VERSION_SHIFT 32
#define ASN_VERSION_MASK ((~0UL) << ASN_VERSION_SHIFT)
#define ASN_FIRST_VERSION (1UL << ASN_VERSION_SHIFT)
/*
* NOTE! The way this is set up, the high bits of the "asn_cache" (and
* the "mm->context") are the ASN _version_ code. A version of 0 is
* always considered invalid, so to invalidate another process you only
* need to do "p->mm->context = 0".
*
* If we need more ASN's than the processor has, we invalidate the old
* user TLB's (tbiap()) and start a new ASN version. That will automatically
* force a new asn for any other processes the next time they want to
* run.
*/
extern inline void get_mmu_context(struct task_struct *p)
{
static unsigned long asn_cache = ASN_FIRST_VERSION;
struct mm_struct * mm = p->mm;
unsigned long asn = mm->context;
/* Check if our ASN is of an older version and thus invalid */
if ((asn_cache ^ asn) & ASN_VERSION_MASK) {
/* get a new asn of the current version */
asn = asn_cache++;
/* check if it's legal.. */
if ((asn & ~ASN_VERSION_MASK) > MAX_ASN) {
/* start a new version, invalidate all old asn's */
tbiap();
asn_cache = (asn_cache & ASN_VERSION_MASK) + ASN_FIRST_VERSION;
if (!asn_cache)
asn_cache = ASN_FIRST_VERSION;
asn = asn_cache++;
}
mm->context = asn; /* full version + asn */
p->tss.asn = asn & ~ASN_VERSION_MASK; /* just asn */
}
}
#endif
......@@ -39,6 +39,9 @@ static inline void invalidate_all(void)
*/
static inline void invalidate_mm(struct mm_struct *mm)
{
if (mm != current->mm)
mm->context = 0;
else
tbiap();
}
......@@ -53,6 +56,11 @@ static inline void invalidate_mm(struct mm_struct *mm)
static inline void invalidate_page(struct vm_area_struct *vma,
unsigned long addr)
{
struct mm_struct * mm = vma->vm_mm;
if (mm != current->mm)
mm->context = 0;
else
tbi(2 + ((vma->vm_flags & VM_EXEC) != 0), addr);
}
......@@ -63,6 +71,9 @@ static inline void invalidate_page(struct vm_area_struct *vma,
static inline void invalidate_range(struct mm_struct *mm,
unsigned long start, unsigned long end)
{
if (mm != current->mm)
mm->context = 0;
else
tbiap();
}
......
#ifndef __I386_MMU_CONTEXT_H
#define __I386_MMU_CONTEXT_H
/*
* get a new mmu context.. x86's don't know about contexts.
*/
#define get_mmu_context(x) do { } while (0)
#endif
......@@ -153,11 +153,20 @@
#define __NR_readv 145
#define __NR_writev 146
#define __NR_getsid 147
#define __NR_fdatasync 148
#define __NR_mlock 150
#define __NR_munlock 151
#define __NR_mlockall 152
#define __NR_munlockall 153
#define __NR_sched_setparam 154
#define __NR_sched_getparam 155
#define __NR_sched_setscheduler 156
#define __NR_sched_getscheduler 157
#define __NR_sched_yield 158
#define __NR_sched_get_priority_max 159
#define __NR_sched_get_priority_min 160
#define __NR_sched_rr_get_interval 161
/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
#define _syscall0(type,name) \
......
......@@ -100,14 +100,26 @@
/* FDC version return types */
#define FDC_NONE 0x00
#define FDC_UNKNOWN 0x10
#define FDC_UNKNOWN 0x10 /* DO NOT USE THIS TYPE EXCEPT IF IDENTIFICATION
FAILS EARLY */
#define FDC_8272A 0x20 /* Intel 8272a, NEC 765 */
#define FDC_765ED 0x30 /* Non-Intel 1MB-compatible FDC, can't detect */
#define FDC_82072 0x40 /* Intel 82072; 8272a + FIFO + DUMPREGS */
#define FDC_82077_ORIG 0x50 /* Original version of 82077AA, sans LOCK */
#define FDC_82077 0x52 /* 82077AA-1 */
#define FDC_82077_UNKN 0x53 /* Unknown 82077 variant */
#define FDC_82078 0x60 /* 44pin 82078 or 64pin 82078SL */
#define FDC_82078_1 0x61 /* 82078-1 (2Mbps fdc) */
#define FDC_87306 0x63 /* National Semiconductor PC 87306 */
/*
* Beware: the fdc type list is roughly sorted by increasing features.
* Presence of features is tested by comparing the FDC version id with the
* "oldest" version that has the needed feature.
* If during FDC detection, an obscure test fails late in the sequence, don't
* assign FDC_UNKNOWN. Else the FDC will be treated as a dumb 8272a, or worse.
* This is especially true if the tests are unneeded.
*/
#define FD_RESET_DELAY 20
#endif
......@@ -12,16 +12,29 @@ static inline unsigned long page_address(struct page * page)
return PAGE_OFFSET + PAGE_SIZE*(page - mem_map);
}
#define PAGE_HASH_SIZE 257
#define PAGE_HASH_BITS 10
#define PAGE_HASH_SIZE (1 << PAGE_HASH_BITS)
#define PAGE_AGE_VALUE 16
extern unsigned long page_cache_size;
extern struct page * page_hash_table[PAGE_HASH_SIZE];
/*
* We use a power-of-two hash table to avoid a modulus,
* and get a reasonable hash by knowing roughly how the
* inode pointer and offsets are distributed (ie, we
* roughly know which bits are "significant")
*/
static inline unsigned long _page_hashfn(struct inode * inode, unsigned long offset)
{
offset ^= (unsigned long) inode;
return offset % PAGE_HASH_SIZE;
#define i (((unsigned long) inode)/sizeof(unsigned long))
#define o (offset >> PAGE_SHIFT)
#define s(x) ((x)+((x)>>PAGE_HASH_BITS))
return s(i+o) & (PAGE_HASH_SIZE-1);
#undef i
#undef o
#undef s
}
#define page_hash(inode,offset) page_hash_table[_page_hashfn(inode,offset)]
......
......@@ -181,9 +181,9 @@
#define DBG_AUD 25 /* READ AUDIO debugging */
#define DBG_SEQ 26 /* Sequoia interface configuration trace */
#define DBG_LCS 27 /* Longshine LCS-7260 debugging trace */
#define DBG_CD2 28 /* MKE CD200 debugging trace */
#define DBG_CD2 28 /* MKE/Funai CD200 debugging trace */
#define DBG_TEA 29 /* TEAC CD-55A debugging trace */
#define DBG_TE2 30 /* TEAC CD-55A 2nd debugging level */
#define DBG_ECS 30 /* ECS-AT (Vertos 100) debugging trace */
#define DBG_000 31 /* unnecessary information */
/*==========================================================================*/
......@@ -240,7 +240,7 @@
* LCS-7260 special status result bits:
*/
#define p_lcs_door_locked 0x02
#define p_lcs_door_closed 0x01
#define p_lcs_door_closed 0x01 /* probably disk_in */
/*
* CR-52x special status result bits:
......@@ -270,6 +270,14 @@
#define pL_door_locked 0x02
#define pL_door_closed 0x01
#define pV_door_closed 0x40
#define pV_spinning 0x20
#define pV_check 0x10
#define pV_success 0x08
#define pV_busy 0x04
#define pV_door_locked 0x02
#define pV_disk_ok 0x01
#define p1_door_closed 0x80
#define p1_disk_in 0x40
#define p1_spinning 0x20
......@@ -313,9 +321,9 @@
#define RESULT_READY ((inb(CDi_status)&s_not_result_ready)==0)
/*
* drive types (firmware versions):
* drive families and types (firmware versions):
*/
#define drv_fam0 0x08 /* CR-52x family */
#define drv_fam0 0x0100 /* CR-52x family */
#define drv_199 (drv_fam0+0x01) /* <200 */
#define drv_200 (drv_fam0+0x02) /* <201 */
#define drv_201 (drv_fam0+0x03) /* <210 */
......@@ -323,25 +331,35 @@
#define drv_211 (drv_fam0+0x05) /* <300 */
#define drv_300 (drv_fam0+0x06) /* >=300 */
#define drv_famL 0x10 /* Longshine family */
#define drv_fam1 0x0200 /* CR-56x family */
#define drv_099 (drv_fam1+0x01) /* <100 */
#define drv_100 (drv_fam1+0x02) /* >=100, only 1.02 and 5.00 known */
#define drv_fam2 0x0400 /* CD200 family */
#define drv_famT 0x0800 /* TEAC CD-55A */
#define drv_famL 0x1000 /* Longshine family */
#define drv_260 (drv_famL+0x01) /* LCS-7260 */
#define drv_e1 (drv_famL+0x01) /* LCS-7260, firmware "A E1" */
#define drv_f4 (drv_famL+0x02) /* LCS-7260, firmware "A4F4" */
#define drv_fam1 0x20 /* CR-56x family */
#define drv_099 (drv_fam1+0x01) /* <100 */
#define drv_100 (drv_fam1+0x02) /* >=100, only 5.00 known here */
#define drv_famT 0x40 /* TEAC CD-55A */
#define drv_fam2 0x80 /* CD200 family */
#define drv_famV 0x2000 /* ECS-AT (vertos-100) family */
#define drv_at (drv_famV+0x01) /* ECS-AT, firmware "1.00" */
#define fam0_drive (D_S[d].drv_type&drv_fam0)
#define famL_drive (D_S[d].drv_type&drv_famL)
#define famV_drive (D_S[d].drv_type&drv_famV)
#define fam1_drive (D_S[d].drv_type&drv_fam1)
#define fam2_drive (D_S[d].drv_type&drv_fam2)
#define famT_drive (D_S[d].drv_type&drv_famT)
#define fam0L_drive (D_S[d].drv_type&(drv_fam0|drv_famL))
#define fam0V_drive (D_S[d].drv_type&(drv_fam0|drv_famV))
#define famLV_drive (D_S[d].drv_type&(drv_famL|drv_famV))
#define fam0LV_drive (D_S[d].drv_type&(drv_fam0|drv_famL|drv_famV))
#define fam1L_drive (D_S[d].drv_type&(drv_fam1|drv_famL))
#define fam1V_drive (D_S[d].drv_type&(drv_fam1|drv_famV))
#define fam1LV_drive (D_S[d].drv_type&(drv_fam1|drv_famL|drv_famV))
#define fam01_drive (D_S[d].drv_type&(drv_fam0|drv_fam1))
#define fam12_drive (D_S[d].drv_type&(drv_fam1|drv_fam2))
#define fam2T_drive (D_S[d].drv_type&(drv_fam2|drv_famT))
......@@ -385,7 +403,6 @@
#define audx13 0x0d /* Audio play operation successfully completed */
#define audx14 0x0e /* Audio play operation stopped due to error */
#define audx15 0x0f /* No current audio status to return */
/* audio status (bcd) */
#define aud_11 0x11 /* Audio play operation in progress */
#define aud_12 0x12 /* Audio play operation paused */
......@@ -393,7 +410,6 @@
#define aud_14 0x14 /* Audio play operation stopped due to error */
#define aud_15 0x15 /* No current audio status to return */
/*
* highest allowed drive number (MINOR+1)
*/
......@@ -414,10 +430,8 @@
#define MIXER_CD_Volume 0x28 /* internal SB Pro register address */
/*==========================================================================*/
/*
* Creative Labs Programmers did this:
*/
#define MAX_TRACKS 120 /* why more than 99? */
#define MAX_TRACKS 99
/*==========================================================================*/
/*
......@@ -596,6 +610,7 @@ Read XA Parameter:
* CD200: CMD2_
* LCS-7260: CMDL_
* TEAC CD-55A: CMDT_
* ECS-AT: CMDV_
*/
#define CMD1_RESET 0x0a
#define CMD2_RESET 0x01
......@@ -605,14 +620,17 @@ Read XA Parameter:
#define CMD2_LOCK_CTL 0x1e
#define CMDT_LOCK_CTL CMD2_LOCK_CTL
#define CMDL_LOCK_CTL 0x0e
#define CMDV_LOCK_CTL CMDL_LOCK_CTL
#define CMD1_TRAY_CTL 0x07
#define CMD2_TRAY_CTL 0x1b
#define CMDT_TRAY_CTL CMD2_TRAY_CTL
#define CMDL_TRAY_CTL 0x0d
#define CMDV_TRAY_CTL CMDL_TRAY_CTL
#define CMD1_MULTISESS 0x8d
#define CMDL_MULTISESS 0x8c
#define CMDV_MULTISESS CMDL_MULTISESS
#define CMD1_SUBCHANINF 0x11
#define CMD2_SUBCHANINF 0x??
......@@ -630,23 +648,27 @@ Read XA Parameter:
#define CMD2_PATH_CHECK 0x???
#define CMDT_PATH_CHECK 0x???
#define CMDL_PATH_CHECK CMD0_PATH_CHECK
#define CMDV_PATH_CHECK CMD0_PATH_CHECK
#define CMD0_SEEK 0x01
#define CMD1_SEEK CMD0_SEEK
#define CMD2_SEEK 0x2b
#define CMDT_SEEK CMD2_SEEK
#define CMDL_SEEK CMD0_SEEK
#define CMDV_SEEK CMD0_SEEK
#define CMD0_READ 0x02
#define CMD1_READ 0x10
#define CMD2_READ 0x28
#define CMDT_READ CMD2_READ
#define CMDL_READ CMD0_READ
#define CMDV_READ CMD0_READ
#define CMD0_READ_XA 0x03
#define CMD2_READ_XA 0xd4
#define CMD2_READ_XA2 0xd5
#define CMDL_READ_XA CMD0_READ_XA /* really ?? */
#define CMDV_READ_XA CMD0_READ_XA
#define CMD0_READ_HEAD 0x04
......@@ -654,11 +676,13 @@ Read XA Parameter:
#define CMD1_SPINUP 0x02
#define CMD2_SPINUP CMD2_TRAY_CTL
#define CMDL_SPINUP CMD0_SPINUP
#define CMDV_SPINUP CMD0_SPINUP
#define CMD0_SPINDOWN 0x06 /* really??? */
#define CMD1_SPINDOWN 0x06
#define CMD2_SPINDOWN CMD2_TRAY_CTL
#define CMDL_SPINDOWN 0x0d
#define CMDV_SPINDOWN CMD0_SPINDOWN
#define CMD0_DIAG 0x07
......@@ -666,6 +690,7 @@ Read XA Parameter:
#define CMD1_READ_UPC 0x88
#define CMD2_READ_UPC 0x???
#define CMDL_READ_UPC CMD0_READ_UPC
#define CMDV_READ_UPC 0x8f
#define CMD0_READ_ISRC 0x09
......@@ -673,6 +698,7 @@ Read XA Parameter:
#define CMD1_PLAY 0x???
#define CMD2_PLAY 0x???
#define CMDL_PLAY CMD0_PLAY
#define CMDV_PLAY CMD0_PLAY
#define CMD0_PLAY_MSF 0x0b
#define CMD1_PLAY_MSF 0x0e
......@@ -688,6 +714,7 @@ Read XA Parameter:
#define CMD2_STATUS 0x00
#define CMDT_STATUS CMD2_STATUS
#define CMDL_STATUS CMD0_STATUS
#define CMDV_STATUS CMD0_STATUS
#define CMD2_SEEK_LEADIN 0x00
#define CMD0_READ_ERR 0x82
......@@ -695,12 +722,14 @@ Read XA Parameter:
#define CMD2_READ_ERR 0x03
#define CMDT_READ_ERR CMD2_READ_ERR /* get audio status */
#define CMDL_READ_ERR CMD0_READ_ERR
#define CMDV_READ_ERR CMD0_READ_ERR
#define CMD0_READ_VER 0x83
#define CMD1_READ_VER CMD0_READ_VER
#define CMD2_READ_VER 0x12
#define CMDT_READ_VER CMD2_READ_VER /* really ?? */
#define CMDL_READ_VER CMD0_READ_VER
#define CMDV_READ_VER CMD0_READ_VER
#define CMD0_SETMODE 0x84
#define CMD1_SETMODE 0x09
......@@ -728,6 +757,7 @@ Read XA Parameter:
#define CMD2_READSUBQ 0x42
#define CMDT_READSUBQ CMD2_READSUBQ
#define CMDL_READSUBQ CMD0_READSUBQ
#define CMDV_READSUBQ CMD0_READSUBQ
#define CMD0_DISKCODE 0x8a
......@@ -736,22 +766,26 @@ Read XA Parameter:
#define CMD2_DISKINFO 0x43
#define CMDT_DISKINFO CMD2_DISKINFO
#define CMDL_DISKINFO CMD0_DISKINFO
#define CMDV_DISKINFO CMD0_DISKINFO
#define CMD0_READTOC 0x8c
#define CMD1_READTOC CMD0_READTOC
#define CMD2_READTOC 0x???
#define CMDL_READTOC CMD0_READTOC
#define CMDV_READTOC CMD0_READTOC
#define CMD0_PAU_RES 0x8d
#define CMD1_PAU_RES 0x0d
#define CMD2_PAU_RES 0x4b
#define CMDT_PAUSE CMD2_PAU_RES
#define CMDL_PAU_RES CMD0_PAU_RES
#define CMDV_PAUSE CMD0_PAU_RES
#define CMD0_PACKET 0x8e
#define CMD1_PACKET CMD0_PACKET
#define CMD2_PACKET 0x???
#define CMDL_PACKET CMD0_PACKET
#define CMDV_PACKET 0x???
/*==========================================================================*/
/*==========================================================================*/
......
......@@ -92,6 +92,10 @@ extern int nr_running, nr_tasks;
#define SCHED_FIFO 1
#define SCHED_RR 2
struct sched_param {
int sched_priority;
};
#ifndef NULL
#define NULL ((void *) 0)
#endif
......@@ -195,7 +199,7 @@ struct task_struct {
struct wait_queue *wait_chldexit; /* for wait4() */
unsigned short uid,euid,suid,fsuid;
unsigned short gid,egid,sgid,fsgid;
unsigned long timeout, policy;
unsigned long timeout, policy, rt_priority;
unsigned long it_real_value, it_prof_value, it_virt_value;
unsigned long it_real_incr, it_prof_incr, it_virt_incr;
struct timer_list real_timer;
......@@ -273,7 +277,7 @@ struct task_struct {
/* suppl grps*/ {NOGROUP,}, \
/* proc links*/ &init_task,&init_task,NULL,NULL,NULL,NULL, \
/* uid etc */ 0,0,0,0,0,0,0,0, \
/* timeout */ 0,SCHED_OTHER,0,0,0,0,0,0, \
/* timeout */ 0,SCHED_OTHER,0,0,0,0,0,0,0, \
/* timer */ { NULL, NULL, 0, 0, it_real_fn }, \
/* utime */ 0,0,0,0,0, \
/* flt */ 0,0,0,0,0,0, \
......
......@@ -8,7 +8,6 @@
#ifdef __SMP__
#include <asm/smp.h>
#include <asm/smp_lock.h>
extern void smp_message_pass(int target, int msg, unsigned long data, int wait);
extern void smp_boot_cpus(void); /* Boot processor call to load the other CPU's */
......
#ifndef __LINUX_SMPLOCK_H
#define __LINUX_SMPLOCK_H
#ifdef __SMP__
#include <asm/pgtable.h>
#include <asm/smp_lock.h>
#endif
#endif
#ifndef _LINUX_TIME_H
#define _LINUX_TIME_H
struct timespec {
long tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
};
struct timeval {
int tv_sec; /* seconds */
int tv_usec; /* microseconds */
......@@ -32,6 +37,11 @@ void do_settimeofday(struct timeval *tv);
#define ITIMER_VIRTUAL 1
#define ITIMER_PROF 2
struct itimerspec {
struct timespec it_interval; /* timer period */
struct timespec it_value; /* timer expiration */
};
struct itimerval {
struct timeval it_interval; /* timer interval */
struct timeval it_value; /* current value */
......
......@@ -12,6 +12,7 @@
#include <linux/module.h>
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/smp.h>
#include <linux/fs.h>
#include <linux/blkdev.h>
#include <linux/sched.h>
......@@ -38,6 +39,7 @@
#include <linux/ext2_fs.h>
#include <linux/random.h>
#include <linux/mount.h>
#include <linux/pagemap.h>
extern unsigned char aux_device_present, kbd_read_mask;
......@@ -222,6 +224,7 @@ struct symbol_table symbol_table = {
X(mem_map),
X(remap_page_range),
X(high_memory),
X(update_vm_cache),
/* filesystem internal functions */
X(getname),
......@@ -252,6 +255,8 @@ struct symbol_table symbol_table = {
X(dcache_add),
X(aout_core_dump),
X(add_blkdev_randomness),
X(generic_file_read),
X(generic_readpage),
/* device registration */
X(register_chrdev),
......@@ -560,10 +565,7 @@ struct symbol_table symbol_table = {
X(proc_unregister),
X(in_group_p),
X(generate_cluster),
#ifdef CONFIG_SCSI
X(proc_scsi),
X(proc_scsi_inode_operations),
#endif
X(proc_net_inode_operations),
X(proc_net),
#endif
......
......@@ -31,6 +31,7 @@
#include <asm/io.h>
#include <asm/segment.h>
#include <asm/pgtable.h>
#include <asm/mmu_context.h>
#include <linux/timex.h>
......@@ -206,7 +207,7 @@ static inline int goodness(struct task_struct * p, int this_cpu)
* into account).
*/
if (p->policy != SCHED_OTHER)
return 1000 + p->priority;
return 1000 + p->rt_priority;
/*
* Give the process a first-approximation goodness value
......@@ -338,6 +339,7 @@ asmlinkage void schedule(void)
timer.function = process_timeout;
add_timer(&timer);
}
get_mmu_context(next);
switch_to(next);
if (timeout)
del_timer(&timer);
......@@ -936,6 +938,167 @@ asmlinkage int sys_nice(int increment)
return 0;
}
static struct task_struct *find_process_by_pid(pid_t pid) {
struct task_struct *p, *q;
if (pid == 0)
p = current;
else {
p = 0;
for_each_task(q) {
if (q && q->pid == pid) {
p = q;
break;
}
}
}
return p;
}
static int setscheduler(pid_t pid, int policy,
struct sched_param *param)
{
int error;
struct sched_param lp;
struct task_struct *p;
if (!param || pid < 0)
return -EINVAL;
error = verify_area(VERIFY_READ, param, sizeof(struct sched_param));
if (error)
return -EINVAL;
memcpy_fromfs(&lp, param, sizeof(struct sched_param));
p = find_process_by_pid(pid);
if (!p)
return -ESRCH;
if (policy < 0)
policy = p->policy;
else if (policy != SCHED_FIFO && policy != SCHED_RR &&
policy != SCHED_OTHER)
return -EINVAL;
/*
* Valid priorities for SCHED_FIFO and SCHED_RR are 1..99, valid
* priority for SCHED_OTHER is 0.
*/
if (lp.sched_priority < 0 || lp.sched_priority > 99)
return -EINVAL;
if ((policy == SCHED_OTHER) != (lp.sched_priority == 0))
return -EINVAL;
if ((policy == SCHED_FIFO || policy == SCHED_RR) && !suser())
return -EPERM;
if ((current->euid != p->euid) && (current->euid != p->uid) &&
!suser())
return -EPERM;
p->policy = policy;
p->rt_priority = lp.sched_priority;
schedule();
return 0;
}
asmlinkage int sys_sched_setscheduler(pid_t pid, int policy,
struct sched_param *param)
{
return setscheduler(pid, policy, param);
}
asmlinkage int sys_sched_setparam(pid_t pid, struct sched_param *param)
{
return setscheduler(pid, -1, param);
}
asmlinkage int sys_sched_getscheduler(pid_t pid)
{
struct task_struct *p;
if (pid < 0)
return -EINVAL;
p = find_process_by_pid(pid);
if (!p)
return -ESRCH;
return p->policy;
}
asmlinkage int sys_sched_getparam(pid_t pid, struct sched_param *param)
{
int error;
struct task_struct *p;
struct sched_param lp;
if (!param || pid < 0)
return -EINVAL;
error = verify_area(VERIFY_WRITE, param, sizeof(struct sched_param));
if (error)
return -EINVAL;
p = find_process_by_pid(pid);
if (!p)
return -ESRCH;
lp.sched_priority = p->rt_priority;
memcpy_tofs(param, &lp, sizeof(struct sched_param));
return 0;
}
asmlinkage int sys_sched_yield(void)
{
/* ... not yet implemented ... */
return -ENOSYS;
}
asmlinkage int sys_sched_get_priority_max(int policy)
{
switch (policy) {
case SCHED_FIFO:
case SCHED_RR:
return 99;
case SCHED_OTHER:
return 0;
}
return -EINVAL;
}
asmlinkage int sys_sched_get_priority_min(int policy)
{
switch (policy) {
case SCHED_FIFO:
case SCHED_RR:
return 1;
case SCHED_OTHER:
return 0;
}
return -EINVAL;
}
asmlinkage int sys_sched_rr_get_interval(pid_t pid, struct timespec *interval)
{
int error;
struct timespec t;
error = verify_area(VERIFY_WRITE, interval, sizeof(struct timespec));
if (error)
return -EINVAL;
t.tv_sec = 0;
t.tv_nsec = 0; /* <-- Linus, please fill correct value in here */
return -ENOSYS; /* and then delete this line. Thanks! */
memcpy_tofs(interval, &t, sizeof(struct timespec));
return 0;
}
static void show_task(int nr,struct task_struct * p)
{
unsigned long free;
......
......@@ -138,7 +138,6 @@ void update_vm_cache(struct inode * inode, unsigned long pos, const char * buf,
if (page) {
unsigned long addr;
page->count++;
if (!page->uptodate)
sleep_on(&page->wait);
addr = page_address(page);
......
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