Commit b0532cc2 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.1.89pre3

parent 2a342179
......@@ -6,6 +6,8 @@ Note that subdirectories have their own index files too.
00-INDEX
- this file.
ARM-README
- information for using Linux on the ARM architecture.
BUG-HUNTING
- brute force method of doing binary search of patches to find bug.
Changes
......@@ -14,10 +16,14 @@ CodingStyle
- how the boss likes the C code in the kernel to look.
Configure.help
- text file that is used for help when you run "make config"
IO-APIC.txt
- info on using the enhanced interrupt hardware on SMP boards.
IO-mapping.txt
- how to access I/O mapped memory from within device drivers.
SMP.txt
- notes, and "To Fix" list for multi-processor Linux. (see smp.tex)
VGA-softcursor.txt
- how to change your VGA cursor from a blinking underscore.
binfmt_misc.txt
- info on the kernel support for extra binary formats.
cdrom/
......@@ -36,6 +42,8 @@ filesystems/
- directory with info on the various filesystems that Linux supports.
ftape.txt
- notes about the floppy tape device driver
hayes-esp.txt
- info on using the Hayes ESP serial driver.
ide.txt
- important info for users of ATA devices (IDE/EIDE disks and CD-ROMS)
initrd.txt
......@@ -46,32 +54,44 @@ isdn/
- directory with info on the linux ISDN support, and supported cards.
java.txt
- info on the in-kernel binary support for Java(tm)
joystick.txt
- info on using joystick devices (and driver) with linux.
locks.txt
- info on file locking implementations, flock() vs. fcntl(), etc.
logo.gif
- Full colour GIF image of Linux logo (penguin)
logo.txt
- Info on creator of above logo & site to get additional images from.
m68k/
- directory with info about Linux on Motorola 68k archtecture.
magic-number.txt
- list of magic numbers used to mark/protect kernel data structures.
mandatory.txt
- info on the linux implementation of Sys V mandatory file locking.
md.txt
- info on boot arguments for the multiple devices driver
memory.txt
- info on typical Linux memory problems.
mca.txt
- info on supporting Micro Channel Architecture (e.g. PS/2) systems.
modules.txt
- short guide on how to make kernel parts into loadable modules
nbd.txt
- info on a TCP implementation of a network block device.
networking/
- directory with info on various linux networking aspects.
nfsroot.txt
- short guide on setting up a diskless box with NFS root filesystem
oops-tracing.txt
- how to decode those nasty internal kernel error dump messages.
pcwd-watchdog.txt
- info and sample code for using with the PC Watchdog reset card.
paride.txt
- information about the parallel port IDE subsystem.
parport.txt
- how to use the parallel-port driver.
powerpc/
- directory with info on using linux with the PowerPC.
ramdisk.txt
- short guide on how to set up and use the RAM disk.
riscom8.txt
......@@ -80,12 +100,22 @@ rtc.txt
- notes on how to use the Real Time Clock (aka CMOS clock) driver.
scsi.txt
- short blurb on using SCSI support as a module.
serial-console.txt
- how to set up linux with a serial line console as the default.
smart-config.txt
- description of the Smart Config makefile feature.
smp.tex
- TeX document describing implementation of Multiprocessor Linux
specialix.txt
- info on hardware/driver for specialix IO8+ multiport serial card.
spinlocks.txt
- info on using spinlocks to provide exclusive access in kernel.
stallion.txt
- info on using the Stallion multiport serial driver.
svga.txt
- short guide on selecting video modes at boot via VGA BIOS.
transname.txt
- how to use name translation to ease use of diskless systems.
unicode.txt
- info on the Unicode character/font mapping used in Linux.
watchdog.txt
......
This diff is collapsed.
......@@ -4,19 +4,19 @@
means, that it works on my computer, and it worked on one of school
computers.
What is it: With this think compiled in kernel, linux can use remote
server as one of its block devices. So every time client computer
wants to read /dev/nd0, it will send request over TCP to server, which
will reply with data readed. This can be used for stations with
low-disk space (or even disklesses - if you boot from floppy) to
borrow disk space from other computer. Unlike NFS, it is possible to
put any filesystem on it etc. It is impossible to use NBD as root
filesystem, since it requires user-level program to start. It also
What is it: With this compiled in the kernel, linux can use a remote
server as one of its block devices. So every time the client computer
wants to read /dev/nd0, it sends a request over TCP to the server, which
will reply with the data read. This can be used for stations with
low-disk space (or even diskless - if you boot from floppy) to
borrow disk space from another computer. Unlike NFS, it is possible to
put any filesystem on it etc. It is impossible to use NBD as a root
filesystem, since it requires a user-level program to start. It also
allows you to run block-device in user land (making server and client
physicaly same computer, communicating using loopback).
physically the same computer, communicating using loopback).
Current state: It currently works. Network block device looks like
being pretty stable. I originaly thought that it is impossible to swap
being pretty stable. I originally thought that it is impossible to swap
over TCP. It turned out not to be true - swapping over TCP now works
and seems to be deadlock-free, but it requires heavy patches into
Linux's network layer.
......@@ -30,8 +30,8 @@ brw-rw-rw- 1 root root 43, 1 Apr 11 00:28 nd1
...
Protocol: Userland program passes file handle with connected TCP
socket to actuall kernel driver. This way, kernel does not have to
care about connecting etc. Protocol is rather simple: If driver is
socket to actual kernel driver. This way, the kernel does not have to
care about connecting etc. Protocol is rather simple: If the driver is
asked to read from block device, it sends packet of following form
"request" (all data are in network byte order):
......@@ -48,7 +48,7 @@ brw-rw-rw- 1 root root 43, 1 Apr 11 00:28 nd1
structure "reply":
__u32 magic; must be equal to
__u64 handle; handle copyied from request
__u64 handle; handle copied from request
__u32 error; 0 = operation completed successfully,
else error code
... in case of read operation with no error,
......
Documentation for /proc/sys/*/* version 0.1
(c) 1998, Rik van Riel <H.H.vanRiel@fys.ruu.nl>
'Why', I hear you ask, 'would anyone even _want_ documentation
for them sysctl files? If anybody really needs it, it's all in
the source...'
Well, this documentation is written because some people either
don't know they need to tweak something, or because they don't
have the time or knowledge to read the source code.
Furthermore, the programmers who built sysctl have built it to
be actually used, not just for the fun of programming it :-)
==============================================================
Legal blurb:
As usual, there are two main things to consider:
1. you get what you pay for
2. it's free
The consequences are that I won't guarantee the correctness of
this document, and if you come to me complaining about how you
screwed up your system because of wrong documentation, I won't
feel sorry for you. I might even laugh at you...
But of course, if you _do_ manage to screw up your system using
only the sysctl options used in this file, I'd like to hear of
it. Not only to have a great laugh, but also to make sure that
you're the last RTFMing person to screw up.
In short, e-mail your suggestions, corrections and / or horror
stories to: <H.H.vanRiel@fys.ruu.nl>
Rik van Riel.
==============================================================
Introduction:
Sysctl is a means of configuring certain aspects of the kernel
at run-time, and the /proc/sys/ directory is there so that you
don't even need special tools to do it!
In fact, there are only four things needed to use these config
facilities:
- a running Linux system
- root access
- common sense (this is especially hard to come by these days)
- knowledge of what all those values mean
As a quick 'ls /proc/sys' will show, the directory consists of
several (arch-dependent?) subdirs. Each subdir is mainly about
one part of the kernel, so you can do configuration on a piece
by piece basis, or just some 'thematic frobbing'.
The subdirs are about:
debug/ <empty>
dev/ device specific information (eg dev/cdrom/info)
fs/ specific filesystems
binfmt_misc <linux/Documentation/binfmt_misc.txt>
kernel/ global kernel info / tuning
open file / inode tuning
miscellaneous stuff
net/ networking stuff, for documentation look in:
<linux/Documentation/networking/>
proc/ <empty>
vm/ memory management tuning
buffer and cache management
These are the subdirs I have on my system. There might be more
or other subdirs in another setup. If you see another dir, I'd
really like to hear about it :-)
Documentation for /proc/sys/kernel/* version 0.1
(c) 1998, Rik van Riel <H.H.vanRiel@fys.ruu.nl>
For general info and legal blurb, please look in README.
==============================================================
This file contains documentation for the sysctl files in
/proc/sys/kernel/ and is valid for Linux kernel version 2.1.
The files in this directory can be used to tune and monitor
miscellaneous and general things in the operation of the Linux
kernel. Since some of the files _can_ be used to screw up your
system, it is advisable to read both documentation and source
before actually making adjustments.
Currently, these files are in /proc/sys/kernel:
- ctrl-alt-del
- dentry-state
- domainname
- file-max
- file-nr
- hostname
- inode-max
- inode-nr
- inode-state
- osrelease
- ostype
- panic
- printk
- securelevel
- version
==============================================================
ctrl-alt-del:
When the value in this file is 0, ctrl-alt-del is trapped and
sent to the init(1) program to handle a graceful restart.
When, however, the value is > 0, Linux's reaction to a Vulcan
Nerve Pinch (tm) will be an immediate reboot, without even
syncing it's dirty buffers.
Note: when a program (like dosemu) has the keyboard in 'raw'
mode, the ctrl-alt-del is intercepted by the program before it
ever reaches the kernel tty layer, and it's up to the program
to decide what to do with it.
==============================================================
dentry-state:
From linux/fs/dentry.c:
--------------------------------------------------------------
struct {
int nr_dentry;
int nr_unused;
int age_limit; /* age in seconds */
int want_pages; /* pages requested by system */
int dummy[2];
} dentry_stat = {0, 0, 45, 0,};
--------------------------------------------------------------
Dentries are dynamically allocated and deallocated, and
nr_dentry seems to be 0 all the time. Hence it's safe to
assume that only nr_unused, age_limit and want_pages are
used. Nr_unused seems to be exactly what it's name says.
Age_limit is the age in seconds after which dcache entries
can be reclaimed when memory is short and want_pages is
nonzero when shrink_dcache_pages() has been called and the
dcache isn't pruned yet.
==============================================================
domainname & hostname:
These files can be controlled to set the domainname and
hostname of your box. For the classic darkstar.frop.org
a simple:
# echo "darkstar" > /proc/sys/kernel/hostname
# echo "frop.org" > /proc/sys/kernel/domainname
would suffice to set your hostname and domainname.
==============================================================
file-max & file-nr:
The kernel allocates filehandles dynamically, but as yet it
doesn't free them again...
The value in file-max denotes the maximum number of file-
handles that the Linux kernel will allocate. When you get lots
of error messages about running out of file handles, you might
want to increase this limit.
The three values in file-nr denote the number of allocated
file handles, the number of used file handles and the maximum
number of file handles. When the allocated filehandles come
close to the maximum, but the number of actually used ones is
far behind, you've encountered a peek in your filehandle usage
and you don't need to increase the maximum.
==============================================================
inode-max, inode-nr & inode-state:
As with filehandles, the kernel allocates the inode structures
dynamically, but can't free them yet...
The value in inode-max denotes the maximum number of inode
handlers. This value should be 3-4 times larger as the value
in file-max, since stdin, stdout and network sockets also
need an inode struct to handle them. When you regularly run
out of inodes, you need to increase this value.
The file inode-nr contains the first two items from
inode-state, so we'll skip to that file...
Inode-state contains three actual numbers and four dummies.
The actual numbers are, in order of appearance, nr_inodes,
nr_free_inodes and preshrink.
Nr_inodes stands for the number of inodes the system has
allocated, this can be slightly more than inode-max because
Linux allocates them one pagefull at a time.
Nr_free_inodes represents the number of free inodes (?) and
preshrink is nonzero when the nr_inodes > inode-max and the
system needs to prune the inode list instead of allocating
more.
==============================================================
osrelease, ostype & version:
# cat osrelease
2.1.88
# cat ostype
Linux
# cat version
#5 Wed Feb 25 21:49:24 MET 1998
The files osrelease and ostype should be clear enough. Version
needs a little more clarification however. The '#5' means that
this is the fifth kernel built from this source base and the
date behind it indicates the time the kernel was built.
The only way to tune these values is to rebuild the kernel :-)
==============================================================
panic:
The value in this file represents the number of seconds the
kernel waits before rebooting on a panic. When you use the
software watchdog, the recommended setting is 60.
==============================================================
printk:
The four values in printk denote: console_loglevel,
default_message_loglevel, minimum_console_level and
default_console_loglevel respectively.
These values influence printk() behavior when printing or
logging error messages. See 'man 2 syslog' for more info on
the different loglevels.
- console_loglevel: messages with a higher priority than
this will be printed to the console
- default_message_level: messages without an explicit priority
will be printed with this priority
- minimum_console_loglevel: minimum (highest) value to which
console_loglevel can be set
- default_console_loglevel: default value for console_loglevel
Note: a quick look in linux/kernel/printk.c will reveal that
these variables aren't put inside a structure, so their order
in-core isn't formally guaranteed and garbage values _might_
occur when the compiler changes. (???)
==============================================================
securelevel:
When the value in this file is nonzero, root is prohibited
from:
- changing the immutable and append-only flags on files
- changing sysctl things (limited ???)
==============================================================
real-root-dev: (CONFIG_INITRD only)
This file is used to configure the real root device when using
an initial ramdisk to configure the system before switching to
the 'real' root device. See linux/Documentation/initrd.txt for
more info.
==============================================================
reboot-cmd: (Sparc only)
??? This seems to be a way to give an argument to the Sparc
ROM/Flash boot loader. Maybe to tell it what to do after
rebooting. ???
Documentation for /proc/sys/vm/* version 0.1
(c) 1998, Rik van Riel <H.H.vanRiel@fys.ruu.nl>
For general info and legal blurb, please look in README.
==============================================================
This file contains the documentation for the sysctl files in
/proc/sys/vm and is valid for Linux kernel version 2.1.
The files in this directory can be used to tune the operation
of the virtual memory (VM) subsystem of the Linux kernel, and
one of the files (bdflush) also has a little influence on disk
usage.
Currently, these files are in /proc/sys/vm:
- bdflush
- freepages
- overcommit_memory
- swapctl
- swapout_interval
==============================================================
bdflush:
This file controls the operation of the bdflush kernel
daemon. The source code to this struct can be found in
linux/mm/buffer.c. It currently contains 9 integer values,
of which 6 are actually used by the kernel.
From linux/fs/buffer.c:
--------------------------------------------------------------
union bdflush_param{
struct {
int nfract; /* Percentage of buffer cache dirty to
activate bdflush */
int ndirty; /* Maximum number of dirty blocks to
write out per wake-cycle */
int nrefill; /* Number of clean buffers to try to
obtain each time we call refill */
int nref_dirt; /* Dirty buffer threshold for activating
bdflush when trying to refill buffers. */
int dummy1; /* unused */
int age_buffer; /* Time for normal buffer to age before
we flush it */
int age_super; /* Time for superblock to age before we
flush it */
int dummy2; /* unused */
int dummy3; /* unused */
} b_un;
unsigned int data[N_PARAM];
} bdf_prm = {{40, 500, 64, 256, 15, 30*HZ, 5*HZ, 1884, 2}};
--------------------------------------------------------------
The first parameter governs the maximum number of of dirty
buffers in the buffer cache. Dirty means that the contents
of the buffer still have to be written to disk (as opposed
to a clean buffer, which can just be forgotten about).
Setting this to a high value means that Linux can delay disk
writes for a long time, but it also means that it will have
to do a lot I/O at once when memory becomes short. A low
value will spread out disk I/O more evenly.
The second parameter (ndirty) gives the maximum number of
dirty buffers that bdflush can write to the disk in one time.
A high value will mean delayed, bursty I/O, while a small
value can lead to memory shortage when bdflush isn't woken
up often enough...
The third parameter (nrefill) is the number of buffers that
bdflush will add to the list of free buffers when
refill_freelist() is called. It is necessary to allocate free
buffers beforehand, since the buffers often are of a different
size than memory pages and some bookkeeping needs to be done
beforehand. The higher the number, the more memory will be
wasted and the less often refill_freelist() will need to run.
When refill_freelist() comes across more than nref_dirt dirty
buffers, it will wake up bdflush.
Finally, the age_buffer and age_super parameters govern the
maximum time Linux waits before writing out a dirty buffer
to disk. The value is expressed in jiffies (clockticks), the
number of jiffies per second is 100, except on Alpha machines
(1024). Age_buffer is the maximum age for data blocks, while
age_super is for filesystem metadata.
==============================================================
freepages:
This file contains three values: min_free_pages, free_pages_low
and free_pages_high in order.
These numbers are used by the VM subsystem to keep a reasonable
number of pages on the free page list, so that programs can
allocate new pages without having to wait for the system to
free used pages first. The actual freeing of pages is done
by kswapd, a kernel daemon.
min_free_pages -- when the number of free pages reaches this
level, only the kernel can allocate memory
for _critical_ tasks only
free_pages_low -- when the number of free pages drops below
this level, kswapd is woken up immediately
free_pages_high -- this is kswapd's target, when more than
free_pages_high pages are free, kswapd will
stop swapping.
When the number of free pages is between free_pages_low and
free_pages_high, and kswapd hasn't run for swapout_interval
jiffies, then kswapd is woken up too. See swapout_interval
for more info.
When free memory is always low on your system, and kswapd has
trouble keeping up with allocations, you might want to
increase these values, especially free_pages_high and perhaps
free_pages_low. I've found that a 1:2:4 relation for these
values tend to work rather well in a heavily loaded system.
==============================================================
overcommit_memory:
This file contains only one value. The following algorithm
is used to decide if there's enough memory. If the value
of overcommit_memory > 0, then there's always enough
memory :-). This is a useful feature, since programs often
malloc() huge amounts of memory 'just in case', while they
only use a small part of it. Leaving this value at 0 will
lead to the failure of such a huge malloc(), when in fact
the system has enough memory for the program to run...
On the other hand, enabling this feature can cause you to
run out of memory and thrash the system to death, so large
and/or important servers will want to set this value to 0.
From linux/mm/mmap.c:
--------------------------------------------------------------
static inline int vm_enough_memory(long pages)
{
/* Stupid algorithm to decide if we have enough memory: while
* simple, it hopefully works in most obvious cases.. Easy to
* fool it, but this should catch most mistakes.
*/
long freepages;
/* Sometimes we want to use more memory than we have. */
if (sysctl_overcommit_memory)
return 1;
freepages = buffermem >> PAGE_SHIFT;
freepages += page_cache_size;
freepages >>= 1;
freepages += nr_free_pages;
freepages += nr_swap_pages;
freepages -= num_physpages >> 4;
return freepages > pages;
}
==============================================================
swapctl:
This file contains no less than 16 variables, of which about
half is actually used :-) In the listing below, the unused
variables are marked as such.
All of these values are used by kswapd, and the usage can be
found in linux/mm/vmscan.c.
From linux/include/linux/swapctl.h:
--------------------------------------------------------------
typedef struct swap_control_v5
{
unsigned int sc_max_page_age;
unsigned int sc_page_advance;
unsigned int sc_page_decline;
unsigned int sc_page_initial_age;
unsigned int sc_max_buff_age; /* unused */
unsigned int sc_buff_advance; /* unused */
unsigned int sc_buff_decline; /* unused */
unsigned int sc_buff_initial_age; /* unused */
unsigned int sc_age_cluster_fract;
unsigned int sc_age_cluster_min;
unsigned int sc_pageout_weight;
unsigned int sc_bufferout_weight;
unsigned int sc_buffer_grace; /* unused */
unsigned int sc_nr_buffs_to_free; /* unused */
unsigned int sc_nr_pages_to_free; /* unused */
enum RCL_POLICY sc_policy; /* RCL_PERSIST hardcoded */
} swap_control_v5;
--------------------------------------------------------------
The first four variables are used to keep track of Linux'
page aging. Page aging is a bookkeeping method to keep track
of which pages of memory are used often, and which pages can
be swapped out without consequences.
When a page is swapped in, it starts at sc_page_initial_age
(default 3) and when the page is scanned by kswapd, it's age
is adjusted according to the following scheme:
- if the page was used since the last time we scanned, it's
age is increased sc_page_advance (default 3) up to a maximum
of sc_max_page_age (default 20)
- else (it wasn't used) it's age is decreased sc_page_decline
(default 1)
And when a page reaches age 0, it's ready to be swapped out.
The variables sc_age_cluster_fract till sc_bufferout_weight
have to do with the amount of scanning kswapd is doing on
each call to try_to_swap_out().
sc_age_cluster_fract is used to calculate how many pages from
a process are to be scanned by kswapd. The formula used is
sc_age_cluster_fract/1024 * RSS, so if you want kswapd to scan
the whole process, sc_age_cluster_fract needs to have a value
of 1024. The minimum number of pages kswapd will scan is
represented by sc_age_cluster_min, this is done so kswapd will
also scan small processes.
The values of sc_pageout_weight and sc_bufferout_weight are
used to control the how many tries kswapd will do in order
to swapout one page / buffer. As with sc_age_cluster_fract,
the actual value is calculated by several more or less complex
formulae and the default value is good for every purpose.
==============================================================
swapout_interval:
The single value in this file controls the amount of time
between successive wakeups of kswapd when nr_free_pages is
between free_pages_low and free_pages_high. The default value
of HZ/4 is usually right, but when kswapd can't keep up with
the number of allocations in your system, you might want to
decrease this number.
......@@ -20,7 +20,7 @@ for this task because they have to be valid in the view of mounted
filesystems at all clients, not at the server.
Linux transname overcomes this problem by allowing filenames
to be context-dependend. For example, if you have a file /etc/config
to be context-dependent. For example, if you have a file /etc/config
that should differ on the hosts "myserver" and "myclient", you just
create two different files named /etc/config#host=myserver# and
/etc/config#host=myclient# . On host "myserver", the file
......
......@@ -920,7 +920,7 @@ miata_device_interrupt(unsigned long vector, struct pt_regs *regs)
*(vulp)PYXIS_INT_MASK, inb(0x20) | (inb(0xA0) << 8));
#endif
/* For now, AND off and bits we are not interested in. */
/* For now, AND off any bits we are not interested in. */
#if defined(CONFIG_ALPHA_MIATA)
/* HALT (2), timer (6), ISA Bridge (7), 21142/3 (8),
then all the PCI slots/INTXs (12-31). */
......
......@@ -4,6 +4,7 @@
* Based on code written by David A Rusling (david.rusling@reo.mts.dec.com).
*
*/
#include <linux/config.h> /* CONFIG_ALPHA_RUFFIAN. */
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/bios32.h>
......
/*
* SMC 37C669 initialization code
*/
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/bios32.h>
......
......@@ -82,20 +82,16 @@ static int disabled_irq [NR_IRQS] = { 0, };
* but we have _much_ higher compatibility and robustness this way.
*/
#ifndef __SMP__
static const unsigned int io_apic_irqs = 0;
#else
/*
* Default to all normal IRQ's _not_ using the IO APIC.
*
* To get IO-APIC interrupts you should either:
* - turn some of them into IO-APIC interrupts at runtime
* with some magic system call interface.
* - explicitly use irq 16-19 depending on which PCI irq
* line your PCI controller uses.
*/
unsigned int io_apic_irqs = 0;
#endif
/*
* Default to all normal IRQ's _not_ using the IO APIC.
*
* To get IO-APIC interrupts you should either:
* - turn some of them into IO-APIC interrupts at runtime
* with some magic system call interface.
* - explicitly use irq 16-19 depending on which PCI irq
* line your PCI controller uses.
*/
unsigned int io_apic_irqs = 0;
struct hw_interrupt_type {
void (*handle)(unsigned int irq, int cpu, struct pt_regs * regs);
......
......@@ -20,11 +20,7 @@ void init_IO_APIC_traps(void);
int IO_APIC_get_PCI_irq_vector (int bus, int slot, int fn);
void make_8259A_irq (unsigned int irq);
#ifdef __SMP__
extern unsigned int io_apic_irqs;
#else
extern const unsigned int io_apic_irqs;
#endif
extern unsigned int io_apic_irqs;
#define IO_APIC_IRQ(x) ((1<<x) & io_apic_irqs)
......
......@@ -331,17 +331,18 @@ struct cpu_model_info {
static struct cpu_model_info cpu_models[] __initdata = {
{ X86_VENDOR_INTEL, 4,
{ "486 DX-25/33", "486 DX-50", "486 SX", "486 DX/2", "486 SL", "486 SX/2",
NULL, "486 DX/2-WB", "486 DX/4", "486 DX/4-WB", NULL, NULL, NULL, NULL,
NULL, NULL }},
{ "486 DX-25/33", "486 DX-50", "486 SX", "486 DX/2", "486 SL",
"486 SX/2", NULL, "486 DX/2-WB", "486 DX/4", "486 DX/4-WB", NULL,
NULL, NULL, NULL, NULL, NULL }},
{ X86_VENDOR_INTEL, 5,
{ "Pentium 60/66 A-step", "Pentium 60/66", "Pentium 75+",
"OverDrive PODP5V83", "Pentium MMX", NULL, NULL,
"Mobile Pentium 75+", "Mobile Pentium MMX", NULL, NULL, NULL,
NULL, NULL, NULL, NULL }},
{ X86_VENDOR_INTEL, 6,
{ "Pentium Pro A-step", "Pentium Pro", NULL, "Pentium II", NULL,
"Pentium II (0.25 um)", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }},
{ "Pentium Pro A-step", "Pentium Pro", NULL, "Pentium II (Klamath)",
NULL, "Pentium II (Deschutes)", NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL }},
{ X86_VENDOR_CYRIX, 4,
{ NULL, NULL, NULL, NULL, "MediaGX", NULL, NULL, NULL, NULL, "5x86",
NULL, NULL, NULL, NULL, NULL, NULL }},
......@@ -349,8 +350,8 @@ static struct cpu_model_info cpu_models[] __initdata = {
{ NULL, NULL, "6x86", NULL, "GXm", NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL }},
{ X86_VENDOR_CYRIX, 6,
{ "6x86MX", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL }},
{ "6x86MX", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL }},
{ X86_VENDOR_AMD, 4,
{ NULL, NULL, NULL, "DX/2", NULL, NULL, NULL, "DX/2-WB", "DX/4",
"DX/4-WB", NULL, NULL, NULL, NULL, "Am5x86-WT", "Am5x86-WB" }},
......@@ -442,7 +443,7 @@ int get_cpuinfo(char * buffer)
"fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce",
"cx8", "apic", "10", "sep", "mtrr", "pge", "mca", "cmov",
"fcmov", "17", "18", "19", "20", "21", "22", "mmx",
"cxmmx", "25", "26", "27", "28", "29", "30", "amd3d"
"osfxsr", "25", "26", "27", "28", "29", "30", "amd3d"
};
struct cpuinfo_x86 *c = cpu_data;
int i, n;
......
......@@ -158,7 +158,7 @@ if [ "$CONFIG_SCSI" != "n" ]; then
dep_tristate 'Adaptec AIC7xxx support' CONFIG_SCSI_AIC7XXX $CONFIG_SCSI
if [ "$CONFIG_SCSI_AIC7XXX" != "n" ]; then
bool ' Enable tagged command queueing' CONFIG_AIC7XXX_TAGGED_QUEUEING Y
dep_tristate ' Override driver defaults for commands per LUN' CONFIG_OVERRIDE_CMDS N
bool ' Override driver defaults for commands per LUN' CONFIG_OVERRIDE_CMDS N
if [ "$CONFIG_OVERRIDE_CMDS" != "n" ]; then
int ' Maximum number of commands per LUN' CONFIG_AIC7XXX_CMDS_PER_LUN 8
fi
......
......@@ -284,7 +284,7 @@ static ssize_t read_mouse(struct file * file, char * buffer,
static unsigned int mouse_poll(struct file *file, poll_table * wait)
{
poll_wait(&mouse.wait, wait);
poll_wait(file, &mouse.wait, wait);
if (mouse.ready)
return POLLIN | POLLRDNORM;
return 0;
......
......@@ -948,7 +948,7 @@ static unsigned int do_poll(struct file *fp, poll_table * wait)
as = fp->private_data;
if (check_apm_bios_struct(as, "select"))
return 0;
poll_wait(&process_list, wait);
poll_wait(fp, &process_list, wait);
if (!queue_empty(as))
return POLLIN | POLLRDNORM;
return 0;
......
......@@ -134,7 +134,7 @@ static ssize_t read_mouse(struct file * file, char * buffer,
static unsigned int mouse_poll(struct file *file, poll_table *wait)
{
poll_wait(&mouse.wait, wait);
poll_wait(file, &mouse.wait, wait);
if (mouse.ready)
return POLLIN | POLLRDNORM;
return 0;
......
......@@ -176,7 +176,7 @@ static ssize_t read_mouse(struct file * file, char * buffer,
static unsigned int mouse_poll(struct file *file, poll_table * wait)
{
poll_wait(&mouse.wait, wait);
poll_wait(file, &mouse.wait, wait);
if (mouse.ready)
return POLLIN | POLLRDNORM;
return 0;
......
......@@ -223,7 +223,7 @@ static ssize_t read_mouse(struct file * file,
*/
static unsigned int mouse_poll(struct file *file, poll_table * wait)
{
poll_wait(&mouse.wait, wait);
poll_wait(file, &mouse.wait, wait);
if (mouse.ready)
return POLLIN | POLLRDNORM;
return 0;
......
......@@ -594,7 +594,7 @@ static unsigned int js_poll(struct file *file, poll_table *wait)
unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev);
curl = file->private_data;
poll_wait(&jsd[minor].wait, wait);
poll_wait(file, &jsd[minor].wait, wait);
if (GOF(curl->tail) != jsd[minor].ahead)
return POLLIN | POLLRDNORM;
return 0;
......
......@@ -475,6 +475,7 @@ static int lp_open(struct inode * inode, struct file * file)
return -ENXIO;
if (LP_F(minor) & LP_BUSY)
return -EBUSY;
LP_F(minor) |= LP_BUSY;
MOD_INC_USE_COUNT;
......@@ -491,23 +492,26 @@ static int lp_open(struct inode * inode, struct file * file)
if (status & LP_POUTPA) {
printk(KERN_INFO "lp%d out of paper\n", minor);
MOD_DEC_USE_COUNT;
LP_F(minor) &= ~LP_BUSY;
return -ENOSPC;
} else if (!(status & LP_PSELECD)) {
printk(KERN_INFO "lp%d off-line\n", minor);
MOD_DEC_USE_COUNT;
LP_F(minor) &= ~LP_BUSY;
return -EIO;
} else if (!(status & LP_PERRORP)) {
printk(KERN_ERR "lp%d printer error\n", minor);
MOD_DEC_USE_COUNT;
LP_F(minor) &= ~LP_BUSY;
return -EIO;
}
}
lp_table[minor].lp_buffer = (char *) kmalloc(LP_BUFFER_SIZE, GFP_KERNEL);
if (!lp_table[minor].lp_buffer) {
MOD_DEC_USE_COUNT;
LP_F(minor) &= ~LP_BUSY;
return -ENOMEM;
}
LP_F(minor) |= LP_BUSY;
return 0;
}
......
......@@ -159,7 +159,7 @@ static ssize_t read_mouse(struct file * file,
static unsigned int mouse_poll(struct file *file, poll_table * wait)
{
poll_wait(&mouse.wait, wait);
poll_wait(file, &mouse.wait, wait);
if (mouse.ready)
return POLLIN | POLLRDNORM;
return 0;
......
......@@ -1102,8 +1102,8 @@ static unsigned int normal_poll(struct tty_struct * tty, struct file * file, pol
{
unsigned int mask = 0;
poll_wait(&tty->read_wait, wait);
poll_wait(&tty->write_wait, wait);
poll_wait(file, &tty->read_wait, wait);
poll_wait(file, &tty->write_wait, wait);
if (input_available_p(tty, TIME_CHAR(tty) ? 0 : MIN_CHAR(tty)))
mask |= POLLIN | POLLRDNORM;
if (tty->packet && tty->link->ctrl_status)
......
......@@ -575,7 +575,7 @@ static ssize_t read_pad(struct file * file, char * buffer, size_t count, loff_t
static unsigned int pad_poll(struct file *file, poll_table * wait)
{
poll_wait(&queue, wait);
poll_wait(file, &queue, wait);
if(button_pending || xy_pending)
return POLLIN | POLLRDNORM;
return 0;
......
......@@ -567,7 +567,7 @@ static ssize_t read_aux(struct file * file, char * buffer,
static unsigned int aux_poll(struct file *file, poll_table * wait)
{
poll_wait(&queue->proc_list, wait);
poll_wait(file, &queue->proc_list, wait);
if (aux_ready)
return POLLIN | POLLRDNORM;
return 0;
......
......@@ -1140,8 +1140,8 @@ random_poll(struct file *file, poll_table * wait)
{
unsigned int mask;
poll_wait(&random_read_wait, wait);
poll_wait(&random_write_wait, wait);
poll_wait(file, &random_read_wait, wait);
poll_wait(file, &random_write_wait, wait);
mask = 0;
if (random_state.entropy_count >= WAIT_INPUT_BITS)
mask |= POLLIN | POLLRDNORM;
......
......@@ -517,7 +517,7 @@ static int rtc_release(struct inode *inode, struct file *file)
#ifndef __alpha__
static unsigned int rtc_poll(struct file *file, poll_table *wait)
{
poll_wait(&rtc_wait, wait);
poll_wait(file, &rtc_wait, wait);
if (rtc_irq_data != 0)
return POLLIN | POLLRDNORM;
return 0;
......
......@@ -1015,7 +1015,7 @@ isdn_poll(struct file *file, poll_table * wait)
int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL);
if (minor == ISDN_MINOR_STATUS) {
poll_wait(&(dev->info_waitq), wait);
poll_wait(file, &(dev->info_waitq), wait);
/* mask = POLLOUT | POLLWRNORM; */
if (file->private_data) {
mask |= POLLIN | POLLRDNORM;
......@@ -1023,7 +1023,7 @@ isdn_poll(struct file *file, poll_table * wait)
return mask;
}
if (minor >= ISDN_MINOR_CTRL && minor <= ISDN_MINOR_CTRLMAX) {
poll_wait(&(dev->drv[drvidx]->st_waitq), wait);
poll_wait(file, &(dev->drv[drvidx]->st_waitq), wait);
if (drvidx < 0) {
printk(KERN_ERR "isdn_common: isdn_poll 1 -> what the hell\n");
return POLLERR;
......
......@@ -702,7 +702,7 @@ isdn_ppp_poll(struct file *file, poll_table * wait)
if (is->debug & 0x2)
printk(KERN_DEBUG "isdn_ppp_poll: minor: %d\n", MINOR(file->f_dentry->d_inode->i_rdev));
poll_wait(&is->wq, wait);
poll_wait(file, &is->wq, wait);
if (!(is->state & IPPP_OPEN)) {
printk(KERN_DEBUG "isdn_ppp: device not open\n");
......
......@@ -53,6 +53,7 @@ if [ "$CONFIG_NET_ETHERNET" = "y" ]; then
else
tristate 'SMC Ultra support' CONFIG_ULTRA
fi
tristate 'SMC Ultra32 EISA support' CONFIG_ULTRA32
tristate 'SMC 9194 support' CONFIG_SMC9194
fi
bool 'Racal-Interlan (Micom) NI cards' CONFIG_NET_VENDOR_RACAL
......
......@@ -172,6 +172,16 @@ else
endif
endif
ifeq ($(CONFIG_ULTRA32),y)
L_OBJS += smc-ultra32.o
CONFIG_8390_BUILTIN = y
else
ifeq ($(CONFIG_ULTRA32),m)
CONFIG_8390_MODULE = y
M_OBJS += smc-ultra32.o
endif
endif
ifeq ($(CONFIG_E2100),y)
L_OBJS += e2100.o
CONFIG_8390_BUILTIN = y
......
......@@ -138,6 +138,9 @@ __initfunc(static int ethif_probe(struct device *dev))
#if defined(CONFIG_MCA)
&& ultramca_probe(dev)
#endif
#if defined(CONFIG_ULTRA32)
&& ultra32_probe(dev)
#endif
#endif
#if defined(CONFIG_SMC9194)
&& smc_init(dev)
......
......@@ -2564,8 +2564,8 @@ ppp_tty_poll (struct tty_struct *tty, struct file *filp, poll_table * wait)
if (ppp && ppp->magic == PPP_MAGIC && tty == ppp->tty) {
CHECK_PPP (0);
poll_wait(&ppp->read_wait, wait);
poll_wait(&ppp->write_wait, wait);
poll_wait(filp, &ppp->read_wait, wait);
poll_wait(filp, &ppp->write_wait, wait);
/* Must lock the user buffer area while checking. */
CHECK_BUF_MAGIC(ppp->ubuf);
......
This diff is collapsed.
......@@ -25,7 +25,7 @@ dep_tristate 'Adaptec AHA1740 support' CONFIG_SCSI_AHA1740 $CONFIG_SCSI
dep_tristate 'Adaptec AIC7xxx support' CONFIG_SCSI_AIC7XXX $CONFIG_SCSI
if [ "$CONFIG_SCSI_AIC7XXX" != "n" ]; then
bool ' Enable tagged command queueing' CONFIG_AIC7XXX_TAGGED_QUEUEING Y
dep_tristate ' Override driver defaults for commands per LUN' CONFIG_OVERRIDE_CMDS N
bool ' Override driver defaults for commands per LUN' CONFIG_OVERRIDE_CMDS N
if [ "$CONFIG_OVERRIDE_CMDS" != "n" ]; then
int ' Maximum number of commands per LUN' CONFIG_AIC7XXX_CMDS_PER_LUN 8
fi
......
......@@ -5,19 +5,7 @@
* Bus Master Host Adapter *
***********************************************************************/
/* Kernel version autodetection */
#include <linux/version.h>
/* Convert Linux Version, Patch-level, Sub-level to LINUX_VERSION_CODE. */
#define ASC_LINUX_VERSION(V, P, S) (((V) * 65536) + ((P) * 256) + (S))
#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,50)
#define VERSION_ELF_1_2_13
#elseif LINUX_VERSION_CODE < ASC_LINUX_VERSION(1,3,95)
#define VERSION_1_3_85
#else
#define VERSION_2_0_0
#endif
/*
* AMD 53C974 driver, header file
......@@ -28,45 +16,27 @@
#if defined(HOSTS_C) || defined(MODULE)
#ifdef VERSION_2_0_0
#include <scsi/scsicam.h>
#else
#include <linux/scsicam.h>
#endif
extern int DC390_detect(Scsi_Host_Template *psht);
extern int DC390_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *));
extern int DC390_abort(Scsi_Cmnd *cmd);
#ifdef VERSION_2_0_0
extern int DC390_reset(Scsi_Cmnd *cmd, unsigned int resetFlags);
#else
extern int DC390_reset(Scsi_Cmnd *cmd);
#endif
#ifdef VERSION_ELF_1_2_13
extern int DC390_bios_param(Disk *disk, int devno, int geom[]);
#else
extern int DC390_bios_param(Disk *disk, kdev_t devno, int geom[]);
#endif
#ifdef MODULE
static int DC390_release(struct Scsi_Host *);
#else
#define DC390_release NULL
# define DC390_release NULL
#endif
#ifndef VERSION_ELF_1_2_13
extern struct proc_dir_entry proc_scsi_tmscsim;
extern int tmscsim_proc_info(char *buffer, char **start, off_t offset, int length, int hostno, int inout);
#endif
#ifdef VERSION_2_0_0
#define DC390_T { \
proc_dir: &proc_scsi_tmscsim, \
proc_info: tmscsim_proc_info, \
name: "Tekram DC390(T) V1.10 Dec-05-1996",\
proc_info: tmscsim_proc_info, \
name: "Tekram DC390(T) V1.12 Feb-25-1998",\
detect: DC390_detect, \
release: DC390_release, \
queuecommand: DC390_queue_command, \
......@@ -79,61 +49,6 @@ extern int tmscsim_proc_info(char *buffer, char **start, off_t offset, int lengt
cmd_per_lun: 2, \
use_clustering: DISABLE_CLUSTERING \
}
#endif
#ifdef VERSION_1_3_85
#define DC390_T { \
NULL, /* *next */ \
NULL, /* *usage_count */ \
&proc_scsi_tmscsim, /* *proc_dir */ \
tmscsim_proc_info, /* (*proc_info)() */ \
"Tekram DC390(T) V1.10 Dec-05-1996", /* *name */ \
DC390_detect, \
DC390_release, /* (*release)() */ \
NULL, /* *(*info)() */ \
NULL, /* (*command)() */ \
DC390_queue_command, \
DC390_abort, \
DC390_reset, \
NULL, /* slave attach */\
DC390_bios_param, \
10,/* can queue(-1) */ \
7, /* id(-1) */ \
SG_ALL, \
2, /* cmd per lun(2) */ \
0, /* present */ \
0, /* unchecked isa dma */ \
DISABLE_CLUSTERING \
}
#endif
#ifdef VERSION_ELF_1_2_13
#define DC390_T { \
NULL, \
NULL, \
"Tekram DC390(T) V1.10 Dec-05-1996",\
DC390_detect, \
DC390_release, \
NULL, /* info */ \
NULL, /* command, deprecated */ \
DC390_queue_command, \
DC390_abort, \
DC390_reset, \
NULL, /* slave attach */\
DC390_bios_param, \
10,/* can queue(-1) */ \
7, /* id(-1) */ \
16,/* old (SG_ALL) */ \
2, /* cmd per lun(2) */ \
0, /* present */ \
0, /* unchecked isa dma */ \
DISABLE_CLUSTERING \
}
#endif
#endif /* defined(HOSTS_C) || defined(MODULE) */
......
......@@ -175,13 +175,8 @@ DC390_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB )
}
#ifndef VERSION_ELF_1_2_13
static void
DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs)
#else
static void
DC390_Interrupt( int irq, struct pt_regs *regs)
#endif
{
PACB pACB;
PDCB pDCB;
......@@ -303,11 +298,7 @@ DC390_DataOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
pSRB->pSegmentList++;
psgl = pSRB->pSegmentList;
#ifndef VERSION_ELF_1_2_13
pSRB->SGPhysAddr = virt_to_phys( psgl->address );
#else
pSRB->SGPhysAddr = (ULONG) psgl->address;
#endif
pSRB->SGToBeXferLen = (ULONG) psgl->length;
}
else
......@@ -368,11 +359,7 @@ DC390_DataIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
pSRB->pSegmentList++;
psgl = pSRB->pSegmentList;
#ifndef VERSION_ELF_1_2_13
pSRB->SGPhysAddr = virt_to_phys( psgl->address );
#else
pSRB->SGPhysAddr = (ULONG) psgl->address;
#endif
pSRB->SGToBeXferLen = (ULONG) psgl->length;
}
else
......@@ -427,11 +414,7 @@ DC390_DataIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
if( residual )
{
bval = inb(ioport+ScsiFifo); /* get residual byte */
#ifndef VERSION_ELF_1_2_13
ptr = (PUCHAR) phys_to_virt( pSRB->SGPhysAddr );
#else
ptr = (PUCHAR) pSRB->SGPhysAddr;
#endif
*ptr = bval;
pSRB->SGPhysAddr++;
pSRB->TotalXferredLen++;
......@@ -643,11 +626,7 @@ DataIO_Comm( PACB pACB, PSRB pSRB, UCHAR ioDir)
if( !pSRB->SGToBeXferLen )
{
psgl = pSRB->pSegmentList;
#ifndef VERSION_ELF_1_2_13
pSRB->SGPhysAddr = virt_to_phys( psgl->address );
#else
pSRB->SGPhysAddr = (ULONG) psgl->address;
#endif
pSRB->SGToBeXferLen = (ULONG) psgl->length;
}
lval = pSRB->SGToBeXferLen;
......
......@@ -547,8 +547,8 @@ static unsigned int sg_poll(struct file *file, poll_table * wait)
struct scsi_generic *device = &scsi_generics[dev];
unsigned int mask = 0;
poll_wait(&scsi_generics[dev].read_wait, wait);
poll_wait(&scsi_generics[dev].write_wait, wait);
poll_wait(file, &scsi_generics[dev].read_wait, wait);
poll_wait(file, &scsi_generics[dev].write_wait, wait);
if(device->pending && device->complete)
mask |= POLLIN | POLLRDNORM;
if(!device->pending)
......
......@@ -24,6 +24,9 @@
* 1.09 11/30/96 KG Added register the allocated IO space *
* 1.10 12/05/96 CLH Modified tmscsim_proc_info(), and reset *
* pending interrupt in DC390_detect() *
* 1.11 02/05/97 KG/CLH Fixeds problem with partitions greater *
* than 1GB *
* 1.12 25/02/98 KG Cleaned up ifdefs for 2.1 kernel *
***********************************************************************/
......@@ -32,7 +35,7 @@
#define SCSI_MALLOC
#ifdef MODULE
#include <linux/module.h>
# include <linux/module.h>
#endif
#include <asm/dma.h>
......@@ -677,11 +680,11 @@ int DC390_bios_param(Disk *disk, kdev_t devno, int geom[])
sectors = 32;
cylinders = disk->capacity / (heads * sectors);
if ( cylinders > 1024)
if ( (pACB->Gmode2 & GREATER_1G) && (cylinders > 1024) )
{
heads = 255;
sectors = 63;
cylinders = disk->capacity / (255 * 63);
cylinders = disk->capacity / (heads * sectors);
}
geom[0] = heads;
......@@ -898,11 +901,7 @@ RecoverSRB( PACB pACB )
* Returns : 0 on success.
***********************************************************************/
#ifdef VERSION_2_0_0
int DC390_reset(Scsi_Cmnd *cmd, unsigned int resetFlags)
#else
int DC390_reset (Scsi_Cmnd *cmd)
#endif
{
USHORT ioport;
unsigned long flags;
......@@ -1161,7 +1160,7 @@ __initfunc(int DC390_initAdapter( PSH psh, ULONG io_port, UCHAR Irq, USHORT inde
if( !used_irq )
{
if( request_irq(Irq, DC390_Interrupt, SA_INTERRUPT, "tmscsim", NULL))
if( request_irq(Irq, DC390_Interrupt, SA_INTERRUPT | SA_SHIRQ, "tmscsim", NULL))
{
printk("DC390: register IRQ error!\n");
return( -1 );
......@@ -1763,11 +1762,11 @@ int tmscsim_proc_info(char *buffer, char **start,
if (acbpnt == (PACB)-1) return(-ESRCH);
if(!shpnt) return(-ESRCH);
if(inout) // Has data been written to the file ?
if(inout) /* Has data been written to the file ? */
return(tmscsim_set_info(buffer, length, shpnt));
SPRINTF("Tekram DC390(T) PCI SCSI Host Adadpter, ");
SPRINTF("Driver Version 1.10, 1996/12/05\n");
SPRINTF("Driver Version 1.12, 1998/02/25\n");
save_flags(flags);
cli();
......
......@@ -4,8 +4,8 @@
;* Device Driver *
;***********************************************************************/
#ifndef TMSCSIM_H
#define TMSCSIM_H
#ifndef _TMSCSIM_H
#define _TMSCSIM_H
#define IRQ_NONE 255
......@@ -677,4 +677,4 @@ UCHAR xx2;
(PCI_CFG2_ENABLE | (((function) << 1) & 0xe))
#endif /* TMSCSIM_H */
#endif /* _TMSCSIM_H */
......@@ -1150,7 +1150,7 @@ void DMAbuf_init(int dev, int dma1, int dma2)
}
}
static unsigned int poll_input(int dev, poll_table *wait)
static unsigned int poll_input(struct file * file, int dev, poll_table *wait)
{
struct audio_operations *adev = audio_devs[dev];
struct dma_buffparms *dmap = adev->dmap_in;
......@@ -1158,7 +1158,7 @@ static unsigned int poll_input(int dev, poll_table *wait)
if (!(adev->open_mode & OPEN_READ))
return 0;
if (dmap->mapping_flags & DMA_MAP_MAPPED) {
poll_wait(&adev->in_sleeper, wait);
poll_wait(file, &adev->in_sleeper, wait);
if (dmap->qlen)
return POLLIN | POLLRDNORM;
return 0;
......@@ -1169,7 +1169,7 @@ static unsigned int poll_input(int dev, poll_table *wait)
!dmap->qlen && adev->go) {
unsigned long flags;
poll_wait(&adev->in_sleeper, wait);
poll_wait(file, &adev->in_sleeper, wait);
save_flags(flags);
cli();
DMAbuf_activate_recording(dev, dmap);
......@@ -1177,13 +1177,13 @@ static unsigned int poll_input(int dev, poll_table *wait)
}
return 0;
}
poll_wait(&adev->in_sleeper, wait);
poll_wait(file, &adev->in_sleeper, wait);
if (!dmap->qlen)
return 0;
return POLLIN | POLLRDNORM;
}
static unsigned int poll_output(int dev, poll_table *wait)
static unsigned int poll_output(struct file * file, int dev, poll_table *wait)
{
struct audio_operations *adev = audio_devs[dev];
struct dma_buffparms *dmap = adev->dmap_out;
......@@ -1191,14 +1191,14 @@ static unsigned int poll_output(int dev, poll_table *wait)
if (!(adev->open_mode & OPEN_WRITE))
return 0;
if (dmap->mapping_flags & DMA_MAP_MAPPED) {
poll_wait(&adev->out_sleeper, wait);
poll_wait(file, &adev->out_sleeper, wait);
if (dmap->qlen)
return POLLOUT | POLLWRNORM;
return 0;
}
if (dmap->dma_mode == DMODE_INPUT)
return 0;
poll_wait(&adev->out_sleeper, wait);
poll_wait(file, &adev->out_sleeper, wait);
if (dmap->dma_mode == DMODE_NONE)
return POLLOUT | POLLWRNORM;
if (!DMAbuf_space_in_queue(dev))
......@@ -1206,9 +1206,9 @@ static unsigned int poll_output(int dev, poll_table *wait)
return POLLOUT | POLLWRNORM;
}
unsigned int DMAbuf_poll(int dev, poll_table *wait)
unsigned int DMAbuf_poll(struct file * file, int dev, poll_table *wait)
{
return poll_input(dev, wait) | poll_output(dev, wait);
return poll_input(file, dev, wait) | poll_output(file, dev, wait);
}
void DMAbuf_deinit(int dev)
......
......@@ -114,119 +114,5 @@
#define SM_WAVE
#define __SGNXPRO__
#define SM_GAMES
#define DESKPROXL
/* Computer generated file. Please don't edit! */
#define KERNEL_COMPATIBLE_CONFIG
#define SELECTED_SOUND_OPTIONS 0x00000000
#if \
defined(CONFIG_PSS) || defined(CONFIG_SSCAPE) || \
defined(CONFIG_CS4232) || defined(CONFIG_MAUI) || \
defined(CONFIG_PSS_MODULE) || defined(CONFIG_SSCAPE_MODULE) || \
defined(CONFIG_CS4232_MODULE) || defined(CONFIG_MAUI_MODULE)
# define CONFIG_MPU_EMU
#endif
#if \
defined(CONFIG_PSS) || defined(CONFIG_GUS16) || \
defined(CONFIG_GUSMAX) || defined(CONFIG_MSS) || \
defined(CONFIG_SSCAPE) || defined(CONFIG_TRIX) || \
defined(CONFIG_MAD16) || defined(CONFIG_CS4232) || \
defined(CONFIG_PSS_MODULE) || defined(CONFIG_GUS16_MODULE) || \
defined(CONFIG_GUSMAX_MODULE) || defined(CONFIG_MSS_MODULE) || \
defined(CONFIG_SSCAPE_MODULE) || defined(CONFIG_TRIX_MODULE) || \
defined(CONFIG_MAD16_MODULE) || defined(CONFIG_CS4232_MODULE)
# define CONFIG_AD1848
#endif
#if \
defined(CONFIG_PAS) || defined(CONFIG_SB) || \
defined(CONFIG_GUS) || defined(CONFIG_PSS) || \
defined(CONFIG_GUS16) || defined(CONFIG_GUSMAX) || \
defined(CONFIG_MSS) || defined(CONFIG_SSCAPE) || \
defined(CONFIG_TRIX) || defined(CONFIG_MAD16) || \
defined(CONFIG_CS4232) || defined(CONFIG_OPL3SA1) || \
defined(CONFIG_SOFTOSS) || \
defined(CONFIG_PAS_MODULE) || defined(CONFIG_SB_MODULE) || \
defined(CONFIG_GUS_MODULE) || defined(CONFIG_PSS_MODULE) || \
defined(CONFIG_GUS16_MODULE) || defined(CONFIG_GUSMAX_MODULE) || \
defined(CONFIG_MSS_MODULE) || defined(CONFIG_SSCAPE_MODULE) || \
defined(CONFIG_TRIX_MODULE) || defined(CONFIG_MAD16_MODULE) || \
defined(CONFIG_CS4232_MODULE) || defined(CONFIG_OPL3SA1_MODULE) || \
defined(CONFIG_SOFTOSS_MODULE)
# define CONFIG_AUDIO
#endif
#if \
defined(CONFIG_PAS) || defined(CONFIG_SB) || \
defined(CONFIG_GUS) || defined(CONFIG_MPU401) || \
defined(CONFIG_PSS) || defined(CONFIG_GUS16) || \
defined(CONFIG_GUSMAX) || defined(CONFIG_SSCAPE) || \
defined(CONFIG_TRIX) || defined(CONFIG_MAD16) || \
defined(CONFIG_CS4232) || defined(CONFIG_MAUI) || \
defined(CONFIG_OPL3SA1) || defined(CONFIG_SOFTOSS) || \
defined(CONFIG_PAS_MODULE) || defined(CONFIG_SB_MODULE) || \
defined(CONFIG_GUS_MODULE) || defined(CONFIG_MPU401_MODULE) || \
defined(CONFIG_PSS_MODULE) || defined(CONFIG_GUS16_MODULE) || \
defined(CONFIG_GUSMAX_MODULE) || defined(CONFIG_SSCAPE_MODULE) || \
defined(CONFIG_TRIX_MODULE) || defined(CONFIG_MAD16_MODULE) || \
defined(CONFIG_CS4232_MODULE) || defined(CONFIG_MAUI_MODULE) || \
defined(CONFIG_OPL3SA1_MODULE) || defined(CONFIG_SOFTOSS_MODULE)
# define CONFIG_MIDI
#endif
#if \
defined(CONFIG_SB) || defined(CONFIG_TRIX) || \
defined(CONFIG_MAD16) || \
defined(CONFIG_SB_MODULE) || defined(CONFIG_TRIX_MODULE) || \
defined(CONFIG_MAD16_MODULE)
# define CONFIG_SBDSP
#endif
#if \
defined(CONFIG_SB_MODULE) || defined(CONFIG_TRIX_MODULE) || \
defined(CONFIG_MAD16_MODULE)
# define CONFIG_SBDSP_MODULE
#endif
#if \
defined(CONFIG_SB) || defined(CONFIG_TRIX) || \
defined(CONFIG_MAD16) || defined(CONFIG_SB_MODULE) || \
defined(CONFIG_TRIX_MODULE) || defined(CONFIG_MAD16_MODULE)
# define CONFIG_UART401
#endif
#if \
defined(CONFIG_SB_MODULE) || defined(CONFIG_TRIX_MODULE) || \
defined(CONFIG_MAD16_MODULE)
#ifndef CONFIG_UART401_MODULE
#define CONFIG_UART401_MODULE
#endif
#endif
#if \
defined(CONFIG_PAS) || defined(CONFIG_SB) || \
defined(CONFIG_ADLIB) || defined(CONFIG_GUS) || \
defined(CONFIG_MPU401) || defined(CONFIG_PSS) || \
defined(CONFIG_SSCAPE) || defined(CONFIG_TRIX) || \
defined(CONFIG_MAD16) || defined(CONFIG_CS4232) || \
defined(CONFIG_MAUI) || \
defined(CONFIG_PAS_MODULE) || defined(CONFIG_SB_MODULE) || \
defined(CONFIG_ADLIB_MODULE) || defined(CONFIG_GUS_MODULE) || \
defined(CONFIG_MPU401_MODULE) || defined(CONFIG_PSS_MODULE) || \
defined(CONFIG_SSCAPE_MODULE) || defined(CONFIG_TRIX_MODULE) || \
defined(CONFIG_MAD16_MODULE) || defined(CONFIG_CS4232_MODULE) || \
defined(CONFIG_MAUI_MODULE)
# define CONFIG_SEQUENCER
#endif
/*
* Force on additional support
*/
#define SM_WAVE
#define __SGNXPRO__
#define SM_GAMES
/* #define SM_GAMES */
#define DESKPROXL
......@@ -396,12 +396,12 @@ unsigned int MIDIbuf_poll(int dev, struct file *file, poll_table * wait)
dev = dev >> 4;
/* input */
poll_wait(&input_sleeper[dev], wait);
poll_wait(file, &input_sleeper[dev], wait);
if (DATA_AVAIL(midi_in_buf[dev]))
mask |= POLLIN | POLLRDNORM;
/* output */
poll_wait(&midi_sleeper[dev], wait);
poll_wait(file, &midi_sleeper[dev], wait);
if (!SPACE_AVAIL(midi_out_buf[dev]))
mask |= POLLOUT | POLLWRNORM;
......
......@@ -1578,12 +1578,12 @@ unsigned int sequencer_poll(int dev, struct file *file, poll_table * wait)
save_flags(flags);
cli();
/* input */
poll_wait(&midi_sleeper, wait);
poll_wait(file, &midi_sleeper, wait);
if (iqlen)
mask |= POLLIN | POLLRDNORM;
/* output */
poll_wait(&seq_sleeper, wait);
poll_wait(file, &seq_sleeper, wait);
if ((SEQ_MAX_QUEUE - qlen) >= output_threshold)
mask |= POLLOUT | POLLWRNORM;
restore_flags(flags);
......
......@@ -22,11 +22,10 @@ int DMAbuf_space_in_queue (int dev);
int DMAbuf_activate_recording (int dev, struct dma_buffparms *dmap);
int DMAbuf_get_buffer_pointer (int dev, struct dma_buffparms *dmap, int direction);
void DMAbuf_launch_output(int dev, struct dma_buffparms *dmap);
unsigned int DMAbuf_poll(int dev, poll_table *wait);
unsigned int DMAbuf_poll(struct file *file, int dev, poll_table *wait);
void DMAbuf_start_devices(unsigned int devmask);
void DMAbuf_reset (int dev);
int DMAbuf_sync (int dev);
unsigned int DMAbuf_poll(int dev, poll_table *wait);
/*
* System calls for /dev/dsp and /dev/audio (audio.c)
......
......@@ -670,7 +670,7 @@ static unsigned int sound_poll(struct file *file, poll_table * wait)
case SND_DEV_DSP:
case SND_DEV_DSP16:
case SND_DEV_AUDIO:
return DMAbuf_poll(dev >> 4, wait);
return DMAbuf_poll(file, dev >> 4, wait);
#endif
}
return 0;
......
......@@ -129,7 +129,7 @@ static unsigned int coda_psdev_poll(struct file *file, poll_table * wait)
if ( !vcp )
return -ENXIO;
poll_wait(&(vcp->vc_waitq), wait);
poll_wait(file, &(vcp->vc_waitq), wait);
if (!q_empty(&(vcp->vc_pending)))
mask |= POLLIN | POLLRDNORM;
......
......@@ -177,7 +177,10 @@ static inline int locks_overlap(struct file_lock *fl1, struct file_lock *fl2)
(fl2->fl_end >= fl1->fl_start));
}
/* Check whether two locks have the same owner
/*
* Check whether two locks have the same owner
* N.B. Do we need the test on PID as well as owner?
* (Clone tasks should be considered as one "owner".)
*/
static inline int
locks_same_owner(struct file_lock *fl1, struct file_lock *fl2)
......@@ -471,6 +474,7 @@ int fcntl_setlk(unsigned int fd, unsigned int cmd, struct flock *l)
void locks_remove_posix(struct task_struct *task, struct file *filp)
{
struct inode * inode = filp->f_dentry->d_inode;
void * owner = task->files;
struct file_lock file_lock, *fl;
struct file_lock **before;
......@@ -480,7 +484,7 @@ void locks_remove_posix(struct task_struct *task, struct file *filp)
repeat:
before = &inode->i_flock;
while ((fl = *before) != NULL) {
if ((fl->fl_flags & FL_POSIX) && fl->fl_owner == task) {
if ((fl->fl_flags & FL_POSIX) && fl->fl_owner == owner) {
int (*lock)(struct file *, int, struct file_lock *);
lock = filp->f_op->lock;
if (lock) {
......@@ -571,6 +575,7 @@ int locks_verify_area(int read_write, struct inode *inode, struct file *filp,
int locks_mandatory_locked(struct inode *inode)
{
void * owner = current->files;
struct file_lock *fl;
/* Search the lock list for this inode for any POSIX locks.
......@@ -578,7 +583,7 @@ int locks_mandatory_locked(struct inode *inode)
for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
if (!(fl->fl_flags & FL_POSIX))
continue;
if (fl->fl_owner != current)
if (fl->fl_owner != owner)
return (-EAGAIN);
}
return (0);
......@@ -595,7 +600,7 @@ int locks_mandatory_area(int read_write, struct inode *inode,
tfl.fl_file = filp;
tfl.fl_flags = FL_POSIX | FL_ACCESS;
tfl.fl_owner = current;
tfl.fl_owner = current->files;
tfl.fl_pid = current->pid;
tfl.fl_type = (read_write == FLOCK_VERIFY_WRITE) ? F_WRLCK : F_RDLCK;
tfl.fl_start = offset;
......@@ -679,7 +684,7 @@ static int posix_make_lock(struct file *filp, struct file_lock *fl,
fl->fl_end = OFFSET_MAX;
fl->fl_file = filp;
fl->fl_owner = current;
fl->fl_owner = current->files;
fl->fl_pid = current->pid;
return (1);
......
......@@ -174,7 +174,7 @@ static unsigned int pipe_poll(struct file * filp, poll_table * wait)
unsigned int mask;
struct inode * inode = filp->f_dentry->d_inode;
poll_wait(&PIPE_WAIT(*inode), wait);
poll_wait(filp, &PIPE_WAIT(*inode), wait);
mask = POLLIN | POLLRDNORM;
if (PIPE_EMPTY(*inode))
mask = POLLOUT | POLLWRNORM;
......@@ -195,7 +195,7 @@ static unsigned int fifo_poll(struct file * filp, poll_table * wait)
unsigned int mask;
struct inode * inode = filp->f_dentry->d_inode;
poll_wait(&PIPE_WAIT(*inode), wait);
poll_wait(filp, &PIPE_WAIT(*inode), wait);
mask = POLLIN | POLLRDNORM;
if (PIPE_EMPTY(*inode))
mask = POLLOUT | POLLWRNORM;
......@@ -228,7 +228,7 @@ static unsigned int connect_poll(struct file * filp, poll_table * wait)
{
struct inode * inode = filp->f_dentry->d_inode;
poll_wait(&PIPE_WAIT(*inode), wait);
poll_wait(filp, &PIPE_WAIT(*inode), wait);
if (!PIPE_EMPTY(*inode)) {
filp->f_op = &read_fifo_fops;
return POLLIN | POLLRDNORM;
......
......@@ -38,7 +38,7 @@ static ssize_t kmsg_read(struct file * file, char * buf,
static unsigned int kmsg_poll(struct file *file, poll_table * wait)
{
poll_wait(&log_wait, wait);
poll_wait(file, &log_wait, wait);
if (log_size)
return POLLIN | POLLRDNORM;
return 0;
......
......@@ -25,6 +25,7 @@
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/poll.h>
#include <linux/file.h>
#include <asm/uaccess.h>
#include <asm/system.h>
......@@ -59,6 +60,7 @@ static void free_wait(poll_table * p)
p->nr--;
entry--;
remove_wait_queue(entry->wait_address,&entry->wait);
fput(entry->filp);
}
}
......
#ifndef __ALPHA_PYXIS__H__
#define __ALPHA_PYXIS__H__
#include <linux/config.h> /* CONFIG_ALPHA_RUFFIAN. */
#include <linux/types.h>
/*
......
......@@ -93,7 +93,7 @@ struct proto_ops {
int flags);
int (*getname) (struct socket *sock, struct sockaddr *uaddr,
int *usockaddr_len, int peer);
unsigned int (*poll) (struct socket *sock, struct poll_table_struct *wait);
unsigned int (*poll) (struct file *file, struct socket *sock, struct poll_table_struct *wait);
int (*ioctl) (struct socket *sock, unsigned int cmd,
unsigned long arg);
int (*listen) (struct socket *sock, int len);
......
......@@ -11,6 +11,7 @@
struct poll_table_entry {
struct file * filp;
struct wait_queue wait;
struct wait_queue ** wait_address;
};
......@@ -22,7 +23,7 @@ typedef struct poll_table_struct {
#define __MAX_POLL_TABLE_ENTRIES (PAGE_SIZE / sizeof (struct poll_table_entry))
extern inline void poll_wait(struct wait_queue ** wait_address, poll_table *p)
extern inline void poll_wait(struct file * filp, struct wait_queue ** wait_address, poll_table *p)
{
struct poll_table_entry * entry;
......@@ -31,6 +32,8 @@ extern inline void poll_wait(struct wait_queue ** wait_address, poll_table *p)
if (p->nr >= __MAX_POLL_TABLE_ENTRIES)
return;
entry = p->entry + p->nr;
entry->filp = filp;
filp->f_count++;
entry->wait_address = wait_address;
entry->wait.task = current;
entry->wait.next = NULL;
......
......@@ -538,7 +538,7 @@ extern __inline__ struct sk_buff *dev_alloc_skb(unsigned int length)
}
extern struct sk_buff * skb_recv_datagram(struct sock *sk,unsigned flags,int noblock, int *err);
extern unsigned int datagram_poll(struct socket *sock, struct poll_table_struct *wait);
extern unsigned int datagram_poll(struct file *file, struct socket *sock, struct poll_table_struct *wait);
extern int skb_copy_datagram(struct sk_buff *from, int offset, char *to,int size);
extern int skb_copy_datagram_iovec(struct sk_buff *from, int offset, struct iovec *to,int size);
extern void skb_free_datagram(struct sock * sk, struct sk_buff *skb);
......
......@@ -28,7 +28,7 @@ extern int inet_sendmsg(struct socket *sock,
struct msghdr *msg,
int size, struct scm_cookie *scm);
extern int inet_shutdown(struct socket *sock, int how);
extern unsigned int inet_poll(struct socket *sock, struct poll_table_struct *wait);
extern unsigned int inet_poll(struct file * file, struct socket *sock, struct poll_table_struct *wait);
extern int inet_setsockopt(struct socket *sock, int level,
int optname, char *optval,
int optlen);
......
......@@ -572,7 +572,7 @@ struct proto
void (*write_wakeup)(struct sock *sk);
void (*read_wakeup)(struct sock *sk);
unsigned int (*poll)(struct socket *sock,
unsigned int (*poll)(struct file * file, struct socket *sock,
struct poll_table_struct *wait);
int (*ioctl)(struct sock *sk, int cmd,
......@@ -798,7 +798,7 @@ extern int sock_no_accept(struct socket *,
struct socket *, int);
extern int sock_no_getname(struct socket *,
struct sockaddr *, int *, int);
extern unsigned int sock_no_poll(struct socket *,
extern unsigned int sock_no_poll(struct file *, struct socket *,
struct poll_table_struct *);
extern int sock_no_ioctl(struct socket *, unsigned int,
unsigned long);
......
......@@ -393,7 +393,7 @@ extern int tcp_rcv_established(struct sock *sk,
extern void tcp_close(struct sock *sk,
unsigned long timeout);
extern struct sock * tcp_accept(struct sock *sk, int flags);
extern unsigned int tcp_poll(struct socket *sock, struct poll_table_struct *wait);
extern unsigned int tcp_poll(struct file * file, struct socket *sock, struct poll_table_struct *wait);
extern int tcp_getsockopt(struct sock *sk, int level,
int optname, char *optval,
int *optlen);
......
......@@ -195,12 +195,12 @@ int skb_copy_datagram_iovec(struct sk_buff *skb, int offset, struct iovec *to,
* is only ever holding data ready to receive.
*/
unsigned int datagram_poll(struct socket *sock, poll_table *wait)
unsigned int datagram_poll(struct file * file, struct socket *sock, poll_table *wait)
{
struct sock *sk = sock->sk;
unsigned int mask;
poll_wait(sk->sleep, wait);
poll_wait(file, sk->sleep, wait);
mask = 0;
/* exceptional events? */
......
......@@ -910,7 +910,7 @@ int sock_no_getname(struct socket *sock, struct sockaddr *saddr,
return -EOPNOTSUPP;
}
unsigned int sock_no_poll(struct socket *sock, poll_table *pt)
unsigned int sock_no_poll(struct file * file, struct socket *sock, poll_table *pt)
{
return -EOPNOTSUPP;
}
......
......@@ -836,13 +836,13 @@ int inet_shutdown(struct socket *sock, int how)
}
unsigned int inet_poll(struct socket *sock, poll_table *wait)
unsigned int inet_poll(struct file * file, struct socket *sock, poll_table *wait)
{
struct sock *sk = sock->sk;
if (sk->prot->poll == NULL)
return(0);
return sk->prot->poll(sock, wait);
return sk->prot->poll(file, sock, wait);
}
/*
......
......@@ -585,13 +585,13 @@ static unsigned int tcp_listen_poll(struct sock *sk, poll_table *wait)
* take care of normal races (between the test and the event) and we don't
* go look at any of the socket buffers directly.
*/
unsigned int tcp_poll(struct socket *sock, poll_table *wait)
unsigned int tcp_poll(struct file * file, struct socket *sock, poll_table *wait)
{
unsigned int mask;
struct sock *sk = sock->sk;
struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp);
poll_wait(sk->sleep, wait);
poll_wait(file, sk->sleep, wait);
if (sk->state == TCP_LISTEN)
return tcp_listen_poll(sk, wait);
......
......@@ -467,7 +467,7 @@ static unsigned int sock_poll(struct file *file, poll_table * wait)
* We can't return errors to poll, so it's either yes or no.
*/
return sock->ops->poll(sock, wait);
return sock->ops->poll(file, sock, wait);
}
......
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