diff -Nru a/CREDITS b/CREDITS
--- a/CREDITS Wed Aug 20 04:45:18 2003
+++ b/CREDITS Sun Aug 31 16:14:38 2003
@@ -1279,14 +1279,13 @@
N: Christoph Hellwig
E: hch@infradead.org
-E: hch@sgi.com
D: all kinds of driver, filesystem & core kernel hacking
D: freevxfs driver
D: sysvfs maintainer
D: chief codingstyle nitpicker
-S: Auweg 38
-S: 85748 Garching
-S: Germany
+S: Ampferstr. 50 / 4
+S: 6020 Innsbruck
+S: Austria
N: Richard Henderson
E: rth@twiddle.net
diff -Nru a/Documentation/DocBook/kernel-locking.tmpl b/Documentation/DocBook/kernel-locking.tmpl
--- a/Documentation/DocBook/kernel-locking.tmpl Thu Dec 5 18:56:55 2002
+++ b/Documentation/DocBook/kernel-locking.tmpl Sun Aug 31 16:14:01 2003
@@ -463,7 +463,7 @@
spin_lock_irqsave()
(include/linux/spinlock.h) is a variant
which saves whether interrupts were on or off in a flags word,
- which is passed to spin_lock_irqrestore(). This
+ which is passed to spin_unlock_irqrestore(). This
means that the same code can be used inside an hard irq handler (where
interrupts are already off) and in softirqs (where the irq
disabling is required).
diff -Nru a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
--- a/Documentation/filesystems/proc.txt Sun Jun 1 14:12:47 2003
+++ b/Documentation/filesystems/proc.txt Sun Aug 31 16:15:48 2003
@@ -25,6 +25,7 @@
1.5 SCSI info
1.6 Parallel port info in /proc/parport
1.7 TTY info in /proc/tty
+ 1.8 Miscellaneous kernel statistics in /proc/stat
2 Modifying System Parameters
2.1 /proc/sys/fs - File system data
@@ -702,6 +703,58 @@
/dev/console /dev/console 5 1 system:console
/dev/tty /dev/tty 5 0 system:/dev/tty
unknown /dev/tty 4 1-63 console
+
+
+1.8 Miscellaneous kernel statistics in /proc/stat
+-------------------------------------------------
+
+Various pieces of information about kernel activity are available in the
+/proc/stat file. All of the numbers reported in this file are aggregates
+since the system first booted. For a quick look, simply cat the file:
+
+ > cat /proc/stat
+ cpu 2255 34 2290 22625563 6290 127 456
+ cpu0 1132 34 1441 11311718 3675 127 438
+ cpu1 1123 0 849 11313845 2614 0 18
+ intr 114930548 113199788 3 0 5 263 0 4 [... lots more numbers ...]
+ ctxt 1990473
+ btime 1062191376
+ processes 2915
+ procs_running 1
+ procs_blocked 0
+
+The very first "cpu" line aggregates the numbers in all of the other "cpuN"
+lines. These numbers identify the amount of time the CPU has spent performing
+different kinds of work. Time units are in USER_HZ (typically hundredths of a
+second). The meanings of the columns are as follows, from left to right:
+
+- user: normal processes executing in user mode
+- nice: niced processes executing in user mode
+- system: processes executing in kernel mode
+- idle: twiddling thumbs
+- iowait: waiting for I/O to complete
+- irq: servicing interrupts
+- softirq: servicing softirqs
+
+The "intr" line gives counts of interrupts serviced since boot time, for each
+of the possible system interrupts. The first column is the total of all
+interrupts serviced; each subsequent column is the total for that particular
+interrupt.
+
+The "ctxt" line gives the total number of context switches across all CPUs.
+
+The "btime" line gives the time at which the system booted, in seconds since
+the Unix epoch.
+
+The "processes" line gives the number of processes and threads created, which
+includes (but is not limited to) those created by calls to the fork() and
+clone() system calls.
+
+The "procs_running" line gives the number of processes currently running on
+CPUs.
+
+The "procs_blocked" line gives the number of processes currently blocked,
+waiting for I/O to complete.
------------------------------------------------------------------------------
diff -Nru a/Documentation/ide.txt b/Documentation/ide.txt
--- a/Documentation/ide.txt Mon May 26 17:48:43 2003
+++ b/Documentation/ide.txt Sun Aug 31 16:13:57 2003
@@ -1,5 +1,5 @@
- Information regarding the Enhanced IDE drive in Linux 2.5
+ Information regarding the Enhanced IDE drive in Linux 2.6
==============================================================================
@@ -242,8 +242,23 @@
and quite likely to cause trouble with
older/odd IDE drives.
+ "hdx=biostimings" : driver will NOT attempt to tune interface speed
+ (DMA/PIO) but always honour BIOS timings.
+
"hdx=slow" : insert a huge pause after each access to the data
port. Should be used only as a last resort.
+
+ "hdx=swapdata" : when the drive is a disk, byte swap all data
+
+ "hdx=bswap" : same as above..........
+
+ "hdx=flash" : allows for more than one ata_flash disk to be
+ registered. In most cases, only one device
+ will be present.
+
+ "hdx=scsi" : the return of the ide-scsi flag, this is useful for
+ allowing ide-floppy, ide-tape, and ide-cdrom|writers
+ to use ide-scsi emulation on a device specific option.
"hdxlun=xx" : set the drive last logical unit
@@ -277,27 +292,41 @@
"idex=noautotune" : driver will NOT attempt to tune interface speed
This is the default for most chipsets,
except the cmd640.
+
+ "idex=biostimings" : driver will NOT attempt to tune interface speed
+ (DMA/PIO) but always honour BIOS timings.
"idex=serialize" : do not overlap operations on idex. Please note
that you will have to specify this option for
both the respecitve primary and secondary channel
to take effect.
+
+ "idex=four" : four drives on idex and ide(x^1) share same ports
"idex=reset" : reset interface after probe
"idex=dma" : automatically configure/use DMA if possible.
-The following are valid ONLY on ide0, which usually corresponds to the first
-ATA interface found on the particular host, and the defaults for the base,ctl
-ports must not be altered.
+ "idex=ata66" : informs the interface that it has an 80c cable
+ for chipsets that are ATA-66 capable, but the
+ ability to bit test for detection is currently
+ unknown.
+
+ "ide=reverse" : formerly called to pci sub-system, but now local.
+
+The following are valid ONLY on ide0 (except dc4030), which usually corresponds
+to the first ATA interface found on the particular host, and the defaults for
+the base,ctl ports must not be altered.
"ide0=dtc2278" : probe/support DTC2278 interface
"ide0=ht6560b" : probe/support HT6560B interface
"ide0=cmd640_vlb" : *REQUIRED* for VLB cards with the CMD640 chip
(not for PCI -- automatically detected)
"ide0=qd65xx" : probe/support qd65xx interface
- "ide0=ali14xx" : probe/support ali14xx chipsets (ALI M1439/M1445)
+ "ide0=ali14xx" : probe/support ali14xx chipsets (ALI M1439/M1443/M1445)
"ide0=umc8672" : probe/support umc8672 chipsets
+ "idex=dc4030" : probe/support Promise DC4030VL interface
+ "ide=doubler" : probe/support IDE doublers on Amiga
There may be more options than shown -- use the source, Luke!
@@ -375,3 +404,6 @@
Wed Apr 17 22:52:44 CEST 2002 edited by Marcin Dalecki, the current
maintainer.
+
+Wed Aug 20 22:31:29 CEST 2003 updated ide boot uptions to current ide.c
+comments at 2.6.0-test4 time. Maciej Soltysiak
diff -Nru a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
--- a/Documentation/kernel-parameters.txt Mon Aug 18 22:27:07 2003
+++ b/Documentation/kernel-parameters.txt Sun Aug 31 16:14:50 2003
@@ -215,7 +215,10 @@
when calculating gettimeofday(). If specicified timesource
is not avalible, it defaults to PIT.
Format: { pit | tsc | cyclone | ... }
-
+
+ hpet= [IA-32,HPET] option to disable HPET and use PIT.
+ Format: disable
+
cm206= [HW,CD]
Format: { auto | [,][] }
diff -Nru a/Documentation/kobject.txt b/Documentation/kobject.txt
--- a/Documentation/kobject.txt Tue Jun 17 15:59:07 2003
+++ b/Documentation/kobject.txt Sun Aug 31 16:14:13 2003
@@ -245,7 +245,9 @@
see the sysfs documentation for more information.
- default_attrs: Default attributes to be exported via sysfs when the
- object is registered.
+ object is registered.Note that the last attribute has to be
+ initialized to NULL ! You can find a complete implementation
+ in drivers/block/genhd.c
Instances of struct kobj_type are not registered; only referenced by
diff -Nru a/Documentation/sonypi.txt b/Documentation/sonypi.txt
--- a/Documentation/sonypi.txt Tue Mar 11 10:20:18 2003
+++ b/Documentation/sonypi.txt Tue Aug 26 09:02:05 2003
@@ -8,7 +8,9 @@
Copyright (C) 2000 Andrew Tridgell
This driver enables access to the Sony Programmable I/O Control Device which
-can be found in many (all ?) Sony Vaio laptops.
+can be found in many Sony Vaio laptops. Some newer Sony laptops (seems to be
+limited to new FX series laptops, at least the FX501 and the FX702) lack a
+sonypi device and are not supported at all by this driver.
It will give access (through a user space utility) to some events those laptops
generate, like:
@@ -96,6 +98,7 @@
SONYPI_THUMBPHRASE_MASK 0x0200
SONYPI_MEYE_MASK 0x0400
SONYPI_MEMORYSTICK_MASK 0x0800
+ SONYPI_BATTERY_MASK 0x1000
useinput: if set (which is the default) jogdial events are
forwarded to the input subsystem as mouse wheel
diff -Nru a/Documentation/sysctl/README b/Documentation/sysctl/README
--- a/Documentation/sysctl/README Tue Feb 5 09:40:37 2002
+++ b/Documentation/sysctl/README Sun Aug 31 16:14:14 2003
@@ -55,6 +55,7 @@
by piece basis, or just some 'thematic frobbing'.
The subdirs are about:
+abi/ execution domains & personalities
debug/
dev/ device specific information (eg dev/cdrom/info)
fs/ specific filesystems
diff -Nru a/Documentation/sysctl/abi.txt b/Documentation/sysctl/abi.txt
--- /dev/null Wed Dec 31 16:00:00 1969
+++ b/Documentation/sysctl/abi.txt Sun Aug 31 16:14:14 2003
@@ -0,0 +1,54 @@
+Documentation for /proc/sys/abi/* kernel version 2.6.0.test2
+ (c) 2003, Fabian Frederick
+
+For general info : README.
+
+==============================================================
+
+This path is binary emulation relevant aka personality types aka abi.
+When a process is executed, it's linked to an exec_domain whose
+personality is defined using values available from /proc/sys/abi.
+You can find further details about abi in include/linux/personality.h.
+
+Here are the files featuring in 2.6 kernel :
+
+- defhandler_coff
+- defhandler_elf
+- defhandler_lcall7
+- defhandler_libcso
+- fake_utsname
+- trace
+
+===========================================================
+defhandler_coff:
+defined value :
+PER_SCOSVR3
+0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE
+
+===========================================================
+defhandler_elf:
+defined value :
+PER_LINUX
+0
+
+===========================================================
+defhandler_lcall7:
+defined value :
+PER_SVR4
+0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
+
+===========================================================
+defhandler_libsco:
+defined value:
+PER_SVR4
+0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
+
+===========================================================
+fake_utsname:
+Unused
+
+===========================================================
+trace:
+Unused
+
+===========================================================
diff -Nru a/Documentation/video4linux/meye.txt b/Documentation/video4linux/meye.txt
--- a/Documentation/video4linux/meye.txt Tue Feb 18 03:32:29 2003
+++ b/Documentation/video4linux/meye.txt Fri Aug 1 05:47:51 2003
@@ -16,6 +16,23 @@
MJPEG hardware grabbing is supported via a private API (see below).
+Hardware supported:
+-------------------
+
+This driver supports the 'second' version of the MotionEye camera :)
+
+The first version was connected directly on the video bus of the Neomagic
+video card and is unsupported.
+
+The second one, made by Kawasaki Steel is fully supported by this
+driver (PCI vendor/device is 0x136b/0xff01)
+
+The third one, present in recent (more or less last year) Picturebooks
+(C1M* models), is not supported. The manufacturer has given the specs
+to the developers under a NDA (which allows the develoment of a GPL
+driver however), but things are not moving very fast (see
+http://r-engine.sourceforge.net/) (PCI vendor/device is 0x10cf/0x2011).
+
Driver options:
---------------
diff -Nru a/MAINTAINERS b/MAINTAINERS
--- a/MAINTAINERS Thu Aug 21 09:09:26 2003
+++ b/MAINTAINERS Sun Aug 31 16:13:57 2003
@@ -615,8 +615,6 @@
S: Maintained
DRM DRIVERS
-P: Rik Faith
-M: faith@redhat.com
L: dri-devel@lists.sourceforge.net
S: Supported
@@ -1087,6 +1085,14 @@
L: kbuild-devel@lists.sourceforge.net
W: http://kbuild.sourceforge.net
S: Maintained
+
+KERNEL JANITORS
+P: Several
+L: kernel-janitor-discuss@lists.sf.net
+W: http://www.kerneljanitors.org/
+W: http://sf.net/projects/kernel-janitor/
+W: http://developer.osdl.org/rddunlap/kj-patches/
+S: Maintained
KERNEL NFSD
P: Neil Brown
diff -Nru a/Makefile b/Makefile
--- a/Makefile Fri Aug 22 16:38:51 2003
+++ b/Makefile Mon Sep 1 04:36:41 2003
@@ -268,8 +268,19 @@
# Detect when mixed targets is specified, and make a second invocation
# of make so .config is not included in this case either (for *config).
+no-dot-config-targets := clean mrproper distclean \
+ cscope TAGS tags help %docs check%
+
config-targets := 0
mixed-targets := 0
+dot-config := 1
+
+ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),)
+ ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),)
+ dot-config := 0
+ endif
+endif
+
ifneq ($(filter config %config,$(MAKECMDGOALS)),)
config-targets := 1
ifneq ($(filter-out config %config,$(MAKECMDGOALS)),)
@@ -309,7 +320,26 @@
core-y := usr/
SUBDIRS :=
--include .config
+ifeq ($(dot-config),1)
+# In this section, we need .config
+
+# Read in dependencies to all Kconfig* files, make sure to run
+# oldconfig if changes are detected.
+-include .config.cmd
+
+include .config
+
+# If .config needs to be updated, it will be done via the dependency
+# that autoconf has on .config.
+# To avoid any implicit rule to kick in, define an empty command
+.config: ;
+
+# If .config is newer than include/linux/autoconf.h, someone tinkered
+# with it and forgot to run make oldconfig
+include/linux/autoconf.h: scripts/fixdep .config
+ $(Q)$(MAKE) $(build)=scripts/kconfig silentoldconfig
+
+endif
include arch/$(ARCH)/Makefile
@@ -338,15 +368,7 @@
# Here goes the main Makefile
# ---------------------------------------------------------------------------
-#
-# If the user gave a *config target, it'll be handled in another
-# section below, since in this case we cannot include .config
-# Same goes for other targets like clean/mrproper etc, which
-# don't need .config, either
-# In this section, we need .config
-
--include .config.cmd
ifndef CONFIG_FRAME_POINTER
CFLAGS += -fomit-frame-pointer
@@ -521,13 +543,6 @@
@scripts/split-include include/linux/autoconf.h include/config
@touch $@
-# if .config is newer than include/linux/autoconf.h, someone tinkered
-# with it and forgot to run make oldconfig
-
-include/linux/autoconf.h: .config scripts/fixdep
- $(Q)$(MAKE) $(build)=scripts/kconfig scripts/kconfig/conf
- ./scripts/kconfig/conf -s arch/$(ARCH)/Kconfig
-
# Generate some files
# ---------------------------------------------------------------------------
@@ -579,6 +594,11 @@
.PHONY: _modinst_
_modinst_:
+ @if [ -z "`$(DEPMOD) -V | grep module-init-tools`" ]; then \
+ echo "Warning: you may need to install module-init-tools"; \
+ echo "See http://www.codemonkey.org.uk/post-halloween-2.5.txt";\
+ sleep 1; \
+ fi
@rm -rf $(MODLIB)/kernel
@rm -f $(MODLIB)/build
@mkdir -p $(MODLIB)/kernel
diff -Nru a/arch/alpha/Kconfig b/arch/alpha/Kconfig
--- a/arch/alpha/Kconfig Sun Aug 17 01:06:24 2003
+++ b/arch/alpha/Kconfig Sun Aug 31 16:14:22 2003
@@ -597,40 +597,6 @@
source "drivers/pcmcia/Kconfig"
-choice
- prompt "Kernel core (/proc/kcore) format"
- depends on PROC_FS
- default KCORE_ELF
-
-config KCORE_ELF
- bool "ELF"
- ---help---
- If you enabled support for /proc file system then the file
- /proc/kcore will contain the kernel core image. This can be used
- in gdb:
-
- $ cd /usr/src/linux ; gdb vmlinux /proc/kcore
-
- You have two choices here: ELF and A.OUT. Selecting ELF will make
- /proc/kcore appear in ELF core format as defined by the Executable
- and Linking Format specification. Selecting A.OUT will choose the
- old "a.out" format which may be necessary for some old versions
- of binutils or on some architectures.
-
- This is especially useful if you have compiled the kernel with the
- "-g" option to preserve debugging information. It is mainly used
- for examining kernel data structures on the live kernel so if you
- don't understand what this means or are not a kernel hacker, just
- leave it at its default value ELF.
-
-config KCORE_AOUT
- bool "A.OUT"
- help
- Not necessary unless you're using a very out-of-date binutils
- version. You probably want KCORE_ELF.
-
-endchoice
-
config SRM_ENV
tristate "SRM environment through procfs"
depends on PROC_FS
diff -Nru a/arch/alpha/kernel/core_titan.c b/arch/alpha/kernel/core_titan.c
--- a/arch/alpha/kernel/core_titan.c Sun Aug 17 00:57:42 2003
+++ b/arch/alpha/kernel/core_titan.c Sun Aug 31 16:14:08 2003
@@ -717,12 +717,12 @@
struct alpha_agp_ops titan_agp_ops =
{
- setup: titan_agp_setup,
- cleanup: titan_agp_cleanup,
- configure: titan_agp_configure,
- bind: titan_agp_bind_memory,
- unbind: titan_agp_unbind_memory,
- translate: titan_agp_translate
+ .setup = titan_agp_setup,
+ .cleanup = titan_agp_cleanup,
+ .configure = titan_agp_configure,
+ .bind = titan_agp_bind_memory,
+ .unbind = titan_agp_unbind_memory,
+ .translate = titan_agp_translate
};
alpha_agp_info *
diff -Nru a/arch/arm/Kconfig b/arch/arm/Kconfig
--- a/arch/arm/Kconfig Tue Aug 19 11:44:53 2003
+++ b/arch/arm/Kconfig Sun Aug 31 16:14:22 2003
@@ -654,39 +654,6 @@
If you do not feel you need a faster FP emulation you should better
choose NWFPE.
-choice
- prompt "Kernel core (/proc/kcore) format"
- default KCORE_ELF
-
-config KCORE_ELF
- bool "ELF"
- ---help---
- If you enabled support for /proc file system then the file
- /proc/kcore will contain the kernel core image. This can be used
- in gdb:
-
- $ cd /usr/src/linux ; gdb vmlinux /proc/kcore
-
- You have two choices here: ELF and A.OUT. Selecting ELF will make
- /proc/kcore appear in ELF core format as defined by the Executable
- and Linking Format specification. Selecting A.OUT will choose the
- old "a.out" format which may be necessary for some old versions
- of binutils or on some architectures.
-
- This is especially useful if you have compiled the kernel with the
- "-g" option to preserve debugging information. It is mainly used
- for examining kernel data structures on the live kernel so if you
- don't understand what this means or are not a kernel hacker, just
- leave it at its default value ELF.
-
-config KCORE_AOUT
- bool "A.OUT"
- help
- Not necessary unless you're using a very out-of-date binutils
- version. You probably want KCORE_ELF.
-
-endchoice
-
source "fs/Kconfig.binfmt"
source "drivers/base/Kconfig"
diff -Nru a/arch/arm/Makefile b/arch/arm/Makefile
--- a/arch/arm/Makefile Tue Aug 19 11:44:53 2003
+++ b/arch/arm/Makefile Wed Aug 13 16:23:42 2003
@@ -24,6 +24,7 @@
CFLAGS += -mbig-endian
AS += -EB
LD += -EB
+AFLAGS += -mbig-endian
endif
check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
diff -Nru a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
--- a/arch/arm/boot/Makefile Tue Apr 15 08:12:47 2003
+++ b/arch/arm/boot/Makefile Wed Aug 13 16:46:20 2003
@@ -42,11 +42,12 @@
ifeq ($(CONFIG_ARCH_SA1100),y)
zreladdr-$(CONFIG_SA1111) := 0xc0208000
endif
- zreladdr-$(CONFIG_ARCH_PXA) := 0xa0008000
- zreladdr-$(CONFIG_ARCH_ANAKIN) := 0x20008000
- zreladdr-$(CONFIG_ARCH_IQ80310) := 0xa0008000
- zreladdr-$(CONFIG_ARCH_IQ80321) := 0xa0008000
- zreladdr-$(CONFIG_ARCH_ADIFCC) := 0xc0008000
+ zreladdr-$(CONFIG_ARCH_PXA) := 0xa0008000
+ zreladdr-$(CONFIG_ARCH_ANAKIN) := 0x20008000
+ zreladdr-$(CONFIG_ARCH_IOP3XX) := 0xa0008000
+params-phys-$(CONFIG_ARCH_IOP3XX) := 0xa0000100
+ zreladdr-$(CONFIG_ARCH_ADIFCC) := 0xc0008000
+params-phys-$(CONFIG_ARCH_ADIFCC) := 0xc0000100
ZRELADDR := $(zreladdr-y)
ZTEXTADDR := $(ztextaddr-y)
diff -Nru a/arch/arm/common/amba.c b/arch/arm/common/amba.c
--- a/arch/arm/common/amba.c Fri Aug 15 15:22:52 2003
+++ b/arch/arm/common/amba.c Sun Aug 24 07:16:13 2003
@@ -41,13 +41,35 @@
return amba_lookup(pcdrv->id_table, pcdev) != NULL;
}
+static int amba_suspend(struct device *dev, u32 state)
+{
+ struct amba_driver *drv = to_amba_driver(dev->driver);
+ int ret = 0;
+
+ if (dev->driver && drv->suspend)
+ ret = drv->suspend(to_amba_device(dev), state);
+ return ret;
+}
+
+static int amba_resume(struct device *dev)
+{
+ struct amba_driver *drv = to_amba_driver(dev->driver);
+ int ret = 0;
+
+ if (dev->driver && drv->resume)
+ ret = drv->resume(to_amba_device(dev));
+ return ret;
+}
+
/*
* Primecells are part of the Advanced Microcontroller Bus Architecture,
* so we call the bus "amba".
*/
-struct bus_type amba_bustype = {
- .name = "amba",
- .match = amba_match,
+static struct bus_type amba_bustype = {
+ .name = "amba",
+ .match = amba_match,
+ .suspend = amba_suspend,
+ .resume = amba_resume,
};
static int __init amba_init(void)
@@ -84,18 +106,6 @@
drv->shutdown(to_amba_device(dev));
}
-static int amba_suspend(struct device *dev, u32 state, u32 level)
-{
- struct amba_driver *drv = to_amba_driver(dev->driver);
- return drv->suspend(to_amba_device(dev), state, level);
-}
-
-static int amba_resume(struct device *dev, u32 level)
-{
- struct amba_driver *drv = to_amba_driver(dev->driver);
- return drv->resume(to_amba_device(dev), level);
-}
-
/**
* amba_driver_register - register an AMBA device driver
* @drv: amba device driver structure
@@ -112,8 +122,6 @@
SETFN(probe);
SETFN(remove);
SETFN(shutdown);
- SETFN(suspend);
- SETFN(resume);
return driver_register(&drv->drv);
}
diff -Nru a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
--- a/arch/arm/common/sa1111.c Fri Aug 15 15:22:52 2003
+++ b/arch/arm/common/sa1111.c Sun Aug 24 07:45:04 2003
@@ -790,10 +790,13 @@
struct sa1111 *sachip = dev_get_drvdata(dev);
struct sa1111_save_data *save;
unsigned long flags;
+ unsigned int val;
char *base;
- if (!dev->saved_state && level == SUSPEND_NOTIFY)
- dev->saved_state = kmalloc(sizeof(struct sa1111_save_data), GFP_KERNEL);
+ if (level != SUSPEND_DISABLE)
+ return 0;
+
+ dev->saved_state = kmalloc(sizeof(struct sa1111_save_data), GFP_KERNEL);
if (!dev->saved_state)
return -ENOMEM;
@@ -804,36 +807,31 @@
/*
* Save state.
*/
- if (level == SUSPEND_SAVE_STATE) {
- base = sachip->base;
- save->skcr = sa1111_readl(base + SA1111_SKCR);
- save->skpcr = sa1111_readl(base + SA1111_SKPCR);
- save->skcdr = sa1111_readl(base + SA1111_SKCDR);
- save->skaud = sa1111_readl(base + SA1111_SKAUD);
- save->skpwm0 = sa1111_readl(base + SA1111_SKPWM0);
- save->skpwm1 = sa1111_readl(base + SA1111_SKPWM1);
-
- base = sachip->base + SA1111_INTC;
- save->intpol0 = sa1111_readl(base + SA1111_INTPOL0);
- save->intpol1 = sa1111_readl(base + SA1111_INTPOL1);
- save->inten0 = sa1111_readl(base + SA1111_INTEN0);
- save->inten1 = sa1111_readl(base + SA1111_INTEN1);
- save->wakepol0 = sa1111_readl(base + SA1111_WAKEPOL0);
- save->wakepol1 = sa1111_readl(base + SA1111_WAKEPOL1);
- save->wakeen0 = sa1111_readl(base + SA1111_WAKEEN0);
- save->wakeen1 = sa1111_readl(base + SA1111_WAKEEN1);
- }
+ base = sachip->base;
+ save->skcr = sa1111_readl(base + SA1111_SKCR);
+ save->skpcr = sa1111_readl(base + SA1111_SKPCR);
+ save->skcdr = sa1111_readl(base + SA1111_SKCDR);
+ save->skaud = sa1111_readl(base + SA1111_SKAUD);
+ save->skpwm0 = sa1111_readl(base + SA1111_SKPWM0);
+ save->skpwm1 = sa1111_readl(base + SA1111_SKPWM1);
+
+ base = sachip->base + SA1111_INTC;
+ save->intpol0 = sa1111_readl(base + SA1111_INTPOL0);
+ save->intpol1 = sa1111_readl(base + SA1111_INTPOL1);
+ save->inten0 = sa1111_readl(base + SA1111_INTEN0);
+ save->inten1 = sa1111_readl(base + SA1111_INTEN1);
+ save->wakepol0 = sa1111_readl(base + SA1111_WAKEPOL0);
+ save->wakepol1 = sa1111_readl(base + SA1111_WAKEPOL1);
+ save->wakeen0 = sa1111_readl(base + SA1111_WAKEEN0);
+ save->wakeen1 = sa1111_readl(base + SA1111_WAKEEN1);
/*
* Disable.
*/
- if (level == SUSPEND_POWER_DOWN && state == 4) {
- unsigned int val = sa1111_readl(sachip->base + SA1111_SKCR);
-
- sa1111_writel(val | SKCR_SLEEP, sachip->base + SA1111_SKCR);
- sa1111_writel(0, sachip->base + SA1111_SKPWM0);
- sa1111_writel(0, sachip->base + SA1111_SKPWM1);
- }
+ val = sa1111_readl(sachip->base + SA1111_SKCR);
+ sa1111_writel(val | SKCR_SLEEP, sachip->base + SA1111_SKCR);
+ sa1111_writel(0, sachip->base + SA1111_SKPWM0);
+ sa1111_writel(0, sachip->base + SA1111_SKPWM1);
spin_unlock_irqrestore(&sachip->lock, flags);
@@ -857,6 +855,9 @@
unsigned long flags, id;
char *base;
+ if (level != RESUME_ENABLE)
+ return 0;
+
save = (struct sa1111_save_data *)dev->saved_state;
if (!save)
return 0;
@@ -878,39 +879,32 @@
/*
* First of all, wake up the chip.
*/
- if (level == RESUME_POWER_ON) {
- sa1111_wake(sachip);
-
- sa1111_writel(0, sachip->base + SA1111_INTC + SA1111_INTEN0);
- sa1111_writel(0, sachip->base + SA1111_INTC + SA1111_INTEN1);
- }
-
- if (level == RESUME_RESTORE_STATE) {
- base = sachip->base;
- sa1111_writel(save->skcr, base + SA1111_SKCR);
- sa1111_writel(save->skpcr, base + SA1111_SKPCR);
- sa1111_writel(save->skcdr, base + SA1111_SKCDR);
- sa1111_writel(save->skaud, base + SA1111_SKAUD);
- sa1111_writel(save->skpwm0, base + SA1111_SKPWM0);
- sa1111_writel(save->skpwm1, base + SA1111_SKPWM1);
-
- base = sachip->base + SA1111_INTC;
- sa1111_writel(save->intpol0, base + SA1111_INTPOL0);
- sa1111_writel(save->intpol1, base + SA1111_INTPOL1);
- sa1111_writel(save->inten0, base + SA1111_INTEN0);
- sa1111_writel(save->inten1, base + SA1111_INTEN1);
- sa1111_writel(save->wakepol0, base + SA1111_WAKEPOL0);
- sa1111_writel(save->wakepol1, base + SA1111_WAKEPOL1);
- sa1111_writel(save->wakeen0, base + SA1111_WAKEEN0);
- sa1111_writel(save->wakeen1, base + SA1111_WAKEEN1);
- }
+ sa1111_wake(sachip);
+ sa1111_writel(0, sachip->base + SA1111_INTC + SA1111_INTEN0);
+ sa1111_writel(0, sachip->base + SA1111_INTC + SA1111_INTEN1);
+
+ base = sachip->base;
+ sa1111_writel(save->skcr, base + SA1111_SKCR);
+ sa1111_writel(save->skpcr, base + SA1111_SKPCR);
+ sa1111_writel(save->skcdr, base + SA1111_SKCDR);
+ sa1111_writel(save->skaud, base + SA1111_SKAUD);
+ sa1111_writel(save->skpwm0, base + SA1111_SKPWM0);
+ sa1111_writel(save->skpwm1, base + SA1111_SKPWM1);
+
+ base = sachip->base + SA1111_INTC;
+ sa1111_writel(save->intpol0, base + SA1111_INTPOL0);
+ sa1111_writel(save->intpol1, base + SA1111_INTPOL1);
+ sa1111_writel(save->inten0, base + SA1111_INTEN0);
+ sa1111_writel(save->inten1, base + SA1111_INTEN1);
+ sa1111_writel(save->wakepol0, base + SA1111_WAKEPOL0);
+ sa1111_writel(save->wakepol1, base + SA1111_WAKEPOL1);
+ sa1111_writel(save->wakeen0, base + SA1111_WAKEEN0);
+ sa1111_writel(save->wakeen1, base + SA1111_WAKEEN1);
spin_unlock_irqrestore(&sachip->lock, flags);
- if (level == RESUME_ENABLE) {
- dev->saved_state = NULL;
- kfree(save);
- }
+ dev->saved_state = NULL;
+ kfree(save);
return 0;
}
@@ -1135,9 +1129,55 @@
return dev->devid == drv->devid;
}
+static int sa1111_bus_suspend(struct device *dev, u32 state)
+{
+ struct sa1111_dev *sadev = SA1111_DEV(dev);
+ struct sa1111_driver *drv = SA1111_DRV(dev->driver);
+ int ret = 0;
+
+ if (drv && drv->suspend)
+ ret = drv->suspend(sadev, state);
+ return ret;
+}
+
+static int sa1111_bus_resume(struct device *dev)
+{
+ struct sa1111_dev *sadev = SA1111_DEV(dev);
+ struct sa1111_driver *drv = SA1111_DRV(dev->driver);
+ int ret = 0;
+
+ if (drv && drv->resume)
+ ret = drv->resume(sadev);
+ return ret;
+}
+
+static int sa1111_bus_probe(struct device *dev)
+{
+ struct sa1111_dev *sadev = SA1111_DEV(dev);
+ struct sa1111_driver *drv = SA1111_DRV(dev->driver);
+ int ret = -ENODEV;
+
+ if (drv->probe)
+ ret = drv->probe(sadev);
+ return ret;
+}
+
+static int sa1111_bus_remove(struct device *dev)
+{
+ struct sa1111_dev *sadev = SA1111_DEV(dev);
+ struct sa1111_driver *drv = SA1111_DRV(dev->driver);
+ int ret = 0;
+
+ if (drv->remove)
+ ret = drv->remove(sadev);
+ return ret;
+}
+
struct bus_type sa1111_bus_type = {
- .name = "RAB",
- .match = sa1111_match,
+ .name = "sa1111-rab",
+ .match = sa1111_match,
+ .suspend = sa1111_bus_suspend,
+ .resume = sa1111_bus_resume,
};
static int sa1111_rab_bus_init(void)
@@ -1147,6 +1187,19 @@
postcore_initcall(sa1111_rab_bus_init);
+int sa1111_driver_register(struct sa1111_driver *driver)
+{
+ driver->drv.probe = sa1111_bus_probe;
+ driver->drv.remove = sa1111_bus_remove;
+ driver->drv.bus = &sa1111_bus_type;
+ return driver_register(&driver->drv);
+}
+
+void sa1111_driver_unregister(struct sa1111_driver *driver)
+{
+ driver_unregister(&driver->drv);
+}
+
EXPORT_SYMBOL(sa1111_check_dma_bug);
EXPORT_SYMBOL(sa1111_select_audio_mode);
EXPORT_SYMBOL(sa1111_set_audio_rate);
@@ -1155,3 +1208,5 @@
EXPORT_SYMBOL(sa1111_disable_device);
EXPORT_SYMBOL(sa1111_pll_clock);
EXPORT_SYMBOL(sa1111_bus_type);
+EXPORT_SYMBOL(sa1111_driver_register);
+EXPORT_SYMBOL(sa1111_driver_unregister);
diff -Nru a/arch/arm/def-configs/iq80310 b/arch/arm/def-configs/iq80310
--- a/arch/arm/def-configs/iq80310 Tue Apr 15 07:34:41 2003
+++ b/arch/arm/def-configs/iq80310 Wed Aug 13 16:46:20 2003
@@ -19,6 +19,12 @@
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_SYSCTL=y
CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_EMBEDDED is not set
+CONFIG_KALLSYMS=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
#
# Loadable module support
@@ -34,7 +40,6 @@
#
# CONFIG_ARCH_ADIFCC is not set
# CONFIG_ARCH_ANAKIN is not set
-# CONFIG_ARCH_ARCA5K is not set
# CONFIG_ARCH_CLPS7500 is not set
# CONFIG_ARCH_CLPS711X is not set
# CONFIG_ARCH_CO285 is not set
@@ -50,14 +55,6 @@
# CONFIG_ARCH_SHARK is not set
#
-# Archimedes/A5000 Implementations
-#
-
-#
-# Archimedes/A5000 Implementations (select only ONE)
-#
-
-#
# CLPS711X/EP721X Implementations
#
@@ -73,7 +70,9 @@
# IOP3xx Implementation Options
#
CONFIG_ARCH_IQ80310=y
+# CONFIG_ARCH_IQ80321 is not set
CONFIG_ARCH_IOP310=y
+# CONFIG_ARCH_IOP321 is not set
#
# IOP3xx Chipset Features
@@ -84,6 +83,14 @@
# CONFIG_IOP3XX_PMON is not set
#
+# ADIFCC Implementation Options
+#
+
+#
+# ADI Board Types
+#
+
+#
# Intel PXA250/210 Implementations
#
@@ -96,6 +103,7 @@
#
CONFIG_CPU_32=y
CONFIG_CPU_XSCALE=y
+CONFIG_XS80200=y
CONFIG_CPU_32v5=y
#
@@ -116,9 +124,15 @@
# CONFIG_HOTPLUG is not set
#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
# At least one math emulation must be selected
#
CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_NWFPE_XP is not set
# CONFIG_FPE_FASTFPE is not set
CONFIG_KCORE_ELF=y
# CONFIG_KCORE_AOUT is not set
@@ -154,6 +168,7 @@
CONFIG_MTD_BLOCK=y
# CONFIG_FTL is not set
# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
#
# RAM/ROM/Flash chip drivers
@@ -164,6 +179,7 @@
# CONFIG_MTD_CFI_ADV_OPTIONS is not set
CONFIG_MTD_CFI_INTELEXT=y
# CONFIG_MTD_CFI_AMDSTD is not set
+# CONFIG_MTD_CFI_STAA is not set
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set
@@ -172,13 +188,11 @@
#
# Mapping drivers for chip access
#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
# CONFIG_MTD_PHYSMAP is not set
-# CONFIG_MTD_NORA is not set
# CONFIG_MTD_ARM_INTEGRATOR is not set
CONFIG_MTD_IQ80310=y
# CONFIG_MTD_EDB7312 is not set
-# CONFIG_MTD_PCI is not set
-# CONFIG_MTD_UCLINUX is not set
#
# Self-contained MTD device drivers
@@ -191,9 +205,9 @@
#
# Disk-On-Chip Device Drivers
#
-# CONFIG_MTD_DOC1000 is not set
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
#
# NAND Flash Device Drivers
@@ -236,7 +250,6 @@
# CONFIG_NETLINK_DEV is not set
CONFIG_NETFILTER=y
# CONFIG_NETFILTER_DEBUG is not set
-# CONFIG_FILTER is not set
CONFIG_UNIX=y
# CONFIG_NET_KEY is not set
CONFIG_INET=y
@@ -253,7 +266,7 @@
# CONFIG_SYN_COOKIES is not set
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
-# CONFIG_XFRM_USER is not set
+# CONFIG_INET_IPCOMP is not set
#
# IP: Netfilter Configuration
@@ -264,7 +277,13 @@
# CONFIG_IP_NF_ARPTABLES is not set
# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
# CONFIG_IP_NF_COMPAT_IPFWADM is not set
+
+#
+# IP: Virtual Server Configuration
+#
+# CONFIG_IP_VS is not set
# CONFIG_IPV6 is not set
+# CONFIG_XFRM_USER is not set
#
# SCTP Configuration (EXPERIMENTAL)
@@ -310,6 +329,7 @@
#
CONFIG_NET_ETHERNET=y
CONFIG_MII=y
+# CONFIG_SMC91X is not set
# CONFIG_HAPPYMEAL is not set
# CONFIG_SUNGEM is not set
# CONFIG_NET_VENDOR_3COM is not set
@@ -351,6 +371,11 @@
# CONFIG_R8169 is not set
# CONFIG_SK98LIN is not set
# CONFIG_TIGON3 is not set
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_IXGB is not set
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
# CONFIG_PPP is not set
@@ -402,6 +427,7 @@
CONFIG_BLK_DEV_IDECD=y
# CONFIG_BLK_DEV_IDEFLOPPY is not set
# CONFIG_IDE_TASK_IOCTL is not set
+# CONFIG_IDE_TASKFILE_IO is not set
#
# IDE chipset support/bugfixes
@@ -409,7 +435,7 @@
# CONFIG_BLK_DEV_IDEPCI is not set
#
-# SCSI support
+# SCSI device support
#
# CONFIG_SCSI is not set
@@ -481,6 +507,7 @@
#
# I2C Hardware Sensors Chip support
#
+# CONFIG_I2C_SENSOR is not set
#
# L3 serial bus support
@@ -534,6 +561,8 @@
# CONFIG_VIDEO_PMS is not set
# CONFIG_VIDEO_CPIA is not set
# CONFIG_VIDEO_STRADIS is not set
+# CONFIG_VIDEO_HEXIUM_ORION is not set
+# CONFIG_VIDEO_HEXIUM_GEMINI is not set
#
# Radio Adapters
@@ -551,18 +580,29 @@
#
# Supported Frontend Modules
#
-CONFIG_DVB_ALPS_BSRU6=y
+# CONFIG_DVB_STV0299 is not set
# CONFIG_DVB_ALPS_BSRV2 is not set
# CONFIG_DVB_ALPS_TDLB7 is not set
# CONFIG_DVB_ALPS_TDMB7 is not set
+# CONFIG_DVB_ATMEL_AT76C651 is not set
+# CONFIG_DVB_CX24110 is not set
# CONFIG_DVB_GRUNDIG_29504_491 is not set
# CONFIG_DVB_GRUNDIG_29504_401 is not set
+# CONFIG_DVB_MT312 is not set
# CONFIG_DVB_VES1820 is not set
+# CONFIG_DVB_TDA1004X is not set
#
-# Supported DVB Adapters
+# Supported SAA7146 based PCI Adapters
#
# CONFIG_DVB_AV7110 is not set
+# CONFIG_DVB_BUDGET is not set
+
+#
+# Supported FlexCopII (B2C2) Adapters
+#
+# CONFIG_DVB_B2C2_SKYSTAR is not set
+# CONFIG_VIDEO_BTCX is not set
#
# File systems
@@ -598,6 +638,7 @@
CONFIG_PROC_FS=y
# CONFIG_DEVFS_FS is not set
CONFIG_DEVPTS_FS=y
+# CONFIG_DEVPTS_FS_XATTR is not set
CONFIG_TMPFS=y
CONFIG_RAMFS=y
@@ -631,13 +672,13 @@
CONFIG_ROOT_NFS=y
CONFIG_LOCKD=y
# CONFIG_EXPORTFS is not set
+CONFIG_SUNRPC=y
+# CONFIG_SUNRPC_GSS is not set
# CONFIG_SMB_FS is not set
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_INTERMEZZO_FS is not set
-CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_GSS is not set
# CONFIG_AFS_FS is not set
#
@@ -655,6 +696,7 @@
# CONFIG_SOLARIS_X86_PARTITION is not set
# CONFIG_UNIXWARE_DISKLABEL is not set
# CONFIG_LDM_PARTITION is not set
+# CONFIG_NEC98_PARTITION is not set
# CONFIG_SGI_PARTITION is not set
# CONFIG_ULTRIX_PARTITION is not set
# CONFIG_SUN_PARTITION is not set
@@ -666,13 +708,6 @@
# CONFIG_FB is not set
#
-# Console display driver support
-#
-# CONFIG_VGA_CONSOLE is not set
-# CONFIG_MDA_CONSOLE is not set
-CONFIG_DUMMY_CONSOLE=y
-
-#
# Sound
#
# CONFIG_SOUND is not set
@@ -695,6 +730,7 @@
# USB support
#
# CONFIG_USB is not set
+# CONFIG_USB_GADGET is not set
#
# Bluetooth support
@@ -714,7 +750,6 @@
# CONFIG_DEBUG_WAITQ is not set
CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_DEBUG_ERRORS=y
-CONFIG_KALLSYMS=y
CONFIG_DEBUG_LL=y
#
diff -Nru a/arch/arm/def-configs/iq80321 b/arch/arm/def-configs/iq80321
--- a/arch/arm/def-configs/iq80321 Sat Aug 2 12:59:32 2003
+++ b/arch/arm/def-configs/iq80321 Wed Aug 13 16:46:20 2003
@@ -9,7 +9,7 @@
#
# Code maturity level options
#
-# CONFIG_EXPERIMENTAL is not set
+CONFIG_EXPERIMENTAL=y
#
# General setup
@@ -19,6 +19,12 @@
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_SYSCTL=y
CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_EMBEDDED is not set
+CONFIG_KALLSYMS=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
#
# Loadable module support
@@ -26,6 +32,7 @@
CONFIG_MODULES=y
# CONFIG_MODULE_UNLOAD is not set
CONFIG_OBSOLETE_MODPARM=y
+# CONFIG_MODVERSIONS is not set
CONFIG_KMOD=y
#
@@ -33,7 +40,6 @@
#
# CONFIG_ARCH_ADIFCC is not set
# CONFIG_ARCH_ANAKIN is not set
-# CONFIG_ARCH_ARCA5K is not set
# CONFIG_ARCH_CLPS7500 is not set
# CONFIG_ARCH_CLPS711X is not set
# CONFIG_ARCH_CO285 is not set
@@ -49,14 +55,6 @@
# CONFIG_ARCH_SHARK is not set
#
-# Archimedes/A5000 Implementations
-#
-
-#
-# Archimedes/A5000 Implementations (select only ONE)
-#
-
-#
# CLPS711X/EP721X Implementations
#
@@ -79,6 +77,18 @@
#
# IOP3xx Chipset Features
#
+# CONFIG_IOP3XX_AAU is not set
+# CONFIG_IOP3XX_DMA is not set
+# CONFIG_IOP3XX_MU is not set
+# CONFIG_IOP3XX_PMON is not set
+
+#
+# ADIFCC Implementation Options
+#
+
+#
+# ADI Board Types
+#
#
# Intel PXA250/210 Implementations
@@ -98,6 +108,7 @@
#
# Processor Features
#
+# CONFIG_ARM_THUMB is not set
CONFIG_XSCALE_PMU=y
#
@@ -112,17 +123,25 @@
# CONFIG_HOTPLUG is not set
#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
# At least one math emulation must be selected
#
CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_NWFPE_XP is not set
+# CONFIG_FPE_FASTFPE is not set
CONFIG_KCORE_ELF=y
# CONFIG_KCORE_AOUT is not set
CONFIG_BINFMT_AOUT=y
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
# CONFIG_PM is not set
+# CONFIG_PREEMPT is not set
# CONFIG_ARTHUR is not set
-CONFIG_CMDLINE="ip=boot root=nfs console=ttyS0,115200"
+CONFIG_CMDLINE="ip=boot root=nfs console=ttyS0,115200 mem=128M@0xa0000000"
CONFIG_ALIGNMENT_TRAP=y
#
@@ -148,6 +167,7 @@
CONFIG_MTD_BLOCK=y
# CONFIG_FTL is not set
# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
#
# RAM/ROM/Flash chip drivers
@@ -158,6 +178,7 @@
# CONFIG_MTD_CFI_ADV_OPTIONS is not set
CONFIG_MTD_CFI_INTELEXT=y
# CONFIG_MTD_CFI_AMDSTD is not set
+# CONFIG_MTD_CFI_STAA is not set
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set
@@ -166,13 +187,10 @@
#
# Mapping drivers for chip access
#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
# CONFIG_MTD_PHYSMAP is not set
-# CONFIG_MTD_NORA is not set
# CONFIG_MTD_ARM_INTEGRATOR is not set
-CONFIG_MTD_IQ80321=y
# CONFIG_MTD_EDB7312 is not set
-# CONFIG_MTD_PCI is not set
-# CONFIG_MTD_UCLINUX is not set
#
# Self-contained MTD device drivers
@@ -185,9 +203,9 @@
#
# Disk-On-Chip Device Drivers
#
-# CONFIG_MTD_DOC1000 is not set
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
#
# NAND Flash Device Drivers
@@ -206,6 +224,7 @@
# CONFIG_BLK_CPQ_DA is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
# CONFIG_BLK_DEV_LOOP is not set
# CONFIG_BLK_DEV_NBD is not set
CONFIG_BLK_DEV_RAM=y
@@ -229,7 +248,6 @@
# CONFIG_NETLINK_DEV is not set
CONFIG_NETFILTER=y
# CONFIG_NETFILTER_DEBUG is not set
-# CONFIG_FILTER is not set
CONFIG_UNIX=y
# CONFIG_NET_KEY is not set
CONFIG_INET=y
@@ -241,24 +259,47 @@
# CONFIG_IP_PNP_RARP is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
# CONFIG_INET_ECN is not set
# CONFIG_SYN_COOKIES is not set
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
-# CONFIG_XFRM_USER is not set
+# CONFIG_INET_IPCOMP is not set
#
# IP: Netfilter Configuration
#
# CONFIG_IP_NF_CONNTRACK is not set
+# CONFIG_IP_NF_QUEUE is not set
# CONFIG_IP_NF_IPTABLES is not set
# CONFIG_IP_NF_ARPTABLES is not set
# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
# CONFIG_IP_NF_COMPAT_IPFWADM is not set
+
+#
+# IP: Virtual Server Configuration
+#
+# CONFIG_IP_VS is not set
+# CONFIG_IPV6 is not set
+# CONFIG_XFRM_USER is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+CONFIG_IPV6_SCTP__=y
+# CONFIG_IP_SCTP is not set
+# CONFIG_ATM is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_LLC is not set
# CONFIG_DECNET is not set
# CONFIG_BRIDGE is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
#
# QoS and/or fair queueing
@@ -279,12 +320,14 @@
# CONFIG_BONDING is not set
# CONFIG_EQUALIZER is not set
# CONFIG_TUN is not set
+# CONFIG_ETHERTAP is not set
#
# Ethernet (10 or 100Mbit)
#
CONFIG_NET_ETHERNET=y
# CONFIG_MII is not set
+# CONFIG_SMC91X is not set
# CONFIG_HAPPYMEAL is not set
# CONFIG_SUNGEM is not set
# CONFIG_NET_VENDOR_3COM is not set
@@ -298,6 +341,7 @@
# CONFIG_PCNET32 is not set
# CONFIG_AMD8111_ETH is not set
# CONFIG_ADAPTEC_STARFIRE is not set
+# CONFIG_B44 is not set
# CONFIG_DGRS is not set
CONFIG_EEPRO100=y
# CONFIG_EEPRO100_PIO is not set
@@ -305,6 +349,7 @@
# CONFIG_FEALNX is not set
# CONFIG_NATSEMI is not set
# CONFIG_NE2K_PCI is not set
+# CONFIG_8139CP is not set
# CONFIG_8139TOO is not set
# CONFIG_SIS900 is not set
# CONFIG_EPIC100 is not set
@@ -317,13 +362,21 @@
#
# CONFIG_ACENIC is not set
# CONFIG_DL2K is not set
-# CONFIG_E1000 is not set
+CONFIG_E1000=y
+CONFIG_E1000_NAPI=y
# CONFIG_NS83820 is not set
# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
# CONFIG_R8169 is not set
# CONFIG_SK98LIN is not set
# CONFIG_TIGON3 is not set
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_IXGB is not set
# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
# CONFIG_PPP is not set
# CONFIG_SLIP is not set
@@ -335,6 +388,8 @@
#
# Token Ring devices (depends on LLC=y)
#
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
#
# Wan interfaces
@@ -371,6 +426,7 @@
CONFIG_BLK_DEV_IDECD=y
# CONFIG_BLK_DEV_IDEFLOPPY is not set
# CONFIG_IDE_TASK_IOCTL is not set
+# CONFIG_IDE_TASKFILE_IO is not set
#
# IDE chipset support/bugfixes
@@ -379,11 +435,13 @@
# CONFIG_BLK_DEV_GENERIC is not set
# CONFIG_IDEPCI_SHARE_IRQ is not set
CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDE_TCQ is not set
# CONFIG_BLK_DEV_OFFBOARD is not set
# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
CONFIG_IDEDMA_PCI_AUTO=y
# CONFIG_IDEDMA_ONLYDISK is not set
CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_PCI_WIP is not set
CONFIG_BLK_DEV_ADMA=y
# CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_BLK_DEV_ALI15X3 is not set
@@ -391,11 +449,13 @@
CONFIG_BLK_DEV_CMD64X=y
# CONFIG_BLK_DEV_TRIFLEX is not set
# CONFIG_BLK_DEV_CY82C693 is not set
+# CONFIG_BLK_DEV_CS5520 is not set
# CONFIG_BLK_DEV_HPT34X is not set
# CONFIG_BLK_DEV_HPT366 is not set
# CONFIG_BLK_DEV_SC1200 is not set
# CONFIG_BLK_DEV_PIIX is not set
# CONFIG_BLK_DEV_NS87415 is not set
+# CONFIG_BLK_DEV_OPTI621 is not set
# CONFIG_BLK_DEV_PDC202XX_OLD is not set
# CONFIG_BLK_DEV_PDC202XX_NEW is not set
# CONFIG_BLK_DEV_SVWKS is not set
@@ -408,11 +468,16 @@
# CONFIG_IDEDMA_IVB is not set
#
-# SCSI support
+# SCSI device support
#
# CONFIG_SCSI is not set
#
+# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+#
+# CONFIG_IEEE1394 is not set
+
+#
# I2O device support
#
# CONFIG_I2O is not set
@@ -450,11 +515,16 @@
#
# Serial drivers
#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+# CONFIG_SERIAL_8250_EXTENDED is not set
#
# Non-8250 serial port support
#
# CONFIG_SERIAL_DZ is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_UNIX98_PTYS=y
CONFIG_UNIX98_PTY_COUNT=256
@@ -470,6 +540,7 @@
#
# I2C Hardware Sensors Chip support
#
+# CONFIG_I2C_SENSOR is not set
#
# L3 serial bus support
@@ -522,6 +593,9 @@
#
# CONFIG_VIDEO_PMS is not set
# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_STRADIS is not set
+# CONFIG_VIDEO_HEXIUM_ORION is not set
+# CONFIG_VIDEO_HEXIUM_GEMINI is not set
#
# Radio Adapters
@@ -534,6 +608,7 @@
# Digital Video Broadcasting Devices
#
# CONFIG_DVB is not set
+# CONFIG_VIDEO_BTCX is not set
#
# File systems
@@ -567,16 +642,25 @@
# Pseudo filesystems
#
CONFIG_PROC_FS=y
+# CONFIG_DEVFS_FS is not set
CONFIG_DEVPTS_FS=y
+# CONFIG_DEVPTS_FS_XATTR is not set
CONFIG_TMPFS=y
CONFIG_RAMFS=y
#
# Miscellaneous filesystems
#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
# CONFIG_JFFS_FS is not set
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=0
+# CONFIG_JFFS2_FS_NAND is not set
# CONFIG_CRAMFS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_HPFS_FS is not set
@@ -589,15 +673,19 @@
#
CONFIG_NFS_FS=y
# CONFIG_NFS_V3 is not set
+# CONFIG_NFS_V4 is not set
# CONFIG_NFSD is not set
CONFIG_ROOT_NFS=y
CONFIG_LOCKD=y
# CONFIG_EXPORTFS is not set
+CONFIG_SUNRPC=y
+# CONFIG_SUNRPC_GSS is not set
# CONFIG_SMB_FS is not set
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
-CONFIG_SUNRPC=y
+# CONFIG_INTERMEZZO_FS is not set
+# CONFIG_AFS_FS is not set
#
# Partition Types
@@ -614,6 +702,7 @@
# CONFIG_SOLARIS_X86_PARTITION is not set
# CONFIG_UNIXWARE_DISKLABEL is not set
# CONFIG_LDM_PARTITION is not set
+# CONFIG_NEC98_PARTITION is not set
# CONFIG_SGI_PARTITION is not set
# CONFIG_ULTRIX_PARTITION is not set
# CONFIG_SUN_PARTITION is not set
@@ -625,13 +714,6 @@
# CONFIG_FB is not set
#
-# Console display driver support
-#
-# CONFIG_VGA_CONSOLE is not set
-# CONFIG_MDA_CONSOLE is not set
-CONFIG_DUMMY_CONSOLE=y
-
-#
# Sound
#
# CONFIG_SOUND is not set
@@ -654,6 +736,7 @@
# USB support
#
# CONFIG_USB is not set
+# CONFIG_USB_GADGET is not set
#
# Bluetooth support
@@ -664,7 +747,7 @@
# Kernel hacking
#
CONFIG_FRAME_POINTER=y
-CONFIG_DEBUG_USER=y
+# CONFIG_DEBUG_USER is not set
# CONFIG_DEBUG_INFO is not set
CONFIG_DEBUG_KERNEL=y
# CONFIG_DEBUG_SLAB is not set
@@ -673,7 +756,6 @@
# CONFIG_DEBUG_WAITQ is not set
CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_DEBUG_ERRORS=y
-# CONFIG_KALLSYMS is not set
CONFIG_DEBUG_LL=y
#
diff -Nru a/arch/arm/kernel/apm.c b/arch/arm/kernel/apm.c
--- a/arch/arm/kernel/apm.c Wed Mar 26 05:00:46 2003
+++ b/arch/arm/kernel/apm.c Sun Aug 31 16:14:08 2003
@@ -26,6 +26,7 @@
#include
#include
+#include /* apm_power_info */
#include
/*
@@ -93,18 +94,7 @@
static const char driver_version[] = "1.13"; /* no spaces */
-/*
- * This structure gets filled in by the machine specific 'get_power_status'
- * implementation. Any fields which are not set default to a safe value.
- */
-struct apm_power_info {
- unsigned char ac_line_status;
- unsigned char battery_status;
- unsigned char battery_flag;
- unsigned char battery_life;
- int time;
- int units;
-};
+
/*
* Compatibility cruft until the IPAQ people move over to the new
@@ -388,18 +378,18 @@
}
static struct file_operations apm_bios_fops = {
- owner: THIS_MODULE,
- read: apm_read,
- poll: apm_poll,
- ioctl: apm_ioctl,
- open: apm_open,
- release: apm_release,
+ .owner = THIS_MODULE,
+ .read = apm_read,
+ .poll = apm_poll,
+ .ioctl = apm_ioctl,
+ .open = apm_open,
+ .release = apm_release,
};
static struct miscdevice apm_device = {
- minor: APM_MINOR_DEV,
- name: "apm_bios",
- fops: &apm_bios_fops
+ .minor = APM_MINOR_DEV,
+ .name = "apm_bios",
+ .fops = &apm_bios_fops
};
diff -Nru a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
--- a/arch/arm/kernel/bios32.c Thu Jul 31 16:47:19 2003
+++ b/arch/arm/kernel/bios32.c Sun Aug 24 06:12:42 2003
@@ -263,7 +263,7 @@
void __devinit pcibios_update_irq(struct pci_dev *dev, int irq)
{
if (debug_pci)
- printk("PCI: Assigning IRQ %02d to %s\n", irq, dev->dev.name);
+ printk("PCI: Assigning IRQ %02d to %s\n", irq, pci_name(dev));
pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
}
@@ -362,6 +362,19 @@
isa_bridge = dev;
break;
#endif
+ case PCI_CLASS_BRIDGE_PCI:
+ pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &status);
+ status |= PCI_BRIDGE_CTL_PARITY|PCI_BRIDGE_CTL_MASTER_ABORT;
+ status &= ~(PCI_BRIDGE_CTL_BUS_RESET|PCI_BRIDGE_CTL_FAST_BACK);
+ pci_write_config_word(dev, PCI_BRIDGE_CONTROL, status);
+ break;
+
+ case PCI_CLASS_BRIDGE_CARDBUS:
+ pci_read_config_word(dev, PCI_CB_BRIDGE_CONTROL, &status);
+ status |= PCI_CB_BRIDGE_CTL_PARITY|PCI_CB_BRIDGE_CTL_MASTER_ABORT;
+ pci_write_config_word(dev, PCI_CB_BRIDGE_CONTROL, status);
+ break;
+ }
}
/*
diff -Nru a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
--- a/arch/arm/kernel/ecard.c Fri Aug 15 15:22:53 2003
+++ b/arch/arm/kernel/ecard.c Sun Aug 24 05:44:40 2003
@@ -896,7 +896,7 @@
static ssize_t ecard_show_vendor(struct device *dev, char *buf)
{
struct expansion_card *ec = ECARD_DEV(dev);
- return sprintf(buf, "%u\n", ec->manufacturer);
+ return sprintf(buf, "%u\n", ec->cid.manufacturer);
}
static DEVICE_ATTR(vendor, S_IRUGO, ecard_show_vendor, NULL);
@@ -904,7 +904,7 @@
static ssize_t ecard_show_device(struct device *dev, char *buf)
{
struct expansion_card *ec = ECARD_DEV(dev);
- return sprintf(buf, "%u\n", ec->product);
+ return sprintf(buf, "%u\n", ec->cid.product);
}
static DEVICE_ATTR(device, S_IRUGO, ecard_show_device, NULL);
diff -Nru a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S
--- a/arch/arm/kernel/entry-header.S Tue Mar 4 16:47:50 2003
+++ b/arch/arm/kernel/entry-header.S Sun Aug 24 06:17:52 2003
@@ -63,13 +63,7 @@
#define S_OFF 8
.macro set_cpsr_c, reg, mode
-#if 1
- /* broken binutils */
- mov \reg, \mode
- msr cpsr_c, \reg
-#else
msr cpsr_c, \mode
-#endif
.endm
.macro disable_irq, temp
diff -Nru a/arch/arm/kernel/pm.c b/arch/arm/kernel/pm.c
--- a/arch/arm/kernel/pm.c Sat Jun 21 03:42:03 2003
+++ b/arch/arm/kernel/pm.c Sun Aug 24 05:40:01 2003
@@ -36,23 +36,7 @@
if (ret != 0)
goto out;
- /*
- * Tell LDM devices we're going to suspend.
- */
- ret = device_suspend(4, SUSPEND_NOTIFY);
- if (ret != 0)
- goto resume_legacy;
-
- /*
- * Disable, devices, and save state.
- */
- device_suspend(4, SUSPEND_DISABLE);
- device_suspend(4, SUSPEND_SAVE_STATE);
-
- /*
- * Tell devices that they're going to be powered off.
- */
- device_suspend(4, SUSPEND_POWER_DOWN);
+ device_suspend(3);
local_irq_disable();
leds_event(led_stop);
@@ -62,21 +46,8 @@
leds_event(led_start);
local_irq_enable();
- /*
- * Tell devices that they now have power.
- */
- device_resume(RESUME_POWER_ON);
-
- /*
- * Resume LDM devices.
- */
- device_resume(RESUME_RESTORE_STATE);
- device_resume(RESUME_ENABLE);
+ device_resume();
- resume_legacy:
- /*
- * Resume "legacy" devices.
- */
pm_send_all(PM_RESUME, (void *)0);
out:
diff -Nru a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
--- a/arch/arm/kernel/vmlinux.lds.S Mon Aug 4 20:39:42 2003
+++ b/arch/arm/kernel/vmlinux.lds.S Sun Aug 24 04:26:29 2003
@@ -1,21 +1,134 @@
-#include
-
-#ifdef CONFIG_CPU_26
-
-#ifdef CONFIG_ROM_KERNEL
-
-#include "vmlinux-armo-rom.lds.in"
-
+/* ld script to make ARM Linux kernel
+ * taken from the i386 version by Russell King
+ * Written by Martin Mares
+ */
+
+#include
+
+OUTPUT_ARCH(arm)
+ENTRY(stext)
+#ifndef __ARMEB__
+jiffies = jiffies_64;
#else
-
-#include "vmlinux-armo.lds.in"
-
-#endif
-
-#endif
-
-#ifdef CONFIG_CPU_32
-
-#include "vmlinux-armv.lds.in"
-
+jiffies = jiffies_64 + 4;
#endif
+SECTIONS
+{
+ . = TEXTADDR;
+ .init : { /* Init code and data */
+ _stext = .;
+ __init_begin = .;
+ _sinittext = .;
+ *(.init.text)
+ _einittext = .;
+ __proc_info_begin = .;
+ *(.proc.info)
+ __proc_info_end = .;
+ __arch_info_begin = .;
+ *(.arch.info)
+ __arch_info_end = .;
+ __tagtable_begin = .;
+ *(.taglist)
+ __tagtable_end = .;
+ *(.init.data)
+ . = ALIGN(16);
+ __setup_start = .;
+ *(.init.setup)
+ __setup_end = .;
+ __early_begin = .;
+ *(__early_param)
+ __early_end = .;
+ __start___param = .;
+ *(__param)
+ __stop___param = .;
+ __initcall_start = .;
+ *(.initcall1.init)
+ *(.initcall2.init)
+ *(.initcall3.init)
+ *(.initcall4.init)
+ *(.initcall5.init)
+ *(.initcall6.init)
+ *(.initcall7.init)
+ __initcall_end = .;
+ __con_initcall_start = .;
+ *(.con_initcall.init)
+ __con_initcall_end = .;
+ __security_initcall_start = .;
+ *(.security_initcall.init)
+ __security_initcall_end = .;
+ . = ALIGN(32);
+ __initramfs_start = .;
+ usr/built-in.o(.init.ramfs)
+ __initramfs_end = .;
+ . = ALIGN(4096);
+ __init_end = .;
+ }
+
+ /DISCARD/ : { /* Exit code and data */
+ *(.exit.text)
+ *(.exit.data)
+ *(.exitcall.exit)
+ }
+
+ .text : { /* Real text segment */
+ _text = .; /* Text and read-only data */
+ *(.text)
+ *(.fixup)
+ *(.gnu.warning)
+ *(.rodata)
+ *(.rodata.*)
+ *(.glue_7)
+ *(.glue_7t)
+ *(.got) /* Global offset table */
+
+ _etext = .; /* End of text section */
+ }
+
+ . = ALIGN(16);
+ __ex_table : { /* Exception table */
+ __start___ex_table = .;
+ *(__ex_table)
+ __stop___ex_table = .;
+ }
+
+ RODATA
+
+ . = ALIGN(8192);
+
+ .data : {
+ /*
+ * first, the init task union, aligned
+ * to an 8192 byte boundary.
+ */
+ *(.init.task)
+
+ /*
+ * then the cacheline aligned data
+ */
+ . = ALIGN(32);
+ *(.data.cacheline_aligned)
+
+ /*
+ * and the usual data section
+ */
+ *(.data)
+ CONSTRUCTORS
+
+ _edata = .;
+ }
+
+ .bss : {
+ __bss_start = .; /* BSS */
+ *(.bss)
+ *(COMMON)
+ _end = . ;
+ }
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+}
diff -Nru a/arch/arm/mach-footbridge/netwinder-pci.c b/arch/arm/mach-footbridge/netwinder-pci.c
--- a/arch/arm/mach-footbridge/netwinder-pci.c Thu Jul 31 16:47:19 2003
+++ b/arch/arm/mach-footbridge/netwinder-pci.c Sun Aug 24 04:37:15 2003
@@ -36,8 +36,8 @@
return IRQ_NETWINDER_ETHER10;
default:
- printk(KERN_ERR "PCI: unknown device in slot %s: %s\n",
- pci_name(dev), dev->dev.name);
+ printk(KERN_ERR "PCI: unknown device in slot %s\n",
+ pci_name(dev));
return 0;
}
}
diff -Nru a/arch/arm/mach-iop3xx/iop321-time.c b/arch/arm/mach-iop3xx/iop321-time.c
--- a/arch/arm/mach-iop3xx/iop321-time.c Tue Apr 15 08:12:47 2003
+++ b/arch/arm/mach-iop3xx/iop321-time.c Wed Aug 13 16:46:20 2003
@@ -51,7 +51,8 @@
return usec;
}
-static void iop321_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t
+iop321_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
u32 tisr;
@@ -62,6 +63,8 @@
asm volatile("mcr p6, 0, %0, c6, c1, 0" : : "r" (tisr));
do_timer(regs);
+
+ return IRQ_HANDLED;
}
extern unsigned long (*gettimeoffset)(void);
diff -Nru a/arch/arm/mach-iop3xx/iq80310-time.c b/arch/arm/mach-iop3xx/iq80310-time.c
--- a/arch/arm/mach-iop3xx/iq80310-time.c Mon Apr 21 15:43:40 2003
+++ b/arch/arm/mach-iop3xx/iq80310-time.c Wed Aug 13 16:46:20 2003
@@ -88,7 +88,8 @@
}
-static void iq80310_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t
+iq80310_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
volatile u_char *timer_en = (volatile u_char *)IQ80310_TIMER_EN;
@@ -96,21 +97,9 @@
*timer_en &= ~2;
*timer_en |= 2;
- /*
- * AHEM..HACK
- *
- * Since the timer interrupt is cascaded through the CPLD and
- * the 80312 and the demux code calls do_IRQ, the irq count is
- * going to be at least 2 when we get here and this will cause the
- * kernel to increment the system tick counter even if we're
- * idle. This causes it to look like there's always 100% system
- * time, which is not the case. To get around it, we just decrement
- * the IRQ count before calling do_timer. We increment it again
- * b/c otherwise it will go negative and than bad things happen.
- *
- * -DS
- */
do_timer(regs);
+
+ return IRQ_HANDLED;
}
extern unsigned long (*gettimeoffset)(void);
@@ -126,7 +115,9 @@
volatile u_char *timer_en = (volatile u_char *)IQ80310_TIMER_EN;
gettimeoffset = iq80310_gettimeoffset;
+
setup_irq(IRQ_IQ80310_TIMER, &timer_irq);
+
*timer_en = 0;
iq80310_write_timer(LATCH);
*timer_en |= 2;
diff -Nru a/arch/arm/mach-sa1100/leds-simpad.c b/arch/arm/mach-sa1100/leds-simpad.c
--- a/arch/arm/mach-sa1100/leds-simpad.c Mon Feb 4 23:53:46 2002
+++ b/arch/arm/mach-sa1100/leds-simpad.c Thu Aug 7 11:40:46 2003
@@ -9,6 +9,7 @@
#include
#include
#include
+#include
#include "leds.h"
diff -Nru a/arch/arm/mach-sa1100/leds.c b/arch/arm/mach-sa1100/leds.c
--- a/arch/arm/mach-sa1100/leds.c Wed Dec 11 06:27:36 2002
+++ b/arch/arm/mach-sa1100/leds.c Thu Aug 7 11:40:46 2003
@@ -41,6 +41,8 @@
leds_event = adsbitsy_leds_event;
if (machine_is_pt_system3())
leds_event = system3_leds_event;
+ if (machine_is_simpad())
+ leds_event = simpad_leds_event; /* what about machine registry? including led, apm... -zecke */
leds_event(led_start);
return 0;
diff -Nru a/arch/arm/mach-sa1100/leds.h b/arch/arm/mach-sa1100/leds.h
--- a/arch/arm/mach-sa1100/leds.h Wed Dec 11 06:27:36 2002
+++ b/arch/arm/mach-sa1100/leds.h Thu Aug 7 11:40:46 2003
@@ -11,3 +11,4 @@
extern void graphicsmaster_leds_event(led_event_t evt);
extern void adsbitsy_leds_event(led_event_t evt);
extern void system3_leds_event(led_event_t evt);
+extern void simpad_leds_event(led_event_t evt);
diff -Nru a/arch/arm/vmlinux-armo.lds.in b/arch/arm/vmlinux-armo.lds.in
--- a/arch/arm/vmlinux-armo.lds.in Wed Jun 11 17:40:04 2003
+++ /dev/null Wed Dec 31 16:00:00 1969
@@ -1,114 +0,0 @@
-/* ld script to make ARM Linux kernel
- * taken from the i386 version by Russell King
- * Written by Martin Mares
- */
-
-#include
-
-OUTPUT_ARCH(arm)
-ENTRY(stext)
-jiffies = jiffies_64;
-SECTIONS
-{
- . = TEXTADDR;
- .init : { /* Init code and data */
- _stext = .;
- __init_begin = .;
- _sinittext = .;
- *(.init.text)
- _einittext = .;
- __proc_info_begin = .;
- *(.proc.info)
- __proc_info_end = .;
- __arch_info_begin = .;
- *(.arch.info)
- __arch_info_end = .;
- __tagtable_begin = .;
- *(.taglist)
- __tagtable_end = .;
- *(.init.data)
- . = ALIGN(16);
- __setup_start = .;
- *(.init.setup)
- __setup_end = .;
- __initcall_start = .;
- *(.initcall1.init)
- *(.initcall2.init)
- *(.initcall3.init)
- *(.initcall4.init)
- *(.initcall5.init)
- *(.initcall6.init)
- *(.initcall7.init)
- __initcall_end = .;
- __con_initcall_start = .;
- *(.con_initcall.init)
- __con_initcall_end = .;
- SECURITY_INIT
- . = ALIGN(32768);
- __init_end = .;
- }
-
- .init.task : {
- *(.init.task)
- }
-
- /DISCARD/ : { /* Exit code and data */
- *(.exit.text)
- *(.exit.data)
- *(.exitcall.exit)
- }
-
- .text : { /* Real text segment */
- _text = .; /* Text and read-only data */
- *(.text)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata)
- *(.rodata.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got) /* Global offset table */
-
- _etext = .; /* End of text section */
- }
-
- . = ALIGN(16);
- __ex_table : { /* Exception table */
- __start___ex_table = .;
- *(__ex_table)
- __stop___ex_table = .;
- }
-
- RODATA
-
- .data : {
- /*
- * The cacheline aligned data
- */
- . = ALIGN(32);
- *(.data.cacheline_aligned)
-
- /*
- * and the usual data section
- */
- *(.data)
- CONSTRUCTORS
-
- _edata = .;
- }
-
- .bss : {
- __bss_start = .; /* BSS */
- *(.bss)
- *(COMMON)
- _end = . ;
- }
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
-}
diff -Nru a/arch/arm/vmlinux-armv.lds.in b/arch/arm/vmlinux-armv.lds.in
--- a/arch/arm/vmlinux-armv.lds.in Wed Jun 18 16:33:31 2003
+++ /dev/null Wed Dec 31 16:00:00 1969
@@ -1,134 +0,0 @@
-/* ld script to make ARM Linux kernel
- * taken from the i386 version by Russell King
- * Written by Martin Mares
- */
-
-#include
-
-OUTPUT_ARCH(arm)
-ENTRY(stext)
-#ifndef __ARMEB__
-jiffies = jiffies_64;
-#else
-jiffies = jiffies_64 + 4;
-#endif
-SECTIONS
-{
- . = TEXTADDR;
- .init : { /* Init code and data */
- _stext = .;
- __init_begin = .;
- _sinittext = .;
- *(.init.text)
- _einittext = .;
- __proc_info_begin = .;
- *(.proc.info)
- __proc_info_end = .;
- __arch_info_begin = .;
- *(.arch.info)
- __arch_info_end = .;
- __tagtable_begin = .;
- *(.taglist)
- __tagtable_end = .;
- *(.init.data)
- . = ALIGN(16);
- __setup_start = .;
- *(.init.setup)
- __setup_end = .;
- __early_begin = .;
- *(__early_param)
- __early_end = .;
- __start___param = .;
- *(__param)
- __stop___param = .;
- __initcall_start = .;
- *(.initcall1.init)
- *(.initcall2.init)
- *(.initcall3.init)
- *(.initcall4.init)
- *(.initcall5.init)
- *(.initcall6.init)
- *(.initcall7.init)
- __initcall_end = .;
- __con_initcall_start = .;
- *(.con_initcall.init)
- __con_initcall_end = .;
- __security_initcall_start = .;
- *(.security_initcall.init)
- __security_initcall_end = .;
- . = ALIGN(32);
- __initramfs_start = .;
- usr/built-in.o(.init.ramfs)
- __initramfs_end = .;
- . = ALIGN(4096);
- __init_end = .;
- }
-
- /DISCARD/ : { /* Exit code and data */
- *(.exit.text)
- *(.exit.data)
- *(.exitcall.exit)
- }
-
- .text : { /* Real text segment */
- _text = .; /* Text and read-only data */
- *(.text)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata)
- *(.rodata.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got) /* Global offset table */
-
- _etext = .; /* End of text section */
- }
-
- . = ALIGN(16);
- __ex_table : { /* Exception table */
- __start___ex_table = .;
- *(__ex_table)
- __stop___ex_table = .;
- }
-
- RODATA
-
- . = ALIGN(8192);
-
- .data : {
- /*
- * first, the init task union, aligned
- * to an 8192 byte boundary.
- */
- *(.init.task)
-
- /*
- * then the cacheline aligned data
- */
- . = ALIGN(32);
- *(.data.cacheline_aligned)
-
- /*
- * and the usual data section
- */
- *(.data)
- CONSTRUCTORS
-
- _edata = .;
- }
-
- .bss : {
- __bss_start = .; /* BSS */
- *(.bss)
- *(COMMON)
- _end = . ;
- }
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
-}
diff -Nru a/arch/arm26/Kconfig b/arch/arm26/Kconfig
--- a/arch/arm26/Kconfig Sat Aug 2 14:26:16 2003
+++ b/arch/arm26/Kconfig Sun Aug 31 16:14:22 2003
@@ -146,39 +146,6 @@
You may say N here if you are going to load the Acorn FPEmulator
early in the bootup.
-choice
- prompt "Kernel core (/proc/kcore) format"
- default KCORE_ELF
-
-config KCORE_ELF
- bool "ELF"
- ---help---
- If you enabled support for /proc file system then the file
- /proc/kcore will contain the kernel core image. This can be used
- in gdb:
-
- $ cd /usr/src/linux ; gdb vmlinux /proc/kcore
-
- You have two choices here: ELF and A.OUT. Selecting ELF will make
- /proc/kcore appear in ELF core format as defined by the Executable
- and Linking Format specification. Selecting A.OUT will choose the
- old "a.out" format which may be necessary for some old versions
- of binutils or on some architectures.
-
- This is especially useful if you have compiled the kernel with the
- "-g" option to preserve debugging information. It is mainly used
- for examining kernel data structures on the live kernel so if you
- don't understand what this means or are not a kernel hacker, just
- leave it at its default value ELF.
-
-config KCORE_AOUT
- bool "A.OUT"
- help
- Not necessary unless you're using a very out-of-date binutils
- version. You probably want KCORE_ELF.
-
-endchoice
-
source "fs/Kconfig.binfmt"
config PREEMPT
diff -Nru a/arch/arm26/kernel/setup.c b/arch/arm26/kernel/setup.c
--- a/arch/arm26/kernel/setup.c Thu Jul 3 15:03:57 2003
+++ b/arch/arm26/kernel/setup.c Sun Aug 31 16:14:08 2003
@@ -304,12 +304,12 @@
#if defined(CONFIG_DUMMY_CONSOLE)
struct screen_info screen_info = {
- orig_video_lines: 30,
- orig_video_cols: 80,
- orig_video_mode: 0,
- orig_video_ega_bx: 0,
- orig_video_isVGA: 1,
- orig_video_points: 8
+ .orig_video_lines = 30,
+ .orig_video_cols = 80,
+ .orig_video_mode = 0,
+ .orig_video_ega_bx = 0,
+ .orig_video_isVGA = 1,
+ .orig_video_points = 8
};
static int __init parse_tag_videotext(const struct tag *tag)
diff -Nru a/arch/cris/arch-v10/drivers/eeprom.c b/arch/cris/arch-v10/drivers/eeprom.c
--- a/arch/cris/arch-v10/drivers/eeprom.c Fri Jul 4 03:27:37 2003
+++ b/arch/cris/arch-v10/drivers/eeprom.c Tue Aug 26 09:25:41 2003
@@ -441,9 +441,9 @@
static int eeprom_open(struct inode * inode, struct file * file)
{
- if(minor(inode->i_rdev) != EEPROM_MINOR_NR)
+ if(iminor(inode) != EEPROM_MINOR_NR)
return -ENXIO;
- if(major(inode->i_rdev) != EEPROM_MAJOR_NR)
+ if(imajor(inode) != EEPROM_MAJOR_NR)
return -ENXIO;
if( eeprom.size > 0 )
diff -Nru a/arch/cris/arch-v10/drivers/gpio.c b/arch/cris/arch-v10/drivers/gpio.c
--- a/arch/cris/arch-v10/drivers/gpio.c Fri Jul 4 03:27:37 2003
+++ b/arch/cris/arch-v10/drivers/gpio.c Tue Aug 26 09:25:40 2003
@@ -386,7 +386,7 @@
gpio_open(struct inode *inode, struct file *filp)
{
struct gpio_private *priv;
- int p = minor(inode->i_rdev);
+ int p = iminor(inode);
if (p > GPIO_MINOR_LAST)
return -EINVAL;
diff -Nru a/arch/cris/arch-v10/drivers/pcf8563.c b/arch/cris/arch-v10/drivers/pcf8563.c
--- a/arch/cris/arch-v10/drivers/pcf8563.c Wed Jul 23 07:38:45 2003
+++ b/arch/cris/arch-v10/drivers/pcf8563.c Sun Aug 31 16:14:08 2003
@@ -57,10 +57,10 @@
int pcf8563_release(struct inode *, struct file *);
static struct file_operations pcf8563_fops = {
- owner: THIS_MODULE,
- ioctl: pcf8563_ioctl,
- open: pcf8563_open,
- release: pcf8563_release,
+ .owner = THIS_MODULE,
+ .ioctl = pcf8563_ioctl,
+ .open = pcf8563_open,
+ .release = pcf8563_release,
};
unsigned char
diff -Nru a/arch/h8300/Kconfig b/arch/h8300/Kconfig
--- a/arch/h8300/Kconfig Thu Aug 21 08:42:22 2003
+++ b/arch/h8300/Kconfig Sun Aug 31 16:14:22 2003
@@ -177,13 +177,6 @@
menu "Executable file formats"
-config KCORE_AOUT
- bool
- default y
-
-config KCORE_ELF
- default y
-
source "fs/Kconfig.binfmt"
endmenu
diff -Nru a/arch/h8300/kernel/setup.c b/arch/h8300/kernel/setup.c
--- a/arch/h8300/kernel/setup.c Sun Jul 27 20:40:08 2003
+++ b/arch/h8300/kernel/setup.c Sun Aug 31 16:14:08 2003
@@ -91,12 +91,12 @@
}
static const struct console gdb_console = {
- name: "gdb_con",
- write: gdb_console_output,
- device: NULL,
- setup: gdb_console_setup,
- flags: CON_PRINTBUFFER,
- index: -1,
+ .name = "gdb_con",
+ .write = gdb_console_output,
+ .device = NULL,
+ .setup = gdb_console_setup,
+ .flags = CON_PRINTBUFFER,
+ .index = -1,
};
#endif
@@ -260,8 +260,8 @@
}
struct seq_operations cpuinfo_op = {
- start: c_start,
- next: c_next,
- stop: c_stop,
- show: show_cpuinfo,
+ .start = c_start,
+ .next = c_next,
+ .stop = c_stop,
+ .show = show_cpuinfo,
};
diff -Nru a/arch/h8300/platform/h8300h/ints.c b/arch/h8300/platform/h8300h/ints.c
--- a/arch/h8300/platform/h8300h/ints.c Thu Aug 21 08:42:22 2003
+++ b/arch/h8300/platform/h8300h/ints.c Wed Aug 27 08:10:22 2003
@@ -32,15 +32,6 @@
#include
#include
-#define EXT_IRQ0 12
-#define EXT_IRQ1 13
-#define EXT_IRQ2 14
-#define EXT_IRQ3 15
-#define EXT_IRQ4 16
-#define EXT_IRQ5 17
-#define EXT_IRQ6 18
-#define EXT_IRQ7 19
-
/*
* This structure has only 4 elements for speed reasons
*/
@@ -57,17 +48,20 @@
extern unsigned long *interrupt_redirect_table;
+#define CPU_VECTOR ((unsigned long *)0x000000)
+#define ADDR_MASK (0xffffff)
+
static inline unsigned long *get_vector_address(void)
{
- unsigned long *rom_vector = (unsigned long *)0x000000;
+ unsigned long *rom_vector = CPU_VECTOR;
unsigned long base,tmp;
int vec_no;
- base = rom_vector[EXT_IRQ0];
+ base = rom_vector[EXT_IRQ0] & ADDR_MASK;
/* check romvector format */
for (vec_no = EXT_IRQ1; vec_no <= EXT_IRQ5; vec_no++) {
- if ((base+(vec_no - EXT_IRQ0)*4) != rom_vector[vec_no])
+ if ((base+(vec_no - EXT_IRQ0)*4) != (rom_vector[vec_no] & ADDR_MASK))
return NULL;
}
@@ -171,7 +165,7 @@
irq, irq_list[irq]->devname);
if (irq >= EXT_IRQ0 && irq <= EXT_IRQ5)
*(volatile unsigned char *)IER &= ~(1 << (irq - EXT_IRQ0));
- if ((irq_list[irq] & 0x80000000) == 0) {
+ if (((unsigned long)irq_list[irq] & 0x80000000) == 0) {
kfree(irq_list[irq]);
irq_list[irq] = NULL;
}
@@ -241,8 +235,9 @@
{
}
-static void __init enable_kmalloc(void)
+static int __init enable_kmalloc(void)
{
use_kmalloc = 1;
+ return 0;
}
-__initcall(enable_kmalloc);
+core_initcall(enable_kmalloc);
diff -Nru a/arch/h8300/platform/h8s/ints.c b/arch/h8300/platform/h8s/ints.c
--- a/arch/h8300/platform/h8s/ints.c Thu Aug 21 08:42:22 2003
+++ b/arch/h8300/platform/h8s/ints.c Wed Aug 27 08:10:22 2003
@@ -33,23 +33,6 @@
#include
#include
-#define EXT_IRQ0 16
-#define EXT_IRQ1 17
-#define EXT_IRQ2 18
-#define EXT_IRQ3 19
-#define EXT_IRQ4 20
-#define EXT_IRQ5 21
-#define EXT_IRQ6 22
-#define EXT_IRQ7 23
-#define EXT_IRQ8 24
-#define EXT_IRQ9 25
-#define EXT_IRQ10 26
-#define EXT_IRQ11 27
-#define EXT_IRQ12 28
-#define EXT_IRQ13 29
-#define EXT_IRQ14 30
-#define EXT_IRQ15 31
-
/*
* This structure has only 4 elements for speed reasons
*/
@@ -95,17 +78,20 @@
extern unsigned long *interrupt_redirect_table;
+#define CPU_VECTOR ((unsigned long *)0x000000)
+#define ADDR_MASK (0xffffff)
+
static inline unsigned long *get_vector_address(void)
{
- volatile unsigned long *rom_vector = (unsigned long *)0x000000;
+ volatile unsigned long *rom_vector = CPU_VECTOR;
unsigned long base,tmp;
int vec_no;
- base = rom_vector[EXT_IRQ0];
+ base = rom_vector[EXT_IRQ0] & ADDR_MASK;
/* check romvector format */
for (vec_no = EXT_IRQ1; vec_no <= EXT_IRQ15; vec_no++) {
- if ((base+(vec_no - EXT_IRQ0)*4) != rom_vector[vec_no])
+ if ((base+(vec_no - EXT_IRQ0)*4) != (rom_vector[vec_no] & ADDR_MASK))
return NULL;
}
@@ -307,4 +293,4 @@
use_kmalloc = 1;
return 0;
}
-__initcall(enable_kmalloc);
+core_initcall(enable_kmalloc);
diff -Nru a/arch/i386/Kconfig b/arch/i386/Kconfig
--- a/arch/i386/Kconfig Wed Aug 20 12:16:36 2003
+++ b/arch/i386/Kconfig Sun Aug 31 16:15:07 2003
@@ -408,6 +408,17 @@
Otherwise, say N.
+config HPET_TIMER
+ bool "HPET Timer Support"
+ help
+ This enables the use of the HPET for the kernel's internal timer.
+ HPET is the next generation timer replacing legacy 8254s.
+ You can safely choose Y here. However, HPET will only be
+ activated if the platform and the BIOS support this feature.
+ Otherwise the 8254 will be used for timing services.
+
+ Choose N to continue using the legacy 8254 timer.
+
config SMP
bool "Symmetric multi-processing support"
---help---
@@ -1155,40 +1166,6 @@
menu "Executable file formats"
-
-choice
- prompt "Kernel core (/proc/kcore) format"
- depends on PROC_FS
- default KCORE_ELF
-
-config KCORE_ELF
- bool "ELF"
- ---help---
- If you enabled support for /proc file system then the file
- /proc/kcore will contain the kernel core image. This can be used
- in gdb:
-
- $ cd /usr/src/linux ; gdb vmlinux /proc/kcore
-
- You have two choices here: ELF and A.OUT. Selecting ELF will make
- /proc/kcore appear in ELF core format as defined by the Executable
- and Linking Format specification. Selecting A.OUT will choose the
- old "a.out" format which may be necessary for some old versions
- of binutils or on some architectures.
-
- This is especially useful if you have compiled the kernel with the
- "-g" option to preserve debugging information. It is mainly used
- for examining kernel data structures on the live kernel so if you
- don't understand what this means or are not a kernel hacker, just
- leave it at its default value ELF.
-
-config KCORE_AOUT
- bool "A.OUT"
- help
- Not necessary unless you're using a very out-of-date binutils
- version. You probably want KCORE_ELF.
-
-endchoice
source "fs/Kconfig.binfmt"
diff -Nru a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile
--- a/arch/i386/kernel/Makefile Mon Aug 18 11:16:59 2003
+++ b/arch/i386/kernel/Makefile Sun Aug 31 16:14:50 2003
@@ -31,6 +31,7 @@
obj-$(CONFIG_MODULES) += module.o
obj-y += sysenter.o vsyscall.o
obj-$(CONFIG_ACPI_SRAT) += srat.o
+obj-$(CONFIG_HPET_TIMER) += time_hpet.o
EXTRA_AFLAGS := -traditional
diff -Nru a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
--- a/arch/i386/kernel/acpi/boot.c Thu Aug 21 11:08:59 2003
+++ b/arch/i386/kernel/acpi/boot.c Sun Aug 31 16:14:49 2003
@@ -41,6 +41,7 @@
#define PREFIX "ACPI: "
extern int acpi_disabled;
+extern int acpi_irq;
extern int acpi_ht;
int acpi_lapic = 0;
@@ -269,6 +270,27 @@
return 0;
}
+#ifdef CONFIG_HPET_TIMER
+extern unsigned long hpet_address;
+
+static int __init acpi_parse_hpet(unsigned long phys, unsigned long size)
+{
+ struct acpi_table_hpet *hpet_tbl;
+
+ hpet_tbl = __va(phys);
+
+ if (hpet_tbl->addr.space_id != ACPI_SPACE_MEM) {
+ printk(KERN_WARNING PREFIX "HPET timers must be located in "
+ "memory.\n");
+ return -1;
+ }
+
+ hpet_address = hpet_tbl->addr.addrl;
+ printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n", hpet_tbl->id,
+ hpet_address);
+ return 0;
+}
+#endif
unsigned long __init
acpi_find_rsdp (void)
@@ -407,7 +429,7 @@
* If MPS is present, it will handle them,
* otherwise the system will stay in PIC mode
*/
- if (acpi_disabled) {
+ if (acpi_disabled || !acpi_irq) {
return 1;
}
@@ -457,6 +479,9 @@
smp_found_config = 1;
clustered_apic_check();
}
+#endif
+#ifdef CONFIG_HPET_TIMER
+ acpi_table_parse(ACPI_HPET, acpi_parse_hpet);
#endif
return 0;
diff -Nru a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c
--- a/arch/i386/kernel/apic.c Mon Aug 18 22:27:07 2003
+++ b/arch/i386/kernel/apic.c Fri Aug 29 03:51:17 2003
@@ -34,6 +34,7 @@
#include
#include
#include
+#include
#include
@@ -779,7 +780,8 @@
return count;
}
-void __init wait_8254_wraparound(void)
+/* next tick in 8254 can be caught by catching timer wraparound */
+static void __init wait_8254_wraparound(void)
{
unsigned int curr_count, prev_count=~0;
int delta;
@@ -801,6 +803,12 @@
}
/*
+ * Default initialization for 8254 timers. If we use other timers like HPET,
+ * we override this later
+ */
+void (*wait_timer_tick)(void) = wait_8254_wraparound;
+
+/*
* This function sets up the local APIC timer, with a timeout of
* 'clocks' APIC bus clock. During calibration we actually call
* this function twice on the boot CPU, once with a bogus timeout
@@ -841,7 +849,7 @@
/*
* Wait for IRQ0's slice:
*/
- wait_8254_wraparound();
+ wait_timer_tick();
__setup_APIC_LVTT(clocks);
@@ -884,7 +892,7 @@
* (the current tick might have been already half done)
*/
- wait_8254_wraparound();
+ wait_timer_tick();
/*
* We wrapped around just now. Let's start:
@@ -897,7 +905,7 @@
* Let's wait LOOPS wraprounds:
*/
for (i = 0; i < LOOPS; i++)
- wait_8254_wraparound();
+ wait_timer_tick();
tt2 = apic_read(APIC_TMCCT);
if (cpu_has_tsc)
diff -Nru a/arch/i386/kernel/cpu/mtrr/if.c b/arch/i386/kernel/cpu/mtrr/if.c
--- a/arch/i386/kernel/cpu/mtrr/if.c Wed May 14 23:43:54 2003
+++ b/arch/i386/kernel/cpu/mtrr/if.c Sun Aug 31 16:14:43 2003
@@ -17,6 +17,22 @@
#define FILE_FCOUNT(f) (((struct seq_file *)((f)->private_data))->private)
+static char *mtrr_strings[MTRR_NUM_TYPES] =
+{
+ "uncachable", /* 0 */
+ "write-combining", /* 1 */
+ "?", /* 2 */
+ "?", /* 3 */
+ "write-through", /* 4 */
+ "write-protect", /* 5 */
+ "write-back", /* 6 */
+};
+
+char *mtrr_attrib_to_str(int x)
+{
+ return (x <= 6) ? mtrr_strings[x] : "?";
+}
+
static int
mtrr_file_add(unsigned long base, unsigned long size,
unsigned int type, char increment, struct file *file, int page)
@@ -300,11 +316,6 @@
# endif /* CONFIG_PROC_FS */
-char * attrib_to_str(int x)
-{
- return (x <= 6) ? mtrr_strings[x] : "?";
-}
-
static int mtrr_seq_show(struct seq_file *seq, void *offset)
{
char factor;
@@ -332,7 +343,7 @@
len += seq_printf(seq,
"reg%02i: base=0x%05lx000 (%4liMB), size=%4i%cB: %s, count=%d\n",
i, base, base >> (20 - PAGE_SHIFT), size, factor,
- attrib_to_str(type), usage_table[i]);
+ mtrr_attrib_to_str(type), usage_table[i]);
}
}
return 0;
diff -Nru a/arch/i386/kernel/cpu/mtrr/main.c b/arch/i386/kernel/cpu/mtrr/main.c
--- a/arch/i386/kernel/cpu/mtrr/main.c Thu Aug 21 11:48:14 2003
+++ b/arch/i386/kernel/cpu/mtrr/main.c Sun Aug 31 16:14:43 2003
@@ -111,11 +111,6 @@
num_var_ranges = config & 0xff;
}
-static char * attrib_to_str(int x)
-{
- return (x <= 6) ? mtrr_strings[x] : "?";
-}
-
static void init_table(void)
{
int i, max;
@@ -362,8 +357,8 @@
if (type == MTRR_TYPE_UNCACHABLE)
continue;
printk (KERN_WARNING "mtrr: type mismatch for %lx000,%lx000 old: %s new: %s\n",
- base, size, attrib_to_str(ltype),
- attrib_to_str(type));
+ base, size, mtrr_attrib_to_str(ltype),
+ mtrr_attrib_to_str(type));
goto out;
}
if (increment)
@@ -703,16 +698,4 @@
return -ENXIO;
}
-char *mtrr_strings[MTRR_NUM_TYPES] =
-{
- "uncachable", /* 0 */
- "write-combining", /* 1 */
- "?", /* 2 */
- "?", /* 3 */
- "write-through", /* 4 */
- "write-protect", /* 5 */
- "write-back", /* 6 */
-};
-
subsys_initcall(mtrr_init);
-
diff -Nru a/arch/i386/kernel/cpu/mtrr/mtrr.h b/arch/i386/kernel/cpu/mtrr/mtrr.h
--- a/arch/i386/kernel/cpu/mtrr/mtrr.h Wed Nov 27 22:37:22 2002
+++ b/arch/i386/kernel/cpu/mtrr/mtrr.h Sun Aug 31 16:14:43 2003
@@ -95,5 +95,6 @@
void finalize_mtrr_state(void);
void mtrr_state_warn(void);
+char *mtrr_attrib_to_str(int x);
extern char * mtrr_if_name[];
diff -Nru a/arch/i386/kernel/cpuid.c b/arch/i386/kernel/cpuid.c
--- a/arch/i386/kernel/cpuid.c Mon Aug 18 19:46:23 2003
+++ b/arch/i386/kernel/cpuid.c Tue Aug 26 09:25:40 2003
@@ -115,7 +115,7 @@
u32 data[4];
size_t rv;
u32 reg = *ppos;
- int cpu = minor(file->f_dentry->d_inode->i_rdev);
+ int cpu = iminor(file->f_dentry->d_inode);
if ( count % 16 )
return -EINVAL; /* Invalid chunk size */
@@ -133,7 +133,7 @@
static int cpuid_open(struct inode *inode, struct file *file)
{
- int cpu = minor(file->f_dentry->d_inode->i_rdev);
+ int cpu = iminor(file->f_dentry->d_inode);
struct cpuinfo_x86 *c = &(cpu_data)[cpu];
if (!cpu_online(cpu))
diff -Nru a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
--- a/arch/i386/kernel/mpparse.c Tue Aug 19 21:21:36 2003
+++ b/arch/i386/kernel/mpparse.c Sun Aug 31 16:14:25 2003
@@ -850,7 +850,7 @@
return i;
}
- printk(KERN_ERR "ERROR: Unable to locate IOAPIC for IRQ %d/n", irq);
+ printk(KERN_ERR "ERROR: Unable to locate IOAPIC for IRQ %d\n", irq);
return -1;
}
diff -Nru a/arch/i386/kernel/msr.c b/arch/i386/kernel/msr.c
--- a/arch/i386/kernel/msr.c Mon Aug 18 19:46:23 2003
+++ b/arch/i386/kernel/msr.c Tue Aug 26 09:25:40 2003
@@ -194,7 +194,7 @@
u32 data[2];
size_t rv;
u32 reg = *ppos;
- int cpu = minor(file->f_dentry->d_inode->i_rdev);
+ int cpu = iminor(file->f_dentry->d_inode);
int err;
if ( count % 8 )
@@ -219,7 +219,7 @@
u32 data[2];
size_t rv;
u32 reg = *ppos;
- int cpu = minor(file->f_dentry->d_inode->i_rdev);
+ int cpu = iminor(file->f_dentry->d_inode);
int err;
if ( count % 8 )
@@ -239,7 +239,7 @@
static int msr_open(struct inode *inode, struct file *file)
{
- int cpu = minor(file->f_dentry->d_inode->i_rdev);
+ int cpu = iminor(file->f_dentry->d_inode);
struct cpuinfo_x86 *c = &(cpu_data)[cpu];
if (!cpu_online(cpu))
diff -Nru a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
--- a/arch/i386/kernel/setup.c Thu Aug 21 11:08:59 2003
+++ b/arch/i386/kernel/setup.c Sun Aug 31 16:14:11 2003
@@ -71,6 +71,7 @@
EXPORT_SYMBOL(acpi_disabled);
#ifdef CONFIG_ACPI_BOOT
+ int acpi_irq __initdata = 1; /* enable IRQ */
int acpi_ht __initdata = 1; /* enable HT */
#endif
@@ -542,6 +543,11 @@
else if (!memcmp(from, "acpi=ht", 7)) {
acpi_ht = 1;
if (!acpi_force) acpi_disabled = 1;
+ }
+
+ /* "pci=noacpi" disables ACPI interrupt routing */
+ else if (!memcmp(from, "pci=noacpi", 10)) {
+ acpi_irq = 0;
}
#ifdef CONFIG_X86_LOCAL_APIC
diff -Nru a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c
--- a/arch/i386/kernel/time.c Thu Jul 10 22:22:57 2003
+++ b/arch/i386/kernel/time.c Fri Aug 29 03:51:17 2003
@@ -60,6 +60,8 @@
#include
#include
+#include
+
#include
#include "io_ports.h"
@@ -291,8 +293,38 @@
device_initcall(time_init_device);
+#ifdef CONFIG_HPET_TIMER
+extern void (*late_time_init)(void);
+/* Duplicate of time_init() below, with hpet_enable part added */
+void __init hpet_time_init(void)
+{
+ xtime.tv_sec = get_cmos_time();
+ wall_to_monotonic.tv_sec = -xtime.tv_sec;
+ xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
+ wall_to_monotonic.tv_nsec = -xtime.tv_nsec;
+
+ if (hpet_enable() >= 0) {
+ printk("Using HPET for base-timer\n");
+ }
+
+ cur_timer = select_timer();
+ time_init_hook();
+}
+#endif
+
void __init time_init(void)
{
+#ifdef CONFIG_HPET_TIMER
+ if (is_hpet_capable()) {
+ /*
+ * HPET initialization needs to do memory-mapped io. So, let
+ * us do a late initialization after mem_init().
+ */
+ late_time_init = hpet_time_init;
+ return;
+ }
+#endif
+
xtime.tv_sec = get_cmos_time();
wall_to_monotonic.tv_sec = -xtime.tv_sec;
xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
diff -Nru a/arch/i386/kernel/time_hpet.c b/arch/i386/kernel/time_hpet.c
--- /dev/null Wed Dec 31 16:00:00 1969
+++ b/arch/i386/kernel/time_hpet.c Sun Aug 31 16:15:40 2003
@@ -0,0 +1,392 @@
+/*
+ * linux/arch/i386/kernel/time_hpet.c
+ * This code largely copied from arch/x86_64/kernel/time.c
+ * See that file for credits.
+ *
+ * 2003-06-30 Venkatesh Pallipadi - Additional changes for HPET support
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include
+#include
+
+#include
+
+unsigned long hpet_period; /* fsecs / HPET clock */
+unsigned long hpet_tick; /* hpet clks count per tick */
+unsigned long hpet_address; /* hpet memory map physical address */
+
+static int use_hpet; /* can be used for runtime check of hpet */
+static int boot_hpet_disable; /* boottime override for HPET timer */
+static unsigned long hpet_virt_address; /* hpet kernel virtual address */
+
+#define FSEC_TO_USEC (1000000000UL)
+
+int hpet_readl(unsigned long a)
+{
+ return readl(hpet_virt_address + a);
+}
+
+void hpet_writel(unsigned long d, unsigned long a)
+{
+ writel(d, hpet_virt_address + a);
+}
+
+#ifdef CONFIG_X86_LOCAL_APIC
+/*
+ * HPET counters dont wrap around on every tick. They just change the
+ * comparator value and continue. Next tick can be caught by checking
+ * for a change in the comparator value. Used in apic.c.
+ */
+void __init wait_hpet_tick(void)
+{
+ unsigned int start_cmp_val, end_cmp_val;
+
+ start_cmp_val = hpet_readl(HPET_T0_CMP);
+ do {
+ end_cmp_val = hpet_readl(HPET_T0_CMP);
+ } while (start_cmp_val == end_cmp_val);
+}
+#endif
+
+/*
+ * Check whether HPET was found by ACPI boot parse. If yes setup HPET
+ * counter 0 for kernel base timer.
+ */
+int __init hpet_enable(void)
+{
+ unsigned int cfg, id;
+ unsigned long tick_fsec_low, tick_fsec_high; /* tick in femto sec */
+ unsigned long hpet_tick_rem;
+
+ if (boot_hpet_disable)
+ return -1;
+
+ if (!hpet_address) {
+ return -1;
+ }
+ hpet_virt_address = (unsigned long) ioremap_nocache(hpet_address,
+ HPET_MMAP_SIZE);
+ /*
+ * Read the period, compute tick and quotient.
+ */
+ id = hpet_readl(HPET_ID);
+
+ /*
+ * We are checking for value '1' or more in number field.
+ * So, we are OK with HPET_EMULATE_RTC part too, where we need
+ * to have atleast 2 timers.
+ */
+ if (!(id & HPET_ID_NUMBER) ||
+ !(id & HPET_ID_LEGSUP))
+ return -1;
+
+ if (((id & HPET_ID_VENDOR) >> HPET_ID_VENDOR_SHIFT) !=
+ HPET_ID_VENDOR_8086)
+ return -1;
+
+ hpet_period = hpet_readl(HPET_PERIOD);
+ if ((hpet_period < HPET_MIN_PERIOD) || (hpet_period > HPET_MAX_PERIOD))
+ return -1;
+
+ /*
+ * 64 bit math
+ * First changing tick into fsec
+ * Then 64 bit div to find number of hpet clk per tick
+ */
+ ASM_MUL64_REG(tick_fsec_low, tick_fsec_high,
+ KERNEL_TICK_USEC, FSEC_TO_USEC);
+ ASM_DIV64_REG(hpet_tick, hpet_tick_rem,
+ hpet_period, tick_fsec_low, tick_fsec_high);
+
+ if (hpet_tick_rem > (hpet_period >> 1))
+ hpet_tick++; /* rounding the result */
+
+ /*
+ * Stop the timers and reset the main counter.
+ */
+ cfg = hpet_readl(HPET_CFG);
+ cfg &= ~HPET_CFG_ENABLE;
+ hpet_writel(cfg, HPET_CFG);
+ hpet_writel(0, HPET_COUNTER);
+ hpet_writel(0, HPET_COUNTER + 4);
+
+ /*
+ * Set up timer 0, as periodic with first interrupt to happen at
+ * hpet_tick, and period also hpet_tick.
+ */
+ cfg = hpet_readl(HPET_T0_CFG);
+ cfg |= HPET_TN_ENABLE | HPET_TN_PERIODIC |
+ HPET_TN_SETVAL | HPET_TN_32BIT;
+ hpet_writel(cfg, HPET_T0_CFG);
+ hpet_writel(hpet_tick, HPET_T0_CMP);
+
+ /*
+ * Go!
+ */
+ cfg = hpet_readl(HPET_CFG);
+ cfg |= HPET_CFG_ENABLE | HPET_CFG_LEGACY;
+ hpet_writel(cfg, HPET_CFG);
+
+ use_hpet = 1;
+#ifdef CONFIG_X86_LOCAL_APIC
+ wait_timer_tick = wait_hpet_tick;
+#endif
+ return 0;
+}
+
+int is_hpet_enabled(void)
+{
+ return use_hpet;
+}
+
+int is_hpet_capable(void)
+{
+ if (!boot_hpet_disable && hpet_address)
+ return 1;
+ return 0;
+}
+
+static int __init hpet_setup(char* str)
+{
+ if (str) {
+ if (!strncmp("disable", str, 7))
+ boot_hpet_disable = 1;
+ }
+ return 1;
+}
+
+__setup("hpet=", hpet_setup);
+
+#ifdef CONFIG_HPET_EMULATE_RTC
+/* HPET in LegacyReplacement Mode eats up RTC interrupt line. When, HPET
+ * is enabled, we support RTC interrupt functionality in software.
+ * RTC has 3 kinds of interrupts:
+ * 1) Update Interrupt - generate an interrupt, every sec, when RTC clock
+ * is updated
+ * 2) Alarm Interrupt - generate an interrupt at a specific time of day
+ * 3) Periodic Interrupt - generate periodic interrupt, with frequencies
+ * 2Hz-8192Hz (2Hz-64Hz for non-root user) (all freqs in powers of 2)
+ * (1) and (2) above are implemented using polling at a frequency of
+ * 64 Hz. The exact frequency is a tradeoff between accuracy and interrupt
+ * overhead. (DEFAULT_RTC_INT_FREQ)
+ * For (3), we use interrupts at 64Hz or user specified periodic
+ * frequency, whichever is higher.
+ */
+#include
+#include
+
+extern irqreturn_t rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+extern void get_rtc_time(struct rtc_time *rtc_tm);
+
+#define DEFAULT_RTC_INT_FREQ 64
+#define RTC_NUM_INTS 1
+
+static unsigned long UIE_on;
+static unsigned long prev_update_sec;
+
+static unsigned long AIE_on;
+static struct rtc_time alarm_time;
+
+static unsigned long PIE_on;
+static unsigned long PIE_freq = DEFAULT_RTC_INT_FREQ;
+static unsigned long PIE_count;
+
+static unsigned long hpet_rtc_int_freq; /* RTC interrupt frequency */
+
+/*
+ * Timer 1 for RTC, we do not use periodic interrupt feature,
+ * even if HPET supports periodic interrupts on Timer 1.
+ * The reason being, to set up a periodic interrupt in HPET, we need to
+ * stop the main counter. And if we do that everytime someone diables/enables
+ * RTC, we will have adverse effect on main kernel timer running on Timer 0.
+ * So, for the time being, simulate the periodic interrupt in software.
+ *
+ * hpet_rtc_timer_init() is called for the first time and during subsequent
+ * interuppts reinit happens through hpet_rtc_timer_reinit().
+ */
+int hpet_rtc_timer_init(void)
+{
+ unsigned int cfg, cnt;
+ unsigned long flags;
+
+ if (!is_hpet_enabled())
+ return 0;
+ /*
+ * Set the counter 1 and enable the interrupts.
+ */
+ if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ))
+ hpet_rtc_int_freq = PIE_freq;
+ else
+ hpet_rtc_int_freq = DEFAULT_RTC_INT_FREQ;
+
+ local_irq_save(flags);
+ cnt = hpet_readl(HPET_COUNTER);
+ cnt += ((hpet_tick*HZ)/hpet_rtc_int_freq);
+ hpet_writel(cnt, HPET_T1_CMP);
+ local_irq_restore(flags);
+
+ cfg = hpet_readl(HPET_T1_CFG);
+ cfg |= HPET_TN_ENABLE | HPET_TN_SETVAL | HPET_TN_32BIT;
+ hpet_writel(cfg, HPET_T1_CFG);
+
+ return 1;
+}
+
+static void hpet_rtc_timer_reinit(void)
+{
+ unsigned int cfg, cnt;
+
+ if (!(PIE_on | AIE_on | UIE_on))
+ return;
+
+ if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ))
+ hpet_rtc_int_freq = PIE_freq;
+ else
+ hpet_rtc_int_freq = DEFAULT_RTC_INT_FREQ;
+
+ /* It is more accurate to use the comparator value than current count.*/
+ cnt = hpet_readl(HPET_T1_CMP);
+ cnt += hpet_tick*HZ/hpet_rtc_int_freq;
+ hpet_writel(cnt, HPET_T1_CMP);
+
+ cfg = hpet_readl(HPET_T1_CFG);
+ cfg |= HPET_TN_ENABLE | HPET_TN_SETVAL | HPET_TN_32BIT;
+ hpet_writel(cfg, HPET_T1_CFG);
+
+ return;
+}
+
+/*
+ * The functions below are called from rtc driver.
+ * Return 0 if HPET is not being used.
+ * Otherwise do the necessary changes and return 1.
+ */
+int hpet_mask_rtc_irq_bit(unsigned long bit_mask)
+{
+ if (!is_hpet_enabled())
+ return 0;
+
+ if (bit_mask & RTC_UIE)
+ UIE_on = 0;
+ if (bit_mask & RTC_PIE)
+ PIE_on = 0;
+ if (bit_mask & RTC_AIE)
+ AIE_on = 0;
+
+ return 1;
+}
+
+int hpet_set_rtc_irq_bit(unsigned long bit_mask)
+{
+ int timer_init_reqd = 0;
+
+ if (!is_hpet_enabled())
+ return 0;
+
+ if (!(PIE_on | AIE_on | UIE_on))
+ timer_init_reqd = 1;
+
+ if (bit_mask & RTC_UIE) {
+ UIE_on = 1;
+ }
+ if (bit_mask & RTC_PIE) {
+ PIE_on = 1;
+ PIE_count = 0;
+ }
+ if (bit_mask & RTC_AIE) {
+ AIE_on = 1;
+ }
+
+ if (timer_init_reqd)
+ hpet_rtc_timer_init();
+
+ return 1;
+}
+
+int hpet_set_alarm_time(unsigned char hrs, unsigned char min, unsigned char sec)
+{
+ if (!is_hpet_enabled())
+ return 0;
+
+ alarm_time.tm_hour = hrs;
+ alarm_time.tm_min = min;
+ alarm_time.tm_sec = sec;
+
+ return 1;
+}
+
+int hpet_set_periodic_freq(unsigned long freq)
+{
+ if (!is_hpet_enabled())
+ return 0;
+
+ PIE_freq = freq;
+ PIE_count = 0;
+
+ return 1;
+}
+
+int hpet_rtc_dropped_irq(void)
+{
+ if (!is_hpet_enabled())
+ return 0;
+
+ return 1;
+}
+
+irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+ struct rtc_time curr_time;
+ unsigned long rtc_int_flag = 0;
+ int call_rtc_interrupt = 0;
+
+ hpet_rtc_timer_reinit();
+
+ if (UIE_on | AIE_on) {
+ get_rtc_time(&curr_time);
+ }
+ if (UIE_on) {
+ if (curr_time.tm_sec != prev_update_sec) {
+ /* Set update int info, call real rtc int routine */
+ call_rtc_interrupt = 1;
+ rtc_int_flag = RTC_UF;
+ prev_update_sec = curr_time.tm_sec;
+ }
+ }
+ if (PIE_on) {
+ PIE_count++;
+ if (PIE_count >= hpet_rtc_int_freq/PIE_freq) {
+ /* Set periodic int info, call real rtc int routine */
+ call_rtc_interrupt = 1;
+ rtc_int_flag |= RTC_PF;
+ PIE_count = 0;
+ }
+ }
+ if (AIE_on) {
+ if ((curr_time.tm_sec == alarm_time.tm_sec) &&
+ (curr_time.tm_min == alarm_time.tm_min) &&
+ (curr_time.tm_hour == alarm_time.tm_hour)) {
+ /* Set alarm int info, call real rtc int routine */
+ call_rtc_interrupt = 1;
+ rtc_int_flag |= RTC_AF;
+ }
+ }
+ if (call_rtc_interrupt) {
+ rtc_int_flag |= (RTC_IRQF | (RTC_NUM_INTS << 8));
+ rtc_interrupt(rtc_int_flag, dev_id, regs);
+ }
+ return IRQ_HANDLED;
+}
+#endif
+
diff -Nru a/arch/i386/kernel/timers/Makefile b/arch/i386/kernel/timers/Makefile
--- a/arch/i386/kernel/timers/Makefile Sun May 4 23:38:34 2003
+++ b/arch/i386/kernel/timers/Makefile Sun Aug 31 16:14:50 2003
@@ -5,3 +5,4 @@
obj-y := timer.o timer_none.o timer_tsc.o timer_pit.o
obj-$(CONFIG_X86_CYCLONE_TIMER) += timer_cyclone.o
+obj-$(CONFIG_HPET_TIMER) += timer_hpet.o
diff -Nru a/arch/i386/kernel/timers/timer.c b/arch/i386/kernel/timers/timer.c
--- a/arch/i386/kernel/timers/timer.c Wed Jul 2 21:21:34 2003
+++ b/arch/i386/kernel/timers/timer.c Sun Aug 31 16:15:21 2003
@@ -3,10 +3,21 @@
#include
#include
+#ifdef CONFIG_HPET_TIMER
+/*
+ * HPET memory read is slower than tsc reads, but is more dependable as it
+ * always runs at constant frequency and reduces complexity due to
+ * cpufreq. So, we prefer HPET timer to tsc based one. Also, we cannot use
+ * timer_pit when HPET is active. So, we default to timer_tsc.
+ */
+#endif
/* list of timers, ordered by preference, NULL terminated */
static struct timer_opts* timers[] = {
#ifdef CONFIG_X86_CYCLONE_TIMER
&timer_cyclone,
+#endif
+#ifdef CONFIG_HPET_TIMER
+ &timer_hpet,
#endif
&timer_tsc,
&timer_pit,
diff -Nru a/arch/i386/kernel/timers/timer_hpet.c b/arch/i386/kernel/timers/timer_hpet.c
--- /dev/null Wed Dec 31 16:00:00 1969
+++ b/arch/i386/kernel/timers/timer_hpet.c Sun Aug 31 16:15:29 2003
@@ -0,0 +1,241 @@
+/*
+ * This code largely moved from arch/i386/kernel/time.c.
+ * See comments there for proper credits.
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include "io_ports.h"
+#include "mach_timer.h"
+#include
+
+static unsigned long hpet_usec_quotient; /* convert hpet clks to usec */
+static unsigned long tsc_hpet_quotient; /* convert tsc to hpet clks */
+static unsigned long hpet_last; /* hpet counter value at last tick*/
+static unsigned long last_tsc_low; /* lsb 32 bits of Time Stamp Counter */
+static unsigned long last_tsc_high; /* msb 32 bits of Time Stamp Counter */
+static unsigned long long monotonic_base;
+static rwlock_t monotonic_lock = RW_LOCK_UNLOCKED;
+
+/* convert from cycles(64bits) => nanoseconds (64bits)
+ * basic equation:
+ * ns = cycles / (freq / ns_per_sec)
+ * ns = cycles * (ns_per_sec / freq)
+ * ns = cycles * (10^9 / (cpu_mhz * 10^6))
+ * ns = cycles * (10^3 / cpu_mhz)
+ *
+ * Then we use scaling math (suggested by george@mvista.com) to get:
+ * ns = cycles * (10^3 * SC / cpu_mhz) / SC
+ * ns = cycles * cyc2ns_scale / SC
+ *
+ * And since SC is a constant power of two, we can convert the div
+ * into a shift.
+ * -johnstul@us.ibm.com "math is hard, lets go shopping!"
+ */
+static unsigned long cyc2ns_scale;
+#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */
+
+static inline void set_cyc2ns_scale(unsigned long cpu_mhz)
+{
+ cyc2ns_scale = (1000 << CYC2NS_SCALE_FACTOR)/cpu_mhz;
+}
+
+static inline unsigned long long cycles_2_ns(unsigned long long cyc)
+{
+ return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR;
+}
+
+static unsigned long long monotonic_clock_hpet(void)
+{
+ unsigned long long last_offset, this_offset, base;
+
+ /* atomically read monotonic base & last_offset */
+ read_lock_irq(&monotonic_lock);
+ last_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low;
+ base = monotonic_base;
+ read_unlock_irq(&monotonic_lock);
+
+ /* Read the Time Stamp Counter */
+ rdtscll(this_offset);
+
+ /* return the value in ns */
+ return base + cycles_2_ns(this_offset - last_offset);
+}
+
+static unsigned long get_offset_hpet(void)
+{
+ register unsigned long eax, edx;
+
+ eax = hpet_readl(HPET_COUNTER);
+ eax -= hpet_last; /* hpet delta */
+
+ /*
+ * Time offset = (hpet delta) * ( usecs per HPET clock )
+ * = (hpet delta) * ( usecs per tick / HPET clocks per tick)
+ * = (hpet delta) * ( hpet_usec_quotient ) / (2^32)
+ *
+ * Where,
+ * hpet_usec_quotient = (2^32 * usecs per tick)/HPET clocks per tick
+ *
+ * Using a mull instead of a divl saves some cycles in critical path.
+ */
+ ASM_MUL64_REG(eax, edx, hpet_usec_quotient, eax);
+
+ /* our adjusted time offset in microseconds */
+ return edx;
+}
+
+static void mark_offset_hpet(void)
+{
+ unsigned long long this_offset, last_offset;
+ unsigned long offset;
+
+ write_lock(&monotonic_lock);
+ last_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low;
+ rdtsc(last_tsc_low, last_tsc_high);
+
+ offset = hpet_readl(HPET_T0_CMP) - hpet_tick;
+ if (unlikely(((offset - hpet_last) > hpet_tick) && (hpet_last != 0))) {
+ int lost_ticks = (offset - hpet_last) / hpet_tick;
+ jiffies += lost_ticks;
+ }
+ hpet_last = offset;
+
+ /* update the monotonic base value */
+ this_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low;
+ monotonic_base += cycles_2_ns(this_offset - last_offset);
+ write_unlock(&monotonic_lock);
+}
+
+void delay_hpet(unsigned long loops)
+{
+ unsigned long hpet_start, hpet_end;
+ unsigned long eax;
+
+ /* loops is the number of cpu cycles. Convert it to hpet clocks */
+ ASM_MUL64_REG(eax, loops, tsc_hpet_quotient, loops);
+
+ hpet_start = hpet_readl(HPET_COUNTER);
+ do {
+ rep_nop();
+ hpet_end = hpet_readl(HPET_COUNTER);
+ } while ((hpet_end - hpet_start) < (loops));
+}
+
+/* ------ Calibrate the TSC -------
+ * Return 2^32 * (1 / (TSC clocks per usec)) for getting the CPU freq.
+ * Set 2^32 * (1 / (tsc per HPET clk)) for delay_hpet().
+ * calibrate_tsc() calibrates the processor TSC by comparing
+ * it to the HPET timer of known frequency.
+ * Too much 64-bit arithmetic here to do this cleanly in C
+ */
+#define CALIBRATE_CNT_HPET (5 * hpet_tick)
+#define CALIBRATE_TIME_HPET (5 * KERNEL_TICK_USEC)
+
+static unsigned long __init calibrate_tsc(void)
+{
+ unsigned long tsc_startlow, tsc_starthigh;
+ unsigned long tsc_endlow, tsc_endhigh;
+ unsigned long hpet_start, hpet_end;
+ unsigned long result, remain;
+
+ hpet_start = hpet_readl(HPET_COUNTER);
+ rdtsc(tsc_startlow, tsc_starthigh);
+ do {
+ hpet_end = hpet_readl(HPET_COUNTER);
+ } while ((hpet_end - hpet_start) < CALIBRATE_CNT_HPET);
+ rdtsc(tsc_endlow, tsc_endhigh);
+
+ /* 64-bit subtract - gcc just messes up with long longs */
+ __asm__("subl %2,%0\n\t"
+ "sbbl %3,%1"
+ :"=a" (tsc_endlow), "=d" (tsc_endhigh)
+ :"g" (tsc_startlow), "g" (tsc_starthigh),
+ "0" (tsc_endlow), "1" (tsc_endhigh));
+
+ /* Error: ECPUTOOFAST */
+ if (tsc_endhigh)
+ goto bad_calibration;
+
+ /* Error: ECPUTOOSLOW */
+ if (tsc_endlow <= CALIBRATE_TIME_HPET)
+ goto bad_calibration;
+
+ ASM_DIV64_REG(result, remain, tsc_endlow, 0, CALIBRATE_TIME_HPET);
+ if (remain > (tsc_endlow >> 1))
+ result++; /* rounding the result */
+
+ ASM_DIV64_REG(tsc_hpet_quotient, remain, tsc_endlow, 0,
+ CALIBRATE_CNT_HPET);
+ if (remain > (tsc_endlow >> 1))
+ tsc_hpet_quotient++; /* rounding the result */
+
+ return result;
+bad_calibration:
+ /*
+ * the CPU was so fast/slow that the quotient wouldn't fit in
+ * 32 bits..
+ */
+ return 0;
+}
+
+static int __init init_hpet(char* override)
+{
+ unsigned long result, remain;
+
+ /* check clock override */
+ if (override[0] && strncmp(override,"hpet",4))
+ return -ENODEV;
+
+ if (!is_hpet_enabled())
+ return -ENODEV;
+
+ printk("Using HPET for gettimeofday\n");
+ if (cpu_has_tsc) {
+ unsigned long tsc_quotient = calibrate_tsc();
+ if (tsc_quotient) {
+ /* report CPU clock rate in Hz.
+ * The formula is (10^6 * 2^32) / (2^32 * 1 / (clocks/us)) =
+ * clock/second. Our precision is about 100 ppm.
+ */
+ { unsigned long eax=0, edx=1000;
+ ASM_DIV64_REG(cpu_khz, edx, tsc_quotient,
+ eax, edx);
+ printk("Detected %lu.%03lu MHz processor.\n",
+ cpu_khz / 1000, cpu_khz % 1000);
+ }
+ set_cyc2ns_scale(cpu_khz/1000);
+ }
+ }
+
+ /*
+ * Math to calculate hpet to usec multiplier
+ * Look for the comments at get_offset_hpet()
+ */
+ ASM_DIV64_REG(result, remain, hpet_tick, 0, KERNEL_TICK_USEC);
+ if (remain > (hpet_tick >> 1))
+ result++; /* rounding the result */
+ hpet_usec_quotient = result;
+
+ return 0;
+}
+
+/************************************************************/
+
+/* tsc timer_opts struct */
+struct timer_opts timer_hpet = {
+ .init = init_hpet,
+ .mark_offset = mark_offset_hpet,
+ .get_offset = get_offset_hpet,
+ .monotonic_clock = monotonic_clock_hpet,
+ .delay = delay_hpet,
+};
diff -Nru a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
--- a/arch/i386/kernel/timers/timer_tsc.c Mon Aug 18 06:40:02 2003
+++ b/arch/i386/kernel/timers/timer_tsc.c Sun Aug 31 16:15:21 2003
@@ -19,9 +19,18 @@
#include "io_ports.h"
#include "mach_timer.h"
+#include
+
+#ifdef CONFIG_HPET_TIMER
+static unsigned long hpet_usec_quotient;
+static unsigned long hpet_last;
+struct timer_opts timer_tsc;
+#endif
+
int tsc_disable __initdata = 0;
extern spinlock_t i8253_lock;
+extern volatile unsigned long jiffies;
static int use_tsc;
/* Number of usecs that the last interrupt was delayed */
@@ -232,7 +241,7 @@
#define CALIBRATE_TIME (5 * 1000020/HZ)
-unsigned long __init calibrate_tsc(void)
+static unsigned long __init calibrate_tsc(void)
{
mach_prepare_counter();
@@ -282,6 +291,107 @@
return 0;
}
+#ifdef CONFIG_HPET_TIMER
+static void mark_offset_tsc_hpet(void)
+{
+ unsigned long long this_offset, last_offset;
+ unsigned long offset, temp, hpet_current;
+
+ write_lock(&monotonic_lock);
+ last_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low;
+ /*
+ * It is important that these two operations happen almost at
+ * the same time. We do the RDTSC stuff first, since it's
+ * faster. To avoid any inconsistencies, we need interrupts
+ * disabled locally.
+ */
+ /*
+ * Interrupts are just disabled locally since the timer irq
+ * has the SA_INTERRUPT flag set. -arca
+ */
+ /* read Pentium cycle counter */
+
+ hpet_current = hpet_readl(HPET_COUNTER);
+ rdtsc(last_tsc_low, last_tsc_high);
+
+ /* lost tick compensation */
+ offset = hpet_readl(HPET_T0_CMP) - hpet_tick;
+ if (unlikely(((offset - hpet_last) > hpet_tick) && (hpet_last != 0))) {
+ int lost_ticks = (offset - hpet_last) / hpet_tick;
+ jiffies += lost_ticks;
+ }
+ hpet_last = hpet_current;
+
+ /* update the monotonic base value */
+ this_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low;
+ monotonic_base += cycles_2_ns(this_offset - last_offset);
+ write_unlock(&monotonic_lock);
+
+ /* calculate delay_at_last_interrupt */
+ /*
+ * Time offset = (hpet delta) * ( usecs per HPET clock )
+ * = (hpet delta) * ( usecs per tick / HPET clocks per tick)
+ * = (hpet delta) * ( hpet_usec_quotient ) / (2^32)
+ * Where,
+ * hpet_usec_quotient = (2^32 * usecs per tick)/HPET clocks per tick
+ */
+ delay_at_last_interrupt = hpet_current - offset;
+ ASM_MUL64_REG(temp, delay_at_last_interrupt,
+ hpet_usec_quotient, delay_at_last_interrupt);
+}
+
+/* ------ Calibrate the TSC based on HPET timer -------
+ * Return 2^32 * (1 / (TSC clocks per usec)) for do_fast_gettimeoffset().
+ * calibrate_tsc() calibrates the processor TSC by comparing
+ * it to the HPET timer of known frequency.
+ * Too much 64-bit arithmetic here to do this cleanly in C
+ */
+
+#define CALIBRATE_CNT_HPET (5 * hpet_tick)
+#define CALIBRATE_TIME_HPET (5 * KERNEL_TICK_USEC)
+
+unsigned long __init calibrate_tsc_hpet(void)
+{
+ unsigned long tsc_startlow, tsc_starthigh;
+ unsigned long tsc_endlow, tsc_endhigh;
+ unsigned long hpet_start, hpet_end;
+ unsigned long result, remain;
+
+ hpet_start = hpet_readl(HPET_COUNTER);
+ rdtsc(tsc_startlow, tsc_starthigh);
+ do {
+ hpet_end = hpet_readl(HPET_COUNTER);
+ } while ((hpet_end - hpet_start) < CALIBRATE_CNT_HPET);
+ rdtsc(tsc_endlow, tsc_endhigh);
+
+ /* 64-bit subtract - gcc just messes up with long longs */
+ __asm__("subl %2,%0\n\t"
+ "sbbl %3,%1"
+ :"=a" (tsc_endlow), "=d" (tsc_endhigh)
+ :"g" (tsc_startlow), "g" (tsc_starthigh),
+ "0" (tsc_endlow), "1" (tsc_endhigh));
+
+ /* Error: ECPUTOOFAST */
+ if (tsc_endhigh)
+ goto bad_calibration;
+
+ /* Error: ECPUTOOSLOW */
+ if (tsc_endlow <= CALIBRATE_TIME_HPET)
+ goto bad_calibration;
+
+ ASM_DIV64_REG(result, remain, tsc_endlow, 0, CALIBRATE_TIME_HPET);
+ if (remain > (tsc_endlow >> 1))
+ result++; /* rounding the result */
+
+ return result;
+bad_calibration:
+ /*
+ * the CPU was so fast/slow that the quotient wouldn't fit in
+ * 32 bits..
+ */
+ return 0;
+}
+#endif
#ifdef CONFIG_CPU_FREQ
static unsigned int ref_freq = 0;
@@ -333,8 +443,16 @@
{
/* check clock override */
- if (override[0] && strncmp(override,"tsc",3))
+ if (override[0] && strncmp(override,"tsc",3)) {
+#ifdef CONFIG_HPET_TIMER
+ if (is_hpet_enabled()) {
+ printk(KERN_ERR "Warning: clock= override failed. Defaulting to tsc\n");
+ } else
+#endif
+ {
return -ENODEV;
+ }
+ }
/*
* If we have APM enabled or the CPU clock speed is variable
@@ -368,7 +486,29 @@
count2 = LATCH; /* initialize counter for mark_offset_tsc() */
if (cpu_has_tsc) {
- unsigned long tsc_quotient = calibrate_tsc();
+ unsigned long tsc_quotient;
+#ifdef CONFIG_HPET_TIMER
+ if (is_hpet_enabled()){
+ unsigned long result, remain;
+ printk("Using TSC for gettimeofday\n");
+ tsc_quotient = calibrate_tsc_hpet();
+ timer_tsc.mark_offset = &mark_offset_tsc_hpet;
+ /*
+ * Math to calculate hpet to usec multiplier
+ * Look for the comments at get_offset_tsc_hpet()
+ */
+ ASM_DIV64_REG(result, remain, hpet_tick,
+ 0, KERNEL_TICK_USEC);
+ if (remain > (hpet_tick >> 1))
+ result++; /* rounding the result */
+
+ hpet_usec_quotient = result;
+ } else
+#endif
+ {
+ tsc_quotient = calibrate_tsc();
+ }
+
if (tsc_quotient) {
fast_gettimeoffset_quotient = tsc_quotient;
use_tsc = 1;
diff -Nru a/arch/i386/mach-visws/mpparse.c b/arch/i386/mach-visws/mpparse.c
--- a/arch/i386/mach-visws/mpparse.c Mon Aug 18 19:46:23 2003
+++ b/arch/i386/mach-visws/mpparse.c Sun Aug 31 16:14:17 2003
@@ -38,7 +38,7 @@
void __init MP_processor_info (struct mpc_config_processor *m)
{
int ver, logical_apicid;
- cpumask_t apic_cpus;
+ physid_mask_t apic_cpus;
if (!(m->mpc_cpuflag & CPU_ENABLED))
return;
diff -Nru a/arch/i386/mach-voyager/voyager_smp.c b/arch/i386/mach-voyager/voyager_smp.c
--- a/arch/i386/mach-voyager/voyager_smp.c Mon Aug 18 19:46:23 2003
+++ b/arch/i386/mach-voyager/voyager_smp.c Sun Aug 31 16:14:42 2003
@@ -130,7 +130,7 @@
{
int cpu;
- for_each_cpu(cpu, mk_cpumask_const(cpu_online_map)) {
+ for_each_cpu(cpu, cpu_online_map) {
if(cpuset & (1<
IOCTL_TABLE_END
+
+int ioctl_table_size = ARRAY_SIZE(ioctl_start);
diff -Nru a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
--- a/arch/ia64/ia32/sys_ia32.c Tue Aug 19 23:13:39 2003
+++ b/arch/ia64/ia32/sys_ia32.c Mon Aug 25 14:45:43 2003
@@ -76,7 +76,6 @@
#define OFFSET4K(a) ((a) & 0xfff)
#define PAGE_START(addr) ((addr) & PAGE_MASK)
-#define PAGE_OFF(addr) ((addr) & ~PAGE_MASK)
#define high2lowuid(uid) ((uid) > 65535 ? 65534 : (uid))
#define high2lowgid(gid) ((gid) > 65535 ? 65534 : (gid))
@@ -170,9 +169,9 @@
current->thread.map_base = old_map_base;
current->thread.task_size = old_task_size;
set_fs(USER_DS); /* establish new task-size as the address-limit */
- out:
- kfree(av);
}
+ out:
+ kfree(av);
return r;
}
@@ -271,11 +270,11 @@
if (old_prot) {
/* copy back the old page contents. */
- if (PAGE_OFF(start))
- copy_to_user((void *) PAGE_START(start), page, PAGE_OFF(start));
- if (PAGE_OFF(end))
- copy_to_user((void *) end, page + PAGE_OFF(end),
- PAGE_SIZE - PAGE_OFF(end));
+ if (offset_in_page(start))
+ copy_to_user((void *) PAGE_START(start), page, offset_in_page(start));
+ if (offset_in_page(end))
+ copy_to_user((void *) end, page + offset_in_page(end),
+ PAGE_SIZE - offset_in_page(end));
}
if (!(flags & MAP_ANONYMOUS)) {
@@ -330,7 +329,7 @@
"%s(%d): emulate_mmap() can't share tail (end=0x%lx)\n",
current->comm, current->pid, end);
ret = mmap_subpage(file, max(start, PAGE_START(end)), end, prot, flags,
- (off + len) - PAGE_OFF(end));
+ (off + len) - offset_in_page(end));
if (IS_ERR((void *) ret))
return ret;
pend -= PAGE_SIZE;
@@ -347,14 +346,14 @@
tmp = arch_get_unmapped_area(file, pstart - fudge, pend - pstart, 0, flags);
if (tmp != pstart) {
pstart = tmp;
- start = pstart + PAGE_OFF(off); /* make start congruent with off */
+ start = pstart + offset_in_page(off); /* make start congruent with off */
end = start + len;
pend = PAGE_ALIGN(end);
}
}
poff = off + (pstart - start); /* note: (pstart - start) may be negative */
- is_congruent = (flags & MAP_ANONYMOUS) || (PAGE_OFF(poff) == 0);
+ is_congruent = (flags & MAP_ANONYMOUS) || (offset_in_page(poff) == 0);
if ((flags & MAP_SHARED) && !is_congruent)
printk(KERN_INFO "%s(%d): emulate_mmap() can't share contents of incongruent mmap "
@@ -588,7 +587,7 @@
down(&ia32_mmap_sem);
{
- if (PAGE_OFF(start)) {
+ if (offset_in_page(start)) {
/* start address is 4KB aligned but not page aligned. */
retval = mprotect_subpage(PAGE_START(start), prot);
if (retval < 0)
@@ -599,7 +598,7 @@
goto out; /* retval is already zero... */
}
- if (PAGE_OFF(end)) {
+ if (offset_in_page(end)) {
/* end address is 4KB aligned but not page aligned. */
retval = mprotect_subpage(PAGE_START(end), prot);
if (retval < 0)
diff -Nru a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
--- a/arch/ia64/kernel/acpi.c Wed Aug 6 12:37:03 2003
+++ b/arch/ia64/kernel/acpi.c Tue Aug 26 15:09:18 2003
@@ -130,7 +130,7 @@
int vector = -1;
if (int_type < ACPI_MAX_PLATFORM_INTERRUPTS) {
- /* correctable platform error interrupt */
+ /* corrected platform error interrupt */
vector = platform_intr_list[int_type];
} else
printk(KERN_ERR "acpi_request_vector(): invalid interrupt type\n");
diff -Nru a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
--- a/arch/ia64/kernel/entry.S Sat Aug 16 17:16:48 2003
+++ b/arch/ia64/kernel/entry.S Mon Aug 25 14:47:33 2003
@@ -1473,7 +1473,7 @@
data8 sys_clock_nanosleep
data8 sys_fstatfs64
data8 sys_statfs64
- data8 ia64_ni_syscall
+ data8 sys_fadvise64_64
data8 ia64_ni_syscall // 1260
data8 ia64_ni_syscall
data8 ia64_ni_syscall
diff -Nru a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S
--- a/arch/ia64/kernel/fsys.S Thu Jul 10 18:16:32 2003
+++ b/arch/ia64/kernel/fsys.S Mon Aug 25 14:47:33 2003
@@ -678,9 +678,9 @@
data8 0 // clock_gettime
data8 0 // clock_getres // 1255
data8 0 // clock_nanosleep
- data8 0
- data8 0
- data8 0
+ data8 0 // fstatfs64
+ data8 0 // statfs64
+ data8 0 // fadvise64_64
data8 0 // 1260
data8 0
data8 0
diff -Nru a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
--- a/arch/ia64/kernel/mca.c Tue Aug 19 23:13:39 2003
+++ b/arch/ia64/kernel/mca.c Tue Aug 26 13:42:37 2003
@@ -1145,7 +1145,7 @@
ia64_mca_cmc_int_handler(cpe_irq, arg, ptregs);
- for (++cpuid ; !cpu_online(cpuid) && cpuid < NR_CPUS ; cpuid++);
+ for (++cpuid ; cpuid < NR_CPUS && !cpu_online(cpuid) ; cpuid++);
if (cpuid < NR_CPUS) {
platform_send_ipi(cpuid, IA64_CMCP_VECTOR, IA64_IPI_DM_INT, 0);
@@ -1225,7 +1225,7 @@
ia64_mca_cpe_int_handler(cpe_irq, arg, ptregs);
- for (++cpuid ; !cpu_online(cpuid) && cpuid < NR_CPUS ; cpuid++);
+ for (++cpuid ; cpuid < NR_CPUS && !cpu_online(cpuid) ; cpuid++);
if (cpuid < NR_CPUS) {
platform_send_ipi(cpuid, IA64_CPEP_VECTOR, IA64_IPI_DM_INT, 0);
diff -Nru a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
--- a/arch/ia64/kernel/perfmon.c Thu Aug 21 15:45:04 2003
+++ b/arch/ia64/kernel/perfmon.c Sun Aug 31 16:14:08 2003
@@ -2109,7 +2109,7 @@
return 1;
}
static struct dentry_operations pfmfs_dentry_operations = {
- d_delete: pfmfs_delete_dentry,
+ .d_delete = pfmfs_delete_dentry,
};
diff -Nru a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
--- a/arch/ia64/kernel/smpboot.c Mon Aug 18 19:46:23 2003
+++ b/arch/ia64/kernel/smpboot.c Fri Aug 22 15:20:52 2003
@@ -560,7 +560,7 @@
if (cpu_online(cpu))
bogosum += cpu_data(cpu)->loops_per_jiffy;
- printk(KERN_INFO "Total of %d processors activated (%lu.%02lu BogoMIPS).\n",
+ printk(KERN_INFO "Total of %lu processors activated (%lu.%02lu BogoMIPS).\n",
num_online_cpus(), bogosum/(500000/HZ), (bogosum/(5000/HZ))%100);
}
diff -Nru a/arch/ia64/kernel/sys_ia64.c b/arch/ia64/kernel/sys_ia64.c
--- a/arch/ia64/kernel/sys_ia64.c Wed Jul 9 09:56:58 2003
+++ b/arch/ia64/kernel/sys_ia64.c Mon Aug 25 14:45:43 2003
@@ -242,7 +242,7 @@
asmlinkage unsigned long
sys_mmap (unsigned long addr, unsigned long len, int prot, int flags, int fd, long off)
{
- if ((off & ~PAGE_MASK) != 0)
+ if (offset_in_page(off) != 0)
return -EINVAL;
addr = do_mmap2(addr, len, prot, flags, fd, off >> PAGE_SHIFT);
diff -Nru a/arch/ia64/lib/Makefile b/arch/ia64/lib/Makefile
--- a/arch/ia64/lib/Makefile Fri Jun 20 12:48:24 2003
+++ b/arch/ia64/lib/Makefile Mon Aug 25 09:56:27 2003
@@ -14,9 +14,6 @@
lib-$(CONFIG_PERFMON) += carta_random.o
lib-$(CONFIG_MD_RAID5) += xor.o
-IGNORE_FLAGS_OBJS = __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o \
- __divdi3.o __udivdi3.o __moddi3.o __umoddi3.o
-
AFLAGS___divdi3.o =
AFLAGS___udivdi3.o = -DUNSIGNED
AFLAGS___moddi3.o = -DMODULO
@@ -27,26 +24,26 @@
AFLAGS___modsi3.o = -DMODULO
AFLAGS___umodsi3.o = -DUNSIGNED -DMODULO
-$(obj)/__divdi3.o: $(src)/idiv64.S
- $(cmd_as_o_S)
+$(obj)/__divdi3.o: $(src)/idiv64.S FORCE
+ $(call if_changed_dep,as_o_S)
-$(obj)/__udivdi3.o: $(src)/idiv64.S
- $(cmd_as_o_S)
+$(obj)/__udivdi3.o: $(src)/idiv64.S FORCE
+ $(call if_changed_dep,as_o_S)
-$(obj)/__moddi3.o: $(src)/idiv64.S
- $(cmd_as_o_S)
+$(obj)/__moddi3.o: $(src)/idiv64.S FORCE
+ $(call if_changed_dep,as_o_S)
-$(obj)/__umoddi3.o: $(src)/idiv64.S
- $(cmd_as_o_S)
+$(obj)/__umoddi3.o: $(src)/idiv64.S FORCE
+ $(call if_changed_dep,as_o_S)
-$(obj)/__divsi3.o: $(src)/idiv32.S
- $(cmd_as_o_S)
+$(obj)/__divsi3.o: $(src)/idiv32.S FORCE
+ $(call if_changed_dep,as_o_S)
-$(obj)/__udivsi3.o: $(src)/idiv32.S
- $(cmd_as_o_S)
+$(obj)/__udivsi3.o: $(src)/idiv32.S FORCE
+ $(call if_changed_dep,as_o_S)
-$(obj)/__modsi3.o: $(src)/idiv32.S
- $(cmd_as_o_S)
+$(obj)/__modsi3.o: $(src)/idiv32.S FORCE
+ $(call if_changed_dep,as_o_S)
-$(obj)/__umodsi3.o: $(src)/idiv32.S
- $(cmd_as_o_S)
+$(obj)/__umodsi3.o: $(src)/idiv32.S FORCE
+ $(call if_changed_dep,as_o_S)
diff -Nru a/arch/ia64/mm/numa.c b/arch/ia64/mm/numa.c
--- a/arch/ia64/mm/numa.c Mon Sep 30 06:38:28 2002
+++ b/arch/ia64/mm/numa.c Thu Aug 21 05:02:28 2003
@@ -42,5 +42,5 @@
paddr < node_memblk[i].start_paddr + node_memblk[i].size)
break;
- return (i < num_memblks) ? node_memblk[i].nid : -1;
+ return (i < num_memblks) ? node_memblk[i].nid : (num_memblks ? -1 : 0);
}
diff -Nru a/arch/ia64/sn/io/drivers/ioconfig_bus.c b/arch/ia64/sn/io/drivers/ioconfig_bus.c
--- a/arch/ia64/sn/io/drivers/ioconfig_bus.c Mon May 19 05:42:35 2003
+++ b/arch/ia64/sn/io/drivers/ioconfig_bus.c Sun Aug 31 16:14:08 2003
@@ -346,9 +346,9 @@
}
struct file_operations ioconfig_bus_fops = {
- ioctl:ioconfig_bus_ioctl,
- open:ioconfig_bus_open, /* open */
- release:ioconfig_bus_close /* release */
+ .ioctl = ioconfig_bus_ioctl,
+ .open = ioconfig_bus_open, /* open */
+ .release = ioconfig_bus_close /* release */
};
diff -Nru a/arch/ia64/sn/io/sn2/shub.c b/arch/ia64/sn/io/sn2/shub.c
--- a/arch/ia64/sn/io/sn2/shub.c Mon Aug 4 10:02:37 2003
+++ b/arch/ia64/sn/io/sn2/shub.c Sun Aug 31 16:14:08 2003
@@ -243,7 +243,7 @@
}
struct file_operations shub_mon_fops = {
- ioctl: shubstats_ioctl,
+ .ioctl = shubstats_ioctl,
};
/*
diff -Nru a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
--- a/arch/ia64/sn/kernel/setup.c Sat Aug 16 16:26:35 2003
+++ b/arch/ia64/sn/kernel/setup.c Sun Aug 31 16:14:08 2003
@@ -117,14 +117,14 @@
* VGA color display.
*/
struct screen_info sn_screen_info = {
- orig_x: 0,
- orig_y: 0,
- orig_video_mode: 3,
- orig_video_cols: 80,
- orig_video_ega_bx: 3,
- orig_video_lines: 25,
- orig_video_isVGA: 1,
- orig_video_points: 16
+ .orig_x = 0,
+ .orig_y = 0,
+ .orig_video_mode = 3,
+ .orig_video_cols = 80,
+ .orig_video_ega_bx = 3,
+ .orig_video_lines = 25,
+ .orig_video_isVGA = 1,
+ .orig_video_points = 16
};
/*
diff -Nru a/arch/m68k/Kconfig b/arch/m68k/Kconfig
--- a/arch/m68k/Kconfig Sat Aug 2 14:26:16 2003
+++ b/arch/m68k/Kconfig Sun Aug 31 16:14:22 2003
@@ -342,40 +342,6 @@
menu "General setup"
-choice
- prompt "Kernel core (/proc/kcore) format"
- depends on PROC_FS
- default KCORE_ELF
-
-config KCORE_ELF
- bool "ELF"
- ---help---
- If you enabled support for /proc file system then the file
- /proc/kcore will contain the kernel core image. This can be used
- in gdb:
-
- $ cd /usr/src/linux ; gdb vmlinux /proc/kcore
-
- You have two choices here: ELF and A.OUT. Selecting ELF will make
- /proc/kcore appear in ELF core format as defined by the Executable
- and Linking Format specification. Selecting A.OUT will choose the
- old "a.out" format which may be necessary for some old versions
- of binutils or on some architectures.
-
- This is especially useful if you have compiled the kernel with the
- "-g" option to preserve debugging information. It is mainly used
- for examining kernel data structures on the live kernel so if you
- don't understand what this means or are not a kernel hacker, just
- leave it at its default value ELF.
-
-config KCORE_AOUT
- bool "A.OUT"
- help
- Not necessary unless you're using a very out-of-date binutils
- version. You probably want KCORE_ELF.
-
-endchoice
-
source "fs/Kconfig.binfmt"
config ZORRO
diff -Nru a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds
--- /dev/null Wed Dec 31 16:00:00 1969
+++ b/arch/m68k/kernel/vmlinux-std.lds Sun Jun 15 03:46:43 2003
@@ -0,0 +1,97 @@
+/* ld script to make m68k Linux kernel */
+
+#include
+
+OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k")
+OUTPUT_ARCH(m68k)
+ENTRY(_start)
+jiffies = jiffies_64 + 4;
+SECTIONS
+{
+ . = 0x1000;
+ _text = .; /* Text and read-only data */
+ .text : {
+ *(.text)
+ *(.fixup)
+ *(.gnu.warning)
+ } = 0x4e75
+
+ . = ALIGN(16); /* Exception table */
+ __start___ex_table = .;
+ __ex_table : { *(__ex_table) }
+ __stop___ex_table = .;
+
+ RODATA
+
+ _etext = .; /* End of text section */
+
+ .data : { /* Data */
+ *(.data)
+ CONSTRUCTORS
+ }
+
+ .bss : { *(.bss) } /* BSS */
+
+ . = ALIGN(16);
+ .data.cacheline_aligned : { *(.data.cacheline_aligned) }
+
+ _edata = .; /* End of data section */
+
+ /* will be freed after init */
+ . = ALIGN(4096); /* Init code and data */
+ __init_begin = .;
+ .init.text : {
+ _sinittext = .;
+ *(.init.text)
+ _einittext = .;
+ }
+ .init.data : { *(.init.data) }
+ . = ALIGN(16);
+ __setup_start = .;
+ .init.setup : { *(.init.setup) }
+ __setup_end = .;
+ __start___param = .;
+ __param : { *(__param) }
+ __stop___param = .;
+ __initcall_start = .;
+ .initcall.init : {
+ *(.initcall1.init)
+ *(.initcall2.init)
+ *(.initcall3.init)
+ *(.initcall4.init)
+ *(.initcall5.init)
+ *(.initcall6.init)
+ *(.initcall7.init)
+ }
+ __initcall_end = .;
+ __con_initcall_start = .;
+ .con_initcall.init : { *(.con_initcall.init) }
+ __con_initcall_end = .;
+ SECURITY_INIT
+ . = ALIGN(8192);
+ __initramfs_start = .;
+ .init.ramfs : { *(.init.ramfs) }
+ __initramfs_end = .;
+ . = ALIGN(8192);
+ __init_end = .;
+
+ .data.init_task : { *(.data.init_task) } /* The initial task and kernel stack */
+
+ _end = . ;
+
+ /* Sections to be discarded */
+ /DISCARD/ : {
+ *(.exit.text)
+ *(.exit.data)
+ *(.exitcall.exit)
+ }
+
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+}
diff -Nru a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds
--- /dev/null Wed Dec 31 16:00:00 1969
+++ b/arch/m68k/kernel/vmlinux-sun3.lds Sun Jun 15 03:46:43 2003
@@ -0,0 +1,97 @@
+/* ld script to make m68k Linux kernel */
+
+#include
+
+OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k")
+OUTPUT_ARCH(m68k)
+ENTRY(_start)
+jiffies = jiffies_64 + 4;
+SECTIONS
+{
+ . = 0xE004000;
+ _text = .; /* Text and read-only data */
+ .text : {
+ *(.head)
+ *(.text)
+ *(.fixup)
+ *(.gnu.warning)
+ } = 0x4e75
+ RODATA
+
+ _etext = .; /* End of text section */
+
+ .data : { /* Data */
+ *(.data)
+ CONSTRUCTORS
+ . = ALIGN(16); /* Exception table */
+ __start___ex_table = .;
+ *(__ex_table)
+ __stop___ex_table = .;
+ }
+ /* End of data goes *here* so that freeing init code works properly. */
+ _edata = .;
+
+ /* will be freed after init */
+ . = ALIGN(8192); /* Init code and data */
+__init_begin = .;
+ .init.text : {
+ _sinittext = .;
+ *(.init.text)
+ _einittext = .;
+ }
+ .init.data : { *(.init.data) }
+ . = ALIGN(16);
+ __setup_start = .;
+ .init.setup : { *(.init.setup) }
+ __setup_end = .;
+ __start___param = .;
+ __param : { *(__param) }
+ __stop___param = .;
+ __initcall_start = .;
+ .initcall.init : {
+ *(.initcall1.init)
+ *(.initcall2.init)
+ *(.initcall3.init)
+ *(.initcall4.init)
+ *(.initcall5.init)
+ *(.initcall6.init)
+ *(.initcall7.init)
+ }
+ __initcall_end = .;
+ __con_initcall_start = .;
+ .con_initcall.init : { *(.con_initcall.init) }
+ __con_initcall_end = .;
+ SECURITY_INIT
+ . = ALIGN(8192);
+ __initramfs_start = .;
+ .init.ramfs : { *(.init.ramfs) }
+ __initramfs_end = .;
+ . = ALIGN(8192);
+ __init_end = .;
+ .init.task : { *(init_task) }
+
+
+ .bss : { *(.bss) } /* BSS */
+
+ _end = . ;
+
+ /* Sections to be discarded */
+ /DISCARD/ : {
+ *(.exit.text)
+ *(.exit.data)
+ *(.exitcall.exit)
+ }
+
+ .crap : {
+ /* Stabs debugging sections. */
+ *(.stab)
+ *(.stabstr)
+ *(.stab.excl)
+ *(.stab.exclstr)
+ *(.stab.index)
+ *(.stab.indexstr)
+ *(.comment)
+ *(.note)
+ }
+
+}
diff -Nru a/arch/m68k/vmlinux-std.lds b/arch/m68k/vmlinux-std.lds
--- a/arch/m68k/vmlinux-std.lds Wed Jun 11 17:40:05 2003
+++ /dev/null Wed Dec 31 16:00:00 1969
@@ -1,97 +0,0 @@
-/* ld script to make m68k Linux kernel */
-
-#include
-
-OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k")
-OUTPUT_ARCH(m68k)
-ENTRY(_start)
-jiffies = jiffies_64 + 4;
-SECTIONS
-{
- . = 0x1000;
- _text = .; /* Text and read-only data */
- .text : {
- *(.text)
- *(.fixup)
- *(.gnu.warning)
- } = 0x4e75
-
- . = ALIGN(16); /* Exception table */
- __start___ex_table = .;
- __ex_table : { *(__ex_table) }
- __stop___ex_table = .;
-
- RODATA
-
- _etext = .; /* End of text section */
-
- .data : { /* Data */
- *(.data)
- CONSTRUCTORS
- }
-
- .bss : { *(.bss) } /* BSS */
-
- . = ALIGN(16);
- .data.cacheline_aligned : { *(.data.cacheline_aligned) }
-
- _edata = .; /* End of data section */
-
- /* will be freed after init */
- . = ALIGN(4096); /* Init code and data */
- __init_begin = .;
- .init.text : {
- _sinittext = .;
- *(.init.text)
- _einittext = .;
- }
- .init.data : { *(.init.data) }
- . = ALIGN(16);
- __setup_start = .;
- .init.setup : { *(.init.setup) }
- __setup_end = .;
- __start___param = .;
- __param : { *(__param) }
- __stop___param = .;
- __initcall_start = .;
- .initcall.init : {
- *(.initcall1.init)
- *(.initcall2.init)
- *(.initcall3.init)
- *(.initcall4.init)
- *(.initcall5.init)
- *(.initcall6.init)
- *(.initcall7.init)
- }
- __initcall_end = .;
- __con_initcall_start = .;
- .con_initcall.init : { *(.con_initcall.init) }
- __con_initcall_end = .;
- SECURITY_INIT
- . = ALIGN(8192);
- __initramfs_start = .;
- .init.ramfs : { *(.init.ramfs) }
- __initramfs_end = .;
- . = ALIGN(8192);
- __init_end = .;
-
- .data.init_task : { *(.data.init_task) } /* The initial task and kernel stack */
-
- _end = . ;
-
- /* Sections to be discarded */
- /DISCARD/ : {
- *(.exit.text)
- *(.exit.data)
- *(.exitcall.exit)
- }
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
-}
diff -Nru a/arch/m68k/vmlinux-sun3.lds b/arch/m68k/vmlinux-sun3.lds
--- a/arch/m68k/vmlinux-sun3.lds Wed Jun 11 17:40:05 2003
+++ /dev/null Wed Dec 31 16:00:00 1969
@@ -1,97 +0,0 @@
-/* ld script to make m68k Linux kernel */
-
-#include
-
-OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k")
-OUTPUT_ARCH(m68k)
-ENTRY(_start)
-jiffies = jiffies_64 + 4;
-SECTIONS
-{
- . = 0xE004000;
- _text = .; /* Text and read-only data */
- .text : {
- *(.head)
- *(.text)
- *(.fixup)
- *(.gnu.warning)
- } = 0x4e75
- RODATA
-
- _etext = .; /* End of text section */
-
- .data : { /* Data */
- *(.data)
- CONSTRUCTORS
- . = ALIGN(16); /* Exception table */
- __start___ex_table = .;
- *(__ex_table)
- __stop___ex_table = .;
- }
- /* End of data goes *here* so that freeing init code works properly. */
- _edata = .;
-
- /* will be freed after init */
- . = ALIGN(8192); /* Init code and data */
-__init_begin = .;
- .init.text : {
- _sinittext = .;
- *(.init.text)
- _einittext = .;
- }
- .init.data : { *(.init.data) }
- . = ALIGN(16);
- __setup_start = .;
- .init.setup : { *(.init.setup) }
- __setup_end = .;
- __start___param = .;
- __param : { *(__param) }
- __stop___param = .;
- __initcall_start = .;
- .initcall.init : {
- *(.initcall1.init)
- *(.initcall2.init)
- *(.initcall3.init)
- *(.initcall4.init)
- *(.initcall5.init)
- *(.initcall6.init)
- *(.initcall7.init)
- }
- __initcall_end = .;
- __con_initcall_start = .;
- .con_initcall.init : { *(.con_initcall.init) }
- __con_initcall_end = .;
- SECURITY_INIT
- . = ALIGN(8192);
- __initramfs_start = .;
- .init.ramfs : { *(.init.ramfs) }
- __initramfs_end = .;
- . = ALIGN(8192);
- __init_end = .;
- .init.task : { *(init_task) }
-
-
- .bss : { *(.bss) } /* BSS */
-
- _end = . ;
-
- /* Sections to be discarded */
- /DISCARD/ : {
- *(.exit.text)
- *(.exit.data)
- *(.exitcall.exit)
- }
-
- .crap : {
- /* Stabs debugging sections. */
- *(.stab)
- *(.stabstr)
- *(.stab.excl)
- *(.stab.exclstr)
- *(.stab.index)
- *(.stab.indexstr)
- *(.comment)
- *(.note)
- }
-
-}
diff -Nru a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig
--- a/arch/m68knommu/Kconfig Sat Aug 2 14:26:16 2003
+++ b/arch/m68knommu/Kconfig Sun Aug 31 16:14:22 2003
@@ -490,14 +490,6 @@
menu "Executable file formats"
-config KCORE_AOUT
- bool
- default y
-
-config KCORE_ELF
- bool
- default y
-
source "fs/Kconfig.binfmt"
endmenu
diff -Nru a/arch/m68knommu/platform/5206/config.c b/arch/m68knommu/platform/5206/config.c
--- a/arch/m68knommu/platform/5206/config.c Tue May 27 20:13:12 2003
+++ b/arch/m68knommu/platform/5206/config.c Sat Aug 23 06:07:40 2003
@@ -14,6 +14,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -26,7 +27,7 @@
/***************************************************************************/
void coldfire_tick(void);
-void coldfire_timer_init(void (*handler)(int, void *, struct pt_regs *));
+void coldfire_timer_init(irqreturn_t (*handler)(int, void *, struct pt_regs *));
unsigned long coldfire_timer_offset(void);
void coldfire_trap_init(void);
void coldfire_reset(void);
diff -Nru a/arch/m68knommu/platform/5206e/config.c b/arch/m68knommu/platform/5206e/config.c
--- a/arch/m68knommu/platform/5206e/config.c Tue May 27 20:13:12 2003
+++ b/arch/m68knommu/platform/5206e/config.c Sat Aug 23 06:07:40 2003
@@ -12,6 +12,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -26,7 +27,7 @@
/***************************************************************************/
void coldfire_tick(void);
-void coldfire_timer_init(void (*handler)(int, void *, struct pt_regs *));
+void coldfire_timer_init(irqreturn_t (*handler)(int, void *, struct pt_regs *));
unsigned long coldfire_timer_offset(void);
void coldfire_trap_init(void);
void coldfire_reset(void);
diff -Nru a/arch/m68knommu/platform/5249/config.c b/arch/m68knommu/platform/5249/config.c
--- a/arch/m68knommu/platform/5249/config.c Tue Jun 17 06:35:38 2003
+++ b/arch/m68knommu/platform/5249/config.c Sat Aug 23 06:07:40 2003
@@ -26,7 +26,7 @@
/***************************************************************************/
void coldfire_tick(void);
-void coldfire_timer_init(void (*handler)(int, void *, struct pt_regs *));
+void coldfire_timer_init(irqreturn_t (*handler)(int, void *, struct pt_regs *));
unsigned long coldfire_timer_offset(void);
void coldfire_trap_init(void);
void coldfire_reset(void);
diff -Nru a/arch/m68knommu/platform/5272/config.c b/arch/m68knommu/platform/5272/config.c
--- a/arch/m68knommu/platform/5272/config.c Tue Jun 17 06:35:38 2003
+++ b/arch/m68knommu/platform/5272/config.c Sat Aug 23 06:07:40 2003
@@ -14,6 +14,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -27,7 +28,7 @@
/***************************************************************************/
void coldfire_tick(void);
-void coldfire_timer_init(void (*handler)(int, void *, struct pt_regs *));
+void coldfire_timer_init(irqreturn_t (*handler)(int, void *, struct pt_regs *));
unsigned long coldfire_timer_offset(void);
void coldfire_trap_init(void);
void coldfire_reset(void);
diff -Nru a/arch/mips/Kconfig b/arch/mips/Kconfig
--- a/arch/mips/Kconfig Mon Jul 28 04:57:50 2003
+++ b/arch/mips/Kconfig Sun Aug 31 16:14:22 2003
@@ -1126,31 +1126,6 @@
menu "Executable file formats"
-config KCORE_ELF
- bool
- default y
- ---help---
- If you enabled support for /proc file system then the file
- /proc/kcore will contain the kernel core image. This can be used
- in gdb:
-
- $ cd /usr/src/linux ; gdb vmlinux /proc/kcore
-
- You have two choices here: ELF and A.OUT. Selecting ELF will make
- /proc/kcore appear in ELF core format as defined by the Executable
- and Linking Format specification. Selecting A.OUT will choose the
- old "a.out" format which may be necessary for some old versions
- of binutils or on some architectures.
-
- This is especially useful if you have compiled the kernel with the
- "-g" option to preserve debugging information. It is mainly used
- for examining kernel data structures on the live kernel so if you
- don't understand what this means or are not a kernel hacker, just
- leave it at its default value ELF.
-
-config KCORE_AOUT
- bool
-
source "fs/Kconfig.binfmt"
config TRAD_SIGNALS
diff -Nru a/arch/mips/au1000/common/dma.c b/arch/mips/au1000/common/dma.c
--- a/arch/mips/au1000/common/dma.c Mon Jun 23 12:12:26 2003
+++ b/arch/mips/au1000/common/dma.c Sun Aug 31 16:14:08 2003
@@ -62,14 +62,14 @@
spinlock_t au1000_dma_spin_lock = SPIN_LOCK_UNLOCKED;
struct dma_chan au1000_dma_table[NUM_AU1000_DMA_CHANNELS] = {
- {dev_id:-1,},
- {dev_id:-1,},
- {dev_id:-1,},
- {dev_id:-1,},
- {dev_id:-1,},
- {dev_id:-1,},
- {dev_id:-1,},
- {dev_id:-1,}
+ {.dev_id = -1,},
+ {.dev_id = -1,},
+ {.dev_id = -1,},
+ {.dev_id = -1,},
+ {.dev_id = -1,},
+ {.dev_id = -1,},
+ {.dev_id = -1,},
+ {.dev_id = -1,}
};
// Device FIFO addresses and default DMA modes
diff -Nru a/arch/mips/kernel/ioctl32.c b/arch/mips/kernel/ioctl32.c
--- a/arch/mips/kernel/ioctl32.c Mon Jul 28 04:57:50 2003
+++ b/arch/mips/kernel/ioctl32.c Sun Aug 31 16:14:44 2003
@@ -810,8 +810,7 @@
#define IOCTL_TABLE_START \
struct ioctl_trans ioctl_start[] = {
#define IOCTL_TABLE_END \
- }; struct ioctl_trans ioctl_end[0];
-
+ };
IOCTL_TABLE_START
#include
@@ -1205,6 +1204,8 @@
COMPATIBLE_IOCTL(RTC_WKALM_SET)
COMPATIBLE_IOCTL(RTC_WKALM_RD)
IOCTL_TABLE_END
+
+int ioctl_table_size = ARRAY_SIZE(ioctl_start);
#define NR_IOCTL_TRANS (sizeof(ioctl_translations) / \
sizeof(ioctl_translations[0]))
diff -Nru a/arch/mips/sibyte/cfe/console.c b/arch/mips/sibyte/cfe/console.c
--- a/arch/mips/sibyte/cfe/console.c Mon Jul 28 04:57:50 2003
+++ b/arch/mips/sibyte/cfe/console.c Sun Aug 31 16:14:08 2003
@@ -9,7 +9,6 @@
#include "cfe_error.h"
extern int cfe_cons_handle;
-static kdev_t cfe_consdev;
static void cfe_console_write(struct console *cons, const char *str,
unsigned int count)
@@ -57,15 +56,12 @@
#ifdef CONFIG_SIBYTE_SB1250_DUART
if (!strcmp(consdev, "uart0")) {
setleds("u0cn");
-// cfe_consdev = MKDEV(TTY_MAJOR, SB1250_DUART_MINOR_BASE + 0);
} else if (!strcmp(consdev, "uart1")) {
setleds("u1cn");
-// cfe_consdev = MKDEV(TTY_MAJOR, SB1250_DUART_MINOR_BASE + 1);
#endif
#ifdef CONFIG_VGA_CONSOLE
} else if (!strcmp(consdev, "pcconsole0")) {
setleds("pccn");
-// cfe_consdev = MKDEV(TTY_MAJOR, 0);
#endif
} else
return -ENODEV;
@@ -74,12 +70,12 @@
}
static struct console sb1250_cfe_cons = {
- name: "cfe",
- write: cfe_console_write,
- device: cfe_console_device,
- setup: cfe_console_setup,
- flags: CON_PRINTBUFFER,
- index: -1,
+ .name = "cfe",
+ .write = cfe_console_write,
+ .device = cfe_console_device,
+ .setup = cfe_console_setup,
+ .flags = CON_PRINTBUFFER,
+ .index = -1,
};
static int __init sb1250_cfe_console_init(void)
diff -Nru a/arch/mips/sibyte/sb1250/bcm1250_tbprof.c b/arch/mips/sibyte/sb1250/bcm1250_tbprof.c
--- a/arch/mips/sibyte/sb1250/bcm1250_tbprof.c Mon Jul 28 04:57:50 2003
+++ b/arch/mips/sibyte/sb1250/bcm1250_tbprof.c Tue Aug 26 09:25:40 2003
@@ -253,7 +253,7 @@
{
int minor;
- minor = minor(inode->i_rdev);
+ minor = iminor(inode);
if (minor != 0) {
return -ENODEV;
}
@@ -278,7 +278,7 @@
{
int minor;
- minor = minor(inode->i_rdev);
+ minor = iminor(inode);
if (minor != 0 || !sbp.open) {
return -ENODEV;
}
diff -Nru a/arch/mips/tx4927/common/tx4927_irq.c b/arch/mips/tx4927/common/tx4927_irq.c
--- a/arch/mips/tx4927/common/tx4927_irq.c Mon Apr 14 20:10:10 2003
+++ b/arch/mips/tx4927/common/tx4927_irq.c Sun Aug 31 16:14:08 2003
@@ -149,26 +149,26 @@
#define TX4927_CP0_NAME "TX4927-CP0"
static struct hw_interrupt_type tx4927_irq_cp0_type = {
- typename: TX4927_CP0_NAME,
- startup: tx4927_irq_cp0_startup,
- shutdown: tx4927_irq_cp0_shutdown,
- enable: tx4927_irq_cp0_enable,
- disable: tx4927_irq_cp0_disable,
- ack: tx4927_irq_cp0_mask_and_ack,
- end: tx4927_irq_cp0_end,
- set_affinity: NULL
+ .typename = TX4927_CP0_NAME,
+ .startup = tx4927_irq_cp0_startup,
+ .shutdown = tx4927_irq_cp0_shutdown,
+ .enable = tx4927_irq_cp0_enable,
+ .disable = tx4927_irq_cp0_disable,
+ .ack = tx4927_irq_cp0_mask_and_ack,
+ .end = tx4927_irq_cp0_end,
+ .set_affinity = NULL
};
#define TX4927_PIC_NAME "TX4927-PIC"
static struct hw_interrupt_type tx4927_irq_pic_type = {
- typename: TX4927_PIC_NAME,
- startup: tx4927_irq_pic_startup,
- shutdown: tx4927_irq_pic_shutdown,
- enable: tx4927_irq_pic_enable,
- disable: tx4927_irq_pic_disable,
- ack: tx4927_irq_pic_mask_and_ack,
- end: tx4927_irq_pic_end,
- set_affinity: NULL
+ .typename = TX4927_PIC_NAME,
+ .startup = tx4927_irq_pic_startup,
+ .shutdown = tx4927_irq_pic_shutdown,
+ .enable = tx4927_irq_pic_enable,
+ .disable = tx4927_irq_pic_disable,
+ .ack = tx4927_irq_pic_mask_and_ack,
+ .end = tx4927_irq_pic_end,
+ .set_affinity = NULL
};
#define TX4927_PIC_ACTION(s) { no_action, 0, 0, s, NULL, NULL }
diff -Nru a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c
--- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c Thu Jul 3 15:17:43 2003
+++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c Sun Aug 31 16:14:08 2003
@@ -255,14 +255,14 @@
#define TOSHIBA_RBTX4927_IOC_NAME "RBTX4927-IOC"
static struct hw_interrupt_type toshiba_rbtx4927_irq_ioc_type = {
- typename:TOSHIBA_RBTX4927_IOC_NAME,
- startup:toshiba_rbtx4927_irq_ioc_startup,
- shutdown:toshiba_rbtx4927_irq_ioc_shutdown,
- enable:toshiba_rbtx4927_irq_ioc_enable,
- disable:toshiba_rbtx4927_irq_ioc_disable,
- ack:toshiba_rbtx4927_irq_ioc_mask_and_ack,
- end:toshiba_rbtx4927_irq_ioc_end,
- set_affinity:NULL
+ .typename = TOSHIBA_RBTX4927_IOC_NAME,
+ .startup = toshiba_rbtx4927_irq_ioc_startup,
+ .shutdown = toshiba_rbtx4927_irq_ioc_shutdown,
+ .enable = toshiba_rbtx4927_irq_ioc_enable,
+ .disable = toshiba_rbtx4927_irq_ioc_disable,
+ .ack = toshiba_rbtx4927_irq_ioc_mask_and_ack,
+ .end = toshiba_rbtx4927_irq_ioc_end,
+ .set_affinity = NULL
};
#define TOSHIBA_RBTX4927_IOC_INTR_ENAB 0xbc002000
#define TOSHIBA_RBTX4927_IOC_INTR_STAT 0xbc002006
@@ -271,14 +271,14 @@
#ifdef CONFIG_TOSHIBA_FPCIB0
#define TOSHIBA_RBTX4927_ISA_NAME "RBTX4927-ISA"
static struct hw_interrupt_type toshiba_rbtx4927_irq_isa_type = {
- typename:TOSHIBA_RBTX4927_ISA_NAME,
- startup:toshiba_rbtx4927_irq_isa_startup,
- shutdown:toshiba_rbtx4927_irq_isa_shutdown,
- enable:toshiba_rbtx4927_irq_isa_enable,
- disable:toshiba_rbtx4927_irq_isa_disable,
- ack:toshiba_rbtx4927_irq_isa_mask_and_ack,
- end:toshiba_rbtx4927_irq_isa_end,
- set_affinity:NULL
+ .typename = TOSHIBA_RBTX4927_ISA_NAME,
+ .startup = toshiba_rbtx4927_irq_isa_startup,
+ .shutdown = toshiba_rbtx4927_irq_isa_shutdown,
+ .enable = toshiba_rbtx4927_irq_isa_enable,
+ .disable = toshiba_rbtx4927_irq_isa_disable,
+ .ack = toshiba_rbtx4927_irq_isa_mask_and_ack,
+ .end = toshiba_rbtx4927_irq_isa_end,
+ .set_affinity = NULL
};
#endif
diff -Nru a/arch/mips/vr41xx/common/vrc4173.c b/arch/mips/vr41xx/common/vrc4173.c
--- a/arch/mips/vr41xx/common/vrc4173.c Thu Jul 31 08:59:17 2003
+++ b/arch/mips/vr41xx/common/vrc4173.c Sun Aug 31 16:14:08 2003
@@ -250,10 +250,10 @@
}
static struct pci_driver vrc4173_driver = {
- name: "NEC VRC4173",
- probe: vrc4173_probe,
- remove: NULL,
- id_table: vrc4173_table,
+ .name = "NEC VRC4173",
+ .probe = vrc4173_probe,
+ .remove = NULL,
+ .id_table = vrc4173_table,
};
static int __devinit vrc4173_init(void)
diff -Nru a/arch/parisc/Kconfig b/arch/parisc/Kconfig
--- a/arch/parisc/Kconfig Sat Aug 2 14:26:16 2003
+++ b/arch/parisc/Kconfig Sun Aug 31 16:14:22 2003
@@ -161,11 +161,6 @@
menu "Executable file formats"
-config KCORE_ELF
- bool
- depends on PROC_FS
- default y
-
source "fs/Kconfig.binfmt"
endmenu
diff -Nru a/arch/parisc/kernel/ioctl32.c b/arch/parisc/kernel/ioctl32.c
--- a/arch/parisc/kernel/ioctl32.c Fri May 2 10:22:56 2003
+++ b/arch/parisc/kernel/ioctl32.c Sun Aug 31 16:14:44 2003
@@ -1426,7 +1426,7 @@
return -EINVAL;
tty = (struct tty_struct *)file->private_data;
- if (tty_paranoia_check(tty, inode->i_rdev, "tty_ioctl"))
+ if (tty_paranoia_check(tty, inode, "tty_ioctl"))
return -EINVAL;
if (tty->driver->ioctl != vt_ioctl)
@@ -2458,7 +2458,7 @@
#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL(cmd, sys_ioctl)
#define IOCTL_TABLE_START struct ioctl_trans ioctl_start[] = {
-#define IOCTL_TABLE_END }; struct ioctl_trans ioctl_end[0];
+#define IOCTL_TABLE_END };
IOCTL_TABLE_START
#include
@@ -2631,3 +2631,4 @@
#endif /* DRM */
IOCTL_TABLE_END
+int ioctl_table_size = ARRAY_SIZE(ioctl_start);
diff -Nru a/arch/ppc/8260_io/uart.c b/arch/ppc/8260_io/uart.c
--- a/arch/ppc/8260_io/uart.c Wed Jun 11 12:32:53 2003
+++ b/arch/ppc/8260_io/uart.c Tue Aug 26 09:25:39 2003
@@ -50,6 +50,10 @@
#include
#include
+#ifdef CONFIG_MAGIC_SYSRQ
+#include
+#endif
+
#ifdef CONFIG_SERIAL_CONSOLE
#include
@@ -77,6 +81,14 @@
static struct tty_driver *serial_driver;
static int serial_console_setup(struct console *co, char *options);
+static void serial_console_write(struct console *c, const char *s,
+ unsigned count);
+static kdev_t serial_console_device(struct console *c);
+
+#if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+static unsigned long break_pressed; /* break, really ... */
+#endif
+
/*
* Serial driver configuration section. Here are the various options:
*/
@@ -208,6 +220,15 @@
cbd_t *tx_cur;
} ser_info_t;
+static struct console sercons = {
+ .name = "ttyS",
+ .write = serial_console_write,
+ .device = serial_console_device,
+ .setup = serial_console_setup,
+ .flags = CON_PRINTBUFFER,
+ .index = CONFIG_SERIAL_CONSOLE_PORT,
+};
+
static void change_speed(ser_info_t *info);
static void rs_8xx_wait_until_sent(struct tty_struct *tty, int timeout);
@@ -328,7 +349,7 @@
schedule_work(&info->tqueue);
}
-static _INLINE_ void receive_chars(ser_info_t *info)
+static _INLINE_ void receive_chars(ser_info_t *info, struct pt_regs *regs)
{
struct tty_struct *tty = info->tty;
unsigned char ch, *cp;
@@ -450,6 +471,19 @@
}
}
}
+
+#if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+ if (break_pressed && info->line == sercons.index) {
+ if (ch != 0 && time_before(jiffies,
+ break_pressed + HZ*5)) {
+ handle_sysrq(ch, regs, NULL, NULL);
+ break_pressed = 0;
+ goto ignore_char;
+ } else
+ break_pressed = 0;
+ }
+#endif
+
if (tty->flip.count >= TTY_FLIPBUF_SIZE)
break;
@@ -458,6 +492,10 @@
tty->flip.count++;
}
+#if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+ ignore_char:
+#endif
+
/* This BD is ready to be used again. Clear status.
* Get next BD.
*/
@@ -475,7 +513,36 @@
schedule_delayed_work(&tty->flip.work, 1);
}
-static _INLINE_ void transmit_chars(ser_info_t *info)
+static _INLINE_ void receive_break(ser_info_t *info, struct pt_regs *regs)
+{
+ struct tty_struct *tty = info->tty;
+
+ info->state->icount.brk++;
+
+#if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+ if (info->line == sercons.index) {
+ if (!break_pressed) {
+ break_pressed = jiffies;
+ return;
+ } else
+ break_pressed = 0;
+ }
+#endif
+
+ /* Check to see if there is room in the tty buffer for
+ * the break. If not, we exit now, losing the break. FIXME
+ */
+ if ((tty->flip.count + 1) >= TTY_FLIPBUF_SIZE)
+ return;
+ *(tty->flip.flag_buf_ptr++) = TTY_BREAK;
+ *(tty->flip.char_buf_ptr++) = 0;
+ tty->flip.count++;
+
+ queue_task(&tty->flip.tqueue, &tq_timer);
+}
+
+
+static _INLINE_ void transmit_chars(ser_info_t *info, struct pt_regs *regs)
{
if (info->flags & TX_WAKEUP) {
@@ -575,19 +642,23 @@
if ((idx = info->state->smc_scc_num) < SCC_NUM_BASE) {
smcp = &immr->im_smc[idx];
events = smcp->smc_smce;
+ if (events & SMCM_BRKE)
+ receive_break(info, regs);
if (events & SMCM_RX)
- receive_chars(info);
+ receive_chars(info, regs);
if (events & SMCM_TX)
- transmit_chars(info);
+ transmit_chars(info, regs);
smcp->smc_smce = events;
}
else {
sccp = &immr->im_scc[idx - SCC_IDX_BASE];
events = sccp->scc_scce;
+ if (events & SMCM_BRKE)
+ receive_break(info, regs);
if (events & SCCM_RX)
- receive_chars(info);
+ receive_chars(info, regs);
if (events & SCCM_TX)
- transmit_chars(info);
+ transmit_chars(info, regs);
sccp->scc_scce = events;
}
@@ -2207,7 +2278,7 @@
static void serial_console_write(struct console *c, const char *s,
unsigned count)
{
-#if defined(CONFIG_KGDB) && !defined(CONFIG_USE_SERIAL2_KGDB)
+#if defined(CONFIG_KGDB_CONSOLE) && !defined(CONFIG_USE_SERIAL2_KGDB)
/* Try to let stub handle output. Returns true if it did. */
if (kgdb_output_string(s, count))
return;
@@ -2391,21 +2462,11 @@
}
#endif
-static kdev_t serial_console_device(struct console *c)
+static struct tty_driver *serial_console_device(struct console *c, int *index)
{
*index = c->index;
return serial_driver;
}
-
-
-static struct console sercons = {
- .name = "ttyS",
- .write = serial_console_write,
- .device = serial_console_device,
- .setup = serial_console_setup,
- .flags = CON_PRINTBUFFER,
- .index = CONFIG_SERIAL_CONSOLE_PORT,
-};
/*
* Register console.
diff -Nru a/arch/ppc/8xx_io/cs4218_tdm.c b/arch/ppc/8xx_io/cs4218_tdm.c
--- a/arch/ppc/8xx_io/cs4218_tdm.c Tue Jul 15 10:01:29 2003
+++ b/arch/ppc/8xx_io/cs4218_tdm.c Tue Aug 26 09:25:40 2003
@@ -2106,11 +2106,11 @@
*/
cs4218_ctl_write(cs4218_control);
- sound.minDev = MINOR(inode->i_rdev) & 0x0f;
+ sound.minDev = iminor(inode) & 0x0f;
sound.soft = sound.dsp;
sound.hard = sound.dsp;
sound_init();
- if ((MINOR(inode->i_rdev) & 0x0f) == SND_DEV_AUDIO) {
+ if ((iminor(inode) & 0x0f) == SND_DEV_AUDIO) {
sound_set_speed(8000);
sound_set_stereo(0);
sound_set_format(AFMT_MU_LAW);
diff -Nru a/arch/ppc/8xx_io/uart.c b/arch/ppc/8xx_io/uart.c
--- a/arch/ppc/8xx_io/uart.c Wed Jun 11 12:32:54 2003
+++ b/arch/ppc/8xx_io/uart.c Thu Aug 21 15:10:37 2003
@@ -1068,7 +1068,7 @@
volatile cbd_t *bdp;
unsigned char *cp;
-#ifdef CONFIG_KGDB
+#ifdef CONFIG_KGDB_CONSOLE
/* Try to let stub handle output. Returns true if it did. */
if (kgdb_output_string(buf, count))
return ret;
@@ -2271,7 +2271,7 @@
static void serial_console_write(struct console *c, const char *s,
unsigned count)
{
-#ifdef CONFIG_KGDB
+#ifdef CONFIG_KGDB_CONSOLE
/* Try to let stub handle output. Returns true if it did. */
if (kgdb_output_string(s, count))
return;
diff -Nru a/arch/ppc/Kconfig b/arch/ppc/Kconfig
--- a/arch/ppc/Kconfig Mon Aug 4 16:10:57 2003
+++ b/arch/ppc/Kconfig Sun Aug 31 16:14:22 2003
@@ -795,22 +795,6 @@
bool "PCI for Permedia2"
depends on !4xx && !8xx && APUS
-# only elf supported, a.out is not -- Cort
-config KCORE_ELF
- bool
- depends on PROC_FS
- default y
- help
- If you enabled support for /proc file system then the file
- /proc/kcore will contain the kernel core image in ELF format. This
- can be used in gdb:
-
- $ cd /usr/src/linux ; gdb vmlinux /proc/kcore
-
- This is especially useful if you have compiled the kernel with the
- "-g" option to preserve debugging information. It is mainly used
- for examining kernel data structures on the live kernel.
-
config KERNEL_ELF
bool
default y
@@ -1277,16 +1261,11 @@
floppy controller, say Y here. Most commonly found in PowerMacs.
config MAC_SERIAL
- tristate "Support for PowerMac serial ports"
+ tristate "Support for PowerMac serial ports (OBSOLETE DRIVER)"
depends on PPC_PMAC
help
- If you have Macintosh style serial ports (8 pin mini-DIN), say Y
- here. If you also have regular serial ports and enable the driver
- for them, you can't currently use the serial console feature.
-
-config SERIAL_CONSOLE
- bool "Support for console on serial port"
- depends on PPC_PMAC && MAC_SERIAL=y
+ This driver is obsolete. Use CONFIG_SERIAL_PMACZILOG in
+ "Character devices --> Serial drivers --> PowerMac z85c30" option.
config ADB
bool "Apple Desktop Bus (ADB) support"
@@ -1426,20 +1405,12 @@
config KGDB
bool "Include kgdb kernel debugger"
depends on DEBUG_KERNEL
+ select DEBUG_INFO
help
Include in-kernel hooks for kgdb, the Linux kernel source level
debugger. See for more information.
Unless you are intending to debug the kernel, say N here.
-config DEBUG_INFO
- bool "Compile the kernel with debug info"
- depends on DEBUG_KERNEL
- help
- If you say Y here the resulting kernel image will include
- debugging info resulting in a larger kernel image.
- Say Y here only if you plan to use gdb to debug the kernel.
- If you don't debug the kernel, you can say N.
-
choice
prompt "Serial Port"
depends on KGDB
@@ -1459,6 +1430,14 @@
endchoice
+config KGDB_CONSOLE
+ bool "Enable serial console thru kgdb port"
+ depends on KGDB && 8xx || 8260
+ help
+ If you enable this, all serial console messages will be sent
+ over the gdb stub.
+ If unsure, say N.
+
config XMON
bool "Include xmon kernel debugger"
depends on DEBUG_KERNEL
@@ -1474,18 +1453,16 @@
Unless you are intending to debug the kernel with one of these
machines, say N here.
-config MORE_COMPILE_OPTIONS
- bool "Add any additional compile options"
- depends on DEBUG_KERNEL && (KGDB || XMON || BDI_SWITCH)
- help
- If you want to add additional CFLAGS to the kernel build, such as -g
- for KGDB or the BDI2000, enable this option and then enter what you
- would like to add in the next question.
-
-config COMPILE_OPTIONS
- string "Additional compile arguments"
- depends on MORE_COMPILE_OPTIONS
- default "-g -ggdb"
+config DEBUG_INFO
+ bool "Compile the kernel with debug info"
+ depends on DEBUG_KERNEL
+ default y if BDI_SWITCH || XMON
+ help
+ If you say Y here the resulting kernel image will include
+ debugging info resulting in a larger kernel image.
+ Say Y here only if you plan to use some sort of debugger to
+ debug the kernel.
+ If you don't debug the kernel, you can say N.
config BOOTX_TEXT
bool "Support for early boot text console (BootX or OpenFirmware only)"
diff -Nru a/arch/ppc/Makefile b/arch/ppc/Makefile
--- a/arch/ppc/Makefile Sun Jul 27 15:52:30 2003
+++ b/arch/ppc/Makefile Thu Aug 21 15:10:37 2003
@@ -22,9 +22,6 @@
cflags-$(CONFIG_4xx) += -Wa,-m405
cflags-$(CONFIG_PPC64BRIDGE) += -Wa,-mppc64bridge
-# Use sed to remove the quotes.
-cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \
- $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g')
CFLAGS += $(cflags-y)
diff -Nru a/arch/ppc/boot/common/ns16550.c b/arch/ppc/boot/common/ns16550.c
--- a/arch/ppc/boot/common/ns16550.c Sat Jun 28 11:06:53 2003
+++ b/arch/ppc/boot/common/ns16550.c Wed Aug 20 10:24:16 2003
@@ -60,7 +60,7 @@
else {
/* Input clock. */
outb(com_port + (UART_DLL << shift),
- (BASE_BAUD / SERIAL_BAUD));
+ (BASE_BAUD / SERIAL_BAUD) & 0xFF);
outb(com_port + (UART_DLM << shift),
(BASE_BAUD / SERIAL_BAUD) >> 8);
/* 8 data, 1 stop, no parity */
diff -Nru a/arch/ppc/boot/common/util.S b/arch/ppc/boot/common/util.S
--- a/arch/ppc/boot/common/util.S Tue Feb 25 11:37:43 2003
+++ b/arch/ppc/boot/common/util.S Thu Aug 21 10:17:00 2003
@@ -160,9 +160,22 @@
blr
+/* udelay (on non-601 processors) needs to know the period of the
+ * timebase in nanoseconds. This used to be hardcoded to be 60ns
+ * (period of 66MHz/4). Now a variable is used that is initialized to
+ * 60 for backward compatibility, but it can be overridden as necessary
+ * with code something like this:
+ * extern unsigned long timebase_period_ns;
+ * timebase_period_ns = 1000000000 / bd->bi_tbfreq;
+ */
+ .data
+ .globl timebase_period_ns
+timebase_period_ns:
+ .long 60
+
+ .text
/*
* Delay for a number of microseconds
- * -- Use the BUS timer (assumes 66MHz)
*/
.globl udelay
udelay:
@@ -180,8 +193,13 @@
.udelay_not_601:
mulli r4,r3,1000 /* nanoseconds */
- addi r4,r4,59
- li r5,60
+ /* Change r4 to be the number of ticks using:
+ * (nanoseconds + (timebase_period_ns - 1 )) / timebase_period_ns
+ * timebase_period_ns defaults to 60 (16.6MHz) */
+ lis r5,timebase_period_ns@h
+ lwz r5,timebase_period_ns@l(r5)
+ addi r4,r4,r5
+ addi r4,r4,-1
divw r4,r4,r5 /* BUS ticks */
1: mftbu r5
mftb r6
diff -Nru a/arch/ppc/boot/include/of1275.h b/arch/ppc/boot/include/of1275.h
--- a/arch/ppc/boot/include/of1275.h Mon Sep 16 21:58:06 2002
+++ b/arch/ppc/boot/include/of1275.h Mon Aug 25 05:13:38 2003
@@ -20,6 +20,7 @@
/* function declarations */
void * claim(unsigned int virt, unsigned int size, unsigned int align);
+int map(unsigned int phys, unsigned int virt, unsigned int size);
void enter(void);
void exit(void);
phandle finddevice(const char *name);
diff -Nru a/arch/ppc/boot/ld.script b/arch/ppc/boot/ld.script
--- a/arch/ppc/boot/ld.script Thu May 29 04:06:53 2003
+++ b/arch/ppc/boot/ld.script Mon Aug 25 05:13:38 2003
@@ -66,7 +66,7 @@
_edata = .;
PROVIDE (edata = .);
- . = ALIGN(8);
+ . = ALIGN(4096);
__bss_start = .;
.bss :
{
diff -Nru a/arch/ppc/boot/of1275/Makefile b/arch/ppc/boot/of1275/Makefile
--- a/arch/ppc/boot/of1275/Makefile Sun Jun 8 01:12:49 2003
+++ b/arch/ppc/boot/of1275/Makefile Mon Aug 25 09:36:40 2003
@@ -3,4 +3,4 @@
#
lib-y := claim.o enter.o exit.o finddevice.o getprop.o ofinit.o \
- ofstdio.o read.o release.o write.o
+ ofstdio.o read.o release.o write.o map.o
diff -Nru a/arch/ppc/boot/of1275/map.c b/arch/ppc/boot/of1275/map.c
--- /dev/null Wed Dec 31 16:00:00 1969
+++ b/arch/ppc/boot/of1275/map.c Mon Aug 25 09:36:40 2003
@@ -0,0 +1,50 @@
+
+/*
+ * Copyright (C) Paul Mackerras 1997.
+ * Copyright (C) Leigh Brown 2002.
+ *
+ * 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.
+ */
+
+#include "of1275.h"
+#include "nonstdio.h"
+
+extern ihandle of_prom_mmu;
+
+int
+map(unsigned int phys, unsigned int virt, unsigned int size)
+{
+ struct prom_args {
+ char *service;
+ int nargs;
+ int nret;
+ char *method;
+ ihandle mmu_ihandle;
+ int misc;
+ unsigned int phys;
+ unsigned int virt;
+ unsigned int size;
+ int ret0;
+ int ret1;
+ } args;
+
+ if (of_prom_mmu == 0) {
+ printf("map() called, no MMU found\n");
+ return -1;
+ }
+ args.service = "call-method";
+ args.nargs = 6;
+ args.nret = 2;
+ args.method = "map";
+ args.mmu_ihandle = of_prom_mmu;
+ args.misc = -1;
+ args.phys = phys;
+ args.virt = virt;
+ args.size = size;
+ (*of_prom_entry)(&args);
+
+ return (int)args.ret0;
+}
diff -Nru a/arch/ppc/boot/of1275/ofinit.c b/arch/ppc/boot/of1275/ofinit.c
--- a/arch/ppc/boot/of1275/ofinit.c Mon Sep 16 22:18:13 2002
+++ b/arch/ppc/boot/of1275/ofinit.c Mon Aug 25 05:13:38 2003
@@ -11,9 +11,17 @@
#include "of1275.h"
prom_entry of_prom_entry;
+ihandle of_prom_mmu;
void
ofinit(prom_entry prom_ptr)
{
+ phandle chosen;
+
of_prom_entry = prom_ptr;
+
+ if ((chosen = finddevice("/chosen")) == OF_INVALID_HANDLE)
+ return;
+ if (getprop(chosen, "mmu", &of_prom_mmu, sizeof(ihandle)) != 4)
+ return;
}
diff -Nru a/arch/ppc/boot/openfirmware/Makefile b/arch/ppc/boot/openfirmware/Makefile
--- a/arch/ppc/boot/openfirmware/Makefile Wed Jul 23 08:39:58 2003
+++ b/arch/ppc/boot/openfirmware/Makefile Mon Aug 25 05:13:38 2003
@@ -22,7 +22,7 @@
images := $(boot)/images
OBJCOPY_ARGS := -O aixcoff-rs6000 -R .stab -R .stabstr -R .comment
-COFF_LD_ARGS := -T $(boot)/ld.script -e _start -Ttext 0x00700000 -Bstatic
+COFF_LD_ARGS := -T $(boot)/ld.script -e _start -Ttext 0x00500000 -Bstatic
CHRP_LD_ARGS := -T $(boot)/ld.script -e _start -Ttext 0x00800000
NEWWORLD_LD_ARGS:= -T $(boot)/ld.script -e _start -Ttext 0x01000000
diff -Nru a/arch/ppc/boot/openfirmware/coffmain.c b/arch/ppc/boot/openfirmware/coffmain.c
--- a/arch/ppc/boot/openfirmware/coffmain.c Thu Nov 7 03:31:11 2002
+++ b/arch/ppc/boot/openfirmware/coffmain.c Mon Aug 25 05:13:38 2003
@@ -32,16 +32,16 @@
char *begin_avail, *end_avail;
char *avail_high;
-#define RAM_START 0
-#define RAM_END (RAM_START + 0x800000) /* only 8M mapped with BATs */
-
-#define PROG_START RAM_START
-#define PROG_SIZE 0x00700000
-
#define SCRATCH_SIZE (128 << 10)
static char heap[SCRATCH_SIZE];
+static unsigned long ram_start = 0;
+static unsigned long ram_end = 0x1000000;
+static unsigned long prog_start = 0x800000;
+static unsigned long prog_size = 0x800000;
+
+
typedef void (*kernel_start_t)(int, int, void *);
void boot(int a1, int a2, void *prom)
@@ -52,32 +52,34 @@
unsigned initrd_start, initrd_size;
printf("coffboot starting: loaded at 0x%p\n", &_start);
- setup_bats(RAM_START);
+ setup_bats(ram_start);
initrd_size = (char *)(&__ramdisk_end) - (char *)(&__ramdisk_begin);
if (initrd_size) {
- initrd_start = (RAM_END - initrd_size) & ~0xFFF;
+ initrd_start = (ram_end - initrd_size) & ~0xFFF;
a1 = initrd_start;
a2 = initrd_size;
- claim(initrd_start, RAM_END - initrd_start, 0);
+ claim(initrd_start, ram_end - initrd_start, 0);
printf("initial ramdisk moving 0x%x <- 0x%p (%x bytes)\n\r",
initrd_start, (char *)(&__ramdisk_begin), initrd_size);
memcpy((char *)initrd_start, (char *)(&__ramdisk_begin), initrd_size);
+ prog_size = initrd_start - prog_start;
} else
a2 = 0xdeadbeef;
im = (char *)(&__image_begin);
len = (char *)(&__image_end) - (char *)(&__image_begin);
- /* claim 4MB starting at 0 */
- claim(0, PROG_SIZE, 0);
- dst = (void *) RAM_START;
+ /* claim 4MB starting at PROG_START */
+ claim(prog_start, prog_size, 0);
+ map(prog_start, prog_start, prog_size);
+ dst = (void *) prog_start;
if (im[0] == 0x1f && im[1] == 0x8b) {
/* set up scratch space */
begin_avail = avail_high = avail_ram = heap;
end_avail = heap + sizeof(heap);
printf("heap at 0x%p\n", avail_ram);
printf("gunzipping (0x%p <- 0x%p:0x%p)...", dst, im, im+len);
- gunzip(dst, PROG_SIZE, im, &len);
+ gunzip(dst, prog_size, im, &len);
printf("done %u bytes\n", len);
printf("%u bytes of heap consumed, max in use %u\n",
avail_high - begin_avail, heap_max);
@@ -87,9 +89,9 @@
flush_cache(dst, len);
make_bi_recs(((unsigned long) dst + len), "coffboot", _MACH_Pmac,
- (PROG_START + PROG_SIZE));
+ (prog_start + prog_size));
- sa = (unsigned long)PROG_START;
+ sa = (unsigned long)prog_start;
printf("start address = 0x%x\n", sa);
(*(kernel_start_t)sa)(a1, a2, prom);
diff -Nru a/arch/ppc/boot/openfirmware/misc.S b/arch/ppc/boot/openfirmware/misc.S
--- a/arch/ppc/boot/openfirmware/misc.S Mon Sep 16 21:54:12 2002
+++ b/arch/ppc/boot/openfirmware/misc.S Mon Aug 25 05:13:38 2003
@@ -9,7 +9,7 @@
.text
/*
- * Use the BAT3 registers to map the 1st 8MB of RAM to
+ * Use the BAT2 & 3 registers to map the 1st 16MB of RAM to
* the address given as the 1st argument.
*/
.globl setup_bats
@@ -22,6 +22,10 @@
mtibatl 3,0 /* invalidate BAT first */
ori 3,3,4 /* set up BAT registers for 601 */
li 4,0x7f
+ mtibatu 2,3
+ mtibatl 2,4
+ oris 3,3,0x80
+ oris 4,4,0x80
mtibatu 3,3
mtibatl 3,4
b 5f
@@ -29,6 +33,12 @@
mtibatu 3,0
ori 3,3,0xff /* set up BAT registers for 604 */
li 4,2
+ mtdbatl 2,4
+ mtdbatu 2,3
+ mtibatl 2,4
+ mtibatu 2,3
+ oris 3,3,0x80
+ oris 4,4,0x80
mtdbatl 3,4
mtdbatu 3,3
mtibatl 3,4
diff -Nru a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile
--- a/arch/ppc/boot/simple/Makefile Tue Jul 1 17:01:18 2003
+++ b/arch/ppc/boot/simple/Makefile Mon Aug 18 09:44:01 2003
@@ -22,7 +22,6 @@
# get_mem_size(), which is memory controller dependent. Add in the correct
# XXX_memory.o file for this to work, as well as editing the $(MISC) file.
-boot: zImage
boot := arch/ppc/boot
common := $(boot)/common
@@ -32,86 +31,90 @@
# Normally, we use the 'misc.c' file for decompress_kernel and
# whatnot. Sometimes we need to override this however.
-MISC := misc.o
-ifeq ($(CONFIG_IBM_OPENBIOS),y)
-ZIMAGE := zImage-TREE
-ZIMAGEINITRD := zImage.initrd-TREE
-END := treeboot
-TFTPIMAGE := /tftpboot/zImage.$(END)
-MISC := misc-embedded.o
-endif
-ifeq ($(CONFIG_EMBEDDEDBOOT),y)
-TFTPIMAGE := /tftpboot/zImage.embedded
-MISC := misc-embedded.o
-endif
-ifeq ($(CONFIG_EBONY),y)
-ZIMAGE := zImage-TREE
-ZIMAGEINITRD := zImage.initrd-TREE
-END := ebony
-ENTRYPOINT := 0x01000000
-TFTPIMAGE := /tftpboot/zImage.$(END)
-endif
-ifeq ($(CONFIG_EV64260),y)
-EXTRA := misc-ev64260.o
-TFTPIMAGE := /tftpboot/zImage.ev64260
-endif
-ifeq ($(CONFIG_GEMINI),y)
-ZIMAGE := zImage-STRIPELF
-ZIMAGEINITRD := zImage.initrd-STRIPELF
-END := gemini
-TFTPIMAGE := /tftpboot/zImage.$(END)
-endif
-ifeq ($(CONFIG_K2),y)
-EXTRA := legacy.o
-TFTPIMAGE := /tftpboot/zImage.k2
-endif
-# kbuild-2.4 'feature', only one of these will ever by 'y' at a time.
+misc-y := misc.o
+
+#
+# See arch/ppc/kconfig and arch/ppc/platforms/Kconfig
+# for definition of what platform each config option refer to.
+#----------------------------------------------------------------------------
+ zimage-$(CONFIG_IBM_OPENBIOS) := zImage-TREE
+zimageinitrd-$(CONFIG_IBM_OPENBIOS) := zImage.initrd-TREE
+ end-$(CONFIG_IBM_OPENBIOS) := treeboot
+ tftpimage-$(CONFIG_IBM_OPENBIOS) := /tftpboot/zImage.$(end-y)
+ misc-$(CONFIG_IBM_OPENBIOS) := misc-embedded.o
+
+ tftpimage-$(CONFIG_EMBEDDEDBOOT) := /tftpboot/zImage.embedded
+ misc-$(CONFIG_EMBEDDEDBOOT) := misc-embedded.o
+
+ zimage-$(CONFIG_EBONY) := zImage-TREE
+zimageinitrd-$(CONFIG_EBONY) := zImage.initrd-TREE
+ extra.o-$(CONFIG_EBONY) := direct.o
+ end-$(CONFIG_EBONY) := ebony
+ entrypoint-$(CONFIG_EBONY) := 0x01000000
+ tftpimage-$(CONFIG_EBONY) := /tftpboot/zImage.$(end-y)
+
+ extra.o-$(CONFIG_EV64260) := direct.o misc-ev64260.o
+ tftpimage-$(CONFIG_EV64260) := /tftpboot/zImage.ev64260
+
+ zimage-$(CONFIG_GEMINI) := zImage-STRIPELF
+zimageinitrd-$(CONFIG_GEMINI) := zImage.initrd-STRIPELF
+ end-$(CONFIG_GEMINI) := gemini
+ tftpimage-$(CONFIG_GEMINI) := /tftpboot/zImage.$(end-y)
+
+ extra.o-$(CONFIG_K2) := legacy.o
+ tftpimage-$(CONFIG_K2) := /tftpboot/zImage.k2
+
+# kconfig 'feature', only one of these will ever by 'y' at a time.
# The rest will be unset.
-ifeq ($(CONFIG_MCPN765)$(CONFIG_MVME5100)$(CONFIG_PRPMC750)$(CONFIG_PRPMC800)$(CONFIG_LOPEC)$(CONFIG_PPLUS),y)
-ZIMAGE := zImage-PPLUS
-ZIMAGEINITRD := zImage.initrd-PPLUS
-TFTPIMAGE := /tftpboot/zImage.pplus
-ZNETBOOT := zImage.pplus
-ZNETBOOTRD := zImage.initrd.pplus
-endif
-ifeq ($(CONFIG_PPLUS),y)
-EXTRA := legacy.o
-endif
-ifeq ($(CONFIG_PCORE)$(CONFIG_POWERPMC250),y)
-ZIMAGE := zImage-STRIPELF
-ZIMAGEINITRD := zImage.initrd-STRIPELF
-EXTRA := chrpmap.o
-END := pcore
-TFTPIMAGE := /tftpboot/zImage.$(END)
-endif
-ifeq ($(CONFIG_SANDPOINT),y)
-TFTPIMAGE := /tftpboot/zImage.sandpoint
-endif
-ifeq ($(CONFIG_SPRUCE),y)
-ZIMAGE := zImage-TREE
-ZIMAGEINITRD := zImage.initrd-TREE
-END := spruce
-ENTRYPOINT := 0x00800000
-MISC := misc-spruce.o
-TFTPIMAGE := /tftpboot/zImage.$(END)
-endif
-ifeq ($(CONFIG_SMP),y)
-TFTPIMAGE += .smp
-endif
-ifeq ($(CONFIG_REDWOOD_4),y)
+multi := $(CONFIG_MCPN765)$(CONFIG_MVME5100)$(CONFIG_PRPMC750) \
+$(CONFIG_PRPMC800)$(CONFIG_LOPEC)$(CONFIG_PPLUS)
+ zimage-$(multi) := zImage-PPLUS
+zimageinitrd-$(multi) := zImage.initrd-PPLUS
+ tftpimage-$(multi) := /tftpboot/zImage.pplus
+ znetboot-$(multi) := zImage.pplus
+ znetbootrd-$(multi) := zImage.initrd.pplus
+
+# Overrides previous assingment
+ extra.o-$(CONFIG_PPLUS) := legacy.o
+
+ zimage-$(CONFIG_PCORE) := zImage-STRIPELF
+zimageinitrd-$(CONFIG_PCORE) := zImage.initrd-STRIPELF
+ extra.o-$(CONFIG_PCORE) := chrpmap.o
+ end-$(CONFIG_PCORE) := pcore
+ tftpimage-$(CONFIG_PCORE) := /tftpboot/zImage.$(end-y)
+
+ zimage-$(CONFIG_POWERPMC250) := zImage-STRIPELF
+zimageinitrd-$(CONFIG_POWERPMC250) := zImage.initrd-STRIPELF
+ extra.o-$(CONFIG_POWERPMC250) := chrpmap.o
+ end-$(CONFIG_POWERPMC250) := pcore
+ tftpimage-$(CONFIG_POWERPMC250) := /tftpboot/zImage.$(end-y)
+
+ tftpimage-$(CONFIG_SANDPOINT) := /tftpboot/zImage.sandpoint
+
+ zimage-$(CONFIG_SPRUCE) := zImage-TREE
+zimageinitrd-$(CONFIG_SPRUCE) := zImage.initrd-TREE
+ end-$(CONFIG_SPRUCE) := spruce
+ entrypoint-$(CONFIG_SPRUCE) := 0x00800000
+ misc-$(CONFIG_SPRUCE) := misc-spruce.o
+ tftpimage-$(CONFIG_SPRUCE) := /tftpboot/zImage.$(end-y)
+
+
+# tftp image is prefixed with .smp if compiled for SMP
+tftpimage-$(CONFIG_SMP) += .smp
+
# This is a treeboot that needs init functions until the
# boot rom is sorted out (i.e. this is short lived)
-EXTRA_AFLAGS := -Wa,-m405
-EXTRA := rw4/rw4_init.o rw4/rw4_init_brd.o
-endif
+extra-aflags-$(CONFIG_REDWOOD_4) := -Wa,-m405
+extra.o-$(CONFIG_REDWOOD_4) := rw4/rw4_init.o rw4/rw4_init_brd.o
+EXTRA_AFLAGS := $(extra-aflags-y)
# Linker args. This specifies where the image will be run at.
-LD_ARGS = -T $(boot)/ld.script \
- -Ttext $(CONFIG_BOOT_LOAD) -Bstatic
+LD_ARGS := -T $(boot)/ld.script \
+ -Ttext $(CONFIG_BOOT_LOAD) -Bstatic
OBJCOPY_ARGS := -O elf32-powerpc
# head.o and relocate.o must be at the start.
-boot-y := head.o relocate.o $(EXTRA) $(MISC)
+boot-y := head.o relocate.o $(extra.o-y) $(misc-y)
boot-$(CONFIG_40x) += embed_config.o
boot-$(CONFIG_8xx) += embed_config.o
boot-$(CONFIG_8260) += embed_config.o
@@ -160,40 +163,40 @@
-R .stabstr -R .sysmap
# Sort-of dummy rules, that let us format the image we want.
-zImage: $(images)/$(ZIMAGE) $(obj)/zvmlinux
+zImage: $(images)/$(zimage-y) $(obj)/zvmlinux
cp -f $(obj)/zvmlinux $(images)/zImage.elf
rm -f $(obj)/zvmlinux
-zImage.initrd: $(images)/$(ZIMAGEINITRD) $(obj)/zvmlinux.initrd
+zImage.initrd: $(images)/$(zimageinitrd-y) $(obj)/zvmlinux.initrd
cp -f $(obj)/zvmlinux.initrd $(images)/zImage.initrd.elf
rm -f $(obj)/zvmlinux.initrd
znetboot: zImage
ifneq ($(ZNETBOOT),)
- cp $(images)/$(ZNETBOOT) $(TFTPIMAGE)
+ cp $(images)/$(ZNETBOOT) $(tftpimage-y)
else
- cp $(images)/zImage.* $(TFTPIMAGE)
+ cp $(images)/zImage.* $(tftpimage-y)
endif
znetboot.initrd: zImage.initrd
-ifneq ($(ZNETBOOTRD),)
- cp $(images)/$(ZNETBOOTRD) $(TFTPIMAGE)
+ifneq ($(znetbootrd-y),)
+ cp $(images)/$(znetbootrd-y) $(tftpimage-y)
else
- cp $(images)/zImage.* $(TFTPIMAGE)
+ cp $(images)/zImage.* $(tftpimage-y)
endif
$(images)/zImage-STRIPELF: $(obj)/zvmlinux
- dd if=$(obj)/zvmlinux of=$(images)/zImage.$(END) skip=64 bs=1k
+ dd if=$(obj)/zvmlinux of=$(images)/zImage.$(end-y) skip=64 bs=1k
$(images)/zImage.initrd-STRIPELF: $(obj)/zvmlinux.initrd
- dd if=$(obj)/zvmlinux.initrd of=$(images)/zImage.initrd.$(END) \
+ dd if=$(obj)/zvmlinux.initrd of=$(images)/zImage.initrd.$(end-y) \
skip=64 bs=1k
$(images)/zImage-TREE: $(obj)/zvmlinux $(MKTREE)
- $(MKTREE) $(obj)/zvmlinux $(images)/zImage.$(END) $(ENTRYPOINT)
+ $(MKTREE) $(obj)/zvmlinux $(images)/zImage.$(end-y) $(ENTRYPOINT)
$(images)/zImage.initrd-TREE: $(obj)/zvmlinux.initrd $(MKTREE)
- $(MKTREE) $(obj)/zvmlinux.initrd $(images)/zImage.initrd.$(END) \
+ $(MKTREE) $(obj)/zvmlinux.initrd $(images)/zImage.initrd.$(end-y) \
$(ENTRYPOINT)
$(images)/zImage-PPLUS: $(obj)/zvmlinux $(MKPREP) $(MKBUGBOOT)
diff -Nru a/arch/ppc/boot/simple/embed_config.c b/arch/ppc/boot/simple/embed_config.c
--- a/arch/ppc/boot/simple/embed_config.c Sat Mar 22 17:18:48 2003
+++ b/arch/ppc/boot/simple/embed_config.c Thu Aug 21 10:17:00 2003
@@ -20,6 +20,7 @@
#ifdef CONFIG_40x
#include
#endif
+extern unsigned long timebase_period_ns;
/* For those boards that don't provide one.
*/
@@ -768,6 +769,7 @@
#if defined(CONFIG_REDWOOD_5) || defined (CONFIG_REDWOOD_6)
bd->bi_tbfreq = 27 * 1000 * 1000;
#endif
+ timebase_period_ns = 1000000000 / bd->bi_tbfreq;
}
#endif /* CONFIG_BEECH */
#endif /* CONFIG_IBM_OPENBIOS */
diff -Nru a/arch/ppc/boot/simple/misc-embedded.c b/arch/ppc/boot/simple/misc-embedded.c
--- a/arch/ppc/boot/simple/misc-embedded.c Thu Jun 5 18:06:12 2003
+++ b/arch/ppc/boot/simple/misc-embedded.c Wed Aug 20 15:44:31 2003
@@ -75,7 +75,7 @@
extern void embed_config(bd_t **bp);
unsigned long
-decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum, bd_t *bp)
+load_kernel(unsigned long load_addr, int num_words, unsigned long cksum, bd_t *bp)
{
char *cp, ch;
int timer = 0, zimage_size;
diff -Nru a/arch/ppc/boot/simple/misc-spruce.c b/arch/ppc/boot/simple/misc-spruce.c
--- a/arch/ppc/boot/simple/misc-spruce.c Tue Feb 11 15:48:52 2003
+++ b/arch/ppc/boot/simple/misc-spruce.c Wed Aug 20 15:44:31 2003
@@ -147,7 +147,7 @@
#define MEM_B2EA 0x60
unsigned long
-decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
+load_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
{
int timer = 0;
char *cp, ch;
diff -Nru a/arch/ppc/boot/simple/misc.c b/arch/ppc/boot/simple/misc.c
--- a/arch/ppc/boot/simple/misc.c Tue Feb 11 15:48:52 2003
+++ b/arch/ppc/boot/simple/misc.c Wed Aug 20 15:44:31 2003
@@ -252,3 +252,10 @@
return (struct bi_record *)rec_loc;
}
+
+/* Allow decompress_kernel to be hooked into. This is the default. */
+void * __attribute__ ((weak))
+load_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
+{
+ return decompress_kernel(load_addr, num_words, cksum);
+}
diff -Nru a/arch/ppc/boot/simple/relocate.S b/arch/ppc/boot/simple/relocate.S
--- a/arch/ppc/boot/simple/relocate.S Tue Feb 11 15:48:52 2003
+++ b/arch/ppc/boot/simple/relocate.S Wed Aug 20 15:44:31 2003
@@ -183,7 +183,7 @@
mr r4,r7 /* Program length */
mr r5,r6 /* Checksum */
mr r6,r11 /* Residual data */
- bl decompress_kernel
+ bl load_kernel
/*
* Make sure the kernel knows we don't have things set in
diff -Nru a/arch/ppc/boot/utils/mktree.c b/arch/ppc/boot/utils/mktree.c
--- a/arch/ppc/boot/utils/mktree.c Sun Sep 15 21:51:58 2002
+++ b/arch/ppc/boot/utils/mktree.c Thu Aug 21 15:00:42 2003
@@ -86,7 +86,7 @@
}
cksum = 0;
- cp = (uint *)&bt;
+ cp = (void *)&bt;
for (i=0; i
#include
+#include
#include
#include
#include
@@ -136,7 +137,7 @@
/* typedef void (*trapfunc_t)(void); */
static void kgdb_fault_handler(struct pt_regs *regs);
-static void handle_exception (struct pt_regs *regs);
+static int handle_exception (struct pt_regs *regs);
#if 0
/* Install an exception handler for kgdb */
@@ -186,7 +187,7 @@
* return 0.
*/
static unsigned char *
-mem2hex(char *mem, char *buf, int count)
+mem2hex(const char *mem, char *buf, int count)
{
unsigned char ch;
unsigned short tmp_s;
@@ -460,14 +461,12 @@
int kgdb_bpt(struct pt_regs *regs)
{
- handle_exception(regs);
- return 1;
+ return handle_exception(regs);
}
int kgdb_sstep(struct pt_regs *regs)
{
- handle_exception(regs);
- return 1;
+ return handle_exception(regs);
}
void kgdb(struct pt_regs *regs)
@@ -477,16 +476,14 @@
int kgdb_iabr_match(struct pt_regs *regs)
{
- printk("kgdb doesn't support iabr, what?!?\n");
- handle_exception(regs);
- return 1;
+ printk(KERN_ERR "kgdb doesn't support iabr, what?!?\n");
+ return handle_exception(regs);
}
int kgdb_dabr_match(struct pt_regs *regs)
{
- printk("kgdb doesn't support dabr, what?!?\n");
- handle_exception(regs);
- return 1;
+ printk(KERN_ERR "kgdb doesn't support dabr, what?!?\n");
+ return handle_exception(regs);
}
/* Convert the hardware trap type code to a unix signal number. */
@@ -559,7 +556,7 @@
/*
* This function does all command processing for interfacing to gdb.
*/
-static void
+static int
handle_exception (struct pt_regs *regs)
{
int sigval;
@@ -568,14 +565,19 @@
char *ptr;
unsigned int msr;
+ /* We don't handle user-mode breakpoints. */
+ if (user_mode(regs))
+ return 0;
+
if (debugger_fault_handler) {
debugger_fault_handler(regs);
panic("kgdb longjump failed!\n");
}
if (kgdb_active) {
- printk("interrupt while in kgdb, returning\n");
- return;
+ printk(KERN_ERR "interrupt while in kgdb, returning\n");
+ return 0;
}
+
kgdb_active = 1;
kgdb_started = 1;
@@ -783,7 +785,7 @@
printk("remcomInBuffer: %s\n", remcomInBuffer);
printk("remcomOutBuffer: %s\n", remcomOutBuffer);
}
- return;
+ return 1;
case 's':
kgdb_flush_cache_all();
@@ -800,7 +802,7 @@
printk("remcomInBuffer: %s\n", remcomInBuffer);
printk("remcomOutBuffer: %s\n", remcomOutBuffer);
}
- return;
+ return 1;
case 'r': /* Reset (if user process..exit ???)*/
panic("kgdb reset.");
@@ -828,11 +830,11 @@
return;
}
- asm(" .globl breakinst
- breakinst: .long 0x7d821008
- ");
+ asm(" .globl breakinst \n\
+ breakinst: .long 0x7d821008");
}
+#ifdef CONFIG_KGDB_CONSOLE
/* Output string in GDB O-packet format if GDB has connected. If nothing
output, returns 0 (caller must then handle output). */
int
@@ -852,3 +854,4 @@
return 1;
}
+#endif
diff -Nru a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
--- a/arch/ppc/kernel/ppc_ksyms.c Tue Jul 1 10:57:22 2003
+++ b/arch/ppc/kernel/ppc_ksyms.c Sun Aug 24 03:57:52 2003
@@ -200,6 +200,7 @@
EXPORT_SYMBOL(flush_icache_user_range);
EXPORT_SYMBOL(flush_dcache_page);
EXPORT_SYMBOL(flush_tlb_kernel_range);
+EXPORT_SYMBOL(flush_tlb_page);
#ifdef CONFIG_ALTIVEC
EXPORT_SYMBOL(last_task_used_altivec);
EXPORT_SYMBOL(giveup_altivec);
@@ -259,6 +260,15 @@
EXPORT_SYMBOL(pci_busdev_to_OF_node);
EXPORT_SYMBOL(pci_device_to_OF_node);
EXPORT_SYMBOL(pci_device_from_OF_node);
+EXPORT_SYMBOL(of_find_node_by_name);
+EXPORT_SYMBOL(of_find_node_by_type);
+EXPORT_SYMBOL(of_find_compatible_node);
+EXPORT_SYMBOL(of_find_node_by_path);
+EXPORT_SYMBOL(of_find_all_nodes);
+EXPORT_SYMBOL(of_get_parent);
+EXPORT_SYMBOL(of_get_next_child);
+EXPORT_SYMBOL(of_node_get);
+EXPORT_SYMBOL(of_node_put);
#endif /* CONFIG_PPC_OF */
#if defined(CONFIG_BOOTX_TEXT)
EXPORT_SYMBOL(btext_update_display);
diff -Nru a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
--- a/arch/ppc/kernel/setup.c Mon Aug 18 19:46:23 2003
+++ b/arch/ppc/kernel/setup.c Mon Aug 25 11:11:43 2003
@@ -624,12 +624,10 @@
#if defined(CONFIG_KGDB)
kgdb_map_scc();
set_debug_traps();
- if (strstr(cmd_line, "nokgdb"))
- printk("kgdb default breakpoint deactivated on command line\n");
- else {
+ if (strstr(cmd_line, "gdb")) {
if (ppc_md.progress)
ppc_md.progress("setup_arch: kgdb breakpoint", 0x4000);
- printk("kgdb default breakpoint activated\n");
+ printk("kgdb breakpoint activated\n");
breakpoint();
}
#endif
diff -Nru a/arch/ppc/kernel/smp.c b/arch/ppc/kernel/smp.c
--- a/arch/ppc/kernel/smp.c Mon Aug 18 19:46:23 2003
+++ b/arch/ppc/kernel/smp.c Fri Aug 22 19:58:08 2003
@@ -47,8 +47,8 @@
DEFINE_PER_CPU(unsigned int, prof_multiplier);
DEFINE_PER_CPU(unsigned int, prof_counter);
unsigned long cache_decay_ticks = HZ/100;
-unsigned long cpu_online_map = cpumask_of_cpu(0);
-unsigned long cpu_possible_map = 1UL;
+cpumask_t cpu_online_map;
+cpumask_t cpu_possible_map;
int smp_hw_index[NR_CPUS];
struct thread_info *secondary_ti;
@@ -336,7 +336,7 @@
void __init smp_prepare_cpus(unsigned int max_cpus)
{
- int num_cpus;
+ int num_cpus, i;
/* Fixup boot cpu */
smp_store_cpu_info(smp_processor_id());
@@ -350,7 +350,8 @@
/* Probe platform for CPUs: always linear. */
num_cpus = smp_ops->probe();
- cpu_possible_map = (1 << num_cpus)-1;
+ for (i = 0; i < num_cpus; ++i)
+ cpu_set(i, cpu_possible_map);
/* Backup CPU 0 state */
__save_cpu_setup();
diff -Nru a/arch/ppc/kernel/syscalls.c b/arch/ppc/kernel/syscalls.c
--- a/arch/ppc/kernel/syscalls.c Tue Jul 15 04:49:49 2003
+++ b/arch/ppc/kernel/syscalls.c Fri Aug 22 19:15:18 2003
@@ -262,4 +262,14 @@
return error;
}
+/*
+ * We put the arguments in a different order so we only use 6
+ * registers for arguments, rather than 7 as sys_fadvise64_64 needs
+ * (because `offset' goes in r5/r6).
+ */
+long ppc_fadvise64_64(int fd, int advice, loff_t offset, loff_t len)
+{
+ return sys_fadvise64_64(fd, offset, len, advice);
+}
+
cond_syscall(sys_pciconfig_iobase);
diff -Nru a/arch/ppc/platforms/mcpn765_serial.h b/arch/ppc/platforms/mcpn765_serial.h
--- a/arch/ppc/platforms/mcpn765_serial.h Tue Feb 11 15:48:53 2003
+++ b/arch/ppc/platforms/mcpn765_serial.h Mon Jul 21 09:05:22 2003
@@ -30,7 +30,8 @@
#endif
/* Rate for the 1.8432 Mhz clock for the onboard serial chip */
-#define BASE_BAUD ( 1843200 / 16 )
+#define BASE_BAUD ( 1843200 / 16 )
+#define UART_CLK 1843200
#ifdef CONFIG_SERIAL_DETECT_IRQ
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST|ASYNC_AUTO_IRQ)
diff -Nru a/arch/ppc/platforms/mcpn765_setup.c b/arch/ppc/platforms/mcpn765_setup.c
--- a/arch/ppc/platforms/mcpn765_setup.c Wed Apr 23 00:49:34 2003
+++ b/arch/ppc/platforms/mcpn765_setup.c Mon Jul 21 09:05:22 2003
@@ -31,6 +31,9 @@
#include
#include
#include
+#include
+#include /* for linux/serial_core.h */
+#include
#include
#include
@@ -49,36 +52,94 @@
#include
#include "mcpn765.h"
+#include "mcpn765_serial.h"
+
static u_char mcpn765_openpic_initsenses[] __initdata = {
- 0, /* 16: i8259 cascade (active high) */
- 1, /* 17: COM1,2,3,4 */
- 1, /* 18: Enet 1 (front panel) */
- 1, /* 19: HAWK WDT XXXX */
- 1, /* 20: 21554 PCI-PCI bridge */
- 1, /* 21: cPCI INTA# */
- 1, /* 22: cPCI INTB# */
- 1, /* 23: cPCI INTC# */
- 1, /* 24: cPCI INTD# */
- 1, /* 25: PMC1 INTA#, PMC2 INTB# */
- 1, /* 26: PMC1 INTB#, PMC2 INTC# */
- 1, /* 27: PMC1 INTC#, PMC2 INTD# */
- 1, /* 28: PMC1 INTD#, PMC2 INTA# */
- 1, /* 29: Enet 2 (connected to J3) */
- 1, /* 30: Abort Switch */
- 1, /* 31: RTC Alarm */
+ (IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE),/* 16: i8259 cascade */
+ (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 17: COM1,2,3,4 */
+ (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 18: Enet 1 (front) */
+ (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 19: HAWK WDT XXXX */
+ (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 20: 21554 bridge */
+ (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 21: cPCI INTA# */
+ (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 22: cPCI INTB# */
+ (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 23: cPCI INTC# */
+ (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 24: cPCI INTD# */
+ (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 25: PMC1 INTA#,PMC2 INTB#*/
+ (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 26: PMC1 INTB#,PMC2 INTC#*/
+ (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 27: PMC1 INTC#,PMC2 INTD#*/
+ (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 28: PMC1 INTD#,PMC2 INTA#*/
+ (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 29: Enet 2 (J3) */
+ (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 30: Abort Switch */
+ (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 31: RTC Alarm */
};
extern u_int openpic_irq(void);
extern char cmd_line[];
+extern void gen550_progress(char *, unsigned short);
+extern void gen550_init(int, struct uart_port *);
+
int use_of_interrupt_tree = 0;
static void mcpn765_halt(void);
TODC_ALLOC();
+#if defined(CONFIG_SERIAL_8250) && \
+ (defined(CONFIG_KGDB) || defined(CONFIG_SERIAL_TEXT_DEBUG))
+static void __init
+mcpn765_early_serial_map(void)
+{
+ struct uart_port serial_req;
+
+ /* Setup serial port access */
+ memset(&serial_req, 0, sizeof(serial_req));
+ serial_req.uartclk = UART_CLK;
+ serial_req.irq = 17;
+ serial_req.flags = STD_COM_FLAGS;
+ serial_req.iotype = SERIAL_IO_MEM;
+ serial_req.membase = (u_char *)MCPN765_SERIAL_1;
+ serial_req.regshift = 4;
+
+ gen550_init(0, &serial_req);
+
+ if (early_serial_setup(&serial_req) != 0)
+ printk(KERN_ERR "Early serial init of port 0 failed\n");
+
+ /* Assume early_serial_setup() doesn't modify serial_req */
+ serial_req.line = 1;
+ serial_req.irq = 17;
+ serial_req.membase = (u_char *)MCPN765_SERIAL_2;
+
+ gen550_init(1, &serial_req);
+
+ if (early_serial_setup(&serial_req) != 0)
+ printk(KERN_ERR "Early serial init of port 1 failed\n");
+
+ /* Assume early_serial_setup() doesn't modify serial_req */
+ serial_req.line = 2;
+ serial_req.irq = 17;
+ serial_req.membase = (u_char *)MCPN765_SERIAL_3;
+
+ gen550_init(2, &serial_req);
+
+ if (early_serial_setup(&serial_req) != 0)
+ printk(KERN_ERR "Early serial init of port 2 failed\n");
+
+ /* Assume early_serial_setup() doesn't modify serial_req */
+ serial_req.line = 3;
+ serial_req.irq = 17;
+ serial_req.membase = (u_char *)MCPN765_SERIAL_4;
+
+ gen550_init(3, &serial_req);
+
+ if (early_serial_setup(&serial_req) != 0)
+ printk(KERN_ERR "Early serial init of port 3 failed\n");
+}
+#endif
+
static void __init
mcpn765_setup_arch(void)
{
@@ -187,12 +248,12 @@
if ( ppc_md.progress )
ppc_md.progress("init_irq: enter", 0);
- openpic_init(1, NUM_8259_INTERRUPTS, NULL, -1);
+ openpic_init(NUM_8259_INTERRUPTS);
for(i=0; i < NUM_8259_INTERRUPTS; i++)
irq_desc[i].handler = &i8259_pic;
- i8259_init(NULL);
+ i8259_init(0);
if ( ppc_md.progress )
ppc_md.progress("init_irq: exit", 0);
@@ -361,65 +422,15 @@
static __inline__ void
mcpn765_set_bat(void)
{
- unsigned long bat3u, bat3l;
- static int mapping_set = 0;
-
- if (!mapping_set) {
-
- __asm__ __volatile__(
- " lis %0,0xf000\n \
- ori %1,%0,0x002a\n \
- ori %0,%0,0x1ffe\n \
- mtspr 0x21e,%0\n \
- mtspr 0x21f,%1\n \
- isync\n \
- sync "
- : "=r" (bat3u), "=r" (bat3l));
-
- mapping_set = 1;
- }
-
- return;
-}
-
-#ifdef CONFIG_SERIAL_TEXT_DEBUG
-#include
-#include
-#include
-
-static struct serial_state rs_table[RS_TABLE_SIZE] = {
- SERIAL_PORT_DFNS /* Defined in */
-};
-
-static void
-mcpn765_progress(char *s, unsigned short hex)
-{
- volatile char c;
- volatile unsigned long com_port;
- u16 shift;
-
- com_port = rs_table[0].port;
- shift = rs_table[0].iomem_reg_shift;
-
- while ((c = *s++) != 0) {
- while ((*((volatile unsigned char *)com_port +
- (UART_LSR << shift)) & UART_LSR_THRE) == 0)
- ;
- *(volatile unsigned char *)com_port = c;
-
- if (c == '\n') {
- while ((*((volatile unsigned char *)com_port +
- (UART_LSR << shift)) & UART_LSR_THRE) == 0)
- ;
- *(volatile unsigned char *)com_port = '\r';
- }
- }
+ mb();
+ mtspr(DBAT1U, 0xfe8000fe);
+ mtspr(DBAT1L, 0xfe80002a);
+ mb();
}
-#endif /* CONFIG_SERIAL_TEXT_DEBUG */
void __init
platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
- unsigned long r6, unsigned long r7)
+ unsigned long r6, unsigned long r7)
{
parse_bootinfo(find_bootinfo());
@@ -458,11 +469,13 @@
ppc_md.heartbeat_reset = 0;
ppc_md.heartbeat_count = 0;
-#ifdef CONFIG_SERIAL_TEXT_DEBUG
- ppc_md.progress = mcpn765_progress;
-#else /* !CONFIG_SERIAL_TEXT_DEBUG */
- ppc_md.progress = NULL;
-#endif /* CONFIG_SERIAL_TEXT_DEBUG */
+#if defined(CONFIG_SERIAL_8250) && \
+ (defined(CONFIG_KGDB) || defined(CONFIG_SERIAL_TEXT_DEBUG))
+ mcpn765_early_serial_map();
+#ifdef CONFIG_SERIAL_TEXT_DEBUG
+ ppc_md.progress = gen550_progress;
+#endif
+#endif
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
ppc_ide_md.default_irq = mcpn765_ide_default_irq;
diff -Nru a/arch/ppc/platforms/pmac_cpufreq.c b/arch/ppc/platforms/pmac_cpufreq.c
--- a/arch/ppc/platforms/pmac_cpufreq.c Wed Jul 23 17:04:23 2003
+++ b/arch/ppc/platforms/pmac_cpufreq.c Mon Aug 25 09:51:43 2003
@@ -21,6 +21,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -31,12 +32,16 @@
#include
#include
+/* WARNING !!! This will cause calibrate_delay() to be called,
+ * but this is an __init function ! So you MUST go edit
+ * init/main.c to make it non-init before enabling DEBUG_FREQ
+ */
#undef DEBUG_FREQ
extern void low_choose_750fx_pll(int pll);
extern void low_sleep_handler(void);
-extern void openpic_sleep_save_intrs(void);
-extern void openpic_sleep_restore_intrs(void);
+extern void openpic_suspend(struct sys_device *sysdev, u32 state);
+extern void openpic_resume(struct sys_device *sysdev);
extern void enable_kernel_altivec(void);
extern void enable_kernel_fp(void);
@@ -116,10 +121,7 @@
printk(KERN_DEBUG "HID1, before: %x\n", mfspr(SPRN_HID1));
#endif
/* Disable all interrupt sources on openpic */
- openpic_sleep_save_intrs();
-
- /* Make sure the PMU is idle */
- pmu_suspend();
+ openpic_suspend(NULL, 1);
/* Make sure the decrementer won't interrupt us */
asm volatile("mtdec %0" : : "r" (0x7fffffff));
@@ -153,11 +155,16 @@
pmu_request(&req, NULL, 6, PMU_CPU_SPEED, 'W', 'O', 'O', 'F', low_speed);
while (!req.complete)
pmu_poll();
-
- pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,1,1);
+ /* Prepare the northbridge for the speed transition */
+ pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,1,1);
+
+ /* Call low level code to backup CPU state and recover from
+ * hardware reset
+ */
low_sleep_handler();
+ /* Restore the northbridge */
pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,1,0);
/* Restore L2 cache */
@@ -174,13 +181,14 @@
printk(KERN_DEBUG "HID1, after: %x\n", mfspr(SPRN_HID1));
#endif
+ /* Restore low level PMU operations */
+ pmu_unlock();
+
/* Restore decrementer */
wakeup_decrementer();
/* Restore interrupts */
- openpic_sleep_restore_intrs();
-
- pmu_resume();
+ openpic_resume(NULL);
/* Let interrupts flow again ... */
local_irq_enable();
@@ -195,13 +203,16 @@
static int __pmac
do_set_cpu_speed(int speed_mode)
{
- struct cpufreq_freqs freqs;
+ struct cpufreq_freqs freqs;
int rc;
freqs.old = cur_freq;
freqs.new = (speed_mode == PMAC_CPU_HIGH_SPEED) ? hi_freq : low_freq;
freqs.cpu = smp_processor_id();
+ if (freqs.old == freqs.new)
+ return 0;
+
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
if (cpufreq_uses_pmu)
rc = pmu_set_cpu_speed(speed_mode);
@@ -275,7 +286,10 @@
struct device_node *cpunode;
u32 *value;
int has_freq_ctl = 0;
-
+
+ if (strstr(cmd_line, "nocpufreq"))
+ return 0;
+
/* Assume only one CPU */
cpunode = find_type_devices("cpu");
if (!cpunode)
diff -Nru a/arch/ppc/platforms/pmac_pic.c b/arch/ppc/platforms/pmac_pic.c
--- a/arch/ppc/platforms/pmac_pic.c Wed Apr 30 05:41:43 2003
+++ b/arch/ppc/platforms/pmac_pic.c Sun Aug 24 04:12:57 2003
@@ -22,6 +22,9 @@
#include
#include
#include
+#include
+#include
+#include
#include
#include
@@ -506,7 +509,7 @@
#endif /* CONFIG_XMON */
}
-#ifdef CONFIG_PMAC_PBOOK
+#ifdef CONFIG_PM
/*
* These procedures are used in implementing sleep on the powerbooks.
* sleep_save_intrs() saves the states of all interrupt enables
@@ -515,9 +518,32 @@
*/
unsigned long sleep_save_mask[2];
-void __pmac
-pmac_sleep_save_intrs(int viaint)
+/* This used to be passed by the PMU driver but that link got
+ * broken with the new driver model. We use this tweak for now...
+ */
+static int pmacpic_find_viaint(void)
{
+ int viaint = -1;
+
+#ifdef CONFIG_ADB_PMU
+ struct device_node *np;
+
+ if (pmu_get_model() != PMU_OHARE_BASED)
+ goto not_found;
+ np = of_find_node_by_name(NULL, "via-pmu");
+ if (np == NULL)
+ goto not_found;
+ viaint = np->intrs[0].line;
+#endif /* CONFIG_ADB_PMU */
+
+not_found:
+ return viaint;
+}
+
+static int pmacpic_suspend(struct sys_device *sysdev, u32 state)
+{
+ int viaint = pmacpic_find_viaint();
+
sleep_save_mask[0] = ppc_cached_irq_mask[0];
sleep_save_mask[1] = ppc_cached_irq_mask[1];
ppc_cached_irq_mask[0] = 0;
@@ -531,10 +557,11 @@
/* make sure mask gets to controller before we return to caller */
mb();
(void)in_le32(&pmac_irq_hw[0]->enable);
+
+ return 0;
}
-void __pmac
-pmac_sleep_restore_intrs(void)
+static int pmacpic_resume(struct sys_device *sysdev)
{
int i;
@@ -545,5 +572,39 @@
for (i = 0; i < max_real_irqs; ++i)
if (test_bit(i, sleep_save_mask))
pmac_unmask_irq(i);
+
+ return 0;
}
-#endif /* CONFIG_PMAC_PBOOK */
+
+#endif /* CONFIG_PM */
+
+static struct sysdev_class pmacpic_sysclass = {
+ set_kset_name("pmac_pic"),
+};
+
+static struct sys_device device_pmacpic = {
+ .id = 0,
+ .cls = &pmacpic_sysclass,
+};
+
+static struct sysdev_driver driver_pmacpic = {
+#ifdef CONFIG_PM
+ .suspend = &pmacpic_suspend,
+ .resume = &pmacpic_resume,
+#endif /* CONFIG_PM */
+};
+
+static int __init init_pmacpic_sysfs(void)
+{
+ if (max_irqs == 0)
+ return -ENODEV;
+
+ printk(KERN_DEBUG "Registering pmac pic with sysfs...\n");
+ sysdev_class_register(&pmacpic_sysclass);
+ sys_device_register(&device_pmacpic);
+ sysdev_driver_register(&pmacpic_sysclass, &driver_pmacpic);
+ return 0;
+}
+
+subsys_initcall(init_pmacpic_sysfs);
+
diff -Nru a/arch/ppc/platforms/sandpoint.c b/arch/ppc/platforms/sandpoint.c
--- a/arch/ppc/platforms/sandpoint.c Tue Jul 1 10:56:46 2003
+++ b/arch/ppc/platforms/sandpoint.c Thu Aug 21 10:19:10 2003
@@ -357,6 +357,21 @@
}
/*
+ * Fix IDE interrupts.
+ */
+static int __init
+sandpoint_fix_winbond_83553(void)
+{
+ /* Make all 8259 interrupt level sensitive */
+ outb(0xf8, 0x4d0);
+ outb(0xde, 0x4d1);
+
+ return 0;
+}
+
+arch_initcall(sandpoint_fix_winbond_83553);
+
+/*
* Initialize the ISA devices on the Nat'l PC87308VUL SuperIO chip.
*/
static int __init
@@ -390,21 +405,6 @@
}
arch_initcall(sandpoint_setup_natl_87308);
-
-/*
- * Fix IDE interrupts.
- */
-static int __init
-sandpoint_fix_winbond_83553(void)
-{
- /* Make all 8259 interrupt level sensitive */
- outb(0xf8, 0x4d0);
- outb(0xde, 0x4d1);
-
- return 0;
-}
-
-arch_initcall(sandpoint_fix_winbond_83553);
static int __init
sandpoint_request_io(void)
diff -Nru a/arch/ppc/platforms/sandpoint.h b/arch/ppc/platforms/sandpoint.h
--- a/arch/ppc/platforms/sandpoint.h Tue Jul 1 10:56:46 2003
+++ b/arch/ppc/platforms/sandpoint.h Thu Aug 21 10:19:10 2003
@@ -61,9 +61,9 @@
#define UART_CLK 1843200
#ifdef CONFIG_SERIAL_DETECT_IRQ
-#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST|ASYNC_AUTO_IRQ)
+#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_AUTO_IRQ)
#else
-#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST)
+#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF)
#endif
#define STD_SERIAL_PORT_DFNS \
diff -Nru a/arch/ppc/syslib/of_device.c b/arch/ppc/syslib/of_device.c
--- a/arch/ppc/syslib/of_device.c Sat Aug 16 11:48:20 2003
+++ b/arch/ppc/syslib/of_device.c Tue Aug 26 06:35:38 2003
@@ -15,8 +15,8 @@
* Used by a driver to check whether an of_device present in the
* system is in its list of supported devices.
*/
-const struct of_match *
-of_match_device(const struct of_match *matches, const struct of_device *dev)
+const struct of_match * of_match_device(const struct of_match *matches,
+ const struct of_device *dev)
{
if (!dev->node)
return NULL;
@@ -38,8 +38,7 @@
return NULL;
}
-static int
-of_platform_bus_match(struct device *dev, struct device_driver *drv)
+static int of_platform_bus_match(struct device *dev, struct device_driver *drv)
{
struct of_device * of_dev = to_of_device(dev);
struct of_platform_driver * of_drv = to_of_platform_driver(drv);
@@ -51,21 +50,27 @@
return of_match_device(matches, of_dev) != NULL;
}
-struct bus_type of_platform_bus_type = {
- name: "of_platform",
- match: of_platform_bus_match,
-};
+struct of_device *of_dev_get(struct of_device *dev)
+{
+ struct device *tmp;
+
+ if (!dev)
+ return NULL;
+ tmp = get_device(&dev->dev);
+ if (tmp)
+ return to_of_device(tmp);
+ else
+ return NULL;
+}
-static int __init
-of_bus_driver_init(void)
+void of_dev_put(struct of_device *dev)
{
- return bus_register(&of_platform_bus_type);
+ if (dev)
+ put_device(&dev->dev);
}
-postcore_initcall(of_bus_driver_init);
-static int
-of_device_probe(struct device *dev)
+static int of_device_probe(struct device *dev)
{
int error = -ENODEV;
struct of_platform_driver *drv;
@@ -78,22 +83,18 @@
if (!drv->probe)
return error;
-/* if (!try_module_get(driver->owner)) {
- printk(KERN_ERR "Can't get a module reference for %s\n", driver->name);
- return error;
- }
-*/
+ of_dev_get(of_dev);
+
match = of_match_device(drv->match_table, of_dev);
if (match)
error = drv->probe(of_dev, match);
-/*
- module_put(driver->owner);
-*/
+ if (error)
+ of_dev_put(of_dev);
+
return error;
}
-static int
-of_device_remove(struct device *dev)
+static int of_device_remove(struct device *dev)
{
struct of_device * of_dev = to_of_device(dev);
struct of_platform_driver * drv = to_of_platform_driver(of_dev->dev.driver);
@@ -103,32 +104,43 @@
return 0;
}
-static int
-of_device_suspend(struct device *dev, u32 state, u32 level)
+static int of_device_suspend(struct device *dev, u32 state)
{
struct of_device * of_dev = to_of_device(dev);
struct of_platform_driver * drv = to_of_platform_driver(of_dev->dev.driver);
int error = 0;
if (drv && drv->suspend)
- error = drv->suspend(of_dev, state, level);
+ error = drv->suspend(of_dev, state);
return error;
}
-static int
-of_device_resume(struct device * dev, u32 level)
+static int of_device_resume(struct device * dev)
{
struct of_device * of_dev = to_of_device(dev);
struct of_platform_driver * drv = to_of_platform_driver(of_dev->dev.driver);
int error = 0;
if (drv && drv->resume)
- error = drv->resume(of_dev, level);
+ error = drv->resume(of_dev);
return error;
}
-int
-of_register_driver(struct of_platform_driver *drv)
+struct bus_type of_platform_bus_type = {
+ .name = "of_platform",
+ .match = of_platform_bus_match,
+ .suspend = of_device_suspend,
+ .resume = of_device_resume,
+};
+
+static int __init of_bus_driver_init(void)
+{
+ return bus_register(&of_platform_bus_type);
+}
+
+postcore_initcall(of_bus_driver_init);
+
+int of_register_driver(struct of_platform_driver *drv)
{
int count = 0;
@@ -136,8 +148,6 @@
drv->driver.name = drv->name;
drv->driver.bus = &of_platform_bus_type;
drv->driver.probe = of_device_probe;
- drv->driver.resume = of_device_resume;
- drv->driver.suspend = of_device_suspend;
drv->driver.remove = of_device_remove;
/* register with core */
@@ -145,15 +155,13 @@
return count ? count : 1;
}
-void
-of_unregister_driver(struct of_platform_driver *drv)
+void of_unregister_driver(struct of_platform_driver *drv)
{
driver_unregister(&drv->driver);
}
-static ssize_t
-dev_show_devspec(struct device *dev, char *buf)
+static ssize_t dev_show_devspec(struct device *dev, char *buf)
{
struct of_device *ofdev;
@@ -163,8 +171,22 @@
static DEVICE_ATTR(devspec, S_IRUGO, dev_show_devspec, NULL);
-int
-of_device_register(struct of_device *ofdev)
+/**
+ * of_release_dev - free an of device structure when all users of it are finished.
+ * @dev: device that's been disconnected
+ *
+ * Will be called only by the device core when all users of this of device are
+ * done.
+ */
+void of_release_dev(struct device *dev)
+{
+ struct of_device *ofdev;
+
+ ofdev = to_of_device(dev);
+ kfree(ofdev);
+}
+
+int of_device_register(struct of_device *ofdev)
{
int rc;
struct of_device **odprop;
@@ -197,21 +219,20 @@
return 0;
}
-void
-of_device_unregister(struct of_device *ofdev)
+void of_device_unregister(struct of_device *ofdev)
{
struct of_device **odprop;
device_remove_file(&ofdev->dev, &dev_attr_devspec);
- device_unregister(&ofdev->dev);
odprop = (struct of_device **)get_property(ofdev->node, "linux,device", NULL);
if (odprop)
*odprop = NULL;
+
+ device_unregister(&ofdev->dev);
}
-struct of_device*
-of_platform_device_create(struct device_node *np, const char *bus_id)
+struct of_device* of_platform_device_create(struct device_node *np, const char *bus_id)
{
struct of_device *dev;
u32 *reg;
@@ -226,6 +247,7 @@
dev->dev.dma_mask = &dev->dma_mask;
dev->dev.parent = NULL;
dev->dev.bus = &of_platform_bus_type;
+ dev->dev.release = of_release_dev;
reg = (u32 *)get_property(np, "reg", NULL);
strlcpy(dev->dev.bus_id, bus_id, BUS_ID_SIZE);
@@ -244,4 +266,7 @@
EXPORT_SYMBOL(of_unregister_driver);
EXPORT_SYMBOL(of_device_register);
EXPORT_SYMBOL(of_device_unregister);
+EXPORT_SYMBOL(of_dev_get);
+EXPORT_SYMBOL(of_dev_put);
EXPORT_SYMBOL(of_platform_device_create);
+EXPORT_SYMBOL(of_release_dev);
diff -Nru a/arch/ppc/syslib/open_pic.c b/arch/ppc/syslib/open_pic.c
--- a/arch/ppc/syslib/open_pic.c Tue Jul 15 10:01:29 2003
+++ b/arch/ppc/syslib/open_pic.c Sun Aug 24 04:11:21 2003
@@ -15,6 +15,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -276,7 +277,7 @@
}
#endif
-#if defined(CONFIG_EPIC_SERIAL_MODE) || defined(CONFIG_PMAC_PBOOK)
+#if defined(CONFIG_EPIC_SERIAL_MODE) || defined(CONFIG_PM)
static void openpic_reset(void)
{
openpic_setfield(&OpenPIC->Global.Global_Configuration0,
@@ -532,7 +533,7 @@
openpic_write(&OpenPIC->Global.Processor_Initialization, mask);
}
-#if defined(CONFIG_SMP) || defined(CONFIG_PMAC_PBOOK)
+#if defined(CONFIG_SMP) || defined(CONFIG_PM)
static spinlock_t openpic_setup_lock = SPIN_LOCK_UNLOCKED;
#endif
@@ -864,20 +865,55 @@
}
#endif /* CONFIG_SMP */
-#ifdef CONFIG_PMAC_PBOOK
+#ifdef CONFIG_PM
+
+/*
+ * We implement the IRQ controller as a sysdev and put it
+ * to sleep at powerdown stage (the callback is named suspend,
+ * but it's old semantics, for the Device Model, it's really
+ * powerdown). The possible problem is that another sysdev that
+ * happens to be suspend after this one will have interrupts off,
+ * that may be an issue... For now, this isn't an issue on pmac
+ * though...
+ */
+
static u32 save_ipi_vp[OPENPIC_NUM_IPI];
static u32 save_irq_src_vp[OPENPIC_MAX_SOURCES];
static u32 save_irq_src_dest[OPENPIC_MAX_SOURCES];
static u32 save_cpu_task_pri[OPENPIC_MAX_PROCESSORS];
+static int openpic_suspend_count;
+
+static void openpic_cached_enable_irq(u_int irq)
+{
+ check_arg_irq(irq);
+ save_irq_src_vp[irq - open_pic_irq_offset] &= ~OPENPIC_MASK;
+}
-void __pmac
-openpic_sleep_save_intrs(void)
+static void openpic_cached_disable_irq(u_int irq)
+{
+ check_arg_irq(irq);
+ save_irq_src_vp[irq - open_pic_irq_offset] |= OPENPIC_MASK;
+}
+
+/* WARNING: Can be called directly by the cpufreq code with NULL parameter,
+ * we need something better to deal with that... Maybe switch to S1 for
+ * cpufreq changes
+ */
+int openpic_suspend(struct sys_device *sysdev, u32 state)
{
int i;
unsigned long flags;
spin_lock_irqsave(&openpic_setup_lock, flags);
+ if (openpic_suspend_count++ > 0) {
+ spin_unlock_irqrestore(&openpic_setup_lock, flags);
+ return 0;
+ }
+
+ open_pic.enable = openpic_cached_enable_irq;
+ open_pic.disable = openpic_cached_disable_irq;
+
for (i=0; iProcessor[i].Current_Task_Priority);
openpic_writefield(&OpenPIC->Processor[i].Current_Task_Priority,
@@ -889,38 +925,112 @@
for (i=0; iVector_Priority)
- & ~OPENPIC_ACTIVITY;
+ save_irq_src_vp[i] = openpic_read(&ISR[i]->Vector_Priority) & ~OPENPIC_ACTIVITY;
save_irq_src_dest[i] = openpic_read(&ISR[i]->Destination);
}
+
spin_unlock_irqrestore(&openpic_setup_lock, flags);
+
+ return 0;
}
-void __pmac
-openpic_sleep_restore_intrs(void)
+/* WARNING: Can be called directly by the cpufreq code with NULL parameter,
+ * we need something better to deal with that... Maybe switch to S1 for
+ * cpufreq changes
+ */
+int openpic_resume(struct sys_device *sysdev)
{
int i;
unsigned long flags;
+ u32 vppmask = OPENPIC_PRIORITY_MASK | OPENPIC_VECTOR_MASK |
+ OPENPIC_SENSE_MASK | OPENPIC_POLARITY_MASK |
+ OPENPIC_MASK;
spin_lock_irqsave(&openpic_setup_lock, flags);
+ if ((--openpic_suspend_count) > 0) {
+ spin_unlock_irqrestore(&openpic_setup_lock, flags);
+ return 0;
+ }
+
openpic_reset();
+ /* OpenPIC sometimes seem to need some time to be fully back up... */
+ do {
+ openpic_set_spurious(OPENPIC_VEC_SPURIOUS+open_pic_irq_offset);
+ } while(openpic_readfield(&OpenPIC->Global.Spurious_Vector, OPENPIC_VECTOR_MASK)
+ != (OPENPIC_VEC_SPURIOUS + open_pic_irq_offset));
+
+ openpic_disable_8259_pass_through();
+
for (i=0; iGlobal.IPI_Vector_Priority(i),
save_ipi_vp[i]);
for (i=0; iVector_Priority, save_irq_src_vp[i]);
openpic_write(&ISR[i]->Destination, save_irq_src_dest[i]);
+ openpic_write(&ISR[i]->Vector_Priority, save_irq_src_vp[i]);
+ /* make sure mask gets to controller before we return to user */
+ do {
+ openpic_write(&ISR[i]->Vector_Priority, save_irq_src_vp[i]);
+ } while (openpic_readfield(&ISR[i]->Vector_Priority, vppmask)
+ != (save_irq_src_vp[i] & vppmask));
}
- openpic_set_spurious(OPENPIC_VEC_SPURIOUS+open_pic_irq_offset);
- openpic_disable_8259_pass_through();
for (i=0; iProcessor[i].Current_Task_Priority,
save_cpu_task_pri[i]);
+ open_pic.enable = openpic_enable_irq;
+ open_pic.disable = openpic_disable_irq;
+
spin_unlock_irqrestore(&openpic_setup_lock, flags);
+
+ return 0;
+}
+
+#endif /* CONFIG_PM */
+
+static struct sysdev_class openpic_sysclass = {
+ set_kset_name("openpic"),
+};
+
+static struct sys_device device_openpic = {
+ .id = 0,
+ .cls = &openpic_sysclass,
+};
+
+static struct sysdev_driver driver_openpic = {
+#ifdef CONFIG_PM
+ .suspend = &openpic_suspend,
+ .resume = &openpic_resume,
+#endif /* CONFIG_PM */
+};
+
+static int __init init_openpic_sysfs(void)
+{
+ int rc;
+
+ if (!OpenPIC_Addr)
+ return -ENODEV;
+ printk(KERN_DEBUG "Registering openpic with sysfs...\n");
+ rc = sysdev_class_register(&openpic_sysclass);
+ if (rc) {
+ printk(KERN_ERR "Failed registering openpic sys class\n");
+ return -ENODEV;
+ }
+ rc = sys_device_register(&device_openpic);
+ if (rc) {
+ printk(KERN_ERR "Failed registering openpic sys device\n");
+ return -ENODEV;
+ }
+ rc = sysdev_driver_register(&openpic_sysclass, &driver_openpic);
+ if (rc) {
+ printk(KERN_ERR "Failed registering openpic sys driver\n");
+ return -ENODEV;
+ }
+ return 0;
}
-#endif /* CONFIG_PMAC_PBOOK */
+
+subsys_initcall(init_openpic_sysfs);
+
diff -Nru a/arch/ppc/syslib/prom.c b/arch/ppc/syslib/prom.c
--- a/arch/ppc/syslib/prom.c Sat Jun 7 02:18:01 2003
+++ b/arch/ppc/syslib/prom.c Sun Aug 24 03:57:52 2003
@@ -941,6 +941,184 @@
return NULL;
}
+/*******
+ *
+ * New implementation of the OF "find" APIs, return a refcounted
+ * object, call of_node_put() when done. Currently, still lacks
+ * locking as old implementation, this is beeing done for ppc64.
+ *
+ * Note that property management will need some locking as well,
+ * this isn't dealt with yet
+ *
+ *******/
+
+/**
+ * of_find_node_by_name - Find a node by it's "name" property
+ * @from: The node to start searching from or NULL, the node
+ * you pass will not be searched, only the next one
+ * will; typically, you pass what the previous call
+ * returned. of_node_put() will be called on it
+ * @name: The name string to match against
+ *
+ * Returns a node pointer with refcount incremented, use
+ * of_node_put() on it when done.
+ */
+struct device_node *of_find_node_by_name(struct device_node *from,
+ const char *name)
+{
+ struct device_node *np = from ? from->allnext : allnodes;
+
+ for (; np != 0; np = np->allnext)
+ if (np->name != 0 && strcasecmp(np->name, name) == 0)
+ break;
+ if (from)
+ of_node_put(from);
+ return of_node_get(np);
+}
+
+/**
+ * of_find_node_by_type - Find a node by it's "device_type" property
+ * @from: The node to start searching from or NULL, the node
+ * you pass will not be searched, only the next one
+ * will; typically, you pass what the previous call
+ * returned. of_node_put() will be called on it
+ * @name: The type string to match against
+ *
+ * Returns a node pointer with refcount incremented, use
+ * of_node_put() on it when done.
+ */
+struct device_node *of_find_node_by_type(struct device_node *from,
+ const char *type)
+{
+ struct device_node *np = from ? from->allnext : allnodes;
+
+ for (; np != 0; np = np->allnext)
+ if (np->type != 0 && strcasecmp(np->type, type) == 0)
+ break;
+ if (from)
+ of_node_put(from);
+ return of_node_get(np);
+}
+
+/**
+ * of_find_compatible_node - Find a node based on type and one of the
+ * tokens in it's "compatible" property
+ * @from: The node to start searching from or NULL, the node
+ * you pass will not be searched, only the next one
+ * will; typically, you pass what the previous call
+ * returned. of_node_put() will be called on it
+ * @type: The type string to match "device_type" or NULL to ignore
+ * @compatible: The string to match to one of the tokens in the device
+ * "compatible" list.
+ *
+ * Returns a node pointer with refcount incremented, use
+ * of_node_put() on it when done.
+ */
+struct device_node *of_find_compatible_node(struct device_node *from,
+ const char *type, const char *compatible)
+{
+ struct device_node *np = from ? from->allnext : allnodes;
+
+ for (; np != 0; np = np->allnext) {
+ if (type != NULL
+ && !(np->type != 0 && strcasecmp(np->type, type) == 0))
+ continue;
+ if (device_is_compatible(np, compatible))
+ break;
+ }
+ if (from)
+ of_node_put(from);
+ return of_node_get(np);
+}
+
+/**
+ * of_find_node_by_path - Find a node matching a full OF path
+ * @path: The full path to match
+ *
+ * Returns a node pointer with refcount incremented, use
+ * of_node_put() on it when done.
+ */
+struct device_node *of_find_node_by_path(const char *path)
+{
+ struct device_node *np = allnodes;
+
+ for (; np != 0; np = np->allnext)
+ if (np->full_name != 0 && strcasecmp(np->full_name, path) == 0)
+ break;
+ return of_node_get(np);
+}
+
+/**
+ * of_find_all_nodes - Get next node in global list
+ * @prev: Previous node or NULL to start iteration
+ * of_node_put() will be called on it
+ *
+ * Returns a node pointer with refcount incremented, use
+ * of_node_put() on it when done.
+ */
+struct device_node *of_find_all_nodes(struct device_node *prev)
+{
+ return of_node_get(prev ? prev->allnext : allnodes);
+}
+
+/**
+ * of_get_parent - Get a node's parent if any
+ * @node: Node to get parent
+ *
+ * Returns a node pointer with refcount incremented, use
+ * of_node_put() on it when done.
+ */
+struct device_node *of_get_parent(const struct device_node *node)
+{
+ return node ? of_node_get(node->parent) : NULL;
+}
+
+/**
+ * of_get_next_child - Iterate a node childs
+ * @node: parent node
+ * @prev: previous child of the parent node, or NULL to get first
+ *
+ * Returns a node pointer with refcount incremented, use
+ * of_node_put() on it when done.
+ */
+struct device_node *of_get_next_child(const struct device_node *node,
+ struct device_node *prev)
+{
+ struct device_node *next = prev ? prev->sibling : node->child;
+
+ for (; next != 0; next = next->sibling)
+ if (of_node_get(next))
+ break;
+ if (prev)
+ of_node_put(prev);
+ return next;
+}
+
+/**
+ * of_node_get - Increment refcount of a node
+ * @node: Node to inc refcount, NULL is supported to
+ * simplify writing of callers
+ *
+ * Returns the node itself or NULL if gone. Current implementation
+ * does nothing as we don't yet do dynamic node allocation on ppc32
+ */
+struct device_node *of_node_get(struct device_node *node)
+{
+ return node;
+}
+
+/**
+ * of_node_put - Decrement refcount of a node
+ * @node: Node to dec refcount, NULL is supported to
+ * simplify writing of callers
+ *
+ * Current implementation does nothing as we don't yet do dynamic node
+ * allocation on ppc32
+ */
+void of_node_put(struct device_node *node)
+{
+}
+
/*
* Find the device_node with a given phandle.
*/
diff -Nru a/arch/ppc/xmon/start.c b/arch/ppc/xmon/start.c
--- a/arch/ppc/xmon/start.c Sat Jun 7 02:18:02 2003
+++ b/arch/ppc/xmon/start.c Sun Aug 24 07:39:33 2003
@@ -225,14 +225,13 @@
static int scc_initialized = 0;
void xmon_init_scc(void);
-extern void pmu_poll(void);
extern void cuda_poll(void);
static inline void do_poll_adb(void)
{
#ifdef CONFIG_ADB_PMU
if (sys_ctrler == SYS_CTRLER_PMU)
- pmu_poll();
+ pmu_poll_adb();
#endif /* CONFIG_ADB_PMU */
#ifdef CONFIG_ADB_CUDA
if (sys_ctrler == SYS_CTRLER_CUDA)
diff -Nru a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig
--- a/arch/ppc64/Kconfig Mon Aug 18 19:46:23 2003
+++ b/arch/ppc64/Kconfig Sun Aug 31 16:14:22 2003
@@ -175,22 +175,6 @@
bool
default PCI
-# only elf supported, a.out is not -- Cort
-config KCORE_ELF
- bool
- depends on PROC_FS
- default y
- help
- If you enabled support for /proc file system then the file
- /proc/kcore will contain the kernel core image in ELF format. This
- can be used in gdb:
-
- $ cd /usr/src/linux ; gdb vmlinux /proc/kcore
-
- This is especially useful if you have compiled the kernel with the
- "-g" option to preserve debugging information. It is mainly used
- for examining kernel data structures on the live kernel.
-
source "fs/Kconfig.binfmt"
source "drivers/pci/Kconfig"
diff -Nru a/arch/ppc64/kernel/ioctl32.c b/arch/ppc64/kernel/ioctl32.c
--- a/arch/ppc64/kernel/ioctl32.c Fri Aug 8 14:53:47 2003
+++ b/arch/ppc64/kernel/ioctl32.c Sun Aug 31 16:14:44 2003
@@ -725,7 +725,7 @@
#define IOCTL_TABLE_START \
struct ioctl_trans ioctl_start[] = {
#define IOCTL_TABLE_END \
- }; struct ioctl_trans ioctl_end[0];
+ };
IOCTL_TABLE_START
#include
@@ -763,3 +763,5 @@
HANDLE_IOCTL(USBDEVFS_REAPURBNDELAY32, do_usbdevfs_reapurb)
HANDLE_IOCTL(USBDEVFS_DISCSIGNAL32, do_usbdevfs_discsignal)
IOCTL_TABLE_END
+
+int ioctl_table_size = ARRAY_SIZE(ioctl_start);
diff -Nru a/arch/ppc64/kernel/proc_ppc64.c b/arch/ppc64/kernel/proc_ppc64.c
--- a/arch/ppc64/kernel/proc_ppc64.c Tue Mar 25 20:30:59 2003
+++ b/arch/ppc64/kernel/proc_ppc64.c Sun Aug 31 16:14:08 2003
@@ -47,9 +47,9 @@
static int page_map_mmap( struct file *file, struct vm_area_struct *vma );
static struct file_operations page_map_fops = {
- llseek: page_map_seek,
- read: page_map_read,
- mmap: page_map_mmap
+ .llseek = page_map_seek,
+ .read = page_map_read,
+ .mmap = page_map_mmap
};
diff -Nru a/arch/ppc64/kernel/scanlog.c b/arch/ppc64/kernel/scanlog.c
--- a/arch/ppc64/kernel/scanlog.c Thu Feb 13 00:47:26 2003
+++ b/arch/ppc64/kernel/scanlog.c Sun Aug 31 16:14:08 2003
@@ -190,11 +190,11 @@
}
struct file_operations scanlog_fops = {
- owner: THIS_MODULE,
- read: scanlog_read,
- write: scanlog_write,
- open: scanlog_open,
- release: scanlog_release,
+ .owner = THIS_MODULE,
+ .read = scanlog_read,
+ .write = scanlog_write,
+ .open = scanlog_open,
+ .release = scanlog_release,
};
int __init scanlog_init(void)
diff -Nru a/arch/s390/Kconfig b/arch/s390/Kconfig
--- a/arch/s390/Kconfig Mon Jul 21 13:25:16 2003
+++ b/arch/s390/Kconfig Sun Aug 31 16:14:22 2003
@@ -217,10 +217,6 @@
endchoice
-config KCORE_ELF
- bool
- default y
-
source "fs/Kconfig.binfmt"
config PROCESS_DEBUG
diff -Nru a/arch/s390/kernel/compat_ioctl.c b/arch/s390/kernel/compat_ioctl.c
--- a/arch/s390/kernel/compat_ioctl.c Tue May 27 12:34:41 2003
+++ b/arch/s390/kernel/compat_ioctl.c Sun Aug 31 16:14:44 2003
@@ -808,7 +808,7 @@
#define IOCTL_TABLE_START \
struct ioctl_trans ioctl_start[] = {
#define IOCTL_TABLE_END \
- }; struct ioctl_trans ioctl_end[0];
+ };
IOCTL_TABLE_START
#include
@@ -899,3 +899,5 @@
HANDLE_IOCTL(BLKPG, blkpg_ioctl_trans)
IOCTL_TABLE_END
+
+int ioctl_table_size = ARRAY_SIZE(ioctl_start);
diff -Nru a/arch/sh/Kconfig b/arch/sh/Kconfig
--- a/arch/sh/Kconfig Sat Aug 2 14:26:16 2003
+++ b/arch/sh/Kconfig Sun Aug 31 16:14:22 2003
@@ -729,40 +729,6 @@
menu "Executable file formats"
-choice
- prompt "Kernel core (/proc/kcore) format"
- depends on PROC_FS
- default KCORE_ELF
-
-config KCORE_ELF
- bool "ELF"
- ---help---
- If you enabled support for /proc file system then the file
- /proc/kcore will contain the kernel core image. This can be used
- in gdb:
-
- $ cd /usr/src/linux ; gdb vmlinux /proc/kcore
-
- You have two choices here: ELF and A.OUT. Selecting ELF will make
- /proc/kcore appear in ELF core format as defined by the Executable
- and Linking Format specification. Selecting A.OUT will choose the
- old "a.out" format which may be necessary for some old versions
- of binutils or on some architectures.
-
- This is especially useful if you have compiled the kernel with the
- "-g" option to preserve debugging information. It is mainly used
- for examining kernel data structures on the live kernel so if you
- don't understand what this means or are not a kernel hacker, just
- leave it at its default value ELF.
-
-config KCORE_AOUT
- bool "A.OUT"
- help
- Not necessary unless you're using a very out-of-date binutils
- version. You probably want KCORE_ELF.
-
-endchoice
-
source "fs/Kconfig.binfmt"
endmenu
diff -Nru a/arch/sh/boards/adx/mach.c b/arch/sh/boards/adx/mach.c
--- a/arch/sh/boards/adx/mach.c Mon May 19 16:04:36 2003
+++ b/arch/sh/boards/adx/mach.c Sun Aug 31 16:14:08 2003
@@ -24,41 +24,41 @@
*/
struct sh_machine_vector mv_adx __initmv = {
- mv_nr_irqs: 48,
+ .mv_nr_irqs = 48,
- mv_inb: adx_inb,
- mv_inw: adx_inw,
- mv_inl: adx_inl,
- mv_outb: adx_outb,
- mv_outw: adx_outw,
- mv_outl: adx_outl,
-
- mv_inb_p: adx_inb_p,
- mv_inw_p: adx_inw,
- mv_inl_p: adx_inl,
- mv_outb_p: adx_outb_p,
- mv_outw_p: adx_outw,
- mv_outl_p: adx_outl,
-
- mv_insb: adx_insb,
- mv_insw: adx_insw,
- mv_insl: adx_insl,
- mv_outsb: adx_outsb,
- mv_outsw: adx_outsw,
- mv_outsl: adx_outsl,
-
- mv_readb: adx_readb,
- mv_readw: adx_readw,
- mv_readl: adx_readl,
- mv_writeb: adx_writeb,
- mv_writew: adx_writew,
- mv_writel: adx_writel,
+ .mv_inb = adx_inb,
+ .mv_inw = adx_inw,
+ .mv_inl = adx_inl,
+ .mv_outb = adx_outb,
+ .mv_outw = adx_outw,
+ .mv_outl = adx_outl,
+
+ .mv_inb_p = adx_inb_p,
+ .mv_inw_p = adx_inw,
+ .mv_inl_p = adx_inl,
+ .mv_outb_p = adx_outb_p,
+ .mv_outw_p = adx_outw,
+ .mv_outl_p = adx_outl,
+
+ .mv_insb = adx_insb,
+ .mv_insw = adx_insw,
+ .mv_insl = adx_insl,
+ .mv_outsb = adx_outsb,
+ .mv_outsw = adx_outsw,
+ .mv_outsl = adx_outsl,
+
+ .mv_readb = adx_readb,
+ .mv_readw = adx_readw,
+ .mv_readl = adx_readl,
+ .mv_writeb = adx_writeb,
+ .mv_writew = adx_writew,
+ .mv_writel = adx_writel,
- mv_ioremap: adx_ioremap,
- mv_iounmap: adx_iounmap,
+ .mv_ioremap = adx_ioremap,
+ .mv_iounmap = adx_iounmap,
- mv_isa_port2addr: adx_isa_port2addr,
+ .mv_isa_port2addr = adx_isa_port2addr,
- mv_init_irq: init_adx_IRQ,
+ .mv_init_irq = init_adx_IRQ,
};
ALIAS_MV(adx)
diff -Nru a/arch/sh/boards/bigsur/mach.c b/arch/sh/boards/bigsur/mach.c
--- a/arch/sh/boards/bigsur/mach.c Sat Mar 2 08:57:07 2002
+++ b/arch/sh/boards/bigsur/mach.c Sun Aug 31 16:14:08 2003
@@ -28,44 +28,44 @@
extern void init_bigsur_IRQ(void);
struct sh_machine_vector mv_bigsur __initmv = {
- mv_nr_irqs: NR_IRQS, // Defined in
- mv_inb: bigsur_inb,
- mv_inw: bigsur_inw,
- mv_inl: bigsur_inl,
- mv_outb: bigsur_outb,
- mv_outw: bigsur_outw,
- mv_outl: bigsur_outl,
-
- mv_inb_p: bigsur_inb_p,
- mv_inw_p: bigsur_inw,
- mv_inl_p: bigsur_inl,
- mv_outb_p: bigsur_outb_p,
- mv_outw_p: bigsur_outw,
- mv_outl_p: bigsur_outl,
-
- mv_insb: bigsur_insb,
- mv_insw: bigsur_insw,
- mv_insl: bigsur_insl,
- mv_outsb: bigsur_outsb,
- mv_outsw: bigsur_outsw,
- mv_outsl: bigsur_outsl,
-
- mv_readb: generic_readb,
- mv_readw: generic_readw,
- mv_readl: generic_readl,
- mv_writeb: generic_writeb,
- mv_writew: generic_writew,
- mv_writel: generic_writel,
+ .mv_nr_irqs = NR_IRQS, // Defined in
+ .mv_inb = bigsur_inb,
+ .mv_inw = bigsur_inw,
+ .mv_inl = bigsur_inl,
+ .mv_outb = bigsur_outb,
+ .mv_outw = bigsur_outw,
+ .mv_outl = bigsur_outl,
+
+ .mv_inb_p = bigsur_inb_p,
+ .mv_inw_p = bigsur_inw,
+ .mv_inl_p = bigsur_inl,
+ .mv_outb_p = bigsur_outb_p,
+ .mv_outw_p = bigsur_outw,
+ .mv_outl_p = bigsur_outl,
+
+ .mv_insb = bigsur_insb,
+ .mv_insw = bigsur_insw,
+ .mv_insl = bigsur_insl,
+ .mv_outsb = bigsur_outsb,
+ .mv_outsw = bigsur_outsw,
+ .mv_outsl = bigsur_outsl,
+
+ .mv_readb = generic_readb,
+ .mv_readw = generic_readw,
+ .mv_readl = generic_readl,
+ .mv_writeb = generic_writeb,
+ .mv_writew = generic_writew,
+ .mv_writel = generic_writel,
- mv_ioremap: generic_ioremap,
- mv_iounmap: generic_iounmap,
+ .mv_ioremap = generic_ioremap,
+ .mv_iounmap = generic_iounmap,
- mv_isa_port2addr: bigsur_isa_port2addr,
- mv_irq_demux: bigsur_irq_demux,
+ .mv_isa_port2addr = bigsur_isa_port2addr,
+ .mv_irq_demux = bigsur_irq_demux,
- mv_init_irq: init_bigsur_IRQ,
+ .mv_init_irq = init_bigsur_IRQ,
#ifdef CONFIG_HEARTBEAT
- mv_heartbeat: heartbeat_bigsur,
+ .mv_heartbeat = heartbeat_bigsur,
#endif
};
diff -Nru a/arch/sh/boards/cat68701/mach.c b/arch/sh/boards/cat68701/mach.c
--- a/arch/sh/boards/cat68701/mach.c Sat Mar 2 08:57:07 2002
+++ b/arch/sh/boards/cat68701/mach.c Sun Aug 31 16:14:08 2003
@@ -23,44 +23,44 @@
*/
struct sh_machine_vector mv_cat68701 __initmv = {
- mv_nr_irqs: 32,
- mv_inb: cat68701_inb,
- mv_inw: cat68701_inw,
- mv_inl: cat68701_inl,
- mv_outb: cat68701_outb,
- mv_outw: cat68701_outw,
- mv_outl: cat68701_outl,
-
- mv_inb_p: cat68701_inb_p,
- mv_inw_p: cat68701_inw,
- mv_inl_p: cat68701_inl,
- mv_outb_p: cat68701_outb_p,
- mv_outw_p: cat68701_outw,
- mv_outl_p: cat68701_outl,
-
- mv_insb: cat68701_insb,
- mv_insw: cat68701_insw,
- mv_insl: cat68701_insl,
- mv_outsb: cat68701_outsb,
- mv_outsw: cat68701_outsw,
- mv_outsl: cat68701_outsl,
-
- mv_readb: cat68701_readb,
- mv_readw: cat68701_readw,
- mv_readl: cat68701_readl,
- mv_writeb: cat68701_writeb,
- mv_writew: cat68701_writew,
- mv_writel: cat68701_writel,
+ .mv_nr_irqs = 32,
+ .mv_inb = cat68701_inb,
+ .mv_inw = cat68701_inw,
+ .mv_inl = cat68701_inl,
+ .mv_outb = cat68701_outb,
+ .mv_outw = cat68701_outw,
+ .mv_outl = cat68701_outl,
+
+ .mv_inb_p = cat68701_inb_p,
+ .mv_inw_p = cat68701_inw,
+ .mv_inl_p = cat68701_inl,
+ .mv_outb_p = cat68701_outb_p,
+ .mv_outw_p = cat68701_outw,
+ .mv_outl_p = cat68701_outl,
+
+ .mv_insb = cat68701_insb,
+ .mv_insw = cat68701_insw,
+ .mv_insl = cat68701_insl,
+ .mv_outsb = cat68701_outsb,
+ .mv_outsw = cat68701_outsw,
+ .mv_outsl = cat68701_outsl,
+
+ .mv_readb = cat68701_readb,
+ .mv_readw = cat68701_readw,
+ .mv_readl = cat68701_readl,
+ .mv_writeb = cat68701_writeb,
+ .mv_writew = cat68701_writew,
+ .mv_writel = cat68701_writel,
- mv_ioremap: cat68701_ioremap,
- mv_iounmap: cat68701_iounmap,
+ .mv_ioremap = cat68701_ioremap,
+ .mv_iounmap = cat68701_iounmap,
- mv_isa_port2addr: cat68701_isa_port2addr,
- mv_irq_demux: cat68701_irq_demux,
+ .mv_isa_port2addr = cat68701_isa_port2addr,
+ .mv_irq_demux = cat68701_irq_demux,
- mv_init_irq: init_cat68701_IRQ,
+ .mv_init_irq = init_cat68701_IRQ,
#ifdef CONFIG_HEARTBEAT
- mv_heartbeat: heartbeat_cat68701,
+ .mv_heartbeat = heartbeat_cat68701,
#endif
};
ALIAS_MV(cat68701)
diff -Nru a/arch/sh/boards/cqreek/mach.c b/arch/sh/boards/cqreek/mach.c
--- a/arch/sh/boards/cqreek/mach.c Sat Jun 14 11:02:09 2003
+++ b/arch/sh/boards/cqreek/mach.c Sun Aug 31 16:14:08 2003
@@ -21,46 +21,46 @@
struct sh_machine_vector mv_cqreek __initmv = {
#if defined(CONFIG_CPU_SH4)
- mv_nr_irqs: 48,
+ .mv_nr_irqs = 48,
#elif defined(CONFIG_CPU_SUBTYPE_SH7708)
- mv_nr_irqs: 32,
+ .mv_nr_irqs = 32,
#elif defined(CONFIG_CPU_SUBTYPE_SH7709)
- mv_nr_irqs: 61,
+ .mv_nr_irqs = 61,
#endif
- mv_inb: generic_inb,
- mv_inw: generic_inw,
- mv_inl: generic_inl,
- mv_outb: generic_outb,
- mv_outw: generic_outw,
- mv_outl: generic_outl,
-
- mv_inb_p: generic_inb_p,
- mv_inw_p: generic_inw_p,
- mv_inl_p: generic_inl_p,
- mv_outb_p: generic_outb_p,
- mv_outw_p: generic_outw_p,
- mv_outl_p: generic_outl_p,
-
- mv_insb: generic_insb,
- mv_insw: generic_insw,
- mv_insl: generic_insl,
- mv_outsb: generic_outsb,
- mv_outsw: generic_outsw,
- mv_outsl: generic_outsl,
-
- mv_readb: generic_readb,
- mv_readw: generic_readw,
- mv_readl: generic_readl,
- mv_writeb: generic_writeb,
- mv_writew: generic_writew,
- mv_writel: generic_writel,
+ .mv_inb = generic_inb,
+ .mv_inw = generic_inw,
+ .mv_inl = generic_inl,
+ .mv_outb = generic_outb,
+ .mv_outw = generic_outw,
+ .mv_outl = generic_outl,
+
+ .mv_inb_p = generic_inb_p,
+ .mv_inw_p = generic_inw_p,
+ .mv_inl_p = generic_inl_p,
+ .mv_outb_p = generic_outb_p,
+ .mv_outw_p = generic_outw_p,
+ .mv_outl_p = generic_outl_p,
+
+ .mv_insb = generic_insb,
+ .mv_insw = generic_insw,
+ .mv_insl = generic_insl,
+ .mv_outsb = generic_outsb,
+ .mv_outsw = generic_outsw,
+ .mv_outsl = generic_outsl,
+
+ .mv_readb = generic_readb,
+ .mv_readw = generic_readw,
+ .mv_readl = generic_readl,
+ .mv_writeb = generic_writeb,
+ .mv_writew = generic_writew,
+ .mv_writel = generic_writel,
- mv_init_irq: init_cqreek_IRQ,
+ .mv_init_irq = init_cqreek_IRQ,
- mv_isa_port2addr: cqreek_port2addr,
+ .mv_isa_port2addr = cqreek_port2addr,
- mv_ioremap: generic_ioremap,
- mv_iounmap: generic_iounmap,
+ .mv_ioremap = generic_ioremap,
+ .mv_iounmap = generic_iounmap,
};
ALIAS_MV(cqreek)
diff -Nru a/arch/sh/boards/dmida/mach.c b/arch/sh/boards/dmida/mach.c
--- a/arch/sh/boards/dmida/mach.c Mon May 19 16:04:36 2003
+++ b/arch/sh/boards/dmida/mach.c Sun Aug 31 16:14:08 2003
@@ -30,42 +30,42 @@
*/
struct sh_machine_vector mv_dmida __initmv = {
- mv_name: "DMIDA",
+ .mv_name = "DMIDA",
- mv_nr_irqs: HD64465_IRQ_BASE+HD64465_IRQ_NUM,
+ .mv_nr_irqs = HD64465_IRQ_BASE+HD64465_IRQ_NUM,
- mv_inb: hd64465_inb,
- mv_inw: hd64465_inw,
- mv_inl: hd64465_inl,
- mv_outb: hd64465_outb,
- mv_outw: hd64465_outw,
- mv_outl: hd64465_outl,
-
- mv_inb_p: hd64465_inb_p,
- mv_inw_p: hd64465_inw,
- mv_inl_p: hd64465_inl,
- mv_outb_p: hd64465_outb_p,
- mv_outw_p: hd64465_outw,
- mv_outl_p: hd64465_outl,
-
- mv_insb: hd64465_insb,
- mv_insw: hd64465_insw,
- mv_insl: hd64465_insl,
- mv_outsb: hd64465_outsb,
- mv_outsw: hd64465_outsw,
- mv_outsl: hd64465_outsl,
-
- mv_readb: generic_readb,
- mv_readw: generic_readw,
- mv_readl: generic_readl,
- mv_writeb: generic_writeb,
- mv_writew: generic_writew,
- mv_writel: generic_writel,
+ .mv_inb = hd64465_inb,
+ .mv_inw = hd64465_inw,
+ .mv_inl = hd64465_inl,
+ .mv_outb = hd64465_outb,
+ .mv_outw = hd64465_outw,
+ .mv_outl = hd64465_outl,
+
+ .mv_inb_p = hd64465_inb_p,
+ .mv_inw_p = hd64465_inw,
+ .mv_inl_p = hd64465_inl,
+ .mv_outb_p = hd64465_outb_p,
+ .mv_outw_p = hd64465_outw,
+ .mv_outl_p = hd64465_outl,
+
+ .mv_insb = hd64465_insb,
+ .mv_insw = hd64465_insw,
+ .mv_insl = hd64465_insl,
+ .mv_outsb = hd64465_outsb,
+ .mv_outsw = hd64465_outsw,
+ .mv_outsl = hd64465_outsl,
+
+ .mv_readb = generic_readb,
+ .mv_readw = generic_readw,
+ .mv_readl = generic_readl,
+ .mv_writeb = generic_writeb,
+ .mv_writew = generic_writew,
+ .mv_writel = generic_writel,
- mv_irq_demux: hd64465_irq_demux,
+ .mv_irq_demux = hd64465_irq_demux,
- mv_rtc_gettimeofday: sh_rtc_gettimeofday,
- mv_rtc_settimeofday: sh_rtc_settimeofday,
+ .mv_rtc_gettimeofday = sh_rtc_gettimeofday,
+ .mv_rtc_settimeofday = sh_rtc_settimeofday,
};
ALIAS_MV(dmida)
diff -Nru a/arch/sh/boards/dreamcast/irq.c b/arch/sh/boards/dreamcast/irq.c
--- a/arch/sh/boards/dreamcast/irq.c Sat Jun 14 11:02:09 2003
+++ b/arch/sh/boards/dreamcast/irq.c Sun Aug 31 16:14:08 2003
@@ -110,13 +110,13 @@
}
struct hw_interrupt_type systemasic_int = {
- typename: "System ASIC",
- startup: startup_systemasic_irq,
- shutdown: shutdown_systemasic_irq,
- enable: enable_systemasic_irq,
- disable: disable_systemasic_irq,
- ack: ack_systemasic_irq,
- end: end_systemasic_irq,
+ .typename = "System ASIC",
+ .startup = startup_systemasic_irq,
+ .shutdown = shutdown_systemasic_irq,
+ .enable = enable_systemasic_irq,
+ .disable = disable_systemasic_irq,
+ .ack = ack_systemasic_irq,
+ .end = end_systemasic_irq,
};
/*
diff -Nru a/arch/sh/boards/dreamcast/mach.c b/arch/sh/boards/dreamcast/mach.c
--- a/arch/sh/boards/dreamcast/mach.c Mon May 19 16:04:36 2003
+++ b/arch/sh/boards/dreamcast/mach.c Sun Aug 31 16:14:08 2003
@@ -21,40 +21,40 @@
*/
struct sh_machine_vector mv_dreamcast __initmv = {
- mv_nr_irqs: NR_IRQS,
+ .mv_nr_irqs = NR_IRQS,
- mv_inb: generic_inb,
- mv_inw: generic_inw,
- mv_inl: generic_inl,
- mv_outb: generic_outb,
- mv_outw: generic_outw,
- mv_outl: generic_outl,
-
- mv_inb_p: generic_inb_p,
- mv_inw_p: generic_inw,
- mv_inl_p: generic_inl,
- mv_outb_p: generic_outb_p,
- mv_outw_p: generic_outw,
- mv_outl_p: generic_outl,
-
- mv_insb: generic_insb,
- mv_insw: generic_insw,
- mv_insl: generic_insl,
- mv_outsb: generic_outsb,
- mv_outsw: generic_outsw,
- mv_outsl: generic_outsl,
-
- mv_readb: generic_readb,
- mv_readw: generic_readw,
- mv_readl: generic_readl,
- mv_writeb: generic_writeb,
- mv_writew: generic_writew,
- mv_writel: generic_writel,
+ .mv_inb = generic_inb,
+ .mv_inw = generic_inw,
+ .mv_inl = generic_inl,
+ .mv_outb = generic_outb,
+ .mv_outw = generic_outw,
+ .mv_outl = generic_outl,
+
+ .mv_inb_p = generic_inb_p,
+ .mv_inw_p = generic_inw,
+ .mv_inl_p = generic_inl,
+ .mv_outb_p = generic_outb_p,
+ .mv_outw_p = generic_outw,
+ .mv_outl_p = generic_outl,
+
+ .mv_insb = generic_insb,
+ .mv_insw = generic_insw,
+ .mv_insl = generic_insl,
+ .mv_outsb = generic_outsb,
+ .mv_outsw = generic_outsw,
+ .mv_outsl = generic_outsl,
+
+ .mv_readb = generic_readb,
+ .mv_readw = generic_readw,
+ .mv_readl = generic_readl,
+ .mv_writeb = generic_writeb,
+ .mv_writew = generic_writew,
+ .mv_writel = generic_writel,
- mv_ioremap: generic_ioremap,
- mv_iounmap: generic_iounmap,
+ .mv_ioremap = generic_ioremap,
+ .mv_iounmap = generic_iounmap,
- mv_isa_port2addr: dreamcast_isa_port2addr,
- mv_irq_demux: systemasic_irq_demux,
+ .mv_isa_port2addr = dreamcast_isa_port2addr,
+ .mv_irq_demux = systemasic_irq_demux,
};
ALIAS_MV(dreamcast)
diff -Nru a/arch/sh/boards/ec3104/irq.c b/arch/sh/boards/ec3104/irq.c
--- a/arch/sh/boards/ec3104/irq.c Sat Jun 14 11:02:09 2003
+++ b/arch/sh/boards/ec3104/irq.c Sun Aug 31 16:14:08 2003
@@ -169,13 +169,13 @@
}
static struct hw_interrupt_type ec3104_int = {
- typename: "EC3104",
- enable: enable_ec3104_irq,
- disable: disable_ec3104_irq,
- ack: mask_and_ack_ec3104_irq,
- end: end_ec3104_irq,
- startup: startup_ec3104_irq,
- shutdown: shutdown_ec3104_irq,
+ .typename = "EC3104",
+ .enable = enable_ec3104_irq,
+ .disable = disable_ec3104_irq,
+ .ack = mask_and_ack_ec3104_irq,
+ .end = end_ec3104_irq,
+ .startup = startup_ec3104_irq,
+ .shutdown = shutdown_ec3104_irq,
};
/* Yuck. the _demux API is ugly */
diff -Nru a/arch/sh/boards/ec3104/mach.c b/arch/sh/boards/ec3104/mach.c
--- a/arch/sh/boards/ec3104/mach.c Sat Jan 19 10:54:19 2002
+++ b/arch/sh/boards/ec3104/mach.c Sun Aug 31 16:14:08 2003
@@ -28,42 +28,42 @@
*/
struct sh_machine_vector mv_ec3104 __initmv = {
- mv_name: "EC3104",
+ .mv_name = "EC3104",
- mv_nr_irqs: 96,
+ .mv_nr_irqs = 96,
- mv_inb: ec3104_inb,
- mv_inw: ec3104_inw,
- mv_inl: ec3104_inl,
- mv_outb: ec3104_outb,
- mv_outw: ec3104_outw,
- mv_outl: ec3104_outl,
-
- mv_inb_p: generic_inb_p,
- mv_inw_p: generic_inw,
- mv_inl_p: generic_inl,
- mv_outb_p: generic_outb_p,
- mv_outw_p: generic_outw,
- mv_outl_p: generic_outl,
-
- mv_insb: generic_insb,
- mv_insw: generic_insw,
- mv_insl: generic_insl,
- mv_outsb: generic_outsb,
- mv_outsw: generic_outsw,
- mv_outsl: generic_outsl,
-
- mv_readb: generic_readb,
- mv_readw: generic_readw,
- mv_readl: generic_readl,
- mv_writeb: generic_writeb,
- mv_writew: generic_writew,
- mv_writel: generic_writel,
+ .mv_inb = ec3104_inb,
+ .mv_inw = ec3104_inw,
+ .mv_inl = ec3104_inl,
+ .mv_outb = ec3104_outb,
+ .mv_outw = ec3104_outw,
+ .mv_outl = ec3104_outl,
+
+ .mv_inb_p = generic_inb_p,
+ .mv_inw_p = generic_inw,
+ .mv_inl_p = generic_inl,
+ .mv_outb_p = generic_outb_p,
+ .mv_outw_p = generic_outw,
+ .mv_outl_p = generic_outl,
+
+ .mv_insb = generic_insb,
+ .mv_insw = generic_insw,
+ .mv_insl = generic_insl,
+ .mv_outsb = generic_outsb,
+ .mv_outsw = generic_outsw,
+ .mv_outsl = generic_outsl,
+
+ .mv_readb = generic_readb,
+ .mv_readw = generic_readw,
+ .mv_readl = generic_readl,
+ .mv_writeb = generic_writeb,
+ .mv_writew = generic_writew,
+ .mv_writel = generic_writel,
- mv_irq_demux: ec3104_irq_demux,
+ .mv_irq_demux = ec3104_irq_demux,
- mv_rtc_gettimeofday: sh_rtc_gettimeofday,
- mv_rtc_settimeofday: sh_rtc_settimeofday,
+ .mv_rtc_gettimeofday = sh_rtc_gettimeofday,
+ .mv_rtc_settimeofday = sh_rtc_settimeofday,
};
ALIAS_MV(ec3104)
diff -Nru a/arch/sh/boards/harp/mach.c b/arch/sh/boards/harp/mach.c
--- a/arch/sh/boards/harp/mach.c Sat Mar 2 08:57:07 2002
+++ b/arch/sh/boards/harp/mach.c Sun Aug 31 16:14:08 2003
@@ -26,46 +26,46 @@
*/
struct sh_machine_vector mv_harp __initmv = {
- mv_nr_irqs: 89 + HD64465_IRQ_NUM,
+ .mv_nr_irqs = 89 + HD64465_IRQ_NUM,
- mv_inb: hd64465_inb,
- mv_inw: hd64465_inw,
- mv_inl: hd64465_inl,
- mv_outb: hd64465_outb,
- mv_outw: hd64465_outw,
- mv_outl: hd64465_outl,
-
- mv_inb_p: hd64465_inb_p,
- mv_inw_p: hd64465_inw,
- mv_inl_p: hd64465_inl,
- mv_outb_p: hd64465_outb_p,
- mv_outw_p: hd64465_outw,
- mv_outl_p: hd64465_outl,
-
- mv_insb: hd64465_insb,
- mv_insw: hd64465_insw,
- mv_insl: hd64465_insl,
- mv_outsb: hd64465_outsb,
- mv_outsw: hd64465_outsw,
- mv_outsl: hd64465_outsl,
-
- mv_readb: generic_readb,
- mv_readw: generic_readw,
- mv_readl: generic_readl,
- mv_writeb: generic_writeb,
- mv_writew: generic_writew,
- mv_writel: generic_writel,
+ .mv_inb = hd64465_inb,
+ .mv_inw = hd64465_inw,
+ .mv_inl = hd64465_inl,
+ .mv_outb = hd64465_outb,
+ .mv_outw = hd64465_outw,
+ .mv_outl = hd64465_outl,
+
+ .mv_inb_p = hd64465_inb_p,
+ .mv_inw_p = hd64465_inw,
+ .mv_inl_p = hd64465_inl,
+ .mv_outb_p = hd64465_outb_p,
+ .mv_outw_p = hd64465_outw,
+ .mv_outl_p = hd64465_outl,
+
+ .mv_insb = hd64465_insb,
+ .mv_insw = hd64465_insw,
+ .mv_insl = hd64465_insl,
+ .mv_outsb = hd64465_outsb,
+ .mv_outsw = hd64465_outsw,
+ .mv_outsl = hd64465_outsl,
+
+ .mv_readb = generic_readb,
+ .mv_readw = generic_readw,
+ .mv_readl = generic_readl,
+ .mv_writeb = generic_writeb,
+ .mv_writew = generic_writew,
+ .mv_writel = generic_writel,
- mv_ioremap: generic_ioremap,
- mv_iounmap: generic_iounmap,
+ .mv_ioremap = generic_ioremap,
+ .mv_iounmap = generic_iounmap,
- mv_isa_port2addr: hd64465_isa_port2addr,
+ .mv_isa_port2addr = hd64465_isa_port2addr,
#ifdef CONFIG_PCI
- mv_init_irq: init_harp_irq,
+ .mv_init_irq = init_harp_irq,
#endif
#ifdef CONFIG_HEARTBEAT
- mv_heartbeat: heartbeat_harp,
+ .mv_heartbeat = heartbeat_harp,
#endif
};
diff -Nru a/arch/sh/boards/hp6xx/hp620/mach.c b/arch/sh/boards/hp6xx/hp620/mach.c
--- a/arch/sh/boards/hp6xx/hp620/mach.c Mon May 19 16:04:36 2003
+++ b/arch/sh/boards/hp6xx/hp620/mach.c Sun Aug 31 16:14:08 2003
@@ -24,41 +24,41 @@
*/
struct sh_machine_vector mv_hp620 __initmv = {
- mv_name: "hp620",
+ .mv_name = "hp620",
- mv_nr_irqs: HD64461_IRQBASE+HD64461_IRQ_NUM,
+ .mv_nr_irqs = HD64461_IRQBASE+HD64461_IRQ_NUM,
- mv_inb: hd64461_inb,
- mv_inw: hd64461_inw,
- mv_inl: hd64461_inl,
- mv_outb: hd64461_outb,
- mv_outw: hd64461_outw,
- mv_outl: hd64461_outl,
-
- mv_inb_p: hd64461_inb_p,
- mv_inw_p: hd64461_inw,
- mv_inl_p: hd64461_inl,
- mv_outb_p: hd64461_outb_p,
- mv_outw_p: hd64461_outw,
- mv_outl_p: hd64461_outl,
-
- mv_insb: hd64461_insb,
- mv_insw: hd64461_insw,
- mv_insl: hd64461_insl,
- mv_outsb: hd64461_outsb,
- mv_outsw: hd64461_outsw,
- mv_outsl: hd64461_outsl,
-
- mv_readb: generic_readb,
- mv_readw: generic_readw,
- mv_readl: generic_readl,
- mv_writeb: generic_writeb,
- mv_writew: generic_writew,
- mv_writel: generic_writel,
+ .mv_inb = hd64461_inb,
+ .mv_inw = hd64461_inw,
+ .mv_inl = hd64461_inl,
+ .mv_outb = hd64461_outb,
+ .mv_outw = hd64461_outw,
+ .mv_outl = hd64461_outl,
+
+ .mv_inb_p = hd64461_inb_p,
+ .mv_inw_p = hd64461_inw,
+ .mv_inl_p = hd64461_inl,
+ .mv_outb_p = hd64461_outb_p,
+ .mv_outw_p = hd64461_outw,
+ .mv_outl_p = hd64461_outl,
+
+ .mv_insb = hd64461_insb,
+ .mv_insw = hd64461_insw,
+ .mv_insl = hd64461_insl,
+ .mv_outsb = hd64461_outsb,
+ .mv_outsw = hd64461_outsw,
+ .mv_outsl = hd64461_outsl,
+
+ .mv_readb = generic_readb,
+ .mv_readw = generic_readw,
+ .mv_readl = generic_readl,
+ .mv_writeb = generic_writeb,
+ .mv_writew = generic_writew,
+ .mv_writel = generic_writel,
- mv_irq_demux: hd64461_irq_demux,
+ .mv_irq_demux = hd64461_irq_demux,
- mv_rtc_gettimeofday: sh_rtc_gettimeofday,
- mv_rtc_settimeofday: sh_rtc_settimeofday,
+ .mv_rtc_gettimeofday = sh_rtc_gettimeofday,
+ .mv_rtc_settimeofday = sh_rtc_settimeofday,
};
ALIAS_MV(hp620)
diff -Nru a/arch/sh/boards/hp6xx/hp680/mach.c b/arch/sh/boards/hp6xx/hp680/mach.c
--- a/arch/sh/boards/hp6xx/hp680/mach.c Mon May 19 16:04:37 2003
+++ b/arch/sh/boards/hp6xx/hp680/mach.c Sun Aug 31 16:14:08 2003
@@ -20,41 +20,41 @@
#include
struct sh_machine_vector mv_hp680 __initmv = {
- mv_name: "hp680",
+ .mv_name = "hp680",
- mv_nr_irqs: HD64461_IRQBASE+HD64461_IRQ_NUM,
+ .mv_nr_irqs = HD64461_IRQBASE+HD64461_IRQ_NUM,
- mv_inb: hd64461_inb,
- mv_inw: hd64461_inw,
- mv_inl: hd64461_inl,
- mv_outb: hd64461_outb,
- mv_outw: hd64461_outw,
- mv_outl: hd64461_outl,
-
- mv_inb_p: hd64461_inb_p,
- mv_inw_p: hd64461_inw,
- mv_inl_p: hd64461_inl,
- mv_outb_p: hd64461_outb_p,
- mv_outw_p: hd64461_outw,
- mv_outl_p: hd64461_outl,
-
- mv_insb: hd64461_insb,
- mv_insw: hd64461_insw,
- mv_insl: hd64461_insl,
- mv_outsb: hd64461_outsb,
- mv_outsw: hd64461_outsw,
- mv_outsl: hd64461_outsl,
-
- mv_readb: generic_readb,
- mv_readw: generic_readw,
- mv_readl: generic_readl,
- mv_writeb: generic_writeb,
- mv_writew: generic_writew,
- mv_writel: generic_writel,
+ .mv_inb = hd64461_inb,
+ .mv_inw = hd64461_inw,
+ .mv_inl = hd64461_inl,
+ .mv_outb = hd64461_outb,
+ .mv_outw = hd64461_outw,
+ .mv_outl = hd64461_outl,
+
+ .mv_inb_p = hd64461_inb_p,
+ .mv_inw_p = hd64461_inw,
+ .mv_inl_p = hd64461_inl,
+ .mv_outb_p = hd64461_outb_p,
+ .mv_outw_p = hd64461_outw,
+ .mv_outl_p = hd64461_outl,
+
+ .mv_insb = hd64461_insb,
+ .mv_insw = hd64461_insw,
+ .mv_insl = hd64461_insl,
+ .mv_outsb = hd64461_outsb,
+ .mv_outsw = hd64461_outsw,
+ .mv_outsl = hd64461_outsl,
+
+ .mv_readb = generic_readb,
+ .mv_readw = generic_readw,
+ .mv_readl = generic_readl,
+ .mv_writeb = generic_writeb,
+ .mv_writew = generic_writew,
+ .mv_writel = generic_writel,
- mv_irq_demux: hd64461_irq_demux,
+ .mv_irq_demux = hd64461_irq_demux,
- mv_rtc_gettimeofday: sh_rtc_gettimeofday,
- mv_rtc_settimeofday: sh_rtc_settimeofday,
+ .mv_rtc_gettimeofday = sh_rtc_gettimeofday,
+ .mv_rtc_settimeofday = sh_rtc_settimeofday,
};
ALIAS_MV(hp680)
diff -Nru a/arch/sh/boards/hp6xx/hp690/mach.c b/arch/sh/boards/hp6xx/hp690/mach.c
--- a/arch/sh/boards/hp6xx/hp690/mach.c Mon May 19 16:04:37 2003
+++ b/arch/sh/boards/hp6xx/hp690/mach.c Sun Aug 31 16:14:08 2003
@@ -20,41 +20,41 @@
#include
struct sh_machine_vector mv_hp690 __initmv = {
- mv_name: "hp690",
+ .mv_name = "hp690",
- mv_nr_irqs: HD64461_IRQBASE+HD64461_IRQ_NUM,
+ .mv_nr_irqs = HD64461_IRQBASE+HD64461_IRQ_NUM,
- mv_inb: hd64461_inb,
- mv_inw: hd64461_inw,
- mv_inl: hd64461_inl,
- mv_outb: hd64461_outb,
- mv_outw: hd64461_outw,
- mv_outl: hd64461_outl,
-
- mv_inb_p: hd64461_inb_p,
- mv_inw_p: hd64461_inw,
- mv_inl_p: hd64461_inl,
- mv_outb_p: hd64461_outb_p,
- mv_outw_p: hd64461_outw,
- mv_outl_p: hd64461_outl,
-
- mv_insb: hd64461_insb,
- mv_insw: hd64461_insw,
- mv_insl: hd64461_insl,
- mv_outsb: hd64461_outsb,
- mv_outsw: hd64461_outsw,
- mv_outsl: hd64461_outsl,
-
- mv_readb: generic_readb,
- mv_readw: generic_readw,
- mv_readl: generic_readl,
- mv_writeb: generic_writeb,
- mv_writew: generic_writew,
- mv_writel: generic_writel,
+ .mv_inb = hd64461_inb,
+ .mv_inw = hd64461_inw,
+ .mv_inl = hd64461_inl,
+ .mv_outb = hd64461_outb,
+ .mv_outw = hd64461_outw,
+ .mv_outl = hd64461_outl,
+
+ .mv_inb_p = hd64461_inb_p,
+ .mv_inw_p = hd64461_inw,
+ .mv_inl_p = hd64461_inl,
+ .mv_outb_p = hd64461_outb_p,
+ .mv_outw_p = hd64461_outw,
+ .mv_outl_p = hd64461_outl,
+
+ .mv_insb = hd64461_insb,
+ .mv_insw = hd64461_insw,
+ .mv_insl = hd64461_insl,
+ .mv_outsb = hd64461_outsb,
+ .mv_outsw = hd64461_outsw,
+ .mv_outsl = hd64461_outsl,
+
+ .mv_readb = generic_readb,
+ .mv_readw = generic_readw,
+ .mv_readl = generic_readl,
+ .mv_writeb = generic_writeb,
+ .mv_writew = generic_writew,
+ .mv_writel = generic_writel,
- mv_irq_demux: hd64461_irq_demux,
+ .mv_irq_demux = hd64461_irq_demux,
- mv_rtc_gettimeofday: sh_rtc_gettimeofday,
- mv_rtc_settimeofday: sh_rtc_settimeofday,
+ .mv_rtc_gettimeofday = sh_rtc_gettimeofday,
+ .mv_rtc_settimeofday = sh_rtc_settimeofday,
};
ALIAS_MV(hp690)
diff -Nru a/arch/sh/boards/overdrive/mach.c b/arch/sh/boards/overdrive/mach.c
--- a/arch/sh/boards/overdrive/mach.c Sat Jun 14 11:02:09 2003
+++ b/arch/sh/boards/overdrive/mach.c Sun Aug 31 16:14:08 2003
@@ -28,46 +28,46 @@
*/
struct sh_machine_vector mv_od __initmv = {
- mv_nr_irqs: 48,
+ .mv_nr_irqs = 48,
- mv_inb: od_inb,
- mv_inw: od_inw,
- mv_inl: od_inl,
- mv_outb: od_outb,
- mv_outw: od_outw,
- mv_outl: od_outl,
-
- mv_inb_p: od_inb_p,
- mv_inw_p: od_inw_p,
- mv_inl_p: od_inl_p,
- mv_outb_p: od_outb_p,
- mv_outw_p: od_outw_p,
- mv_outl_p: od_outl_p,
-
- mv_insb: od_insb,
- mv_insw: od_insw,
- mv_insl: od_insl,
- mv_outsb: od_outsb,
- mv_outsw: od_outsw,
- mv_outsl: od_outsl,
-
- mv_readb: generic_readb,
- mv_readw: generic_readw,
- mv_readl: generic_readl,
- mv_writeb: generic_writeb,
- mv_writew: generic_writew,
- mv_writel: generic_writel,
+ .mv_inb = od_inb,
+ .mv_inw = od_inw,
+ .mv_inl = od_inl,
+ .mv_outb = od_outb,
+ .mv_outw = od_outw,
+ .mv_outl = od_outl,
+
+ .mv_inb_p = od_inb_p,
+ .mv_inw_p = od_inw_p,
+ .mv_inl_p = od_inl_p,
+ .mv_outb_p = od_outb_p,
+ .mv_outw_p = od_outw_p,
+ .mv_outl_p = od_outl_p,
+
+ .mv_insb = od_insb,
+ .mv_insw = od_insw,
+ .mv_insl = od_insl,
+ .mv_outsb = od_outsb,
+ .mv_outsw = od_outsw,
+ .mv_outsl = od_outsl,
+
+ .mv_readb = generic_readb,
+ .mv_readw = generic_readw,
+ .mv_readl = generic_readl,
+ .mv_writeb = generic_writeb,
+ .mv_writew = generic_writew,
+ .mv_writel = generic_writel,
- mv_ioremap: generic_ioremap,
- mv_iounmap: generic_iounmap,
+ .mv_ioremap = generic_ioremap,
+ .mv_iounmap = generic_iounmap,
- mv_isa_port2addr: generic_isa_port2addr,
+ .mv_isa_port2addr = generic_isa_port2addr,
#ifdef CONFIG_PCI
- mv_init_irq: init_overdrive_irq,
+ .mv_init_irq = init_overdrive_irq,
#endif
#ifdef CONFIG_HEARTBEAT
- mv_heartbeat: heartbeat_od,
+ .mv_heartbeat = heartbeat_od,
#endif
};
diff -Nru a/arch/sh/boards/saturn/irq.c b/arch/sh/boards/saturn/irq.c
--- a/arch/sh/boards/saturn/irq.c Sat Jun 14 11:02:09 2003
+++ b/arch/sh/boards/saturn/irq.c Sun Aug 31 16:14:08 2003
@@ -102,13 +102,13 @@
}
static struct hw_interrupt_type saturn_int = {
- typename: "Saturn",
- enable: enable_saturn_irq,
- disable: disable_saturn_irq,
- ack: mask_and_ack_saturn_irq,
- end: end_saturn_irq,
- startup: startup_saturn_irq,
- shutdown: shutdown_saturn_irq,
+ .typename = "Saturn",
+ .enable = enable_saturn_irq,
+ .disable = disable_saturn_irq,
+ .ack = mask_and_ack_saturn_irq,
+ .end = end_saturn_irq,
+ .startup = startup_saturn_irq,
+ .shutdown = shutdown_saturn_irq,
};
int saturn_irq_demux(int irq_nr)
diff -Nru a/arch/sh/boards/saturn/mach.c b/arch/sh/boards/saturn/mach.c
--- a/arch/sh/boards/saturn/mach.c Mon May 19 16:04:39 2003
+++ b/arch/sh/boards/saturn/mach.c Sun Aug 31 16:14:08 2003
@@ -18,41 +18,41 @@
* The Machine Vector
*/
struct sh_machine_vector mv_saturn __initmv = {
- mv_nr_irqs: 80, /* Fix this later */
+ .mv_nr_irqs = 80, /* Fix this later */
- mv_inb: generic_inb,
- mv_inw: generic_inw,
- mv_inl: generic_inl,
- mv_outb: generic_outb,
- mv_outw: generic_outw,
- mv_outl: generic_outl,
-
- mv_inb_p: generic_inb_p,
- mv_inw_p: generic_inw_p,
- mv_inl_p: generic_inl_p,
- mv_outb_p: generic_outb_p,
- mv_outw_p: generic_outw_p,
- mv_outl_p: generic_outl_p,
-
- mv_insb: generic_insb,
- mv_insw: generic_insw,
- mv_insl: generic_insl,
- mv_outsb: generic_outsb,
- mv_outsw: generic_outsw,
- mv_outsl: generic_outsl,
-
- mv_readb: generic_readb,
- mv_readw: generic_readw,
- mv_readl: generic_readl,
- mv_writeb: generic_writeb,
- mv_writew: generic_writew,
- mv_writel: generic_writel,
+ .mv_inb = generic_inb,
+ .mv_inw = generic_inw,
+ .mv_inl = generic_inl,
+ .mv_outb = generic_outb,
+ .mv_outw = generic_outw,
+ .mv_outl = generic_outl,
+
+ .mv_inb_p = generic_inb_p,
+ .mv_inw_p = generic_inw_p,
+ .mv_inl_p = generic_inl_p,
+ .mv_outb_p = generic_outb_p,
+ .mv_outw_p = generic_outw_p,
+ .mv_outl_p = generic_outl_p,
+
+ .mv_insb = generic_insb,
+ .mv_insw = generic_insw,
+ .mv_insl = generic_insl,
+ .mv_outsb = generic_outsb,
+ .mv_outsw = generic_outsw,
+ .mv_outsl = generic_outsl,
+
+ .mv_readb = generic_readb,
+ .mv_readw = generic_readw,
+ .mv_readl = generic_readl,
+ .mv_writeb = generic_writeb,
+ .mv_writew = generic_writew,
+ .mv_writel = generic_writel,
- mv_isa_port2addr: saturn_isa_port2addr,
- mv_irq_demux: saturn_irq_demux,
+ .mv_isa_port2addr = saturn_isa_port2addr,
+ .mv_irq_demux = saturn_irq_demux,
- mv_ioremap: saturn_ioremap,
- mv_iounmap: saturn_iounmap,
+ .mv_ioremap = saturn_ioremap,
+ .mv_iounmap = saturn_iounmap,
};
ALIAS_MV(saturn)
diff -Nru a/arch/sh/boards/se/770x/mach.c b/arch/sh/boards/se/770x/mach.c
--- a/arch/sh/boards/se/770x/mach.c Mon May 19 16:04:39 2003
+++ b/arch/sh/boards/se/770x/mach.c Sun Aug 31 16:14:08 2003
@@ -28,49 +28,49 @@
struct sh_machine_vector mv_se __initmv = {
#if defined(CONFIG_CPU_SH4)
- mv_nr_irqs: 48,
+ .mv_nr_irqs = 48,
#elif defined(CONFIG_CPU_SUBTYPE_SH7708)
- mv_nr_irqs: 32,
+ .mv_nr_irqs = 32,
#elif defined(CONFIG_CPU_SUBTYPE_SH7709)
- mv_nr_irqs: 61,
+ .mv_nr_irqs = 61,
#endif
- mv_inb: se_inb,
- mv_inw: se_inw,
- mv_inl: se_inl,
- mv_outb: se_outb,
- mv_outw: se_outw,
- mv_outl: se_outl,
-
- mv_inb_p: se_inb_p,
- mv_inw_p: se_inw,
- mv_inl_p: se_inl,
- mv_outb_p: se_outb_p,
- mv_outw_p: se_outw,
- mv_outl_p: se_outl,
-
- mv_insb: se_insb,
- mv_insw: se_insw,
- mv_insl: se_insl,
- mv_outsb: se_outsb,
- mv_outsw: se_outsw,
- mv_outsl: se_outsl,
-
- mv_readb: se_readb,
- mv_readw: se_readw,
- mv_readl: se_readl,
- mv_writeb: se_writeb,
- mv_writew: se_writew,
- mv_writel: se_writel,
+ .mv_inb = se_inb,
+ .mv_inw = se_inw,
+ .mv_inl = se_inl,
+ .mv_outb = se_outb,
+ .mv_outw = se_outw,
+ .mv_outl = se_outl,
+
+ .mv_inb_p = se_inb_p,
+ .mv_inw_p = se_inw,
+ .mv_inl_p = se_inl,
+ .mv_outb_p = se_outb_p,
+ .mv_outw_p = se_outw,
+ .mv_outl_p = se_outl,
+
+ .mv_insb = se_insb,
+ .mv_insw = se_insw,
+ .mv_insl = se_insl,
+ .mv_outsb = se_outsb,
+ .mv_outsw = se_outsw,
+ .mv_outsl = se_outsl,
+
+ .mv_readb = se_readb,
+ .mv_readw = se_readw,
+ .mv_readl = se_readl,
+ .mv_writeb = se_writeb,
+ .mv_writew = se_writew,
+ .mv_writel = se_writel,
- mv_ioremap: generic_ioremap,
- mv_iounmap: generic_iounmap,
+ .mv_ioremap = generic_ioremap,
+ .mv_iounmap = generic_iounmap,
- mv_isa_port2addr: se_isa_port2addr,
+ .mv_isa_port2addr = se_isa_port2addr,
- mv_init_irq: init_se_IRQ,
+ .mv_init_irq = init_se_IRQ,
#ifdef CONFIG_HEARTBEAT
- mv_heartbeat: heartbeat_se,
+ .mv_heartbeat = heartbeat_se,
#endif
};
ALIAS_MV(se)
diff -Nru a/arch/sh/boards/se/7751/mach.c b/arch/sh/boards/se/7751/mach.c
--- a/arch/sh/boards/se/7751/mach.c Mon May 19 16:04:39 2003
+++ b/arch/sh/boards/se/7751/mach.c Sun Aug 31 16:14:08 2003
@@ -26,44 +26,44 @@
*/
struct sh_machine_vector mv_7751se __initmv = {
- mv_nr_irqs: 72,
+ .mv_nr_irqs = 72,
- mv_inb: sh7751se_inb,
- mv_inw: sh7751se_inw,
- mv_inl: sh7751se_inl,
- mv_outb: sh7751se_outb,
- mv_outw: sh7751se_outw,
- mv_outl: sh7751se_outl,
-
- mv_inb_p: sh7751se_inb_p,
- mv_inw_p: sh7751se_inw,
- mv_inl_p: sh7751se_inl,
- mv_outb_p: sh7751se_outb_p,
- mv_outw_p: sh7751se_outw,
- mv_outl_p: sh7751se_outl,
-
- mv_insb: sh7751se_insb,
- mv_insw: sh7751se_insw,
- mv_insl: sh7751se_insl,
- mv_outsb: sh7751se_outsb,
- mv_outsw: sh7751se_outsw,
- mv_outsl: sh7751se_outsl,
-
- mv_readb: sh7751se_readb,
- mv_readw: sh7751se_readw,
- mv_readl: sh7751se_readl,
- mv_writeb: sh7751se_writeb,
- mv_writew: sh7751se_writew,
- mv_writel: sh7751se_writel,
+ .mv_inb = sh7751se_inb,
+ .mv_inw = sh7751se_inw,
+ .mv_inl = sh7751se_inl,
+ .mv_outb = sh7751se_outb,
+ .mv_outw = sh7751se_outw,
+ .mv_outl = sh7751se_outl,
+
+ .mv_inb_p = sh7751se_inb_p,
+ .mv_inw_p = sh7751se_inw,
+ .mv_inl_p = sh7751se_inl,
+ .mv_outb_p = sh7751se_outb_p,
+ .mv_outw_p = sh7751se_outw,
+ .mv_outl_p = sh7751se_outl,
+
+ .mv_insb = sh7751se_insb,
+ .mv_insw = sh7751se_insw,
+ .mv_insl = sh7751se_insl,
+ .mv_outsb = sh7751se_outsb,
+ .mv_outsw = sh7751se_outsw,
+ .mv_outsl = sh7751se_outsl,
+
+ .mv_readb = sh7751se_readb,
+ .mv_readw = sh7751se_readw,
+ .mv_readl = sh7751se_readl,
+ .mv_writeb = sh7751se_writeb,
+ .mv_writew = sh7751se_writew,
+ .mv_writel = sh7751se_writel,
- mv_ioremap: generic_ioremap,
- mv_iounmap: generic_iounmap,
+ .mv_ioremap = generic_ioremap,
+ .mv_iounmap = generic_iounmap,
- mv_isa_port2addr: sh7751se_isa_port2addr,
+ .mv_isa_port2addr = sh7751se_isa_port2addr,
- mv_init_irq: init_7751se_IRQ,
+ .mv_init_irq = init_7751se_IRQ,
#ifdef CONFIG_HEARTBEAT
- mv_heartbeat: heartbeat_7751se,
+ .mv_heartbeat = heartbeat_7751se,
#endif
};
ALIAS_MV(7751se)
diff -Nru a/arch/sh/boards/sh2000/mach.c b/arch/sh/boards/sh2000/mach.c
--- a/arch/sh/boards/sh2000/mach.c Mon May 19 16:04:40 2003
+++ b/arch/sh/boards/sh2000/mach.c Sun Aug 31 16:14:08 2003
@@ -19,39 +19,39 @@
*/
struct sh_machine_vector mv_sh2000 __initmv = {
- mv_nr_irqs: 80,
+ .mv_nr_irqs = 80,
- mv_inb: generic_inb,
- mv_inw: generic_inw,
- mv_inl: generic_inl,
- mv_outb: generic_outb,
- mv_outw: generic_outw,
- mv_outl: generic_outl,
-
- mv_inb_p: generic_inb_p,
- mv_inw_p: generic_inw_p,
- mv_inl_p: generic_inl_p,
- mv_outb_p: generic_outb_p,
- mv_outw_p: generic_outw_p,
- mv_outl_p: generic_outl_p,
-
- mv_insb: generic_insb,
- mv_insw: generic_insw,
- mv_insl: generic_insl,
- mv_outsb: generic_outsb,
- mv_outsw: generic_outsw,
- mv_outsl: generic_outsl,
-
- mv_readb: generic_readb,
- mv_readw: generic_readw,
- mv_readl: generic_readl,
- mv_writeb: generic_writeb,
- mv_writew: generic_writew,
- mv_writel: generic_writel,
+ .mv_inb = generic_inb,
+ .mv_inw = generic_inw,
+ .mv_inl = generic_inl,
+ .mv_outb = generic_outb,
+ .mv_outw = generic_outw,
+ .mv_outl = generic_outl,
+
+ .mv_inb_p = generic_inb_p,
+ .mv_inw_p = generic_inw_p,
+ .mv_inl_p = generic_inl_p,
+ .mv_outb_p = generic_outb_p,
+ .mv_outw_p = generic_outw_p,
+ .mv_outl_p = generic_outl_p,
+
+ .mv_insb = generic_insb,
+ .mv_insw = generic_insw,
+ .mv_insl = generic_insl,
+ .mv_outsb = generic_outsb,
+ .mv_outsw = generic_outsw,
+ .mv_outsl = generic_outsl,
+
+ .mv_readb = generic_readb,
+ .mv_readw = generic_readw,
+ .mv_readl = generic_readl,
+ .mv_writeb = generic_writeb,
+ .mv_writew = generic_writew,
+ .mv_writel = generic_writel,
- mv_isa_port2addr: sh2000_isa_port2addr,
+ .mv_isa_port2addr = sh2000_isa_port2addr,
- mv_ioremap: generic_ioremap,
- mv_iounmap: generic_iounmap,
+ .mv_ioremap = generic_ioremap,
+ .mv_iounmap = generic_iounmap,
};
ALIAS_MV(sh2000)
diff -Nru a/arch/sh/boards/unknown/mach.c b/arch/sh/boards/unknown/mach.c
--- a/arch/sh/boards/unknown/mach.c Fri Jan 10 04:26:40 2003
+++ b/arch/sh/boards/unknown/mach.c Sun Aug 31 16:14:08 2003
@@ -24,44 +24,44 @@
struct sh_machine_vector mv_unknown __initmv = {
#if defined(CONFIG_CPU_SH4)
- mv_nr_irqs: 48,
+ .mv_nr_irqs = 48,
#elif defined(CONFIG_CPU_SUBTYPE_SH7708)
- mv_nr_irqs: 32,
+ .mv_nr_irqs = 32,
#elif defined(CONFIG_CPU_SUBTYPE_SH7709)
- mv_nr_irqs: 61,
+ .mv_nr_irqs = 61,
#endif
- mv_inb: unknown_inb,
- mv_inw: unknown_inw,
- mv_inl: unknown_inl,
- mv_outb: unknown_outb,
- mv_outw: unknown_outw,
- mv_outl: unknown_outl,
-
- mv_inb_p: unknown_inb_p,
- mv_inw_p: unknown_inw_p,
- mv_inl_p: unknown_inl_p,
- mv_outb_p: unknown_outb_p,
- mv_outw_p: unknown_outw_p,
- mv_outl_p: unknown_outl_p,
-
- mv_insb: unknown_insb,
- mv_insw: unknown_insw,
- mv_insl: unknown_insl,
- mv_outsb: unknown_outsb,
- mv_outsw: unknown_outsw,
- mv_outsl: unknown_outsl,
-
- mv_readb: unknown_readb,
- mv_readw: unknown_readw,
- mv_readl: unknown_readl,
- mv_writeb: unknown_writeb,
- mv_writew: unknown_writew,
- mv_writel: unknown_writel,
+ .mv_inb = unknown_inb,
+ .mv_inw = unknown_inw,
+ .mv_inl = unknown_inl,
+ .mv_outb = unknown_outb,
+ .mv_outw = unknown_outw,
+ .mv_outl = unknown_outl,
+
+ .mv_inb_p = unknown_inb_p,
+ .mv_inw_p = unknown_inw_p,
+ .mv_inl_p = unknown_inl_p,
+ .mv_outb_p = unknown_outb_p,
+ .mv_outw_p = unknown_outw_p,
+ .mv_outl_p = unknown_outl_p,
+
+ .mv_insb = unknown_insb,
+ .mv_insw = unknown_insw,
+ .mv_insl = unknown_insl,
+ .mv_outsb = unknown_outsb,
+ .mv_outsw = unknown_outsw,
+ .mv_outsl = unknown_outsl,
+
+ .mv_readb = unknown_readb,
+ .mv_readw = unknown_readw,
+ .mv_readl = unknown_readl,
+ .mv_writeb = unknown_writeb,
+ .mv_writew = unknown_writew,
+ .mv_writel = unknown_writel,
- mv_ioremap: unknown_ioremap,
- mv_iounmap: unknown_iounmap,
+ .mv_ioremap = unknown_ioremap,
+ .mv_iounmap = unknown_iounmap,
- mv_isa_port2addr: unknown_isa_port2addr,
+ .mv_isa_port2addr = unknown_isa_port2addr,
};
ALIAS_MV(unknown)
diff -Nru a/arch/sh/cchips/hd6446x/hd64465/setup.c b/arch/sh/cchips/hd6446x/hd64465/setup.c
--- a/arch/sh/cchips/hd6446x/hd64465/setup.c Mon Nov 4 07:33:57 2002
+++ b/arch/sh/cchips/hd6446x/hd64465/setup.c Sun Aug 31 16:14:08 2003
@@ -89,13 +89,13 @@
static struct hw_interrupt_type hd64465_irq_type = {
- typename: "HD64465-IRQ",
- startup: startup_hd64465_irq,
- shutdown: shutdown_hd64465_irq,
- enable: enable_hd64465_irq,
- disable: disable_hd64465_irq,
- ack: mask_and_ack_hd64465,
- end: end_hd64465_irq
+ .typename = "HD64465-IRQ",
+ .startup = startup_hd64465_irq,
+ .shutdown = shutdown_hd64465_irq,
+ .enable = enable_hd64465_irq,
+ .disable = disable_hd64465_irq,
+ .ack = mask_and_ack_hd64465,
+ .end = end_hd64465_irq
};
diff -Nru a/arch/sparc/Kconfig b/arch/sparc/Kconfig
--- a/arch/sparc/Kconfig Sat Aug 2 14:26:16 2003
+++ b/arch/sparc/Kconfig Sun Aug 31 16:14:22 2003
@@ -254,29 +254,6 @@
.
The module will be called openpromfs. If unsure, say M.
-config KCORE_ELF
- bool
- depends on PROC_FS
- default y
- ---help---
- If you enabled support for /proc file system then the file
- /proc/kcore will contain the kernel core image. This can be used
- in gdb:
-
- $ cd /usr/src/linux ; gdb vmlinux /proc/kcore
-
- You have two choices here: ELF and A.OUT. Selecting ELF will make
- /proc/kcore appear in ELF core format as defined by the Executable
- and Linking Format specification. Selecting A.OUT will choose the
- old "a.out" format which may be necessary for some old versions
- of binutils or on some architectures.
-
- This is especially useful if you have compiled the kernel with the
- "-g" option to preserve debugging information. It is mainly used
- for examining kernel data structures on the live kernel so if you
- don't understand what this means or are not a kernel hacker, just
- leave it at its default value ELF.
-
source "fs/Kconfig.binfmt"
config SUNOS_EMUL
diff -Nru a/arch/sparc/kernel/sys_sunos.c b/arch/sparc/kernel/sys_sunos.c
--- a/arch/sparc/kernel/sys_sunos.c Sun May 25 17:00:00 2003
+++ b/arch/sparc/kernel/sys_sunos.c Tue Aug 26 09:25:41 2003
@@ -92,8 +92,8 @@
* SunOS is so stupid some times... hmph!
*/
if (file) {
- if(major(file->f_dentry->d_inode->i_rdev) == MEM_MAJOR &&
- minor(file->f_dentry->d_inode->i_rdev) == 5) {
+ if(imajor(file->f_dentry->d_inode) == MEM_MAJOR &&
+ iminor(file->f_dentry->d_inode) == 5) {
flags |= MAP_ANONYMOUS;
fput(file);
file = 0;
diff -Nru a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
--- a/arch/sparc64/Kconfig Sat Aug 2 14:26:53 2003
+++ b/arch/sparc64/Kconfig Sun Aug 31 16:14:22 2003
@@ -363,29 +363,6 @@
.
The module will be called openpromfs. If unsure, say M.
-config KCORE_ELF
- bool
- depends on PROC_FS
- default y
- ---help---
- If you enabled support for /proc file system then the file
- /proc/kcore will contain the kernel core image. This can be used
- in gdb:
-
- $ cd /usr/src/linux ; gdb vmlinux /proc/kcore
-
- You have two choices here: ELF and A.OUT. Selecting ELF will make
- /proc/kcore appear in ELF core format as defined by the Executable
- and Linking Format specification. Selecting A.OUT will choose the
- old "a.out" format which may be necessary for some old versions
- of binutils or on some architectures.
-
- This is especially useful if you have compiled the kernel with the
- "-g" option to preserve debugging information. It is mainly used
- for examining kernel data structures on the live kernel so if you
- don't understand what this means or are not a kernel hacker, just
- leave it at its default value ELF.
-
config SPARC32_COMPAT
bool "Kernel support for Linux/Sparc 32bit binary compatibility"
help
diff -Nru a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c
--- a/arch/sparc64/kernel/ioctl32.c Fri Aug 8 14:53:47 2003
+++ b/arch/sparc64/kernel/ioctl32.c Sun Aug 31 16:14:44 2003
@@ -1388,7 +1388,7 @@
#define IOCTL_TABLE_START \
struct ioctl_trans ioctl_start[] = {
#define IOCTL_TABLE_END \
- }; struct ioctl_trans ioctl_end[0];
+ };
IOCTL_TABLE_START
#include
@@ -1583,3 +1583,5 @@
HANDLE_IOCTL(USBDEVFS_DISCSIGNAL32, do_usbdevfs_discsignal)
/* take care of sizeof(sizeof()) breakage */
IOCTL_TABLE_END
+
+int ioctl_table_size = ARRAY_SIZE(ioctl_start);
diff -Nru a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c
--- a/arch/sparc64/kernel/sys_sunos32.c Sun May 25 17:00:00 2003
+++ b/arch/sparc64/kernel/sys_sunos32.c Tue Aug 26 09:25:41 2003
@@ -90,7 +90,7 @@
if (!file)
goto out;
inode = file->f_dentry->d_inode;
- if (minor(inode->i_rdev) == MEM_MAJOR && minor(inode->i_rdev) == 5) {
+ if (imajor(inode) == MEM_MAJOR && iminor(inode) == 5) {
flags |= MAP_ANONYMOUS;
fput(file);
file = NULL;
diff -Nru a/arch/sparc64/mm/hugetlbpage.c b/arch/sparc64/mm/hugetlbpage.c
--- a/arch/sparc64/mm/hugetlbpage.c Mon Feb 24 23:13:11 2003
+++ b/arch/sparc64/mm/hugetlbpage.c Tue Aug 26 09:41:27 2003
@@ -380,207 +380,6 @@
return 1;
}
-static struct inode *set_new_inode(unsigned long len, int prot, int flag, int key)
-{
- struct inode *inode;
- int i;
-
- for (i = 0; i < MAX_ID; i++) {
- if (htlbpagek[i].key == 0)
- break;
- }
- if (i == MAX_ID)
- return NULL;
- inode = kmalloc(sizeof (struct inode), GFP_KERNEL);
- if (inode == NULL)
- return NULL;
-
- inode_init_once(inode);
- atomic_inc(&inode->i_writecount);
- inode->i_mapping = &inode->i_data;
- inode->i_mapping->host = inode;
- inode->i_ino = (unsigned long)key;
-
- htlbpagek[i].key = key;
- htlbpagek[i].in = inode;
- inode->i_uid = current->fsuid;
- inode->i_gid = current->fsgid;
- inode->i_mode = prot;
- inode->i_size = len;
- return inode;
-}
-
-static int check_size_prot(struct inode *inode, unsigned long len, int prot, int flag)
-{
- if (inode->i_uid != current->fsuid)
- return -1;
- if (inode->i_gid != current->fsgid)
- return -1;
- if (inode->i_size != len)
- return -1;
- return 0;
-}
-
-static int alloc_shared_hugetlb_pages(int key, unsigned long addr, unsigned long len,
- int prot, int flag)
-{
- struct mm_struct *mm = current->mm;
- struct vm_area_struct *vma;
- struct inode *inode;
- struct address_space *mapping;
- struct page *page;
- int idx;
- int retval = -ENOMEM;
- int newalloc = 0;
-
-try_again:
- spin_lock(&htlbpage_lock);
-
- inode = find_key_inode(key);
- if (inode == NULL) {
- if (!capable(CAP_SYS_ADMIN)) {
- if (!in_group_p(0)) {
- retval = -EPERM;
- goto out_err;
- }
- }
- if (!(flag & IPC_CREAT)) {
- retval = -ENOENT;
- goto out_err;
- }
- inode = set_new_inode(len, prot, flag, key);
- if (inode == NULL)
- goto out_err;
- newalloc = 1;
- } else {
- if (check_size_prot(inode, len, prot, flag) < 0) {
- retval = -EINVAL;
- goto out_err;
- } else if (atomic_read(&inode->i_writecount)) {
- spin_unlock(&htlbpage_lock);
- goto try_again;
- }
- }
- spin_unlock(&htlbpage_lock);
- mapping = inode->i_mapping;
-
- addr = do_mmap_pgoff(NULL, addr, len, (unsigned long) prot,
- MAP_NORESERVE|MAP_FIXED|MAP_PRIVATE|MAP_ANONYMOUS, 0);
- if (IS_ERR((void *) addr))
- goto freeinode;
-
- vma = find_vma(mm, addr);
- if (!vma) {
- retval = -EINVAL;
- goto freeinode;
- }
-
- spin_lock(&mm->page_table_lock);
- do {
- pte_t *pte = huge_pte_alloc_map(mm, addr);
-
- if (!pte || !pte_none(pte)) {
- if (pte)
- pte_unmap(pte);
- goto out;
- }
-
- idx = (addr - vma->vm_start) >> HPAGE_SHIFT;
- page = find_get_page(mapping, idx);
- if (page == NULL) {
- page = alloc_hugetlb_page();
- if (page == NULL) {
- pte_unmap(pte);
- retval = -ENOMEM;
- goto out;
- }
- retval = add_to_page_cache(page, mapping,
- idx, GFP_ATOMIC);
- if (retval) {
- pte_unmap(pte);
- free_hugetlb_page(page);
- goto out;
- }
- }
- set_huge_pte(mm, vma, page, pte,
- (vma->vm_flags & VM_WRITE));
- pte_unmap(pte);
-
- addr += HPAGE_SIZE;
- } while (addr < vma->vm_end);
-
- retval = 0;
- vma->vm_flags |= (VM_HUGETLB | VM_RESERVED);
- vma->vm_ops = &hugetlb_vm_ops;
- spin_unlock(&mm->page_table_lock);
- spin_lock(&htlbpage_lock);
- atomic_set(&inode->i_writecount, 0);
- spin_unlock(&htlbpage_lock);
-
- return retval;
-
-out:
- if (addr > vma->vm_start) {
- unsigned long raddr;
- raddr = vma->vm_end;
- vma->vm_end = addr;
-
- flush_cache_range(vma, vma->vm_start, vma->vm_end);
- zap_hugetlb_resources(vma);
- flush_tlb_range(vma, vma->vm_start, vma->vm_end);
-
- vma->vm_end = raddr;
- }
- spin_unlock(&mm->page_table_lock);
- do_munmap(mm, vma->vm_start, len);
- if (newalloc)
- goto freeinode;
-
- return retval;
-
-out_err:
- spin_unlock(&htlbpage_lock);
-
-freeinode:
- if (newalloc) {
- for (idx = 0; idx < MAX_ID; idx++) {
- if (htlbpagek[idx].key == inode->i_ino) {
- htlbpagek[idx].key = 0;
- htlbpagek[idx].in = NULL;
- break;
- }
- }
- kfree(inode);
- }
- return retval;
-}
-
-static int alloc_private_hugetlb_pages(int key, unsigned long addr, unsigned long len,
- int prot, int flag)
-{
- if (!capable(CAP_SYS_ADMIN)) {
- if (!in_group_p(0))
- return -EPERM;
- }
- addr = do_mmap_pgoff(NULL, addr, len, prot,
- MAP_NORESERVE|MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, 0);
- if (IS_ERR((void *) addr))
- return -ENOMEM;
- if (make_hugetlb_pages_present(addr, (addr + len), flag) < 0) {
- do_munmap(current->mm, addr, len);
- return -ENOMEM;
- }
- return 0;
-}
-
-int alloc_hugetlb_pages(int key, unsigned long addr, unsigned long len, int prot,
- int flag)
-{
- if (key > 0)
- return alloc_shared_hugetlb_pages(key, addr, len, prot, flag);
- return alloc_private_hugetlb_pages(key, addr, len, prot, flag);
-}
-
extern long htlbzone_pages;
extern struct list_head htlbpage_freelist;
diff -Nru a/arch/sparc64/solaris/misc.c b/arch/sparc64/solaris/misc.c
--- a/arch/sparc64/solaris/misc.c Tue Aug 19 12:12:41 2003
+++ b/arch/sparc64/solaris/misc.c Tue Aug 26 09:25:41 2003
@@ -77,8 +77,8 @@
goto out;
else {
struct inode * inode = file->f_dentry->d_inode;
- if(major(inode->i_rdev) == MEM_MAJOR &&
- minor(inode->i_rdev) == 5) {
+ if(imajor(inode) == MEM_MAJOR &&
+ iminor(inode) == 5) {
flags |= MAP_ANONYMOUS;
fput(file);
file = NULL;
diff -Nru a/arch/sparc64/solaris/socksys.c b/arch/sparc64/solaris/socksys.c
--- a/arch/sparc64/solaris/socksys.c Wed May 7 08:47:29 2003
+++ b/arch/sparc64/solaris/socksys.c Tue Aug 26 09:25:40 2003
@@ -70,14 +70,14 @@
(int (*)(int,int,int))SUNOS(97);
struct sol_socket_struct * sock;
- family = ((minor(inode->i_rdev) >> 4) & 0xf);
+ family = ((iminor(inode) >> 4) & 0xf);
switch (family) {
case AF_UNIX:
type = SOCK_STREAM;
protocol = 0;
break;
case AF_INET:
- protocol = af_inet_protocols[minor(inode->i_rdev) & 0xf];
+ protocol = af_inet_protocols[iminor(inode) & 0xf];
switch (protocol) {
case IPPROTO_TCP: type = SOCK_STREAM; break;
case IPPROTO_UDP: type = SOCK_DGRAM; break;
diff -Nru a/arch/sparc64/solaris/timod.c b/arch/sparc64/solaris/timod.c
--- a/arch/sparc64/solaris/timod.c Fri Jun 6 04:40:53 2003
+++ b/arch/sparc64/solaris/timod.c Tue Aug 26 09:25:41 2003
@@ -924,7 +924,7 @@
if (!ino) goto out;
if (!ino->i_sock &&
- (major(ino->i_rdev) != 30 || minor(ino->i_rdev) != 1))
+ (imajor(ino) != 30 || iminor(ino) != 1))
goto out;
ctlptr = (struct strbuf *)A(arg1);
diff -Nru a/arch/v850/Kconfig b/arch/v850/Kconfig
--- a/arch/v850/Kconfig Sat Aug 2 14:26:16 2003
+++ b/arch/v850/Kconfig Sun Aug 31 16:14:22 2003
@@ -262,14 +262,6 @@
menu "Executable file formats"
-config KCORE_AOUT
- bool
- default y
-
-config KCORE_ELF
- bool
- default y
-
source "fs/Kconfig.binfmt"
endmenu
diff -Nru a/arch/v850/kernel/vmlinux.lds.S b/arch/v850/kernel/vmlinux.lds.S
--- a/arch/v850/kernel/vmlinux.lds.S Mon Aug 4 20:42:12 2003
+++ b/arch/v850/kernel/vmlinux.lds.S Tue Aug 26 00:21:26 2003
@@ -33,6 +33,30 @@
*(.intv.mach) /* Machine-specific int. vectors. */ \
__intv_end = . ;
+#define RODATA_CONTENTS \
+ . = ALIGN (16) ; \
+ *(.rodata) *(.rodata.*) \
+ *(__vermagic) /* Kernel version magic */ \
+ *(.rodata1) \
+ /* Kernel symbol table: Normal symbols */ \
+ ___start___ksymtab = .; \
+ *(__ksymtab) \
+ ___stop___ksymtab = .; \
+ /* Kernel symbol table: GPL-only symbols */ \
+ ___start___ksymtab_gpl = .; \
+ *(__ksymtab_gpl) \
+ ___stop___ksymtab_gpl = .; \
+ /* Kernel symbol table: strings */ \
+ *(__ksymtab_strings) \
+ /* Kernel symbol table: Normal symbols */ \
+ ___start___kcrctab = .; \
+ *(__kcrctab) \
+ ___stop___kcrctab = .; \
+ /* Kernel symbol table: GPL-only symbols */ \
+ ___start___kcrctab_gpl = .; \
+ *(__kcrctab_gpl) \
+ ___stop___kcrctab_gpl = .; \
+
/* Kernel text segment, and some constant data areas. */
#define TEXT_CONTENTS \
__stext = . ; \
@@ -42,7 +66,7 @@
*(.text.lock) \
*(.exitcall.exit) \
__real_etext = . ; /* There may be data after here. */ \
- RODATA \
+ RODATA_CONTENTS \
. = ALIGN (4) ; \
*(.call_table_data) \
*(.call_table_text) \
diff -Nru a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
--- a/arch/x86_64/Kconfig Sat Aug 2 14:26:16 2003
+++ b/arch/x86_64/Kconfig Sun Aug 31 16:14:22 2003
@@ -370,11 +370,6 @@
menu "Executable file formats / Emulations"
-config KCORE_ELF
- bool
- depends on PROC_FS
- default y
-
source "fs/Kconfig.binfmt"
config IA32_EMULATION
diff -Nru a/arch/x86_64/defconfig b/arch/x86_64/defconfig
--- a/arch/x86_64/defconfig Sat Aug 9 07:53:46 2003
+++ b/arch/x86_64/defconfig Sat Aug 23 04:57:05 2003
@@ -14,6 +14,7 @@
# Code maturity level options
#
CONFIG_EXPERIMENTAL=y
+# CONFIG_BROKEN is not set
#
# General setup
@@ -23,10 +24,12 @@
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_SYSCTL=y
CONFIG_LOG_BUF_SHIFT=18
+# CONFIG_IKCONFIG is not set
# CONFIG_EMBEDDED is not set
CONFIG_KALLSYMS=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
+CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y
@@ -72,10 +75,10 @@
CONFIG_SOFTWARE_SUSPEND=y
#
-# ACPI Support
+# ACPI (Advanced Configuration and Power Interface) Support
#
+# CONFIG_ACPI_HT is not set
CONFIG_ACPI=y
-# CONFIG_ACPI_HT_ONLY is not set
CONFIG_ACPI_BOOT=y
CONFIG_ACPI_SLEEP=y
CONFIG_ACPI_SLEEP_PROC_FS=y
@@ -117,7 +120,6 @@
#
# Generic Driver Options
#
-# CONFIG_FW_LOADER is not set
#
# Memory Technology Devices (MTD)
@@ -159,6 +161,7 @@
CONFIG_IDEDISK_MULTI_MODE=y
# CONFIG_IDEDISK_STROKE 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_IDE_TASK_IOCTL is not set
@@ -318,7 +321,6 @@
# CONFIG_DECNET is not set
# CONFIG_BRIDGE is not set
# CONFIG_NETFILTER is not set
-# CONFIG_XFRM_USER is not set
#
# SCTP Configuration (EXPERIMENTAL)
@@ -405,6 +407,7 @@
# CONFIG_HAMACHI is not set
# CONFIG_YELLOWFIN is not set
# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
# CONFIG_SK98LIN is not set
CONFIG_TIGON3=y
@@ -595,10 +598,7 @@
CONFIG_REISERFS_FS=y
# CONFIG_REISERFS_CHECK is not set
# CONFIG_REISERFS_PROC_INFO is not set
-CONFIG_JFS_FS=y
-CONFIG_JFS_POSIX_ACL=y
-# CONFIG_JFS_DEBUG is not set
-# CONFIG_JFS_STATISTICS is not set
+# CONFIG_JFS_FS is not set
CONFIG_FS_POSIX_ACL=y
# CONFIG_XFS_FS is not set
# CONFIG_MINIX_FS is not set
@@ -674,49 +674,6 @@
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y
-CONFIG_NLS=y
-
-#
-# Native Language Support
-#
-CONFIG_NLS_DEFAULT="iso8859-1"
-# CONFIG_NLS_CODEPAGE_437 is not set
-# CONFIG_NLS_CODEPAGE_737 is not set
-# CONFIG_NLS_CODEPAGE_775 is not set
-# CONFIG_NLS_CODEPAGE_850 is not set
-# CONFIG_NLS_CODEPAGE_852 is not set
-# CONFIG_NLS_CODEPAGE_855 is not set
-# CONFIG_NLS_CODEPAGE_857 is not set
-# CONFIG_NLS_CODEPAGE_860 is not set
-# CONFIG_NLS_CODEPAGE_861 is not set
-# CONFIG_NLS_CODEPAGE_862 is not set
-# CONFIG_NLS_CODEPAGE_863 is not set
-# CONFIG_NLS_CODEPAGE_864 is not set
-# CONFIG_NLS_CODEPAGE_865 is not set
-# CONFIG_NLS_CODEPAGE_866 is not set
-# CONFIG_NLS_CODEPAGE_869 is not set
-# CONFIG_NLS_CODEPAGE_936 is not set
-# CONFIG_NLS_CODEPAGE_950 is not set
-# CONFIG_NLS_CODEPAGE_932 is not set
-# CONFIG_NLS_CODEPAGE_949 is not set
-# CONFIG_NLS_CODEPAGE_874 is not set
-# CONFIG_NLS_ISO8859_8 is not set
-# CONFIG_NLS_CODEPAGE_1250 is not set
-# CONFIG_NLS_CODEPAGE_1251 is not set
-# CONFIG_NLS_ISO8859_1 is not set
-# CONFIG_NLS_ISO8859_2 is not set
-# CONFIG_NLS_ISO8859_3 is not set
-# CONFIG_NLS_ISO8859_4 is not set
-# CONFIG_NLS_ISO8859_5 is not set
-# CONFIG_NLS_ISO8859_6 is not set
-# CONFIG_NLS_ISO8859_7 is not set
-# CONFIG_NLS_ISO8859_9 is not set
-# CONFIG_NLS_ISO8859_13 is not set
-# CONFIG_NLS_ISO8859_14 is not set
-# CONFIG_NLS_ISO8859_15 is not set
-# CONFIG_NLS_KOI8_R is not set
-# CONFIG_NLS_KOI8_U is not set
-# CONFIG_NLS_UTF8 is not set
#
# Graphics support
diff -Nru a/arch/x86_64/ia32/ia32_ioctl.c b/arch/x86_64/ia32/ia32_ioctl.c
--- a/arch/x86_64/ia32/ia32_ioctl.c Fri Jul 11 05:14:13 2003
+++ b/arch/x86_64/ia32/ia32_ioctl.c Sun Aug 31 16:14:44 2003
@@ -673,12 +673,10 @@
return err;
}
-#define REF_SYMBOL(handler) if (0) (void)handler;
-#define HANDLE_IOCTL2(cmd,handler) REF_SYMBOL(handler); asm volatile(".quad %P0, " #handler ",0"::"i" (cmd));
-#define HANDLE_IOCTL(cmd,handler) HANDLE_IOCTL2(cmd,handler)
+#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler), NULL },
#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL(cmd,sys_ioctl)
-#define IOCTL_TABLE_START void ioctl_dummy(void) { asm volatile("\n.global ioctl_start\nioctl_start:\n\t" );
-#define IOCTL_TABLE_END asm volatile("\n.global ioctl_end;\nioctl_end:\n"); }
+#define IOCTL_TABLE_START struct ioctl_trans ioctl_start[] = {
+#define IOCTL_TABLE_END };
IOCTL_TABLE_START
#include
@@ -765,3 +763,4 @@
HANDLE_IOCTL(MTRRIOC32_KILL_PAGE_ENTRY, mtrr_ioctl32)
IOCTL_TABLE_END
+int ioctl_table_size = ARRAY_SIZE(ioctl_start);
diff -Nru a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c
--- a/arch/x86_64/ia32/sys_ia32.c Mon Jul 14 04:19:39 2003
+++ b/arch/x86_64/ia32/sys_ia32.c Sun Aug 31 05:33:07 2003
@@ -1170,8 +1170,6 @@
return ret;
}
-extern void check_pending(int signum);
-
asmlinkage long sys_utimes(char *, struct timeval *);
asmlinkage long
diff -Nru a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c
--- a/arch/x86_64/kernel/apic.c Mon Aug 18 19:46:23 2003
+++ b/arch/x86_64/kernel/apic.c Sat Aug 23 05:13:33 2003
@@ -299,7 +299,7 @@
* This is meaningless in clustered apic mode, so we skip it.
*/
if (!clustered_apic_mode &&
- !cpu_isset(GET_APIC_ID(apic_read(APIC_ID)), phys_cpu_present_map))
+ !physid_isset(GET_APIC_ID(apic_read(APIC_ID)), phys_cpu_present_map))
BUG();
/*
@@ -993,7 +993,7 @@
connect_bsp_APIC();
- phys_cpu_present_map = cpumask_of_cpu(0);
+ phys_cpu_present_map = physid_mask_of_physid(0);
apic_write_around(APIC_ID, boot_cpu_id);
setup_local_APIC();
diff -Nru a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
--- a/arch/x86_64/kernel/io_apic.c Tue Aug 19 07:45:10 2003
+++ b/arch/x86_64/kernel/io_apic.c Sat Aug 23 05:13:33 2003
@@ -1014,7 +1014,7 @@
static void __init setup_ioapic_ids_from_mpc (void)
{
union IO_APIC_reg_00 reg_00;
- cpumask_t phys_id_present_map = phys_cpu_present_map;
+ physid_mask_t phys_id_present_map = phys_cpu_present_map;
int apic;
int i;
unsigned char old_id;
@@ -1047,22 +1047,22 @@
* system must have a unique ID or we get lots of nice
* 'stuck on smp_invalidate_needed IPI wait' messages.
*/
- if (cpu_isset(mp_ioapics[apic].mpc_apicid, phys_id_present_map)) {
+ if (physid_isset(mp_ioapics[apic].mpc_apicid, phys_id_present_map)) {
printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n",
apic, mp_ioapics[apic].mpc_apicid);
for (i = 0; i < 0xf; i++)
- if (!cpu_isset(i, phys_id_present_map))
+ if (!physid_isset(i, phys_id_present_map))
break;
if (i >= 0xf)
panic("Max APIC ID exceeded!\n");
printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n",
i);
- cpu_set(i, phys_id_present_map);
+ physid_set(i, phys_id_present_map);
mp_ioapics[apic].mpc_apicid = i;
} else {
printk(KERN_INFO
"Using IO-APIC %d\n", mp_ioapics[apic].mpc_apicid);
- cpu_set(mp_ioapics[apic].mpc_apicid, phys_id_present_map);
+ physid_set(mp_ioapics[apic].mpc_apicid, phys_id_present_map);
}
@@ -1642,7 +1642,7 @@
int __init io_apic_get_unique_id (int ioapic, int apic_id)
{
union IO_APIC_reg_00 reg_00;
- static cpumask_t apic_id_map;
+ static physid_mask_t apic_id_map;
unsigned long flags;
int i = 0;
@@ -1655,7 +1655,7 @@
* advantage of new APIC bus architecture.
*/
- if (!cpus_empty(apic_id_map))
+ if (!physids_empty(apic_id_map))
apic_id_map = phys_cpu_present_map;
spin_lock_irqsave(&ioapic_lock, flags);
@@ -1672,10 +1672,10 @@
* Every APIC in a system must have a unique ID or we get lots of nice
* 'stuck on smp_invalidate_needed IPI wait' messages.
*/
- if (cpu_isset(apic_id, apic_id_map)) {
+ if (physid_isset(apic_id, apic_id_map)) {
for (i = 0; i < IO_APIC_MAX_ID; i++) {
- if (!cpu_isset(i, apic_id_map))
+ if (!physid_isset(i, apic_id_map))
break;
}
@@ -1688,7 +1688,7 @@
apic_id = i;
}
- cpu_set(apic_id, apic_id_map);
+ physid_set(apic_id, apic_id_map);
if (reg_00.bits.ID != apic_id) {
reg_00.bits.ID = apic_id;
diff -Nru a/arch/x86_64/kernel/ioport.c b/arch/x86_64/kernel/ioport.c
--- a/arch/x86_64/kernel/ioport.c Wed Aug 20 10:43:52 2003
+++ b/arch/x86_64/kernel/ioport.c Sat Aug 23 05:03:34 2003
@@ -10,12 +10,11 @@
#include
#include
#include
-#include
#include
#include
#include
#include
-#include
+#include
/* Set EXTENT bits starting at BASE in BITMAP to value TURN_ON. */
static void set_bitmap(unsigned long *bitmap, unsigned int base, unsigned int extent, int new_value)
@@ -118,12 +117,7 @@
return -EPERM;
}
regs.eflags = (regs.eflags &~ 0x3000UL) | (level << 12);
+ /* Make sure we return the long way (not sysenter) */
+ set_thread_flag(TIF_IRET);
return 0;
}
-
-void eat_key(void)
-{
- if (inb(0x60) & 1)
- inb(0x64);
-}
-
diff -Nru a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c
--- a/arch/x86_64/kernel/mpparse.c Tue Aug 19 07:45:28 2003
+++ b/arch/x86_64/kernel/mpparse.c Sat Aug 23 05:13:33 2003
@@ -67,7 +67,7 @@
static unsigned int num_processors = 0;
/* Bitmask of physically existing CPUs */
-cpumask_t phys_cpu_present_map = CPU_MASK_NONE;
+physid_mask_t phys_cpu_present_map = PHYSID_MASK_NONE;
/* ACPI MADT entry parsing functions */
#ifdef CONFIG_ACPI_BOOT
@@ -126,7 +126,7 @@
}
ver = m->mpc_apicver;
- cpu_set(m->mpc_apicid, phys_cpu_present_map);
+ physid_set(m->mpc_apicid, phys_cpu_present_map);
/*
* Validate version
*/
diff -Nru a/arch/x86_64/kernel/msr.c b/arch/x86_64/kernel/msr.c
--- a/arch/x86_64/kernel/msr.c Mon Aug 18 19:46:23 2003
+++ b/arch/x86_64/kernel/msr.c Tue Aug 26 09:25:40 2003
@@ -194,7 +194,7 @@
u32 data[2];
size_t rv;
u32 reg = *ppos;
- int cpu = minor(file->f_dentry->d_inode->i_rdev);
+ int cpu = iminor(file->f_dentry->d_inode);
int err;
if ( count % 8 )
@@ -219,7 +219,7 @@
u32 data[2];
size_t rv;
u32 reg = *ppos;
- int cpu = minor(file->f_dentry->d_inode->i_rdev);
+ int cpu = iminor(file->f_dentry->d_inode);
int err;
if ( count % 8 )
@@ -239,7 +239,7 @@
static int msr_open(struct inode *inode, struct file *file)
{
- int cpu = minor(file->f_dentry->d_inode->i_rdev);
+ int cpu = iminor(file->f_dentry->d_inode);
struct cpuinfo_x86 *c = &(cpu_data)[cpu];
if (!cpu_online(cpu))
diff -Nru a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
--- a/arch/x86_64/kernel/setup.c Mon Aug 18 19:46:23 2003
+++ b/arch/x86_64/kernel/setup.c Sat Aug 23 04:55:48 2003
@@ -243,6 +243,8 @@
void __init setup_arch(char **cmdline_p)
{
+ unsigned long low_mem_size;
+
ROOT_DEV = ORIG_ROOT_DEV;
drive_info = DRIVE_INFO;
screen_info = SCREEN_INFO;
@@ -378,7 +380,13 @@
request_resource(&ioport_resource, standard_io_resources+i);
}
- pci_mem_start = IOMAP_START;
+ /* Will likely break when you have unassigned resources with more
+ than 4GB memory and bridges that don't support more than 4GB.
+ Doing it properly would require to allocate GFP_DMA memory
+ in this case. */
+ low_mem_size = ((end_pfn << PAGE_SHIFT) + 0xfffff) & ~0xfffff;
+ if (low_mem_size > pci_mem_start)
+ pci_mem_start = low_mem_size;
#ifdef CONFIG_GART_IOMMU
iommu_hole_init();
diff -Nru a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
--- a/arch/x86_64/kernel/smpboot.c Mon Aug 18 19:46:23 2003
+++ b/arch/x86_64/kernel/smpboot.c Sat Aug 23 05:13:33 2003
@@ -734,10 +734,10 @@
current_thread_info()->cpu = 0;
smp_tune_scheduling();
- if (!cpu_isset(hard_smp_processor_id(), phys_cpu_present_map)) {
+ if (!physid_isset(hard_smp_processor_id(), phys_cpu_present_map)) {
printk("weird, boot CPU (#%d) not listed by the BIOS.\n",
hard_smp_processor_id());
- cpu_set(hard_smp_processor_id(), phys_cpu_present_map);
+ physid_set(hard_smp_processor_id(), phys_cpu_present_map);
}
/*
@@ -748,7 +748,7 @@
printk(KERN_NOTICE "SMP motherboard not detected.\n");
io_apic_irqs = 0;
cpu_online_map = cpumask_of_cpu(0);
- phys_cpu_present_map = cpumask_of_cpu(0);
+ phys_cpu_present_map = physid_mask_of_physid(0);
if (APIC_init_uniprocessor())
printk(KERN_NOTICE "Local APIC not detected."
" Using dummy APIC emulation.\n");
@@ -759,10 +759,10 @@
* Should not be necessary because the MP table should list the boot
* CPU too, but we do it for the sake of robustness anyway.
*/
- if (!cpu_isset(boot_cpu_id, phys_cpu_present_map)) {
+ if (!physid_isset(boot_cpu_id, phys_cpu_present_map)) {
printk(KERN_NOTICE "weird, boot CPU (#%d) not listed by the BIOS.\n",
boot_cpu_id);
- cpu_set(hard_smp_processor_id(), phys_cpu_present_map);
+ physid_set(hard_smp_processor_id(), phys_cpu_present_map);
}
/*
@@ -774,7 +774,7 @@
printk(KERN_ERR "... forcing use of dummy APIC emulation. (tell your hw vendor)\n");
io_apic_irqs = 0;
cpu_online_map = cpumask_of_cpu(0);
- phys_cpu_present_map = cpumask_of_cpu(0);
+ phys_cpu_present_map = physid_mask_of_physid(0);
disable_apic = 1;
goto smp_done;
}
@@ -789,7 +789,7 @@
printk(KERN_INFO "SMP mode deactivated, forcing use of dummy APIC emulation.\n");
io_apic_irqs = 0;
cpu_online_map = cpumask_of_cpu(0);
- phys_cpu_present_map = cpumask_of_cpu(0);
+ phys_cpu_present_map = physid_mask_of_physid(0);
disable_apic = 1;
goto smp_done;
}
@@ -803,7 +803,7 @@
/*
* Now scan the CPU present map and fire up the other CPUs.
*/
- Dprintk("CPU present map: %lx\n", phys_cpu_present_map);
+ Dprintk("CPU present map: %lx\n", physids_coerce(phys_cpu_present_map));
for (apicid = 0; apicid < NR_CPUS; apicid++) {
/*
diff -Nru a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
--- a/arch/x86_64/kernel/time.c Thu Jul 10 22:22:57 2003
+++ b/arch/x86_64/kernel/time.c Sat Aug 23 04:31:18 2003
@@ -79,6 +79,7 @@
unsigned long t;
unsigned long x;
rdtscll_sync(&t);
+ if (t < vxtime.last_tsc) t = vxtime.last_tsc; /* hack */
x = ((t - vxtime.last_tsc) * vxtime.tsc_quot) >> 32;
return x;
}
diff -Nru a/arch/x86_64/kernel/vsyscall.c b/arch/x86_64/kernel/vsyscall.c
--- a/arch/x86_64/kernel/vsyscall.c Fri Jun 13 01:16:29 2003
+++ b/arch/x86_64/kernel/vsyscall.c Sat Aug 23 04:31:40 2003
@@ -85,6 +85,7 @@
if (__vxtime.mode == VXTIME_TSC) {
sync_core();
rdtscll(t);
+ if (t < __vxtime.last_tsc) t = __vxtime.last_tsc;
usec += ((t - __vxtime.last_tsc) *
__vxtime.tsc_quot) >> 32;
} else {
diff -Nru a/drivers/Makefile b/drivers/Makefile
--- a/drivers/Makefile Tue Aug 12 08:42:21 2003
+++ b/drivers/Makefile Sun Aug 24 07:59:26 2003
@@ -20,6 +20,7 @@
obj-y += base/ block/ misc/ net/ media/
obj-$(CONFIG_NUBUS) += nubus/
obj-$(CONFIG_ATM) += atm/
+obj-$(CONFIG_PPC_PMAC) += macintosh/
obj-$(CONFIG_IDE) += ide/
obj-$(CONFIG_FC4) += fc4/
obj-$(CONFIG_SCSI) += scsi/
@@ -31,7 +32,6 @@
obj-$(CONFIG_DIO) += dio/
obj-$(CONFIG_SBUS) += sbus/
obj-$(CONFIG_ZORRO) += zorro/
-obj-$(CONFIG_PPC_PMAC) += macintosh/
obj-$(CONFIG_MAC) += macintosh/
obj-$(CONFIG_PARIDE) += block/paride/
obj-$(CONFIG_TC) += tc/
diff -Nru a/drivers/acorn/block/fd1772.c b/drivers/acorn/block/fd1772.c
--- a/drivers/acorn/block/fd1772.c Thu Aug 7 02:25:23 2003
+++ b/drivers/acorn/block/fd1772.c Tue Aug 26 09:25:40 2003
@@ -1455,8 +1455,8 @@
static int floppy_open(struct inode *inode, struct file *filp)
{
- int drive = minor(inode->i_rdev) & 3;
- int type = minor(inode->i_rdev) >> 2;
+ int drive = iminor(inode) & 3;
+ int type = iminor(inode) >> 2;
int old_dev = fd_device[drive];
if (fd_ref[drive] && old_dev != type)
@@ -1490,7 +1490,7 @@
static int floppy_release(struct inode *inode, struct file *filp)
{
- int drive = minor(inode->i_rdev) & 3;
+ int drive = iminor(inode) & 3;
if (fd_ref[drive] < 0)
fd_ref[drive] = 0;
diff -Nru a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
--- a/drivers/acpi/Kconfig Wed Aug 20 09:06:49 2003
+++ b/drivers/acpi/Kconfig Sat Aug 23 04:07:34 2003
@@ -69,6 +69,7 @@
bool "Sleep States (EXPERIMENTAL)"
depends on X86 && ACPI
depends on EXPERIMENTAL && PM
+ select SOFTWARE_SUSPEND
default y
---help---
This option adds support for ACPI suspend states.
diff -Nru a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
--- a/drivers/acpi/pci_link.c Tue Jul 29 13:28:29 2003
+++ b/drivers/acpi/pci_link.c Sun Aug 31 16:14:25 2003
@@ -516,9 +516,8 @@
return_VALUE(0);
}
- if (acpi_pci_link_allocate(link)) {
- return -ENODEV;
- }
+ if (acpi_pci_link_allocate(link))
+ return_VALUE(0);
if (!link->irq.active) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Link disabled\n"));
diff -Nru a/drivers/atm/eni.c b/drivers/atm/eni.c
--- a/drivers/atm/eni.c Tue Aug 19 21:10:45 2003
+++ b/drivers/atm/eni.c Sun Aug 31 16:14:27 2003
@@ -2345,7 +2345,7 @@
struct sk_buff *skb; /* dummy for sizeof */
if (sizeof(skb->cb) < sizeof(struct eni_skb_prv)) {
- printk(KERN_ERR "eni_detect: skb->cb is too small (%d < %d)\n",
+ printk(KERN_ERR "eni_detect: skb->cb is too small (%Zd < %Zd)\n",
sizeof(skb->cb),sizeof(struct eni_skb_prv));
return -EIO;
}
diff -Nru a/drivers/atm/firestream.c b/drivers/atm/firestream.c
--- a/drivers/atm/firestream.c Tue Aug 19 21:10:45 2003
+++ b/drivers/atm/firestream.c Sun Aug 31 16:14:27 2003
@@ -895,7 +895,7 @@
/* XXX handle qos parameters (rate limiting) ? */
vcc = kmalloc(sizeof(struct fs_vcc), GFP_KERNEL);
- fs_dprintk (FS_DEBUG_ALLOC, "Alloc VCC: %p(%d)\n", vcc, sizeof(struct fs_vcc));
+ fs_dprintk (FS_DEBUG_ALLOC, "Alloc VCC: %p(%Zd)\n", vcc, sizeof(struct fs_vcc));
if (!vcc) {
clear_bit(ATM_VF_ADDR, &atm_vcc->flags);
return -ENOMEM;
@@ -946,7 +946,7 @@
if (DO_DIRECTION (txtp)) {
tc = kmalloc (sizeof (struct fs_transmit_config), GFP_KERNEL);
- fs_dprintk (FS_DEBUG_ALLOC, "Alloc tc: %p(%d)\n",
+ fs_dprintk (FS_DEBUG_ALLOC, "Alloc tc: %p(%Zd)\n",
tc, sizeof (struct fs_transmit_config));
if (!tc) {
fs_dprintk (FS_DEBUG_OPEN, "fs: can't alloc transmit_config.\n");
@@ -1180,7 +1180,7 @@
vcc->last_skb = skb;
td = kmalloc (sizeof (struct FS_BPENTRY), GFP_ATOMIC);
- fs_dprintk (FS_DEBUG_ALLOC, "Alloc transd: %p(%d)\n", td, sizeof (struct FS_BPENTRY));
+ fs_dprintk (FS_DEBUG_ALLOC, "Alloc transd: %p(%Zd)\n", td, sizeof (struct FS_BPENTRY));
if (!td) {
/* Oops out of mem */
return -ENOMEM;
@@ -1487,7 +1487,7 @@
fs_dprintk (FS_DEBUG_ALLOC, "Alloc rec-skb: %p(%d)\n", skb, fp->bufsize);
if (!skb) break;
ne = kmalloc (sizeof (struct FS_BPENTRY), gfp_flags);
- fs_dprintk (FS_DEBUG_ALLOC, "Alloc rec-d: %p(%d)\n", ne, sizeof (struct FS_BPENTRY));
+ fs_dprintk (FS_DEBUG_ALLOC, "Alloc rec-d: %p(%Zd)\n", ne, sizeof (struct FS_BPENTRY));
if (!ne) {
fs_dprintk (FS_DEBUG_ALLOC, "Free rec-skb: %p\n", skb);
dev_kfree_skb_any (skb);
@@ -1792,7 +1792,7 @@
}
dev->atm_vccs = kmalloc (dev->nchannels * sizeof (struct atm_vcc *),
GFP_KERNEL);
- fs_dprintk (FS_DEBUG_ALLOC, "Alloc atmvccs: %p(%d)\n",
+ fs_dprintk (FS_DEBUG_ALLOC, "Alloc atmvccs: %p(%Zd)\n",
dev->atm_vccs, dev->nchannels * sizeof (struct atm_vcc *));
if (!dev->atm_vccs) {
@@ -1900,7 +1900,7 @@
goto err_out;
fs_dev = kmalloc (sizeof (struct fs_dev), GFP_KERNEL);
- fs_dprintk (FS_DEBUG_ALLOC, "Alloc fs-dev: %p(%d)\n",
+ fs_dprintk (FS_DEBUG_ALLOC, "Alloc fs-dev: %p(%Zd)\n",
fs_dev, sizeof (struct fs_dev));
if (!fs_dev)
goto err_out;
diff -Nru a/drivers/block/DAC960.c b/drivers/block/DAC960.c
--- a/drivers/block/DAC960.c Fri Aug 15 09:39:48 2003
+++ b/drivers/block/DAC960.c Sun Aug 31 16:13:56 2003
@@ -23,6 +23,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -44,6 +45,8 @@
#include
#include "DAC960.h"
+#define DAC960_GAM_MINOR 252
+
static DAC960_Controller_T *DAC960_Controllers[DAC960_MaxControllers];
static int DAC960_ControllerCount;
@@ -71,10 +74,6 @@
DAC960_Controller_T *p = disk->queue->queuedata;
int drive_nr = (int)disk->private_data;
- /* bad hack for the "user" ioctls */
- if (!p->ControllerNumber && !drive_nr && (file->f_flags & O_NONBLOCK))
- return 0;
-
if (p->FirmwareType == DAC960_V1_Controller) {
if (p->V1.LogicalDriveInformation[drive_nr].
LogicalDriveState == DAC960_V1_LogicalDrive_Offline)
@@ -101,9 +100,6 @@
int drive_nr = (int)disk->private_data;
struct hd_geometry g, *loc = (struct hd_geometry *)arg;
- if (file && (file->f_flags & O_NONBLOCK))
- return DAC960_UserIOCTL(inode, file, cmd, arg);
-
if (cmd != HDIO_GETGEO || !loc)
return -EINVAL;
@@ -5569,407 +5565,6 @@
}
/*
- DAC960_UserIOCTL is the User IOCTL Function for the DAC960 Driver.
-*/
-
-static int DAC960_UserIOCTL(struct inode *inode, struct file *file,
- unsigned int Request, unsigned long Argument)
-{
- int ErrorCode = 0;
- if (!capable(CAP_SYS_ADMIN)) return -EACCES;
- switch (Request)
- {
- case DAC960_IOCTL_GET_CONTROLLER_COUNT:
- return DAC960_ControllerCount;
- case DAC960_IOCTL_GET_CONTROLLER_INFO:
- {
- DAC960_ControllerInfo_T *UserSpaceControllerInfo =
- (DAC960_ControllerInfo_T *) Argument;
- DAC960_ControllerInfo_T ControllerInfo;
- DAC960_Controller_T *Controller;
- int ControllerNumber;
- if (UserSpaceControllerInfo == NULL) return -EINVAL;
- ErrorCode = get_user(ControllerNumber,
- &UserSpaceControllerInfo->ControllerNumber);
- if (ErrorCode != 0) return ErrorCode;
- if (ControllerNumber < 0 ||
- ControllerNumber > DAC960_ControllerCount - 1)
- return -ENXIO;
- Controller = DAC960_Controllers[ControllerNumber];
- if (Controller == NULL) return -ENXIO;
- memset(&ControllerInfo, 0, sizeof(DAC960_ControllerInfo_T));
- ControllerInfo.ControllerNumber = ControllerNumber;
- ControllerInfo.FirmwareType = Controller->FirmwareType;
- ControllerInfo.Channels = Controller->Channels;
- ControllerInfo.Targets = Controller->Targets;
- ControllerInfo.PCI_Bus = Controller->Bus;
- ControllerInfo.PCI_Device = Controller->Device;
- ControllerInfo.PCI_Function = Controller->Function;
- ControllerInfo.IRQ_Channel = Controller->IRQ_Channel;
- ControllerInfo.PCI_Address = Controller->PCI_Address;
- strcpy(ControllerInfo.ModelName, Controller->ModelName);
- strcpy(ControllerInfo.FirmwareVersion, Controller->FirmwareVersion);
- return (copy_to_user(UserSpaceControllerInfo, &ControllerInfo,
- sizeof(DAC960_ControllerInfo_T)) ? -EFAULT : 0);
- }
- case DAC960_IOCTL_V1_EXECUTE_COMMAND:
- {
- DAC960_V1_UserCommand_T *UserSpaceUserCommand =
- (DAC960_V1_UserCommand_T *) Argument;
- DAC960_V1_UserCommand_T UserCommand;
- DAC960_Controller_T *Controller;
- DAC960_Command_T *Command = NULL;
- DAC960_V1_CommandOpcode_T CommandOpcode;
- DAC960_V1_CommandStatus_T CommandStatus;
- DAC960_V1_DCDB_T DCDB;
- DAC960_V1_DCDB_T *DCDB_IOBUF = NULL;
- dma_addr_t DCDB_IOBUFDMA;
- unsigned long flags;
- int ControllerNumber, DataTransferLength;
- unsigned char *DataTransferBuffer = NULL;
- dma_addr_t DataTransferBufferDMA;
- if (UserSpaceUserCommand == NULL) return -EINVAL;
- if (copy_from_user(&UserCommand, UserSpaceUserCommand,
- sizeof(DAC960_V1_UserCommand_T))) {
- ErrorCode = -EFAULT;
- goto Failure1a;
- }
- ControllerNumber = UserCommand.ControllerNumber;
- if (ControllerNumber < 0 ||
- ControllerNumber > DAC960_ControllerCount - 1)
- return -ENXIO;
- Controller = DAC960_Controllers[ControllerNumber];
- if (Controller == NULL) return -ENXIO;
- if (Controller->FirmwareType != DAC960_V1_Controller) return -EINVAL;
- CommandOpcode = UserCommand.CommandMailbox.Common.CommandOpcode;
- DataTransferLength = UserCommand.DataTransferLength;
- if (CommandOpcode & 0x80) return -EINVAL;
- if (CommandOpcode == DAC960_V1_DCDB)
- {
- if (copy_from_user(&DCDB, UserCommand.DCDB,
- sizeof(DAC960_V1_DCDB_T))) {
- ErrorCode = -EFAULT;
- goto Failure1a;
- }
- if (DCDB.Channel >= DAC960_V1_MaxChannels) return -EINVAL;
- if (!((DataTransferLength == 0 &&
- DCDB.Direction
- == DAC960_V1_DCDB_NoDataTransfer) ||
- (DataTransferLength > 0 &&
- DCDB.Direction
- == DAC960_V1_DCDB_DataTransferDeviceToSystem) ||
- (DataTransferLength < 0 &&
- DCDB.Direction
- == DAC960_V1_DCDB_DataTransferSystemToDevice)))
- return -EINVAL;
- if (((DCDB.TransferLengthHigh4 << 16) | DCDB.TransferLength)
- != abs(DataTransferLength))
- return -EINVAL;
- DCDB_IOBUF = pci_alloc_consistent(Controller->PCIDevice,
- sizeof(DAC960_V1_DCDB_T), &DCDB_IOBUFDMA);
- if (DCDB_IOBUF == NULL)
- return -ENOMEM;
- }
- if (DataTransferLength > 0)
- {
- DataTransferBuffer = pci_alloc_consistent(Controller->PCIDevice,
- DataTransferLength, &DataTransferBufferDMA);
- if (DataTransferBuffer == NULL) {
- ErrorCode = -ENOMEM;
- goto Failure1;
- }
- memset(DataTransferBuffer, 0, DataTransferLength);
- }
- else if (DataTransferLength < 0)
- {
- DataTransferBuffer = pci_alloc_consistent(Controller->PCIDevice,
- -DataTransferLength, &DataTransferBufferDMA);
- if (DataTransferBuffer == NULL) {
- ErrorCode = -ENOMEM;
- goto Failure1;
- }
- if (copy_from_user(DataTransferBuffer,
- UserCommand.DataTransferBuffer,
- -DataTransferLength)) {
- ErrorCode = -EFAULT;
- goto Failure1;
- }
- }
- if (CommandOpcode == DAC960_V1_DCDB)
- {
- spin_lock_irqsave(&Controller->queue_lock, flags);
- while ((Command = DAC960_AllocateCommand(Controller)) == NULL)
- DAC960_WaitForCommand(Controller);
- while (Controller->V1.DirectCommandActive[DCDB.Channel]
- [DCDB.TargetID])
- {
- spin_unlock_irq(&Controller->queue_lock);
- __wait_event(Controller->CommandWaitQueue,
- !Controller->V1.DirectCommandActive
- [DCDB.Channel][DCDB.TargetID]);
- spin_lock_irq(&Controller->queue_lock);
- }
- Controller->V1.DirectCommandActive[DCDB.Channel]
- [DCDB.TargetID] = true;
- spin_unlock_irqrestore(&Controller->queue_lock, flags);
- DAC960_V1_ClearCommand(Command);
- Command->CommandType = DAC960_ImmediateCommand;
- memcpy(&Command->V1.CommandMailbox, &UserCommand.CommandMailbox,
- sizeof(DAC960_V1_CommandMailbox_T));
- Command->V1.CommandMailbox.Type3.BusAddress = DCDB_IOBUFDMA;
- DCDB.BusAddress = DataTransferBufferDMA;
- memcpy(DCDB_IOBUF, &DCDB, sizeof(DAC960_V1_DCDB_T));
- }
- else
- {
- spin_lock_irqsave(&Controller->queue_lock, flags);
- while ((Command = DAC960_AllocateCommand(Controller)) == NULL)
- DAC960_WaitForCommand(Controller);
- spin_unlock_irqrestore(&Controller->queue_lock, flags);
- DAC960_V1_ClearCommand(Command);
- Command->CommandType = DAC960_ImmediateCommand;
- memcpy(&Command->V1.CommandMailbox, &UserCommand.CommandMailbox,
- sizeof(DAC960_V1_CommandMailbox_T));
- if (DataTransferBuffer != NULL)
- Command->V1.CommandMailbox.Type3.BusAddress =
- DataTransferBufferDMA;
- }
- DAC960_ExecuteCommand(Command);
- CommandStatus = Command->V1.CommandStatus;
- spin_lock_irqsave(&Controller->queue_lock, flags);
- DAC960_DeallocateCommand(Command);
- spin_unlock_irqrestore(&Controller->queue_lock, flags);
- if (DataTransferLength > 0)
- {
- if (copy_to_user(UserCommand.DataTransferBuffer,
- DataTransferBuffer, DataTransferLength)) {
- ErrorCode = -EFAULT;
- goto Failure1;
- }
- }
- if (CommandOpcode == DAC960_V1_DCDB)
- {
- /*
- I don't believe Target or Channel in the DCDB_IOBUF
- should be any different from the contents of DCDB.
- */
- Controller->V1.DirectCommandActive[DCDB.Channel]
- [DCDB.TargetID] = false;
- if (copy_to_user(UserCommand.DCDB, DCDB_IOBUF,
- sizeof(DAC960_V1_DCDB_T))) {
- ErrorCode = -EFAULT;
- goto Failure1;
- }
- }
- ErrorCode = CommandStatus;
- Failure1:
- if (DataTransferBuffer != NULL)
- pci_free_consistent(Controller->PCIDevice, abs(DataTransferLength),
- DataTransferBuffer, DataTransferBufferDMA);
- if (DCDB_IOBUF != NULL)
- pci_free_consistent(Controller->PCIDevice, sizeof(DAC960_V1_DCDB_T),
- DCDB_IOBUF, DCDB_IOBUFDMA);
- Failure1a:
- return ErrorCode;
- }
- case DAC960_IOCTL_V2_EXECUTE_COMMAND:
- {
- DAC960_V2_UserCommand_T *UserSpaceUserCommand =
- (DAC960_V2_UserCommand_T *) Argument;
- DAC960_V2_UserCommand_T UserCommand;
- DAC960_Controller_T *Controller;
- DAC960_Command_T *Command = NULL;
- DAC960_V2_CommandMailbox_T *CommandMailbox;
- DAC960_V2_CommandStatus_T CommandStatus;
- unsigned long flags;
- int ControllerNumber, DataTransferLength;
- int DataTransferResidue, RequestSenseLength;
- unsigned char *DataTransferBuffer = NULL;
- dma_addr_t DataTransferBufferDMA;
- unsigned char *RequestSenseBuffer = NULL;
- dma_addr_t RequestSenseBufferDMA;
- if (UserSpaceUserCommand == NULL) return -EINVAL;
- if (copy_from_user(&UserCommand, UserSpaceUserCommand,
- sizeof(DAC960_V2_UserCommand_T))) {
- ErrorCode = -EFAULT;
- goto Failure2a;
- }
- ControllerNumber = UserCommand.ControllerNumber;
- if (ControllerNumber < 0 ||
- ControllerNumber > DAC960_ControllerCount - 1)
- return -ENXIO;
- Controller = DAC960_Controllers[ControllerNumber];
- if (Controller == NULL) return -ENXIO;
- if (Controller->FirmwareType != DAC960_V2_Controller) return -EINVAL;
- DataTransferLength = UserCommand.DataTransferLength;
- if (DataTransferLength > 0)
- {
- DataTransferBuffer = pci_alloc_consistent(Controller->PCIDevice,
- DataTransferLength, &DataTransferBufferDMA);
- if (DataTransferBuffer == NULL) return -ENOMEM;
- memset(DataTransferBuffer, 0, DataTransferLength);
- }
- else if (DataTransferLength < 0)
- {
- DataTransferBuffer = pci_alloc_consistent(Controller->PCIDevice,
- -DataTransferLength, &DataTransferBufferDMA);
- if (DataTransferBuffer == NULL) return -ENOMEM;
- if (copy_from_user(DataTransferBuffer,
- UserCommand.DataTransferBuffer,
- -DataTransferLength)) {
- ErrorCode = -EFAULT;
- goto Failure2;
- }
- }
- RequestSenseLength = UserCommand.RequestSenseLength;
- if (RequestSenseLength > 0)
- {
- RequestSenseBuffer = pci_alloc_consistent(Controller->PCIDevice,
- RequestSenseLength, &RequestSenseBufferDMA);
- if (RequestSenseBuffer == NULL)
- {
- ErrorCode = -ENOMEM;
- goto Failure2;
- }
- memset(RequestSenseBuffer, 0, RequestSenseLength);
- }
- spin_lock_irqsave(&Controller->queue_lock, flags);
- while ((Command = DAC960_AllocateCommand(Controller)) == NULL)
- DAC960_WaitForCommand(Controller);
- spin_unlock_irqrestore(&Controller->queue_lock, flags);
- DAC960_V2_ClearCommand(Command);
- Command->CommandType = DAC960_ImmediateCommand;
- CommandMailbox = &Command->V2.CommandMailbox;
- memcpy(CommandMailbox, &UserCommand.CommandMailbox,
- sizeof(DAC960_V2_CommandMailbox_T));
- CommandMailbox->Common.CommandControlBits
- .AdditionalScatterGatherListMemory = false;
- CommandMailbox->Common.CommandControlBits
- .NoAutoRequestSense = true;
- CommandMailbox->Common.DataTransferSize = 0;
- CommandMailbox->Common.DataTransferPageNumber = 0;
- memset(&CommandMailbox->Common.DataTransferMemoryAddress, 0,
- sizeof(DAC960_V2_DataTransferMemoryAddress_T));
- if (DataTransferLength != 0)
- {
- if (DataTransferLength > 0)
- {
- CommandMailbox->Common.CommandControlBits
- .DataTransferControllerToHost = true;
- CommandMailbox->Common.DataTransferSize = DataTransferLength;
- }
- else
- {
- CommandMailbox->Common.CommandControlBits
- .DataTransferControllerToHost = false;
- CommandMailbox->Common.DataTransferSize = -DataTransferLength;
- }
- CommandMailbox->Common.DataTransferMemoryAddress
- .ScatterGatherSegments[0]
- .SegmentDataPointer = DataTransferBufferDMA;
- CommandMailbox->Common.DataTransferMemoryAddress
- .ScatterGatherSegments[0]
- .SegmentByteCount =
- CommandMailbox->Common.DataTransferSize;
- }
- if (RequestSenseLength > 0)
- {
- CommandMailbox->Common.CommandControlBits
- .NoAutoRequestSense = false;
- CommandMailbox->Common.RequestSenseSize = RequestSenseLength;
- CommandMailbox->Common.RequestSenseBusAddress =
- RequestSenseBufferDMA;
- }
- DAC960_ExecuteCommand(Command);
- CommandStatus = Command->V2.CommandStatus;
- RequestSenseLength = Command->V2.RequestSenseLength;
- DataTransferResidue = Command->V2.DataTransferResidue;
- spin_lock_irqsave(&Controller->queue_lock, flags);
- DAC960_DeallocateCommand(Command);
- spin_unlock_irqrestore(&Controller->queue_lock, flags);
- if (RequestSenseLength > UserCommand.RequestSenseLength)
- RequestSenseLength = UserCommand.RequestSenseLength;
- if (copy_to_user(&UserSpaceUserCommand->DataTransferLength,
- &DataTransferResidue,
- sizeof(DataTransferResidue))) {
- ErrorCode = -EFAULT;
- goto Failure2;
- }
- if (copy_to_user(&UserSpaceUserCommand->RequestSenseLength,
- &RequestSenseLength, sizeof(RequestSenseLength))) {
- ErrorCode = -EFAULT;
- goto Failure2;
- }
- if (DataTransferLength > 0)
- {
- if (copy_to_user(UserCommand.DataTransferBuffer,
- DataTransferBuffer, DataTransferLength)) {
- ErrorCode = -EFAULT;
- goto Failure2;
- }
- }
- if (RequestSenseLength > 0)
- {
- if (copy_to_user(UserCommand.RequestSenseBuffer,
- RequestSenseBuffer, RequestSenseLength)) {
- ErrorCode = -EFAULT;
- goto Failure2;
- }
- }
- ErrorCode = CommandStatus;
- Failure2:
- pci_free_consistent(Controller->PCIDevice, abs(DataTransferLength),
- DataTransferBuffer, DataTransferBufferDMA);
- if (RequestSenseBuffer != NULL)
- pci_free_consistent(Controller->PCIDevice, RequestSenseLength,
- RequestSenseBuffer, RequestSenseBufferDMA);
- Failure2a:
- return ErrorCode;
- }
- case DAC960_IOCTL_V2_GET_HEALTH_STATUS:
- {
- DAC960_V2_GetHealthStatus_T *UserSpaceGetHealthStatus =
- (DAC960_V2_GetHealthStatus_T *) Argument;
- DAC960_V2_GetHealthStatus_T GetHealthStatus;
- DAC960_V2_HealthStatusBuffer_T HealthStatusBuffer;
- DAC960_Controller_T *Controller;
- int ControllerNumber;
- if (UserSpaceGetHealthStatus == NULL) return -EINVAL;
- if (copy_from_user(&GetHealthStatus, UserSpaceGetHealthStatus,
- sizeof(DAC960_V2_GetHealthStatus_T)))
- return -EFAULT;
- ControllerNumber = GetHealthStatus.ControllerNumber;
- if (ControllerNumber < 0 ||
- ControllerNumber > DAC960_ControllerCount - 1)
- return -ENXIO;
- Controller = DAC960_Controllers[ControllerNumber];
- if (Controller == NULL) return -ENXIO;
- if (Controller->FirmwareType != DAC960_V2_Controller) return -EINVAL;
- if (copy_from_user(&HealthStatusBuffer,
- GetHealthStatus.HealthStatusBuffer,
- sizeof(DAC960_V2_HealthStatusBuffer_T)))
- return -EFAULT;
- while (Controller->V2.HealthStatusBuffer->StatusChangeCounter
- == HealthStatusBuffer.StatusChangeCounter &&
- Controller->V2.HealthStatusBuffer->NextEventSequenceNumber
- == HealthStatusBuffer.NextEventSequenceNumber)
- {
- interruptible_sleep_on_timeout(&Controller->HealthStatusWaitQueue,
- DAC960_MonitoringTimerInterval);
- if (signal_pending(current)) return -EINTR;
- }
- if (copy_to_user(GetHealthStatus.HealthStatusBuffer,
- Controller->V2.HealthStatusBuffer,
- sizeof(DAC960_V2_HealthStatusBuffer_T)))
- return -EFAULT;
- return 0;
- }
- }
- return -EINVAL;
-}
-
-
-/*
DAC960_CheckStatusBuffer verifies that there is room to hold ByteCount
additional bytes in the Combined Status Buffer and grows the buffer if
necessary. It returns true if there is enough room and false otherwise.
@@ -6901,6 +6496,436 @@
Controller->ControllerProcEntry = NULL;
}
+#ifdef DAC960_GAM_MINOR
+
+/*
+ * DAC960_gam_ioctl is the ioctl function for performing RAID operations.
+*/
+
+static int DAC960_gam_ioctl(struct inode *inode, struct file *file,
+ unsigned int Request, unsigned long Argument)
+{
+ int ErrorCode = 0;
+ if (!capable(CAP_SYS_ADMIN)) return -EACCES;
+ switch (Request)
+ {
+ case DAC960_IOCTL_GET_CONTROLLER_COUNT:
+ return DAC960_ControllerCount;
+ case DAC960_IOCTL_GET_CONTROLLER_INFO:
+ {
+ DAC960_ControllerInfo_T *UserSpaceControllerInfo =
+ (DAC960_ControllerInfo_T *) Argument;
+ DAC960_ControllerInfo_T ControllerInfo;
+ DAC960_Controller_T *Controller;
+ int ControllerNumber;
+ if (UserSpaceControllerInfo == NULL) return -EINVAL;
+ ErrorCode = get_user(ControllerNumber,
+ &UserSpaceControllerInfo->ControllerNumber);
+ if (ErrorCode != 0) return ErrorCode;
+ if (ControllerNumber < 0 ||
+ ControllerNumber > DAC960_ControllerCount - 1)
+ return -ENXIO;
+ Controller = DAC960_Controllers[ControllerNumber];
+ if (Controller == NULL) return -ENXIO;
+ memset(&ControllerInfo, 0, sizeof(DAC960_ControllerInfo_T));
+ ControllerInfo.ControllerNumber = ControllerNumber;
+ ControllerInfo.FirmwareType = Controller->FirmwareType;
+ ControllerInfo.Channels = Controller->Channels;
+ ControllerInfo.Targets = Controller->Targets;
+ ControllerInfo.PCI_Bus = Controller->Bus;
+ ControllerInfo.PCI_Device = Controller->Device;
+ ControllerInfo.PCI_Function = Controller->Function;
+ ControllerInfo.IRQ_Channel = Controller->IRQ_Channel;
+ ControllerInfo.PCI_Address = Controller->PCI_Address;
+ strcpy(ControllerInfo.ModelName, Controller->ModelName);
+ strcpy(ControllerInfo.FirmwareVersion, Controller->FirmwareVersion);
+ return (copy_to_user(UserSpaceControllerInfo, &ControllerInfo,
+ sizeof(DAC960_ControllerInfo_T)) ? -EFAULT : 0);
+ }
+ case DAC960_IOCTL_V1_EXECUTE_COMMAND:
+ {
+ DAC960_V1_UserCommand_T *UserSpaceUserCommand =
+ (DAC960_V1_UserCommand_T *) Argument;
+ DAC960_V1_UserCommand_T UserCommand;
+ DAC960_Controller_T *Controller;
+ DAC960_Command_T *Command = NULL;
+ DAC960_V1_CommandOpcode_T CommandOpcode;
+ DAC960_V1_CommandStatus_T CommandStatus;
+ DAC960_V1_DCDB_T DCDB;
+ DAC960_V1_DCDB_T *DCDB_IOBUF = NULL;
+ dma_addr_t DCDB_IOBUFDMA;
+ unsigned long flags;
+ int ControllerNumber, DataTransferLength;
+ unsigned char *DataTransferBuffer = NULL;
+ dma_addr_t DataTransferBufferDMA;
+ if (UserSpaceUserCommand == NULL) return -EINVAL;
+ if (copy_from_user(&UserCommand, UserSpaceUserCommand,
+ sizeof(DAC960_V1_UserCommand_T))) {
+ ErrorCode = -EFAULT;
+ goto Failure1a;
+ }
+ ControllerNumber = UserCommand.ControllerNumber;
+ if (ControllerNumber < 0 ||
+ ControllerNumber > DAC960_ControllerCount - 1)
+ return -ENXIO;
+ Controller = DAC960_Controllers[ControllerNumber];
+ if (Controller == NULL) return -ENXIO;
+ if (Controller->FirmwareType != DAC960_V1_Controller) return -EINVAL;
+ CommandOpcode = UserCommand.CommandMailbox.Common.CommandOpcode;
+ DataTransferLength = UserCommand.DataTransferLength;
+ if (CommandOpcode & 0x80) return -EINVAL;
+ if (CommandOpcode == DAC960_V1_DCDB)
+ {
+ if (copy_from_user(&DCDB, UserCommand.DCDB,
+ sizeof(DAC960_V1_DCDB_T))) {
+ ErrorCode = -EFAULT;
+ goto Failure1a;
+ }
+ if (DCDB.Channel >= DAC960_V1_MaxChannels) return -EINVAL;
+ if (!((DataTransferLength == 0 &&
+ DCDB.Direction
+ == DAC960_V1_DCDB_NoDataTransfer) ||
+ (DataTransferLength > 0 &&
+ DCDB.Direction
+ == DAC960_V1_DCDB_DataTransferDeviceToSystem) ||
+ (DataTransferLength < 0 &&
+ DCDB.Direction
+ == DAC960_V1_DCDB_DataTransferSystemToDevice)))
+ return -EINVAL;
+ if (((DCDB.TransferLengthHigh4 << 16) | DCDB.TransferLength)
+ != abs(DataTransferLength))
+ return -EINVAL;
+ DCDB_IOBUF = pci_alloc_consistent(Controller->PCIDevice,
+ sizeof(DAC960_V1_DCDB_T), &DCDB_IOBUFDMA);
+ if (DCDB_IOBUF == NULL)
+ return -ENOMEM;
+ }
+ if (DataTransferLength > 0)
+ {
+ DataTransferBuffer = pci_alloc_consistent(Controller->PCIDevice,
+ DataTransferLength, &DataTransferBufferDMA);
+ if (DataTransferBuffer == NULL) {
+ ErrorCode = -ENOMEM;
+ goto Failure1;
+ }
+ memset(DataTransferBuffer, 0, DataTransferLength);
+ }
+ else if (DataTransferLength < 0)
+ {
+ DataTransferBuffer = pci_alloc_consistent(Controller->PCIDevice,
+ -DataTransferLength, &DataTransferBufferDMA);
+ if (DataTransferBuffer == NULL) {
+ ErrorCode = -ENOMEM;
+ goto Failure1;
+ }
+ if (copy_from_user(DataTransferBuffer,
+ UserCommand.DataTransferBuffer,
+ -DataTransferLength)) {
+ ErrorCode = -EFAULT;
+ goto Failure1;
+ }
+ }
+ if (CommandOpcode == DAC960_V1_DCDB)
+ {
+ spin_lock_irqsave(&Controller->queue_lock, flags);
+ while ((Command = DAC960_AllocateCommand(Controller)) == NULL)
+ DAC960_WaitForCommand(Controller);
+ while (Controller->V1.DirectCommandActive[DCDB.Channel]
+ [DCDB.TargetID])
+ {
+ spin_unlock_irq(&Controller->queue_lock);
+ __wait_event(Controller->CommandWaitQueue,
+ !Controller->V1.DirectCommandActive
+ [DCDB.Channel][DCDB.TargetID]);
+ spin_lock_irq(&Controller->queue_lock);
+ }
+ Controller->V1.DirectCommandActive[DCDB.Channel]
+ [DCDB.TargetID] = true;
+ spin_unlock_irqrestore(&Controller->queue_lock, flags);
+ DAC960_V1_ClearCommand(Command);
+ Command->CommandType = DAC960_ImmediateCommand;
+ memcpy(&Command->V1.CommandMailbox, &UserCommand.CommandMailbox,
+ sizeof(DAC960_V1_CommandMailbox_T));
+ Command->V1.CommandMailbox.Type3.BusAddress = DCDB_IOBUFDMA;
+ DCDB.BusAddress = DataTransferBufferDMA;
+ memcpy(DCDB_IOBUF, &DCDB, sizeof(DAC960_V1_DCDB_T));
+ }
+ else
+ {
+ spin_lock_irqsave(&Controller->queue_lock, flags);
+ while ((Command = DAC960_AllocateCommand(Controller)) == NULL)
+ DAC960_WaitForCommand(Controller);
+ spin_unlock_irqrestore(&Controller->queue_lock, flags);
+ DAC960_V1_ClearCommand(Command);
+ Command->CommandType = DAC960_ImmediateCommand;
+ memcpy(&Command->V1.CommandMailbox, &UserCommand.CommandMailbox,
+ sizeof(DAC960_V1_CommandMailbox_T));
+ if (DataTransferBuffer != NULL)
+ Command->V1.CommandMailbox.Type3.BusAddress =
+ DataTransferBufferDMA;
+ }
+ DAC960_ExecuteCommand(Command);
+ CommandStatus = Command->V1.CommandStatus;
+ spin_lock_irqsave(&Controller->queue_lock, flags);
+ DAC960_DeallocateCommand(Command);
+ spin_unlock_irqrestore(&Controller->queue_lock, flags);
+ if (DataTransferLength > 0)
+ {
+ if (copy_to_user(UserCommand.DataTransferBuffer,
+ DataTransferBuffer, DataTransferLength)) {
+ ErrorCode = -EFAULT;
+ goto Failure1;
+ }
+ }
+ if (CommandOpcode == DAC960_V1_DCDB)
+ {
+ /*
+ I don't believe Target or Channel in the DCDB_IOBUF
+ should be any different from the contents of DCDB.
+ */
+ Controller->V1.DirectCommandActive[DCDB.Channel]
+ [DCDB.TargetID] = false;
+ if (copy_to_user(UserCommand.DCDB, DCDB_IOBUF,
+ sizeof(DAC960_V1_DCDB_T))) {
+ ErrorCode = -EFAULT;
+ goto Failure1;
+ }
+ }
+ ErrorCode = CommandStatus;
+ Failure1:
+ if (DataTransferBuffer != NULL)
+ pci_free_consistent(Controller->PCIDevice, abs(DataTransferLength),
+ DataTransferBuffer, DataTransferBufferDMA);
+ if (DCDB_IOBUF != NULL)
+ pci_free_consistent(Controller->PCIDevice, sizeof(DAC960_V1_DCDB_T),
+ DCDB_IOBUF, DCDB_IOBUFDMA);
+ Failure1a:
+ return ErrorCode;
+ }
+ case DAC960_IOCTL_V2_EXECUTE_COMMAND:
+ {
+ DAC960_V2_UserCommand_T *UserSpaceUserCommand =
+ (DAC960_V2_UserCommand_T *) Argument;
+ DAC960_V2_UserCommand_T UserCommand;
+ DAC960_Controller_T *Controller;
+ DAC960_Command_T *Command = NULL;
+ DAC960_V2_CommandMailbox_T *CommandMailbox;
+ DAC960_V2_CommandStatus_T CommandStatus;
+ unsigned long flags;
+ int ControllerNumber, DataTransferLength;
+ int DataTransferResidue, RequestSenseLength;
+ unsigned char *DataTransferBuffer = NULL;
+ dma_addr_t DataTransferBufferDMA;
+ unsigned char *RequestSenseBuffer = NULL;
+ dma_addr_t RequestSenseBufferDMA;
+ if (UserSpaceUserCommand == NULL) return -EINVAL;
+ if (copy_from_user(&UserCommand, UserSpaceUserCommand,
+ sizeof(DAC960_V2_UserCommand_T))) {
+ ErrorCode = -EFAULT;
+ goto Failure2a;
+ }
+ ControllerNumber = UserCommand.ControllerNumber;
+ if (ControllerNumber < 0 ||
+ ControllerNumber > DAC960_ControllerCount - 1)
+ return -ENXIO;
+ Controller = DAC960_Controllers[ControllerNumber];
+ if (Controller == NULL) return -ENXIO;
+ if (Controller->FirmwareType != DAC960_V2_Controller) return -EINVAL;
+ DataTransferLength = UserCommand.DataTransferLength;
+ if (DataTransferLength > 0)
+ {
+ DataTransferBuffer = pci_alloc_consistent(Controller->PCIDevice,
+ DataTransferLength, &DataTransferBufferDMA);
+ if (DataTransferBuffer == NULL) return -ENOMEM;
+ memset(DataTransferBuffer, 0, DataTransferLength);
+ }
+ else if (DataTransferLength < 0)
+ {
+ DataTransferBuffer = pci_alloc_consistent(Controller->PCIDevice,
+ -DataTransferLength, &DataTransferBufferDMA);
+ if (DataTransferBuffer == NULL) return -ENOMEM;
+ if (copy_from_user(DataTransferBuffer,
+ UserCommand.DataTransferBuffer,
+ -DataTransferLength)) {
+ ErrorCode = -EFAULT;
+ goto Failure2;
+ }
+ }
+ RequestSenseLength = UserCommand.RequestSenseLength;
+ if (RequestSenseLength > 0)
+ {
+ RequestSenseBuffer = pci_alloc_consistent(Controller->PCIDevice,
+ RequestSenseLength, &RequestSenseBufferDMA);
+ if (RequestSenseBuffer == NULL)
+ {
+ ErrorCode = -ENOMEM;
+ goto Failure2;
+ }
+ memset(RequestSenseBuffer, 0, RequestSenseLength);
+ }
+ spin_lock_irqsave(&Controller->queue_lock, flags);
+ while ((Command = DAC960_AllocateCommand(Controller)) == NULL)
+ DAC960_WaitForCommand(Controller);
+ spin_unlock_irqrestore(&Controller->queue_lock, flags);
+ DAC960_V2_ClearCommand(Command);
+ Command->CommandType = DAC960_ImmediateCommand;
+ CommandMailbox = &Command->V2.CommandMailbox;
+ memcpy(CommandMailbox, &UserCommand.CommandMailbox,
+ sizeof(DAC960_V2_CommandMailbox_T));
+ CommandMailbox->Common.CommandControlBits
+ .AdditionalScatterGatherListMemory = false;
+ CommandMailbox->Common.CommandControlBits
+ .NoAutoRequestSense = true;
+ CommandMailbox->Common.DataTransferSize = 0;
+ CommandMailbox->Common.DataTransferPageNumber = 0;
+ memset(&CommandMailbox->Common.DataTransferMemoryAddress, 0,
+ sizeof(DAC960_V2_DataTransferMemoryAddress_T));
+ if (DataTransferLength != 0)
+ {
+ if (DataTransferLength > 0)
+ {
+ CommandMailbox->Common.CommandControlBits
+ .DataTransferControllerToHost = true;
+ CommandMailbox->Common.DataTransferSize = DataTransferLength;
+ }
+ else
+ {
+ CommandMailbox->Common.CommandControlBits
+ .DataTransferControllerToHost = false;
+ CommandMailbox->Common.DataTransferSize = -DataTransferLength;
+ }
+ CommandMailbox->Common.DataTransferMemoryAddress
+ .ScatterGatherSegments[0]
+ .SegmentDataPointer = DataTransferBufferDMA;
+ CommandMailbox->Common.DataTransferMemoryAddress
+ .ScatterGatherSegments[0]
+ .SegmentByteCount =
+ CommandMailbox->Common.DataTransferSize;
+ }
+ if (RequestSenseLength > 0)
+ {
+ CommandMailbox->Common.CommandControlBits
+ .NoAutoRequestSense = false;
+ CommandMailbox->Common.RequestSenseSize = RequestSenseLength;
+ CommandMailbox->Common.RequestSenseBusAddress =
+ RequestSenseBufferDMA;
+ }
+ DAC960_ExecuteCommand(Command);
+ CommandStatus = Command->V2.CommandStatus;
+ RequestSenseLength = Command->V2.RequestSenseLength;
+ DataTransferResidue = Command->V2.DataTransferResidue;
+ spin_lock_irqsave(&Controller->queue_lock, flags);
+ DAC960_DeallocateCommand(Command);
+ spin_unlock_irqrestore(&Controller->queue_lock, flags);
+ if (RequestSenseLength > UserCommand.RequestSenseLength)
+ RequestSenseLength = UserCommand.RequestSenseLength;
+ if (copy_to_user(&UserSpaceUserCommand->DataTransferLength,
+ &DataTransferResidue,
+ sizeof(DataTransferResidue))) {
+ ErrorCode = -EFAULT;
+ goto Failure2;
+ }
+ if (copy_to_user(&UserSpaceUserCommand->RequestSenseLength,
+ &RequestSenseLength, sizeof(RequestSenseLength))) {
+ ErrorCode = -EFAULT;
+ goto Failure2;
+ }
+ if (DataTransferLength > 0)
+ {
+ if (copy_to_user(UserCommand.DataTransferBuffer,
+ DataTransferBuffer, DataTransferLength)) {
+ ErrorCode = -EFAULT;
+ goto Failure2;
+ }
+ }
+ if (RequestSenseLength > 0)
+ {
+ if (copy_to_user(UserCommand.RequestSenseBuffer,
+ RequestSenseBuffer, RequestSenseLength)) {
+ ErrorCode = -EFAULT;
+ goto Failure2;
+ }
+ }
+ ErrorCode = CommandStatus;
+ Failure2:
+ pci_free_consistent(Controller->PCIDevice, abs(DataTransferLength),
+ DataTransferBuffer, DataTransferBufferDMA);
+ if (RequestSenseBuffer != NULL)
+ pci_free_consistent(Controller->PCIDevice, RequestSenseLength,
+ RequestSenseBuffer, RequestSenseBufferDMA);
+ Failure2a:
+ return ErrorCode;
+ }
+ case DAC960_IOCTL_V2_GET_HEALTH_STATUS:
+ {
+ DAC960_V2_GetHealthStatus_T *UserSpaceGetHealthStatus =
+ (DAC960_V2_GetHealthStatus_T *) Argument;
+ DAC960_V2_GetHealthStatus_T GetHealthStatus;
+ DAC960_V2_HealthStatusBuffer_T HealthStatusBuffer;
+ DAC960_Controller_T *Controller;
+ int ControllerNumber;
+ if (UserSpaceGetHealthStatus == NULL) return -EINVAL;
+ if (copy_from_user(&GetHealthStatus, UserSpaceGetHealthStatus,
+ sizeof(DAC960_V2_GetHealthStatus_T)))
+ return -EFAULT;
+ ControllerNumber = GetHealthStatus.ControllerNumber;
+ if (ControllerNumber < 0 ||
+ ControllerNumber > DAC960_ControllerCount - 1)
+ return -ENXIO;
+ Controller = DAC960_Controllers[ControllerNumber];
+ if (Controller == NULL) return -ENXIO;
+ if (Controller->FirmwareType != DAC960_V2_Controller) return -EINVAL;
+ if (copy_from_user(&HealthStatusBuffer,
+ GetHealthStatus.HealthStatusBuffer,
+ sizeof(DAC960_V2_HealthStatusBuffer_T)))
+ return -EFAULT;
+ while (Controller->V2.HealthStatusBuffer->StatusChangeCounter
+ == HealthStatusBuffer.StatusChangeCounter &&
+ Controller->V2.HealthStatusBuffer->NextEventSequenceNumber
+ == HealthStatusBuffer.NextEventSequenceNumber)
+ {
+ interruptible_sleep_on_timeout(&Controller->HealthStatusWaitQueue,
+ DAC960_MonitoringTimerInterval);
+ if (signal_pending(current)) return -EINTR;
+ }
+ if (copy_to_user(GetHealthStatus.HealthStatusBuffer,
+ Controller->V2.HealthStatusBuffer,
+ sizeof(DAC960_V2_HealthStatusBuffer_T)))
+ return -EFAULT;
+ return 0;
+ }
+ }
+ return -EINVAL;
+}
+
+static struct file_operations DAC960_gam_fops = {
+ .owner = THIS_MODULE,
+ .ioctl = DAC960_gam_ioctl
+};
+
+static struct miscdevice DAC960_gam_dev = {
+ DAC960_GAM_MINOR,
+ "dac960_gam",
+ &DAC960_gam_fops
+};
+
+static int DAC960_gam_init(void)
+{
+ int ret;
+
+ ret = misc_register(&DAC960_gam_dev);
+ if (ret)
+ printk(KERN_ERR "DAC960_gam: can't misc_register on minor %d\n", DAC960_GAM_MINOR);
+ return ret;
+}
+
+static void DAC960_gam_cleanup(void)
+{
+ misc_deregister(&DAC960_gam_dev);
+}
+
+#endif /* DAC960_GAM_MINOR */
+
static struct DAC960_privdata DAC960_BA_privdata = {
.HardwareType = DAC960_BA_Controller,
.FirmwareType = DAC960_V2_Controller,
@@ -7000,12 +7025,23 @@
static int DAC960_init_module(void)
{
- return pci_module_init(&DAC960_pci_driver);
+ int ret;
+
+ ret = pci_module_init(&DAC960_pci_driver);
+#ifdef DAC960_GAM_MINOR
+ if (!ret)
+ DAC960_gam_init();
+#endif
+ return ret;
}
static void DAC960_cleanup_module(void)
{
int i;
+
+#ifdef DAC960_GAM_MINOR
+ DAC960_gam_cleanup();
+#endif
for (i = 0; i < DAC960_ControllerCount; i++) {
DAC960_Controller_T *Controller = DAC960_Controllers[i];
diff -Nru a/drivers/block/DAC960.h b/drivers/block/DAC960.h
--- a/drivers/block/DAC960.h Thu Aug 7 06:13:28 2003
+++ b/drivers/block/DAC960.h Sun Aug 31 16:13:56 2003
@@ -4138,8 +4138,6 @@
static void DAC960_V1_QueueMonitoringCommand(DAC960_Command_T *);
static void DAC960_V2_QueueMonitoringCommand(DAC960_Command_T *);
static void DAC960_MonitoringTimerFunction(unsigned long);
-static int DAC960_UserIOCTL(struct inode *, struct file *,
- unsigned int, unsigned long);
static void DAC960_Message(DAC960_MessageLevel_T, unsigned char *,
DAC960_Controller_T *, ...);
static void DAC960_CreateProcEntries(DAC960_Controller_T *);
diff -Nru a/drivers/block/acsi_slm.c b/drivers/block/acsi_slm.c
--- a/drivers/block/acsi_slm.c Sun Jun 8 04:05:16 2003
+++ b/drivers/block/acsi_slm.c Tue Aug 26 09:25:40 2003
@@ -374,7 +374,7 @@
if (!(page = __get_free_page( GFP_KERNEL )))
return( -ENOMEM );
- length = slm_getstats( (char *)page, MINOR(node->i_rdev) );
+ length = slm_getstats( (char *)page, iminor(node) );
if (length < 0) {
count = length;
goto out;
@@ -622,7 +622,7 @@
{
struct inode *node = file->f_dentry->d_inode;
- int device = MINOR( node->i_rdev );
+ int device = iminor(node);
int n, filled, w, h;
while( SLMState == PRINTING ||
@@ -694,7 +694,7 @@
static int slm_ioctl( struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg )
-{ int device = MINOR( inode->i_rdev ), err;
+{ int device = iminor(inode), err;
/* I can think of setting:
* - manual feed
@@ -768,7 +768,7 @@
{ int device;
struct slm *sip;
- device = MINOR(inode->i_rdev);
+ device = iminor(inode);
if (device >= N_SLM_Printers)
return( -ENXIO );
sip = &slm_info[device];
@@ -797,7 +797,7 @@
{ int device;
struct slm *sip;
- device = MINOR(inode->i_rdev);
+ device = iminor(inode);
sip = &slm_info[device];
if (file->f_mode & 2)
diff -Nru a/drivers/block/amiflop.c b/drivers/block/amiflop.c
--- a/drivers/block/amiflop.c Thu Aug 7 02:25:23 2003
+++ b/drivers/block/amiflop.c Tue Jul 29 16:35:37 2003
@@ -55,24 +55,15 @@
#include
-#include
-#include
-#include
-#include
-#include
#include
#include
-#include
-#include
#include
-#include
-#include
#include
#include
#include
-#include
#include
-#include
+#include
+#include
#include
#include
@@ -1446,7 +1437,7 @@
static int fd_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long param)
{
- int drive = minor(inode->i_rdev) & 3;
+ int drive = iminor(inode) & 3;
static struct floppy_struct getprm;
switch(cmd){
@@ -1570,8 +1561,8 @@
*/
static int floppy_open(struct inode *inode, struct file *filp)
{
- int drive = minor(inode->i_rdev) & 3;
- int system = (minor(inode->i_rdev) & 4) >> 2;
+ int drive = iminor(inode) & 3;
+ int system = (iminor(inode) & 4) >> 2;
int old_dev;
unsigned long flags;
@@ -1618,7 +1609,7 @@
static int floppy_release(struct inode * inode, struct file * filp)
{
- int drive = minor(inode->i_rdev) & 3;
+ int drive = iminor(inode) & 3;
if (unit[drive].dirty == 1) {
del_timer (flush_track_timer + drive);
diff -Nru a/drivers/block/as-iosched.c b/drivers/block/as-iosched.c
--- a/drivers/block/as-iosched.c Fri Aug 15 00:57:28 2003
+++ b/drivers/block/as-iosched.c Sun Aug 31 16:14:29 2003
@@ -709,6 +709,14 @@
return 1;
}
+ if (aic->seek_samples == 0 || aic->ttime_samples == 0) {
+ /*
+ * Process has just started IO so default to not anticipate.
+ * Maybe should be smarter.
+ */
+ return 1;
+ }
+
if (aic->ttime_mean > ad->antic_expire) {
/* the process thinks too much between requests */
return 1;
diff -Nru a/drivers/block/ataflop.c b/drivers/block/ataflop.c
--- a/drivers/block/ataflop.c Thu Aug 7 02:25:23 2003
+++ b/drivers/block/ataflop.c Wed Jul 30 15:49:57 2003
@@ -63,35 +63,16 @@
#include
-#include
-#include
-#include
-#include
-#include
-#include
#include
-#include
-#include
#include
-#include
-#include
#include
-#include /* for invalidate_buffers() */
-
-#include
-#include
-#include
-#include
-#include
-#include
+#include
#include
#include
-#include
#include
#include
#include
-#include
#define FD_MAX_UNITS 2
@@ -1838,7 +1819,7 @@
static int floppy_open( struct inode *inode, struct file *filp )
{
struct atari_floppy_struct *p = inode->i_bdev->bd_disk->private_data;
- int type = minor(inode->i_rdev) >> 2;
+ int type = iminor(inode) >> 2;
DPRINT(("fd_open: type=%d\n",type));
if (p->ref && p->type != type)
diff -Nru a/drivers/block/cciss.c b/drivers/block/cciss.c
--- a/drivers/block/cciss.c Thu Aug 7 06:13:28 2003
+++ b/drivers/block/cciss.c Tue Aug 26 09:25:41 2003
@@ -356,11 +356,11 @@
*/
static int cciss_open(struct inode *inode, struct file *filep)
{
- int ctlr = major(inode->i_rdev) - COMPAQ_CISS_MAJOR;
- int dsk = minor(inode->i_rdev) >> NWD_SHIFT;
+ int ctlr = imajor(inode) - COMPAQ_CISS_MAJOR;
+ int dsk = iminor(inode) >> NWD_SHIFT;
#ifdef CCISS_DEBUG
- printk(KERN_DEBUG "cciss_open %x (%x:%x)\n", inode->i_rdev, ctlr, dsk);
+ printk(KERN_DEBUG "cciss_open %s (%x:%x)\n", inode->i_bdev->bd_disk->disk_name, ctlr, dsk);
#endif /* CCISS_DEBUG */
if (ctlr >= MAX_CTLR || hba[ctlr] == NULL)
@@ -372,7 +372,7 @@
* for "raw controller".
*/
if (hba[ctlr]->drv[dsk].nr_blocks == 0) {
- if (minor(inode->i_rdev) != 0)
+ if (iminor(inode) != 0)
return -ENXIO;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
@@ -386,11 +386,11 @@
*/
static int cciss_release(struct inode *inode, struct file *filep)
{
- int ctlr = major(inode->i_rdev) - COMPAQ_CISS_MAJOR;
- int dsk = minor(inode->i_rdev) >> NWD_SHIFT;
+ int ctlr = imajor(inode) - COMPAQ_CISS_MAJOR;
+ int dsk = iminor(inode) >> NWD_SHIFT;
#ifdef CCISS_DEBUG
- printk(KERN_DEBUG "cciss_release %x (%x:%x)\n", inode->i_rdev, ctlr, dsk);
+ printk(KERN_DEBUG "cciss_release %s (%x:%x)\n", inode->i_bdev->bd_disk->disk_name, ctlr, dsk);
#endif /* CCISS_DEBUG */
/* fsync_dev(inode->i_rdev); */
@@ -406,8 +406,8 @@
static int cciss_ioctl(struct inode *inode, struct file *filep,
unsigned int cmd, unsigned long arg)
{
- int ctlr = major(inode->i_rdev) - COMPAQ_CISS_MAJOR;
- int dsk = minor(inode->i_rdev) >> NWD_SHIFT;
+ int ctlr = imajor(inode) - COMPAQ_CISS_MAJOR;
+ int dsk = iminor(inode) >> NWD_SHIFT;
#ifdef CCISS_DEBUG
printk(KERN_DEBUG "cciss_ioctl: Called with cmd=%x %lx\n", cmd, arg);
@@ -2525,6 +2525,9 @@
if (!q)
goto err_all;
+ hba[i]->queue = q;
+ q->queuedata = hba[i];
+
/* Initialize the pdev driver private data.
have it point to hba[i]. */
pci_set_drvdata(pdev, hba[i]);
@@ -2545,7 +2548,6 @@
cciss_procinit(i);
- q->queuedata = hba[i];
blk_queue_bounce_limit(q, hba[i]->pdev->dma_mask);
/* This is a hardware imposed limit. */
diff -Nru a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
--- a/drivers/block/cpqarray.c Thu Aug 7 02:25:24 2003
+++ b/drivers/block/cpqarray.c Tue Aug 26 09:25:41 2003
@@ -1078,7 +1078,7 @@
put_user(host->ctlr_sig, (int*)arg);
return 0;
case IDAREVALIDATEVOLS:
- if (minor(inode->i_rdev) != 0)
+ if (iminor(inode) != 0)
return -ENXIO;
return revalidate_allvol(host);
case IDADRIVERVERSION:
diff -Nru a/drivers/block/floppy.c b/drivers/block/floppy.c
--- a/drivers/block/floppy.c Fri Aug 15 10:27:03 2003
+++ b/drivers/block/floppy.c Sun Aug 31 16:14:41 2003
@@ -695,23 +695,9 @@
spin_unlock_irqrestore(&floppy_lock, flags);
}
-static int maximum(int a, int b)
-{
- if (a > b)
- return a;
- else
- return b;
-}
-#define INFBOUND(a,b) (a)=maximum((a),(b));
+#define INFBOUND(a,b) (a)=max_t(int, a, b)
-static int minimum(int a, int b)
-{
- if (a < b)
- return a;
- else
- return b;
-}
-#define SUPBOUND(a,b) (a)=minimum((a),(b));
+#define SUPBOUND(a,b) (a)=min_t(int, a, b)
/*
@@ -1021,9 +1007,9 @@
static DECLARE_WORK(floppy_work, NULL, NULL);
-static void schedule_bh( void (*handler)(void*) )
+static void schedule_bh(void (*handler) (void))
{
- PREPARE_WORK(&floppy_work, handler, NULL);
+ PREPARE_WORK(&floppy_work, (void (*)(void *))handler, NULL);
schedule_work(&floppy_work);
}
@@ -1035,7 +1021,7 @@
spin_lock_irqsave(&floppy_lock, flags);
do_floppy = NULL;
- PREPARE_WORK(&floppy_work, (void*)(void*)empty, NULL);
+ PREPARE_WORK(&floppy_work, (void*)empty, NULL);
del_timer(&fd_timer);
spin_unlock_irqrestore(&floppy_lock, flags);
}
@@ -1813,9 +1799,9 @@
max_sensei--;
} while ((ST0 & 0x83) != UNIT(current_drive) && inr == 2 && max_sensei);
}
- if (handler) {
- schedule_bh( (void *)(void *) handler);
- } else
+ if (handler)
+ schedule_bh(handler);
+ else
FDCS->reset = 1;
is_alive("normal interrupt end");
@@ -2058,26 +2044,26 @@
wake_up(&command_done);
}
-static struct cont_t wakeup_cont={
- empty,
- do_wakeup,
- empty,
- (done_f)empty
+static struct cont_t wakeup_cont = {
+ .interrupt = empty,
+ .redo = do_wakeup,
+ .error = empty,
+ .done = (done_f) empty
};
-static struct cont_t intr_cont={
- empty,
- process_fd_request,
- empty,
- (done_f) empty
+static struct cont_t intr_cont = {
+ .interrupt = empty,
+ .redo = process_fd_request,
+ .error = empty,
+ .done = (done_f) empty
};
static int wait_til_done(void (*handler)(void), int interruptible)
{
int ret;
- schedule_bh((void *)(void *)handler);
+ schedule_bh(handler);
if (command_status < 2 && NO_SIGNAL) {
DECLARE_WAITQUEUE(wait, current);
@@ -2281,11 +2267,12 @@
#endif
}
-static struct cont_t format_cont={
- format_interrupt,
- redo_format,
- bad_flp_intr,
- generic_done };
+static struct cont_t format_cont = {
+ .interrupt = format_interrupt,
+ .redo = redo_format,
+ .error = bad_flp_intr,
+ .done = generic_done
+};
static int do_format(int drive, struct format_descr *tmp_format_req)
{
@@ -2523,12 +2510,12 @@
int size, i;
max_sector = transfer_size(ssize,
- minimum(max_sector, max_sector_2),
+ min(max_sector, max_sector_2),
current_req->nr_sectors);
if (current_count_sectors <= 0 && CT(COMMAND) == FD_WRITE &&
buffer_max > fsector_t + current_req->nr_sectors)
- current_count_sectors = minimum(buffer_max - fsector_t,
+ current_count_sectors = min_t(int, buffer_max - fsector_t,
current_req->nr_sectors);
remaining = current_count_sectors << 9;
@@ -2546,7 +2533,7 @@
}
#endif
- buffer_max = maximum(max_sector, buffer_max);
+ buffer_max = max(max_sector, buffer_max);
dma_buffer = floppy_track_buffer + ((fsector_t - buffer_min) << 9);
@@ -2697,7 +2684,7 @@
if ((_floppy->rate & FD_2M) && (!TRACK) && (!HEAD)){
max_sector = 2 * _floppy->sect / 3;
if (fsector_t >= max_sector){
- current_count_sectors = minimum(_floppy->sect - fsector_t,
+ current_count_sectors = min_t(int, _floppy->sect - fsector_t,
current_req->nr_sectors);
return 1;
}
@@ -2987,7 +2974,7 @@
if (TESTF(FD_NEED_TWADDLE))
twaddle();
- schedule_bh( (void *)(void *) floppy_start);
+ schedule_bh(floppy_start);
#ifdef DEBUGT
debugt("queue fd request");
#endif
@@ -2996,16 +2983,17 @@
#undef REPEAT
}
-static struct cont_t rw_cont={
- rw_interrupt,
- redo_fd_request,
- bad_flp_intr,
- request_done };
+static struct cont_t rw_cont = {
+ .interrupt = rw_interrupt,
+ .redo = redo_fd_request,
+ .error = bad_flp_intr,
+ .done = request_done
+};
static void process_fd_request(void)
{
cont = &rw_cont;
- schedule_bh( (void *)(void *) redo_fd_request);
+ schedule_bh(redo_fd_request);
}
static void do_fd_request(request_queue_t * q)
@@ -3031,11 +3019,12 @@
is_alive("do fd request");
}
-static struct cont_t poll_cont={
- success_and_wakeup,
- floppy_ready,
- generic_failure,
- generic_done };
+static struct cont_t poll_cont = {
+ .interrupt = success_and_wakeup,
+ .redo = floppy_ready,
+ .error = generic_failure,
+ .done = generic_done
+};
static int poll_drive(int interruptible, int flag)
{
@@ -3066,11 +3055,12 @@
printk("weird, reset interrupt called\n");
}
-static struct cont_t reset_cont={
- reset_intr,
- success_and_wakeup,
- generic_failure,
- generic_done };
+static struct cont_t reset_cont = {
+ .interrupt = reset_intr,
+ .redo = success_and_wakeup,
+ .error = generic_failure,
+ .done = generic_done
+};
static int user_reset_fdc(int drive, int arg, int interruptible)
{
@@ -3174,11 +3164,11 @@
}
-static struct cont_t raw_cmd_cont={
- success_and_wakeup,
- floppy_start,
- generic_failure,
- raw_cmd_done
+static struct cont_t raw_cmd_cont = {
+ .interrupt = success_and_wakeup,
+ .redo = floppy_start,
+ .error = generic_failure,
+ .done = raw_cmd_done
};
static inline int raw_cmd_copyout(int cmd, char *param,
@@ -3781,9 +3771,9 @@
}
}
- UDRS->fd_device = minor(inode->i_rdev);
- set_capacity(disks[drive], floppy_sizes[minor(inode->i_rdev)]);
- if (old_dev != -1 && old_dev != minor(inode->i_rdev)) {
+ UDRS->fd_device = iminor(inode);
+ set_capacity(disks[drive], floppy_sizes[iminor(inode)]);
+ if (old_dev != -1 && old_dev != iminor(inode)) {
if (buffer_drive == drive)
buffer_track = -1;
}
@@ -3910,22 +3900,6 @@
return 0;
}
-static int floppy_read_block_0(struct gendisk *disk)
-{
- struct block_device *bdev;
- int ret;
-
- bdev = bdget_disk(disk, 0);
- if (!bdev) {
- printk("No block device for %s\n", disk->disk_name);
- BUG();
- }
- bdev->bd_disk = disk; /* ewww */
- ret = __floppy_read_block_0(bdev);
- atomic_dec(&bdev->bd_count);
- return ret;
-}
-
/* revalidate the floppy disk, i.e. trigger format autodetection by reading
* the bootblock (block 0). "Autodetection" is also needed to check whether
* there is a disk in the drive at all... Thus we also do it for fixed
@@ -3961,7 +3935,7 @@
UDRS->generation++;
if (NO_GEOM){
/* auto-sensing */
- res = floppy_read_block_0(disk);
+ res = __floppy_read_block_0(opened_bdev[drive]);
} else {
if (cf)
poll_drive(0, FD_RAW_NEED_DISK);
diff -Nru a/drivers/block/floppy98.c b/drivers/block/floppy98.c
--- a/drivers/block/floppy98.c Thu Aug 7 02:25:24 2003
+++ b/drivers/block/floppy98.c Tue Aug 26 09:44:42 2003
@@ -3844,9 +3844,9 @@
}
}
- UDRS->fd_device = minor(inode->i_rdev);
- set_capacity(disks[drive], floppy_sizes[minor(inode->i_rdev)]);
- if (old_dev != -1 && old_dev != minor(inode->i_rdev)) {
+ UDRS->fd_device = iminor(inode);
+ set_capacity(disks[drive], floppy_sizes[iminor(inode)]);
+ if (old_dev != -1 && old_dev != iminor(inode)) {
if (buffer_drive == drive)
buffer_track = -1;
}
@@ -3989,22 +3989,6 @@
return 0;
}
-static int floppy_read_block_0(struct gendisk *disk)
-{
- struct block_device *bdev;
- int ret;
-
- bdev = bdget_disk(disk, 0);
- if (!bdev) {
- printk("No block device for %s\n", disk->disk_name);
- BUG();
- }
- bdev->bd_disk = disk; /* ewww */
- ret = __floppy_read_block_0(bdev);
- atomic_dec(&bdev->bd_count);
- return ret;
-}
-
/* revalidate the floppy disk, i.e. trigger format autodetection by reading
* the bootblock (block 0). "Autodetection" is also needed to check whether
* there is a disk in the drive at all... Thus we also do it for fixed
@@ -4040,7 +4024,7 @@
UDRS->generation++;
if (NO_GEOM){
/* auto-sensing */
- res = floppy_read_block_0(disk);
+ res = __floppy_read_block_0(opened_bdev[drive]);
} else {
if (cf)
poll_drive(0, FD_RAW_NEED_DISK);
diff -Nru a/drivers/block/genhd.c b/drivers/block/genhd.c
--- a/drivers/block/genhd.c Fri Aug 1 02:22:20 2003
+++ b/drivers/block/genhd.c Tue Aug 26 12:06:15 2003
@@ -576,13 +576,10 @@
void set_device_ro(struct block_device *bdev, int flag)
{
- struct gendisk *disk = bdev->bd_disk;
- if (bdev->bd_contains != bdev) {
- int part = bdev->bd_dev - MKDEV(disk->major, disk->first_minor);
- struct hd_struct *p = disk->part[part-1];
- if (p) p->policy = flag;
- } else
- disk->policy = flag;
+ if (bdev->bd_contains != bdev)
+ bdev->bd_part->policy = flag;
+ else
+ bdev->bd_disk->policy = flag;
}
void set_disk_ro(struct gendisk *disk, int flag)
@@ -595,17 +592,12 @@
int bdev_read_only(struct block_device *bdev)
{
- struct gendisk *disk;
if (!bdev)
return 0;
- disk = bdev->bd_disk;
- if (bdev->bd_contains != bdev) {
- int part = bdev->bd_dev - MKDEV(disk->major, disk->first_minor);
- struct hd_struct *p = disk->part[part-1];
- if (p) return p->policy;
- return 0;
- } else
- return disk->policy;
+ else if (bdev->bd_contains != bdev)
+ return bdev->bd_part->policy;
+ else
+ return bdev->bd_disk->policy;
}
int invalidate_partition(struct gendisk *disk, int index)
diff -Nru a/drivers/block/ioctl.c b/drivers/block/ioctl.c
--- a/drivers/block/ioctl.c Thu Jul 17 22:30:42 2003
+++ b/drivers/block/ioctl.c Tue Aug 26 12:06:15 2003
@@ -8,7 +8,6 @@
static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg *arg)
{
struct block_device *bdevp;
- int holder;
struct gendisk *disk;
struct blkpg_ioctl_arg a;
struct blkpg_partition p;
@@ -41,8 +40,11 @@
return -EINVAL;
}
/* partition number in use? */
- if (disk->part[part - 1])
+ down(&bdev->bd_sem);
+ if (disk->part[part - 1]) {
+ up(&bdev->bd_sem);
return -EBUSY;
+ }
/* overlap? */
for (i = 0; i < disk->minors - 1; i++) {
struct hd_struct *s = disk->part[i];
@@ -50,22 +52,26 @@
if (!s)
continue;
if (!(start+length <= s->start_sect ||
- start >= s->start_sect + s->nr_sects))
+ start >= s->start_sect + s->nr_sects)) {
+ up(&bdev->bd_sem);
return -EBUSY;
+ }
}
/* all seems OK */
add_partition(disk, part, start, length);
+ up(&bdev->bd_sem);
return 0;
case BLKPG_DEL_PARTITION:
if (!disk->part[part-1])
return -ENXIO;
if (disk->part[part - 1]->nr_sects == 0)
return -ENXIO;
- /* partition in use? Incomplete check for now. */
bdevp = bdget_disk(disk, part);
if (!bdevp)
return -ENOMEM;
- if (bd_claim(bdevp, &holder) < 0) {
+ down(&bdevp->bd_sem);
+ if (bdevp->bd_openers) {
+ up(&bdevp->bd_sem);
bdput(bdevp);
return -EBUSY;
}
@@ -73,9 +79,12 @@
fsync_bdev(bdevp);
invalidate_bdev(bdevp, 0);
+ down(&bdev->bd_sem);
delete_partition(disk, part);
- bd_release(bdevp);
+ up(&bdev->bd_sem);
+ up(&bdevp->bd_sem);
bdput(bdevp);
+
return 0;
default:
return -EINVAL;
diff -Nru a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c
--- a/drivers/block/ll_rw_blk.c Mon Aug 18 22:28:54 2003
+++ b/drivers/block/ll_rw_blk.c Tue Aug 26 12:06:15 2003
@@ -2043,24 +2043,23 @@
static inline void blk_partition_remap(struct bio *bio)
{
struct block_device *bdev = bio->bi_bdev;
- struct gendisk *disk = bdev->bd_disk;
- struct hd_struct *p;
- if (bdev == bdev->bd_contains)
- return;
- p = disk->part[bdev->bd_dev-MKDEV(disk->major,disk->first_minor)-1];
- switch (bio->bi_rw) {
- case READ:
- p->read_sectors += bio_sectors(bio);
- p->reads++;
- break;
- case WRITE:
- p->write_sectors += bio_sectors(bio);
- p->writes++;
- break;
+ if (bdev != bdev->bd_contains) {
+ struct hd_struct *p = bdev->bd_part;
+
+ switch (bio->bi_rw) {
+ case READ:
+ p->read_sectors += bio_sectors(bio);
+ p->reads++;
+ break;
+ case WRITE:
+ p->write_sectors += bio_sectors(bio);
+ p->writes++;
+ break;
+ }
+ bio->bi_sector += p->start_sect;
+ bio->bi_bdev = bdev->bd_contains;
}
- bio->bi_sector += bdev->bd_offset;
- bio->bi_bdev = bdev->bd_contains;
}
/**
diff -Nru a/drivers/block/paride/pg.c b/drivers/block/paride/pg.c
--- a/drivers/block/paride/pg.c Sun May 25 02:45:05 2003
+++ b/drivers/block/paride/pg.c Tue Aug 26 09:25:41 2003
@@ -527,11 +527,9 @@
return -1;
}
-#define DEVICE_NR(dev) (minor(dev) & 0x7F)
-
static int pg_open(struct inode *inode, struct file *file)
{
- int unit = DEVICE_NR(inode->i_rdev);
+ int unit = iminor(inode) & 0x7f;
struct pg *dev = &devices[unit];
if ((unit >= PG_UNITS) || (!dev->present))
diff -Nru a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c
--- a/drivers/block/paride/pt.c Sun May 25 02:45:06 2003
+++ b/drivers/block/paride/pt.c Tue Aug 26 09:25:41 2003
@@ -670,11 +670,11 @@
return -1;
}
-#define DEVICE_NR(dev) (minor(dev) & 0x7F)
+#define DEVICE_NR(inode) (iminor(inode) & 0x7F)
static int pt_open(struct inode *inode, struct file *file)
{
- int unit = DEVICE_NR(inode->i_rdev);
+ int unit = DEVICE_NR(inode);
if ((unit >= PT_UNITS) || (!PT.present))
return -ENODEV;
@@ -696,7 +696,7 @@
return -EROFS;
}
- if (!(minor(inode->i_rdev) & 128))
+ if (!(iminor(inode) & 128))
PT.flags |= PT_REWIND;
PT.bufptr = kmalloc(PT_BUFSIZE, GFP_KERNEL);
@@ -715,7 +715,7 @@
int unit;
struct mtop mtop;
- unit = DEVICE_NR(inode->i_rdev);
+ unit = DEVICE_NR(inode);
if (unit >= PT_UNITS)
return -EINVAL;
if (!PT.present)
@@ -753,7 +753,7 @@
static int
pt_release(struct inode *inode, struct file *file)
{
- int unit = DEVICE_NR(inode->i_rdev);
+ int unit = DEVICE_NR(inode);
if ((unit >= PT_UNITS) || (atomic_read(&PT.available) > 1))
return -EINVAL;
@@ -776,7 +776,7 @@
static ssize_t pt_read(struct file *filp, char *buf, size_t count, loff_t * ppos)
{
struct inode *ino = filp->f_dentry->d_inode;
- int unit = DEVICE_NR(ino->i_rdev);
+ int unit = DEVICE_NR(ino);
char rd_cmd[12] = { ATAPI_READ_6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
int k, n, r, p, s, t, b;
@@ -873,7 +873,7 @@
static ssize_t pt_write(struct file *filp, const char *buf, size_t count, loff_t * ppos)
{
struct inode *ino = filp->f_dentry->d_inode;
- int unit = DEVICE_NR(ino->i_rdev);
+ int unit = DEVICE_NR(ino);
char wr_cmd[12] = { ATAPI_WRITE_6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
int k, n, r, p, s, t, b;
diff -Nru a/drivers/block/rd.c b/drivers/block/rd.c
--- a/drivers/block/rd.c Thu Aug 7 02:25:24 2003
+++ b/drivers/block/rd.c Tue Aug 26 10:05:56 2003
@@ -245,6 +245,7 @@
static int rd_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
{
int error;
+ struct block_device *bdev = inode->i_bdev;
if (cmd != BLKFLSBUF)
return -EINVAL;
@@ -253,12 +254,12 @@
it's not like with the other blockdevices where
this ioctl only flushes away the buffer cache. */
error = -EBUSY;
- down(&inode->i_bdev->bd_sem);
- if (inode->i_bdev->bd_openers <= 2) {
- truncate_inode_pages(inode->i_mapping, 0);
+ down(&bdev->bd_sem);
+ if (bdev->bd_openers <= 2) {
+ truncate_inode_pages(bdev->bd_inode->i_mapping, 0);
error = 0;
}
- up(&inode->i_bdev->bd_sem);
+ up(&bdev->bd_sem);
return error;
}
@@ -269,18 +270,18 @@
static int rd_open(struct inode * inode, struct file * filp)
{
- unsigned unit = minor(inode->i_rdev);
+ unsigned unit = iminor(inode);
/*
* Immunize device against invalidate_buffers() and prune_icache().
*/
if (rd_bdev[unit] == NULL) {
struct block_device *bdev = inode->i_bdev;
- atomic_inc(&bdev->bd_count);
+ inode = igrab(bdev->bd_inode);
rd_bdev[unit] = bdev;
bdev->bd_openers++;
bdev->bd_block_size = rd_blocksize;
- bdev->bd_inode->i_size = get_capacity(rd_disks[unit])<<9;
+ inode->i_size = get_capacity(rd_disks[unit])<<9;
inode->i_mapping->a_ops = &ramdisk_aops;
inode->i_mapping->backing_dev_info = &rd_backing_dev_info;
}
diff -Nru a/drivers/block/z2ram.c b/drivers/block/z2ram.c
--- a/drivers/block/z2ram.c Thu Aug 7 02:25:24 2003
+++ b/drivers/block/z2ram.c Wed Jul 30 15:20:18 2003
@@ -28,10 +28,10 @@
#define DEVICE_NAME "Z2RAM"
#include
-#include
#include
#include
#include
+#include
#include
#include
@@ -150,7 +150,7 @@
sizeof( z2ram_map[0] );
int rc = -ENOMEM;
- device = minor( inode->i_rdev );
+ device = iminor(inode);
if ( current_device != -1 && current_device != device )
{
diff -Nru a/drivers/char/agp/Kconfig b/drivers/char/agp/Kconfig
--- a/drivers/char/agp/Kconfig Fri Aug 15 07:33:19 2003
+++ b/drivers/char/agp/Kconfig Thu Aug 28 16:22:00 2003
@@ -63,15 +63,19 @@
You should say Y here if you use XFree86 3.3.6 or 4.x and want to
use GLX or DRI. If unsure, say N.
+# RED-PEN this option is misnamed, it's not 8151 specific
config AGP_AMD_8151
- tristate "AMD Opteron/Athlon64 on-CPU GART support"
+ tristate "AMD Opteron/Athlon64 on-CPU GART support" if !GART_IOMMU
depends on AGP && X86
- default GART_IOMMU
+ default y if GART_IOMMU
help
This option gives you AGP support for the GLX component of
- XFree86 4.x using the on-CPU AGP bridge of the AMD Athlon64/Opteron CPUs.
+ XFree86 4.x using the on-CPU northbridge of the AMD Athlon64/Opteron CPUs.
+ You still need an external AGP bridge like the AMD 8151, VIA
+ K8T400M, SiS755. It may also support other AGP bridges when loaded
+ with agp_try_unsupported=1.
You should say Y here if you use XFree86 3.3.6 or 4.x and want to
- use GLX or DRI. If unsure, say N
+ use GLX or DRI. If unsure, say Y
config AGP_INTEL
tristate "Intel 440LX/BX/GX, I8xx and E7x05 chipset support"
diff -Nru a/drivers/char/agp/agp.h b/drivers/char/agp/agp.h
--- a/drivers/char/agp/agp.h Fri Aug 15 06:28:58 2003
+++ b/drivers/char/agp/agp.h Thu Aug 28 18:04:31 2003
@@ -167,8 +167,10 @@
#define PGE_EMPTY(b, p) (!(p) || (p) == (unsigned long) (b)->scratch_page)
-/* intel register */
-#define INTEL_APBASE 0x10
+/* Chipset independant registers (from AGP Spec) */
+#define AGP_APBASE 0x10
+
+/* Intel registers */
#define INTEL_APSIZE 0xb4
#define INTEL_ATTBASE 0xb8
#define INTEL_AGPCTRL 0xb0
@@ -176,7 +178,6 @@
#define INTEL_ERRSTS 0x91
/* Intel 460GX Registers */
-#define INTEL_I460_APBASE 0x10
#define INTEL_I460_BAPBASE 0x98
#define INTEL_I460_GXBCTL 0xa0
#define INTEL_I460_AGPSIZ 0xa2
@@ -184,7 +185,7 @@
#define INTEL_I460_GATT_VALID (1UL << 24)
#define INTEL_I460_GATT_COHERENT (1UL << 25)
-/* intel i830 registers */
+/* Intel i830 registers */
#define I830_GMCH_CTRL 0x52
#define I830_GMCH_ENABLED 0x4
#define I830_GMCH_MEM_MASK 0x1
@@ -218,31 +219,31 @@
#define I852_GME 0x2
#define I852_GM 0x5
-/* intel 815 register */
+/* Intel 815 register */
#define INTEL_815_APCONT 0x51
#define INTEL_815_ATTBASE_MASK ~0x1FFFFFFF
-/* intel i820 registers */
+/* Intel i820 registers */
#define INTEL_I820_RDCR 0x51
#define INTEL_I820_ERRSTS 0xc8
-/* intel i840 registers */
+/* Intel i840 registers */
#define INTEL_I840_MCHCFG 0x50
#define INTEL_I840_ERRSTS 0xc8
-/* intel i845 registers */
+/* Intel i845 registers */
#define INTEL_I845_AGPM 0x51
#define INTEL_I845_ERRSTS 0xc8
-/* intel i850 registers */
+/* Intel i850 registers */
#define INTEL_I850_MCHCFG 0x50
#define INTEL_I850_ERRSTS 0xc8
-/* intel i860 registers */
+/* Intel i860 registers */
#define INTEL_I860_MCHCFG 0x50
#define INTEL_I860_ERRSTS 0xc8
-/* intel i810 registers */
+/* Intel i810 registers */
#define I810_GMADDR 0x10
#define I810_MMADDR 0x14
#define I810_PTE_BASE 0x10000
@@ -261,7 +262,6 @@
#define I810_DRAM_ROW_0_SDRAM 0x00000001
/* Intel 7505 registers */
-#define INTEL_I7505_NAPBASELO 0x10
#define INTEL_I7505_APSIZE 0x74
#define INTEL_I7505_NCAPID 0x60
#define INTEL_I7505_NISTAT 0x6c
@@ -271,26 +271,23 @@
#define INTEL_I7505_MCHCFG 0x50
/* VIA register */
-#define VIA_APBASE 0x10
#define VIA_GARTCTRL 0x80
#define VIA_APSIZE 0x84
#define VIA_ATTBASE 0x88
/* VIA KT400 */
#define VIA_AGP3_GARTCTRL 0x90
-#define VIA_AGP3_APSIZE 0x94
+#define VIA_AGP3_APSIZE 0x94
#define VIA_AGP3_ATTBASE 0x98
-#define VIA_AGPSEL 0xfd
+#define VIA_AGPSEL 0xfd
/* SiS registers */
-#define SIS_APBASE 0x10
#define SIS_ATTBASE 0x90
#define SIS_APSIZE 0x94
#define SIS_TLBCNTRL 0x97
#define SIS_TLBFLUSH 0x98
/* AMD registers */
-#define AMD_APBASE 0x10
#define AMD_MMBASE 0x14
#define AMD_APSIZE 0xac
#define AMD_MODECNTL 0xb0
@@ -300,24 +297,14 @@
#define AMD_TLBFLUSH 0x0c /* In mmio region (32-bit register) */
#define AMD_CACHEENTRY 0x10 /* In mmio region (32-bit register) */
-#define AMD_8151_APSIZE 0xb4
-#define AMD_8151_GARTBLOCK 0xb8
-
-#define AMD_X86_64_GARTAPERTURECTL 0x90
-#define AMD_X86_64_GARTAPERTUREBASE 0x94
-#define AMD_X86_64_GARTTABLEBASE 0x98
-#define AMD_X86_64_GARTCACHECTL 0x9c
-#define AMD_X86_64_GARTEN 1<<0
-
-#define AMD_8151_VMAPERTURE 0x10
-#define AMD_8151_AGP_CTL 0xb0
-#define AMD_8151_APERTURESIZE 0xb4
-#define AMD_8151_GARTPTR 0xb8
-#define AMD_8151_GTLBEN 1<<7
-#define AMD_8151_APEREN 1<<8
+/* AMD64 registers */
+#define AMD64_GARTAPERTURECTL 0x90
+#define AMD64_GARTAPERTUREBASE 0x94
+#define AMD64_GARTTABLEBASE 0x98
+#define AMD64_GARTCACHECTL 0x9c
+#define AMD64_GARTEN 1<<0
/* ALi registers */
-#define ALI_APBASE 0x10
#define ALI_AGPCTRL 0xb8
#define ALI_ATTBASE 0xbc
#define ALI_TLBCTRL 0xc0
@@ -327,19 +314,17 @@
#define ALI_CACHE_FLUSH_EN 0x100
/* ATI register */
-#define ATI_APBASE 0x10
-#define ATI_GART_MMBASE_ADDR 0x14
-#define ATI_RS100_APSIZE 0xac
-#define ATI_RS300_APSIZE 0xf8
-#define ATI_RS100_IG_AGPMODE 0xb0
-#define ATI_RS300_IG_AGPMODE 0xfc
-
-#define ATI_GART_FEATURE_ID 0x00
-#define ATI_GART_BASE 0x04
-#define ATI_GART_CACHE_SZBASE 0x08
-#define ATI_GART_CACHE_CNTRL 0x0c
-#define ATI_GART_CACHE_ENTRY_CNTRL 0x10
-
+#define ATI_GART_MMBASE_ADDR 0x14
+#define ATI_RS100_APSIZE 0xac
+#define ATI_RS300_APSIZE 0xf8
+#define ATI_RS100_IG_AGPMODE 0xb0
+#define ATI_RS300_IG_AGPMODE 0xfc
+
+#define ATI_GART_FEATURE_ID 0x00
+#define ATI_GART_BASE 0x04
+#define ATI_GART_CACHE_SZBASE 0x08
+#define ATI_GART_CACHE_CNTRL 0x0c
+#define ATI_GART_CACHE_ENTRY_CNTRL 0x10
/* Serverworks Registers */
#define SVWRKS_APSIZE 0x10
@@ -369,6 +354,17 @@
#define HP_ZX1_PDIR_BASE 0x320
#define HP_ZX1_CACHE_FLUSH 0x428
+/* NVIDIA registers */
+#define NVIDIA_0_APSIZE 0x80
+#define NVIDIA_1_WBC 0xf0
+#define NVIDIA_2_GARTCTRL 0xd0
+#define NVIDIA_2_APBASE 0xd8
+#define NVIDIA_2_APLIMIT 0xdc
+#define NVIDIA_2_ATTBASE(i) (0xe0 + (i) * 4)
+#define NVIDIA_3_APBASE 0x50
+#define NVIDIA_3_APLIMIT 0x54
+
+
struct agp_device_ids {
unsigned short device_id; /* first, to make table easier to read */
enum chipset_type chipset;
@@ -405,6 +401,9 @@
void global_cache_flush(void);
void get_agp_version(struct agp_bridge_data *bridge);
unsigned long agp_generic_mask_memory(unsigned long addr, int type);
+
+extern int agp_off;
+extern int agp_try_unsupported_boot;
/* Standard agp registers */
#define AGPSTAT 0x4
diff -Nru a/drivers/char/agp/ali-agp.c b/drivers/char/agp/ali-agp.c
--- a/drivers/char/agp/ali-agp.c Mon Aug 18 10:39:21 2003
+++ b/drivers/char/agp/ali-agp.c Thu Aug 28 16:44:18 2003
@@ -76,7 +76,7 @@
pci_write_config_dword(agp_bridge->dev, ALI_TLBCTRL, ((temp & 0xffffff00) | 0x00000010));
/* address to map to */
- pci_read_config_dword(agp_bridge->dev, ALI_APBASE, &temp);
+ pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp);
agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
#if 0
diff -Nru a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c
--- a/drivers/char/agp/amd-k7-agp.c Mon Aug 18 10:39:21 2003
+++ b/drivers/char/agp/amd-k7-agp.c Thu Aug 28 16:44:18 2003
@@ -148,7 +148,7 @@
* used to program the agp master not the cpu
*/
- pci_read_config_dword(agp_bridge->dev, AMD_APBASE, &temp);
+ pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp);
addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
agp_bridge->gart_bus_addr = addr;
diff -Nru a/drivers/char/agp/amd-k8-agp.c b/drivers/char/agp/amd-k8-agp.c
--- a/drivers/char/agp/amd-k8-agp.c Thu Jul 31 08:58:45 2003
+++ b/drivers/char/agp/amd-k8-agp.c Thu Aug 28 18:04:31 2003
@@ -8,12 +8,6 @@
* work is done in the northbridge(s).
*/
-/*
- * On x86-64 the AGP driver needs to be initialized early by the IOMMU
- * code. When you use this driver as a template for a new K8 AGP bridge
- * driver don't forget to change arch/x86_64/kernel/pci-gart.c too -AK.
- */
-
#include
#include
#include
@@ -21,7 +15,11 @@
#include "agp.h"
/* Will need to be increased if hammer ever goes >8-way. */
+#ifdef CONFIG_SMP
#define MAX_HAMMER_GARTS 8
+#else
+#define MAX_HAMMER_GARTS 1
+#endif
/* PTE bits. */
#define GPTE_VALID 1
@@ -39,6 +37,8 @@
static int nr_garts;
static struct pci_dev * hammers[MAX_HAMMER_GARTS];
+static int __initdata agp_try_unsupported;
+
static int gart_iterator;
#define for_each_nb() for(gart_iterator=0;gart_iterator>= 12;
tmp = (u32) addr<<4;
tmp &= ~0xf;
- pci_write_config_dword (hammer, AMD_X86_64_GARTTABLEBASE, tmp);
+ pci_write_config_dword (hammer, AMD64_GARTTABLEBASE, tmp);
/* Enable GART translation for this hammer. */
- pci_read_config_dword(hammer, AMD_X86_64_GARTAPERTURECTL, &tmp);
+ pci_read_config_dword(hammer, AMD64_GARTAPERTURECTL, &tmp);
tmp |= GARTEN;
tmp &= ~(DISGARTCPU | DISGARTIO);
- pci_write_config_dword(hammer, AMD_X86_64_GARTAPERTURECTL, tmp);
+ pci_write_config_dword(hammer, AMD64_GARTAPERTURECTL, tmp);
/* keep CPU's coherent. */
flush_x86_64_tlb (hammer);
@@ -216,9 +216,9 @@
for_each_nb() {
/* disable gart translation */
- pci_read_config_dword (hammers[gart_iterator], AMD_X86_64_GARTAPERTURECTL, &tmp);
- tmp &= ~(AMD_X86_64_GARTEN);
- pci_write_config_dword (hammers[gart_iterator], AMD_X86_64_GARTAPERTURECTL, tmp);
+ pci_read_config_dword (hammers[gart_iterator], AMD64_GARTAPERTURECTL, &tmp);
+ tmp &= ~AMD64_GARTEN;
+ pci_write_config_dword (hammers[gart_iterator], AMD64_GARTAPERTURECTL, tmp);
}
}
@@ -246,24 +246,123 @@
.agp_destroy_page = agp_generic_destroy_page,
};
+/* Some basic sanity checks for the aperture. */
+static int __init aperture_valid(u64 aper, u32 size)
+{
+ static int not_first_call;
+ u32 pfn, c;
+ if (aper == 0) {
+ printk(KERN_ERR "No aperture\n");
+ return 0;
+ }
+ if (size < 32*1024*1024) {
+ printk(KERN_ERR "Aperture too small (%d MB)\n", size>>20);
+ return 0;
+ }
+ if (aper + size > 0xffffffff) {
+ printk(KERN_ERR "Aperture out of bounds\n");
+ return 0;
+ }
+ pfn = aper >> PAGE_SHIFT;
+ for (c = 0; c < size/PAGE_SIZE; c++) {
+ if (!pfn_valid(pfn + c))
+ break;
+ if (!PageReserved(pfn_to_page(pfn + c))) {
+ printk(KERN_ERR "Aperture pointing to RAM\n");
+ return 0;
+ }
+ }
-#ifdef CONFIG_SMP
-static int cache_nbs (void)
+ /* Request the Aperture. This catches cases when someone else
+ already put a mapping in there - happens with some very broken BIOS
+
+ Maybe better to use pci_assign_resource/pci_enable_device instead trusting
+ the bridges? */
+ if (!not_first_call && request_mem_region(aper, size, "aperture") < 0) {
+ printk(KERN_ERR "Aperture conflicts with PCI mapping.\n");
+ return 0;
+ }
+
+ not_first_call = 1;
+ return 1;
+}
+
+/*
+ * W*s centric BIOS sometimes only set up the aperture in the AGP
+ * bridge, not the northbridge. On AMD64 this is handled early
+ * in aperture.c, but when GART_IOMMU is not enabled or we run
+ * on a 32bit kernel this needs to be redone.
+ * Unfortunately it is impossible to fix the aperture here because it's too late
+ * to allocate that much memory. But at least error out cleanly instead of
+ * crashing.
+ */
+static __init int fix_northbridge(struct pci_dev *nb, struct pci_dev *agp,
+ u16 cap)
+{
+ u32 aper_low, aper_hi;
+ u64 aper, nb_aper;
+ int order = 0;
+ u32 nb_order, nb_base;
+ u16 apsize;
+
+ pci_read_config_dword(nb, 0x90, &nb_order);
+ nb_order = (nb_order >> 1) & 7;
+ pci_read_config_dword(nb, 0x94, &nb_base);
+ nb_aper = nb_base << 25;
+ if (aperture_valid(nb_aper, (32*1024*1024)<> 25);
+
+ return 0;
+}
+
+static __init int cache_nbs (struct pci_dev *pdev, u32 cap_ptr)
{
struct pci_dev *loop_dev = NULL;
int i = 0;
/* cache pci_devs of northbridges. */
- while ((loop_dev = pci_find_device(PCI_VENDOR_ID_AMD, 0x1103, loop_dev)) != NULL) {
+ while ((loop_dev = pci_find_device(PCI_VENDOR_ID_AMD, 0x1103, loop_dev))
+ != NULL) {
+ if (fix_northbridge(loop_dev, pdev, cap_ptr) < 0) {
+ printk("No usable aperture found.\n");
+#ifdef __x86_64__
+ /* should port this to i386 */
+ printk("Consider rebooting with iommu=memaper=2 to get a good aperture.\n");
+#endif
+ return -1;
+ }
hammers[i++] = loop_dev;
nr_garts = i;
- if (i == MAX_HAMMER_GARTS)
+ if (i == MAX_HAMMER_GARTS) {
+ printk(KERN_INFO "Too many northbridges for AGP\n");
return -1;
+ }
}
- return 0;
+ return i == 0 ? -1 : 0;
}
-#endif
-
static int __init agp_amdk8_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
@@ -277,7 +376,7 @@
if (!cap_ptr)
return -ENODEV;
- printk(KERN_INFO PFX "Detected Opteron/Athlon64 on-CPU GART\n");
+ /* Could check for AGPv3 here */
bridge = agp_alloc_bridge();
if (!bridge)
@@ -311,6 +410,9 @@
bridge->major_version = 3;
bridge->minor_version = 0;
}
+ } else {
+ printk(KERN_INFO PFX "Detected AGP bridge %x\n",
+ pdev->devfn);
}
bridge->driver = &amd_8151_driver;
@@ -320,22 +422,10 @@
/* Fill in the mode register */
pci_read_config_dword(pdev, bridge->capndx+PCI_AGP_STATUS, &bridge->mode);
-#ifdef CONFIG_SMP
- if (cache_nbs() == -1) {
+ if (cache_nbs(pdev, cap_ptr) == -1) {
agp_put_bridge(bridge);
- return -ENOMEM;
- }
-#else
- {
- struct pci_dev *loop_dev = NULL;
- while ((loop_dev = pci_find_device(PCI_VENDOR_ID_AMD, 0x1103, loop_dev)) != NULL) {
- /* For UP, we only care about the first GART. */
- hammers[0] = loop_dev;
- nr_garts = 1;
- break;
- }
+ return -ENODEV;
}
-#endif
pci_set_drvdata(pdev, bridge);
return agp_add_bridge(bridge);
@@ -345,6 +435,8 @@
{
struct agp_bridge_data *bridge = pci_get_drvdata(pdev);
+ release_mem_region(virt_to_phys(bridge->gatt_table_real),
+ x86_64_aperture_sizes[bridge->aperture_size_idx].size);
agp_remove_bridge(bridge);
agp_put_bridge(bridge);
}
@@ -358,11 +450,21 @@
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
},
+ /* VIA K8T800 */
{
.class = (PCI_CLASS_BRIDGE_HOST << 8),
.class_mask = ~0,
.vendor = PCI_VENDOR_ID_VIA,
- .device = PCI_DEVICE_ID_VIA_K8T400M_0,
+ .device = PCI_DEVICE_ID_VIA_8385_0,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ },
+ /* VIA K8M800 / K8N800 */
+ {
+ .class = (PCI_CLASS_BRIDGE_HOST << 8),
+ .class_mask = ~0,
+ .vendor = PCI_VENDOR_ID_VIA,
+ .device = PCI_DEVICE_ID_VIA_8380_0,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
},
@@ -386,10 +488,43 @@
.remove = agp_amdk8_remove,
};
+
/* Not static due to IOMMU code calling it early. */
int __init agp_amdk8_init(void)
{
- return pci_module_init(&agp_amdk8_pci_driver);
+ int err = 0;
+ if (agp_off)
+ return -EINVAL;
+ if (pci_module_init(&agp_amdk8_pci_driver) == 0) {
+ struct pci_dev *dev;
+ if (!agp_try_unsupported && !agp_try_unsupported_boot) {
+ printk(KERN_INFO "No supported AGP bridge found.\n");
+#ifdef MODULE
+ printk(KERN_INFO "You can try agp_try_unsupported=1\n");
+#else
+ printk(KERN_INFO "You can boot with agp=try_unsupported\n");
+#endif
+ return -ENODEV;
+ }
+
+ /* First check that we have at least one K8 NB */
+ if (!pci_find_device(PCI_VENDOR_ID_AMD, 0x1103, NULL))
+ return -ENODEV;
+
+ /* Look for any AGP bridge */
+ dev = NULL;
+ err = -ENODEV;
+ while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev))) {
+ if (!pci_find_capability(dev, PCI_CAP_ID_AGP))
+ continue;
+ /* Only one bridge supported right now */
+ if (agp_amdk8_probe(dev, NULL) == 0) {
+ err = 0;
+ break;
+ }
+ }
+ }
+ return err;
}
static void __exit agp_amdk8_cleanup(void)
@@ -404,6 +539,6 @@
module_exit(agp_amdk8_cleanup);
#endif
-MODULE_AUTHOR("Dave Jones ");
+MODULE_AUTHOR("Dave Jones , Andi Kleen");
+MODULE_PARM(agp_try_unsupported, "1i");
MODULE_LICENSE("GPL and additional rights");
-
diff -Nru a/drivers/char/agp/ati-agp.c b/drivers/char/agp/ati-agp.c
--- a/drivers/char/agp/ati-agp.c Mon Aug 18 10:39:21 2003
+++ b/drivers/char/agp/ati-agp.c Thu Aug 28 16:44:18 2003
@@ -1,5 +1,5 @@
/*
- * ALi AGPGART routines.
+ * ATi AGPGART routines.
*/
#include
@@ -212,7 +212,7 @@
/* address to map too */
/*
- pci_read_config_dword(agp_bridge.dev, ATI_APBASE, &temp);
+ pci_read_config_dword(agp_bridge.dev, AGP_APBASE, &temp);
agp_bridge.gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
printk(KERN_INFO "IGP320 gart_bus_addr: %x\n", agp_bridge.gart_bus_addr);
*/
@@ -355,7 +355,7 @@
* This is a bus address even on the alpha, b/c its
* used to program the agp master not the cpu
*/
- pci_read_config_dword(agp_bridge->dev, ATI_APBASE, &temp);
+ pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp);
addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
agp_bridge->gart_bus_addr = addr;
diff -Nru a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c
--- a/drivers/char/agp/backend.c Wed Aug 13 10:20:16 2003
+++ b/drivers/char/agp/backend.c Thu Aug 28 16:22:00 2003
@@ -301,9 +301,14 @@
}
EXPORT_SYMBOL_GPL(agp_remove_bridge);
+int agp_off;
+int agp_try_unsupported_boot;
+EXPORT_SYMBOL(agp_off);
+EXPORT_SYMBOL(agp_try_unsupported_boot);
static int __init agp_init(void)
{
+ if (!agp_off)
printk(KERN_INFO "Linux agpgart interface v%d.%d (c) Dave Jones\n",
AGPGART_VERSION_MAJOR, AGPGART_VERSION_MINOR);
return 0;
@@ -313,6 +318,15 @@
{
}
+static __init int agp_setup(char *s)
+{
+ if (!strcmp(s,"off"))
+ agp_off = 1;
+ if (!strcmp(s,"try_unsupported"))
+ agp_try_unsupported_boot = 1;
+ return 1;
+}
+__setup("agp=", agp_setup);
MODULE_AUTHOR("Dave Jones ");
MODULE_DESCRIPTION("AGP GART driver");
diff -Nru a/drivers/char/agp/frontend.c b/drivers/char/agp/frontend.c
--- a/drivers/char/agp/frontend.c Sun Jul 13 05:36:05 2003
+++ b/drivers/char/agp/frontend.c Tue Aug 26 09:25:41 2003
@@ -698,7 +698,7 @@
static int agp_open(struct inode *inode, struct file *file)
{
- int minor = minor(inode->i_rdev);
+ int minor = iminor(inode);
struct agp_file_private *priv;
struct agp_client *client;
int rc = -ENXIO;
diff -Nru a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
--- a/drivers/char/agp/generic.c Wed Aug 13 01:35:50 2003
+++ b/drivers/char/agp/generic.c Wed Aug 27 11:06:10 2003
@@ -577,12 +577,12 @@
agp_device_command(command, TRUE);
return;
} else {
- /* Disable calibration cycle in RX91<1> when not in AGP3.0 mode of operation.*/
+ /* Disable calibration cycle in RX91<1> when not in AGP3.0 mode of operation.*/
command &= ~(7<<10) ;
pci_read_config_dword(agp_bridge->dev, agp_bridge->capndx+AGPCTRL, &temp);
temp |= (1<<9);
pci_write_config_dword(agp_bridge->dev, agp_bridge->capndx+AGPCTRL, temp);
-
+
printk (KERN_INFO PFX "Device is in legacy mode,"
" falling back to 2.x\n");
}
diff -Nru a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
--- a/drivers/char/agp/intel-agp.c Fri Aug 15 07:25:05 2003
+++ b/drivers/char/agp/intel-agp.c Thu Aug 28 16:44:18 2003
@@ -618,7 +618,7 @@
pci_write_config_word(agp_bridge->dev, INTEL_APSIZE, current_size->size_value);
/* address to map to */
- pci_read_config_dword(agp_bridge->dev, INTEL_APBASE, &temp);
+ pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp);
agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
/* attbase - aperture base */
@@ -657,7 +657,7 @@
current_size->size_value);
/* address to map to */
- pci_read_config_dword(agp_bridge->dev, INTEL_APBASE, &temp);
+ pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp);
agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
pci_read_config_dword(agp_bridge->dev, INTEL_ATTBASE, &addr);
@@ -708,7 +708,7 @@
pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value);
/* address to map to */
- pci_read_config_dword(agp_bridge->dev, INTEL_APBASE, &temp);
+ pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp);
agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
/* attbase - aperture base */
@@ -739,7 +739,7 @@
pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value);
/* address to map to */
- pci_read_config_dword(agp_bridge->dev, INTEL_APBASE, &temp);
+ pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp);
agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
/* attbase - aperture base */
@@ -768,7 +768,7 @@
pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value);
/* address to map to */
- pci_read_config_dword(agp_bridge->dev, INTEL_APBASE, &temp);
+ pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp);
agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
/* attbase - aperture base */
@@ -797,7 +797,7 @@
pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value);
/* address to map to */
- pci_read_config_dword(agp_bridge->dev, INTEL_APBASE, &temp);
+ pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp);
agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
/* attbase - aperture base */
@@ -826,7 +826,7 @@
pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value);
/* address to map to */
- pci_read_config_dword(agp_bridge->dev, INTEL_APBASE, &temp);
+ pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp);
agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
/* attbase - aperture base */
@@ -855,7 +855,7 @@
pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value);
/* address to map to */
- pci_read_config_dword(agp_bridge->dev, INTEL_APBASE, &temp);
+ pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp);
agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
/* attbase - aperture base */
@@ -884,7 +884,7 @@
pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value);
/* address to map to */
- pci_read_config_dword(agp_bridge->dev, INTEL_APBASE, &temp);
+ pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp);
agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
/* attbase - aperture base */
diff -Nru a/drivers/char/agp/nvidia-agp.c b/drivers/char/agp/nvidia-agp.c
--- a/drivers/char/agp/nvidia-agp.c Fri Aug 15 07:22:22 2003
+++ b/drivers/char/agp/nvidia-agp.c Thu Aug 28 16:56:50 2003
@@ -13,18 +13,6 @@
#include
#include "agp.h"
-
-/* registers */
-#define NVIDIA_0_APBASE 0x10
-#define NVIDIA_0_APSIZE 0x80
-#define NVIDIA_1_WBC 0xf0
-#define NVIDIA_2_GARTCTRL 0xd0
-#define NVIDIA_2_APBASE 0xd8
-#define NVIDIA_2_APLIMIT 0xdc
-#define NVIDIA_2_ATTBASE(i) (0xe0 + (i) * 4)
-#define NVIDIA_3_APBASE 0x50
-#define NVIDIA_3_APLIMIT 0x54
-
static struct _nvidia_private {
struct pci_dev *dev_1;
struct pci_dev *dev_2;
@@ -73,7 +61,7 @@
current_size->size_value);
/* address to map to */
- pci_read_config_dword(agp_bridge->dev, NVIDIA_0_APBASE, &apbase);
+ pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &apbase);
apbase &= PCI_BASE_ADDRESS_MEM_MASK;
agp_bridge->gart_bus_addr = apbase;
aplimit = apbase + (current_size->size * 1024 * 1024) - 1;
diff -Nru a/drivers/char/agp/sis-agp.c b/drivers/char/agp/sis-agp.c
--- a/drivers/char/agp/sis-agp.c Mon Aug 18 10:39:21 2003
+++ b/drivers/char/agp/sis-agp.c Thu Aug 28 16:44:18 2003
@@ -43,7 +43,7 @@
current_size = A_SIZE_8(agp_bridge->current_size);
pci_write_config_byte(agp_bridge->dev, SIS_TLBCNTRL, 0x05);
- pci_read_config_dword(agp_bridge->dev, SIS_APBASE, &temp);
+ pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp);
agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
pci_write_config_dword(agp_bridge->dev, SIS_ATTBASE,
agp_bridge->gatt_bus_addr);
diff -Nru a/drivers/char/agp/via-agp.c b/drivers/char/agp/via-agp.c
--- a/drivers/char/agp/via-agp.c Wed Aug 13 01:41:04 2003
+++ b/drivers/char/agp/via-agp.c Thu Aug 28 17:14:45 2003
@@ -39,7 +39,7 @@
pci_write_config_byte(agp_bridge->dev, VIA_APSIZE,
current_size->size_value);
/* address to map too */
- pci_read_config_dword(agp_bridge->dev, VIA_APBASE, &temp);
+ pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp);
agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
/* GART control register */
@@ -114,7 +114,7 @@
current_size = A_SIZE_16(agp_bridge->current_size);
/* address to map too */
- pci_read_config_dword(agp_bridge->dev, VIA_APBASE, &temp);
+ pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp);
agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
/* attbase - aperture GATT base */
@@ -215,52 +215,52 @@
{
{
.device_id = PCI_DEVICE_ID_VIA_82C597_0,
- .chipset_name = "VP3",
+ .chipset_name = "Apollo VP3",
},
{
.device_id = PCI_DEVICE_ID_VIA_82C598_0,
- .chipset_name = "MVP3",
+ .chipset_name = "Apollo MVP3",
},
{
.device_id = PCI_DEVICE_ID_VIA_8501_0,
- .chipset_name = "MVP4",
+ .chipset_name = "Apollo MVP4",
},
/* VT8601 */
{
.device_id = PCI_DEVICE_ID_VIA_8601_0,
- .chipset_name = "PLE133 ProMedia",
+ .chipset_name = "Apollo ProMedia/PLE133Ta",
},
/* VT82C693A / VT28C694T */
{
- .device_id = PCI_DEVICE_ID_VIA_82C691,
+ .device_id = PCI_DEVICE_ID_VIA_82C691_0,
.chipset_name = "Apollo Pro 133",
},
{
.device_id = PCI_DEVICE_ID_VIA_8371_0,
- .chipset_name = "Apollo Pro KX133",
+ .chipset_name = "KX133",
},
/* VT8633 */
{
.device_id = PCI_DEVICE_ID_VIA_8633_0,
- .chipset_name = "Apollo Pro 266",
+ .chipset_name = "Pro 266",
},
/* VT8361 */
{
.device_id = PCI_DEVICE_ID_VIA_8361,
- .chipset_name = "Apollo KLE133",
+ .chipset_name = "KLE133",
},
/* VT8365 / VT8362 */
{
.device_id = PCI_DEVICE_ID_VIA_8363_0,
- .chipset_name = "Apollo Pro KT133/KM133/TwisterK",
+ .chipset_name = "Twister-K/KT133x/KM133",
},
/* VT8753A */
@@ -272,79 +272,79 @@
/* VT8366 */
{
.device_id = PCI_DEVICE_ID_VIA_8367_0,
- .chipset_name = "Apollo Pro KT266/KT333",
+ .chipset_name = "KT266/KY266x/KT333",
},
/* VT8633 (for CuMine/ Celeron) */
{
.device_id = PCI_DEVICE_ID_VIA_8653_0,
- .chipset_name = "Apollo Pro 266T",
+ .chipset_name = "Pro266T",
},
/* KM266 / PM266 */
{
- .device_id = PCI_DEVICE_ID_VIA_KM266,
- .chipset_name = "KM266/PM266",
+ .device_id = PCI_DEVICE_ID_VIA_XM266,
+ .chipset_name = "PM266/KM266",
},
/* CLE266 */
{
- .device_id = PCI_DEVICE_ID_VIA_CLE266,
+ .device_id = PCI_DEVICE_ID_VIA_862X_0,
.chipset_name = "CLE266",
},
{
.device_id = PCI_DEVICE_ID_VIA_8377_0,
- .chipset_name = "Apollo Pro KT400",
+ .chipset_name = "KT400/KT400A/KT600",
},
- /* VT8604 / VT8605 / VT8603 / TwisterT
+ /* VT8604 / VT8605 / VT8603
* (Apollo Pro133A chipset with S3 Savage4) */
{
- .device_id = PCI_DEVICE_ID_VIA_82C694X_0,
- .chipset_name = "Apollo ProSavage PM133/PL133/PN133/Twister"
+ .device_id = PCI_DEVICE_ID_VIA_8605_0,
+ .chipset_name = "ProSavage PM133/PL133/PN133"
},
- /* VT8752*/
+ /* P4M266x/P4N266 */
{
- .device_id = PCI_DEVICE_ID_VIA_8752,
- .chipset_name = "ProSavage DDR P4M266",
+ .device_id = PCI_DEVICE_ID_VIA_8703_51_0,
+ .chipset_name = "P4M266x/P4N266",
},
- /* KN266/PN266 */
+ /* VT8754 */
{
- .device_id = PCI_DEVICE_ID_VIA_KN266,
- .chipset_name = "KN266/PN266",
+ .device_id = PCI_DEVICE_ID_VIA_8754C_0,
+ .chipset_name = "PT800",
},
- /* VT8754 */
+ /* P4X600 */
{
- .device_id = PCI_DEVICE_ID_VIA_8754,
- .chipset_name = "Apollo P4X333/P4X400"
+ .device_id = PCI_DEVICE_ID_VIA_8763_0,
+ .chipset_name = "P4X600"
},
- /* P4N333 */
+ /* KM400 */
{
- .device_id = PCI_DEVICE_ID_VIA_P4N333,
- .chipset_name = "P4N333",
+ .device_id = PCI_DEVICE_ID_VIA_8378_0,
+ .chipset_name = "KM400/KM400A",
},
- /* P4X600 */
+ /* PT880 */
{
- .device_id = PCI_DEVICE_ID_VIA_P4X600,
- .chipset_name = "P4X600",
+ .device_id = PCI_DEVICE_ID_VIA_PT880,
+ .chipset_name = "PT880",
},
- /* KM400 */
+ /* PT890 */
{
- .device_id = PCI_DEVICE_ID_VIA_KM400,
- .chipset_name = "KM400",
+ .device_id = PCI_DEVICE_ID_VIA_8783_0,
+ .chipset_name = "PT890",
},
- /* P4M400 */
+ /* PM800/PN800/PM880/PN880 */
{
- .device_id = PCI_DEVICE_ID_VIA_P4M400,
- .chipset_name = "P4M400",
+ .device_id = PCI_DEVICE_ID_VIA_PX8X0_0,
+ .chipset_name = "PM800/PN800/PM880/PN880",
},
{ }, /* dummy final entry, always present */
diff -Nru a/drivers/char/busmouse.c b/drivers/char/busmouse.c
--- a/drivers/char/busmouse.c Fri Jul 11 23:17:17 2003
+++ b/drivers/char/busmouse.c Tue Aug 26 09:25:41 2003
@@ -51,7 +51,7 @@
#define NR_MICE 15
#define FIRST_MOUSE 0
-#define DEV_TO_MOUSE(dev) MINOR_TO_MOUSE(minor(dev))
+#define DEV_TO_MOUSE(inode) MINOR_TO_MOUSE(iminor(inode))
#define MINOR_TO_MOUSE(minor) ((minor) - FIRST_MOUSE)
/*
@@ -190,7 +190,7 @@
unsigned int mousedev;
int ret;
- mousedev = DEV_TO_MOUSE(inode->i_rdev);
+ mousedev = DEV_TO_MOUSE(inode);
if (mousedev >= NR_MICE)
return -EINVAL;
diff -Nru a/drivers/char/cyclades.c b/drivers/char/cyclades.c
--- a/drivers/char/cyclades.c Fri Aug 1 02:20:44 2003
+++ b/drivers/char/cyclades.c Sun Aug 31 16:14:39 2003
@@ -1050,14 +1050,14 @@
udelay(5000L);
/* Enable the Tx interrupts on the CD1400 */
- save_flags(flags); cli();
+ local_irq_save(flags);
cy_writeb((u_long)address + (CyCAR<i_rdev) == DRM(minor)[i]) {
+ if (iminor(inode) == DRM(minor)[i]) {
dev = &(DRM(device)[i]);
break;
}
diff -Nru a/drivers/char/drm/drm_fops.h b/drivers/char/drm/drm_fops.h
--- a/drivers/char/drm/drm_fops.h Thu Jul 10 23:18:01 2003
+++ b/drivers/char/drm/drm_fops.h Tue Aug 26 09:25:41 2003
@@ -51,7 +51,7 @@
*/
int DRM(open_helper)(struct inode *inode, struct file *filp, drm_device_t *dev)
{
- int minor = minor(inode->i_rdev);
+ int minor = iminor(inode);
drm_file_t *priv;
if (filp->f_flags & O_EXCL) return -EBUSY; /* No exclusive opens */
diff -Nru a/drivers/char/drm/drm_stub.h b/drivers/char/drm/drm_stub.h
--- a/drivers/char/drm/drm_stub.h Thu Jul 10 23:18:01 2003
+++ b/drivers/char/drm/drm_stub.h Tue Aug 26 09:25:41 2003
@@ -62,7 +62,7 @@
*/
static int DRM(stub_open)(struct inode *inode, struct file *filp)
{
- int minor = minor(inode->i_rdev);
+ int minor = iminor(inode);
int err = -ENODEV;
struct file_operations *old_fops;
diff -Nru a/drivers/char/dsp56k.c b/drivers/char/dsp56k.c
--- a/drivers/char/dsp56k.c Wed May 7 08:47:29 2003
+++ b/drivers/char/dsp56k.c Tue Aug 26 09:25:41 2003
@@ -207,7 +207,7 @@
loff_t *ppos)
{
struct inode *inode = file->f_dentry->d_inode;
- int dev = minor(inode->i_rdev) & 0x0f;
+ int dev = iminor(inode) & 0x0f;
switch(dev)
{
@@ -270,7 +270,7 @@
loff_t *ppos)
{
struct inode *inode = file->f_dentry->d_inode;
- int dev = minor(inode->i_rdev) & 0x0f;
+ int dev = iminor(inode) & 0x0f;
switch(dev)
{
@@ -331,7 +331,7 @@
static int dsp56k_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
- int dev = minor(inode->i_rdev) & 0x0f;
+ int dev = iminor(inode) & 0x0f;
switch(dev)
{
@@ -424,7 +424,7 @@
#if 0
static unsigned int dsp56k_poll(struct file *file, poll_table *wait)
{
- int dev = minor(file->f_dentry->d_inode->i_rdev) & 0x0f;
+ int dev = iminor(file->f_dentry->d_inode) & 0x0f;
switch(dev)
{
@@ -441,7 +441,7 @@
static int dsp56k_open(struct inode *inode, struct file *file)
{
- int dev = minor(inode->i_rdev) & 0x0f;
+ int dev = iminor(inode) & 0x0f;
switch(dev)
{
@@ -472,7 +472,7 @@
static int dsp56k_release(struct inode *inode, struct file *file)
{
- int dev = minor(inode->i_rdev) & 0x0f;
+ int dev = iminor(inode) & 0x0f;
switch(dev)
{
diff -Nru a/drivers/char/dtlk.c b/drivers/char/dtlk.c
--- a/drivers/char/dtlk.c Fri Jul 11 06:34:28 2003
+++ b/drivers/char/dtlk.c Tue Aug 26 09:25:41 2003
@@ -125,7 +125,7 @@
static ssize_t dtlk_read(struct file *file, char *buf,
size_t count, loff_t * ppos)
{
- unsigned int minor = minor(file->f_dentry->d_inode->i_rdev);
+ unsigned int minor = iminor(file->f_dentry->d_inode);
char ch;
int i = 0, retries;
@@ -185,7 +185,7 @@
if (ppos != &file->f_pos)
return -ESPIPE;
- if (minor(file->f_dentry->d_inode->i_rdev) != DTLK_MINOR)
+ if (iminor(file->f_dentry->d_inode) != DTLK_MINOR)
return -EINVAL;
while (1) {
@@ -304,7 +304,7 @@
{
TRACE_TEXT("(dtlk_open");
- switch (minor(inode->i_rdev)) {
+ switch (iminor(inode)) {
case DTLK_MINOR:
if (dtlk_busy)
return -EBUSY;
@@ -319,7 +319,7 @@
{
TRACE_TEXT("(dtlk_release");
- switch (minor(inode->i_rdev)) {
+ switch (iminor(inode)) {
case DTLK_MINOR:
break;
diff -Nru a/drivers/char/ftape/lowlevel/fdc-io.c b/drivers/char/ftape/lowlevel/fdc-io.c
--- a/drivers/char/ftape/lowlevel/fdc-io.c Tue Jul 15 10:01:29 2003
+++ b/drivers/char/ftape/lowlevel/fdc-io.c Sun Aug 31 16:13:58 2003
@@ -1305,7 +1305,7 @@
} else {
TRACE(ft_t_bug, "Unexpected ftape interrupt");
}
- return IRQ_RETVAL(handled);
+ TRACE_EXIT IRQ_RETVAL(handled);
}
int fdc_grab_irq_and_dma(void)
diff -Nru a/drivers/char/ftape/zftape/zftape-init.c b/drivers/char/ftape/zftape/zftape-init.c
--- a/drivers/char/ftape/zftape/zftape-init.c Tue Jul 15 10:01:29 2003
+++ b/drivers/char/ftape/zftape/zftape-init.c Tue Aug 26 09:25:41 2003
@@ -110,11 +110,11 @@
int result;
TRACE_FUN(ft_t_flow);
- TRACE(ft_t_flow, "called for minor %d", minor(ino->i_rdev));
+ TRACE(ft_t_flow, "called for minor %d", iminor(ino));
if ( test_and_set_bit(0,&busy_flag) ) {
TRACE_ABORT(-EBUSY, ft_t_warn, "failed: already busy");
}
- if ((minor(ino->i_rdev) & ~(ZFT_MINOR_OP_MASK | FTAPE_NO_REWIND))
+ if ((iminor(ino) & ~(ZFT_MINOR_OP_MASK | FTAPE_NO_REWIND))
>
FTAPE_SEL_D) {
clear_bit(0,&busy_flag);
@@ -122,7 +122,7 @@
}
orig_sigmask = current->blocked;
sigfillset(¤t->blocked);
- result = _zft_open(minor(ino->i_rdev), filep->f_flags & O_ACCMODE);
+ result = _zft_open(iminor(ino), filep->f_flags & O_ACCMODE);
if (result < 0) {
current->blocked = orig_sigmask; /* restore mask */
clear_bit(0,&busy_flag);
@@ -144,7 +144,7 @@
int result;
TRACE_FUN(ft_t_flow);
- if ( !test_bit(0,&busy_flag) || minor(ino->i_rdev) != zft_unit) {
+ if ( !test_bit(0,&busy_flag) || iminor(ino) != zft_unit) {
TRACE(ft_t_err, "failed: not busy or wrong unit");
TRACE_EXIT 0;
}
@@ -167,7 +167,7 @@
sigset_t old_sigmask;
TRACE_FUN(ft_t_flow);
- if ( !test_bit(0,&busy_flag) || minor(ino->i_rdev) != zft_unit || ft_failure) {
+ if ( !test_bit(0,&busy_flag) || iminor(ino) != zft_unit || ft_failure) {
TRACE_ABORT(-EIO, ft_t_err,
"failed: not busy, failure or wrong unit");
}
@@ -188,7 +188,7 @@
TRACE_FUN(ft_t_flow);
if ( !test_bit(0,&busy_flag) ||
- minor(filep->f_dentry->d_inode->i_rdev) != zft_unit ||
+ iminor(filep->f_dentry->d_inode) != zft_unit ||
ft_failure)
{
TRACE_ABORT(-EIO, ft_t_err,
@@ -217,7 +217,7 @@
TRACE_FUN(ft_t_flow);
TRACE(ft_t_data_flow, "called with count: %ld", (unsigned long)req_len);
- if (!test_bit(0,&busy_flag) || minor(ino->i_rdev) != zft_unit || ft_failure) {
+ if (!test_bit(0,&busy_flag) || iminor(ino) != zft_unit || ft_failure) {
TRACE_ABORT(-EIO, ft_t_err,
"failed: not busy, failure or wrong unit");
}
@@ -240,7 +240,7 @@
TRACE_FUN(ft_t_flow);
TRACE(ft_t_flow, "called with count: %ld", (unsigned long)req_len);
- if (!test_bit(0,&busy_flag) || minor(ino->i_rdev) != zft_unit || ft_failure) {
+ if (!test_bit(0,&busy_flag) || iminor(ino) != zft_unit || ft_failure) {
TRACE_ABORT(-EIO, ft_t_err,
"failed: not busy, failure or wrong unit");
}
diff -Nru a/drivers/char/ip2main.c b/drivers/char/ip2main.c
--- a/drivers/char/ip2main.c Mon Jul 14 06:47:09 2003
+++ b/drivers/char/ip2main.c Tue Aug 26 09:25:41 2003
@@ -2733,7 +2733,7 @@
ssize_t
ip2_ipl_read(struct file *pFile, char *pData, size_t count, loff_t *off )
{
- unsigned int minor = minor( pFile->f_dentry->d_inode->i_rdev );
+ unsigned int minor = iminor(pFile->f_dentry->d_inode);
int rc = 0;
#ifdef IP2DEBUG_IPL
@@ -2863,7 +2863,7 @@
static int
ip2_ipl_ioctl ( struct inode *pInode, struct file *pFile, UINT cmd, ULONG arg )
{
- unsigned int iplminor = minor(pInode->i_rdev);
+ unsigned int iplminor = iminor(pInode);
int rc = 0;
ULONG *pIndex = (ULONG*)arg;
i2eBordStrPtr pB = i2BoardPtrTable[iplminor / 4];
@@ -2998,7 +2998,7 @@
static int
ip2_ipl_open( struct inode *pInode, struct file *pFile )
{
- unsigned int iplminor = minor(pInode->i_rdev);
+ unsigned int iplminor = iminor(pInode);
i2eBordStrPtr pB;
i2ChanStrPtr pCh;
diff -Nru a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c
--- a/drivers/char/ipmi/ipmi_devintf.c Wed May 7 08:47:29 2003
+++ b/drivers/char/ipmi/ipmi_devintf.c Tue Aug 26 09:25:41 2003
@@ -110,7 +110,7 @@
static int ipmi_open(struct inode *inode, struct file *file)
{
- int if_num = minor(inode->i_rdev);
+ int if_num = iminor(inode);
int rv;
struct ipmi_file_private *priv;
diff -Nru a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c
--- a/drivers/char/ipmi/ipmi_watchdog.c Mon Aug 11 04:34:37 2003
+++ b/drivers/char/ipmi/ipmi_watchdog.c Tue Aug 26 09:25:41 2003
@@ -645,7 +645,7 @@
static int ipmi_open(struct inode *ino, struct file *filep)
{
- switch (minor(ino->i_rdev))
+ switch (iminor(ino))
{
case WATCHDOG_MINOR:
if (ipmi_wdog_open)
@@ -688,7 +688,7 @@
static int ipmi_close(struct inode *ino, struct file *filep)
{
- if (minor(ino->i_rdev)==WATCHDOG_MINOR)
+ if (iminor(ino)==WATCHDOG_MINOR)
{
#ifndef CONFIG_WATCHDOG_NOWAYOUT
ipmi_watchdog_state = WDOG_TIMEOUT_NONE;
diff -Nru a/drivers/char/istallion.c b/drivers/char/istallion.c
--- a/drivers/char/istallion.c Mon Jun 23 18:43:58 2003
+++ b/drivers/char/istallion.c Tue Aug 26 09:25:41 2003
@@ -4805,7 +4805,7 @@
(int) fp, (int) buf, count, (int) offp);
#endif
- brdnr = minor(fp->f_dentry->d_inode->i_rdev);
+ brdnr = iminor(fp->f_dentry->d_inode);
if (brdnr >= stli_nrbrds)
return(-ENODEV);
brdp = stli_brds[brdnr];
@@ -4860,7 +4860,7 @@
(int) fp, (int) buf, count, (int) offp);
#endif
- brdnr = minor(fp->f_dentry->d_inode->i_rdev);
+ brdnr = iminor(fp->f_dentry->d_inode);
if (brdnr >= stli_nrbrds)
return(-ENODEV);
brdp = stli_brds[brdnr];
@@ -5201,7 +5201,7 @@
* Now handle the board specific ioctls. These all depend on the
* minor number of the device they were called from.
*/
- brdnr = minor(ip->i_rdev);
+ brdnr = iminor(ip);
if (brdnr >= STL_MAXBRDS)
return(-ENODEV);
brdp = stli_brds[brdnr];
diff -Nru a/drivers/char/ite_gpio.c b/drivers/char/ite_gpio.c
--- a/drivers/char/ite_gpio.c Thu Mar 6 14:03:51 2003
+++ b/drivers/char/ite_gpio.c Tue Aug 26 09:25:41 2003
@@ -238,7 +238,7 @@
static int ite_gpio_open(struct inode *inode, struct file *file)
{
- unsigned int minor = minor(inode->i_rdev);
+ unsigned int minor = iminor(inode);
if (minor != GPIO_MINOR)
return -ENODEV;
diff -Nru a/drivers/char/lcd.c b/drivers/char/lcd.c
--- a/drivers/char/lcd.c Wed May 29 12:05:13 2002
+++ b/drivers/char/lcd.c Sun Aug 31 16:14:08 2003
@@ -551,9 +551,9 @@
*/
static struct file_operations lcd_fops = {
- read: lcd_read,
- ioctl: lcd_ioctl,
- open: lcd_open,
+ .read = lcd_read,
+ .ioctl = lcd_ioctl,
+ .open = lcd_open,
};
static struct miscdevice lcd_dev=
diff -Nru a/drivers/char/lp.c b/drivers/char/lp.c
--- a/drivers/char/lp.c Wed May 7 08:47:29 2003
+++ b/drivers/char/lp.c Tue Aug 26 09:25:41 2003
@@ -292,7 +292,7 @@
static ssize_t lp_write(struct file * file, const char * buf,
size_t count, loff_t *ppos)
{
- unsigned int minor = minor(file->f_dentry->d_inode->i_rdev);
+ unsigned int minor = iminor(file->f_dentry->d_inode);
struct parport *port = lp_table[minor].dev->port;
char *kbuf = lp_table[minor].lp_buffer;
ssize_t retv = 0;
@@ -408,7 +408,7 @@
static ssize_t lp_read(struct file * file, char * buf,
size_t count, loff_t *ppos)
{
- unsigned int minor=minor(file->f_dentry->d_inode->i_rdev);
+ unsigned int minor=iminor(file->f_dentry->d_inode);
struct parport *port = lp_table[minor].dev->port;
ssize_t retval = 0;
char *kbuf = lp_table[minor].lp_buffer;
@@ -483,7 +483,7 @@
static int lp_open(struct inode * inode, struct file * file)
{
- unsigned int minor = minor(inode->i_rdev);
+ unsigned int minor = iminor(inode);
if (minor >= LP_NO)
return -ENXIO;
@@ -540,7 +540,7 @@
static int lp_release(struct inode * inode, struct file * file)
{
- unsigned int minor = minor(inode->i_rdev);
+ unsigned int minor = iminor(inode);
lp_claim_parport_or_block (&lp_table[minor]);
parport_negotiate (lp_table[minor].dev->port, IEEE1284_MODE_COMPAT);
@@ -555,7 +555,7 @@
static int lp_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
- unsigned int minor = minor(inode->i_rdev);
+ unsigned int minor = iminor(inode);
int status;
int retval = 0;
diff -Nru a/drivers/char/lp_old98.c b/drivers/char/lp_old98.c
--- a/drivers/char/lp_old98.c Thu Apr 24 03:30:40 2003
+++ b/drivers/char/lp_old98.c Tue Aug 26 09:25:41 2003
@@ -219,7 +219,7 @@
static int lp_old98_open(struct inode * inode, struct file * file)
{
- if (minor(inode->i_rdev) != 0)
+ if (iminor(inode) != 0)
return -ENXIO;
if (lp.flags & LP_BUSY)
diff -Nru a/drivers/char/mem.c b/drivers/char/mem.c
--- a/drivers/char/mem.c Tue Jun 10 23:33:17 2003
+++ b/drivers/char/mem.c Tue Aug 26 09:25:41 2003
@@ -607,7 +607,7 @@
static int memory_open(struct inode * inode, struct file * filp)
{
- switch (minor(inode->i_rdev)) {
+ switch (iminor(inode)) {
case 1:
filp->f_op = &mem_fops;
break;
diff -Nru a/drivers/char/misc.c b/drivers/char/misc.c
--- a/drivers/char/misc.c Sat May 17 12:39:13 2003
+++ b/drivers/char/misc.c Tue Aug 26 09:25:41 2003
@@ -100,7 +100,7 @@
static int misc_open(struct inode * inode, struct file * file)
{
- int minor = minor(inode->i_rdev);
+ int minor = iminor(inode);
struct miscdevice *c;
int err = -ENODEV;
struct file_operations *old_fops, *new_fops = NULL;
diff -Nru a/drivers/char/n_hdlc.c b/drivers/char/n_hdlc.c
--- a/drivers/char/n_hdlc.c Fri May 30 19:53:01 2003
+++ b/drivers/char/n_hdlc.c Sun Aug 31 16:14:27 2003
@@ -182,9 +182,9 @@
/* TTY callbacks */
-static int n_hdlc_tty_read(struct tty_struct *tty, struct file *file,
+static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file,
__u8 *buf, size_t nr);
-static int n_hdlc_tty_write(struct tty_struct *tty, struct file *file,
+static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file,
const __u8 *buf, size_t nr);
static int n_hdlc_tty_ioctl(struct tty_struct *tty, struct file *file,
unsigned int cmd, unsigned long arg);
@@ -572,7 +572,7 @@
*
* Returns the number of bytes returned or error code.
*/
-static int n_hdlc_tty_read(struct tty_struct *tty, struct file *file,
+static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file,
__u8 *buf, size_t nr)
{
struct n_hdlc *n_hdlc = tty2n_hdlc(tty);
@@ -649,7 +649,7 @@
*
* Returns the number of bytes written (or error code).
*/
-static int n_hdlc_tty_write(struct tty_struct *tty, struct file *file,
+static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file,
const __u8 *data, size_t count)
{
struct n_hdlc *n_hdlc = tty2n_hdlc (tty);
@@ -658,7 +658,7 @@
struct n_hdlc_buf *tbuf;
if (debuglevel >= DEBUG_LEVEL_INFO)
- printk("%s(%d)n_hdlc_tty_write() called count=%d\n",
+ printk("%s(%d)n_hdlc_tty_write() called count=%Zd\n",
__FILE__,__LINE__,count);
/* Verify pointers */
@@ -673,7 +673,7 @@
if (debuglevel & DEBUG_LEVEL_INFO)
printk (KERN_WARNING
"n_hdlc_tty_write: truncating user packet "
- "from %lu to %d\n", (unsigned long) count,
+ "from %lu to %Zd\n", (unsigned long) count,
maxframe );
count = maxframe;
}
diff -Nru a/drivers/char/pcxx.c b/drivers/char/pcxx.c
--- a/drivers/char/pcxx.c Wed Aug 20 14:20:10 2003
+++ b/drivers/char/pcxx.c Sun Aug 31 16:14:07 2003
@@ -121,7 +121,7 @@
MODULE_PARM(altpin, "1-4i");
MODULE_PARM(numports, "1-4i");
-#endif MODULE
+#endif /* MODULE */
static int numcards = 1;
static int nbdevs = 0;
diff -Nru a/drivers/char/ppdev.c b/drivers/char/ppdev.c
--- a/drivers/char/ppdev.c Wed May 7 08:47:29 2003
+++ b/drivers/char/ppdev.c Tue Aug 26 09:25:41 2003
@@ -104,7 +104,7 @@
static ssize_t pp_read (struct file * file, char * buf, size_t count,
loff_t * ppos)
{
- unsigned int minor = minor (file->f_dentry->d_inode->i_rdev);
+ unsigned int minor = iminor(file->f_dentry->d_inode);
struct pp_struct *pp = file->private_data;
char * kbuffer;
ssize_t bytes_read = 0;
@@ -187,7 +187,7 @@
static ssize_t pp_write (struct file * file, const char * buf, size_t count,
loff_t * ppos)
{
- unsigned int minor = minor (file->f_dentry->d_inode->i_rdev);
+ unsigned int minor = iminor(file->f_dentry->d_inode);
struct pp_struct *pp = file->private_data;
char * kbuffer;
ssize_t bytes_written = 0;
@@ -330,7 +330,7 @@
static int pp_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
- unsigned int minor = minor(inode->i_rdev);
+ unsigned int minor = iminor(inode);
struct pp_struct *pp = file->private_data;
struct parport * port;
@@ -638,7 +638,7 @@
static int pp_open (struct inode * inode, struct file * file)
{
- unsigned int minor = minor (inode->i_rdev);
+ unsigned int minor = iminor(inode);
struct pp_struct *pp;
if (minor >= PARPORT_MAX)
@@ -667,7 +667,7 @@
static int pp_release (struct inode * inode, struct file * file)
{
- unsigned int minor = minor (inode->i_rdev);
+ unsigned int minor = iminor(inode);
struct pp_struct *pp = file->private_data;
int compat_negot;
diff -Nru a/drivers/char/random.c b/drivers/char/random.c
--- a/drivers/char/random.c Wed Aug 6 10:59:31 2003
+++ b/drivers/char/random.c Sun Aug 31 16:13:54 2003
@@ -269,9 +269,9 @@
/*
* The minimum number of bits of entropy before we wake up a read on
- * /dev/random. Should always be at least 8, or at least 1 byte.
+ * /dev/random. Should be enough to do a significant reseed.
*/
-static int random_read_wakeup_thresh = 8;
+static int random_read_wakeup_thresh = 64;
/*
* If the entropy count falls under this number of bits, then we
@@ -483,9 +483,9 @@
unsigned add_ptr;
int entropy_count;
int input_rotate;
- int extract_count;
struct poolinfo poolinfo;
__u32 *pool;
+ spinlock_t lock;
};
/*
@@ -502,7 +502,7 @@
poolwords = (size + 3) / 4; /* Convert bytes->words */
/* The pool size must be a multiple of 16 32-bit words */
- poolwords = ((poolwords + 15) / 16) * 16;
+ poolwords = ((poolwords + 15) / 16) * 16;
for (p = poolinfo_table; p->poolwords; p++) {
if (poolwords == p->poolwords)
@@ -524,6 +524,7 @@
return -ENOMEM;
}
memset(r->pool, 0, POOLBYTES);
+ r->lock = SPIN_LOCK_UNLOCKED;
*ret_bucket = r;
return 0;
}
@@ -534,7 +535,6 @@
r->add_ptr = 0;
r->entropy_count = 0;
r->input_rotate = 0;
- r->extract_count = 0;
memset(r->pool, 0, r->poolinfo.POOLBYTES);
}
#ifdef CONFIG_SYSCTL
@@ -565,6 +565,9 @@
int new_rotate;
int wordmask = r->poolinfo.poolwords - 1;
__u32 w;
+ unsigned long flags;
+
+ spin_lock_irqsave(&r->lock, flags);
while (nwords--) {
w = rotate_left(r->input_rotate, *in++);
@@ -589,6 +592,8 @@
w ^= r->pool[i];
r->pool[i] = (w >> 3) ^ twist_table[w & 7];
}
+
+ spin_unlock_irqrestore(&r->lock, flags);
}
/*
@@ -596,6 +601,10 @@
*/
static void credit_entropy_store(struct entropy_store *r, int nbits)
{
+ unsigned long flags;
+
+ spin_lock_irqsave(&r->lock, flags);
+
if (r->entropy_count + nbits < 0) {
DEBUG_ENT("negative entropy/overflow (%d+%d)\n",
r->entropy_count, nbits);
@@ -605,11 +614,15 @@
} else {
r->entropy_count += nbits;
if (nbits)
- DEBUG_ENT("%s added %d bits, now %d\n",
+ DEBUG_ENT("%04d %04d : added %d bits to %s\n",
+ random_state->entropy_count,
+ sec_random_state->entropy_count,
+ nbits,
r == sec_random_state ? "secondary" :
- r == random_state ? "primary" : "unknown",
- nbits, r->entropy_count);
+ r == random_state ? "primary" : "unknown");
}
+
+ spin_unlock_irqrestore(&r->lock, flags);
}
/**********************************************************************
@@ -620,27 +633,33 @@
*
**********************************************************************/
-static __u32 *batch_entropy_pool;
-static int *batch_entropy_credit;
-static int batch_max;
+struct sample {
+ __u32 data[2];
+ int credit;
+};
+
+static struct sample *batch_entropy_pool, *batch_entropy_copy;
static int batch_head, batch_tail;
+static spinlock_t batch_lock = SPIN_LOCK_UNLOCKED;
+
+static int batch_max;
static void batch_entropy_process(void *private_);
static DECLARE_WORK(batch_work, batch_entropy_process, NULL);
/* note: the size must be a power of 2 */
static int __init batch_entropy_init(int size, struct entropy_store *r)
{
- batch_entropy_pool = kmalloc(2*size*sizeof(__u32), GFP_KERNEL);
+ batch_entropy_pool = kmalloc(size*sizeof(struct sample), GFP_KERNEL);
if (!batch_entropy_pool)
return -1;
- batch_entropy_credit =kmalloc(size*sizeof(int), GFP_KERNEL);
- if (!batch_entropy_credit) {
+ batch_entropy_copy = kmalloc(size*sizeof(struct sample), GFP_KERNEL);
+ if (!batch_entropy_copy) {
kfree(batch_entropy_pool);
return -1;
}
batch_head = batch_tail = 0;
- batch_max = size;
batch_work.data = r;
+ batch_max = size;
return 0;
}
@@ -652,27 +671,33 @@
*/
void batch_entropy_store(u32 a, u32 b, int num)
{
- int new;
+ int new;
+ unsigned long flags;
if (!batch_max)
return;
-
- batch_entropy_pool[2*batch_head] = a;
- batch_entropy_pool[(2*batch_head) + 1] = b;
- batch_entropy_credit[batch_head] = num;
- new = (batch_head+1) & (batch_max-1);
- if ((unsigned)(new - batch_tail) >= (unsigned)(batch_max / 2)) {
+ spin_lock_irqsave(&batch_lock, flags);
+
+ batch_entropy_pool[batch_head].data[0] = a;
+ batch_entropy_pool[batch_head].data[1] = b;
+ batch_entropy_pool[batch_head].credit = num;
+
+ if (((batch_head - batch_tail) & (batch_max-1)) >= (batch_max / 2)) {
/*
* Schedule it for the next timer tick:
*/
schedule_delayed_work(&batch_work, 1);
- batch_head = new;
- } else if (new == batch_tail) {
+ }
+
+ new = (batch_head+1) & (batch_max-1);
+ if (new == batch_tail) {
DEBUG_ENT("batch entropy buffer full\n");
} else {
batch_head = new;
}
+
+ spin_unlock_irqrestore(&batch_lock, flags);
}
/*
@@ -684,20 +709,34 @@
{
struct entropy_store *r = (struct entropy_store *) private_, *p;
int max_entropy = r->poolinfo.POOLBITS;
+ unsigned head, tail;
- if (!batch_max)
- return;
+ /* Mixing into the pool is expensive, so copy over the batch
+ * data and release the batch lock. The pool is at least half
+ * full, so don't worry too much about copying only the used
+ * part.
+ */
+ spin_lock_irq(&batch_lock);
+
+ memcpy(batch_entropy_copy, batch_entropy_pool,
+ batch_max*sizeof(struct sample));
+
+ head = batch_head;
+ tail = batch_tail;
+ batch_tail = batch_head;
+
+ spin_unlock_irq(&batch_lock);
p = r;
- while (batch_head != batch_tail) {
+ while (head != tail) {
if (r->entropy_count >= max_entropy) {
r = (r == sec_random_state) ? random_state :
sec_random_state;
max_entropy = r->poolinfo.POOLBITS;
}
- add_entropy_words(r, batch_entropy_pool + 2*batch_tail, 2);
- credit_entropy_store(r, batch_entropy_credit[batch_tail]);
- batch_tail = (batch_tail+1) & (batch_max-1);
+ add_entropy_words(r, batch_entropy_copy[tail].data, 2);
+ credit_entropy_store(r, batch_entropy_copy[tail].credit);
+ tail = (tail+1) & (batch_max-1);
}
if (p->entropy_count >= random_read_wakeup_thresh)
wake_up_interruptible(&random_read_wait);
@@ -1216,6 +1255,7 @@
#define EXTRACT_ENTROPY_USER 1
#define EXTRACT_ENTROPY_SECONDARY 2
+#define EXTRACT_ENTROPY_LIMIT 4
#define TMP_BUF_SIZE (HASH_BUFFER_SIZE + HASH_EXTRA_SIZE)
#define SEC_XFER_SIZE (TMP_BUF_SIZE*4)
@@ -1224,36 +1264,28 @@
/*
* This utility inline function is responsible for transfering entropy
- * from the primary pool to the secondary extraction pool. We pull
- * randomness under two conditions; one is if there isn't enough entropy
- * in the secondary pool. The other is after we have extracted 1024 bytes,
- * at which point we do a "catastrophic reseeding".
+ * from the primary pool to the secondary extraction pool. We make
+ * sure we pull enough for a 'catastrophic reseed'.
*/
static inline void xfer_secondary_pool(struct entropy_store *r,
size_t nbytes, __u32 *tmp)
{
if (r->entropy_count < nbytes * 8 &&
r->entropy_count < r->poolinfo.POOLBITS) {
- int nwords = min_t(int,
- r->poolinfo.poolwords - r->entropy_count/32,
- sizeof(tmp) / 4);
+ int bytes = max_t(int, random_read_wakeup_thresh / 8,
+ min_t(int, nbytes, TMP_BUF_SIZE));
- DEBUG_ENT("xfer %d from primary to %s (have %d, need %d)\n",
- nwords * 32,
+ DEBUG_ENT("%04d %04d : going to reseed %s with %d bits "
+ "(%d of %d requested)\n",
+ random_state->entropy_count,
+ sec_random_state->entropy_count,
r == sec_random_state ? "secondary" : "unknown",
- r->entropy_count, nbytes * 8);
+ bytes * 8, nbytes * 8, r->entropy_count);
- extract_entropy(random_state, tmp, nwords * 4, 0);
- add_entropy_words(r, tmp, nwords);
- credit_entropy_store(r, nwords * 32);
- }
- if (r->extract_count > 1024) {
- DEBUG_ENT("reseeding %s with %d from primary\n",
- r == sec_random_state ? "secondary" : "unknown",
- sizeof(tmp) * 8);
- extract_entropy(random_state, tmp, sizeof(tmp), 0);
- add_entropy_words(r, tmp, sizeof(tmp) / 4);
- r->extract_count = 0;
+ bytes=extract_entropy(random_state, tmp, bytes,
+ EXTRACT_ENTROPY_LIMIT);
+ add_entropy_words(r, tmp, bytes);
+ credit_entropy_store(r, bytes*8);
}
}
@@ -1276,8 +1308,8 @@
ssize_t ret, i;
__u32 tmp[TMP_BUF_SIZE];
__u32 x;
+ unsigned long cpuflags;
- add_timer_randomness(&extract_timer_state, nbytes);
/* Redundant, but just in case... */
if (r->entropy_count > r->poolinfo.POOLBITS)
@@ -1286,10 +1318,18 @@
if (flags & EXTRACT_ENTROPY_SECONDARY)
xfer_secondary_pool(r, nbytes, tmp);
- DEBUG_ENT("%s has %d bits, want %d bits\n",
+ /* Hold lock while accounting */
+ spin_lock_irqsave(&r->lock, cpuflags);
+
+ DEBUG_ENT("%04d %04d : trying to extract %d bits from %s\n",
+ random_state->entropy_count,
+ sec_random_state->entropy_count,
+ nbytes * 8,
r == sec_random_state ? "secondary" :
- r == random_state ? "primary" : "unknown",
- r->entropy_count, nbytes * 8);
+ r == random_state ? "primary" : "unknown");
+
+ if (flags & EXTRACT_ENTROPY_LIMIT && nbytes >= r->entropy_count / 8)
+ nbytes = r->entropy_count / 8;
if (r->entropy_count / 8 >= nbytes)
r->entropy_count -= nbytes*8;
@@ -1299,8 +1339,16 @@
if (r->entropy_count < random_write_wakeup_thresh)
wake_up_interruptible(&random_write_wait);
- r->extract_count += nbytes;
-
+ DEBUG_ENT("%04d %04d : debiting %d bits from %s%s\n",
+ random_state->entropy_count,
+ sec_random_state->entropy_count,
+ nbytes * 8,
+ r == sec_random_state ? "secondary" :
+ r == random_state ? "primary" : "unknown",
+ flags & EXTRACT_ENTROPY_LIMIT ? "" : " (unlimited)");
+
+ spin_unlock_irqrestore(&r->lock, cpuflags);
+
ret = 0;
while (nbytes) {
/*
@@ -1312,7 +1360,16 @@
ret = -ERESTARTSYS;
break;
}
+
+ DEBUG_ENT("%04d %04d : extract feeling sleepy (%d bytes left)\n",
+ random_state->entropy_count,
+ sec_random_state->entropy_count, nbytes);
+
schedule();
+
+ DEBUG_ENT("%04d %04d : extract woke up\n",
+ random_state->entropy_count,
+ sec_random_state->entropy_count);
}
/* Hash the pool to get the output */
@@ -1361,7 +1418,6 @@
nbytes -= i;
buf += i;
ret += i;
- add_timer_randomness(&extract_timer_state, nbytes);
}
/* Wipe data just returned from memory */
@@ -1488,15 +1544,27 @@
if (nbytes == 0)
return 0;
- add_wait_queue(&random_read_wait, &wait);
while (nbytes > 0) {
- set_current_state(TASK_INTERRUPTIBLE);
-
n = nbytes;
if (n > SEC_XFER_SIZE)
n = SEC_XFER_SIZE;
- if (n > random_state->entropy_count / 8)
- n = random_state->entropy_count / 8;
+
+ DEBUG_ENT("%04d %04d : reading %d bits, p: %d s: %d\n",
+ random_state->entropy_count,
+ sec_random_state->entropy_count,
+ n*8, random_state->entropy_count,
+ sec_random_state->entropy_count);
+
+ n = extract_entropy(sec_random_state, buf, n,
+ EXTRACT_ENTROPY_USER |
+ EXTRACT_ENTROPY_LIMIT |
+ EXTRACT_ENTROPY_SECONDARY);
+
+ DEBUG_ENT("%04d %04d : read got %d bits (%d still needed)\n",
+ random_state->entropy_count,
+ sec_random_state->entropy_count,
+ n*8, (nbytes-n)*8);
+
if (n == 0) {
if (file->f_flags & O_NONBLOCK) {
retval = -EAGAIN;
@@ -1506,12 +1574,27 @@
retval = -ERESTARTSYS;
break;
}
- schedule();
+
+ DEBUG_ENT("%04d %04d : sleeping?\n",
+ random_state->entropy_count,
+ sec_random_state->entropy_count);
+
+ set_current_state(TASK_INTERRUPTIBLE);
+ add_wait_queue(&random_read_wait, &wait);
+
+ if (sec_random_state->entropy_count / 8 == 0)
+ schedule();
+
+ set_current_state(TASK_RUNNING);
+ remove_wait_queue(&random_read_wait, &wait);
+
+ DEBUG_ENT("%04d %04d : waking up\n",
+ random_state->entropy_count,
+ sec_random_state->entropy_count);
+
continue;
}
- n = extract_entropy(sec_random_state, buf, n,
- EXTRACT_ENTROPY_USER |
- EXTRACT_ENTROPY_SECONDARY);
+
if (n < 0) {
retval = n;
break;
@@ -1522,8 +1605,6 @@
break; /* This break makes the device work */
/* like a named pipe */
}
- current->state = TASK_RUNNING;
- remove_wait_queue(&random_read_wait, &wait);
/*
* If we gave the user some bytes, update the access time.
@@ -1595,8 +1676,9 @@
random_ioctl(struct inode * inode, struct file * file,
unsigned int cmd, unsigned long arg)
{
- int *p, size, ent_count;
+ int *p, *tmp, size, ent_count;
int retval;
+ unsigned long flags;
switch (cmd) {
case RNDGETENTCNT:
@@ -1621,17 +1703,36 @@
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
p = (int *) arg;
- ent_count = random_state->entropy_count;
- if (put_user(ent_count, p++) ||
- get_user(size, p) ||
+ if (get_user(size, p) ||
put_user(random_state->poolinfo.poolwords, p++))
return -EFAULT;
if (size < 0)
- return -EINVAL;
+ return -EFAULT;
if (size > random_state->poolinfo.poolwords)
size = random_state->poolinfo.poolwords;
- if (copy_to_user(p, random_state->pool, size * sizeof(__u32)))
+
+ /* prepare to atomically snapshot pool */
+
+ tmp = kmalloc(size * sizeof(__u32), GFP_KERNEL);
+
+ if (!tmp)
return -EFAULT;
+
+ spin_lock_irqsave(&random_state->lock, flags);
+ ent_count = random_state->entropy_count;
+ memcpy(tmp, random_state->pool, size * sizeof(__u32));
+ spin_unlock_irqrestore(&random_state->lock, flags);
+
+ if (!copy_to_user(p, tmp, size * sizeof(__u32))) {
+ kfree(tmp);
+ return -EFAULT;
+ }
+
+ kfree(tmp);
+
+ if(put_user(ent_count, p++))
+ return -EFAULT;
+
return 0;
case RNDADDENTROPY:
if (!capable(CAP_SYS_ADMIN))
diff -Nru a/drivers/char/raw.c b/drivers/char/raw.c
--- a/drivers/char/raw.c Fri Jun 20 13:16:17 2003
+++ b/drivers/char/raw.c Sun Aug 31 16:14:45 2003
@@ -43,7 +43,7 @@
*/
static int raw_open(struct inode *inode, struct file *filp)
{
- const int minor = minor(inode->i_rdev);
+ const int minor = iminor(inode);
struct block_device *bdev;
int err;
@@ -60,23 +60,25 @@
bdev = raw_devices[minor].binding;
err = -ENODEV;
if (bdev) {
- err = bd_claim(bdev, raw_open);
+ err = blkdev_get(bdev, filp->f_mode, 0, BDEV_RAW);
if (err)
goto out;
- atomic_inc(&bdev->bd_count);
- err = blkdev_get(bdev, filp->f_mode, 0, BDEV_RAW);
+ igrab(bdev->bd_inode);
+ err = bd_claim(bdev, raw_open);
+ if (err) {
+ blkdev_put(bdev, BDEV_RAW);
+ goto out;
+ }
+ err = set_blocksize(bdev, bdev_hardsect_size(bdev));
if (err) {
bd_release(bdev);
+ blkdev_put(bdev, BDEV_RAW);
goto out;
- } else {
- err = set_blocksize(bdev, bdev_hardsect_size(bdev));
- if (err == 0) {
- filp->f_flags |= O_DIRECT;
- if (++raw_devices[minor].inuse == 1)
- filp->f_dentry->d_inode->i_mapping =
- bdev->bd_inode->i_mapping;
- }
}
+ filp->f_flags |= O_DIRECT;
+ if (++raw_devices[minor].inuse == 1)
+ filp->f_dentry->d_inode->i_mapping =
+ bdev->bd_inode->i_mapping;
}
filp->private_data = bdev;
out:
@@ -90,7 +92,7 @@
*/
static int raw_release(struct inode *inode, struct file *filp)
{
- const int minor= minor(inode->i_rdev);
+ const int minor= iminor(inode);
struct block_device *bdev;
down(&raw_mutex);
diff -Nru a/drivers/char/rtc.c b/drivers/char/rtc.c
--- a/drivers/char/rtc.c Tue Aug 12 13:25:18 2003
+++ b/drivers/char/rtc.c Sun Aug 31 16:15:40 2003
@@ -44,10 +44,12 @@
* 1.11 Takashi Iwai: Kernel access functions
* rtc_register/rtc_unregister/rtc_control
* 1.11a Daniele Bellucci: Audit create_proc_read_entry in rtc_init
+ * 1.12 Venkatesh Pallipadi: Hooks for emulating rtc on HPET base-timer
+ * CONFIG_HPET_EMULATE_RTC
*
*/
-#define RTC_VERSION "1.11a"
+#define RTC_VERSION "1.12"
#define RTC_IO_EXTENT 0x8
@@ -80,6 +82,10 @@
#include
#include
+#if defined(__i386__)
+#include
+#endif
+
#ifdef __sparc__
#include
#include
@@ -95,6 +101,17 @@
static int rtc_has_irq = 1;
#endif
+#ifndef CONFIG_HPET_EMULATE_RTC
+#define is_hpet_enabled() 0
+#define hpet_set_alarm_time(hrs, min, sec) 0
+#define hpet_set_periodic_freq(arg) 0
+#define hpet_mask_rtc_irq_bit(arg) 0
+#define hpet_set_rtc_irq_bit(arg) 0
+#define hpet_rtc_timer_init() do { } while (0)
+#define hpet_rtc_dropped_irq() 0
+static inline irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs) {return 0;}
+#endif
+
/*
* We sponge a minor off of the misc major. No need slurping
* up another valuable major dev number for this. If you add
@@ -120,7 +137,7 @@
static unsigned int rtc_poll(struct file *file, poll_table *wait);
#endif
-static void get_rtc_time (struct rtc_time *rtc_tm);
+void get_rtc_time (struct rtc_time *rtc_tm);
static void get_rtc_alm_time (struct rtc_time *alm_tm);
#if RTC_IRQ
static void rtc_dropped_irq(unsigned long data);
@@ -182,7 +199,7 @@
* (See ./arch/XXXX/kernel/time.c for the set_rtc_mmss() function.)
*/
-static irqreturn_t rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
/*
* Can be an alarm interrupt, update complete interrupt,
@@ -194,7 +211,16 @@
spin_lock (&rtc_lock);
rtc_irq_data += 0x100;
rtc_irq_data &= ~0xff;
- rtc_irq_data |= (CMOS_READ(RTC_INTR_FLAGS) & 0xF0);
+ if (is_hpet_enabled()) {
+ /*
+ * In this case it is HPET RTC interrupt handler
+ * calling us, with the interrupt information
+ * passed as arg1, instead of irq.
+ */
+ rtc_irq_data |= (unsigned long)irq & 0xF0;
+ } else {
+ rtc_irq_data |= (CMOS_READ(RTC_INTR_FLAGS) & 0xF0);
+ }
if (rtc_status & RTC_TIMER_ON)
mod_timer(&rtc_irq_timer, jiffies + HZ/rtc_freq + 2*HZ/100);
@@ -429,6 +455,12 @@
sec = alm_tm.tm_sec;
spin_lock_irq(&rtc_lock);
+ if (hpet_set_alarm_time(hrs, min, sec)) {
+ /*
+ * Fallthru and set alarm time in CMOS too,
+ * so that we will get proper value in RTC_ALM_READ
+ */
+ }
if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) ||
RTC_ALWAYS_BCD)
{
@@ -582,6 +614,10 @@
return -EINVAL;
spin_lock_irq(&rtc_lock);
+ if (hpet_set_periodic_freq(arg)) {
+ spin_unlock_irq(&rtc_lock);
+ return 0;
+ }
rtc_freq = arg;
val = CMOS_READ(RTC_FREQ_SELECT) & 0xf0;
@@ -667,13 +703,14 @@
*/
spin_lock_irq(&rtc_lock);
- tmp = CMOS_READ(RTC_CONTROL);
- tmp &= ~RTC_PIE;
- tmp &= ~RTC_AIE;
- tmp &= ~RTC_UIE;
- CMOS_WRITE(tmp, RTC_CONTROL);
- CMOS_READ(RTC_INTR_FLAGS);
-
+ if (!hpet_mask_rtc_irq_bit(RTC_PIE | RTC_AIE | RTC_UIE)) {
+ tmp = CMOS_READ(RTC_CONTROL);
+ tmp &= ~RTC_PIE;
+ tmp &= ~RTC_AIE;
+ tmp &= ~RTC_UIE;
+ CMOS_WRITE(tmp, RTC_CONTROL);
+ CMOS_READ(RTC_INTR_FLAGS);
+ }
if (rtc_status & RTC_TIMER_ON) {
rtc_status &= ~RTC_TIMER_ON;
del_timer(&rtc_irq_timer);
@@ -765,12 +802,14 @@
rtc_callback = NULL;
/* disable controls */
- tmp = CMOS_READ(RTC_CONTROL);
- tmp &= ~RTC_PIE;
- tmp &= ~RTC_AIE;
- tmp &= ~RTC_UIE;
- CMOS_WRITE(tmp, RTC_CONTROL);
- CMOS_READ(RTC_INTR_FLAGS);
+ if (!hpet_mask_rtc_irq_bit(RTC_PIE | RTC_AIE | RTC_UIE)) {
+ tmp = CMOS_READ(RTC_CONTROL);
+ tmp &= ~RTC_PIE;
+ tmp &= ~RTC_AIE;
+ tmp &= ~RTC_UIE;
+ CMOS_WRITE(tmp, RTC_CONTROL);
+ CMOS_READ(RTC_INTR_FLAGS);
+ }
if (rtc_status & RTC_TIMER_ON) {
rtc_status &= ~RTC_TIMER_ON;
del_timer(&rtc_irq_timer);
@@ -822,6 +861,10 @@
&rtc_fops
};
+#if RTC_IRQ
+static irqreturn_t (*rtc_int_handler_ptr)(int irq, void *dev_id, struct pt_regs *regs);
+#endif
+
static int __init rtc_init(void)
{
#if defined(__alpha__) || defined(__mips__)
@@ -889,12 +932,20 @@
}
#if RTC_IRQ
- if (request_irq(RTC_IRQ, rtc_interrupt, SA_INTERRUPT, "rtc", NULL)) {
+ if (is_hpet_enabled()) {
+ rtc_int_handler_ptr = hpet_rtc_interrupt;
+ } else {
+ rtc_int_handler_ptr = rtc_interrupt;
+ }
+
+ if(request_irq(RTC_IRQ, rtc_int_handler_ptr, SA_INTERRUPT, "rtc", NULL)) {
/* Yeah right, seeing as irq 8 doesn't even hit the bus. */
printk(KERN_ERR "rtc: IRQ %d is not free.\n", RTC_IRQ);
release_region(RTC_PORT(0), RTC_IO_EXTENT);
return -EIO;
}
+ hpet_rtc_timer_init();
+
#endif
#endif /* __sparc__ vs. others */
@@ -965,10 +1016,12 @@
init_timer(&rtc_irq_timer);
rtc_irq_timer.function = rtc_dropped_irq;
spin_lock_irq(&rtc_lock);
- /* Initialize periodic freq. to CMOS reset default, which is 1024Hz */
- CMOS_WRITE(((CMOS_READ(RTC_FREQ_SELECT) & 0xF0) | 0x06), RTC_FREQ_SELECT);
- spin_unlock_irq(&rtc_lock);
rtc_freq = 1024;
+ if (!hpet_set_periodic_freq(rtc_freq)) {
+ /* Initialize periodic freq. to CMOS reset default, which is 1024Hz */
+ CMOS_WRITE(((CMOS_READ(RTC_FREQ_SELECT) & 0xF0) | 0x06), RTC_FREQ_SELECT);
+ }
+ spin_unlock_irq(&rtc_lock);
no_irq2:
#endif
@@ -1019,6 +1072,11 @@
spin_lock_irq (&rtc_lock);
+ if (hpet_rtc_dropped_irq()) {
+ spin_unlock_irq(&rtc_lock);
+ return;
+ }
+
/* Just in case someone disabled the timer from behind our back... */
if (rtc_status & RTC_TIMER_ON)
mod_timer(&rtc_irq_timer, jiffies + HZ/rtc_freq + 2*HZ/100);
@@ -1148,7 +1206,7 @@
return uip;
}
-static void get_rtc_time(struct rtc_time *rtc_tm)
+void get_rtc_time(struct rtc_time *rtc_tm)
{
unsigned long uip_watchdog = jiffies;
unsigned char ctrl;
@@ -1254,6 +1312,10 @@
unsigned char val;
spin_lock_irq(&rtc_lock);
+ if (hpet_mask_rtc_irq_bit(bit)) {
+ spin_unlock_irq(&rtc_lock);
+ return;
+ }
val = CMOS_READ(RTC_CONTROL);
val &= ~bit;
CMOS_WRITE(val, RTC_CONTROL);
@@ -1268,6 +1330,10 @@
unsigned char val;
spin_lock_irq(&rtc_lock);
+ if (hpet_set_rtc_irq_bit(bit)) {
+ spin_unlock_irq(&rtc_lock);
+ return;
+ }
val = CMOS_READ(RTC_CONTROL);
val |= bit;
CMOS_WRITE(val, RTC_CONTROL);
diff -Nru a/drivers/char/scx200_gpio.c b/drivers/char/scx200_gpio.c
--- a/drivers/char/scx200_gpio.c Sat Dec 7 08:54:07 2002
+++ b/drivers/char/scx200_gpio.c Tue Aug 26 09:25:41 2003
@@ -29,7 +29,7 @@
static ssize_t scx200_gpio_write(struct file *file, const char *data,
size_t len, loff_t *ppos)
{
- unsigned m = minor(file->f_dentry->d_inode->i_rdev);
+ unsigned m = iminor(file->f_dentry->d_inode);
size_t i;
if (ppos != &file->f_pos)
@@ -80,7 +80,7 @@
static ssize_t scx200_gpio_read(struct file *file, char *buf,
size_t len, loff_t *ppos)
{
- unsigned m = minor(file->f_dentry->d_inode->i_rdev);
+ unsigned m = iminor(file->f_dentry->d_inode);
int value;
if (ppos != &file->f_pos)
@@ -95,7 +95,7 @@
static int scx200_gpio_open(struct inode *inode, struct file *file)
{
- unsigned m = minor(inode->i_rdev);
+ unsigned m = iminor(inode);
if (m > 63)
return -EINVAL;
return 0;
diff -Nru a/drivers/char/sonypi.c b/drivers/char/sonypi.c
--- a/drivers/char/sonypi.c Fri Jun 13 07:30:24 2003
+++ b/drivers/char/sonypi.c Fri Aug 1 05:36:14 2003
@@ -308,7 +308,7 @@
int i, j;
v1 = inb_p(sonypi_device.ioport1);
- v2 = inb_p(sonypi_device.ioport2);
+ v2 = inb_p(sonypi_device.ioport1 + sonypi_device.evtype_offset);
for (i = 0; sonypi_eventtypes[i].model; i++) {
if (sonypi_device.model != sonypi_eventtypes[i].model)
@@ -670,11 +670,13 @@
if (sonypi_device.model == SONYPI_DEVICE_MODEL_TYPE2) {
ioport_list = sonypi_type2_ioport_list;
sonypi_device.region_size = SONYPI_TYPE2_REGION_SIZE;
+ sonypi_device.evtype_offset = SONYPI_TYPE2_EVTYPE_OFFSET;
irq_list = sonypi_type2_irq_list;
}
else {
ioport_list = sonypi_type1_ioport_list;
sonypi_device.region_size = SONYPI_TYPE1_REGION_SIZE;
+ sonypi_device.evtype_offset = SONYPI_TYPE1_EVTYPE_OFFSET;
irq_list = sonypi_type1_irq_list;
}
diff -Nru a/drivers/char/sonypi.h b/drivers/char/sonypi.h
--- a/drivers/char/sonypi.h Tue Jun 10 03:03:28 2003
+++ b/drivers/char/sonypi.h Thu Aug 7 02:36:23 2003
@@ -56,12 +56,14 @@
#define SONYPI_BASE 0x50
#define SONYPI_G10A (SONYPI_BASE+0x14)
#define SONYPI_TYPE1_REGION_SIZE 0x08
+#define SONYPI_TYPE1_EVTYPE_OFFSET 0x04
/* type2 series specifics */
#define SONYPI_SIRQ 0x9b
#define SONYPI_SLOB 0x9c
#define SONYPI_SHIB 0x9d
#define SONYPI_TYPE2_REGION_SIZE 0x20
+#define SONYPI_TYPE2_EVTYPE_OFFSET 0x12
/* battery / brightness addresses */
#define SONYPI_BAT_FLAGS 0x81
@@ -167,6 +169,7 @@
#define SONYPI_THUMBPHRASE_MASK 0x00000200
#define SONYPI_MEYE_MASK 0x00000400
#define SONYPI_MEMORYSTICK_MASK 0x00000800
+#define SONYPI_BATTERY_MASK 0x00001000
struct sonypi_event {
u8 data;
@@ -293,6 +296,13 @@
{ 0, 0 }
};
+/* The set of possible battery events */
+static struct sonypi_event sonypi_batteryev[] = {
+ { 0x20, SONYPI_EVENT_BATTERY_INSERT },
+ { 0x30, SONYPI_EVENT_BATTERY_REMOVE },
+ { 0, 0 }
+};
+
struct sonypi_eventtypes {
int model;
u8 data;
@@ -307,19 +317,22 @@
{ SONYPI_DEVICE_MODEL_TYPE1, 0x20, SONYPI_FNKEY_MASK, sonypi_fnkeyev },
{ SONYPI_DEVICE_MODEL_TYPE1, 0x30, SONYPI_BLUETOOTH_MASK, sonypi_blueev },
{ SONYPI_DEVICE_MODEL_TYPE1, 0x40, SONYPI_PKEY_MASK, sonypi_pkeyev },
+ { SONYPI_DEVICE_MODEL_TYPE1, 0x30, SONYPI_MEMORYSTICK_MASK, sonypi_memorystickev },
+ { SONYPI_DEVICE_MODEL_TYPE1, 0x40, SONYPI_BATTERY_MASK, sonypi_batteryev },
{ SONYPI_DEVICE_MODEL_TYPE2, 0, 0xffffffff, sonypi_releaseev },
{ SONYPI_DEVICE_MODEL_TYPE2, 0x38, SONYPI_LID_MASK, sonypi_lidev },
- { SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_JOGGER_MASK, sonypi_joggerev },
+ { SONYPI_DEVICE_MODEL_TYPE2, 0x11, SONYPI_JOGGER_MASK, sonypi_joggerev },
{ SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_CAPTURE_MASK, sonypi_captureev },
- { SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_FNKEY_MASK, sonypi_fnkeyev },
- { SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_BLUETOOTH_MASK, sonypi_blueev },
+ { SONYPI_DEVICE_MODEL_TYPE2, 0x21, SONYPI_FNKEY_MASK, sonypi_fnkeyev },
+ { SONYPI_DEVICE_MODEL_TYPE2, 0x31, SONYPI_BLUETOOTH_MASK, sonypi_blueev },
{ SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_PKEY_MASK, sonypi_pkeyev },
- { SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_BACK_MASK, sonypi_backev },
+ { SONYPI_DEVICE_MODEL_TYPE2, 0x11, SONYPI_BACK_MASK, sonypi_backev },
{ SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_HELP_MASK, sonypi_helpev },
{ SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_ZOOM_MASK, sonypi_zoomev },
{ SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_THUMBPHRASE_MASK, sonypi_thumbphraseev },
- { SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_MEMORYSTICK_MASK, sonypi_memorystickev },
+ { SONYPI_DEVICE_MODEL_TYPE2, 0x31, SONYPI_MEMORYSTICK_MASK, sonypi_memorystickev },
+ { SONYPI_DEVICE_MODEL_TYPE2, 0x41, SONYPI_BATTERY_MASK, sonypi_batteryev },
{ 0, 0, 0, 0 }
};
@@ -354,6 +367,7 @@
u16 ioport1;
u16 ioport2;
u16 region_size;
+ u16 evtype_offset;
int camera_power;
int bluetooth_power;
struct semaphore lock;
diff -Nru a/drivers/char/stallion.c b/drivers/char/stallion.c
--- a/drivers/char/stallion.c Wed Jul 30 04:37:51 2003
+++ b/drivers/char/stallion.c Sun Aug 24 05:39:23 2003
@@ -3078,7 +3078,7 @@
(int) fp, cmd, (int) arg);
#endif
- brdnr = minor(ip->i_rdev);
+ brdnr = iminor(ip);
if (brdnr >= STL_MAXBRDS)
return(-ENODEV);
rc = 0;
@@ -4234,7 +4234,7 @@
misr = inb(ioaddr + EREG_DATA);
if (misr & MISR_DCD) {
set_bit(ASYI_DCDCHANGE, &portp->istate);
- schedule_task(&portp->tqueue);
+ schedule_work(&portp->tqueue);
portp->stats.modem++;
}
@@ -5031,7 +5031,7 @@
if ((len == 0) || ((len < STL_TXBUFLOW) &&
(test_bit(ASYI_TXLOW, &portp->istate) == 0))) {
set_bit(ASYI_TXLOW, &portp->istate);
- schedule_task(&portp->tqueue);
+ schedule_work(&portp->tqueue);
}
if (len == 0) {
@@ -5248,7 +5248,7 @@
ipr = stl_sc26198getreg(portp, IPR);
if (ipr & IPR_DCDCHANGE) {
set_bit(ASYI_DCDCHANGE, &portp->istate);
- schedule_task(&portp->tqueue);
+ schedule_work(&portp->tqueue);
portp->stats.modem++;
}
break;
diff -Nru a/drivers/char/tipar.c b/drivers/char/tipar.c
--- a/drivers/char/tipar.c Wed May 7 08:47:30 2003
+++ b/drivers/char/tipar.c Tue Aug 26 09:25:41 2003
@@ -248,7 +248,7 @@
static int
tipar_open(struct inode *inode, struct file *file)
{
- unsigned int minor = minor(inode->i_rdev) - TIPAR_MINOR;
+ unsigned int minor = iminor(inode) - TIPAR_MINOR;
if (minor > tp_count - 1)
return -ENXIO;
@@ -266,7 +266,7 @@
static int
tipar_close(struct inode *inode, struct file *file)
{
- unsigned int minor = minor(inode->i_rdev) - TIPAR_MINOR;
+ unsigned int minor = iminor(inode) - TIPAR_MINOR;
if (minor > tp_count - 1)
return -ENXIO;
@@ -279,8 +279,7 @@
static ssize_t
tipar_write(struct file *file, const char *buf, size_t count, loff_t * ppos)
{
- unsigned int minor =
- minor(file->f_dentry->d_inode->i_rdev) - TIPAR_MINOR;
+ unsigned int minor = iminor(file->f_dentry->d_inode) - TIPAR_MINOR;
ssize_t n;
parport_claim_or_block(table[minor].dev);
@@ -308,8 +307,7 @@
tipar_read(struct file *file, char *buf, size_t count, loff_t * ppos)
{
int b = 0;
- unsigned int minor =
- minor(file->f_dentry->d_inode->i_rdev) - TIPAR_MINOR;
+ unsigned int minor = iminor(file->f_dentry->d_inode) - TIPAR_MINOR;
ssize_t retval = 0;
ssize_t n = 0;
diff -Nru a/drivers/char/tpqic02.c b/drivers/char/tpqic02.c
--- a/drivers/char/tpqic02.c Wed May 7 08:47:30 2003
+++ b/drivers/char/tpqic02.c Tue Aug 26 09:25:41 2003
@@ -169,7 +169,7 @@
static volatile unsigned dma_mode; /* !=0 also means DMA in use */
static flag need_rewind = YES;
-static kdev_t current_tape_dev;
+static int current_type;
static int extra_blocks_left = BLOCKS_BEYOND_EW;
static struct timer_list tp_timer;
@@ -677,7 +677,7 @@
* exception flag from previous exception which we are trying to clear.
*/
- if (TP_DIAGS(current_tape_dev))
+ if (TP_DIAGS(current_type))
printk(TPQIC02_NAME ": reading status bytes: ");
for (q = stp; q < stp + size; q++) {
@@ -693,7 +693,7 @@
*q = inb_p(QIC02_DATA_PORT); /* read status byte */
- if (TP_DIAGS(current_tape_dev))
+ if (TP_DIAGS(current_type))
printk("[%1d]=0x%x ", q - stp, (unsigned) (*q) & 0xff);
outb_p(ctlbits | QIC02_CTL_REQUEST, QIC02_CTL_PORT); /* set request */
@@ -714,7 +714,7 @@
cpu_relax();
/* wait for ready */
- if (TP_DIAGS(current_tape_dev))
+ if (TP_DIAGS(current_type))
printk("\n");
return TE_OK;
@@ -1614,7 +1614,7 @@
if (status_expect_int) {
#ifdef WANT_EXTRA_FULL_DEBUGGING
- if (TP_DIAGS(current_tape_dev))
+ if (TP_DIAGS(current_type))
printk("@");
#endif
stat = inb(QIC02_STAT_PORT); /* Knock, knock */
@@ -1726,7 +1726,7 @@
static ssize_t qic02_tape_read(struct file *filp, char *buf, size_t count, loff_t * ppos)
{
- kdev_t dev = filp->f_dentry->d_inode->i_rdev;
+ int type = iminor(filp->f_dentry->d_inode);
unsigned short flags = filp->f_flags;
unsigned long bytes_todo, bytes_done, total_bytes_done = 0;
int stat;
@@ -1736,8 +1736,8 @@
return -ENXIO;
}
- if (TP_DIAGS(current_tape_dev))
- printk(TPQIC02_NAME ": request READ, minor=%x, buf=%p, count=%lx, pos=%Lx, flags=%x\n", minor(dev), buf,
+ if (TP_DIAGS(current_type))
+ printk(TPQIC02_NAME ": request READ, minor=%x, buf=%p, count=%lx, pos=%Lx, flags=%x\n", type, buf,
(long) count, filp->f_pos, flags);
if (count % TAPE_BLKSIZE) { /* Only allow mod 512 bytes at a time. */
@@ -1904,7 +1904,7 @@
*/
static ssize_t qic02_tape_write(struct file *filp, const char *buf, size_t count, loff_t * ppos)
{
- kdev_t dev = filp->f_dentry->d_inode->i_rdev;
+ int type = iminor(filp->f_dentry->d_inode);
unsigned short flags = filp->f_flags;
unsigned long bytes_todo, bytes_done, total_bytes_done = 0;
@@ -1913,9 +1913,9 @@
return -ENXIO;
}
- if (TP_DIAGS(current_tape_dev)) {
+ if (TP_DIAGS(current_type)) {
printk(TPQIC02_NAME ": request WRITE, minor=%x, buf=%p, count=%lx, pos=%Lx, flags=%x\n",
- minor(dev), buf, (long) count, filp->f_pos, flags);
+ type, buf, (long) count, filp->f_pos, flags);
}
if (count % TAPE_BLKSIZE) { /* only allow mod 512 bytes at a time */
@@ -2070,17 +2070,18 @@
static int qic02_tape_open_no_use_count(struct inode *inode,
struct file *filp)
{
- kdev_t dev = inode->i_rdev;
+ int type = iminor(inode);
unsigned short flags = filp->f_flags;
unsigned short dens = 0;
int s;
- if (TP_DIAGS(dev)) {
- printk("qic02_tape_open: dev=%s, flags=%x ", cdevname(dev), flags);
+ if (TP_DIAGS(type)) {
+ printk("qic02_tape_open: dev=tpqic2(%d), flags=%x ",
+ type, flags);
}
- if (minor(dev) == 255) { /* special case for resetting */
+ if (type == 255) { /* special case for resetting */
if (capable(CAP_SYS_ADMIN)) {
return (tape_reset(1) == TE_OK) ? -EAGAIN : -ENXIO;
} else {
@@ -2162,7 +2163,7 @@
*/
/* not allowed to do QCMD_DENS_* unless tape is rewound */
- if ((TP_DENS(dev) != 0) && (TP_DENS(current_tape_dev) != TP_DENS(dev))) {
+ if ((TP_DENS(type) != 0) && (TP_DENS(current_type) != TP_DENS(type))) {
/* force rewind if minor bits have changed,
* i.e. user wants to use tape in different format.
* [assuming single drive operation]
@@ -2175,7 +2176,7 @@
/* density bits still the same, but TP_DIAGS bit
* may have changed.
*/
- current_tape_dev = dev;
+ current_type = type;
}
if (need_rewind == YES) {
@@ -2212,14 +2213,14 @@
* so we must have done a rewind by now. If not, just skip over.
* Only give set density command when minor bits have changed.
*/
- if (TP_DENS(current_tape_dev) == TP_DENS(dev)) {
+ if (TP_DENS(current_type) == TP_DENS(type)) {
return 0;
}
- current_tape_dev = dev;
+ current_type = type;
need_rewind = NO;
if (TP_HAVE_DENS) {
- dens = TP_DENS(dev);
+ dens = TP_DENS(type);
}
if (dens < sizeof(format_names) / sizeof(char *))
@@ -2227,7 +2228,7 @@
else
tpqputs(TPQD_REWIND, "Wait for retensioning...");
- switch (TP_DENS(dev)) {
+ switch (TP_DENS(type)) {
case 0: /* Minor 0 is for drives without set-density support */
s = 0;
break;
@@ -2254,7 +2255,7 @@
}
if (s != 0) {
status_dead = YES; /* force reset */
- current_tape_dev = NODEV;/* earlier 0xff80 */
+ current_type = 0;/* earlier 0xff80 */
return -EIO;
}
@@ -2264,10 +2265,10 @@
static int qic02_tape_release(struct inode *inode, struct file *filp)
{
- kdev_t dev = inode->i_rdev;
+ int type = iminor(inode);
- if (TP_DIAGS(dev)) {
- printk("qic02_tape_release: dev=%s\n", cdevname(dev));
+ if (TP_DIAGS(type)) {
+ printk("qic02_tape_release: dev=tpqic2(%d)\n", type);
}
if (status_zombie == NO) { /* don't rewind in zombie mode */
@@ -2283,7 +2284,7 @@
/* Rewind only if minor number requires it AND
* read/writes have been done. ************* IS THIS CORRECT??????????
*/
- if ((TP_REWCLOSE(dev)) && (status_bytes_rd | status_bytes_wr)) {
+ if (TP_REWCLOSE(type) && (status_bytes_rd | status_bytes_wr)) {
tpqputs(TPQD_REWIND, "release: Doing rewind...");
(void) do_qic_cmd(QCMD_REWIND, TIM_R);
}
@@ -2398,7 +2399,7 @@
struct mtpos ioctl_tell;
- if (TP_DIAGS(current_tape_dev))
+ if (TP_DIAGS(current_type))
printk(TPQIC02_NAME ": ioctl(%4x, %4lx)\n", iocmd, ioarg);
if (!inode)
@@ -2459,7 +2460,7 @@
* --- tape at the beginning of the current file.
*/
- if (TP_DIAGS(current_tape_dev))
+ if (TP_DIAGS(current_type))
printk("OP op=%4x, count=%4x\n", operation.mt_op, operation.mt_count);
if (operation.mt_count < 0)
@@ -2492,7 +2493,7 @@
return 0;
} else if (c == _IOC_NR(MTIOCGET)) {
- if (TP_DIAGS(current_tape_dev))
+ if (TP_DIAGS(current_type))
printk("GET ");
CHECK_IOC_SIZE(mtget);
@@ -2507,7 +2508,7 @@
return -EFAULT;
return 0;
} else if (TP_HAVE_TELL && (c == _IOC_NR(MTIOCPOS))) {
- if (TP_DIAGS(current_tape_dev))
+ if (TP_DIAGS(current_type))
printk("POS ");
CHECK_IOC_SIZE(mtpos);
@@ -2664,7 +2665,7 @@
return -ENODEV;
}
- current_tape_dev = mk_kdev(QIC02_TAPE_MAJOR, 0);
+ current_type = 0;
#ifndef CONFIG_QIC02_DYNCONF
printk(TPQIC02_NAME ": IRQ %d, DMA %d, IO 0x%x, IFC %s, %s, %s\n",
diff -Nru a/drivers/char/tty_io.c b/drivers/char/tty_io.c
--- a/drivers/char/tty_io.c Fri Aug 1 02:22:20 2003
+++ b/drivers/char/tty_io.c Sun Aug 31 16:15:47 2003
@@ -177,7 +177,7 @@
EXPORT_SYMBOL(tty_name);
-inline int tty_paranoia_check(struct tty_struct *tty, kdev_t device,
+inline int tty_paranoia_check(struct tty_struct *tty, struct inode *inode,
const char *routine)
{
#ifdef TTY_PARANOIA_CHECK
@@ -187,11 +187,11 @@
"Warning: null TTY for (%s) in %s\n";
if (!tty) {
- printk(badtty, cdevname(device), routine);
+ printk(badtty, cdevname(inode->i_rdev), routine);
return 1;
}
if (tty->magic != TTY_MAGIC) {
- printk(badmagic, cdevname(device), routine);
+ printk(badmagic, cdevname(inode->i_rdev), routine);
return 1;
}
#endif
@@ -646,7 +646,7 @@
tty = (struct tty_struct *)file->private_data;
inode = file->f_dentry->d_inode;
- if (tty_paranoia_check(tty, inode->i_rdev, "tty_read"))
+ if (tty_paranoia_check(tty, inode, "tty_read"))
return -EIO;
if (!tty || (test_bit(TTY_IO_ERROR, &tty->flags)))
return -EIO;
@@ -763,7 +763,7 @@
}
tty = (struct tty_struct *)file->private_data;
- if (tty_paranoia_check(tty, inode->i_rdev, "tty_write"))
+ if (tty_paranoia_check(tty, inode, "tty_write"))
return -EIO;
if (!tty || !tty->driver->write || (test_bit(TTY_IO_ERROR, &tty->flags)))
return -EIO;
@@ -1023,7 +1023,7 @@
o_tty->magic = 0;
o_tty->driver->refcount--;
file_list_lock();
- list_del(&o_tty->tty_files);
+ list_del_init(&o_tty->tty_files);
file_list_unlock();
free_tty_struct(o_tty);
}
@@ -1037,7 +1037,7 @@
tty->magic = 0;
tty->driver->refcount--;
file_list_lock();
- list_del(&tty->tty_files);
+ list_del_init(&tty->tty_files);
file_list_unlock();
module_put(tty->driver->owner);
free_tty_struct(tty);
@@ -1059,7 +1059,7 @@
char buf[64];
tty = (struct tty_struct *)filp->private_data;
- if (tty_paranoia_check(tty, filp->f_dentry->d_inode->i_rdev, "release_dev"))
+ if (tty_paranoia_check(tty, filp->f_dentry->d_inode, "release_dev"))
return;
check_tty_count(tty, "release_dev");
@@ -1439,7 +1439,7 @@
struct tty_struct * tty;
tty = (struct tty_struct *)filp->private_data;
- if (tty_paranoia_check(tty, filp->f_dentry->d_inode->i_rdev, "tty_poll"))
+ if (tty_paranoia_check(tty, filp->f_dentry->d_inode, "tty_poll"))
return 0;
if (tty->ldisc.poll)
@@ -1453,7 +1453,7 @@
int retval;
tty = (struct tty_struct *)filp->private_data;
- if (tty_paranoia_check(tty, filp->f_dentry->d_inode->i_rdev, "tty_fasync"))
+ if (tty_paranoia_check(tty, filp->f_dentry->d_inode, "tty_fasync"))
return 0;
retval = fasync_helper(fd, filp, on, &tty->fasync);
@@ -1727,7 +1727,7 @@
int retval;
tty = (struct tty_struct *)file->private_data;
- if (tty_paranoia_check(tty, inode->i_rdev, "tty_ioctl"))
+ if (tty_paranoia_check(tty, inode, "tty_ioctl"))
return -EINVAL;
real_tty = tty;
diff -Nru a/drivers/char/vc_screen.c b/drivers/char/vc_screen.c
--- a/drivers/char/vc_screen.c Wed May 7 08:47:30 2003
+++ b/drivers/char/vc_screen.c Tue Aug 26 09:25:41 2003
@@ -49,7 +49,7 @@
vcs_size(struct inode *inode)
{
int size;
- int minor = minor(inode->i_rdev);
+ int minor = iminor(inode);
int currcons = minor & 127;
if (currcons == 0)
currcons = fg_console;
@@ -104,7 +104,7 @@
vcs_read(struct file *file, char *buf, size_t count, loff_t *ppos)
{
struct inode *inode = file->f_dentry->d_inode;
- unsigned int currcons = minor(inode->i_rdev);
+ unsigned int currcons = iminor(inode);
long pos = *ppos;
long viewed, attr, read;
int col, maxcol;
@@ -273,7 +273,7 @@
vcs_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
{
struct inode *inode = file->f_dentry->d_inode;
- unsigned int currcons = minor(inode->i_rdev);
+ unsigned int currcons = iminor(inode);
long pos = *ppos;
long viewed, attr, size, written;
char *con_buf0;
@@ -456,7 +456,7 @@
static int
vcs_open(struct inode *inode, struct file *filp)
{
- unsigned int currcons = minor(inode->i_rdev) & 127;
+ unsigned int currcons = iminor(inode) & 127;
if(currcons && !vc_cons_allocated(currcons-1))
return -ENXIO;
return 0;
diff -Nru a/drivers/char/watchdog/Kconfig b/drivers/char/watchdog/Kconfig
--- a/drivers/char/watchdog/Kconfig Mon Jul 28 13:28:55 2003
+++ b/drivers/char/watchdog/Kconfig Sun Aug 31 11:39:56 2003
@@ -346,6 +346,18 @@
module, say M here and read . Most
people will say N.
+config ALIM1535_WDT
+ tristate "ALi M1535 PMU Watchdog Timer"
+ depends on WATCHDOG
+ ---help---
+ This is the driver for the hardware watchdog on the ALi M1535 PMU.
+
+ This driver is also available as a module ( = code which can be
+ inserted in and removed from the running kernel whenever you want).
+ The module is called alim1535_wdt. If you want to compile it as a
+ module, say M here and read . Most
+ people will say N.
+
config SC1200_WDT
tristate "National Semiconductor PC87307/PC97307 (ala SC1200) Watchdog"
depends on WATCHDOG
diff -Nru a/drivers/char/watchdog/Makefile b/drivers/char/watchdog/Makefile
--- a/drivers/char/watchdog/Makefile Thu Feb 27 12:38:45 2003
+++ b/drivers/char/watchdog/Makefile Sun Aug 31 11:39:56 2003
@@ -27,6 +27,7 @@
obj-$(CONFIG_W83877F_WDT) += w83877f_wdt.o
obj-$(CONFIG_SC520_WDT) += sc520_wdt.o
obj-$(CONFIG_ALIM7101_WDT) += alim7101_wdt.o
+obj-$(CONFIG_ALIM1535_WDT) += alim1535_wdt.o
obj-$(CONFIG_SC1200_WDT) += sc1200wdt.o
obj-$(CONFIG_WAFER_WDT) += wafer5823wdt.o
obj-$(CONFIG_CPU5_WDT) += cpu5wdt.o
diff -Nru a/drivers/char/watchdog/acquirewdt.c b/drivers/char/watchdog/acquirewdt.c
--- a/drivers/char/watchdog/acquirewdt.c Fri Aug 8 03:28:08 2003
+++ b/drivers/char/watchdog/acquirewdt.c Sun Aug 31 14:15:12 2003
@@ -1,5 +1,5 @@
/*
- * Acquire Single Board Computer Watchdog Timer driver for Linux 2.1.x
+ * Acquire Single Board Computer Watchdog Timer driver
*
* Based on wdt.c. Original copyright messages:
*
@@ -10,10 +10,10 @@
* 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.
- *
- * Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
- * warranty for any of this software. This material is provided
- * "AS-IS" and at no charge.
+ *
+ * Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
+ * warranty for any of this software. This material is provided
+ * "AS-IS" and at no charge.
*
* (c) Copyright 1995 Alan Cox
*
@@ -22,33 +22,39 @@
* Can't add timeout - driver doesn't allow changing value
*/
-#include
#include
#include
#include
#include
#include