diff -Nru a/Documentation/DocBook/kernel-hacking.tmpl b/Documentation/DocBook/kernel-hacking.tmpl
--- a/Documentation/DocBook/kernel-hacking.tmpl Sat Aug 31 15:06:00 2002
+++ b/Documentation/DocBook/kernel-hacking.tmpl Sat Aug 31 15:06:00 2002
@@ -1085,18 +1085,17 @@
Initializing structure members
- The preferred method of initializing structures is to use the
- gcc Labeled Elements extension, eg:
+ The preferred method of initializing structures is to use
+ designated initialisers, as defined by ISO C99, eg:
static struct block_device_operations opt_fops = {
- open: opt_open,
- release: opt_release,
- ioctl: opt_ioctl,
- check_media_change: opt_media_change,
+ .open = opt_open,
+ .release = opt_release,
+ .ioctl = opt_ioctl,
+ .check_media_change = opt_media_change,
};
-
This makes it easy to grep for, and makes it clear which
structure fields are set. You should do this because it looks
diff -Nru a/Documentation/cciss.txt b/Documentation/cciss.txt
--- a/Documentation/cciss.txt Sat Aug 31 15:05:54 2002
+++ b/Documentation/cciss.txt Sat Aug 31 15:05:54 2002
@@ -86,7 +86,7 @@
Hot plugging of SCSI tape drives is supported, with some caveats.
The cciss driver must be informed that changes to the SCSI bus
-have been made, in addition to and prior to informing the the SCSI
+have been made, in addition to and prior to informing the SCSI
mid layer. This may be done via the /proc filesystem. For example:
echo "rescan" > /proc/scsi/cciss0/1
diff -Nru a/Documentation/cdrom/sonycd535 b/Documentation/cdrom/sonycd535
--- a/Documentation/cdrom/sonycd535 Sat Aug 31 15:05:59 2002
+++ b/Documentation/cdrom/sonycd535 Sat Aug 31 15:05:59 2002
@@ -63,8 +63,8 @@
Thanks also to Eberhard Moenkeberg (emoenke@gwdg.de) for prodding
me to place this code into the mainstream Linux source tree
(as of Linux version 1.1.91), as well as some patches to make
-it a better device citizen. Further thanks to "S. Joel Katz"
- for his MODULE patches (see details below),
+it a better device citizen. Further thanks to Joel Katz
+ for his MODULE patches (see details below),
Porfiri Claudio for patches
to make the driver work with the older CDU-510/515 series, and
Heiko Eissfeldt for pointing out that
@@ -79,7 +79,7 @@
ken@halcyon.com
------------------------------------------------------------------------------
-(The following is from Joel Katz .)
+(The following is from Joel Katz .)
To build a version of sony535.o that can be installed as a module,
use the following command:
@@ -103,7 +103,7 @@
I have an external drive, and I usually leave it powered off. I used
to have to reboot if I needed to use the CDROM drive. Now I don't.
- Even if you have an internal drive, why waste the 268K of memory
+ Even if you have an internal drive, why waste the 96K of memory
(unswappable) that the driver uses if you use your CD-ROM drive infrequently?
This driver will not install (whether compiled in or loaded as a
diff -Nru a/Documentation/filesystems/devfs/ChangeLog b/Documentation/filesystems/devfs/ChangeLog
--- a/Documentation/filesystems/devfs/ChangeLog Sat Aug 31 15:05:54 2002
+++ b/Documentation/filesystems/devfs/ChangeLog Sat Aug 31 15:05:54 2002
@@ -1957,3 +1957,11 @@
- Removed deprecated
+===============================================================================
+Changes for patch v217
+
+- Exported and to modules
+
+- Updated README from master HTML file
+
+- Fixed module unload race in
diff -Nru a/Documentation/filesystems/devfs/README b/Documentation/filesystems/devfs/README
--- a/Documentation/filesystems/devfs/README Sat Aug 31 15:05:59 2002
+++ b/Documentation/filesystems/devfs/README Sat Aug 31 15:05:59 2002
@@ -3,7 +3,7 @@
Linux Devfs (Device File System) FAQ
Richard Gooch
-21-JUL-2002
+20-AUG-2002
Document languages:
@@ -1509,6 +1509,16 @@
+Devfsd doesn't start
+
+Make sure you have compiled and installed devfsd
+Make sure devfsd is being started from your boot
+scripts
+Make sure you have configured your kernel to enable devfs (see
+below)
+Make sure devfs is mounted (see below)
+
+
Devfsd is not managing all my permissions
Make sure you are capturing the appropriate events. For example,
@@ -1777,7 +1787,7 @@
First, remember that no naming scheme will please everybody. You hate
the scheme, others love it. Who's to say who's right and who's wrong?
Ultimately, the person who writes the code gets to choose, and what
-exists now is a combination of the the choices made by the
+exists now is a combination of the choices made by the
devfs author and the
kernel maintainer (Linus).
diff -Nru a/Documentation/filesystems/ntfs.txt b/Documentation/filesystems/ntfs.txt
--- a/Documentation/filesystems/ntfs.txt Sat Aug 31 15:06:00 2002
+++ b/Documentation/filesystems/ntfs.txt Sat Aug 31 15:06:00 2002
@@ -247,6 +247,12 @@
Note, a technical ChangeLog aimed at kernel hackers is in fs/ntfs/ChangeLog.
+2.1.0:
+ - Add configuration option for developmental write support.
+ - Initial implementation of file overwriting. (Writes to resident files
+ are not written out to disk yet, so avoid writing to files smaller
+ than about 1kiB.)
+ - Intercept/abort changes in file size as they are not implemented yet.
2.0.25:
- Minor bugfixes in error code paths and small cleanups.
2.0.24:
diff -Nru a/Documentation/networking/8139too.txt b/Documentation/networking/8139too.txt
--- a/Documentation/networking/8139too.txt Sat Aug 31 15:06:00 2002
+++ b/Documentation/networking/8139too.txt Sat Aug 31 15:06:00 2002
@@ -185,9 +185,22 @@
Change History
--------------
-Version 0.9.23 - In progress
+Version 0.9.26 - August 9, 2002
-* New, compile-time conditional for testing better RX reset
+* Fix MII ioctl phy id corruption.
+* Fix big-endian multicast bug.
+* Support register dumps via ethtool.
+* Fix several uses of 'len' after potential skb free, in dev->hard_start_xmit
+* Replace several "magic numbers" with their proper representation
+ constants in linux/mii.h.
+* Support ethtool media interface via generic kernel MII API
+* Export NIC-specific statistics via ethtool.
+* Proper support for RTL8139 rev K. (can be disabled via
+ compile-time conditional)
+* Add PCI ids for new 8139 boards.
+* Use ethernet crc via generic linux/crc32.h kernel API.
+* Better RX reset. Old rx-reset method still available via
+ a compile-time conditional.
* Only account specific RX errors if rx_status is !OK
diff -Nru a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
--- a/Documentation/networking/bonding.txt Sat Aug 31 15:05:55 2002
+++ b/Documentation/networking/bonding.txt Sat Aug 31 15:05:55 2002
@@ -266,7 +266,7 @@
If not explicitly configured with ifconfig, the MAC address of the
bonding device is taken from its first slave device. This MAC address
is then passed to all following slaves and remains persistent (even if
- the the first slave is removed) until the bonding device is brought
+ the first slave is removed) until the bonding device is brought
down or reconfigured.
If you wish to change the MAC address, you can set it with ifconfig:
diff -Nru a/Documentation/networking/e1000.txt b/Documentation/networking/e1000.txt
--- a/Documentation/networking/e1000.txt Sat Aug 31 15:05:55 2002
+++ b/Documentation/networking/e1000.txt Sat Aug 31 15:05:55 2002
@@ -1,7 +1,7 @@
Linux* Base Driver for the Intel(R) PRO/1000 Family of Adapters
===============================================================
-June 11, 2002
+August 6, 2002
Contents
@@ -20,12 +20,12 @@
===============
This file describes the Linux* Base Driver for the Intel(R) PRO/1000 Family
-of Adapters, version 4.2.x. This driver includes support for
+of Adapters, version 4.3.x. This driver includes support for
Itanium(TM)-based systems.
This release version includes the following:
- - Support for the ethtool 1.5 interface. A third-party application can use
+ - Support for the ethtool 1.6 interface. A third-party application can use
the ethtool interface to get and set driver parameters.
- Zero copy. This feature provides faster data throughput. Enabled by
@@ -113,12 +113,12 @@
Default Value: 0x2F
This parameter is a bit mask that specifies which speed and duplex
settings the board advertises. When this parameter is used, the Speed and
- Duplex parameters must not be specified.
+ Duplex parameters must not be specified.
Duplex (adapters using copper connections only)
Valid Range: 0-2 (0=auto-negotiate, 1=half, 2=full)
Default Value: 0
- Defines the direction in which data is allowed to flow. Can by either one
+ Defines the direction in which data is allowed to flow. Can by either one
or two-directional. If both Duplex and the link partner are set to auto-
negotiate, the board auto-detects the correct duplex. If the link partner
is forced (either full or half), Duplex defaults to half-duplex.
@@ -126,45 +126,58 @@
FlowControl
Valid Range: 0-3 (0=none, 1=Rx only, 2=Tx only, 3=Rx&Tx)
Default: Read flow control settings from the EEPROM
- This parameter controls the automatic generation(Tx) and response(Rx) to
+ This parameter controls the automatic generation(Tx) and response(Rx) to
Ethernet PAUSE frames.
RxDescriptors
Valid Range: 80-256 for 82542 and 82543-based adapters
80-4096 for 82540, 82544, 82545, and 82546-based adapters
Default Value: 80
- This value is the number of receive descriptors allocated by the driver.
- Increasing this value allows the driver to buffer more incoming packets.
+ This value is the number of receive descriptors allocated by the driver.
+ Increasing this value allows the driver to buffer more incoming packets.
Each descriptor is 16 bytes. A receive buffer is also allocated for each
- descriptor and can be either 2048, 4096, 8192, or 16384 bytes, depending
+ descriptor and can be either 2048, 4096, 8192, or 16384 bytes, depending
on the MTU setting. The maximum MTU size is 16110.
+ NOTE: MTU designates the frame size. It only needs to be set for Jumbo
+ Frames.
+
RxIntDelay
Valid Range: 0-65535 (0=off)
Default Value: 0 (82542, 82543, and 82544-based adapters)
128 (82540, 82545, and 82546-based adapters)
- This value delays the generation of receive interrupts in units of 1.024
- microseconds. Receive interrupt reduction can improve CPU efficiency if
- properly tuned for specific network traffic. Increasing this value adds
- extra latency to frame reception and can end up decreasing the throughput
- of TCP traffic. If the system is reporting dropped receives, this value
- may be set too high, causing the driver to run out of available receive
+ This value delays the generation of receive interrupts in units of 1.024
+ microseconds. Receive interrupt reduction can improve CPU efficiency if
+ properly tuned for specific network traffic. Increasing this value adds
+ extra latency to frame reception and can end up decreasing the throughput
+ of TCP traffic. If the system is reporting dropped receives, this value
+ may be set too high, causing the driver to run out of available receive
descriptors.
- CAUTION: When setting RxIntDelay to a value other than 0, adapters based
- on the Intel 82543 and 82544 LAN controllers may hang (stop
+ CAUTION: When setting RxIntDelay to a value other than 0, adapters based
+ on the Intel 82543 and 82544 LAN controllers may hang (stop
transmitting) under certain network conditions. If this occurs a
- message is logged in the system event log. In addition, the
- controller is automatically reset, restoring the network
- connection. To eliminate the potential for the hang ensure that
+ message is logged in the system event log. In addition, the
+ controller is automatically reset, restoring the network
+ connection. To eliminate the potential for the hang ensure that
RxIntDelay is set to 0.
+RxAbsIntDelay (82540, 82545, and 82546-based adapters only)
+Valid Range: 0-65535 (0=off)
+Default Value: 128
+ This value, in units of 1.024 microseconds, limits the delay in which a
+ transmit interrupt is generated. Useful only if RxIntDelay is non-zero,
+ this value ensures that an interrupt is generated after the initial
+ packet is received within the set amount of time. Proper tuning,
+ along with RxIntDelay, may improve traffic throughput in specific network
+ conditions.
+
Speed (adapters using copper connections only)
Valid Settings: 0, 10, 100, 1000
Default Value: 0 (auto-negotiate at all supported speeds)
Speed forces the line speed to the specified value in megabits per second
- (Mbps). If this parameter is not specified or is set to 0 and the link
- partner is set to auto-negotiate, the board will auto-detect the correct
+ (Mbps). If this parameter is not specified or is set to 0 and the link
+ partner is set to auto-negotiate, the board will auto-detect the correct
speed. Duplex must also be set when Speed is set to either 10 or 100.
TxDescriptors
@@ -172,8 +185,27 @@
80-4096 for 82540, 82544, 82545, and 82546-based adapters
Default Value: 256
This value is the number of transmit descriptors allocated by the driver.
- Increasing this value allows the driver to queue more transmits. Each
+ Increasing this value allows the driver to queue more transmits. Each
descriptor is 16 bytes.
+
+TxIntDelay
+Valid Range: 0-65535 (0=off)
+Default Value: 64
+ This value delays the generation of transmit interrupts in units of
+ 1.024 microseconds. Transmit interrupt reduction can improve CPU
+ efficiency if properly tuned for specific network traffic. If the
+ system is reporting dropped transmits, this value may be set too high
+ causing the driver to run out of available transmit descriptors.
+
+TxAbsIntDelay (82540, 82545, and 82546-based adapters only)
+Valid Range: 0-65535 (0=off)
+Default Value: 64
+ This value, in units of 1.024 microseconds, limits the delay in which a
+ transmit interrupt is generated. Useful only if TxIntDelay is non-zero,
+ this value ensures that an interrupt is generated after the initial
+ packet is sent on the wire within the set amount of time. Proper tuning,
+ along with TxIntDelay, may improve traffic throughput in specific
+ network conditions.
XsumRX (not available on the PRO/1000 Gigabit Server Adapter)
Valid Range: 0-1
diff -Nru a/Documentation/networking/sctp.txt b/Documentation/networking/sctp.txt
--- /dev/null Wed Dec 31 16:00:00 1969
+++ b/Documentation/networking/sctp.txt Sat Aug 31 15:06:06 2002
@@ -0,0 +1,38 @@
+Linux Kernel SCTP
+
+This is the current BETA release of the Linux Kernel SCTP reference
+implementation.
+
+SCTP (Stream Control Transmission Protocol) is a IP based, message oriented,
+reliable transport protocol, with congestion control, support for
+transparent multi-homing, and multiple ordered streams of messages.
+RFC2960 defines the core protocol. The IETF SIGTRAN working group originally
+developed the SCTP protocol and later handed the protocol over to the
+Transport Area (TSVWG) working group for the continued evolvement of SCTP as a
+general purpose transport.
+
+See the IETF website (http://www.ietf.org) for further documents on SCTP.
+See http://www.ietf.org/rfc/rfc2960.txt
+
+The initial project goal is to create an Linux kernel reference implementation
+of SCTP that is RFC 2960 compliant and provides an programming interface
+referred to as the UDP-style API of the Sockets Extensions for SCTP, as
+proposed in IETF Internet-Drafts.
+
+
+Caveats:
+
+-lksctp can be built as statically or as a module. However, be aware that
+module removal of lksctp is not yet a safe activity.
+
+-There is tentative support for IPv6, but most work has gone towards
+implementation and testing lksctp on IPv4.
+
+
+For more information, please visit the lksctp project website:
+ http://www.sf.net/projects/lksctp
+
+Or contact the lksctp developers through the mailing list:
+
+
+
diff -Nru a/Documentation/preempt-locking.txt b/Documentation/preempt-locking.txt
--- a/Documentation/preempt-locking.txt Sat Aug 31 15:05:54 2002
+++ b/Documentation/preempt-locking.txt Sat Aug 31 15:05:54 2002
@@ -1,7 +1,7 @@
Proper Locking Under a Preemptible Kernel:
Keeping Kernel Code Preempt-Safe
- Robert Love
- Last Updated: 22 Jan 2002
+ Robert Love
+ Last Updated: 28 Aug 2002
INTRODUCTION
@@ -112,3 +112,24 @@
This code is not preempt-safe, but see how easily we can fix it by simply
moving the spin_lock up two lines.
+
+
+PREVENTING PREEMPTION USING INTERRUPT DISABLING
+
+
+It is possible to prevent a preemption event using local_irq_disable and
+local_irq_save. Note, when doing so, you must be very careful to not cause
+an event that would set need_resched and result in a preemption check. When
+in doubt, rely on locking or explicit preemption disabling.
+
+Note in 2.5 interrupt disabling is now only per-CPU (e.g. local).
+
+An additional concern is proper usage of local_irq_disable and local_irq_save.
+These may be used to protect from preemption, however, on exit, if preemption
+may be enabled, a test to see if preemption is required should be done. If
+these are called from the spin_lock and read/write lock macros, the right thing
+is done. They may also be called within a spin-lock protected region, however,
+if they are ever called outside of this context, a test for preemption should
+be made. Do note that calls from interrupt context or bottom half/ tasklets
+are also protected by preemption locks and so may use the versions which do
+not check preemption.
diff -Nru a/Documentation/usb/ehci.txt b/Documentation/usb/ehci.txt
--- a/Documentation/usb/ehci.txt Sat Aug 31 15:06:00 2002
+++ b/Documentation/usb/ehci.txt Sat Aug 31 15:06:00 2002
@@ -1,4 +1,4 @@
-26-Apr-2002
+23-Aug-2002
The EHCI driver is used to talk to high speed USB 2.0 devices using
USB 2.0-capable host controller hardware. The USB 2.0 standard is
@@ -21,11 +21,15 @@
At this writing, this driver has been seen to work with implementations
of EHCI from (in alphabetical order): Intel, NEC, Philips, and VIA.
+Other EHCI implementations are becoming available from other vendors;
+you should expect this driver to work with them too.
-At this writing, high speed devices are finally beginning to appear.
-While usb-storage devices have been available for some time (working
+While usb-storage devices have been available since mid-2001 (working
quite speedily on the 2.4 version of this driver), hubs have only
-very recently become available.
+been available since late 2001, and other kinds of high speed devices
+appear to be on hold until more systems come with USB 2.0 built-in.
+Such new systems have been available since early 2002, and became much
+more typical in the second half of 2002.
Note that USB 2.0 support involves more than just EHCI. It requires
other changes to the Linux-USB core APIs, including the hub driver,
@@ -43,26 +47,25 @@
It's believed to do all the right PCI magic so that I/O works even on
systems with interesting DMA mapping issues.
-At this writing the driver should comfortably handle all control and bulk
-transfers, including requests to USB 1.1 devices through transaction
-translators (TTs) in USB 2.0 hubs. However, there some situations where
-the hub driver needs to clear TT error state, which it doesn't yet do.
-
-Interrupt transfer support is newly functional and not yet as robust as
-control and bulk traffic. As yet there is no support for split transaction
-scheduling for interrupt transfers, which means among other things that
-connecting USB 1.1 hubs, keyboards, and mice to USB 2.0 hubs won't work.
-Connect them to USB 1.1 hubs, or to a root hub.
-
-Isochronous (ISO) transfer support is also newly functional. No production
-high speed devices are available which would need it (though high quality
-webcams are in the works!). Note that split transaction support for ISO
+At this writing the driver should comfortably handle all control, bulk,
+and interrupt transfers, including requests to USB 1.1 devices through
+transaction translators (TTs) in USB 2.0 hubs.
+
+High Speed Isochronous (ISO) transfer support is also functional, but
+at this writing no Linux drivers have been using that support.
+
+Full Speed Isochronous transfer support, through transaction translators,
+is not yet available. Note that split transaction support for ISO
transfers can't share much code with the code for high speed ISO transfers,
since EHCI represents these with a different data structure. So for now,
-most USB audio and video devices have the same restrictions as hubs, mice,
-and keyboards: don't connect them using high speed USB hubs.
+most USB audio and video devices can't be connected to high speed buses.
+
+Transfers of all types can be queued. This means that control transfers
+from a driver on one interface (or through usbfs) won't interfere with
+ones from another driver, and that interrupt transfers can use periods
+of one frame without risking data loss due to interrupt processing costs.
-The EHCI root hub code should hand off USB 1.1 devices to its companion
+The EHCI root hub code hands off USB 1.1 devices to its companion
controller. This driver doesn't need to know anything about those
drivers; a OHCI or UHCI driver that works already doesn't need to change
just because the EHCI driver is also present.
@@ -70,6 +73,11 @@
There are some issues with power management; suspend/resume doesn't
behave quite right at the moment.
+Also, some shortcuts have been taken with the scheduling periodic
+transactions (interrupt and isochronous transfers). These place some
+limits on the number of periodic transactions that can be scheduled,
+and prevent use of polling intervals of less than one frame.
+
USE BY
@@ -83,10 +91,10 @@
# rmmod ehci-hcd
You should also have a driver for a "companion controller", such as
-"ohci-hcd", "usb-ohci", "usb-uhci", or "uhci". In case of any trouble
-with the EHCI driver, remove its module and then the driver for that
-companion controller will take over (at lower speed) all the devices
-that were previously handled by the EHCI driver.
+"ohci-hcd" or "uhci-hcd". In case of any trouble with the EHCI driver,
+remove its module and then the driver for that companion controller will
+take over (at lower speed) all the devices that were previously handled
+by the EHCI driver.
Module parameters (pass to "modprobe") include:
@@ -122,13 +130,18 @@
and at most 13 of those fit into one USB 2.0 microframe. Eight USB 2.0
microframes fit in a USB 1.1 frame; a microframe is 1 msec/8 = 125 usec.
+So more than 50 MByte/sec is available for bulk transfers, when both
+hardware and device driver software allow it. Periodic transfer modes
+(isochronous and interrupt) allow the larger packet sizes which let you
+approach the quoted 480 MBit/sec transfer rate.
+
Hardware Performance
At this writing, individual USB 2.0 devices tend to max out at around
20 MByte/sec transfer rates. This is of course subject to change;
and some devices now go faster, while others go slower.
-The NEC implementation of EHCI seems to have a hardware bottleneck
+The first NEC implementation of EHCI seems to have a hardware bottleneck
at around 28 MByte/sec aggregate transfer rate. While this is clearly
enough for a single device at 20 MByte/sec, putting three such devices
onto one bus does not get you 60 MByte/sec. The issue appears to be
@@ -136,9 +149,11 @@
so that it's only trying six (or maybe seven) USB transactions each
microframe rather than thirteen. (Seems like a reasonable trade off
for a product that beat all the others to market by over a year!)
+
It's expected that newer implementations will better this, throwing
more silicon real estate at the problem so that new motherboard chip
-sets will get closer to that 60 MByte/sec target.
+sets will get closer to that 60 MByte/sec target. That includes an
+updated implementation from NEC, as well as other vendors' silicon.
There's a minimum latency of one microframe (125 usec) for the host
to receive interrupts from the EHCI controller indicating completion
diff -Nru a/Documentation/usb/ohci.txt b/Documentation/usb/ohci.txt
--- a/Documentation/usb/ohci.txt Sat Aug 31 15:06:06 2002
+++ b/Documentation/usb/ohci.txt Sat Aug 31 15:06:06 2002
@@ -1,98 +1,32 @@
+23-Aug-2002
-The OHCI HCD layer is a simple but nearly complete implementation of what the
-USB people would call a HCD for the OHCI.
- (ISO coming soon, Bulk, INT u. CTRL transfers enabled)
-It is based on Linus Torvalds UHCI code and Gregory Smith OHCI fragments (0.03 source tree).
-The layer (functions) on top of it, is for interfacing to the alternate-usb device-drivers.
-
-- Roman Weissgaerber
-
- * v4.0 1999/08/18 removed all dummy eds, unlink unused eds, code cleanup, bulk transfers
- * v2.1 1999/05/09 ep_addr correction, code cleanup
- * v0.2.0 1999/05/04
- * everything has been moved into 2 files (ohci-hcd.c, ohci-hub-root.c and headers)
- * virtual root hub is now an option,
- * memory allocation based on kmalloc and kfree now, simple Bus error handling,
- * INT and CTRL transfers enabled, Bulk included but disabled, ISO needs completion
- *
- * from Linus Torvalds (uhci.c): APM (not tested); hub, usb_device, bus and related stuff
- * from Greg Smith (ohci.c): better reset ohci-controller handling, hub
- *
- * v0.1.0 1999/04/27 initial release
-
-to remove the module try:
-rmmod usb-ohci
-
-Features:
-- virtual root hub, all basic hub descriptors and commands (state: complete)
- this is an option now (v0.2.0)
- #define CONFIG_USB_OHCI_VROOTHUB includes the virtual hub code, (VROOTHUB)
- default is with.
- (at the moment: the Virtual Root Hub is included automatically)
-
- files: ohci-root-hub.c, ohci-root-hub.h
-
-
-- Endpoint Descriptor (ED) handling more static approach
- (EDs should be allocated in parallel to the SET CONFIGURATION command and they live
- as long as the function (device) is alive or another configuration is chosen.
- In the HCD layer the EDs has to be allocated manually either by calling a subroutine
- or by sending a USB root hub vendor specific command to the virtual root hub.
- At the alternate linux usb stack EDs will be added (allocated) at their first use.
- ED will be unlinked from the HC chains if they are not busy.
-
- files: ohci-hcd.c ohci-hcd.h
- routines: (do not use for drivers, use the top layer alternate usb commands instead)
-
- int usb_ohci_add_ep(struct ohci * ohci, unsigned int ep_addr1,
- int interval, int load, f_handler handler, int ep_size, int speed)
- adds an endpoint, (if the endpoint already exists some parameters will be updated)
-
- int usb_ohci_rm_ep( )
- removes an endpoint and all pending TDs of that EP
-
- usb_ohci_rm_function( )
- removes all Endpoints of a function (device)
-
-- Transfer Descriptors (TD): handling and allocation of TDs is transparent to the upper layers
- The HCD takes care of TDs and EDs memory allocation whereas the upper layers (UBSD ...) has
- to take care of buffer allocation.
- files: ohci-hcd.c ohci-hcd.h
-
- There is one basic command for all types of bus transfers (INT, BULK, ISO, CTRL):
-
- int ohci_trans_req(struct ohci * ohci, hcd_ed, int ctrl_len, void *ctrl, void * data, int data_len, __OHCI_BAG lw0, __OHCI_BAG lw1)
-
- CTRL: ctrl, ctrl_len ... cmd buffer
- data, data_len ... data buffer (in or out)
- INT, BULK: ctrl = NULL, ctrl_len=0,
- data, data_len ... data buffer (in or out)
- ISO: tbd
-
- There is no buffer reinsertion done by the internal HCD function.
- (The interface layer does this for a INT-pipe on request.)
- If you want a transfer then you have to
- provide buffers by sending ohci_trans_req requests. As they are queued as TDs on an ED
- you can send as many as you like. They should come back by the callback f_handler in
- the same order (for each endpoint, not globally) If an error occurs all
- queued transfers of an endpoint will return unsent. They will be marked with an error status.
-
- e.g double-buffering for int transfers:
-
- ohci_trans_req(ohci, ep_addr, 0, NULL, data0, data0_len, 0,0)
- ohci_trans_req(ohci, ep_addr, 0, NULL, data1, data1_len, 0,0)
-
- and when a data0 packet returns by the callback f_handler requeue it:
- ohci_trans_req(ohci, ep_addr, 0, NULL, data0, data0_len, 0,0)
- and when a data1 packet returns by the callback f_handler requeue it:
- ohci_trans_req(ohci, ep_addr, 0, NULL, data1, data1_len, 0,0)
-
- lw0, lw1 are private fields for upper layers for ids or fine grained handlers.
- The alternate usb uses them for dev_id and usb_device_irq handler.
-
-
-- Done list handling: returns the requests (callback f_handler in ED) and does
- some error handling, root-hub request dequeuing
- (files: ohci-done-list.c in ohci-hcd.c now(v0.2.0))
+The "ohci-hcd" driver is a USB Host Controller Driver (HCD) that is derived
+from the "usb-ohci" driver from the 2.4 kernel series. The "usb-ohci" code
+was written primarily by Roman Weissgaerber but with
+contributions from many others (read its copyright/licencing header).
+
+It supports the "Open Host Controller Interface" (OHCI), which standardizes
+hardware register protocols used to talk to USB 1.1 host controllers. As
+compared to the earlier "Universal Host Controller Interface" (UHCI) from
+Intel, it pushes more intelligence into the hardware. USB 1.1 controllers
+from vendors other than Intel and VIA generally use OHCI.
+
+Changes since the 2.4 kernel include
+
+ - improved robustness; bugfixes; and less overhead
+ - supports the updated and simplified usbcore APIs
+ - interrupt transfers can be larger, and can be queued
+ - less code, by using the upper level "hcd" framework
+ - supports some non-PCI implementations of OHCI
+ - ... more
+
+The "ohci-hcd" driver handles all USB 1.1 transfer types. Transfers of all
+types can be queued. That was also true in "usb-ohci", except for interrupt
+transfers. Previously, using periods of one frame would risk data loss due
+to overhead in IRQ processing. When interrupt transfers are queued, those
+risks can be minimized by making sure the hardware always has transfers to
+work on while the OS is getting around to the relevant IRQ processing.
+
+- David Brownell
+
-
diff -Nru a/Documentation/watchdog-api.txt b/Documentation/watchdog-api.txt
--- a/Documentation/watchdog-api.txt Sat Aug 31 15:05:54 2002
+++ b/Documentation/watchdog-api.txt Sat Aug 31 15:05:54 2002
@@ -278,7 +278,7 @@
when the timeout runs out which can be 0 = RESET (default),
1 = SMI, 2 = NMI, 3 = SCI.
- Supports CONFIG_WATCHDOG_NOWAYOUT and the the magic character
+ Supports CONFIG_WATCHDOG_NOWAYOUT and the magic character
'V' close handling.
GETSUPPORT returns WDIOF_KEEPALIVEPING, and the GETSTATUS call
diff -Nru a/MAINTAINERS b/MAINTAINERS
--- a/MAINTAINERS Sat Aug 31 15:06:01 2002
+++ b/MAINTAINERS Sat Aug 31 15:06:01 2002
@@ -1406,7 +1406,7 @@
SCHEDULER
P: Ingo Molnar
M: mingo@elte.hu
-P: Robert Love
+P: Robert Love [the preemptible kernel bits]
M: rml@tech9.net
L: linux-kernel@vger.kernel.org
S: Maintained
@@ -1888,7 +1888,6 @@
VIDEO FOR LINUX
P: Gerd Knorr
M: kraxel@bytesex.org
-W: http://roadrunner.swansea.linux.org.uk/v4l.shtml
S: Maintained
WAN ROUTER & SANGOMA WANPIPE DRIVERS & API (X.25, FRAME RELAY, PPP, CISCO HDLC)
diff -Nru a/Makefile b/Makefile
--- a/Makefile Sat Aug 31 15:05:54 2002
+++ b/Makefile Sat Aug 31 15:05:54 2002
@@ -1,6 +1,6 @@
VERSION = 2
PATCHLEVEL = 5
-SUBLEVEL = 32
+SUBLEVEL = 33
EXTRAVERSION =
# *DOCUMENTATION*
diff -Nru a/arch/alpha/config.in b/arch/alpha/config.in
--- a/arch/alpha/config.in Sat Aug 31 15:05:55 2002
+++ b/arch/alpha/config.in Sat Aug 31 15:05:55 2002
@@ -338,6 +338,7 @@
fi
endmenu
+source drivers/input/Config.in
source drivers/char/Config.in
#source drivers/misc/Config.in
@@ -373,7 +374,6 @@
endmenu
source drivers/usb/Config.in
-source drivers/input/Config.in
source net/bluetooth/Config.in
diff -Nru a/arch/alpha/defconfig b/arch/alpha/defconfig
--- a/arch/alpha/defconfig Sat Aug 31 15:06:00 2002
+++ b/arch/alpha/defconfig Sat Aug 31 15:06:00 2002
@@ -572,6 +572,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/alpha/kernel/core_apecs.c b/arch/alpha/kernel/core_apecs.c
--- a/arch/alpha/kernel/core_apecs.c Sat Aug 31 15:05:55 2002
+++ b/arch/alpha/kernel/core_apecs.c Sat Aug 31 15:05:55 2002
@@ -90,12 +90,11 @@
*/
static int
-mk_conf_addr(struct pci_dev *dev, int where, unsigned long *pci_addr,
- unsigned char *type1)
+mk_conf_addr(struct pci_bus *bus_dev, unsigned int device_fn, int where,
+ unsigned long *pci_addr, unsigned char *type1)
{
unsigned long addr;
- u8 bus = dev->bus->number;
- u8 device_fn = dev->devfn;
+ u8 bus = bus_dev->number;
DBGC(("mk_conf_addr(bus=%d ,device_fn=0x%x, where=0x%x,"
" pci_addr=0x%p, type1=0x%p)\n",
@@ -273,87 +272,66 @@
}
static int
-apecs_read_config_byte(struct pci_dev *dev, int where, u8 *value)
+apecs_read_config(struct pci_bus *bus, unsigned int devfn, int where, int size,
+ u8 *value)
{
unsigned long addr, pci_addr;
unsigned char type1;
+ long mask;
+ int shift;
- if (mk_conf_addr(dev, where, &pci_addr, &type1))
+ if (mk_conf_addr(bus, devfn, where, &pci_addr, &type1))
return PCIBIOS_DEVICE_NOT_FOUND;
- addr = (pci_addr << 5) + 0x00 + APECS_CONF;
- *value = conf_read(addr, type1) >> ((where & 3) * 8);
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int
-apecs_read_config_word(struct pci_dev *dev, int where, u16 *value)
-{
- unsigned long addr, pci_addr;
- unsigned char type1;
-
- if (mk_conf_addr(dev, where, &pci_addr, &type1))
- return PCIBIOS_DEVICE_NOT_FOUND;
-
- addr = (pci_addr << 5) + 0x08 + APECS_CONF;
- *value = conf_read(addr, type1) >> ((where & 3) * 8);
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int
-apecs_read_config_dword(struct pci_dev *dev, int where, u32 *value)
-{
- unsigned long addr, pci_addr;
- unsigned char type1;
-
- if (mk_conf_addr(dev, where, &pci_addr, &type1))
- return PCIBIOS_DEVICE_NOT_FOUND;
-
- addr = (pci_addr << 5) + 0x18 + APECS_CONF;
- *value = conf_read(addr, type1);
+ switch (size) {
+ case 1:
+ mask = 0x00;
+ shift = (where & 3) * 8;
+ break;
+ case 2:
+ mask = 0x08;
+ shift = (where & 3) * 8;
+ break;
+ case 4:
+ mask = 0x18;
+ shift = 0;
+ break;
+ }
+ addr = (pci_addr << 5) + mask + APECS_CONF;
+ *value = conf_read(addr, type1) >> (shift);
return PCIBIOS_SUCCESSFUL;
}
static int
-apecs_write_config(struct pci_dev *dev, int where, u32 value, long mask)
+apecs_write_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value)
{
unsigned long addr, pci_addr;
unsigned char type1;
+ long mask;
- if (mk_conf_addr(dev, where, &pci_addr, &type1))
+ if (mk_conf_addr(bus, devfn, where, &pci_addr, &type1))
return PCIBIOS_DEVICE_NOT_FOUND;
+ switch (size) {
+ case 1:
+ mask = 0x00;
+ break;
+ case 2:
+ mask = 0x08;
+ break;
+ case 4:
+ mask = 0x18;
+ break;
+ }
addr = (pci_addr << 5) + mask + APECS_CONF;
conf_write(addr, value << ((where & 3) * 8), type1);
return PCIBIOS_SUCCESSFUL;
}
-static int
-apecs_write_config_byte(struct pci_dev *dev, int where, u8 value)
-{
- return apecs_write_config(dev, where, value, 0x00);
-}
-
-static int
-apecs_write_config_word(struct pci_dev *dev, int where, u16 value)
-{
- return apecs_write_config(dev, where, value, 0x08);
-}
-
-static int
-apecs_write_config_dword(struct pci_dev *dev, int where, u32 value)
-{
- return apecs_write_config(dev, where, value, 0x18);
-}
-
struct pci_ops apecs_pci_ops =
{
- read_byte: apecs_read_config_byte,
- read_word: apecs_read_config_word,
- read_dword: apecs_read_config_dword,
- write_byte: apecs_write_config_byte,
- write_word: apecs_write_config_word,
- write_dword: apecs_write_config_dword
+ .read = apecs_read_config,
+ .write = apecs_write_config,
};
void
diff -Nru a/arch/alpha/kernel/core_cia.c b/arch/alpha/kernel/core_cia.c
--- a/arch/alpha/kernel/core_cia.c Sat Aug 31 15:06:00 2002
+++ b/arch/alpha/kernel/core_cia.c Sat Aug 31 15:06:00 2002
@@ -89,11 +89,10 @@
*/
static int
-mk_conf_addr(struct pci_dev *dev, int where, unsigned long *pci_addr,
- unsigned char *type1)
+mk_conf_addr(struct pci_bus *bus_dev, unsigned int device_fn, int where,
+ unsigned long *pci_addr, unsigned char *type1)
{
- u8 bus = dev->bus->number;
- u8 device_fn = dev->devfn;
+ u8 bus = bus_dev->number;
*type1 = (bus != 0);
*pci_addr = (bus << 16) | (device_fn << 8) | where;
@@ -208,88 +207,70 @@
DBGC(("done\n"));
}
-static int
-cia_read_config_byte(struct pci_dev *dev, int where, u8 *value)
-{
- unsigned long addr, pci_addr;
- unsigned char type1;
-
- if (mk_conf_addr(dev, where, &pci_addr, &type1))
- return PCIBIOS_DEVICE_NOT_FOUND;
-
- addr = (pci_addr << 5) + 0x00 + CIA_CONF;
- *value = conf_read(addr, type1) >> ((where & 3) * 8);
- return PCIBIOS_SUCCESSFUL;
-}
-
static int
-cia_read_config_word(struct pci_dev *dev, int where, u16 *value)
+cia_read_config(struct pci_bus *bus, unsigned int devfn, int where, int size,
+ u32 *value)
{
unsigned long addr, pci_addr;
+ long mask;
unsigned char type1;
+ int shift;
- if (mk_conf_addr(dev, where, &pci_addr, &type1))
+ if (mk_conf_addr(bus, devfn, where, &pci_addr, &type1))
return PCIBIOS_DEVICE_NOT_FOUND;
- addr = (pci_addr << 5) + 0x08 + CIA_CONF;
- *value = conf_read(addr, type1) >> ((where & 3) * 8);
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int
-cia_read_config_dword(struct pci_dev *dev, int where, u32 *value)
-{
- unsigned long addr, pci_addr;
- unsigned char type1;
-
- if (mk_conf_addr(dev, where, &pci_addr, &type1))
- return PCIBIOS_DEVICE_NOT_FOUND;
+ switch (size) {
+ case 1:
+ mask = 0x00;
+ shift = (where & 3) * 8;
+ break;
+ case 2:
+ mask = 0x08;
+ shift = (where & 3) * 8;
+ break;
+ case 4:
+ mase = 0x18;
+ shift = 0;
+ break;
+ }
addr = (pci_addr << 5) + 0x18 + CIA_CONF;
- *value = conf_read(addr, type1);
+ *value = conf_read(addr, type1) >> (shift);
return PCIBIOS_SUCCESSFUL;
}
static int
-cia_write_config(struct pci_dev *dev, int where, u32 value, long mask)
+cia_write_config(struct pci_bus *bus, unsigned int devfn, int where, int size,
+ u32 value)
{
unsigned long addr, pci_addr;
+ long mask;
unsigned char type1;
- if (mk_conf_addr(dev, where, &pci_addr, &type1))
+ if (mk_conf_addr(bus, devfn, where, &pci_addr, &type1))
return PCIBIOS_DEVICE_NOT_FOUND;
+ switch (size) {
+ case 1:
+ mask = 0x00;
+ break;
+ case 2:
+ mask = 0x08;
+ break;
+ case 4:
+ mase = 0x18;
+ break;
+ }
+
addr = (pci_addr << 5) + mask + CIA_CONF;
conf_write(addr, value << ((where & 3) * 8), type1);
return PCIBIOS_SUCCESSFUL;
}
-static int
-cia_write_config_byte(struct pci_dev *dev, int where, u8 value)
-{
- return cia_write_config(dev, where, value, 0x00);
-}
-
-static int
-cia_write_config_word(struct pci_dev *dev, int where, u16 value)
-{
- return cia_write_config(dev, where, value, 0x08);
-}
-
-static int
-cia_write_config_dword(struct pci_dev *dev, int where, u32 value)
-{
- return cia_write_config(dev, where, value, 0x18);
-}
-
struct pci_ops cia_pci_ops =
{
- read_byte: cia_read_config_byte,
- read_word: cia_read_config_word,
- read_dword: cia_read_config_dword,
- write_byte: cia_write_config_byte,
- write_word: cia_write_config_word,
- write_dword: cia_write_config_dword
+ .read = cia_read_config,
+ .write = cia_write_config,
};
/*
diff -Nru a/arch/alpha/kernel/core_irongate.c b/arch/alpha/kernel/core_irongate.c
--- a/arch/alpha/kernel/core_irongate.c Sat Aug 31 15:05:54 2002
+++ b/arch/alpha/kernel/core_irongate.c Sat Aug 31 15:05:54 2002
@@ -83,12 +83,11 @@
*/
static int
-mk_conf_addr(struct pci_dev *dev, int where, unsigned long *pci_addr,
- unsigned char *type1)
+mk_conf_addr(struct pci_bus *bus_dev, unsigned int device_fn, int where,
+ unsigned long *pci_addr, unsigned char *type1)
{
unsigned long addr;
- u8 bus = dev->bus->number;
- u8 device_fn = dev->devfn;
+ u8 bus = bus_dev->number;
DBG_CFG(("mk_conf_addr(bus=%d ,device_fn=0x%x, where=0x%x, "
"pci_addr=0x%p, type1=0x%p)\n",
@@ -105,12 +104,13 @@
}
static int
-irongate_read_config_byte(struct pci_dev *dev, int where, u8 *value)
+irongate_read_config(struct pci_bus *bus, unsigned int devfn, int where,
+ int size, u32 *value)
{
unsigned long addr;
unsigned char type1;
- if (mk_conf_addr(dev, where, &addr, &type1))
+ if (mk_conf_addr(bus, devfn, where, &addr, &type1))
return PCIBIOS_DEVICE_NOT_FOUND;
*value = __kernel_ldbu(*(vucp)addr);
@@ -118,38 +118,13 @@
}
static int
-irongate_read_config_word(struct pci_dev *dev, int where, u16 *value)
+irongate_write_config(struct pci_bus *bus, unsigned int devfn, int where,
+ int size, u32 value)
{
unsigned long addr;
unsigned char type1;
- if (mk_conf_addr(dev, where, &addr, &type1))
- return PCIBIOS_DEVICE_NOT_FOUND;
-
- *value = __kernel_ldwu(*(vusp)addr);
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int
-irongate_read_config_dword(struct pci_dev *dev, int where, u32 *value)
-{
- unsigned long addr;
- unsigned char type1;
-
- if (mk_conf_addr(dev, where, &addr, &type1))
- return PCIBIOS_DEVICE_NOT_FOUND;
-
- *value = *(vuip)addr;
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int
-irongate_write_config_byte(struct pci_dev *dev, int where, u8 value)
-{
- unsigned long addr;
- unsigned char type1;
-
- if (mk_conf_addr(dev, where, &addr, &type1))
+ if (mk_conf_addr(bus, devfn, where, &addr, &type1))
return PCIBIOS_DEVICE_NOT_FOUND;
__kernel_stb(value, *(vucp)addr);
@@ -158,45 +133,11 @@
return PCIBIOS_SUCCESSFUL;
}
-static int
-irongate_write_config_word(struct pci_dev *dev, int where, u16 value)
-{
- unsigned long addr;
- unsigned char type1;
-
- if (mk_conf_addr(dev, where, &addr, &type1))
- return PCIBIOS_DEVICE_NOT_FOUND;
-
- __kernel_stw(value, *(vusp)addr);
- mb();
- __kernel_ldwu(*(vusp)addr);
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int
-irongate_write_config_dword(struct pci_dev *dev, int where, u32 value)
-{
- unsigned long addr;
- unsigned char type1;
-
- if (mk_conf_addr(dev, where, &addr, &type1))
- return PCIBIOS_DEVICE_NOT_FOUND;
-
- *(vuip)addr = value;
- mb();
- *(vuip)addr;
- return PCIBIOS_SUCCESSFUL;
-}
-
struct pci_ops irongate_pci_ops =
{
- read_byte: irongate_read_config_byte,
- read_word: irongate_read_config_word,
- read_dword: irongate_read_config_dword,
- write_byte: irongate_write_config_byte,
- write_word: irongate_write_config_word,
- write_dword: irongate_write_config_dword
+ .read = irongate_read_config,
+ .write = irongate_write_config,
};
#ifdef DEBUG_IRONGATE
diff -Nru a/arch/alpha/kernel/core_lca.c b/arch/alpha/kernel/core_lca.c
--- a/arch/alpha/kernel/core_lca.c Sat Aug 31 15:05:55 2002
+++ b/arch/alpha/kernel/core_lca.c Sat Aug 31 15:05:55 2002
@@ -99,11 +99,11 @@
*/
static int
-mk_conf_addr(struct pci_dev *dev, int where, unsigned long *pci_addr)
+mk_conf_addr(struct pci_bus *bus_dev, unsigned int device_fn, int where,
+ unsigned long *pci_addr)
{
unsigned long addr;
- u8 bus = dev->bus->number;
- u8 device_fn = dev->devfn;
+ u8 bus = bus_dev->number;
if (bus == 0) {
int device = device_fn >> 3;
@@ -199,83 +199,65 @@
}
static int
-lca_read_config_byte(struct pci_dev *dev, int where, u8 *value)
+lca_read_config(struct pci_bus *bus, unsigned int devfn, int where,
+ int size, u32 *value)
{
unsigned long addr, pci_addr;
+ long mask;
+ int shift
- if (mk_conf_addr(dev, where, &pci_addr))
+ if (mk_conf_addr(bus, devfn, dev, where, &pci_addr))
return PCIBIOS_DEVICE_NOT_FOUND;
- addr = (pci_addr << 5) + 0x00 + LCA_CONF;
- *value = conf_read(addr) >> ((where & 3) * 8);
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int
-lca_read_config_word(struct pci_dev *dev, int where, u16 *value)
-{
- unsigned long addr, pci_addr;
-
- if (mk_conf_addr(dev, where, &pci_addr))
- return PCIBIOS_DEVICE_NOT_FOUND;
-
- addr = (pci_addr << 5) + 0x08 + LCA_CONF;
- *value = conf_read(addr) >> ((where & 3) * 8);
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int
-lca_read_config_dword(struct pci_dev *dev, int where, u32 *value)
-{
- unsigned long addr, pci_addr;
-
- if (mk_conf_addr(dev, where, &pci_addr))
- return PCIBIOS_DEVICE_NOT_FOUND;
-
- addr = (pci_addr << 5) + 0x18 + LCA_CONF;
- *value = conf_read(addr);
+ switch (size) {
+ case 1:
+ shift = (where & 3) * 8;
+ mask = 0x00;
+ break;
+ case 2:
+ shift = (where & 3) * 8;
+ mask = 0x08
+ break;
+ case 4:
+ shift = 0;
+ mask = 0x18
+ break;
+ }
+ addr = (pci_addr << 5) + mask + LCA_CONF;
+ *value = conf_read(addr) >> (shift);
return PCIBIOS_SUCCESSFUL;
}
static int
-lca_write_config(struct pci_dev *dev, int where, u32 value, long mask)
+lca_write_config(struct pci_bus *dev, unsigned int devfn, int where, int size,
+ u32 value)
{
unsigned long addr, pci_addr;
+ long mask;
- if (mk_conf_addr(dev, where, &pci_addr))
+ if (mk_conf_addr(bus, devfn, where, &pci_addr))
return PCIBIOS_DEVICE_NOT_FOUND;
+ switch (size) {
+ case 1:
+ mask = 0x00;
+ break;
+ case 2:
+ mask = 0x08
+ break;
+ case 4:
+ mask = 0x18
+ break;
+ }
addr = (pci_addr << 5) + mask + LCA_CONF;
conf_write(addr, value << ((where & 3) * 8));
return PCIBIOS_SUCCESSFUL;
}
-static int
-lca_write_config_byte(struct pci_dev *dev, int where, u8 value)
-{
- return lca_write_config(dev, where, value, 0x00);
-}
-
-static int
-lca_write_config_word(struct pci_dev *dev, int where, u16 value)
-{
- return lca_write_config(dev, where, value, 0x08);
-}
-
-static int
-lca_write_config_dword(struct pci_dev *dev, int where, u32 value)
-{
- return lca_write_config(dev, where, value, 0x18);
-}
-
struct pci_ops lca_pci_ops =
{
- read_byte: lca_read_config_byte,
- read_word: lca_read_config_word,
- read_dword: lca_read_config_dword,
- write_byte: lca_write_config_byte,
- write_word: lca_write_config_word,
- write_dword: lca_write_config_dword
+ .read = lca_read_config,
+ .write = lca_write_config,
};
void
diff -Nru a/arch/alpha/kernel/core_polaris.c b/arch/alpha/kernel/core_polaris.c
--- a/arch/alpha/kernel/core_polaris.c Sat Aug 31 15:05:55 2002
+++ b/arch/alpha/kernel/core_polaris.c Sat Aug 31 15:05:55 2002
@@ -65,10 +65,10 @@
*/
static int
-mk_conf_addr(struct pci_dev *dev, int where, unsigned long *pci_addr, u8 *type1)
+mk_conf_addr(struct pci_bus *bus_dev, unsigned int device_fn, int where,
+ unsigned long *pci_addr, u8 *type1)
{
- u8 bus = dev->bus->number;
- u8 device_fn = dev->devfn;
+ u8 bus = bus_dev->number;
*type1 = (bus == 0) ? 0 : 1;
*pci_addr = (bus << 16) | (device_fn << 8) | (where) |
@@ -82,51 +82,28 @@
}
static int
-polaris_read_config_byte(struct pci_dev *dev, int where, u8 *value)
+polaris_read_config(struct pci_bus *bus, unsigned int devfn, int where,
+ int size, u32 *value)
{
unsigned long pci_addr;
unsigned char type1;
- if (mk_conf_addr(dev, where, &pci_addr, &type1))
+ if (mk_conf_addr(bus, devfn, where, &pci_addr, &type1))
return PCIBIOS_DEVICE_NOT_FOUND;
*value = __kernel_ldbu(*(vucp)pci_addr);
return PCIBIOS_SUCCESSFUL;
}
-static int
-polaris_read_config_word(struct pci_dev *dev, int where, u16 *value)
-{
- unsigned long pci_addr;
- unsigned char type1;
-
- if (mk_conf_addr(dev, where, &pci_addr, &type1))
- return PCIBIOS_DEVICE_NOT_FOUND;
-
- *value = __kernel_ldwu(*(vusp)pci_addr);
- return PCIBIOS_SUCCESSFUL;
-}
-
-int
-polaris_read_config_dword(struct pci_dev *dev, int where, u32 *value)
-{
- unsigned long pci_addr;
- unsigned char type1;
-
- if (mk_conf_addr(dev, where, &pci_addr, &type1))
- return PCIBIOS_DEVICE_NOT_FOUND;
-
- *value = *(vuip)pci_addr;
- return PCIBIOS_SUCCESSFUL;
-}
static int
-polaris_write_config_byte(struct pci_dev *dev, int where, u8 value)
+polaris_write_config(struct pci_bus *bus, unsigned int devfn, int where,
+ int size, u32 value)
{
unsigned long pci_addr;
unsigned char type1;
- if (mk_conf_addr(dev, where, &pci_addr, &type1))
+ if (mk_conf_addr(bus, devfn, where, &pci_addr, &type1))
return PCIBIOS_DEVICE_NOT_FOUND;
__kernel_stb(value, *(vucp)pci_addr);
@@ -135,44 +112,10 @@
return PCIBIOS_SUCCESSFUL;
}
-static int
-polaris_write_config_word(struct pci_dev *dev, int where, u16 value)
-{
- unsigned long pci_addr;
- unsigned char type1;
-
- if (mk_conf_addr(dev, where, &pci_addr, &type1))
- return PCIBIOS_DEVICE_NOT_FOUND;
-
- __kernel_stw(value, *(vusp)pci_addr);
- mb();
- __kernel_ldwu(*(vusp)pci_addr);
- return PCIBIOS_SUCCESSFUL;
-}
-
-int
-polaris_write_config_dword(struct pci_dev *dev, int where, u32 value)
-{
- unsigned long pci_addr;
- unsigned char type1;
-
- if (mk_conf_addr(dev, where, &pci_addr, &type1))
- return PCIBIOS_DEVICE_NOT_FOUND;
-
- *(vuip)pci_addr = value;
- mb();
- *(vuip)pci_addr;
- return PCIBIOS_SUCCESSFUL;
-}
-
struct pci_ops polaris_pci_ops =
{
- read_byte: polaris_read_config_byte,
- read_word: polaris_read_config_word,
- read_dword: polaris_read_config_dword,
- write_byte: polaris_write_config_byte,
- write_word: polaris_write_config_word,
- write_dword: polaris_write_config_dword
+ .read = polaris_read_config,
+ .write = polaris_write_config,
};
void __init
diff -Nru a/arch/alpha/kernel/core_t2.c b/arch/alpha/kernel/core_t2.c
--- a/arch/alpha/kernel/core_t2.c Sat Aug 31 15:05:54 2002
+++ b/arch/alpha/kernel/core_t2.c Sat Aug 31 15:05:54 2002
@@ -89,12 +89,11 @@
*/
static int
-mk_conf_addr(struct pci_dev *dev, int where, unsigned long *pci_addr,
- unsigned char *type1)
+mk_conf_addr(struct pci_bus *bus_dev, unsigned int device_fn, int where,
+ unsigned long *pci_addr, unsigned char *type1)
{
unsigned long addr;
- u8 bus = dev->bus->number;
- u8 device_fn = dev->devfn;
+ u8 bus = bus_dev->number;
DBG(("mk_conf_addr(bus=%d, dfn=0x%x, where=0x%x,"
" addr=0x%lx, type1=0x%x)\n",
@@ -238,87 +237,67 @@
}
static int
-t2_read_config_byte(struct pci_dev *dev, int where, u8 *value)
+t2_read_config(struct pci_bus *bus, unsigned int devfn, int where,
+ int size, u32 *value)
{
unsigned long addr, pci_addr;
unsigned char type1;
+ int shift;
+ long mask;
- if (mk_conf_addr(dev, where, &pci_addr, &type1))
- return PCIBIOS_DEVICE_NOT_FOUND;
-
- addr = (pci_addr << 5) + 0x00 + T2_CONF;
- *value = conf_read(addr, type1) >> ((where & 3) * 8);
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int
-t2_read_config_word(struct pci_dev *dev, int where, u16 *value)
-{
- unsigned long addr, pci_addr;
- unsigned char type1;
-
- if (mk_conf_addr(dev, where, &pci_addr, &type1))
- return PCIBIOS_DEVICE_NOT_FOUND;
-
- addr = (pci_addr << 5) + 0x08 + T2_CONF;
- *value = conf_read(addr, type1) >> ((where & 3) * 8);
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int
-t2_read_config_dword(struct pci_dev *dev, int where, u32 *value)
-{
- unsigned long addr, pci_addr;
- unsigned char type1;
-
- if (mk_conf_addr(dev, where, &pci_addr, &type1))
+ if (mk_conf_addr(bus, devfn, where, &pci_addr, &type1))
return PCIBIOS_DEVICE_NOT_FOUND;
- addr = (pci_addr << 5) + 0x18 + T2_CONF;
- *value = conf_read(addr, type1);
+ switch (size) {
+ case 1:
+ mask = 0x00;
+ shift = (where & 3) * 8;
+ break;
+ case 2:
+ mask = 0x08;
+ shift = (where & 3) * 8;
+ break;
+ case 4:
+ mask = 0x18;
+ shift = 0;
+ break;
+ }
+ addr = (pci_addr << 5) + mask + T2_CONF;
+ *value = conf_read(addr, type1) >> (shift);
return PCIBIOS_SUCCESSFUL;
}
static int
-t2_write_config(struct pci_dev *dev, int where, u32 value, long mask)
+t2_write_config(struct pci_bus *bus, unsigned int devfn, int where, int size,
+ u32 value)
{
unsigned long addr, pci_addr;
unsigned char type1;
+ long mask;
if (mk_conf_addr(dev, where, &pci_addr, &type1))
return PCIBIOS_DEVICE_NOT_FOUND;
+ switch (size) {
+ case 1:
+ mask = 0x00;
+ break;
+ case 2:
+ mask = 0x08;
+ break;
+ case 4:
+ mask = 0x18;
+ break;
+ }
addr = (pci_addr << 5) + mask + T2_CONF;
conf_write(addr, value << ((where & 3) * 8), type1);
return PCIBIOS_SUCCESSFUL;
}
-static int
-t2_write_config_byte(struct pci_dev *dev, int where, u8 value)
-{
- return t2_write_config(dev, where, value, 0x00);
-}
-
-static int
-t2_write_config_word(struct pci_dev *dev, int where, u16 value)
-{
- return t2_write_config(dev, where, value, 0x08);
-}
-
-static int
-t2_write_config_dword(struct pci_dev *dev, int where, u32 value)
-{
- return t2_write_config(dev, where, value, 0x18);
-}
-
struct pci_ops t2_pci_ops =
{
- read_byte: t2_read_config_byte,
- read_word: t2_read_config_word,
- read_dword: t2_read_config_dword,
- write_byte: t2_write_config_byte,
- write_word: t2_write_config_word,
- write_dword: t2_write_config_dword
+ .read = t2_read_config,
+ .write = t2_write_config,
};
void __init
diff -Nru a/arch/arm/def-configs/a5k b/arch/arm/def-configs/a5k
--- a/arch/arm/def-configs/a5k Sat Aug 31 15:05:59 2002
+++ b/arch/arm/def-configs/a5k Sat Aug 31 15:05:59 2002
@@ -385,6 +385,7 @@
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/adi_evb b/arch/arm/def-configs/adi_evb
--- a/arch/arm/def-configs/adi_evb Sat Aug 31 15:06:00 2002
+++ b/arch/arm/def-configs/adi_evb Sat Aug 31 15:06:00 2002
@@ -529,6 +529,7 @@
# CONFIG_FREEVXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/adsbitsy b/arch/arm/def-configs/adsbitsy
--- a/arch/arm/def-configs/adsbitsy Sat Aug 31 15:06:04 2002
+++ b/arch/arm/def-configs/adsbitsy Sat Aug 31 15:06:04 2002
@@ -479,6 +479,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/anakin b/arch/arm/def-configs/anakin
--- a/arch/arm/def-configs/anakin Sat Aug 31 15:05:54 2002
+++ b/arch/arm/def-configs/anakin Sat Aug 31 15:05:54 2002
@@ -509,6 +509,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/assabet b/arch/arm/def-configs/assabet
--- a/arch/arm/def-configs/assabet Sat Aug 31 15:05:59 2002
+++ b/arch/arm/def-configs/assabet Sat Aug 31 15:05:59 2002
@@ -658,6 +658,7 @@
# CONFIG_FREEVXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/badge4 b/arch/arm/def-configs/badge4
--- a/arch/arm/def-configs/badge4 Sat Aug 31 15:06:06 2002
+++ b/arch/arm/def-configs/badge4 Sat Aug 31 15:06:06 2002
@@ -844,6 +844,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/arm/def-configs/brutus b/arch/arm/def-configs/brutus
--- a/arch/arm/def-configs/brutus Sat Aug 31 15:05:55 2002
+++ b/arch/arm/def-configs/brutus Sat Aug 31 15:05:55 2002
@@ -223,6 +223,7 @@
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/cerfcube b/arch/arm/def-configs/cerfcube
--- a/arch/arm/def-configs/cerfcube Sat Aug 31 15:05:54 2002
+++ b/arch/arm/def-configs/cerfcube Sat Aug 31 15:05:54 2002
@@ -647,6 +647,7 @@
# CONFIG_FREEVXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/cerfpda b/arch/arm/def-configs/cerfpda
--- a/arch/arm/def-configs/cerfpda Sat Aug 31 15:05:55 2002
+++ b/arch/arm/def-configs/cerfpda Sat Aug 31 15:05:55 2002
@@ -685,6 +685,7 @@
# CONFIG_FREEVXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/cerfpod b/arch/arm/def-configs/cerfpod
--- a/arch/arm/def-configs/cerfpod Sat Aug 31 15:06:06 2002
+++ b/arch/arm/def-configs/cerfpod Sat Aug 31 15:06:06 2002
@@ -649,6 +649,7 @@
# CONFIG_FREEVXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/clps7500 b/arch/arm/def-configs/clps7500
--- a/arch/arm/def-configs/clps7500 Sat Aug 31 15:05:54 2002
+++ b/arch/arm/def-configs/clps7500 Sat Aug 31 15:05:54 2002
@@ -420,6 +420,8 @@
# CONFIG_ISO9660_FS is not set
CONFIG_MINIX_FS=y
# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/ebsa110 b/arch/arm/def-configs/ebsa110
--- a/arch/arm/def-configs/ebsa110 Sat Aug 31 15:05:54 2002
+++ b/arch/arm/def-configs/ebsa110 Sat Aug 31 15:05:54 2002
@@ -531,6 +531,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/edb7211 b/arch/arm/def-configs/edb7211
--- a/arch/arm/def-configs/edb7211 Sat Aug 31 15:05:54 2002
+++ b/arch/arm/def-configs/edb7211 Sat Aug 31 15:05:54 2002
@@ -330,6 +330,7 @@
CONFIG_MINIX_FS=y
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/empeg b/arch/arm/def-configs/empeg
--- a/arch/arm/def-configs/empeg Sat Aug 31 15:05:55 2002
+++ b/arch/arm/def-configs/empeg Sat Aug 31 15:05:55 2002
@@ -1,4 +1,5 @@
#
+#
# Example empeg-car kernel configuration file.
#
CONFIG_ARM=y
diff -Nru a/arch/arm/def-configs/epxa10db b/arch/arm/def-configs/epxa10db
--- a/arch/arm/def-configs/epxa10db Sat Aug 31 15:05:55 2002
+++ b/arch/arm/def-configs/epxa10db Sat Aug 31 15:05:55 2002
@@ -544,6 +544,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/flexanet b/arch/arm/def-configs/flexanet
--- a/arch/arm/def-configs/flexanet Sat Aug 31 15:06:06 2002
+++ b/arch/arm/def-configs/flexanet Sat Aug 31 15:06:06 2002
@@ -642,6 +642,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/footbridge b/arch/arm/def-configs/footbridge
--- a/arch/arm/def-configs/footbridge Sat Aug 31 15:05:59 2002
+++ b/arch/arm/def-configs/footbridge Sat Aug 31 15:05:59 2002
@@ -615,6 +615,7 @@
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/fortunet b/arch/arm/def-configs/fortunet
--- a/arch/arm/def-configs/fortunet Sat Aug 31 15:06:06 2002
+++ b/arch/arm/def-configs/fortunet Sat Aug 31 15:06:06 2002
@@ -455,6 +455,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/freebird b/arch/arm/def-configs/freebird
--- a/arch/arm/def-configs/freebird Sat Aug 31 15:05:55 2002
+++ b/arch/arm/def-configs/freebird Sat Aug 31 15:05:55 2002
@@ -492,6 +492,7 @@
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/freebird_new b/arch/arm/def-configs/freebird_new
--- a/arch/arm/def-configs/freebird_new Sat Aug 31 15:05:54 2002
+++ b/arch/arm/def-configs/freebird_new Sat Aug 31 15:05:54 2002
@@ -512,6 +512,7 @@
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/graphicsclient b/arch/arm/def-configs/graphicsclient
--- a/arch/arm/def-configs/graphicsclient Sat Aug 31 15:06:06 2002
+++ b/arch/arm/def-configs/graphicsclient Sat Aug 31 15:06:06 2002
@@ -585,6 +585,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/graphicsmaster b/arch/arm/def-configs/graphicsmaster
--- a/arch/arm/def-configs/graphicsmaster Sat Aug 31 15:05:53 2002
+++ b/arch/arm/def-configs/graphicsmaster Sat Aug 31 15:05:53 2002
@@ -560,6 +560,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/h3600 b/arch/arm/def-configs/h3600
--- a/arch/arm/def-configs/h3600 Sat Aug 31 15:05:55 2002
+++ b/arch/arm/def-configs/h3600 Sat Aug 31 15:05:55 2002
@@ -650,6 +650,7 @@
# CONFIG_FREEVXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/huw_webpanel b/arch/arm/def-configs/huw_webpanel
--- a/arch/arm/def-configs/huw_webpanel Sat Aug 31 15:05:54 2002
+++ b/arch/arm/def-configs/huw_webpanel Sat Aug 31 15:05:54 2002
@@ -336,6 +336,7 @@
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/integrator b/arch/arm/def-configs/integrator
--- a/arch/arm/def-configs/integrator Sat Aug 31 15:05:54 2002
+++ b/arch/arm/def-configs/integrator Sat Aug 31 15:05:54 2002
@@ -543,6 +543,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/iq80310 b/arch/arm/def-configs/iq80310
--- a/arch/arm/def-configs/iq80310 Sat Aug 31 15:05:55 2002
+++ b/arch/arm/def-configs/iq80310 Sat Aug 31 15:05:55 2002
@@ -638,6 +638,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/jornada720 b/arch/arm/def-configs/jornada720
--- a/arch/arm/def-configs/jornada720 Sat Aug 31 15:05:55 2002
+++ b/arch/arm/def-configs/jornada720 Sat Aug 31 15:05:55 2002
@@ -667,6 +667,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/arm/def-configs/lart b/arch/arm/def-configs/lart
--- a/arch/arm/def-configs/lart Sat Aug 31 15:05:59 2002
+++ b/arch/arm/def-configs/lart Sat Aug 31 15:05:59 2002
@@ -655,6 +655,7 @@
# CONFIG_FREEVXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/lubbock b/arch/arm/def-configs/lubbock
--- a/arch/arm/def-configs/lubbock Sat Aug 31 15:05:54 2002
+++ b/arch/arm/def-configs/lubbock Sat Aug 31 15:05:54 2002
@@ -702,6 +702,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/lusl7200 b/arch/arm/def-configs/lusl7200
--- a/arch/arm/def-configs/lusl7200 Sat Aug 31 15:05:55 2002
+++ b/arch/arm/def-configs/lusl7200 Sat Aug 31 15:05:55 2002
@@ -417,6 +417,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/neponset b/arch/arm/def-configs/neponset
--- a/arch/arm/def-configs/neponset Sat Aug 31 15:05:59 2002
+++ b/arch/arm/def-configs/neponset Sat Aug 31 15:05:59 2002
@@ -762,6 +762,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/omnimeter b/arch/arm/def-configs/omnimeter
--- a/arch/arm/def-configs/omnimeter Sat Aug 31 15:05:59 2002
+++ b/arch/arm/def-configs/omnimeter Sat Aug 31 15:05:59 2002
@@ -422,6 +422,7 @@
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/pangolin b/arch/arm/def-configs/pangolin
--- a/arch/arm/def-configs/pangolin Sat Aug 31 15:06:00 2002
+++ b/arch/arm/def-configs/pangolin Sat Aug 31 15:06:00 2002
@@ -559,6 +559,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/pfs168_mqtft b/arch/arm/def-configs/pfs168_mqtft
--- a/arch/arm/def-configs/pfs168_mqtft Sat Aug 31 15:06:00 2002
+++ b/arch/arm/def-configs/pfs168_mqtft Sat Aug 31 15:06:00 2002
@@ -598,6 +598,7 @@
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/pfs168_mqvga b/arch/arm/def-configs/pfs168_mqvga
--- a/arch/arm/def-configs/pfs168_mqvga Sat Aug 31 15:05:54 2002
+++ b/arch/arm/def-configs/pfs168_mqvga Sat Aug 31 15:05:54 2002
@@ -598,6 +598,7 @@
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/pfs168_sastn b/arch/arm/def-configs/pfs168_sastn
--- a/arch/arm/def-configs/pfs168_sastn Sat Aug 31 15:05:54 2002
+++ b/arch/arm/def-configs/pfs168_sastn Sat Aug 31 15:05:54 2002
@@ -591,6 +591,7 @@
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/pfs168_satft b/arch/arm/def-configs/pfs168_satft
--- a/arch/arm/def-configs/pfs168_satft Sat Aug 31 15:05:54 2002
+++ b/arch/arm/def-configs/pfs168_satft Sat Aug 31 15:05:54 2002
@@ -598,6 +598,7 @@
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/pleb b/arch/arm/def-configs/pleb
--- a/arch/arm/def-configs/pleb Sat Aug 31 15:05:55 2002
+++ b/arch/arm/def-configs/pleb Sat Aug 31 15:05:55 2002
@@ -460,6 +460,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/rpc b/arch/arm/def-configs/rpc
--- a/arch/arm/def-configs/rpc Sat Aug 31 15:05:53 2002
+++ b/arch/arm/def-configs/rpc Sat Aug 31 15:05:53 2002
@@ -620,6 +620,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/shannon b/arch/arm/def-configs/shannon
--- a/arch/arm/def-configs/shannon Sat Aug 31 15:05:54 2002
+++ b/arch/arm/def-configs/shannon Sat Aug 31 15:05:54 2002
@@ -534,6 +534,8 @@
CONFIG_MINIX_FS=y
# CONFIG_FREEVXFS_FS is not set
# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/def-configs/shark b/arch/arm/def-configs/shark
--- a/arch/arm/def-configs/shark Sat Aug 31 15:05:54 2002
+++ b/arch/arm/def-configs/shark Sat Aug 31 15:05:54 2002
@@ -681,6 +681,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/arm/def-configs/sherman b/arch/arm/def-configs/sherman
--- a/arch/arm/def-configs/sherman Sat Aug 31 15:05:54 2002
+++ b/arch/arm/def-configs/sherman Sat Aug 31 15:05:54 2002
@@ -151,6 +151,8 @@
# CONFIG_JOLIET is not set
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_QNX4FS_FS is not set
diff -Nru a/arch/arm/def-configs/stork b/arch/arm/def-configs/stork
--- a/arch/arm/def-configs/stork Sat Aug 31 15:06:06 2002
+++ b/arch/arm/def-configs/stork Sat Aug 31 15:06:06 2002
@@ -649,6 +649,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/arm/def-configs/system3 b/arch/arm/def-configs/system3
--- a/arch/arm/def-configs/system3 Sat Aug 31 15:05:59 2002
+++ b/arch/arm/def-configs/system3 Sat Aug 31 15:05:59 2002
@@ -684,6 +684,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/arm/defconfig b/arch/arm/defconfig
--- a/arch/arm/defconfig Sat Aug 31 15:05:55 2002
+++ b/arch/arm/defconfig Sat Aug 31 15:05:55 2002
@@ -421,6 +421,7 @@
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/cris/defconfig b/arch/cris/defconfig
--- a/arch/cris/defconfig Sat Aug 31 15:05:55 2002
+++ b/arch/cris/defconfig Sat Aug 31 15:05:55 2002
@@ -441,6 +441,7 @@
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/i386/defconfig b/arch/i386/defconfig
--- a/arch/i386/defconfig Sat Aug 31 15:05:54 2002
+++ b/arch/i386/defconfig Sat Aug 31 15:05:54 2002
@@ -657,9 +657,85 @@
#
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
# CONFIG_SERIAL_NONSTANDARD is not set
#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+# CONFIG_SERIAL_8250_CONSOLE is not set
+# CONFIG_SERIAL_8250_CS is not set
+# CONFIG_SERIAL_8250_EXTENDED is not set
+# CONFIG_SERIAL_8250_MANY_PORTS is not set
+# CONFIG_SERIAL_8250_SHARE_IRQ is not set
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+# CONFIG_SERIAL_8250_MULTIPORT is not set
+# CONFIG_SERIAL_8250_RSA is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
+CONFIG_PRINTER=y
+# CONFIG_LP_CONSOLE is not set
+# CONFIG_PPDEV is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Mice
+#
+# CONFIG_BUSMOUSE is not set
+# CONFIG_QIC02_TAPE is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+CONFIG_INTEL_RNG=y
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set
+# CONFIG_GEN_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_SONYPI is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+CONFIG_AGP=y
+CONFIG_AGP_INTEL=y
+CONFIG_AGP_I810=y
+# CONFIG_AGP_VIA is not set
+# CONFIG_AGP_AMD is not set
+# CONFIG_AGP_SIS is not set
+# CONFIG_AGP_ALI is not set
+# CONFIG_AGP_SWORKS is not set
+CONFIG_DRM=y
+# CONFIG_DRM_TDFX is not set
+# CONFIG_DRM_GAMMA is not set
+# CONFIG_DRM_R128 is not set
+CONFIG_DRM_RADEON=y
+# CONFIG_DRM_I810 is not set
+# CONFIG_DRM_I830 is not set
+# CONFIG_DRM_MGA is not set
+
+#
+# PCMCIA character devices
+#
+# CONFIG_SYNCLINK_CS is not set
+# CONFIG_MWAVE is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
# Multimedia devices
#
# CONFIG_VIDEO_DEV is not set
@@ -703,6 +779,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c
--- a/arch/i386/kernel/cpu/common.c Sat Aug 31 15:05:54 2002
+++ b/arch/i386/kernel/cpu/common.c Sat Aug 31 15:05:54 2002
@@ -454,7 +454,7 @@
/*
* Set up the per-thread TLS descriptor cache:
*/
- memcpy(thread->tls_array, cpu_gdt_table[cpu], GDT_ENTRY_TLS_MAX * 8);
+ memcpy(thread->tls_array, cpu_gdt_table[cpu], GDT_ENTRY_TLS_ENTRIES * 8);
__asm__ __volatile__("lgdt %0": "=m" (cpu_gdt_descr[cpu]));
__asm__ __volatile__("lidt %0": "=m" (idt_descr));
diff -Nru a/arch/i386/kernel/i386_ksyms.c b/arch/i386/kernel/i386_ksyms.c
--- a/arch/i386/kernel/i386_ksyms.c Sat Aug 31 15:06:00 2002
+++ b/arch/i386/kernel/i386_ksyms.c Sat Aug 31 15:06:00 2002
@@ -58,6 +58,9 @@
EXPORT_SYMBOL(EISA_bus);
#endif
EXPORT_SYMBOL(MCA_bus);
+#ifdef CONFIG_MULTIQUAD
+EXPORT_SYMBOL(xquad_portio);
+#endif
EXPORT_SYMBOL(__verify_write);
EXPORT_SYMBOL(dump_thread);
EXPORT_SYMBOL(dump_fpu);
@@ -169,7 +172,3 @@
EXPORT_SYMBOL(is_sony_vaio_laptop);
EXPORT_SYMBOL(__PAGE_KERNEL);
-
-#ifdef CONFIG_MULTIQUAD
-EXPORT_SYMBOL(xquad_portio);
-#endif
diff -Nru a/arch/i386/kernel/ioport.c b/arch/i386/kernel/ioport.c
--- a/arch/i386/kernel/ioport.c Sat Aug 31 15:06:00 2002
+++ b/arch/i386/kernel/ioport.c Sat Aug 31 15:06:00 2002
@@ -55,12 +55,16 @@
asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int turn_on)
{
struct thread_struct * t = ¤t->thread;
- struct tss_struct * tss = init_tss + smp_processor_id();
+ struct tss_struct * tss;
+ int ret = 0;
if ((from + num <= from) || (from + num > IO_BITMAP_SIZE*32))
return -EINVAL;
if (turn_on && !capable(CAP_SYS_RAWIO))
return -EPERM;
+
+ tss = init_tss + get_cpu();
+
/*
* If it's the first ioperm() call in this thread's lifetime, set the
* IO bitmap up. ioperm() is much less timing critical than clone(),
@@ -69,8 +73,11 @@
if (!t->ts_io_bitmap) {
unsigned long *bitmap;
bitmap = kmalloc(IO_BITMAP_BYTES, GFP_KERNEL);
- if (!bitmap)
- return -ENOMEM;
+ if (!bitmap) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
/*
* just in case ...
*/
@@ -88,7 +95,9 @@
set_bitmap(t->ts_io_bitmap, from, num, !turn_on);
set_bitmap(tss->io_bitmap, from, num, !turn_on);
- return 0;
+out:
+ put_cpu();
+ return ret;
}
/*
diff -Nru a/arch/i386/kernel/ldt.c b/arch/i386/kernel/ldt.c
--- a/arch/i386/kernel/ldt.c Sat Aug 31 15:05:54 2002
+++ b/arch/i386/kernel/ldt.c Sat Aug 31 15:05:54 2002
@@ -49,17 +49,20 @@
memcpy(newldt, pc->ldt, oldsize*LDT_ENTRY_SIZE);
oldldt = pc->ldt;
memset(newldt+oldsize*LDT_ENTRY_SIZE, 0, (mincount-oldsize)*LDT_ENTRY_SIZE);
- wmb();
pc->ldt = newldt;
+ wmb();
pc->size = mincount;
+ wmb();
+
if (reload) {
load_LDT(pc);
#ifdef CONFIG_SMP
- if (current->mm->cpu_vm_mask != (1<mm->cpu_vm_mask != (1 << smp_processor_id()))
smp_call_function(flush_ldt, 0, 1, 1);
+ preempt_enable();
#endif
}
- wmb();
if (oldsize) {
if (oldsize*LDT_ENTRY_SIZE > PAGE_SIZE)
vfree(oldldt);
@@ -72,11 +75,8 @@
static inline int copy_ldt(mm_context_t *new, mm_context_t *old)
{
int err = alloc_ldt(new, old->size, 0);
- if (err < 0) {
- printk(KERN_WARNING "ldt allocation failed\n");
- new->size = 0;
+ if (err < 0)
return err;
- }
memcpy(new->ldt, old->ldt, old->size*LDT_ENTRY_SIZE);
return 0;
}
diff -Nru a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
--- a/arch/i386/kernel/process.c Sat Aug 31 15:05:53 2002
+++ b/arch/i386/kernel/process.c Sat Aug 31 15:05:53 2002
@@ -504,7 +504,7 @@
regs.eflags = 0x286;
/* Ok, create the new process.. */
- p = do_fork(flags | CLONE_VM, 0, ®s, 0);
+ p = do_fork(flags | CLONE_VM, 0, ®s, 0, NULL);
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
}
@@ -588,11 +588,6 @@
}
/*
- * The common fastpath:
- */
- if (!(clone_flags & (CLONE_SETTLS | CLONE_SETTID | CLONE_CLEARTID)))
- return 0;
- /*
* Set a new TLS for the child thread?
*/
if (clone_flags & CLONE_SETTLS) {
@@ -613,19 +608,6 @@
desc->a = LDT_entry_a(&info);
desc->b = LDT_entry_b(&info);
}
-
- /*
- * Notify the child of the TID?
- */
- if (clone_flags & CLONE_SETTID)
- if (put_user(p->pid, (pid_t *)childregs->edx))
- return -EFAULT;
-
- /*
- * Does the userspace VM want the TID cleared on mm_release()?
- */
- if (clone_flags & CLONE_CLEARTID)
- p->user_tid = (int *) childregs->edx;
return 0;
}
@@ -779,7 +761,7 @@
{
struct task_struct *p;
- p = do_fork(SIGCHLD, regs.esp, ®s, 0);
+ p = do_fork(SIGCHLD, regs.esp, ®s, 0, NULL);
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
}
@@ -788,12 +770,14 @@
struct task_struct *p;
unsigned long clone_flags;
unsigned long newsp;
+ int *user_tid;
clone_flags = regs.ebx;
newsp = regs.ecx;
+ user_tid = (int *)regs.edx;
if (!newsp)
newsp = regs.esp;
- p = do_fork(clone_flags & ~CLONE_IDLETASK, newsp, ®s, 0);
+ p = do_fork(clone_flags & ~CLONE_IDLETASK, newsp, ®s, 0, user_tid);
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
}
@@ -811,7 +795,7 @@
{
struct task_struct *p;
- p = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs.esp, ®s, 0);
+ p = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs.esp, ®s, 0, NULL);
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
}
diff -Nru a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
--- a/arch/i386/kernel/setup.c Sat Aug 31 15:06:00 2002
+++ b/arch/i386/kernel/setup.c Sat Aug 31 15:06:00 2002
@@ -46,6 +46,8 @@
unsigned long mmu_cr4_features;
+int acpi_disabled __initdata = 0;
+
int MCA_bus;
/* for MCA, but anyone else can use it if they want */
unsigned int machine_id;
@@ -522,7 +524,7 @@
} /* setup_memory_region */
-static void __init parse_mem_cmdline (char ** cmdline_p)
+static void __init parse_cmdline_early (char ** cmdline_p)
{
char c = ' ', *to = command_line, *from = COMMAND_LINE;
int len = 0;
@@ -569,6 +571,11 @@
}
}
}
+
+ /* "acpi=off" disables both ACPI table parsing and interpreter init */
+ if (c == ' ' && !memcmp(from, "acpi=off", 8))
+ acpi_disabled = 1;
+
/*
* highmem=size forces highmem to be exactly 'size' bytes.
* This works even on boxes that have no highmem otherwise.
@@ -637,7 +644,7 @@
data_resource.start = virt_to_phys(&_etext);
data_resource.end = virt_to_phys(&_edata)-1;
- parse_mem_cmdline(cmdline_p);
+ parse_cmdline_early(cmdline_p);
#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
@@ -840,7 +847,8 @@
/*
* Parse the ACPI tables for possible boot-time SMP configuration.
*/
- acpi_boot_init(*cmdline_p);
+ if (!acpi_disabled)
+ acpi_boot_init(*cmdline_p);
#endif
#ifdef CONFIG_X86_LOCAL_APIC
if (smp_found_config)
diff -Nru a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
--- a/arch/i386/kernel/smpboot.c Sat Aug 31 15:06:00 2002
+++ b/arch/i386/kernel/smpboot.c Sat Aug 31 15:06:00 2002
@@ -395,7 +395,7 @@
Dprintk("CALLIN, before setup_local_APIC().\n");
/*
* Because we use NMIs rather than the INIT-STARTUP sequence to
- * bootstrap the CPUs, the APIC may be in a wierd state. Kick it.
+ * bootstrap the CPUs, the APIC may be in a weird state. Kick it.
*/
if (clustered_apic_mode)
clear_local_APIC();
@@ -495,7 +495,7 @@
* don't care about the eip and regs settings since
* we'll never reschedule the forked task.
*/
- return do_fork(CLONE_VM|CLONE_IDLETASK, 0, ®s, 0);
+ return do_fork(CLONE_VM|CLONE_IDLETASK, 0, ®s, 0, NULL);
}
/* which physical APIC ID maps to which logical CPU number */
diff -Nru a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
--- a/arch/i386/kernel/traps.c Sat Aug 31 15:05:55 2002
+++ b/arch/i386/kernel/traps.c Sat Aug 31 15:05:55 2002
@@ -311,21 +311,6 @@
if (vm86 && regs->eflags & VM_MASK)
goto vm86_trap;
-#ifdef CONFIG_PNPBIOS
- if (regs->xcs == 0x60 || regs->xcs == 0x68)
- {
- extern u32 pnp_bios_fault_eip, pnp_bios_fault_esp;
- extern u32 pnp_bios_is_utter_crap;
- pnp_bios_is_utter_crap = 1;
- printk(KERN_CRIT "PNPBIOS fault.. attempting recovery.\n");
- __asm__ volatile(
- "movl %0, %%esp\n\t"
- "jmp *%1\n\t"
- : "=a" (pnp_bios_fault_esp), "=b" (pnp_bios_fault_eip));
- panic("do_trap: can't hit this");
- }
-#endif
-
if (!(regs->xcs & 3))
goto kernel_trap;
@@ -341,7 +326,23 @@
}
kernel_trap: {
- unsigned long fixup = search_exception_table(regs->eip);
+ unsigned long fixup;
+#ifdef CONFIG_PNPBIOS
+ if (unlikely((regs->xcs | 8) == 0x88)) /* 0x80 or 0x88 */
+ {
+ extern u32 pnp_bios_fault_eip, pnp_bios_fault_esp;
+ extern u32 pnp_bios_is_utter_crap;
+ pnp_bios_is_utter_crap = 1;
+ printk(KERN_CRIT "PNPBIOS fault.. attempting recovery.\n");
+ __asm__ volatile(
+ "movl %0, %%esp\n\t"
+ "jmp *%1\n\t"
+ : "=a" (pnp_bios_fault_esp), "=b" (pnp_bios_fault_eip));
+ panic("do_trap: can't hit this");
+ }
+#endif
+
+ fixup = search_exception_table(regs->eip);
if (fixup)
regs->eip = fixup;
else
diff -Nru a/arch/i386/pci/common.c b/arch/i386/pci/common.c
--- a/arch/i386/pci/common.c Sat Aug 31 15:05:59 2002
+++ b/arch/i386/pci/common.c Sat Aug 31 15:05:59 2002
@@ -25,9 +25,6 @@
struct pci_bus *pci_root_bus = NULL;
struct pci_ops *pci_root_ops = NULL;
-int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int len, u32 *value) = NULL;
-int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value) = NULL;
-
/*
* legacy, numa, and acpi all want to call pcibios_scan_root
* from their initcalls. This flag prevents that.
diff -Nru a/arch/i386/pci/direct.c b/arch/i386/pci/direct.c
--- a/arch/i386/pci/direct.c Sat Aug 31 15:05:55 2002
+++ b/arch/i386/pci/direct.c Sat Aug 31 15:05:55 2002
@@ -13,7 +13,7 @@
#define PCI_CONF1_ADDRESS(bus, dev, fn, reg) \
(0x80000000 | (bus << 16) | (dev << 11) | (fn << 8) | (reg & ~3))
-static int pci_conf1_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
+static int __pci_conf1_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
{
unsigned long flags;
@@ -41,7 +41,7 @@
return 0;
}
-static int pci_conf1_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
+static int __pci_conf1_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
{
unsigned long flags;
@@ -69,75 +69,23 @@
return 0;
}
-
#undef PCI_CONF1_ADDRESS
-static int pci_conf1_read_config_byte(struct pci_dev *dev, int where, u8 *value)
+static int pci_conf1_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value)
{
- int result;
- u32 data;
-
- if (!value)
- return -EINVAL;
-
- result = pci_conf1_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 1, &data);
-
- *value = (u8)data;
-
- return result;
+ return __pci_conf1_read(0, bus->number, PCI_SLOT(devfn),
+ PCI_FUNC(devfn), where, size, value);
}
-static int pci_conf1_read_config_word(struct pci_dev *dev, int where, u16 *value)
+static int pci_conf1_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value)
{
- int result;
- u32 data;
-
- if (!value)
- return -EINVAL;
-
- result = pci_conf1_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 2, &data);
-
- *value = (u16)data;
-
- return result;
-}
-
-static int pci_conf1_read_config_dword(struct pci_dev *dev, int where, u32 *value)
-{
- if (!value)
- return -EINVAL;
-
- return pci_conf1_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 4, value);
-}
-
-static int pci_conf1_write_config_byte(struct pci_dev *dev, int where, u8 value)
-{
- return pci_conf1_write(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 1, value);
-}
-
-static int pci_conf1_write_config_word(struct pci_dev *dev, int where, u16 value)
-{
- return pci_conf1_write(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 2, value);
-}
-
-static int pci_conf1_write_config_dword(struct pci_dev *dev, int where, u32 value)
-{
- return pci_conf1_write(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 4, value);
+ return __pci_conf1_write(0, bus->number, PCI_SLOT(devfn),
+ PCI_FUNC(devfn), where, size, value);
}
static struct pci_ops pci_direct_conf1 = {
- pci_conf1_read_config_byte,
- pci_conf1_read_config_word,
- pci_conf1_read_config_dword,
- pci_conf1_write_config_byte,
- pci_conf1_write_config_word,
- pci_conf1_write_config_dword
+ .read = pci_conf1_read,
+ .write = pci_conf1_write,
};
@@ -147,7 +95,7 @@
#define PCI_CONF2_ADDRESS(dev, reg) (u16)(0xC000 | (dev << 8) | reg)
-static int pci_conf2_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
+static int __pci_conf2_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
{
unsigned long flags;
@@ -181,7 +129,7 @@
return 0;
}
-static int pci_conf2_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
+static int __pci_conf2_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
{
unsigned long flags;
@@ -217,57 +165,21 @@
#undef PCI_CONF2_ADDRESS
-static int pci_conf2_read_config_byte(struct pci_dev *dev, int where, u8 *value)
-{
- int result;
- u32 data;
- result = pci_conf2_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 1, &data);
- *value = (u8)data;
- return result;
-}
-
-static int pci_conf2_read_config_word(struct pci_dev *dev, int where, u16 *value)
-{
- int result;
- u32 data;
- result = pci_conf2_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 2, &data);
- *value = (u16)data;
- return result;
-}
-
-static int pci_conf2_read_config_dword(struct pci_dev *dev, int where, u32 *value)
-{
- return pci_conf2_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 4, value);
-}
-
-static int pci_conf2_write_config_byte(struct pci_dev *dev, int where, u8 value)
+static int pci_conf2_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value)
{
- return pci_conf2_write(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 1, value);
+ return __pci_conf2_read(0, bus->number, PCI_SLOT(devfn),
+ PCI_FUNC(devfn), where, size, value);
}
-static int pci_conf2_write_config_word(struct pci_dev *dev, int where, u16 value)
+static int pci_conf2_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value)
{
- return pci_conf2_write(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 2, value);
-}
-
-static int pci_conf2_write_config_dword(struct pci_dev *dev, int where, u32 value)
-{
- return pci_conf2_write(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 4, value);
+ return __pci_conf2_write(0, bus->number, PCI_SLOT(devfn),
+ PCI_FUNC(devfn), where, size, value);
}
static struct pci_ops pci_direct_conf2 = {
- pci_conf2_read_config_byte,
- pci_conf2_read_config_word,
- pci_conf2_read_config_dword,
- pci_conf2_write_config_byte,
- pci_conf2_write_config_word,
- pci_conf2_write_config_dword
+ .read = pci_conf2_read,
+ .write = pci_conf2_write,
};
@@ -283,7 +195,7 @@
*/
static int __devinit pci_sanity_check(struct pci_ops *o)
{
- u16 x;
+ u32 x = 0;
struct pci_bus bus; /* Fake bus and device */
struct pci_dev dev;
@@ -292,16 +204,16 @@
bus.number = 0;
dev.bus = &bus;
for(dev.devfn=0; dev.devfn < 0x100; dev.devfn++)
- if ((!o->read_word(&dev, PCI_CLASS_DEVICE, &x) &&
+ if ((!o->read(&bus, dev.devfn, PCI_CLASS_DEVICE, 2, &x) &&
(x == PCI_CLASS_BRIDGE_HOST || x == PCI_CLASS_DISPLAY_VGA)) ||
- (!o->read_word(&dev, PCI_VENDOR_ID, &x) &&
+ (!o->read(&bus, dev.devfn, PCI_VENDOR_ID, 2, &x) &&
(x == PCI_VENDOR_ID_INTEL || x == PCI_VENDOR_ID_COMPAQ)))
return 1;
DBG("PCI: Sanity check failed\n");
return 0;
}
-static struct pci_ops * __devinit pci_check_direct(void)
+static int __init pci_direct_init(void)
{
unsigned int tmp;
unsigned long flags;
@@ -321,8 +233,10 @@
local_irq_restore(flags);
printk(KERN_INFO "PCI: Using configuration type 1\n");
if (!request_region(0xCF8, 8, "PCI conf1"))
- return NULL;
- return &pci_direct_conf1;
+ pci_root_ops = NULL;
+ else
+ pci_root_ops = &pci_direct_conf1;
+ return 0;
}
outl (tmp, 0xCF8);
}
@@ -339,28 +253,15 @@
local_irq_restore(flags);
printk(KERN_INFO "PCI: Using configuration type 2\n");
if (!request_region(0xCF8, 4, "PCI conf2"))
- return NULL;
- return &pci_direct_conf2;
+ pci_root_ops = NULL;
+ else
+ pci_root_ops = &pci_direct_conf2;
+ return 0;
}
}
local_irq_restore(flags);
- return NULL;
-}
-
-static int __init pci_direct_init(void)
-{
- if ((pci_probe & (PCI_PROBE_CONF1 | PCI_PROBE_CONF2))
- && (pci_root_ops = pci_check_direct())) {
- if (pci_root_ops == &pci_direct_conf1) {
- pci_config_read = pci_conf1_read;
- pci_config_write = pci_conf1_write;
- }
- else {
- pci_config_read = pci_conf2_read;
- pci_config_write = pci_conf2_write;
- }
- }
+ pci_root_ops = NULL;
return 0;
}
diff -Nru a/arch/i386/pci/numa.c b/arch/i386/pci/numa.c
--- a/arch/i386/pci/numa.c Sat Aug 31 15:05:55 2002
+++ b/arch/i386/pci/numa.c Sat Aug 31 15:05:55 2002
@@ -1,19 +1,19 @@
/*
* numa.c - Low-level PCI access for NUMA-Q machines
*/
+
#include
#include
-
#include "pci.h"
#define BUS2QUAD(global) (mp_bus_id_to_node[global])
#define BUS2LOCAL(global) (mp_bus_id_to_local[global])
#define QUADLOCAL2BUS(quad,local) (quad_local_to_mp_bus_id[quad][local])
-#define PCI_CONF1_ADDRESS(bus, dev, fn, reg) \
+#define PCI_CONF1_MQ_ADDRESS(bus, dev, fn, reg) \
(0x80000000 | (BUS2LOCAL(bus) << 16) | (dev << 11) | (fn << 8) | (reg & ~3))
-static int pci_conf1_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
+static int __pci_conf1_mq_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
{
unsigned long flags;
@@ -22,7 +22,7 @@
spin_lock_irqsave(&pci_config_lock, flags);
- outl_quad(PCI_CONF1_ADDRESS(bus, dev, fn, reg), 0xCF8, BUS2QUAD(bus));
+ outl_quad(PCI_CONF1_MQ_ADDRESS(bus, dev, fn, reg), 0xCF8, BUS2QUAD(bus));
switch (len) {
case 1:
@@ -41,7 +41,7 @@
return 0;
}
-static int pci_conf1_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
+static int __pci_conf1_mq_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
{
unsigned long flags;
@@ -50,7 +50,7 @@
spin_lock_irqsave(&pci_config_lock, flags);
- outl_quad(PCI_CONF1_ADDRESS(bus, dev, fn, reg), 0xCF8, BUS2QUAD(bus));
+ outl_quad(PCI_CONF1_MQ_ADDRESS(bus, dev, fn, reg), 0xCF8, BUS2QUAD(bus));
switch (len) {
case 1:
@@ -69,6 +69,25 @@
return 0;
}
+#undef PCI_CONF1_MQ_ADDRESS
+
+static int pci_conf1_mq_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value)
+{
+ return __pci_conf1_mq_read(0, bus->number, PCI_SLOT(devfn),
+ PCI_FUNC(devfn), where, size, value);
+}
+
+static int pci_conf1_mq_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value)
+{
+ return __pci_conf1_mq_write(0, bus->number, PCI_SLOT(devfn),
+ PCI_FUNC(devfn), where, size, value);
+}
+
+static struct pci_ops pci_direct_conf1_mq = {
+ read: pci_conf1_mq_read,
+ write: pci_conf1_mq_write
+};
+
static void __devinit pci_fixup_i450nx(struct pci_dev *d)
{
@@ -102,8 +121,7 @@
{
int quad;
- pci_config_read = pci_conf1_read;
- pci_config_write = pci_conf1_write;
+ pci_root_ops = &pci_direct_conf1_mq;
if (pcibios_scanned++)
return 0;
diff -Nru a/arch/i386/pci/pcbios.c b/arch/i386/pci/pcbios.c
--- a/arch/i386/pci/pcbios.c Sat Aug 31 15:05:54 2002
+++ b/arch/i386/pci/pcbios.c Sat Aug 31 15:05:54 2002
@@ -185,7 +185,7 @@
return (int) (ret & 0xff00) >> 8;
}
-static int pci_bios_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
+static int __pci_bios_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
{
unsigned long result = 0;
unsigned long flags;
@@ -240,7 +240,7 @@
return (int)((result & 0xff00) >> 8);
}
-static int pci_bios_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
+static int __pci_bios_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
{
unsigned long result = 0;
unsigned long flags;
@@ -295,63 +295,16 @@
return (int)((result & 0xff00) >> 8);
}
-static int pci_bios_read_config_byte(struct pci_dev *dev, int where, u8 *value)
+static int pci_bios_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value)
{
- int result;
- u32 data;
-
- if (!value)
- return -EINVAL;
-
- result = pci_bios_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 1, &data);
-
- *value = (u8)data;
-
- return result;
-}
-
-static int pci_bios_read_config_word(struct pci_dev *dev, int where, u16 *value)
-{
- int result;
- u32 data;
-
- if (!value)
- return -EINVAL;
-
- result = pci_bios_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 2, &data);
-
- *value = (u16)data;
-
- return result;
-}
-
-static int pci_bios_read_config_dword(struct pci_dev *dev, int where, u32 *value)
-{
- if (!value)
- return -EINVAL;
-
- return pci_bios_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 4, value);
-}
-
-static int pci_bios_write_config_byte(struct pci_dev *dev, int where, u8 value)
-{
- return pci_bios_write(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 1, value);
-}
-
-static int pci_bios_write_config_word(struct pci_dev *dev, int where, u16 value)
-{
- return pci_bios_write(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 2, value);
+ return __pci_bios_read(0, bus->number, PCI_SLOT(devfn),
+ PCI_FUNC(devfn), where, size, value);
}
-static int pci_bios_write_config_dword(struct pci_dev *dev, int where, u32 value)
+static int pci_bios_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value)
{
- return pci_bios_write(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 4, value);
+ return __pci_bios_write(0, bus->number, PCI_SLOT(devfn),
+ PCI_FUNC(devfn), where, size, value);
}
@@ -360,12 +313,8 @@
*/
static struct pci_ops pci_bios_access = {
- pci_bios_read_config_byte,
- pci_bios_read_config_word,
- pci_bios_read_config_dword,
- pci_bios_write_config_byte,
- pci_bios_write_config_word,
- pci_bios_write_config_dword
+ .read = pci_bios_read,
+ .write = pci_bios_write
};
/*
@@ -551,8 +500,6 @@
&& ((pci_root_ops = pci_find_bios()))) {
pci_probe |= PCI_BIOS_SORT;
pci_bios_present = 1;
- pci_config_read = pci_bios_read;
- pci_config_write = pci_bios_write;
}
return 0;
}
diff -Nru a/arch/ia64/Makefile b/arch/ia64/Makefile
--- a/arch/ia64/Makefile Sat Aug 31 15:05:54 2002
+++ b/arch/ia64/Makefile Sat Aug 31 15:05:54 2002
@@ -96,7 +96,8 @@
vmlinux: arch/$(ARCH)/vmlinux.lds.s
-CPPFLAGS_arch/ia64/vmlinux.lds.s := -traditional
+arch/$(ARCH)/vmlinux.lds.s: arch/$(ARCH)/vmlinux.lds.S
+ $(CPP) $(CPPFLAGS) $(CPPFLAGS_$@) -D__ASSEMBLY__ -P -C -U$(ARCH) $< -o $@
compressed: vmlinux
$(OBJCOPY) $(OBJCOPYFLAGS) vmlinux vmlinux-tmp
diff -Nru a/arch/ia64/defconfig b/arch/ia64/defconfig
--- a/arch/ia64/defconfig Sat Aug 31 15:05:54 2002
+++ b/arch/ia64/defconfig Sat Aug 31 15:05:54 2002
@@ -628,6 +628,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c
--- a/arch/ia64/hp/common/sba_iommu.c Sat Aug 31 15:05:54 2002
+++ b/arch/ia64/hp/common/sba_iommu.c Sat Aug 31 15:05:54 2002
@@ -30,11 +30,11 @@
#include
#include
#include
+#include
#include /* ia64_get_itc() */
#include
#include /* PAGE_OFFSET */
-#include
#define DRIVER_NAME "SBA"
diff -Nru a/arch/ia64/hp/sim/simeth.c b/arch/ia64/hp/sim/simeth.c
--- a/arch/ia64/hp/sim/simeth.c Sat Aug 31 15:05:54 2002
+++ b/arch/ia64/hp/sim/simeth.c Sat Aug 31 15:05:54 2002
@@ -213,7 +213,7 @@
memcpy(dev->dev_addr, mac_addr, sizeof(mac_addr));
- dev->irq = ia64_alloc_irq();
+ dev->irq = ia64_alloc_vector();
/*
* attach the interrupt in the simulator, this does enable interrupts
diff -Nru a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c
--- a/arch/ia64/hp/sim/simserial.c Sat Aug 31 15:06:00 2002
+++ b/arch/ia64/hp/sim/simserial.c Sat Aug 31 15:06:00 2002
@@ -1076,7 +1076,7 @@
if (state->type == PORT_UNKNOWN) continue;
if (!state->irq) {
- state->irq = ia64_alloc_irq();
+ state->irq = ia64_alloc_vector();
ia64_ssc_connect_irq(KEYBOARD_INTR, state->irq);
}
diff -Nru a/arch/ia64/hp/zx1/hpzx1_misc.c b/arch/ia64/hp/zx1/hpzx1_misc.c
--- a/arch/ia64/hp/zx1/hpzx1_misc.c Sat Aug 31 15:05:59 2002
+++ b/arch/ia64/hp/zx1/hpzx1_misc.c Sat Aug 31 15:05:59 2002
@@ -12,9 +12,9 @@
#include
#include
#include
+#include
#include
-#include
#include
extern acpi_status acpi_evaluate_integer (acpi_handle, acpi_string, acpi_object_list *,
diff -Nru a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
--- a/arch/ia64/ia32/sys_ia32.c Sat Aug 31 15:06:01 2002
+++ b/arch/ia64/ia32/sys_ia32.c Sat Aug 31 15:06:03 2002
@@ -46,6 +46,7 @@
#include
#include
#include
+#include
#include
#include
diff -Nru a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
--- a/arch/ia64/kernel/acpi.c Sat Aug 31 15:06:00 2002
+++ b/arch/ia64/kernel/acpi.c Sat Aug 31 15:06:00 2002
@@ -37,7 +37,7 @@
#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -47,9 +47,9 @@
#define PREFIX "ACPI: "
-asm (".weak iosapic_register_irq");
-asm (".weak iosapic_register_legacy_irq");
-asm (".weak iosapic_register_platform_irq");
+asm (".weak iosapic_register_intr");
+asm (".weak iosapic_override_isa_irq");
+asm (".weak iosapic_register_platform_intr");
asm (".weak iosapic_init");
asm (".weak iosapic_version");
@@ -173,10 +173,10 @@
#ifdef CONFIG_ACPI_BOOT
-#define ACPI_MAX_PLATFORM_IRQS 256
+#define ACPI_MAX_PLATFORM_INTERRUPTS 256
/* Array to record platform interrupt vectors for generic interrupt routing. */
-int platform_irq_list[ACPI_MAX_PLATFORM_IRQS] = { [0 ... ACPI_MAX_PLATFORM_IRQS - 1] = -1 };
+int platform_intr_list[ACPI_MAX_PLATFORM_INTERRUPTS] = { [0 ... ACPI_MAX_PLATFORM_INTERRUPTS - 1] = -1 };
enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_IOSAPIC;
@@ -189,9 +189,9 @@
{
int vector = -1;
- if (int_type < ACPI_MAX_PLATFORM_IRQS) {
+ if (int_type < ACPI_MAX_PLATFORM_INTERRUPTS) {
/* correctable platform error interrupt */
- vector = platform_irq_list[int_type];
+ vector = platform_intr_list[int_type];
} else
printk("acpi_request_vector(): invalid interrupt type\n");
return vector;
@@ -210,6 +210,7 @@
static int total_cpus __initdata;
static int available_cpus __initdata;
struct acpi_table_madt * acpi_madt __initdata;
+static u8 has_8259;
static int __init
@@ -284,7 +285,7 @@
static int __init
-acpi_find_iosapic (int global_vector, u32 *irq_base, char **iosapic_address)
+acpi_find_iosapic (unsigned int gsi, u32 *gsi_base, char **iosapic_address)
{
struct acpi_table_iosapic *iosapic;
int ver;
@@ -292,7 +293,7 @@
char *p;
char *end;
- if (!irq_base || !iosapic_address)
+ if (!gsi_base || !iosapic_address)
return -ENODEV;
p = (char *) (acpi_madt + 1);
@@ -302,13 +303,13 @@
if (*p == ACPI_MADT_IOSAPIC) {
iosapic = (struct acpi_table_iosapic *) p;
- *irq_base = iosapic->global_irq_base;
+ *gsi_base = iosapic->global_irq_base;
*iosapic_address = ioremap(iosapic->address, 0);
ver = iosapic_version(*iosapic_address);
max_pin = (ver >> 16) & 0xff;
- if ((global_vector - *irq_base) <= max_pin)
+ if ((gsi - *gsi_base) <= max_pin)
return 0; /* Found it! */
}
p += p[1];
@@ -347,7 +348,7 @@
{
struct acpi_table_plat_int_src *plintsrc;
int vector;
- u32 irq_base;
+ u32 gsi_base;
char *iosapic_address;
plintsrc = (struct acpi_table_plat_int_src *) header;
@@ -356,31 +357,31 @@
acpi_table_print_madt_entry(header);
- if (!iosapic_register_platform_irq) {
- printk(KERN_WARNING PREFIX "No ACPI platform IRQ support\n");
+ if (!iosapic_register_platform_intr) {
+ printk(KERN_WARNING PREFIX "No ACPI platform interrupt support\n");
return -ENODEV;
}
- if (acpi_find_iosapic(plintsrc->global_irq, &irq_base, &iosapic_address)) {
+ if (acpi_find_iosapic(plintsrc->global_irq, &gsi_base, &iosapic_address)) {
printk(KERN_WARNING PREFIX "IOSAPIC not found\n");
return -ENODEV;
}
/*
- * Get vector assignment for this IRQ, set attributes, and program the
- * IOSAPIC routing table.
+ * Get vector assignment for this interrupt, set attributes,
+ * and program the IOSAPIC routing table.
*/
- vector = iosapic_register_platform_irq(plintsrc->type,
- plintsrc->global_irq,
- plintsrc->iosapic_vector,
- plintsrc->eid,
- plintsrc->id,
- (plintsrc->flags.polarity == 1) ? 1 : 0,
- (plintsrc->flags.trigger == 1) ? 1 : 0,
- irq_base,
- iosapic_address);
+ vector = iosapic_register_platform_intr(plintsrc->type,
+ plintsrc->global_irq,
+ plintsrc->iosapic_vector,
+ plintsrc->eid,
+ plintsrc->id,
+ (plintsrc->flags.polarity == 1) ? 1 : 0,
+ (plintsrc->flags.trigger == 1) ? 1 : 0,
+ gsi_base,
+ iosapic_address);
- platform_irq_list[plintsrc->type] = vector;
+ platform_intr_list[plintsrc->type] = vector;
return 0;
}
@@ -397,12 +398,12 @@
acpi_table_print_madt_entry(header);
/* Ignore if the platform doesn't support overrides */
- if (!iosapic_register_legacy_irq)
+ if (!iosapic_override_isa_irq)
return 0;
- iosapic_register_legacy_irq(p->bus_irq, p->global_irq,
- (p->flags.polarity == 1) ? 1 : 0,
- (p->flags.trigger == 1) ? 1 : 0);
+ iosapic_override_isa_irq(p->bus_irq, p->global_irq,
+ (p->flags.polarity == 1) ? 1 : 0,
+ (p->flags.trigger == 1) ? 1 : 0);
return 0;
}
@@ -431,6 +432,9 @@
acpi_madt = (struct acpi_table_madt *) __va(phys_addr);
+ /* remember the value for reference after free_initmem() */
+ has_8259 = acpi_madt->flags.pcat_compat;
+
/* Get base address of IPI Message Block */
if (acpi_madt->lapic_address)
@@ -440,11 +444,14 @@
return 0;
}
+
static int __init
acpi_parse_fadt (unsigned long phys_addr, unsigned long size)
{
struct acpi_table_header *fadt_header;
fadt_descriptor_rev2 *fadt;
+ u32 sci_irq, gsi_base;
+ char *iosapic_address;
if (!phys_addr || !size)
return -EINVAL;
@@ -458,9 +465,20 @@
if (!(fadt->iapc_boot_arch & BAF_8042_KEYBOARD_CONTROLLER))
acpi_kbd_controller_present = 0;
+ if (!iosapic_register_intr)
+ return 0; /* just ignore the rest */
+
+ sci_irq = fadt->sci_int;
+
+ if (has_8259 && sci_irq < 16)
+ return 0; /* legacy, no setup required */
+
+ if (!acpi_find_iosapic(sci_irq, &gsi_base, &iosapic_address))
+ iosapic_register_intr(sci_irq, 0, 0, gsi_base, iosapic_address);
return 0;
}
+
unsigned long __init
acpi_find_rsdp (void)
{
@@ -482,12 +500,12 @@
acpi_parse_spcr (unsigned long phys_addr, unsigned long size)
{
acpi_ser_t *spcr;
- unsigned long global_int;
+ unsigned int gsi;
if (!phys_addr || !size)
return -EINVAL;
- if (!iosapic_register_irq)
+ if (!iosapic_register_intr)
return -ENODEV;
/*
@@ -500,6 +518,7 @@
*/
spcr = (acpi_ser_t *) __va(phys_addr);
+
setup_serial_acpi(spcr);
if (spcr->length < sizeof(acpi_ser_t))
@@ -509,22 +528,22 @@
if ((spcr->base_addr.space_id != ACPI_SERIAL_PCICONF_SPACE) &&
(spcr->int_type == ACPI_SERIAL_INT_SAPIC))
{
- u32 irq_base;
+ u32 gsi_base;
char *iosapic_address;
int vector;
/* We have a UART in memory space with an SAPIC interrupt */
- global_int = ((spcr->global_int[3] << 24) |
- (spcr->global_int[2] << 16) |
- (spcr->global_int[1] << 8) |
- (spcr->global_int[0]) );
-
- /* Which iosapic does this IRQ belong to? */
-
- if (!acpi_find_iosapic(global_int, &irq_base, &iosapic_address))
- vector = iosapic_register_irq(global_int, 1, 1,
- irq_base, iosapic_address);
+ gsi = ( (spcr->global_int[3] << 24) |
+ (spcr->global_int[2] << 16) |
+ (spcr->global_int[1] << 8) |
+ (spcr->global_int[0]) );
+
+ /* Which iosapic does this interrupt belong to? */
+
+ if (!acpi_find_iosapic(gsi, &gsi_base, &iosapic_address))
+ vector = iosapic_register_intr(gsi, 1, 1,
+ gsi_base, iosapic_address);
}
return 0;
}
@@ -583,7 +602,12 @@
printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
skip_madt:
- /* FADT says whether a legacy keyboard controller is present. */
+ /*
+ * FADT says whether a legacy keyboard controller is present.
+ * The FADT also contains an SCI_INT line, by which the system
+ * gets interrupts such as power and sleep buttons. If it's not
+ * on a Legacy interrupt, it needs to be setup.
+ */
if (acpi_table_parse(ACPI_FACP, acpi_parse_fadt) < 1)
printk(KERN_ERR PREFIX "Can't find FADT\n");
@@ -631,7 +655,7 @@
*count = 0;
if (acpi_prt.count < 0) {
- printk(KERN_ERR PREFIX "No PCI IRQ routing entries\n");
+ printk(KERN_ERR PREFIX "No PCI interrupt routing entries\n");
return -ENODEV;
}
@@ -667,6 +691,15 @@
*type = ACPI_IRQ_MODEL_IOSAPIC;
return 0;
+}
+
+int
+acpi_irq_to_vector (u32 irq)
+{
+ if (has_8259 && irq < 16)
+ return isa_irq_to_vector(irq);
+
+ return gsi_to_vector(irq);
}
#endif /* CONFIG_ACPI_BOOT */
diff -Nru a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
--- a/arch/ia64/kernel/efi.c Sat Aug 31 15:05:54 2002
+++ b/arch/ia64/kernel/efi.c Sat Aug 31 15:05:54 2002
@@ -24,8 +24,8 @@
#include
#include
#include
+#include
-#include
#include
#include
#include
diff -Nru a/arch/ia64/kernel/efivars.c b/arch/ia64/kernel/efivars.c
--- a/arch/ia64/kernel/efivars.c Sat Aug 31 15:06:00 2002
+++ b/arch/ia64/kernel/efivars.c Sat Aug 31 15:06:00 2002
@@ -65,8 +65,8 @@
#include
#include
#include
+#include
-#include
#include
MODULE_AUTHOR("Matt Domsch ");
diff -Nru a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
--- a/arch/ia64/kernel/entry.S Sat Aug 31 15:05:55 2002
+++ b/arch/ia64/kernel/entry.S Sat Aug 31 15:05:55 2002
@@ -1229,11 +1229,11 @@
data8 ia64_ni_syscall // 1235
data8 ia64_ni_syscall
data8 ia64_ni_syscall
- data8 ia64_ni_syscall
- data8 ia64_ni_syscall
- data8 ia64_ni_syscall // 1240
- data8 ia64_ni_syscall
- data8 ia64_ni_syscall
+ data8 sys_io_setup
+ data8 sys_io_destroy
+ data8 sys_io_getevents // 1240
+ data8 sys_io_submit
+ data8 sys_io_cancel
data8 ia64_ni_syscall
data8 ia64_ni_syscall
data8 ia64_ni_syscall // 1245
diff -Nru a/arch/ia64/kernel/fw-emu.c b/arch/ia64/kernel/fw-emu.c
--- a/arch/ia64/kernel/fw-emu.c Sat Aug 31 15:05:54 2002
+++ b/arch/ia64/kernel/fw-emu.c Sat Aug 31 15:05:54 2002
@@ -13,7 +13,7 @@
# include
#endif
-#include
+#include
#include
#include
#include
diff -Nru a/arch/ia64/kernel/ia64_ksyms.c b/arch/ia64/kernel/ia64_ksyms.c
--- a/arch/ia64/kernel/ia64_ksyms.c Sat Aug 31 15:06:00 2002
+++ b/arch/ia64/kernel/ia64_ksyms.c Sat Aug 31 15:06:00 2002
@@ -58,7 +58,7 @@
#include
# ifndef CONFIG_NUMA
-EXPORT_SYMBOL(cpu_info);
+EXPORT_SYMBOL(cpu_info__per_cpu);
# endif
EXPORT_SYMBOL(kernel_thread);
diff -Nru a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c
--- a/arch/ia64/kernel/iosapic.c Sat Aug 31 15:06:00 2002
+++ b/arch/ia64/kernel/iosapic.c Sat Aug 31 15:06:00 2002
@@ -26,9 +26,12 @@
* 02/04/18 J.I. Lee bug fix in iosapic_init_pci_irq
* 02/04/30 J.I. Lee bug fix in find_iosapic to fix ACPI PCI IRQ to IOSAPIC mapping
* error
+ * 02/07/29 T. Kochi Allocate interrupt vectors dynamically
+ * 02/08/04 T. Kochi Cleaned up terminology (irq, global system interrupt, vector,
+ * etc.)
*/
/*
- * Here is what the interrupt logic between a PCI device and the CPU looks like:
+ * Here is what the interrupt logic between a PCI device and the kernel looks like:
*
* (1) A PCI device raises one of the four interrupt pins (INTA, INTB, INTC, INTD). The
* device is uniquely identified by its bus--, and slot-number (the function
@@ -37,19 +40,28 @@
*
* (2) The motherboard routes the interrupt line to a pin on a IOSAPIC controller.
* Multiple interrupt lines may have to share the same IOSAPIC pin (if they're level
- * triggered and use the same polarity). Each interrupt line has a unique IOSAPIC
- * irq number which can be calculated as the sum of the controller's base irq number
- * and the IOSAPIC pin number to which the line connects.
+ * triggered and use the same polarity). Each interrupt line has a unique Global
+ * System Interrupt (GSI) number which can be calculated as the sum of the controller's
+ * base GSI number and the IOSAPIC pin number to which the line connects.
*
- * (3) The IOSAPIC uses an internal table to map the IOSAPIC pin into the IA-64 interrupt
- * vector. This interrupt vector is then sent to the CPU.
+ * (3) The IOSAPIC uses an internal routing table entries (RTEs) to map the IOSAPIC pin
+ * into the IA-64 interrupt vector. This interrupt vector is then sent to the CPU.
*
- * In other words, there are two levels of indirections involved:
+ * (4) The kernel recognizes an interrupt as an IRQ. The IRQ interface is used as
+ * architecture-independent interrupt handling mechanism in Linux. As an
+ * IRQ is a number, we have to have IA-64 interrupt vector number <-> IRQ number
+ * mapping. On smaller systems, we use one-to-one mapping between IA-64 vector and
+ * IRQ. A platform can implemnent platform_irq_to_vector(irq) and
+ * platform_local_vector_to_irq(vector) APIs to differentiate the mapping.
+ * Please see also include/asm-ia64/hw_irq.h for those APIs.
*
- * pci pin -> iosapic irq -> IA-64 vector
+ * To sum up, there are three levels of mappings involved:
*
- * Note: outside this module, IA-64 vectors are called "irqs". This is because that's
- * the traditional name Linux uses for interrupt vectors.
+ * PCI pin -> global system interrupt (GSI) -> IA-64 vector <-> IRQ
+ *
+ * Note: The term "IRQ" is loosely used everywhere in Linux kernel to describe interrupts.
+ * Now we use "IRQ" only for Linux IRQ's. ISA IRQ (isa_irq) is the only exception in this
+ * source code.
*/
#include
@@ -72,49 +84,55 @@
#include
-#undef DEBUG_IRQ_ROUTING
+#undef DEBUG_INTERRUPT_ROUTING
#undef OVERRIDE_DEBUG
+#ifdef DEBUG_INTERRUPT_ROUTING
+#define DBG(fmt...) printk(fmt)
+#else
+#define DBG(fmt...)
+#endif
+
static spinlock_t iosapic_lock = SPIN_LOCK_UNLOCKED;
-/* PCI pin to IOSAPIC irq routing information. This info typically comes from ACPI. */
+/* PCI pin to GSI routing information. This info typically comes from ACPI. */
static struct {
int num_routes;
struct pci_vector_struct *route;
} pci_irq;
-/* This tables maps IA-64 vectors to the IOSAPIC pin that generates this vector. */
+/* These tables map IA-64 vectors to the IOSAPIC pin that generates this vector. */
-static struct iosapic_irq {
- char *addr; /* base address of IOSAPIC */
- unsigned int base_irq; /* first irq assigned to this IOSAPIC */
- char pin; /* IOSAPIC pin (-1 => not an IOSAPIC irq) */
- unsigned char dmode : 3; /* delivery mode (see iosapic.h) */
- unsigned char polarity : 1; /* interrupt polarity (see iosapic.h) */
- unsigned char trigger : 1; /* trigger mode (see iosapic.h) */
-} iosapic_irq[IA64_NUM_VECTORS];
+static struct iosapic_intr_info {
+ char *addr; /* base address of IOSAPIC */
+ unsigned int gsi_base; /* first GSI assigned to this IOSAPIC */
+ char rte_index; /* IOSAPIC RTE index (-1 => not an IOSAPIC interrupt) */
+ unsigned char dmode : 3; /* delivery mode (see iosapic.h) */
+ unsigned char polarity: 1; /* interrupt polarity (see iosapic.h) */
+ unsigned char trigger : 1; /* trigger mode (see iosapic.h) */
+} iosapic_intr_info[IA64_NUM_VECTORS];
static struct iosapic {
- char *addr; /* base address of IOSAPIC */
- unsigned int base_irq; /* first irq assigned to this IOSAPIC */
- unsigned short max_pin; /* max input pin supported in this IOSAPIC */
+ char *addr; /* base address of IOSAPIC */
+ unsigned int gsi_base; /* first GSI assigned to this IOSAPIC */
+ unsigned short num_rte; /* number of RTE in this IOSAPIC */
unsigned char pcat_compat; /* 8259 compatibility flag */
-} iosapic_lists[256] __initdata;
+} iosapic_lists[256] __devinitdata;
static int num_iosapic = 0;
/*
- * Find an IOSAPIC associated with an IRQ
+ * Find an IOSAPIC associated with a GSI
*/
-static inline int __init
-find_iosapic (unsigned int irq)
+static inline int __devinit
+find_iosapic (unsigned int gsi)
{
int i;
for (i = 0; i < num_iosapic; i++) {
- if ((unsigned) (irq - iosapic_lists[i].base_irq) <= iosapic_lists[i].max_pin)
+ if ((unsigned) (gsi - iosapic_lists[i].gsi_base) < iosapic_lists[i].num_rte)
return i;
}
@@ -122,60 +140,51 @@
}
/*
- * Translate IOSAPIC irq number to the corresponding IA-64 interrupt vector. If no
+ * Translate GSI number to the corresponding IA-64 interrupt vector. If no
* entry exists, return -1.
*/
-static int
-iosapic_irq_to_vector (int irq)
+int
+gsi_to_vector (unsigned int gsi)
{
int vector;
for (vector = 0; vector < IA64_NUM_VECTORS; ++vector)
- if (iosapic_irq[vector].base_irq + iosapic_irq[vector].pin == irq)
+ if (iosapic_intr_info[vector].gsi_base + iosapic_intr_info[vector].rte_index == gsi)
return vector;
return -1;
}
-/*
- * Map PCI pin to the corresponding IA-64 interrupt vector. If no such mapping exists,
- * return -1.
- */
-int
-pci_pin_to_vector (int bus, int slot, int pci_pin)
-{
- struct pci_vector_struct *r;
-
- for (r = pci_irq.route; r < pci_irq.route + pci_irq.num_routes; ++r)
- if (r->bus == bus && (r->pci_id >> 16) == slot && r->pin == pci_pin)
- return iosapic_irq_to_vector(r->irq);
- return -1;
-}
-
static void
-set_rte (unsigned int vector, unsigned long dest)
+set_rte (unsigned int vector, unsigned int dest)
{
unsigned long pol, trigger, dmode;
u32 low32, high32;
char *addr;
- int pin;
+ int rte_index;
char redir;
-#ifdef DEBUG_IRQ_ROUTING
- printk(KERN_DEBUG "set_rte: routing vector 0x%02x to 0x%lx\n", vector, dest);
-#endif
+ DBG(KERN_DEBUG "%s: routing vector %d to %x\n", __FUNCTION__, vector, dest);
- pin = iosapic_irq[vector].pin;
- if (pin < 0)
+ rte_index = iosapic_intr_info[vector].rte_index;
+ if (rte_index < 0)
return; /* not an IOSAPIC interrupt */
- addr = iosapic_irq[vector].addr;
- pol = iosapic_irq[vector].polarity;
- trigger = iosapic_irq[vector].trigger;
- dmode = iosapic_irq[vector].dmode;
+ addr = iosapic_intr_info[vector].addr;
+ pol = iosapic_intr_info[vector].polarity;
+ trigger = iosapic_intr_info[vector].trigger;
+ dmode = iosapic_intr_info[vector].dmode;
redir = (dmode == IOSAPIC_LOWEST_PRIORITY) ? 1 : 0;
#ifdef CONFIG_SMP
- set_irq_affinity_info(vector, (int)(dest & 0xffff), redir);
+ {
+ unsigned int irq;
+
+ for (irq = 0; irq < NR_IRQS; ++irq)
+ if (irq_to_vector(irq) == vector) {
+ set_irq_affinity_info(irq, (int)(dest & 0xffff), redir);
+ break;
+ }
+ }
#endif
low32 = ((pol << IOSAPIC_POLARITY_SHIFT) |
@@ -186,9 +195,9 @@
/* dest contains both id and eid */
high32 = (dest << IOSAPIC_DEST_SHIFT);
- writel(IOSAPIC_RTE_HIGH(pin), addr + IOSAPIC_REG_SELECT);
+ writel(IOSAPIC_RTE_HIGH(rte_index), addr + IOSAPIC_REG_SELECT);
writel(high32, addr + IOSAPIC_WINDOW);
- writel(IOSAPIC_RTE_LOW(pin), addr + IOSAPIC_REG_SELECT);
+ writel(IOSAPIC_RTE_LOW(rte_index), addr + IOSAPIC_REG_SELECT);
writel(low32, addr + IOSAPIC_WINDOW);
}
@@ -204,18 +213,18 @@
unsigned long flags;
char *addr;
u32 low32;
- int pin;
+ int rte_index;
ia64_vector vec = irq_to_vector(irq);
- addr = iosapic_irq[vec].addr;
- pin = iosapic_irq[vec].pin;
+ addr = iosapic_intr_info[vec].addr;
+ rte_index = iosapic_intr_info[vec].rte_index;
- if (pin < 0)
+ if (rte_index < 0)
return; /* not an IOSAPIC interrupt! */
spin_lock_irqsave(&iosapic_lock, flags);
{
- writel(IOSAPIC_RTE_LOW(pin), addr + IOSAPIC_REG_SELECT);
+ writel(IOSAPIC_RTE_LOW(rte_index), addr + IOSAPIC_REG_SELECT);
low32 = readl(addr + IOSAPIC_WINDOW);
low32 |= (1 << IOSAPIC_MASK_SHIFT); /* set only the mask bit */
@@ -230,17 +239,17 @@
unsigned long flags;
char *addr;
u32 low32;
- int pin;
+ int rte_index;
ia64_vector vec = irq_to_vector(irq);
- addr = iosapic_irq[vec].addr;
- pin = iosapic_irq[vec].pin;
- if (pin < 0)
+ addr = iosapic_intr_info[vec].addr;
+ rte_index = iosapic_intr_info[vec].rte_index;
+ if (rte_index < 0)
return; /* not an IOSAPIC interrupt! */
spin_lock_irqsave(&iosapic_lock, flags);
{
- writel(IOSAPIC_RTE_LOW(pin), addr + IOSAPIC_REG_SELECT);
+ writel(IOSAPIC_RTE_LOW(rte_index), addr + IOSAPIC_REG_SELECT);
low32 = readl(addr + IOSAPIC_WINDOW);
low32 &= ~(1 << IOSAPIC_MASK_SHIFT); /* clear only the mask bit */
@@ -256,24 +265,28 @@
#ifdef CONFIG_SMP
unsigned long flags;
u32 high32, low32;
- int dest, pin;
+ int dest, rte_index;
char *addr;
- int redir = (irq & (1<<31)) ? 1 : 0;
+ int redir = (irq & IA64_IRQ_REDIRECTED) ? 1 : 0;
+ ia64_vector vec;
+
+ irq &= (~IA64_IRQ_REDIRECTED);
+ vec = irq_to_vector(irq);
mask &= cpu_online_map;
- if (!mask || irq >= IA64_NUM_VECTORS)
+ if (!mask || vec >= IA64_NUM_VECTORS)
return;
dest = cpu_physical_id(ffz(~mask));
- pin = iosapic_irq[irq].pin;
- addr = iosapic_irq[irq].addr;
+ rte_index = iosapic_intr_info[vec].rte_index;
+ addr = iosapic_intr_info[vec].addr;
- if (pin < 0)
+ if (rte_index < 0)
return; /* not an IOSAPIC interrupt */
- set_irq_affinity_info(irq,dest,redir);
+ set_irq_affinity_info(irq, dest, redir);
/* dest contains both id and eid */
high32 = dest << IOSAPIC_DEST_SHIFT;
@@ -281,7 +294,7 @@
spin_lock_irqsave(&iosapic_lock, flags);
{
/* get current delivery mode by reading the low32 */
- writel(IOSAPIC_RTE_LOW(pin), addr + IOSAPIC_REG_SELECT);
+ writel(IOSAPIC_RTE_LOW(rte_index), addr + IOSAPIC_REG_SELECT);
low32 = readl(addr + IOSAPIC_WINDOW);
low32 &= ~(7 << IOSAPIC_DELIVERY_SHIFT);
@@ -292,9 +305,9 @@
/* change delivery mode to fixed */
low32 |= (IOSAPIC_FIXED << IOSAPIC_DELIVERY_SHIFT);
- writel(IOSAPIC_RTE_HIGH(pin), addr + IOSAPIC_REG_SELECT);
+ writel(IOSAPIC_RTE_HIGH(rte_index), addr + IOSAPIC_REG_SELECT);
writel(high32, addr + IOSAPIC_WINDOW);
- writel(IOSAPIC_RTE_LOW(pin), addr + IOSAPIC_REG_SELECT);
+ writel(IOSAPIC_RTE_LOW(rte_index), addr + IOSAPIC_REG_SELECT);
writel(low32, addr + IOSAPIC_WINDOW);
}
spin_unlock_irqrestore(&iosapic_lock, flags);
@@ -317,7 +330,7 @@
{
ia64_vector vec = irq_to_vector(irq);
- writel(vec, iosapic_irq[vec].addr + IOSAPIC_EOI);
+ writel(vec, iosapic_intr_info[vec].addr + IOSAPIC_EOI);
}
#define iosapic_shutdown_level_irq mask_irq
@@ -388,7 +401,7 @@
* {
* unsigned int version : 8;
* unsigned int reserved1 : 8;
- * unsigned int pins : 8;
+ * unsigned int max_redir : 8;
* unsigned int reserved2 : 8;
* }
*/
@@ -405,70 +418,72 @@
{
int new_vector;
- if (iosapic_irq[vector].pin >= 0 || iosapic_irq[vector].addr
- || iosapic_irq[vector].base_irq || iosapic_irq[vector].dmode
- || iosapic_irq[vector].polarity || iosapic_irq[vector].trigger)
+ if (iosapic_intr_info[vector].rte_index >= 0 || iosapic_intr_info[vector].addr
+ || iosapic_intr_info[vector].gsi_base || iosapic_intr_info[vector].dmode
+ || iosapic_intr_info[vector].polarity || iosapic_intr_info[vector].trigger)
{
- new_vector = ia64_alloc_irq();
- printk("Reassigning vector 0x%x to 0x%x\n", vector, new_vector);
- memcpy (&iosapic_irq[new_vector], &iosapic_irq[vector],
- sizeof(struct iosapic_irq));
- memset (&iosapic_irq[vector], 0, sizeof(struct iosapic_irq));
- iosapic_irq[vector].pin = -1;
+ new_vector = ia64_alloc_vector();
+ printk("Reassigning vector %d to %d\n", vector, new_vector);
+ memcpy(&iosapic_intr_info[new_vector], &iosapic_intr_info[vector],
+ sizeof(struct iosapic_intr_info));
+ memset(&iosapic_intr_info[vector], 0, sizeof(struct iosapic_intr_info));
+ iosapic_intr_info[vector].rte_index = -1;
}
}
static void
-register_irq (u32 global_vector, int vector, int pin, unsigned char delivery,
- unsigned long polarity, unsigned long edge_triggered,
- u32 base_irq, char *iosapic_address)
+register_intr (unsigned int gsi, int vector, unsigned char delivery,
+ unsigned long polarity, unsigned long edge_triggered,
+ unsigned int gsi_base, char *iosapic_address)
{
irq_desc_t *idesc;
struct hw_interrupt_type *irq_type;
+ int rte_index;
- gsi_to_vector(global_vector) = vector;
- iosapic_irq[vector].pin = pin;
- iosapic_irq[vector].polarity = polarity ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW;
- iosapic_irq[vector].dmode = delivery;
+ rte_index = gsi - gsi_base;
+ iosapic_intr_info[vector].rte_index = rte_index;
+ iosapic_intr_info[vector].polarity = polarity ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW;
+ iosapic_intr_info[vector].dmode = delivery;
/*
- * In override, it does not provide addr/base_irq. global_vector is enough to
- * locate iosapic addr, base_irq and pin by examining base_irq and max_pin of
- * registered iosapics (tbd)
+ * In override, it may not provide addr/gsi_base. GSI is enough to
+ * locate iosapic addr, gsi_base and rte_index by examining
+ * gsi_base and num_rte of registered iosapics (tbd)
*/
#ifndef OVERRIDE_DEBUG
if (iosapic_address) {
- iosapic_irq[vector].addr = iosapic_address;
- iosapic_irq[vector].base_irq = base_irq;
+ iosapic_intr_info[vector].addr = iosapic_address;
+ iosapic_intr_info[vector].gsi_base = gsi_base;
}
#else
if (iosapic_address) {
- if (iosapic_irq[vector].addr && (iosapic_irq[vector].addr != iosapic_address))
- printk("WARN: register_irq: diff IOSAPIC ADDRESS for gv %x, v %x\n",
- global_vector, vector);
- iosapic_irq[vector].addr = iosapic_address;
- if (iosapic_irq[vector].base_irq && (iosapic_irq[vector].base_irq != base_irq)) {
- printk("WARN: register_irq: diff BASE IRQ %x for gv %x, v %x\n",
- base_irq, global_vector, vector);
+ if (iosapic_intr_info[vector].addr && (iosapic_intr_info[vector].addr != iosapic_address))
+ printk("WARN: register_intr: diff IOSAPIC ADDRESS for GSI 0x%x, vector %d\n",
+ gsi, vector);
+ iosapic_intr_info[vector].addr = iosapic_address;
+ if (iosapic_intr_info[vector].gsi_base && (iosapic_intr_info[vector].gsi_base != gsi_base)) {
+ printk("WARN: register_intr: diff GSI base 0x%x for GSI 0x%x, vector %d\n",
+ gsi_base, gsi, vector);
}
- iosapic_irq[vector].base_irq = base_irq;
- } else if (!iosapic_irq[vector].addr)
- printk("WARN: register_irq: invalid override for gv %x, v %x\n",
- global_vector, vector);
+ iosapic_intr_info[vector].gsi_base = gsi_base;
+ } else if (!iosapic_intr_info[vector].addr)
+ printk("WARN: register_intr: invalid override for GSI 0x%x, vector %d\n",
+ gsi, vector);
#endif
if (edge_triggered) {
- iosapic_irq[vector].trigger = IOSAPIC_EDGE;
+ iosapic_intr_info[vector].trigger = IOSAPIC_EDGE;
irq_type = &irq_type_iosapic_edge;
} else {
- iosapic_irq[vector].trigger = IOSAPIC_LEVEL;
+ iosapic_intr_info[vector].trigger = IOSAPIC_LEVEL;
irq_type = &irq_type_iosapic_level;
}
idesc = irq_desc(vector);
if (idesc->handler != irq_type) {
if (idesc->handler != &no_irq_type)
- printk("register_irq(): changing vector 0x%02x from "
- "%s to %s\n", vector, idesc->handler->typename, irq_type->typename);
+ printk("%s: changing vector %d from %s to %s\n",
+ __FUNCTION__, vector, idesc->handler->typename,
+ irq_type->typename);
idesc->handler = irq_type;
}
}
@@ -479,24 +494,26 @@
* program the IOSAPIC RTE.
*/
int
-iosapic_register_irq (u32 global_vector, unsigned long polarity, unsigned long
- edge_triggered, u32 base_irq, char *iosapic_address)
+iosapic_register_intr (unsigned int gsi,
+ unsigned long polarity, unsigned long edge_triggered,
+ unsigned int gsi_base, char *iosapic_address)
{
int vector;
+ unsigned int dest = (ia64_get_lid() >> 16) & 0xffff;
- vector = iosapic_irq_to_vector(global_vector);
+ vector = gsi_to_vector(gsi);
if (vector < 0)
- vector = ia64_alloc_irq();
+ vector = ia64_alloc_vector();
- register_irq (global_vector, vector, global_vector - base_irq,
- IOSAPIC_LOWEST_PRIORITY, polarity, edge_triggered,
- base_irq, iosapic_address);
+ register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY,
+ polarity, edge_triggered, gsi_base, iosapic_address);
- printk("IOSAPIC 0x%x(%s,%s) -> Vector 0x%x\n", global_vector,
- (polarity ? "high" : "low"), (edge_triggered ? "edge" : "level"), vector);
+ printk("GSI 0x%x(%s,%s) -> CPU 0x%04x vector %d\n",
+ gsi, (polarity ? "high" : "low"),
+ (edge_triggered ? "edge" : "level"), dest, vector);
/* program the IOSAPIC routing table */
- set_rte(vector, (ia64_get_lid() >> 16) & 0xffff);
+ set_rte(vector, dest);
return vector;
}
@@ -505,12 +522,14 @@
* Note that the irq_base and IOSAPIC address must be set in iosapic_init().
*/
int
-iosapic_register_platform_irq (u32 int_type, u32 global_vector,
- u32 iosapic_vector, u16 eid, u16 id, unsigned long polarity,
- unsigned long edge_triggered, u32 base_irq, char *iosapic_address)
+iosapic_register_platform_intr (u32 int_type, unsigned int gsi,
+ int iosapic_vector, u16 eid, u16 id,
+ unsigned long polarity, unsigned long edge_triggered,
+ unsigned int gsi_base, char *iosapic_address)
{
unsigned char delivery;
int vector;
+ unsigned int dest = ((id << 8) | eid) & 0xffff;
switch (int_type) {
case ACPI_INTERRUPT_PMI:
@@ -523,7 +542,7 @@
delivery = IOSAPIC_PMI;
break;
case ACPI_INTERRUPT_INIT:
- vector = ia64_alloc_irq();
+ vector = ia64_alloc_vector();
delivery = IOSAPIC_INIT;
break;
case ACPI_INTERRUPT_CPEI:
@@ -535,56 +554,137 @@
return -1;
}
- register_irq(global_vector, vector, global_vector - base_irq, delivery, polarity,
- edge_triggered, base_irq, iosapic_address);
+ register_intr(gsi, vector, delivery, polarity,
+ edge_triggered, gsi_base, iosapic_address);
- printk("PLATFORM int 0x%x: IOSAPIC 0x%x(%s,%s) -> Vector 0x%x CPU %.02u:%.02u\n",
- int_type, global_vector, (polarity ? "high" : "low"),
- (edge_triggered ? "edge" : "level"), vector, eid, id);
+ printk("PLATFORM int 0x%x: GSI 0x%x(%s,%s) -> CPU 0x%04x vector %d\n",
+ int_type, gsi, (polarity ? "high" : "low"),
+ (edge_triggered ? "edge" : "level"), dest, vector);
/* program the IOSAPIC routing table */
- set_rte(vector, ((id << 8) | eid) & 0xffff);
+ set_rte(vector, dest);
return vector;
}
/*
- * ACPI calls this when it finds an entry for a legacy ISA interrupt.
- * Note that the irq_base and IOSAPIC address must be set in iosapic_init().
+ * ACPI calls this when it finds an entry for a legacy ISA IRQ override.
+ * Note that the gsi_base and IOSAPIC address must be set in iosapic_init().
*/
void
-iosapic_register_legacy_irq (unsigned long irq,
- unsigned long pin, unsigned long polarity,
- unsigned long edge_triggered)
-{
- int vector = isa_irq_to_vector(irq);
-
- register_irq(irq, vector, (int)pin, IOSAPIC_LOWEST_PRIORITY, polarity, edge_triggered,
- 0, NULL); /* ignored for override */
-
-#ifdef DEBUG_IRQ_ROUTING
- printk("ISA: IRQ %u -> IOSAPIC irq 0x%02x (%s, %s) -> vector %02x\n",
- (unsigned) irq, (unsigned) pin,
- polarity ? "high" : "low", edge_triggered ? "edge" : "level",
- vector);
-#endif
+iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi,
+ unsigned long polarity,
+ unsigned long edge_triggered)
+{
+ int index, vector;
+ unsigned int gsi_base;
+ char *addr;
+ unsigned int dest = (ia64_get_lid() >> 16) & 0xffff;
+
+ index = find_iosapic(gsi);
+
+ if (index < 0) {
+ printk("ISA: No corresponding IOSAPIC found : ISA IRQ %u -> GSI 0x%x\n", isa_irq, gsi);
+ return;
+ }
+
+ vector = isa_irq_to_vector(isa_irq);
+ addr = iosapic_lists[index].addr;
+ gsi_base = iosapic_lists[index].gsi_base;
+
+ register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY, polarity, edge_triggered,
+ gsi_base, addr);
+
+ DBG("ISA: IRQ %u -> GSI 0x%x (%s,%s) -> CPU 0x%04x vector %d\n",
+ isa_irq, gsi,
+ polarity ? "high" : "low", edge_triggered ? "edge" : "level",
+ dest, vector);
/* program the IOSAPIC routing table */
- set_rte(vector, (ia64_get_lid() >> 16) & 0xffff);
+ set_rte(vector, dest);
+}
+
+/*
+ * Map PCI pin to the corresponding GSI.
+ * If no such mapping exists, return -1.
+ */
+static int
+pci_pin_to_gsi (int bus, int slot, int pci_pin, unsigned int *gsi)
+{
+ struct pci_vector_struct *r;
+
+ for (r = pci_irq.route; r < pci_irq.route + pci_irq.num_routes; ++r)
+ if (r->bus == bus &&
+ (r->pci_id >> 16) == slot && r->pin == pci_pin) {
+ *gsi = r->irq;
+ return 0;
+ }
+
+ return -1;
+}
+
+/*
+ * Map PCI pin to the corresponding IA-64 interrupt vector. If no such mapping exists,
+ * try to allocate a new vector. If it fails, return -1.
+ */
+static int
+pci_pin_to_vector (int bus, int slot, int pci_pin)
+{
+ int index, vector;
+ int gsi_base, pcat_compat;
+ char *addr;
+ unsigned int gsi;
+
+ if (pci_pin_to_gsi(bus, slot, pci_pin, &gsi) < 0) {
+ printk("PCI: no interrupt route for %02x:%02x pin %c\n", bus, slot, 'A' + pci_pin);
+ return -1;
+ }
+
+ vector = gsi_to_vector(gsi);
+
+ if (vector < 0) {
+ /* we should allocate a vector for this interrupt line */
+
+ index = find_iosapic(gsi);
+
+ if (index < 0) {
+ printk("PCI: GSI 0x%x has no IOSAPIC mapping\n", gsi);
+ return -1;
+ }
+
+ addr = iosapic_lists[index].addr;
+ gsi_base = iosapic_lists[index].gsi_base;
+ pcat_compat = iosapic_lists[index].pcat_compat;
+
+ if (pcat_compat && (gsi < 16))
+ vector = isa_irq_to_vector(gsi);
+ else {
+ /* new GSI; allocate a vector for it */
+ vector = ia64_alloc_vector();
+ }
+
+ register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY,
+ 0, 0, gsi_base, addr);
+
+ DBG("PCI: (%02x:%02x INT%c) -> GSI 0x%x -> vector %d\n",
+ bus, slot, 'A' + pci_pin, gsi, vector);
+ }
+
+ return vector;
}
-void __init
-iosapic_init (unsigned long phys_addr, unsigned int base_irq, int pcat_compat)
+void __devinit
+iosapic_init (unsigned long phys_addr, unsigned int gsi_base, int pcat_compat)
{
- int irq, max_pin, vector, pin;
- unsigned int ver;
+ int num_rte, vector;
+ unsigned int isa_irq, ver;
char *addr;
static int first_time = 1;
if (first_time) {
first_time = 0;
for (vector = 0; vector < IA64_NUM_VECTORS; ++vector)
- iosapic_irq[vector].pin = -1; /* mark as unused */
+ iosapic_intr_info[vector].rte_index = -1; /* mark as unused */
}
if (pcat_compat) {
@@ -599,109 +699,148 @@
addr = ioremap(phys_addr, 0);
ver = iosapic_version(addr);
- max_pin = (ver >> 16) & 0xff;
+
+ /*
+ * The MAX_REDIR register holds the highest input pin
+ * number (starting from 0).
+ * We add 1 so that we can use it for number of pins (= RTEs)
+ */
+ num_rte = ((ver >> 16) & 0xff) + 1;
iosapic_lists[num_iosapic].addr = addr;
iosapic_lists[num_iosapic].pcat_compat = pcat_compat;
- iosapic_lists[num_iosapic].base_irq = base_irq;
- iosapic_lists[num_iosapic].max_pin = max_pin;
+ iosapic_lists[num_iosapic].gsi_base = gsi_base;
+ iosapic_lists[num_iosapic].num_rte = num_rte;
num_iosapic++;
- printk("IOSAPIC: version %x.%x, address 0x%lx, IRQs 0x%02x-0x%02x\n",
- (ver & 0xf0) >> 4, (ver & 0x0f), phys_addr, base_irq, base_irq + max_pin);
+ printk("IOSAPIC: version %x.%x, address 0x%lx, GSIs 0x%x-0x%x\n",
+ (ver & 0xf0) >> 4, (ver & 0x0f), phys_addr, gsi_base, gsi_base + num_rte - 1);
+
+ if ((gsi_base == 0) && pcat_compat) {
+ unsigned int dest = (ia64_get_lid() >> 16) & 0xffff;
- if ((base_irq == 0) && pcat_compat) {
/*
* Map the legacy ISA devices into the IOSAPIC data. Some of these may
* get reprogrammed later on with data from the ACPI Interrupt Source
* Override table.
*/
- for (irq = 0; irq < 16; ++irq) {
- vector = isa_irq_to_vector(irq);
- if ((pin = iosapic_irq[vector].pin) == -1)
- pin = irq;
+ for (isa_irq = 0; isa_irq < 16; ++isa_irq) {
+ vector = isa_irq_to_vector(isa_irq);
- register_irq(irq, vector, pin,
+ register_intr(isa_irq, vector, IOSAPIC_LOWEST_PRIORITY,
/* IOSAPIC_POL_HIGH, IOSAPIC_EDGE */
- IOSAPIC_LOWEST_PRIORITY, 1, 1, base_irq, addr);
+ 1, 1, gsi_base, addr);
-#ifdef DEBUG_IRQ_ROUTING
- printk("ISA: IRQ %u -> IOSAPIC irq 0x%02x (high, edge) -> vector 0x%02x\n",
- irq, iosapic_irq[vector].base_irq + iosapic_irq[vector].pin,
- vector);
-#endif
+ DBG("ISA: IRQ %u -> GSI 0x%x (high,edge) -> CPU 0x%04x vector %d\n",
+ isa_irq, isa_irq, dest, vector);
/* program the IOSAPIC routing table: */
- set_rte(vector, (ia64_get_lid() >> 16) & 0xffff);
+ set_rte(vector, dest);
}
}
}
-static void __init
-iosapic_init_pci_irq (void)
-{
- int i, index, vector, pin;
- int base_irq, max_pin, pcat_compat;
- unsigned int irq;
- char *addr;
-
- if (acpi_get_prt(&pci_irq.route, &pci_irq.num_routes))
- return;
-
- for (i = 0; i < pci_irq.num_routes; i++) {
- irq = pci_irq.route[i].irq;
+/*
+ * Set allocated interrupt vector to dev->irq and
+ * program IOSAPIC to deliver interrupts
+ */
+void
+iosapic_fixup_pci_interrupt (struct pci_dev *dev)
+{
+ unsigned char pci_pin;
+ int vector;
+ unsigned int dest;
+ struct hw_interrupt_type *irq_type;
+ irq_desc_t *idesc;
- index = find_iosapic(irq);
- if (index < 0) {
- printk("PCI: IRQ %u has no IOSAPIC mapping\n", irq);
- continue;
+ pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pci_pin);
+ if (pci_pin) {
+ pci_pin--; /* interrupt pins are numberd starting from 1 */
+
+ vector = pci_pin_to_vector(dev->bus->number, PCI_SLOT(dev->devfn), pci_pin);
+
+ if (vector < 0 && dev->bus->parent) {
+ /* go back to the bridge */
+ struct pci_dev *bridge = dev->bus->self;
+
+ if (bridge) {
+ /* allow for multiple bridges on an adapter */
+ do {
+ /* do the bridge swizzle... */
+ pci_pin = (pci_pin + PCI_SLOT(dev->devfn)) % 4;
+ vector = pci_pin_to_vector(bridge->bus->number,
+ PCI_SLOT(bridge->devfn),
+ pci_pin);
+ } while (vector < 0 && (bridge = bridge->bus->self));
+ }
+ if (vector >= 0)
+ printk(KERN_WARNING
+ "PCI: using PPB (%s INT%c) to get vector %d\n",
+ dev->slot_name, 'A' + pci_pin,
+ vector);
+ else
+ printk(KERN_WARNING
+ "PCI: Couldn't map irq for (%s INT%c)\n",
+ dev->slot_name, 'A' + pci_pin);
}
- addr = iosapic_lists[index].addr;
- base_irq = iosapic_lists[index].base_irq;
- max_pin = iosapic_lists[index].max_pin;
- pcat_compat = iosapic_lists[index].pcat_compat;
- pin = irq - base_irq;
-
- if ((unsigned) pin > max_pin)
- /* the interrupt route is for another controller... */
- continue;
+ if (vector >= 0) {
+ dev->irq = vector;
- if (pcat_compat && (irq < 16))
- vector = isa_irq_to_vector(irq);
- else {
- vector = iosapic_irq_to_vector(irq);
- if (vector < 0)
- /* new iosapic irq: allocate a vector for it */
- vector = ia64_alloc_irq();
- }
-
- register_irq(irq, vector, pin, IOSAPIC_LOWEST_PRIORITY, 0, 0, base_irq, addr);
+ irq_type = &irq_type_iosapic_level;
+ idesc = irq_desc(vector);
+ if (idesc->handler != irq_type) {
+ if (idesc->handler != &no_irq_type)
+ printk("%s: changing vector %d from %s to %s\n",
+ __FUNCTION__, vector,
+ idesc->handler->typename,
+ irq_type->typename);
+ idesc->handler = irq_type;
+ }
+#ifdef CONFIG_SMP
+ /*
+ * For platforms that do not support interrupt redirect
+ * via the XTP interface, we can round-robin the PCI
+ * device interrupts to the processors
+ */
+ if (!(smp_int_redirect & SMP_IRQ_REDIRECTION)) {
+ static int cpu_index = 0;
+
+ while (!cpu_online(cpu_index))
+ if (++cpu_index >= NR_CPUS)
+ cpu_index = 0;
-#ifdef DEBUG_IRQ_ROUTING
- printk("PCI: (B%d,I%d,P%d) -> IOSAPIC irq 0x%02x -> vector 0x%02x\n",
- pci_irq.route[i].bus, pci_irq.route[i].pci_id>>16, pci_irq.route[i].pin,
- iosapic_irq[vector].base_irq + iosapic_irq[vector].pin, vector);
+ dest = cpu_physical_id(cpu_index) & 0xffff;
+ } else {
+ /*
+ * Direct the interrupt vector to the current cpu,
+ * platform redirection will distribute them.
+ */
+ dest = (ia64_get_lid() >> 16) & 0xffff;
+ }
+#else
+ /* direct the interrupt vector to the running cpu id */
+ dest = (ia64_get_lid() >> 16) & 0xffff;
#endif
- /*
- * NOTE: The IOSAPIC RTE will be programmed in iosapic_pci_fixup(). It
- * needs to be done there to ensure PCI hotplug works right.
- */
+
+ printk("PCI->APIC IRQ transform: (%s INT%c) -> CPU 0x%04x vector %d\n",
+ dev->slot_name, 'A' + pci_pin, dest, vector);
+ set_rte(vector, dest);
+ }
}
}
+
void
iosapic_pci_fixup (int phase)
{
struct pci_dev *dev;
- unsigned char pin;
- int vector;
- struct hw_interrupt_type *irq_type;
- irq_desc_t *idesc;
if (phase == 0) {
- iosapic_init_pci_irq();
+ if (acpi_get_prt(&pci_irq.route, &pci_irq.num_routes)) {
+ printk("%s: acpi_get_prt failed\n", __FILE__);
+ }
return;
}
@@ -709,76 +848,9 @@
return;
pci_for_each_dev(dev) {
- pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
- if (pin) {
- pin--; /* interrupt pins are numbered starting from 1 */
- vector = pci_pin_to_vector(dev->bus->number, PCI_SLOT(dev->devfn), pin);
- if (vector < 0 && dev->bus->parent) {
- /* go back to the bridge */
- struct pci_dev *bridge = dev->bus->self;
-
- if (bridge) {
- /* allow for multiple bridges on an adapter */
- do {
- /* do the bridge swizzle... */
- pin = (pin + PCI_SLOT(dev->devfn)) % 4;
- vector = pci_pin_to_vector(bridge->bus->number,
- PCI_SLOT(bridge->devfn),
- pin);
- } while (vector < 0 && (bridge = bridge->bus->self));
- }
- if (vector >= 0)
- printk(KERN_WARNING
- "PCI: using PPB(B%d,I%d,P%d) to get vector %02x\n",
- dev->bus->number, PCI_SLOT(dev->devfn),
- pin, vector);
- else
- printk(KERN_WARNING
- "PCI: Couldn't map irq for (B%d,I%d,P%d)\n",
- dev->bus->number, PCI_SLOT(dev->devfn), pin);
- }
- if (vector >= 0) {
- printk("PCI->APIC IRQ transform: (B%d,I%d,P%d) -> 0x%02x\n",
- dev->bus->number, PCI_SLOT(dev->devfn), pin, vector);
- dev->irq = vector;
-
- irq_type = &irq_type_iosapic_level;
- idesc = irq_desc(vector);
- if (idesc->handler != irq_type) {
- if (idesc->handler != &no_irq_type)
- printk("iosapic_pci_fixup: changing vector 0x%02x "
- "from %s to %s\n", vector,
- idesc->handler->typename,
- irq_type->typename);
- idesc->handler = irq_type;
- }
-#ifdef CONFIG_SMP
- /*
- * For platforms that do not support interrupt redirect
- * via the XTP interface, we can round-robin the PCI
- * device interrupts to the processors
- */
- if (!(smp_int_redirect & SMP_IRQ_REDIRECTION)) {
- static int cpu_index = 0;
+ /* fixup dev->irq and program IOSAPIC */
+ iosapic_fixup_pci_interrupt(dev);
- while (!cpu_online(cpu_index))
- if (++cpu_index >= NR_CPUS)
- cpu_index = 0;
-
- set_rte(vector, cpu_physical_id(cpu_index) & 0xffff);
- } else {
- /*
- * Direct the interrupt vector to the current cpu,
- * platform redirection will distribute them.
- */
- set_rte(vector, (ia64_get_lid() >> 16) & 0xffff);
- }
-#else
- /* direct the interrupt vector to the running cpu id */
- set_rte(vector, (ia64_get_lid() >> 16) & 0xffff);
-#endif
- }
- }
/*
* Nothing to fixup
* Fix out-of-range IRQ numbers
diff -Nru a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c
--- a/arch/ia64/kernel/irq.c Sat Aug 31 15:05:59 2002
+++ b/arch/ia64/kernel/irq.c Sat Aug 31 15:05:59 2002
@@ -802,8 +802,7 @@
#define HEX_DIGITS 8
-static unsigned int parse_hex_value (const char *buffer,
- unsigned long count, unsigned long *ret)
+static int parse_hex_value (const char *buffer, unsigned long count, unsigned long *ret)
{
unsigned char hexnum [HEX_DIGITS];
unsigned long value;
@@ -846,11 +845,11 @@
static unsigned long irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = ~0UL };
static char irq_redir [NR_IRQS]; // = { [0 ... NR_IRQS-1] = 1 };
-void set_irq_affinity_info(int irq, int hwid, int redir)
+void set_irq_affinity_info (unsigned int irq, int hwid, int redir)
{
unsigned long mask = 1UL<= 0 && irq < NR_IRQS) {
+ if (irq < NR_IRQS) {
irq_affinity[irq] = mask;
irq_redir[irq] = (char) (redir & 0xff);
}
@@ -861,14 +860,15 @@
{
if (count < HEX_DIGITS+3)
return -EINVAL;
- return sprintf (page, "%s%08lx\n", irq_redir[(long)data] ? "r " : "",
- irq_affinity[(long)data]);
+ return sprintf (page, "%s%08lx\n", irq_redir[(unsigned long)data] ? "r " : "",
+ irq_affinity[(unsigned long)data]);
}
static int irq_affinity_write_proc (struct file *file, const char *buffer,
unsigned long count, void *data)
{
- int irq = (long) data, full_count = count, err;
+ unsigned int irq = (unsigned long) data;
+ int full_count = count, err;
unsigned long new_value;
const char *buf = buffer;
int redir;
@@ -884,6 +884,8 @@
redir = 0;
err = parse_hex_value(buf, count, &new_value);
+ if (err)
+ return err;
/*
* Do not allow disabling IRQs completely - it's a too easy
@@ -893,7 +895,7 @@
if (!(new_value & cpu_online_map))
return -EINVAL;
- irq_desc(irq)->handler->set_affinity(irq | (redir?(1<<31):0), new_value);
+ irq_desc(irq)->handler->set_affinity(irq | (redir? IA64_IRQ_REDIRECTED : 0), new_value);
return full_count;
}
@@ -912,7 +914,8 @@
static int prof_cpu_mask_write_proc (struct file *file, const char *buffer,
unsigned long count, void *data)
{
- unsigned long *mask = (unsigned long *) data, full_count = count, err;
+ unsigned long *mask = (unsigned long *) data;
+ int full_count = count, err;
unsigned long new_value;
err = parse_hex_value(buffer, count, &new_value);
@@ -946,7 +949,7 @@
if (entry) {
entry->nlink = 1;
- entry->data = (void *)(long)irq;
+ entry->data = (void *)(unsigned long)irq;
entry->read_proc = irq_affinity_read_proc;
entry->write_proc = irq_affinity_write_proc;
}
diff -Nru a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c
--- a/arch/ia64/kernel/irq_ia64.c Sat Aug 31 15:05:59 2002
+++ b/arch/ia64/kernel/irq_ia64.c Sat Aug 31 15:05:59 2002
@@ -54,20 +54,15 @@
0x28, 0x27, 0x26, 0x25, 0x24, 0x23, 0x22, 0x21
};
-/*
- * GSI to IA-64 vector translation table.
- */
-__u8 gsi_to_vector_map[255];
-
int
-ia64_alloc_irq (void)
+ia64_alloc_vector (void)
{
- static int next_irq = IA64_FIRST_DEVICE_VECTOR;
+ static int next_vector = IA64_FIRST_DEVICE_VECTOR;
- if (next_irq > IA64_LAST_DEVICE_VECTOR)
+ if (next_vector > IA64_LAST_DEVICE_VECTOR)
/* XXX could look for sharable vectors instead of panic'ing... */
- panic("ia64_alloc_irq: out of interrupt vectors!");
- return next_irq++;
+ panic("ia64_alloc_vector: out of interrupt vectors!");
+ return next_vector++;
}
extern unsigned int do_IRQ(unsigned long irq, struct pt_regs *regs);
diff -Nru a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c
--- a/arch/ia64/kernel/palinfo.c Sat Aug 31 15:05:54 2002
+++ b/arch/ia64/kernel/palinfo.c Sat Aug 31 15:05:54 2002
@@ -21,10 +21,10 @@
#include
#include
#include
+#include
#include
#include
-#include
#include
#include
#ifdef CONFIG_SMP
diff -Nru a/arch/ia64/kernel/pci.c b/arch/ia64/kernel/pci.c
--- a/arch/ia64/kernel/pci.c Sat Aug 31 15:06:00 2002
+++ b/arch/ia64/kernel/pci.c Sat Aug 31 15:06:00 2002
@@ -46,9 +46,6 @@
struct pci_ops *pci_root_ops;
-int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int len, u32 *value);
-int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value);
-
/*
* Low-level SAL-based PCI configuration access functions. Note that SAL
@@ -60,7 +57,7 @@
((u64)(bus << 16) | (u64)(dev << 11) | (u64)(fn << 8) | (u64)(reg))
static int
-pci_sal_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
+__pci_sal_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
{
int result = 0;
u64 data = 0;
@@ -76,7 +73,7 @@
}
static int
-pci_sal_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
+__pci_sal_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
{
if ((bus > 255) || (dev > 31) || (fn > 7) || (reg > 255))
return -EINVAL;
@@ -86,77 +83,22 @@
static int
-pci_sal_read_config_byte (struct pci_dev *dev, int where, u8 *value)
-{
- int result = 0;
- u32 data = 0;
-
- if (!value)
- return -EINVAL;
-
- result = pci_sal_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 1, &data);
-
- *value = (u8) data;
-
- return result;
-}
-
-static int
-pci_sal_read_config_word (struct pci_dev *dev, int where, u16 *value)
-{
- int result = 0;
- u32 data = 0;
-
- if (!value)
- return -EINVAL;
-
- result = pci_sal_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 2, &data);
-
- *value = (u16) data;
-
- return result;
-}
-
-static int
-pci_sal_read_config_dword (struct pci_dev *dev, int where, u32 *value)
-{
- if (!value)
- return -EINVAL;
-
- return pci_sal_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 4, value);
-}
-
-static int
-pci_sal_write_config_byte (struct pci_dev *dev, int where, u8 value)
-{
- return pci_sal_write(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 1, value);
-}
-
-static int
-pci_sal_write_config_word (struct pci_dev *dev, int where, u16 value)
+pci_sal_read (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value)
{
- return pci_sal_write(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 2, value);
+ return __pci_sal_read(0, bus->number, PCI_SLOT(devfn),
+ PCI_FUNC(devfn), where, size, value);
}
static int
-pci_sal_write_config_dword (struct pci_dev *dev, int where, u32 value)
+pci_sal_write (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value)
{
- return pci_sal_write(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 4, value);
+ return __pci_sal_write(0, bus->number, PCI_SLOT(devfn),
+ PCI_FUNC(devfn), where, size, value);
}
struct pci_ops pci_sal_ops = {
- pci_sal_read_config_byte,
- pci_sal_read_config_word,
- pci_sal_read_config_dword,
- pci_sal_write_config_byte,
- pci_sal_write_config_word,
- pci_sal_write_config_dword
+ .read = pci_sal_read,
+ .write = pci_sal_write,
};
@@ -193,8 +135,6 @@
printk("PCI: Using SAL to access configuration space\n");
pci_root_ops = &pci_sal_ops;
- pci_config_read = pci_sal_read;
- pci_config_write = pci_sal_write;
return;
}
diff -Nru a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
--- a/arch/ia64/kernel/process.c Sat Aug 31 15:06:00 2002
+++ b/arch/ia64/kernel/process.c Sat Aug 31 15:06:00 2002
@@ -19,9 +19,9 @@
#include
#include
#include
+#include
#include
-#include
#include
#include
#include
diff -Nru a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
--- a/arch/ia64/kernel/setup.c Sat Aug 31 15:05:54 2002
+++ b/arch/ia64/kernel/setup.c Sat Aug 31 15:05:54 2002
@@ -30,6 +30,7 @@
#include
#include
#include
+#include
#include
#include
@@ -37,7 +38,6 @@
#include
#include
#include
-#include
#include
#include
@@ -58,9 +58,8 @@
unsigned long __per_cpu_offset[NR_CPUS];
#endif
-DECLARE_PER_CPU(struct cpuinfo_ia64, cpu_info);
-
-unsigned long ia64_phys_stacked_size_p8;
+DEFINE_PER_CPU(struct cpuinfo_ia64, cpu_info);
+DEFINE_PER_CPU(unsigned long, ia64_phys_stacked_size_p8);
unsigned long ia64_cycles_per_usec;
struct ia64_boot_param *ia64_boot_param;
struct screen_info screen_info;
@@ -564,11 +563,11 @@
my_cpu_data = (void *) get_free_page(GFP_KERNEL);
memcpy(my_cpu_data, __phys_per_cpu_start, __per_cpu_end - __per_cpu_start);
__per_cpu_offset[cpu] = (char *) my_cpu_data - __per_cpu_start;
- my_cpu_info = my_cpu_data + ((char *) &cpu_info - __per_cpu_start);
+ my_cpu_info = my_cpu_data + ((char *) &__get_cpu_var(cpu_info) - __per_cpu_start);
#else
my_cpu_data = __phys_per_cpu_start;
#endif
- my_cpu_info = my_cpu_data + ((char *) &cpu_info - __per_cpu_start);
+ my_cpu_info = my_cpu_data + ((char *) &__get_cpu_var(cpu_info) - __per_cpu_start);
/*
* We can't pass "local_cpu_data" to identify_cpu() because we haven't called
@@ -652,6 +651,6 @@
num_phys_stacked = 96;
}
/* size of physical stacked register partition plus 8 bytes: */
- ia64_phys_stacked_size_p8 = num_phys_stacked*8 + 8;
+ __get_cpu_var(ia64_phys_stacked_size_p8) = num_phys_stacked*8 + 8;
platform_cpu_init();
}
diff -Nru a/arch/ia64/kernel/smp.c b/arch/ia64/kernel/smp.c
--- a/arch/ia64/kernel/smp.c Sat Aug 31 15:06:06 2002
+++ b/arch/ia64/kernel/smp.c Sat Aug 31 15:06:06 2002
@@ -32,12 +32,12 @@
#include
#include
#include
+#include
#include
#include
#include
#include
-#include
#include
#include
#include
@@ -72,7 +72,7 @@
#define IPI_CPU_STOP 1
/* This needs to be cacheline aligned because it is written to by *other* CPUs. */
-static DECLARE_PER_CPU(__u64, ipi_operation) ____cacheline_aligned;
+static DEFINE_PER_CPU(__u64, ipi_operation) ____cacheline_aligned;
static void
stop_this_cpu (void)
diff -Nru a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
--- a/arch/ia64/kernel/smpboot.c Sat Aug 31 15:05:55 2002
+++ b/arch/ia64/kernel/smpboot.c Sat Aug 31 15:05:55 2002
@@ -27,13 +27,13 @@
#include
#include
#include
+#include
#include
#include
#include
#include
#include
-#include
#include
#include
#include
diff -Nru a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
--- a/arch/ia64/kernel/time.c Sat Aug 31 15:05:55 2002
+++ b/arch/ia64/kernel/time.c Sat Aug 31 15:05:55 2002
@@ -15,9 +15,9 @@
#include
#include
#include
+#include
#include
-#include
#include
#include
#include
diff -Nru a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c
--- a/arch/ia64/kernel/traps.c Sat Aug 31 15:06:06 2002
+++ b/arch/ia64/kernel/traps.c Sat Aug 31 15:06:06 2002
@@ -135,8 +135,6 @@
siginfo_t siginfo;
int sig, code;
- die_if_kernel("bad break", regs, break_num);
-
/* SIGILL, SIGFPE, SIGSEGV, and SIGBUS want these field initialized: */
siginfo.si_addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri);
siginfo.si_imm = break_num;
@@ -144,7 +142,8 @@
siginfo.si_isr = 0;
switch (break_num) {
- case 0: /* unknown error */
+ case 0: /* unknown error (used by GCC for __builtin_abort()) */
+ die_if_kernel("bad break", regs, break_num);
sig = SIGILL; code = ILL_ILLOPC;
break;
diff -Nru a/arch/ia64/lib/memcpy.S b/arch/ia64/lib/memcpy.S
--- a/arch/ia64/lib/memcpy.S Sat Aug 31 15:05:54 2002
+++ b/arch/ia64/lib/memcpy.S Sat Aug 31 15:05:54 2002
@@ -13,8 +13,6 @@
* Stephane Eranian
* David Mosberger-Tang
*/
-#include
-
#include
GLOBAL_ENTRY(bcopy)
diff -Nru a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
--- a/arch/ia64/mm/init.c Sat Aug 31 15:05:59 2002
+++ b/arch/ia64/mm/init.c Sat Aug 31 15:05:59 2002
@@ -14,11 +14,11 @@
#include
#include
#include
+#include
#include
#include
#include
-#include
#include
#include
#include
diff -Nru a/arch/ia64/mm/tlb.c b/arch/ia64/mm/tlb.c
--- a/arch/ia64/mm/tlb.c Sat Aug 31 15:06:04 2002
+++ b/arch/ia64/mm/tlb.c Sat Aug 31 15:06:04 2002
@@ -41,7 +41,7 @@
.max_ctx = ~0U
};
-u8 ia64_need_tlb_flush __per_cpu_data;
+DEFINE_PER_CPU(u8, ia64_need_tlb_flush);
/*
* Acquire the ia64_ctx.lock before calling this function!
diff -Nru a/arch/ia64/sn/configs/sn1/defconfig-bigsur-mp b/arch/ia64/sn/configs/sn1/defconfig-bigsur-mp
--- a/arch/ia64/sn/configs/sn1/defconfig-bigsur-mp Sat Aug 31 15:05:59 2002
+++ b/arch/ia64/sn/configs/sn1/defconfig-bigsur-mp Sat Aug 31 15:05:59 2002
@@ -526,6 +526,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/ia64/sn/configs/sn1/defconfig-bigsur-sp b/arch/ia64/sn/configs/sn1/defconfig-bigsur-sp
--- a/arch/ia64/sn/configs/sn1/defconfig-bigsur-sp Sat Aug 31 15:05:55 2002
+++ b/arch/ia64/sn/configs/sn1/defconfig-bigsur-sp Sat Aug 31 15:05:55 2002
@@ -526,6 +526,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/ia64/sn/configs/sn1/defconfig-dig-mp b/arch/ia64/sn/configs/sn1/defconfig-dig-mp
--- a/arch/ia64/sn/configs/sn1/defconfig-dig-mp Sat Aug 31 15:06:06 2002
+++ b/arch/ia64/sn/configs/sn1/defconfig-dig-mp Sat Aug 31 15:06:06 2002
@@ -288,6 +288,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ia64/sn/configs/sn1/defconfig-dig-sp b/arch/ia64/sn/configs/sn1/defconfig-dig-sp
--- a/arch/ia64/sn/configs/sn1/defconfig-dig-sp Sat Aug 31 15:05:54 2002
+++ b/arch/ia64/sn/configs/sn1/defconfig-dig-sp Sat Aug 31 15:05:54 2002
@@ -288,6 +288,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ia64/sn/configs/sn1/defconfig-generic-mp b/arch/ia64/sn/configs/sn1/defconfig-generic-mp
--- a/arch/ia64/sn/configs/sn1/defconfig-generic-mp Sat Aug 31 15:05:55 2002
+++ b/arch/ia64/sn/configs/sn1/defconfig-generic-mp Sat Aug 31 15:05:55 2002
@@ -283,6 +283,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ia64/sn/configs/sn1/defconfig-generic-sp b/arch/ia64/sn/configs/sn1/defconfig-generic-sp
--- a/arch/ia64/sn/configs/sn1/defconfig-generic-sp Sat Aug 31 15:05:59 2002
+++ b/arch/ia64/sn/configs/sn1/defconfig-generic-sp Sat Aug 31 15:05:59 2002
@@ -283,6 +283,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ia64/sn/configs/sn1/defconfig-hp-sp b/arch/ia64/sn/configs/sn1/defconfig-hp-sp
--- a/arch/ia64/sn/configs/sn1/defconfig-hp-sp Sat Aug 31 15:06:00 2002
+++ b/arch/ia64/sn/configs/sn1/defconfig-hp-sp Sat Aug 31 15:06:00 2002
@@ -253,6 +253,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ia64/sn/configs/sn1/defconfig-prom-medusa b/arch/ia64/sn/configs/sn1/defconfig-prom-medusa
--- a/arch/ia64/sn/configs/sn1/defconfig-prom-medusa Sat Aug 31 15:05:59 2002
+++ b/arch/ia64/sn/configs/sn1/defconfig-prom-medusa Sat Aug 31 15:05:59 2002
@@ -363,6 +363,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/ia64/sn/configs/sn1/defconfig-sn1-mp b/arch/ia64/sn/configs/sn1/defconfig-sn1-mp
--- a/arch/ia64/sn/configs/sn1/defconfig-sn1-mp Sat Aug 31 15:06:06 2002
+++ b/arch/ia64/sn/configs/sn1/defconfig-sn1-mp Sat Aug 31 15:06:06 2002
@@ -497,6 +497,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/ia64/sn/configs/sn1/defconfig-sn1-mp-modules b/arch/ia64/sn/configs/sn1/defconfig-sn1-mp-modules
--- a/arch/ia64/sn/configs/sn1/defconfig-sn1-mp-modules Sat Aug 31 15:06:03 2002
+++ b/arch/ia64/sn/configs/sn1/defconfig-sn1-mp-modules Sat Aug 31 15:06:03 2002
@@ -499,6 +499,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/ia64/sn/configs/sn1/defconfig-sn1-mp-syn1-0 b/arch/ia64/sn/configs/sn1/defconfig-sn1-mp-syn1-0
--- a/arch/ia64/sn/configs/sn1/defconfig-sn1-mp-syn1-0 Sat Aug 31 15:05:59 2002
+++ b/arch/ia64/sn/configs/sn1/defconfig-sn1-mp-syn1-0 Sat Aug 31 15:05:59 2002
@@ -497,6 +497,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/ia64/sn/configs/sn1/defconfig-sn1-sp b/arch/ia64/sn/configs/sn1/defconfig-sn1-sp
--- a/arch/ia64/sn/configs/sn1/defconfig-sn1-sp Sat Aug 31 15:05:54 2002
+++ b/arch/ia64/sn/configs/sn1/defconfig-sn1-sp Sat Aug 31 15:05:54 2002
@@ -497,6 +497,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/ia64/sn/configs/sn2/defconfig-dig-numa b/arch/ia64/sn/configs/sn2/defconfig-dig-numa
--- a/arch/ia64/sn/configs/sn2/defconfig-dig-numa Sat Aug 31 15:05:55 2002
+++ b/arch/ia64/sn/configs/sn2/defconfig-dig-numa Sat Aug 31 15:05:55 2002
@@ -289,6 +289,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ia64/sn/configs/sn2/defconfig-sn2-dig-mp b/arch/ia64/sn/configs/sn2/defconfig-sn2-dig-mp
--- a/arch/ia64/sn/configs/sn2/defconfig-sn2-dig-mp Sat Aug 31 15:06:06 2002
+++ b/arch/ia64/sn/configs/sn2/defconfig-sn2-dig-mp Sat Aug 31 15:06:06 2002
@@ -288,6 +288,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ia64/sn/configs/sn2/defconfig-sn2-dig-sp b/arch/ia64/sn/configs/sn2/defconfig-sn2-dig-sp
--- a/arch/ia64/sn/configs/sn2/defconfig-sn2-dig-sp Sat Aug 31 15:05:59 2002
+++ b/arch/ia64/sn/configs/sn2/defconfig-sn2-dig-sp Sat Aug 31 15:05:59 2002
@@ -288,6 +288,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ia64/sn/configs/sn2/defconfig-sn2-mp b/arch/ia64/sn/configs/sn2/defconfig-sn2-mp
--- a/arch/ia64/sn/configs/sn2/defconfig-sn2-mp Sat Aug 31 15:05:55 2002
+++ b/arch/ia64/sn/configs/sn2/defconfig-sn2-mp Sat Aug 31 15:05:55 2002
@@ -496,6 +496,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/ia64/sn/configs/sn2/defconfig-sn2-mp-modules b/arch/ia64/sn/configs/sn2/defconfig-sn2-mp-modules
--- a/arch/ia64/sn/configs/sn2/defconfig-sn2-mp-modules Sat Aug 31 15:06:03 2002
+++ b/arch/ia64/sn/configs/sn2/defconfig-sn2-mp-modules Sat Aug 31 15:06:03 2002
@@ -498,6 +498,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/ia64/sn/configs/sn2/defconfig-sn2-prom-medusa b/arch/ia64/sn/configs/sn2/defconfig-sn2-prom-medusa
--- a/arch/ia64/sn/configs/sn2/defconfig-sn2-prom-medusa Sat Aug 31 15:05:59 2002
+++ b/arch/ia64/sn/configs/sn2/defconfig-sn2-prom-medusa Sat Aug 31 15:05:59 2002
@@ -371,6 +371,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/ia64/sn/configs/sn2/defconfig-sn2-sp b/arch/ia64/sn/configs/sn2/defconfig-sn2-sp
--- a/arch/ia64/sn/configs/sn2/defconfig-sn2-sp Sat Aug 31 15:05:54 2002
+++ b/arch/ia64/sn/configs/sn2/defconfig-sn2-sp Sat Aug 31 15:05:54 2002
@@ -496,6 +496,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/ia64/sn/fakeprom/fpmem.c b/arch/ia64/sn/fakeprom/fpmem.c
--- a/arch/ia64/sn/fakeprom/fpmem.c Sat Aug 31 15:05:59 2002
+++ b/arch/ia64/sn/fakeprom/fpmem.c Sat Aug 31 15:05:59 2002
@@ -18,7 +18,7 @@
*/
#include
-#include
+#include
#include "fpmem.h"
/*
diff -Nru a/arch/ia64/sn/fakeprom/fw-emu.c b/arch/ia64/sn/fakeprom/fw-emu.c
--- a/arch/ia64/sn/fakeprom/fw-emu.c Sat Aug 31 15:05:55 2002
+++ b/arch/ia64/sn/fakeprom/fw-emu.c Sat Aug 31 15:05:55 2002
@@ -36,7 +36,7 @@
* http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
#include
-#include
+#include
#include
#include
#include
diff -Nru a/arch/ia64/sn/io/efi-rtc.c b/arch/ia64/sn/io/efi-rtc.c
--- a/arch/ia64/sn/io/efi-rtc.c Sat Aug 31 15:05:54 2002
+++ b/arch/ia64/sn/io/efi-rtc.c Sat Aug 31 15:05:54 2002
@@ -12,7 +12,7 @@
#include
#include
#include
-#include
+#include
#include
/*
diff -Nru a/arch/ia64/sn/io/pci.c b/arch/ia64/sn/io/pci.c
--- a/arch/ia64/sn/io/pci.c Sat Aug 31 15:05:55 2002
+++ b/arch/ia64/sn/io/pci.c Sat Aug 31 15:05:55 2002
@@ -44,22 +44,21 @@
extern devfs_handle_t devfn_to_vertex(unsigned char bus, unsigned char devfn);
/*
- * snia64_read_config_byte - Read a byte from the config area of the device.
+ * snia64_read - Read from the config area of the device.
*/
-static int snia64_read_config_byte (struct pci_dev *dev,
- int where, unsigned char *val)
+static int snia64_read (struct pci_bus *bus, unsigned char devfn,
+ int where, int size, unsigned char *val)
{
unsigned long res = 0;
- unsigned size = 1;
devfs_handle_t device_vertex;
- if ( (dev == (struct pci_dev *)0) || (val == (unsigned char *)0) ) {
+ if ( (bus == NULL) || (val == (unsigned char *)0) ) {
return PCIBIOS_DEVICE_NOT_FOUND;
}
- device_vertex = devfn_to_vertex(dev->bus->number, dev->devfn);
+ device_vertex = devfn_to_vertex(bus->number, devfn);
if (!device_vertex) {
DBG("%s : nonexistent device: bus= 0x%x slot= 0x%x func= 0x%x\n",
- __FUNCTION__, dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
+ __FUNCTION__, bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn));
return(-1);
}
res = pciio_config_get(device_vertex, (unsigned) where, size);
@@ -68,160 +67,40 @@
}
/*
- * snia64_read_config_word - Read 2 bytes from the config area of the device.
+ * snia64_write - Writes to the config area of the device.
*/
-static int snia64_read_config_word (struct pci_dev *dev,
- int where, unsigned short *val)
+static int snia64_write (struct pci_bus *bus, unsigned char devfn,
+ int where, int size, unsigned char val)
{
- unsigned long res = 0;
- unsigned size = 2; /* 2 bytes */
- devfs_handle_t device_vertex;
-
- if ( (dev == (struct pci_dev *)0) || (val == (unsigned short *)0) ) {
- return PCIBIOS_DEVICE_NOT_FOUND;
- }
- device_vertex = devfn_to_vertex(dev->bus->number, dev->devfn);
- if (!device_vertex) {
- DBG("%s : nonexistent device: bus= 0x%x slot= 0x%x func= 0x%x\n",
- __FUNCTION__, dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
- return(-1);
- }
- res = pciio_config_get(device_vertex, (unsigned) where, size);
- *val = (unsigned short) res;
- return PCIBIOS_SUCCESSFUL;
-}
-
-/*
- * snia64_read_config_dword - Read 4 bytes from the config area of the device.
- */
-static int snia64_read_config_dword (struct pci_dev *dev,
- int where, unsigned int *val)
-{
- unsigned long res = 0;
- unsigned size = 4; /* 4 bytes */
devfs_handle_t device_vertex;
- if (where & 3) {
- return PCIBIOS_BAD_REGISTER_NUMBER;
- }
- if ( (dev == (struct pci_dev *)0) || (val == (unsigned int *)0) ) {
- return PCIBIOS_DEVICE_NOT_FOUND;
- }
-
- device_vertex = devfn_to_vertex(dev->bus->number, dev->devfn);
- if (!device_vertex) {
- DBG("%s : nonexistent device: bus= 0x%x slot= 0x%x func= 0x%x\n",
- __FUNCTION__, dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
- return(-1);
- }
- res = pciio_config_get(device_vertex, (unsigned) where, size);
- *val = (unsigned int) res;
- return PCIBIOS_SUCCESSFUL;
-}
-
-/*
- * snia64_write_config_byte - Writes 1 byte to the config area of the device.
- */
-static int snia64_write_config_byte (struct pci_dev *dev,
- int where, unsigned char val)
-{
- devfs_handle_t device_vertex;
-
- if ( dev == (struct pci_dev *)0 ) {
+ if ( bus == NULL) {
return PCIBIOS_DEVICE_NOT_FOUND;
}
/*
* if it's an IOC3 then we bail out, we special
* case them with pci_fixup_ioc3
*/
- if (dev->vendor == PCI_VENDOR_ID_SGI &&
+ /* Starting 2.5.32 struct pci_dev is not passed down */
+ /*if (dev->vendor == PCI_VENDOR_ID_SGI &&
dev->device == PCI_DEVICE_ID_SGI_IOC3 )
return PCIBIOS_SUCCESSFUL;
+ */
- device_vertex = devfn_to_vertex(dev->bus->number, dev->devfn);
- if (!device_vertex) {
- DBG("%s : nonexistent device: bus= 0x%x slot= 0x%x func= 0x%x\n",
- __FUNCTION__, dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
- return(-1);
- }
- pciio_config_set( device_vertex, (unsigned)where, 1, (uint64_t) val);
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-/*
- * snia64_write_config_word - Writes 2 bytes to the config area of the device.
- */
-static int snia64_write_config_word (struct pci_dev *dev,
- int where, unsigned short val)
-{
- devfs_handle_t device_vertex = NULL;
-
- if (where & 1) {
- return PCIBIOS_BAD_REGISTER_NUMBER;
- }
- if ( dev == (struct pci_dev *)0 ) {
- return PCIBIOS_DEVICE_NOT_FOUND;
- }
- /*
- * if it's an IOC3 then we bail out, we special
- * case them with pci_fixup_ioc3
- */
- if (dev->vendor == PCI_VENDOR_ID_SGI &&
- dev->device == PCI_DEVICE_ID_SGI_IOC3)
- return PCIBIOS_SUCCESSFUL;
-
- device_vertex = devfn_to_vertex(dev->bus->number, dev->devfn);
- if (!device_vertex) {
- DBG("%s : nonexistent device: bus= 0x%x slot= 0x%x func= 0x%x\n",
- __FUNCTION__, dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
- return(-1);
- }
- pciio_config_set( device_vertex, (unsigned)where, 2, (uint64_t) val);
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-/*
- * snia64_write_config_dword - Writes 4 bytes to the config area of the device.
- */
-static int snia64_write_config_dword (struct pci_dev *dev,
- int where, unsigned int val)
-{
- devfs_handle_t device_vertex;
-
- if (where & 3) {
- return PCIBIOS_BAD_REGISTER_NUMBER;
- }
- if ( dev == (struct pci_dev *)0 ) {
- return PCIBIOS_DEVICE_NOT_FOUND;
- }
- /*
- * if it's an IOC3 then we bail out, we special
- * case them with pci_fixup_ioc3
- */
- if (dev->vendor == PCI_VENDOR_ID_SGI &&
- dev->device == PCI_DEVICE_ID_SGI_IOC3)
- return PCIBIOS_SUCCESSFUL;
-
- device_vertex = devfn_to_vertex(dev->bus->number, dev->devfn);
+ device_vertex = devfn_to_vertex(bus->number, devfn);
if (!device_vertex) {
DBG("%s : nonexistent device: bus= 0x%x slot= 0x%x func= 0x%x\n",
- __FUNCTION__, dev->bus->number, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
+ __FUNCTION__, bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn));
return(-1);
}
- pciio_config_set( device_vertex, (unsigned)where, 4, (uint64_t) val);
+ pciio_config_set( device_vertex, (unsigned)where, size, (uint64_t) val);
return PCIBIOS_SUCCESSFUL;
}
static struct pci_ops snia64_pci_ops = {
- snia64_read_config_byte,
- snia64_read_config_word,
- snia64_read_config_dword,
- snia64_write_config_byte,
- snia64_write_config_word,
- snia64_write_config_dword
+ .read = snia64_read,
+ .write = snia64_write,
};
/*
diff -Nru a/arch/ia64/sn/io/sn1/pcibr.c b/arch/ia64/sn/io/sn1/pcibr.c
--- a/arch/ia64/sn/io/sn1/pcibr.c Sat Aug 31 15:06:03 2002
+++ b/arch/ia64/sn/io/sn1/pcibr.c Sat Aug 31 15:06:03 2002
@@ -7485,7 +7485,7 @@
#ifdef LITTLE_ENDIAN
/*
- * on sn-ia we need to twiddle the the addresses going out
+ * on sn-ia we need to twiddle the addresses going out
* the pci bus because we use the unswizzled synergy space
* (the alternative is to use the swizzled synergy space
* and byte swap the data)
diff -Nru a/arch/ia64/sn/kernel/llsc4.c b/arch/ia64/sn/kernel/llsc4.c
--- a/arch/ia64/sn/kernel/llsc4.c Sat Aug 31 15:05:55 2002
+++ b/arch/ia64/sn/kernel/llsc4.c Sat Aug 31 15:05:55 2002
@@ -17,7 +17,7 @@
#include
#include
#include
-#include
+#include
#include
#include
#include
diff -Nru a/arch/ia64/vmlinux.lds.S b/arch/ia64/vmlinux.lds.S
--- a/arch/ia64/vmlinux.lds.S Sat Aug 31 15:05:55 2002
+++ b/arch/ia64/vmlinux.lds.S Sat Aug 31 15:05:55 2002
@@ -7,7 +7,7 @@
OUTPUT_FORMAT("elf64-ia64-little")
OUTPUT_ARCH(ia64)
ENTRY(phys_start)
-jiffies = jiffies_64;
+jiffies = jiffies_64;
SECTIONS
{
/* Sections to be discarded */
diff -Nru a/arch/m68k/defconfig b/arch/m68k/defconfig
--- a/arch/m68k/defconfig Sat Aug 31 15:05:54 2002
+++ b/arch/m68k/defconfig Sat Aug 31 15:05:54 2002
@@ -228,6 +228,8 @@
# CONFIG_JOLIET is not set
CONFIG_MINIX_FS=y
# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/mips/config.in b/arch/mips/config.in
--- a/arch/mips/config.in Sat Aug 31 15:06:03 2002
+++ b/arch/mips/config.in Sat Aug 31 15:06:03 2002
@@ -389,6 +389,8 @@
fi
endmenu
+source drivers/input/Config.in
+
source drivers/char/Config.in
source drivers/media/Config.in
@@ -474,7 +476,6 @@
fi
source drivers/usb/Config.in
-source drivers/input/Config.in
mainmenu_option next_comment
comment 'Kernel hacking'
diff -Nru a/arch/mips/ddb5074/pci.c b/arch/mips/ddb5074/pci.c
--- a/arch/mips/ddb5074/pci.c Sat Aug 31 15:06:00 2002
+++ b/arch/mips/ddb5074/pci.c Sat Aug 31 15:06:00 2002
@@ -43,137 +43,118 @@
}
-static int nile4_pci_read_config_dword(struct pci_dev *dev,
- int where, u32 * val)
+static int nile4_pci_read(struct pci_bus *bus, unsigned int devfn, int where,
+ int size, u32 * val)
{
- int slot_num, func_num;
- u32 base;
+ int status, slot_num, func_num;
+ u32 result, base;
- /*
- * For starters let's do configuration cycle 0 only (one bus only)
- */
- if (dev->bus->number)
- return PCIBIOS_FUNC_NOT_SUPPORTED;
-
- slot_num = PCI_SLOT(dev->devfn);
- func_num = PCI_FUNC(dev->devfn);
- if (slot_num == 5) {
- /*
- * This is Nile 4 and it will crash if we access it like other
- * devices
- */
- *val = nile4_in32(NILE4_PCI_BASE + where);
- return PCIBIOS_SUCCESSFUL;
+ switch (size) {
+ case 4:
+ /*
+ * For starters let's do configuration cycle 0 only
+ * (one bus only)
+ */
+ if (bus->number)
+ return PCIBIOS_FUNC_NOT_SUPPORTED;
+
+ slot_num = PCI_SLOT(devfn);
+ func_num = PCI_FUNC(devfn);
+ if (slot_num == 5) {
+ /*
+ * This is Nile 4 and it will crash if we access it
+ * like other devices
+ */
+ *val = nile4_in32(NILE4_PCI_BASE + where);
+ return PCIBIOS_SUCCESSFUL;
+ }
+ base = nile4_pre_pci_access0(slot_num);
+ *val = *((volatile u32 *) (base + (func_num << 8) +
+ (where & 0xfc)));
+ nile4_post_pci_access0();
+ return PCIBIOS_SUCCESSFUL;
+
+ case 2:
+ status = nile4_pci_read(bus, devfn, where, 4, &result);
+ if (status != PCIBIOS_SUCCESSFUL)
+ return status;
+ if (where & 2)
+ result >>= 16;
+ *val = (u16)(result & 0xffff);
+ break;
+ case 1:
+ status = nile4_pci_read(bus, devfn, where, 4, &result);
+ if (status != PCIBIOS_SUCCESSFUL)
+ return status;
+ if (where & 1)
+ result >>= 8;
+ if (where & 2)
+ result >>= 16;
+ *val = (u8)(result & 0xff);
+ break;
}
- base = nile4_pre_pci_access0(slot_num);
- *val =
- *((volatile u32 *) (base + (func_num << 8) + (where & 0xfc)));
- nile4_post_pci_access0();
return PCIBIOS_SUCCESSFUL;
}
-static int nile4_pci_write_config_dword(struct pci_dev *dev, int where,
- u32 val)
-{
- int slot_num, func_num;
- u32 base;
-
- /*
- * For starters let's do configuration cycle 0 only (one bus only)
- */
- if (dev->bus->number)
- return PCIBIOS_FUNC_NOT_SUPPORTED;
-
- slot_num = PCI_SLOT(dev->devfn);
- func_num = PCI_FUNC(dev->devfn);
- if (slot_num == 5) {
- /*
- * This is Nile 4 and it will crash if we access it like other
- * devices
- */
- nile4_out32(NILE4_PCI_BASE + where, val);
- return PCIBIOS_SUCCESSFUL;
- }
- base = nile4_pre_pci_access0(slot_num);
- *((volatile u32 *) (base + (func_num << 8) + (where & 0xfc))) =
- val;
- nile4_post_pci_access0();
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int nile4_pci_read_config_word(struct pci_dev *dev, int where,
- u16 * val)
-{
- int status;
- u32 result;
-
- status = nile4_pci_read_config_dword(dev, where, &result);
- if (status != PCIBIOS_SUCCESSFUL)
- return status;
- if (where & 2)
- result >>= 16;
- *val = result & 0xffff;
- return PCIBIOS_SUCCESSFUL;
-}
-static int nile4_pci_read_config_byte(struct pci_dev *dev, int where,
- u8 * val)
+static int nile4_pci_write(struct pci_bus *bus, unsigned int devfn, int where,
+ int size, u32 val)
{
- int status;
- u32 result;
+ int status, slot_num, func_num, shift = 0;
+ u32 result, base;
- status = nile4_pci_read_config_dword(dev, where, &result);
- if (status != PCIBIOS_SUCCESSFUL)
- return status;
- if (where & 1)
- result >>= 8;
- if (where & 2)
- result >>= 16;
- *val = result & 0xff;
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int nile4_pci_write_config_word(struct pci_dev *dev, int where,
- u16 val)
-{
- int status, shift = 0;
- u32 result;
-
- status = nile4_pci_read_config_dword(dev, where, &result);
- if (status != PCIBIOS_SUCCESSFUL)
- return status;
- if (where & 2)
- shift += 16;
- result &= ~(0xffff << shift);
- result |= val << shift;
- return nile4_pci_write_config_dword(dev, where, result);
-}
-
-static int nile4_pci_write_config_byte(struct pci_dev *dev, int where,
- u8 val)
-{
- int status, shift = 0;
- u32 result;
-
- status = nile4_pci_read_config_dword(dev, where, &result);
- if (status != PCIBIOS_SUCCESSFUL)
- return status;
- if (where & 2)
- shift += 16;
- if (where & 1)
- shift += 8;
- result &= ~(0xff << shift);
- result |= val << shift;
- return nile4_pci_write_config_dword(dev, where, result);
+ switch (size) {
+ case 4:
+ /*
+ * For starters let's do configuration cycle 0 only
+ * (one bus only)
+ */
+ if (bus->number)
+ return PCIBIOS_FUNC_NOT_SUPPORTED;
+
+ slot_num = PCI_SLOT(devfn);
+ func_num = PCI_FUNC(devfn);
+ if (slot_num == 5) {
+ /*
+ * This is Nile 4 and it will crash if we access
+ * it like other devices
+ */
+ nile4_out32(NILE4_PCI_BASE + where, val);
+ return PCIBIOS_SUCCESSFUL;
+ }
+ base = nile4_pre_pci_access0(slot_num);
+ *((volatile u32 *) (base + (func_num << 8) +
+ (where & 0xfc))) = val;
+ nile4_post_pci_access0();
+ return PCIBIOS_SUCCESSFUL;
+
+ case 2:
+ status = nile4_pci_read(bus, devfn, where, 4, &result);
+ if (status != PCIBIOS_SUCCESSFUL)
+ return status;
+ if (where & 2)
+ shift += 16;
+ result &= ~(0xffff << shift);
+ result |= (u16)(val << shift);
+ break;
+ case 1:
+ status = nile4_pci_read(bus, devfn, where, 4, &result);
+ if (status != PCIBIOS_SUCCESSFUL)
+ return status;
+ if (where & 2)
+ shift += 16;
+ if (where & 1)
+ shift += 8;
+ result &= ~(0xff << shift);
+ result |= (u8)(val << shift);
+ break;
+ }
+ return nile4_pci_write(bus, devfn, where, 4, result);
}
struct pci_ops nile4_pci_ops = {
- nile4_pci_read_config_byte,
- nile4_pci_read_config_word,
- nile4_pci_read_config_dword,
- nile4_pci_write_config_byte,
- nile4_pci_write_config_word,
- nile4_pci_write_config_dword
+ .read = nile4_pci_read,
+ .write = nile4_pci_write,
};
struct {
diff -Nru a/arch/mips/ddb5476/pci.c b/arch/mips/ddb5476/pci.c
--- a/arch/mips/ddb5476/pci.c Sat Aug 31 15:05:59 2002
+++ b/arch/mips/ddb5476/pci.c Sat Aug 31 15:05:59 2002
@@ -51,145 +51,106 @@
nile4_set_pmr(NILE4_PCIINIT1, NILE4_PCICMD_MEM, 0x08000000);
}
-
-static int nile4_pci_read_config_dword(struct pci_dev *dev,
- int where, u32 * val)
+static int nile4_pci_read(struct pci_bus *bus, unsigned int devfn, int where,
+ int size, u32 * val)
{
- int slot_num, func_num;
- u32 base;
- u32 addr;
-
- /*
- * Do we need to generate type 1 configure transaction?
- */
- if (dev->bus->number) {
- /* FIXME - not working yet */
- return PCIBIOS_FUNC_NOT_SUPPORTED;
-
- /*
- * the largest type 1 configuration addr is 16M, < 256M
- * config space
- */
- slot_num = 0;
- addr =
- (dev->bus->number << 16) | (dev->devfn <
- 8) | where | 1;
- } else {
- slot_num = PCI_SLOT(dev->devfn);
- func_num = PCI_FUNC(dev->devfn);
- addr = (func_num << 8) + where;
- }
+ int status, slot_num, func_num;
+ u32 result, base, addr;
- base = nile4_pre_pci_access0(slot_num);
- *val = *(volatile u32 *) (base + addr);
- nile4_post_pci_access0();
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int nile4_pci_write_config_dword(struct pci_dev *dev, int where,
- u32 val)
-{
- int slot_num, func_num;
- u32 base;
- u32 addr;
-
- /*
- * Do we need to generate type 1 configure transaction?
- */
- if (dev->bus->number) {
- /* FIXME - not working yet */
- return PCIBIOS_FUNC_NOT_SUPPORTED;
-
- /* the largest type 1 configuration addr is 16M, < 256M config space */
- slot_num = 0;
- addr =
- (dev->bus->number << 16) | (dev->devfn <
- 8) | where | 1;
- } else {
- slot_num = PCI_SLOT(dev->devfn);
- func_num = PCI_FUNC(dev->devfn);
- addr = (func_num << 8) + where;
+ if(size == 4) {
+ /* Do we need to generate type 1 configure transaction? */
+ if (bus->number) {
+ /* FIXME - not working yet */
+ return PCIBIOS_FUNC_NOT_SUPPORTED;
+ /*
+ * the largest type 1 configuration addr is 16M,
+ * < 256M config space
+ */
+ slot_num = 0;
+ addr = (bus->number << 16) | (devfn < 8) | where | 1;
+ } else {
+ slot_num = PCI_SLOT(devfn);
+ func_num = PCI_FUNC(devfn);
+ addr = (func_num << 8) + where;
+ }
+ base = nile4_pre_pci_access0(slot_num);
+ *val = *(volatile u32 *) (base + addr);
+ nile4_post_pci_access0();
+ return PCIBIOS_SUCCESSFUL;
}
- base = nile4_pre_pci_access0(slot_num);
- *(volatile u32 *) (base + addr) = val;
- nile4_post_pci_access0();
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int nile4_pci_read_config_word(struct pci_dev *dev, int where,
- u16 * val)
-{
- int status;
- u32 result;
-
- status = nile4_pci_read_config_dword(dev, where & ~3, &result);
- if (status != PCIBIOS_SUCCESSFUL)
- return status;
- if (where & 2)
- result >>= 16;
- *val = result & 0xffff;
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int nile4_pci_read_config_byte(struct pci_dev *dev, int where,
- u8 * val)
-{
- int status;
- u32 result;
-
- status = nile4_pci_read_config_dword(dev, where & ~3, &result);
+ status = nile4_pci_read(bus, devfn, where & ~3, 4, &result);
if (status != PCIBIOS_SUCCESSFUL)
return status;
- if (where & 1)
- result >>= 8;
- if (where & 2)
- result >>= 16;
- *val = result & 0xff;
+ switch (size) {
+ case 1:
+ if (where & 1)
+ result >>= 8;
+ if (where & 2)
+ result >>= 16;
+ *val = (u8)(result & 0xff);
+ break;
+ case 2:
+ if (where & 2)
+ result >>= 16;
+ *val = (u16)(result & 0xffff);
+ break;
+ }
return PCIBIOS_SUCCESSFUL;
}
-static int nile4_pci_write_config_word(struct pci_dev *dev, int where,
- u16 val)
+static int nile4_pci_write(struct pci_bus *bus, unsigned int devfn, int where,
+ int size, u32 val)
{
- int status, shift = 0;
- u32 result;
+ int status, slot_num, func_num, shift = 0;
+ u32 result, base, addr;
- status = nile4_pci_read_config_dword(dev, where & ~3, &result);
+ status = nile4_pci_read(bus, devfn, where & ~3, 4, &result);
if (status != PCIBIOS_SUCCESSFUL)
return status;
- if (where & 2)
- shift += 16;
- result &= ~(0xffff << shift);
- result |= val << shift;
- return nile4_pci_write_config_dword(dev, where & ~3, result);
-}
-
-static int nile4_pci_write_config_byte(struct pci_dev *dev, int where,
- u8 val)
-{
- int status, shift = 0;
- u32 result;
-
- status = nile4_pci_read_config_dword(dev, where & ~3, &result);
- if (status != PCIBIOS_SUCCESSFUL)
- return status;
- if (where & 2)
- shift += 16;
- if (where & 1)
- shift += 8;
- result &= ~(0xff << shift);
- result |= val << shift;
- return nile4_pci_write_config_dword(dev, where & ~3, result);
+ switch (size) {
+ case 1:
+ if (where & 2)
+ shift += 16;
+ if (where & 1)
+ shift += 8;
+ result &= ~(0xff << shift);
+ result |= val << shift;
+ break;
+ case 2:
+ if (where & 2)
+ shift += 16;
+ result &= ~(0xffff << shift);
+ result |= val << shift;
+ break;
+ case 4:
+ /* Do we need to generate type 1 configure transaction? */
+ if (bus->number) {
+ /* FIXME - not working yet */
+ return PCIBIOS_FUNC_NOT_SUPPORTED;
+
+ /* the largest type 1 configuration addr is 16M,
+ * < 256M config space */
+ slot_num = 0;
+ addr = (bus->number << 16) | (devfn < 8) |
+ where | 1;
+ } else {
+ slot_num = PCI_SLOT(devfn);
+ func_num = PCI_FUNC(devfn);
+ addr = (func_num << 8) + where;
+ }
+
+ base = nile4_pre_pci_access0(slot_num);
+ *(volatile u32 *) (base + addr) = val;
+ nile4_post_pci_access0();
+ return PCIBIOS_SUCCESSFUL;
+ }
+ return nile4_pci_write(bus, devfn, where & ~3, 4, result);
}
struct pci_ops nile4_pci_ops = {
- nile4_pci_read_config_byte,
- nile4_pci_read_config_word,
- nile4_pci_read_config_dword,
- nile4_pci_write_config_byte,
- nile4_pci_write_config_word,
- nile4_pci_write_config_dword
+ .read = nile4_pci_read,
+ .write = nile4_pci_write,
};
struct {
@@ -274,13 +235,13 @@
pci_pmu = dev; /* for LEDs D2 and D3 */
/* Program the lines for LEDs D2 and D3 to output */
- nile4_pci_read_config_byte(dev, 0x7d, &t8);
+ nile4_pci_read(dev->bus, dev->devfn, 0x7d, 1, &t8);
t8 |= 0xc0;
- nile4_pci_write_config_byte(dev, 0x7d, t8);
+ nile4_pci_write(dev->bus, dev->devfn, 0x7d, 1, t8);
/* Turn LEDs D2 and D3 off */
- nile4_pci_read_config_byte(dev, 0x7e, &t8);
+ nile4_pci_read(dev->bus, dev->devfn, 0x7e, 1, &t8);
t8 |= 0xc0;
- nile4_pci_write_config_byte(dev, 0x7e, t8);
+ nile4_pci_write(dev->bus, dev->devfn, 0x7e, 1, t8);
} else if (dev->vendor == PCI_VENDOR_ID_AL &&
dev->device == 0x5229) {
int i;
diff -Nru a/arch/mips/ddb5xxx/ddb5477/pci_ops.c b/arch/mips/ddb5xxx/ddb5477/pci_ops.c
--- a/arch/mips/ddb5xxx/ddb5477/pci_ops.c Sat Aug 31 15:05:54 2002
+++ b/arch/mips/ddb5xxx/ddb5477/pci_ops.c Sat Aug 31 15:05:54 2002
@@ -134,173 +134,138 @@
ddb_out32(swap->pmr, swap->pmr_backup);
}
-static int read_config_dword(struct pci_config_swap *swap,
- struct pci_dev *dev,
+static int read_config(struct pci_config_swap *swap,
+ struct pci_bus *bus,
+ unsigned int devfn,
u32 where,
+ int size,
u32 *val)
{
- u32 bus, slot_num, func_num;
- u32 base;
+ u32 busnum, slot_num, func_num, base, result;
+ int status
- MIPS_ASSERT((where & 3) == 0);
- MIPS_ASSERT(where < (1 << 8));
-
- /* check if the bus is top-level */
- if (dev->bus->parent != NULL) {
- bus = dev->bus->number;
- MIPS_ASSERT(bus != 0);
- } else {
- bus = 0;
+ switch (size) {
+ case 4:
+ MIPS_ASSERT((where & 3) == 0);
+ MIPS_ASSERT(where < (1 << 8));
+
+ /* check if the bus is top-level */
+ if (bus->parent != NULL) {
+ busnum = bus->number;
+ MIPS_ASSERT(busnum != 0);
+ } else {
+ busnum = 0;
+ }
+
+ slot_num = PCI_SLOT(devfn);
+ func_num = PCI_FUNC(devfn);
+ base = ddb_access_config_base(swap, busnum, slot_num);
+ *val = *(volatile u32*) (base + (func_num << 8) + where);
+ ddb_close_config_base(swap);
+ return PCIBIOS_SUCCESSFUL;
+
+ case 2:
+ MIPS_ASSERT((where & 1) == 0);
+
+ status = read_config(swap, bus, devfn, where & ~3, 4,
+ &result);
+ if (where & 2) result >>= 16;
+ *val = (u16)(result & 0xffff);
+ return status;
+
+ case 1:
+ status = read_config(swap, bus, devfn, where & ~3, 4,
+ &result);
+ if (where & 1) result >>= 8;
+ if (where & 2) result >>= 16;
+ *val = (u8)(result & 0xff);
+ return status;
}
-
- slot_num = PCI_SLOT(dev->devfn);
- func_num = PCI_FUNC(dev->devfn);
- base = ddb_access_config_base(swap, bus, slot_num);
- *val = *(volatile u32*) (base + (func_num << 8) + where);
- ddb_close_config_base(swap);
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int read_config_word(struct pci_config_swap *swap,
- struct pci_dev *dev,
- u32 where,
- u16 *val)
-{
- int status;
- u32 result;
-
- MIPS_ASSERT((where & 1) == 0);
-
- status = read_config_dword(swap, dev, where & ~3, &result);
- if (where & 2) result >>= 16;
- *val = result & 0xffff;
- return status;
}
-static int read_config_byte(struct pci_config_swap *swap,
- struct pci_dev *dev,
- u32 where,
- u8 *val)
-{
- int status;
- u32 result;
-
- status = read_config_dword(swap, dev, where & ~3, &result);
- if (where & 1) result >>= 8;
- if (where & 2) result >>= 16;
- *val = result & 0xff;
- return status;
-}
-
-static int write_config_dword(struct pci_config_swap *swap,
- struct pci_dev *dev,
+static int write_config(struct pci_config_swap *swap,
+ struct pci_bus *bus,
+ unsigned int devfn,
u32 where,
+ int size,
u32 val)
{
- u32 bus, slot_num, func_num;
- u32 base;
+ u32 busnum, slot_num, func_num, base, results;
+ int status, shift = 0;
- MIPS_ASSERT((where & 3) == 0);
- MIPS_ASSERT(where < (1 << 8));
-
- /* check if the bus is top-level */
- if (dev->bus->parent != NULL) {
- bus = dev->bus->number;
- MIPS_ASSERT(bus != 0);
- } else {
- bus = 0;
+ switch (size) {
+ case 4:
+ MIPS_ASSERT((where & 3) == 0);
+ MIPS_ASSERT(where < (1 << 8));
+
+ /* check if the bus is top-level */
+ if (bus->parent != NULL) {
+ busnum = bus->number;
+ MIPS_ASSERT(busnum != 0);
+ } else {
+ busnum = 0;
+ }
+
+ slot_num = PCI_SLOT(devfn);
+ func_num = PCI_FUNC(devfn);
+ base = ddb_access_config_base(swap, busnum, slot_num);
+ *(volatile u32*) (base + (func_num << 8) + where) = val;
+ ddb_close_config_base(swap);
+ return PCIBIOS_SUCCESSFUL;
+
+ case 2:
+ MIPS_ASSERT((where & 1) == 0);
+
+ status = read_config(swap, bus, devfn, where & ~3, 4,
+ &result);
+ if (status != PCIBIOS_SUCCESSFUL) return status;
+
+ if (where & 2)
+ shift += 16;
+ result &= ~(0xffff << shift);
+ result |= (u16)(val << shift);
+ return write_config(swap, bus, devfn, where & ~3, size,
+ result);
+
+ case 1:
+ status = read_config(swap, bus, devfn, where & ~3, 4,
+ &result);
+ if (status != PCIBIOS_SUCCESSFUL) return status;
+
+ if (where & 2)
+ shift += 16;
+ if (where & 1)
+ shift += 8;
+ result &= ~(0xff << shift);
+ result |= (u8)(val << shift);
+ return write_config(swap, bus, devfn, where & ~3, size,
+ result);
}
-
- slot_num = PCI_SLOT(dev->devfn);
- func_num = PCI_FUNC(dev->devfn);
- base = ddb_access_config_base(swap, bus, slot_num);
- *(volatile u32*) (base + (func_num << 8) + where) = val;
- ddb_close_config_base(swap);
- return PCIBIOS_SUCCESSFUL;
}
-static int write_config_word(struct pci_config_swap *swap,
- struct pci_dev *dev,
- u32 where,
- u16 val)
-{
- int status, shift=0;
- u32 result;
-
- MIPS_ASSERT((where & 1) == 0);
-
- status = read_config_dword(swap, dev, where & ~3, &result);
- if (status != PCIBIOS_SUCCESSFUL) return status;
-
- if (where & 2)
- shift += 16;
- result &= ~(0xffff << shift);
- result |= val << shift;
- return write_config_dword(swap, dev, where & ~3, result);
-}
-
-static int write_config_byte(struct pci_config_swap *swap,
- struct pci_dev *dev,
- u32 where,
- u8 val)
-{
- int status, shift=0;
- u32 result;
-
- status = read_config_dword(swap, dev, where & ~3, &result);
- if (status != PCIBIOS_SUCCESSFUL) return status;
-
- if (where & 2)
- shift += 16;
- if (where & 1)
- shift += 8;
- result &= ~(0xff << shift);
- result |= val << shift;
- return write_config_dword(swap, dev, where & ~3, result);
-}
-
-#define MAKE_PCI_OPS(prefix, rw, unitname, unittype, pciswap) \
-static int prefix##_##rw##_config_##unitname(struct pci_dev *dev, int where, unittype val) \
+#define MAKE_PCI_OPS(prefix, rw, pciswap) \
+static int prefix##_##rw##_config(struct pci_bus *bus, unsigned int devfn, \
+ int where, int size, u32 val) \
{ \
- return rw##_config_##unitname(pciswap, \
- dev, \
- where, \
- val); \
+ return rw##_config(pciswap, bus, devfn, \
+ where, size, val); \
}
-MAKE_PCI_OPS(extpci, read, byte, u8 *, &ext_pci_swap)
-MAKE_PCI_OPS(extpci, read, word, u16 *, &ext_pci_swap)
-MAKE_PCI_OPS(extpci, read, dword, u32 *, &ext_pci_swap)
-
-MAKE_PCI_OPS(iopci, read, byte, u8 *, &io_pci_swap)
-MAKE_PCI_OPS(iopci, read, word, u16 *, &io_pci_swap)
-MAKE_PCI_OPS(iopci, read, dword, u32 *, &io_pci_swap)
-
-MAKE_PCI_OPS(extpci, write, byte, u8, &ext_pci_swap)
-MAKE_PCI_OPS(extpci, write, word, u16, &ext_pci_swap)
-MAKE_PCI_OPS(extpci, write, dword, u32, &ext_pci_swap)
-
-MAKE_PCI_OPS(iopci, write, byte, u8, &io_pci_swap)
-MAKE_PCI_OPS(iopci, write, word, u16, &io_pci_swap)
-MAKE_PCI_OPS(iopci, write, dword, u32, &io_pci_swap)
+MAKE_PCI_OPS(extpci, read, &ext_pci_swap)
+MAKE_PCI_OPS(extpci, write, &ext_pci_swap)
+
+MAKE_PCI_OPS(iopci, read, &io_pci_swap)
+MAKE_PCI_OPS(iopci, write, &io_pci_swap)
struct pci_ops ddb5477_ext_pci_ops ={
- extpci_read_config_byte,
- extpci_read_config_word,
- extpci_read_config_dword,
- extpci_write_config_byte,
- extpci_write_config_word,
- extpci_write_config_dword
+ .read = extpci_read_config,
+ .write = extpci_write_config,
};
struct pci_ops ddb5477_io_pci_ops ={
- iopci_read_config_byte,
- iopci_read_config_word,
- iopci_read_config_dword,
- iopci_write_config_byte,
- iopci_write_config_word,
- iopci_write_config_dword
+ .read = iopci_read_config,
+ .write = iopci_write_config,
};
#if defined(CONFIG_LL_DEBUG)
diff -Nru a/arch/mips/defconfig b/arch/mips/defconfig
--- a/arch/mips/defconfig Sat Aug 31 15:05:54 2002
+++ b/arch/mips/defconfig Sat Aug 31 15:05:54 2002
@@ -443,6 +443,7 @@
# CONFIG_FREEVXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/mips/defconfig-atlas b/arch/mips/defconfig-atlas
--- a/arch/mips/defconfig-atlas Sat Aug 31 15:05:59 2002
+++ b/arch/mips/defconfig-atlas Sat Aug 31 15:05:59 2002
@@ -433,6 +433,7 @@
# CONFIG_FREEVXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/mips/defconfig-ddb5476 b/arch/mips/defconfig-ddb5476
--- a/arch/mips/defconfig-ddb5476 Sat Aug 31 15:05:59 2002
+++ b/arch/mips/defconfig-ddb5476 Sat Aug 31 15:05:59 2002
@@ -467,6 +467,7 @@
# CONFIG_FREEVXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/mips/defconfig-ddb5477 b/arch/mips/defconfig-ddb5477
--- a/arch/mips/defconfig-ddb5477 Sat Aug 31 15:05:55 2002
+++ b/arch/mips/defconfig-ddb5477 Sat Aug 31 15:05:55 2002
@@ -394,6 +394,7 @@
# CONFIG_FREEVXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/mips/defconfig-decstation b/arch/mips/defconfig-decstation
--- a/arch/mips/defconfig-decstation Sat Aug 31 15:06:06 2002
+++ b/arch/mips/defconfig-decstation Sat Aug 31 15:06:06 2002
@@ -430,6 +430,7 @@
# CONFIG_FREEVXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/mips/defconfig-ip22 b/arch/mips/defconfig-ip22
--- a/arch/mips/defconfig-ip22 Sat Aug 31 15:06:06 2002
+++ b/arch/mips/defconfig-ip22 Sat Aug 31 15:06:06 2002
@@ -443,6 +443,7 @@
# CONFIG_FREEVXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/mips/defconfig-it8172 b/arch/mips/defconfig-it8172
--- a/arch/mips/defconfig-it8172 Sat Aug 31 15:05:59 2002
+++ b/arch/mips/defconfig-it8172 Sat Aug 31 15:05:59 2002
@@ -546,6 +546,7 @@
# CONFIG_FREEVXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/mips/defconfig-malta b/arch/mips/defconfig-malta
--- a/arch/mips/defconfig-malta Sat Aug 31 15:05:55 2002
+++ b/arch/mips/defconfig-malta Sat Aug 31 15:05:55 2002
@@ -459,6 +459,7 @@
# CONFIG_FREEVXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/mips/defconfig-nino b/arch/mips/defconfig-nino
--- a/arch/mips/defconfig-nino Sat Aug 31 15:06:04 2002
+++ b/arch/mips/defconfig-nino Sat Aug 31 15:06:04 2002
@@ -270,6 +270,7 @@
# CONFIG_FREEVXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/mips/defconfig-ocelot b/arch/mips/defconfig-ocelot
--- a/arch/mips/defconfig-ocelot Sat Aug 31 15:06:00 2002
+++ b/arch/mips/defconfig-ocelot Sat Aug 31 15:06:00 2002
@@ -395,6 +395,7 @@
# CONFIG_FREEVXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/mips/defconfig-pb1000 b/arch/mips/defconfig-pb1000
--- a/arch/mips/defconfig-pb1000 Sat Aug 31 15:05:59 2002
+++ b/arch/mips/defconfig-pb1000 Sat Aug 31 15:05:59 2002
@@ -382,6 +382,7 @@
# CONFIG_FREEVXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/mips/defconfig-rm200 b/arch/mips/defconfig-rm200
--- a/arch/mips/defconfig-rm200 Sat Aug 31 15:06:06 2002
+++ b/arch/mips/defconfig-rm200 Sat Aug 31 15:06:06 2002
@@ -313,6 +313,7 @@
# CONFIG_FREEVXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/mips/gt64120/common/pci.c b/arch/mips/gt64120/common/pci.c
--- a/arch/mips/gt64120/common/pci.c Sat Aug 31 15:06:00 2002
+++ b/arch/mips/gt64120/common/pci.c Sat Aug 31 15:06:00 2002
@@ -108,18 +108,10 @@
/* Functions to implement "pci ops" */
-static int galileo_pcibios_read_config_word(struct pci_dev *dev,
- int offset, u16 * val);
-static int galileo_pcibios_read_config_byte(struct pci_dev *dev,
- int offset, u8 * val);
-static int galileo_pcibios_read_config_dword(struct pci_dev *dev,
- int offset, u32 * val);
-static int galileo_pcibios_write_config_byte(struct pci_dev *dev,
- int offset, u8 val);
-static int galileo_pcibios_write_config_word(struct pci_dev *dev,
- int offset, u16 val);
-static int galileo_pcibios_write_config_dword(struct pci_dev *dev,
- int offset, u32 val);
+static int galileo_pcibios_read(struct pci_bus *bus, unsigned int devfn,
+ int offset, int size, u32 * val);
+static int galileo_pcibios_write(struct pci_bus *bus, unsigned int devfn,
+ int offset, int size, u32 val);
static void galileo_pcibios_set_master(struct pci_dev *dev);
/*
@@ -609,15 +601,16 @@
/*
- * galileo_pcibios_(read/write)_config_(dword/word/byte) -
+ * galileo_pcibios_(read/write) -
*
* reads/write a dword/word/byte register from the configuration space
* of a device.
*
* Inputs :
* bus - bus number
- * dev - device number
+ * devfn - device function index
* offset - register offset in the configuration space
+ * size - size of value (1=byte,2=word,4-dword)
* val - value to be written / read
*
* Outputs :
@@ -626,165 +619,106 @@
* PCIBIOS_BAD_REGISTER_NUMBER when accessing non aligned
*/
-static int galileo_pcibios_read_config_dword(struct pci_dev *device,
- int offset, u32 * val)
+static int galileo_pcibios_read (struct pci_bus *bus, unsigned int devfn, int offset, int size, u32 * val)
{
- int dev, bus;
- bus = device->bus->number;
- dev = PCI_SLOT(device->devfn);
+ int dev, busnum;
- if (pci_range_ck(bus, dev)) {
- *val = 0xffffffff;
- return PCIBIOS_DEVICE_NOT_FOUND;
- }
- if (offset & 0x3)
- return PCIBIOS_BAD_REGISTER_NUMBER;
- if (bus == 0)
- *val = pci0ReadConfigReg(offset, device);
+ busnum = bus->number;
+ dev = PCI_SLOT(devfn);
- /* This is so that the upper PCI layer will get the correct return value if
- we're not attached to anything. */
- if ((offset == 0) && (*val == 0xffffffff)) {
+ if (pci_range_ck(busnum, dev)) {
+ if(size == 1)
+ *val = (u8)0xff;
+ else if (size == 2)
+ *val = (u16)0xffff;
+ else if (size == 4)
+ *val = 0xffffffff;
return PCIBIOS_DEVICE_NOT_FOUND;
}
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int galileo_pcibios_read_config_word(struct pci_dev *device,
- int offset, u16 * val)
-{
- int dev, bus;
-
- bus = device->bus->number;
- dev = PCI_SLOT(device->devfn);
-
- if (pci_range_ck(bus, dev)) {
- *val = 0xffff;
- return PCIBIOS_DEVICE_NOT_FOUND;
- }
- if (offset & 0x1)
+ if ((size == 2) && (offset & 0x1))
+ return PCIBIOS_BAD_REGISTER_NUMBER;
+ else if ((size == 4) && (offset & 0x3))
return PCIBIOS_BAD_REGISTER_NUMBER;
- if (bus == 0)
- *val =
- (unsigned short) (pci0ReadConfigReg(offset, device) >>
+ if (busnum == 0) {
+ if(size == 1) {
+ *val = (u8)(pci0ReadConfigReg(offset, bus->dev) >>
+ ((offset & ~0x3) * 8));
+ }else if (size == 2) {
+ *val = (u16)(pci0ReadConfigReg(offset, bus->dev) >>
((offset & ~0x3) * 8));
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int galileo_pcibios_read_config_byte(struct pci_dev *device,
- int offset, u8 * val)
-{
- int dev, bus;
-
- bus = device->bus->number;
- dev = PCI_SLOT(device->devfn);
-
- if (pci_range_ck(bus, dev)) {
- *val = 0xff;
- return PCIBIOS_DEVICE_NOT_FOUND;
+ }else if (size == 4) {
+ *val = pci0ReadConfigReg(offset, bus->dev);
+ }
}
- if (bus == 0)
- *val =
- (unsigned char) (pci0ReadConfigReg(offset, device) >>
- ((offset & ~0x3) * 8));
-
/*
* This is so that the upper PCI layer will get the correct return
* value if we're not attached to anything.
*/
- if ((offset == 0xe) && (*val == 0xff)) {
- u32 MasterAbort;
- GT_READ(GT_INTRCAUSE_OFS, &MasterAbort);
- if (MasterAbort & 0x40000) {
- GT_WRITE(GT_INTRCAUSE_OFS,
- (MasterAbort & 0xfffbffff));
- return PCIBIOS_DEVICE_NOT_FOUND;
- }
+ switch (size) {
+ case 1:
+ if ((offset == 0xe) && (*val == (u8)0xff)) {
+ u32 MasterAbort;
+ GT_READ(GT_INTRCAUSE_OFS, &MasterAbort);
+ if (MasterAbort & 0x40000) {
+ GT_WRITE(GT_INTRCAUSE_OFS,
+ (MasterAbort & 0xfffbffff));
+ return PCIBIOS_DEVICE_NOT_FOUND;
+ }
+ }
+ break;
+ case 4:
+ if ((offset == 0) && (*val == 0xffffffff)) {
+ return PCIBIOS_DEVICE_NOT_FOUND;
+ }
+ break
}
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int galileo_pcibios_write_config_dword(struct pci_dev *device,
- int offset, u32 val)
-{
- int dev, bus;
-
- bus = device->bus->number;
- dev = PCI_SLOT(device->devfn);
-
- if (pci_range_ck(bus, dev))
- return PCIBIOS_DEVICE_NOT_FOUND;
- if (offset & 0x3)
- return PCIBIOS_BAD_REGISTER_NUMBER;
- if (bus == 0)
- pci0WriteConfigReg(offset, device, val);
-// if (bus == 1) pci1WriteConfigReg (offset,device,val);
-
return PCIBIOS_SUCCESSFUL;
}
-
-static int galileo_pcibios_write_config_word(struct pci_dev *device,
- int offset, u16 val)
+static int galileo_pcibios_write(struct pci_bus *bus, unsigned int devfn, int offset, int size, u32 val)
{
- int dev, bus;
+ int dev, busnum;
unsigned long tmp;
- bus = device->bus->number;
- dev = PCI_SLOT(device->devfn);
+ busnum = bus->number;
+ dev = PCI_SLOT(devfn);
- if (pci_range_ck(bus, dev))
+ if (pci_range_ck(busnum, dev))
return PCIBIOS_DEVICE_NOT_FOUND;
- if (offset & 0x1)
+ if (size == 4) {
+ if (offset & 0x3)
+ return PCIBIOS_BAD_REGISTER_NUMBER;
+ if(busnum == 0)
+ pci0WriteConfigReg(offset, bus->dev, val);
+ //if (busnum == 1) pci1WriteConfigReg (offset,bus->dev,val);
+ return PCIBIOS_SUCCESSFUL;
+ }
+ if ((size == 2) && (offset & 0x1))
return PCIBIOS_BAD_REGISTER_NUMBER;
- if (bus == 0)
- tmp = pci0ReadConfigReg(offset, device);
-// if (bus == 1) tmp = pci1ReadConfigReg (offset,device);
-
- if ((offset % 4) == 0)
- tmp = (tmp & 0xffff0000) | (val & 0xffff);
- if ((offset % 4) == 2)
- tmp = (tmp & 0x0000ffff) | ((val & 0xffff) << 16);
-
- if (bus == 0)
- pci0WriteConfigReg(offset, device, tmp);
-// if (bus == 1) pci1WriteConfigReg (offset,device,tmp);
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int galileo_pcibios_write_config_byte(struct pci_dev *device,
- int offset, u8 val)
-{
- int dev, bus;
- unsigned long tmp;
-
- bus = device->bus->number;
- dev = PCI_SLOT(device->devfn);
-
- if (pci_range_ck(bus, dev))
- return PCIBIOS_DEVICE_NOT_FOUND;
- if (bus == 0)
- tmp = pci0ReadConfigReg(offset, device);
-// if (bus == 1) tmp = pci1ReadConfigReg (offset,device);
-
- if ((offset % 4) == 0)
- tmp = (tmp & 0xffffff00) | (val & 0xff);
- if ((offset % 4) == 1)
- tmp = (tmp & 0xffff00ff) | ((val & 0xff) << 8);
- if ((offset % 4) == 2)
- tmp = (tmp & 0xff00ffff) | ((val & 0xff) << 16);
- if ((offset % 4) == 3)
- tmp = (tmp & 0x00ffffff) | ((val & 0xff) << 24);
-
- if (bus == 0)
- pci0WriteConfigReg(offset, device, tmp);
-// if (bus == 1) pci1WriteConfigReg (offset,device,tmp);
-
+ if (busnum == 0){
+ tmp = pci0ReadConfigReg(offset, bus->dev);
+ //if (busnum == 1) tmp = pci1ReadConfigReg (offset,bus->dev);
+ if (size == 1) {
+ if ((offset % 4) == 0)
+ tmp = (tmp & 0xffffff00) | (val & (u8)0xff);
+ if ((offset % 4) == 1)
+ tmp = (tmp & 0xffff00ff) | ((val & (u8)0xff) << 8);
+ if ((offset % 4) == 2)
+ tmp = (tmp & 0xff00ffff) | ((val & (u8)0xff) << 16);
+ if ((offset % 4) == 3)
+ tmp = (tmp & 0x00ffffff) | ((val & (u8)0xff) << 24);
+ } else if (size == 2) {
+ if ((offset % 4) == 0)
+ tmp = (tmp & 0xffff0000) | (val & (u16)0xffff);
+ if ((offset % 4) == 2)
+ tmp = (tmp & 0x0000ffff) | ((val & (u16)0xffff) << 16);
+ }
+ if (busnum == 0)
+ pci0WriteConfigReg(offset, bus->dev, tmp);
+ //if (busnum == 1) pci1WriteConfigReg (offset,bus->dev,tmp);
+ }
return PCIBIOS_SUCCESSFUL;
}
@@ -792,9 +726,9 @@
{
u16 cmd;
- galileo_pcibios_read_config_word(dev, PCI_COMMAND, &cmd);
+ galileo_pcibios_read(dev->bus, dev->devfn, PCI_COMMAND, 2, &cmd);
cmd |= PCI_COMMAND_MASTER;
- galileo_pcibios_write_config_word(dev, PCI_COMMAND, cmd);
+ galileo_pcibios_write(dev->bus, dev->devfn, PCI_COMMAND, 2, cmd);
}
/* Externally-expected functions. Do not change function names */
@@ -806,7 +740,7 @@
int idx;
struct resource *r;
- galileo_pcibios_read_config_word(dev, PCI_COMMAND, &cmd);
+ galileo_pcibios_read(dev->bus, dev->devfn, PCI_COMMAND, 2, &cmd);
old_cmd = cmd;
for (idx = 0; idx < 6; idx++) {
r = &dev->resource[idx];
@@ -822,7 +756,7 @@
cmd |= PCI_COMMAND_MEMORY;
}
if (cmd != old_cmd) {
- galileo_pcibios_write_config_word(dev, PCI_COMMAND, cmd);
+ galileo_pcibios_write(dev->bus, dev->devfn, PCI_COMMAND, 2, cmd);
}
/*
@@ -830,19 +764,17 @@
* line size = 32 bytes / sizeof dword (4) = 8.
* Latency timer must be > 8. 32 is random but appears to work.
*/
- galileo_pcibios_read_config_byte(dev, PCI_CACHE_LINE_SIZE, &tmp1);
+ galileo_pcibios_read(dev->bus, dev->devfn, PCI_CACHE_LINE_SIZE, 1, &tmp1);
if (tmp1 != 8) {
printk(KERN_WARNING "PCI setting cache line size to 8 from "
"%d\n", tmp1);
- galileo_pcibios_write_config_byte(dev, PCI_CACHE_LINE_SIZE,
- 8);
+ galileo_pcibios_write(dev->bus, dev->devfn, PCI_CACHE_LINE_SIZE, 1, 8);
}
- galileo_pcibios_read_config_byte(dev, PCI_LATENCY_TIMER, &tmp1);
+ galileo_pcibios_read(dev->bus, dev->devfn, PCI_LATENCY_TIMER, 1, &tmp1);
if (tmp1 < 32) {
printk(KERN_WARNING "PCI setting latency timer to 32 from %d\n",
tmp1);
- galileo_pcibios_write_config_byte(dev, PCI_LATENCY_TIMER,
- 32);
+ galileo_pcibios_write(dev->bus, dev->devfn, PCI_LATENCY_TIMER, 1, 32);
}
return 0;
@@ -909,12 +841,8 @@
}
struct pci_ops galileo_pci_ops = {
- galileo_pcibios_read_config_byte,
- galileo_pcibios_read_config_word,
- galileo_pcibios_read_config_dword,
- galileo_pcibios_write_config_byte,
- galileo_pcibios_write_config_word,
- galileo_pcibios_write_config_dword
+ .read = galileo_pcibios_read,
+ .write = galileo_pcibios_write,
};
struct pci_fixup pcibios_fixups[] = {
diff -Nru a/arch/mips/ite-boards/generic/it8172_pci.c b/arch/mips/ite-boards/generic/it8172_pci.c
--- a/arch/mips/ite-boards/generic/it8172_pci.c Sat Aug 31 15:06:06 2002
+++ b/arch/mips/ite-boards/generic/it8172_pci.c Sat Aug 31 15:06:06 2002
@@ -45,18 +45,17 @@
#undef DEBUG_CONFIG_CYCLES
static int
-it8172_pcibios_config_access(unsigned char access_type, struct pci_dev *dev,
- unsigned char where, u32 *data)
+it8172_pcibios_config_access(unsigned char access_type, struct pci_bus *bus, unsigned int devfn, unsigned char where, u32 *data)
{
/*
* config cycles are on 4 byte boundary only
*/
- unsigned char bus = dev->bus->number;
- unsigned char dev_fn = dev->devfn;
+ unsigned char bus = bus->number;
+ unsigned char dev_fn = (char)devfn;
#ifdef DEBUG_CONFIG_CYCLES
- printk("it config: type %d dev %x bus %d dev_fn %x data %x\n",
- access_type, dev, bus, dev_fn, *data);
+ printk("it config: type %d bus %d dev_fn %x data %x\n",
+ access_type, bus, dev_fn, *data);
#endif
@@ -86,121 +85,63 @@
* read/write a 32bit word and mask/modify the data we actually want.
*/
static int
-it8172_pcibios_read_config_byte (struct pci_dev *dev, int where, u8 *val)
+it8172_pcibios_read (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val)
{
u32 data = 0;
- if (it8172_pcibios_config_access(PCI_ACCESS_READ, dev, where, &data))
- return -1;
-
- *val = (data >> ((where & 3) << 3)) & 0xff;
-#ifdef DEBUG
- printk("cfg read byte: bus %d dev_fn %x where %x: val %x\n",
- dev->bus->number, dev->devfn, where, *val);
-#endif
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-
-static int
-it8172_pcibios_read_config_word (struct pci_dev *dev, int where, u16 *val)
-{
- u32 data = 0;
-
- if (where & 1)
+ if ((size == 2) && (where & 1))
return PCIBIOS_BAD_REGISTER_NUMBER;
-
- if (it8172_pcibios_config_access(PCI_ACCESS_READ, dev, where, &data))
- return -1;
-
- *val = (data >> ((where & 3) << 3)) & 0xffff;
-#ifdef DEBUG
- printk("cfg read word: bus %d dev_fn %x where %x: val %x\n",
- dev->bus->number, dev->devfn, where, *val);
-#endif
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int
-it8172_pcibios_read_config_dword (struct pci_dev *dev, int where, u32 *val)
-{
- u32 data = 0;
-
- if (where & 3)
+ else if ((size == 4) && (where & 3))
return PCIBIOS_BAD_REGISTER_NUMBER;
-
- if (it8172_pcibios_config_access(PCI_ACCESS_READ, dev, where, &data))
+ if (it8172_pcibios_config_access(PCI_ACCESS_READ, bus, devfn, where, &data))
return -1;
+ if (size == 1)
+ *val = (u8)(data >> ((where & 3) << 3)) & 0xff;
+ else if (size == 2)
+ *val = (u16)(data >> ((where & 3) << 3)) & 0xffff;
+ else if (size == 4)
+ *val = data;
- *val = data;
#ifdef DEBUG
- printk("cfg read dword: bus %d dev_fn %x where %x: val %x\n",
- dev->bus->number, dev->devfn, where, *val);
+ printk("cfg read: bus %d devfn %x where %x size %x: val %x\n",
+ bus->number, devfn, where, size, *val);
#endif
return PCIBIOS_SUCCESSFUL;
}
-
static int
-it8172_pcibios_write_config_byte (struct pci_dev *dev, int where, u8 val)
+it8172_pcibios_write (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val)
{
u32 data = 0;
-
- if (it8172_pcibios_config_access(PCI_ACCESS_READ, dev, where, &data))
- return -1;
-
- data = (data & ~(0xff << ((where & 3) << 3))) |
- (val << ((where & 3) << 3));
- if (it8172_pcibios_config_access(PCI_ACCESS_WRITE, dev, where, &data))
- return -1;
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int
-it8172_pcibios_write_config_word (struct pci_dev *dev, int where, u16 val)
-{
- u32 data = 0;
-
- if (where & 1)
+ if ((size == 2) && (where & 1))
return PCIBIOS_BAD_REGISTER_NUMBER;
+ else if (size == 4) {
+ if (where & 3)
+ return PCIBIOS_BAD_REGISTER_NUMBER;
+ if (it8172_pcibios_config_access(PCI_ACCESS_WRITE, bus, devfn, where, &val))
+ return -1;
+ return PCIBIOS_SUCCESSFUL;
+ }
- if (it8172_pcibios_config_access(PCI_ACCESS_READ, dev, where, &data))
- return -1;
-
- data = (data & ~(0xffff << ((where & 3) << 3))) |
- (val << ((where & 3) << 3));
-
- if (it8172_pcibios_config_access(PCI_ACCESS_WRITE, dev, where, &data))
- return -1;
-
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int
-it8172_pcibios_write_config_dword(struct pci_dev *dev, int where, u32 val)
-{
- if (where & 3)
- return PCIBIOS_BAD_REGISTER_NUMBER;
+ if (it8172_pcibios_config_access(PCI_ACCESS_READ, bus, devfn, where, &data))
+ return -1;
- if (it8172_pcibios_config_access(PCI_ACCESS_WRITE, dev, where, &val))
- return -1;
+ if(size == 1) {
+ data = (u8)(data & ~(0xff << ((where & 3) << 3))) |
+ (val << ((where & 3) << 3));
+ } else if (size == 2) {
+ data = (u16)(data & ~(0xffff << ((where & 3) << 3))) |
+ (val << ((where & 3) << 3));
+ }
return PCIBIOS_SUCCESSFUL;
}
struct pci_ops it8172_pci_ops = {
- it8172_pcibios_read_config_byte,
- it8172_pcibios_read_config_word,
- it8172_pcibios_read_config_dword,
- it8172_pcibios_write_config_byte,
- it8172_pcibios_write_config_word,
- it8172_pcibios_write_config_dword
+ .read = it8172_pcibios_read,
+ .write = it8172_pcibios_write,
};
void __init pcibios_init(void)
diff -Nru a/arch/mips/kernel/irixelf.c b/arch/mips/kernel/irixelf.c
--- a/arch/mips/kernel/irixelf.c Sat Aug 31 15:06:00 2002
+++ b/arch/mips/kernel/irixelf.c Sat Aug 31 15:06:00 2002
@@ -54,7 +54,6 @@
#ifndef elf_addr_t
#define elf_addr_t unsigned long
-#define elf_caddr_t char *
#endif
#ifdef DEBUG_ELF
@@ -155,8 +154,8 @@
unsigned int interp_load_addr,
struct pt_regs *regs, struct elf_phdr *ephdr)
{
- elf_caddr_t *argv;
- elf_caddr_t *envp;
+ elf_addr_t *argv;
+ elf_addr_t *envp;
elf_addr_t *sp, *csp;
#ifdef DEBUG_ELF
@@ -202,20 +201,20 @@
#undef NEW_AUX_ENT
sp -= envc+1;
- envp = (elf_caddr_t *) sp;
+ envp = sp;
sp -= argc+1;
- argv = (elf_caddr_t *) sp;
+ argv = sp;
__put_user((elf_addr_t)argc,--sp);
current->mm->arg_start = (unsigned long) p;
while (argc-->0) {
- __put_user((elf_caddr_t)(unsigned long)p,argv++);
+ __put_user((unsigned long)p,argv++);
p += strlen_user(p);
}
__put_user(NULL, argv);
current->mm->arg_end = current->mm->env_start = (unsigned long) p;
while (envc-->0) {
- __put_user((elf_caddr_t)(unsigned long)p,envp++);
+ __put_user((unsigned long)p,envp++);
p += strlen_user(p);
}
__put_user(NULL, envp);
diff -Nru a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
--- a/arch/mips/kernel/setup.c Sat Aug 31 15:05:55 2002
+++ b/arch/mips/kernel/setup.c Sat Aug 31 15:05:55 2002
@@ -285,7 +285,7 @@
mips_cpu.isa_level = MIPS_CPU_ISA_IV;
mips_cpu.options = MIPS_CPU_TLB | MIPS_CPU_4KEX |
MIPS_CPU_FPU | MIPS_CPU_32FPR;
- mips_cpu.tlbsize = 384; /* has wierd TLB: 3-way x 128 */
+ mips_cpu.tlbsize = 384; /* has weird TLB: 3-way x 128 */
break;
case PRID_IMP_R10000:
mips_cpu.cputype = CPU_R10000;
diff -Nru a/arch/mips/mips-boards/generic/pci.c b/arch/mips/mips-boards/generic/pci.c
--- a/arch/mips/mips-boards/generic/pci.c Sat Aug 31 15:05:59 2002
+++ b/arch/mips/mips-boards/generic/pci.c Sat Aug 31 15:05:59 2002
@@ -37,11 +37,9 @@
#define PCI_ACCESS_WRITE 1
static int
-mips_pcibios_config_access(unsigned char access_type, struct pci_dev *dev,
- unsigned char where, u32 *data)
+mips_pcibios_config_access(unsigned char access_type, struct pci_bus *bus_dev, unsigned int dev_fn, unsigned char where, u32 *data)
{
- unsigned char bus = dev->bus->number;
- unsigned char dev_fn = dev->devfn;
+ unsigned char bus = bus_dev->number;
u32 intr;
if ((bus == 0) && (dev_fn >= PCI_DEVFN(31,0)))
@@ -101,109 +99,56 @@
* read/write a 32bit word and mask/modify the data we actually want.
*/
static int
-mips_pcibios_read_config_byte (struct pci_dev *dev, int where, u8 *val)
+mips_pcibios_read (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val)
{
u32 data = 0;
- if (mips_pcibios_config_access(PCI_ACCESS_READ, dev, where, &data))
- return -1;
-
- *val = (data >> ((where & 3) << 3)) & 0xff;
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-
-static int
-mips_pcibios_read_config_word (struct pci_dev *dev, int where, u16 *val)
-{
- u32 data = 0;
-
- if (where & 1)
+ if((size == 2) && (where & 1))
return PCIBIOS_BAD_REGISTER_NUMBER;
-
- if (mips_pcibios_config_access(PCI_ACCESS_READ, dev, where, &data))
- return -1;
-
- *val = (data >> ((where & 3) << 3)) & 0xffff;
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int
-mips_pcibios_read_config_dword (struct pci_dev *dev, int where, u32 *val)
-{
- u32 data = 0;
-
- if (where & 3)
+ else if ((size == 4) && (where & 3))
return PCIBIOS_BAD_REGISTER_NUMBER;
-
- if (mips_pcibios_config_access(PCI_ACCESS_READ, dev, where, &data))
+ if (mips_pcibios_config_access(PCI_ACCESS_READ, bus, devfn, where, &data))
return -1;
-
- *val = data;
+ if(size == 1)
+ *val = (u8)(data >> ((where & 3) << 3)) & 0xff;
+ else if (size == 2)
+ *val = (u16)(data >> ((where & 3) << 3)) & 0xffff;
+ else if (size == 4)
+ *val = data;
return PCIBIOS_SUCCESSFUL;
}
static int
-mips_pcibios_write_config_byte (struct pci_dev *dev, int where, u8 val)
+mips_pcibios_write (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val)
{
u32 data = 0;
- if (mips_pcibios_config_access(PCI_ACCESS_READ, dev, where, &data))
- return -1;
-
- data = (data & ~(0xff << ((where & 3) << 3))) |
- (val << ((where & 3) << 3));
-
- if (mips_pcibios_config_access(PCI_ACCESS_WRITE, dev, where, &data))
- return -1;
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int
-mips_pcibios_write_config_word (struct pci_dev *dev, int where, u16 val)
-{
- u32 data = 0;
-
- if (where & 1)
- return PCIBIOS_BAD_REGISTER_NUMBER;
-
- if (mips_pcibios_config_access(PCI_ACCESS_READ, dev, where, &data))
- return -1;
-
- data = (data & ~(0xffff << ((where & 3) << 3))) |
- (val << ((where & 3) << 3));
-
- if (mips_pcibios_config_access(PCI_ACCESS_WRITE, dev, where, &data))
- return -1;
-
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int
-mips_pcibios_write_config_dword(struct pci_dev *dev, int where, u32 val)
-{
- if (where & 3)
+ if((size == 2) && (where & 1))
return PCIBIOS_BAD_REGISTER_NUMBER;
-
- if (mips_pcibios_config_access(PCI_ACCESS_WRITE, dev, where, &val))
- return -1;
-
+ else if (size == 4) {
+ if(where & 3)
+ return PCIBIOS_BAD_REGISTER_NUMBER;
+ if(mips_pcibios_config_access(PCI_ACCESS_READ, bus, devfn, where, &val))
+ return -1;
+ return PCIBIOS_SUCCESSFUL;
+ }
+ if (mips_pcibios_config_access(PCI_ACCESS_READ, bus, devfn, where, &data))
+ return -1;
+ if(size == 1) {
+ data = (data & ~(0xff << ((where & 3) << 3))) |
+ (val << ((where & 3) << 3));
+ } else if (size == 2) {
+ data = (data & ~(0xffff << ((where & 3) << 3))) |
+ (val << ((where & 3) << 3));
+ }
return PCIBIOS_SUCCESSFUL;
}
struct pci_ops mips_pci_ops = {
- mips_pcibios_read_config_byte,
- mips_pcibios_read_config_word,
- mips_pcibios_read_config_dword,
- mips_pcibios_write_config_byte,
- mips_pcibios_write_config_word,
- mips_pcibios_write_config_dword
+ .read = mips_pcibios_read,
+ .write = mips_pcibios_write,
};
void __init pcibios_init(void)
diff -Nru a/arch/mips/sni/pci.c b/arch/mips/sni/pci.c
--- a/arch/mips/sni/pci.c Sat Aug 31 15:06:00 2002
+++ b/arch/mips/sni/pci.c Sat Aug 31 15:06:00 2002
@@ -17,13 +17,13 @@
#ifdef CONFIG_PCI
-#define mkaddr(dev, where) \
+#define mkaddr(bus, devfn, where) \
do { \
- if ((dev)->bus->number == 0) \
+ if (bus->number == 0) \
return -1; \
*(volatile u32 *)PCIMT_CONFIG_ADDRESS = \
- ((dev->bus->number & 0xff) << 0x10) | \
- ((dev->devfn & 0xff) << 0x08) | \
+ ((bus->number & 0xff) << 0x10) | \
+ ((devfn & 0xff) << 0x08) | \
(where & 0xfc); \
} while(0)
@@ -69,87 +69,67 @@
* We can't address 8 and 16 bit words directly. Instead we have to
* read/write a 32bit word and mask/modify the data we actually want.
*/
-static int pcimt_read_config_byte (struct pci_dev *dev,
- int where, unsigned char *val)
+static int pcimt_read (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val)
{
u32 res;
- mkaddr(dev, where);
- res = *(volatile u32 *)PCIMT_CONFIG_DATA;
- res = (le32_to_cpu(res) >> ((where & 3) << 3)) & 0xff;
- *val = res;
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int pcimt_read_config_word (struct pci_dev *dev,
- int where, unsigned short *val)
-{
- u32 res;
-
- if (where & 1)
- return PCIBIOS_BAD_REGISTER_NUMBER;
- mkaddr(dev, where);
- res = *(volatile u32 *)PCIMT_CONFIG_DATA;
- res = (le32_to_cpu(res) >> ((where & 3) << 3)) & 0xffff;
- *val = res;
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int pcimt_read_config_dword (struct pci_dev *dev,
- int where, unsigned int *val)
-{
- u32 res;
-
- if (where & 3)
- return PCIBIOS_BAD_REGISTER_NUMBER;
- mkaddr(dev, where);
- res = *(volatile u32 *)PCIMT_CONFIG_DATA;
- res = le32_to_cpu(res);
- *val = res;
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int pcimt_write_config_byte (struct pci_dev *dev,
- int where, unsigned char val)
-{
- mkaddr(dev, where);
- *(volatile u8 *)(PCIMT_CONFIG_DATA + (where & 3)) = val;
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int pcimt_write_config_word (struct pci_dev *dev,
- int where, unsigned short val)
-{
- if (where & 1)
- return PCIBIOS_BAD_REGISTER_NUMBER;
- mkaddr(dev, where);
- *(volatile u16 *)(PCIMT_CONFIG_DATA + (where & 3)) = le16_to_cpu(val);
+ switch (size) {
+ case 1:
+ mkaddr(bus, devfn, where);
+ res = *(volatile u32 *)PCIMT_CONFIG_DATA;
+ res = (le32_to_cpu(res) >> ((where & 3) << 3)) & 0xff;
+ *val = (u8)res;
+ break;
+ case 2:
+ if (where & 1)
+ return PCIBIOS_BAD_REGISTER_NUMBER;
+ mkaddr(bus, devfn, where);
+ res = *(volatile u32 *)PCIMT_CONFIG_DATA;
+ res = (le32_to_cpu(res) >> ((where & 3) << 3)) & 0xffff;
+ *val = (u16)res;
+ break;
+ case 4:
+ if (where & 3)
+ return PCIBIOS_BAD_REGISTER_NUMBER;
+ mkaddr(bus, devfn, where);
+ res = *(volatile u32 *)PCIMT_CONFIG_DATA;
+ res = le32_to_cpu(res);
+ *val = res;
+ break;
+ }
return PCIBIOS_SUCCESSFUL;
}
-static int pcimt_write_config_dword (struct pci_dev *dev,
- int where, unsigned int val)
+static int pcimt_write (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val)
{
- if (where & 3)
- return PCIBIOS_BAD_REGISTER_NUMBER;
- mkaddr(dev, where);
- *(volatile u32 *)PCIMT_CONFIG_DATA = le32_to_cpu(val);
+ switch (size) {
+ case 1:
+ mkaddr(bus, devfn, where);
+ *(volatile u8 *)(PCIMT_CONFIG_DATA + (where & 3)) =
+ (u8)le32_to_cpu(val);
+ break;
+ case 2:
+ if (where & 1)
+ return PCIBIOS_BAD_REGISTER_NUMBER;
+ mkaddr(bus, devfn, where);
+ *(volatile u16 *)(PCIMT_CONFIG_DATA + (where & 3)) =
+ (u16)le32_to_cpu(val);
+ break;
+ case 4:
+ if (where & 3)
+ return PCIBIOS_BAD_REGISTER_NUMBER;
+ mkaddr(bus, devfn, where);
+ *(volatile u32 *)PCIMT_CONFIG_DATA = le32_to_cpu(val);
+ break;
+ }
return PCIBIOS_SUCCESSFUL;
}
struct pci_ops sni_pci_ops = {
- pcimt_read_config_byte,
- pcimt_read_config_word,
- pcimt_read_config_dword,
- pcimt_write_config_byte,
- pcimt_write_config_word,
- pcimt_write_config_dword
+ .read = pcimt_read,
+ .write = pcimt_write,
};
void __init
diff -Nru a/arch/mips64/config.in b/arch/mips64/config.in
--- a/arch/mips64/config.in Sat Aug 31 15:05:54 2002
+++ b/arch/mips64/config.in Sat Aug 31 15:05:54 2002
@@ -189,6 +189,8 @@
fi
endmenu
+source drivers/input/Config.in
+
source drivers/char/Config.in
#source drivers/misc/Config.in
@@ -230,7 +232,6 @@
fi
source drivers/usb/Config.in
-source drivers/input/Config.in
mainmenu_option next_comment
comment 'Kernel hacking'
diff -Nru a/arch/mips64/defconfig b/arch/mips64/defconfig
--- a/arch/mips64/defconfig Sat Aug 31 15:05:55 2002
+++ b/arch/mips64/defconfig Sat Aug 31 15:05:55 2002
@@ -400,6 +400,7 @@
# CONFIG_FREEVXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/mips64/defconfig-ip22 b/arch/mips64/defconfig-ip22
--- a/arch/mips64/defconfig-ip22 Sat Aug 31 15:05:54 2002
+++ b/arch/mips64/defconfig-ip22 Sat Aug 31 15:05:54 2002
@@ -405,6 +405,7 @@
# CONFIG_FREEVXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/mips64/defconfig-ip27 b/arch/mips64/defconfig-ip27
--- a/arch/mips64/defconfig-ip27 Sat Aug 31 15:06:00 2002
+++ b/arch/mips64/defconfig-ip27 Sat Aug 31 15:06:00 2002
@@ -400,6 +400,7 @@
# CONFIG_FREEVXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/mips64/defconfig-ip32 b/arch/mips64/defconfig-ip32
--- a/arch/mips64/defconfig-ip32 Sat Aug 31 15:06:06 2002
+++ b/arch/mips64/defconfig-ip32 Sat Aug 31 15:06:06 2002
@@ -430,6 +430,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/mips64/kernel/binfmt_elf32.c b/arch/mips64/kernel/binfmt_elf32.c
--- a/arch/mips64/kernel/binfmt_elf32.c Sat Aug 31 15:05:59 2002
+++ b/arch/mips64/kernel/binfmt_elf32.c Sat Aug 31 15:05:59 2002
@@ -80,7 +80,6 @@
};
#define elf_addr_t u32
-#define elf_caddr_t u32
#define init_elf_binfmt init_elf32_binfmt
#undef CONFIG_BINFMT_ELF
#ifdef CONFIG_BINFMT_ELF32
diff -Nru a/arch/parisc/defconfig b/arch/parisc/defconfig
--- a/arch/parisc/defconfig Sat Aug 31 15:05:54 2002
+++ b/arch/parisc/defconfig Sat Aug 31 15:05:54 2002
@@ -294,6 +294,7 @@
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/FADS_defconfig b/arch/ppc/configs/FADS_defconfig
--- a/arch/ppc/configs/FADS_defconfig Sat Aug 31 15:06:06 2002
+++ b/arch/ppc/configs/FADS_defconfig Sat Aug 31 15:06:06 2002
@@ -376,6 +376,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/IVMS8_defconfig b/arch/ppc/configs/IVMS8_defconfig
--- a/arch/ppc/configs/IVMS8_defconfig Sat Aug 31 15:05:54 2002
+++ b/arch/ppc/configs/IVMS8_defconfig Sat Aug 31 15:05:54 2002
@@ -404,6 +404,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/SM850_defconfig b/arch/ppc/configs/SM850_defconfig
--- a/arch/ppc/configs/SM850_defconfig Sat Aug 31 15:05:59 2002
+++ b/arch/ppc/configs/SM850_defconfig Sat Aug 31 15:05:59 2002
@@ -372,6 +372,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/SPD823TS_defconfig b/arch/ppc/configs/SPD823TS_defconfig
--- a/arch/ppc/configs/SPD823TS_defconfig Sat Aug 31 15:06:06 2002
+++ b/arch/ppc/configs/SPD823TS_defconfig Sat Aug 31 15:06:06 2002
@@ -371,6 +371,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/TQM823L_defconfig b/arch/ppc/configs/TQM823L_defconfig
--- a/arch/ppc/configs/TQM823L_defconfig Sat Aug 31 15:05:55 2002
+++ b/arch/ppc/configs/TQM823L_defconfig Sat Aug 31 15:05:55 2002
@@ -372,6 +372,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/TQM8260_defconfig b/arch/ppc/configs/TQM8260_defconfig
--- a/arch/ppc/configs/TQM8260_defconfig Sat Aug 31 15:05:55 2002
+++ b/arch/ppc/configs/TQM8260_defconfig Sat Aug 31 15:05:55 2002
@@ -345,6 +345,7 @@
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/TQM850L_defconfig b/arch/ppc/configs/TQM850L_defconfig
--- a/arch/ppc/configs/TQM850L_defconfig Sat Aug 31 15:06:00 2002
+++ b/arch/ppc/configs/TQM850L_defconfig Sat Aug 31 15:06:00 2002
@@ -372,6 +372,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/TQM860L_defconfig b/arch/ppc/configs/TQM860L_defconfig
--- a/arch/ppc/configs/TQM860L_defconfig Sat Aug 31 15:05:59 2002
+++ b/arch/ppc/configs/TQM860L_defconfig Sat Aug 31 15:05:59 2002
@@ -417,6 +417,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/adir_defconfig b/arch/ppc/configs/adir_defconfig
--- a/arch/ppc/configs/adir_defconfig Sat Aug 31 15:06:06 2002
+++ b/arch/ppc/configs/adir_defconfig Sat Aug 31 15:06:06 2002
@@ -514,6 +514,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/apus_defconfig b/arch/ppc/configs/apus_defconfig
--- a/arch/ppc/configs/apus_defconfig Sat Aug 31 15:06:06 2002
+++ b/arch/ppc/configs/apus_defconfig Sat Aug 31 15:06:06 2002
@@ -659,6 +659,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/ash_defconfig b/arch/ppc/configs/ash_defconfig
--- a/arch/ppc/configs/ash_defconfig Sat Aug 31 15:05:54 2002
+++ b/arch/ppc/configs/ash_defconfig Sat Aug 31 15:05:54 2002
@@ -432,6 +432,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/bseip_defconfig b/arch/ppc/configs/bseip_defconfig
--- a/arch/ppc/configs/bseip_defconfig Sat Aug 31 15:05:55 2002
+++ b/arch/ppc/configs/bseip_defconfig Sat Aug 31 15:05:55 2002
@@ -371,6 +371,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/ceder_defconfig b/arch/ppc/configs/ceder_defconfig
--- a/arch/ppc/configs/ceder_defconfig Sat Aug 31 15:06:06 2002
+++ b/arch/ppc/configs/ceder_defconfig Sat Aug 31 15:06:06 2002
@@ -434,6 +434,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/common_defconfig b/arch/ppc/configs/common_defconfig
--- a/arch/ppc/configs/common_defconfig Sat Aug 31 15:05:55 2002
+++ b/arch/ppc/configs/common_defconfig Sat Aug 31 15:05:55 2002
@@ -725,6 +725,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/ppc/configs/cpci405_defconfig b/arch/ppc/configs/cpci405_defconfig
--- a/arch/ppc/configs/cpci405_defconfig Sat Aug 31 15:05:59 2002
+++ b/arch/ppc/configs/cpci405_defconfig Sat Aug 31 15:05:59 2002
@@ -458,6 +458,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/ep405_defconfig b/arch/ppc/configs/ep405_defconfig
--- a/arch/ppc/configs/ep405_defconfig Sat Aug 31 15:06:06 2002
+++ b/arch/ppc/configs/ep405_defconfig Sat Aug 31 15:06:06 2002
@@ -428,6 +428,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/est8260_defconfig b/arch/ppc/configs/est8260_defconfig
--- a/arch/ppc/configs/est8260_defconfig Sat Aug 31 15:06:00 2002
+++ b/arch/ppc/configs/est8260_defconfig Sat Aug 31 15:06:00 2002
@@ -355,6 +355,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/ev64260_defconfig b/arch/ppc/configs/ev64260_defconfig
--- a/arch/ppc/configs/ev64260_defconfig Sat Aug 31 15:05:59 2002
+++ b/arch/ppc/configs/ev64260_defconfig Sat Aug 31 15:05:59 2002
@@ -473,6 +473,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/ppc/configs/gemini_defconfig b/arch/ppc/configs/gemini_defconfig
--- a/arch/ppc/configs/gemini_defconfig Sat Aug 31 15:05:59 2002
+++ b/arch/ppc/configs/gemini_defconfig Sat Aug 31 15:05:59 2002
@@ -453,6 +453,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/ppc/configs/iSeries_defconfig b/arch/ppc/configs/iSeries_defconfig
--- a/arch/ppc/configs/iSeries_defconfig Sat Aug 31 15:05:54 2002
+++ b/arch/ppc/configs/iSeries_defconfig Sat Aug 31 15:05:54 2002
@@ -364,6 +364,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/ppc/configs/ibmchrp_defconfig b/arch/ppc/configs/ibmchrp_defconfig
--- a/arch/ppc/configs/ibmchrp_defconfig Sat Aug 31 15:06:00 2002
+++ b/arch/ppc/configs/ibmchrp_defconfig Sat Aug 31 15:06:00 2002
@@ -593,6 +593,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/ppc/configs/k2_defconfig b/arch/ppc/configs/k2_defconfig
--- a/arch/ppc/configs/k2_defconfig Sat Aug 31 15:05:54 2002
+++ b/arch/ppc/configs/k2_defconfig Sat Aug 31 15:05:54 2002
@@ -494,6 +494,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/lopec_defconfig b/arch/ppc/configs/lopec_defconfig
--- a/arch/ppc/configs/lopec_defconfig Sat Aug 31 15:05:54 2002
+++ b/arch/ppc/configs/lopec_defconfig Sat Aug 31 15:05:54 2002
@@ -681,6 +681,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/mbx_defconfig b/arch/ppc/configs/mbx_defconfig
--- a/arch/ppc/configs/mbx_defconfig Sat Aug 31 15:05:53 2002
+++ b/arch/ppc/configs/mbx_defconfig Sat Aug 31 15:05:53 2002
@@ -364,6 +364,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/mcpn765_defconfig b/arch/ppc/configs/mcpn765_defconfig
--- a/arch/ppc/configs/mcpn765_defconfig Sat Aug 31 15:06:01 2002
+++ b/arch/ppc/configs/mcpn765_defconfig Sat Aug 31 15:06:01 2002
@@ -404,6 +404,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/menf1_defconfig b/arch/ppc/configs/menf1_defconfig
--- a/arch/ppc/configs/menf1_defconfig Sat Aug 31 15:05:53 2002
+++ b/arch/ppc/configs/menf1_defconfig Sat Aug 31 15:05:53 2002
@@ -503,6 +503,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/mvme5100_defconfig b/arch/ppc/configs/mvme5100_defconfig
--- a/arch/ppc/configs/mvme5100_defconfig Sat Aug 31 15:05:54 2002
+++ b/arch/ppc/configs/mvme5100_defconfig Sat Aug 31 15:05:54 2002
@@ -552,6 +552,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/oak_defconfig b/arch/ppc/configs/oak_defconfig
--- a/arch/ppc/configs/oak_defconfig Sat Aug 31 15:05:54 2002
+++ b/arch/ppc/configs/oak_defconfig Sat Aug 31 15:05:54 2002
@@ -407,6 +407,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/pcore_defconfig b/arch/ppc/configs/pcore_defconfig
--- a/arch/ppc/configs/pcore_defconfig Sat Aug 31 15:06:00 2002
+++ b/arch/ppc/configs/pcore_defconfig Sat Aug 31 15:06:00 2002
@@ -504,6 +504,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/pmac_defconfig b/arch/ppc/configs/pmac_defconfig
--- a/arch/ppc/configs/pmac_defconfig Sat Aug 31 15:06:06 2002
+++ b/arch/ppc/configs/pmac_defconfig Sat Aug 31 15:06:06 2002
@@ -805,6 +805,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/ppc/configs/power3_defconfig b/arch/ppc/configs/power3_defconfig
--- a/arch/ppc/configs/power3_defconfig Sat Aug 31 15:05:55 2002
+++ b/arch/ppc/configs/power3_defconfig Sat Aug 31 15:05:55 2002
@@ -577,6 +577,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/pplus_defconfig b/arch/ppc/configs/pplus_defconfig
--- a/arch/ppc/configs/pplus_defconfig Sat Aug 31 15:06:01 2002
+++ b/arch/ppc/configs/pplus_defconfig Sat Aug 31 15:06:01 2002
@@ -596,6 +596,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/prpmc750_defconfig b/arch/ppc/configs/prpmc750_defconfig
--- a/arch/ppc/configs/prpmc750_defconfig Sat Aug 31 15:05:55 2002
+++ b/arch/ppc/configs/prpmc750_defconfig Sat Aug 31 15:05:55 2002
@@ -440,6 +440,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/prpmc800_defconfig b/arch/ppc/configs/prpmc800_defconfig
--- a/arch/ppc/configs/prpmc800_defconfig Sat Aug 31 15:05:59 2002
+++ b/arch/ppc/configs/prpmc800_defconfig Sat Aug 31 15:05:59 2002
@@ -454,6 +454,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/redwood5_defconfig b/arch/ppc/configs/redwood5_defconfig
--- a/arch/ppc/configs/redwood5_defconfig Sat Aug 31 15:05:55 2002
+++ b/arch/ppc/configs/redwood5_defconfig Sat Aug 31 15:05:55 2002
@@ -433,6 +433,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/redwood_defconfig b/arch/ppc/configs/redwood_defconfig
--- a/arch/ppc/configs/redwood_defconfig Sat Aug 31 15:06:00 2002
+++ b/arch/ppc/configs/redwood_defconfig Sat Aug 31 15:06:00 2002
@@ -372,6 +372,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/rpxcllf_defconfig b/arch/ppc/configs/rpxcllf_defconfig
--- a/arch/ppc/configs/rpxcllf_defconfig Sat Aug 31 15:05:55 2002
+++ b/arch/ppc/configs/rpxcllf_defconfig Sat Aug 31 15:05:55 2002
@@ -371,6 +371,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/rpxlite_defconfig b/arch/ppc/configs/rpxlite_defconfig
--- a/arch/ppc/configs/rpxlite_defconfig Sat Aug 31 15:05:55 2002
+++ b/arch/ppc/configs/rpxlite_defconfig Sat Aug 31 15:05:55 2002
@@ -371,6 +371,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/sandpoint_defconfig b/arch/ppc/configs/sandpoint_defconfig
--- a/arch/ppc/configs/sandpoint_defconfig Sat Aug 31 15:06:00 2002
+++ b/arch/ppc/configs/sandpoint_defconfig Sat Aug 31 15:06:00 2002
@@ -687,6 +687,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/spruce_defconfig b/arch/ppc/configs/spruce_defconfig
--- a/arch/ppc/configs/spruce_defconfig Sat Aug 31 15:05:54 2002
+++ b/arch/ppc/configs/spruce_defconfig Sat Aug 31 15:05:54 2002
@@ -402,6 +402,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/walnut_defconfig b/arch/ppc/configs/walnut_defconfig
--- a/arch/ppc/configs/walnut_defconfig Sat Aug 31 15:06:06 2002
+++ b/arch/ppc/configs/walnut_defconfig Sat Aug 31 15:06:06 2002
@@ -428,6 +428,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc/configs/zx4500_defconfig b/arch/ppc/configs/zx4500_defconfig
--- a/arch/ppc/configs/zx4500_defconfig Sat Aug 31 15:05:55 2002
+++ b/arch/ppc/configs/zx4500_defconfig Sat Aug 31 15:05:55 2002
@@ -409,6 +409,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/ppc/defconfig b/arch/ppc/defconfig
--- a/arch/ppc/defconfig Sat Aug 31 15:05:55 2002
+++ b/arch/ppc/defconfig Sat Aug 31 15:05:55 2002
@@ -725,6 +725,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/ppc/mm/tlb.c b/arch/ppc/mm/tlb.c
--- a/arch/ppc/mm/tlb.c Sat Aug 31 15:06:03 2002
+++ b/arch/ppc/mm/tlb.c Sat Aug 31 15:06:03 2002
@@ -4,7 +4,7 @@
/*
* This file contains the routines for TLB flushing.
* On machines where the MMU uses a hash table to store virtual to
- * physical translations, these routines flush entries from the the
+ * physical translations, these routines flush entries from the
* hash table also.
* -- paulus
*
diff -Nru a/arch/ppc64/defconfig b/arch/ppc64/defconfig
--- a/arch/ppc64/defconfig Sat Aug 31 15:05:55 2002
+++ b/arch/ppc64/defconfig Sat Aug 31 15:05:55 2002
@@ -584,6 +584,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/ppc64/kernel/iSeries_IoMmTable.c b/arch/ppc64/kernel/iSeries_IoMmTable.c
--- a/arch/ppc64/kernel/iSeries_IoMmTable.c Sat Aug 31 15:06:06 2002
+++ b/arch/ppc64/kernel/iSeries_IoMmTable.c Sat Aug 31 15:06:06 2002
@@ -130,7 +130,7 @@
/* The HvCallPci_getBarParms is used to get the size of the BAR */
/* space. It calls iSeries_IoMmTable_AllocateEntry to allocate */
/* each entry. */
-/* - Loops through The Bar resourses(0 - 5) including the the ROM */
+/* - Loops through The Bar resources(0 - 5) including the ROM */
/* is resource(6). */
/*******************************************************************/
void iSeries_allocateDeviceBars(struct pci_dev* PciDev)
diff -Nru a/arch/s390/defconfig b/arch/s390/defconfig
--- a/arch/s390/defconfig Sat Aug 31 15:06:06 2002
+++ b/arch/s390/defconfig Sat Aug 31 15:06:06 2002
@@ -295,6 +295,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/s390x/defconfig b/arch/s390x/defconfig
--- a/arch/s390x/defconfig Sat Aug 31 15:05:53 2002
+++ b/arch/s390x/defconfig Sat Aug 31 15:05:53 2002
@@ -295,6 +295,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
diff -Nru a/arch/s390x/kernel/binfmt_elf32.c b/arch/s390x/kernel/binfmt_elf32.c
--- a/arch/s390x/kernel/binfmt_elf32.c Sat Aug 31 15:06:00 2002
+++ b/arch/s390x/kernel/binfmt_elf32.c Sat Aug 31 15:06:00 2002
@@ -166,7 +166,6 @@
#define NEW_TO_OLD_GID(gid) ((gid) > 65535) ? (u16)overflowgid : (u16)(gid)
#define elf_addr_t u32
-#define elf_caddr_t u32
/*
#define init_elf_binfmt init_elf32_binfmt
*/
diff -Nru a/arch/sh/defconfig b/arch/sh/defconfig
--- a/arch/sh/defconfig Sat Aug 31 15:05:54 2002
+++ b/arch/sh/defconfig Sat Aug 31 15:05:54 2002
@@ -156,6 +156,7 @@
# CONFIG_MINIX_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/sh/kernel/irq_intc2.c b/arch/sh/kernel/irq_intc2.c
--- a/arch/sh/kernel/irq_intc2.c Sat Aug 31 15:06:04 2002
+++ b/arch/sh/kernel/irq_intc2.c Sat Aug 31 15:06:04 2002
@@ -107,7 +107,7 @@
}
disable_irq_nosync(irq);
- /* Fill the the data we need */
+ /* Fill the data we need */
intc2_data[offset].addr=addr;
intc2_data[offset].mask=1<bus->number==0 && dev->devfn==0)
+#define BBA_SELECTED(bus,devfn) (bus->number==0 && devfn==0)
-static int gapspci_read_config_byte(struct pci_dev *dev, int where,
- u8 * val)
+static int gapspci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 * val)
{
- if (BBA_SELECTED(dev))
- *val = inb(GAPSPCI_BBA_CONFIG+where);
- else
- *val = 0xff;
-
+ switch (size) {
+ case 1:
+ if (BBA_SELECTED(bus, devfn))
+ *val = (u8)inb(GAPSPCI_BBA_CONFIG+where);
+ else
+ *val = (u8)0xff;
+ break;
+ case 2:
+ if (BBA_SELECTED(bus, devfn))
+ *val = (u16)inw(GAPSPCI_BBA_CONFIG+where);
+ else
+ *val = (u16)0xffff;
+ break;
+ case 4:
+ if (BBA_SELECTED(bus, devfn))
+ *val = inl(GAPSPCI_BBA_CONFIG+where);
+ else
+ *val = 0xffffffff;
+ break;
+ }
return PCIBIOS_SUCCESSFUL;
}
-static int gapspci_read_config_word(struct pci_dev *dev, int where,
- u16 * val)
-{
- if (BBA_SELECTED(dev))
- *val = inw(GAPSPCI_BBA_CONFIG+where);
- else
- *val = 0xffff;
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int gapspci_read_config_dword(struct pci_dev *dev, int where,
- u32 * val)
-{
- if (BBA_SELECTED(dev))
- *val = inl(GAPSPCI_BBA_CONFIG+where);
- else
- *val = 0xffffffff;
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int gapspci_write_config_byte(struct pci_dev *dev, int where,
- u8 val)
-{
- if (BBA_SELECTED(dev))
- outb(val, GAPSPCI_BBA_CONFIG+where);
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-
-static int gapspci_write_config_word(struct pci_dev *dev, int where,
- u16 val)
-{
- if (BBA_SELECTED(dev))
- outw(val, GAPSPCI_BBA_CONFIG+where);
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int gapspci_write_config_dword(struct pci_dev *dev, int where,
- u32 val)
+static int gapspci_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val)
{
- if (BBA_SELECTED(dev))
- outl(val, GAPSPCI_BBA_CONFIG+where);
-
- return PCIBIOS_SUCCESSFUL;
+ if (BBA_SELECTED(bus, devfn)) {
+ switch (size) {
+ case 1:
+ if (BBA_SELECTED(bus, devfn))
+ outb((u8)val, GAPSPCI_BBA_CONFIG+where);
+ break;
+ case 2:
+ if (BBA_SELECTED(bus, devfn))
+ outw((u16)val, GAPSPCI_BBA_CONFIG+where);
+ break;
+ case 4:
+ if (BBA_SELECTED(bus, devfn))
+ outl(val, GAPSPCI_BBA_CONFIG+where);
+ break;
+ }
+ }
+ return PCIBIOS_SUCCESSFUL;
}
static struct pci_ops pci_config_ops = {
- gapspci_read_config_byte,
- gapspci_read_config_word,
- gapspci_read_config_dword,
- gapspci_write_config_byte,
- gapspci_write_config_word,
- gapspci_write_config_dword
+ .read = gapspci_read,
+ .write = gapspci_write,
};
@@ -143,7 +124,7 @@
for (ln=bus->devices.next; ln != &bus->devices; ln=ln->next) {
dev = pci_dev_b(ln);
- if (!BBA_SELECTED(dev)) continue;
+ if (!BBA_SELECTED(bus, dev->devfn)) continue;
printk("PCI: MMIO fixup to %s\n", dev->name);
dev->resource[1].start=0x01001700;
diff -Nru a/arch/sh/kernel/pci-sh7751.c b/arch/sh/kernel/pci-sh7751.c
--- a/arch/sh/kernel/pci-sh7751.c Sat Aug 31 15:05:54 2002
+++ b/arch/sh/kernel/pci-sh7751.c Sat Aug 31 15:05:54 2002
@@ -41,14 +41,14 @@
#ifdef CONFIG_PCI_DIRECT
-#define CONFIG_CMD(dev, where) (0x80000000 | (dev->bus->number << 16) | (dev->devfn << 8) | (where & ~3))
+#define CONFIG_CMD(bus, devfn, where) (0x80000000 | (bus->number << 16) | (devfn << 8) | (where & ~3))
#define PCI_REG(reg) (SH7751_PCIREG_BASE+reg)
/*
* Functions for accessing PCI configuration space with type 1 accesses
*/
-static int pci_conf1_read_config_byte(struct pci_dev *dev, int where, u8 *value)
+static int pci_conf1_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value)
{
u32 word;
unsigned long flags;
@@ -57,144 +57,88 @@
* so we must do byte alignment by hand
*/
save_and_cli(flags);
- outl(CONFIG_CMD(dev,where), PCI_REG(SH7751_PCIPAR));
+ outl(CONFIG_CMD(bus,devfn,where), PCI_REG(SH7751_PCIPAR));
word = inl(PCI_REG(SH7751_PCIPDR));
restore_flags(flags);
- switch (where & 0x3) {
- case 3:
- *value = (u8)(word >> 24);
- break;
- case 2:
- *value = (u8)(word >> 16);
- break;
- case 1:
- *value = (u8)(word >> 8);
- break;
- default:
- *value = (u8)word;
- break;
- }
- PCIDBG(4,"pci_conf1_read_config_byte@0x%08x=0x%x\n",
- CONFIG_CMD(dev,where),*value);
- return PCIBIOS_SUCCESSFUL;
-}
-static int pci_conf1_read_config_word(struct pci_dev *dev, int where, u16 *value)
-{
- u32 word;
- unsigned long flags;
-
- /* PCIPDR may only be accessed as 32 bit words,
- * so we must do word alignment by hand
- */
- save_and_cli(flags);
- outl(CONFIG_CMD(dev,where), PCI_REG(SH7751_PCIPAR));
- word = inl(PCI_REG(SH7751_PCIPDR));
- restore_flags(flags);
- switch (where & 0x3) {
- case 3:
- // This should never happen...
- printk(KERN_ERR "PCI BIOS: read_config_word: Illegal u16 alignment");
- return PCIBIOS_BAD_REGISTER_NUMBER;
- case 2:
- *value = (u16)(word >> 16);
- break;
+ switch (size) {
case 1:
- *value = (u16)(word >> 8);
- break;
- default:
- *value = (u16)word;
+ switch (where & 0x3) {
+ case 3:
+ *value = (u8)(word >> 24);
+ break;
+ case 2:
+ *value = (u8)(word >> 16);
+ break;
+ case 1:
+ *value = (u8)(word >> 8);
+ break;
+ default:
+ *value = (u8)word;
+ break;
+ }
+ case 2:
+ switch (where & 0x3) {
+ case 3: /*This should never happen.*/
+ printk(KERN_ERR "PCI BIOS: read_config: Illegal u16 alignment");
+ return PCIBIOS_BAD_REGISTER_NUMBER;
+ case 2:
+ *value = (u16)(word >> 16);
+ break;
+ case 1:
+ *value = (u16)(word >> 8);
+ break;
+ default:
+ *value = (u16)word;
+ break;
+ }
+ case 4:
+ *value = word;
break;
- }
- PCIDBG(4,"pci_conf1_read_config_word@0x%08x=0x%x\n",
- CONFIG_CMD(dev,where),*value);
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int pci_conf1_read_config_dword(struct pci_dev *dev, int where, u32 *value)
-{
- unsigned long flags;
-
- save_and_cli(flags);
- outl(CONFIG_CMD(dev,where), PCI_REG(SH7751_PCIPAR));
- *value = inl(PCI_REG(SH7751_PCIPDR));
- restore_flags(flags);
- PCIDBG(4,"pci_conf1_read_config_dword@0x%08x=0x%x\n",
- CONFIG_CMD(dev,where),*value);
+ }
+ PCIDBG(4,"pci_conf1_read@0x%08x=0x%x\n", CONFIG_CMD(bus,devfn,where),*value);
return PCIBIOS_SUCCESSFUL;
}
-static int pci_conf1_write_config_byte(struct pci_dev *dev, int where, u8 value)
+/*
+ * Since SH7751 only does 32bit access we'll have to do a read,mask,write operation.
+ * We'll allow an odd byte offset, though it should be illegal.
+ */
+static int pci_conf1_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value)
{
- u32 word;
- u32 shift = (where & 3) * 8;
- u32 mask = ((1 << 8) - 1) << shift; // create the byte mask
+ u32 word,mask;
unsigned long flags;
-
- /* Since SH7751 only does 32bit access we'll have to do a
- * read,mask,write operation
- */
- save_and_cli(flags);
- outl(CONFIG_CMD(dev,where), PCI_REG(SH7751_PCIPAR));
- word = inl(PCI_REG(SH7751_PCIPDR)) ;
- word &= ~mask;
- word |= value << shift;
-
- outl(word, PCI_REG(SH7751_PCIPDR));
- restore_flags(flags);
- PCIDBG(4,"pci_conf1_write_config_byte@0x%08x=0x%x\n",
- CONFIG_CMD(dev,where),word);
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int pci_conf1_write_config_word(struct pci_dev *dev, int where, u16 value)
-{
- u32 word;
u32 shift = (where & 3) * 8;
- u32 mask = ((1 << 16) - 1) << shift; // create the word mask
- unsigned long flags;
- /* Since SH7751 only does 32bit access we'll have to do a
- * read,mask,write operation. We'll allow an odd byte offset,
- * though it should be illegal.
- */
- if (shift == 24)
- return PCIBIOS_BAD_REGISTER_NUMBER;
- save_and_cli(flags);
- outl(CONFIG_CMD(dev,where), PCI_REG(SH7751_PCIPAR));
+ if(size == 1) {
+ mask = ((1 << 8) - 1) << shift; // create the byte mask
+ } else if(size == 2){
+ if(shift == 24)
+ return PCIBIOS_BAD_REGISTER_NUMBER;
+ mask = ((1 << 16) - 1) << shift; // create the word mask
+ }
+ save_and_cli(flags);
+ outl(CONFIG_CMD(bus,devfn,where), PCI_REG(SH7751_PCIPAR));
+ if(size == 4){
+ outl(value, PCI_REG(SH7751_PCIPDR));
+ restore_flags(flags);
+ PCIDBG(4,"pci_conf1_write@0x%08x=0x%x\n", CONFIG_CMD(bus,devfn,where),value);
+ return PCIBIOS_SUCCESSFUL;
+ }
word = inl(PCI_REG(SH7751_PCIPDR)) ;
word &= ~mask;
word |= value << shift;
-
- outl(value, PCI_REG(SH7751_PCIPDR));
- restore_flags(flags);
- PCIDBG(4,"pci_conf1_write_config_word@0x%08x=0x%x\n",
- CONFIG_CMD(dev,where),word);
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int pci_conf1_write_config_dword(struct pci_dev *dev, int where, u32 value)
-{
- unsigned long flags;
-
- save_and_cli(flags);
- outl(CONFIG_CMD(dev,where), PCI_REG(SH7751_PCIPAR));
- outl(value, PCI_REG(SH7751_PCIPDR));
+ outl(word, PCI_REG(SH7751_PCIPDR));
restore_flags(flags);
- PCIDBG(4,"pci_conf1_write_config_dword@0x%08x=0x%x\n",
- CONFIG_CMD(dev,where),value);
+ PCIDBG(4,"pci_conf1_write@0x%08x=0x%x\n", CONFIG_CMD(bus,devfn,where),word);
return PCIBIOS_SUCCESSFUL;
}
#undef CONFIG_CMD
static struct pci_ops pci_direct_conf1 = {
- pci_conf1_read_config_byte,
- pci_conf1_read_config_word,
- pci_conf1_read_config_dword,
- pci_conf1_write_config_byte,
- pci_conf1_write_config_word,
- pci_conf1_write_config_dword
+ .read = pci_conf1_read,
+ .write = pci_conf1_write,
};
struct pci_ops * __init pci_check_direct(void)
diff -Nru a/arch/sh/kernel/pci_st40.c b/arch/sh/kernel/pci_st40.c
--- a/arch/sh/kernel/pci_st40.c Sat Aug 31 15:06:06 2002
+++ b/arch/sh/kernel/pci_st40.c Sat Aug 31 15:06:06 2002
@@ -268,7 +268,7 @@
#define SET_CONFIG_BITS(bus,devfn,where)\
(((bus) << 16) | ((devfn) << 8) | ((where) & ~3) | (bus!=0))
-#define CONFIG_CMD(dev, where) SET_CONFIG_BITS((dev)->bus->number,(dev)->devfn,where)
+#define CONFIG_CMD(bus, devfn, where) SET_CONFIG_BITS(bus->number,devfn,where)
static int CheckForMasterAbort(void)
@@ -284,79 +284,53 @@
}
/* Write to config register */
-static int st40pci_read_config_byte(struct pci_dev *dev, int where,
- u8 * val)
+static int st40pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 * val)
{
- ST40PCI_WRITE(PAR, CONFIG_CMD(dev, where));
-
- *val = ST40PCI_READ_BYTE(PDR + (where & 3));
-
- if (CheckForMasterAbort())
- *val = 0xff;
-
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int st40pci_read_config_word(struct pci_dev *dev, int where,
- u16 * val)
-{
- ST40PCI_WRITE(PAR, CONFIG_CMD(dev, where));
-
- *val = ST40PCI_READ_SHORT(PDR + (where & 2));
-
- if (CheckForMasterAbort())
- *val = 0xffff;
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-
-static int st40pci_read_config_dword(struct pci_dev *dev, int where,
- u32 * val)
-{
-
- ST40PCI_WRITE(PAR, CONFIG_CMD(dev, where));
-
- *val = ST40PCI_READ(PDR);
-
- if (CheckForMasterAbort())
- *val = 0xffffffff;
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-static int st40pci_write_config_byte(struct pci_dev *dev, int where,
- u8 val)
-{
- ST40PCI_WRITE(PAR, CONFIG_CMD(dev, where));
-
- ST40PCI_WRITE_BYTE(PDR + (where & 3), val);
-
- CheckForMasterAbort();
-
- return PCIBIOS_SUCCESSFUL;
-}
-
-
-static int st40pci_write_config_word(struct pci_dev *dev, int where,
- u16 val)
-{
- ST40PCI_WRITE(PAR, CONFIG_CMD(dev, where));
-
- ST40PCI_WRITE_SHORT(PDR + (where & 2), val);
+ ST40PCI_WRITE(PAR, CONFIG_CMD(bus, devfn, where));
+ switch (size) {
+ case 1:
+ *val = (u8)ST40PCI_READ_BYTE(PDR + (where & 3));
+ break;
+ case 2:
+ *val = (u16)ST40PCI_READ_SHORT(PDR + (where & 2));
+ break;
+ case 4:
+ *val = ST40PCI_READ(PDR);
+ break;
+ }
- CheckForMasterAbort();
+ if (CheckForMasterAbort()){
+ switch (size) {
+ case 1:
+ *val = (u8)0xff;
+ break;
+ case 2:
+ *val = (u16)0xffff;
+ break;
+ case 4:
+ *val = 0xffffffff;
+ break;
+ }
+ }
return PCIBIOS_SUCCESSFUL;
}
-static int st40pci_write_config_dword(struct pci_dev *dev, int where,
- u32 val)
+static int st40pci_write(struct pci_bus *bus, unsigned int devfn; int where, int size, u32 val)
{
ST40PCI_WRITE(PAR, CONFIG_CMD(dev, where));
- ST40PCI_WRITE(PDR, val);
+ switch (size) {
+ case 1:
+ ST40PCI_WRITE_BYTE(PDR + (where & 3), (u8)val);
+ break;
+ case 2:
+ ST40PCI_WRITE_SHORT(PDR + (where & 2), (u16)val);
+ break;
+ case 4:
+ ST40PCI_WRITE(PDR, val);
+ break;
+ }
CheckForMasterAbort();
@@ -364,12 +338,8 @@
}
static struct pci_ops pci_config_ops = {
- st40pci_read_config_byte,
- st40pci_read_config_word,
- st40pci_read_config_dword,
- st40pci_write_config_byte,
- st40pci_write_config_word,
- st40pci_write_config_dword
+ .read = st40pci_read,
+ .write = st40pci_write,
};
diff -Nru a/arch/sparc/config.in b/arch/sparc/config.in
--- a/arch/sparc/config.in Sat Aug 31 15:05:54 2002
+++ b/arch/sparc/config.in Sat Aug 31 15:05:54 2002
@@ -15,6 +15,7 @@
define_bool CONFIG_VT y
define_bool CONFIG_VT_CONSOLE y
+define_bool CONFIG_HW_CONSOLE y
bool 'Symmetric multi-processing support (does not work on sun4/sun4c)' CONFIG_SMP
diff -Nru a/arch/sparc/defconfig b/arch/sparc/defconfig
--- a/arch/sparc/defconfig Sat Aug 31 15:06:06 2002
+++ b/arch/sparc/defconfig Sat Aug 31 15:06:06 2002
@@ -302,6 +302,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
CONFIG_HPFS_FS=m
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/sparc64/config.in b/arch/sparc64/config.in
--- a/arch/sparc64/config.in Sat Aug 31 15:05:59 2002
+++ b/arch/sparc64/config.in Sat Aug 31 15:05:59 2002
@@ -13,6 +13,7 @@
define_bool CONFIG_VT y
define_bool CONFIG_VT_CONSOLE y
+define_bool CONFIG_HW_CONSOLE y
bool 'Symmetric multi-processing support' CONFIG_SMP
bool 'Preemptible Kernel' CONFIG_PREEMPT
diff -Nru a/arch/sparc64/defconfig b/arch/sparc64/defconfig
--- a/arch/sparc64/defconfig Sat Aug 31 15:05:59 2002
+++ b/arch/sparc64/defconfig Sat Aug 31 15:05:59 2002
@@ -28,6 +28,7 @@
CONFIG_BBC_I2C=m
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
CONFIG_SMP=y
# CONFIG_PREEMPT is not set
CONFIG_SPARC64=y
@@ -194,67 +195,82 @@
# ATA/ATAPI/MFM/RLL device support
#
CONFIG_IDE=y
+
+#
+# IDE, ATA and ATAPI Block devices
+#
CONFIG_BLK_DEV_IDE=y
-# CONFIG_BLK_DEV_HD_IDE is not set
-# CONFIG_BLK_DEV_HD is not set
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
CONFIG_BLK_DEV_IDEDISK=y
# CONFIG_IDEDISK_MULTI_MODE is not set
# CONFIG_IDEDISK_STROKE is not set
-CONFIG_ATAPI=y
+# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set
+# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set
+# CONFIG_BLK_DEV_IDEDISK_IBM is not set
+# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set
+# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set
+# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set
+# CONFIG_BLK_DEV_IDEDISK_WD is not set
+# CONFIG_BLK_DEV_COMMERIAL is not set
+# CONFIG_BLK_DEV_TIVO is not set
+# CONFIG_BLK_DEV_IDECS is not set
CONFIG_BLK_DEV_IDECD=y
# CONFIG_BLK_DEV_IDETAPE is not set
# CONFIG_BLK_DEV_IDEFLOPPY is not set
# CONFIG_BLK_DEV_IDESCSI is not set
-# CONFIG_BLK_DEV_IDECS is not set
+# CONFIG_IDE_TASK_IOCTL is not set
#
-# ATA host controller support
+# IDE chipset support/bugfixes
#
-# CONFIG_BLK_DEV_RZ1000 is not set
# CONFIG_BLK_DEV_CMD640 is not set
# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
# CONFIG_BLK_DEV_ISAPNP is not set
-
-#
-# PCI host controller support
-#
-# CONFIG_BLK_DEV_OFFBOARD is not set
+# CONFIG_BLK_DEV_RZ1000 is not set
+CONFIG_BLK_DEV_IDEPCI=y
# CONFIG_IDEPCI_SHARE_IRQ is not set
CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_OFFBOARD is not set
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
CONFIG_IDEDMA_PCI_AUTO=y
CONFIG_IDEDMA_ONLYDISK=y
CONFIG_BLK_DEV_IDEDMA=y
-# CONFIG_BLK_DEV_IDE_TCQ is not set
-# CONFIG_BLK_DEV_IDE_TCQ_DEFAULT is not set
+# CONFIG_IDEDMA_PCI_WIP is not set
+# CONFIG_BLK_DEV_IDEDMA_TIMEOUT is not set
# CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
# CONFIG_BLK_DEV_AEC62XX is not set
-# CONFIG_AEC6280_BURST is not set
+# CONFIG_AEC62XX_TUNING is not set
CONFIG_BLK_DEV_ALI15X3=y
# CONFIG_WDC_ALI15X3 is not set
# CONFIG_BLK_DEV_AMD74XX is not set
+# CONFIG_AMD74XX_OVERRIDE is not set
CONFIG_BLK_DEV_CMD64X=y
+# CONFIG_BLK_DEV_CMD680 is not set
# CONFIG_BLK_DEV_CY82C693 is not set
# CONFIG_BLK_DEV_CS5530 is not set
# CONFIG_BLK_DEV_HPT34X is not set
# CONFIG_HPT34X_AUTODMA is not set
# CONFIG_BLK_DEV_HPT366 is not set
-# CONFIG_BLK_DEV_PIIX is not set
CONFIG_BLK_DEV_NS87415=y
# CONFIG_BLK_DEV_OPTI621 is not set
+# CONFIG_BLK_DEV_ADMA100 is not set
# CONFIG_BLK_DEV_PDC202XX is not set
# CONFIG_PDC202XX_BURST is not set
# CONFIG_PDC202XX_FORCE is not set
+# CONFIG_BLK_DEV_RZ1000 is not set
# CONFIG_BLK_DEV_SVWKS is not set
# CONFIG_BLK_DEV_SIS5513 is not set
+# CONFIG_BLK_DEV_SLC90E66 is not set
# CONFIG_BLK_DEV_TRM290 is not set
# CONFIG_BLK_DEV_VIA82CXXX is not set
-# CONFIG_BLK_DEV_SL82C105 is not set
# CONFIG_IDE_CHIPSETS is not set
-# CONFIG_IDEDMA_IVB is not set
CONFIG_IDEDMA_AUTO=y
-# CONFIG_BLK_DEV_ATARAID is not set
-# CONFIG_BLK_DEV_ATARAID_PDC is not set
-# CONFIG_BLK_DEV_ATARAID_HPT is not set
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_DMA_NONPCI is not set
+CONFIG_BLK_DEV_IDE_MODES=y
#
# SCSI support
@@ -475,7 +491,7 @@
# CONFIG_8139TOO_PIO is not set
# CONFIG_8139TOO_TUNE_TWISTER is not set
# CONFIG_8139TOO_8129 is not set
-# CONFIG_8139_NEW_RX_RESET is not set
+# CONFIG_8139_OLD_RX_RESET is not set
CONFIG_SIS900=m
CONFIG_EPIC100=m
CONFIG_SUNDANCE=m
@@ -490,6 +506,7 @@
# CONFIG_ACENIC is not set
# CONFIG_DL2K is not set
# CONFIG_E1000 is not set
+# CONFIG_E1000_NAPI is not set
CONFIG_MYRI_SBUS=m
# CONFIG_NS83820 is not set
CONFIG_HAMACHI=m
@@ -574,7 +591,6 @@
#
# Userland interfaces
#
-CONFIG_INPUT_KEYBDEV=y
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
@@ -583,7 +599,6 @@
# CONFIG_INPUT_TSDEV is not set
CONFIG_INPUT_EVDEV=y
# CONFIG_INPUT_EVBUG is not set
-# CONFIG_INPUT_UINPUT is not set
#
# Input I/O drivers
@@ -597,7 +612,10 @@
# CONFIG_GAMEPORT_FM801 is not set
# CONFIG_GAMEPORT_CS461x is not set
CONFIG_SERIO=y
-# CONFIG_SERIO_I8042 is not set
+CONFIG_SERIO_I8042=y
+CONFIG_I8042_REG_BASE=60
+CONFIG_I8042_KBD_IRQ=1
+CONFIG_I8042_AUX_IRQ=12
# CONFIG_SERIO_SERPORT is not set
# CONFIG_SERIO_CT82C710 is not set
# CONFIG_SERIO_PARKBD is not set
@@ -606,12 +624,12 @@
# Input Device Drivers
#
CONFIG_INPUT_KEYBOARD=y
-# CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_ATKBD=y
CONFIG_KEYBOARD_SUNKBD=y
# CONFIG_KEYBOARD_XTKBD is not set
# CONFIG_KEYBOARD_NEWTON is not set
CONFIG_INPUT_MOUSE=y
-# CONFIG_MOUSE_PS2 is not set
+CONFIG_MOUSE_PS2=y
CONFIG_MOUSE_SERIAL=y
# CONFIG_MOUSE_INPORT is not set
# CONFIG_MOUSE_LOGIBM is not set
@@ -641,6 +659,10 @@
# CONFIG_INPUT_JOYDUMP is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
# CONFIG_TOUCHSCREEN_GUNZE is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_PCSPKR is not set
+CONFIG_INPUT_SPARCSPKR=y
+# CONFIG_INPUT_UINPUT is not set
#
# File systems
@@ -681,6 +703,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
CONFIG_HPFS_FS=m
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
@@ -924,6 +947,8 @@
CONFIG_USB_AUERSWALD=m
CONFIG_USB_RIO500=m
# CONFIG_USB_BRLVGER is not set
+CONFIG_USB_LCD=m
+CONFIG_USB_SPEEDTOUCH=m
#
# Bluetooth support
diff -Nru a/arch/sparc64/kernel/binfmt_elf32.c b/arch/sparc64/kernel/binfmt_elf32.c
--- a/arch/sparc64/kernel/binfmt_elf32.c Sat Aug 31 15:06:06 2002
+++ b/arch/sparc64/kernel/binfmt_elf32.c Sat Aug 31 15:06:06 2002
@@ -147,7 +147,6 @@
}
#define elf_addr_t u32
-#define elf_caddr_t u32
#undef start_thread
#define start_thread start_thread32
#define init_elf_binfmt init_elf32_binfmt
diff -Nru a/arch/sparc64/kernel/cpu.c b/arch/sparc64/kernel/cpu.c
--- a/arch/sparc64/kernel/cpu.c Sat Aug 31 15:06:06 2002
+++ b/arch/sparc64/kernel/cpu.c Sat Aug 31 15:06:06 2002
@@ -57,25 +57,24 @@
void __init cpu_probe(void)
{
- int manuf, impl;
- unsigned i, cpuid;
- long ver, fpu_vers;
- long fprs;
+ unsigned long ver, fpu_vers, manuf, impl, fprs;
+ int i, cpuid;
cpuid = hard_smp_processor_id();
- fprs = fprs_read ();
- fprs_write (FPRS_FEF);
+ fprs = fprs_read();
+ fprs_write(FPRS_FEF);
__asm__ __volatile__ ("rdpr %%ver, %0; stx %%fsr, [%1]"
: "=&r" (ver)
: "r" (&fpu_vers));
- fprs_write (fprs);
+ fprs_write(fprs);
manuf = ((ver >> 48) & 0xffff);
impl = ((ver >> 32) & 0xffff);
fpu_vers = ((fpu_vers >> 17) & 0x7);
+retry:
for (i = 0; i < NSPARCCHIPS; i++) {
if (linux_sparc_chips[i].manuf == manuf) {
if (linux_sparc_chips[i].impl == impl) {
@@ -87,8 +86,17 @@
}
if (i == NSPARCCHIPS) {
- printk("DEBUG: manuf = 0x%x impl = 0x%x\n",
- manuf, impl);
+ /* Maybe it is a cheetah+ derivative, report it as cheetah+
+ * in that case until we learn the real names.
+ */
+ if (manuf == 0x3e &&
+ impl > 0x15) {
+ impl = 0x15;
+ goto retry;
+ } else {
+ printk("DEBUG: manuf[%lx] impl[%lx]\n",
+ manuf, impl);
+ }
sparc_cpu_type[cpuid] = "Unknown CPU";
}
@@ -104,9 +112,8 @@
}
if (i == NSPARCFPU) {
- printk("DEBUG: manuf = 0x%x impl = 0x%x fsr.vers = 0x%x\n",
- manuf, impl,
- (unsigned int) fpu_vers);
+ printk("DEBUG: manuf[%lx] impl[%lx] fsr.vers[%lx]\n",
+ manuf, impl, fpu_vers);
sparc_fpu_type[cpuid] = "Unknown FPU";
}
}
diff -Nru a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S
--- a/arch/sparc64/kernel/entry.S Sat Aug 31 15:05:53 2002
+++ b/arch/sparc64/kernel/entry.S Sat Aug 31 15:05:53 2002
@@ -1820,23 +1820,13 @@
ldx [%g3 + %lo(timer_tick_offset)], %g3
or %g2, %lo(xtime), %g2
or %g1, %lo(timer_tick_compare), %g1
-1: rdpr %ver, %o2
- sethi %hi(CHEETAH_ID), %o1
- srlx %o2, 32, %o2
- or %o1, %lo(CHEETAH_ID), %o1
- membar #Sync
+1: membar #Sync
ldda [%g2] ASI_NUCLEUS_QUAD_LDD, %o4
- cmp %o2, %o1
- be,a,pn %xcc, 3f
- rd %asr24, %o1
- sethi %hi(CHEETAH_PLUS_ID), %o1
- or %o1, %lo(CHEETAH_PLUS_ID), %o1
- cmp %o2, %o1
- bne,pt %xcc, 2f
- nop
+ BRANCH_IF_ANY_CHEETAH(o2,o1,2f)
ba,pt %xcc, 3f
+ rd %tick, %o1
+2: ba,pt %xcc, 3f
rd %asr24, %o1
-2: rd %tick, %o1
3: ldx [%g1], %g7
membar #Sync
ldda [%g2] ASI_NUCLEUS_QUAD_LDD, %o2
diff -Nru a/arch/sparc64/kernel/etrap.S b/arch/sparc64/kernel/etrap.S
--- a/arch/sparc64/kernel/etrap.S Sat Aug 31 15:05:59 2002
+++ b/arch/sparc64/kernel/etrap.S Sat Aug 31 15:05:59 2002
@@ -115,11 +115,12 @@
* 0x00 TL1's TSTATE
* 0x08 TL1's TPC
* 0x10 TL1's TNPC
+ * 0x18 TL1's TT
* ...
- * 0x58 TL4's TNPC
+ * 0x58 TL4's TT
* 0x60 TL
*/
- sub %sp, (24 * 8) + 8, %g2
+ sub %sp, ((4 * 8) * 4) + 8, %g2
rdpr %tl, %g1
wrpr %g0, 1, %tl
@@ -129,33 +130,41 @@
stx %g3, [%g2 + STACK_BIAS + 0x08]
rdpr %tnpc, %g3
stx %g3, [%g2 + STACK_BIAS + 0x10]
+ rdpr %tt, %g3
+ stx %g3, [%g2 + STACK_BIAS + 0x18]
wrpr %g0, 2, %tl
rdpr %tstate, %g3
- stx %g3, [%g2 + STACK_BIAS + 0x18]
- rdpr %tpc, %g3
stx %g3, [%g2 + STACK_BIAS + 0x20]
- rdpr %tnpc, %g3
+ rdpr %tpc, %g3
stx %g3, [%g2 + STACK_BIAS + 0x28]
+ rdpr %tnpc, %g3
+ stx %g3, [%g2 + STACK_BIAS + 0x30]
+ rdpr %tt, %g3
+ stx %g3, [%g2 + STACK_BIAS + 0x38]
wrpr %g0, 3, %tl
rdpr %tstate, %g3
- stx %g3, [%g2 + STACK_BIAS + 0x30]
+ stx %g3, [%g2 + STACK_BIAS + 0x40]
rdpr %tpc, %g3
- stx %g3, [%g2 + STACK_BIAS + 0x38]
+ stx %g3, [%g2 + STACK_BIAS + 0x48]
rdpr %tnpc, %g3
- stx %g3, [%g2 + STACK_BIAS + 0x40]
+ stx %g3, [%g2 + STACK_BIAS + 0x50]
+ rdpr %tt, %g3
+ stx %g3, [%g2 + STACK_BIAS + 0x58]
wrpr %g0, 4, %tl
rdpr %tstate, %g3
- stx %g3, [%g2 + STACK_BIAS + 0x48]
+ stx %g3, [%g2 + STACK_BIAS + 0x60]
rdpr %tpc, %g3
- stx %g3, [%g2 + STACK_BIAS + 0x50]
+ stx %g3, [%g2 + STACK_BIAS + 0x68]
rdpr %tnpc, %g3
- stx %g3, [%g2 + STACK_BIAS + 0x58]
+ stx %g3, [%g2 + STACK_BIAS + 0x70]
+ rdpr %tt, %g3
+ stx %g3, [%g2 + STACK_BIAS + 0x78]
wrpr %g1, %tl
- stx %g1, [%g2 + STACK_BIAS + 0x60]
+ stx %g1, [%g2 + STACK_BIAS + 0x80]
rdpr %tstate, %g1 ! Single Group+4bubbles
sub %g2, REGWIN_SZ + TRACEREG_SZ - STACK_BIAS, %g2 ! IEU1
diff -Nru a/arch/sparc64/kernel/head.S b/arch/sparc64/kernel/head.S
--- a/arch/sparc64/kernel/head.S Sat Aug 31 15:05:59 2002
+++ b/arch/sparc64/kernel/head.S Sat Aug 31 15:05:59 2002
@@ -78,16 +78,9 @@
* PROM entry point is on %o4
*/
sparc64_boot:
- rdpr %ver, %g1
- sethi %hi(CHEETAH_ID), %g5
- srlx %g1, 32, %g1
- or %g5, %lo(CHEETAH_ID), %g5
- cmp %g1, %g5
- be,pn %icc, cheetah_boot
- sethi %hi(CHEETAH_PLUS_ID), %g5
- or %g5, %lo(CHEETAH_PLUS_ID), %g5
- cmp %g1, %g5
- bne,pt %icc, spitfire_boot
+ BRANCH_IF_CHEETAH_BASE(g1,g5,cheetah_boot)
+ BRANCH_IF_CHEETAH_PLUS_OR_FOLLOWON(g1,g5,cheetah_plus_boot)
+ ba,pt %xcc, spitfire_boot
nop
cheetah_plus_boot:
@@ -212,15 +205,11 @@
add %l0, (1 << 3), %l0
/* On Cheetah+, have to check second DTLB. */
- rdpr %ver, %g1
- srlx %g1, 32, %g1
- sethi %hi(CHEETAH_PLUS_ID), %l0
- or %l0, %lo(CHEETAH_PLUS_ID), %l0
- cmp %g1, %l0
- bne,pt %icc, 9f
+ BRANCH_IF_CHEETAH_PLUS_OR_FOLLOWON(g1,l0,2f)
+ ba,pt %xcc, 9f
nop
- set 3 << 16, %l0
+2: set 3 << 16, %l0
1: ldxa [%l0] ASI_DTLB_TAG_READ, %g1
membar #Sync
andn %g1, %l2, %g1
@@ -469,16 +458,9 @@
stxa %g3, [%g2] ASI_DMMU
membar #Sync
- rdpr %ver, %g1
- sethi %hi(CHEETAH_ID), %g5
- srlx %g1, 32, %g1
- or %g5, %lo(CHEETAH_ID), %g5
- cmp %g1, %g5
- be,pn %icc, cheetah_tlb_fixup
- sethi %hi(CHEETAH_PLUS_ID), %g5
- or %g5, %lo(CHEETAH_PLUS_ID), %g5
- cmp %g1, %g5
- bne,pt %icc, spitfire_tlb_fixup
+ BRANCH_IF_ANY_CHEETAH(g1,g5,cheetah_tlb_fixup)
+
+ ba,pt %xcc, spitfire_tlb_fixup
nop
cheetah_tlb_fixup:
@@ -499,15 +481,10 @@
flush %g3
membar #Sync
- sethi %hi(CHEETAH_PLUS_ID), %g5
- or %g5, %lo(CHEETAH_PLUS_ID), %g5
- rdpr %ver, %g2
- srlx %g2, 32, %g2
- cmp %g2, %g5
- bne,a,pt %icc, 1f
- mov 1, %g2 /* Set TLB type to cheetah. */
-
mov 2, %g2 /* Set TLB type to cheetah+. */
+ BRANCH_IF_CHEETAH_PLUS_OR_FOLLOWON(g5,g2,1f)
+
+ mov 1, %g2 /* Set TLB type to cheetah. */
1: sethi %hi(tlb_type), %g5
stw %g2, [%g5 + %lo(tlb_type)]
@@ -631,16 +608,8 @@
sllx %g2, 32, %g2
or %g2, KERN_LOWBITS, %g2
- rdpr %ver, %g3
- sethi %hi(CHEETAH_ID), %g7
- srlx %g3, 32, %g3
- or %g7, %lo(CHEETAH_ID), %g7
- cmp %g3, %g7
- be,pn %icc, cheetah_vpte_base
- sethi %hi(CHEETAH_PLUS_ID), %g7
- or %g7, %lo(CHEETAH_PLUS_ID), %g7
- cmp %g3, %g7
- bne,pt %icc, spitfire_vpte_base
+ BRANCH_IF_ANY_CHEETAH(g3,g7,cheetah_vpte_base)
+ ba,pt %xcc, spitfire_vpte_base
nop
cheetah_vpte_base:
@@ -648,6 +617,7 @@
or %g3, %ulo(VPTE_BASE_CHEETAH), %g3
ba,pt %xcc, 2f
sllx %g3, 32, %g3
+
spitfire_vpte_base:
sethi %uhi(VPTE_BASE_SPITFIRE), %g3
or %g3, %ulo(VPTE_BASE_SPITFIRE), %g3
@@ -675,16 +645,9 @@
nop
not_starfire:
- rdpr %ver, %g1
- sethi %hi(CHEETAH_ID), %g5
- srlx %g1, 32, %g1
- or %g5, %lo(CHEETAH_ID), %g5
- cmp %g1, %g5
- be,pn %icc, is_cheetah
- sethi %hi(CHEETAH_PLUS_ID), %g5
- or %g5, %lo(CHEETAH_PLUS_ID), %g5
- cmp %g1, %g5
- bne,pt %icc, not_cheetah
+ BRANCH_IF_ANY_CHEETAH(g1,g5,is_cheetah)
+
+ ba,pt %xcc, not_cheetah
nop
is_cheetah:
@@ -710,23 +673,16 @@
/* Kill PROM timer */
wr %g0, 0, %tick_cmpr
- rdpr %ver, %g1
- sethi %hi(CHEETAH_ID), %g5
- srlx %g1, 32, %g1
- or %g5, %lo(CHEETAH_ID), %g5
- cmp %g1, %g5
- be,pn %icc, 1f
- sethi %hi(CHEETAH_PLUS_ID), %g5
- or %g5, %lo(CHEETAH_PLUS_ID), %g5
- cmp %g1, %g5
- bne,pt %icc, 2f
+ BRANCH_IF_ANY_CHEETAH(g1,g5,1f)
+
+ ba,pt %xcc, 2f
nop
/* Disable STICK_INT interrupts. */
1:
- sethi %hi(0x80000000), %g1
- sllx %g1, 32, %g1
- wr %g1, %asr25
+ sethi %hi(0x80000000), %g1
+ sllx %g1, 32, %g1
+ wr %g1, %asr25
/* Ok, we're done setting up all the state our trap mechanims needs,
* now get back into normal globals and let the PROM know what is up.
diff -Nru a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
--- a/arch/sparc64/kernel/irq.c Sat Aug 31 15:05:59 2002
+++ b/arch/sparc64/kernel/irq.c Sat Aug 31 15:05:59 2002
@@ -20,7 +20,6 @@
#include
#include
#include
-#include
#include
#include
diff -Nru a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
--- a/arch/sparc64/kernel/setup.c Sat Aug 31 15:05:59 2002
+++ b/arch/sparc64/kernel/setup.c Sat Aug 31 15:05:59 2002
@@ -705,19 +705,5 @@
prom_cmdline();
}
-#ifdef CONFIG_MAGIC_SYSRQ
-/* Because we use the generic input layer keyboard drivers for
- * everything, this PC sysrq translation table is all we need.
- */
-unsigned char kbd_sysrq_xlate[128] =
- "\000\0331234567890-=\177\t" /* 0x00 - 0x0f */
- "qwertyuiop[]\r\000as" /* 0x10 - 0x1f */
- "dfghjkl;'`\000\\zxcv" /* 0x20 - 0x2f */
- "bnm,./\000*\000 \000\201\202\203\204\205" /* 0x30 - 0x3f */
- "\206\207\210\211\212\000\000789-456+1" /* 0x40 - 0x4f */
- "230\177\000\000\213\214\000\000\000\000\000\000\000\000\000\000" /* 0x50 - 0x5f */
- "\r\000/"; /* 0x60 - 0x6f */
-#endif
-
int serial_console;
int stop_a_enabled = 1;
diff -Nru a/arch/sparc64/kernel/trampoline.S b/arch/sparc64/kernel/trampoline.S
--- a/arch/sparc64/kernel/trampoline.S Sat Aug 31 15:05:59 2002
+++ b/arch/sparc64/kernel/trampoline.S Sat Aug 31 15:05:59 2002
@@ -33,16 +33,10 @@
sparc64_cpu_startup:
flushw
- rdpr %ver, %g1
- sethi %hi(CHEETAH_ID), %g5
- srlx %g1, 32, %g1
- or %g5, %lo(CHEETAH_ID), %g5
- cmp %g1, %g5
- be,pn %icc, cheetah_startup
- sethi %hi(CHEETAH_PLUS_ID), %g5
- or %g5, %lo(CHEETAH_PLUS_ID), %g5
- cmp %g1, %g5
- bne,pt %icc, spitfire_startup
+ BRANCH_IF_CHEETAH_BASE(g1,g5,cheetah_startup)
+ BRANCH_IF_CHEETAH_PLUS_OR_FOLLOWON(g1,g5,cheetah_plus_startup)
+
+ ba,pt %xcc, spitfire_startup
nop
cheetah_plus_startup:
@@ -51,15 +45,15 @@
nop
cheetah_startup:
- mov DCR_BPE | DCR_RPE | DCR_SI | DCR_IFPOE | DCR_MS, %g1
- wr %g1, %asr18
+ mov DCR_BPE | DCR_RPE | DCR_SI | DCR_IFPOE | DCR_MS, %g1
+ wr %g1, %asr18
- sethi %uhi(DCU_ME | DCU_RE | /*DCU_PE |*/ DCU_HPE | DCU_SPE | DCU_SL | DCU_WE), %g5
- or %g5, %ulo(DCU_ME | DCU_RE | /*DCU_PE |*/ DCU_HPE | DCU_SPE | DCU_SL | DCU_WE), %g5
- sllx %g5, 32, %g5
- or %g5, DCU_DM | DCU_IM | DCU_DC | DCU_IC, %g5
- stxa %g5, [%g0] ASI_DCU_CONTROL_REG
- membar #Sync
+ sethi %uhi(DCU_ME|DCU_RE|DCU_HPE|DCU_SPE|DCU_SL|DCU_WE), %g5
+ or %g5, %ulo(DCU_ME|DCU_RE|DCU_HPE|DCU_SPE|DCU_SL|DCU_WE), %g5
+ sllx %g5, 32, %g5
+ or %g5, DCU_DM | DCU_IM | DCU_DC | DCU_IC, %g5
+ stxa %g5, [%g0] ASI_DCU_CONTROL_REG
+ membar #Sync
cheetah_generic_startup:
mov TSB_EXTENSION_P, %g3
@@ -127,19 +121,10 @@
ldx [%g2 + %lo(kern_locked_tte_data)], %g2
stx %g2, [%sp + 2047 + 128 + 0x30]
- rdpr %ver, %g1
- sethi %hi(CHEETAH_ID), %g5
- srlx %g1, 32, %g1
- or %g5, %lo(CHEETAH_ID), %g5
- cmp %g1, %g5
- be,a,pn %icc, 1f
- mov 15, %g2
- sethi %hi(CHEETAH_PLUS_ID), %g5
- or %g5, %lo(CHEETAH_PLUS_ID), %g5
- cmp %g1, %g5
- bne,a,pt %icc, 1f
- mov 63, %g2
mov 15, %g2
+ BRANCH_IF_ANY_CHEETAH(g1,g5,1f)
+
+ mov 63, %g2
1:
stx %g2, [%sp + 2047 + 128 + 0x38]
sethi %hi(p1275buf), %g2
@@ -167,19 +152,10 @@
ldx [%g2 + %lo(kern_locked_tte_data)], %g2
stx %g2, [%sp + 2047 + 128 + 0x30]
- rdpr %ver, %g1
- sethi %hi(CHEETAH_ID), %g5
- srlx %g1, 32, %g1
- or %g5, %lo(CHEETAH_ID), %g5
- cmp %g1, %g5
- be,a,pn %icc, 1f
- mov 15, %g2
- sethi %hi(CHEETAH_PLUS_ID), %g5
- or %g5, %lo(CHEETAH_PLUS_ID), %g5
- cmp %g1, %g5
- bne,a,pt %icc, 1f
- mov 63, %g2
mov 15, %g2
+ BRANCH_IF_ANY_CHEETAH(g1,g5,1f)
+
+ mov 63, %g2
1:
stx %g2, [%sp + 2047 + 128 + 0x38]
@@ -244,16 +220,9 @@
sllx %g2, 32, %g2
or %g2, KERN_LOWBITS, %g2
- rdpr %ver, %g3
- sethi %hi(CHEETAH_ID), %g7
- srlx %g3, 32, %g3
- or %g7, %lo(CHEETAH_ID), %g7
- cmp %g3, %g7
- be,pn %icc, 9f
- sethi %hi(CHEETAH_PLUS_ID), %g7
- or %g7, %lo(CHEETAH_PLUS_ID), %g7
- cmp %g3, %g7
- bne,pt %icc, 1f
+ BRANCH_IF_ANY_CHEETAH(g3,g7,9f)
+
+ ba,pt %xcc, 1f
nop
9:
diff -Nru a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c
--- a/arch/sparc64/kernel/traps.c Sat Aug 31 15:06:06 2002
+++ b/arch/sparc64/kernel/traps.c Sat Aug 31 15:06:06 2002
@@ -47,6 +47,7 @@
unsigned long tstate;
unsigned long tpc;
unsigned long tnpc;
+ unsigned long tt;
} trapstack[4];
unsigned long tl;
};
@@ -58,9 +59,12 @@
printk("TRAPLOG: Error at trap level 0x%lx, dumping track stack.\n",
p->tl);
for (i = 0; i < 4; i++) {
- printk("TRAPLOG: Trap level %d TSTATE[%016lx] TPC[%016lx] TNPC[%016lx]\n",
+ printk(KERN_CRIT
+ "TRAPLOG: Trap level %d TSTATE[%016lx] TPC[%016lx] "
+ "TNPC[%016lx] TT[%lx]\n",
i + 1,
- p->trapstack[i].tstate, p->trapstack[i].tpc, p->trapstack[i].tnpc);
+ p->trapstack[i].tstate, p->trapstack[i].tpc,
+ p->trapstack[i].tnpc, p->trapstack[i].tt);
}
}
@@ -182,43 +186,36 @@
#endif
/* When access exceptions happen, we must do this. */
-static void clean_and_reenable_l1_caches(void)
+static void spitfire_clean_and_reenable_l1_caches(void)
{
unsigned long va;
- if (tlb_type == spitfire) {
- /* Clean 'em. */
- for (va = 0; va < (PAGE_SIZE << 1); va += 32) {
- spitfire_put_icache_tag(va, 0x0);
- spitfire_put_dcache_tag(va, 0x0);
- }
+ if (tlb_type != spitfire)
+ BUG();
- /* Re-enable in LSU. */
- __asm__ __volatile__("flush %%g6\n\t"
- "membar #Sync\n\t"
- "stxa %0, [%%g0] %1\n\t"
- "membar #Sync"
- : /* no outputs */
- : "r" (LSU_CONTROL_IC | LSU_CONTROL_DC |
- LSU_CONTROL_IM | LSU_CONTROL_DM),
- "i" (ASI_LSU_CONTROL)
- : "memory");
- } else if (tlb_type == cheetah || tlb_type == cheetah_plus) {
- /* Flush D-cache */
- for (va = 0; va < (1 << 16); va += (1 << 5)) {
- __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
- "membar #Sync"
- : /* no outputs */
- : "r" (va), "i" (ASI_DCACHE_TAG));
- }
- }
+ /* Clean 'em. */
+ for (va = 0; va < (PAGE_SIZE << 1); va += 32) {
+ spitfire_put_icache_tag(va, 0x0);
+ spitfire_put_dcache_tag(va, 0x0);
+ }
+
+ /* Re-enable in LSU. */
+ __asm__ __volatile__("flush %%g6\n\t"
+ "membar #Sync\n\t"
+ "stxa %0, [%%g0] %1\n\t"
+ "membar #Sync"
+ : /* no outputs */
+ : "r" (LSU_CONTROL_IC | LSU_CONTROL_DC |
+ LSU_CONTROL_IM | LSU_CONTROL_DM),
+ "i" (ASI_LSU_CONTROL)
+ : "memory");
}
void do_iae(struct pt_regs *regs)
{
siginfo_t info;
- clean_and_reenable_l1_caches();
+ spitfire_clean_and_reenable_l1_caches();
info.si_signo = SIGBUS;
info.si_errno = 0;
@@ -232,7 +229,7 @@
{
#ifdef CONFIG_PCI
if (pci_poke_in_progress && pci_poke_cpu == smp_processor_id()) {
- clean_and_reenable_l1_caches();
+ spitfire_clean_and_reenable_l1_caches();
pci_poke_faulted = 1;
diff -Nru a/arch/sparc64/lib/blockops.S b/arch/sparc64/lib/blockops.S
--- a/arch/sparc64/lib/blockops.S Sat Aug 31 15:05:54 2002
+++ b/arch/sparc64/lib/blockops.S Sat Aug 31 15:05:54 2002
@@ -106,13 +106,8 @@
bne,pn %xcc, copy_page_using_blkcommit
nop
- rdpr %ver, %g3
- sllx %g3, 16, %g3
- srlx %g3, 32 + 16, %g3
- cmp %g3, 0x14 ! CHEETAH_ID
- be,pn %icc, cheetah_copy_user_page
- cmp %g3, 0x15 ! CHEETAH_PLUS_ID
- bne,pt %icc, spitfire_copy_user_page
+ BRANCH_IF_ANY_CHEETAH(g3,o2,cheetah_copy_user_page)
+ ba,pt %xcc, spitfire_copy_user_page
nop
cheetah_copy_user_page:
diff -Nru a/arch/x86_64/defconfig b/arch/x86_64/defconfig
--- a/arch/x86_64/defconfig Sat Aug 31 15:06:03 2002
+++ b/arch/x86_64/defconfig Sat Aug 31 15:06:03 2002
@@ -513,6 +513,7 @@
# CONFIG_VXFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
# CONFIG_HPFS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
diff -Nru a/arch/x86_64/ia32/ia32_binfmt.c b/arch/x86_64/ia32/ia32_binfmt.c
--- a/arch/x86_64/ia32/ia32_binfmt.c Sat Aug 31 15:05:54 2002
+++ b/arch/x86_64/ia32/ia32_binfmt.c Sat Aug 31 15:05:54 2002
@@ -186,7 +186,6 @@
#undef MODULE_AUTHOR
#define elf_addr_t __u32
-#define elf_caddr_t __u32
static void elf32_init(struct pt_regs *);
diff -Nru a/arch/x86_64/pci/direct.c b/arch/x86_64/pci/direct.c
--- a/arch/x86_64/pci/direct.c Sat Aug 31 15:06:06 2002
+++ b/arch/x86_64/pci/direct.c Sat Aug 31 15:06:06 2002
@@ -13,7 +13,7 @@
#define PCI_CONF1_ADDRESS(bus, dev, fn, reg) \
(0x80000000 | (bus << 16) | (dev << 11) | (fn << 8) | (reg & ~3))
-static int pci_conf1_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
+static int __pci_conf1_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
{
unsigned long flags;
@@ -41,7 +41,7 @@
return 0;
}
-static int pci_conf1_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
+static int __pci_conf1_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
{
unsigned long flags;
@@ -69,75 +69,23 @@
return 0;
}
-
#undef PCI_CONF1_ADDRESS
-static int pci_conf1_read_config_byte(struct pci_dev *dev, int where, u8 *value)
+static int pci_conf1_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value)
{
- int result;
- u32 data;
-
- if (!value)
- return -EINVAL;
-
- result = pci_conf1_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 1, &data);
-
- *value = (u8)data;
-
- return result;
+ return __pci_conf1_read(0, bus->number, PCI_SLOT(devfn),
+ PCI_FUNC(devfn), where, size, value);
}
-static int pci_conf1_read_config_word(struct pci_dev *dev, int where, u16 *value)
+static int pci_conf1_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value)
{
- int result;
- u32 data;
-
- if (!value)
- return -EINVAL;
-
- result = pci_conf1_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 2, &data);
-
- *value = (u16)data;
-
- return result;
-}
-
-static int pci_conf1_read_config_dword(struct pci_dev *dev, int where, u32 *value)
-{
- if (!value)
- return -EINVAL;
-
- return pci_conf1_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 4, value);
-}
-
-static int pci_conf1_write_config_byte(struct pci_dev *dev, int where, u8 value)
-{
- return pci_conf1_write(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 1, value);
-}
-
-static int pci_conf1_write_config_word(struct pci_dev *dev, int where, u16 value)
-{
- return pci_conf1_write(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 2, value);
-}
-
-static int pci_conf1_write_config_dword(struct pci_dev *dev, int where, u32 value)
-{
- return pci_conf1_write(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 4, value);
+ return __pci_conf1_write(0, bus->number, PCI_SLOT(devfn),
+ PCI_FUNC(devfn), where, size, value);
}
static struct pci_ops pci_direct_conf1 = {
- pci_conf1_read_config_byte,
- pci_conf1_read_config_word,
- pci_conf1_read_config_dword,
- pci_conf1_write_config_byte,
- pci_conf1_write_config_word,
- pci_conf1_write_config_dword
+ .read = pci_conf1_read,
+ .write = pci_conf1_write,
};
@@ -147,7 +95,7 @@
#define PCI_CONF2_ADDRESS(dev, reg) (u16)(0xC000 | (dev << 8) | reg)
-static int pci_conf2_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
+static int __pci_conf2_read (int seg, int bus, int dev, int fn, int reg, int len, u32 *value)
{
unsigned long flags;
@@ -181,7 +129,7 @@
return 0;
}
-static int pci_conf2_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
+static int __pci_conf2_write (int seg, int bus, int dev, int fn, int reg, int len, u32 value)
{
unsigned long flags;
@@ -217,57 +165,21 @@
#undef PCI_CONF2_ADDRESS
-static int pci_conf2_read_config_byte(struct pci_dev *dev, int where, u8 *value)
-{
- int result;
- u32 data;
- result = pci_conf2_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 1, &data);
- *value = (u8)data;
- return result;
-}
-
-static int pci_conf2_read_config_word(struct pci_dev *dev, int where, u16 *value)
-{
- int result;
- u32 data;
- result = pci_conf2_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 2, &data);
- *value = (u16)data;
- return result;
-}
-
-static int pci_conf2_read_config_dword(struct pci_dev *dev, int where, u32 *value)
-{
- return pci_conf2_read(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 4, value);
-}
-
-static int pci_conf2_write_config_byte(struct pci_dev *dev, int where, u8 value)
+static int pci_conf2_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value)
{
- return pci_conf2_write(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 1, value);
+ return __pci_conf2_read(0, bus->number, PCI_SLOT(devfn),
+ PCI_FUNC(devfn), where, size, value);
}
-static int pci_conf2_write_config_word(struct pci_dev *dev, int where, u16 value)
+static int pci_conf2_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value)
{
- return pci_conf2_write(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 2, value);
-}
-
-static int pci_conf2_write_config_dword(struct pci_dev *dev, int where, u32 value)
-{
- return pci_conf2_write(0, dev->bus->number, PCI_SLOT(dev->devfn),
- PCI_FUNC(dev->devfn), where, 4, value);
+ return __pci_conf2_write(0, bus->number, PCI_SLOT(devfn),
+ PCI_FUNC(devfn), where, size, value);
}
static struct pci_ops pci_direct_conf2 = {
- pci_conf2_read_config_byte,
- pci_conf2_read_config_word,
- pci_conf2_read_config_dword,
- pci_conf2_write_config_byte,
- pci_conf2_write_config_word,
- pci_conf2_write_config_dword
+ .read = pci_conf2_read,
+ .write = pci_conf2_write,
};
@@ -283,7 +195,7 @@
*/
static int __devinit pci_sanity_check(struct pci_ops *o)
{
- u16 x;
+ u32 x = 0;
struct pci_bus bus; /* Fake bus and device */
struct pci_dev dev;
@@ -292,16 +204,16 @@
bus.number = 0;
dev.bus = &bus;
for(dev.devfn=0; dev.devfn < 0x100; dev.devfn++)
- if ((!o->read_word(&dev, PCI_CLASS_DEVICE, &x) &&
+ if ((!o->read(&bus, dev.devfn, PCI_CLASS_DEVICE, 2, &x) &&
(x == PCI_CLASS_BRIDGE_HOST || x == PCI_CLASS_DISPLAY_VGA)) ||
- (!o->read_word(&dev, PCI_VENDOR_ID, &x) &&
+ (!o->read(&bus, dev.devfn, PCI_VENDOR_ID, 2, &x) &&
(x == PCI_VENDOR_ID_INTEL || x == PCI_VENDOR_ID_COMPAQ)))
return 1;
DBG("PCI: Sanity check failed\n");
return 0;
}
-static struct pci_ops * __devinit pci_check_direct(void)
+static int __init pci_direct_init(void)
{
unsigned int tmp;
unsigned long flags;
@@ -321,8 +233,10 @@
local_irq_restore(flags);
printk(KERN_INFO "PCI: Using configuration type 1\n");
if (!request_region(0xCF8, 8, "PCI conf1"))
- return NULL;
- return &pci_direct_conf1;
+ pci_root_ops = NULL;
+ else
+ pci_root_ops = &pci_direct_conf1;
+ return 0;
}
outl (tmp, 0xCF8);
}
@@ -339,28 +253,15 @@
local_irq_restore(flags);
printk(KERN_INFO "PCI: Using configuration type 2\n");
if (!request_region(0xCF8, 4, "PCI conf2"))
- return NULL;
- return &pci_direct_conf2;
+ pci_root_ops = NULL;
+ else
+ pci_root_ops = &pci_direct_conf2;
+ return 0;
}
}
local_irq_restore(flags);
- return NULL;
-}
-
-static int __init pci_direct_init(void)
-{
- if ((pci_probe & (PCI_PROBE_CONF1 | PCI_PROBE_CONF2))
- && (pci_root_ops = pci_check_direct())) {
- if (pci_root_ops == &pci_direct_conf1) {
- pci_config_read = pci_conf1_read;
- pci_config_write = pci_conf1_write;
- }
- else {
- pci_config_read = pci_conf2_read;
- pci_config_write = pci_conf2_write;
- }
- }
+ pci_root_ops = NULL;
return 0;
}
diff -Nru a/drivers/acpi/Config.in b/drivers/acpi/Config.in
--- a/drivers/acpi/Config.in Sat Aug 31 15:06:06 2002
+++ b/drivers/acpi/Config.in Sat Aug 31 15:06:06 2002
@@ -31,6 +31,9 @@
tristate ' Fan' CONFIG_ACPI_FAN
tristate ' Processor' CONFIG_ACPI_PROCESSOR
dep_tristate ' Thermal Zone' CONFIG_ACPI_THERMAL $CONFIG_ACPI_PROCESSOR
+ if [ "$CONFIG_NUMA" = "y" ]; then
+ bool ' NUMA support' CONFIG_ACPI_NUMA $CONFIG_NUMA
+ fi
tristate ' Toshiba Laptop Extras' CONFIG_ACPI_TOSHIBA
bool ' Debug Statements' CONFIG_ACPI_DEBUG
fi
@@ -58,6 +61,7 @@
define_bool CONFIG_ACPI_FAN n
define_bool CONFIG_ACPI_PROCESSOR n
define_bool CONFIG_ACPI_THERMAL n
+ define_bool CONFIG_ACPI_NUMA y
endmenu
fi
@@ -77,7 +81,10 @@
tristate ' Button' CONFIG_ACPI_BUTTON
tristate ' Fan' CONFIG_ACPI_FAN
tristate ' Processor' CONFIG_ACPI_PROCESSOR
- dep_tristate ' Thermal Zone' CONFIG_ACPI_THERMAL $CONFIG_ACPI_PROCESSOR
+ dep_tristate ' Thermal Zone' CONFIG_ACPI_THERMAL $CONFIG_ACPI_PROCESSOR
+ if [ "$CONFIG_NUMA" = "y" ]; then
+ bool ' NUMA support' CONFIG_ACPI_NUMA $CONFIG_NUMA
+ fi
bool ' Debug Statements' CONFIG_ACPI_DEBUG
endmenu
fi
diff -Nru a/drivers/acpi/Makefile b/drivers/acpi/Makefile
--- a/drivers/acpi/Makefile Sat Aug 31 15:06:06 2002
+++ b/drivers/acpi/Makefile Sat Aug 31 15:06:06 2002
@@ -43,6 +43,7 @@
obj-$(CONFIG_ACPI_PROCESSOR) += processor.o
obj-$(CONFIG_ACPI_THERMAL) += thermal.o
obj-$(CONFIG_ACPI_SYSTEM) += system.o
+obj-$(CONFIG_ACPI_NUMA) += numa.o
obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o
include $(TOPDIR)/Rules.make
diff -Nru a/drivers/acpi/bus.c b/drivers/acpi/bus.c
--- a/drivers/acpi/bus.c Sat Aug 31 15:06:01 2002
+++ b/drivers/acpi/bus.c Sat Aug 31 15:06:01 2002
@@ -32,6 +32,7 @@
#include
#include
#include
+#include
#include "acpi_bus.h"
#include "acpi_drivers.h"
#include "include/acinterp.h" /* for acpi_ex_eisa_id_to_string() */
@@ -46,8 +47,11 @@
#define PREFIX "ACPI: "
+extern void eisa_set_level_irq(unsigned int irq);
+
+extern int acpi_disabled;
+
FADT_DESCRIPTOR acpi_fadt;
-static u8 acpi_disabled;
struct acpi_device *acpi_root;
struct proc_dir_entry *acpi_root_dir;
@@ -1962,6 +1966,12 @@
printk(KERN_ERR PREFIX "Unable to get the FADT\n");
goto error1;
}
+
+ /* Ensure the SCI is set to level-triggered, active-low */
+ if (acpi_ioapic)
+ mp_override_legacy_irq(acpi_fadt.sci_int, 3, 3, acpi_fadt.sci_int);
+ else
+ eisa_set_level_irq(acpi_fadt.sci_int);
status = acpi_enable_subsystem(ACPI_FULL_INITIALIZATION);
if (ACPI_FAILURE(status)) {
diff -Nru a/drivers/acpi/debugger/dbdisasm.c b/drivers/acpi/debugger/dbdisasm.c
--- a/drivers/acpi/debugger/dbdisasm.c Sat Aug 31 15:06:00 2002
+++ /dev/null Wed Dec 31 16:00:00 1969
@@ -1,707 +0,0 @@
-/*******************************************************************************
- *
- * Module Name: dbdisasm - parser op tree display routines
- * $Revision: 67 $
- *
- ******************************************************************************/
-
-/*
- * Copyright (C) 2000 - 2002, R. Byron Moore
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-
-#include "acpi.h"
-#include "acparser.h"
-#include "amlcode.h"
-#include "acnamesp.h"
-#include "acdebug.h"
-
-
-#ifdef ENABLE_DEBUGGER
-
-#define _COMPONENT ACPI_DEBUGGER
- ACPI_MODULE_NAME ("dbdisasm")
-
-
-#define BLOCK_PAREN 1
-#define BLOCK_BRACE 2
-#define DB_NO_OP_INFO " [%2.2d] "
-#define DB_FULL_OP_INFO "%5.5X #%4.4hX [%2.2d] "
-
-
-NATIVE_CHAR *acpi_gbl_db_disasm_indent = "....";
-
-
-/*******************************************************************************
- *
- * FUNCTION: Acpi_db_block_type
- *
- * PARAMETERS: Op - Object to be examined
- *
- * RETURN: Status
- *
- * DESCRIPTION: Type of block for this op (parens or braces)
- *
- ******************************************************************************/
-
-u32
-acpi_db_block_type (
- acpi_parse_object *op)
-{
-
- switch (op->common.aml_opcode) {
- case AML_METHOD_OP:
- return (BLOCK_BRACE);
-
- default:
- break;
- }
-
- return (BLOCK_PAREN);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: Acpi_ps_display_object_pathname
- *
- * PARAMETERS: Op - Object whose pathname is to be obtained
- *
- * RETURN: Status
- *
- * DESCRIPTION: Diplay the pathname associated with a named object. Two
- * versions. One searches the parse tree (for parser-only
- * applications suchas Acpi_dump), and the other searches the
- * ACPI namespace (the parse tree is probably deleted)
- *
- ******************************************************************************/
-
-#ifdef PARSER_ONLY
-
-acpi_status
-acpi_ps_display_object_pathname (
- acpi_walk_state *walk_state,
- acpi_parse_object *op)
-{
- acpi_parse_object *target_op;
- char *name;
-
-
- if (op->common.flags & ACPI_PARSEOP_GENERIC) {
- name = op->common.value.name;
- if (name[0] == '\\') {
- acpi_os_printf (" (Fully Qualified Pathname)");
- return (AE_OK);
- }
- }
- else {
- name = (char *) &op->named.name;
- }
-
- /* Search parent tree up to the root if necessary */
-
- target_op = acpi_ps_find (op, name, 0, 0);
- if (!target_op) {
- /*
- * Didn't find the name in the parse tree. This may be
- * a problem, or it may simply be one of the predefined names
- * (such as _OS_). Rather than worry about looking up all
- * the predefined names, just display the name as given
- */
- acpi_os_printf (" **** Path not found in parse tree");
- }
- else {
- /* The target was found, print the name and complete path */
-
- acpi_os_printf (" (Path ");
- acpi_db_display_path (target_op);
- acpi_os_printf (")");
- }
-
- return (AE_OK);
-}
-
-#else
-
-acpi_status
-acpi_ps_display_object_pathname (
- acpi_walk_state *walk_state,
- acpi_parse_object *op)
-{
- acpi_status status;
- acpi_namespace_node *node;
- acpi_buffer buffer;
- u32 debug_level;
-
-
- /* Save current debug level so we don't get extraneous debug output */
-
- debug_level = acpi_dbg_level;
- acpi_dbg_level = 0;
-
- /* Just get the Node out of the Op object */
-
- node = op->common.node;
- if (!node) {
- /* Node not defined in this scope, look it up */
-
- status = acpi_ns_lookup (walk_state->scope_info, op->common.value.string, ACPI_TYPE_ANY,
- ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, walk_state, &(node));
-
- if (ACPI_FAILURE (status)) {
- /*
- * We can't get the pathname since the object
- * is not in the namespace. This can happen during single
- * stepping where a dynamic named object is *about* to be created.
- */
- acpi_os_printf (" [Path not found]");
- goto exit;
- }
-
- /* Save it for next time. */
-
- op->common.node = node;
- }
-
- /* Convert Named_desc/handle to a full pathname */
-
- buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
- status = acpi_ns_handle_to_pathname (node, &buffer);
- if (ACPI_FAILURE (status)) {
- acpi_os_printf ("****Could not get pathname****)");
- goto exit;
- }
-
- acpi_os_printf (" (Path %s)", buffer.pointer);
- ACPI_MEM_FREE (buffer.pointer);
-
-
-exit:
- /* Restore the debug level */
-
- acpi_dbg_level = debug_level;
- return (status);
-}
-
-#endif
-
-
-/*******************************************************************************
- *
- * FUNCTION: Acpi_db_display_op
- *
- * PARAMETERS: Origin - Starting object
- * Num_opcodes - Max number of opcodes to be displayed
- *
- * RETURN: None
- *
- * DESCRIPTION: Display parser object and its children
- *
- ******************************************************************************/
-
-void
-acpi_db_display_op (
- acpi_walk_state *walk_state,
- acpi_parse_object *origin,
- u32 num_opcodes)
-{
- acpi_parse_object *op = origin;
- acpi_parse_object *arg;
- acpi_parse_object *depth;
- u32 depth_count = 0;
- u32 last_depth = 0;
- u32 i;
- u32 j;
-
-
- if (!op) {
- acpi_db_display_opcode (walk_state, op);
- return;
- }
-
-
- while (op) {
- /* Indentation */
-
- depth_count = 0;
- if (!acpi_gbl_db_opt_verbose) {
- depth_count++;
- }
-
- /* Determine the nesting depth of this argument */
-
- for (depth = op->common.parent; depth; depth = depth->common.parent) {
- arg = acpi_ps_get_arg (depth, 0);
- while (arg && arg != origin) {
- arg = arg->common.next;
- }
-
- if (arg) {
- break;
- }
-
- depth_count++;
- }
-
- /* Open a new block if we are nested further than last time */
-
- if (depth_count > last_depth) {
- VERBOSE_PRINT ((DB_NO_OP_INFO, last_depth));
- for (i = 0; i < last_depth; i++) {
- acpi_os_printf ("%s", acpi_gbl_db_disasm_indent);
- }
-
- if (acpi_db_block_type (op) == BLOCK_PAREN) {
- acpi_os_printf ("(\n");
- }
- else {
- acpi_os_printf ("{\n");
- }
- }
-
- /* Close a block if we are nested less than last time */
-
- else if (depth_count < last_depth) {
- for (j = last_depth; j >= (depth_count + 1); j--) {
- VERBOSE_PRINT ((DB_NO_OP_INFO, (j - 1)));
- for (i = 1; i < j; i++) {
- acpi_os_printf ("%s", acpi_gbl_db_disasm_indent);
- }
-
- if (acpi_db_block_type (op) == BLOCK_PAREN) {
- acpi_os_printf (")\n");
- }
- else {
- acpi_os_printf ("}\n");
- }
- }
- }
-
- /* In verbose mode, print the AML offset, opcode and depth count */
-
- VERBOSE_PRINT ((DB_FULL_OP_INFO, (u32) op->common.aml_offset,
- op->common.aml_opcode, depth_count));
-
-
- /* Indent the output according to the depth count */
-
- for (i = 0; i < depth_count; i++) {
- acpi_os_printf ("%s", acpi_gbl_db_disasm_indent);
- }
-
- /* Now print the opcode */
-
- acpi_db_display_opcode (walk_state, op);
-
- /* Resolve a name reference */
-
- if ((op->common.aml_opcode == AML_INT_NAMEPATH_OP && op->common.value.name) &&
- (op->common.parent) &&
- (acpi_gbl_db_opt_verbose)) {
- (void) acpi_ps_display_object_pathname (walk_state, op);
- }
-
- acpi_os_printf ("\n");
-
- /* Get the next node in the tree */
-
- op = acpi_ps_get_depth_next (origin, op);
- last_depth = depth_count;
-
- num_opcodes--;
- if (!num_opcodes) {
- op = NULL;
- }
- }
-
- /* Close the last block(s) */
-
- depth_count = last_depth -1;
- for (i = 0; i < last_depth; i++) {
- VERBOSE_PRINT ((DB_NO_OP_INFO, last_depth - i));
- for (j = 0; j < depth_count; j++) {
- acpi_os_printf ("%s", acpi_gbl_db_disasm_indent);
- }
- acpi_os_printf ("}\n");
- depth_count--;
- }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: Acpi_db_display_namestring
- *
- * PARAMETERS: Name - ACPI Name string to store
- *
- * RETURN: None
- *
- * DESCRIPTION: Display namestring. Handles prefix characters
- *
- ******************************************************************************/
-
-void
-acpi_db_display_namestring (
- NATIVE_CHAR *name)
-{
- u32 seg_count;
-
-
- if (!name) {
- acpi_os_printf ("");
- return;
- }
-
- /* Handle all Scope Prefix operators */
-
- while (acpi_ps_is_prefix_char (ACPI_GET8 (name))) {
- /* Append prefix character */
-
- acpi_os_printf ("%1c", ACPI_GET8 (name));
- name++;
- }
-
- switch (ACPI_GET8 (name)) {
- case 0:
- seg_count = 0;
- break;
-
- case AML_DUAL_NAME_PREFIX:
- seg_count = 2;
- name++;
- break;
-
- case AML_MULTI_NAME_PREFIX_OP:
- seg_count = (u32) ACPI_GET8 (name + 1);
- name += 2;
- break;
-
- default:
- seg_count = 1;
- break;
- }
-
- while (seg_count) {
- /* Append Name segment */
-
- acpi_os_printf ("%4.4s", name);
-
- seg_count--;
- if (seg_count) {
- /* Not last name, append dot separator */
-
- acpi_os_printf (".");
- }
- name += ACPI_NAME_SIZE;
- }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: Acpi_db_display_path
- *
- * PARAMETERS: Op - Named Op whose path is to be constructed
- *
- * RETURN: None
- *
- * DESCRIPTION: Walk backwards from current scope and display the name
- * of each previous level of scope up to the root scope
- * (like "pwd" does with file systems)
- *
- ******************************************************************************/
-
-void
-acpi_db_display_path (
- acpi_parse_object *op)
-{
- acpi_parse_object *prev;
- acpi_parse_object *search;
- u32 name;
- u8 do_dot = FALSE;
- acpi_parse_object *name_path;
- const acpi_opcode_info *op_info;
-
-
- /* We are only interested in named objects */
-
- op_info = acpi_ps_get_opcode_info (op->common.aml_opcode);
- if (!(op_info->flags & AML_NSNODE)) {
- return;
- }
-
- if (op_info->flags & AML_CREATE) {
- /* Field creation - check for a fully qualified namepath */
-
- if (op->common.aml_opcode == AML_CREATE_FIELD_OP) {
- name_path = acpi_ps_get_arg (op, 3);
- }
- else {
- name_path = acpi_ps_get_arg (op, 2);
- }
-
- if ((name_path) &&
- (name_path->common.value.string) &&
- (name_path->common.value.string[0] == '\\')) {
- acpi_db_display_namestring (name_path->common.value.string);
- return;
- }
- }
-
- prev = NULL; /* Start with Root Node */
-
- while (prev != op) {
- /* Search upwards in the tree to find scope with "prev" as its parent */
-
- search = op;
- for (; ;) {
- if (search->common.parent == prev) {
- break;
- }
-
- /* Go up one level */
-
- search = search->common.parent;
- }
-
- if (prev) {
- op_info = acpi_ps_get_opcode_info (search->common.aml_opcode);
- if (!(op_info->flags & AML_FIELD)) {
- /* below root scope, append scope name */
-
- if (do_dot) {
- /* append dot */
-
- acpi_os_printf (".");
- }
-
- if (op_info->flags & AML_CREATE) {
- if (op->common.aml_opcode == AML_CREATE_FIELD_OP) {
- name_path = acpi_ps_get_arg (op, 3);
- }
- else {
- name_path = acpi_ps_get_arg (op, 2);
- }
-
- if ((name_path) &&
- (name_path->common.value.string)) {
- acpi_os_printf ("%4.4s", name_path->common.value.string);
- }
- }
- else {
- name = acpi_ps_get_name (search);
- acpi_os_printf ("%4.4s", &name);
- }
-
- do_dot = TRUE;
- }
- }
-
- prev = search;
- }
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: Acpi_db_display_opcode
- *
- * PARAMETERS: Op - Op that is to be printed
- *
- * RETURN: Status
- *
- * DESCRIPTION: Store printed op in a Buffer and return its length
- * (or -1 if out of space)
- *
- * NOTE: Terse mode prints out ASL-like code. Verbose mode adds more info.
- *
- ******************************************************************************/
-
-void
-acpi_db_display_opcode (
- acpi_walk_state *walk_state,
- acpi_parse_object *op)
-{
- u8 *byte_data;
- u32 byte_count;
- u32 i;
- const acpi_opcode_info *op_info = NULL;
- u32 name;
-
-
- if (!op) {
- acpi_os_printf ("");
- return;
- }
-
- /* op and arguments */
-
- switch (op->common.aml_opcode) {
- case AML_BYTE_OP:
-
- if (acpi_gbl_db_opt_verbose) {
- acpi_os_printf ("(u8) 0x%2.2hX", op->common.value.integer8);
- }
- else {
- acpi_os_printf ("0x%2.2hX", op->common.value.integer8);
- }
- break;
-
-
- case AML_WORD_OP:
-
- if (acpi_gbl_db_opt_verbose) {
- acpi_os_printf ("(u16) 0x%4.4hX", op->common.value.integer16);
- }
- else {
- acpi_os_printf ("0x%4.4hX", op->common.value.integer16);
- }
- break;
-
-
- case AML_DWORD_OP:
-
- if (acpi_gbl_db_opt_verbose) {
- acpi_os_printf ("(u32) 0x%8.8X", op->common.value.integer32);
- }
- else {
- acpi_os_printf ("0x%8.8X", op->common.value.integer32);
- }
- break;
-
-
- case AML_QWORD_OP:
-
- if (acpi_gbl_db_opt_verbose) {
- acpi_os_printf ("(u64) 0x%8.8X%8.8X", op->common.value.integer64.hi,
- op->common.value.integer64.lo);
- }
- else {
- acpi_os_printf ("0x%8.8X%8.8X", op->common.value.integer64.hi,
- op->common.value.integer64.lo);
- }
- break;
-
-
- case AML_STRING_OP:
-
- if (op->common.value.string) {
- acpi_os_printf ("\"%s\"", op->common.value.string);
- }
- else {
- acpi_os_printf ("<\"NULL STRING PTR\">");
- }
- break;
-
-
- case AML_INT_STATICSTRING_OP:
-
- if (op->common.value.string) {
- acpi_os_printf ("\"%s\"", op->common.value.string);
- }
- else {
- acpi_os_printf ("\"\"");
- }
- break;
-
-
- case AML_INT_NAMEPATH_OP:
-
- acpi_db_display_namestring (op->common.value.name);
- break;
-
-
- case AML_INT_NAMEDFIELD_OP:
-
- acpi_os_printf ("Named_field (Length 0x%8.8X) ", op->common.value.integer32);
- break;
-
-
- case AML_INT_RESERVEDFIELD_OP:
-
- acpi_os_printf ("Reserved_field (Length 0x%8.8X) ", op->common.value.integer32);
- break;
-
-
- case AML_INT_ACCESSFIELD_OP:
-
- acpi_os_printf ("Access_field (Length 0x%8.8X) ", op->common.value.integer32);
- break;
-
-
- case AML_INT_BYTELIST_OP:
-
- if (acpi_gbl_db_opt_verbose) {
- acpi_os_printf ("Byte_list (Length 0x%8.8X) ", op->common.value.integer32);
- }
- else {
- acpi_os_printf ("0x%2.2X", op->common.value.integer32);
-
- byte_count = op->common.value.integer32;
- byte_data = op->named.data;
-
- for (i = 0; i < byte_count; i++) {
- acpi_os_printf (", 0x%2.2X", byte_data[i]);
- }
- }
- break;
-
-
- default:
-
- /* Just get the opcode name and print it */
-
- op_info = acpi_ps_get_opcode_info (op->common.aml_opcode);
- acpi_os_printf ("%s", op_info->name);
-
-
-#ifndef PARSER_ONLY
- if ((op->common.aml_opcode == AML_INT_RETURN_VALUE_OP) &&
- (walk_state) &&
- (walk_state->results) &&
- (walk_state->results->results.num_results)) {
- acpi_db_decode_internal_object (
- walk_state->results->results.obj_desc [walk_state->results->results.num_results-1]);
- }
-#endif
- break;
- }
-
- if (!op_info) {
- /* If there is another element in the list, add a comma */
-
- if (op->common.next) {
- acpi_os_printf (",");
- }
- }
-
- /*
- * If this is a named opcode, print the associated name value
- */
- op_info = acpi_ps_get_opcode_info (op->common.aml_opcode);
- if (op && (op_info->flags & AML_NAMED)) {
- name = acpi_ps_get_name (op);
- acpi_os_printf (" %4.4s", &name);
-
- if ((acpi_gbl_db_opt_verbose) && (op->common.aml_opcode != AML_INT_NAMEDFIELD_OP)) {
- (void) acpi_ps_display_object_pathname (walk_state, op);
- }
- }
-}
-
-#endif /* ENABLE_DEBUGGER */
-
diff -Nru a/drivers/acpi/dispatcher/dsopcode.c b/drivers/acpi/dispatcher/dsopcode.c
--- a/drivers/acpi/dispatcher/dsopcode.c Sat Aug 31 15:05:55 2002
+++ b/drivers/acpi/dispatcher/dsopcode.c Sat Aug 31 15:05:55 2002
@@ -2,7 +2,7 @@
*
* Module Name: dsopcode - Dispatcher Op Region support and handling of
* "control" opcodes
- * $Revision: 81 $
+ * $Revision: 82 $
*
*****************************************************************************/
@@ -93,7 +93,7 @@
return_ACPI_STATUS (status);
}
- walk_state->parse_flags = 0;
+ walk_state->parse_flags = ACPI_PARSE_DEFERRED_OP;
/* Pass1: Parse the entire declaration */
diff -Nru a/drivers/acpi/dispatcher/dswload.c b/drivers/acpi/dispatcher/dswload.c
--- a/drivers/acpi/dispatcher/dswload.c Sat Aug 31 15:05:54 2002
+++ b/drivers/acpi/dispatcher/dswload.c Sat Aug 31 15:05:54 2002
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: dswload - Dispatcher namespace load callbacks
- * $Revision: 70 $
+ * $Revision: 71 $
*
*****************************************************************************/
@@ -109,22 +109,27 @@
acpi_status status;
acpi_object_type object_type;
NATIVE_CHAR *path;
+ u32 flags;
ACPI_FUNCTION_NAME ("Ds_load1_begin_op");
+
op = walk_state->op;
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op, walk_state));
-
- if (op && (op->common.aml_opcode == AML_INT_NAMEDFIELD_OP)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op, walk_state));
- }
-
/* We are only interested in opcodes that have an associated name */
if (op) {
if (!(walk_state->op_info->flags & AML_NAMED)) {
+#if 0
+ if ((walk_state->op_info->class == AML_CLASS_EXECUTE) ||
+ (walk_state->op_info->class == AML_CLASS_CONTROL)) {
+ acpi_os_printf ("\n\n***EXECUTABLE OPCODE %s***\n\n", walk_state->op_info->name);
+ *out_op = op;
+ return (AE_CTRL_SKIP);
+ }
+#endif
*out_op = op;
return (AE_OK);
}
@@ -144,7 +149,31 @@
object_type = walk_state->op_info->object_type;
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "State=%p Op=%p Type=%X\n", walk_state, op, object_type));
+ "State=%p Op=%p [%s] ", walk_state, op, acpi_ut_get_type_name (object_type)));
+
+ /*
+ * Setup the search flags.
+ *
+ * Since we are entering a name into the namespace, we do not want to
+ * enable the search-to-root upsearch.
+ *
+ * There are only two conditions where it is acceptable that the name
+ * already exists:
+ * 1) the Scope() operator can reopen a scoping object that was
+ * previously defined (Scope, Method, Device, etc.)
+ * 2) Whenever we are parsing a deferred opcode (Op_region, Buffer,
+ * Buffer_field, or Package), the name of the object is already
+ * in the namespace.
+ */
+ flags = ACPI_NS_NO_UPSEARCH;
+ if ((walk_state->opcode != AML_SCOPE_OP) &&
+ (!(walk_state->parse_flags & ACPI_PARSE_DEFERRED_OP))) {
+ flags |= ACPI_NS_ERROR_IF_FOUND;
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Cannot already exist\n"));
+ }
+ else {
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Both Find or Create allowed\n"));
+ }
/*
* Enter the named type into the internal namespace. We enter the name
@@ -152,12 +181,38 @@
* arguments to the opcode must be created as we go back up the parse tree later.
*/
status = acpi_ns_lookup (walk_state->scope_info, path, object_type,
- ACPI_IMODE_LOAD_PASS1, ACPI_NS_NO_UPSEARCH, walk_state, &(node));
-
+ ACPI_IMODE_LOAD_PASS1, flags, walk_state, &(node));
if (ACPI_FAILURE (status)) {
return (status);
}
+ /*
+ * For the scope op, we must check to make sure that the target is
+ * one of the opcodes that actually opens a scope
+ */
+ if (walk_state->opcode == AML_SCOPE_OP) {
+ switch (node->type) {
+ case ACPI_TYPE_ANY: /* Scope nodes are untyped (ANY) */
+ case ACPI_TYPE_DEVICE:
+ case ACPI_TYPE_METHOD:
+ case ACPI_TYPE_POWER:
+ case ACPI_TYPE_PROCESSOR:
+ case ACPI_TYPE_THERMAL:
+
+ /* These are acceptable types */
+ break;
+
+ default:
+
+ /* All other types are an error */
+
+ ACPI_REPORT_ERROR (("Invalid type (%s) for target of Scope operator [%4.4s]\n",
+ acpi_ut_get_type_name (node->type), path));
+
+ return (AE_AML_OPERAND_TYPE);
+ }
+ }
+
if (!op) {
/* Create a new op */
@@ -214,9 +269,9 @@
ACPI_FUNCTION_NAME ("Ds_load1_end_op");
+
op = walk_state->op;
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", op, walk_state));
-
/* We are only interested in opcodes that have an associated name */
diff -Nru a/drivers/acpi/events/evevent.c b/drivers/acpi/events/evevent.c
--- a/drivers/acpi/events/evevent.c Sat Aug 31 15:06:06 2002
+++ b/drivers/acpi/events/evevent.c Sat Aug 31 15:06:06 2002
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: evevent - Fixed and General Purpose Even handling and dispatch
- * $Revision: 90 $
+ * $Revision: 91 $
*
*****************************************************************************/
@@ -137,6 +137,7 @@
return_ACPI_STATUS (status);
}
+ acpi_gbl_events_initialized = TRUE;
return_ACPI_STATUS (status);
}
diff -Nru a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c
--- a/drivers/acpi/events/evmisc.c Sat Aug 31 15:06:00 2002
+++ b/drivers/acpi/events/evmisc.c Sat Aug 31 15:06:00 2002
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: evmisc - Miscellaneous event manager support functions
- * $Revision: 56 $
+ * $Revision: 57 $
*
*****************************************************************************/
@@ -547,7 +547,7 @@
*
* RETURN: none
*
- * DESCRIPTION: free memory allocated for table storage.
+ * DESCRIPTION: Disable events and free memory allocated for table storage.
*
******************************************************************************/
@@ -560,39 +560,42 @@
ACPI_FUNCTION_TRACE ("Ev_terminate");
- /*
- * Disable all event-related functionality.
- * In all cases, on error, print a message but obviously we don't abort.
- */
- /*
- * Disable all fixed events
- */
- for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) {
- status = acpi_disable_event(i, ACPI_EVENT_FIXED, 0);
- if (ACPI_FAILURE (status)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Failed to disable fixed event %d.\n", i));
- }
- }
+ if (acpi_gbl_events_initialized) {
+ /*
+ * Disable all event-related functionality.
+ * In all cases, on error, print a message but obviously we don't abort.
+ */
- /*
- * Disable all GPEs
- */
- for (i = 0; i < acpi_gbl_gpe_number_max; i++) {
- if (acpi_ev_get_gpe_number_index(i) != ACPI_GPE_INVALID) {
- status = acpi_hw_disable_gpe(i);
+ /*
+ * Disable all fixed events
+ */
+ for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) {
+ status = acpi_disable_event(i, ACPI_EVENT_FIXED, 0);
if (ACPI_FAILURE (status)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Failed to disable GPE %d.\n", i));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not disable fixed event %d\n", i));
}
}
- }
- /*
- * Remove SCI handler
- */
- status = acpi_ev_remove_sci_handler();
- if (ACPI_FAILURE(status)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unable to remove SCI handler.\n"));
+ /*
+ * Disable all GPEs
+ */
+ for (i = 0; i < acpi_gbl_gpe_number_max; i++) {
+ if (acpi_ev_get_gpe_number_index(i) != ACPI_GPE_INVALID) {
+ status = acpi_hw_disable_gpe(i);
+ if (ACPI_FAILURE (status)) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not disable GPE %d\n", i));
+ }
+ }
+ }
+
+ /*
+ * Remove SCI handler
+ */
+ status = acpi_ev_remove_sci_handler();
+ if (ACPI_FAILURE(status)) {
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not remove SCI handler\n"));
+ }
}
/*
@@ -601,7 +604,7 @@
if (acpi_gbl_original_mode == ACPI_SYS_MODE_LEGACY) {
status = acpi_disable ();
if (ACPI_FAILURE (status)) {
- ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Acpi_disable failed.\n"));
+ ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Acpi_disable failed\n"));
}
}
diff -Nru a/drivers/acpi/include/acconfig.h b/drivers/acpi/include/acconfig.h
--- a/drivers/acpi/include/acconfig.h Sat Aug 31 15:05:55 2002
+++ b/drivers/acpi/include/acconfig.h Sat Aug 31 15:05:55 2002
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acconfig.h - Global configuration constants
- * $Revision: 109 $
+ * $Revision: 110 $
*
*****************************************************************************/
@@ -54,7 +54,7 @@
/* Version string */
-#define ACPI_CA_VERSION 0x20020815
+#define ACPI_CA_VERSION 0x20020829
/* Version of ACPI supported */
diff -Nru a/drivers/acpi/include/acglobal.h b/drivers/acpi/include/acglobal.h
--- a/drivers/acpi/include/acglobal.h Sat Aug 31 15:05:53 2002
+++ b/drivers/acpi/include/acglobal.h Sat Aug 31 15:05:53 2002
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: acglobal.h - Declarations for global variables
- * $Revision: 130 $
+ * $Revision: 131 $
*
*****************************************************************************/
@@ -136,6 +136,7 @@
ACPI_EXTERN u8 acpi_gbl_step_to_next_call;
ACPI_EXTERN u8 acpi_gbl_acpi_hardware_present;
ACPI_EXTERN u8 acpi_gbl_global_lock_present;
+ACPI_EXTERN u8 acpi_gbl_events_initialized;
extern u8 acpi_gbl_shutdown;
extern u32 acpi_gbl_startup_flags;
diff -Nru a/drivers/acpi/include/aclocal.h b/drivers/acpi/include/aclocal.h
--- a/drivers/acpi/include/aclocal.h Sat Aug 31 15:06:03 2002
+++ b/drivers/acpi/include/aclocal.h Sat Aug 31 15:06:03 2002
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: aclocal.h - Internal data types used across the ACPI subsystem
- * $Revision: 175 $
+ * $Revision: 176 $
*
*****************************************************************************/
@@ -667,8 +667,8 @@
u32 aml_subtree_length;
u32 final_aml_length;
u32 final_aml_offset;
+ u32 compile_flags;
u16 parse_opcode;
- u16 compile_flags;
u8 aml_opcode_length;
u8 aml_pkg_len_bytes;
u8 extra;
diff -Nru a/drivers/acpi/include/acparser.h b/drivers/acpi/include/acparser.h
--- a/drivers/acpi/include/acparser.h Sat Aug 31 15:06:03 2002
+++ b/drivers/acpi/include/acparser.h Sat Aug 31 15:06:03 2002
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: acparser.h - AML Parser subcomponent prototypes and defines
- * $Revision: 61 $
+ * $Revision: 62 $
*
*****************************************************************************/
@@ -44,6 +44,7 @@
#define ACPI_PARSE_EXECUTE 0x0030
#define ACPI_PARSE_MODE_MASK 0x0030
+#define ACPI_PARSE_DEFERRED_OP 0x0100
/* Parser external interfaces */
diff -Nru a/drivers/acpi/include/actbl2.h b/drivers/acpi/include/actbl2.h
--- a/drivers/acpi/include/actbl2.h Sat Aug 31 15:06:01 2002
+++ b/drivers/acpi/include/actbl2.h Sat Aug 31 15:06:01 2002
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: actbl2.h - ACPI Specification Revision 2.0 Tables
- * $Revision: 27 $
+ * $Revision: 28 $
*
*****************************************************************************/
@@ -139,8 +139,8 @@
u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */
u16 flush_size; /* Number of flush strides that need to be read */
u16 flush_stride; /* Processor's memory cache line width, in bytes */
- u8 duty_offset; /* Processor’s duty cycle index in processor's P_CNT reg*/
- u8 duty_width; /* Processor’s duty cycle value bit width in P_CNT register.*/
+ u8 duty_offset; /* Processor's duty cycle index in processor's P_CNT reg*/
+ u8 duty_width; /* Processor's duty cycle value bit width in P_CNT register.*/
u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */
u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */
u8 century; /* Index to century in RTC CMOS RAM */
diff -Nru a/drivers/acpi/include/platform/aclinux.h b/drivers/acpi/include/platform/aclinux.h
--- a/drivers/acpi/include/platform/aclinux.h Sat Aug 31 15:06:06 2002
+++ b/drivers/acpi/include/platform/aclinux.h Sat Aug 31 15:06:06 2002
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Name: aclinux.h - OS specific defines, etc.
- * $Revision: 26 $
+ * $Revision: 27 $
*
*****************************************************************************/
@@ -51,6 +51,7 @@
#include
#include
#include
+#include
#if defined(__ia64__) || defined(__x86_64__)
#define ACPI_MACHINE_WIDTH 64
diff -Nru a/drivers/acpi/numa.c b/drivers/acpi/numa.c
--- /dev/null Wed Dec 31 16:00:00 1969
+++ b/drivers/acpi/numa.c Sat Aug 31 15:06:07 2002
@@ -0,0 +1,187 @@
+/*
+ * acpi_numa.c - ACPI NUMA support
+ *
+ * Copyright (C) 2002 Takayoshi Kochi
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#define PREFIX "ACPI: "
+
+extern int __init acpi_table_parse_madt_family (enum acpi_table_id id, unsigned long madt_size, int entry_id, acpi_madt_entry_handler handler);
+
+void __init
+acpi_table_print_srat_entry (
+ acpi_table_entry_header *header)
+{
+ if (!header)
+ return;
+
+ switch (header->type) {
+
+ case ACPI_SRAT_PROCESSOR_AFFINITY:
+ {
+ struct acpi_table_processor_affinity *p =
+ (struct acpi_table_processor_affinity*) header;
+ printk(KERN_INFO PREFIX "SRAT Processor (id[0x%02x] eid[0x%02x]) in proximity domain %d %s\n",
+ p->apic_id, p->lsapic_eid, p->proximity_domain,
+ p->flags.enabled?"enabled":"disabled");
+ }
+ break;
+
+ case ACPI_SRAT_MEMORY_AFFINITY:
+ {
+ struct acpi_table_memory_affinity *p =
+ (struct acpi_table_memory_affinity*) header;
+ printk(KERN_INFO PREFIX "SRAT Memory (0x%08x%08x length 0x%08x%08x type 0x%x) in proximity domain %d %s%s\n",
+ p->base_addr_hi, p->base_addr_lo, p->length_hi, p->length_lo,
+ p->memory_type, p->proximity_domain,
+ p->flags.enabled ? "enabled" : "disabled",
+ p->flags.hot_pluggable ? " hot-pluggable" : "");
+ }
+ break;
+
+ default:
+ printk(KERN_WARNING PREFIX "Found unsupported SRAT entry (type = 0x%x)\n",
+ header->type);
+ break;
+ }
+}
+
+
+static int __init
+acpi_parse_slit (unsigned long phys_addr, unsigned long size)
+{
+ struct acpi_table_slit *slit;
+ u32 localities;
+
+ if (!phys_addr || !size)
+ return -EINVAL;
+
+ slit = (struct acpi_table_slit *) __va(phys_addr);
+
+ /* downcast just for %llu vs %lu for i386/ia64 */
+ localities = (u32) slit->localities;
+
+ printk(KERN_INFO PREFIX "SLIT localities %ux%u\n", localities, localities);
+
+ acpi_numa_slit_init(slit);
+
+ return 0;
+}
+
+
+static int __init
+acpi_parse_processor_affinity (acpi_table_entry_header *header)
+{
+ struct acpi_table_processor_affinity *processor_affinity = NULL;
+
+ processor_affinity = (struct acpi_table_processor_affinity*) header;
+ if (!processor_affinity)
+ return -EINVAL;
+
+ acpi_table_print_srat_entry(header);
+
+ /* let architecture-dependent part to do it */
+ acpi_numa_processor_affinity_init(processor_affinity);
+
+ return 0;
+}
+
+
+static int __init
+acpi_parse_memory_affinity (acpi_table_entry_header *header)
+{
+ struct acpi_table_memory_affinity *memory_affinity = NULL;
+
+ memory_affinity = (struct acpi_table_memory_affinity*) header;
+ if (!memory_affinity)
+ return -EINVAL;
+
+ acpi_table_print_srat_entry(header);
+
+ /* let architecture-dependent part to do it */
+ acpi_numa_memory_affinity_init(memory_affinity);
+
+ return 0;
+}
+
+
+static int __init
+acpi_parse_srat (unsigned long phys_addr, unsigned long size)
+{
+ struct acpi_table_srat *srat = NULL;
+
+ if (!phys_addr || !size)
+ return -EINVAL;
+
+ srat = (struct acpi_table_srat *) __va(phys_addr);
+
+ printk(KERN_INFO PREFIX "SRAT revision %d\n", srat->table_revision);
+
+ return 0;
+}
+
+
+int __init
+acpi_table_parse_srat (
+ enum acpi_srat_entry_id id,
+ acpi_madt_entry_handler handler)
+{
+ return acpi_table_parse_madt_family(ACPI_SRAT, sizeof(struct acpi_table_srat),
+ id, handler);
+}
+
+
+int __init
+acpi_numa_init()
+{
+ int result;
+
+ /* SRAT: Static Resource Affinity Table */
+ result = acpi_table_parse(ACPI_SRAT, acpi_parse_srat);
+
+ if (result > 0) {
+ result = acpi_table_parse_srat(ACPI_SRAT_PROCESSOR_AFFINITY,
+ acpi_parse_processor_affinity);
+ result = acpi_table_parse_srat(ACPI_SRAT_MEMORY_AFFINITY,
+ acpi_parse_memory_affinity);
+ } else {
+ /* FIXME */
+ printk("Warning: acpi_table_parse(ACPI_SRAT) returned %d!\n",result);
+ }
+
+ /* SLIT: System Locality Information Table */
+ result = acpi_table_parse(ACPI_SLIT, acpi_parse_slit);
+ if (result < 1) {
+ /* FIXME */
+ printk("Warning: acpi_table_parse(ACPI_SLIT) returned %d!\n",result);
+ }
+
+ acpi_numa_arch_fixup();
+ return 0;
+}
diff -Nru a/drivers/acpi/osl.c b/drivers/acpi/osl.c
--- a/drivers/acpi/osl.c Sat Aug 31 15:06:06 2002
+++ b/drivers/acpi/osl.c Sat Aug 31 15:06:06 2002
@@ -71,6 +71,7 @@
static OSD_HANDLER acpi_irq_handler = NULL;
static void *acpi_irq_context = NULL;
+extern struct pci_ops *pci_root_ops;
acpi_status
acpi_os_initialize(void)
@@ -80,7 +81,7 @@
* it while walking the namespace (bus 0 and root bridges w/ _BBNs).
*/
#ifdef CONFIG_ACPI_PCI
- if (!pci_config_read || !pci_config_write) {
+ if (!pci_root_ops) {
printk(KERN_ERR PREFIX "Access to PCI configuration space unavailable\n");
return AE_NULL_ENTRY;
}
@@ -438,27 +439,31 @@
u32 width)
{
int result = 0;
+ int size = 0;
+ struct pci_bus bus;
+
if (!value)
return AE_BAD_PARAMETER;
- switch (width)
- {
+ switch (width) {
case 8:
- result = pci_config_read(pci_id->segment, pci_id->bus,
- pci_id->device, pci_id->function, reg, 1, value);
+ size = 1;
break;
case 16:
- result = pci_config_read(pci_id->segment, pci_id->bus,
- pci_id->device, pci_id->function, reg, 2, value);
+ size = 2;
break;
case 32:
- result = pci_config_read(pci_id->segment, pci_id->bus,
- pci_id->device, pci_id->function, reg, 4, value);
+ size = 4;
break;
default:
BUG();
}
+ bus.number = pci_id->bus;
+ result = pci_root_ops->read(&bus, PCI_DEVFN(pci_id->device,
+ pci_id->function),
+ reg, size, value);
+
return (result ? AE_ERROR : AE_OK);
}
@@ -470,25 +475,27 @@
u32 width)
{
int result = 0;
+ int size = 0;
+ struct pci_bus bus;
- switch (width)
- {
+ switch (width) {
case 8:
- result = pci_config_write(pci_id->segment, pci_id->bus,
- pci_id->device, pci_id->function, reg, 1, value);
+ size = 1;
break;
case 16:
- result = pci_config_write(pci_id->segment, pci_id->bus,
- pci_id->device, pci_id->function, reg, 2, value);
+ size = 2;
break;
case 32:
- result = pci_config_write(pci_id->segment, pci_id->bus,
- pci_id->device, pci_id->function, reg, 4, value);
+ size = 4;
break;
default:
BUG();
}
+ bus.number = pci_id->bus;
+ result = pci_root_ops->write(&bus, PCI_DEVFN(pci_id->device,
+ pci_id->function),
+ reg, size, value);
return (result ? AE_ERROR : AE_OK);
}
diff -Nru a/drivers/acpi/system.c b/drivers/acpi/system.c
--- a/drivers/acpi/system.c Sat Aug 31 15:06:00 2002
+++ b/drivers/acpi/system.c Sat Aug 31 15:06:00 2002
@@ -257,7 +257,6 @@
unsigned long flags = 0;
local_irq_save(flags);
- local_irq_disable();
switch (state)
{
diff -Nru a/drivers/acpi/tables.c b/drivers/acpi/tables.c
--- a/drivers/acpi/tables.c Sat Aug 31 15:05:59 2002
+++ b/drivers/acpi/tables.c Sat Aug 31 15:05:59 2002
@@ -224,11 +224,13 @@
int __init
-acpi_table_parse_madt (
+acpi_table_parse_madt_family (
enum acpi_table_id id,
+ unsigned long madt_size,
+ int entry_id,
acpi_madt_entry_handler handler)
{
- struct acpi_table_madt *madt = NULL;
+ void *madt = NULL;
acpi_table_entry_header *entry = NULL;
unsigned long count = 0;
unsigned long madt_end = 0;
@@ -240,19 +242,21 @@
/* Locate the MADT (if exists). There should only be one. */
for (i = 0; i < sdt.count; i++) {
- if (sdt.entry[i].id != ACPI_APIC)
+ if (sdt.entry[i].id != id)
continue;
- madt = (struct acpi_table_madt *)
+ madt = (void *)
__acpi_map_table(sdt.entry[i].pa, sdt.entry[i].size);
if (!madt) {
- printk(KERN_WARNING PREFIX "Unable to map MADT\n");
+ printk(KERN_WARNING PREFIX "Unable to map %s\n",
+ acpi_table_signatures[id]);
return -ENODEV;
}
break;
}
if (!madt) {
- printk(KERN_WARNING PREFIX "MADT not present\n");
+ printk(KERN_WARNING PREFIX "%s not present\n",
+ acpi_table_signatures[id]);
return -ENODEV;
}
@@ -261,10 +265,10 @@
/* Parse all entries looking for a match. */
entry = (acpi_table_entry_header *)
- ((unsigned long) madt + sizeof(struct acpi_table_madt));
+ ((unsigned long) madt + madt_size);
while (((unsigned long) entry) < madt_end) {
- if (entry->type == id) {
+ if (entry->type == entry_id) {
count++;
handler(entry);
}
@@ -273,6 +277,16 @@
}
return count;
+}
+
+
+int __init
+acpi_table_parse_madt (
+ enum acpi_madt_entry_id id,
+ acpi_madt_entry_handler handler)
+{
+ return acpi_table_parse_madt_family(ACPI_APIC, sizeof(struct acpi_table_madt),
+ id, handler);
}
diff -Nru a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c
--- a/drivers/acpi/utilities/utglobal.c Sat Aug 31 15:05:54 2002
+++ b/drivers/acpi/utilities/utglobal.c Sat Aug 31 15:05:54 2002
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: utglobal - Global variables for the ACPI subsystem
- * $Revision: 168 $
+ * $Revision: 170 $
*
*****************************************************************************/
@@ -166,10 +166,10 @@
/*
- * Names built-in to the interpreter
+ * Predefined ACPI Names (Built-in to the Interpreter)
*
* Initial values are currently supported only for types String and Number.
- * To avoid type punning, both are specified as strings in this table.
+ * Both are specified as strings in this table.
*
* NOTES:
* 1) _SB_ is defined to be a device to allow _SB_/_INI to be run
@@ -177,11 +177,11 @@
*/
const acpi_predefined_names acpi_gbl_pre_defined_names[] =
-{ {"_GPE", INTERNAL_TYPE_DEF_ANY, NULL},
- {"_PR_", INTERNAL_TYPE_DEF_ANY, NULL},
+{ {"_GPE", INTERNAL_TYPE_SCOPE, NULL},
+ {"_PR_", INTERNAL_TYPE_SCOPE, NULL},
{"_SB_", ACPI_TYPE_DEVICE, NULL},
- {"_SI_", INTERNAL_TYPE_DEF_ANY, NULL},
- {"_TZ_", INTERNAL_TYPE_DEF_ANY, NULL},
+ {"_SI_", INTERNAL_TYPE_SCOPE, NULL},
+ {"_TZ_", INTERNAL_TYPE_SCOPE, NULL},
{"_REV", ACPI_TYPE_INTEGER, "2"},
{"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME},
{"_GL_", ACPI_TYPE_MUTEX, "0"},
@@ -195,9 +195,7 @@
/*
* Properties of the ACPI Object Types, both internal and external.
- *
- * Elements of Acpi_ns_properties are bit significant
- * and the table is indexed by values of acpi_object_type
+ * The table is indexed by values of acpi_object_type
*/
const u8 acpi_gbl_ns_properties[] =
@@ -530,7 +528,6 @@
/*
* Strings and procedures used for debug only
- *
*/
@@ -763,6 +760,7 @@
acpi_gbl_gpe_register_info = NULL;
acpi_gbl_gpe_number_info = NULL;
+ acpi_gbl_events_initialized = FALSE;
/* Namespace */
diff -Nru a/drivers/block/floppy.c b/drivers/block/floppy.c
--- a/drivers/block/floppy.c Sat Aug 31 15:05:54 2002
+++ b/drivers/block/floppy.c Sat Aug 31 15:05:54 2002
@@ -239,6 +239,7 @@
static int irqdma_allocated;
+#define CURRENT current_req
#define LOCAL_END_REQUEST
#define MAJOR_NR FLOPPY_MAJOR
#define DEVICE_NAME "floppy"
@@ -249,6 +250,8 @@
#include /* for the compatibility eject ioctl */
#include
+static struct request *current_req;
+
#ifndef fd_get_dma_residue
#define fd_get_dma_residue() get_dma_residue(FLOPPY_DMA)
#endif
@@ -2296,8 +2299,13 @@
return;
add_blkdev_randomness(major(dev));
floppy_off(DEVICE_NR(dev));
- blkdev_dequeue_request(req);
end_that_request_last(req);
+
+ /* Get the next request */
+ req = elv_next_request(QUEUE);
+ if (req)
+ blkdev_dequeue_request(req);
+ CURRENT = req;
}
@@ -2306,15 +2314,15 @@
static void request_done(int uptodate)
{
struct request_queue *q = QUEUE;
- struct request *req = elv_next_request(q);
+ struct request *req = CURRENT;
unsigned long flags;
int block;
probing = 0;
reschedule_timeout(MAXTIMEOUT, "request done %d", uptodate);
- if (blk_queue_empty(q)) {
- DPRINT("request list destroyed in floppy request done\n");
+ if (!req) {
+ printk("floppy.c: no request in request_done\n");
return;
}
@@ -2328,7 +2336,7 @@
/* unlock chained buffers */
spin_lock_irqsave(q->queue_lock, flags);
- while (current_count_sectors && !blk_queue_empty(q) &&
+ while (current_count_sectors && CURRENT &&
current_count_sectors >= req->current_nr_sectors){
current_count_sectors -= req->current_nr_sectors;
req->nr_sectors -= req->current_nr_sectors;
@@ -2337,7 +2345,7 @@
}
spin_unlock_irqrestore(q->queue_lock, flags);
- if (current_count_sectors && !blk_queue_empty(q)) {
+ if (current_count_sectors && CURRENT) {
/* "unlock" last subsector */
req->buffer += current_count_sectors <<9;
req->current_nr_sectors -= current_count_sectors;
@@ -2346,7 +2354,7 @@
return;
}
- if (current_count_sectors && blk_queue_empty(q))
+ if (current_count_sectors && !CURRENT)
DPRINT("request list destroyed in floppy request done\n");
} else {
@@ -2924,10 +2932,15 @@
floppy_off(current_drive);
for (;;) {
- if (blk_queue_empty(QUEUE)) {
- do_floppy = NULL;
- unlock_fdc();
- return;
+ if (!CURRENT) {
+ struct request *req = elv_next_request(QUEUE);
+ if (!req) {
+ do_floppy = NULL;
+ unlock_fdc();
+ return;
+ }
+ blkdev_dequeue_request(req);
+ CURRENT = req;
}
if (major(CURRENT->rq_dev) != MAJOR_NR)
panic(DEVICE_NAME ": request list destroyed");
diff -Nru a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
--- a/drivers/bluetooth/hci_ldisc.c Sat Aug 31 15:06:06 2002
+++ b/drivers/bluetooth/hci_ldisc.c Sat Aug 31 15:06:06 2002
@@ -33,7 +33,6 @@
#include
#include
-#include
#include
#include
#include
diff -Nru a/drivers/char/Config.help b/drivers/char/Config.help
--- a/drivers/char/Config.help Sat Aug 31 15:05:59 2002
+++ b/drivers/char/Config.help Sat Aug 31 15:05:59 2002
@@ -985,9 +985,10 @@
CONFIG_NVRAM
If you say Y here and create a character special file /dev/nvram
with major number 10 and minor number 144 using mknod ("man mknod"),
- you get read and write access to the 50 bytes of non-volatile memory
- in the real time clock (RTC), which is contained in every PC and
- most Ataris.
+ you get read and write access to the extra bytes of non-volatile
+ memory in the real time clock (RTC), which is contained in every PC
+ and most Ataris. The actual number of bytes varies, depending on the
+ nvram in the system, but is usually 114 (128-14 for the RTC).
This memory is conventionally called "CMOS RAM" on PCs and "NVRAM"
on Ataris. /dev/nvram may be used to view settings there, or to
diff -Nru a/drivers/char/Makefile b/drivers/char/Makefile
--- a/drivers/char/Makefile Sat Aug 31 15:06:06 2002
+++ b/drivers/char/Makefile Sat Aug 31 15:06:06 2002
@@ -15,7 +15,7 @@
export-objs := busmouse.o console.o keyboard.o sysrq.o \
misc.o pty.o random.o selection.o \
sonypi.o tty_io.o tty_ioctl.o generic_serial.o rtc.o \
- ip2main.o
+ ip2main.o nvram.o
obj-$(CONFIG_VT) += vt.o vc_screen.o consolemap.o consolemap_deftbl.o selection.o keyboard.o
obj-$(CONFIG_HW_CONSOLE) += console.o defkeymap.o
diff -Nru a/drivers/char/console.c b/drivers/char/console.c
--- a/drivers/char/console.c Sat Aug 31 15:06:06 2002
+++ b/drivers/char/console.c Sat Aug 31 15:06:06 2002
@@ -150,6 +150,7 @@
static void hide_cursor(int currcons);
static void unblank_screen_t(unsigned long dummy);
static void console_callback(void *ignored);
+static void __init con_init_devfs (void);
static int printable; /* Is console ready for printing? */
@@ -2526,6 +2527,7 @@
kbd_init();
console_map_init();
+ con_init_devfs();
vcs_init();
return 0;
}
@@ -2624,7 +2626,7 @@
* is called before kmalloc() works. This function is called later to
* do the registration.
*/
-void __init con_init_devfs (void)
+static void __init con_init_devfs (void)
{
int i;
diff -Nru a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
--- a/drivers/char/drm/drmP.h Sat Aug 31 15:06:06 2002
+++ b/drivers/char/drm/drmP.h Sat Aug 31 15:06:06 2002
@@ -165,7 +165,7 @@
#define pte_unmap(pte)
#endif
-#if LINUX_VERSION_CODE < 0x020500
+#if LINUX_VERSION_CODE < 0x020413 /* KERNEL_VERSION(2,4,19) */
static inline struct page * vmalloc_to_page(void * vmalloc_addr)
{
unsigned long addr = (unsigned long) vmalloc_addr;
@@ -201,9 +201,9 @@
/* Macros to make printk easier */
#define DRM_ERROR(fmt, arg...) \
- printk(KERN_ERR "[" DRM_NAME ":" __FUNCTION__ "] *ERROR* " fmt , ##arg)
+ printk(KERN_ERR "[" DRM_NAME ":%s] *ERROR* " fmt , __FUNCTION__ , ##arg)
#define DRM_MEM_ERROR(area, fmt, arg...) \
- printk(KERN_ERR "[" DRM_NAME ":" __FUNCTION__ ":%s] *ERROR* " fmt , \
+ printk(KERN_ERR "[" DRM_NAME ":%s:%s] *ERROR* " fmt , __FUNCTION__, \
DRM(mem_stats)[area].name , ##arg)
#define DRM_INFO(fmt, arg...) printk(KERN_INFO "[" DRM_NAME "] " fmt , ##arg)
@@ -212,8 +212,8 @@
do { \
if ( DRM(flags) & DRM_FLAG_DEBUG ) \
printk(KERN_DEBUG \
- "[" DRM_NAME ":" __FUNCTION__ "] " fmt , \
- ##arg); \
+ "[" DRM_NAME ":%s] " fmt , \
+ __FUNCTION__ , ##arg); \
} while (0)
#else
#define DRM_DEBUG(fmt, arg...) do { } while (0)
diff -Nru a/drivers/char/drm/drm_agpsupport.h b/drivers/char/drm/drm_agpsupport.h
--- a/drivers/char/drm/drm_agpsupport.h Sat Aug 31 15:05:53 2002
+++ b/drivers/char/drm/drm_agpsupport.h Sat Aug 31 15:05:53 2002
@@ -268,11 +268,11 @@
case INTEL_I810: head->chipset = "Intel i810"; break;
case INTEL_I815: head->chipset = "Intel i815"; break;
-#if LINUX_VERSION_CODE >= 0x020415
+#if LINUX_VERSION_CODE >= 0x02040f /* KERNEL_VERSION(2,4,15) */
case INTEL_I820: head->chipset = "Intel i820"; break;
#endif
case INTEL_I840: head->chipset = "Intel i840"; break;
-#if LINUX_VERSION_CODE >= 0x020415
+#if LINUX_VERSION_CODE >= 0x02040f /* KERNEL_VERSION(2,4,15) */
case INTEL_I845: head->chipset = "Intel i845"; break;
#endif
case INTEL_I850: head->chipset = "Intel i850"; break;
diff -Nru a/drivers/char/drm/drm_drv.h b/drivers/char/drm/drm_drv.h
--- a/drivers/char/drm/drm_drv.h Sat Aug 31 15:05:55 2002
+++ b/drivers/char/drm/drm_drv.h Sat Aug 31 15:05:55 2002
@@ -115,15 +115,15 @@
#ifndef DRIVER_FOPS
#define DRIVER_FOPS \
static struct file_operations DRM(fops) = { \
- owner: THIS_MODULE, \
- open: DRM(open), \
- flush: DRM(flush), \
- release: DRM(release), \
- ioctl: DRM(ioctl), \
- mmap: DRM(mmap), \
- read: DRM(read), \
- fasync: DRM(fasync), \
- poll: DRM(poll), \
+ .owner = THIS_MODULE, \
+ .open = DRM(open), \
+ .flush = DRM(flush), \
+ .release = DRM(release), \
+ .ioctl = DRM(ioctl), \
+ .mmap = DRM(mmap), \
+ .read = DRM(read), \
+ .fasync = DRM(fasync), \
+ .poll = DRM(poll), \
}
#endif
diff -Nru a/drivers/char/drm/drm_stub.h b/drivers/char/drm/drm_stub.h
--- a/drivers/char/drm/drm_stub.h Sat Aug 31 15:06:06 2002
+++ b/drivers/char/drm/drm_stub.h Sat Aug 31 15:06:06 2002
@@ -66,8 +66,8 @@
}
static struct file_operations DRM(stub_fops) = {
- owner: THIS_MODULE,
- open: DRM(stub_open)
+ .owner = THIS_MODULE,
+ .open = DRM(stub_open)
};
static int DRM(stub_getminor)(const char *name, struct file_operations *fops,
diff -Nru a/drivers/char/drm/drm_vm.h b/drivers/char/drm/drm_vm.h
--- a/drivers/char/drm/drm_vm.h Sat Aug 31 15:06:06 2002
+++ b/drivers/char/drm/drm_vm.h Sat Aug 31 15:06:06 2002
@@ -33,27 +33,27 @@
#include "drmP.h"
struct vm_operations_struct DRM(vm_ops) = {
- nopage: DRM(vm_nopage),
- open: DRM(vm_open),
- close: DRM(vm_close),
+ .nopage = DRM(vm_nopage),
+ .open = DRM(vm_open),
+ .close = DRM(vm_close),
};
struct vm_operations_struct DRM(vm_shm_ops) = {
- nopage: DRM(vm_shm_nopage),
- open: DRM(vm_open),
- close: DRM(vm_shm_close),
+ .nopage = DRM(vm_shm_nopage),
+ .open = DRM(vm_open),
+ .close = DRM(vm_shm_close),
};
struct vm_operations_struct DRM(vm_dma_ops) = {
- nopage: DRM(vm_dma_nopage),
- open: DRM(vm_open),
- close: DRM(vm_close),
+ .nopage = DRM(vm_dma_nopage),
+ .open = DRM(vm_open),
+ .close = DRM(vm_close),
};
struct vm_operations_struct DRM(vm_sg_ops) = {
- nopage: DRM(vm_sg_nopage),
- open: DRM(vm_open),
- close: DRM(vm_close),
+ .nopage = DRM(vm_sg_nopage),
+ .open = DRM(vm_open),
+ .close = DRM(vm_close),
};
struct page *DRM(vm_nopage)(struct vm_area_struct *vma,
@@ -343,7 +343,7 @@
vma->vm_ops = &DRM(vm_dma_ops);
-#if LINUX_VERSION_CODE <= 0x020414
+#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */
vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */
#else
vma->vm_flags |= VM_RESERVED; /* Don't swap */
@@ -473,7 +473,7 @@
vma->vm_private_data = (void *)map;
/* Don't let this area swap. Change when
DRM_KERNEL advisory is supported. */
-#if LINUX_VERSION_CODE <= 0x020414
+#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */
vma->vm_flags |= VM_LOCKED;
#else
vma->vm_flags |= VM_RESERVED;
@@ -482,7 +482,7 @@
case _DRM_SCATTER_GATHER:
vma->vm_ops = &DRM(vm_sg_ops);
vma->vm_private_data = (void *)map;
-#if LINUX_VERSION_CODE <= 0x020414
+#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */
vma->vm_flags |= VM_LOCKED;
#else
vma->vm_flags |= VM_RESERVED;
@@ -491,7 +491,7 @@
default:
return -EINVAL; /* This should never happen. */
}
-#if LINUX_VERSION_CODE <= 0x020414
+#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */
vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */
#else
vma->vm_flags |= VM_RESERVED; /* Don't swap */
diff -Nru a/drivers/char/drm/i810_dma.c b/drivers/char/drm/i810_dma.c
--- a/drivers/char/drm/i810_dma.c Sat Aug 31 15:05:59 2002
+++ b/drivers/char/drm/i810_dma.c Sat Aug 31 15:05:59 2002
@@ -131,14 +131,14 @@
}
static struct file_operations i810_buffer_fops = {
- open: DRM(open),
- flush: DRM(flush),
- release: DRM(release),
- ioctl: DRM(ioctl),
- mmap: i810_mmap_buffers,
- read: DRM(read),
- fasync: DRM(fasync),
- poll: DRM(poll),
+ .open = DRM(open),
+ .flush = DRM(flush),
+ .release = DRM(release),
+ .ioctl = DRM(ioctl),
+ .mmap = i810_mmap_buffers,
+ .read = DRM(read),
+ .fasync = DRM(fasync),
+ .poll = DRM(poll),
};
int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
@@ -272,20 +272,24 @@
if(address == 0UL)
return 0;
-#if LINUX_VERSION_CODE < 0x020500
+#if LINUX_VERSION_CODE < 0x020409
atomic_inc(&virt_to_page(address)->count);
set_bit(PG_locked, &virt_to_page(address)->flags);
#else
get_page(virt_to_page(address));
+#if LINUX_VERSION_CODE < 0x020500
+ LockPage(virt_to_page(address));
+#else
SetPageLocked(virt_to_page(address));
#endif
+#endif
return address;
}
static void i810_free_page(drm_device_t *dev, unsigned long page)
{
if (page) {
-#if LINUX_VERSION_CODE < 0x020500
+#if LINUX_VERSION_CODE < 0x020409
atomic_dec(&virt_to_page(page)->count);
clear_bit(PG_locked, &virt_to_page(page)->flags);
wake_up(&virt_to_page(page)->wait);
@@ -339,8 +343,6 @@
end = jiffies + (HZ*3);
while (ring->space < n) {
- int i;
-
ring->head = I810_READ(LP_RING + RING_HEAD) & HEAD_ADDR;
ring->space = ring->head - (ring->tail+8);
if (ring->space < 0) ring->space += ring->Size;
diff -Nru a/drivers/char/drm/i830_dma.c b/drivers/char/drm/i830_dma.c
--- a/drivers/char/drm/i830_dma.c Sat Aug 31 15:05:54 2002
+++ b/drivers/char/drm/i830_dma.c Sat Aug 31 15:05:54 2002
@@ -153,14 +153,14 @@
}
static struct file_operations i830_buffer_fops = {
- open: DRM(open),
- flush: DRM(flush),
- release: DRM(release),
- ioctl: DRM(ioctl),
- mmap: i830_mmap_buffers,
- read: DRM(read),
- fasync: DRM(fasync),
- poll: DRM(poll),
+ .open = DRM(open),
+ .flush = DRM(flush),
+ .release = DRM(release),
+ .ioctl = DRM(ioctl),
+ .mmap = i830_mmap_buffers,
+ .read = DRM(read),
+ .fasync = DRM(fasync),
+ .poll = DRM(poll),
};
int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
@@ -303,20 +303,24 @@
if(address == 0UL)
return 0;
-#if LINUX_VERSION_CODE < 0x020500
+#if LINUX_VERSION_CODE < 0x020409
atomic_inc(&virt_to_page(address)->count);
set_bit(PG_locked, &virt_to_page(address)->flags);
#else
get_page(virt_to_page(address));
+#if LINUX_VERSION_CODE < 0x020500
+ LockPage(virt_to_page(address));
+#else
SetPageLocked(virt_to_page(address));
#endif
+#endif
return address;
}
static void i830_free_page(drm_device_t *dev, unsigned long page)
{
if (page) {
-#if LINUX_VERSION_CODE < 0x020500
+#if LINUX_VERSION_CODE < 0x020409
atomic_dec(&virt_to_page(page)->count);
clear_bit(PG_locked, &virt_to_page(page)->flags);
wake_up(&virt_to_page(page)->wait);
diff -Nru a/drivers/char/drm/mga_dma.c b/drivers/char/drm/mga_dma.c
--- a/drivers/char/drm/mga_dma.c Sat Aug 31 15:05:59 2002
+++ b/drivers/char/drm/mga_dma.c Sat Aug 31 15:05:59 2002
@@ -696,7 +696,7 @@
#if MGA_DMA_DEBUG
int ret = mga_do_wait_for_idle( dev_priv );
if ( ret < 0 )
- DRM_INFO( "%s: -EBUSY\n", __func__ );
+ DRM_INFO( "%s: -EBUSY\n", __FUNCTION__ );
return ret;
#else
return mga_do_wait_for_idle( dev_priv );
diff -Nru a/drivers/char/drm/mga_drv.h b/drivers/char/drm/mga_drv.h
--- a/drivers/char/drm/mga_drv.h Sat Aug 31 15:06:06 2002
+++ b/drivers/char/drm/mga_drv.h Sat Aug 31 15:06:06 2002
@@ -38,7 +38,7 @@
u32 tail;
int space;
- int wrapped;
+ volatile long wrapped;
volatile u32 *status;
@@ -188,7 +188,7 @@
if ( !_DRM_LOCK_IS_HELD( dev->lock.hw_lock->lock ) || \
dev->lock.pid != DRM_CURRENTPID ) { \
DRM_ERROR( "%s called without lock held\n", \
- __func__ ); \
+ __FUNCTION__ ); \
return DRM_ERR(EINVAL); \
} \
} while (0)
@@ -201,7 +201,7 @@
} else if ( dev_priv->prim.space < \
dev_priv->prim.high_mark ) { \
if ( MGA_DMA_DEBUG ) \
- DRM_INFO( "%s: wrap...\n", __func__ ); \
+ DRM_INFO( "%s: wrap...\n", __FUNCTION__ ); \
return DRM_ERR(EBUSY); \
} \
} \
@@ -212,7 +212,7 @@
if ( test_bit( 0, &dev_priv->prim.wrapped ) ) { \
if ( mga_do_wait_for_idle( dev_priv ) < 0 ) { \
if ( MGA_DMA_DEBUG ) \
- DRM_INFO( "%s: wrap...\n", __func__ ); \
+ DRM_INFO( "%s: wrap...\n", __FUNCTION__ ); \
return DRM_ERR(EBUSY); \
} \
mga_do_dma_wrap_end( dev_priv ); \
@@ -234,7 +234,7 @@
do { \
if ( MGA_VERBOSE ) { \
DRM_INFO( "BEGIN_DMA( %d ) in %s\n", \
- (n), __func__ ); \
+ (n), __FUNCTION__ ); \
DRM_INFO( " space=0x%x req=0x%x\n", \
dev_priv->prim.space, (n) * DMA_BLOCK_SIZE ); \
} \
@@ -245,7 +245,7 @@
#define BEGIN_DMA_WRAP() \
do { \
if ( MGA_VERBOSE ) { \
- DRM_INFO( "BEGIN_DMA() in %s\n", __func__ ); \
+ DRM_INFO( "BEGIN_DMA() in %s\n", __FUNCTION__ ); \
DRM_INFO( " space=0x%x\n", dev_priv->prim.space ); \
} \
prim = dev_priv->prim.start; \
@@ -264,7 +264,7 @@
#define FLUSH_DMA() \
do { \
if ( 0 ) { \
- DRM_INFO( "%s:\n", __func__ ); \
+ DRM_INFO( "%s:\n", __FUNCTION__ ); \
DRM_INFO( " tail=0x%06x head=0x%06lx\n", \
dev_priv->prim.tail, \
MGA_READ( MGA_PRIMADDRESS ) - \
diff -Nru a/drivers/char/drm/mga_state.c b/drivers/char/drm/mga_state.c
--- a/drivers/char/drm/mga_state.c Sat Aug 31 15:05:59 2002
+++ b/drivers/char/drm/mga_state.c Sat Aug 31 15:05:59 2002
@@ -37,7 +37,6 @@
#include "drm.h"
#include "mga_drm.h"
#include "mga_drv.h"
-#include "drm.h"
/* ================================================================
@@ -662,7 +661,7 @@
FLUSH_DMA();
- DRM_DEBUG( "%s... done.\n", __func__ );
+ DRM_DEBUG( "%s... done.\n", __FUNCTION__ );
}
static void mga_dma_dispatch_vertex( drm_device_t *dev, drm_buf_t *buf )
@@ -1023,7 +1022,7 @@
#if 0
if ( mga_do_wait_for_idle( dev_priv ) < 0 ) {
if ( MGA_DMA_DEBUG )
- DRM_INFO( "%s: -EBUSY\n", __func__ );
+ DRM_INFO( "%s: -EBUSY\n", __FUNCTION__ );
return DRM_ERR(EBUSY);
}
#endif
diff -Nru a/drivers/char/drm/r128_cce.c b/drivers/char/drm/r128_cce.c
--- a/drivers/char/drm/r128_cce.c Sat Aug 31 15:05:54 2002
+++ b/drivers/char/drm/r128_cce.c Sat Aug 31 15:05:54 2002
@@ -666,7 +666,7 @@
LOCK_TEST_WITH_RETURN( dev );
if ( dev_priv->cce_running || dev_priv->cce_mode == R128_PM4_NONPM4 ) {
- DRM_DEBUG( "%s while CCE running\n", __func__ );
+ DRM_DEBUG( "%s while CCE running\n", __FUNCTION__ );
return 0;
}
@@ -728,7 +728,7 @@
LOCK_TEST_WITH_RETURN( dev );
if ( !dev_priv ) {
- DRM_DEBUG( "%s called before init done\n", __func__ );
+ DRM_DEBUG( "%s called before init done\n", __FUNCTION__ );
return DRM_ERR(EINVAL);
}
diff -Nru a/drivers/char/drm/r128_drv.h b/drivers/char/drm/r128_drv.h
--- a/drivers/char/drm/r128_drv.h Sat Aug 31 15:06:06 2002
+++ b/drivers/char/drm/r128_drv.h Sat Aug 31 15:06:06 2002
@@ -401,7 +401,7 @@
do { \
if ( !_DRM_LOCK_IS_HELD( dev->lock.hw_lock->lock ) || \
dev->lock.pid != DRM_CURRENTPID ) { \
- DRM_ERROR( "%s called without lock held\n", __func__ ); \
+ DRM_ERROR( "%s called without lock held\n", __FUNCTION__ ); \
return DRM_ERR(EINVAL); \
} \
} while (0)
@@ -459,7 +459,7 @@
#define BEGIN_RING( n ) do { \
if ( R128_VERBOSE ) { \
DRM_INFO( "BEGIN_RING( %d ) in %s\n", \
- (n), __func__ ); \
+ (n), __FUNCTION__ ); \
} \
if ( dev_priv->ring.space <= (n) * sizeof(u32) ) { \
r128_wait_ring( dev_priv, (n) * sizeof(u32) ); \
diff -Nru a/drivers/char/drm/r128_state.c b/drivers/char/drm/r128_state.c
--- a/drivers/char/drm/r128_state.c Sat Aug 31 15:05:54 2002
+++ b/drivers/char/drm/r128_state.c Sat Aug 31 15:05:54 2002
@@ -43,7 +43,7 @@
{
u32 aux_sc_cntl = 0x00000000;
RING_LOCALS;
- DRM_DEBUG( " %s\n", __func__ );
+ DRM_DEBUG( " %s\n", __FUNCTION__ );
BEGIN_RING( 17 );
@@ -86,7 +86,7 @@
drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
drm_r128_context_regs_t *ctx = &sarea_priv->context_state;
RING_LOCALS;
- DRM_DEBUG( " %s\n", __func__ );
+ DRM_DEBUG( " %s\n", __FUNCTION__ );
BEGIN_RING( 2 );
@@ -101,7 +101,7 @@
drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
drm_r128_context_regs_t *ctx = &sarea_priv->context_state;
RING_LOCALS;
- DRM_DEBUG( " %s\n", __func__ );
+ DRM_DEBUG( " %s\n", __FUNCTION__ );
BEGIN_RING( 13 );
@@ -127,7 +127,7 @@
drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
drm_r128_context_regs_t *ctx = &sarea_priv->context_state;
RING_LOCALS;
- DRM_DEBUG( " %s\n", __func__ );
+ DRM_DEBUG( " %s\n", __FUNCTION__ );
BEGIN_RING( 3 );
@@ -143,7 +143,7 @@
drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
drm_r128_context_regs_t *ctx = &sarea_priv->context_state;
RING_LOCALS;
- DRM_DEBUG( " %s\n", __func__ );
+ DRM_DEBUG( " %s\n", __FUNCTION__ );
BEGIN_RING( 5 );
@@ -162,7 +162,7 @@
drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
drm_r128_context_regs_t *ctx = &sarea_priv->context_state;
RING_LOCALS;
- DRM_DEBUG( " %s\n", __func__ );
+ DRM_DEBUG( " %s\n", __FUNCTION__ );
BEGIN_RING( 2 );
@@ -179,7 +179,7 @@
drm_r128_texture_regs_t *tex = &sarea_priv->tex_state[0];
int i;
RING_LOCALS;
- DRM_DEBUG( " %s\n", __func__ );
+ DRM_DEBUG( " %s\n", __FUNCTION__ );
BEGIN_RING( 7 + R128_MAX_TEXTURE_LEVELS );
@@ -205,7 +205,7 @@
drm_r128_texture_regs_t *tex = &sarea_priv->tex_state[1];
int i;
RING_LOCALS;
- DRM_DEBUG( " %s\n", __func__ );
+ DRM_DEBUG( " %s\n", __FUNCTION__ );
BEGIN_RING( 5 + R128_MAX_TEXTURE_LEVELS );
@@ -228,7 +228,7 @@
drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
unsigned int dirty = sarea_priv->dirty;
- DRM_DEBUG( "%s: dirty=0x%08x\n", __func__, dirty );
+ DRM_DEBUG( "%s: dirty=0x%08x\n", __FUNCTION__, dirty );
if ( dirty & R128_UPLOAD_CORE ) {
r128_emit_core( dev_priv );
@@ -369,7 +369,7 @@
unsigned int flags = clear->flags;
int i;
RING_LOCALS;
- DRM_DEBUG( "%s\n", __func__ );
+ DRM_DEBUG( "%s\n", __FUNCTION__ );
if ( dev_priv->page_flipping && dev_priv->current_page == 1 ) {
unsigned int tmp = flags;
@@ -472,7 +472,7 @@
drm_clip_rect_t *pbox = sarea_priv->boxes;
int i;
RING_LOCALS;
- DRM_DEBUG( "%s\n", __func__ );
+ DRM_DEBUG( "%s\n", __FUNCTION__ );
#if R128_PERFORMANCE_BOXES
/* Do some trivial performance monitoring...
@@ -1148,7 +1148,7 @@
int count, *x, *y;
int i;
RING_LOCALS;
- DRM_DEBUG( "%s\n", __func__ );
+ DRM_DEBUG( "%s\n", __FUNCTION__ );
count = depth->n;
if ( count > dev_priv->depth_pitch ) {
@@ -1215,7 +1215,7 @@
drm_r128_private_t *dev_priv = dev->dev_private;
int i;
RING_LOCALS;
- DRM_DEBUG( "%s\n", __func__ );
+ DRM_DEBUG( "%s\n", __FUNCTION__ );
BEGIN_RING( 33 );
@@ -1264,7 +1264,7 @@
DRM_DEVICE;
drm_r128_private_t *dev_priv = dev->dev_private;
drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv;
- DRM_DEBUG( "%s\n", __func__ );
+ DRM_DEBUG( "%s\n", __FUNCTION__ );
LOCK_TEST_WITH_RETURN( dev );
@@ -1296,7 +1296,7 @@
LOCK_TEST_WITH_RETURN( dev );
if ( !dev_priv ) {
- DRM_ERROR( "%s called with no initialization\n", __func__ );
+ DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
return DRM_ERR(EINVAL);
}
@@ -1356,7 +1356,7 @@
LOCK_TEST_WITH_RETURN( dev );
if ( !dev_priv ) {
- DRM_ERROR( "%s called with no initialization\n", __func__ );
+ DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
return DRM_ERR(EINVAL);
}
@@ -1505,7 +1505,7 @@
LOCK_TEST_WITH_RETURN( dev );
if ( !dev_priv ) {
- DRM_ERROR( "%s called with no initialization\n", __func__ );
+ DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
return DRM_ERR(EINVAL);
}
diff -Nru a/drivers/char/drm/radeon.h b/drivers/char/drm/radeon.h
--- a/drivers/char/drm/radeon.h Sat Aug 31 15:05:59 2002
+++ b/drivers/char/drm/radeon.h Sat Aug 31 15:05:59 2002
@@ -51,7 +51,7 @@
#define DRIVER_DATE "20020611"
#define DRIVER_MAJOR 1
-#define DRIVER_MINOR 4
+#define DRIVER_MINOR 5
#define DRIVER_PATCHLEVEL 0
/* Interface history:
@@ -64,9 +64,10 @@
* - Add support for new radeon packets (keith)
* - Add getparam ioctl (keith)
* - Add flip-buffers ioctl, deprecate fullscreen foo (keith).
- * 1.4 - Add r200 packets to cmdbuf ioctl
+ * 1.4 - Add scratch registers to get_param ioctl.
+ * 1.5 - Add r200 packets to cmdbuf ioctl
* - Add r200 function to init ioctl
- * - Add 'scalar2' hack to cmdbuf ioctl (must die)
+ * - Add 'scalar2' instruction to cmdbuf
*/
#define DRIVER_IOCTLS \
[DRM_IOCTL_NR(DRM_IOCTL_DMA)] = { radeon_cp_buffers, 1, 0 }, \
diff -Nru a/drivers/char/drm/radeon_cp.c b/drivers/char/drm/radeon_cp.c
--- a/drivers/char/drm/radeon_cp.c Sat Aug 31 15:05:55 2002
+++ b/drivers/char/drm/radeon_cp.c Sat Aug 31 15:05:55 2002
@@ -925,6 +925,24 @@
RADEON_WRITE( RADEON_SCRATCH_UMSK, 0x7 );
+ /* Writeback doesn't seem to work everywhere, test it first */
+ DRM_WRITE32( &dev_priv->scratch[1], 0 );
+ RADEON_WRITE( RADEON_SCRATCH_REG1, 0xdeadbeef );
+
+ for ( tmp = 0 ; tmp < dev_priv->usec_timeout ; tmp++ ) {
+ if ( DRM_READ32( &dev_priv->scratch[1] ) == 0xdeadbeef )
+ break;
+ DRM_UDELAY( 1 );
+ }
+
+ if ( tmp < dev_priv->usec_timeout ) {
+ dev_priv->writeback_works = 1;
+ DRM_DEBUG( "writeback test succeeded, tmp=%d\n", tmp );
+ } else {
+ dev_priv->writeback_works = 0;
+ DRM_DEBUG( "writeback test failed\n" );
+ }
+
dev_priv->sarea_priv->last_frame = dev_priv->scratch[0] = 0;
RADEON_WRITE( RADEON_LAST_FRAME_REG,
dev_priv->sarea_priv->last_frame );
@@ -1000,7 +1018,7 @@
}
dev_priv->is_r200 = (init->func == RADEON_INIT_R200_CP);
- dev_priv->do_boxes = 1;
+ dev_priv->do_boxes = 0;
dev_priv->cp_mode = init->cp_mode;
/* We don't support anything other than bus-mastering ring mode,
@@ -1307,12 +1325,12 @@
LOCK_TEST_WITH_RETURN( dev );
if ( dev_priv->cp_running ) {
- DRM_DEBUG( "%s while CP running\n", __func__ );
+ DRM_DEBUG( "%s while CP running\n", __FUNCTION__ );
return 0;
}
if ( dev_priv->cp_mode == RADEON_CSQ_PRIDIS_INDDIS ) {
DRM_DEBUG( "%s called with bogus CP mode (%d)\n",
- __func__, dev_priv->cp_mode );
+ __FUNCTION__, dev_priv->cp_mode );
return 0;
}
@@ -1374,7 +1392,7 @@
LOCK_TEST_WITH_RETURN( dev );
if ( !dev_priv ) {
- DRM_DEBUG( "%s called before init done\n", __func__ );
+ DRM_DEBUG( "%s called before init done\n", __FUNCTION__ );
return DRM_ERR(EINVAL);
}
@@ -1456,8 +1474,8 @@
start = dev_priv->last_buf;
for ( t = 0 ; t < dev_priv->usec_timeout ; t++ ) {
- u32 done_age = DRM_READ32(&dev_priv->scratch[1]);
-
+ u32 done_age = GET_SCRATCH( 1 );
+ DRM_DEBUG("done_age = %d\n",done_age);
for ( i = start ; i < dma->buf_count ; i++ ) {
buf = dma->buflist[i];
buf_priv = buf->dev_private;
diff -Nru a/drivers/char/drm/radeon_drv.h b/drivers/char/drm/radeon_drv.h
--- a/drivers/char/drm/radeon_drv.h Sat Aug 31 15:06:00 2002
+++ b/drivers/char/drm/radeon_drv.h Sat Aug 31 15:06:00 2002
@@ -76,6 +76,7 @@
drm_radeon_freelist_t *tail;
int last_buf;
volatile u32 *scratch;
+ int writeback_works;
int usec_timeout;
@@ -233,6 +234,10 @@
#define RADEON_SCRATCH_UMSK 0x0770
#define RADEON_SCRATCH_ADDR 0x0774
+#define GET_SCRATCH( x ) (dev_priv->writeback_works \
+ ? DRM_READ32( &dev_priv->scratch[(x)] ) \
+ : RADEON_READ( RADEON_SCRATCH_REG0 + 4*(x) ) )
+
#define RADEON_HOST_PATH_CNTL 0x0130
# define RADEON_HDP_SOFT_RESET (1 << 26)
# define RADEON_HDP_WC_TIMEOUT_MASK (7 << 28)
@@ -680,7 +685,7 @@
do { \
if ( !_DRM_LOCK_IS_HELD( dev->lock.hw_lock->lock ) || \
dev->lock.pid != DRM_CURRENTPID ) { \
- DRM_ERROR( "%s called without lock held\n", __func__ ); \
+ DRM_ERROR( "%s called without lock held\n", __FUNCTION__ ); \
return DRM_ERR(EINVAL); \
} \
} while (0)
@@ -742,7 +747,7 @@
#define BEGIN_RING( n ) do { \
if ( RADEON_VERBOSE ) { \
DRM_INFO( "BEGIN_RING( %d ) in %s\n", \
- n, __func__ ); \
+ n, __FUNCTION__ ); \
} \
if ( dev_priv->ring.space <= (n) * sizeof(u32) ) { \
COMMIT_RING(); \
diff -Nru a/drivers/char/drm/radeon_state.c b/drivers/char/drm/radeon_state.c
--- a/drivers/char/drm/radeon_state.c Sat Aug 31 15:06:06 2002
+++ b/drivers/char/drm/radeon_state.c Sat Aug 31 15:06:06 2002
@@ -50,8 +50,7 @@
OUT_RING( CP_PACKET0( RADEON_RE_TOP_LEFT, 0 ) );
OUT_RING( (box->y1 << 16) | box->x1 );
OUT_RING( CP_PACKET0( RADEON_RE_WIDTH_HEIGHT, 0 ) );
-/* OUT_RING( ((box->y2 - 1) << 16) | (box->x2 - 1) );*/
- OUT_RING( (box->y2 << 16) | box->x2 );
+ OUT_RING( ((box->y2 - 1) << 16) | (box->x2 - 1) );
ADVANCE_RING();
}
@@ -412,7 +411,6 @@
RING_LOCALS;
DRM_DEBUG( "flags = 0x%x\n", flags );
-
dev_priv->stats.clears++;
if ( dev_priv->page_flipping && dev_priv->current_page == 1 ) {
@@ -810,9 +808,6 @@
BEGIN_RING( 4 );
RADEON_WAIT_UNTIL_3D_IDLE();
-/*
- RADEON_WAIT_UNTIL_PAGE_FLIPPED();
-*/
OUT_RING( CP_PACKET0( RADEON_CRTC_OFFSET, 0 ) );
if ( dev_priv->current_page == 0 ) {
@@ -1383,7 +1378,7 @@
LOCK_TEST_WITH_RETURN( dev );
if ( !dev_priv ) {
- DRM_ERROR( "%s called with no initialization\n", __func__ );
+ DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
return DRM_ERR(EINVAL);
}
@@ -1470,7 +1465,7 @@
LOCK_TEST_WITH_RETURN( dev );
if ( !dev_priv ) {
- DRM_ERROR( "%s called with no initialization\n", __func__ );
+ DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
return DRM_ERR(EINVAL);
}
@@ -1620,7 +1615,7 @@
LOCK_TEST_WITH_RETURN( dev );
if ( !dev_priv ) {
- DRM_ERROR( "%s called with no initialization\n", __func__ );
+ DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
return DRM_ERR(EINVAL);
}
@@ -1697,7 +1692,7 @@
LOCK_TEST_WITH_RETURN( dev );
if ( !dev_priv ) {
- DRM_ERROR( "%s called with no initialization\n", __func__ );
+ DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
return DRM_ERR(EINVAL);
}
@@ -1941,6 +1936,19 @@
if ( i < cmdbuf->nbox ) {
if (DRM_COPY_FROM_USER_UNCHECKED( &box, &boxes[i], sizeof(box) ))
return DRM_ERR(EFAULT);
+ /* FIXME The second and subsequent times round this loop, send a
+ * WAIT_UNTIL_3D_IDLE before calling emit_clip_rect(). This
+ * fixes a lockup on fast machines when sending several
+ * cliprects with a cmdbuf, as when waving a 2D window over
+ * a 3D window. Something in the commands from user space
+ * seems to hang the card when they're sent several times
+ * in a row. That would be the correct place to fix it but
+ * this works around it until I can figure that out - Tim Smith */
+ if ( i ) {
+ BEGIN_RING( 2 );
+ RADEON_WAIT_UNTIL_3D_IDLE();
+ ADVANCE_RING();
+ }
radeon_emit_clip_rect( dev_priv, &box );
}
@@ -1949,7 +1957,6 @@
ADVANCE_RING();
} while ( ++i < cmdbuf->nbox );
-
if (cmdbuf->nbox == 1)
cmdbuf->nbox = 0;
@@ -1975,7 +1982,7 @@
LOCK_TEST_WITH_RETURN( dev );
if ( !dev_priv ) {
- DRM_ERROR( "%s called with no initialization\n", __func__ );
+ DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
return DRM_ERR(EINVAL);
}
@@ -2097,7 +2104,7 @@
int value;
if ( !dev_priv ) {
- DRM_ERROR( "%s called with no initialization\n", __func__ );
+ DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
return DRM_ERR(EINVAL);
}
@@ -2112,14 +2119,14 @@
break;
case RADEON_PARAM_LAST_FRAME:
dev_priv->stats.last_frame_reads++;
- value = DRM_READ32(&dev_priv->scratch[0]);
+ value = GET_SCRATCH( 0 );
break;
case RADEON_PARAM_LAST_DISPATCH:
- value = DRM_READ32(&dev_priv->scratch[1]);
+ value = GET_SCRATCH( 1 );
break;
case RADEON_PARAM_LAST_CLEAR:
dev_priv->stats.last_clear_reads++;
- value = DRM_READ32(&dev_priv->scratch[2]);
+ value = GET_SCRATCH( 2 );
break;
default:
return DRM_ERR(EINVAL);
diff -Nru a/drivers/char/efirtc.c b/drivers/char/efirtc.c
--- a/drivers/char/efirtc.c Sat Aug 31 15:06:04 2002
+++ b/drivers/char/efirtc.c Sat Aug 31 15:06:04 2002
@@ -35,8 +35,8 @@
#include
#include
#include
+#include
-#include
#include
#include
diff -Nru a/drivers/char/keyboard.c b/drivers/char/keyboard.c
--- a/drivers/char/keyboard.c Sat Aug 31 15:05:59 2002
+++ b/drivers/char/keyboard.c Sat Aug 31 15:05:59 2002
@@ -906,7 +906,7 @@
DECLARE_TASKLET_DISABLED(keyboard_tasklet, kbd_bh, 0);
-#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) || defined(CONFIG_MIPS) || defined(CONFIG_PPC)
+#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64)
static unsigned short x86_keycodes[256] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
@@ -929,6 +929,11 @@
extern int mac_hid_mouse_emulate_buttons(int, int, int);
#endif /* CONFIG_MAC_EMUMOUSEBTN */
+#if defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64)
+static int sparc_l1_a_state = 0;
+extern void sun_do_break(void);
+#endif
+
static int emulate_raw(struct vc_data *vc, unsigned int keycode,
unsigned char up_flag)
{
@@ -1001,6 +1006,10 @@
if (keycode == KEY_LEFTALT || keycode == KEY_RIGHTALT)
sysrq_alt = down;
+#if defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64)
+ if (keycode == KEY_STOP)
+ sparc_l1_a_state = down;
+#endif
rep = (down == 2);
@@ -1018,6 +1027,12 @@
return;
}
#endif
+#if defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64)
+ if (keycode == KEY_A && sparc_l1_a_state) {
+ sparc_l1_a_state = 0;
+ sun_do_break();
+ }
+#endif
if (kbd->kbdmode == VC_MEDIUMRAW) {
/*
@@ -1180,8 +1195,10 @@
for (i = 0 ; i < MAX_NR_CONSOLES ; i++)
kbd_table[i] = kbd0;
+ input_register_handler(&kbd_handler);
+
tasklet_enable(&keyboard_tasklet);
tasklet_schedule(&keyboard_tasklet);
- input_register_handler(&kbd_handler);
+
return 0;
}
diff -Nru a/drivers/char/mxser.c b/drivers/char/mxser.c
--- a/drivers/char/mxser.c Sat Aug 31 15:06:03 2002
+++ b/drivers/char/mxser.c Sat Aug 31 15:06:04 2002
@@ -650,7 +650,7 @@
n = (sizeof(mxser_pcibrds) / sizeof(mxser_pcibrds[0])) - 1;
index = 0;
for (b = 0; b < n; b++) {
- while (pdev = pci_find_device(mxser_pcibrds[b].vendor, mxser_pcibrds[b].device, pdev))
+ while ((pdev = pci_find_device(mxser_pcibrds[b].vendor, mxser_pcibrds[b].device, pdev)))
{
if (pci_enable_device(pdev))
continue;
diff -Nru a/drivers/char/nvram.c b/drivers/char/nvram.c
--- a/drivers/char/nvram.c Sat Aug 31 15:05:59 2002
+++ b/drivers/char/nvram.c Sat Aug 31 15:05:59 2002
@@ -3,6 +3,7 @@
*
* Copyright (C) 1997 Roman Hodek
* idea by and with help from Richard Jelinek
+ * Portions copyright (c) 2001,2002 Sun Microsystems (thockin@sun.com)
*
* This driver allows you to access the contents of the non-volatile memory in
* the mc146818rtc.h real-time clock. This chip is built into all PCs and into
@@ -10,9 +11,10 @@
* "NVRAM" (NV stands for non-volatile).
*
* The data are supplied as a (seekable) character device, /dev/nvram. The
- * size of this file is 50, the number of freely available bytes in the memory
- * (i.e., not used by the RTC itself).
- *
+ * size of this file is dependant on the controller. The usual size is 114,
+ * the number of freely available bytes in the memory (i.e., not used by the
+ * RTC itself).
+ *
* Checksums over the NVRAM contents are managed by this driver. In case of a
* bad checksum, reads and writes return -EIO. The checksum can be initialized
* to a sane state either by ioctl(NVRAM_INIT) (clear whole NVRAM) or
@@ -28,25 +30,35 @@
*
* 1.1 Cesar Barros: SMP locking fixes
* added changelog
+ * 1.2 Erik Gilling: Cobalt Networks support
+ * Tim Hockin: general cleanup, Cobalt support
*/
-#define NVRAM_VERSION "1.1"
+#define NVRAM_VERSION "1.2"
#include
#include
#include
#include
+#include
#define PC 1
#define ATARI 2
+#define COBALT 3
/* select machine configuration */
#if defined(CONFIG_ATARI)
-#define MACH ATARI
+# define MACH ATARI
#elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) /* and others?? */
#define MACH PC
+# if defined(CONFIG_COBALT)
+# include
+# define MACH COBALT
+# else
+# define MACH PC
+# endif
#else
-#error Cannot build nvram driver for this machine configuration.
+# error Cannot build nvram driver for this machine configuration.
#endif
#if MACH == PC
@@ -58,10 +70,23 @@
#define PC_CKS_RANGE_START 2
#define PC_CKS_RANGE_END 31
#define PC_CKS_LOC 32
+#define NVRAM_BYTES (128-NVRAM_FIRST_BYTE)
+
+#define mach_check_checksum pc_check_checksum
+#define mach_set_checksum pc_set_checksum
+#define mach_proc_infos pc_proc_infos
+
+#endif
+
+#if MACH == COBALT
+
+#define CHECK_DRIVER_INIT() 1
+
+#define NVRAM_BYTES (128-NVRAM_FIRST_BYTE)
-#define mach_check_checksum pc_check_checksum
-#define mach_set_checksum pc_set_checksum
-#define mach_proc_infos pc_proc_infos
+#define mach_check_checksum cobalt_check_checksum
+#define mach_set_checksum cobalt_set_checksum
+#define mach_proc_infos cobalt_proc_infos
#endif
@@ -79,9 +104,9 @@
#define ATARI_CKS_RANGE_END 47
#define ATARI_CKS_LOC 48
-#define mach_check_checksum atari_check_checksum
-#define mach_set_checksum atari_set_checksum
-#define mach_proc_infos atari_proc_infos
+#define mach_check_checksum atari_check_checksum
+#define mach_set_checksum atari_set_checksum
+#define mach_proc_infos atari_proc_infos
#endif
@@ -98,7 +123,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -107,17 +131,11 @@
#include
#include
+static spinlock_t nvram_state_lock = SPIN_LOCK_UNLOCKED;
static int nvram_open_cnt; /* #times opened */
static int nvram_open_mode; /* special open modes */
-static spinlock_t nvram_open_lock = SPIN_LOCK_UNLOCKED; /* guards
- * nvram_open_cnt and
- * nvram_open_mode */
-#define NVRAM_WRITE 1 /* opened for writing (exclusive) */
-#define NVRAM_EXCL 2 /* opened with O_EXCL */
-
-#define RTC_FIRST_BYTE 14 /* RTC register number of first
- * NVRAM byte */
-#define NVRAM_BYTES 128-RTC_FIRST_BYTE /* number of NVRAM bytes */
+#define NVRAM_WRITE 1 /* opened for writing (exclusive) */
+#define NVRAM_EXCL 2 /* opened with O_EXCL */
static int mach_check_checksum(void);
static void mach_set_checksum(void);
@@ -128,95 +146,85 @@
#endif
/*
- * These are the internal NVRAM access functions, which do NOT disable
- * interrupts and do not check the checksum. Both tasks are left to higher
- * level function, so they need to be done only once per syscall.
- */
-
-static __inline__ unsigned char
-nvram_read_int(int i)
-{
- return CMOS_READ(RTC_FIRST_BYTE + i);
-}
-
-static __inline__ void
-nvram_write_int(unsigned char c, int i)
-{
- CMOS_WRITE(c, RTC_FIRST_BYTE + i);
-}
-
-static __inline__ int
-nvram_check_checksum_int(void)
-{
- return mach_check_checksum();
-}
-
-static __inline__ void
-nvram_set_checksum_int(void)
-{
- mach_set_checksum();
-}
-
-#if MACH == ATARI
-
-/*
- * These non-internal functions are provided to be called by other parts of
+ * These functions are provided to be called internally or by other parts of
* the kernel. It's up to the caller to ensure correct checksum before reading
* or after writing (needs to be done only once).
*
- * They're only built if CONFIG_ATARI is defined, because Atari drivers use
- * them. For other configurations (PC), the rest of the kernel can't rely on
- * them being present (this driver may not be configured at all, or as a
- * module), so they access config information themselves.
+ * It is worth noting that these functions all access bytes of general
+ * purpose memory in the NVRAM - that is to say, they all add the
+ * NVRAM_FIRST_BYTE offset. Pass them offsets into NVRAM as if you did not
+ * know about the RTC cruft.
*/
unsigned char
+__nvram_read_byte(int i)
+{
+ return CMOS_READ(NVRAM_FIRST_BYTE + i);
+}
+
+unsigned char
nvram_read_byte(int i)
{
unsigned long flags;
unsigned char c;
spin_lock_irqsave(&rtc_lock, flags);
- c = nvram_read_int(i);
+ c = __nvram_read_byte(i);
spin_unlock_irqrestore(&rtc_lock, flags);
return c;
}
/* This races nicely with trying to read with checksum checking (nvram_read) */
void
+__nvram_write_byte(unsigned char c, int i)
+{
+ CMOS_WRITE(c, NVRAM_FIRST_BYTE + i);
+}
+
+void
nvram_write_byte(unsigned char c, int i)
{
unsigned long flags;
spin_lock_irqsave(&rtc_lock, flags);
- nvram_write_int(c, i);
+ __nvram_write_byte(c, i);
spin_unlock_irqrestore(&rtc_lock, flags);
}
int
+__nvram_check_checksum(void)
+{
+ return mach_check_checksum();
+}
+
+int
nvram_check_checksum(void)
{
unsigned long flags;
int rv;
spin_lock_irqsave(&rtc_lock, flags);
- rv = nvram_check_checksum_int();
+ rv = __nvram_check_checksum();
spin_unlock_irqrestore(&rtc_lock, flags);
return rv;
}
void
+__nvram_set_checksum(void)
+{
+ mach_set_checksum();
+}
+
+void
nvram_set_checksum(void)
{
unsigned long flags;
spin_lock_irqsave(&rtc_lock, flags);
- nvram_set_checksum_int();
+ __nvram_set_checksum();
spin_unlock_irqrestore(&rtc_lock, flags);
}
-#endif /* MACH == ATARI */
-
/*
* The are the file operation function for user access to /dev/nvram
*/
@@ -243,17 +251,17 @@
static ssize_t
nvram_read(struct file *file, char *buf, size_t count, loff_t *ppos)
{
- char contents[NVRAM_BYTES];
+ unsigned char contents[NVRAM_BYTES];
unsigned i = *ppos;
- char *tmp;
+ unsigned char *tmp;
spin_lock_irq(&rtc_lock);
- if (!nvram_check_checksum_int())
+ if (!__nvram_check_checksum())
goto checksum_err;
for (tmp = contents; count-- > 0 && i < NVRAM_BYTES; ++i, ++tmp)
- *tmp = nvram_read_int(i);
+ *tmp = __nvram_read_byte(i);
spin_unlock_irq(&rtc_lock);
@@ -272,23 +280,24 @@
static ssize_t
nvram_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
{
- char contents[NVRAM_BYTES];
+ unsigned char contents[NVRAM_BYTES];
unsigned i = *ppos;
- char *tmp;
+ unsigned char *tmp;
+ int len;
- if (copy_from_user(contents, buf, (NVRAM_BYTES - i) < count ?
- (NVRAM_BYTES - i) : count))
+ len = (NVRAM_BYTES - i) < count ? (NVRAM_BYTES - i) : count;
+ if (copy_from_user(contents, buf, len))
return -EFAULT;
spin_lock_irq(&rtc_lock);
- if (!nvram_check_checksum_int())
+ if (!__nvram_check_checksum())
goto checksum_err;
for (tmp = contents; count-- > 0 && i < NVRAM_BYTES; ++i, ++tmp)
- nvram_write_int(*tmp, i);
+ __nvram_write_byte(*tmp, i);
- nvram_set_checksum_int();
+ __nvram_set_checksum();
spin_unlock_irq(&rtc_lock);
@@ -309,27 +318,28 @@
switch (cmd) {
- case NVRAM_INIT: /* initialize NVRAM contents and checksum */
+ case NVRAM_INIT:
+ /* initialize NVRAM contents and checksum */
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
spin_lock_irq(&rtc_lock);
for (i = 0; i < NVRAM_BYTES; ++i)
- nvram_write_int(0, i);
- nvram_set_checksum_int();
+ __nvram_write_byte(0, i);
+ __nvram_set_checksum();
spin_unlock_irq(&rtc_lock);
return 0;
- case NVRAM_SETCKS: /* just set checksum, contents unchanged
- * (maybe useful after checksum garbaged
- * somehow...) */
+ case NVRAM_SETCKS:
+ /* just set checksum, contents unchanged (maybe useful after
+ * checksum garbaged somehow...) */
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
spin_lock_irq(&rtc_lock);
- nvram_set_checksum_int();
+ __nvram_set_checksum();
spin_unlock_irq(&rtc_lock);
return 0;
@@ -341,11 +351,12 @@
static int
nvram_open(struct inode *inode, struct file *file)
{
- spin_lock(&nvram_open_lock);
+ spin_lock(&nvram_state_lock);
+
if ((nvram_open_cnt && (file->f_flags & O_EXCL)) ||
(nvram_open_mode & NVRAM_EXCL) ||
((file->f_mode & 2) && (nvram_open_mode & NVRAM_WRITE))) {
- spin_unlock(&nvram_open_lock);
+ spin_unlock(&nvram_state_lock);
return -EBUSY;
}
@@ -354,20 +365,27 @@
if (file->f_mode & 2)
nvram_open_mode |= NVRAM_WRITE;
nvram_open_cnt++;
- spin_unlock(&nvram_open_lock);
+
+ spin_unlock(&nvram_state_lock);
+
return 0;
}
static int
nvram_release(struct inode *inode, struct file *file)
{
- spin_lock(&nvram_open_lock);
+ spin_lock(&nvram_state_lock);
+
nvram_open_cnt--;
- if (file->f_flags & O_EXCL)
+
+ /* if only one instance is open, clear the EXCL bit */
+ if (nvram_open_mode & NVRAM_EXCL)
nvram_open_mode &= ~NVRAM_EXCL;
if (file->f_mode & 2)
nvram_open_mode &= ~NVRAM_WRITE;
- spin_unlock(&nvram_open_lock);
+
+ spin_unlock(&nvram_state_lock);
+
return 0;
}
@@ -390,7 +408,7 @@
spin_lock_irq(&rtc_lock);
for (i = 0; i < NVRAM_BYTES; ++i)
- contents[i] = nvram_read_int(i);
+ contents[i] = __nvram_read_byte(i);
spin_unlock_irq(&rtc_lock);
*eof = mach_proc_infos(contents, buffer, &len, &begin, offset, size);
@@ -404,7 +422,7 @@
/* This macro frees the machine specific function from bounds checking and
* this like that... */
-#define PRINT_PROC(fmt,args...) \
+#define PRINT_PROC(fmt,args...) \
do { \
*len += sprintf(buffer+*len, fmt, ##args); \
if (*begin + *len > offset + size) \
@@ -484,11 +502,13 @@
{
int i;
unsigned short sum = 0;
+ unsigned short expect;
for (i = PC_CKS_RANGE_START; i <= PC_CKS_RANGE_END; ++i)
- sum += nvram_read_int(i);
- return ((sum & 0xffff) ==
- ((nvram_read_int(PC_CKS_LOC)<<8) | nvram_read_int(PC_CKS_LOC+1)));
+ sum += __nvram_read_byte(i);
+ expect = __nvram_read_byte(PC_CKS_LOC)<<8 |
+ __nvram_read_byte(PC_CKS_LOC+1);
+ return ((sum & 0xffff) == expect);
}
static void
@@ -498,9 +518,9 @@
unsigned short sum = 0;
for (i = PC_CKS_RANGE_START; i <= PC_CKS_RANGE_END; ++i)
- sum += nvram_read_int(i);
- nvram_write_int(sum >> 8, PC_CKS_LOC);
- nvram_write_int(sum & 0xff, PC_CKS_LOC + 1);
+ sum += __nvram_read_byte(i);
+ __nvram_write_byte(sum >> 8, PC_CKS_LOC);
+ __nvram_write_byte(sum & 0xff, PC_CKS_LOC + 1);
}
#ifdef CONFIG_PROC_FS
@@ -525,7 +545,7 @@
int type;
spin_lock_irq(&rtc_lock);
- checksum = nvram_check_checksum_int();
+ checksum = __nvram_check_checksum();
spin_unlock_irq(&rtc_lock);
PRINT_PROC("Checksum status: %svalid\n", checksum ? "" : "not ");
@@ -583,6 +603,177 @@
#endif /* MACH == PC */
+#if MACH == COBALT
+
+/* the cobalt CMOS has a wider range of it's checksum */
+static int cobalt_check_checksum(void)
+{
+ int i;
+ unsigned short sum = 0;
+ unsigned short expect;
+
+ for (i = COBT_CMOS_CKS_START; i <= COBT_CMOS_CKS_END; ++i) {
+ if ((i == COBT_CMOS_CHECKSUM) || (i == (COBT_CMOS_CHECKSUM+1)))
+ continue;
+
+ sum += __nvram_read_byte(i);
+ }
+ expect = __nvram_read_byte(COBT_CMOS_CHECKSUM) << 8 |
+ __nvram_read_byte(COBT_CMOS_CHECKSUM+1);
+ return ((sum & 0xffff) == expect);
+}
+
+static void cobalt_set_checksum(void)
+{
+ int i;
+ unsigned short sum = 0;
+
+ for (i = COBT_CMOS_CKS_START; i <= COBT_CMOS_CKS_END; ++i) {
+ if ((i == COBT_CMOS_CHECKSUM) || (i == (COBT_CMOS_CHECKSUM+1)))
+ continue;
+
+ sum += __nvram_read_byte(i);
+ }
+
+ __nvram_write_byte(sum >> 8, COBT_CMOS_CHECKSUM);
+ __nvram_write_byte(sum & 0xff, COBT_CMOS_CHECKSUM+1);
+}
+
+#ifdef CONFIG_PROC_FS
+
+static int cobalt_proc_infos(unsigned char *nvram, char *buffer, int *len,
+ off_t *begin, off_t offset, int size)
+{
+ int i;
+ unsigned int checksum;
+ unsigned int flags;
+ char sernum[14];
+ char *key = "cNoEbTaWlOtR!";
+ unsigned char bto_csum;
+
+ spin_lock_irq(&rtc_lock);
+ checksum = __nvram_check_checksum();
+ spin_unlock_irq(&rtc_lock);
+
+ PRINT_PROC("Checksum status: %svalid\n", checksum ? "" : "not ");
+
+ flags = nvram[COBT_CMOS_FLAG_BYTE_0] << 8
+ | nvram[COBT_CMOS_FLAG_BYTE_1];
+
+ PRINT_PROC("Console: %s\n",
+ flags & COBT_CMOS_CONSOLE_FLAG ? "on": "off");
+
+ PRINT_PROC("Firmware Debug Messages: %s\n",
+ flags & COBT_CMOS_DEBUG_FLAG ? "on": "off");
+
+ PRINT_PROC("Auto Prompt: %s\n",
+ flags & COBT_CMOS_AUTO_PROMPT_FLAG ? "on": "off");
+
+ PRINT_PROC("Shutdown Status: %s\n",
+ flags & COBT_CMOS_CLEAN_BOOT_FLAG ? "clean": "dirty");
+
+ PRINT_PROC("Hardware Probe: %s\n",
+ flags & COBT_CMOS_HW_NOPROBE_FLAG ? "partial": "full");
+
+ PRINT_PROC("System Fault: %sdetected\n",
+ flags & COBT_CMOS_SYSFAULT_FLAG ? "": "not ");
+
+ PRINT_PROC("Panic on OOPS: %s\n",
+ flags & COBT_CMOS_OOPSPANIC_FLAG ? "yes": "no");
+
+ PRINT_PROC("Delayed Cache Initialization: %s\n",
+ flags & COBT_CMOS_DELAY_CACHE_FLAG ? "yes": "no");
+
+ PRINT_PROC("Show Logo at Boot: %s\n",
+ flags & COBT_CMOS_NOLOGO_FLAG ? "no": "yes");
+
+ PRINT_PROC("Boot Method: ");
+ switch (nvram[COBT_CMOS_BOOT_METHOD]) {
+ case COBT_CMOS_BOOT_METHOD_DISK:
+ PRINT_PROC("disk\n");
+ break;
+
+ case COBT_CMOS_BOOT_METHOD_ROM:
+ PRINT_PROC("rom\n");
+ break;
+
+ case COBT_CMOS_BOOT_METHOD_NET:
+ PRINT_PROC("net\n");
+ break;
+
+ default:
+ PRINT_PROC("unknown\n");
+ break;
+ }
+
+ PRINT_PROC("Primary Boot Device: %d:%d\n",
+ nvram[COBT_CMOS_BOOT_DEV0_MAJ],
+ nvram[COBT_CMOS_BOOT_DEV0_MIN] );
+ PRINT_PROC("Secondary Boot Device: %d:%d\n",
+ nvram[COBT_CMOS_BOOT_DEV1_MAJ],
+ nvram[COBT_CMOS_BOOT_DEV1_MIN] );
+ PRINT_PROC("Tertiary Boot Device: %d:%d\n",
+ nvram[COBT_CMOS_BOOT_DEV2_MAJ],
+ nvram[COBT_CMOS_BOOT_DEV2_MIN] );
+
+ PRINT_PROC("Uptime: %d\n",
+ nvram[COBT_CMOS_UPTIME_0] << 24 |
+ nvram[COBT_CMOS_UPTIME_1] << 16 |
+ nvram[COBT_CMOS_UPTIME_2] << 8 |
+ nvram[COBT_CMOS_UPTIME_3]);
+
+ PRINT_PROC("Boot Count: %d\n",
+ nvram[COBT_CMOS_BOOTCOUNT_0] << 24 |
+ nvram[COBT_CMOS_BOOTCOUNT_1] << 16 |
+ nvram[COBT_CMOS_BOOTCOUNT_2] << 8 |
+ nvram[COBT_CMOS_BOOTCOUNT_3]);
+
+ /* 13 bytes of serial num */
+ for (i=0 ; i<13 ; i++) {
+ sernum[i] = nvram[COBT_CMOS_SYS_SERNUM_0 + i];
+ }
+ sernum[13] = '\0';
+
+ checksum = 0;
+ for (i=0 ; i<13 ; i++) {
+ checksum += sernum[i] ^ key[i];
+ }
+ checksum = ((checksum & 0x7f) ^ (0xd6)) & 0xff;
+
+ PRINT_PROC("Serial Number: %s", sernum);
+ if (checksum != nvram[COBT_CMOS_SYS_SERNUM_CSUM]) {
+ PRINT_PROC(" (invalid checksum)");
+ }
+ PRINT_PROC("\n");
+
+ PRINT_PROC("Rom Revison: %d.%d.%d\n", nvram[COBT_CMOS_ROM_REV_MAJ],
+ nvram[COBT_CMOS_ROM_REV_MIN], nvram[COBT_CMOS_ROM_REV_REV]);
+
+ PRINT_PROC("BTO Server: %d.%d.%d.%d", nvram[COBT_CMOS_BTO_IP_0],
+ nvram[COBT_CMOS_BTO_IP_1], nvram[COBT_CMOS_BTO_IP_2],
+ nvram[COBT_CMOS_BTO_IP_3]);
+ bto_csum = nvram[COBT_CMOS_BTO_IP_0] + nvram[COBT_CMOS_BTO_IP_1]
+ + nvram[COBT_CMOS_BTO_IP_2] + nvram[COBT_CMOS_BTO_IP_3];
+ if (bto_csum != nvram[COBT_CMOS_BTO_IP_CSUM]) {
+ PRINT_PROC(" (invalid checksum)");
+ }
+ PRINT_PROC("\n");
+
+ if (flags & COBT_CMOS_VERSION_FLAG
+ && nvram[COBT_CMOS_VERSION] >= COBT_CMOS_VER_BTOCODE) {
+ PRINT_PROC("BTO Code: 0x%x\n",
+ nvram[COBT_CMOS_BTO_CODE_0] << 24 |
+ nvram[COBT_CMOS_BTO_CODE_1] << 16 |
+ nvram[COBT_CMOS_BTO_CODE_2] << 8 |
+ nvram[COBT_CMOS_BTO_CODE_3]);
+ }
+
+ return 1;
+}
+#endif /* CONFIG_PROC_FS */
+
+#endif /* MACH == COBALT */
+
#if MACH == ATARI
static int
@@ -592,9 +783,9 @@
unsigned char sum = 0;
for (i = ATARI_CKS_RANGE_START; i <= ATARI_CKS_RANGE_END; ++i)
- sum += nvram_read_int(i);
- return (nvram_read_int(ATARI_CKS_LOC) == (~sum & 0xff) &&
- nvram_read_int(ATARI_CKS_LOC + 1) == (sum & 0xff));
+ sum += __nvram_read_byte(i);
+ return (__nvram_read_byte(ATARI_CKS_LOC) == (~sum & 0xff) &&
+ __nvram_read_byte(ATARI_CKS_LOC + 1) == (sum & 0xff));
}
static void
@@ -604,9 +795,9 @@
unsigned char sum = 0;
for (i = ATARI_CKS_RANGE_START; i <= ATARI_CKS_RANGE_END; ++i)
- sum += nvram_read_int(i);
- nvram_write_int(~sum, ATARI_CKS_LOC);
- nvram_write_int(sum, ATARI_CKS_LOC + 1);
+ sum += __nvram_read_byte(i);
+ __nvram_write_byte(~sum, ATARI_CKS_LOC);
+ __nvram_write_byte(sum, ATARI_CKS_LOC + 1);
}
#ifdef CONFIG_PROC_FS
@@ -722,3 +913,12 @@
#endif /* MACH == ATARI */
MODULE_LICENSE("GPL");
+
+EXPORT_SYMBOL(__nvram_read_byte);
+EXPORT_SYMBOL(nvram_read_byte);
+EXPORT_SYMBOL(__nvram_write_byte);
+EXPORT_SYMBOL(nvram_write_byte);
+EXPORT_SYMBOL(__nvram_check_checksum);
+EXPORT_SYMBOL(nvram_check_checksum);
+EXPORT_SYMBOL(__nvram_set_checksum);
+EXPORT_SYMBOL(nvram_set_checksum);
diff -Nru a/drivers/char/sysrq.c b/drivers/char/sysrq.c
--- a/drivers/char/sysrq.c Sat Aug 31 15:06:06 2002
+++ b/drivers/char/sysrq.c Sat Aug 31 15:06:06 2002
@@ -76,7 +76,7 @@
};
#endif
-
+#ifdef CONFIG_VT
/* unraw sysrq handler */
static void sysrq_handle_unraw(int key, struct pt_regs *pt_regs,
struct tty_struct *tty)
@@ -91,7 +91,7 @@
help_msg: "unRaw",
action_msg: "Keyboard mode set to XLATE",
};
-
+#endif /* CONFIG_VT */
/* reboot sysrq handler */
static void sysrq_handle_reboot(int key, struct pt_regs *pt_regs,
@@ -371,7 +371,11 @@
as 'Off' at init time */
/* p */ &sysrq_showregs_op,
/* q */ NULL,
+#ifdef CONFIG_VT
/* r */ &sysrq_unraw_op,
+#else
+/* r */ NULL,
+#endif
/* s */ &sysrq_sync_op,
/* t */ &sysrq_showstate_op,
/* u */ &sysrq_mountro_op,
diff -Nru a/drivers/hotplug/pci_hotplug_util.c b/drivers/hotplug/pci_hotplug_util.c
--- a/drivers/hotplug/pci_hotplug_util.c Sat Aug 31 15:06:03 2002
+++ b/drivers/hotplug/pci_hotplug_util.c Sat Aug 31 15:06:03 2002
@@ -51,245 +51,6 @@
static int debug;
-static int build_dev (struct pci_ops *ops, u8 bus, u8 slot, u8 function, struct pci_dev **pci_dev)
-{
- struct pci_dev *my_dev;
- struct pci_bus *my_bus;
-
- /* Some validity checks. */
- if ((function > 7) ||
- (slot > 31) ||
- (pci_dev == NULL) ||
- (ops == NULL))
- return -ENODEV;
-
- my_dev = kmalloc (sizeof (struct pci_dev), GFP_KERNEL);
- if (!my_dev)
- return -ENOMEM;
- my_bus = kmalloc (sizeof (struct pci_bus), GFP_KERNEL);
- if (!my_bus) {
- kfree (my_dev);
- return -ENOMEM;
- }
- memset(my_dev, 0, sizeof(struct pci_dev));
- memset(my_bus, 0, sizeof(struct pci_bus));
-
- my_bus->number = bus;
- my_bus->ops = ops;
- my_dev->devfn = PCI_DEVFN(slot, function);
- my_dev->bus = my_bus;
- *pci_dev = my_dev;
- return 0;
-}
-
-/**
- * pci_read_config_byte_nodev - read a byte from a pci device
- * @ops: pointer to a &struct pci_ops that will be used to read from the pci device
- * @bus: the bus of the pci device to read from
- * @slot: the pci slot number of the pci device to read from
- * @function: the function of the pci device to read from
- * @where: the location on the pci address space to read from
- * @value: pointer to where to place the data read
- *
- * Like pci_read_config_byte() but works for pci devices that do not have a
- * pci_dev structure set up yet.
- * Returns 0 on success.
- */
-int pci_read_config_byte_nodev (struct pci_ops *ops, u8 bus, u8 slot, u8 function, int where, u8 *value)
-{
- struct pci_dev *dev = NULL;
- int result;
-
- dbg("%p, %d, %d, %d, %d, %p\n", ops, bus, slot, function, where, value);
- dev = pci_find_slot(bus, PCI_DEVFN(slot, function));
- if (dev) {
- dbg("using native pci_dev\n");
- return pci_read_config_byte (dev, where, value);
- }
-
- result = build_dev (ops, bus, slot, function, &dev);
- if (result)
- return result;
- result = pci_read_config_byte(dev, where, value);
- kfree (dev->bus);
- kfree (dev);
- return result;
-}
-
-/**
- * pci_read_config_word_nodev - read a word from a pci device
- * @ops: pointer to a &struct pci_ops that will be used to read from the pci device
- * @bus: the bus of the pci device to read from
- * @slot: the pci slot number of the pci device to read from
- * @function: the function of the pci device to read from
- * @where: the location on the pci address space to read from
- * @value: pointer to where to place the data read
- *
- * Like pci_read_config_word() but works for pci devices that do not have a
- * pci_dev structure set up yet.
- * Returns 0 on success.
- */
-int pci_read_config_word_nodev (struct pci_ops *ops, u8 bus, u8 slot, u8 function, int where, u16 *value)
-{
- struct pci_dev *dev = NULL;
- int result;
-
- dbg("%p, %d, %d, %d, %d, %p\n", ops, bus, slot, function, where, value);
- dev = pci_find_slot(bus, PCI_DEVFN(slot, function));
- if (dev) {
- dbg("using native pci_dev\n");
- return pci_read_config_word (dev, where, value);
- }
-
- result = build_dev (ops, bus, slot, function, &dev);
- if (result)
- return result;
- result = pci_read_config_word(dev, where, value);
- kfree (dev->bus);
- kfree (dev);
- return result;
-}
-
-/**
- * pci_read_config_dword_nodev - read a dword from a pci device
- * @ops: pointer to a &struct pci_ops that will be used to read from the pci
- * device
- * @bus: the bus of the pci device to read from
- * @slot: the pci slot number of the pci device to read from
- * @function: the function of the pci device to read from
- * @where: the location on the pci address space to read from
- * @value: pointer to where to place the data read
- *
- * Like pci_read_config_dword() but works for pci devices that do not have a
- * pci_dev structure set up yet.
- * Returns 0 on success.
- */
-int pci_read_config_dword_nodev (struct pci_ops *ops, u8 bus, u8 slot, u8 function, int where, u32 *value)
-{
- struct pci_dev *dev = NULL;
- int result;
-
- dbg("%p, %d, %d, %d, %d, %p\n", ops, bus, slot, function, where, value);
- dev = pci_find_slot(bus, PCI_DEVFN(slot, function));
- if (dev) {
- dbg("using native pci_dev\n");
- return pci_read_config_dword (dev, where, value);
- }
-
- result = build_dev (ops, bus, slot, function, &dev);
- if (result)
- return result;
- result = pci_read_config_dword(dev, where, value);
- kfree (dev->bus);
- kfree (dev);
- return result;
-}
-
-/**
- * pci_write_config_byte_nodev - write a byte to a pci device
- * @ops: pointer to a &struct pci_ops that will be used to write to the pci
- * device
- * @bus: the bus of the pci device to write to
- * @slot: the pci slot number of the pci device to write to
- * @function: the function of the pci device to write to
- * @where: the location on the pci address space to write to
- * @value: the value to write to the pci device
- *
- * Like pci_write_config_byte() but works for pci devices that do not have a
- * pci_dev structure set up yet.
- * Returns 0 on success.
- */
-int pci_write_config_byte_nodev (struct pci_ops *ops, u8 bus, u8 slot, u8 function, int where, u8 value)
-{
- struct pci_dev *dev = NULL;
- int result;
-
- dbg("%p, %d, %d, %d, %d, %d\n", ops, bus, slot, function, where, value);
- dev = pci_find_slot(bus, PCI_DEVFN(slot, function));
- if (dev) {
- dbg("using native pci_dev\n");
- return pci_write_config_byte (dev, where, value);
- }
-
- result = build_dev (ops, bus, slot, function, &dev);
- if (result)
- return result;
- result = pci_write_config_byte(dev, where, value);
- kfree (dev->bus);
- kfree (dev);
- return result;
-}
-
-/**
- * pci_write_config_word_nodev - write a word to a pci device
- * @ops: pointer to a &struct pci_ops that will be used to write to the pci
- * device
- * @bus: the bus of the pci device to write to
- * @slot: the pci slot number of the pci device to write to
- * @function: the function of the pci device to write to
- * @where: the location on the pci address space to write to
- * @value: the value to write to the pci device
- *
- * Like pci_write_config_word() but works for pci devices that do not have a
- * pci_dev structure set up yet.
- * Returns 0 on success.
- */
-int pci_write_config_word_nodev (struct pci_ops *ops, u8 bus, u8 slot, u8 function, int where, u16 value)
-{
- struct pci_dev *dev = NULL;
- int result;
-
- dbg("%p, %d, %d, %d, %d, %d\n", ops, bus, slot, function, where, value);
- dev = pci_find_slot(bus, PCI_DEVFN(slot, function));
- if (dev) {
- dbg("using native pci_dev\n");
- return pci_write_config_word (dev, where, value);
- }
-
- result = build_dev (ops, bus, slot, function, &dev);
- if (result)
- return result;
- result = pci_write_config_word(dev, where, value);
- kfree (dev->bus);
- kfree (dev);
- return result;
-}
-
-/**
- * pci_write_config_dword_nodev - write a dword to a pci device
- * @ops: pointer to a &struct pci_ops that will be used to write to the pci
- * device
- * @bus: the bus of the pci device to write to
- * @slot: the pci slot number of the pci device to write to
- * @function: the function of the pci device to write to
- * @where: the location on the pci address space to write to
- * @value: the value to write to the pci device
- *
- * Like pci_write_config_dword() but works for pci devices that do not have a
- * pci_dev structure set up yet.
- * Returns 0 on success.
- */
-int pci_write_config_dword_nodev (struct pci_ops *ops, u8 bus, u8 slot, u8 function, int where, u32 value)
-{
- struct pci_dev *dev = NULL;
- int result;
-
- dbg("%p, %d, %d, %d, %d, %d\n", ops, bus, slot, function, where, value);
- dev = pci_find_slot(bus, PCI_DEVFN(slot, function));
- if (dev) {
- dbg("using native pci_dev\n");
- return pci_write_config_dword (dev, where, value);
- }
-
- result = build_dev (ops, bus, slot, function, &dev);
- if (result)
- return result;
- result = pci_write_config_dword(dev, where, value);
- kfree (dev->bus);
- kfree (dev);
- return result;
-}
-
/*
* This is code that scans the pci buses.
* Every bus and every function is presented to a custom
@@ -394,10 +155,4 @@
EXPORT_SYMBOL(pci_visit_dev);
-EXPORT_SYMBOL(pci_read_config_byte_nodev);
-EXPORT_SYMBOL(pci_read_config_word_nodev);
-EXPORT_SYMBOL(pci_read_config_dword_nodev);
-EXPORT_SYMBOL(pci_write_config_byte_nodev);
-EXPORT_SYMBOL(pci_write_config_word_nodev);
-EXPORT_SYMBOL(pci_write_config_dword_nodev);
diff -Nru a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
--- a/drivers/ide/ide-cd.c Sat Aug 31 15:06:00 2002
+++ b/drivers/ide/ide-cd.c Sat Aug 31 15:06:00 2002
@@ -3005,14 +3005,8 @@
static
void ide_cdrom_revalidate (ide_drive_t *drive)
{
- ide_hwif_t *hwif = HWIF(drive);
- int unit = drive - hwif->drives;
- struct gendisk *g = hwif->gd[unit];
struct request_sense sense;
-
cdrom_read_toc(drive, &sense);
- g->minor_shift = 0;
- grok_partitions(mk_kdev(g->major, drive->select.b.unit), current_capacity(drive));
}
static
@@ -3031,6 +3025,9 @@
{
struct cdrom_info *info = drive->driver_data;
struct cdrom_device_info *devinfo = &info->devinfo;
+ ide_hwif_t *hwif = HWIF(drive);
+ int unit = drive - hwif->drives;
+ struct gendisk *g = hwif->gd[unit];
if (ide_unregister_subdriver (drive))
return 1;
@@ -3044,13 +3041,14 @@
printk ("%s: ide_cdrom_cleanup failed to unregister device from the cdrom driver.\n", drive->name);
kfree(info);
drive->driver_data = NULL;
+ del_gendisk(g);
return 0;
}
-int ide_cdrom_init(void);
-int ide_cdrom_reinit (ide_drive_t *drive);
+static int ide_cdrom_reinit (ide_drive_t *drive);
static ide_driver_t ide_cdrom_driver = {
+ owner: THIS_MODULE,
name: "ide-cdrom",
version: IDECD_VERSION,
media: ide_cdrom,
@@ -3079,17 +3077,10 @@
capacity: ide_cdrom_capacity,
special: NULL,
proc: NULL,
- init: ide_cdrom_init,
reinit: ide_cdrom_reinit,
ata_prebuilder: NULL,
atapi_prebuilder: NULL,
-};
-
-static ide_module_t ide_cdrom_module = {
- IDE_DRIVER_MODULE,
- ide_cdrom_init,
- &ide_cdrom_driver,
- NULL
+ drives: LIST_HEAD_INIT(ide_cdrom_driver.drives),
};
/* options */
@@ -3098,95 +3089,81 @@
MODULE_PARM(ignore, "s");
MODULE_DESCRIPTION("ATAPI CD-ROM Driver");
-int ide_cdrom_reinit (ide_drive_t *drive)
+static int ide_cdrom_reinit (ide_drive_t *drive)
{
struct cdrom_info *info;
- int failed = 0;
+ ide_hwif_t *hwif = HWIF(drive);
+ int unit = drive - hwif->drives;
+ struct gendisk *g = hwif->gd[unit];
+ struct request_sense sense;
- MOD_INC_USE_COUNT;
+ if (!strstr("ide-cdrom", drive->driver_req))
+ goto failed;
+ if (!drive->present)
+ goto failed;
+ if (drive->media != ide_cdrom)
+ goto failed;
+ /* skip drives that we were told to ignore */
+ if (ignore != NULL) {
+ if (strstr(ignore, drive->name)) {
+ printk("ide-cd: ignoring drive %s\n", drive->name);
+ goto failed;
+ }
+ }
+ if (drive->scsi) {
+ printk("ide-cd: passing drive %s to ide-scsi emulation.\n", drive->name);
+ goto failed;
+ }
info = (struct cdrom_info *) kmalloc (sizeof (struct cdrom_info), GFP_KERNEL);
if (info == NULL) {
printk ("%s: Can't allocate a cdrom structure\n", drive->name);
- return 1;
+ goto failed;
}
if (ide_register_subdriver (drive, &ide_cdrom_driver, IDE_SUBDRIVER_VERSION)) {
printk ("%s: Failed to register the driver with ide.c\n", drive->name);
kfree (info);
- return 1;
+ goto failed;
}
memset (info, 0, sizeof (struct cdrom_info));
drive->driver_data = info;
DRIVER(drive)->busy++;
if (ide_cdrom_setup (drive)) {
+ struct cdrom_device_info *devinfo = &info->devinfo;
DRIVER(drive)->busy--;
- if (ide_cdrom_cleanup (drive))
- printk ("%s: ide_cdrom_cleanup failed in ide_cdrom_init\n", drive->name);
- return 1;
+ ide_unregister_subdriver (drive);
+ if (info->buffer != NULL)
+ kfree(info->buffer);
+ if (info->toc != NULL)
+ kfree(info->toc);
+ if (info->changer_info != NULL)
+ kfree(info->changer_info);
+ if (devinfo->handle == drive && unregister_cdrom (devinfo))
+ printk ("%s: ide_cdrom_cleanup failed to unregister device from the cdrom driver.\n", drive->name);
+ kfree(info);
+ drive->driver_data = NULL;
+ goto failed;
}
DRIVER(drive)->busy--;
- failed--;
- ide_register_module(&ide_cdrom_module);
- MOD_DEC_USE_COUNT;
+ cdrom_read_toc(drive, &sense);
+ g->minor_shift = 0;
+ add_gendisk(g);
+ register_disk(g, mk_kdev(g->major,g->first_minor),
+ 1<minor_shift, ide_fops,
+ g->part[0].nr_sects);
return 0;
+failed:
+ return 1;
}
static void __exit ide_cdrom_exit(void)
{
- ide_drive_t *drive;
- int failed = 0;
-
- while ((drive = ide_scan_devices (ide_cdrom, ide_cdrom_driver.name, &ide_cdrom_driver, failed)) != NULL)
- if (ide_cdrom_cleanup (drive)) {
- printk ("%s: cleanup_module() called while still busy\n", drive->name);
- failed++;
- }
- ide_unregister_module (&ide_cdrom_module);
+ ide_unregister_driver(&ide_cdrom_driver);
}
-int ide_cdrom_init(void)
+static int ide_cdrom_init(void)
{
- ide_drive_t *drive;
- struct cdrom_info *info;
- int failed = 0;
-
- MOD_INC_USE_COUNT;
- while ((drive = ide_scan_devices (ide_cdrom, ide_cdrom_driver.name, NULL, failed++)) != NULL) {
- /* skip drives that we were told to ignore */
- if (ignore != NULL) {
- if (strstr(ignore, drive->name)) {
- printk("ide-cd: ignoring drive %s\n", drive->name);
- continue;
- }
- }
- if (drive->scsi) {
- printk("ide-cd: passing drive %s to ide-scsi emulation.\n", drive->name);
- continue;
- }
- info = (struct cdrom_info *) kmalloc (sizeof (struct cdrom_info), GFP_KERNEL);
- if (info == NULL) {
- printk ("%s: Can't allocate a cdrom structure\n", drive->name);
- continue;
- }
- if (ide_register_subdriver (drive, &ide_cdrom_driver, IDE_SUBDRIVER_VERSION)) {
- printk ("%s: Failed to register the driver with ide.c\n", drive->name);
- kfree (info);
- continue;
- }
- memset (info, 0, sizeof (struct cdrom_info));
- drive->driver_data = info;
- DRIVER(drive)->busy++;
- if (ide_cdrom_setup (drive)) {
- DRIVER(drive)->busy--;
- if (ide_cdrom_cleanup (drive))
- printk ("%s: ide_cdrom_cleanup failed in ide_cdrom_init\n", drive->name);
- continue;
- }
- DRIVER(drive)->busy--;
- failed--;
- }
- ide_register_module(&ide_cdrom_module);
- MOD_DEC_USE_COUNT;
+ ide_register_driver(&ide_cdrom_driver);
return 0;
}
diff -Nru a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
--- a/drivers/ide/ide-disk.c Sat Aug 31 15:05:59 2002
+++ b/drivers/ide/ide-disk.c Sat Aug 31 15:05:59 2002
@@ -1629,20 +1629,26 @@
static int idedisk_cleanup (ide_drive_t *drive)
{
+ ide_hwif_t *hwif = HWIF(drive);
+ int unit = drive - hwif->drives;
+ struct gendisk *g = hwif->gd[unit];
if ((drive->id->cfs_enable_2 & 0x3000) && drive->wcache)
if (do_idedisk_flushcache(drive))
printk (KERN_INFO "%s: Write Cache FAILED Flushing!\n",
drive->name);
- return ide_unregister_subdriver(drive);
+ if (ide_unregister_subdriver(drive))
+ return 1;
+ del_gendisk(g);
+ return 0;
}
-int idedisk_init (void);
-int idedisk_reinit(ide_drive_t *drive);
+static int idedisk_reinit(ide_drive_t *drive);
/*
* IDE subdriver functions, registered with ide.c
*/
static ide_driver_t idedisk_driver = {
+ owner: THIS_MODULE,
name: "ide-disk",
version: IDEDISK_VERSION,
media: ide_disk,
@@ -1667,92 +1673,64 @@
capacity: idedisk_capacity,
special: idedisk_special,
proc: idedisk_proc,
- init: idedisk_init,
reinit: idedisk_reinit,
ata_prebuilder: NULL,
atapi_prebuilder: NULL,
-};
-
-static ide_module_t idedisk_module = {
- IDE_DRIVER_MODULE,
- idedisk_init,
- &idedisk_driver,
- NULL
+ drives: LIST_HEAD_INIT(idedisk_driver.drives),
};
MODULE_DESCRIPTION("ATA DISK Driver");
-int idedisk_reinit (ide_drive_t *drive)
+static int idedisk_reinit(ide_drive_t *drive)
{
- int failed = 0;
-
- MOD_INC_USE_COUNT;
+ ide_hwif_t *hwif = HWIF(drive);
+ int unit = drive - hwif->drives;
+ struct gendisk *g = hwif->gd[unit];
+
+ /* strstr("foo", "") is non-NULL */
+ if (!strstr("ide-disk", drive->driver_req))
+ goto failed;
+ if (!drive->present)
+ goto failed;
+ if (drive->media != ide_disk)
+ goto failed;
if (ide_register_subdriver (drive, &idedisk_driver, IDE_SUBDRIVER_VERSION)) {
printk (KERN_ERR "ide-disk: %s: Failed to register the driver with ide.c\n", drive->name);
- return 1;
+ goto failed;
}
DRIVER(drive)->busy++;
idedisk_setup(drive);
if ((!drive->head || drive->head > 16) && !drive->select.b.lba) {
printk(KERN_ERR "%s: INVALID GEOMETRY: %d PHYSICAL HEADS?\n",
drive->name, drive->head);
- (void) idedisk_cleanup(drive);
+ if ((drive->id->cfs_enable_2 & 0x3000) && drive->wcache)
+ if (do_idedisk_flushcache(drive))
+ printk (KERN_INFO "%s: Write Cache FAILED Flushing!\n",
+ drive->name);
+ ide_unregister_subdriver(drive);
DRIVER(drive)->busy--;
- return 1;
+ goto failed;
}
DRIVER(drive)->busy--;
- failed--;
-
- ide_register_module(&idedisk_module);
- MOD_DEC_USE_COUNT;
+ g->minor_shift = PARTN_BITS;
+ add_gendisk(g);
+ register_disk(g, mk_kdev(g->major,g->first_minor),
+ 1<minor_shift, ide_fops,
+ current_capacity(drive));
return 0;
+failed:
+ return 1;
}
static void __exit idedisk_exit (void)
{
- ide_drive_t *drive;
- int failed = 0;
-
- while ((drive = ide_scan_devices (ide_disk, idedisk_driver.name, &idedisk_driver, failed)) != NULL) {
- if (idedisk_cleanup (drive)) {
- printk (KERN_ERR "%s: cleanup_module() called while still busy\n", drive->name);
- failed++;
- }
- /* We must remove proc entries defined in this module.
- Otherwise we oops while accessing these entries */
-#ifdef CONFIG_PROC_FS
- if (drive->proc)
- ide_remove_proc_entries(drive->proc, idedisk_proc);
-#endif
- }
- ide_unregister_module(&idedisk_module);
+ ide_unregister_driver(&idedisk_driver);
}
-int idedisk_init (void)
+static int idedisk_init (void)
{
- ide_drive_t *drive;
- int failed = 0;
-
- MOD_INC_USE_COUNT;
- while ((drive = ide_scan_devices (ide_disk, idedisk_driver.name, NULL, failed++)) != NULL) {
- if (ide_register_subdriver (drive, &idedisk_driver, IDE_SUBDRIVER_VERSION)) {
- printk (KERN_ERR "ide-disk: %s: Failed to register the driver with ide.c\n", drive->name);
- continue;
- }
- DRIVER(drive)->busy++;
- idedisk_setup(drive);
- if ((!drive->head || drive->head > 16) && !drive->select.b.lba) {
- printk(KERN_ERR "%s: INVALID GEOMETRY: %d PHYSICAL HEADS?\n", drive->name, drive->head);
- (void) idedisk_cleanup(drive);
- DRIVER(drive)->busy--;
- continue;
- }
- DRIVER(drive)->busy--;
- failed--;
- }
- ide_register_module(&idedisk_module);
- MOD_DEC_USE_COUNT;
+ ide_register_driver(&idedisk_driver);
return 0;
}
diff -Nru a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
--- a/drivers/ide/ide-floppy.c Sat Aug 31 15:06:00 2002
+++ b/drivers/ide/ide-floppy.c Sat Aug 31 15:06:00 2002
@@ -2122,11 +2122,15 @@
static int idefloppy_cleanup (ide_drive_t *drive)
{
idefloppy_floppy_t *floppy = drive->driver_data;
+ ide_hwif_t *hwif = HWIF(drive);
+ int unit = drive - hwif->drives;
+ struct gendisk *g = hwif->gd[unit];
if (ide_unregister_subdriver (drive))
return 1;
drive->driver_data = NULL;
kfree (floppy);
+ del_gendisk(g);
return 0;
}
@@ -2143,13 +2147,13 @@
#endif /* CONFIG_PROC_FS */
-int idefloppy_init (void);
-int idefloppy_reinit(ide_drive_t *drive);
+static int idefloppy_reinit(ide_drive_t *drive);
/*
* IDE subdriver functions, registered with ide.c
*/
static ide_driver_t idefloppy_driver = {
+ owner: THIS_MODULE,
name: "ide-floppy",
version: IDEFLOPPY_VERSION,
media: ide_floppy,
@@ -2178,111 +2182,68 @@
capacity: idefloppy_capacity,
special: NULL,
proc: idefloppy_proc,
- init: idefloppy_init,
reinit: idefloppy_reinit,
ata_prebuilder: NULL,
atapi_prebuilder: NULL,
+ drives: LIST_HEAD_INIT(idefloppy_driver.drives),
};
-static ide_module_t idefloppy_module = {
- IDE_DRIVER_MODULE,
- idefloppy_init,
- &idefloppy_driver,
- NULL
-};
-
-int idefloppy_reinit (ide_drive_t *drive)
+static int idefloppy_reinit (ide_drive_t *drive)
{
idefloppy_floppy_t *floppy;
- int failed = 0;
-
- MOD_INC_USE_COUNT;
- while ((drive = ide_scan_devices (ide_floppy, idefloppy_driver.name, NULL, failed++)) != NULL) {
- if (!idefloppy_identify_device (drive, drive->id)) {
- printk (KERN_ERR "ide-floppy: %s: not supported by this version of ide-floppy\n", drive->name);
- continue;
- }
- if (drive->scsi) {
- printk("ide-floppy: passing drive %s to ide-scsi emulation.\n", drive->name);
- continue;
- }
- if ((floppy = (idefloppy_floppy_t *) kmalloc (sizeof (idefloppy_floppy_t), GFP_KERNEL)) == NULL) {
- printk (KERN_ERR "ide-floppy: %s: Can't allocate a floppy structure\n", drive->name);
- continue;
- }
- if (ide_register_subdriver (drive, &idefloppy_driver, IDE_SUBDRIVER_VERSION)) {
- printk (KERN_ERR "ide-floppy: %s: Failed to register the driver with ide.c\n", drive->name);
- kfree (floppy);
- continue;
- }
- DRIVER(drive)->busy++;
- idefloppy_setup (drive, floppy);
- DRIVER(drive)->busy--;
- failed--;
+ ide_hwif_t *hwif = HWIF(drive);
+ int unit = drive - hwif->drives;
+ struct gendisk *g = hwif->gd[unit];
+ if (!strstr("ide-floppy", drive->driver_req))
+ goto failed;
+ if (!drive->present)
+ goto failed;
+ if (drive->media != ide_floppy)
+ goto failed;
+ if (!idefloppy_identify_device (drive, drive->id)) {
+ printk (KERN_ERR "ide-floppy: %s: not supported by this version of ide-floppy\n", drive->name);
+ goto failed;
+ }
+ if (drive->scsi) {
+ printk("ide-floppy: passing drive %s to ide-scsi emulation.\n", drive->name);
+ goto failed;
}
- ide_register_module(&idefloppy_module);
- MOD_DEC_USE_COUNT;
+ if ((floppy = (idefloppy_floppy_t *) kmalloc (sizeof (idefloppy_floppy_t), GFP_KERNEL)) == NULL) {
+ printk (KERN_ERR "ide-floppy: %s: Can't allocate a floppy structure\n", drive->name);
+ goto failed;
+ }
+ if (ide_register_subdriver (drive, &idefloppy_driver, IDE_SUBDRIVER_VERSION)) {
+ printk (KERN_ERR "ide-floppy: %s: Failed to register the driver with ide.c\n", drive->name);
+ kfree (floppy);
+ goto failed;
+ }
+ DRIVER(drive)->busy++;
+ idefloppy_setup (drive, floppy);
+ DRIVER(drive)->busy--;
+ g->minor_shift = PARTN_BITS;
+ add_gendisk(g);
+ register_disk(g, mk_kdev(g->major,g->first_minor),
+ 1<minor_shift, ide_fops,
+ g->part[0].nr_sects);
return 0;
+failed:
+ return 1;
}
MODULE_DESCRIPTION("ATAPI FLOPPY Driver");
static void __exit idefloppy_exit (void)
{
- ide_drive_t *drive;
- int failed = 0;
-
- while ((drive = ide_scan_devices (ide_floppy, idefloppy_driver.name, &idefloppy_driver, failed)) != NULL) {
- if (idefloppy_cleanup (drive)) {
- printk ("%s: cleanup_module() called while still busy\n", drive->name);
- failed++;
- }
- /* We must remove proc entries defined in this module.
- Otherwise we oops while accessing these entries */
-#ifdef CONFIG_PROC_FS
- if (drive->proc)
- ide_remove_proc_entries(drive->proc, idefloppy_proc);
-#endif
- }
- ide_unregister_module(&idefloppy_module);
+ ide_unregister_driver(&idefloppy_driver);
}
/*
* idefloppy_init will register the driver for each floppy.
*/
-int idefloppy_init (void)
+static int idefloppy_init (void)
{
- ide_drive_t *drive;
- idefloppy_floppy_t *floppy;
- int failed = 0;
-
printk("ide-floppy driver " IDEFLOPPY_VERSION "\n");
- MOD_INC_USE_COUNT;
- while ((drive = ide_scan_devices (ide_floppy, idefloppy_driver.name, NULL, failed++)) != NULL) {
- if (!idefloppy_identify_device (drive, drive->id)) {
- printk (KERN_ERR "ide-floppy: %s: not supported by this version of ide-floppy\n", drive->name);
- continue;
- }
- if (drive->scsi) {
- printk("ide-floppy: passing drive %s to ide-scsi emulation.\n", drive->name);
- continue;
- }
- if ((floppy = (idefloppy_floppy_t *) kmalloc (sizeof (idefloppy_floppy_t), GFP_KERNEL)) == NULL) {
- printk (KERN_ERR "ide-floppy: %s: Can't allocate a floppy structure\n", drive->name);
- continue;
- }
- if (ide_register_subdriver (drive, &idefloppy_driver, IDE_SUBDRIVER_VERSION)) {
- printk (KERN_ERR "ide-floppy: %s: Failed to register the driver with ide.c\n", drive->name);
- kfree (floppy);
- continue;
- }
- DRIVER(drive)->busy++;
- idefloppy_setup (drive, floppy);
- DRIVER(drive)->busy--;
- failed--;
- }
- ide_register_module(&idefloppy_module);
- MOD_DEC_USE_COUNT;
+ ide_register_driver(&idefloppy_driver);
return 0;
}
diff -Nru a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
--- a/drivers/ide/ide-probe.c Sat Aug 31 15:06:00 2002
+++ b/drivers/ide/ide-probe.c Sat Aug 31 15:06:00 2002
@@ -555,6 +555,7 @@
*/
for (unit = 0; unit < MAX_DRIVES; ++unit) {
ide_drive_t *drive = &hwif->drives[unit];
+ drive->dn = ((hwif->channel ? 2 : 0) + unit);
(void) probe_for_drive (drive);
if (drive->present && !hwif->present) {
hwif->present = 1;
@@ -585,6 +586,17 @@
if (hwif->tuneproc != NULL && drive->autotune == 1)
/* auto-tune PIO mode */
hwif->tuneproc(drive, 255);
+
+ if ((drive->autotune != 2) && hwif->dmaproc != NULL) {
+ /*
+ * Force DMAing for the beginning of the check.
+ * Some chipsets appear to do interesting
+ * things, if not checked and cleared.
+ * PARANOIA!!!
+ */
+ hwif->dmaproc(ide_dma_off_quietly, drive);
+ hwif->dmaproc(ide_dma_check, drive);
+ }
}
}
}
@@ -852,14 +864,12 @@
gd[unit].nr_real = 1;
gd[unit].fops = ide_fops;
hwif->gd[unit] = gd + unit;
- add_gendisk(gd + unit);
}
for (unit = 0; unit < units; ++unit) {
#if 1
char name[64];
ide_add_generic_settings(hwif->drives + unit);
- hwif->drives[unit].dn = ((hwif->channel ? 2 : 0) + unit);
sprintf (name, "host%d/bus%d/target%d/lun%d",
(hwif->channel && hwif->mate) ?
hwif->mate->index : hwif->index,
@@ -871,7 +881,6 @@
char name[64];
ide_add_generic_settings(hwif->drives + unit);
- hwif->drives[unit].dn = ((hwif->channel ? 2 : 0) + unit);
sprintf (name, "host%d/bus%d/target%d/lun%d",
(hwif->channel && hwif->mate) ? hwif->mate->index : hwif->index,
hwif->channel, unit, hwif->drives[unit].lun);
@@ -997,6 +1006,15 @@
for (index = 0; index < MAX_HWIFS; ++index)
if (probe[index])
hwif_init(&ide_hwifs[index]);
+ for (index = 0; index < MAX_HWIFS; ++index)
+ if (probe[index]) {
+ ide_hwif_t *hwif = &ide_hwifs[index];
+ int unit;
+ if (!hwif->present)
+ continue;
+ for (unit = 0; unit < MAX_DRIVES; ++unit)
+ ata_attach(&hwif->drives[unit]);
+ }
if (!ide_probe)
ide_probe = &ideprobe_module;
MOD_DEC_USE_COUNT;
diff -Nru a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c
--- a/drivers/ide/ide-proc.c Sat Aug 31 15:05:53 2002
+++ b/drivers/ide/ide-proc.c Sat Aug 31 15:05:53 2002
@@ -67,6 +67,7 @@
#include
#include
#include
+#include
#include
@@ -374,24 +375,6 @@
return digit;
}
-static int proc_ide_read_drivers
- (char *page, char **start, off_t off, int count, int *eof, void *data)
-{
- char *out = page;
- int len;
- ide_module_t *p = ide_modules;
- ide_driver_t *driver;
-
- while (p) {
- driver = (ide_driver_t *) p->info;
- if (driver)
- out += sprintf(out, "%s version %s\n", driver->name, driver->version);
- p = p->next;
- }
- len = out - page;
- PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
-}
-
static int proc_ide_read_imodel
(char *page, char **start, off_t off, int count, int *eof, void *data)
{
@@ -832,15 +815,29 @@
}
}
+extern struct seq_operations ide_drivers_op;
+static int ide_drivers_open(struct inode *inode, struct file *file)
+{
+ return seq_open(file, &ide_drivers_op);
+}
+static struct file_operations ide_drivers_operations = {
+ open: ide_drivers_open,
+ read: seq_read,
+ llseek: seq_lseek,
+ release: seq_release,
+};
+
void proc_ide_create(void)
{
+ struct proc_dir_entry *entry;
proc_ide_root = proc_mkdir("ide", 0);
if (!proc_ide_root) return;
create_proc_ide_interfaces();
- create_proc_read_entry("drivers", 0, proc_ide_root,
- proc_ide_read_drivers, NULL);
+ entry = create_proc_entry("drivers", 0, proc_ide_root);
+ if (entry)
+ entry->proc_fops = &ide_drivers_operations;
#ifdef CONFIG_BLK_DEV_AEC62XX
if ((aec62xx_display_info) && (aec62xx_proc))
diff -Nru a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
--- a/drivers/ide/ide-tape.c Sat Aug 31 15:05:59 2002
+++ b/drivers/ide/ide-tape.c Sat Aug 31 15:05:59 2002
@@ -1424,7 +1424,6 @@
* Additional state variables are defined in our ide_drive_t structure.
*/
static idetape_chrdev_t idetape_chrdevs[MAX_HWIFS * MAX_DRIVES];
-static int idetape_chrdev_present = 0;
#if IDETAPE_DEBUG_LOG_VERBOSE
@@ -6272,11 +6271,6 @@
devfs_unregister(tape->de_r);
devfs_unregister(tape->de_n);
kfree (tape);
- for (minor = 0; minor < MAX_HWIFS * MAX_DRIVES; minor++)
- if (idetape_chrdevs[minor].drive != NULL)
- return 0;
- unregister_chrdev(IDETAPE_MAJOR, "ht");
- idetape_chrdev_present = 0;
return 0;
}
@@ -6305,13 +6299,13 @@
#endif
-int idetape_init (void);
-int idetape_reinit(ide_drive_t *drive);
+static int idetape_reinit(ide_drive_t *drive);
/*
* IDE subdriver functions, registered with ide.c
*/
static ide_driver_t idetape_driver = {
+ owner: THIS_MODULE,
name: "ide-tape",
version: IDETAPE_VERSION,
media: ide_tape,
@@ -6340,17 +6334,10 @@
capacity: NULL,
special: NULL,
proc: idetape_proc,
- init: idetape_init,
reinit: idetape_reinit,
ata_prebuilder: NULL,
atapi_prebuilder: NULL,
-};
-
-static ide_module_t idetape_module = {
- IDE_DRIVER_MODULE,
- idetape_init,
- &idetape_driver,
- NULL
+ drives: LIST_HEAD_INIT(idetape_driver.drives),
};
/*
@@ -6365,91 +6352,57 @@
release: idetape_chrdev_release,
};
-int idetape_reinit (ide_drive_t *drive)
+static int idetape_reinit (ide_drive_t *drive)
{
-#if 0
idetape_tape_t *tape;
- int minor, failed = 0, supported = 0;
-/* DRIVER(drive)->busy++; */
- MOD_INC_USE_COUNT;
-#if ONSTREAM_DEBUG
- printk(KERN_INFO "ide-tape: MOD_INC_USE_COUNT in idetape_init\n");
-#endif
- if (!idetape_chrdev_present)
- for (minor = 0; minor < MAX_HWIFS * MAX_DRIVES; minor++ )
- idetape_chrdevs[minor].drive = NULL;
+ int minor;
- if ((drive = ide_scan_devices(ide_tape, idetape_driver.name, NULL, failed++)) == NULL) {
- ide_register_module(&idetape_module);
- MOD_DEC_USE_COUNT;
-#if ONSTREAM_DEBUG
- printk(KERN_INFO "ide-tape: MOD_DEC_USE_COUNT in idetape_init\n");
-#endif
- return 0;
- }
- if (!idetape_chrdev_present &&
- register_chrdev(IDETAPE_MAJOR, "ht", &idetape_fops)) {
- printk(KERN_ERR "ide-tape: Failed to register character device interface\n");
- MOD_DEC_USE_COUNT;
-#if ONSTREAM_DEBUG
- printk(KERN_INFO "ide-tape: MOD_DEC_USE_COUNT in idetape_init\n");
-#endif
- return -EBUSY;
- }
- do {
- if (!idetape_identify_device(drive, drive->id)) {
- printk(KERN_ERR "ide-tape: %s: not supported by this version of ide-tape\n", drive->name);
- continue;
- }
- if (drive->scsi) {
- if (strstr(drive->id->model, "OnStream DI-30")) {
- printk("ide-tape: ide-scsi emulation is not supported for %s.\n", drive->id->model);
- } else {
- printk("ide-tape: passing drive %s to ide-scsi emulation.\n", drive->name);
- continue;
- }
- }
- tape = (idetape_tape_t *) kmalloc (sizeof (idetape_tape_t), GFP_KERNEL);
- if (tape == NULL) {
- printk(KERN_ERR "ide-tape: %s: Can't allocate a tape structure\n", drive->name);
- continue;
- }
- if (ide_register_subdriver (drive, &idetape_driver, IDE_SUBDRIVER_VERSION)) {
- printk(KERN_ERR "ide-tape: %s: Failed to register the driver with ide.c\n", drive->name);
- kfree(tape);
- continue;
+ if (!strstr("ide-tape", drive->driver_req))
+ goto failed;
+ if (!drive->present)
+ goto failed;
+ if (drive->media != ide_tape)
+ goto failed;
+ if (!idetape_identify_device (drive, drive->id)) {
+ printk(KERN_ERR "ide-tape: %s: not supported by this version of ide-tape\n", drive->name);
+ goto failed;
+ }
+ if (drive->scsi) {
+ if (strstr(drive->id->model, "OnStream DI-")) {
+ printk("ide-tape: ide-scsi emulation is not supported for %s.\n", drive->id->model);
+ } else {
+ printk("ide-tape: passing drive %s to ide-scsi emulation.\n", drive->name);
+ goto failed;
}
- for (minor = 0; idetape_chrdevs[minor].drive != NULL; minor++);
- idetape_setup(drive, tape, minor);
- idetape_chrdevs[minor].drive = drive;
- tape->de_r =
- devfs_register (drive->de, "mt", DEVFS_FL_DEFAULT,
- HWIF(drive)->major, minor,
- S_IFCHR | S_IRUGO | S_IWUGO,
- &idetape_fops, NULL);
- tape->de_n =
- devfs_register (drive->de, "mtn", DEVFS_FL_DEFAULT,
- HWIF(drive)->major, minor + 128,
- S_IFCHR | S_IRUGO | S_IWUGO,
- &idetape_fops, NULL);
- devfs_register_tape(tape->de_r);
- supported++;
- failed--;
- } while ((drive = ide_scan_devices(ide_tape, idetape_driver.name, NULL, failed++)) != NULL);
- if (!idetape_chrdev_present && !supported) {
- devfs_unregister_chrdev(IDETAPE_MAJOR, "ht");
- } else
- idetape_chrdev_present = 1;
- ide_register_module(&idetape_module);
- MOD_DEC_USE_COUNT;
-#if ONSTREAM_DEBUG
- printk(KERN_INFO "ide-tape: MOD_DEC_USE_COUNT in idetape_init\n");
-#endif
-
+ }
+ tape = (idetape_tape_t *) kmalloc (sizeof (idetape_tape_t), GFP_KERNEL);
+ if (tape == NULL) {
+ printk(KERN_ERR "ide-tape: %s: Can't allocate a tape structure\n", drive->name);
+ goto failed;
+ }
+ if (ide_register_subdriver (drive, &idetape_driver, IDE_SUBDRIVER_VERSION)) {
+ printk(KERN_ERR "ide-tape: %s: Failed to register the driver with ide.c\n", drive->name);
+ kfree(tape);
+ goto failed;
+ }
+ for (minor = 0; idetape_chrdevs[minor].drive != NULL; minor++)
+ ;
+ idetape_setup(drive, tape, minor);
+ idetape_chrdevs[minor].drive = drive;
+ tape->de_r =
+ devfs_register (drive->de, "mt", DEVFS_FL_DEFAULT,
+ HWIF(drive)->major, minor,
+ S_IFCHR | S_IRUGO | S_IWUGO,
+ &idetape_fops, NULL);
+ tape->de_n =
+ devfs_register (drive->de, "mtn", DEVFS_FL_DEFAULT,
+ HWIF(drive)->major, minor + 128,
+ S_IFCHR | S_IRUGO | S_IWUGO,
+ &idetape_fops, NULL);
+ devfs_register_tape(tape->de_r);
return 0;
-#else
+failed:
return 1;
-#endif
}
MODULE_DESCRIPTION("ATAPI Streaming TAPE Driver");
@@ -6457,100 +6410,20 @@
static void __exit idetape_exit (void)
{
- ide_drive_t *drive;
- int minor;
-
- for (minor = 0; minor < MAX_HWIFS * MAX_DRIVES; minor++) {
- drive = idetape_chrdevs[minor].drive;
- if (drive != NULL && idetape_cleanup (drive))
- printk(KERN_ERR "ide-tape: %s: cleanup_module() called while still busy\n", drive->name);
- }
- ide_unregister_module(&idetape_module);
+ ide_unregister_driver(&idetape_driver);
+ unregister_chrdev(IDETAPE_MAJOR, "ht");
}
/*
* idetape_init will register the driver for each tape.
*/
-int idetape_init (void)
+static int idetape_init (void)
{
- ide_drive_t *drive;
- idetape_tape_t *tape;
- int minor, failed = 0, supported = 0;
-/* DRIVER(drive)->busy++; */
- MOD_INC_USE_COUNT;
-#if ONSTREAM_DEBUG
- printk(KERN_INFO "ide-tape: MOD_INC_USE_COUNT in idetape_init\n");
-#endif
- if (!idetape_chrdev_present)
- for (minor = 0; minor < MAX_HWIFS * MAX_DRIVES; minor++ )
- idetape_chrdevs[minor].drive = NULL;
-
- if ((drive = ide_scan_devices(ide_tape, idetape_driver.name, NULL, failed++)) == NULL) {
- ide_register_module(&idetape_module);
- MOD_DEC_USE_COUNT;
-#if ONSTREAM_DEBUG
- printk(KERN_INFO "ide-tape: MOD_DEC_USE_COUNT in idetape_init\n");
-#endif
- return 0;
- }
- if (!idetape_chrdev_present &&
- register_chrdev(IDETAPE_MAJOR, "ht", &idetape_fops)) {
+ if (register_chrdev(IDETAPE_MAJOR, "ht", &idetape_fops)) {
printk(KERN_ERR "ide-tape: Failed to register character device interface\n");
- MOD_DEC_USE_COUNT;
-#if ONSTREAM_DEBUG
- printk(KERN_INFO "ide-tape: MOD_DEC_USE_COUNT in idetape_init\n");
-#endif
return -EBUSY;
}
- do {
- if (!idetape_identify_device (drive, drive->id)) {
- printk(KERN_ERR "ide-tape: %s: not supported by this version of ide-tape\n", drive->name);
- continue;
- }
- if (drive->scsi) {
- if (strstr(drive->id->model, "OnStream DI-")) {
- printk("ide-tape: ide-scsi emulation is not supported for %s.\n", drive->id->model);
- } else {
- printk("ide-tape: passing drive %s to ide-scsi emulation.\n", drive->name);
- continue;
- }
- }
- tape = (idetape_tape_t *) kmalloc (sizeof (idetape_tape_t), GFP_KERNEL);
- if (tape == NULL) {
- printk(KERN_ERR "ide-tape: %s: Can't allocate a tape structure\n", drive->name);
- continue;
- }
- if (ide_register_subdriver (drive, &idetape_driver, IDE_SUBDRIVER_VERSION)) {
- printk(KERN_ERR "ide-tape: %s: Failed to register the driver with ide.c\n", drive->name);
- kfree(tape);
- continue;
- }
- for (minor = 0; idetape_chrdevs[minor].drive != NULL; minor++);
- idetape_setup(drive, tape, minor);
- idetape_chrdevs[minor].drive = drive;
- tape->de_r =
- devfs_register (drive->de, "mt", DEVFS_FL_DEFAULT,
- HWIF(drive)->major, minor,
- S_IFCHR | S_IRUGO | S_IWUGO,
- &idetape_fops, NULL);
- tape->de_n =
- devfs_register (drive->de, "mtn", DEVFS_FL_DEFAULT,
- HWIF(drive)->major, minor + 128,
- S_IFCHR | S_IRUGO | S_IWUGO,
- &idetape_fops, NULL);
- devfs_register_tape(tape->de_r);
- supported++;
- failed--;
- } while ((drive = ide_scan_devices(ide_tape, idetape_driver.name, NULL, failed++)) != NULL);
- if (!idetape_chrdev_present && !supported) {
- unregister_chrdev(IDETAPE_MAJOR, "ht");
- } else
- idetape_chrdev_present = 1;
- ide_register_module(&idetape_module);
- MOD_DEC_USE_COUNT;
-#if ONSTREAM_DEBUG
- printk(KERN_INFO "ide-tape: MOD_DEC_USE_COUNT in idetape_init\n");
-#endif
+ ide_register_driver(&idetape_driver);
return 0;
}
diff -Nru a/drivers/ide/ide.c b/drivers/ide/ide.c
--- a/drivers/ide/ide.c Sat Aug 31 15:05:55 2002
+++ b/drivers/ide/ide.c Sat Aug 31 15:05:55 2002
@@ -151,6 +151,7 @@
#include
#include
#include
+#include
#include
#include
@@ -177,7 +178,6 @@
#ifdef CONFIG_BLK_DEV_IDESCSI_24
#define CONFIG_BLK_DEV_IDESCSI
-extern int idescsi_init(void);
#endif
#ifdef CONFIG_BLK_DEV_IDEPCI
@@ -197,7 +197,6 @@
/*
* ide_modules keeps track of the available IDE chipset/probe/driver modules.
*/
-ide_module_t *ide_modules;
ide_module_t *ide_probe;
/*
@@ -277,6 +276,7 @@
drive->name[2] = 'a' + (index * MAX_DRIVES) + unit;
drive->max_failures = IDE_DEFAULT_MAX_FAILURES;
init_waitqueue_head(&drive->wqueue);
+ INIT_LIST_HEAD(&drive->list);
}
}
@@ -443,30 +443,6 @@
}
extern struct block_device_operations ide_fops[];
-/*
- * ide_geninit() is called exactly *once* for each interface.
- */
-void ide_geninit (ide_hwif_t *hwif)
-{
- unsigned int unit;
-
- for (unit = 0; unit < MAX_DRIVES; ++unit) {
- ide_drive_t *drive = &hwif->drives[unit];
- struct gendisk *gd = hwif->gd[unit];
-
- if (!drive->present)
- continue;
- if (drive->media!=ide_disk && drive->media!=ide_floppy
- && drive->media != ide_cdrom)
- continue;
- register_disk(gd,mk_kdev(hwif->major,unit<forced_geom && drive->noprobe) ? 1 :
-#endif /* CONFIG_BLK_DEV_ISAPNP */
- 1<drives;
struct gendisk *g = hwif->gd[unit];
- int minor = (drive->select.b.unit << g->minor_shift);
-
- grok_partitions(mk_kdev(g->major, minor), current_capacity(drive));
+ g->part[0].nr_sects = current_capacity(drive);
}
/*
@@ -1788,53 +1762,14 @@
* usage == 1 (we need an open channel to use an ioctl :-), so this
* is our limit.
*/
-int ide_revalidate_disk (kdev_t i_rdev)
+static int ide_revalidate_disk (kdev_t i_rdev)
{
ide_drive_t *drive;
- ide_hwgroup_t *hwgroup;
- unsigned long flags;
- int res;
-
if ((drive = get_info_ptr(i_rdev)) == NULL)
return -ENODEV;
- hwgroup = HWGROUP(drive);
- spin_lock_irqsave(&ide_lock, flags);
- if (drive->busy || (drive->usage > 1)) {
- spin_unlock_irqrestore(&ide_lock, flags);
- return -EBUSY;
- };
- drive->busy = 1;
- MOD_INC_USE_COUNT;
- spin_unlock_irqrestore(&ide_lock, flags);
-
- res = wipe_partitions(i_rdev);
-
- if (!res && DRIVER(drive)->revalidate)
+ if (DRIVER(drive)->revalidate)
DRIVER(drive)->revalidate(drive);
-
- drive->busy = 0;
- wake_up(&drive->wqueue);
- MOD_DEC_USE_COUNT;
- return res;
-}
-
-static void revalidate_drives (void)
-{
- ide_hwif_t *hwif;
- ide_drive_t *drive;
- int index, unit;
-
- for (index = 0; index < MAX_HWIFS; ++index) {
- hwif = &ide_hwifs[index];
- for (unit = 0; unit < MAX_DRIVES; ++unit) {
- drive = &ide_hwifs[index].drives[unit];
- if (drive->revalidate) {
- drive->revalidate = 0;
- if (!initializing)
- (void) ide_revalidate_disk(mk_kdev(hwif->major, unit<init();
}
- revalidate_drives();
-}
-
-static void ide_driver_module (void)
-{
- int index;
- ide_module_t *module = ide_modules;
-
- for (index = 0; index < MAX_HWIFS; ++index)
- if (ide_hwifs[index].present)
- goto search;
- ide_probe_module();
-search:
- while (module) {
- (void) module->init();
- module = module->next;
- }
- revalidate_drives();
}
static int ide_open (struct inode * inode, struct file * filp)
@@ -1872,8 +1789,6 @@
if ((drive = get_info_ptr(inode->i_rdev)) == NULL)
return -ENXIO;
- if (drive->driver == NULL)
- ide_driver_module();
#ifdef CONFIG_KMOD
if (drive->driver == NULL) {
if (drive->media == ide_disk)
@@ -1916,6 +1831,50 @@
return 0;
}
+static LIST_HEAD(ata_unused);
+static spinlock_t drives_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t drivers_lock = SPIN_LOCK_UNLOCKED;
+static LIST_HEAD(drivers);
+
+/* Iterator */
+static void *m_start(struct seq_file *m, loff_t *pos)
+{
+ struct list_head *p;
+ loff_t l = *pos;
+ spin_lock(&drivers_lock);
+ list_for_each(p, &drivers)
+ if (!l--)
+ return list_entry(p, ide_driver_t, drivers);
+ return NULL;
+}
+static void *m_next(struct seq_file *m, void *v, loff_t *pos)
+{
+ struct list_head *p = ((ide_driver_t *)v)->drivers.next;
+ (*pos)++;
+ return p==&drivers ? NULL : list_entry(p, ide_driver_t, drivers);
+}
+static void m_stop(struct seq_file *m, void *v)
+{
+ spin_unlock(&drivers_lock);
+}
+static int show_driver(struct seq_file *m, void *v)
+{
+ ide_driver_t *driver = v;
+ seq_printf(m, "%s version %s\n", driver->name, driver->version);
+ return 0;
+}
+struct seq_operations ide_drivers_op = {
+ start: m_start,
+ next: m_next,
+ stop: m_stop,
+ show: show_driver
+};
+
+/*
+ * Locking is badly broken here - since way back. That sucker is
+ * root-only, but that's not an excuse... The real question is what
+ * exclusion rules do we want here.
+ */
int ide_replace_subdriver (ide_drive_t *drive, const char *driver)
{
if (!drive->present || drive->busy || drive->usage)
@@ -1923,9 +1882,15 @@
if (drive->driver != NULL && DRIVER(drive)->cleanup(drive))
goto abort;
strncpy(drive->driver_req, driver, 9);
- ide_driver_module();
- drive->driver_req[0] = 0;
- ide_driver_module();
+ if (ata_attach(drive)) {
+ spin_lock(&drives_lock);
+ list_del_init(&drive->list);
+ spin_unlock(&drives_lock);
+ drive->driver_req[0] = 0;
+ ata_attach(drive);
+ } else {
+ drive->driver_req[0] = 0;
+ }
if (DRIVER(drive) && !strcmp(DRIVER(drive)->name, driver))
return 0;
abort:
@@ -2096,8 +2061,6 @@
gd = hwif->gd[0];
if (gd) {
int i;
- for (i = 0; i < MAX_DRIVES; i++)
- del_gendisk(gd + i);
kfree(gd->part);
if (gd->de_arr)
kfree (gd->de_arr);
@@ -2221,7 +2184,6 @@
#ifdef CONFIG_PROC_FS
create_proc_ide_interfaces();
#endif
- ide_driver_module();
}
if (hwifp)
@@ -2509,59 +2471,29 @@
return((int) ((!system_bus_speed) ? ide_system_bus_speed() : system_bus_speed ));
}
-int ide_reinit_drive (ide_drive_t *drive)
+int ata_attach(ide_drive_t *drive)
{
- switch (drive->media) {
-#ifdef CONFIG_BLK_DEV_IDECD
- case ide_cdrom:
- {
- extern int ide_cdrom_reinit(ide_drive_t *drive);
- if (ide_cdrom_reinit(drive))
- return 1;
- break;
- }
-#endif /* CONFIG_BLK_DEV_IDECD */
-#ifdef CONFIG_BLK_DEV_IDEDISK
- case ide_disk:
- {
- extern int idedisk_reinit(ide_drive_t *drive);
- if (idedisk_reinit(drive))
- return 1;
- break;
- }
-#endif /* CONFIG_BLK_DEV_IDEDISK */
-#ifdef CONFIG_BLK_DEV_IDEFLOPPY
- case ide_floppy:
- {
- extern int idefloppy_reinit(ide_drive_t *drive);
- if (idefloppy_reinit(drive))
- return 1;
- break;
- }
-#endif /* CONFIG_BLK_DEV_IDEFLOPPY */
-#ifdef CONFIG_BLK_DEV_IDETAPE
- case ide_tape:
- {
- extern int idetape_reinit(ide_drive_t *drive);
- if (idetape_reinit(drive))
- return 1;
- break;
+ struct list_head *p;
+ spin_lock(&drivers_lock);
+ list_for_each(p, &drivers) {
+ ide_driver_t *driver = list_entry(p, ide_driver_t, drivers);
+ if (!try_inc_mod_count(driver->owner))
+ continue;
+ spin_unlock(&drivers_lock);
+ if (driver->reinit(drive) == 0) {
+ if (driver->owner)
+ __MOD_DEC_USE_COUNT(driver->owner);
+ return 0;
}
-#endif /* CONFIG_BLK_DEV_IDETAPE */
-#ifdef CONFIG_BLK_DEV_IDESCSI
-/*
- * {
- * extern int idescsi_reinit(ide_drive_t *drive);
- * if (idescsi_reinit(drive))
- * return 1;
- * break;
- * }
- */
-#endif /* CONFIG_BLK_DEV_IDESCSI */
- default:
- return 1;
- }
- return 0;
+ spin_lock(&drivers_lock);
+ if (driver->owner)
+ __MOD_DEC_USE_COUNT(driver->owner);
+ }
+ spin_unlock(&drivers_lock);
+ spin_lock(&drives_lock);
+ list_add(&drive->list, &ata_unused);
+ spin_unlock(&drives_lock);
+ return 1;
}
static int ide_ioctl (struct inode *inode, struct file *file,
@@ -2615,10 +2547,6 @@
return 0;
}
- case BLKRRPART: /* Re-read partition tables */
- if (!capable(CAP_SYS_ADMIN)) return -EACCES;
- return ide_revalidate_disk(inode->i_rdev);
-
case HDIO_OBSOLETE_IDENTITY:
case HDIO_GET_IDENTITY:
if (minor(inode->i_rdev) & PARTN_MASK)
@@ -2720,7 +2648,8 @@
* }
* HWIF(drive)->multiproc(drive);
*/
- return ide_revalidate_disk(inode->i_rdev);
+ return file->f_op->ioctl(inode, file,
+ BLKRRPART, 0);
}
return 0;
}
@@ -3382,29 +3311,6 @@
#ifdef CONFIG_PROC_FS
proc_ide_create();
#endif
-
- /*
- * Attempt to match drivers for the available drives
- */
-#ifdef CONFIG_BLK_DEV_IDEDISK
- (void) idedisk_init();
-#endif /* CONFIG_BLK_DEV_IDEDISK */
-#ifdef CONFIG_BLK_DEV_IDECD
- (void) ide_cdrom_init();
-#endif /* CONFIG_BLK_DEV_IDECD */
-#ifdef CONFIG_BLK_DEV_IDETAPE
- (void) idetape_init();
-#endif /* CONFIG_BLK_DEV_IDETAPE */
-#ifdef CONFIG_BLK_DEV_IDEFLOPPY
- (void) idefloppy_init();
-#endif /* CONFIG_BLK_DEV_IDEFLOPPY */
-#ifdef CONFIG_BLK_DEV_IDESCSI
- #ifdef CONFIG_SCSI
- (void) idescsi_init();
- #else
- #warning ide scsi-emulation selected but no SCSI-subsystem in kernel
- #endif
-#endif /* CONFIG_BLK_DEV_IDESCSI */
}
static int default_cleanup (ide_drive_t *drive)
@@ -3492,11 +3398,6 @@
return ide_stopped;
}
-static int default_init (void)
-{
- return 0;
-}
-
static int default_reinit (ide_drive_t *drive)
{
printk(KERN_ERR "%s: does not support hotswap of device class !\n", drive->name);
@@ -3524,30 +3425,9 @@
if (d->pre_reset == NULL) d->pre_reset = default_pre_reset;
if (d->capacity == NULL) d->capacity = default_capacity;
if (d->special == NULL) d->special = default_special;
- if (d->init == NULL) d->init = default_init;
if (d->reinit == NULL) d->reinit = default_reinit;
}
-ide_drive_t *ide_scan_devices (byte media, const char *name, ide_driver_t *driver, int n)
-{
- unsigned int unit, index, i;
-
- for (index = 0, i = 0; index < MAX_HWIFS; ++index) {
- ide_hwif_t *hwif = &ide_hwifs[index];
- if (!hwif->present)
- continue;
- for (unit = 0; unit < MAX_DRIVES; ++unit) {
- ide_drive_t *drive = &hwif->drives[unit];
- char *req = drive->driver_req;
- if (*req && !strstr(name, req))
- continue;
- if (drive->present && drive->media == media && drive->driver == driver && ++i > n)
- return drive;
- }
- }
- return NULL;
-}
-
int ide_register_subdriver (ide_drive_t *drive, ide_driver_t *driver, int version)
{
unsigned long flags;
@@ -3561,21 +3441,15 @@
drive->driver = driver;
setup_driver_defaults(drive);
spin_unlock_irqrestore(&ide_lock, flags);
+ spin_lock(&drives_lock);
+ list_add(&drive->list, &driver->drives);
+ spin_unlock(&drives_lock);
if (drive->autotune != 2) {
- if (driver->supports_dma && HWIF(drive)->dmaproc != NULL) {
- /*
- * Force DMAing for the beginning of the check.
- * Some chipsets appear to do interesting things,
- * if not checked and cleared.
- * PARANOIA!!!
- */
+ if (!driver->supports_dma && HWIF(drive)->dmaproc != NULL)
(void) (HWIF(drive)->dmaproc(ide_dma_off_quietly, drive));
- (void) (HWIF(drive)->dmaproc(ide_dma_check, drive));
- }
drive->dsc_overlap = (drive->next != drive && driver->supports_dsc_overlap);
drive->nice1 = 1;
}
- drive->revalidate = 1;
drive->suspend_reset = 0;
#ifdef CONFIG_PROC_FS
ide_add_proc_entries(drive->proc, generic_subdriver_entries, drive);
@@ -3604,31 +3478,55 @@
auto_remove_settings(drive);
drive->driver = NULL;
spin_unlock_irqrestore(&ide_lock, flags);
+ spin_lock(&drives_lock);
+ list_del_init(&drive->list);
+ spin_unlock(&drives_lock);
return 0;
}
-int ide_register_module (ide_module_t *module)
+int ide_register_driver(ide_driver_t *driver)
{
- ide_module_t *p = ide_modules;
+ struct list_head list;
- while (p) {
- if (p == module)
- return 1;
- p = p->next;
- }
- module->next = ide_modules;
- ide_modules = module;
- revalidate_drives();
+ spin_lock(&drivers_lock);
+ list_add(&driver->drivers, &drivers);
+ spin_unlock(&drivers_lock);
+
+ spin_lock(&drives_lock);
+ INIT_LIST_HEAD(&list);
+ list_splice_init(&ata_unused, &list);
+ spin_unlock(&drives_lock);
+
+ while (!list_empty(&list)) {
+ ide_drive_t *drive = list_entry(list.next, ide_drive_t, list);
+ list_del_init(&drive->list);
+ ata_attach(drive);
+ }
return 0;
}
-void ide_unregister_module (ide_module_t *module)
+void ide_unregister_driver(ide_driver_t *driver)
{
- ide_module_t **p;
+ ide_drive_t *drive;
- for (p = &ide_modules; (*p) && (*p) != module; p = &((*p)->next));
- if (*p)
- *p = (*p)->next;
+ spin_lock(&drivers_lock);
+ list_del(&driver->drivers);
+ spin_unlock(&drivers_lock);
+
+ while(!list_empty(&driver->drives)) {
+ drive = list_entry(driver->drives.next, ide_drive_t, list);
+ if (driver->cleanup(drive)) {
+ printk("%s: cleanup_module() called while still busy\n", drive->name);
+ BUG();
+ }
+ /* We must remove proc entries defined in this module.
+ Otherwise we oops while accessing these entries */
+#ifdef CONFIG_PROC_FS
+ if (drive->proc)
+ ide_remove_proc_entries(drive->proc, driver->proc);
+#endif
+ ata_attach(drive);
+ }
}
struct block_device_operations ide_fops[] = {{
@@ -3641,8 +3539,8 @@
}};
EXPORT_SYMBOL(ide_hwifs);
-EXPORT_SYMBOL(ide_register_module);
-EXPORT_SYMBOL(ide_unregister_module);
+EXPORT_SYMBOL(ide_register_driver);
+EXPORT_SYMBOL(ide_unregister_driver);
EXPORT_SYMBOL(ide_spin_wait_hwgroup);
/*
@@ -3663,7 +3561,6 @@
/*
* Driver module
*/
-EXPORT_SYMBOL(ide_scan_devices);
EXPORT_SYMBOL(ide_register_subdriver);
EXPORT_SYMBOL(ide_unregister_subdriver);
EXPORT_SYMBOL(ide_replace_subdriver);
@@ -3678,7 +3575,6 @@
EXPORT_SYMBOL(ide_end_drive_cmd);
EXPORT_SYMBOL(ide_end_request);
EXPORT_SYMBOL(ide_revalidate_drive);
-EXPORT_SYMBOL(ide_revalidate_disk);
EXPORT_SYMBOL(ide_cmd);
EXPORT_SYMBOL(ide_wait_cmd);
EXPORT_SYMBOL(ide_wait_cmd_task);
@@ -3705,7 +3601,7 @@
EXPORT_SYMBOL(system_bus_clock);
-EXPORT_SYMBOL(ide_reinit_drive);
+EXPORT_SYMBOL(ata_attach);
static int ide_notify_reboot (struct notifier_block *this, unsigned long event, void *x)
{
@@ -3759,8 +3655,6 @@
int __init ide_init (void)
{
static char banner_printed;
- int i;
-
if (!banner_printed) {
printk(KERN_INFO "Uniform Multi-Platform E-IDE driver " REVISION "\n");
ide_devfs_handle = devfs_mk_dir (NULL, "ide", NULL);
@@ -3773,12 +3667,6 @@
initializing = 1;
ide_init_builtin_drivers();
initializing = 0;
-
- for (i = 0; i < MAX_HWIFS; ++i) {
- ide_hwif_t *hwif = &ide_hwifs[i];
- if (hwif->present)
- ide_geninit(hwif);
- }
register_reboot_notifier(&ide_notifier);
return 0;
diff -Nru a/drivers/input/Config.in b/drivers/input/Config.in
--- a/drivers/input/Config.in Sat Aug 31 15:06:00 2002
+++ b/drivers/input/Config.in Sat Aug 31 15:06:00 2002
@@ -9,7 +9,7 @@
comment 'Userland interfaces'
dep_tristate ' Mouse interface' CONFIG_INPUT_MOUSEDEV $CONFIG_INPUT
-dep_mbool ' Provide legacy /dev/psaux device' CONFIG_INPUT_MOUSEDEV_PSAUX $CONFIG_INPUT
+dep_mbool ' Provide legacy /dev/psaux device' CONFIG_INPUT_MOUSEDEV_PSAUX $CONFIG_INPUT_MOUSEDEV
if [ "$CONFIG_INPUT_MOUSEDEV" != "n" ]; then
int ' Horizontal screen resolution' CONFIG_INPUT_MOUSEDEV_SCREEN_X 1024
int ' Vertical screen resolution' CONFIG_INPUT_MOUSEDEV_SCREEN_Y 768
diff -Nru a/drivers/input/input.c b/drivers/input/input.c
--- a/drivers/input/input.c Sat Aug 31 15:06:00 2002
+++ b/drivers/input/input.c Sat Aug 31 15:06:00 2002
@@ -1,29 +1,13 @@
/*
- * $Id: input.c,v 1.48 2001/12/26 21:08:33 jsimmons Exp $
+ * The input core
*
- * Copyright (c) 1999-2001 Vojtech Pavlik
- *
- * The input core
+ * Copyright (c) 1999-2002 Vojtech Pavlik
*/
/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to , or by paper mail:
- * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
*/
#include
@@ -39,7 +23,7 @@
#include