Merge branch 'omap-fixes' into fixes
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Sat, 12 May 2007 15:10:03 +0000 (16:10 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 12 May 2007 15:10:24 +0000 (16:10 +0100)
273 files changed:
Documentation/feature-removal-schedule.txt
MAINTAINERS
arch/arm/Kconfig
arch/arm/kernel/armksyms.c
arch/arm/kernel/stacktrace.c
arch/arm/mach-at91/Makefile
arch/arm/mach-at91/board-sam9261ek.c
arch/arm/mach-ebsa110/io.c
arch/i386/kernel/head.S
arch/i386/kernel/paravirt.c
arch/i386/kernel/vmlinux.lds.S
arch/powerpc/boot/dts/mpc832x_mds.dts
arch/powerpc/boot/dts/mpc834x_mds.dts
arch/powerpc/configs/celleb_defconfig
arch/powerpc/kernel/pci_64.c
arch/powerpc/kernel/prom.c
arch/powerpc/lib/Makefile
arch/powerpc/lib/rheap.c
arch/powerpc/mm/hash_native_64.c
arch/powerpc/platforms/83xx/mpc8313_rdb.c
arch/powerpc/platforms/83xx/mpc832x_rdb.c
arch/powerpc/platforms/83xx/mpc834x_itx.c
arch/powerpc/platforms/83xx/mpc834x_mds.c
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
arch/powerpc/platforms/celleb/pci.c
arch/powerpc/platforms/celleb/scc_epci.c
arch/powerpc/platforms/celleb/setup.c
arch/powerpc/platforms/pseries/eeh.c
arch/powerpc/platforms/pseries/eeh_driver.c
arch/powerpc/platforms/pseries/iommu.c
arch/powerpc/platforms/pseries/kexec.c
arch/powerpc/sysdev/commproc.c
arch/powerpc/sysdev/cpm2_common.c
arch/powerpc/sysdev/qe_lib/qe.c
arch/powerpc/sysdev/qe_lib/ucc_fast.c
arch/powerpc/sysdev/qe_lib/ucc_slow.c
arch/ppc/8xx_io/commproc.c
arch/ppc/lib/Makefile
arch/ppc/lib/rheap.c [deleted file]
arch/ppc/syslib/cpm2_common.c
arch/s390/Kconfig
arch/s390/defconfig
arch/s390/hypfs/inode.c
arch/s390/kernel/ipl.c
arch/s390/mm/fault.c
arch/sparc64/kernel/pci.c
arch/sparc64/kernel/pci_common.c
arch/sparc64/kernel/pci_fire.c
arch/sparc64/kernel/pci_impl.h
arch/sparc64/kernel/pci_psycho.c
arch/sparc64/kernel/pci_sabre.c
arch/sparc64/kernel/pci_schizo.c
arch/sparc64/kernel/pci_sun4v.c
arch/sparc64/kernel/prom.c
arch/x86_64/kernel/traps.c
drivers/Makefile
drivers/acpi/dispatcher/dsmethod.c
drivers/acpi/dispatcher/dsopcode.c
drivers/acpi/dispatcher/dsutils.c
drivers/acpi/dispatcher/dswstate.c
drivers/acpi/ec.c
drivers/acpi/events/evgpe.c
drivers/acpi/events/evgpeblk.c
drivers/acpi/events/evmisc.c
drivers/acpi/events/evregion.c
drivers/acpi/events/evrgnini.c
drivers/acpi/events/evxface.c
drivers/acpi/events/evxfevnt.c
drivers/acpi/executer/exconvrt.c
drivers/acpi/executer/excreate.c
drivers/acpi/executer/exdump.c
drivers/acpi/executer/exmutex.c
drivers/acpi/executer/exnames.c
drivers/acpi/executer/exprep.c
drivers/acpi/executer/exresop.c
drivers/acpi/executer/exsystem.c
drivers/acpi/executer/exutils.c
drivers/acpi/hardware/hwsleep.c
drivers/acpi/namespace/nseval.c
drivers/acpi/namespace/nsinit.c
drivers/acpi/namespace/nswalk.c
drivers/acpi/namespace/nsxfeval.c
drivers/acpi/osl.c
drivers/acpi/parser/psopcode.c
drivers/acpi/resources/rscalc.c
drivers/acpi/resources/rscreate.c
drivers/acpi/resources/rsdump.c
drivers/acpi/resources/rsinfo.c
drivers/acpi/resources/rslist.c
drivers/acpi/resources/rsmisc.c
drivers/acpi/resources/rsutils.c
drivers/acpi/resources/rsxface.c
drivers/acpi/sleep/main.c
drivers/acpi/sleep/proc.c
drivers/acpi/tables/tbfadt.c
drivers/acpi/tables/tbxface.c
drivers/acpi/thermal.c
drivers/acpi/utilities/utalloc.c
drivers/acpi/utilities/utcache.c
drivers/acpi/utilities/utcopy.c
drivers/acpi/utilities/utdebug.c
drivers/acpi/utilities/utdelete.c
drivers/acpi/utilities/utglobal.c
drivers/acpi/utilities/utmisc.c
drivers/acpi/utilities/utmutex.c
drivers/acpi/utilities/utresrc.c
drivers/acpi/utilities/utxface.c
drivers/ata/Kconfig
drivers/auxdisplay/Kconfig
drivers/block/Kconfig
drivers/char/Kconfig
drivers/char/ipmi/Kconfig
drivers/char/tpm/Kconfig
drivers/char/watchdog/Kconfig
drivers/char/watchdog/Makefile
drivers/char/watchdog/cpu5wdt.c
drivers/char/watchdog/eurotechwdt.c
drivers/char/watchdog/i8xx_tco.c [deleted file]
drivers/char/watchdog/i8xx_tco.h [deleted file]
drivers/char/watchdog/ibmasr.c
drivers/char/watchdog/machzwd.c
drivers/char/watchdog/mtx-1_wdt.c [new file with mode: 0644]
drivers/char/watchdog/pcwd.c
drivers/char/watchdog/pcwd_usb.c
drivers/char/watchdog/s3c2410_wdt.c
drivers/char/watchdog/sbc8360.c
drivers/char/watchdog/w83627hf_wdt.c
drivers/crypto/Kconfig
drivers/dma/Kconfig
drivers/edac/Kconfig
drivers/firewire/Kconfig [new file with mode: 0644]
drivers/firewire/Makefile [new file with mode: 0644]
drivers/firewire/fw-card.c [new file with mode: 0644]
drivers/firewire/fw-cdev.c [new file with mode: 0644]
drivers/firewire/fw-device.c [new file with mode: 0644]
drivers/firewire/fw-device.h [new file with mode: 0644]
drivers/firewire/fw-iso.c [new file with mode: 0644]
drivers/firewire/fw-ohci.c [new file with mode: 0644]
drivers/firewire/fw-ohci.h [new file with mode: 0644]
drivers/firewire/fw-sbp2.c [new file with mode: 0644]
drivers/firewire/fw-topology.c [new file with mode: 0644]
drivers/firewire/fw-topology.h [new file with mode: 0644]
drivers/firewire/fw-transaction.c [new file with mode: 0644]
drivers/firewire/fw-transaction.h [new file with mode: 0644]
drivers/hwmon/Kconfig
drivers/hwmon/ams/ams-input.c
drivers/hwmon/applesmc.c
drivers/hwmon/hdaps.c
drivers/i2c/Kconfig
drivers/i2c/busses/i2c-at91.c
drivers/i2c/busses/i2c-pxa.c
drivers/ide/Kconfig
drivers/ieee1394/Kconfig
drivers/infiniband/Kconfig
drivers/input/Kconfig
drivers/input/misc/ixp4xx-beeper.c
drivers/isdn/Kconfig
drivers/kvm/Kconfig
drivers/leds/Kconfig
drivers/md/raid1.c
drivers/media/Kconfig
drivers/message/fusion/Kconfig
drivers/message/i2o/Kconfig
drivers/mfd/Kconfig
drivers/misc/Kconfig
drivers/misc/asus-laptop.c
drivers/misc/msi-laptop.c
drivers/misc/sony-laptop.c
drivers/mmc/Kconfig
drivers/mtd/Kconfig
drivers/net/fs_enet/mac-scc.c
drivers/net/phy/Kconfig
drivers/net/ucc_geth.c
drivers/net/wireless/Kconfig
drivers/parport/Kconfig
drivers/pnp/Kconfig
drivers/rtc/Kconfig
drivers/s390/block/Kconfig
drivers/s390/block/dasd.c
drivers/s390/block/dasd_diag.c
drivers/s390/block/dasd_eckd.c
drivers/s390/block/dasd_ioctl.c
drivers/s390/char/Kconfig [moved from drivers/s390/Kconfig with 59% similarity]
drivers/s390/char/monreader.c
drivers/s390/char/raw3270.c
drivers/s390/char/sclp.h
drivers/s390/char/sclp_sdias.c
drivers/s390/char/zcore.c
drivers/s390/cio/css.c
drivers/s390/cio/css.h
drivers/s390/cio/device.c
drivers/s390/cio/device_ops.c
drivers/s390/cio/qdio.c
drivers/s390/net/Kconfig
drivers/s390/net/qeth_mpc.c
drivers/s390/scsi/zfcp_aux.c
drivers/s390/scsi/zfcp_dbf.c
drivers/serial/Kconfig
drivers/serial/cpm_uart/cpm_uart.h
drivers/serial/cpm_uart/cpm_uart_core.c
drivers/serial/cpm_uart/cpm_uart_cpm1.c
drivers/serial/cpm_uart/cpm_uart_cpm2.c
drivers/serial/sunzilog.c
drivers/serial/sunzilog.h
drivers/spi/Kconfig
drivers/telephony/Kconfig
drivers/usb/Kconfig
drivers/video/Kconfig
drivers/w1/Kconfig
fs/afs/afs_fs.h
fs/afs/fsclient.c
fs/afs/rxrpc.c
fs/afs/write.c
fs/compat_ioctl.c
fs/locks.c
fs/ocfs2/cluster/masklog.c
include/acpi/acdispat.h
include/acpi/acglobal.h
include/acpi/acinterp.h
include/acpi/aclocal.h
include/acpi/acnamesp.h
include/acpi/acobject.h
include/acpi/acpi_bus.h
include/acpi/acpi_drivers.h
include/acpi/acpi_numa.h
include/acpi/acpiosxf.h
include/acpi/actypes.h
include/acpi/acutils.h
include/acpi/platform/aclinux.h
include/acpi/processor.h
include/asm-arm/arch-at91/hardware.h
include/asm-arm/arch-at91/io.h
include/asm-arm/arch-at91/irqs.h
include/asm-arm/arch-at91/uncompress.h
include/asm-arm/arch-iop13xx/io.h
include/asm-arm/arch-iop32x/io.h
include/asm-arm/arch-iop33x/io.h
include/asm-i386/paravirt.h
include/asm-powerpc/mmu-hash64.h
include/asm-powerpc/mmzone.h
include/asm-powerpc/ppc-pci.h
include/asm-powerpc/ps3.h
include/asm-powerpc/qe.h
include/asm-powerpc/reg_booke.h [new file with mode: 0644]
include/asm-powerpc/rheap.h [moved from include/asm-ppc/rheap.h with 75% similarity]
include/asm-powerpc/systbl.h
include/asm-powerpc/unistd.h
include/asm-ppc/commproc.h
include/asm-ppc/cpm2.h
include/asm-s390/ccwdev.h
include/asm-s390/ipl.h
include/asm-s390/param.h
include/asm-sparc64/openprom.h
include/linux/acpi.h
include/linux/crc-itu-t.h [new file with mode: 0644]
include/linux/firewire-cdev.h [new file with mode: 0644]
include/linux/firewire-constants.h [new file with mode: 0644]
include/linux/kernel.h
include/linux/mm_types.h
include/linux/pmu.h
init/Kconfig
kernel/timer.c
lib/Kconfig
lib/Makefile
lib/crc-itu-t.c [new file with mode: 0644]
mm/page_alloc.c
mm/slub.c
net/Kconfig
net/ax25/Kconfig
net/bluetooth/Kconfig
net/irda/Kconfig
net/rxrpc/ar-peer.c
sound/Kconfig

index 676b7981adb771d5185c5bedd4c286ebc81d66f3..c6322c760348f243a30c61ffc22bd63259c3116a 100644 (file)
@@ -278,14 +278,6 @@ Who:       Richard Purdie <rpurdie@rpsys.net>
 
 ---------------------------
 
-What:  i8xx_tco watchdog driver
-When:  in 2.6.22
-Why:   the i8xx_tco watchdog driver has been replaced by the iTCO_wdt
-       watchdog driver.
-Who:   Wim Van Sebroeck <wim@iguana.be>
-
----------------------------
-
 What:  Multipath cached routing support in ipv4
 When:  in 2.6.23
 Why:   Code was merged, then submitter immediately disappeared leaving
index cfd26ddccd7a0997c10ed46e4c15a7dc021c1761..bd558ac5bb73ced7de418089a9ae499732cfe3c9 100644 (file)
@@ -1718,12 +1718,6 @@ P:       H. Peter Anvin
 M:     hpa@zytor.com
 S:     Maintained
 
-i810 TCO TIMER WATCHDOG
-P:     Nils Faerber
-M:     nils@kernelconcepts.de
-W:     http://www.kernelconcepts.de/
-S:     Maintained
-
 IA64 (Itanium) PLATFORM
 P:     Tony Luck
 M:     tony.luck@intel.com
index d7c0984d4a8662a48fc47f2d922ab8cb7806b030..0d8fac3b03713020cf4ad3dc98eab209cbc0a5a1 100644 (file)
@@ -354,7 +354,6 @@ config ARCH_SA1100
 config ARCH_S3C2410
        bool "Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443"
        select GENERIC_GPIO
-       select GENERIC_TIME
        help
          Samsung S3C2410X CPU based systems, such as the Simtec Electronics
          BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or
index 4779f474f9113ac0a87aa0ae41ac332b02033484..9179e82203142bec7678ab20051b52590549396a 100644 (file)
@@ -76,6 +76,7 @@ EXPORT_SYMBOL(__const_udelay);
 
        /* networking */
 EXPORT_SYMBOL(csum_partial);
+EXPORT_SYMBOL(csum_partial_copy_from_user);
 EXPORT_SYMBOL(csum_partial_copy_nocheck);
 EXPORT_SYMBOL(__csum_ipv6_magic);
 
index 77ef35efaa8d3e05642c3f3e1887030f6f4ca6bc..398d0c0511ebe2ac5a6172099d65f4471032648f 100644 (file)
@@ -52,21 +52,15 @@ static int save_trace(struct stackframe *frame, void *d)
        return trace->nr_entries >= trace->max_entries;
 }
 
-void save_stack_trace(struct stack_trace *trace, struct task_struct *task)
+void save_stack_trace(struct stack_trace *trace)
 {
        struct stack_trace_data data;
        unsigned long fp, base;
 
        data.trace = trace;
        data.skip = trace->skip;
-
-       if (task) {
-               base = (unsigned long)task_stack_page(task);
-               fp = 0; /* FIXME */
-       } else {
-               base = (unsigned long)task_stack_page(current);
-               asm("mov %0, fp" : "=r" (fp));
-       }
+       base = (unsigned long)task_stack_page(current);
+       asm("mov %0, fp" : "=r" (fp));
 
        walk_stackframe(fp, base, base + THREAD_SIZE, save_trace, &data);
 }
index a412ae18a4213e5b4e065b637caee6666c3751c3..cd1bc541f28e93b799500486214ad63686e5e0b4 100644 (file)
@@ -39,6 +39,7 @@ obj-$(CONFIG_MACH_AT91SAM9263EK) += board-sam9263ek.o
 # LEDs support
 led-$(CONFIG_ARCH_AT91RM9200DK)        += leds.o
 led-$(CONFIG_MACH_AT91RM9200EK)        += leds.o
+led-$(CONFIG_MACH_AT91SAM9261EK)+= leds.o
 led-$(CONFIG_MACH_CSB337)      += leds.o
 led-$(CONFIG_MACH_CSB637)      += leds.o
 led-$(CONFIG_MACH_KB9200)      += leds.o
index bcf71536cc6db2931bf8a220548146ad1b2806c5..1f0c8a400b3a6c219dc981d9b84fba471559bbd9 100644 (file)
@@ -60,6 +60,9 @@ static void __init ek_map_io(void)
        /* Initialize processor: 18.432 MHz crystal */
        at91sam9261_initialize(18432000);
 
+       /* Setup the LEDs */
+       at91_init_leds(AT91_PIN_PA13, AT91_PIN_PA14);
+
        /* Setup the serial ports and console */
        at91_init_serial(&ek_uart_config);
 }
index bbf0d332407e5f8ad898df430daa40ce8a4b1695..6b2380e153ef67a0a358682100e8bec4915365c4 100644 (file)
@@ -102,7 +102,7 @@ EXPORT_SYMBOL(__readb);
 EXPORT_SYMBOL(__readw);
 EXPORT_SYMBOL(__readl);
 
-void readsw(void __iomem *addr, void *data, int len)
+void readsw(const void __iomem *addr, void *data, int len)
 {
        void __iomem *a = __isamem_convert_addr(addr);
 
@@ -112,7 +112,7 @@ void readsw(void __iomem *addr, void *data, int len)
 }
 EXPORT_SYMBOL(readsw);
 
-void readsl(void __iomem *addr, void *data, int len)
+void readsl(const void __iomem *addr, void *data, int len)
 {
        void __iomem *a = __isamem_convert_addr(addr);
 
@@ -157,7 +157,7 @@ EXPORT_SYMBOL(__writeb);
 EXPORT_SYMBOL(__writew);
 EXPORT_SYMBOL(__writel);
 
-void writesw(void __iomem *addr, void *data, int len)
+void writesw(void __iomem *addr, const void *data, int len)
 {
        void __iomem *a = __isamem_convert_addr(addr);
 
@@ -167,7 +167,7 @@ void writesw(void __iomem *addr, void *data, int len)
 }
 EXPORT_SYMBOL(writesw);
 
-void writesl(void __iomem *addr, void *data, int len)
+void writesl(void __iomem *addr, const void *data, int len)
 {
        void __iomem *a = __isamem_convert_addr(addr);
 
index 9b10af65faaadbf400a6f219338dc9c76e61f6e4..f74dfc419b56739f3cc7e854271f5106ef701911 100644 (file)
@@ -71,12 +71,6 @@ INIT_MAP_BEYOND_END = BOOTBITMAP_SIZE + (PAGE_TABLE_SIZE + ALLOCATOR_SLOP)*PAGE_
 .section .text.head,"ax",@progbits
 ENTRY(startup_32)
 
-#ifdef CONFIG_PARAVIRT
-        movl %cs, %eax
-        testl $0x3, %eax
-        jnz startup_paravirt
-#endif
-
 /*
  * Set segments to known values.
  */
@@ -501,38 +495,6 @@ ignore_int:
        iret
 
 .section .text
-#ifdef CONFIG_PARAVIRT
-startup_paravirt:
-       cld
-       movl $(init_thread_union+THREAD_SIZE),%esp
-
-       /* We take pains to preserve all the regs. */
-       pushl   %edx
-       pushl   %ecx
-       pushl   %eax
-
-       pushl   $__start_paravirtprobe
-1:
-       movl    0(%esp), %eax
-       cmpl    $__stop_paravirtprobe, %eax
-       je      unhandled_paravirt
-       pushl   (%eax)
-       movl    8(%esp), %eax
-       call    *(%esp)
-       popl    %eax
-
-       movl    4(%esp), %eax
-       movl    8(%esp), %ecx
-       movl    12(%esp), %edx
-
-       addl    $4, (%esp)
-       jmp     1b
-
-unhandled_paravirt:
-       /* Nothing wanted us: we're screwed. */
-       ud2
-#endif
-
 /*
  * Real beginning of normal "text" segment
  */
index 5c10f376bce1e36b437c6a76ba28e5a6c4eb0026..faab09abca5e33a3bb1cff6b50848a788bc20349 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/module.h>
 #include <linux/efi.h>
 #include <linux/bcd.h>
-#include <linux/start_kernel.h>
 #include <linux/highmem.h>
 
 #include <asm/bug.h>
index 23e8614edeee42e10728364f386a49976ced06ff..80bec6640230c9df5e4e9264c055685728004123 100644 (file)
@@ -78,12 +78,6 @@ SECTIONS
        CONSTRUCTORS
        } :data
 
-  .paravirtprobe : AT(ADDR(.paravirtprobe) - LOAD_OFFSET) {
-       __start_paravirtprobe = .;
-       *(.paravirtprobe)
-       __stop_paravirtprobe = .;
-  }
-
   . = ALIGN(4096);
   .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
        __nosave_begin = .;
index 93b76069601049e58319b1ce3e08234263f9c6d8..112dd5198fe2d4d4406fb5e29cf6b665eda6b1d1 100644 (file)
                        interrupt-parent = < &ipic >;
                        interrupts = <42 8>;
                        bus-range = <0 0>;
-                       ranges = <02000000 0 a0000000 90000000 0 10000000
+                       ranges = <02000000 0 90000000 90000000 0 10000000
                                  42000000 0 80000000 80000000 0 10000000
                                  01000000 0 00000000 d0000000 0 00100000>;
                        clock-frequency = <0>;
index 07bcc5194d2babd0d9f24e312986fc634af43c4c..df773fafe9d179f886e68628fee8c826614e3887 100644 (file)
                        interrupt-parent = < &ipic >;
                        interrupts = <42 8>;
                        bus-range = <0 0>;
-                       ranges = <02000000 0 a0000000 a0000000 0 10000000
+                       ranges = <02000000 0 90000000 90000000 0 10000000
                                  42000000 0 80000000 80000000 0 10000000
                                  01000000 0 00000000 e2000000 0 00100000>;
                        clock-frequency = <3f940aa>;
                        interrupts = <42 8>;
                        bus-range = <0 0>;
                        ranges = <02000000 0 b0000000 b0000000 0 10000000
-                                 42000000 0 90000000 90000000 0 10000000
+                                 42000000 0 a0000000 a0000000 0 10000000
                                  01000000 0 00000000 e2100000 0 00100000>;
                        clock-frequency = <3f940aa>;
                        #interrupt-cells = <1>;
index a1fe97197ead13349d170cfa0812ed9388e8db07..91b657b339b442ded7dcd1f169a681ef7bf5ee07 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.20-rc4
-# Thu Jan 11 20:55:33 2007
+# Linux kernel version: 2.6.21
+# Tue May  8 12:32:16 2007
 #
 CONFIG_PPC64=y
 CONFIG_64BIT=y
@@ -60,6 +60,7 @@ CONFIG_LOCALVERSION_AUTO=y
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 # CONFIG_IPC_NS is not set
+CONFIG_SYSVIPC_SYSCTL=y
 # CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 # CONFIG_TASKSTATS is not set
@@ -70,6 +71,7 @@ CONFIG_IKCONFIG_PROC=y
 # CONFIG_CPUSETS is not set
 CONFIG_SYSFS_DEPRECATED=y
 # CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
@@ -132,15 +134,26 @@ CONFIG_PPC_MULTIPLATFORM=y
 # CONFIG_PPC_PSERIES is not set
 # CONFIG_PPC_ISERIES is not set
 # CONFIG_PPC_MPC52xx is not set
+# CONFIG_PPC_MPC5200 is not set
 # CONFIG_PPC_PMAC is not set
 # CONFIG_PPC_MAPLE is not set
 # CONFIG_PPC_PASEMI is not set
+CONFIG_PPC_CELLEB=y
+# CONFIG_PPC_PS3 is not set
 CONFIG_PPC_CELL=y
 # CONFIG_PPC_CELL_NATIVE is not set
 # CONFIG_PPC_IBM_CELL_BLADE is not set
-# CONFIG_PPC_PS3 is not set
-CONFIG_PPC_CELLEB=y
+
+#
+# Cell Broadband Engine options
+#
+CONFIG_SPU_FS=y
+CONFIG_SPU_BASE=y
+# CONFIG_PQ2ADS is not set
 CONFIG_PPC_UDBG_BEAT=y
+# CONFIG_MPIC is not set
+# CONFIG_MPIC_WEIRD is not set
+# CONFIG_PPC_I8259 is not set
 # CONFIG_U3_DART is not set
 # CONFIG_PPC_RTAS is not set
 # CONFIG_MMIO_NVRAM is not set
@@ -149,15 +162,7 @@ CONFIG_PPC_UDBG_BEAT=y
 # CONFIG_PPC_INDIRECT_IO is not set
 # CONFIG_GENERIC_IOMAP is not set
 # CONFIG_CPU_FREQ is not set
-# CONFIG_WANT_EARLY_SERIAL is not set
-# CONFIG_MPIC is not set
-
-#
-# Cell Broadband Engine options
-#
-CONFIG_SPU_FS=y
-CONFIG_SPU_BASE=y
-# CONFIG_CBE_RAS is not set
+# CONFIG_CPM2 is not set
 
 #
 # Kernel options
@@ -183,7 +188,6 @@ CONFIG_NUMA=y
 CONFIG_NODES_SHIFT=4
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
 CONFIG_ARCH_SPARSEMEM_ENABLE=y
-CONFIG_ARCH_SPARSEMEM_DEFAULT=y
 CONFIG_ARCH_POPULATES_NODE_MAP=y
 CONFIG_SELECT_MEMORY_MODEL=y
 # CONFIG_FLATMEM_MANUAL is not set
@@ -199,6 +203,7 @@ CONFIG_MEMORY_HOTPLUG_SPARSE=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_MIGRATION=y
 CONFIG_RESOURCES_64BIT=y
+CONFIG_ZONE_DMA_FLAG=1
 CONFIG_ARCH_MEMORY_PROBE=y
 CONFIG_NODES_SPAN_OTHER_NODES=y
 # CONFIG_PPC_64K_PAGES is not set
@@ -207,14 +212,14 @@ CONFIG_PROC_DEVICETREE=y
 # CONFIG_CMDLINE_BOOL is not set
 # CONFIG_PM is not set
 CONFIG_SECCOMP=y
+# CONFIG_WANT_DEVICE_TREE is not set
 CONFIG_ISA_DMA_API=y
 
 #
 # Bus options
 #
+CONFIG_ZONE_DMA=y
 CONFIG_GENERIC_ISA_DMA=y
-# CONFIG_MPIC_WEIRD is not set
-# CONFIG_PPC_I8259 is not set
 # CONFIG_PPC_INDIRECT_PCI is not set
 CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
@@ -240,13 +245,13 @@ CONFIG_NET=y
 #
 # Networking options
 #
-# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
 CONFIG_XFRM=y
 # CONFIG_XFRM_USER is not set
 # CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
@@ -262,7 +267,7 @@ CONFIG_SYN_COOKIES=y
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_INET_XFRM_TUNNEL is not set
-# CONFIG_INET_TUNNEL is not set
+CONFIG_INET_TUNNEL=y
 CONFIG_INET_XFRM_MODE_TRANSPORT=y
 CONFIG_INET_XFRM_MODE_TUNNEL=y
 CONFIG_INET_XFRM_MODE_BEET=y
@@ -280,6 +285,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_IPV6=y
 # CONFIG_IPV6_PRIVACY is not set
 # CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
 CONFIG_INET6_AH=m
 CONFIG_INET6_ESP=m
 CONFIG_INET6_IPCOMP=m
@@ -302,17 +308,21 @@ CONFIG_NETFILTER=y
 #
 # CONFIG_NETFILTER_NETLINK is not set
 # CONFIG_NF_CONNTRACK_ENABLED is not set
+# CONFIG_NF_CONNTRACK is not set
 # CONFIG_NETFILTER_XTABLES is not set
 
 #
 # IP: Netfilter Configuration
 #
 CONFIG_IP_NF_QUEUE=m
+# CONFIG_IP_NF_IPTABLES is not set
+# CONFIG_IP_NF_ARPTABLES is not set
 
 #
 # IPv6: Netfilter Configuration (EXPERIMENTAL)
 #
 # CONFIG_IP6_NF_QUEUE is not set
+# CONFIG_IP6_NF_IPTABLES is not set
 
 #
 # DCCP Configuration (EXPERIMENTAL)
@@ -352,6 +362,13 @@ CONFIG_IP_NF_QUEUE=m
 # CONFIG_HAMRADIO is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
 # CONFIG_IEEE80211 is not set
 
 #
@@ -365,16 +382,13 @@ CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
 # CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
 
 #
 # Connector - unified userspace <-> kernelspace linker
 #
 # CONFIG_CONNECTOR is not set
-
-#
-# Memory Technology Devices (MTD)
-#
 # CONFIG_MTD is not set
 
 #
@@ -385,6 +399,7 @@ CONFIG_FW_LOADER=y
 #
 # Plug and Play support
 #
+# CONFIG_PNPACPI is not set
 
 #
 # Block devices
@@ -404,7 +419,6 @@ CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=131072
 CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
-CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
 
@@ -443,7 +457,6 @@ CONFIG_BLK_DEV_GENERIC=y
 # CONFIG_BLK_DEV_OPTI621 is not set
 CONFIG_BLK_DEV_IDEDMA_PCI=y
 # CONFIG_BLK_DEV_IDEDMA_FORCED is not set
-CONFIG_IDEDMA_PCI_AUTO=y
 # CONFIG_IDEDMA_ONLYDISK is not set
 # CONFIG_BLK_DEV_AEC62XX is not set
 # CONFIG_BLK_DEV_ALI15X3 is not set
@@ -458,6 +471,7 @@ CONFIG_IDEDMA_PCI_AUTO=y
 # CONFIG_BLK_DEV_JMICRON is not set
 # CONFIG_BLK_DEV_SC1200 is not set
 # CONFIG_BLK_DEV_PIIX is not set
+# CONFIG_BLK_DEV_IT8213 is not set
 # CONFIG_BLK_DEV_IT821X is not set
 # CONFIG_BLK_DEV_NS87415 is not set
 # CONFIG_BLK_DEV_PDC202XX_OLD is not set
@@ -468,11 +482,11 @@ CONFIG_IDEDMA_PCI_AUTO=y
 # CONFIG_BLK_DEV_SLC90E66 is not set
 # CONFIG_BLK_DEV_TRM290 is not set
 # CONFIG_BLK_DEV_VIA82CXXX is not set
-CONFIG_BLK_DEV_IDE_CELLEB=y
+# CONFIG_BLK_DEV_TC86C001 is not set
+CONFIG_BLK_DEV_CELLEB=y
 # CONFIG_IDE_ARM is not set
 CONFIG_BLK_DEV_IDEDMA=y
 # CONFIG_IDEDMA_IVB is not set
-CONFIG_IDEDMA_AUTO=y
 # CONFIG_BLK_DEV_HD is not set
 
 #
@@ -546,6 +560,7 @@ CONFIG_SCSI_MULTI_LUN=y
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
 # CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_ESP_CORE is not set
 # CONFIG_SCSI_SRP is not set
 
 #
@@ -591,12 +606,7 @@ CONFIG_DM_MULTIPATH=m
 # I2O device support
 #
 # CONFIG_I2O is not set
-
-#
-# Macintosh device drivers
-#
-# CONFIG_MAC_EMUMOUSEBTN is not set
-# CONFIG_WINDFARM is not set
+# CONFIG_MACINTOSH_DRIVERS is not set
 
 #
 # Network device support
@@ -652,15 +662,18 @@ CONFIG_MII=y
 # CONFIG_BNX2 is not set
 CONFIG_SPIDER_NET=y
 # CONFIG_QLA3XXX is not set
+# CONFIG_ATL1 is not set
 
 #
 # Ethernet (10000 Mbit)
 #
 # CONFIG_CHELSIO_T1 is not set
+# CONFIG_CHELSIO_T3 is not set
 # CONFIG_IXGB is not set
 # CONFIG_S2IO is not set
 # CONFIG_MYRI10GE is not set
 # CONFIG_NETXEN_NIC is not set
+# CONFIG_PASEMI_MAC is not set
 
 #
 # Token Ring devices
@@ -668,9 +681,10 @@ CONFIG_SPIDER_NET=y
 # CONFIG_TR is not set
 
 #
-# Wireless LAN (non-hamradio)
+# Wireless LAN
 #
-# CONFIG_NET_RADIO is not set
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
 
 #
 # Wan interfaces
@@ -770,6 +784,7 @@ CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_SERIAL_TXX9=y
 CONFIG_HAS_TXX9_SERIAL=y
+CONFIG_SERIAL_TXX9_NR_UARTS=3
 CONFIG_SERIAL_TXX9_CONSOLE=y
 # CONFIG_SERIAL_TXX9_STDSERIAL is not set
 # CONFIG_SERIAL_JSM is not set
@@ -890,6 +905,11 @@ CONFIG_I2C_ALGOBIT=y
 # CONFIG_HWMON is not set
 # CONFIG_HWMON_VID is not set
 
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+
 #
 # Multimedia devices
 #
@@ -904,7 +924,7 @@ CONFIG_I2C_ALGOBIT=y
 #
 # Graphics support
 #
-# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 # CONFIG_FB is not set
 # CONFIG_FB_IBM_GXT4500 is not set
 
@@ -913,7 +933,6 @@ CONFIG_I2C_ALGOBIT=y
 #
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_DUMMY_CONSOLE=y
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
 # Sound
@@ -924,6 +943,15 @@ CONFIG_DUMMY_CONSOLE=y
 # HID Devices
 #
 CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_HID_FF is not set
+CONFIG_USB_HIDDEV=y
 
 #
 # USB support
@@ -938,9 +966,8 @@ CONFIG_USB=y
 # Miscellaneous USB options
 #
 CONFIG_USB_DEVICEFS=y
-# CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_DEVICE_CLASS is not set
 # CONFIG_USB_DYNAMIC_MINORS is not set
-# CONFIG_USB_MULTITHREAD_PROBE is not set
 # CONFIG_USB_OTG is not set
 
 #
@@ -953,6 +980,7 @@ CONFIG_USB_EHCI_HCD=m
 CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y
 # CONFIG_USB_ISP116X_HCD is not set
 CONFIG_USB_OHCI_HCD=m
+# CONFIG_USB_OHCI_HCD_PPC_OF is not set
 # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
 CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
 CONFIG_USB_OHCI_LITTLE_ENDIAN=y
@@ -989,10 +1017,6 @@ CONFIG_USB_STORAGE=m
 #
 # USB Input Devices
 #
-CONFIG_USB_HID=y
-# CONFIG_USB_HIDINPUT_POWERBOOK is not set
-# CONFIG_HID_FF is not set
-CONFIG_USB_HIDDEV=y
 # CONFIG_USB_AIPTEK is not set
 # CONFIG_USB_WACOM is not set
 # CONFIG_USB_ACECAD is not set
@@ -1005,6 +1029,7 @@ CONFIG_USB_HIDDEV=y
 # CONFIG_USB_ATI_REMOTE2 is not set
 # CONFIG_USB_KEYSPAN_REMOTE is not set
 # CONFIG_USB_APPLETOUCH is not set
+# CONFIG_USB_GTCO is not set
 
 #
 # USB Imaging devices
@@ -1042,6 +1067,7 @@ CONFIG_USB_MON=y
 # CONFIG_USB_RIO500 is not set
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
 # CONFIG_USB_LED is not set
 # CONFIG_USB_CYPRESS_CY7C63 is not set
 # CONFIG_USB_CYTHERM is not set
@@ -1052,6 +1078,7 @@ CONFIG_USB_MON=y
 # CONFIG_USB_SISUSBVGA is not set
 # CONFIG_USB_LD is not set
 # CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
 # CONFIG_USB_TEST is not set
 
 #
@@ -1108,6 +1135,10 @@ CONFIG_USB_MON=y
 # DMA Devices
 #
 
+#
+# Auxiliary Display support
+#
+
 #
 # Virtualization
 #
@@ -1293,6 +1324,8 @@ CONFIG_NLS_ISO8859_15=m
 # Distributed Lock Manager
 #
 # CONFIG_DLM is not set
+# CONFIG_UCC_SLOW is not set
+# CONFIG_UCC_FAST is not set
 
 #
 # Library routines
@@ -1305,7 +1338,8 @@ CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=m
 CONFIG_ZLIB_DEFLATE=m
 CONFIG_PLIST=y
-CONFIG_IOMAP_COPY=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
 
 #
 # Instrumentation Support
@@ -1323,15 +1357,16 @@ CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
 # CONFIG_HEADERS_CHECK is not set
 CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
 CONFIG_LOG_BUF_SHIFT=15
 CONFIG_DETECT_SOFTLOCKUP=y
 # CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
 # CONFIG_DEBUG_SLAB is not set
 # CONFIG_DEBUG_RT_MUTEXES is not set
 # CONFIG_RT_MUTEX_TESTER is not set
 # CONFIG_DEBUG_SPINLOCK is not set
 CONFIG_DEBUG_MUTEXES=y
-# CONFIG_DEBUG_RWSEMS is not set
 CONFIG_DEBUG_SPINLOCK_SLEEP=y
 # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
 # CONFIG_DEBUG_KOBJECT is not set
@@ -1341,8 +1376,10 @@ CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_LIST is not set
 # CONFIG_FORCED_INLINING is not set
 # CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_FAULT_INJECTION is not set
 # CONFIG_DEBUG_STACKOVERFLOW is not set
 # CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_PAGEALLOC is not set
 CONFIG_DEBUGGER=y
 CONFIG_XMON=y
 CONFIG_XMON_DEFAULT=y
@@ -1356,6 +1393,7 @@ CONFIG_PPC_EARLY_DEBUG=y
 # CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE is not set
 # CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
 # CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
+# CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE is not set
 CONFIG_PPC_EARLY_DEBUG_BEAT=y
 
 #
@@ -1385,8 +1423,10 @@ CONFIG_CRYPTO_TGR192=m
 # CONFIG_CRYPTO_GF128MUL is not set
 CONFIG_CRYPTO_ECB=m
 CONFIG_CRYPTO_CBC=m
+CONFIG_CRYPTO_PCBC=m
 # CONFIG_CRYPTO_LRW is not set
 CONFIG_CRYPTO_DES=m
+# CONFIG_CRYPTO_FCRYPT is not set
 CONFIG_CRYPTO_BLOWFISH=m
 CONFIG_CRYPTO_TWOFISH=m
 CONFIG_CRYPTO_TWOFISH_COMMON=m
@@ -1401,6 +1441,7 @@ CONFIG_CRYPTO_ANUBIS=m
 CONFIG_CRYPTO_DEFLATE=m
 CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_CRC32C=m
+# CONFIG_CRYPTO_CAMELLIA is not set
 CONFIG_CRYPTO_TEST=m
 
 #
index 6d05a1f377b5e1a56fb3294a4ec22661442c34fc..b0409e19b1c156fcb05935f512f1642f84253249 100644 (file)
@@ -1098,35 +1098,24 @@ static int get_bus_io_range(struct pci_bus *bus, unsigned long *start_phys,
                                unsigned long *start_virt, unsigned long *size)
 {
        struct pci_controller *hose = pci_bus_to_host(bus);
-       struct pci_bus_region region;
        struct resource *res;
 
-       if (bus->self) {
+       if (bus->self)
                res = bus->resource[0];
-               pcibios_resource_to_bus(bus->self, &region, res);
-               *start_phys = hose->io_base_phys + region.start;
-               *start_virt = (unsigned long) hose->io_base_virt + 
-                               region.start;
-               if (region.end > region.start) 
-                       *size = region.end - region.start + 1;
-               else {
-                       printk("%s(): unexpected region 0x%lx->0x%lx\n", 
-                                       __FUNCTION__, region.start, region.end);
-                       return 1;
-               }
-               
-       } else {
+       else
                /* Root Bus */
                res = &hose->io_resource;
-               *start_phys = hose->io_base_phys + res->start;
-               *start_virt = (unsigned long) hose->io_base_virt + res->start;
-               if (res->end > res->start)
-                       *size = res->end - res->start + 1;
-               else {
-                       printk("%s(): unexpected region 0x%lx->0x%lx\n", 
-                                       __FUNCTION__, res->start, res->end);
-                       return 1;
-               }
+
+       *start_virt = pci_io_base + res->start;
+       *start_phys = *start_virt + hose->io_base_phys
+               - (unsigned long) hose->io_base_virt;
+
+       if (res->end > res->start)
+               *size = res->end - res->start + 1;
+       else {
+               printk("%s(): unexpected region 0x%lx->0x%lx\n",
+                      __FUNCTION__, res->start, res->end);
+               return 1;
        }
 
        return 0;
index caef555f2dc06a1f1b20e225d3b272d36c378ee9..c065b555036881b138b3c70ba378bb6392a07db7 100644 (file)
@@ -716,11 +716,40 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
        return 0;
 }
 
+#ifdef CONFIG_BLK_DEV_INITRD
+static void __init early_init_dt_check_for_initrd(unsigned long node)
+{
+       unsigned long l;
+       u32 *prop;
+
+       DBG("Looking for initrd properties... ");
+
+       prop = of_get_flat_dt_prop(node, "linux,initrd-start", &l);
+       if (prop) {
+               initrd_start = (unsigned long)__va(of_read_ulong(prop, l/4));
+
+               prop = of_get_flat_dt_prop(node, "linux,initrd-end", &l);
+               if (prop) {
+                       initrd_end = (unsigned long)
+                                       __va(of_read_ulong(prop, l/4));
+                       initrd_below_start_ok = 1;
+               } else {
+                       initrd_start = 0;
+               }
+       }
+
+       DBG("initrd_start=0x%lx  initrd_end=0x%lx\n", initrd_start, initrd_end);
+}
+#else
+static inline void early_init_dt_check_for_initrd(unsigned long node)
+{
+}
+#endif /* CONFIG_BLK_DEV_INITRD */
+
 static int __init early_init_dt_scan_chosen(unsigned long node,
                                            const char *uname, int depth, void *data)
 {
        unsigned long *lprop;
-       u32 *prop;
        unsigned long l;
        char *p;
 
@@ -762,21 +791,7 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
                crashk_res.end = crashk_res.start + *lprop - 1;
 #endif
 
-#ifdef CONFIG_BLK_DEV_INITRD
-       DBG("Looking for initrd properties... ");
-       prop = of_get_flat_dt_prop(node, "linux,initrd-start", &l);
-       if (prop) {
-               initrd_start = (unsigned long)__va(of_read_ulong(prop, l/4));
-               prop = of_get_flat_dt_prop(node, "linux,initrd-end", &l);
-               if (prop) {
-                       initrd_end = (unsigned long)__va(of_read_ulong(prop, l/4));
-                       initrd_below_start_ok = 1;
-               } else {
-                       initrd_start = 0;
-               }
-       }
-       DBG("initrd_start=0x%lx  initrd_end=0x%lx\n", initrd_start, initrd_end);
-#endif /* CONFIG_BLK_DEV_INITRD */
+       early_init_dt_check_for_initrd(node);
 
        /* Retreive command line */
        p = of_get_flat_dt_prop(node, "bootargs", &l);
index 450258de7ca1215cdd9f2d63dea6e91053def2ee..0a486d4b2547e98af054799435d11c2a9de25379 100644 (file)
@@ -23,7 +23,5 @@ obj-$(CONFIG_SMP)     += locks.o
 endif
 
 # Temporary hack until we have migrated to asm-powerpc
-ifeq ($(CONFIG_PPC_MERGE),y)
 obj-$(CONFIG_8xx)      += rheap.o
 obj-$(CONFIG_CPM2)     += rheap.o
-endif
index 6c5c5dd183ee3ac79c57bf4f5cf744b91a15ad47..b2f6dcc59600bb5c6d21c753b0eb6058491ca260 100644 (file)
@@ -133,7 +133,7 @@ static rh_block_t *get_slot(rh_info_t * info)
        info->empty_slots--;
 
        /* Initialize */
-       blk->start = NULL;
+       blk->start = 0;
        blk->size = 0;
        blk->owner = NULL;
 
@@ -158,7 +158,7 @@ static void attach_free_block(rh_info_t * info, rh_block_t * blkn)
 
        /* We assume that they are aligned properly */
        size = blkn->size;
-       s = (unsigned long)blkn->start;
+       s = blkn->start;
        e = s + size;
 
        /* Find the blocks immediately before and after the given one
@@ -170,7 +170,7 @@ static void attach_free_block(rh_info_t * info, rh_block_t * blkn)
        list_for_each(l, &info->free_list) {
                blk = list_entry(l, rh_block_t, list);
 
-               bs = (unsigned long)blk->start;
+               bs = blk->start;
                be = bs + blk->size;
 
                if (next == NULL && s >= bs)
@@ -188,10 +188,10 @@ static void attach_free_block(rh_info_t * info, rh_block_t * blkn)
        }
 
        /* Now check if they are really adjacent */
-       if (before != NULL && s != (unsigned long)before->start + before->size)
+       if (before && s != (before->start + before->size))
                before = NULL;
 
-       if (after != NULL && e != (unsigned long)after->start)
+       if (after && e != after->start)
                after = NULL;
 
        /* No coalescing; list insert and return */
@@ -216,7 +216,7 @@ static void attach_free_block(rh_info_t * info, rh_block_t * blkn)
 
        /* Grow the after block backwards */
        if (before == NULL && after != NULL) {
-               after->start = (int8_t *)after->start - size;
+               after->start -= size;
                after->size += size;
                return;
        }
@@ -321,14 +321,14 @@ void rh_init(rh_info_t * info, unsigned int alignment, int max_blocks,
 }
 
 /* Attach a free memory region, coalesces regions if adjuscent */
-int rh_attach_region(rh_info_t * info, void *start, int size)
+int rh_attach_region(rh_info_t * info, unsigned long start, int size)
 {
        rh_block_t *blk;
        unsigned long s, e, m;
        int r;
 
        /* The region must be aligned */
-       s = (unsigned long)start;
+       s = start;
        e = s + size;
        m = info->alignment - 1;
 
@@ -338,9 +338,12 @@ int rh_attach_region(rh_info_t * info, void *start, int size)
        /* Round end down */
        e = e & ~m;
 
+       if (IS_ERR_VALUE(e) || (e < s))
+               return -ERANGE;
+
        /* Take final values */
-       start = (void *)s;
-       size = (int)(e - s);
+       start = s;
+       size = e - s;
 
        /* Grow the blocks, if needed */
        r = assure_empty(info, 1);
@@ -358,7 +361,7 @@ int rh_attach_region(rh_info_t * info, void *start, int size)
 }
 
 /* Detatch given address range, splits free block if needed. */
-void *rh_detach_region(rh_info_t * info, void *start, int size)
+unsigned long rh_detach_region(rh_info_t * info, unsigned long start, int size)
 {
        struct list_head *l;
        rh_block_t *blk, *newblk;
@@ -366,10 +369,10 @@ void *rh_detach_region(rh_info_t * info, void *start, int size)
 
        /* Validate size */
        if (size <= 0)
-               return ERR_PTR(-EINVAL);
+               return (unsigned long) -EINVAL;
 
        /* The region must be aligned */
-       s = (unsigned long)start;
+       s = start;
        e = s + size;
        m = info->alignment - 1;
 
@@ -380,34 +383,34 @@ void *rh_detach_region(rh_info_t * info, void *start, int size)
        e = e & ~m;
 
        if (assure_empty(info, 1) < 0)
-               return ERR_PTR(-ENOMEM);
+               return (unsigned long) -ENOMEM;
 
        blk = NULL;
        list_for_each(l, &info->free_list) {
                blk = list_entry(l, rh_block_t, list);
                /* The range must lie entirely inside one free block */
-               bs = (unsigned long)blk->start;
-               be = (unsigned long)blk->start + blk->size;
+               bs = blk->start;
+               be = blk->start + blk->size;
                if (s >= bs && e <= be)
                        break;
                blk = NULL;
        }
 
        if (blk == NULL)
-               return ERR_PTR(-ENOMEM);
+               return (unsigned long) -ENOMEM;
 
        /* Perfect fit */
        if (bs == s && be == e) {
                /* Delete from free list, release slot */
                list_del(&blk->list);
                release_slot(info, blk);
-               return (void *)s;
+               return s;
        }
 
        /* blk still in free list, with updated start and/or size */
        if (bs == s || be == e) {
                if (bs == s)
-                       blk->start = (int8_t *)blk->start + size;
+                       blk->start += size;
                blk->size -= size;
 
        } else {
@@ -416,25 +419,29 @@ void *rh_detach_region(rh_info_t * info, void *start, int size)
 
                /* the back free fragment */
                newblk = get_slot(info);
-               newblk->start = (void *)e;
+               newblk->start = e;
                newblk->size = be - e;
 
                list_add(&newblk->list, &blk->list);
        }
 
-       return (void *)s;
+       return s;
 }
 
-void *rh_alloc_align(rh_info_t * info, int size, int alignment, const char *owner)
+/* Allocate a block of memory at the specified alignment.  The value returned
+ * is an offset into the buffer initialized by rh_init(), or a negative number
+ * if there is an error.
+ */
+unsigned long rh_alloc_align(rh_info_t * info, int size, int alignment, const char *owner)
 {
        struct list_head *l;
        rh_block_t *blk;
        rh_block_t *newblk;
-       void *start;
+       unsigned long start;
 
-       /* Validate size, (must be power of two) */
+       /* Validate size, and alignment must be power of two */
        if (size <= 0 || (alignment & (alignment - 1)) != 0)
-               return ERR_PTR(-EINVAL);
+               return (unsigned long) -EINVAL;
 
        /* given alignment larger that default rheap alignment */
        if (alignment > info->alignment)
@@ -444,7 +451,7 @@ void *rh_alloc_align(rh_info_t * info, int size, int alignment, const char *owne
        size = (size + (info->alignment - 1)) & ~(info->alignment - 1);
 
        if (assure_empty(info, 1) < 0)
-               return ERR_PTR(-ENOMEM);
+               return (unsigned long) -ENOMEM;
 
        blk = NULL;
        list_for_each(l, &info->free_list) {
@@ -455,7 +462,7 @@ void *rh_alloc_align(rh_info_t * info, int size, int alignment, const char *owne
        }
 
        if (blk == NULL)
-               return ERR_PTR(-ENOMEM);
+               return (unsigned long) -ENOMEM;
 
        /* Just fits */
        if (blk->size == size) {
@@ -475,7 +482,7 @@ void *rh_alloc_align(rh_info_t * info, int size, int alignment, const char *owne
        newblk->owner = owner;
 
        /* blk still in free list, with updated start, size */
-       blk->start = (int8_t *)blk->start + size;
+       blk->start += size;
        blk->size -= size;
 
        start = newblk->start;
@@ -486,19 +493,25 @@ void *rh_alloc_align(rh_info_t * info, int size, int alignment, const char *owne
        /* this is no problem with the deallocator since */
        /* we scan for pointers that lie in the blocks   */
        if (alignment > info->alignment)
-               start = (void *)(((unsigned long)start + alignment - 1) &
-                               ~(alignment - 1));
+               start = (start + alignment - 1) & ~(alignment - 1);
 
        return start;
 }
 
-void *rh_alloc(rh_info_t * info, int size, const char *owner)
+/* Allocate a block of memory at the default alignment.  The value returned is
+ * an offset into the buffer initialized by rh_init(), or a negative number if
+ * there is an error.
+ */
+unsigned long rh_alloc(rh_info_t * info, int size, const char *owner)
 {
        return rh_alloc_align(info, size, info->alignment, owner);
 }
 
-/* allocate at precisely the given address */
-void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
+/* Allocate a block of memory at the given offset, rounded up to the default
+ * alignment.  The value returned is an offset into the buffer initialized by
+ * rh_init(), or a negative number if there is an error.
+ */
+unsigned long rh_alloc_fixed(rh_info_t * info, unsigned long start, int size, const char *owner)
 {
        struct list_head *l;
        rh_block_t *blk, *newblk1, *newblk2;
@@ -506,10 +519,10 @@ void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
 
        /* Validate size */
        if (size <= 0)
-               return ERR_PTR(-EINVAL);
+               return (unsigned long) -EINVAL;
 
        /* The region must be aligned */
-       s = (unsigned long)start;
+       s = start;
        e = s + size;
        m = info->alignment - 1;
 
@@ -520,20 +533,20 @@ void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
        e = e & ~m;
 
        if (assure_empty(info, 2) < 0)
-               return ERR_PTR(-ENOMEM);
+               return (unsigned long) -ENOMEM;
 
        blk = NULL;
        list_for_each(l, &info->free_list) {
                blk = list_entry(l, rh_block_t, list);
                /* The range must lie entirely inside one free block */
-               bs = (unsigned long)blk->start;
-               be = (unsigned long)blk->start + blk->size;
+               bs = blk->start;
+               be = blk->start + blk->size;
                if (s >= bs && e <= be)
                        break;
        }
 
        if (blk == NULL)
-               return ERR_PTR(-ENOMEM);
+               return (unsigned long) -ENOMEM;
 
        /* Perfect fit */
        if (bs == s && be == e) {
@@ -551,7 +564,7 @@ void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
        /* blk still in free list, with updated start and/or size */
        if (bs == s || be == e) {
                if (bs == s)
-                       blk->start = (int8_t *)blk->start + size;
+                       blk->start += size;
                blk->size -= size;
 
        } else {
@@ -560,14 +573,14 @@ void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
 
                /* The back free fragment */
                newblk2 = get_slot(info);
-               newblk2->start = (void *)e;
+               newblk2->start = e;
                newblk2->size = be - e;
 
                list_add(&newblk2->list, &blk->list);
        }
 
        newblk1 = get_slot(info);
-       newblk1->start = (void *)s;
+       newblk1->start = s;
        newblk1->size = e - s;
        newblk1->owner = owner;
 
@@ -577,7 +590,11 @@ void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
        return start;
 }
 
-int rh_free(rh_info_t * info, void *start)
+/* Deallocate the memory previously allocated by one of the rh_alloc functions.
+ * The return value is the size of the deallocated block, or a negative number
+ * if there is an error.
+ */
+int rh_free(rh_info_t * info, unsigned long start)
 {
        rh_block_t *blk, *blk2;
        struct list_head *l;
@@ -642,7 +659,7 @@ int rh_get_stats(rh_info_t * info, int what, int max_stats, rh_stats_t * stats)
        return nr;
 }
 
-int rh_set_owner(rh_info_t * info, void *start, const char *owner)
+int rh_set_owner(rh_info_t * info, unsigned long start, const char *owner)
 {
        rh_block_t *blk, *blk2;
        struct list_head *l;
@@ -684,8 +701,8 @@ void rh_dump(rh_info_t * info)
                nr = maxnr;
        for (i = 0; i < nr; i++)
                printk(KERN_INFO
-                      "    0x%p-0x%p (%u)\n",
-                      st[i].start, (int8_t *) st[i].start + st[i].size,
+                      "    0x%lx-0x%lx (%u)\n",
+                      st[i].start, st[i].start + st[i].size,
                       st[i].size);
        printk(KERN_INFO "\n");
 
@@ -695,8 +712,8 @@ void rh_dump(rh_info_t * info)
                nr = maxnr;
        for (i = 0; i < nr; i++)
                printk(KERN_INFO
-                      "    0x%p-0x%p (%u) %s\n",
-                      st[i].start, (int8_t *) st[i].start + st[i].size,
+                      "    0x%lx-0x%lx (%u) %s\n",
+                      st[i].start, st[i].start + st[i].size,
                       st[i].size, st[i].owner != NULL ? st[i].owner : "");
        printk(KERN_INFO "\n");
 }
@@ -704,6 +721,6 @@ void rh_dump(rh_info_t * info)
 void rh_dump_blk(rh_info_t * info, rh_block_t * blk)
 {
        printk(KERN_INFO
-              "blk @0x%p: 0x%p-0x%p (%u)\n",
-              blk, blk->start, (int8_t *) blk->start + blk->size, blk->size);
+              "blk @0x%p: 0x%lx-0x%lx (%u)\n",
+              blk, blk->start, blk->start + blk->size, blk->size);
 }
index 7b7fe2d7b9dc7c1e882984ab2b8ba17461b70617..7d722eea4ea8ba927850c54cc85aff990ed81727 100644 (file)
@@ -376,31 +376,28 @@ static void hpte_decode(hpte_t *hpte, unsigned long slot,
                }
        }
 
-       /*
-        * FIXME, the code below works for 16M, 64K, and 4K pages as these
-        * fall under the p<=23 rules for calculating the virtual address.
-        * In the case of 16M pages, an extra bit is stolen from the AVPN
-        * field to achieve the requisite 24 bits.
-        *
-        * Does not work for 16G pages or 1 TB segments.
-        */
+       /* This works for all page sizes, and for 256M and 1T segments */
        shift = mmu_psize_defs[size].shift;
-       if (mmu_psize_defs[size].avpnm)
-               avpnm_bits = __ilog2_u64(mmu_psize_defs[size].avpnm) + 1;
-       else
-               avpnm_bits = 0;
-       if (shift - avpnm_bits <= 23) {
-               avpn = HPTE_V_AVPN_VAL(hpte_v) << 23;
+       avpn = (HPTE_V_AVPN_VAL(hpte_v) & ~mmu_psize_defs[size].avpnm) << 23;
 
-               if (shift < 23) {
-                       unsigned long vpi, pteg;
+       if (shift < 23) {
+               unsigned long vpi, vsid, pteg;
 
-                       pteg = slot / HPTES_PER_GROUP;
-                       if (hpte_v & HPTE_V_SECONDARY)
-                               pteg = ~pteg;
+               pteg = slot / HPTES_PER_GROUP;
+               if (hpte_v & HPTE_V_SECONDARY)
+                       pteg = ~pteg;
+               switch (hpte_v >> HPTE_V_SSIZE_SHIFT) {
+               case MMU_SEGSIZE_256M:
                        vpi = ((avpn >> 28) ^ pteg) & htab_hash_mask;
-                       avpn |= (vpi << mmu_psize_defs[size].shift);
+                       break;
+               case MMU_SEGSIZE_1T:
+                       vsid = avpn >> 40;
+                       vpi = (vsid ^ (vsid << 25) ^ pteg) & htab_hash_mask;
+                       break;
+               default:
+                       avpn = vpi = psize = 0;
                }
+               avpn |= (vpi << mmu_psize_defs[size].shift);
        }
 
        *va = avpn;
index 32e9e9492841ac600f68fb4bf07dfb35218837e3..96970ac887ee267dc2826f607298df6cf930e36c 100644 (file)
@@ -40,7 +40,9 @@ unsigned long isa_mem_base = 0;
  */
 static void __init mpc8313_rdb_setup_arch(void)
 {
+#ifdef CONFIG_PCI
        struct device_node *np;
+#endif
 
        if (ppc_md.progress)
                ppc_md.progress("mpc8313_rdb_setup_arch()", 0);
index b0b22bb29de79045f34d81e7b1f6366973fd6bcb..3db68b73fc3297a8eab6c1bff2d73cf0de3532cf 100644 (file)
@@ -44,7 +44,9 @@ unsigned long isa_mem_base = 0;
  */
 static void __init mpc832x_rdb_setup_arch(void)
 {
+#if defined(CONFIG_PCI) || defined(CONFIG_QUICC_ENGINE)
        struct device_node *np;
+#endif
 
        if (ppc_md.progress)
                ppc_md.progress("mpc832x_rdb_setup_arch()", 0);
index 3c009f6d4a4f12baec689d577cba7070cb76f097..40a01947d6840428733df06f316d8f0be3152904 100644 (file)
@@ -50,7 +50,9 @@ unsigned long isa_mem_base = 0;
  */
 static void __init mpc834x_itx_setup_arch(void)
 {
+#ifdef CONFIG_PCI
        struct device_node *np;
+#endif
 
        if (ppc_md.progress)
                ppc_md.progress("mpc834x_itx_setup_arch()", 0);
index 8aa9a93e2aa2c78a30c8920bd58c78e93799a7db..10394b2d7e7a0bd44cb4cc9871d7ddc30f876897 100644 (file)
@@ -120,7 +120,9 @@ static int mpc834x_usb_cfg(void)
  */
 static void __init mpc834x_mds_setup_arch(void)
 {
+#ifdef CONFIG_PCI
        struct device_node *np;
+#endif
 
        if (ppc_md.progress)
                ppc_md.progress("mpc834x_mds_setup_arch()", 0);
index 90877565caa33238f2b83514df58a7dd0d0ac1c1..1051702c8d4f48c5e2dc9bc0c01be7e913e8eb0b 100644 (file)
@@ -168,7 +168,7 @@ static void __devinit quirk_uli1575(struct pci_dev *dev)
 {
        unsigned short temp;
        struct pci_controller *hose = pci_bus_to_host(dev->bus);
-       unsigned char irq2pin[16];
+       unsigned char irq2pin[16], c;
        unsigned long pirq_map_word = 0;
        u32 irq;
        int i;
@@ -288,6 +288,11 @@ static void __devinit quirk_uli1575(struct pci_dev *dev)
        outb(0x1e, 0x4d1);
 
 #undef ULI1575_SET_DEV_IRQ
+
+       /* Disable the HD interface and enable the AC97 interface. */
+       pci_read_config_byte(dev, 0xb8, &c);
+       c &= 0x7f;
+       pci_write_config_byte(dev, 0xb8, c);
 }
 
 static void __devinit quirk_uli5288(struct pci_dev *dev)
index d1adf34cd5e8dedc2b9a43625704d765da37734e..e9ac19c4bba411d19f34d58aeb7ffa35c959defb 100644 (file)
@@ -457,6 +457,7 @@ int __devinit celleb_setup_phb(struct pci_controller *phb)
 
        pr_debug("PCI: celleb_setup_phb() %s\n", name);
        phb_set_bus_ranges(dev, phb);
+       phb->buid = 1;
 
        if (strcmp(name, "epci") == 0) {
                phb->ops = &celleb_epci_ops;
index fb23d53eb09c53cce17482905f95169c266de9b0..c4b011094bd678a64b92a00ff70cc277e5cda5cb 100644 (file)
@@ -133,13 +133,13 @@ static int celleb_epci_check_abort(struct pci_controller *hose,
 }
 
 static volatile void __iomem *celleb_epci_make_config_addr(
+                                       struct pci_bus *bus,
                                        struct pci_controller *hose,
                                        unsigned int devfn, int where)
 {
        volatile void __iomem *addr;
-       struct pci_bus *bus = hose->bus;
 
-       if (bus->self)
+       if (bus != hose->bus)
                addr = celleb_epci_get_epci_cfg(hose) +
                       (((bus->number & 0xff) << 16)
                        | ((devfn & 0xff) << 8)
@@ -193,7 +193,7 @@ static int celleb_epci_read_config(struct pci_bus *bus,
        } else {
 
                clear_and_disable_master_abort_interrupt(hose);
-               addr = celleb_epci_make_config_addr(hose, devfn, where);
+               addr = celleb_epci_make_config_addr(bus, hose, devfn, where);
 
                switch (size) {
                case 1:
@@ -257,7 +257,7 @@ static int celleb_epci_write_config(struct pci_bus *bus,
        } else {
 
                clear_and_disable_master_abort_interrupt(hose);
-               addr = celleb_epci_make_config_addr(hose, devfn, where);
+               addr = celleb_epci_make_config_addr(bus, hose, devfn, where);
 
                switch (size) {
                case 1:
index 596ab2a788d4571cd3f51f85a7b15352bbf25794..5e9f7f163571a36b08344e18e8e931c8035c47b1 100644 (file)
@@ -80,7 +80,7 @@ static int celleb_machine_type_hack(char *ptr)
        return 0;
 }
 
-__setup("celleb_machine_type_hack", celleb_machine_type_hack);
+__setup("celleb_machine_type_hack=", celleb_machine_type_hack);
 
 static void celleb_progress(char *s, unsigned short hex)
 {
index 093438b93bd9e102e9e332988f9c763af385958f..5f3e6d8659fec09d2909e801737bf39f1a9b4717 100644 (file)
@@ -76,7 +76,7 @@
  */
 #define EEH_MAX_FAILS  2100000
 
-/* Time to wait for a PCI slot to retport status, in milliseconds */
+/* Time to wait for a PCI slot to report status, in milliseconds */
 #define PCI_BUS_RESET_WAIT_MSEC (60*1000)
 
 /* RTAS tokens */
@@ -95,11 +95,18 @@ EXPORT_SYMBOL(eeh_subsystem_enabled);
 /* Lock to avoid races due to multiple reports of an error */
 static DEFINE_SPINLOCK(confirm_error_lock);
 
-/* Buffer for reporting slot-error-detail rtas calls */
+/* Buffer for reporting slot-error-detail rtas calls. Its here
+ * in BSS, and not dynamically alloced, so that it ends up in
+ * RMO where RTAS can access it.
+ */
 static unsigned char slot_errbuf[RTAS_ERROR_LOG_MAX];
 static DEFINE_SPINLOCK(slot_errbuf_lock);
 static int eeh_error_buf_size;
 
+/* Buffer for reporting pci register dumps. Its here in BSS, and
+ * not dynamically alloced, so that it ends up in RMO where RTAS
+ * can access it.
+ */
 #define EEH_PCI_REGS_LOG_LEN 4096
 static unsigned char pci_regs_buf[EEH_PCI_REGS_LOG_LEN];
 
@@ -218,7 +225,7 @@ static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len)
 void eeh_slot_error_detail(struct pci_dn *pdn, int severity)
 {
        size_t loglen = 0;
-       memset(pci_regs_buf, 0, EEH_PCI_REGS_LOG_LEN);
+       pci_regs_buf[0] = 0;
 
        rtas_pci_enable(pdn, EEH_THAW_MMIO);
        loglen = gather_pci_data(pdn, pci_regs_buf, EEH_PCI_REGS_LOG_LEN);
index f07d849cfc84837e47ee560a19746387b7c424f7..161a5844ab6c243da27df37ba188fc5e98e72eba 100644 (file)
@@ -378,8 +378,9 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event)
 
        /* Since rtas may enable MMIO when posting the error log,
         * don't post the error log until after all dev drivers
-        * have been informed. */
-       eeh_slot_error_detail(frozen_pdn, 1 /* Temporary Error */);
+        * have been informed.
+        */
+       eeh_slot_error_detail(frozen_pdn, EEH_LOG_TEMP_FAILURE);
 
        /* If all device drivers were EEH-unaware, then shut
         * down all of the device drivers, and hope they
@@ -470,7 +471,7 @@ hard_fail:
                location, drv_str, pci_str);
 
 perm_error:
-       eeh_slot_error_detail(frozen_pdn, 2 /* Permanent Error */);
+       eeh_slot_error_detail(frozen_pdn, EEH_LOG_PERM_FAILURE);
 
        /* Notify all devices that they're about to go down. */
        pci_walk_bus(frozen_bus, eeh_report_failure, NULL);
index eec684a8e44e1bc7176df1f29120631d1b8f5474..be17d2395072c02a67abd37565c956a1221f2699 100644 (file)
@@ -520,7 +520,6 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
                dev->dev.archdata.dma_data = PCI_DN(pdn)->iommu_table;
                return;
        }
-       DBG("  found DMA window, table: %p\n", pci->iommu_table);
 
        pci = PCI_DN(pdn);
        if (!pci->iommu_table) {
@@ -534,6 +533,8 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
 
                pci->iommu_table = iommu_init_table(tbl, pci->phb->node);
                DBG("  created table: %p\n", pci->iommu_table);
+       } else {
+               DBG("  found DMA window, table: %p\n", pci->iommu_table);
        }
 
        dev->dev.archdata.dma_data = pci->iommu_table;
index af2685607458e1e877bbb5bb71d9036a1829b892..412a5e7aff2d33829f8d0f1483fba69d6d635003 100644 (file)
@@ -12,6 +12,7 @@
 #include <asm/firmware.h>
 #include <asm/kexec.h>
 #include <asm/mpic.h>
+#include <asm/smp.h>
 
 #include "pseries.h"
 #include "xics.h"
index 9b4fafd9a840aceb236816276ac4ef8a419b998d..4f67b89ba1d0a0bcf532229b8027962ccce93a95 100644 (file)
@@ -330,7 +330,7 @@ void m8xx_cpm_dpinit(void)
         * with the processor and the microcode patches applied / activated.
         * But the following should be at least safe.
         */
-       rh_attach_region(&cpm_dpmem_info, (void *)CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE);
+       rh_attach_region(&cpm_dpmem_info, CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE);
 }
 
 /*
@@ -338,9 +338,9 @@ void m8xx_cpm_dpinit(void)
  * This function returns an offset into the DPRAM area.
  * Use cpm_dpram_addr() to get the virtual address of the area.
  */
-uint cpm_dpalloc(uint size, uint align)
+unsigned long cpm_dpalloc(uint size, uint align)
 {
-       void *start;
+       unsigned long start;
        unsigned long flags;
 
        spin_lock_irqsave(&cpm_dpmem_lock, flags);
@@ -352,30 +352,30 @@ uint cpm_dpalloc(uint size, uint align)
 }
 EXPORT_SYMBOL(cpm_dpalloc);
 
-int cpm_dpfree(uint offset)
+int cpm_dpfree(unsigned long offset)
 {
        int ret;
        unsigned long flags;
 
        spin_lock_irqsave(&cpm_dpmem_lock, flags);
-       ret = rh_free(&cpm_dpmem_info, (void *)offset);
+       ret = rh_free(&cpm_dpmem_info, offset);
        spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
 
        return ret;
 }
 EXPORT_SYMBOL(cpm_dpfree);
 
-uint cpm_dpalloc_fixed(uint offset, uint size, uint align)
+unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align)
 {
-       void *start;
+       unsigned long start;
        unsigned long flags;
 
        spin_lock_irqsave(&cpm_dpmem_lock, flags);
        cpm_dpmem_info.alignment = align;
-       start = rh_alloc_fixed(&cpm_dpmem_info, (void *)offset, size, "commproc");
+       start = rh_alloc_fixed(&cpm_dpmem_info, offset, size, "commproc");
        spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
 
-       return (uint)start;
+       return start;
 }
 EXPORT_SYMBOL(cpm_dpalloc_fixed);
 
@@ -385,7 +385,7 @@ void cpm_dpdump(void)
 }
 EXPORT_SYMBOL(cpm_dpdump);
 
-void *cpm_dpram_addr(uint offset)
+void *cpm_dpram_addr(unsigned long offset)
 {
        return (void *)(dpram_vbase + offset);
 }
index ec265995d5d8bc020837c766f35ac3ed6de25ad3..9244129747955d062b7a255c3797b97a23b88ab4 100644 (file)
@@ -248,15 +248,14 @@ static void cpm2_dpinit(void)
         * varies with the processor and the microcode patches activated.
         * But the following should be at least safe.
         */
-       rh_attach_region(&cpm_dpmem_info, (void *)CPM_DATAONLY_BASE,
-                       CPM_DATAONLY_SIZE);
+       rh_attach_region(&cpm_dpmem_info, CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE);
 }
 
 /* This function returns an index into the DPRAM area.
  */
-uint cpm_dpalloc(uint size, uint align)
+unsigned long cpm_dpalloc(uint size, uint align)
 {
-       void *start;
+       unsigned long start;
        unsigned long flags;
 
        spin_lock_irqsave(&cpm_dpmem_lock, flags);
@@ -268,13 +267,13 @@ uint cpm_dpalloc(uint size, uint align)
 }
 EXPORT_SYMBOL(cpm_dpalloc);
 
-int cpm_dpfree(uint offset)
+int cpm_dpfree(unsigned long offset)
 {
        int ret;
        unsigned long flags;
 
        spin_lock_irqsave(&cpm_dpmem_lock, flags);
-       ret = rh_free(&cpm_dpmem_info, (void *)offset);
+       ret = rh_free(&cpm_dpmem_info, offset);
        spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
 
        return ret;
@@ -282,17 +281,17 @@ int cpm_dpfree(uint offset)
 EXPORT_SYMBOL(cpm_dpfree);
 
 /* not sure if this is ever needed */
-uint cpm_dpalloc_fixed(uint offset, uint size, uint align)
+unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align)
 {
-       void *start;
+       unsigned long start;
        unsigned long flags;
 
        spin_lock_irqsave(&cpm_dpmem_lock, flags);
        cpm_dpmem_info.alignment = align;
-       start = rh_alloc_fixed(&cpm_dpmem_info, (void *)offset, size, "commproc");
+       start = rh_alloc_fixed(&cpm_dpmem_info, offset, size, "commproc");
        spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
 
-       return (uint)start;
+       return start;
 }
 EXPORT_SYMBOL(cpm_dpalloc_fixed);
 
@@ -302,7 +301,7 @@ void cpm_dpdump(void)
 }
 EXPORT_SYMBOL(cpm_dpdump);
 
-void *cpm_dpram_addr(uint offset)
+void *cpm_dpram_addr(unsigned long offset)
 {
        return (void *)(im_dprambase + offset);
 }
index 7f4c0754396197bdc5bf571c698b7813ffd3b979..90f87408b5d591de37347a2006432b4ba8a6d012 100644 (file)
@@ -244,7 +244,7 @@ EXPORT_SYMBOL(qe_put_snum);
 static int qe_sdma_init(void)
 {
        struct sdma *sdma = &qe_immr->sdma;
-       u32 sdma_buf_offset;
+       unsigned long sdma_buf_offset;
 
        if (!sdma)
                return -ENODEV;
@@ -252,10 +252,10 @@ static int qe_sdma_init(void)
        /* allocate 2 internal temporary buffers (512 bytes size each) for
         * the SDMA */
        sdma_buf_offset = qe_muram_alloc(512 * 2, 4096);
-       if (IS_MURAM_ERR(sdma_buf_offset))
+       if (IS_ERR_VALUE(sdma_buf_offset))
                return -ENOMEM;
 
-       out_be32(&sdma->sdebcr, sdma_buf_offset & QE_SDEBCR_BA_MASK);
+       out_be32(&sdma->sdebcr, (u32) sdma_buf_offset & QE_SDEBCR_BA_MASK);
        out_be32(&sdma->sdmr, (QE_SDMR_GLB_1_MSK |
                                        (0x1 << QE_SDMR_CEN_SHIFT)));
 
@@ -291,33 +291,32 @@ static void qe_muram_init(void)
        if ((np = of_find_node_by_name(NULL, "data-only")) != NULL) {
                address = *of_get_address(np, 0, &size, &flags);
                of_node_put(np);
-               rh_attach_region(&qe_muram_info,
-                       (void *)address, (int)size);
+               rh_attach_region(&qe_muram_info, address, (int) size);
        }
 }
 
 /* This function returns an index into the MURAM area.
  */
-u32 qe_muram_alloc(u32 size, u32 align)
+unsigned long qe_muram_alloc(int size, int align)
 {
-       void *start;
+       unsigned long start;
        unsigned long flags;
 
        spin_lock_irqsave(&qe_muram_lock, flags);
        start = rh_alloc_align(&qe_muram_info, size, align, "QE");
        spin_unlock_irqrestore(&qe_muram_lock, flags);
 
-       return (u32) start;
+       return start;
 }
 EXPORT_SYMBOL(qe_muram_alloc);
 
-int qe_muram_free(u32 offset)
+int qe_muram_free(unsigned long offset)
 {
        int ret;
        unsigned long flags;
 
        spin_lock_irqsave(&qe_muram_lock, flags);
-       ret = rh_free(&qe_muram_info, (void *)offset);
+       ret = rh_free(&qe_muram_info, offset);
        spin_unlock_irqrestore(&qe_muram_lock, flags);
 
        return ret;
@@ -325,16 +324,16 @@ int qe_muram_free(u32 offset)
 EXPORT_SYMBOL(qe_muram_free);
 
 /* not sure if this is ever needed */
-u32 qe_muram_alloc_fixed(u32 offset, u32 size)
+unsigned long qe_muram_alloc_fixed(unsigned long offset, int size)
 {
-       void *start;
+       unsigned long start;
        unsigned long flags;
 
        spin_lock_irqsave(&qe_muram_lock, flags);
-       start = rh_alloc_fixed(&qe_muram_info, (void *)offset, size, "commproc");
+       start = rh_alloc_fixed(&qe_muram_info, offset, size, "commproc");
        spin_unlock_irqrestore(&qe_muram_lock, flags);
 
-       return (u32) start;
+       return start;
 }
 EXPORT_SYMBOL(qe_muram_alloc_fixed);
 
@@ -344,7 +343,7 @@ void qe_muram_dump(void)
 }
 EXPORT_SYMBOL(qe_muram_dump);
 
-void *qe_muram_addr(u32 offset)
+void *qe_muram_addr(unsigned long offset)
 {
        return (void *)&qe_immr->muram[offset];
 }
index 66137bf2dfb0ffb2c78a1613cd62079d6f447b38..9143236853fc029029f0a178f5319cb383650506 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/slab.h>
 #include <linux/stddef.h>
 #include <linux/interrupt.h>
+#include <linux/err.h>
 
 #include <asm/io.h>
 #include <asm/immap_qe.h>
@@ -268,7 +269,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
        /* Allocate memory for Tx Virtual Fifo */
        uccf->ucc_fast_tx_virtual_fifo_base_offset =
            qe_muram_alloc(uf_info->utfs, UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
-       if (IS_MURAM_ERR(uccf->ucc_fast_tx_virtual_fifo_base_offset)) {
+       if (IS_ERR_VALUE(uccf->ucc_fast_tx_virtual_fifo_base_offset)) {
                printk(KERN_ERR "%s: cannot allocate MURAM for TX FIFO", __FUNCTION__);
                uccf->ucc_fast_tx_virtual_fifo_base_offset = 0;
                ucc_fast_free(uccf);
@@ -280,7 +281,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
                qe_muram_alloc(uf_info->urfs +
                           UCC_FAST_RECEIVE_VIRTUAL_FIFO_SIZE_FUDGE_FACTOR,
                           UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
-       if (IS_MURAM_ERR(uccf->ucc_fast_rx_virtual_fifo_base_offset)) {
+       if (IS_ERR_VALUE(uccf->ucc_fast_rx_virtual_fifo_base_offset)) {
                printk(KERN_ERR "%s: cannot allocate MURAM for RX FIFO", __FUNCTION__);
                uccf->ucc_fast_rx_virtual_fifo_base_offset = 0;
                ucc_fast_free(uccf);
index b930d686a4d18d1b06c5fe0915674f67492df900..1f65c26ce63f8fff07ecd4ff040f0d8eadb8c0e9 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/slab.h>
 #include <linux/stddef.h>
 #include <linux/interrupt.h>
+#include <linux/err.h>
 
 #include <asm/io.h>
 #include <asm/immap_qe.h>
@@ -175,7 +176,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
        /* Get PRAM base */
        uccs->us_pram_offset =
                qe_muram_alloc(UCC_SLOW_PRAM_SIZE, ALIGNMENT_OF_UCC_SLOW_PRAM);
-       if (IS_MURAM_ERR(uccs->us_pram_offset)) {
+       if (IS_ERR_VALUE(uccs->us_pram_offset)) {
                printk(KERN_ERR "%s: cannot allocate MURAM for PRAM", __FUNCTION__);
                ucc_slow_free(uccs);
                return -ENOMEM;
@@ -210,7 +211,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
        uccs->rx_base_offset =
                qe_muram_alloc(us_info->rx_bd_ring_len * sizeof(struct qe_bd),
                                QE_ALIGNMENT_OF_BD);
-       if (IS_MURAM_ERR(uccs->rx_base_offset)) {
+       if (IS_ERR_VALUE(uccs->rx_base_offset)) {
                printk(KERN_ERR "%s: cannot allocate RX BDs", __FUNCTION__);
                uccs->rx_base_offset = 0;
                ucc_slow_free(uccs);
@@ -220,7 +221,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
        uccs->tx_base_offset =
                qe_muram_alloc(us_info->tx_bd_ring_len * sizeof(struct qe_bd),
                        QE_ALIGNMENT_OF_BD);
-       if (IS_MURAM_ERR(uccs->tx_base_offset)) {
+       if (IS_ERR_VALUE(uccs->tx_base_offset)) {
                printk(KERN_ERR "%s: cannot allocate TX BDs", __FUNCTION__);
                uccs->tx_base_offset = 0;
                ucc_slow_free(uccs);
index 7a8722beac1262bafeb4fe49545dcd5d66370f6b..e2c6210f234baf322ad2dd40d2f8af0d0184433c 100644 (file)
@@ -402,7 +402,7 @@ void m8xx_cpm_dpinit(void)
         * with the processor and the microcode patches applied / activated.
         * But the following should be at least safe.
         */
-       rh_attach_region(&cpm_dpmem_info, (void *)CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE);
+       rh_attach_region(&cpm_dpmem_info, CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE);
 }
 
 /*
@@ -410,9 +410,9 @@ void m8xx_cpm_dpinit(void)
  * This function returns an offset into the DPRAM area.
  * Use cpm_dpram_addr() to get the virtual address of the area.
  */
-uint cpm_dpalloc(uint size, uint align)
+unsigned long cpm_dpalloc(uint size, uint align)
 {
-       void *start;
+       unsigned long start;
        unsigned long flags;
 
        spin_lock_irqsave(&cpm_dpmem_lock, flags);
@@ -420,34 +420,34 @@ uint cpm_dpalloc(uint size, uint align)
        start = rh_alloc(&cpm_dpmem_info, size, "commproc");
        spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
 
-       return (uint)start;
+       return start;
 }
 EXPORT_SYMBOL(cpm_dpalloc);
 
-int cpm_dpfree(uint offset)
+int cpm_dpfree(unsigned long offset)
 {
        int ret;
        unsigned long flags;
 
        spin_lock_irqsave(&cpm_dpmem_lock, flags);
-       ret = rh_free(&cpm_dpmem_info, (void *)offset);
+       ret = rh_free(&cpm_dpmem_info, offset);
        spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
 
        return ret;
 }
 EXPORT_SYMBOL(cpm_dpfree);
 
-uint cpm_dpalloc_fixed(uint offset, uint size, uint align)
+unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align)
 {
-       void *start;
+       unsigned long start;
        unsigned long flags;
 
        spin_lock_irqsave(&cpm_dpmem_lock, flags);
        cpm_dpmem_info.alignment = align;
-       start = rh_alloc_fixed(&cpm_dpmem_info, (void *)offset, size, "commproc");
+       start = rh_alloc_fixed(&cpm_dpmem_info, offset, size, "commproc");
        spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
 
-       return (uint)start;
+       return start;
 }
 EXPORT_SYMBOL(cpm_dpalloc_fixed);
 
@@ -457,7 +457,7 @@ void cpm_dpdump(void)
 }
 EXPORT_SYMBOL(cpm_dpdump);
 
-void *cpm_dpram_addr(uint offset)
+void *cpm_dpram_addr(unsigned long offset)
 {
        return ((immap_t *)IMAP_ADDR)->im_cpm.cp_dpmem + offset;
 }
index 422bef9bae7b6dff9f360272be891db61d449217..095e661e79ddc3335d95f6db6bb71d0d09960541 100644 (file)
@@ -3,6 +3,3 @@
 #
 
 obj-y                  := checksum.o string.o div64.o
-
-obj-$(CONFIG_8xx)      += rheap.o
-obj-$(CONFIG_CPM2)     += rheap.o
diff --git a/arch/ppc/lib/rheap.c b/arch/ppc/lib/rheap.c
deleted file mode 100644 (file)
index d407007..0000000
+++ /dev/null
@@ -1,692 +0,0 @@
-/*
- * A Remote Heap.  Remote means that we don't touch the memory that the
- * heap points to. Normal heap implementations use the memory they manage
- * to place their list. We cannot do that because the memory we manage may
- * have special properties, for example it is uncachable or of different
- * endianess.
- *
- * Author: Pantelis Antoniou <panto@intracom.gr>
- *
- * 2004 (c) INTRACOM S.A. Greece. This file is licensed under
- * the terms of the GNU General Public License version 2. This program
- * is licensed "as is" without any warranty of any kind, whether express
- * or implied.
- */
-#include <linux/types.h>
-#include <linux/errno.h>
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/slab.h>
-
-#include <asm/rheap.h>
-
-/*
- * Fixup a list_head, needed when copying lists.  If the pointers fall
- * between s and e, apply the delta.  This assumes that
- * sizeof(struct list_head *) == sizeof(unsigned long *).
- */
-static inline void fixup(unsigned long s, unsigned long e, int d,
-                        struct list_head *l)
-{
-       unsigned long *pp;
-
-       pp = (unsigned long *)&l->next;
-       if (*pp >= s && *pp < e)
-               *pp += d;
-
-       pp = (unsigned long *)&l->prev;
-       if (*pp >= s && *pp < e)
-               *pp += d;
-}
-
-/* Grow the allocated blocks */
-static int grow(rh_info_t * info, int max_blocks)
-{
-       rh_block_t *block, *blk;
-       int i, new_blocks;
-       int delta;
-       unsigned long blks, blke;
-
-       if (max_blocks <= info->max_blocks)
-               return -EINVAL;
-
-       new_blocks = max_blocks - info->max_blocks;
-
-       block = kmalloc(sizeof(rh_block_t) * max_blocks, GFP_KERNEL);
-       if (block == NULL)
-               return -ENOMEM;
-
-       if (info->max_blocks > 0) {
-
-               /* copy old block area */
-               memcpy(block, info->block,
-                      sizeof(rh_block_t) * info->max_blocks);
-
-               delta = (char *)block - (char *)info->block;
-
-               /* and fixup list pointers */
-               blks = (unsigned long)info->block;
-               blke = (unsigned long)(info->block + info->max_blocks);
-
-               for (i = 0, blk = block; i < info->max_blocks; i++, blk++)
-                       fixup(blks, blke, delta, &blk->list);
-
-               fixup(blks, blke, delta, &info->empty_list);
-               fixup(blks, blke, delta, &info->free_list);
-               fixup(blks, blke, delta, &info->taken_list);
-
-               /* free the old allocated memory */
-               if ((info->flags & RHIF_STATIC_BLOCK) == 0)
-                       kfree(info->block);
-       }
-
-       info->block = block;
-       info->empty_slots += new_blocks;
-       info->max_blocks = max_blocks;
-       info->flags &= ~RHIF_STATIC_BLOCK;
-
-       /* add all new blocks to the free list */
-       for (i = 0, blk = block + info->max_blocks; i < new_blocks; i++, blk++)
-               list_add(&blk->list, &info->empty_list);
-
-       return 0;
-}
-
-/*
- * Assure at least the required amount of empty slots.  If this function
- * causes a grow in the block area then all pointers kept to the block
- * area are invalid!
- */
-static int assure_empty(rh_info_t * info, int slots)
-{
-       int max_blocks;
-
-       /* This function is not meant to be used to grow uncontrollably */
-       if (slots >= 4)
-               return -EINVAL;
-
-       /* Enough space */
-       if (info->empty_slots >= slots)
-               return 0;
-
-       /* Next 16 sized block */
-       max_blocks = ((info->max_blocks + slots) + 15) & ~15;
-
-       return grow(info, max_blocks);
-}
-
-static rh_block_t *get_slot(rh_info_t * info)
-{
-       rh_block_t *blk;
-
-       /* If no more free slots, and failure to extend. */
-       /* XXX: You should have called assure_empty before */
-       if (info->empty_slots == 0) {
-               printk(KERN_ERR "rh: out of slots; crash is imminent.\n");
-               return NULL;
-       }
-
-       /* Get empty slot to use */
-       blk = list_entry(info->empty_list.next, rh_block_t, list);
-       list_del_init(&blk->list);
-       info->empty_slots--;
-
-       /* Initialize */
-       blk->start = NULL;
-       blk->size = 0;
-       blk->owner = NULL;
-
-       return blk;
-}
-
-static inline void release_slot(rh_info_t * info, rh_block_t * blk)
-{
-       list_add(&blk->list, &info->empty_list);
-       info->empty_slots++;
-}
-
-static void attach_free_block(rh_info_t * info, rh_block_t * blkn)
-{
-       rh_block_t *blk;
-       rh_block_t *before;
-       rh_block_t *after;
-       rh_block_t *next;
-       int size;
-       unsigned long s, e, bs, be;
-       struct list_head *l;
-
-       /* We assume that they are aligned properly */
-       size = blkn->size;
-       s = (unsigned long)blkn->start;
-       e = s + size;
-
-       /* Find the blocks immediately before and after the given one
-        * (if any) */
-       before = NULL;
-       after = NULL;
-       next = NULL;
-
-       list_for_each(l, &info->free_list) {
-               blk = list_entry(l, rh_block_t, list);
-
-               bs = (unsigned long)blk->start;
-               be = bs + blk->size;
-
-               if (next == NULL && s >= bs)
-                       next = blk;
-
-               if (be == s)
-                       before = blk;
-
-               if (e == bs)
-                       after = blk;
-
-               /* If both are not null, break now */
-               if (before != NULL && after != NULL)
-                       break;
-       }
-
-       /* Now check if they are really adjacent */
-       if (before != NULL && s != (unsigned long)before->start + before->size)
-               before = NULL;
-
-       if (after != NULL && e != (unsigned long)after->start)
-               after = NULL;
-
-       /* No coalescing; list insert and return */
-       if (before == NULL && after == NULL) {
-
-               if (next != NULL)
-                       list_add(&blkn->list, &next->list);
-               else
-                       list_add(&blkn->list, &info->free_list);
-
-               return;
-       }
-
-       /* We don't need it anymore */
-       release_slot(info, blkn);
-
-       /* Grow the before block */
-       if (before != NULL && after == NULL) {
-               before->size += size;
-               return;
-       }
-
-       /* Grow the after block backwards */
-       if (before == NULL && after != NULL) {
-               after->start = (int8_t *)after->start - size;
-               after->size += size;
-               return;
-       }
-
-       /* Grow the before block, and release the after block */
-       before->size += size + after->size;
-       list_del(&after->list);
-       release_slot(info, after);
-}
-
-static void attach_taken_block(rh_info_t * info, rh_block_t * blkn)
-{
-       rh_block_t *blk;
-       struct list_head *l;
-
-       /* Find the block immediately before the given one (if any) */
-       list_for_each(l, &info->taken_list) {
-               blk = list_entry(l, rh_block_t, list);
-               if (blk->start > blkn->start) {
-                       list_add_tail(&blkn->list, &blk->list);
-                       return;
-               }
-       }
-
-       list_add_tail(&blkn->list, &info->taken_list);
-}
-
-/*
- * Create a remote heap dynamically.  Note that no memory for the blocks
- * are allocated.  It will upon the first allocation
- */
-rh_info_t *rh_create(unsigned int alignment)
-{
-       rh_info_t *info;
-
-       /* Alignment must be a power of two */
-       if ((alignment & (alignment - 1)) != 0)
-               return ERR_PTR(-EINVAL);
-
-       info = kmalloc(sizeof(*info), GFP_KERNEL);
-       if (info == NULL)
-               return ERR_PTR(-ENOMEM);
-
-       info->alignment = alignment;
-
-       /* Initially everything as empty */
-       info->block = NULL;
-       info->max_blocks = 0;
-       info->empty_slots = 0;
-       info->flags = 0;
-
-       INIT_LIST_HEAD(&info->empty_list);
-       INIT_LIST_HEAD(&info->free_list);
-       INIT_LIST_HEAD(&info->taken_list);
-
-       return info;
-}
-
-/*
- * Destroy a dynamically created remote heap.  Deallocate only if the areas
- * are not static
- */
-void rh_destroy(rh_info_t * info)
-{
-       if ((info->flags & RHIF_STATIC_BLOCK) == 0 && info->block != NULL)
-               kfree(info->block);
-
-       if ((info->flags & RHIF_STATIC_INFO) == 0)
-               kfree(info);
-}
-
-/*
- * Initialize in place a remote heap info block.  This is needed to support
- * operation very early in the startup of the kernel, when it is not yet safe
- * to call kmalloc.
- */
-void rh_init(rh_info_t * info, unsigned int alignment, int max_blocks,
-            rh_block_t * block)
-{
-       int i;
-       rh_block_t *blk;
-
-       /* Alignment must be a power of two */
-       if ((alignment & (alignment - 1)) != 0)
-               return;
-
-       info->alignment = alignment;
-
-       /* Initially everything as empty */
-       info->block = block;
-       info->max_blocks = max_blocks;
-       info->empty_slots = max_blocks;
-       info->flags = RHIF_STATIC_INFO | RHIF_STATIC_BLOCK;
-
-       INIT_LIST_HEAD(&info->empty_list);
-       INIT_LIST_HEAD(&info->free_list);
-       INIT_LIST_HEAD(&info->taken_list);
-
-       /* Add all new blocks to the free list */
-       for (i = 0, blk = block; i < max_blocks; i++, blk++)
-               list_add(&blk->list, &info->empty_list);
-}
-
-/* Attach a free memory region, coalesces regions if adjuscent */
-int rh_attach_region(rh_info_t * info, void *start, int size)
-{
-       rh_block_t *blk;
-       unsigned long s, e, m;
-       int r;
-
-       /* The region must be aligned */
-       s = (unsigned long)start;
-       e = s + size;
-       m = info->alignment - 1;
-
-       /* Round start up */
-       s = (s + m) & ~m;
-
-       /* Round end down */
-       e = e & ~m;
-
-       /* Take final values */
-       start = (void *)s;
-       size = (int)(e - s);
-
-       /* Grow the blocks, if needed */
-       r = assure_empty(info, 1);
-       if (r < 0)
-               return r;
-
-       blk = get_slot(info);
-       blk->start = start;
-       blk->size = size;
-       blk->owner = NULL;
-
-       attach_free_block(info, blk);
-
-       return 0;
-}
-
-/* Detatch given address range, splits free block if needed. */
-void *rh_detach_region(rh_info_t * info, void *start, int size)
-{
-       struct list_head *l;
-       rh_block_t *blk, *newblk;
-       unsigned long s, e, m, bs, be;
-
-       /* Validate size */
-       if (size <= 0)
-               return ERR_PTR(-EINVAL);
-
-       /* The region must be aligned */
-       s = (unsigned long)start;
-       e = s + size;
-       m = info->alignment - 1;
-
-       /* Round start up */
-       s = (s + m) & ~m;
-
-       /* Round end down */
-       e = e & ~m;
-
-       if (assure_empty(info, 1) < 0)
-               return ERR_PTR(-ENOMEM);
-
-       blk = NULL;
-       list_for_each(l, &info->free_list) {
-               blk = list_entry(l, rh_block_t, list);
-               /* The range must lie entirely inside one free block */
-               bs = (unsigned long)blk->start;
-               be = (unsigned long)blk->start + blk->size;
-               if (s >= bs && e <= be)
-                       break;
-               blk = NULL;
-       }
-
-       if (blk == NULL)
-               return ERR_PTR(-ENOMEM);
-
-       /* Perfect fit */
-       if (bs == s && be == e) {
-               /* Delete from free list, release slot */
-               list_del(&blk->list);
-               release_slot(info, blk);
-               return (void *)s;
-       }
-
-       /* blk still in free list, with updated start and/or size */
-       if (bs == s || be == e) {
-               if (bs == s)
-                       blk->start = (int8_t *)blk->start + size;
-               blk->size -= size;
-
-       } else {
-               /* The front free fragment */
-               blk->size = s - bs;
-
-               /* the back free fragment */
-               newblk = get_slot(info);
-               newblk->start = (void *)e;
-               newblk->size = be - e;
-
-               list_add(&newblk->list, &blk->list);
-       }
-
-       return (void *)s;
-}
-
-void *rh_alloc(rh_info_t * info, int size, const char *owner)
-{
-       struct list_head *l;
-       rh_block_t *blk;
-       rh_block_t *newblk;
-       void *start;
-
-       /* Validate size */
-       if (size <= 0)
-               return ERR_PTR(-EINVAL);
-
-       /* Align to configured alignment */
-       size = (size + (info->alignment - 1)) & ~(info->alignment - 1);
-
-       if (assure_empty(info, 1) < 0)
-               return ERR_PTR(-ENOMEM);
-
-       blk = NULL;
-       list_for_each(l, &info->free_list) {
-               blk = list_entry(l, rh_block_t, list);
-               if (size <= blk->size)
-                       break;
-               blk = NULL;
-       }
-
-       if (blk == NULL)
-               return ERR_PTR(-ENOMEM);
-
-       /* Just fits */
-       if (blk->size == size) {
-               /* Move from free list to taken list */
-               list_del(&blk->list);
-               blk->owner = owner;
-               start = blk->start;
-
-               attach_taken_block(info, blk);
-
-               return start;
-       }
-
-       newblk = get_slot(info);
-       newblk->start = blk->start;
-       newblk->size = size;
-       newblk->owner = owner;
-
-       /* blk still in free list, with updated start, size */
-       blk->start = (int8_t *)blk->start + size;
-       blk->size -= size;
-
-       start = newblk->start;
-
-       attach_taken_block(info, newblk);
-
-       return start;
-}
-
-/* allocate at precisely the given address */
-void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
-{
-       struct list_head *l;
-       rh_block_t *blk, *newblk1, *newblk2;
-       unsigned long s, e, m, bs, be;
-
-       /* Validate size */
-       if (size <= 0)
-               return ERR_PTR(-EINVAL);
-
-       /* The region must be aligned */
-       s = (unsigned long)start;
-       e = s + size;
-       m = info->alignment - 1;
-
-       /* Round start up */
-       s = (s + m) & ~m;
-
-       /* Round end down */
-       e = e & ~m;
-
-       if (assure_empty(info, 2) < 0)
-               return ERR_PTR(-ENOMEM);
-
-       blk = NULL;
-       list_for_each(l, &info->free_list) {
-               blk = list_entry(l, rh_block_t, list);
-               /* The range must lie entirely inside one free block */
-               bs = (unsigned long)blk->start;
-               be = (unsigned long)blk->start + blk->size;
-               if (s >= bs && e <= be)
-                       break;
-       }
-
-       if (blk == NULL)
-               return ERR_PTR(-ENOMEM);
-
-       /* Perfect fit */
-       if (bs == s && be == e) {
-               /* Move from free list to taken list */
-               list_del(&blk->list);
-               blk->owner = owner;
-
-               start = blk->start;
-               attach_taken_block(info, blk);
-
-               return start;
-
-       }
-
-       /* blk still in free list, with updated start and/or size */
-       if (bs == s || be == e) {
-               if (bs == s)
-                       blk->start = (int8_t *)blk->start + size;
-               blk->size -= size;
-
-       } else {
-               /* The front free fragment */
-               blk->size = s - bs;
-
-               /* The back free fragment */
-               newblk2 = get_slot(info);
-               newblk2->start = (void *)e;
-               newblk2->size = be - e;
-
-               list_add(&newblk2->list, &blk->list);
-       }
-
-       newblk1 = get_slot(info);
-       newblk1->start = (void *)s;
-       newblk1->size = e - s;
-       newblk1->owner = owner;
-
-       start = newblk1->start;
-       attach_taken_block(info, newblk1);
-
-       return start;
-}
-
-int rh_free(rh_info_t * info, void *start)
-{
-       rh_block_t *blk, *blk2;
-       struct list_head *l;
-       int size;
-
-       /* Linear search for block */
-       blk = NULL;
-       list_for_each(l, &info->taken_list) {
-               blk2 = list_entry(l, rh_block_t, list);
-               if (start < blk2->start)
-                       break;
-               blk = blk2;
-       }
-
-       if (blk == NULL || start > (blk->start + blk->size))
-               return -EINVAL;
-
-       /* Remove from taken list */
-       list_del(&blk->list);
-
-       /* Get size of freed block */
-       size = blk->size;
-       attach_free_block(info, blk);
-
-       return size;
-}
-
-int rh_get_stats(rh_info_t * info, int what, int max_stats, rh_stats_t * stats)
-{
-       rh_block_t *blk;
-       struct list_head *l;
-       struct list_head *h;
-       int nr;
-
-       switch (what) {
-
-       case RHGS_FREE:
-               h = &info->free_list;
-               break;
-
-       case RHGS_TAKEN:
-               h = &info->taken_list;
-               break;
-
-       default:
-               return -EINVAL;
-       }
-
-       /* Linear search for block */
-       nr = 0;
-       list_for_each(l, h) {
-               blk = list_entry(l, rh_block_t, list);
-               if (stats != NULL && nr < max_stats) {
-                       stats->start = blk->start;
-                       stats->size = blk->size;
-                       stats->owner = blk->owner;
-                       stats++;
-               }
-               nr++;
-       }
-
-       return nr;
-}
-
-int rh_set_owner(rh_info_t * info, void *start, const char *owner)
-{
-       rh_block_t *blk, *blk2;
-       struct list_head *l;
-       int size;
-
-       /* Linear search for block */
-       blk = NULL;
-       list_for_each(l, &info->taken_list) {
-               blk2 = list_entry(l, rh_block_t, list);
-               if (start < blk2->start)
-                       break;
-               blk = blk2;
-       }
-
-       if (blk == NULL || start > (blk->start + blk->size))
-               return -EINVAL;
-
-       blk->owner = owner;
-       size = blk->size;
-
-       return size;
-}
-
-void rh_dump(rh_info_t * info)
-{
-       static rh_stats_t st[32];       /* XXX maximum 32 blocks */
-       int maxnr;
-       int i, nr;
-
-       maxnr = ARRAY_SIZE(st);
-
-       printk(KERN_INFO
-              "info @0x%p (%d slots empty / %d max)\n",
-              info, info->empty_slots, info->max_blocks);
-
-       printk(KERN_INFO "  Free:\n");
-       nr = rh_get_stats(info, RHGS_FREE, maxnr, st);
-       if (nr > maxnr)
-               nr = maxnr;
-       for (i = 0; i < nr; i++)
-               printk(KERN_INFO
-                      "    0x%p-0x%p (%u)\n",
-                      st[i].start, (int8_t *) st[i].start + st[i].size,
-                      st[i].size);
-       printk(KERN_INFO "\n");
-
-       printk(KERN_INFO "  Taken:\n");
-       nr = rh_get_stats(info, RHGS_TAKEN, maxnr, st);
-       if (nr > maxnr)
-               nr = maxnr;
-       for (i = 0; i < nr; i++)
-               printk(KERN_INFO
-                      "    0x%p-0x%p (%u) %s\n",
-                      st[i].start, (int8_t *) st[i].start + st[i].size,
-                      st[i].size, st[i].owner != NULL ? st[i].owner : "");
-       printk(KERN_INFO "\n");
-}
-
-void rh_dump_blk(rh_info_t * info, rh_block_t * blk)
-{
-       printk(KERN_INFO
-              "blk @0x%p: 0x%p-0x%p (%u)\n",
-              blk, blk->start, (int8_t *) blk->start + blk->size, blk->size);
-}
index cbac44b1620cc3cc7313b2127e1999e2472a422c..6cd859d7721f7cbca96ee09c3915890ad2b4de92 100644 (file)
@@ -136,15 +136,14 @@ static void cpm2_dpinit(void)
         * varies with the processor and the microcode patches activated.
         * But the following should be at least safe.
         */
-       rh_attach_region(&cpm_dpmem_info, (void *)CPM_DATAONLY_BASE,
-                       CPM_DATAONLY_SIZE);
+       rh_attach_region(&cpm_dpmem_info, CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE);
 }
 
 /* This function returns an index into the DPRAM area.
  */
-uint cpm_dpalloc(uint size, uint align)
+unsigned long cpm_dpalloc(uint size, uint align)
 {
-       void *start;
+       unsigned long start;
        unsigned long flags;
 
        spin_lock_irqsave(&cpm_dpmem_lock, flags);
@@ -152,17 +151,17 @@ uint cpm_dpalloc(uint size, uint align)
        start = rh_alloc(&cpm_dpmem_info, size, "commproc");
        spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
 
-       return (uint)start;
+       return start;
 }
 EXPORT_SYMBOL(cpm_dpalloc);
 
-int cpm_dpfree(uint offset)
+int cpm_dpfree(unsigned long offset)
 {
        int ret;
        unsigned long flags;
 
        spin_lock_irqsave(&cpm_dpmem_lock, flags);
-       ret = rh_free(&cpm_dpmem_info, (void *)offset);
+       ret = rh_free(&cpm_dpmem_info, offset);
        spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
 
        return ret;
@@ -170,17 +169,17 @@ int cpm_dpfree(uint offset)
 EXPORT_SYMBOL(cpm_dpfree);
 
 /* not sure if this is ever needed */
-uint cpm_dpalloc_fixed(uint offset, uint size, uint align)
+unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align)
 {
-       void *start;
+       unsigned long start;
        unsigned long flags;
 
        spin_lock_irqsave(&cpm_dpmem_lock, flags);
        cpm_dpmem_info.alignment = align;
-       start = rh_alloc_fixed(&cpm_dpmem_info, (void *)offset, size, "commproc");
+       start = rh_alloc_fixed(&cpm_dpmem_info, offset, size, "commproc");
        spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
 
-       return (uint)start;
+       return start;
 }
 EXPORT_SYMBOL(cpm_dpalloc_fixed);
 
@@ -190,7 +189,7 @@ void cpm_dpdump(void)
 }
 EXPORT_SYMBOL(cpm_dpdump);
 
-void *cpm_dpram_addr(uint offset)
+void *cpm_dpram_addr(unsigned long offset)
 {
        return (void *)&cpm2_immr->im_dprambase[offset];
 }
index 1a84719be2641f47bedc832ff7a460acbf29cf9b..098c62c29f9c3cda9b4292da5790ae1265be259d 100644 (file)
@@ -4,27 +4,23 @@
 #
 
 config MMU
-       bool
-       default y
+       def_bool y
 
 config ZONE_DMA
        def_bool y
        depends on 64BIT
 
 config LOCKDEP_SUPPORT
-       bool
-       default y
+       def_bool y
 
 config STACKTRACE_SUPPORT
-       bool
-       default y
+       def_bool y
 
 config RWSEM_GENERIC_SPINLOCK
        bool
 
 config RWSEM_XCHGADD_ALGORITHM
-       bool
-       default y
+       def_bool y
 
 config ARCH_HAS_ILOG2_U32
        bool
@@ -35,8 +31,7 @@ config ARCH_HAS_ILOG2_U64
        default n
 
 config GENERIC_HWEIGHT
-       bool
-       default y
+       def_bool y
 
 config GENERIC_TIME
        def_bool y
@@ -55,8 +50,7 @@ config NO_DMA
 mainmenu "Linux Kernel Configuration"
 
 config S390
-       bool
-       default y
+       def_bool y
 
 source "init/Kconfig"
 
@@ -280,6 +274,10 @@ config WARN_STACK_SIZE
 config ARCH_POPULATES_NODE_MAP
        def_bool y
 
+comment "Kernel preemption"
+
+source "kernel/Kconfig.preempt"
+
 source "mm/Kconfig"
 
 config HOLES_IN_ZONE
@@ -320,17 +318,6 @@ config QDIO_DEBUG
 
 comment "Misc"
 
-config PREEMPT
-       bool "Preemptible Kernel"
-       help
-         This option reduces the latency of the kernel when reacting to
-         real-time or interactive events by allowing a low priority process to
-         be preempted even if it is in kernel mode executing a system call.
-         This allows applications to run more reliably even when the system is
-         under load.
-
-         Say N if you are unsure.
-
 config IPL
        bool "Builtin IPL record support"
        help
@@ -488,6 +475,8 @@ config APPLDATA_NET_SUM
          This can also be compiled as a module, which will be called
          appldata_net_sum.o.
 
+source kernel/Kconfig.hz
+
 config NO_IDLE_HZ
        bool "No HZ timer ticks in idle"
        help
@@ -535,18 +524,12 @@ endmenu
 source "net/Kconfig"
 
 config PCMCIA
-       bool
-       default n
-
-source "drivers/base/Kconfig"
+       def_bool n
 
-source "drivers/connector/Kconfig"
-
-source "drivers/scsi/Kconfig"
-
-source "drivers/s390/Kconfig"
+config CCW
+       def_bool y
 
-source "drivers/net/Kconfig"
+source "drivers/Kconfig"
 
 source "fs/Kconfig"
 
index 0e4da8a7d8266c64897375e03002447d1d3c5455..485b60c1983ce8d2efa2a348c0464bb384d890f3 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.21-rc1
-# Wed Feb 21 10:44:30 2007
+# Linux kernel version: 2.6.21
+# Thu May 10 15:18:19 2007
 #
 CONFIG_MMU=y
 CONFIG_ZONE_DMA=y
@@ -14,6 +14,7 @@ CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_TIME=y
 CONFIG_GENERIC_BUG=y
 CONFIG_NO_IOMEM=y
+CONFIG_NO_DMA=y
 CONFIG_S390=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
@@ -41,9 +42,11 @@ CONFIG_AUDIT=y
 # CONFIG_AUDITSYSCALL is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=17
 # CONFIG_CPUSETS is not set
 CONFIG_SYSFS_DEPRECATED=y
 # CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE=""
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_SYSCTL=y
@@ -60,12 +63,14 @@ CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_SHMEM=y
-CONFIG_SLAB=y
 CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLUB_DEBUG=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
 CONFIG_RT_MUTEXES=y
 # CONFIG_TINY_SHMEM is not set
 CONFIG_BASE_SMALL=0
-# CONFIG_SLOB is not set
 
 #
 # Loadable module support
@@ -128,6 +133,14 @@ CONFIG_CHECK_STACK=y
 CONFIG_STACK_GUARD=256
 # CONFIG_WARN_STACK is not set
 CONFIG_ARCH_POPULATES_NODE_MAP=y
+
+#
+# Kernel preemption
+#
+# CONFIG_PREEMPT_NONE is not set
+# CONFIG_PREEMPT_VOLUNTARY is not set
+CONFIG_PREEMPT=y
+CONFIG_PREEMPT_BKL=y
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
 # CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -150,7 +163,6 @@ CONFIG_QDIO=y
 #
 # Misc
 #
-CONFIG_PREEMPT=y
 CONFIG_IPL=y
 # CONFIG_IPL_TAPE is not set
 CONFIG_IPL_VM=y
@@ -163,6 +175,11 @@ CONFIG_PFAULT=y
 CONFIG_VIRT_TIMER=y
 CONFIG_VIRT_CPU_ACCOUNTING=y
 # CONFIG_APPLDATA_BASE is not set
+CONFIG_HZ_100=y
+# CONFIG_HZ_250 is not set
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=100
 CONFIG_NO_IDLE_HZ=y
 CONFIG_NO_IDLE_HZ_INIT=y
 CONFIG_S390_HYPFS_FS=y
@@ -177,7 +194,6 @@ CONFIG_NET=y
 #
 # Networking options
 #
-# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
@@ -216,6 +232,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_IPV6=y
 # CONFIG_IPV6_PRIVACY is not set
 # CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
 # CONFIG_INET6_AH is not set
 # CONFIG_INET6_ESP is not set
 # CONFIG_INET6_IPCOMP is not set
@@ -240,7 +257,12 @@ CONFIG_IPV6_SIT=y
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-# CONFIG_IP_SCTP is not set
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
 
 #
 # TIPC Configuration (EXPERIMENTAL)
@@ -263,9 +285,6 @@ CONFIG_IPV6_SIT=y
 #
 CONFIG_NET_SCHED=y
 CONFIG_NET_SCH_FIFO=y
-CONFIG_NET_SCH_CLK_JIFFIES=y
-# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set
-# CONFIG_NET_SCH_CLK_CPU is not set
 
 #
 # Queueing/Scheduling
@@ -308,11 +327,14 @@ CONFIG_NET_ESTIMATOR=y
 #
 # CONFIG_NET_PKTGEN is not set
 # CONFIG_NET_TCPPROBE is not set
-# CONFIG_HAMRADIO is not set
-# CONFIG_IRDA is not set
-# CONFIG_BT is not set
-# CONFIG_IEEE80211 is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_RFKILL is not set
 # CONFIG_PCMCIA is not set
+CONFIG_CCW=y
+
+#
+# Device Drivers
+#
 
 #
 # Generic Driver Options
@@ -329,6 +351,37 @@ CONFIG_SYS_HYPERVISOR=y
 #
 # CONFIG_CONNECTOR is not set
 
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=m
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+CONFIG_BLK_DEV_NBD=m
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# S/390 block device drivers
+#
+CONFIG_BLK_DEV_XPRAM=m
+# CONFIG_DCSSBLK is not set
+CONFIG_DASD=y
+CONFIG_DASD_PROFILE=y
+CONFIG_DASD_ECKD=y
+CONFIG_DASD_FBA=y
+CONFIG_DASD_DIAG=y
+CONFIG_DASD_EER=y
+
+#
+# Misc devices
+#
+# CONFIG_BLINK is not set
+
 #
 # SCSI device support
 #
@@ -356,6 +409,7 @@ CONFIG_SCSI_MULTI_LUN=y
 CONFIG_SCSI_CONSTANTS=y
 CONFIG_SCSI_LOGGING=y
 CONFIG_SCSI_SCAN_ASYNC=y
+CONFIG_SCSI_WAIT_SCAN=m
 
 #
 # SCSI Transports
@@ -372,34 +426,6 @@ CONFIG_SCSI_FC_ATTRS=y
 # CONFIG_ISCSI_TCP is not set
 # CONFIG_SCSI_DEBUG is not set
 CONFIG_ZFCP=y
-CONFIG_CCW=y
-
-#
-# Block devices
-#
-# CONFIG_BLK_DEV_COW_COMMON is not set
-CONFIG_BLK_DEV_LOOP=m
-# CONFIG_BLK_DEV_CRYPTOLOOP is not set
-CONFIG_BLK_DEV_NBD=m
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_COUNT=16
-CONFIG_BLK_DEV_RAM_SIZE=4096
-CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
-CONFIG_BLK_DEV_INITRD=y
-# CONFIG_CDROM_PKTCDVD is not set
-
-#
-# S/390 block device drivers
-#
-CONFIG_BLK_DEV_XPRAM=m
-# CONFIG_DCSSBLK is not set
-CONFIG_DASD=y
-CONFIG_DASD_PROFILE=y
-CONFIG_DASD_ECKD=y
-CONFIG_DASD_FBA=y
-CONFIG_DASD_DIAG=y
-CONFIG_DASD_EER=y
-# CONFIG_ATA_OVER_ETH is not set
 
 #
 # Multi-device support (RAID and LVM)
@@ -421,56 +447,7 @@ CONFIG_DM_MIRROR=y
 CONFIG_DM_ZERO=y
 CONFIG_DM_MULTIPATH=y
 # CONFIG_DM_MULTIPATH_EMC is not set
-
-#
-# Character device drivers
-#
-CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=2048
-# CONFIG_HANGCHECK_TIMER is not set
-
-#
-# Watchdog Cards
-#
-# CONFIG_WATCHDOG is not set
-
-#
-# S/390 character device drivers
-#
-CONFIG_TN3270=y
-CONFIG_TN3270_TTY=y
-CONFIG_TN3270_FS=m
-CONFIG_TN3270_CONSOLE=y
-CONFIG_TN3215=y
-CONFIG_TN3215_CONSOLE=y
-CONFIG_CCW_CONSOLE=y
-CONFIG_SCLP_TTY=y
-CONFIG_SCLP_CONSOLE=y
-CONFIG_SCLP_VT220_TTY=y
-CONFIG_SCLP_VT220_CONSOLE=y
-CONFIG_SCLP_CPI=m
-CONFIG_S390_TAPE=m
-
-#
-# S/390 tape interface support
-#
-CONFIG_S390_TAPE_BLOCK=y
-
-#
-# S/390 tape hardware support
-#
-CONFIG_S390_TAPE_34XX=m
-# CONFIG_S390_TAPE_3590 is not set
-# CONFIG_VMLOGRDR is not set
-# CONFIG_VMCP is not set
-# CONFIG_MONREADER is not set
-CONFIG_MONWRITER=m
-
-#
-# Cryptographic devices
-#
-CONFIG_ZCRYPT=m
-# CONFIG_ZCRYPT_MONOLITHIC is not set
+# CONFIG_DM_DELAY is not set
 
 #
 # Network device support
@@ -481,10 +458,6 @@ CONFIG_BONDING=m
 CONFIG_EQUALIZER=m
 CONFIG_TUN=m
 
-#
-# PHY device support
-#
-
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -498,17 +471,13 @@ CONFIG_NET_ETHERNET=y
 #
 # Ethernet (10000 Mbit)
 #
+CONFIG_MLX4_DEBUG=y
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
 
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
-
 #
 # Wan interfaces
 #
@@ -536,6 +505,56 @@ CONFIG_CCWGROUP=y
 # CONFIG_NETPOLL is not set
 # CONFIG_NET_POLL_CONTROLLER is not set
 
+#
+# Character devices
+#
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+CONFIG_HW_RANDOM=m
+# CONFIG_R3964 is not set
+CONFIG_RAW_DRIVER=m
+CONFIG_MAX_RAW_DEVS=256
+# CONFIG_HANGCHECK_TIMER is not set
+
+#
+# S/390 character device drivers
+#
+CONFIG_TN3270=y
+CONFIG_TN3270_TTY=y
+CONFIG_TN3270_FS=m
+CONFIG_TN3270_CONSOLE=y
+CONFIG_TN3215=y
+CONFIG_TN3215_CONSOLE=y
+CONFIG_CCW_CONSOLE=y
+CONFIG_SCLP=y
+CONFIG_SCLP_TTY=y
+CONFIG_SCLP_CONSOLE=y
+CONFIG_SCLP_VT220_TTY=y
+CONFIG_SCLP_VT220_CONSOLE=y
+CONFIG_SCLP_CPI=m
+CONFIG_S390_TAPE=m
+
+#
+# S/390 tape interface support
+#
+CONFIG_S390_TAPE_BLOCK=y
+
+#
+# S/390 tape hardware support
+#
+CONFIG_S390_TAPE_34XX=m
+# CONFIG_S390_TAPE_3590 is not set
+# CONFIG_VMLOGRDR is not set
+# CONFIG_VMCP is not set
+# CONFIG_MONREADER is not set
+CONFIG_MONWRITER=m
+
 #
 # File systems
 #
@@ -628,6 +647,7 @@ CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=y
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=y
+# CONFIG_SUNRPC_BIND34 is not set
 # CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_RPCSEC_GSS_SPKM3 is not set
 # CONFIG_SMB_FS is not set
@@ -658,6 +678,7 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_SUN_PARTITION is not set
 # CONFIG_KARMA_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
 
 #
 # Native Language Support
@@ -668,8 +689,6 @@ CONFIG_MSDOS_PARTITION=y
 # Distributed Lock Manager
 #
 CONFIG_DLM=m
-CONFIG_DLM_TCP=y
-# CONFIG_DLM_SCTP is not set
 # CONFIG_DLM_DEBUG is not set
 
 #
@@ -693,7 +712,6 @@ CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
 CONFIG_HEADERS_CHECK=y
 CONFIG_DEBUG_KERNEL=y
-CONFIG_LOG_BUF_SHIFT=17
 # CONFIG_SCHEDSTATS is not set
 # CONFIG_TIMER_STATS is not set
 # CONFIG_DEBUG_SLAB is not set
@@ -729,12 +747,13 @@ CONFIG_FORCED_INLINING=y
 CONFIG_CRYPTO=y
 CONFIG_CRYPTO_ALGAPI=y
 CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_HASH=m
 CONFIG_CRYPTO_MANAGER=y
-# CONFIG_CRYPTO_HMAC is not set
+CONFIG_CRYPTO_HMAC=m
 # CONFIG_CRYPTO_XCBC is not set
 # CONFIG_CRYPTO_NULL is not set
 # CONFIG_CRYPTO_MD4 is not set
-# CONFIG_CRYPTO_MD5 is not set
+CONFIG_CRYPTO_MD5=m
 # CONFIG_CRYPTO_SHA1 is not set
 # CONFIG_CRYPTO_SHA256 is not set
 # CONFIG_CRYPTO_SHA512 is not set
@@ -745,6 +764,7 @@ CONFIG_CRYPTO_ECB=m
 CONFIG_CRYPTO_CBC=y
 CONFIG_CRYPTO_PCBC=m
 # CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_CRYPTD is not set
 # CONFIG_CRYPTO_DES is not set
 CONFIG_CRYPTO_FCRYPT=m
 # CONFIG_CRYPTO_BLOWFISH is not set
@@ -771,6 +791,8 @@ CONFIG_CRYPTO_CAMELLIA=m
 # CONFIG_CRYPTO_DES_S390 is not set
 # CONFIG_CRYPTO_AES_S390 is not set
 CONFIG_S390_PRNG=m
+CONFIG_ZCRYPT=m
+# CONFIG_ZCRYPT_MONOLITHIC is not set
 
 #
 # Library routines
index ba5d3167df0db3175fb76525843094ac653582e6..8e1ea1c4012846a8a8d2f31f45f289ceabf39e6f 100644 (file)
@@ -477,7 +477,7 @@ static int __init hypfs_init(void)
                        goto fail_diag;
                }
        }
-       kset_set_kset_s(&s390_subsys, hypervisor_subsys);
+       kobj_set_kset_s(&s390_subsys, hypervisor_subsys);
        rc = subsystem_register(&s390_subsys);
        if (rc)
                goto fail_sysfs;
index 0ea048d350d8a8a2b51e9347823ae88327fab4cc..367caf92ea78afbc9715c9e7f0534424647d3741 100644 (file)
@@ -816,23 +816,23 @@ static int __init ipl_register_fcp_files(void)
 {
        int rc;
 
-       rc = sysfs_create_group(&ipl_subsys.kset.kobj,
+       rc = sysfs_create_group(&ipl_subsys.kobj,
                                &ipl_fcp_attr_group);
        if (rc)
                goto out;
-       rc = sysfs_create_bin_file(&ipl_subsys.kset.kobj,
+       rc = sysfs_create_bin_file(&ipl_subsys.kobj,
                                   &ipl_parameter_attr);
        if (rc)
                goto out_ipl_parm;
-       rc = sysfs_create_bin_file(&ipl_subsys.kset.kobj,
+       rc = sysfs_create_bin_file(&ipl_subsys.kobj,
                                   &ipl_scp_data_attr);
        if (!rc)
                goto out;
 
-       sysfs_remove_bin_file(&ipl_subsys.kset.kobj, &ipl_parameter_attr);
+       sysfs_remove_bin_file(&ipl_subsys.kobj, &ipl_parameter_attr);
 
 out_ipl_parm:
-       sysfs_remove_group(&ipl_subsys.kset.kobj, &ipl_fcp_attr_group);
+       sysfs_remove_group(&ipl_subsys.kobj, &ipl_fcp_attr_group);
 out:
        return rc;
 }
@@ -846,7 +846,7 @@ static int __init ipl_init(void)
                return rc;
        switch (ipl_info.type) {
        case IPL_TYPE_CCW:
-               rc = sysfs_create_group(&ipl_subsys.kset.kobj,
+               rc = sysfs_create_group(&ipl_subsys.kobj,
                                        &ipl_ccw_attr_group);
                break;
        case IPL_TYPE_FCP:
@@ -854,11 +854,11 @@ static int __init ipl_init(void)
                rc = ipl_register_fcp_files();
                break;
        case IPL_TYPE_NSS:
-               rc = sysfs_create_group(&ipl_subsys.kset.kobj,
+               rc = sysfs_create_group(&ipl_subsys.kobj,
                                        &ipl_nss_attr_group);
                break;
        default:
-               rc = sysfs_create_group(&ipl_subsys.kset.kobj,
+               rc = sysfs_create_group(&ipl_subsys.kobj,
                                        &ipl_unknown_attr_group);
                break;
        }
@@ -885,7 +885,7 @@ static int __init reipl_nss_init(void)
 
        if (!MACHINE_IS_VM)
                return 0;
-       rc = sysfs_create_group(&reipl_subsys.kset.kobj, &reipl_nss_attr_group);
+       rc = sysfs_create_group(&reipl_subsys.kobj, &reipl_nss_attr_group);
        if (rc)
                return rc;
        strncpy(reipl_nss_name, kernel_nss_name, NSS_NAME_SIZE + 1);
@@ -900,7 +900,7 @@ static int __init reipl_ccw_init(void)
        reipl_block_ccw = (void *) get_zeroed_page(GFP_KERNEL);
        if (!reipl_block_ccw)
                return -ENOMEM;
-       rc = sysfs_create_group(&reipl_subsys.kset.kobj, &reipl_ccw_attr_group);
+       rc = sysfs_create_group(&reipl_subsys.kobj, &reipl_ccw_attr_group);
        if (rc) {
                free_page((unsigned long)reipl_block_ccw);
                return rc;
@@ -938,7 +938,7 @@ static int __init reipl_fcp_init(void)
        reipl_block_fcp = (void *) get_zeroed_page(GFP_KERNEL);
        if (!reipl_block_fcp)
                return -ENOMEM;
-       rc = sysfs_create_group(&reipl_subsys.kset.kobj, &reipl_fcp_attr_group);
+       rc = sysfs_create_group(&reipl_subsys.kobj, &reipl_fcp_attr_group);
        if (rc) {
                free_page((unsigned long)reipl_block_fcp);
                return rc;
@@ -990,7 +990,7 @@ static int __init dump_ccw_init(void)
        dump_block_ccw = (void *) get_zeroed_page(GFP_KERNEL);
        if (!dump_block_ccw)
                return -ENOMEM;
-       rc = sysfs_create_group(&dump_subsys.kset.kobj, &dump_ccw_attr_group);
+       rc = sysfs_create_group(&dump_subsys.kobj, &dump_ccw_attr_group);
        if (rc) {
                free_page((unsigned long)dump_block_ccw);
                return rc;
@@ -1014,7 +1014,7 @@ static int __init dump_fcp_init(void)
        dump_block_fcp = (void *) get_zeroed_page(GFP_KERNEL);
        if (!dump_block_fcp)
                return -ENOMEM;
-       rc = sysfs_create_group(&dump_subsys.kset.kobj, &dump_fcp_attr_group);
+       rc = sysfs_create_group(&dump_subsys.kobj, &dump_fcp_attr_group);
        if (rc) {
                free_page((unsigned long)dump_block_fcp);
                return rc;
index 8b924b359774a40abb9042c2737b5ac9f6c637a2..d855cdbf8fb86b6b96d6e89b0090c95fc243a06c 100644 (file)
@@ -253,7 +253,10 @@ static int signal_return(struct mm_struct *mm, struct pt_regs *regs,
                         unsigned long address, unsigned long error_code)
 {
        u16 instruction;
-       int rc, compat;
+       int rc;
+#ifdef CONFIG_COMPAT
+       int compat;
+#endif
 
        pagefault_disable();
        rc = __get_user(instruction, (u16 __user *) regs->psw.addr);
index d85e1ed7c3e438d3425ab96d103c3f427ca4a38a..cf9a75112d0fa9bdb9e00d09fa9c454ee7e8e17b 100644 (file)
@@ -377,7 +377,7 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
        const char *type;
        u32 class;
 
-       dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL);
+       dev = alloc_pci_dev();
        if (!dev)
                return NULL;
 
index 76faaa8135dd957b0e28ad53499cc47d766babb7..f974fefc3ebc273ceea972b6a936d21888326017 100644 (file)
 #include <asm/oplib.h>
 
 #include "pci_impl.h"
+#include "pci_sun4v.h"
+
+static int config_out_of_range(struct pci_pbm_info *pbm,
+                              unsigned long bus,
+                              unsigned long devfn,
+                              unsigned long reg)
+{
+       if (bus < pbm->pci_first_busno ||
+           bus > pbm->pci_last_busno)
+               return 1;
+       return 0;
+}
+
+static void *sun4u_config_mkaddr(struct pci_pbm_info *pbm,
+                                unsigned long bus,
+                                unsigned long devfn,
+                                unsigned long reg)
+{
+       unsigned long rbits = pbm->config_space_reg_bits;
+
+       if (config_out_of_range(pbm, bus, devfn, reg))
+               return NULL;
+
+       reg = (reg & ((1 << rbits) - 1));
+       devfn <<= rbits;
+       bus <<= rbits + 8;
+
+       return (void *) (pbm->config_space | bus | devfn | reg);
+}
+
+static int sun4u_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
+                             int where, int size, u32 *value)
+{
+       struct pci_pbm_info *pbm = bus_dev->sysdata;
+       unsigned char bus = bus_dev->number;
+       u32 *addr;
+       u16 tmp16;
+       u8 tmp8;
+
+       if (bus_dev == pbm->pci_bus && devfn == 0x00)
+               return pci_host_bridge_read_pci_cfg(bus_dev, devfn, where,
+                                                   size, value);
+
+       switch (size) {
+       case 1:
+               *value = 0xff;
+               break;
+       case 2:
+               *value = 0xffff;
+               break;
+       case 4:
+               *value = 0xffffffff;
+               break;
+       }
+
+       addr = sun4u_config_mkaddr(pbm, bus, devfn, where);
+       if (!addr)
+               return PCIBIOS_SUCCESSFUL;
+
+       switch (size) {
+       case 1:
+               pci_config_read8((u8 *)addr, &tmp8);
+               *value = (u32) tmp8;
+               break;
+
+       case 2:
+               if (where & 0x01) {
+                       printk("pci_read_config_word: misaligned reg [%x]\n",
+                              where);
+                       return PCIBIOS_SUCCESSFUL;
+               }
+               pci_config_read16((u16 *)addr, &tmp16);
+               *value = (u32) tmp16;
+               break;
+
+       case 4:
+               if (where & 0x03) {
+                       printk("pci_read_config_dword: misaligned reg [%x]\n",
+                              where);
+                       return PCIBIOS_SUCCESSFUL;
+               }
+               pci_config_read32(addr, value);
+               break;
+       }
+       return PCIBIOS_SUCCESSFUL;
+}
+
+static int sun4u_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
+                              int where, int size, u32 value)
+{
+       struct pci_pbm_info *pbm = bus_dev->sysdata;
+       unsigned char bus = bus_dev->number;
+       u32 *addr;
+
+       if (bus_dev == pbm->pci_bus && devfn == 0x00)
+               return pci_host_bridge_write_pci_cfg(bus_dev, devfn, where,
+                                                    size, value);
+       addr = sun4u_config_mkaddr(pbm, bus, devfn, where);
+       if (!addr)
+               return PCIBIOS_SUCCESSFUL;
+
+       switch (size) {
+       case 1:
+               pci_config_write8((u8 *)addr, value);
+               break;
+
+       case 2:
+               if (where & 0x01) {
+                       printk("pci_write_config_word: misaligned reg [%x]\n",
+                              where);
+                       return PCIBIOS_SUCCESSFUL;
+               }
+               pci_config_write16((u16 *)addr, value);
+               break;
+
+       case 4:
+               if (where & 0x03) {
+                       printk("pci_write_config_dword: misaligned reg [%x]\n",
+                              where);
+                       return PCIBIOS_SUCCESSFUL;
+               }
+               pci_config_write32(addr, value);
+       }
+       return PCIBIOS_SUCCESSFUL;
+}
+
+struct pci_ops sun4u_pci_ops = {
+       .read =         sun4u_read_pci_cfg,
+       .write =        sun4u_write_pci_cfg,
+};
+
+static int sun4v_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
+                             int where, int size, u32 *value)
+{
+       struct pci_pbm_info *pbm = bus_dev->sysdata;
+       u32 devhandle = pbm->devhandle;
+       unsigned int bus = bus_dev->number;
+       unsigned int device = PCI_SLOT(devfn);
+       unsigned int func = PCI_FUNC(devfn);
+       unsigned long ret;
+
+       if (bus_dev == pbm->pci_bus && devfn == 0x00)
+               return pci_host_bridge_read_pci_cfg(bus_dev, devfn, where,
+                                                   size, value);
+       if (config_out_of_range(pbm, bus, devfn, where)) {
+               ret = ~0UL;
+       } else {
+               ret = pci_sun4v_config_get(devhandle,
+                               HV_PCI_DEVICE_BUILD(bus, device, func),
+                               where, size);
+       }
+       switch (size) {
+       case 1:
+               *value = ret & 0xff;
+               break;
+       case 2:
+               *value = ret & 0xffff;
+               break;
+       case 4:
+               *value = ret & 0xffffffff;
+               break;
+       };
+
+
+       return PCIBIOS_SUCCESSFUL;
+}
+
+static int sun4v_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
+                              int where, int size, u32 value)
+{
+       struct pci_pbm_info *pbm = bus_dev->sysdata;
+       u32 devhandle = pbm->devhandle;
+       unsigned int bus = bus_dev->number;
+       unsigned int device = PCI_SLOT(devfn);
+       unsigned int func = PCI_FUNC(devfn);
+       unsigned long ret;
+
+       if (bus_dev == pbm->pci_bus && devfn == 0x00)
+               return pci_host_bridge_write_pci_cfg(bus_dev, devfn, where,
+                                                    size, value);
+       if (config_out_of_range(pbm, bus, devfn, where)) {
+               /* Do nothing. */
+       } else {
+               ret = pci_sun4v_config_put(devhandle,
+                               HV_PCI_DEVICE_BUILD(bus, device, func),
+                               where, size, value);
+       }
+       return PCIBIOS_SUCCESSFUL;
+}
+
+struct pci_ops sun4v_pci_ops = {
+       .read =         sun4v_read_pci_cfg,
+       .write =        sun4v_write_pci_cfg,
+};
 
 void pci_get_pbm_props(struct pci_pbm_info *pbm)
 {
index 2e0eb4ee8f71a67176d370bfc8d19366d8aec1ad..9198c1a0f7a5df0f9a2cd4bc12b23947080675ff 100644 (file)
                               "i" (ASI_PHYS_BYPASS_EC_E) \
                             : "memory")
 
-/* Fire config space address format is nearly identical to
- * that of SCHIZO and PSYCHO, except that in order to accomodate
- * PCI-E extended config space the encoding can handle 12 bits
- * of register address:
- *
- *  32     28 27 20 19    15 14      12 11  2  1 0
- * -------------------------------------------------
- * |0 0 0 0 0| bus | device | function | reg | 0 0 |
- * -------------------------------------------------
- */
-#define FIRE_CONFIG_BASE(PBM)  ((PBM)->config_space)
-#define FIRE_CONFIG_ENCODE(BUS, DEVFN, REG)    \
-       (((unsigned long)(BUS)   << 20) |       \
-        ((unsigned long)(DEVFN) << 12)  |      \
-        ((unsigned long)(REG)))
-
-static void *fire_pci_config_mkaddr(struct pci_pbm_info *pbm,
-                                     unsigned char bus,
-                                     unsigned int devfn,
-                                     int where)
-{
-       if (!pbm)
-               return NULL;
-       return (void *)
-               (FIRE_CONFIG_BASE(pbm) |
-                FIRE_CONFIG_ENCODE(bus, devfn, where));
-}
-
-/* FIRE PCI configuration space accessors. */
-
-static int fire_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
-                            int where, int size, u32 *value)
-{
-       struct pci_pbm_info *pbm = bus_dev->sysdata;
-       unsigned char bus = bus_dev->number;
-       u32 *addr;
-       u16 tmp16;
-       u8 tmp8;
-
-       if (bus_dev == pbm->pci_bus && devfn == 0x00)
-               return pci_host_bridge_read_pci_cfg(bus_dev, devfn, where,
-                                                   size, value);
-       switch (size) {
-       case 1:
-               *value = 0xff;
-               break;
-       case 2:
-               *value = 0xffff;
-               break;
-       case 4:
-               *value = 0xffffffff;
-               break;
-       }
-
-       addr = fire_pci_config_mkaddr(pbm, bus, devfn, where);
-       if (!addr)
-               return PCIBIOS_SUCCESSFUL;
-
-       switch (size) {
-       case 1:
-               pci_config_read8((u8 *)addr, &tmp8);
-               *value = tmp8;
-               break;
-
-       case 2:
-               if (where & 0x01) {
-                       printk("pci_read_config_word: misaligned reg [%x]\n",
-                              where);
-                       return PCIBIOS_SUCCESSFUL;
-               }
-               pci_config_read16((u16 *)addr, &tmp16);
-               *value = tmp16;
-               break;
-
-       case 4:
-               if (where & 0x03) {
-                       printk("pci_read_config_dword: misaligned reg [%x]\n",
-                              where);
-                       return PCIBIOS_SUCCESSFUL;
-               }
-
-               pci_config_read32(addr, value);
-               break;
-       }
-       return PCIBIOS_SUCCESSFUL;
-}
-
-static int fire_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
-                             int where, int size, u32 value)
-{
-       struct pci_pbm_info *pbm = bus_dev->sysdata;
-       unsigned char bus = bus_dev->number;
-       u32 *addr;
-
-       if (bus_dev == pbm->pci_bus && devfn == 0x00)
-               return pci_host_bridge_write_pci_cfg(bus_dev, devfn, where,
-                                                    size, value);
-       addr = fire_pci_config_mkaddr(pbm, bus, devfn, where);
-       if (!addr)
-               return PCIBIOS_SUCCESSFUL;
-
-       switch (size) {
-       case 1:
-               pci_config_write8((u8 *)addr, value);
-               break;
-
-       case 2:
-               if (where & 0x01) {
-                       printk("pci_write_config_word: misaligned reg [%x]\n",
-                              where);
-                       return PCIBIOS_SUCCESSFUL;
-               }
-               pci_config_write16((u16 *)addr, value);
-               break;
-
-       case 4:
-               if (where & 0x03) {
-                       printk("pci_write_config_dword: misaligned reg [%x]\n",
-                              where);
-                       return PCIBIOS_SUCCESSFUL;
-               }
-
-               pci_config_write32(addr, value);
-       }
-       return PCIBIOS_SUCCESSFUL;
-}
-
-static struct pci_ops pci_fire_ops = {
-       .read   =       fire_read_pci_cfg,
-       .write  =       fire_write_pci_cfg,
-};
-
 static void pci_fire_scan_bus(struct pci_pbm_info *pbm)
 {
        pbm->pci_bus = pci_scan_one_pbm(pbm);
@@ -314,7 +182,8 @@ static void pci_fire_pbm_init(struct pci_controller_info *p,
        pci_pbm_root = pbm;
 
        pbm->scan_bus = pci_fire_scan_bus;
-       pbm->pci_ops = &pci_fire_ops;
+       pbm->pci_ops = &sun4u_pci_ops;
+       pbm->config_space_reg_bits = 12;
 
        pbm->index = pci_num_pbms++;
 
index 8e38023868aafd81a509c07194b76b84ccbee70b..f660c2b685ebfe6c8682dff6facfe8f8acaf9e8f 100644 (file)
@@ -77,6 +77,9 @@ struct pci_pbm_info {
        /* Base of PCI Config space, can be per-PBM or shared. */
        unsigned long                   config_space;
 
+       /* This will be 12 on PCI-E controllers, 8 elsewhere.  */
+       unsigned long                   config_space_reg_bits;
+
        /* State of 66MHz capabilities on this PBM. */
        int                             is_66mhz_capable;
        int                             all_devs_66mhz;
@@ -156,4 +159,7 @@ extern void pci_config_write8(u8 *addr, u8 val);
 extern void pci_config_write16(u16 *addr, u16 val);
 extern void pci_config_write32(u32 *addr, u32 val);
 
+extern struct pci_ops sun4u_pci_ops;
+extern struct pci_ops sun4v_pci_ops;
+
 #endif /* !(PCI_IMPL_H) */
index 2edcb1dd13c3744674c6e96cba7f39e1be12a477..598393a2df168d1e92910cc9bc2a6866bb933013 100644 (file)
@@ -94,122 +94,6 @@ static void *psycho_pci_config_mkaddr(struct pci_pbm_info *pbm,
                 PSYCHO_CONFIG_ENCODE(bus, devfn, where));
 }
 
-static int psycho_out_of_range(struct pci_pbm_info *pbm,
-                              unsigned char bus,
-                              unsigned char devfn)
-{
-       return ((bus == pbm->pci_first_busno) &&
-               PCI_SLOT(devfn) > 8);
-}
-
-/* PSYCHO PCI configuration space accessors. */
-
-static int psycho_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
-                              int where, int size, u32 *value)
-{
-       struct pci_pbm_info *pbm = bus_dev->sysdata;
-       unsigned char bus = bus_dev->number;
-       u32 *addr;
-       u16 tmp16;
-       u8 tmp8;
-
-       if (bus_dev == pbm->pci_bus && devfn == 0x00)
-               return pci_host_bridge_read_pci_cfg(bus_dev, devfn, where,
-                                                   size, value);
-
-       switch (size) {
-       case 1:
-               *value = 0xff;
-               break;
-       case 2:
-               *value = 0xffff;
-               break;
-       case 4:
-               *value = 0xffffffff;
-               break;
-       }
-
-       addr = psycho_pci_config_mkaddr(pbm, bus, devfn, where);
-       if (!addr)
-               return PCIBIOS_SUCCESSFUL;
-
-       if (psycho_out_of_range(pbm, bus, devfn))
-               return PCIBIOS_SUCCESSFUL;
-       switch (size) {
-       case 1:
-               pci_config_read8((u8 *)addr, &tmp8);
-               *value = (u32) tmp8;
-               break;
-
-       case 2:
-               if (where & 0x01) {
-                       printk("pci_read_config_word: misaligned reg [%x]\n",
-                              where);
-                       return PCIBIOS_SUCCESSFUL;
-               }
-               pci_config_read16((u16 *)addr, &tmp16);
-               *value = (u32) tmp16;
-               break;
-
-       case 4:
-               if (where & 0x03) {
-                       printk("pci_read_config_dword: misaligned reg [%x]\n",
-                              where);
-                       return PCIBIOS_SUCCESSFUL;
-               }
-               pci_config_read32(addr, value);
-               break;
-       }
-       return PCIBIOS_SUCCESSFUL;
-}
-
-static int psycho_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
-                               int where, int size, u32 value)
-{
-       struct pci_pbm_info *pbm = bus_dev->sysdata;
-       unsigned char bus = bus_dev->number;
-       u32 *addr;
-
-       if (bus_dev == pbm->pci_bus && devfn == 0x00)
-               return pci_host_bridge_write_pci_cfg(bus_dev, devfn, where,
-                                                    size, value);
-       addr = psycho_pci_config_mkaddr(pbm, bus, devfn, where);
-       if (!addr)
-               return PCIBIOS_SUCCESSFUL;
-
-       if (psycho_out_of_range(pbm, bus, devfn))
-               return PCIBIOS_SUCCESSFUL;
-
-       switch (size) {
-       case 1:
-               pci_config_write8((u8 *)addr, value);
-               break;
-
-       case 2:
-               if (where & 0x01) {
-                       printk("pci_write_config_word: misaligned reg [%x]\n",
-                              where);
-                       return PCIBIOS_SUCCESSFUL;
-               }
-               pci_config_write16((u16 *)addr, value);
-               break;
-
-       case 4:
-               if (where & 0x03) {
-                       printk("pci_write_config_dword: misaligned reg [%x]\n",
-                              where);
-                       return PCIBIOS_SUCCESSFUL;
-               }
-               pci_config_write32(addr, value);
-       }
-       return PCIBIOS_SUCCESSFUL;
-}
-
-static struct pci_ops psycho_ops = {
-       .read =         psycho_read_pci_cfg,
-       .write =        psycho_write_pci_cfg,
-};
-
 /* PSYCHO error handling support. */
 enum psycho_error_type {
        UE_ERR, CE_ERR, PCI_ERR
@@ -1089,7 +973,8 @@ static void psycho_pbm_init(struct pci_controller_info *p,
        pci_pbm_root = pbm;
 
        pbm->scan_bus = psycho_scan_bus;
-       pbm->pci_ops = &psycho_ops;
+       pbm->pci_ops = &sun4u_pci_ops;
+       pbm->config_space_reg_bits = 8;
 
        pbm->index = pci_num_pbms++;
 
index 4cefe6e83b24cfc02783a21b5dc0a80c4721f558..e2377796de894e6f08164cfca6f4870f4192eb36 100644 (file)
 #define SABRE_MEMSPACE         0x100000000UL
 #define SABRE_MEMSPACE_SIZE    0x07fffffffUL
 
-/* UltraSparc-IIi Programmer's Manual, page 325, PCI
- * configuration space address format:
- * 
- *  32             24 23 16 15    11 10       8 7   2  1 0
- * ---------------------------------------------------------
- * |0 0 0 0 0 0 0 0 1| bus | device | function | reg | 0 0 |
- * ---------------------------------------------------------
- */
-#define SABRE_CONFIG_BASE(PBM) \
-       ((PBM)->config_space | (1UL << 24))
-#define SABRE_CONFIG_ENCODE(BUS, DEVFN, REG)   \
-       (((unsigned long)(BUS)   << 16) |       \
-        ((unsigned long)(DEVFN) << 8)  |       \
-        ((unsigned long)(REG)))
-
 static int hummingbird_p;
 static struct pci_bus *sabre_root_bus;
 
-static void *sabre_pci_config_mkaddr(struct pci_pbm_info *pbm,
-                                    unsigned char bus,
-                                    unsigned int devfn,
-                                    int where)
-{
-       if (!pbm)
-               return NULL;
-       return (void *)
-               (SABRE_CONFIG_BASE(pbm) |
-                SABRE_CONFIG_ENCODE(bus, devfn, where));
-}
-
-static int sabre_out_of_range(unsigned char devfn)
-{
-       if (hummingbird_p)
-               return 0;
-
-       return (((PCI_SLOT(devfn) == 0) && (PCI_FUNC(devfn) > 0)) ||
-               ((PCI_SLOT(devfn) == 1) && (PCI_FUNC(devfn) > 1)) ||
-               (PCI_SLOT(devfn) > 1));
-}
-
-static int __sabre_out_of_range(struct pci_pbm_info *pbm,
-                               unsigned char bus,
-                               unsigned char devfn)
-{
-       if (hummingbird_p)
-               return 0;
-
-       return ((pbm->parent == 0) ||
-               ((pbm == &pbm->parent->pbm_A) &&
-                (bus == pbm->pci_first_busno) &&
-                PCI_SLOT(devfn) > 8));
-}
-
-static int __sabre_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
-                               int where, int size, u32 *value)
-{
-       struct pci_pbm_info *pbm = bus_dev->sysdata;
-       unsigned char bus = bus_dev->number;
-       u32 *addr;
-       u16 tmp16;
-       u8 tmp8;
-
-       switch (size) {
-       case 1:
-               *value = 0xff;
-               break;
-       case 2:
-               *value = 0xffff;
-               break;
-       case 4:
-               *value = 0xffffffff;
-               break;
-       }
-
-       addr = sabre_pci_config_mkaddr(pbm, bus, devfn, where);
-       if (!addr)
-               return PCIBIOS_SUCCESSFUL;
-
-       if (__sabre_out_of_range(pbm, bus, devfn))
-               return PCIBIOS_SUCCESSFUL;
-
-       switch (size) {
-       case 1:
-               pci_config_read8((u8 *) addr, &tmp8);
-               *value = tmp8;
-               break;
-
-       case 2:
-               if (where & 0x01) {
-                       printk("pci_read_config_word: misaligned reg [%x]\n",
-                              where);
-                       return PCIBIOS_SUCCESSFUL;
-               }
-               pci_config_read16((u16 *) addr, &tmp16);
-               *value = tmp16;
-               break;
-
-       case 4:
-               if (where & 0x03) {
-                       printk("pci_read_config_dword: misaligned reg [%x]\n",
-                              where);
-                       return PCIBIOS_SUCCESSFUL;
-               }
-               pci_config_read32(addr, value);
-               break;
-       }
-
-       return PCIBIOS_SUCCESSFUL;
-}
-
-static int sabre_read_pci_cfg(struct pci_bus *bus, unsigned int devfn,
-                             int where, int size, u32 *value)
-{
-       struct pci_pbm_info *pbm = bus->sysdata;
-
-       if (bus == pbm->pci_bus && devfn == 0x00)
-               return pci_host_bridge_read_pci_cfg(bus, devfn, where,
-                                                   size, value);
-
-       if (!bus->number && sabre_out_of_range(devfn)) {
-               switch (size) {
-               case 1:
-                       *value = 0xff;
-                       break;
-               case 2:
-                       *value = 0xffff;
-                       break;
-               case 4:
-                       *value = 0xffffffff;
-                       break;
-               }
-               return PCIBIOS_SUCCESSFUL;
-       }
-
-       if (bus->number || PCI_SLOT(devfn))
-               return __sabre_read_pci_cfg(bus, devfn, where, size, value);
-
-       /* When accessing PCI config space of the PCI controller itself (bus
-        * 0, device slot 0, function 0) there are restrictions.  Each
-        * register must be accessed as it's natural size.  Thus, for example
-        * the Vendor ID must be accessed as a 16-bit quantity.
-        */
-
-       switch (size) {
-       case 1:
-               if (where < 8) {
-                       u32 tmp32;
-                       u16 tmp16;
-
-                       __sabre_read_pci_cfg(bus, devfn, where & ~1, 2, &tmp32);
-                       tmp16 = (u16) tmp32;
-                       if (where & 1)
-                               *value = tmp16 >> 8;
-                       else
-                               *value = tmp16 & 0xff;
-               } else
-                       return __sabre_read_pci_cfg(bus, devfn, where, 1, value);
-               break;
-
-       case 2:
-               if (where < 8)
-                       return __sabre_read_pci_cfg(bus, devfn, where, 2, value);
-               else {
-                       u32 tmp32;
-                       u8 tmp8;
-
-                       __sabre_read_pci_cfg(bus, devfn, where, 1, &tmp32);
-                       tmp8 = (u8) tmp32;
-                       *value = tmp8;
-                       __sabre_read_pci_cfg(bus, devfn, where + 1, 1, &tmp32);
-                       tmp8 = (u8) tmp32;
-                       *value |= tmp8 << 8;
-               }
-               break;
-
-       case 4: {
-               u32 tmp32;
-               u16 tmp16;
-
-               sabre_read_pci_cfg(bus, devfn, where, 2, &tmp32);
-               tmp16 = (u16) tmp32;
-               *value = tmp16;
-               sabre_read_pci_cfg(bus, devfn, where + 2, 2, &tmp32);
-               tmp16 = (u16) tmp32;
-               *value |= tmp16 << 16;
-               break;
-       }
-       }
-       return PCIBIOS_SUCCESSFUL;
-}
-
-static int __sabre_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
-                                int where, int size, u32 value)
-{
-       struct pci_pbm_info *pbm = bus_dev->sysdata;
-       unsigned char bus = bus_dev->number;
-       u32 *addr;
-
-       addr = sabre_pci_config_mkaddr(pbm, bus, devfn, where);
-       if (!addr)
-               return PCIBIOS_SUCCESSFUL;
-
-       if (__sabre_out_of_range(pbm, bus, devfn))
-               return PCIBIOS_SUCCESSFUL;
-
-       switch (size) {
-       case 1:
-               pci_config_write8((u8 *) addr, value);
-               break;
-
-       case 2:
-               if (where & 0x01) {
-                       printk("pci_write_config_word: misaligned reg [%x]\n",
-                              where);
-                       return PCIBIOS_SUCCESSFUL;
-               }
-               pci_config_write16((u16 *) addr, value);
-               break;
-
-       case 4:
-               if (where & 0x03) {
-                       printk("pci_write_config_dword: misaligned reg [%x]\n",
-                              where);
-                       return PCIBIOS_SUCCESSFUL;
-               }
-               pci_config_write32(addr, value);
-               break;
-       }
-
-       return PCIBIOS_SUCCESSFUL;
-}
-
-static int sabre_write_pci_cfg(struct pci_bus *bus, unsigned int devfn,
-                              int where, int size, u32 value)
-{
-       struct pci_pbm_info *pbm = bus->sysdata;
-
-       if (bus == pbm->pci_bus && devfn == 0x00)
-               return pci_host_bridge_write_pci_cfg(bus, devfn, where,
-                                                    size, value);
-
-       if (bus->number)
-               return __sabre_write_pci_cfg(bus, devfn, where, size, value);
-
-       if (sabre_out_of_range(devfn))
-               return PCIBIOS_SUCCESSFUL;
-
-       switch (size) {
-       case 1:
-               if (where < 8) {
-                       u32 tmp32;
-                       u16 tmp16;
-
-                       __sabre_read_pci_cfg(bus, devfn, where & ~1, 2, &tmp32);
-                       tmp16 = (u16) tmp32;
-                       if (where & 1) {
-                               value &= 0x00ff;
-                               value |= tmp16 << 8;
-                       } else {
-                               value &= 0xff00;
-                               value |= tmp16;
-                       }
-                       tmp32 = (u32) tmp16;
-                       return __sabre_write_pci_cfg(bus, devfn, where & ~1, 2, tmp32);
-               } else
-                       return __sabre_write_pci_cfg(bus, devfn, where, 1, value);
-               break;
-       case 2:
-               if (where < 8)
-                       return __sabre_write_pci_cfg(bus, devfn, where, 2, value);
-               else {
-                       __sabre_write_pci_cfg(bus, devfn, where, 1, value & 0xff);
-                       __sabre_write_pci_cfg(bus, devfn, where + 1, 1, value >> 8);
-               }
-               break;
-       case 4:
-               sabre_write_pci_cfg(bus, devfn, where, 2, value & 0xffff);
-               sabre_write_pci_cfg(bus, devfn, where + 2, 2, value >> 16);
-               break;
-       }
-       return PCIBIOS_SUCCESSFUL;
-}
-
-static struct pci_ops sabre_ops = {
-       .read =         sabre_read_pci_cfg,
-       .write =        sabre_write_pci_cfg,
-};
-
 /* SABRE error handling support. */
 static void sabre_check_iommu_error(struct pci_pbm_info *pbm,
                                    unsigned long afsr,
@@ -1010,7 +725,8 @@ static void sabre_pbm_init(struct pci_controller_info *p, struct pci_pbm_info *p
        printk("%s: SABRE PCI Bus Module\n", pbm->name);
 
        pbm->scan_bus = sabre_scan_bus;
-       pbm->pci_ops = &sabre_ops;
+       pbm->pci_ops = &sun4u_pci_ops;
+       pbm->config_space_reg_bits = 8;
 
        pbm->index = pci_num_pbms++;
 
index e375d72b8eed0acf1ab8b46a7038008325512c33..ae76898bbe2b0fcfa239669f31a794eb56191935 100644 (file)
@@ -104,125 +104,6 @@ static void *schizo_pci_config_mkaddr(struct pci_pbm_info *pbm,
                 SCHIZO_CONFIG_ENCODE(bus, devfn, where));
 }
 
-/* Just make sure the bus number is in range.  */
-static int schizo_out_of_range(struct pci_pbm_info *pbm,
-                              unsigned char bus,
-                              unsigned char devfn)
-{
-       if (bus < pbm->pci_first_busno ||
-           bus > pbm->pci_last_busno)
-               return 1;
-       return 0;
-}
-
-/* SCHIZO PCI configuration space accessors. */
-
-static int schizo_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
-                              int where, int size, u32 *value)
-{
-       struct pci_pbm_info *pbm = bus_dev->sysdata;
-       unsigned char bus = bus_dev->number;
-       u32 *addr;
-       u16 tmp16;
-       u8 tmp8;
-
-       if (bus_dev == pbm->pci_bus && devfn == 0x00)
-               return pci_host_bridge_read_pci_cfg(bus_dev, devfn, where,
-                                                   size, value);
-       switch (size) {
-       case 1:
-               *value = 0xff;
-               break;
-       case 2:
-               *value = 0xffff;
-               break;
-       case 4:
-               *value = 0xffffffff;
-               break;
-       }
-
-       addr = schizo_pci_config_mkaddr(pbm, bus, devfn, where);
-       if (!addr)
-               return PCIBIOS_SUCCESSFUL;
-
-       if (schizo_out_of_range(pbm, bus, devfn))
-               return PCIBIOS_SUCCESSFUL;
-       switch (size) {
-       case 1:
-               pci_config_read8((u8 *)addr, &tmp8);
-               *value = tmp8;
-               break;
-
-       case 2:
-               if (where & 0x01) {
-                       printk("pci_read_config_word: misaligned reg [%x]\n",
-                              where);
-                       return PCIBIOS_SUCCESSFUL;
-               }
-               pci_config_read16((u16 *)addr, &tmp16);
-               *value = tmp16;
-               break;
-
-       case 4:
-               if (where & 0x03) {
-                       printk("pci_read_config_dword: misaligned reg [%x]\n",
-                              where);
-                       return PCIBIOS_SUCCESSFUL;
-               }
-               pci_config_read32(addr, value);
-               break;
-       }
-       return PCIBIOS_SUCCESSFUL;
-}
-
-static int schizo_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
-                               int where, int size, u32 value)
-{
-       struct pci_pbm_info *pbm = bus_dev->sysdata;
-       unsigned char bus = bus_dev->number;
-       u32 *addr;
-
-       if (bus_dev == pbm->pci_bus && devfn == 0x00)
-               return pci_host_bridge_write_pci_cfg(bus_dev, devfn, where,
-                                                    size, value);
-       addr = schizo_pci_config_mkaddr(pbm, bus, devfn, where);
-       if (!addr)
-               return PCIBIOS_SUCCESSFUL;
-
-       if (schizo_out_of_range(pbm, bus, devfn))
-               return PCIBIOS_SUCCESSFUL;
-
-       switch (size) {
-       case 1:
-               pci_config_write8((u8 *)addr, value);
-               break;
-
-       case 2:
-               if (where & 0x01) {
-                       printk("pci_write_config_word: misaligned reg [%x]\n",
-                              where);
-                       return PCIBIOS_SUCCESSFUL;
-               }
-               pci_config_write16((u16 *)addr, value);
-               break;
-
-       case 4:
-               if (where & 0x03) {
-                       printk("pci_write_config_dword: misaligned reg [%x]\n",
-                              where);
-                       return PCIBIOS_SUCCESSFUL;
-               }
-
-               pci_config_write32(addr, value);
-       }
-       return PCIBIOS_SUCCESSFUL;
-}
-
-static struct pci_ops schizo_ops = {
-       .read =         schizo_read_pci_cfg,
-       .write =        schizo_write_pci_cfg,
-};
-
 /* SCHIZO error handling support. */
 enum schizo_error_type {
        UE_ERR, CE_ERR, PCI_ERR, SAFARI_ERR
@@ -1494,7 +1375,8 @@ static void schizo_pbm_init(struct pci_controller_info *p,
        pci_pbm_root = pbm;
 
        pbm->scan_bus = schizo_scan_bus;
-       pbm->pci_ops = &schizo_ops;
+       pbm->pci_ops = &sun4u_pci_ops;
+       pbm->config_space_reg_bits = 8;
 
        pbm->index = pci_num_pbms++;
 
index 0c76a8891a96b270bd8e5ff279134333fbf70823..34df4047587a4db2c95506410e5e2edd96b35837 100644 (file)
@@ -593,89 +593,6 @@ const struct pci_iommu_ops pci_sun4v_iommu_ops = {
        .dma_sync_sg_for_cpu            = pci_4v_dma_sync_sg_for_cpu,
 };
 
-static inline int pci_sun4v_out_of_range(struct pci_pbm_info *pbm, unsigned int bus, unsigned int device, unsigned int func)
-{
-       if (bus < pbm->pci_first_busno ||
-           bus > pbm->pci_last_busno)
-               return 1;
-       return 0;
-}
-
-static int pci_sun4v_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
-                                 int where, int size, u32 *value)
-{
-       struct pci_pbm_info *pbm = bus_dev->sysdata;
-       u32 devhandle = pbm->devhandle;
-       unsigned int bus = bus_dev->number;
-       unsigned int device = PCI_SLOT(devfn);
-       unsigned int func = PCI_FUNC(devfn);
-       unsigned long ret;
-
-       if (bus_dev == pbm->pci_bus && devfn == 0x00)
-               return pci_host_bridge_read_pci_cfg(bus_dev, devfn, where,
-                                                   size, value);
-       if (pci_sun4v_out_of_range(pbm, bus, device, func)) {
-               ret = ~0UL;
-       } else {
-               ret = pci_sun4v_config_get(devhandle,
-                               HV_PCI_DEVICE_BUILD(bus, device, func),
-                               where, size);
-#if 0
-               printk("rcfg: [%x:%x:%x:%d]=[%lx]\n",
-                      devhandle, HV_PCI_DEVICE_BUILD(bus, device, func),
-                      where, size, ret);
-#endif
-       }
-       switch (size) {
-       case 1:
-               *value = ret & 0xff;
-               break;
-       case 2:
-               *value = ret & 0xffff;
-               break;
-       case 4:
-               *value = ret & 0xffffffff;
-               break;
-       };
-
-
-       return PCIBIOS_SUCCESSFUL;
-}
-
-static int pci_sun4v_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
-                                  int where, int size, u32 value)
-{
-       struct pci_pbm_info *pbm = bus_dev->sysdata;
-       u32 devhandle = pbm->devhandle;
-       unsigned int bus = bus_dev->number;
-       unsigned int device = PCI_SLOT(devfn);
-       unsigned int func = PCI_FUNC(devfn);
-       unsigned long ret;
-
-       if (bus_dev == pbm->pci_bus && devfn == 0x00)
-               return pci_host_bridge_write_pci_cfg(bus_dev, devfn, where,
-                                                    size, value);
-       if (pci_sun4v_out_of_range(pbm, bus, device, func)) {
-               /* Do nothing. */
-       } else {
-               ret = pci_sun4v_config_put(devhandle,
-                               HV_PCI_DEVICE_BUILD(bus, device, func),
-                               where, size, value);
-#if 0
-               printk("wcfg: [%x:%x:%x:%d] v[%x] == [%lx]\n",
-                      devhandle, HV_PCI_DEVICE_BUILD(bus, device, func),
-                      where, size, value, ret);
-#endif
-       }
-       return PCIBIOS_SUCCESSFUL;
-}
-
-static struct pci_ops pci_sun4v_ops = {
-       .read =         pci_sun4v_read_pci_cfg,
-       .write =        pci_sun4v_write_pci_cfg,
-};
-
-
 static void pci_sun4v_scan_bus(struct pci_pbm_info *pbm)
 {
        struct property *prop;
@@ -1238,7 +1155,8 @@ static void pci_sun4v_pbm_init(struct pci_controller_info *p, struct device_node
        pci_pbm_root = pbm;
 
        pbm->scan_bus = pci_sun4v_scan_bus;
-       pbm->pci_ops = &pci_sun4v_ops;
+       pbm->pci_ops = &sun4v_pci_ops;
+       pbm->config_space_reg_bits = 12;
 
        pbm->index = pci_num_pbms++;
 
index c54d4d8af0142530d861074fe6afdb8b9081d207..b7976b14d0bac15319520d13316cb4492605eeb7 100644 (file)
@@ -1636,10 +1636,21 @@ static struct device_node * __init create_node(phandle node, struct device_node
 
 static struct device_node * __init build_tree(struct device_node *parent, phandle node, struct device_node ***nextp)
 {
+       struct device_node *ret = NULL, *prev_sibling = NULL;
        struct device_node *dp;
 
-       dp = create_node(node, parent);
-       if (dp) {
+       while (1) {
+               dp = create_node(node, parent);
+               if (!dp)
+                       break;
+
+               if (prev_sibling)
+                       prev_sibling->sibling = dp;
+
+               if (!ret)
+                       ret = dp;
+               prev_sibling = dp;
+
                *(*nextp) = dp;
                *nextp = &dp->allnext;
 
@@ -1648,10 +1659,10 @@ static struct device_node * __init build_tree(struct device_node *parent, phandl
 
                dp->child = build_tree(dp, prom_getchild(node), nextp);
 
-               dp->sibling = build_tree(parent, prom_getsibling(node), nextp);
+               node = prom_getsibling(node);
        }
 
-       return dp;
+       return ret;
 }
 
 void __init prom_build_devicetree(void)
index 8c2ac41187c126aeef9bc0535b3f58d5c3332b3b..d28f01379b9b5f31aff3c17bad2964c7bfa2ff5d 100644 (file)
@@ -778,6 +778,7 @@ asmlinkage __kprobes void default_do_nmi(struct pt_regs *regs)
                        return;
                if (notify_die(DIE_NMI_POST, "nmi_post", regs, reason, 2, 0)
                                                                == NOTIFY_STOP)
+                       return;
                if (!do_nmi_callback(regs,cpu))
                        unknown_nmi_error(reason, regs);
 
index 26ca9031ea496320106d62772dba56e178eae7c7..adad2f3d438a07929ca9842ac96fb8b3d4dac329 100644 (file)
@@ -36,6 +36,7 @@ obj-$(CONFIG_FC4)             += fc4/
 obj-$(CONFIG_SCSI)             += scsi/
 obj-$(CONFIG_ATA)              += ata/
 obj-$(CONFIG_FUSION)           += message/
+obj-$(CONFIG_FIREWIRE)         += firewire/
 obj-$(CONFIG_IEEE1394)         += ieee1394/
 obj-y                          += cdrom/
 obj-y                          += auxdisplay/
index 1683e5c5b94c5febc942d191489f0f30634cbe04..1cbe6190582494ed9f3557c58a17b659644f4979 100644 (file)
@@ -231,8 +231,10 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
                 * Obtain the method mutex if necessary. Do not acquire mutex for a
                 * recursive call.
                 */
-               if (acpi_os_get_thread_id() !=
-                   obj_desc->method.mutex->mutex.owner_thread_id) {
+               if (!walk_state ||
+                   !obj_desc->method.mutex->mutex.owner_thread ||
+                   (walk_state->thread !=
+                    obj_desc->method.mutex->mutex.owner_thread)) {
                        /*
                         * Acquire the method mutex. This releases the interpreter if we
                         * block (and reacquires it before it returns)
@@ -246,14 +248,14 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
                        }
 
                        /* Update the mutex and walk info and save the original sync_level */
-                       obj_desc->method.mutex->mutex.owner_thread_id =
-                               acpi_os_get_thread_id();
 
                        if (walk_state) {
                                obj_desc->method.mutex->mutex.
                                    original_sync_level =
                                    walk_state->thread->current_sync_level;
 
+                               obj_desc->method.mutex->mutex.owner_thread =
+                                   walk_state->thread;
                                walk_state->thread->current_sync_level =
                                    obj_desc->method.sync_level;
                        } else {
@@ -567,7 +569,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
 
                        acpi_os_release_mutex(method_desc->method.mutex->mutex.
                                              os_mutex);
-                       method_desc->method.mutex->mutex.owner_thread_id = ACPI_MUTEX_NOT_ACQUIRED;
+                       method_desc->method.mutex->mutex.owner_thread = NULL;
                }
        }
 
index 6c6104a7a247ef6413ed817ea34c24edfaf96dda..fc9da4879cbfb932e3b2e8ea683b12835d2391ad 100644 (file)
@@ -866,8 +866,7 @@ acpi_ds_eval_data_object_operands(struct acpi_walk_state *walk_state,
                    ((op->common.parent->common.aml_opcode != AML_PACKAGE_OP) &&
                     (op->common.parent->common.aml_opcode !=
                      AML_VAR_PACKAGE_OP)
-                    && (op->common.parent->common.aml_opcode !=
-                        AML_NAME_OP))) {
+                    && (op->common.parent->common.aml_opcode != AML_NAME_OP))) {
                        walk_state->result_obj = obj_desc;
                }
        }
index e4073e05a75ca1475bc39c03c3306028a8728622..71503c036f7c1496c2cd873a55a5e4bba676d6f2 100644 (file)
@@ -556,10 +556,9 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
                                         * indicate this to the interpreter, set the
                                         * object to the root
                                         */
-                                       obj_desc =
-                                           ACPI_CAST_PTR(union
-                                                         acpi_operand_object,
-                                                         acpi_gbl_root_node);
+                                       obj_desc = ACPI_CAST_PTR(union
+                                                                acpi_operand_object,
+                                                                acpi_gbl_root_node);
                                        status = AE_OK;
                                } else {
                                        /*
index 16c8e38b51ef944de7a1c90c6ae96cf30d61cfee..5afcdd9c74492aedd4eda84deeb3a9f3882e36c7 100644 (file)
@@ -630,12 +630,9 @@ struct acpi_walk_state *acpi_ds_pop_walk_state(struct acpi_thread_state *thread)
  *
  ******************************************************************************/
 
-struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id,
-                                                 union acpi_parse_object
-                                                 *origin,
-                                                 union acpi_operand_object
-                                                 *method_desc,
-                                                 struct acpi_thread_state
+struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id, union acpi_parse_object
+                                                 *origin, union acpi_operand_object
+                                                 *method_desc, struct acpi_thread_state
                                                  *thread)
 {
        struct acpi_walk_state *walk_state;
index e08cf98f504f12583174d23468a60bf4f9a28c14..82f496c07675c66e3cf76020cfbf81fc3dc4139f 100644 (file)
@@ -147,9 +147,10 @@ static inline int acpi_ec_check_status(struct acpi_ec *ec, enum ec_event event,
        return 0;
 }
 
-static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, unsigned count)
+static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event,
+                        unsigned count, int force_poll)
 {
-       if (acpi_ec_mode == EC_POLL) {
+       if (unlikely(force_poll) || acpi_ec_mode == EC_POLL) {
                unsigned long delay = jiffies + msecs_to_jiffies(ACPI_EC_DELAY);
                while (time_before(jiffies, delay)) {
                        if (acpi_ec_check_status(ec, event, 0))
@@ -173,14 +174,15 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, unsigned count)
 
 static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, u8 command,
                                        const u8 * wdata, unsigned wdata_len,
-                                       u8 * rdata, unsigned rdata_len)
+                                       u8 * rdata, unsigned rdata_len,
+                                       int force_poll)
 {
        int result = 0;
        unsigned count = atomic_read(&ec->event_count);
        acpi_ec_write_cmd(ec, command);
 
        for (; wdata_len > 0; --wdata_len) {
-               result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, count);
+               result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, count, force_poll);
                if (result) {
                        printk(KERN_ERR PREFIX
                               "write_cmd timeout, command = %d\n", command);
@@ -191,7 +193,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, u8 command,
        }
 
        if (!rdata_len) {
-               result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, count);
+               result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, count, force_poll);
                if (result) {
                        printk(KERN_ERR PREFIX
                               "finish-write timeout, command = %d\n", command);
@@ -202,7 +204,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, u8 command,
        }
 
        for (; rdata_len > 0; --rdata_len) {
-               result = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF_1, count);
+               result = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF_1, count, force_poll);
                if (result) {
                        printk(KERN_ERR PREFIX "read timeout, command = %d\n",
                               command);
@@ -217,7 +219,8 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, u8 command,
 
 static int acpi_ec_transaction(struct acpi_ec *ec, u8 command,
                               const u8 * wdata, unsigned wdata_len,
-                              u8 * rdata, unsigned rdata_len)
+                              u8 * rdata, unsigned rdata_len,
+                              int force_poll)
 {
        int status;
        u32 glk;
@@ -240,7 +243,7 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 command,
        /* Make sure GPE is enabled before doing transaction */
        acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR);
 
-       status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, 0);
+       status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, 0, 0);
        if (status) {
                printk(KERN_DEBUG PREFIX
                       "input buffer is not empty, aborting transaction\n");
@@ -249,7 +252,8 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 command,
 
        status = acpi_ec_transaction_unlocked(ec, command,
                                              wdata, wdata_len,
-                                             rdata, rdata_len);
+                                             rdata, rdata_len,
+                                             force_poll);
 
       end:
 
@@ -267,12 +271,12 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 command,
 int acpi_ec_burst_enable(struct acpi_ec *ec)
 {
        u8 d;
-       return acpi_ec_transaction(ec, ACPI_EC_BURST_ENABLE, NULL, 0, &d, 1);
+       return acpi_ec_transaction(ec, ACPI_EC_BURST_ENABLE, NULL, 0, &d, 1, 0);
 }
 
 int acpi_ec_burst_disable(struct acpi_ec *ec)
 {
-       return acpi_ec_transaction(ec, ACPI_EC_BURST_DISABLE, NULL, 0, NULL, 0);
+       return acpi_ec_transaction(ec, ACPI_EC_BURST_DISABLE, NULL, 0, NULL, 0, 0);
 }
 
 static int acpi_ec_read(struct acpi_ec *ec, u8 address, u8 * data)
@@ -281,7 +285,7 @@ static int acpi_ec_read(struct acpi_ec *ec, u8 address, u8 * data)
        u8 d;
 
        result = acpi_ec_transaction(ec, ACPI_EC_COMMAND_READ,
-                                    &address, 1, &d, 1);
+                                    &address, 1, &d, 1, 0);
        *data = d;
        return result;
 }
@@ -290,7 +294,7 @@ static int acpi_ec_write(struct acpi_ec *ec, u8 address, u8 data)
 {
        u8 wdata[2] = { address, data };
        return acpi_ec_transaction(ec, ACPI_EC_COMMAND_WRITE,
-                                  wdata, 2, NULL, 0);
+                                  wdata, 2, NULL, 0, 0);
 }
 
 /*
@@ -349,13 +353,15 @@ EXPORT_SYMBOL(ec_write);
 
 int ec_transaction(u8 command,
                   const u8 * wdata, unsigned wdata_len,
-                  u8 * rdata, unsigned rdata_len)
+                  u8 * rdata, unsigned rdata_len,
+                  int force_poll)
 {
        if (!first_ec)
                return -ENODEV;
 
        return acpi_ec_transaction(first_ec, command, wdata,
-                                  wdata_len, rdata, rdata_len);
+                                  wdata_len, rdata, rdata_len,
+                                  force_poll);
 }
 
 EXPORT_SYMBOL(ec_transaction);
@@ -374,7 +380,7 @@ static int acpi_ec_query(struct acpi_ec *ec, u8 * data)
         * bit to be cleared (and thus clearing the interrupt source).
         */
 
-       result = acpi_ec_transaction(ec, ACPI_EC_COMMAND_QUERY, NULL, 0, &d, 1);
+       result = acpi_ec_transaction(ec, ACPI_EC_COMMAND_QUERY, NULL, 0, &d, 1, 0);
        if (result)
                return result;
 
@@ -410,6 +416,7 @@ static u32 acpi_ec_gpe_handler(void *data)
        acpi_status status = AE_OK;
        u8 value;
        struct acpi_ec *ec = data;
+
        atomic_inc(&ec->event_count);
 
        if (acpi_ec_mode == EC_INTR) {
index 635ba449ebc2c97e98c2bc615f44e87bcaaf3092..e22f4a973c0fdc4d4cf5670e8ace14d83e75abe1 100644 (file)
@@ -341,9 +341,8 @@ struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
 
        /* A Non-NULL gpe_device means this is a GPE Block Device */
 
-       obj_desc =
-           acpi_ns_get_attached_object((struct acpi_namespace_node *)
-                                       gpe_device);
+       obj_desc = acpi_ns_get_attached_object((struct acpi_namespace_node *)
+                                              gpe_device);
        if (!obj_desc || !obj_desc->device.gpe_block) {
                return (NULL);
        }
index ad5bc76edf4660a43aa7ea624d9ef92905f020b9..902c287b3a4fd0295f2a9f38418a1ba1228904ab 100644 (file)
@@ -1033,8 +1033,7 @@ acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device,
 
                        if (((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) ==
                             ACPI_GPE_DISPATCH_METHOD)
-                           && (gpe_event_info->
-                               flags & ACPI_GPE_TYPE_RUNTIME)) {
+                           && (gpe_event_info->flags & ACPI_GPE_TYPE_RUNTIME)) {
                                gpe_enabled_count++;
                        }
 
index cae786ca8600edf12d26042b02c66a236a5a52ff..21cb749d0c75567534ebee05c78551bb289f1972 100644 (file)
@@ -196,15 +196,12 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
                notify_info->notify.value = (u16) notify_value;
                notify_info->notify.handler_obj = handler_obj;
 
-               acpi_ex_exit_interpreter();
-
-               acpi_ev_notify_dispatch(notify_info);
-
-               status = acpi_ex_enter_interpreter();
+               status =
+                   acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_ev_notify_dispatch,
+                                   notify_info);
                if (ACPI_FAILURE(status)) {
-                       return_ACPI_STATUS(status);
+                       acpi_ut_delete_generic_state(notify_info);
                }
-
        }
 
        if (!handler_obj) {
@@ -323,8 +320,9 @@ static u32 acpi_ev_global_lock_handler(void *context)
                acpi_gbl_global_lock_acquired = TRUE;
                /* Send a unit to the semaphore */
 
-               if (ACPI_FAILURE(acpi_os_signal_semaphore(
-                       acpi_gbl_global_lock_semaphore, 1))) {
+               if (ACPI_FAILURE
+                   (acpi_os_signal_semaphore
+                    (acpi_gbl_global_lock_semaphore, 1))) {
                        ACPI_ERROR((AE_INFO,
                                    "Could not signal Global Lock semaphore"));
                }
@@ -450,7 +448,9 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout)
        }
 
        if (ACPI_FAILURE(status)) {
-               status = acpi_ex_system_wait_mutex(acpi_gbl_global_lock_mutex, timeout);
+               status =
+                   acpi_ex_system_wait_mutex(acpi_gbl_global_lock_mutex,
+                                             timeout);
        }
        if (ACPI_FAILURE(status)) {
                return_ACPI_STATUS(status);
index 96b0e84317482ed67d8ecdd493d678986cf1d6c9..e99f0c435a4724006c9d204c69349733b91d763f 100644 (file)
@@ -291,7 +291,6 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
                               u32 bit_width, acpi_integer * value)
 {
        acpi_status status;
-       acpi_status status2;
        acpi_adr_space_handler handler;
        acpi_adr_space_setup region_setup;
        union acpi_operand_object *handler_desc;
@@ -345,7 +344,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
                 * setup will potentially execute control methods
                 * (e.g., _REG method for this region)
                 */
-               acpi_ex_exit_interpreter();
+               acpi_ex_relinquish_interpreter();
 
                status = region_setup(region_obj, ACPI_REGION_ACTIVATE,
                                      handler_desc->address_space.context,
@@ -353,10 +352,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
 
                /* Re-enter the interpreter */
 
-               status2 = acpi_ex_enter_interpreter();
-               if (ACPI_FAILURE(status2)) {
-                       return_ACPI_STATUS(status2);
-               }
+               acpi_ex_reacquire_interpreter();
 
                /* Check for failure of the Region Setup */
 
@@ -409,7 +405,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
                 * exit the interpreter because the handler *might* block -- we don't
                 * know what it will do, so we can't hold the lock on the intepreter.
                 */
-               acpi_ex_exit_interpreter();
+               acpi_ex_relinquish_interpreter();
        }
 
        /* Call the handler */
@@ -430,10 +426,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
                 * We just returned from a non-default handler, we must re-enter the
                 * interpreter
                 */
-               status2 = acpi_ex_enter_interpreter();
-               if (ACPI_FAILURE(status2)) {
-                       return_ACPI_STATUS(status2);
-               }
+               acpi_ex_reacquire_interpreter();
        }
 
        return_ACPI_STATUS(status);
index a4fa7e6822a30a7b40e3ff00abff1654af650174..400d90fca966ca9c08aa2c68233d56f47790bc00 100644 (file)
@@ -228,7 +228,8 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
 
                                /* Install a handler for this PCI root bridge */
 
-                               status = acpi_install_address_space_handler((acpi_handle) pci_root_node, ACPI_ADR_SPACE_PCI_CONFIG, ACPI_DEFAULT_HANDLER, NULL, NULL);
+                               status =
+                                   acpi_install_address_space_handler((acpi_handle) pci_root_node, ACPI_ADR_SPACE_PCI_CONFIG, ACPI_DEFAULT_HANDLER, NULL, NULL);
                                if (ACPI_FAILURE(status)) {
                                        if (status == AE_SAME_HANDLER) {
                                                /*
index a3379bafa676dc7da65fd71aeed1db5091ad7de7..6d866a01f5f439e06f79624de1bd268267b93f2a 100644 (file)
@@ -91,7 +91,6 @@ acpi_status acpi_install_exception_handler(acpi_exception_handler handler)
 
 ACPI_EXPORT_SYMBOL(acpi_install_exception_handler)
 #endif                         /*  ACPI_FUTURE_USAGE  */
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_install_fixed_event_handler
@@ -768,11 +767,9 @@ acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle)
                return (AE_BAD_PARAMETER);
        }
 
-       status = acpi_ex_enter_interpreter();
-       if (ACPI_FAILURE(status)) {
-               return (status);
-       }
+       /* Must lock interpreter to prevent race conditions */
 
+       acpi_ex_enter_interpreter();
        status = acpi_ev_acquire_global_lock(timeout);
        acpi_ex_exit_interpreter();
 
index 17065e98807c1921d1fcee9aa51d5423fd84ffd3..9cbd3414a574ebf4cad5c94f54a7f95883363189 100644 (file)
@@ -472,7 +472,6 @@ acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags)
 }
 
 ACPI_EXPORT_SYMBOL(acpi_clear_gpe)
-
 #ifdef ACPI_FUTURE_USAGE
 /*******************************************************************************
  *
@@ -568,7 +567,6 @@ acpi_get_gpe_status(acpi_handle gpe_device,
 
 ACPI_EXPORT_SYMBOL(acpi_get_gpe_status)
 #endif                         /*  ACPI_FUTURE_USAGE  */
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_install_gpe_block
index d470e8b1f4ea6052a60643d45c800ce04aa2c7f6..79f2c0d42c06a59ff5a56b8c4062371aeb18362b 100644 (file)
@@ -512,9 +512,8 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc,
                 * Create a new string object and string buffer
                 * (-1 because of extra separator included in string_length from above)
                 */
-               return_desc =
-                   acpi_ut_create_string_object((acpi_size)
-                                                (string_length - 1));
+               return_desc = acpi_ut_create_string_object((acpi_size)
+                                                          (string_length - 1));
                if (!return_desc) {
                        return_ACPI_STATUS(AE_NO_MEMORY);
                }
index ae97812681a3ee7fa9ce448aadc0baaea51f7b39..6e9a23e47fef38e5c39497daa0c46a713d3ee726 100644 (file)
@@ -50,7 +50,6 @@
 
 #define _COMPONENT          ACPI_EXECUTER
 ACPI_MODULE_NAME("excreate")
-
 #ifndef ACPI_NO_METHOD_EXECUTION
 /*******************************************************************************
  *
@@ -583,10 +582,7 @@ acpi_ex_create_method(u8 * aml_start,
         * Get the sync_level. If method is serialized, a mutex will be
         * created for this method when it is parsed.
         */
-       if (acpi_gbl_all_methods_serialized) {
-               obj_desc->method.sync_level = 0;
-               obj_desc->method.method_flags |= AML_METHOD_SERIALIZED;
-       } else if (method_flags & AML_METHOD_SERIALIZED) {
+       if (method_flags & AML_METHOD_SERIALIZED) {
                /*
                 * ACPI 1.0: sync_level = 0
                 * ACPI 2.0: sync_level = sync_level in method declaration
index 1a73c14df2c5aa7d7f7cdd1c195bb1e202747139..51c9c29987c3d102a857ecf8d30f937771b27da4 100644 (file)
@@ -134,7 +134,7 @@ static struct acpi_exdump_info acpi_ex_dump_method[8] = {
 static struct acpi_exdump_info acpi_ex_dump_mutex[5] = {
        {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_mutex), NULL},
        {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(mutex.sync_level), "Sync Level"},
-       {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.owner_thread_id), "Owner Thread"},
+       {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.owner_thread), "Owner Thread"},
        {ACPI_EXD_UINT16, ACPI_EXD_OFFSET(mutex.acquisition_depth),
         "Acquire Depth"},
        {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(mutex.os_mutex), "OsMutex"}
@@ -451,9 +451,8 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
 
        ACPI_FUNCTION_NAME(ex_dump_operand)
 
-           if (!
-               ((ACPI_LV_EXEC & acpi_dbg_level)
-                && (_COMPONENT & acpi_dbg_layer))) {
+           if (!((ACPI_LV_EXEC & acpi_dbg_level)
+                 && (_COMPONENT & acpi_dbg_layer))) {
                return;
        }
 
@@ -844,9 +843,8 @@ void acpi_ex_dump_namespace_node(struct acpi_namespace_node *node, u32 flags)
        ACPI_FUNCTION_ENTRY();
 
        if (!flags) {
-               if (!
-                   ((ACPI_LV_OBJECTS & acpi_dbg_level)
-                    && (_COMPONENT & acpi_dbg_layer))) {
+               if (!((ACPI_LV_OBJECTS & acpi_dbg_level)
+                     && (_COMPONENT & acpi_dbg_layer))) {
                        return;
                }
        }
@@ -1011,9 +1009,8 @@ acpi_ex_dump_object_descriptor(union acpi_operand_object *obj_desc, u32 flags)
        }
 
        if (!flags) {
-               if (!
-                   ((ACPI_LV_OBJECTS & acpi_dbg_level)
-                    && (_COMPONENT & acpi_dbg_layer))) {
+               if (!((ACPI_LV_OBJECTS & acpi_dbg_level)
+                     && (_COMPONENT & acpi_dbg_layer))) {
                        return_VOID;
                }
        }
index 4eb883bda6ae7f23800decda4a549042c64c8a94..6748e3ef09972472d9aeeaeaa1abf639773a77a8 100644 (file)
@@ -66,9 +66,10 @@ acpi_ex_link_mutex(union acpi_operand_object *obj_desc,
  *
  ******************************************************************************/
 
-void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc,
-                         struct acpi_thread_state *thread)
+void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc)
 {
+       struct acpi_thread_state *thread = obj_desc->mutex.owner_thread;
+
        if (!thread) {
                return;
        }
@@ -173,13 +174,16 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
 
        /* Support for multiple acquires by the owning thread */
 
-       if (obj_desc->mutex.owner_thread_id == acpi_os_get_thread_id()) {
-               /*
-                * The mutex is already owned by this thread, just increment the
-                * acquisition depth
-                */
-               obj_desc->mutex.acquisition_depth++;
-               return_ACPI_STATUS(AE_OK);
+       if (obj_desc->mutex.owner_thread) {
+               if (obj_desc->mutex.owner_thread->thread_id ==
+                   walk_state->thread->thread_id) {
+                       /*
+                        * The mutex is already owned by this thread, just increment the
+                        * acquisition depth
+                        */
+                       obj_desc->mutex.acquisition_depth++;
+                       return_ACPI_STATUS(AE_OK);
+               }
        }
 
        /* Acquire the mutex, wait if necessary. Special case for Global Lock */
@@ -202,7 +206,7 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
 
        /* Have the mutex: update mutex and walk info and save the sync_level */
 
-       obj_desc->mutex.owner_thread_id = acpi_os_get_thread_id();
+       obj_desc->mutex.owner_thread = walk_state->thread;
        obj_desc->mutex.acquisition_depth = 1;
        obj_desc->mutex.original_sync_level =
            walk_state->thread->current_sync_level;
@@ -242,7 +246,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 
        /* The mutex must have been previously acquired in order to release it */
 
-       if (!obj_desc->mutex.owner_thread_id) {
+       if (!obj_desc->mutex.owner_thread) {
                ACPI_ERROR((AE_INFO,
                            "Cannot release Mutex [%4.4s], not acquired",
                            acpi_ut_get_node_name(obj_desc->mutex.node)));
@@ -262,14 +266,15 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
         * The Mutex is owned, but this thread must be the owner.
         * Special case for Global Lock, any thread can release
         */
-       if ((obj_desc->mutex.owner_thread_id !=
+       if ((obj_desc->mutex.owner_thread->thread_id !=
             walk_state->thread->thread_id)
            && (obj_desc->mutex.os_mutex != acpi_gbl_global_lock_mutex)) {
                ACPI_ERROR((AE_INFO,
                            "Thread %lX cannot release Mutex [%4.4s] acquired by thread %lX",
                            (unsigned long)walk_state->thread->thread_id,
                            acpi_ut_get_node_name(obj_desc->mutex.node),
-                           (unsigned long)obj_desc->mutex.owner_thread_id));
+                           (unsigned long)obj_desc->mutex.owner_thread->
+                           thread_id));
                return_ACPI_STATUS(AE_AML_NOT_OWNER);
        }
 
@@ -296,7 +301,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 
        /* Unlink the mutex from the owner's list */
 
-       acpi_ex_unlink_mutex(obj_desc, walk_state->thread);
+       acpi_ex_unlink_mutex(obj_desc);
 
        /* Release the mutex, special case for Global Lock */
 
@@ -308,7 +313,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 
        /* Update the mutex and restore sync_level */
 
-       obj_desc->mutex.owner_thread_id = ACPI_MUTEX_NOT_ACQUIRED;
+       obj_desc->mutex.owner_thread = NULL;
        walk_state->thread->current_sync_level =
            obj_desc->mutex.original_sync_level;
 
@@ -363,7 +368,7 @@ void acpi_ex_release_all_mutexes(struct acpi_thread_state *thread)
 
                /* Mark mutex unowned */
 
-               obj_desc->mutex.owner_thread_id = ACPI_MUTEX_NOT_ACQUIRED;
+               obj_desc->mutex.owner_thread = NULL;
 
                /* Update Thread sync_level (Last mutex is the important one) */
 
index 1ee4fb1175c680f5b8b7d3f706e467c5b73683ba..308eae52dc054d72c670fb8bccc8a90f6dd7e93d 100644 (file)
@@ -177,8 +177,7 @@ static acpi_status acpi_ex_name_segment(u8 ** in_aml_address, char *name_string)
 
        ACPI_DEBUG_PRINT((ACPI_DB_LOAD, "Bytes from stream:\n"));
 
-       for (index = 0;
-            (index < ACPI_NAME_SIZE)
+       for (index = 0; (index < ACPI_NAME_SIZE)
             && (acpi_ut_valid_acpi_char(*aml_address, 0)); index++) {
                char_buf[index] = *aml_address++;
                ACPI_DEBUG_PRINT((ACPI_DB_LOAD, "%c\n", char_buf[index]));
index a6696621ff1b567d18652e4a31e8a86d574e99ef..efe5d4b461a47a7c91351608ce876ffc76de1566 100644 (file)
@@ -242,7 +242,7 @@ acpi_ex_decode_field_access(union acpi_operand_object *obj_desc,
                                            obj_desc->common_field.bit_length,
                                            0xFFFFFFFF
                                            /* Temp until we pass region_length as parameter */
-                                           );
+                   );
                bit_length = byte_alignment * 8;
 #endif
 
index ba761862a5990c85551c41a9bebaeeedd24b67eb..09d897b3f6d5b1848490eac18b9d09370409f782 100644 (file)
@@ -354,8 +354,7 @@ acpi_ex_resolve_operands(u16 opcode,
                        if ((opcode == AML_STORE_OP) &&
                            (ACPI_GET_OBJECT_TYPE(*stack_ptr) ==
                             ACPI_TYPE_LOCAL_REFERENCE)
-                           && ((*stack_ptr)->reference.opcode ==
-                               AML_INDEX_OP)) {
+                           && ((*stack_ptr)->reference.opcode == AML_INDEX_OP)) {
                                goto next_operand;
                        }
                        break;
index b2edf620ba8968d1086dfe1938be8727a8d1580e..9460baff30328f4c5565e2c5d671eabfdf4f634c 100644 (file)
@@ -66,7 +66,6 @@ ACPI_MODULE_NAME("exsystem")
 acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
 {
        acpi_status status;
-       acpi_status status2;
 
        ACPI_FUNCTION_TRACE(ex_system_wait_semaphore);
 
@@ -79,7 +78,7 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
 
                /* We must wait, so unlock the interpreter */
 
-               acpi_ex_exit_interpreter();
+               acpi_ex_relinquish_interpreter();
 
                status = acpi_os_wait_semaphore(semaphore, 1, timeout);
 
@@ -89,13 +88,7 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
 
                /* Reacquire the interpreter */
 
-               status2 = acpi_ex_enter_interpreter();
-               if (ACPI_FAILURE(status2)) {
-
-                       /* Report fatal error, could not acquire interpreter */
-
-                       return_ACPI_STATUS(status2);
-               }
+               acpi_ex_reacquire_interpreter();
        }
 
        return_ACPI_STATUS(status);
@@ -119,7 +112,6 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
 acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout)
 {
        acpi_status status;
-       acpi_status status2;
 
        ACPI_FUNCTION_TRACE(ex_system_wait_mutex);
 
@@ -132,7 +124,7 @@ acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout)
 
                /* We must wait, so unlock the interpreter */
 
-               acpi_ex_exit_interpreter();
+               acpi_ex_relinquish_interpreter();
 
                status = acpi_os_acquire_mutex(mutex, timeout);
 
@@ -142,13 +134,7 @@ acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout)
 
                /* Reacquire the interpreter */
 
-               status2 = acpi_ex_enter_interpreter();
-               if (ACPI_FAILURE(status2)) {
-
-                       /* Report fatal error, could not acquire interpreter */
-
-                       return_ACPI_STATUS(status2);
-               }
+               acpi_ex_reacquire_interpreter();
        }
 
        return_ACPI_STATUS(status);
@@ -209,20 +195,18 @@ acpi_status acpi_ex_system_do_stall(u32 how_long)
 
 acpi_status acpi_ex_system_do_suspend(acpi_integer how_long)
 {
-       acpi_status status;
-
        ACPI_FUNCTION_ENTRY();
 
        /* Since this thread will sleep, we must release the interpreter */
 
-       acpi_ex_exit_interpreter();
+       acpi_ex_relinquish_interpreter();
 
        acpi_os_sleep(how_long);
 
        /* And now we must get the interpreter again */
 
-       status = acpi_ex_enter_interpreter();
-       return (status);
+       acpi_ex_reacquire_interpreter();
+       return (AE_OK);
 }
 
 /*******************************************************************************
index aea461f3a48cc02ab7269c8e7e7e9807657edefc..6b0aeccbb69b3f59738d5a9dd22fe875a1a2d018 100644 (file)
@@ -76,14 +76,15 @@ static u32 acpi_ex_digits_needed(acpi_integer value, u32 base);
  *
  * PARAMETERS:  None
  *
- * RETURN:      Status
+ * RETURN:      None
  *
- * DESCRIPTION: Enter the interpreter execution region.  Failure to enter
- *              the interpreter region is a fatal system error
+ * DESCRIPTION: Enter the interpreter execution region. Failure to enter
+ *              the interpreter region is a fatal system error. Used in
+ *              conjunction with exit_interpreter.
  *
  ******************************************************************************/
 
-acpi_status acpi_ex_enter_interpreter(void)
+void acpi_ex_enter_interpreter(void)
 {
        acpi_status status;
 
@@ -91,31 +92,55 @@ acpi_status acpi_ex_enter_interpreter(void)
 
        status = acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER);
        if (ACPI_FAILURE(status)) {
-               ACPI_ERROR((AE_INFO, "Could not acquire interpreter mutex"));
+               ACPI_ERROR((AE_INFO,
+                           "Could not acquire AML Interpreter mutex"));
        }
 
-       return_ACPI_STATUS(status);
+       return_VOID;
 }
 
 /*******************************************************************************
  *
- * FUNCTION:    acpi_ex_exit_interpreter
+ * FUNCTION:    acpi_ex_reacquire_interpreter
  *
  * PARAMETERS:  None
  *
  * RETURN:      None
  *
- * DESCRIPTION: Exit the interpreter execution region
+ * DESCRIPTION: Reacquire the interpreter execution region from within the
+ *              interpreter code. Failure to enter the interpreter region is a
+ *              fatal system error. Used in  conjuction with
+ *              relinquish_interpreter
+ *
+ ******************************************************************************/
+
+void acpi_ex_reacquire_interpreter(void)
+{
+       ACPI_FUNCTION_TRACE(ex_reacquire_interpreter);
+
+       /*
+        * If the global serialized flag is set, do not release the interpreter,
+        * since it was not actually released by acpi_ex_relinquish_interpreter.
+        * This forces the interpreter to be single threaded.
+        */
+       if (!acpi_gbl_all_methods_serialized) {
+               acpi_ex_enter_interpreter();
+       }
+
+       return_VOID;
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ex_exit_interpreter
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      None
  *
- * Cases where the interpreter is unlocked:
- *      1) Completion of the execution of a control method
- *      2) Method blocked on a Sleep() AML opcode
- *      3) Method blocked on an Acquire() AML opcode
- *      4) Method blocked on a Wait() AML opcode
- *      5) Method blocked to acquire the global lock
- *      6) Method blocked to execute a serialized control method that is
- *          already executing
- *      7) About to invoke a user-installed opregion handler
+ * DESCRIPTION: Exit the interpreter execution region. This is the top level
+ *              routine used to exit the interpreter when all processing has
+ *              been completed.
  *
  ******************************************************************************/
 
@@ -127,7 +152,46 @@ void acpi_ex_exit_interpreter(void)
 
        status = acpi_ut_release_mutex(ACPI_MTX_INTERPRETER);
        if (ACPI_FAILURE(status)) {
-               ACPI_ERROR((AE_INFO, "Could not release interpreter mutex"));
+               ACPI_ERROR((AE_INFO,
+                           "Could not release AML Interpreter mutex"));
+       }
+
+       return_VOID;
+}
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ex_relinquish_interpreter
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Exit the interpreter execution region, from within the
+ *              interpreter - before attempting an operation that will possibly
+ *              block the running thread.
+ *
+ * Cases where the interpreter is unlocked internally
+ *      1) Method to be blocked on a Sleep() AML opcode
+ *      2) Method to be blocked on an Acquire() AML opcode
+ *      3) Method to be blocked on a Wait() AML opcode
+ *      4) Method to be blocked to acquire the global lock
+ *      5) Method to be blocked waiting to execute a serialized control method
+ *          that is currently executing
+ *      6) About to invoke a user-installed opregion handler
+ *
+ ******************************************************************************/
+
+void acpi_ex_relinquish_interpreter(void)
+{
+       ACPI_FUNCTION_TRACE(ex_relinquish_interpreter);
+
+       /*
+        * If the global serialized flag is set, do not release the interpreter.
+        * This forces the interpreter to be single threaded.
+        */
+       if (!acpi_gbl_all_methods_serialized) {
+               acpi_ex_exit_interpreter();
        }
 
        return_VOID;
@@ -141,8 +205,8 @@ void acpi_ex_exit_interpreter(void)
  *
  * RETURN:      none
  *
- * DESCRIPTION: Truncate a number to 32-bits if the currently executing method
- *              belongs to a 32-bit ACPI table.
+ * DESCRIPTION: Truncate an ACPI Integer to 32 bits if the execution mode is
+ *              32-bit, as determined by the revision of the DSDT.
  *
  ******************************************************************************/
 
index c84b1faba28cf3900001c78f2b0700975faf4d61..76c525dc590b3b91aedfe0c99d6526eabfe5bbc9 100644 (file)
@@ -152,7 +152,6 @@ acpi_get_firmware_waking_vector(acpi_physical_address * physical_address)
 
 ACPI_EXPORT_SYMBOL(acpi_get_firmware_waking_vector)
 #endif
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_enter_sleep_state_prep
index 26fd0dd6953dc7be4792610f8e662276b46d6124..97b2ac57c16be69d7ad94c1899410f806164e9af 100644 (file)
@@ -75,7 +75,7 @@ ACPI_MODULE_NAME("nseval")
  * MUTEX:       Locks interpreter
  *
  ******************************************************************************/
-acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info)
+acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info)
 {
        acpi_status status;
 
@@ -154,11 +154,7 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info)
                 * Execute the method via the interpreter. The interpreter is locked
                 * here before calling into the AML parser
                 */
-               status = acpi_ex_enter_interpreter();
-               if (ACPI_FAILURE(status)) {
-                       return_ACPI_STATUS(status);
-               }
-
+               acpi_ex_enter_interpreter();
                status = acpi_ps_execute_method(info);
                acpi_ex_exit_interpreter();
        } else {
@@ -182,10 +178,7 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info)
                 * resolution, we must lock it because we could access an opregion.
                 * The opregion access code assumes that the interpreter is locked.
                 */
-               status = acpi_ex_enter_interpreter();
-               if (ACPI_FAILURE(status)) {
-                       return_ACPI_STATUS(status);
-               }
+               acpi_ex_enter_interpreter();
 
                /* Function has a strange interface */
 
index c4ab615f77fea6a133f2f1cf9865217e9d02b0d5..33db2241044e5930430c5091f6580c9013721f15 100644 (file)
@@ -214,7 +214,7 @@ acpi_ns_init_one_object(acpi_handle obj_handle,
                        u32 level, void *context, void **return_value)
 {
        acpi_object_type type;
-       acpi_status status;
+       acpi_status status = AE_OK;
        struct acpi_init_walk_info *info =
            (struct acpi_init_walk_info *)context;
        struct acpi_namespace_node *node =
@@ -268,10 +268,7 @@ acpi_ns_init_one_object(acpi_handle obj_handle,
        /*
         * Must lock the interpreter before executing AML code
         */
-       status = acpi_ex_enter_interpreter();
-       if (ACPI_FAILURE(status)) {
-               return (status);
-       }
+       acpi_ex_enter_interpreter();
 
        /*
         * Each of these types can contain executable AML code within the
index 94eb8f332d941bb67a0175e85f17d4560ecd4f4d..280b8357c46c32ebe3f5dc9933f6a19ae95f4d0e 100644 (file)
@@ -65,10 +65,8 @@ ACPI_MODULE_NAME("nswalk")
  *              within Scope is returned.
  *
  ******************************************************************************/
-struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type,
-                                                 struct acpi_namespace_node
-                                                 *parent_node,
-                                                 struct acpi_namespace_node
+struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type, struct acpi_namespace_node
+                                                 *parent_node, struct acpi_namespace_node
                                                  *child_node)
 {
        struct acpi_namespace_node *next_node = NULL;
index 8904d0fae6a2ff90794389456b6f62420c5410d3..be4f2899de74e6b6d91af7978f6f411452f1391b 100644 (file)
@@ -48,7 +48,6 @@
 
 #define _COMPONENT          ACPI_NAMESPACE
 ACPI_MODULE_NAME("nsxfeval")
-
 #ifdef ACPI_FUTURE_USAGE
 /*******************************************************************************
  *
@@ -73,8 +72,8 @@ ACPI_MODULE_NAME("nsxfeval")
 acpi_status
 acpi_evaluate_object_typed(acpi_handle handle,
                           acpi_string pathname,
-                          struct acpi_object_list * external_params,
-                          struct acpi_buffer * return_buffer,
+                          struct acpi_object_list *external_params,
+                          struct acpi_buffer *return_buffer,
                           acpi_object_type return_type)
 {
        acpi_status status;
@@ -143,7 +142,6 @@ acpi_evaluate_object_typed(acpi_handle handle,
 
 ACPI_EXPORT_SYMBOL(acpi_evaluate_object_typed)
 #endif                         /*  ACPI_FUTURE_USAGE  */
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_evaluate_object
@@ -170,7 +168,6 @@ acpi_evaluate_object(acpi_handle handle,
                     struct acpi_buffer *return_buffer)
 {
        acpi_status status;
-       acpi_status status2;
        struct acpi_evaluate_info *info;
        acpi_size buffer_space_needed;
        u32 i;
@@ -329,14 +326,12 @@ acpi_evaluate_object(acpi_handle handle,
                 * Delete the internal return object. NOTE: Interpreter must be
                 * locked to avoid race condition.
                 */
-               status2 = acpi_ex_enter_interpreter();
-               if (ACPI_SUCCESS(status2)) {
+               acpi_ex_enter_interpreter();
 
-                       /* Remove one reference on the return object (should delete it) */
+               /* Remove one reference on the return object (should delete it) */
 
-                       acpi_ut_remove_reference(info->return_object);
-                       acpi_ex_exit_interpreter();
-               }
+               acpi_ut_remove_reference(info->return_object);
+               acpi_ex_exit_interpreter();
        }
 
       cleanup:
index c2bed56915e1eafe1559d906ba06661764990d45..b998340e23d4126074a36cc1af38d05461b4bde9 100644 (file)
@@ -71,6 +71,7 @@ static unsigned int acpi_irq_irq;
 static acpi_osd_handler acpi_irq_handler;
 static void *acpi_irq_context;
 static struct workqueue_struct *kacpid_wq;
+static struct workqueue_struct *kacpi_notify_wq;
 
 static void __init acpi_request_region (struct acpi_generic_address *addr,
        unsigned int length, char *desc)
@@ -137,8 +138,9 @@ acpi_status acpi_os_initialize1(void)
                return AE_NULL_ENTRY;
        }
        kacpid_wq = create_singlethread_workqueue("kacpid");
+       kacpi_notify_wq = create_singlethread_workqueue("kacpi_notify");
        BUG_ON(!kacpid_wq);
-
+       BUG_ON(!kacpi_notify_wq);
        return AE_OK;
 }
 
@@ -150,6 +152,7 @@ acpi_status acpi_os_terminate(void)
        }
 
        destroy_workqueue(kacpid_wq);
+       destroy_workqueue(kacpi_notify_wq);
 
        return AE_OK;
 }
@@ -601,6 +604,23 @@ void acpi_os_derive_pci_id(acpi_handle rhandle,    /* upper bound  */
 }
 
 static void acpi_os_execute_deferred(struct work_struct *work)
+{
+       struct acpi_os_dpc *dpc = container_of(work, struct acpi_os_dpc, work);
+       if (!dpc) {
+               printk(KERN_ERR PREFIX "Invalid (NULL) context\n");
+               return;
+       }
+
+       dpc->function(dpc->context);
+       kfree(dpc);
+
+       /* Yield cpu to notify thread */
+       cond_resched();
+
+       return;
+}
+
+static void acpi_os_execute_notify(struct work_struct *work)
 {
        struct acpi_os_dpc *dpc = container_of(work, struct acpi_os_dpc, work);
 
@@ -637,14 +657,12 @@ acpi_status acpi_os_execute(acpi_execute_type type,
        acpi_status status = AE_OK;
        struct acpi_os_dpc *dpc;
 
-       ACPI_FUNCTION_TRACE("os_queue_for_execution");
-
        ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
                          "Scheduling function [%p(%p)] for deferred execution.\n",
                          function, context));
 
        if (!function)
-               return_ACPI_STATUS(AE_BAD_PARAMETER);
+               return AE_BAD_PARAMETER;
 
        /*
         * Allocate/initialize DPC structure.  Note that this memory will be
@@ -662,14 +680,21 @@ acpi_status acpi_os_execute(acpi_execute_type type,
        dpc->function = function;
        dpc->context = context;
 
-       INIT_WORK(&dpc->work, acpi_os_execute_deferred);
-       if (!queue_work(kacpid_wq, &dpc->work)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+       if (type == OSL_NOTIFY_HANDLER) {
+               INIT_WORK(&dpc->work, acpi_os_execute_notify);
+               if (!queue_work(kacpi_notify_wq, &dpc->work)) {
+                       status = AE_ERROR;
+                       kfree(dpc);
+               }
+       } else {
+               INIT_WORK(&dpc->work, acpi_os_execute_deferred);
+               if (!queue_work(kacpid_wq, &dpc->work)) {
+                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
                                  "Call to queue_work() failed.\n"));
-               kfree(dpc);
-               status = AE_ERROR;
+                       status = AE_ERROR;
+                       kfree(dpc);
+               }
        }
-
        return_ACPI_STATUS(status);
 }
 
index 16d8b6cc3c220407917111204ba587f6164845aa..9296e86761d74f2aa4000167f068f611d36486d3 100644 (file)
@@ -185,459 +185,453 @@ const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = {
 /* Index           Name                 Parser Args               Interpreter Args                ObjectType                    Class                      Type                  Flags */
 
 /* 00 */ ACPI_OP("Zero", ARGP_ZERO_OP, ARGI_ZERO_OP, ACPI_TYPE_INTEGER,
-                        AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, AML_CONSTANT),
+                AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, AML_CONSTANT),
 /* 01 */ ACPI_OP("One", ARGP_ONE_OP, ARGI_ONE_OP, ACPI_TYPE_INTEGER,
-                        AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, AML_CONSTANT),
+                AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, AML_CONSTANT),
 /* 02 */ ACPI_OP("Alias", ARGP_ALIAS_OP, ARGI_ALIAS_OP,
-                        ACPI_TYPE_LOCAL_ALIAS, AML_CLASS_NAMED_OBJECT,
-                        AML_TYPE_NAMED_SIMPLE,
-                        AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE |
-                        AML_NSNODE | AML_NAMED),
+                ACPI_TYPE_LOCAL_ALIAS, AML_CLASS_NAMED_OBJECT,
+                AML_TYPE_NAMED_SIMPLE,
+                AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE |
+                AML_NSNODE | AML_NAMED),
 /* 03 */ ACPI_OP("Name", ARGP_NAME_OP, ARGI_NAME_OP, ACPI_TYPE_ANY,
-                        AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX,
-                        AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE |
-                        AML_NSNODE | AML_NAMED),
+                AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX,
+                AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE |
+                AML_NSNODE | AML_NAMED),
 /* 04 */ ACPI_OP("ByteConst", ARGP_BYTE_OP, ARGI_BYTE_OP,
-                        ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT,
-                        AML_TYPE_LITERAL, AML_CONSTANT),
+                ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT,
+                AML_TYPE_LITERAL, AML_CONSTANT),
 /* 05 */ ACPI_OP("WordConst", ARGP_WORD_OP, ARGI_WORD_OP,
-                        ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT,
-                        AML_TYPE_LITERAL, AML_CONSTANT),
+                ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT,
+                AML_TYPE_LITERAL, AML_CONSTANT),
 /* 06 */ ACPI_OP("DwordConst", ARGP_DWORD_OP, ARGI_DWORD_OP,
-                        ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT,
-                        AML_TYPE_LITERAL, AML_CONSTANT),
+                ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT,
+                AML_TYPE_LITERAL, AML_CONSTANT),
 /* 07 */ ACPI_OP("String", ARGP_STRING_OP, ARGI_STRING_OP,
-                        ACPI_TYPE_STRING, AML_CLASS_ARGUMENT,
-                        AML_TYPE_LITERAL, AML_CONSTANT),
+                ACPI_TYPE_STRING, AML_CLASS_ARGUMENT,
+                AML_TYPE_LITERAL, AML_CONSTANT),
 /* 08 */ ACPI_OP("Scope", ARGP_SCOPE_OP, ARGI_SCOPE_OP,
-                        ACPI_TYPE_LOCAL_SCOPE, AML_CLASS_NAMED_OBJECT,
-                        AML_TYPE_NAMED_NO_OBJ,
-                        AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE |
-                        AML_NSNODE | AML_NAMED),
+                ACPI_TYPE_LOCAL_SCOPE, AML_CLASS_NAMED_OBJECT,
+                AML_TYPE_NAMED_NO_OBJ,
+                AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE |
+                AML_NSNODE | AML_NAMED),
 /* 09 */ ACPI_OP("Buffer", ARGP_BUFFER_OP, ARGI_BUFFER_OP,
-                        ACPI_TYPE_BUFFER, AML_CLASS_CREATE,
-                        AML_TYPE_CREATE_OBJECT,
-                        AML_HAS_ARGS | AML_DEFER | AML_CONSTANT),
+                ACPI_TYPE_BUFFER, AML_CLASS_CREATE,
+                AML_TYPE_CREATE_OBJECT,
+                AML_HAS_ARGS | AML_DEFER | AML_CONSTANT),
 /* 0A */ ACPI_OP("Package", ARGP_PACKAGE_OP, ARGI_PACKAGE_OP,
-                        ACPI_TYPE_PACKAGE, AML_CLASS_CREATE,
-                        AML_TYPE_CREATE_OBJECT,
-                        AML_HAS_ARGS | AML_DEFER | AML_CONSTANT),
+                ACPI_TYPE_PACKAGE, AML_CLASS_CREATE,
+                AML_TYPE_CREATE_OBJECT,
+                AML_HAS_ARGS | AML_DEFER | AML_CONSTANT),
 /* 0B */ ACPI_OP("Method", ARGP_METHOD_OP, ARGI_METHOD_OP,
-                        ACPI_TYPE_METHOD, AML_CLASS_NAMED_OBJECT,
-                        AML_TYPE_NAMED_COMPLEX,
-                        AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE |
-                        AML_NSNODE | AML_NAMED | AML_DEFER),
+                ACPI_TYPE_METHOD, AML_CLASS_NAMED_OBJECT,
+                AML_TYPE_NAMED_COMPLEX,
+                AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE |
+                AML_NSNODE | AML_NAMED | AML_DEFER),
 /* 0C */ ACPI_OP("Local0", ARGP_LOCAL0, ARGI_LOCAL0,
-                        ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
-                        AML_TYPE_LOCAL_VARIABLE, 0),
+                ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
+                AML_TYPE_LOCAL_VARIABLE, 0),
 /* 0D */ ACPI_OP("Local1", ARGP_LOCAL1, ARGI_LOCAL1,
-                        ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
-                        AML_TYPE_LOCAL_VARIABLE, 0),
+                ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
+                AML_TYPE_LOCAL_VARIABLE, 0),
 /* 0E */ ACPI_OP("Local2", ARGP_LOCAL2, ARGI_LOCAL2,
-                        ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
-                        AML_TYPE_LOCAL_VARIABLE, 0),
+                ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
+                AML_TYPE_LOCAL_VARIABLE, 0),
 /* 0F */ ACPI_OP("Local3", ARGP_LOCAL3, ARGI_LOCAL3,
-                        ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
-                        AML_TYPE_LOCAL_VARIABLE, 0),
+                ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
+                AML_TYPE_LOCAL_VARIABLE, 0),
 /* 10 */ ACPI_OP("Local4", ARGP_LOCAL4, ARGI_LOCAL4,
-                        ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
-                        AML_TYPE_LOCAL_VARIABLE, 0),
+                ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
+                AML_TYPE_LOCAL_VARIABLE, 0),
 /* 11 */ ACPI_OP("Local5", ARGP_LOCAL5, ARGI_LOCAL5,
-                        ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
-                        AML_TYPE_LOCAL_VARIABLE, 0),
+                ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
+                AML_TYPE_LOCAL_VARIABLE, 0),
 /* 12 */ ACPI_OP("Local6", ARGP_LOCAL6, ARGI_LOCAL6,
-                        ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
-                        AML_TYPE_LOCAL_VARIABLE, 0),
+                ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
+                AML_TYPE_LOCAL_VARIABLE, 0),
 /* 13 */ ACPI_OP("Local7", ARGP_LOCAL7, ARGI_LOCAL7,
-                        ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
-                        AML_TYPE_LOCAL_VARIABLE, 0),
+                ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
+                AML_TYPE_LOCAL_VARIABLE, 0),
 /* 14 */ ACPI_OP("Arg0", ARGP_ARG0, ARGI_ARG0,
-                        ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
-                        AML_TYPE_METHOD_ARGUMENT, 0),
+                ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
+                AML_TYPE_METHOD_ARGUMENT, 0),
 /* 15 */ ACPI_OP("Arg1", ARGP_ARG1, ARGI_ARG1,
-                        ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
-                        AML_TYPE_METHOD_ARGUMENT, 0),
+                ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
+                AML_TYPE_METHOD_ARGUMENT, 0),
 /* 16 */ ACPI_OP("Arg2", ARGP_ARG2, ARGI_ARG2,
-                        ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
-                        AML_TYPE_METHOD_ARGUMENT, 0),
+                ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
+                AML_TYPE_METHOD_ARGUMENT, 0),
 /* 17 */ ACPI_OP("Arg3", ARGP_ARG3, ARGI_ARG3,
-                        ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
-                        AML_TYPE_METHOD_ARGUMENT, 0),
+                ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
+                AML_TYPE_METHOD_ARGUMENT, 0),
 /* 18 */ ACPI_OP("Arg4", ARGP_ARG4, ARGI_ARG4,
-                        ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
-                        AML_TYPE_METHOD_ARGUMENT, 0),
+                ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
+                AML_TYPE_METHOD_ARGUMENT, 0),
 /* 19 */ ACPI_OP("Arg5", ARGP_ARG5, ARGI_ARG5,
-                        ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
-                        AML_TYPE_METHOD_ARGUMENT, 0),
+                ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
+                AML_TYPE_METHOD_ARGUMENT, 0),
 /* 1A */ ACPI_OP("Arg6", ARGP_ARG6, ARGI_ARG6,
-                        ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
-                        AML_TYPE_METHOD_ARGUMENT, 0),
+                ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
+                AML_TYPE_METHOD_ARGUMENT, 0),
 /* 1B */ ACPI_OP("Store", ARGP_STORE_OP, ARGI_STORE_OP, ACPI_TYPE_ANY,
-                        AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R,
-                        AML_FLAGS_EXEC_1A_1T_1R),
+                AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R,
+                AML_FLAGS_EXEC_1A_1T_1R),
 /* 1C */ ACPI_OP("RefOf", ARGP_REF_OF_OP, ARGI_REF_OF_OP, ACPI_TYPE_ANY,
-                        AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R,
-                        AML_FLAGS_EXEC_1A_0T_1R),
+ &