Pull trivial into test branch
authorLen Brown <len.brown@intel.com>
Sat, 3 Feb 2007 06:39:07 +0000 (01:39 -0500)
committerLen Brown <len.brown@intel.com>
Sat, 3 Feb 2007 06:39:07 +0000 (01:39 -0500)
Conflicts:

drivers/acpi/scan.c

Signed-off-by: Len Brown <len.brown@intel.com>
406 files changed:
Documentation/feature-removal-schedule.txt
Documentation/sysrq.txt
MAINTAINERS
Makefile
arch/alpha/kernel/process.c
arch/arm/configs/at91sam9260ek_defconfig
arch/arm/configs/at91sam9261ek_defconfig
arch/arm/kernel/head.S
arch/arm/mach-at91rm9200/at91rm9200_devices.c
arch/arm/mach-at91rm9200/at91sam9260.c
arch/arm/mach-at91rm9200/at91sam9261.c
arch/arm/mach-at91rm9200/gpio.c
arch/arm/mach-imx/cpufreq.c
arch/arm/mach-s3c2410/gpio.c
arch/arm/mach-s3c2410/pm.c
arch/arm/mach-s3c2410/s3c2412-dma.c
arch/arm/mm/init.c
arch/arm/mm/ioremap.c
arch/arm/mm/proc-xscale.S
arch/arm/tools/mach-types
arch/arm/vfp/entry.S
arch/arm/vfp/vfp.h
arch/arm/vfp/vfphw.S
arch/arm/vfp/vfpmodule.c
arch/i386/boot/compressed/relocs.c
arch/i386/defconfig
arch/i386/kernel/acpi/boot.c
arch/i386/kernel/acpi/earlyquirk.c
arch/i386/kernel/cpu/cpufreq/longhaul.c
arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
arch/i386/kernel/cpu/cyrix.c
arch/i386/kernel/io_apic.c
arch/i386/kernel/mpparse.c
arch/i386/kernel/srat.c
arch/i386/mach-default/setup.c
arch/i386/mach-es7000/es7000.h
arch/i386/mach-es7000/es7000plat.c
arch/i386/pci/mmconfig.c
arch/ia64/kernel/acpi.c
arch/ia64/sn/kernel/io_acpi_init.c
arch/ia64/sn/kernel/io_common.c
arch/ia64/sn/kernel/io_init.c
arch/ia64/sn/kernel/iomv.c
arch/ia64/sn/pci/pcibr/pcibr_provider.c
arch/mips/mips-boards/malta/Makefile
arch/mips/mips-boards/sim/sim_setup.c
arch/mips/momentum/ocelot_g/prom.c
arch/mips/momentum/ocelot_g/setup.c
arch/sparc/kernel/process.c
arch/sparc/kernel/smp.c
arch/sparc/kernel/sun4d_smp.c
arch/um/Kconfig.i386
arch/um/sys-i386/signal.c
arch/um/sys-x86_64/signal.c
arch/x86_64/kernel/early-quirks.c
arch/x86_64/kernel/genapic.c
arch/x86_64/kernel/mpparse.c
arch/x86_64/kernel/time.c
arch/x86_64/mm/srat.c
arch/x86_64/pci/mmconfig.c
block/scsi_ioctl.c
drivers/acpi/Kconfig
drivers/acpi/Makefile
drivers/acpi/asus_acpi.c
drivers/acpi/battery.c
drivers/acpi/bay.c [new file with mode: 0644]
drivers/acpi/blacklist.c
drivers/acpi/bus.c
drivers/acpi/button.c
drivers/acpi/container.c
drivers/acpi/debug.c
drivers/acpi/dispatcher/dsfield.c
drivers/acpi/dispatcher/dsinit.c
drivers/acpi/dispatcher/dsmethod.c
drivers/acpi/dispatcher/dsmthdat.c
drivers/acpi/dispatcher/dsobject.c
drivers/acpi/dispatcher/dsopcode.c
drivers/acpi/dispatcher/dsutils.c
drivers/acpi/dispatcher/dswexec.c
drivers/acpi/dispatcher/dswload.c
drivers/acpi/dispatcher/dswscope.c
drivers/acpi/dispatcher/dswstate.c
drivers/acpi/dock.c
drivers/acpi/ec.c
drivers/acpi/events/evevent.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/evsci.c
drivers/acpi/events/evxface.c
drivers/acpi/events/evxfevnt.c
drivers/acpi/events/evxfregn.c
drivers/acpi/executer/exconfig.c
drivers/acpi/executer/exconvrt.c
drivers/acpi/executer/excreate.c
drivers/acpi/executer/exdump.c
drivers/acpi/executer/exfield.c
drivers/acpi/executer/exfldio.c
drivers/acpi/executer/exmisc.c
drivers/acpi/executer/exmutex.c
drivers/acpi/executer/exnames.c
drivers/acpi/executer/exoparg1.c
drivers/acpi/executer/exoparg2.c
drivers/acpi/executer/exoparg3.c
drivers/acpi/executer/exoparg6.c
drivers/acpi/executer/exprep.c
drivers/acpi/executer/exregion.c
drivers/acpi/executer/exresnte.c
drivers/acpi/executer/exresolv.c
drivers/acpi/executer/exresop.c
drivers/acpi/executer/exstore.c
drivers/acpi/executer/exstoren.c
drivers/acpi/executer/exstorob.c
drivers/acpi/executer/exsystem.c
drivers/acpi/executer/exutils.c
drivers/acpi/fan.c
drivers/acpi/glue.c
drivers/acpi/hardware/hwacpi.c
drivers/acpi/hardware/hwgpe.c
drivers/acpi/hardware/hwregs.c
drivers/acpi/hardware/hwsleep.c
drivers/acpi/hardware/hwtimer.c
drivers/acpi/motherboard.c [deleted file]
drivers/acpi/namespace/nsaccess.c
drivers/acpi/namespace/nsalloc.c
drivers/acpi/namespace/nsdump.c
drivers/acpi/namespace/nsdumpdv.c
drivers/acpi/namespace/nseval.c
drivers/acpi/namespace/nsinit.c
drivers/acpi/namespace/nsload.c
drivers/acpi/namespace/nsnames.c
drivers/acpi/namespace/nsobject.c
drivers/acpi/namespace/nsparse.c
drivers/acpi/namespace/nssearch.c
drivers/acpi/namespace/nsutils.c
drivers/acpi/namespace/nswalk.c
drivers/acpi/namespace/nsxfeval.c
drivers/acpi/namespace/nsxfname.c
drivers/acpi/namespace/nsxfobj.c
drivers/acpi/numa.c
drivers/acpi/osl.c
drivers/acpi/parser/psargs.c
drivers/acpi/parser/psloop.c
drivers/acpi/parser/psopcode.c
drivers/acpi/parser/psparse.c
drivers/acpi/parser/psscope.c
drivers/acpi/parser/pstree.c
drivers/acpi/parser/psutils.c
drivers/acpi/parser/pswalk.c
drivers/acpi/parser/psxface.c
drivers/acpi/pci_link.c
drivers/acpi/pci_root.c
drivers/acpi/processor_core.c
drivers/acpi/processor_idle.c
drivers/acpi/processor_perflib.c
drivers/acpi/processor_throttling.c
drivers/acpi/resources/rsaddr.c
drivers/acpi/resources/rscalc.c
drivers/acpi/resources/rscreate.c
drivers/acpi/resources/rsdump.c
drivers/acpi/resources/rsinfo.c
drivers/acpi/resources/rsio.c
drivers/acpi/resources/rsirq.c
drivers/acpi/resources/rslist.c
drivers/acpi/resources/rsmemory.c
drivers/acpi/resources/rsmisc.c
drivers/acpi/resources/rsutils.c
drivers/acpi/resources/rsxface.c
drivers/acpi/scan.c
drivers/acpi/sleep/proc.c
drivers/acpi/system.c
drivers/acpi/tables.c
drivers/acpi/tables/Makefile
drivers/acpi/tables/tbconvrt.c [deleted file]
drivers/acpi/tables/tbfadt.c [new file with mode: 0644]
drivers/acpi/tables/tbfind.c [new file with mode: 0644]
drivers/acpi/tables/tbget.c [deleted file]
drivers/acpi/tables/tbgetall.c [deleted file]
drivers/acpi/tables/tbinstal.c
drivers/acpi/tables/tbrsdt.c [deleted file]
drivers/acpi/tables/tbutils.c
drivers/acpi/tables/tbxface.c
drivers/acpi/tables/tbxfroot.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/uteval.c
drivers/acpi/utilities/utglobal.c
drivers/acpi/utilities/utinit.c
drivers/acpi/utilities/utmath.c
drivers/acpi/utilities/utmisc.c
drivers/acpi/utilities/utmutex.c
drivers/acpi/utilities/utobject.c
drivers/acpi/utilities/utresrc.c
drivers/acpi/utilities/utstate.c
drivers/acpi/utilities/utxface.c
drivers/acpi/video.c
drivers/ata/ahci.c
drivers/ata/libata-core.c
drivers/ata/libata-eh.c
drivers/ata/libata-scsi.c
drivers/ata/pata_atiixp.c
drivers/ata/pata_jmicron.c
drivers/ata/pata_platform.c
drivers/ata/pata_sil680.c
drivers/ata/pata_via.c
drivers/char/agp/amd-k7-agp.c
drivers/char/agp/amd64-agp.c
drivers/char/agp/ati-agp.c
drivers/char/agp/intel-agp.c
drivers/char/agp/via-agp.c
drivers/char/ipmi/ipmi_msghandler.c
drivers/char/ipmi/ipmi_si_intf.c
drivers/char/sysrq.c
drivers/char/tpm/tpm_bios.c
drivers/cpufreq/cpufreq.c
drivers/firmware/pcdp.c
drivers/hid/hid-core.c
drivers/hid/hid-input.c
drivers/ide/ide-pnp.c
drivers/ide/ide.c
drivers/ide/pci/aec62xx.c
drivers/ide/pci/alim15x3.c
drivers/ide/pci/amd74xx.c
drivers/ide/pci/atiixp.c
drivers/ide/pci/cmd64x.c
drivers/ide/pci/cs5520.c
drivers/ide/pci/cs5530.c
drivers/ide/pci/cy82c693.c
drivers/ide/pci/generic.c
drivers/ide/pci/hpt34x.c
drivers/ide/pci/hpt366.c
drivers/ide/pci/jmicron.c
drivers/ide/pci/ns87415.c
drivers/ide/pci/opti621.c
drivers/ide/pci/pdc202xx_new.c
drivers/ide/pci/pdc202xx_old.c
drivers/ide/pci/rz1000.c
drivers/ide/pci/sc1200.c
drivers/ide/pci/serverworks.c
drivers/ide/pci/sgiioc4.c
drivers/ide/pci/siimage.c
drivers/ide/pci/sis5513.c
drivers/ide/pci/sl82c105.c
drivers/ide/pci/slc90e66.c
drivers/ide/pci/triflex.c
drivers/ide/pci/trm290.c
drivers/ide/pci/via82cxxx.c
drivers/kvm/svm.c
drivers/kvm/vmx.c
drivers/misc/Kconfig
drivers/misc/Makefile
drivers/misc/asus-laptop.c [new file with mode: 0644]
drivers/mtd/nand/cafe.c
drivers/net/82596.c
drivers/net/b44.c
drivers/net/bnx2.c
drivers/net/bnx2.h
drivers/net/bonding/bonding.h
drivers/net/e100.c
drivers/net/ehea/ehea.h
drivers/net/ehea/ehea_main.c
drivers/net/fs_enet/mac-fec.c
drivers/net/fs_enet/mac-scc.c
drivers/net/hamradio/Kconfig
drivers/net/netxen/netxen_nic.h
drivers/net/netxen/netxen_nic_ethtool.c
drivers/net/netxen/netxen_nic_hw.c
drivers/net/netxen/netxen_nic_hw.h
drivers/net/netxen/netxen_nic_init.c
drivers/net/netxen/netxen_nic_isr.c
drivers/net/netxen/netxen_nic_main.c
drivers/net/netxen/netxen_nic_niu.c
drivers/net/phy/fixed.c
drivers/net/sky2.c
drivers/net/spider_net.c
drivers/pci/hotplug/acpiphp_glue.c
drivers/pci/hotplug/sgi_hotplug.c
drivers/pci/quirks.c
drivers/pci/search.c
drivers/pnp/pnpacpi/Kconfig
drivers/pnp/system.c
drivers/scsi/pcmcia/sym53c500_cs.c
drivers/serial/amba-pl010.c
drivers/serial/amba-pl011.c
drivers/serial/atmel_serial.c
drivers/serial/atmel_serial.h
drivers/usb/input/hid-core.c
fs/buffer.c
fs/fuse/control.c
fs/hostfs/hostfs.h
fs/hostfs/hostfs_kern.c
fs/hostfs/hostfs_user.c
fs/lockd/clntlock.c
fs/nfs/file.c
fs/nfsd/export.c
fs/nfsd/nfsfh.c
fs/nfsd/vfs.c
fs/ntfs/aops.c
fs/proc/base.c
fs/ufs/balloc.c
fs/ufs/inode.c
fs/ufs/truncate.c
include/acpi/acconfig.h
include/acpi/acdebug.h
include/acpi/acdisasm.h
include/acpi/acdispat.h
include/acpi/acevents.h
include/acpi/acexcep.h
include/acpi/acglobal.h
include/acpi/achware.h
include/acpi/acinterp.h
include/acpi/aclocal.h
include/acpi/acmacros.h
include/acpi/acnames.h
include/acpi/acnamesp.h
include/acpi/acobject.h
include/acpi/acopcode.h
include/acpi/acoutput.h
include/acpi/acparser.h
include/acpi/acpi.h
include/acpi/acpi_bus.h
include/acpi/acpi_drivers.h
include/acpi/acpiosxf.h
include/acpi/acpixf.h
include/acpi/acresrc.h
include/acpi/acstruct.h
include/acpi/actables.h
include/acpi/actbl.h
include/acpi/actbl1.h
include/acpi/actbl2.h [deleted file]
include/acpi/actbl71.h [deleted file]
include/acpi/actypes.h
include/acpi/acutils.h
include/acpi/amlcode.h
include/acpi/amlresrc.h
include/acpi/platform/acenv.h
include/acpi/platform/acgcc.h
include/acpi/platform/aclinux.h
include/asm-alpha/dma-mapping.h
include/asm-arm/arch-at91rm9200/at91_ecc.h
include/asm-arm/arch-at91rm9200/at91_pmc.h
include/asm-arm/arch-at91rm9200/at91_rstc.h
include/asm-arm/arch-at91rm9200/at91_rtc.h
include/asm-arm/arch-at91rm9200/at91rm9200.h
include/asm-arm/arch-at91rm9200/at91sam9260_matrix.h
include/asm-arm/arch-at91rm9200/at91sam9261_matrix.h
include/asm-arm/arch-at91rm9200/at91sam926x_mc.h
include/asm-arm/arch-s3c2410/regs-gpio.h
include/asm-arm/arch-s3c2410/regs-mem.h
include/asm-arm/fpstate.h
include/asm-frv/Kbuild
include/asm-frv/page.h
include/asm-frv/ptrace.h
include/asm-frv/termios.h
include/asm-i386/acpi.h
include/asm-i386/mach-es7000/mach_mpparse.h
include/asm-ia64/acpi.h
include/asm-ia64/pci.h
include/asm-ia64/sn/acpi.h
include/asm-ia64/sn/pcibr_provider.h
include/asm-ia64/sn/pcidev.h
include/asm-m68k/uaccess.h
include/asm-mips/pgtable.h
include/asm-powerpc/dma-mapping.h
include/asm-sparc/checksum.h
include/asm-um/pgtable.h
include/asm-x86_64/acpi.h
include/linux/acpi.h
include/linux/cdev.h
include/linux/efi.h
include/linux/hdreg.h
include/linux/hid.h
include/linux/i2o-dev.h
include/linux/libata.h
include/linux/pci_ids.h
include/linux/pid_namespace.h
include/sound/core.h
kernel/exit.c
kernel/fork.c
kernel/kprobes.c
kernel/pid.c
mm/filemap_xip.c
mm/mmap.c
mm/mremap.c
mm/page-writeback.c
mm/page_alloc.c
net/ipv4/netfilter/ip_conntrack_sip.c
net/ipv6/addrconf.c
net/ipv6/ndisc.c
net/netfilter/Kconfig
net/netfilter/nf_conntrack_sip.c
net/netfilter/xt_connbytes.c
net/sched/act_ipt.c
net/sctp/sm_sideeffect.c
net/sunrpc/svc.c
net/sunrpc/svcsock.c
scripts/Makefile.headersinst
sound/core/init.c
sound/core/sound.c
sound/core/sound_oss.c

index 0ba6af02cdaf9ce2b48b11767d54ad06d4ff918e..b3d1ce7e3ba020808797fa0fb5c6222b3669dce5 100644 (file)
@@ -274,6 +274,7 @@ Who:        Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
 
 ---------------------------
 
+<<<<<<< test:Documentation/feature-removal-schedule.txt
 What:  ACPI hotkey driver (CONFIG_ACPI_HOTKEY)
 When:  2.6.21
 Why:   hotkey.c was an attempt to consolidate multiple drivers that use
@@ -306,11 +307,18 @@ Why:      The ACPI namespace is effectively the symbol list for
        the BIOS can be extracted and disassembled with acpidump
        and iasl as documented in the pmtools package here:
        http://ftp.kernel.org/pub/linux/kernel/people/lenb/acpi/utils
-
 Who:   Len Brown <len.brown@intel.com>
 
 ---------------------------
 
+What:  ACPI procfs interface
+When:  July 2007
+Why:   After ACPI sysfs conversion, ACPI attributes will be duplicated
+       in sysfs and the ACPI procfs interface should be removed.
+Who:   Zhang Rui <rui.zhang@intel.com>
+
+---------------------------
+
 What:  /proc/acpi/button
 When:  August 2007
 Why:   /proc/acpi/button has been replaced by events to the input layer
index e0188a23fd5e7183768362da2ae4c5c72eebd059..61613166981b9139a5961fe0c3344cbd03286688 100644 (file)
@@ -1,6 +1,6 @@
 Linux Magic System Request Key Hacks
-Documentation for sysrq.c version 1.15
-Last update: $Date: 2001/01/28 10:15:59 $
+Documentation for sysrq.c
+Last update: 2007-JAN-06
 
 *  What is the magic SysRq key?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -35,7 +35,7 @@ You can set the value in the file by the following command:
 
 Note that the value of /proc/sys/kernel/sysrq influences only the invocation
 via a keyboard. Invocation of any operation via /proc/sysrq-trigger is always
-allowed.
+allowed (by a user with admin privileges).
 
 *  How do I use the magic SysRq key?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -58,7 +58,7 @@ On PowerPC - Press 'ALT - Print Screen (or F13) - <command key>,
 On other - If you know of the key combos for other architectures, please
            let me know so I can add them to this section.
 
-On all -  write a character to /proc/sysrq-trigger.  eg:
+On all -  write a character to /proc/sysrq-trigger.  e.g.:
 
                echo t > /proc/sysrq-trigger
 
@@ -74,6 +74,8 @@ On all -  write a character to /proc/sysrq-trigger.  eg:
 
 'c'    - Will perform a kexec reboot in order to take a crashdump.
 
+'d'    - Shows all locks that are held.
+
 'o'     - Will shut your system off (if configured and supported).
 
 's'     - Will attempt to sync all mounted filesystems.
@@ -87,38 +89,43 @@ On all -  write a character to /proc/sysrq-trigger.  eg:
 
 'm'     - Will dump current memory info to your console.
 
+'n'    - Used to make RT tasks nice-able
+
 'v'    - Dumps Voyager SMP processor info to your console.
 
+'w'    - Dumps tasks that are in uninterruptable (blocked) state.
+
+'x'    - Used by xmon interface on ppc/powerpc platforms.
+
 '0'-'9' - Sets the console log level, controlling which kernel messages
           will be printed to your console. ('0', for example would make
           it so that only emergency messages like PANICs or OOPSes would
           make it to your console.)
 
-'f'    - Will call oom_kill to kill a memory hog process
+'f'    - Will call oom_kill to kill a memory hog process.
 
 'e'     - Send a SIGTERM to all processes, except for init.
 
-'i'     - Send a SIGKILL to all processes, except for init.
+'g'    - Used by kgdb on ppc platforms.
 
-'l'     - Send a SIGKILL to all processes, INCLUDING init. (Your system
-          will be non-functional after this.)
+'i'     - Send a SIGKILL to all processes, except for init.
 
-'h'     - Will display help ( actually any other key than those listed
+'h'     - Will display help (actually any other key than those listed
           above will display help. but 'h' is easy to remember :-)
 
 *  Okay, so what can I use them for?
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Well, un'R'aw is very handy when your X server or a svgalib program crashes.
 
-sa'K' (Secure Access Key) is useful when you want to be sure there are no
-trojan program is running at console and which could grab your password
-when you would try to login. It will kill all programs on given console
-and thus letting you make sure that the login prompt you see is actually
+sa'K' (Secure Access Key) is useful when you want to be sure there is no
+trojan program running at console which could grab your password
+when you would try to login. It will kill all programs on given console,
+thus letting you make sure that the login prompt you see is actually
 the one from init, not some trojan program.
 IMPORTANT: In its true form it is not a true SAK like the one in a :IMPORTANT
 IMPORTANT: c2 compliant system, and it should not be mistaken as   :IMPORTANT
 IMPORTANT: such.                                                   :IMPORTANT
-       It seems other find it useful as (System Attention Key) which is
+       It seems others find it useful as (System Attention Key) which is
 useful when you want to exit a program that will not let you switch consoles.
 (For example, X or a svgalib program.)
 
@@ -139,8 +146,8 @@ OK or Done message...)
 Again, the unmount (remount read-only) hasn't taken place until you see the
 "OK" and "Done" message appear on the screen.
 
-The loglevel'0'-'9' is useful when your console is being flooded with
-kernel messages you do not want to see. Setting '0' will prevent all but
+The loglevels '0'-'9' are useful when your console is being flooded with
+kernel messages you do not want to see. Selecting '0' will prevent all but
 the most urgent kernel messages from reaching your console. (They will
 still be logged if syslogd/klogd are alive, though.)
 
@@ -152,7 +159,7 @@ processes.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 That happens to me, also. I've found that tapping shift, alt, and control
 on both sides of the keyboard, and hitting an invalid sysrq sequence again
-will fix the problem. (ie, something like alt-sysrq-z). Switching to another
+will fix the problem. (i.e., something like alt-sysrq-z). Switching to another
 virtual console (ALT+Fn) and then back again should also help.
 
 *  I hit SysRq, but nothing seems to happen, what's wrong?
@@ -174,11 +181,11 @@ handler function you will use, B) a help_msg string, that will print when SysRQ
 prints help, and C) an action_msg string, that will print right before your
 handler is called. Your handler must conform to the prototype in 'sysrq.h'.
 
-After the sysrq_key_op is created, you can call the macro 
-register_sysrq_key(int key, struct sysrq_key_op *op_p) that is defined in
-sysrq.h, this will register the operation pointed to by 'op_p' at table
-key 'key', if that slot in the table is blank. At module unload time, you must
-call the macro unregister_sysrq_key(int key, struct sysrq_key_op *op_p), which
+After the sysrq_key_op is created, you can call the kernel function
+register_sysrq_key(int key, struct sysrq_key_op *op_p); this will
+register the operation pointed to by 'op_p' at table key 'key',
+if that slot in the table is blank. At module unload time, you must call
+the function unregister_sysrq_key(int key, struct sysrq_key_op *op_p), which
 will remove the key op pointed to by 'op_p' from the key 'key', if and only if
 it is currently registered in that slot. This is in case the slot has been
 overwritten since you registered it.
@@ -186,15 +193,12 @@ overwritten since you registered it.
 The Magic SysRQ system works by registering key operations against a key op
 lookup table, which is defined in 'drivers/char/sysrq.c'. This key table has
 a number of operations registered into it at compile time, but is mutable,
-and 4 functions are exported for interface to it: __sysrq_lock_table,
-__sysrq_unlock_table, __sysrq_get_key_op, and __sysrq_put_key_op. The
-functions __sysrq_swap_key_ops and __sysrq_swap_key_ops_nolock are defined
-in the header itself, and the REGISTER and UNREGISTER macros are built from
-these. More complex (and dangerous!) manipulations of the table are possible
-using these functions, but you must be careful to always lock the table before
-you read or write from it, and to unlock it again when you are done. (And of
-course, to never ever leave an invalid pointer in the table). Null pointers in
-the table are always safe :)
+and 2 functions are exported for interface to it:
+       register_sysrq_key and unregister_sysrq_key.
+Of course, never ever leave an invalid pointer in the table. I.e., when
+your module that called register_sysrq_key() exits, it must call
+unregister_sysrq_key() to clean up the sysrq key table entry that it used.
+Null pointers in the table are always safe. :)
 
 If for some reason you feel the need to call the handle_sysrq function from
 within a function called by handle_sysrq, you must be aware that you are in
index f0596e452c5c9404c8e27e232e00dad79b29ca70..efca26a9242c807359b4a836dbbf223915ac1e8a 100644 (file)
@@ -584,6 +584,14 @@ W: http://sourceforge.net/projects/acpi4asus
 W:     http://xf.iksaif.net/acpi4asus
 S:     Maintained
 
+ASUS LAPTOP EXTRAS DRIVER
+P:     Corentin Chary
+M:     corentincj@iksaif.net
+L:     acpi4asus-user@lists.sourceforge.net
+W:     http://sourceforge.net/projects/acpi4asus
+W:     http://xf.iksaif.net/acpi4asus
+S:     Maintained
+
 ATA OVER ETHERNET DRIVER
 P:     Ed L. Cashin
 M:     ecashin@coraid.com
@@ -598,8 +606,6 @@ W:  http://linux-atm.sourceforge.net
 S:     Maintained
 
 ATMEL MACB ETHERNET DRIVER
-P:     Atmel AVR32 Support Team
-M:     avr32@atmel.com
 P:     Haavard Skinnemoen
 M:     hskinnemoen@atmel.com
 S:     Supported
@@ -620,8 +626,6 @@ T:  git kernel.org:/pub/scm/linux/kernel/git/dwmw2/audit-2.6.git
 S:     Maintained
 
 AVR32 ARCHITECTURE
-P:     Atmel AVR32 Support Team
-M:     avr32@atmel.com
 P:     Haavard Skinnemoen
 M:     hskinnemoen@atmel.com
 W:     http://www.atmel.com/products/AVR32/
@@ -630,8 +634,6 @@ W:  http://avrfreaks.net/
 S:     Supported
 
 AVR32/AT32AP MACHINE SUPPORT
-P:     Atmel AVR32 Support Team
-M:     avr32@atmel.com
 P:     Haavard Skinnemoen
 M:     hskinnemoen@atmel.com
 S:     Supported
@@ -1598,12 +1600,11 @@ M:      ipslinux@adaptec.com
 W:     http://www.developer.ibm.com/welcome/netfinity/serveraid.html
 S:     Supported 
 
-IDE DRIVER [GENERAL]
+IDE SUBSYSTEM
 P:     Bartlomiej Zolnierkiewicz
-M:     B.Zolnierkiewicz@elka.pw.edu.pl
-L:     linux-kernel@vger.kernel.org
+M:     bzolnier@gmail.com
 L:     linux-ide@vger.kernel.org
-T:     git kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6.git
+T:     quilt kernel.org/pub/linux/kernel/people/bart/pata-2.6/
 S:     Maintained
 
 IDE/ATAPI CDROM DRIVER
@@ -2289,7 +2290,7 @@ P:        Jozsef Kadlecsik
 P:     Patrick McHardy
 M:     kaber@trash.net
 L:     netfilter-devel@lists.netfilter.org
-L:     netfilter@lists.netfilter.org
+L:     netfilter@lists.netfilter.org (subscribers-only)
 L:     coreteam@netfilter.org
 W:     http://www.netfilter.org/
 W:     http://www.iptables.org/
@@ -3600,6 +3601,12 @@ M:       ysato@users.sourceforge.jp
 W:     http://uclinux-h8.sourceforge.jp/
 S:     Supported
 
+UFS FILESYSTEM
+P: Evgeniy Dushistov
+M: dushistov@mail.ru
+L: linux-kernel@vger.kernel.org
+S: Maintained
+
 USB DIAMOND RIO500 DRIVER
 P:     Cesar Miquel
 M:     miquel@df.uba.ar
index 9e1adac8aa282d0936efad3a39230d4e061698da..75adfb539977d42a35ee77913cbb102304b0f81f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 20
-EXTRAVERSION =-rc6
+EXTRAVERSION =-rc7
 NAME = Homicidal Dwarf Hamster
 
 # *DOCUMENTATION*
@@ -1116,15 +1116,15 @@ help:
        @echo  '  cscope          - Generate cscope index'
        @echo  '  kernelrelease   - Output the release version string'
        @echo  '  kernelversion   - Output the version stored in Makefile'
-       @if [ -r include/asm-$(ARCH)/Kbuild ]; then \
+       @if [ -r $(srctree)/include/asm-$(ARCH)/Kbuild ]; then \
         echo  '  headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \
+        echo  '                    (default: $(INSTALL_HDR_PATH))'; \
         fi
-       @echo  '                    (default: $(INSTALL_HDR_PATH))'
        @echo  ''
        @echo  'Static analysers'
        @echo  '  checkstack      - Generate a list of stack hogs'
        @echo  '  namespacecheck  - Name space analysis on compiled kernel'
-       @if [ -r include/asm-$(ARCH)/Kbuild ]; then \
+       @if [ -r $(srctree)/include/asm-$(ARCH)/Kbuild ]; then \
         echo  '  headers_check   - Sanity check on exported headers'; \
         fi
        @echo  ''
index 3370e6faeae022d5209e1bb05188959823e0a944..c151863906932239309079c0719d8d13b148b2b1 100644 (file)
@@ -47,6 +47,7 @@
  * Power off function, if any
  */
 void (*pm_power_off)(void) = machine_power_off;
+EXPORT_SYMBOL(pm_power_off);
 
 void
 cpu_idle(void)
index 79049206dfa5348192c29329f7f2f5a1afa6ff1a..46b0c734aeb92d90537ae62f2619c691d5041672 100644 (file)
@@ -923,7 +923,6 @@ CONFIG_FORCED_INLINING=y
 # CONFIG_HEADERS_CHECK is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 CONFIG_DEBUG_USER=y
-# CONFIG_DEBUG_WAITQ is not set
 # CONFIG_DEBUG_ERRORS is not set
 CONFIG_DEBUG_LL=y
 # CONFIG_DEBUG_ICEDCC is not set
index 784ad7c0186d8f342e5f9f8ef75111530c3a0cf1..fcd8fa091e9d3eaaea702e58513bb617714705a3 100644 (file)
@@ -1079,7 +1079,6 @@ CONFIG_FORCED_INLINING=y
 # CONFIG_HEADERS_CHECK is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 CONFIG_DEBUG_USER=y
-# CONFIG_DEBUG_WAITQ is not set
 # CONFIG_DEBUG_ERRORS is not set
 CONFIG_DEBUG_LL=y
 # CONFIG_DEBUG_ICEDCC is not set
index d994561816a1a15cdef675914fb1d675d23c2a5b..cf495a3084b31f8a7ead7089508ff16096864ae9 100644 (file)
 #include <asm/thread_info.h>
 #include <asm/system.h>
 
+#if (PHYS_OFFSET & 0x001fffff)
+#error "PHYS_OFFSET must be at an even 2MiB boundary!"
+#endif
+
 #define KERNEL_RAM_VADDR       (PAGE_OFFSET + TEXT_OFFSET)
 #define KERNEL_RAM_PADDR       (PHYS_OFFSET + TEXT_OFFSET)
 
@@ -251,7 +255,8 @@ __create_page_tables:
         * Then map first 1MB of ram in case it contains our boot params.
         */
        add     r0, r4, #PAGE_OFFSET >> 18
-       orr     r6, r7, #PHYS_OFFSET
+       orr     r6, r7, #(PHYS_OFFSET & 0xff000000)
+       orr     r6, r6, #(PHYS_OFFSET & 0x00e00000)
        str     r6, [r0]
 
 #ifdef CONFIG_XIP_KERNEL
index 4641b99db0ee1ca56b93be286952ddc763108256..57fac7203fe4f79f6ad639f1be651a12411bbe82 100644 (file)
@@ -272,7 +272,7 @@ void __init at91_add_device_cf(struct at91_cf_data *data)
        at91_set_A_periph(AT91_PIN_PC12, 0);    /* NCS6/CFCE2 */
 
        /* nWAIT is _not_ a default setting */
-       at91_set_A_periph(AT91_PIN_PC6, 1);     /*  nWAIT */
+       at91_set_A_periph(AT91_PIN_PC6, 1);     /* nWAIT */
 
        cf_data = *data;
        platform_device_register(&at91rm9200_cf_device);
index 203f073a53e657a55f58cc02e280a5864392b60e..b14871adc300151b4e8f73354690b34ba9319793 100644 (file)
@@ -16,6 +16,7 @@
 #include <asm/mach/map.h>
 #include <asm/arch/at91sam9260.h>
 #include <asm/arch/at91_pmc.h>
+#include <asm/arch/at91_rstc.h>
 
 #include "generic.h"
 #include "clock.h"
@@ -212,7 +213,7 @@ static struct at91_gpio_bank at91sam9260_gpio[] = {
 
 static void at91sam9260_reset(void)
 {
-#warning "Implement CPU reset"
+       at91_sys_write(AT91_RSTC_CR, (0xA5 << 24) | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
 }
 
 
index 5a82f35da2e948bdf6a65c1a686646fcf7b17e37..d242bb885c6dabc2c1302e4873f5644a3fdfaf67 100644 (file)
@@ -16,6 +16,7 @@
 #include <asm/mach/map.h>
 #include <asm/arch/at91sam9261.h>
 #include <asm/arch/at91_pmc.h>
+#include <asm/arch/at91_rstc.h>
 
 #include "generic.h"
 #include "clock.h"
@@ -207,7 +208,7 @@ static struct at91_gpio_bank at91sam9261_gpio[] = {
 
 static void at91sam9261_reset(void)
 {
-#warning "Implement CPU reset"
+       at91_sys_write(AT91_RSTC_CR, (0xA5 << 24) | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
 }
 
 
index 3f188508c39194aebab97e79871546a81eb8a0db..af22659c8a2895a4c90b66a2f8203790e6e509f4 100644 (file)
@@ -20,7 +20,6 @@
 #include <asm/io.h>
 #include <asm/hardware.h>
 #include <asm/arch/at91_pio.h>
-#include <asm/arch/at91_pmc.h>
 #include <asm/arch/gpio.h>
 
 #include "generic.h"
@@ -224,17 +223,17 @@ static u32 backups[MAX_GPIO_BANKS];
 static int gpio_irq_set_wake(unsigned pin, unsigned state)
 {
        unsigned        mask = pin_to_mask(pin);
+       unsigned        bank = (pin - PIN_BASE) / 32;
 
-       pin -= PIN_BASE;
-       pin /= 32;
-
-       if (unlikely(pin >= MAX_GPIO_BANKS))
+       if (unlikely(bank >= MAX_GPIO_BANKS))
                return -EINVAL;
 
        if (state)
-               wakeups[pin] |= mask;
+               wakeups[bank] |= mask;
        else
-               wakeups[pin] &= ~mask;
+               wakeups[bank] &= ~mask;
+
+       set_irq_wake(gpio[bank].id, state);
 
        return 0;
 }
@@ -246,29 +245,15 @@ void at91_gpio_suspend(void)
        for (i = 0; i < gpio_banks; i++) {
                u32 pio = gpio[i].offset;
 
-               /*
-                * Note: drivers should have disabled GPIO interrupts that
-                * aren't supposed to be wakeup sources.
-                * But that is not much good on ARM.....  disable_irq() does
-                * not update the hardware immediately, so the hardware mask
-                * (IMR) has the wrong value (not current, too much is
-                * permitted).
-                *
-                * Our workaround is to disable all non-wakeup IRQs ...
-                * which is exactly what correct drivers asked for in the
-                * first place!
-                */
                backups[i] = at91_sys_read(pio + PIO_IMR);
                at91_sys_write(pio + PIO_IDR, backups[i]);
                at91_sys_write(pio + PIO_IER, wakeups[i]);
 
-               if (!wakeups[i]) {
-                       disable_irq_wake(gpio[i].id);
-                       at91_sys_write(AT91_PMC_PCDR, 1 << gpio[i].id);
-               } else {
-                       enable_irq_wake(gpio[i].id);
+               if (!wakeups[i])
+                       clk_disable(gpio[i].clock);
+               else {
 #ifdef CONFIG_PM_DEBUG
-                       printk(KERN_DEBUG "GPIO-%c may wake for %08x\n", "ABCD"[i], wakeups[i]);
+                       printk(KERN_DEBUG "GPIO-%c may wake for %08x\n", 'A'+i, wakeups[i]);
 #endif
                }
        }
@@ -281,9 +266,11 @@ void at91_gpio_resume(void)
        for (i = 0; i < gpio_banks; i++) {
                u32 pio = gpio[i].offset;
 
+               if (!wakeups[i])
+                       clk_enable(gpio[i].clock);
+
                at91_sys_write(pio + PIO_IDR, wakeups[i]);
                at91_sys_write(pio + PIO_IER, backups[i]);
-               at91_sys_write(AT91_PMC_PCER, 1 << gpio[i].id);
        }
 }
 
index ac5f99895660fa3cf5ab3d4a374329d48bd7946a..4f66e90db74f934d7db83b00de0a824b0df1cd48 100644 (file)
@@ -184,6 +184,17 @@ static int imx_set_target(struct cpufreq_policy *policy,
        long sysclk;
        unsigned int bclk_div = 1;
 
+       /*
+        * Some governors do not respects CPU and policy lower limits
+        * which leads to bad things (division by zero etc), ensure
+        * that such things do not happen.
+        */
+       if(target_freq < policy->cpuinfo.min_freq)
+               target_freq = policy->cpuinfo.min_freq;
+
+       if(target_freq < policy->min)
+               target_freq = policy->min;
+
        freq = target_freq * 1000;
 
        pr_debug(KERN_DEBUG "imx: requested frequency %ld Hz, mpctl0 at boot 0x%08x\n",
@@ -258,7 +269,8 @@ static int __init imx_cpufreq_driver_init(struct cpufreq_policy *policy)
        policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
        policy->cpuinfo.min_freq = 8000;
        policy->cpuinfo.max_freq = 200000;
-       policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
+        /* Manual states, that PLL stabilizes in two CLK32 periods */
+       policy->cpuinfo.transition_latency = 4 * 1000000000LL / CLK32;
        return 0;
 }
 
index ba346546150b6b1cbb86ee2588ad15e6eaa0a726..f6fb215bb48c2a7d6f5dc108cc1ffe70ccd532c3 100644 (file)
@@ -57,6 +57,7 @@ void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function)
        case S3C2410_GPIO_SFN2:
        case S3C2410_GPIO_SFN3:
                if (pin < S3C2410_GPIO_BANKB) {
+                       function -= 1;
                        function &= 1;
                        function <<= S3C2410_GPIO_OFFSET(pin);
                } else {
@@ -83,15 +84,18 @@ EXPORT_SYMBOL(s3c2410_gpio_cfgpin);
 unsigned int s3c2410_gpio_getcfg(unsigned int pin)
 {
        void __iomem *base = S3C24XX_GPIO_BASE(pin);
-       unsigned long mask;
+       unsigned long val = __raw_readl(base);
 
        if (pin < S3C2410_GPIO_BANKB) {
-               mask = 1 << S3C2410_GPIO_OFFSET(pin);
+               val >>= S3C2410_GPIO_OFFSET(pin);
+               val &= 1;
+               val += 1;
        } else {
-               mask = 3 << S3C2410_GPIO_OFFSET(pin)*2;
+               val >>= S3C2410_GPIO_OFFSET(pin)*2;
+               val &= 3;
        }
 
-       return __raw_readl(base) & mask;
+       return val | S3C2410_GPIO_INPUT;
 }
 
 EXPORT_SYMBOL(s3c2410_gpio_getcfg);
index 00834097eb8244567e345f62b5c1b1afe7eca175..ebf294dd31da7cf25410ac4327f58a230833a1b9 100644 (file)
@@ -451,15 +451,14 @@ static void s3c2410_pm_check_resume_pin(unsigned int pin, unsigned int irqoffs)
                irqstate = s3c_irqwake_eintmask & (1L<<irqoffs);
 
        pinstate = s3c2410_gpio_getcfg(pin);
-       pinstate >>= S3C2410_GPIO_OFFSET(pin)*2;
 
        if (!irqstate) {
-               if (pinstate == 0x02)
+               if (pinstate == S3C2410_GPIO_IRQ)
                        DBG("Leaving IRQ %d (pin %d) enabled\n", irq, pin);
        } else {
-               if (pinstate == 0x02) {
+               if (pinstate == S3C2410_GPIO_IRQ) {
                        DBG("Disabling IRQ %d (pin %d)\n", irq, pin);
-                       s3c2410_gpio_cfgpin(pin, 0x00);
+                       s3c2410_gpio_cfgpin(pin, S3C2410_GPIO_INPUT);
                }
        }
 }
index fe71a8fdb87cd55eadc2fe751e32bb05a336a392..138f726ac6bfa8efcbd38bae070fb83ee5ecee40 100644 (file)
@@ -133,8 +133,8 @@ static struct s3c24xx_dma_map __initdata s3c2412_dma_mappings[] = {
 static void s3c2412_dma_select(struct s3c2410_dma_chan *chan,
                               struct s3c24xx_dma_map *map)
 {
-       writel(chan->regs + S3C2412_DMA_DMAREQSEL,
-              map->channels[0] | S3C2412_DMAREQSEL_HW);
+       writel(map->channels[0] | S3C2412_DMAREQSEL_HW,
+              chan->regs + S3C2412_DMA_DMAREQSEL);
 }
 
 static struct s3c24xx_dma_selection __initdata s3c2412_dma_sel = {
index b5814b4b6f35c6ffe392a358f884b04af3cb3a5f..7760193e74cc37fb29f632d673fe01b2dc6dc62c 100644 (file)
@@ -52,15 +52,18 @@ void show_mem(void)
        printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
 
        for_each_online_node(node) {
+               pg_data_t *n = NODE_DATA(node);
+               struct page *map = n->node_mem_map - n->node_start_pfn;
+
                for_each_nodebank (i,mi,node) {
                        unsigned int pfn1, pfn2;
                        struct page *page, *end;
 
-                       pfn1 = mi->bank[i].start >> PAGE_SHIFT;
-                       pfn2 = (mi->bank[i].size + mi->bank[i].start) >> PAGE_SHIFT;
+                       pfn1 = __phys_to_pfn(mi->bank[i].start);
+                       pfn2 = __phys_to_pfn(mi->bank[i].size + mi->bank[i].start);
 
-                       page = NODE_MEM_MAP(node) + pfn1;
-                       end  = NODE_MEM_MAP(node) + pfn2;
+                       page = map + pfn1;
+                       end  = map + pfn2;
 
                        do {
                                total++;
index 251685fe73a8841ec51190bf66f23fcf777009c9..0ac615c0f7987f81ccc7aa3a16c8ace113f65192 100644 (file)
@@ -300,7 +300,8 @@ __ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
        addr = (unsigned long)area->addr;
 
 #ifndef CONFIG_SMP
-       if ((((cpu_architecture() >= CPU_ARCH_ARMv6) && (get_cr() & CR_XP)) ||
+       if (DOMAIN_IO == 0 &&
+           (((cpu_architecture() >= CPU_ARCH_ARMv6) && (get_cr() & CR_XP)) ||
               cpu_is_xsc3()) &&
               !((__pfn_to_phys(pfn) | size | addr) & ~SUPERSECTION_MASK)) {
                area->flags |= VM_ARM_SECTION_MAPPING;
index 490e11b342319077e5c3be51c7e9a95562941991..d29fe927ee9e019ce60020c9f375957fe9073e76 100644 (file)
@@ -708,7 +708,7 @@ __8032x_proc_info:
        .type   __8033x_proc_info,#object
 __8033x_proc_info:
        .long   0x69054010
-       .long   0xffffff30
+       .long   0xfffffd30
        .long   PMD_TYPE_SECT | \
                PMD_SECT_BUFFERABLE | \
                PMD_SECT_CACHEABLE | \
index 8bcb838e5444278b66827826862b6542a4e3d0c7..bd78058b717852637dbbc2df88981138fbb5de09 100644 (file)
@@ -12,7 +12,7 @@
 #
 #   http://www.arm.linux.org.uk/developer/machines/?action=new
 #
-# Last update: Thu Dec 7 17:19:20 2006
+# Last update: Tue Jan 16 16:52:56 2007
 #
 # machine_is_xxx       CONFIG_xxxx             MACH_TYPE_xxx           number
 #
@@ -1219,3 +1219,26 @@ zevio_1020               MACH_ZEVIO_1020         ZEVIO_1020              1207
 hitrack                        MACH_HITRACK            HITRACK                 1208
 syme1                  MACH_SYME1              SYME1                   1209
 syhl1                  MACH_SYHL1              SYHL1                   1210
+empca400               MACH_EMPCA400           EMPCA400                1211
+em7210                 MACH_EM7210             EM7210                  1212
+htchermes              MACH_HTCHERMES          HTCHERMES               1213
+eti_c1                 MACH_ETI_C1             ETI_C1                  1214
+mach_dep2410           MACH_MACH_DEP2410       MACH_DEP2410            1215
+ac100                  MACH_AC100              AC100                   1216
+sneetch                        MACH_SNEETCH            SNEETCH                 1217
+studentmate            MACH_STUDENTMATE        STUDENTMATE             1218
+zir2410                        MACH_ZIR2410            ZIR2410                 1219
+zir2413                        MACH_ZIR2413            ZIR2413                 1220
+dlonip3                        MACH_DLONIP3            DLONIP3                 1221
+instream               MACH_INSTREAM           INSTREAM                1222
+ambarella              MACH_AMBARELLA          AMBARELLA               1223
+nevis                  MACH_NEVIS              NEVIS                   1224
+htc_trinity            MACH_HTC_TRINITY        HTC_TRINITY             1225
+ql202b                 MACH_QL202B             QL202B                  1226
+vpac270                        MACH_VPAC270            VPAC270                 1227
+rd129                  MACH_RD129              RD129                   1228
+htcwizard              MACH_HTCWIZARD          HTCWIZARD               1229
+xscale_treo680         MACH_XSCALE_TREO680     XSCALE_TREO680          1230
+tecon_tmezon           MACH_TECON_TMEZON       TECON_TMEZON            1231
+zylonite               MACH_ZYLONITE           ZYLONITE                1233
+gene1270               MACH_GENE1270           GENE1270                1234
index 7b595547c1c80c9a0333a58a75cc00283d3c8fb9..ca2a5ad19ea6a65ce9ee1c871a5b06fdcc9fab86 100644 (file)
@@ -25,6 +25,7 @@
 do_vfp:
        enable_irq
        ldr     r4, .LCvfp
+       ldr     r11, [r10, #TI_CPU]     @ CPU number
        add     r10, r10, #TI_VFPSTATE  @ r10 = workspace
        ldr     pc, [r4]                @ call VFP entry point
 
index f2797896e6d5dbcc488f5c9b0be9f1ce497d7843..54a2ad6d9ca25a314514b6e99543c392a37ddde9 100644 (file)
@@ -370,3 +370,7 @@ struct op {
        u32 (* const fn)(int dd, int dn, int dm, u32 fpscr);
        u32 flags;
 };
+
+#ifdef CONFIG_SMP
+extern void vfp_save_state(void *location, u32 fpexc);
+#endif
index e51e6679c402b39b461e16a2a0de65ca3326e789..d4b7b229631d5b3fe9db079a3aed284f656beadf 100644 (file)
@@ -65,6 +65,7 @@
 @  r2  = faulted PC+4
 @  r9  = successful return
 @  r10 = vfp_state union
+@  r11 = CPU number
 @  lr  = failure return
 
        .globl  vfp_support_entry
@@ -79,7 +80,7 @@ vfp_support_entry:
        DBGSTR1 "enable %x", r10
        ldr     r3, last_VFP_context_address
        orr     r1, r1, #FPEXC_ENABLE   @ user FPEXC has the enable bit set
-       ldr     r4, [r3]                @ last_VFP_context pointer
+       ldr     r4, [r3, r11, lsl #2]   @ last_VFP_context pointer
        bic     r5, r1, #FPEXC_EXCEPTION @ make sure exceptions are disabled
        cmp     r4, r10
        beq     check_for_exception     @ we are returning to the same
@@ -91,7 +92,9 @@ vfp_support_entry:
                                        @ exceptions, so we can get at the
                                        @ rest of it
 
+#ifndef CONFIG_SMP
        @ Save out the current registers to the old thread state
+       @ No need for SMP since this is not done lazily
 
        DBGSTR1 "save old state %p", r4
        cmp     r4, #0
@@ -105,10 +108,11 @@ vfp_support_entry:
        stmia   r4, {r1, r5, r6, r8}    @ save FPEXC, FPSCR, FPINST, FPINST2
                                        @ and point r4 at the word at the
                                        @ start of the register dump
+#endif
 
 no_old_VFP_process:
        DBGSTR1 "load state %p", r10
-       str     r10, [r3]               @ update the last_VFP_context pointer
+       str     r10, [r3, r11, lsl #2]  @ update the last_VFP_context pointer
                                        @ Load the saved state back into the VFP
        VFPFLDMIA r10                   @ reload the working registers while
                                        @ FPEXC is in a safe state
@@ -162,6 +166,24 @@ process_exception:
                                        @ required. If not, the user code will
                                        @ retry the faulted instruction
 
+#ifdef CONFIG_SMP
+       .globl  vfp_save_state
+       .type   vfp_save_state, %function
+vfp_save_state:
+       @ Save the current VFP state
+       @ r0 - save location
+       @ r1 - FPEXC
+       DBGSTR1 "save VFP state %p", r0
+       VFPFMRX r2, FPSCR               @ current status
+       VFPFMRX r3, FPINST              @ FPINST (always there, rev0 onwards)
+       tst     r1, #FPEXC_FPV2         @ is there an FPINST2 to read?
+       VFPFMRX r12, FPINST2, NE        @ FPINST2 if needed - avoids reading
+                                       @ nonexistant reg on rev0
+       VFPFSTMIA r0                    @ save the working registers
+       stmia   r0, {r1, r2, r3, r12}   @ save FPEXC, FPSCR, FPINST, FPINST2
+       mov     pc, lr
+#endif
+
 last_VFP_context_address:
        .word   last_VFP_context
 
index 490d9d18a7d1c166dbef16e988050ec870e406a8..f1e5951dc72188ce86c9ae880ccbef79621ae327 100644 (file)
@@ -28,7 +28,7 @@ void vfp_testing_entry(void);
 void vfp_support_entry(void);
 
 void (*vfp_vector)(void) = vfp_testing_entry;
-union vfp_state *last_VFP_context;
+union vfp_state *last_VFP_context[NR_CPUS];
 
 /*
  * Dual-use variable.
@@ -41,13 +41,35 @@ static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v)
 {
        struct thread_info *thread = v;
        union vfp_state *vfp;
+       __u32 cpu = thread->cpu;
 
        if (likely(cmd == THREAD_NOTIFY_SWITCH)) {
+               u32 fpexc = fmrx(FPEXC);
+
+#ifdef CONFIG_SMP
+               /*
+                * On SMP, if VFP is enabled, save the old state in
+                * case the thread migrates to a different CPU. The
+                * restoring is done lazily.
+                */
+               if ((fpexc & FPEXC_ENABLE) && last_VFP_context[cpu]) {
+                       vfp_save_state(last_VFP_context[cpu], fpexc);
+                       last_VFP_context[cpu]->hard.cpu = cpu;
+               }
+               /*
+                * Thread migration, just force the reloading of the
+                * state on the new CPU in case the VFP registers
+                * contain stale data.
+                */
+               if (thread->vfpstate.hard.cpu != cpu)
+                       last_VFP_context[cpu] = NULL;
+#endif
+
                /*
                 * Always disable VFP so we can lazily save/restore the
                 * old state.
                 */
-               fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_ENABLE);
+               fmxr(FPEXC, fpexc & ~FPEXC_ENABLE);
                return NOTIFY_DONE;
        }
 
@@ -68,8 +90,8 @@ static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v)
        }
 
        /* flush and release case: Per-thread VFP cleanup. */
-       if (last_VFP_context == vfp)
-               last_VFP_context = NULL;
+       if (last_VFP_context[cpu] == vfp)
+               last_VFP_context[cpu] = NULL;
 
        return NOTIFY_DONE;
 }
index 468da89153c470ee2311a30ac445cabd2301755b..881951ca03e1cc53be63665b5c717e04adf1d47a 100644 (file)
@@ -43,6 +43,8 @@ static int is_safe_abs_reloc(const char* sym_name)
                        /* Match found */
                        return 1;
        }
+       if (strncmp(sym_name, "__crc_", 6) == 0)
+               return 1;
        return 0;
 }
 
index 5d80edfc61b7f61f36ed0183c886921c8a79ffd1..bb0c376b62b32fcc8ee934ce281676908b6fd150 100644 (file)
@@ -466,7 +466,8 @@ CONFIG_FW_LOADER=y
 #
 # Plug and Play support
 #
-# CONFIG_PNP is not set
+CONFIG_PNP=y
+CONFIG_PNPACPI=y
 
 #
 # Block devices
index cbcb2c27f48b8e796b87fc79b7f0fd3c92c5e81b..e94aff6888cab7aca553870d908aacf04526914f 100644 (file)
@@ -66,7 +66,7 @@ static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) { return
 
 #define BAD_MADT_ENTRY(entry, end) (                                       \
                (!entry) || (unsigned long)entry + sizeof(*entry) > end ||  \
-               ((acpi_table_entry_header *)entry)->length < sizeof(*entry))
+               ((struct acpi_subtable_header *)entry)->length < sizeof(*entry))
 
 #define PREFIX                 "ACPI: "
 
@@ -79,7 +79,7 @@ int acpi_ioapic;
 int acpi_strict;
 EXPORT_SYMBOL(acpi_strict);
 
-acpi_interrupt_flags acpi_sci_flags __initdata;
+u8 acpi_sci_flags __initdata;
 int acpi_sci_override_gsi __initdata;
 int acpi_skip_timer_override __initdata;
 int acpi_use_timer_override __initdata;
@@ -92,11 +92,6 @@ static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
 #warning ACPI uses CMPXCHG, i486 and later hardware
 #endif
 
-#define MAX_MADT_ENTRIES       256
-u8 x86_acpiid_to_apicid[MAX_MADT_ENTRIES] =
-    {[0 ... MAX_MADT_ENTRIES - 1] = 0xff };
-EXPORT_SYMBOL(x86_acpiid_to_apicid);
-
 /* --------------------------------------------------------------------------
                               Boot-time Configuration
    -------------------------------------------------------------------------- */
@@ -166,30 +161,26 @@ char *__acpi_map_table(unsigned long phys, unsigned long size)
 
 #ifdef CONFIG_PCI_MMCONFIG
 /* The physical address of the MMCONFIG aperture.  Set from ACPI tables. */
-struct acpi_table_mcfg_config *pci_mmcfg_config;
+struct acpi_mcfg_allocation *pci_mmcfg_config;
 int pci_mmcfg_config_num;
 
-int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size)
+int __init acpi_parse_mcfg(struct acpi_table_header *header)
 {
        struct acpi_table_mcfg *mcfg;
        unsigned long i;
        int config_size;
 
-       if (!phys_addr || !size)
+       if (!header)
                return -EINVAL;
 
-       mcfg = (struct acpi_table_mcfg *)__acpi_map_table(phys_addr, size);
-       if (!mcfg) {
-               printk(KERN_WARNING PREFIX "Unable to map MCFG\n");
-               return -ENODEV;
-       }
+       mcfg = (struct acpi_table_mcfg *)header;
 
        /* how many config structures do we have */
        pci_mmcfg_config_num = 0;
-       i = size - sizeof(struct acpi_table_mcfg);
-       while (i >= sizeof(struct acpi_table_mcfg_config)) {
+       i = header->length - sizeof(struct acpi_table_mcfg);
+       while (i >= sizeof(struct acpi_mcfg_allocation)) {
                ++pci_mmcfg_config_num;
-               i -= sizeof(struct acpi_table_mcfg_config);
+               i -= sizeof(struct acpi_mcfg_allocation);
        };
        if (pci_mmcfg_config_num == 0) {
                printk(KERN_ERR PREFIX "MMCONFIG has no entries\n");
@@ -204,9 +195,9 @@ int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size)
                return -ENOMEM;
        }
 
-       memcpy(pci_mmcfg_config, &mcfg->config, config_size);
+       memcpy(pci_mmcfg_config, &mcfg[1], config_size);
        for (i = 0; i < pci_mmcfg_config_num; ++i) {
-               if (mcfg->config[i].base_reserved) {
+               if (pci_mmcfg_config[i].address > 0xFFFFFFFF) {
                        printk(KERN_ERR PREFIX
                               "MMCONFIG not in low 4GB of memory\n");
                        kfree(pci_mmcfg_config);
@@ -220,24 +211,24 @@ int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size)
 #endif                         /* CONFIG_PCI_MMCONFIG */
 
 #ifdef CONFIG_X86_LOCAL_APIC
-static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size)
+static int __init acpi_parse_madt(struct acpi_table_header *table)
 {
        struct acpi_table_madt *madt = NULL;
 
-       if (!phys_addr || !size || !cpu_has_apic)
+       if (!cpu_has_apic)
                return -EINVAL;
 
-       madt = (struct acpi_table_madt *)__acpi_map_table(phys_addr, size);
+       madt = (struct acpi_table_madt *)table;
        if (!madt) {
                printk(KERN_WARNING PREFIX "Unable to map MADT\n");
                return -ENODEV;
        }
 
-       if (madt->lapic_address) {
-               acpi_lapic_addr = (u64) madt->lapic_address;
+       if (madt->address) {
+               acpi_lapic_addr = (u64) madt->address;
 
                printk(KERN_DEBUG PREFIX "Local APIC address 0x%08x\n",
-                      madt->lapic_address);
+                      madt->address);
        }
 
        acpi_madt_oem_check(madt->header.oem_id, madt->header.oem_table_id);
@@ -246,21 +237,17 @@ static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size)
 }
 
 static int __init
-acpi_parse_lapic(acpi_table_entry_header * header, const unsigned long end)
+acpi_parse_lapic(struct acpi_subtable_header * header, const unsigned long end)
 {
-       struct acpi_table_lapic *processor = NULL;
+       struct acpi_madt_local_apic *processor = NULL;
 
-       processor = (struct acpi_table_lapic *)header;
+       processor = (struct acpi_madt_local_apic *)header;
 
        if (BAD_MADT_ENTRY(processor, end))
                return -EINVAL;
 
        acpi_table_print_madt_entry(header);
 
-       /* Record local apic id only when enabled */
-       if (processor->flags.enabled)
-               x86_acpiid_to_apicid[processor->acpi_id] = processor->id;
-
        /*
         * We need to register disabled CPU as well to permit
         * counting disabled CPUs. This allows us to size
@@ -269,18 +256,18 @@ acpi_parse_lapic(acpi_table_entry_header * header, const unsigned long end)
         * when we use CPU hotplug.
         */
        mp_register_lapic(processor->id,        /* APIC ID */
-                         processor->flags.enabled);    /* Enabled? */
+                         processor->lapic_flags & ACPI_MADT_ENABLED);  /* Enabled? */
 
        return 0;
 }
 
 static int __init
-acpi_parse_lapic_addr_ovr(acpi_table_entry_header * header,
+acpi_parse_lapic_addr_ovr(struct acpi_subtable_header * header,
                          const unsigned long end)
 {
-       struct acpi_table_lapic_addr_ovr *lapic_addr_ovr = NULL;
+       struct acpi_madt_local_apic_override *lapic_addr_ovr = NULL;
 
-       lapic_addr_ovr = (struct acpi_table_lapic_addr_ovr *)header;
+       lapic_addr_ovr = (struct acpi_madt_local_apic_override *)header;
 
        if (BAD_MADT_ENTRY(lapic_addr_ovr, end))
                return -EINVAL;
@@ -291,11 +278,11 @@ acpi_parse_lapic_addr_ovr(acpi_table_entry_header * header,
 }
 
 static int __init
-acpi_parse_lapic_nmi(acpi_table_entry_header * header, const unsigned long end)
+acpi_parse_lapic_nmi(struct acpi_subtable_header * header, const unsigned long end)
 {
-       struct acpi_table_lapic_nmi *lapic_nmi = NULL;
+       struct acpi_madt_local_apic_nmi *lapic_nmi = NULL;
 
-       lapic_nmi = (struct acpi_table_lapic_nmi *)header;
+       lapic_nmi = (struct acpi_madt_local_apic_nmi *)header;
 
        if (BAD_MADT_ENTRY(lapic_nmi, end))
                return -EINVAL;
@@ -313,11 +300,11 @@ acpi_parse_lapic_nmi(acpi_table_entry_header * header, const unsigned long end)
 #ifdef CONFIG_X86_IO_APIC
 
 static int __init
-acpi_parse_ioapic(acpi_table_entry_header * header, const unsigned long end)
+acpi_parse_ioapic(struct acpi_subtable_header * header, const unsigned long end)
 {
-       struct acpi_table_ioapic *ioapic = NULL;
+       struct acpi_madt_io_apic *ioapic = NULL;
 
-       ioapic = (struct acpi_table_ioapic *)header;
+       ioapic = (struct acpi_madt_io_apic *)header;
 
        if (BAD_MADT_ENTRY(ioapic, end))
                return -EINVAL;
@@ -342,11 +329,11 @@ static void __init acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
                polarity = 3;
 
        /* Command-line over-ride via acpi_sci= */
-       if (acpi_sci_flags.trigger)
-               trigger = acpi_sci_flags.trigger;
+       if (acpi_sci_flags & ACPI_MADT_TRIGGER_MASK)
+               trigger = (acpi_sci_flags & ACPI_MADT_TRIGGER_MASK) >> 2;
 
-       if (acpi_sci_flags.polarity)
-               polarity = acpi_sci_flags.polarity;
+       if (acpi_sci_flags & ACPI_MADT_POLARITY_MASK)
+               polarity = acpi_sci_flags & ACPI_MADT_POLARITY_MASK;
 
        /*
         * mp_config_acpi_legacy_irqs() already setup IRQs < 16
@@ -357,51 +344,52 @@ static void __init acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
 
        /*
         * stash over-ride to indicate we've been here
-        * and for later update of acpi_fadt
+        * and for later update of acpi_gbl_FADT
         */
        acpi_sci_override_gsi = gsi;
        return;
 }
 
 static int __init
-acpi_parse_int_src_ovr(acpi_table_entry_header * header,
+acpi_parse_int_src_ovr(struct acpi_subtable_header * header,
                       const unsigned long end)
 {
-       struct acpi_table_int_src_ovr *intsrc = NULL;
+       struct acpi_madt_interrupt_override *intsrc = NULL;
 
-       intsrc = (struct acpi_table_int_src_ovr *)header;
+       intsrc = (struct acpi_madt_interrupt_override *)header;
 
        if (BAD_MADT_ENTRY(intsrc, end))
                return -EINVAL;
 
        acpi_table_print_madt_entry(header);
 
-       if (intsrc->bus_irq == acpi_fadt.sci_int) {
+       if (intsrc->source_irq == acpi_gbl_FADT.sci_interrupt) {
                acpi_sci_ioapic_setup(intsrc->global_irq,
-                                     intsrc->flags.polarity,
-                                     intsrc->flags.trigger);
+                                     intsrc->inti_flags & ACPI_MADT_POLARITY_MASK,
+                                     (intsrc->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2);
                return 0;
        }
 
        if (acpi_skip_timer_override &&
-           intsrc->bus_irq == 0 && intsrc->global_irq == 2) {
+           intsrc->source_irq == 0 && intsrc->global_irq == 2) {
                printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n");
                return 0;
        }
 
-       mp_override_legacy_irq(intsrc->bus_irq,
-                              intsrc->flags.polarity,
-                              intsrc->flags.trigger, intsrc->global_irq);
+       mp_override_legacy_irq(intsrc->source_irq,
+                               intsrc->inti_flags & ACPI_MADT_POLARITY_MASK,
+                               (intsrc->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2,
+                               intsrc->global_irq);
 
        return 0;
 }
 
 static int __init
-acpi_parse_nmi_src(acpi_table_entry_header * header, const unsigned long end)
+acpi_parse_nmi_src(struct acpi_subtable_header * header, const unsigned long end)
 {
-       struct acpi_table_nmi_src *nmi_src = NULL;
+       struct acpi_madt_nmi_source *nmi_src = NULL;
 
-       nmi_src = (struct acpi_table_nmi_src *)header;
+       nmi_src = (struct acpi_madt_nmi_source *)header;
 
        if (BAD_MADT_ENTRY(nmi_src, end))
                return -EINVAL;
@@ -417,7 +405,7 @@ acpi_parse_nmi_src(acpi_table_entry_header * header, const unsigned long end)
 
 /*
  * acpi_pic_sci_set_trigger()
- * 
+ *
  * use ELCR to set PIC-mode trigger type for SCI
  *
  * If a PIC-mode SCI is not recognized or gives spurious IRQ7's
@@ -511,7 +499,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
 {
        struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        union acpi_object *obj;
-       struct acpi_table_lapic *lapic;
+       struct acpi_madt_local_apic *lapic;
        cpumask_t tmp_map, new_map;
        u8 physid;
        int cpu;
@@ -529,10 +517,10 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
                return -EINVAL;
        }
 
-       lapic = (struct acpi_table_lapic *)obj->buffer.pointer;
+       lapic = (struct acpi_madt_local_apic *)obj->buffer.pointer;
 
-       if ((lapic->header.type != ACPI_MADT_LAPIC) ||
-           (!lapic->flags.enabled)) {
+       if (lapic->header.type != ACPI_MADT_TYPE_LOCAL_APIC ||
+           !(lapic->lapic_flags & ACPI_MADT_ENABLED)) {
                kfree(buffer.pointer);
                return -EINVAL;
        }
@@ -544,7 +532,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
        buffer.pointer = NULL;
 
        tmp_map = cpu_present_map;
-       mp_register_lapic(physid, lapic->flags.enabled);
+       mp_register_lapic(physid, lapic->lapic_flags & ACPI_MADT_ENABLED);
 
        /*
         * If mp_register_lapic successfully generates a new logical cpu
@@ -566,14 +554,6 @@ EXPORT_SYMBOL(acpi_map_lsapic);
 
 int acpi_unmap_lsapic(int cpu)
 {
-       int i;
-
-       for_each_possible_cpu(i) {
-               if (x86_acpiid_to_apicid[i] == x86_cpu_to_apicid[cpu]) {
-                       x86_acpiid_to_apicid[i] = -1;
-                       break;
-               }
-       }
        x86_cpu_to_apicid[cpu] = -1;
        cpu_clear(cpu, cpu_present_map);
        num_processors--;
@@ -619,42 +599,36 @@ acpi_scan_rsdp(unsigned long start, unsigned long length)
        return 0;
 }
 
-static int __init acpi_parse_sbf(unsigned long phys_addr, unsigned long size)
+static int __init acpi_parse_sbf(struct acpi_table_header *table)
 {
-       struct acpi_table_sbf *sb;
-
-       if (!phys_addr || !size)
-               return -EINVAL;
+       struct acpi_table_boot *sb;
 
-       sb = (struct acpi_table_sbf *)__acpi_map_table(phys_addr, size);
+       sb = (struct acpi_table_boot *)table;
        if (!sb) {
                printk(KERN_WARNING PREFIX "Unable to map SBF\n");
                return -ENODEV;
        }
 
-       sbf_port = sb->sbf_cmos;        /* Save CMOS port */
+       sbf_port = sb->cmos_index;      /* Save CMOS port */
 
        return 0;
 }
 
 #ifdef CONFIG_HPET_TIMER
 
-static int __init acpi_parse_hpet(unsigned long phys, unsigned long size)
+static int __init acpi_parse_hpet(struct acpi_table_header *table)
 {
        struct acpi_table_hpet *hpet_tbl;
        struct resource *hpet_res;
        resource_size_t res_start;
 
-       if (!phys || !size)
-               return -EINVAL;
-
-       hpet_tbl = (struct acpi_table_hpet *)__acpi_map_table(phys, size);
+       hpet_tbl = (struct acpi_table_hpet *)table;
        if (!hpet_tbl) {
                printk(KERN_WARNING PREFIX "Unable to map HPET\n");
                return -ENODEV;
        }
 
-       if (hpet_tbl->addr.space_id != ACPI_SPACE_MEM) {
+       if (hpet_tbl->address.space_id != ACPI_SPACE_MEM) {
                printk(KERN_WARNING PREFIX "HPET timers must be located in "
                       "memory.\n");
                return -1;
@@ -667,29 +641,28 @@ static int __init acpi_parse_hpet(unsigned long phys, unsigned long size)
                hpet_res->name = (void *)&hpet_res[1];
                hpet_res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
                snprintf((char *)hpet_res->name, HPET_RESOURCE_NAME_SIZE,
-                        "HPET %u", hpet_tbl->number);
+                        "HPET %u", hpet_tbl->sequence);
                hpet_res->end = (1 * 1024) - 1;
        }
 
-#ifdef CONFIG_X86_64
-       vxtime.hpet_address = hpet_tbl->addr.addrl |
-           ((long)hpet_tbl->addr.addrh << 32);
+#ifdef CONFIG_X86_64
+       vxtime.hpet_address = hpet_tbl->address.address;
 
        printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
-              hpet_tbl->id, vxtime.hpet_address);
+               hpet_tbl->id, vxtime.hpet_address);
 
        res_start = vxtime.hpet_address;
-#else                          /* X86 */
+#else                          /* X86 */
        {
                extern unsigned long hpet_address;
 
-               hpet_address = hpet_tbl->addr.addrl;
+               hpet_address = hpet_tbl->address.address;
                printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
-                      hpet_tbl->id, hpet_address);
+                       hpet_tbl->id, hpet_address);
 
                res_start = hpet_address;
        }
-#endif                         /* X86 */
+#endif                         /* X86 */
 
        if (hpet_res) {
                hpet_res->start = res_start;
@@ -707,42 +680,28 @@ static int __init acpi_parse_hpet(unsigned long phys, unsigned long size)
 extern u32 pmtmr_ioport;
 #endif
 
-static int __init acpi_parse_fadt(unsigned long phys, unsigned long size)
+static int __init acpi_parse_fadt(struct acpi_table_header *table)
 {
-       struct fadt_descriptor *fadt = NULL;
-
-       fadt = (struct fadt_descriptor *)__acpi_map_table(phys, size);
-       if (!fadt) {
-               printk(KERN_WARNING PREFIX "Unable to map FADT\n");
-               return 0;
-       }
-       /* initialize sci_int early for INT_SRC_OVR MADT parsing */
-       acpi_fadt.sci_int = fadt->sci_int;
-
-       /* initialize rev and apic_phys_dest_mode for x86_64 genapic */
-       acpi_fadt.revision = fadt->revision;
-       acpi_fadt.force_apic_physical_destination_mode =
-           fadt->force_apic_physical_destination_mode;
 
 #ifdef CONFIG_X86_PM_TIMER
        /* detect the location of the ACPI PM Timer */
-       if (fadt->revision >= FADT2_REVISION_ID) {
+       if (acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID) {
                /* FADT rev. 2 */
-               if (fadt->xpm_tmr_blk.address_space_id !=
+               if (acpi_gbl_FADT.xpm_timer_block.space_id !=
                    ACPI_ADR_SPACE_SYSTEM_IO)
                        return 0;
 
-               pmtmr_ioport = fadt->xpm_tmr_blk.address;
+               pmtmr_ioport = acpi_gbl_FADT.xpm_timer_block.address;
                /*
                 * "X" fields are optional extensions to the original V1.0
                 * fields, so we must selectively expand V1.0 fields if the
                 * corresponding X field is zero.
                 */
                if (!pmtmr_ioport)
-                       pmtmr_ioport = fadt->V1_pm_tmr_blk;
+                       pmtmr_ioport = acpi_gbl_FADT.pm_timer_block;
        } else {
                /* FADT rev. 1 */
-               pmtmr_ioport = fadt->V1_pm_tmr_blk;
+               pmtmr_ioport = acpi_gbl_FADT.pm_timer_block;
        }
        if (pmtmr_ioport)
                printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n",
@@ -784,13 +743,13 @@ static int __init acpi_parse_madt_lapic_entries(void)
        if (!cpu_has_apic)
                return -ENODEV;
 
-       /* 
+       /*
         * Note that the LAPIC address is obtained from the MADT (32-bit value)
         * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value).
         */
 
        count =
-           acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR,
+           acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE,
                                  acpi_parse_lapic_addr_ovr, 0);
        if (count < 0) {
                printk(KERN_ERR PREFIX
@@ -800,7 +759,7 @@ static int __init acpi_parse_madt_lapic_entries(void)
 
        mp_register_lapic_address(acpi_lapic_addr);
 
-       count = acpi_table_parse_madt(ACPI_MADT_LAPIC, acpi_parse_lapic,
+       count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC, acpi_parse_lapic,
                                      MAX_APICS);
        if (!count) {
                printk(KERN_ERR PREFIX "No LAPIC entries present\n");
@@ -813,7 +772,7 @@ static int __init acpi_parse_madt_lapic_entries(void)
        }
 
        count =
-           acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0);
+           acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_NMI, acpi_parse_lapic_nmi, 0);
        if (count < 0) {
                printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
                /* TBD: Cleanup to allow fallback to MPS */
@@ -842,7 +801,7 @@ static int __init acpi_parse_madt_ioapic_entries(void)
                return -ENODEV;
        }
 
-       if (!cpu_has_apic) 
+       if (!cpu_has_apic)
                return -ENODEV;
 
        /*
@@ -855,7 +814,7 @@ static int __init acpi_parse_madt_ioapic_entries(void)
        }
 
        count =
-           acpi_table_parse_madt(ACPI_MADT_IOAPIC, acpi_parse_ioapic,
+           acpi_table_parse_madt(ACPI_MADT_TYPE_IO_APIC, acpi_parse_ioapic,
                                  MAX_IO_APICS);
        if (!count) {
                printk(KERN_ERR PREFIX "No IOAPIC entries present\n");
@@ -866,7 +825,7 @@ static int __init acpi_parse_madt_ioapic_entries(void)
        }
 
        count =
-           acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr,
+           acpi_table_parse_madt(ACPI_MADT_TYPE_INTERRUPT_OVERRIDE, acpi_parse_int_src_ovr,
                                  NR_IRQ_VECTORS);
        if (count < 0) {
                printk(KERN_ERR PREFIX
@@ -880,13 +839,13 @@ static int __init acpi_parse_madt_ioapic_entries(void)
         * pretend we got one so we can set the SCI flags.
         */
        if (!acpi_sci_override_gsi)
-               acpi_sci_ioapic_setup(acpi_fadt.sci_int, 0, 0);
+               acpi_sci_ioapic_setup(acpi_gbl_FADT.sci_interrupt, 0, 0);
 
        /* Fill in identity legacy mapings where no override */
        mp_config_acpi_legacy_irqs();
 
        count =
-           acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src,
+           acpi_table_parse_madt(ACPI_MADT_TYPE_NMI_SOURCE, acpi_parse_nmi_src,
                                  NR_IRQ_VECTORS);
        if (count < 0) {
                printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
@@ -908,7 +867,7 @@ static void __init acpi_process_madt(void)
 #ifdef CONFIG_X86_LOCAL_APIC
        int count, error;
 
-       count = acpi_table_parse(ACPI_APIC, acpi_parse_madt);
+       count = acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt);
        if (count >= 1) {
 
                /*
@@ -1195,7 +1154,7 @@ int __init acpi_boot_table_init(void)
        if (acpi_disabled && !acpi_ht)
                return 1;
 
-       /* 
+       /*
         * Initialize the ACPI boot-time table parser.
         */
        error = acpi_table_init();
@@ -1204,7 +1163,7 @@ int __init acpi_boot_table_init(void)
                return error;
        }
 
-       acpi_table_parse(ACPI_BOOT, acpi_parse_sbf);
+       acpi_table_parse(ACPI_SIG_BOOT, acpi_parse_sbf);
 
        /*
         * blacklist may disable ACPI entirely
@@ -1232,19 +1191,19 @@ int __init acpi_boot_init(void)
        if (acpi_disabled && !acpi_ht)
                return 1;
 
-       acpi_table_parse(ACPI_BOOT, acpi_parse_sbf);
+       acpi_table_parse(ACPI_SIG_BOOT, acpi_parse_sbf);
 
        /*
         * set sci_int and PM timer address
         */
-       acpi_table_parse(ACPI_FADT, acpi_parse_fadt);
+       acpi_table_parse(ACPI_SIG_FADT, acpi_parse_fadt);
 
        /*
         * Process the Multiple APIC Description Table (MADT), if present
         */
        acpi_process_madt();
 
-       acpi_table_parse(ACPI_HPET, acpi_parse_hpet);
+       acpi_table_parse(ACPI_SIG_HPET, acpi_parse_hpet);
 
        return 0;
 }
@@ -1315,13 +1274,17 @@ static int __init setup_acpi_sci(char *s)
        if (!s)
                return -EINVAL;
        if (!strcmp(s, "edge"))
-               acpi_sci_flags.trigger = 1;
+               acpi_sci_flags =  ACPI_MADT_TRIGGER_EDGE |
+                       (acpi_sci_flags & ~ACPI_MADT_TRIGGER_MASK);
        else if (!strcmp(s, "level"))
-               acpi_sci_flags.trigger = 3;
+               acpi_sci_flags = ACPI_MADT_TRIGGER_LEVEL |
+                       (acpi_sci_flags & ~ACPI_MADT_TRIGGER_MASK);
        else if (!strcmp(s, "high"))
-               acpi_sci_flags.polarity = 1;
+               acpi_sci_flags = ACPI_MADT_POLARITY_ACTIVE_HIGH |
+                       (acpi_sci_flags & ~ACPI_MADT_POLARITY_MASK);
        else if (!strcmp(s, "low"))
-               acpi_sci_flags.polarity = 3;
+               acpi_sci_flags = ACPI_MADT_POLARITY_ACTIVE_LOW |
+                       (acpi_sci_flags & ~ACPI_MADT_POLARITY_MASK);
        else
                return -EINVAL;
        return 0;
index 4b60af7f91dd0c915c42f24d09976254b7c42353..bf86f7662d8b7a4c6210ff6e537502db624e27b6 100644 (file)
@@ -16,7 +16,7 @@
 
 static int nvidia_hpet_detected __initdata;
 
-static int __init nvidia_hpet_check(unsigned long phys, unsigned long size)
+static int __init nvidia_hpet_check(struct acpi_table_header *header)
 {
        nvidia_hpet_detected = 1;
        return 0;
@@ -30,7 +30,7 @@ static int __init check_bridge(int vendor, int device)
           is enabled. */
        if (!acpi_use_timer_override && vendor == PCI_VENDOR_ID_NVIDIA) {
                nvidia_hpet_detected = 0;
-               acpi_table_parse(ACPI_HPET, nvidia_hpet_check);
+               acpi_table_parse(ACPI_SIG_HPET, nvidia_hpet_check);
                if (nvidia_hpet_detected == 0) {
                        acpi_skip_timer_override = 1;
                          printk(KERN_INFO "Nvidia board "
index e940e00b96c99df51836d78ef3ab54e290d59ffa..a3db9332d652eccbc9c3745b55aaf309c4eebbe7 100644 (file)
@@ -190,7 +190,7 @@ static void do_powersaver(int cx_address, unsigned int clock_ratio_index)
                /* Invoke C3 */
                inb(cx_address);
                /* Dummy op - must do something useless after P_LVL3 read */
-               t = inl(acpi_fadt.xpm_tmr_blk.address);
+               t = inl(acpi_gbl_FADT.xpm_timer_block.address);
        }
        /* Disable bus ratio bit */
        local_irq_disable();
@@ -250,8 +250,7 @@ static void longhaul_setstate(unsigned int clock_ratio_index)
                outb(3, 0x22);
        } else if ((pr != NULL) && pr->flags.bm_control) {
                /* Disable bus master arbitration */
-               acpi_set_register(ACPI_BITREG_ARB_DISABLE, 1,
-                                 ACPI_MTX_DO_NOT_LOCK);
+               acpi_set_register(ACPI_BITREG_ARB_DISABLE, 1);
        }
        switch (longhaul_version) {
 
@@ -281,8 +280,7 @@ static void longhaul_setstate(unsigned int clock_ratio_index)
        case TYPE_POWERSAVER:
                if (longhaul_flags & USE_ACPI_C3) {
                        /* Don't allow wakeup */
-                       acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 0,
-                                         ACPI_MTX_DO_NOT_LOCK);
+                       acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 0);
                        do_powersaver(cx->address, clock_ratio_index);
                } else {
                        do_powersaver(0, clock_ratio_index);
@@ -295,8 +293,7 @@ static void longhaul_setstate(unsigned int clock_ratio_index)
                outb(0, 0x22);
        } else if ((pr != NULL) && pr->flags.bm_control) {
                /* Enable bus master arbitration */
-               acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0,
-                                 ACPI_MTX_DO_NOT_LOCK);
+               acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0);
        }
        outb(pic2_mask,0xA1);   /* restore mask */
        outb(pic1_mask,0x21);
@@ -414,7 +411,7 @@ static int __init longhaul_get_ranges(void)
        highest_speed = calc_speed(maxmult);
        lowest_speed = calc_speed(minmult);
        dprintk ("FSB:%dMHz  Lowest speed: %s   Highest speed:%s\n", fsb,
-                print_speed(lowest_speed/1000), 
+                print_speed(lowest_speed/1000),
                 print_speed(highest_speed/1000));
 
        if (lowest_speed == highest_speed) {
@@ -498,7 +495,7 @@ static void __init longhaul_setup_voltagescaling(void)
                maxvid.mV/1000, maxvid.mV%1000,
                minvid.mV/1000, minvid.mV%1000,
                numvscales);
-       
+
        j = 0;
        while (longhaul_table[j].frequency != CPUFREQ_TABLE_END) {
                speed = longhaul_table[j].frequency;
index bec50170b75a46816ac7b679aaac67b3a0abd7be..4786fedca6ebfcc94897f6e8d84581f61189c2e4 100644 (file)
@@ -51,7 +51,6 @@ enum {
 
 
 static int has_N44_O17_errata[NR_CPUS];
-static int has_N60_errata[NR_CPUS];
 static unsigned int stock_freq;
 static struct cpufreq_driver p4clockmod_driver;
 static unsigned int cpufreq_p4_get(unsigned int cpu);
@@ -224,12 +223,6 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
        case 0x0f12:
                has_N44_O17_errata[policy->cpu] = 1;
                dprintk("has errata -- disabling low frequencies\n");
-               break;
-
-       case 0x0f29:
-               has_N60_errata[policy->cpu] = 1;
-               dprintk("has errata -- disabling frequencies lower than 2ghz\n");
-               break;
        }
 
        /* get max frequency */
@@ -241,8 +234,6 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
        for (i=1; (p4clockmod_table[i].frequency != CPUFREQ_TABLE_END); i++) {
                if ((i<2) && (has_N44_O17_errata[policy->cpu]))
                        p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID;
-               else if (has_N60_errata[policy->cpu] && ((stock_freq * i)/8) < 2000000)
-                       p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID;
                else
                        p4clockmod_table[i].frequency = (stock_freq * i)/8;
        }
index abcff92f994c06eafd9aa52f13b1401498c789fa..c0c3b59de32c4d183b677e843ffacffa5aa2f1bb 100644 (file)
@@ -173,7 +173,7 @@ static void __cpuinit geode_configure(void)
        ccr4 = getCx86(CX86_CCR4);
        ccr4 |= 0x38;           /* FPU fast, DTE cache, Mem bypass */
        
-       setCx86(CX86_CCR4, ccr4);
+       setCx86(CX86_CCR3, ccr3);
        
        set_cx86_memwb();
        set_cx86_reorder();     
index 2424cc9c7b3d60d1d673ee1668a8cb27db28344e..6a3875f81a0a9ff5c2cce422f0c0f8fbd31410f8 100644 (file)
@@ -1227,26 +1227,32 @@ static u8 irq_vector[NR_IRQ_VECTORS] __read_mostly = { FIRST_DEVICE_VECTOR , 0 }
 
 static int __assign_irq_vector(int irq)
 {
-       static int current_vector = FIRST_DEVICE_VECTOR, offset = 0;
-       int vector;
+       static int current_vector = FIRST_DEVICE_VECTOR, current_offset = 0;
+       int vector, offset, i;
 
        BUG_ON((unsigned)irq >= NR_IRQ_VECTORS);
 
        if (irq_vector[irq] > 0)
                return irq_vector[irq];
 
-       current_vector += 8;
-       if (current_vector == SYSCALL_VECTOR)
-               current_vector += 8;
-
-       if (current_vector >= FIRST_SYSTEM_VECTOR) {
-               offset++;
-               if (!(offset % 8))
-                       return -ENOSPC;
-               current_vector = FIRST_DEVICE_VECTOR + offset;
-       }
-
        vector = current_vector;
+       offset = current_offset;
+next:
+       vector += 8;
+       if (vector >= FIRST_SYSTEM_VECTOR) {
+               offset = (offset + 1) % 8;
+               vector = FIRST_DEVICE_VECTOR + offset;
+       }
+       if (vector == current_vector)
+               return -ENOSPC;
+       if (vector == SYSCALL_VECTOR)
+               goto next;
+       for (i = 0; i < NR_IRQ_VECTORS; i++)
+               if (irq_vector[i] == vector)
+                       goto next;
+
+       current_vector = vector;
+       current_offset = offset;
        irq_vector[irq] = vector;
 
        return vector;
index 49bff3596bffd980862fcfd4480268a6b55131c1..4f5983c98669ad3ac42969c0fbc9b91ebd8e3472 100644 (file)
@@ -1057,7 +1057,7 @@ int mp_register_gsi(u32 gsi, int triggering, int polarity)
        static int              gsi_to_irq[MAX_GSI_NUM];
 
        /* Don't set up the ACPI SCI because it's already set up */
-       if (acpi_fadt.sci_int == gsi)
+       if (acpi_gbl_FADT.sci_interrupt == gsi)
                return gsi;
 
        ioapic = mp_find_ioapic(gsi);
@@ -1114,7 +1114,7 @@ int mp_register_gsi(u32 gsi, int triggering, int polarity)
                        /*
                         * Don't assign IRQ used by ACPI SCI
                         */
-                       if (gsi == acpi_fadt.sci_int)
+                       if (gsi == acpi_gbl_FADT.sci_interrupt)
                                gsi = pci_irq++;
                        gsi_to_irq[irq] = gsi;
                } else {
index f7e735c077c35df71c4ae0c2262113f3ea7a92e4..2a8713ec0f9aa7823ad0ec9a5cc53eadea4e8ecb 100644 (file)
@@ -62,19 +62,19 @@ extern void * boot_ioremap(unsigned long, unsigned long);
 /* Identify CPU proximity domains */
 static void __init parse_cpu_affinity_structure(char *p)
 {
-       struct acpi_table_processor_affinity *cpu_affinity = 
-                               (struct acpi_table_processor_affinity *) p;
+       struct acpi_srat_cpu_affinity *cpu_affinity =
+                               (struct acpi_srat_cpu_affinity *) p;
 
-       if (!cpu_affinity->flags.enabled)
+       if ((cpu_affinity->flags & ACPI_SRAT_CPU_ENABLED) == 0)
                return;         /* empty entry */
 
        /* mark this node as "seen" in node bitmap */
-       BMAP_SET(pxm_bitmap, cpu_affinity->proximity_domain);
+       BMAP_SET(pxm_bitmap, cpu_affinity->proximity_domain_lo);
 
-       apicid_to_pxm[cpu_affinity->apic_id] = cpu_affinity->proximity_domain;
+       apicid_to_pxm[cpu_affinity->apic_id] = cpu_affinity->proximity_domain_lo;
 
        printk("CPU 0x%02X in proximity domain 0x%02X\n",
-               cpu_affinity->apic_id, cpu_affinity->proximity_domain);
+               cpu_affinity->apic_id, cpu_affinity->proximity_domain_lo);
 }
 
 /*
@@ -84,28 +84,27 @@ static void __init parse_cpu_affinity_structure(char *p)
 static void __init parse_memory_affinity_structure (char *sratp)
 {
        unsigned long long paddr, size;
-       unsigned long start_pfn, end_pfn; 
+       unsigned long start_pfn, end_pfn;
        u8 pxm;
        struct node_memory_chunk_s *p, *q, *pend;
-       struct acpi_table_memory_affinity *memory_affinity =
-                       (struct acpi_table_memory_affinity *) sratp;
+       struct acpi_srat_mem_affinity *memory_affinity =
+                       (struct acpi_srat_mem_affinity *) sratp;
 
-       if (!memory_affinity->flags.enabled)
+       if ((memory_affinity->flags & ACPI_SRAT_MEM_ENABLED) == 0)
                return;         /* empty entry */
 
+       pxm = memory_affinity->proximity_domain & 0xff;
+
        /* mark this node as "seen" in node bitmap */
-       BMAP_SET(pxm_bitmap, memory_affinity->proximity_domain);
+       BMAP_SET(pxm_bitmap, pxm);
 
        /* calculate info for memory chunk structure */
-       paddr = memory_affinity->base_addr_hi;
-       paddr = (paddr << 32) | memory_affinity->base_addr_lo;
-       size = memory_affinity->length_hi;
-       size = (size << 32) | memory_affinity->length_lo;
-       
+       paddr = memory_affinity->base_address;
+       size = memory_affinity->length;
+
        start_pfn = paddr >> PAGE_SHIFT;
        end_pfn = (paddr + size) >> PAGE_SHIFT;
-       
-       pxm = memory_affinity->proximity_domain;
+
 
        if (num_memory_chunks >= MAXCHUNKS) {
                printk("Too many mem chunks in SRAT. Ignoring %lld MBytes at %llx\n",
@@ -132,8 +131,8 @@ static void __init parse_memory_affinity_structure (char *sratp)
        printk("Memory range 0x%lX to 0x%lX (type 0x%X) in proximity domain 0x%02X %s\n",
                start_pfn, end_pfn,
                memory_affinity->memory_type,
-               memory_affinity->proximity_domain,
-               (memory_affinity->flags.hot_pluggable ?
+               pxm,
+               ((memory_affinity->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) ?
                 "enabled and removable" : "enabled" ) );
 }
 
@@ -185,10 +184,10 @@ static int __init acpi20_parse_srat(struct acpi_table_srat *sratp)
        num_memory_chunks = 0;
        while (p < end) {
                switch (*p) {
-               case ACPI_SRAT_PROCESSOR_AFFINITY:
+               case ACPI_SRAT_TYPE_CPU_AFFINITY:
                        parse_cpu_affinity_structure(p);
                        break;
-               case ACPI_SRAT_MEMORY_AFFINITY:
+               case ACPI_SRAT_TYPE_MEMORY_AFFINITY:
                        parse_memory_affinity_structure(p);
                        break;
                default:
@@ -262,31 +261,30 @@ out_fail:
        return 0;
 }
 
+struct acpi_static_rsdt {
+       struct acpi_table_rsdt table;
+       u32 padding[7]; /* Allow for 7 more table entries */
+};
+
 int __init get_memcfg_from_srat(void)
 {
        struct acpi_table_header *header = NULL;
        struct acpi_table_rsdp *rsdp = NULL;
        struct acpi_table_rsdt *rsdt = NULL;
-       struct acpi_pointer *rsdp_address = NULL;
-       struct acpi_table_rsdt saved_rsdt;
+       acpi_native_uint rsdp_address = 0;
+       struct acpi_static_rsdt saved_rsdt;
        int tables = 0;
        int i = 0;
 
-       if (ACPI_FAILURE(acpi_find_root_pointer(ACPI_PHYSICAL_ADDRESSING,
-                                               rsdp_address))) {
+       rsdp_address = acpi_find_rsdp();
+       if (!rsdp_address) {
                printk("%s: System description tables not found\n",
                       __FUNCTION__);
                goto out_err;
        }
 
-       if (rsdp_address->pointer_type == ACPI_PHYSICAL_POINTER) {
-               printk("%s: assigning address to rsdp\n", __FUNCTION__);
-               rsdp = (struct acpi_table_rsdp *)
-                               (u32)rsdp_address->pointer.physical;
-       } else {
-               printk("%s: rsdp_address is not a physical pointer\n", __FUNCTION__);
-               goto out_err;
-       }
+       printk("%s: assigning address to rsdp\n", __FUNCTION__);
+       rsdp = (struct acpi_table_rsdp *)(u32)rsdp_address;
        if (!rsdp) {
                printk("%s: Didn't find ACPI root!\n", __FUNCTION__);
                goto out_err;
@@ -295,13 +293,13 @@ int __init get_memcfg_from_srat(void)
        printk(KERN_INFO "%.8s v%d [%.6s]\n", rsdp->signature, rsdp->revision,
                rsdp->oem_id);
 
-       if (strncmp(rsdp->signature, RSDP_SIG,strlen(RSDP_SIG))) {
+       if (strncmp(rsdp->signature, ACPI_SIG_RSDP,strlen(ACPI_SIG_RSDP))) {
                printk(KERN_WARNING "%s: RSDP table signature incorrect\n", __FUNCTION__);
                goto out_err;
        }
 
        rsdt = (struct acpi_table_rsdt *)
-           boot_ioremap(rsdp->rsdt_address, sizeof(struct acpi_table_rsdt));
+           boot_ioremap(rsdp->rsdt_physical_address, sizeof(struct acpi_table_rsdt));
 
        if (!rsdt) {
                printk(KERN_WARNING
@@ -310,9 +308,9 @@ int __init get_memcfg_from_srat(void)
                goto out_err;
        }
 
-       header = & rsdt->header;
+       header = &rsdt->header;
 
-       if (strncmp(header->signature, RSDT_SIG, strlen(RSDT_SIG))) {
+       if (strncmp(header->signature, ACPI_SIG_RSDT, strlen(ACPI_SIG_RSDT))) {
                printk(KERN_WARNING "ACPI: RSDT signature incorrect\n");
                goto out_err;
        }
@@ -330,9 +328,9 @@ int __init get_memcfg_from_srat(void)
 
        memcpy(&saved_rsdt, rsdt, sizeof(saved_rsdt));
 
-       if (saved_rsdt.header.length > sizeof(saved_rsdt)) {
+       if (saved_rsdt.table.header.length > sizeof(saved_rsdt)) {
                printk(KERN_WARNING "ACPI: Too big length in RSDT: %d\n",
-                      saved_rsdt.header.length);
+                      saved_rsdt.table.header.length);
                goto out_err;
        }
 
@@ -341,15 +339,15 @@ int __init get_memcfg_from_srat(void)
        for (i = 0; i < tables; i++) {
                /* Map in header, then map in full table length. */
                header = (struct acpi_table_header *)
-                       boot_ioremap(saved_rsdt.entry[i], sizeof(struct acpi_table_header));
+                       boot_ioremap(saved_rsdt.table.table_offset_entry[i], sizeof(struct acpi_table_header));
                if (!header)
                        break;
                header = (struct acpi_table_header *)
-                       boot_ioremap(saved_rsdt.entry[i], header->length);
+                       boot_ioremap(saved_rsdt.table.table_offset_entry[i], header->length);
                if (!header)
                        break;
 
-               if (strncmp((char *) &header->signature, "SRAT", 4))
+               if (strncmp((char *) &header->signature, ACPI_SIG_SRAT, 4))
                        continue;
 
                /* we've found the srat table. don't need to look at any more tables */
index c511705c386cc6b251b6c3707864b356155a04bd..cc2f519b2f7f6c41a5b6ff5fdbe082fa730b5734 100644 (file)
@@ -102,7 +102,7 @@ void __init time_init_hook(void)
  *     along the MCA bus.  Use this to hook into that chain if you will need
  *     it.
  **/
-void __init mca_nmi_hook(void)
+void mca_nmi_hook(void)
 {
        /* If I recall correctly, there's a whole bunch of other things that
         * we can do to check for NMI problems, but that's all I know about
index 80566ca4a80a614ca9785af4f8d56e7e7782a11e..c8d5aa132fa078d9f21cd52d550432766f0e8aa6 100644 (file)
@@ -84,15 +84,6 @@ struct es7000_oem_table {
 };
 
 #ifdef CONFIG_ACPI
-struct acpi_table_sdt {
-       unsigned long pa;
-       unsigned long count;
-       struct {
-               unsigned long pa;
-               enum acpi_table_id id;
-               unsigned long size;
-       }       entry[50];
-};
 
 struct oem_table {
        struct acpi_table_header Header;
index 3d0fc853516d196eb379149dd33c58ff236b9507..9be6ceabf042fc64f8108c43c711cc1f475f96b7 100644 (file)
@@ -160,51 +160,14 @@ parse_unisys_oem (char *oemptr)
 int __init
 find_unisys_acpi_oem_table(unsigned long *oem_addr)
 {
-       struct acpi_table_rsdp          *rsdp = NULL;
-       unsigned long                   rsdp_phys = 0;
-       struct acpi_table_header        *header = NULL;
-       int                             i;
-       struct acpi_table_sdt           sdt;
-
-       rsdp_phys = acpi_find_rsdp();
-       rsdp = __va(rsdp_phys);
-       if (rsdp->rsdt_address) {
-               struct acpi_table_rsdt  *mapped_rsdt = NULL;
-               sdt.pa = rsdp->rsdt_address;
-
-               header = (struct acpi_table_header *)
-                       __acpi_map_table(sdt.pa, sizeof(struct acpi_table_header));
-               if (!header)
-                       return -ENODEV;
-
-               sdt.count = (header->length - sizeof(struct acpi_table_header)) >> 3;
-               mapped_rsdt = (struct acpi_table_rsdt *)
-                       __acpi_map_table(sdt.pa, header->length);
-               if (!mapped_rsdt)
-                       return -ENODEV;
-
-               header = &mapped_rsdt->header;
-
-               for (i = 0; i < sdt.count; i++)
-                       sdt.entry[i].pa = (unsigned long) mapped_rsdt->entry[i];
-       };
-       for (i = 0; i < sdt.count; i++) {
-
-               header = (struct acpi_table_header *)
-                       __acpi_map_table(sdt.entry[i].pa,
-                               sizeof(struct acpi_table_header));
-               if (!header)
-                       continue;
-               if (!strncmp((char *) &header->signature, "OEM1", 4)) {
-                       if (!strncmp((char *) &header->oem_id, "UNISYS", 6)) {
-                               void *addr;
-                               struct oem_table *t;
-                               acpi_table_print(header, sdt.entry[i].pa);
-                               t = (struct oem_table *) __acpi_map_table(sdt.entry[i].pa, header->length);
-                               addr = (void *) __acpi_map_table(t->OEMTableAddr, t->OEMTableSize);
-                               *oem_addr = (unsigned long) addr;
-                               return 0;
-                       }
+       struct acpi_table_header *header = NULL;
+       int i = 0;
+       while (ACPI_SUCCESS(acpi_get_table("OEM1", i++, &header))) {
+               if (!memcmp((char *) &header->oem_id, "UNISYS", 6)) {
+                       struct oem_table *t = (struct oem_table *)header;
+                       *oem_addr = (unsigned long)__acpi_map_table(t->OEMTableAddr,
+                                                                   t->OEMTableSize);
+                       return 0;
                }
        }
        return -1;
index e2616a266e13c50cea634238b2dbbb98c3cbb062..5700220dcf5fa15a4c0984128ce0c8e95735bd60 100644 (file)
@@ -36,7 +36,7 @@ static DECLARE_BITMAP(fallback_slots, MAX_CHECK_BUS*32);
 static u32 get_base_addr(unsigned int seg, int bus, unsigned devfn)
 {
        int cfg_num = -1;
-       struct acpi_table_mcfg_config *cfg;
+       struct acpi_mcfg_allocation *cfg;
 
        if (seg == 0 && bus < MAX_CHECK_BUS &&
            test_bit(PCI_SLOT(devfn) + 32*bus, fallback_slots))
@@ -48,11 +48,11 @@ static u32 get_base_addr(unsigned int seg, int bus, unsigned devfn)
                        break;
                }
                cfg = &pci_mmcfg_config[cfg_num];
-               if (cfg->pci_segment_group_number != seg)
+               if (cfg->pci_segment != seg)
                        continue;
                if ((cfg->start_bus_number <= bus) &&
                    (cfg->end_bus_number >= bus))
-                       return cfg->base_address;
+                       return cfg->address;
        }
 
        /* Handle more broken MCFG tables on Asus etc.
@@ -60,9 +60,9 @@ static u32 get_base_addr(unsigned int seg, int bus, unsigned devfn)
           this applies to all busses. */
        cfg = &pci_mmcfg_config[0];
        if (pci_mmcfg_config_num == 1 &&
-               cfg->pci_segment_group_number == 0 &&
+               cfg->pci_segment == 0 &&
                (cfg->start_bus_number | cfg->end_bus_number) == 0)
-               return cfg->base_address;
+               return cfg->address;
 
        /* Fall back to type 0 */
        return 0;
@@ -125,7 +125,7 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus,
        unsigned long flags;
        u32 base;
 
-       if ((bus > 255) || (devfn > 255) || (reg > 4095)) 
+       if ((bus > 255) || (devfn > 255) || (reg > 4095))
                return -EINVAL;
 
        base = get_base_addr(seg, bus, devfn);
@@ -199,19 +199,19 @@ void __init pci_mmcfg_init(int type)
        if ((pci_probe & PCI_PROBE_MMCONF) == 0)
                return;
 
-       acpi_table_parse(ACPI_MCFG, acpi_parse_mcfg);
+       acpi_table_parse(ACPI_SIG_MCFG, acpi_parse_mcfg);
        if ((pci_mmcfg_config_num == 0) ||
            (pci_mmcfg_config == NULL) ||
-           (pci_mmcfg_config[0].base_address == 0))
+           (pci_mmcfg_config[0].address == 0))
                return;
 
        /* Only do this check when type 1 works. If it doesn't work
           assume we run on a Mac and always use MCFG */
-       if (type == 1 && !e820_all_mapped(pci_mmcfg_config[0].base_address,
-                       pci_mmcfg_config[0].base_address + MMCONFIG_APER_MIN,
+       if (type == 1 && !e820_all_mapped(pci_mmcfg_config[0].address,
+                       pci_mmcfg_config[0].address + MMCONFIG_APER_MIN,
                        E820_RESERVED)) {
-               printk(KERN_ERR "PCI: BIOS Bug: MCFG area at %x is not E820-reserved\n",
-                               pci_mmcfg_config[0].base_address);
+               printk(KERN_ERR "PCI: BIOS Bug: MCFG area at %lx is not E820-reserved\n",
+                               (unsigned long)pci_mmcfg_config[0].address);
                printk(KERN_ERR "PCI: Not using MMCONFIG.\n");
                return;
        }
index ef2fe474f107319c90af67317de180162d22ed2b..a99b0cc92881919a976fabdb02ca3274e8e449e7 100644 (file)
@@ -55,7 +55,7 @@
 
 #define BAD_MADT_ENTRY(entry, end) (                                        \
                (!entry) || (unsigned long)entry + sizeof(*entry) > end ||  \
-               ((acpi_table_entry_header *)entry)->length < sizeof(*entry))
+               ((struct acpi_subtable_header *)entry)->length < sizeof(*entry))
 
 #define PREFIX                 "ACPI: "
 
@@ -67,16 +67,11 @@ EXPORT_SYMBOL(pm_power_off);
 unsigned int acpi_cpei_override;
 unsigned int acpi_cpei_phys_cpuid;
 
-#define MAX_SAPICS 256
-u16 ia64_acpiid_to_sapicid[MAX_SAPICS] = {[0 ... MAX_SAPICS - 1] = -1 };
-
-EXPORT_SYMBOL(ia64_acpiid_to_sapicid);
-
 const char *acpi_get_sysname(void)
 {
 #ifdef CONFIG_IA64_GENERIC
        unsigned long rsdp_phys;
-       struct acpi20_table_rsdp *rsdp;
+       struct acpi_table_rsdp *rsdp;
        struct acpi_table_xsdt *xsdt;
        struct acpi_table_header *hdr;
 
@@ -87,16 +82,16 @@ const char *acpi_get_sysname(void)
                return "dig";
        }
 
-       rsdp = (struct acpi20_table_rsdp *)__va(rsdp_phys);
-       if (strncmp(rsdp->signature, RSDP_SIG, sizeof(RSDP_SIG) - 1)) {
+       rsdp = (struct acpi_table_rsdp *)__va(rsdp_phys);
+       if (strncmp(rsdp->signature, ACPI_SIG_RSDP, sizeof(ACPI_SIG_RSDP) - 1)) {
                printk(KERN_ERR
                       "ACPI 2.0 RSDP signature incorrect, default to \"dig\"\n");
                return "dig";
        }
 
-       xsdt = (struct acpi_table_xsdt *)__va(rsdp->xsdt_address);
+       xsdt = (struct acpi_table_xsdt *)__va(rsdp->xsdt_physical_address);
        hdr = &xsdt->header;
-       if (strncmp(hdr->signature, XSDT_SIG, sizeof(XSDT_SIG) - 1)) {
+       if (strncmp(hdr->signature, ACPI_SIG_XSDT, sizeof(ACPI_SIG_XSDT) - 1)) {
                printk(KERN_ERR
                       "ACPI 2.0 XSDT signature incorrect, default to \"dig\"\n");
                return "dig";
@@ -169,12 +164,12 @@ struct acpi_table_madt *acpi_madt __initdata;
 static u8 has_8259;
 
 static int __init
-acpi_parse_lapic_addr_ovr(acpi_table_entry_header * header,
+acpi_parse_lapic_addr_ovr(struct acpi_subtable_header * header,
                          const unsigned long end)
 {
-       struct acpi_table_lapic_addr_ovr *lapic;
+       struct acpi_madt_local_apic_override *lapic;
 
-       lapic = (struct acpi_table_lapic_addr_ovr *)header;
+       lapic = (struct acpi_madt_local_apic_override *)header;
 
        if (BAD_MADT_ENTRY(lapic, end))
                return -EINVAL;
@@ -187,22 +182,19 @@ acpi_parse_lapic_addr_ovr(acpi_table_entry_header * header,
 }
 
 static int __init
-acpi_parse_lsapic(acpi_table_entry_header * header, const unsigned long end)
+acpi_parse_lsapic(struct acpi_subtable_header * header, const unsigned long end)
 {
-       struct acpi_table_lsapic *lsapic;
+       struct acpi_madt_local_sapic *lsapic;
 
-       lsapic = (struct acpi_table_lsapic *)header;
+       lsapic = (struct acpi_madt_local_sapic *)header;
 
-       if (BAD_MADT_ENTRY(lsapic, end))
-               return -EINVAL;
+       /*Skip BAD_MADT_ENTRY check, as lsapic size could vary */
 
-       if (lsapic->flags.enabled) {
+       if (lsapic->lapic_flags & ACPI_MADT_ENABLED) {
 #ifdef CONFIG_SMP
                smp_boot_data.cpu_phys_id[available_cpus] =
                    (lsapic->id << 8) | lsapic->eid;
 #endif
-               ia64_acpiid_to_sapicid[lsapic->acpi_id] =
-                   (lsapic->id << 8) | lsapic->eid;
                ++available_cpus;
        }
 
@@ -211,11 +203,11 @@ acpi_parse_lsapic(acpi_table_entry_header * header, const unsigned long end)
 }
 
 static int __init
-acpi_parse_lapic_nmi(acpi_table_entry_header * header, const unsigned long end)
+acpi_parse_lapic_nmi(struct acpi_subtable_header * header, const unsigned long end)
 {
-       struct acpi_table_lapic_nmi *lacpi_nmi;
+       struct acpi_madt_local_apic_nmi *lacpi_nmi;
 
-       lacpi_nmi = (struct acpi_table_lapic_nmi *)header;
+       lacpi_nmi = (struct acpi_madt_local_apic_nmi *)header;
 
        if (BAD_MADT_ENTRY(lacpi_nmi, end))
                return -EINVAL;
@@ -225,11 +217,11 @@ acpi_parse_lapic_nmi(acpi_table_entry_header * header, const unsigned long end)
 }
 
 static int __init
-acpi_parse_iosapic(acpi_table_entry_header * header, const unsigned long end)
+acpi_parse_iosapic(struct acpi_subtable_header * header, const unsigned long end)
 {
-       struct acpi_table_iosapic *iosapic;
+       struct acpi_madt_io_sapic *iosapic;
 
-       iosapic = (struct acpi_table_iosapic *)header;
+       iosapic = (struct acpi_madt_io_sapic *)header;
 
        if (BAD_MADT_ENTRY(iosapic, end))
                return -EINVAL;
@@ -240,13 +232,13 @@ acpi_parse_iosapic(acpi_table_entry_header * header, const unsigned long end)
 static unsigned int __initdata acpi_madt_rev;
 
 static int __init
-acpi_parse_plat_int_src(acpi_table_entry_header * header,
+acpi_parse_plat_int_src(struct acpi_subtable_header * header,
                        const unsigned long end)
 {
-       struct acpi_table_plat_int_src *plintsrc;
+       struct acpi_madt_interrupt_source *plintsrc;
        int vector;
 
-       plintsrc = (struct acpi_table_plat_int_src *)header;
+       plintsrc = (struct acpi_madt_interrupt_source *)header;
 
        if (BAD_MADT_ENTRY(plintsrc, end))
                return -EINVAL;
@@ -257,19 +249,19 @@ acpi_parse_plat_int_src(acpi_table_entry_header * header,
         */
        vector = iosapic_register_platform_intr(plintsrc->type,
                                                plintsrc->global_irq,
-                                               plintsrc->iosapic_vector,
+                                               plintsrc->io_sapic_vector,
                                                plintsrc->eid,
                                                plintsrc->id,
-                                               (plintsrc->flags.polarity ==
-                                                1) ? IOSAPIC_POL_HIGH :
-                                               IOSAPIC_POL_LOW,
-                                               (plintsrc->flags.trigger ==
-                                                1) ? IOSAPIC_EDGE :
-                                               IOSAPIC_LEVEL);
+                                               ((plintsrc->inti_flags & ACPI_MADT_POLARITY_MASK) ==
+                                                ACPI_MADT_POLARITY_ACTIVE_HIGH) ?
+                                               IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
+                                               ((plintsrc->inti_flags & ACPI_MADT_TRIGGER_MASK) ==
+                                                ACPI_MADT_TRIGGER_EDGE) ?
+                                               IOSAPIC_EDGE : IOSAPIC_LEVEL);
 
        platform_intr_list[plintsrc->type] = vector;
        if (acpi_madt_rev > 1) {
-               acpi_cpei_override = plintsrc->plint_flags.cpei_override_flag;
+               acpi_cpei_override = plintsrc->flags & ACPI_MADT_CPEI_OVERRIDE;
        }
 
        /*
@@ -324,30 +316,32 @@ unsigned int get_cpei_target_cpu(void)
 }
 
 static int __init
-acpi_parse_int_src_ovr(acpi_table_entry_header * header,
+acpi_parse_int_src_ovr(struct acpi_subtable_header * header,
                       const unsigned long end)
 {
-       struct acpi_table_int_src_ovr *p;
+       struct acpi_madt_interrupt_override *p;
 
-       p = (struct acpi_table_int_src_ovr *)header;
+       p = (struct acpi_madt_interrupt_override *)header;
 
        if (BAD_MADT_ENTRY(p, end))
                return -EINVAL;
 
-       iosapic_override_isa_irq(p->bus_irq, p->global_irq,
-                                (p->flags.polarity ==
-                                 1) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
-                                (p->flags.trigger ==
-                                 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
+       iosapic_override_isa_irq(p->source_irq, p->global_irq,
+                                ((p->inti_flags & ACPI_MADT_POLARITY_MASK) ==
+                                 ACPI_MADT_POLARITY_ACTIVE_HIGH) ?
+                                IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
+                                ((p->inti_flags & ACPI_MADT_TRIGGER_MASK) ==
+                                ACPI_MADT_TRIGGER_EDGE) ?
+                                IOSAPIC_EDGE : IOSAPIC_LEVEL);
        return 0;
 }
 
 static int __init
-acpi_parse_nmi_src(acpi_table_entry_header * header, const unsigned long end)
+acpi_parse_nmi_src(struct acpi_subtable_header * header, const unsigned long end)
 {
-       struct acpi_table_nmi_src *nmi_src;
+       struct acpi_madt_nmi_source *nmi_src;
 
-       nmi_src = (struct acpi_table_nmi_src *)header;
+       nmi_src = (struct acpi_madt_nmi_source *)header;
 
        if (BAD_MADT_ENTRY(nmi_src, end))
                return -EINVAL;
@@ -371,12 +365,12 @@ static void __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
        }
 }
 
-static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size)
+static int __init acpi_parse_madt(struct acpi_table_header *table)
 {
-       if (!phys_addr || !size)
+       if (!table)
                return -EINVAL;
 
-       acpi_madt = (struct acpi_table_madt *)__va(phys_addr);
+       acpi_madt = (struct acpi_table_madt *)table;
 
        acpi_madt_rev = acpi_madt->header.revision;
 
@@ -384,14 +378,14 @@ static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size)
 #ifdef CONFIG_ITANIUM
        has_8259 = 1;           /* Firmware on old Itanium systems is broken */
 #else
-       has_8259 = acpi_madt->flags.pcat_compat;
+       has_8259 = acpi_madt->flags & ACPI_MADT_PCAT_COMPAT;
 #endif
        iosapic_system_init(has_8259);
 
        /* Get base address of IPI Message Block */
 
-       if (acpi_madt->lapic_address)
-               ipi_base_addr = ioremap(acpi_madt->lapic_address, 0);
+       if (acpi_madt->address)
+               ipi_base_addr = ioremap(acpi_madt->address, 0);
 
        printk(KERN_INFO PREFIX "Local APIC address %p\n", ipi_base_addr);
 
@@ -413,23 +407,24 @@ static u32 __devinitdata pxm_flag[PXM_FLAG_LEN];
 #define pxm_bit_test(bit)      (test_bit(bit,(void *)pxm_flag))
 static struct acpi_table_slit __initdata *slit_table;
 
-static int get_processor_proximity_domain(struct acpi_table_processor_affinity *pa)
+static int get_processor_proximity_domain(struct acpi_srat_cpu_affinity *pa)
 {
        int pxm;
 
-       pxm = pa->proximity_domain;
+       pxm = pa->proximity_domain_lo;
        if (ia64_platform_is("sn2"))
-               pxm += pa->reserved[0] << 8;
+               pxm += pa->proximity_domain_hi[0] << 8;
        return pxm;
 }
 
-static int get_memory_proximity_domain(struct acpi_table_memory_affinity *ma)
+static int get_memory_proximity_domain(struct acpi_srat_mem_affinity *ma)
 {
        int pxm;
 
        pxm = ma->proximity_domain;
-       if (ia64_platform_is("sn2"))
-               pxm += ma->reserved1[0] << 8;
+       if (!ia64_platform_is("sn2"))
+               pxm &= 0xff;
+
        return pxm;
 }
 
@@ -442,7 +437,7 @@ void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
        u32 len;
 
        len = sizeof(struct acpi_table_header) + 8
-           + slit->localities * slit->localities;
+           + slit->locality_count * slit->locality_count;
        if (slit->header.length != len) {
                printk(KERN_ERR
                       "ACPI 2.0 SLIT: size mismatch: %d expected, %d actual\n",
@@ -454,11 +449,11 @@ void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
 }
 
 void __init
-acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa)
+acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
 {
        int pxm;
 
-       if (!pa->flags.enabled)
+       if (!(pa->flags & ACPI_SRAT_CPU_ENABLED))
                return;
 
        pxm = get_processor_proximity_domain(pa);
@@ -467,14 +462,14 @@ acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa)
        pxm_bit_set(pxm);
 
        node_cpuid[srat_num_cpus].phys_id =
-           (pa->apic_id << 8) | (pa->lsapic_eid);
+           (pa->apic_id << 8) | (pa->local_sapic_eid);
        /* nid should be overridden as logical node id later */
        node_cpuid[srat_num_cpus].nid = pxm;
        srat_num_cpus++;
 }
 
 void __init
-acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma)
+acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 {
        unsigned long paddr, size;
        int pxm;
@@ -483,13 +478,11 @@ acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma)
        pxm = get_memory_proximity_domain(ma);
 
        /* fill node memory chunk structure */
-       paddr = ma->base_addr_hi;
-       paddr = (paddr << 32) | ma->base_addr_lo;
-       size = ma->length_hi;
-       size = (size << 32) | ma->length_lo;
+       paddr = ma->base_address;
+       size = ma->length;
 
        /* Ignore disabled entries */
-       if (!ma->flags.enabled)
+       if (!(ma->flags & ACPI_SRAT_MEM_ENABLED))
                return;
 
        /* record this node in proximity bitmap */
@@ -560,16 +553,16 @@ void __init acpi_numa_arch_fixup(void)
        if (!slit_table)
                return;
        memset(numa_slit, -1, sizeof(numa_slit));
-       for (i = 0; i < slit_table->localities; i++) {
+       for (i = 0; i < slit_table->locality_count; i++) {
                if (!pxm_bit_test(i))
                        continue;
                node_from = pxm_to_node(i);
-               for (j = 0; j < slit_table->localities; j++) {
+               for (j = 0; j < slit_table->locality_count; j++) {
                        if (!pxm_bit_test(j))
                                continue;
                        node_to = pxm_to_node(j);
                        node_distance(node_from, node_to) =
-                           slit_table->entry[i * slit_table->localities + j];
+                           slit_table->entry[i * slit_table->locality_count + j];
                }
        }
 
@@ -614,21 +607,21 @@ void acpi_unregister_gsi(u32 gsi)
 
 EXPORT_SYMBOL(acpi_unregister_gsi);
 
-static int __init acpi_parse_fadt(unsigned long phys_addr, unsigned long size)
+static int __init acpi_parse_fadt(struct acpi_table_header *table)
 {
        struct acpi_table_header *fadt_header;
-       struct fadt_descriptor *fadt;
+       struct acpi_table_fadt *fadt;
 
-       if (!phys_addr || !size)
+       if (!table)
                return -EINVAL;
 
-       fadt_header = (struct acpi_table_header *)__va(phys_addr);
+       fadt_header = (struct acpi_table_header *)table;
        if (fadt_header->revision != 3)
                return -ENODEV; /* Only deal with ACPI 2.0 FADT */
 
-       fadt = (struct fadt_descriptor *)fadt_header;
+       fadt = (struct acpi_table_fadt *)fadt_header;
 
-       acpi_register_gsi(fadt->sci_int, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW);
+       acpi_register_gsi(fadt->sci_interrupt, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW);
        return 0;
 }
 
@@ -655,7 +648,7 @@ int __init acpi_boot_init(void)
         * information -- the successor to MPS tables.
         */
 
-       if (acpi_table_parse(ACPI_APIC, acpi_parse_madt) < 1) {
+       if (acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt) < 1) {
                printk(KERN_ERR PREFIX "Can't find MADT\n");
                goto skip_madt;
        }
@@ -663,40 +656,40 @@ int __init acpi_boot_init(void)
        /* Local APIC */
 
        if (acpi_table_parse_madt
-           (ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr, 0) < 0)
+           (ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE, acpi_parse_lapic_addr_ovr, 0) < 0)
                printk(KERN_ERR PREFIX
                       "Error parsing LAPIC address override entry\n");
 
-       if (acpi_table_parse_madt(ACPI_MADT_LSAPIC, acpi_parse_lsapic, NR_CPUS)
+       if (acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_SAPIC, acpi_parse_lsapic, NR_CPUS)
            < 1)
                printk(KERN_ERR PREFIX
                       "Error parsing MADT - no LAPIC entries\n");
 
-       if (acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0)
+       if (acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_NMI, acpi_parse_lapic_nmi, 0)
            < 0)
                printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
 
        /* I/O APIC */
 
        if (acpi_table_parse_madt
-           (ACPI_MADT_IOSAPIC, acpi_parse_iosapic, NR_IOSAPICS) < 1)
+           (ACPI_MADT_TYPE_IO_SAPIC, acpi_parse_iosapic, NR_IOSAPICS) < 1)
                printk(KERN_ERR PREFIX
                       "Error parsing MADT - no IOSAPIC entries\n");
 
        /* System-Level Interrupt Routing */
 
        if (acpi_table_parse_madt
-           (ACPI_MADT_PLAT_INT_SRC, acpi_parse_plat_int_src,
+           (ACPI_MADT_TYPE_INTERRUPT_SOURCE, acpi_parse_plat_int_src,
             ACPI_MAX_PLATFORM_INTERRUPTS) < 0)
                printk(KERN_ERR PREFIX
                       "Error parsing platform interrupt source entry\n");
 
        if (acpi_table_parse_madt
-           (ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, 0) < 0)
+           (ACPI_MADT_TYPE_INTERRUPT_OVERRIDE, acpi_parse_int_src_ovr, 0) < 0)
                printk(KERN_ERR PREFIX
                       "Error parsing interrupt source overrides entry\n");
 
-       if (acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src, 0) < 0)
+       if (acpi_table_parse_madt(ACPI_MADT_TYPE_NMI_SOURCE, acpi_parse_nmi_src, 0) < 0)
                printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
       skip_madt:
 
@@ -706,7 +699,7 @@ int __init acpi_boot_init(void)
         * gets interrupts such as power and sleep buttons.  If it's not
         * on a Legacy interrupt, it needs to be setup.
         */
-       if (acpi_table_parse(ACPI_FADT, acpi_parse_fadt) < 1)
+       if (acpi_table_parse(ACPI_SIG_FADT, acpi_parse_fadt) < 1)
                printk(KERN_ERR PREFIX "Can't find FADT\n");
 
 #ifdef CONFIG_SMP
@@ -839,7 +832,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
 {
        struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        union acpi_object *obj;
-       struct acpi_table_lsapic *lsapic;
+       struct acpi_madt_local_sapic *lsapic;
        cpumask_t tmp_map;
        long physid;
        int cpu;
@@ -851,16 +844,16 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
                return -EINVAL;
 
        obj = buffer.pointer;
-       if (obj->type != ACPI_TYPE_BUFFER ||
-           obj->buffer.length < sizeof(*lsapic)) {
+       if (obj->type != ACPI_TYPE_BUFFER)
+       {
                kfree(buffer.pointer);
                return -EINVAL;
        }
 
-       lsapic = (struct acpi_table_lsapic *)obj->buffer.pointer;
+       lsapic = (struct acpi_madt_local_sapic *)obj->buffer.pointer;
 
-       if ((lsapic->header.type != ACPI_MADT_LSAPIC) ||
-           (!lsapic->flags.enabled)) {
+       if ((lsapic->header.type != ACPI_MADT_TYPE_LOCAL_SAPIC) ||
+           (!lsapic->lapic_flags & ACPI_MADT_ENABLED)) {
                kfree(buffer.pointer);
                return -EINVAL;
        }
@@ -880,7 +873,6 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
 
        cpu_set(cpu, cpu_present_map);
        ia64_cpu_to_sapicid[cpu] = physid;
-       ia64_acpiid_to_sapicid[lsapic->acpi_id] = ia64_cpu_to_sapicid[cpu];
 
        *pcpu = cpu;
        return (0);
@@ -890,14 +882,6 @@ EXPORT_SYMBOL(acpi_map_lsapic);
 
 int acpi_unmap_lsapic(int cpu)
 {
-       int i;
-
-       for (i = 0; i < MAX_SAPICS; i++) {
-               if (ia64_acpiid_to_sapicid[i] == ia64_cpu_to_sapicid[cpu]) {
-                       ia64_acpiid_to_sapicid[i] = -1;
-                       break;
-               }
-       }
        ia64_cpu_to_sapicid[cpu] = -1;
        cpu_clear(cpu, cpu_present_map);
 
@@ -917,7 +901,7 @@ acpi_map_iosapic(acpi_handle handle, u32 depth, void *context, void **ret)
 {
        struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        union acpi_object *obj;
-       struct acpi_table_iosapic *iosapic;
+       struct acpi_madt_io_sapic *iosapic;
        unsigned int gsi_base;
        int pxm, node;
 
@@ -935,9 +919,9 @@ acpi_map_iosapic(acpi_handle handle, u32 depth, void *context, void **ret)
                return AE_OK;
        }
 
-       iosapic = (struct acpi_table_iosapic *)obj->buffer.pointer;
+       iosapic = (struct acpi_madt_io_sapic *)obj->buffer.pointer;
 
-       if (iosapic->header.type != ACPI_MADT_IOSAPIC) {
+       if (iosapic->header.type != ACPI_MADT_TYPE_IO_SAPIC) {
                kfree(buffer.pointer);
                return AE_OK;
        }
index cb96b4ea7df6970825151bf3b5f0dd014a43c063..8c331ca6e5c9088a8a8542ebae195306f4d9a6bc 100644 (file)
@@ -13,6 +13,7 @@
 #include <asm/sn/sn_sal.h>
 #include "xtalk/hubdev.h"
 #include <linux/acpi.h>
+#include <acpi/acnamesp.h>
 
 
 /*
@@ -31,6 +32,12 @@ struct acpi_vendor_uuid sn_uuid = {
                    0xa2, 0x7c, 0x08, 0x00, 0x69, 0x13, 0xea, 0x51 },
 };
 
+struct sn_pcidev_match {
+       u8 bus;
+       unsigned int devfn;
+       acpi_handle handle;
+};
+
 /*
  * Perform the early IO init in PROM.
  */
@@ -119,9 +126,11 @@ sn_get_bussoft_ptr(struct pci_bus *bus)
        status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS,
                                          &sn_uuid, &buffer);
        if (ACPI_FAILURE(status)) {
-               printk(KERN_ERR "get_acpi_pcibus_ptr: "
-                      "get_acpi_bussoft_info() failed: %d\n",
-                      status);
+               printk(KERN_ERR "%s: "
+                      "acpi_get_vendor_resource() failed (0x%x) for: ",
+                      __FUNCTION__, status);
+               acpi_ns_print_node_pathname(handle, NULL);
+               printk("\n");
                return NULL;
        }
        resource = buffer.pointer;
@@ -130,8 +139,8 @@ sn_get_bussoft_ptr(struct pci_bus *bus)
        if ((vendor->byte_length - sizeof(struct acpi_vendor_uuid)) !=
             sizeof(struct pcibus_bussoft *)) {
                printk(KERN_ERR
-                      "get_acpi_bussoft_ptr: Invalid vendor data "
-                      "length %d\n", vendor->byte_length);
+                      "%s: Invalid vendor data length %d\n",
+                       __FUNCTION__, vendor->byte_length);
                kfree(buffer.pointer);
                return NULL;
        }
@@ -143,34 +152,254 @@ sn_get_bussoft_ptr(struct pci_bus *bus)
 }
 
 /*
- * sn_acpi_bus_fixup
+ * sn_extract_device_info - Extract the pcidev_info and the sn_irq_info
+ *                         pointers from the vendor resource using the
+ *                         provided acpi handle, and copy the structures
+ *                         into the argument buffers.
  */
-void
-sn_acpi_bus_fixup(struct pci_bus *bus)
+static int
+sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info,
+                   struct sn_irq_info **sn_irq_info)
 {
-       struct pci_dev *pci_dev = NULL;
-       struct pcibus_bussoft *prom_bussoft_ptr;
-       extern void sn_common_bus_fixup(struct pci_bus *,
-                                       struct pcibus_bussoft *);
+       u64 addr;
+       struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
+       struct sn_irq_info *irq_info, *irq_info_prom;
+       struct pcidev_info *pcidev_ptr, *pcidev_prom_ptr;
+       struct acpi_resource *resource;
+       int ret = 0;
+       acpi_status status;
+       struct acpi_resource_vendor_typed *vendor;
 
-       if (!bus->parent) {     /* If root bus */
-               prom_bussoft_ptr = sn_get_bussoft_ptr(bus);
-               if (prom_bussoft_ptr == NULL) {
+       /*
+        * The pointer to this device's pcidev_info structure in
+        * the PROM, is in the vendor resource.
+        */
+       status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS,
+                                         &sn_uuid, &buffer);
+       if (ACPI_FAILURE(status)) {
+               printk(KERN_ERR
+                      "%s: acpi_get_vendor_resource() failed (0x%x) for: ",
+                       __FUNCTION__, status);
+               acpi_ns_print_node_pathname(handle, NULL);
+               printk("\n");
+               return 1;
+       }
+
+       resource = buffer.pointer;
+       vendor = &resource->data.vendor_typed;
+       if ((vendor->byte_length - sizeof(struct acpi_vendor_uuid)) !=
+           sizeof(struct pci_devdev_info *)) {
+               printk(KERN_ERR
+                      "%s: Invalid vendor data length: %d for: ",
+                       __FUNCTION__, vendor->byte_length);
+               acpi_ns_print_node_pathname(handle, NULL);
+               printk("\n");
+               ret = 1;
+               goto exit;
+       }
+
+       pcidev_ptr = kzalloc(sizeof(struct pcidev_info), GFP_KERNEL);
+       if (!pcidev_ptr)
+               panic("%s: Unable to alloc memory for pcidev_info", __FUNCTION__);
+
+       memcpy(&addr, vendor->byte_data, sizeof(struct pcidev_info *));
+       pcidev_prom_ptr = __va(addr);
+       memcpy(pcidev_ptr, pcidev_prom_ptr, sizeof(struct pcidev_info));
+
+       /* Get the IRQ info */
+       irq_info = kzalloc(sizeof(struct sn_irq_info), GFP_KERNEL);
+       if (!irq_info)
+                panic("%s: Unable to alloc memory for sn_irq_info", __FUNCTION__);
+
+       if (pcidev_ptr->pdi_sn_irq_info) {
+               irq_info_prom = __va(pcidev_ptr->pdi_sn_irq_info);
+               memcpy(irq_info, irq_info_prom, sizeof(struct sn_irq_info));
+       }
+
+       *pcidev_info = pcidev_ptr;
+       *sn_irq_info = irq_info;
+
+exit:
+       kfree(buffer.pointer);
+       return ret;
+}
+
+static unsigned int
+get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle)
+{
+       unsigned long adr;
+       acpi_handle child;
+       unsigned int devfn;
+       int function;
+       acpi_handle parent;
+       int slot;
+       acpi_status status;
+
+       /*
+        * Do an upward search to find the root bus device, and
+        * obtain the host devfn from the previous child device.
+        */
+       child = device_handle;
+       while (child) {
+               status = acpi_get_parent(child, &parent);
+               if (ACPI_FAILURE(status)) {
+                       printk(KERN_ERR "%s: acpi_get_parent() failed "
+                              "(0x%x) for: ", __FUNCTION__, status);
+                       acpi_ns_print_node_pathname(child, NULL);
+                       printk("\n");
+                       panic("%s: Unable to find host devfn\n", __FUNCTION__);
+               }
+               if (parent == rootbus_handle)
+                       break;
+               child = parent;
+       }
+       if (!child) {
+               printk(KERN_ERR "%s: Unable to find root bus for: ",
+                      __FUNCTION__);
+               acpi_ns_print_node_pathname(device_handle, NULL);
+               printk("\n");
+               BUG();
+       }
+
+       status = acpi_evaluate_integer(child, METHOD_NAME__ADR, NULL, &adr);
+       if (ACPI_FAILURE(status)) {
+               printk(KERN_ERR "%s: Unable to get _ADR (0x%x) for: ",
+                      __FUNCTION__, status);
+               acpi_ns_print_node_pathname(child, NULL);
+               printk("\n");
+               panic("%s: Unable to find host devfn\n", __FUNCTION__);
+       }
+
+       slot = (adr >> 16) & 0xffff;
+       function = adr & 0xffff;
+       devfn = PCI_DEVFN(slot, function);
+       return devfn;
+}
+
+/*
+ * find_matching_device - Callback routine to find the ACPI device
+ *                       that matches up with our pci_dev device.
+ *                       Matching is done on bus number and devfn.
+ *                       To find the bus number for a particular
+ *                       ACPI device, we must look at the _BBN method
+ *                       of its parent.
+ */
+static acpi_status
+find_matching_device(acpi_handle handle, u32 lvl, void *context, void **rv)
+{
+       unsigned long bbn = -1;
+       unsigned long adr;
+       acpi_handle parent = NULL;
+       acpi_status status;
+       unsigned int devfn;
+       int function;
+       int slot;
+       struct sn_pcidev_match *info = context;
+
+        status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL,
+                                       &adr);
+        if (ACPI_SUCCESS(status)) {
+               status = acpi_get_parent(handle, &parent);
+               if (ACPI_FAILURE(status)) {
                        printk(KERN_ERR
-                              "sn_pci_fixup_bus: 0x%04x:0x%02x Unable to "
-                              "obtain prom_bussoft_ptr\n",
-                              pci_domain_nr(bus), bus->number);
-                       return;
+                              "%s: acpi_get_parent() failed (0x%x) for: ",
+                                       __FUNCTION__, status);
+                       acpi_ns_print_node_pathname(handle, NULL);
+                       printk("\n");
+                       return AE_OK;
+               }
+               status = acpi_evaluate_integer(parent, METHOD_NAME__BBN,
+                                              NULL, &bbn);
+               if (ACPI_FAILURE(status)) {
+                       printk(KERN_ERR
+                         "%s: Failed to find _BBN in parent of: ",
+                                       __FUNCTION__);
+                       acpi_ns_print_node_pathname(handle, NULL);
+                       printk("\n");
+                       return AE_OK;
+               }
+
+                slot = (adr >> 16) & 0xffff;
+                function = adr & 0xffff;
+                devfn = PCI_DEVFN(slot, function);
+                if ((info->devfn == devfn) && (info->bus == bbn)) {
+                       /* We have a match! */
+                       info->handle = handle;
+                       return 1;
                }
-               sn_common_bus_fixup(bus, prom_bussoft_ptr);
        }
-       list_for_each_entry(pci_dev, &bus->devices, bus_list) {
-               sn_pci_fixup_slot(pci_dev);
+       return AE_OK;
+}
+
+/*
+ * sn_acpi_get_pcidev_info - Search ACPI namespace for the acpi
+ *                          device matching the specified pci_dev,
+ *                          and return the pcidev info and irq info.
+ */
+int
+sn_acpi_get_pcidev_info(struct pci_dev *dev, struct pcidev_info **pcidev_info,
+                       struct sn_irq_info **sn_irq_info)
+{
+       unsigned int host_devfn;
+       struct sn_pcidev_match pcidev_match;
+       acpi_handle rootbus_handle;
+       unsigned long segment;
+       acpi_status status;
+
+       rootbus_handle = PCI_CONTROLLER(dev)->acpi_handle;
+        status = acpi_evaluate_integer(rootbus_handle, METHOD_NAME__SEG, NULL,
+                                       &segment);
+        if (ACPI_SUCCESS(status)) {
+               if (segment != pci_domain_nr(dev)) {
+                       printk(KERN_ERR
+                              "%s: Segment number mismatch, 0x%lx vs 0x%x for: ",
+                              __FUNCTION__, segment, pci_domain_nr(dev));
+                       acpi_ns_print_node_pathname(rootbus_handle, NULL);
+                       printk("\n");
+                       return 1;
+               }
+       } else {
+               printk(KERN_ERR "%s: Unable to get __SEG from: ",
+                      __FUNCTION__);
+               acpi_ns_print_node_pathname(rootbus_handle, NULL);
+               printk("\n");
+               return 1;
+       }
+
+       /*
+        * We want to search all devices in this segment/domain
+        * of the ACPI namespace for the matching ACPI device,
+        * which holds the pcidev_info pointer in its vendor resource.
+        */
+       pcidev_match.bus = dev->bus->number;
+       pcidev_match.devfn = dev->devfn;
+       pcidev_match.handle = NULL;
+
+       acpi_walk_namespace(ACPI_TYPE_DEVICE, rootbus_handle, ACPI_UINT32_MAX,
+                           find_matching_device, &pcidev_match, NULL);
+
+       if (!pcidev_match.handle) {
+               printk(KERN_ERR
+                      "%s: Could not find matching ACPI device for %s.\n",
+                      __FUNCTION__, pci_name(dev));
+               return 1;
        }
+
+       if (sn_extract_device_info(pcidev_match.handle, pcidev_info, sn_irq_info))
+               return 1;
+
+       /* Build up the pcidev_info.pdi_slot_host_handle */
+       host_devfn = get_host_devfn(pcidev_match.handle, rootbus_handle);
+       (*pcidev_info)->pdi_slot_host_handle =
+                       ((unsigned long) pci_domain_nr(dev) << 40) |
+                                       /* bus == 0 */
+                                       host_devfn;
+       return 0;
 }
 
 /*
- * sn_acpi_slot_fixup - Perform any SN specific slot fixup.
+ * sn_acpi_slot_fixup - Obtain the pcidev_info and sn_irq_info.
+ *                     Perform any SN specific slot fixup.
  *                     At present there does not appear to be
  *                     any generic way to handle a ROM image
  *                     that has been shadowed by the PROM, so
@@ -179,11 +408,18 @@ sn_acpi_bus_fixup(struct pci_bus *bus)
  */
 
 void
-sn_acpi_slot_fixup(struct pci_dev *dev, struct pcidev_info *pcidev_info)
+sn_acpi_slot_fixup(struct pci_dev *dev)
 {
        void __iomem *addr;
+       struct pcidev_info *pcidev_info = NULL;
+       struct sn_irq_info *sn_irq_info = NULL;
        size_t size;
 
+       if (sn_acpi_get_pcidev_info(dev, &pcidev_info, &sn_irq_info)) {
+               panic("%s:  Failure obtaining pcidev_info for %s\n",
+                     __FUNCTION__, pci_name(dev));
+       }
+
        if (pcidev_info->pdi_pio_mapped_addr[PCI_ROM_RESOURCE]) {
                /*
                 * A valid ROM image exists and has been shadowed by the
@@ -200,8 +436,11 @@ sn_acpi_slot_fixup(struct pci_dev *dev, struct pcidev_info *pcidev_info)
                                                (unsigned long) addr + size;
                dev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_BIOS_COPY;
        }
+       sn_pci_fixup_slot(dev, pcidev_info, sn_irq_info);
 }
 
+EXPORT_SYMBOL(sn_acpi_slot_fixup);
+
 static struct acpi_driver acpi_sn_hubdev_driver = {
        .name = "SGI HUBDEV Driver",
        .ids = "SGIHUB,SGITIO",
@@ -211,6 +450,33 @@ static struct acpi_driver acpi_sn_hubdev_driver = {
 };
 
 
+/*
+ * sn_acpi_bus_fixup -  Perform SN specific setup of software structs
+ *                     (pcibus_bussoft, pcidev_info) and hardware
+ *                     registers, for the specified bus and devices under it.
+ */
+void
+sn_acpi_bus_fixup(struct pci_bus *bus)
+{
+       struct pci_dev *pci_dev = NULL;
+       struct pcibus_bussoft *prom_bussoft_ptr;
+
+       if (!bus->parent) {     /* If root bus */
+               prom_bussoft_ptr = sn_get_bussoft_ptr(bus);
+               if (prom_bussoft_ptr == NULL) {
+                       printk(KERN_ERR
+                              "%s: 0x%04x:0x%02x Unable to "
+                              "obtain prom_bussoft_ptr\n",
+                              __FUNCTION__, pci_domain_nr(bus), bus->number);
+                       return;
+               }
+               sn_common_bus_fixup(bus, prom_bussoft_ptr);
+       }
+       list_for_each_entry(pci_dev, &bus->devices, bus_list) {
+               sn_acpi_slot_fixup(pci_dev);
+       }
+}
+
 /*
  * sn_io_acpi_init - PROM has ACPI support for IO, defining at a minimum the
  *                  nodes and root buses in the DSDT. As a result, bus scanning
index d4dd8f4b6b8da3b17de48d1fc23d796d6e555f5b..d48bcd83253c28073050377cbd5f937882a3f6a5 100644 (file)
 #include <linux/acpi.h>
 #include <asm/sn/sn2/sn_hwperf.h>
 #include <asm/sn/acpi.h>
+#include "acpi/acglobal.h"
 
 extern void sn_init_cpei_timer(void);
 extern void register_sn_procfs(void);
-extern void sn_acpi_bus_fixup(struct pci_bus *);
-extern void sn_bus_fixup(struct pci_bus *);
-extern void sn_acpi_slot_fixup(struct pci_dev *, struct pcidev_info *);
-extern void sn_more_slot_fixup(struct pci_dev *, struct pcidev_info *);
-extern void sn_legacy_pci_window_fixup(struct pci_controller *, u64, u64);
 extern void sn_io_acpi_init(void);
 extern void sn_io_init(void);
 
@@ -48,6 +44,9 @@ struct sysdata_el {
 
 int sn_ioif_inited;            /* SN I/O infrastructure initialized? */
 
+int sn_acpi_rev;               /* SN ACPI revision */
+EXPORT_SYMBOL_GPL(sn_acpi_rev);
+
 struct sn_pcibus_provider *sn_pci_provider[PCIIO_ASIC_MAX_TYPES];      /* indexed by asic type */
 
 /*
@@ -98,25 +97,6 @@ sal_get_device_dmaflush_list(u64 nasid, u64 widget_num, u64 device_num,
        return ret_stuff.status;
 }
 
-/*
- * Retrieve the pci device information given the bus and device|function number.
- */
-static inline u64
-sal_get_pcidev_info(u64 segment, u64 bus_number, u64 devfn, u64 pci_dev,
-                   u64 sn_irq_info)
-{
-       struct ia64_sal_retval ret_stuff;
-       ret_stuff.status = 0;
-       ret_stuff.v0 = 0;
-
-       SAL_CALL_NOLOCK(ret_stuff,
-                       (u64) SN_SAL_IOIF_GET_PCIDEV_INFO,
-                       (u64) segment, (u64) bus_number, (u64) devfn,
-                       (u64) pci_dev,
-                       sn_irq_info, 0, 0);
-       return ret_stuff.v0;
-}
-
 /*
  * sn_pcidev_info_get() - Retrieve the pcidev_info struct for the specified
  *                       device.
@@ -249,50 +229,25 @@ void sn_pci_unfixup_slot(struct pci_dev *dev)
 }
 
 /*
- * sn_pci_fixup_slot() - This routine sets up a slot's resources consistent
- *                      with the Linux PCI abstraction layer. Resources
- *                      acquired from our PCI provider include PIO maps
- *                      to BAR space and interrupt objects.
+ * sn_pci_fixup_slot()
  */
-void sn_pci_fixup_slot(struct pci_dev *dev)
+void sn_pci_fixup_slot(struct pci_dev *dev, struct pcidev_info *pcidev_info,
+                      struct sn_irq_info *sn_irq_info)
 {
        int segment = pci_domain_nr(dev->bus);
-       int status = 0;
        struct pcibus_bussoft *bs;
-       struct pci_bus *host_pci_bus;
-       struct pci_dev *host_pci_dev;
-       struct pcidev_info *pcidev_info;
-       struct sn_irq_info *sn_irq_info;
-       unsigned int bus_no, devfn;
+       struct pci_bus *host_pci_bus;
+       struct pci_dev *host_pci_dev;
+       unsigned int bus_no, devfn;
 
        pci_dev_get(dev); /* for the sysdata pointer */
-       pcidev_info = kzalloc(sizeof(struct pcidev_info), GFP_KERNEL);
-       if (!pcidev_info)
-               BUG();          /* Cannot afford to run out of memory */
-
-       sn_irq_info = kzalloc(sizeof(struct sn_irq_info), GFP_KERNEL);
-       if (!sn_irq_info)
-               BUG();          /* Cannot afford to run out of memory */
-
-       /* Call to retrieve pci device information needed by kernel. */
-       status = sal_get_pcidev_info((u64) segment, (u64) dev->bus->number,
-                                    dev->devfn,
-                                    (u64) __pa(pcidev_info),
-                                    (u64) __pa(sn_irq_info));
-       if (status)
-               BUG(); /* Cannot get platform pci device information */
 
        /* Add pcidev_info to list in pci_controller.platform_data */
        list_add_tail(&pcidev_info->pdi_list,
                      &(SN_PLATFORM_DATA(dev->bus)->pcidev_info));
-
-       if (SN_ACPI_BASE_SUPPORT())
-               sn_acpi_slot_fixup(dev, pcidev_info);
-       else
-               sn_more_slot_fixup(dev, pcidev_info);
        /*
         * Using the PROMs values for the PCI host bus, get the Linux
-        * PCI host_pci_dev struct and set up host bus linkages
+        * PCI host_pci_dev struct and set up host bus linkages
         */
 
        bus_no = (pcidev_info->pdi_slot_host_handle >> 32) & 0xff;
@@ -489,11 +444,6 @@ void sn_generate_path(struct pci_bus *pci_bus, char *address)
                        sprintf(address, "%s^%d", address, geo_slot(geoid));
 }
 
-/*
- * sn_pci_fixup_bus() - Perform SN specific setup of software structs
- *                     (pcibus_bussoft, pcidev_info) and hardware
- *                     registers, for the specified bus and devices under it.
- */
 void __devinit
 sn_pci_fixup_bus(struct pci_bus *bus)
 {
@@ -519,6 +469,15 @@ sn_io_early_init(void)
        if (!ia64_platform_is("sn2") || IS_RUNNING_ON_FAKE_PROM())
                return 0;
 
+       /* we set the acpi revision to that of the DSDT table OEM rev. */
+       {
+               struct acpi_table_header *header = NULL;
+
+               acpi_get_table_by_index(ACPI_TABLE_INDEX_DSDT, &header);
+               BUG_ON(header == NULL);
+               sn_acpi_rev = header->oem_revision;
+       }
+
        /*
         * prime sn_pci_provider[].  Individial provider init routines will
         * override their respective default entries.
@@ -544,8 +503,12 @@ sn_io_early_init(void)
        register_sn_procfs();
 #endif
 
-       printk(KERN_INFO "ACPI  DSDT OEM Rev 0x%x\n",
-              acpi_gbl_DSDT->oem_revision);
+       {
+               struct acpi_table_header *header;
+               (void)acpi_get_table_by_index(ACPI_TABLE_INDEX_DSDT, &header);
+               printk(KERN_INFO "ACPI  DSDT OEM Rev 0x%x\n",
+                       header->oem_revision);
+       }
        if (SN_ACPI_BASE_SUPPORT())
                sn_io_acpi_init();
        else
@@ -605,7 +568,6 @@ sn_io_late_init(void)
 
 fs_initcall(sn_io_late_init);
 
-EXPORT_SYMBOL(sn_pci_fixup_slot);
 EXPORT_SYMBOL(sn_pci_unfixup_slot);
 EXPORT_SYMBOL(sn_bus_store_sysdata);
 EXPORT_SYMBOL(sn_bus_free_sysdata);
index 9ad843e0383b53a1745591defbf2497461a73471..600be3ebae05b660247050b2393057f22b49eda3 100644 (file)
@@ -56,6 +56,25 @@ static inline u64 sal_get_pcibus_info(u64 segment, u64 busnum, u64 address)
        return ret_stuff.v0;
 }
 
+/*
+ * Retrieve the pci device information given the bus and device|function number.
+ */
+static inline u64
+sal_get_pcidev_info(u64 segment, u64 bus_number, u64 devfn, u64 pci_dev,
+                   u64 sn_irq_info)
+{
+       struct ia64_sal_retval ret_stuff;
+       ret_stuff.status = 0;
+       ret_stuff.v0 = 0;
+
+       SAL_CALL_NOLOCK(ret_stuff,
+                       (u64) SN_SAL_IOIF_GET_PCIDEV_INFO,
+                       (u64) segment, (u64) bus_number, (u64) devfn,
+                       (u64) pci_dev,
+                       sn_irq_info, 0, 0);
+       return ret_stuff.v0;
+}
+
 
 /*
  * sn_fixup_ionodes() - This routine initializes the HUB data structure for
@@ -172,18 +191,40 @@ sn_pci_window_fixup(struct pci_dev *dev, unsigned int count,
 }
 
 /*
- * sn_more_slot_fixup() - We are not running with an ACPI capable PROM,
+ * sn_io_slot_fixup() -   We are not running with an ACPI capable PROM,
  *                       and need to convert the pci_dev->resource
  *                       'start' and 'end' addresses to mapped addresses,
  *                       and setup the pci_controller->window array entries.
  */
 void
-sn_more_slot_fixup(struct pci_dev *dev, struct pcidev_info *pcidev_info)
+sn_io_slot_fixup(struct pci_dev *dev)
 {
        unsigned int count = 0;
        int idx;
        s64 pci_addrs[PCI_ROM_RESOURCE + 1];
        unsigned long addr, end, size, start;
+       struct pcidev_info *pcidev_info;
+       struct sn_irq_info *sn_irq_info;
+       int status;
+
+       pcidev_info = kzalloc(sizeof(struct pcidev_info), GFP_KERNEL);
+       if (!pcidev_info)
+               panic("%s: Unable to alloc memory for pcidev_info", __FUNCTION__);
+
+       sn_irq_info = kzalloc(sizeof(struct sn_irq_info), GFP_KERNEL);
+       if (!sn_irq_info)
+               panic("%s: Unable to alloc memory for sn_irq_info", __FUNCTION__);
+
+       /* Call to retrieve pci device information needed by kernel. */
+       status = sal_get_pcidev_info((u64) pci_domain_nr(dev),
+               (u64) dev->bus->number,
+               dev->devfn,
+               (u64) __pa(pcidev_info),
+               (u64) __pa(sn_irq_info));
+
+       if (status)
+               BUG(); /* Cannot get platform pci device information */
+
 
        /* Copy over PIO Mapped Addresses */
        for (idx = 0; idx <= PCI_ROM_RESOURCE; idx++) {
@@ -219,8 +260,12 @@ sn_more_slot_fixup(struct pci_dev *dev, struct pcidev_info *pcidev_info)
         */
        if (count > 0)
                sn_pci_window_fixup(dev, count, pci_addrs);
+
+       sn_pci_fixup_slot(dev, pcidev_info, sn_irq_info);
 }
 
+EXPORT_SYMBOL(sn_io_slot_fixup);
+
 /*
  * sn_pci_controller_fixup() - This routine sets up a bus's resources
  *                            consistent with the Linux PCI abstraction layer.
@@ -272,9 +317,6 @@ sn_bus_fixup(struct pci_bus *bus)
 {
        struct pci_dev *pci_dev = NULL;
        struct pcibus_bussoft *prom_bussoft_ptr;
-       extern void sn_common_bus_fixup(struct pci_bus *,
-                                       struct pcibus_bussoft *);
-
 
        if (!bus->parent) {  /* If root bus */
                prom_bussoft_ptr = PCI_CONTROLLER(bus)->platform_data;
@@ -291,7 +333,7 @@ sn_bus_fixup(struct pci_bus *bus)
                                           prom_bussoft_ptr->bs_legacy_mem);
         }
         list_for_each_entry(pci_dev, &bus->devices, bus_list) {
-                sn_pci_fixup_slot(pci_dev);
+                sn_io_slot_fixup(pci_dev);
         }
 
 }
index 4aa4f301d56d5a63aa114830b23328eefc034476..ab7e2fd40798ea8702d4b4c5bcd167b3310d0645 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  * @port: port to convert
  *
  * Legacy in/out instructions are converted to ld/st instructions
- * on IA64.  This routine will convert a port number into a valid 
+ * on IA64.  This routine will convert a port number into a valid
  * SN i/o address.  Used by sn_in*() and sn_out*().
  */
+
 void *sn_io_addr(unsigned long port)
 {
        if (!IS_RUNNING_ON_SIMULATOR()) {
index 6846dc9b432dc7a2582cf451a7a68c7c8bb2bb2b..04a8256017eb6ab8c0294580c52b12b584c15102 100644 (file)
@@ -20,7 +20,8 @@
 #include "xtalk/hubdev.h"
 
 int
-sal_pcibr_slot_enable(struct pcibus_info *soft, int device, void *resp)
+sal_pcibr_slot_enable(struct pcibus_info *soft, int device, void *resp,
+                      char **ssdt)
 {
        struct ia64_sal_retval ret_stuff;
        u64 busnum;
@@ -32,7 +33,8 @@ sal_pcibr_slot_enable(struct pcibus_info *soft, int device, void *resp)
        segment = soft->pbi_buscommon.bs_persist_segment;
        busnum = soft->pbi_buscommon.bs_persist_busnum;
        SAL_CALL_NOLOCK(ret_stuff, (u64) SN_SAL_IOIF_SLOT_ENABLE, segment,
-                       busnum, (u64) device, (u64) resp, 0, 0, 0);
+                       busnum, (u64) device, (u64) resp, (u64)ia64_tpa(ssdt),
+                       0, 0);
 
        return (int)ret_stuff.v0;
 }
index b662c75fb28e1080a6667f29c2a5775f774ec23e..cb7f349b051448376a554749d4c4c1dc0c1963f8 100644 (file)
@@ -19,5 +19,6 @@
 # under Linux.
 #
 
-obj-y := malta_int.o malta_mtd.o malta_setup.o
+obj-y := malta_int.o malta_setup.o
+obj-$(CONFIG_MTD) += malta_mtd.o
 obj-$(CONFIG_SMP) += malta_smp.o
index 2659c1c3b78d923e6bb1e42e0fec14e2a2873b67..ea2066c3a1f77e43ca1c6f0f0af5e38ac8046572 100644 (file)
@@ -57,7 +57,7 @@ void __init plat_mem_setup(void)
        board_time_init = sim_time_init;
        prom_printf("Linux started...\n");
 
-#ifdef CONFIG_MT_SMP
+#ifdef CONFIG_MIPS_MT_SMP
        sanitize_tlb_entries();
 #endif
 }
index 6509a9c9863c6d49fab630a840aeac2c67074abc..2f75c6b91ec5211fc258a3b732232e4570864e65 100644 (file)
@@ -28,7 +28,7 @@ struct callvectors* debug_vectors;
 extern unsigned long marvell_base;
 extern unsigned long bus_clock;
 
-#ifdef CONFIG_GALILLEO_GT64240_ETH
+#ifdef CONFIG_GALILEO_GT64240_ETH
 extern unsigned char prom_mac_addr_base[6];
 #endif
 
@@ -61,7 +61,7 @@ void __init prom_init(void)
        mips_machgroup = MACH_GROUP_MOMENCO;
        mips_machtype = MACH_MOMENCO_OCELOT_G;
 
-#ifdef CONFIG_GALILLEO_GT64240_ETH
+#ifdef CONFIG_GALILEO_GT64240_ETH
        /* get the base MAC address for on-board ethernet ports */
        memcpy(prom_mac_addr_base, (void*)0xfc807cf2, 6);
 #endif
index d288f7b018426260a114fc240fa3083a7899b5fc..9db638a7982c517fbd478977e7e81728d7e4d8bf 100644 (file)
@@ -64,7 +64,7 @@
 
 #include "ocelot_pld.h"
 
-#ifdef CONFIG_GALILLEO_GT64240_ETH
+#ifdef CONFIG_GALILEO_GT64240_ETH
 extern unsigned char prom_mac_addr_base[6];
 #endif
 
@@ -185,7 +185,7 @@ void __init plat_mem_setup(void)
        /* do handoff reconfiguration */
        PMON_v2_setup();
 
-#ifdef CONFIG_GALILLEO_GT64240_ETH
+#ifdef CONFIG_GALILEO_GT64240_ETH
        /* get the mac addr */
        memcpy(prom_mac_addr_base, (void*)0xfc807cf2, 6);
 #endif
index 89a28cc018c9b0340fc8ec6efda5acf08f1efff4..113bd48a89bde9ccd16bce8c7e9c827e117ccb92 100644 (file)
@@ -54,6 +54,7 @@ void (*pm_idle)(void);
  * handler when auxio is not present-- unused for now...
  */
 void (*pm_power_off)(void) = machine_power_off;
+EXPORT_SYMBOL(pm_power_off);
 
 /*
  * sysctl - toggle power-off restriction for serial console 
index 276f22881d0fd764cd3922037eed8f962138d646..6b5f26b0fb75c5e716574a70122a79b675b62708 100644 (file)
@@ -292,8 +292,8 @@ int setup_profiling_timer(unsigned int multiplier)
 
 void __init smp_prepare_cpus(unsigned int max_cpus)
 {
-       extern void smp4m_boot_cpus(void);
-       extern void smp4d_boot_cpus(void);
+       extern void __init smp4m_boot_cpus(void);
+       extern void __init smp4d_boot_cpus(void);
        int i, cpuid, extra;
 
        printk("Entering SMP Mode...\n");
@@ -375,8 +375,8 @@ void __init smp_prepare_boot_cpu(void)
 
 int __cpuinit __cpu_up(unsigned int cpu)
 {
-       extern int smp4m_boot_one_cpu(int);
-       extern int smp4d_boot_one_cpu(int);
+       extern int __cpuinit smp4m_boot_one_cpu(int);
+       extern int __cpuinit smp4d_boot_one_cpu(int);
        int ret=0;
 
        switch(sparc_cpu_model) {
index c80ea61e8ba0e84d8ca1c00fc9df0668477759d2..c69de5d4863d69cff95df5cc1a16d21441dc83a0 100644 (file)
@@ -164,7 +164,7 @@ void __init smp4d_boot_cpus(void)
        local_flush_cache_all();
 }
 
-int smp4d_boot_one_cpu(int i)
+int __cpuinit smp4d_boot_one_cpu(int i)
 {
                        extern unsigned long sun4d_cpu_startup;
                        unsigned long *entry = &sun4d_cpu_startup;
index 77558a88a2fe834975c326e768abd9ce82ebe205..d6cffb27fff8159b255177a09ac68e1899fd0d01 100644 (file)
@@ -36,14 +36,14 @@ choice
 
        So, if you do not know what to do here, say 'Default split'.
 
-       config HOST_VMSPLIT_3G
-               bool "Default split (3G/1G user/kernel host split)"
-       config HOST_VMSPLIT_3G_OPT
-               bool "3G/1G user/kernel host split (for full 1G low memory)"
-       config HOST_VMSPLIT_2G
-               bool "2G/2G user/kernel host split"
-       config HOST_VMSPLIT_1G
-               bool "1G/3G user/kernel host split"
+config HOST_VMSPLIT_3G
+       bool "Default split (3G/1G user/kernel host split)"
+config HOST_VMSPLIT_3G_OPT
+       bool "3G/1G user/kernel host split (for full 1G low memory)"
+config HOST_VMSPLIT_2G
+       bool "2G/2G user/kernel host split"
+config HOST_VMSPLIT_1G
+       bool "1G/3G user/kernel host split"
 endchoice
 
 config TOP_ADDR
index 0709fc6670c287ab4b3bf2323792ebc19e4a0873..3f6acd6677179ff30d1cd3b2a3ecac39195466dd 100644 (file)
@@ -219,7 +219,8 @@ int setup_signal_stack_sc(unsigned long stack_top, int sig,
        unsigned long save_sp = PT_REGS_SP(regs);
        int err = 0;
 
-       stack_top &= -8UL;
+       /* This is the same calculation as i386 - ((sp + 4) & 15) == 0 */
+       stack_top = ((stack_top + 4) & -16UL) - 4;
        frame = (struct sigframe __user *) stack_top - 1;
        if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
                return 1;
index 9edf114faf79c571831fd1ca84127204094bb846..af2f017617b471da64942c28391fcd34eebe84f5 100644 (file)
@@ -191,8 +191,9 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
        struct task_struct *me = current;
 
        frame = (struct rt_sigframe __user *)
-               round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8;
-        frame = (struct rt_sigframe __user *) ((unsigned long) frame - 128);
+               round_down(stack_top - sizeof(struct rt_sigframe), 16);
+       /* Subtract 128 for a red zone and 8 for proper alignment */
+        frame = (struct rt_sigframe __user *) ((unsigned long) frame - 128 - 8);
 
        if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate)))
                goto out;
index 49802f1bee9487484b066915160388d5d683234a..bd30d138113fa9e270a8e7974df36f185db11d50 100644 (file)
@@ -32,7 +32,7 @@ static void via_bugs(void)
 
 static int nvidia_hpet_detected __initdata;
 
-static int __init nvidia_hpet_check(unsigned long phys, unsigned long size)
+static int __init nvidia_hpet_check(struct acpi_table_header *header)
 {
        nvidia_hpet_detected = 1;
        return 0;
@@ -53,7 +53,7 @@ static void nvidia_bugs(void)
                return;
 
        nvidia_hpet_detected = 0;
-       acpi_table_parse(ACPI_HPET, nvidia_hpet_check);
+       acpi_table_parse(ACPI_SIG_HPET, nvidia_hpet_check);
        if (nvidia_hpet_detected == 0) {
                acpi_skip_timer_override = 1;
                printk(KERN_INFO "Nvidia board "
index b007433f96bbc540b2d71ef9b50f81d8349a2174..0b3603adf56d4e4f35aa4a5eb22dc97cb72243ed 100644 (file)
@@ -58,8 +58,8 @@ void __init clustered_apic_check(void)
         * Some x86_64 machines use physical APIC mode regardless of how many
         * procs/clusters are present (x86_64 ES7000 is an example).
         */
-       if (acpi_fadt.revision > FADT2_REVISION_ID)
-               if (acpi_fadt.force_apic_physical_destination_mode) {
+       if (acpi_gbl_FADT.header.revision > FADT2_REVISION_ID)
+               if (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL) {
                        genapic = &apic_cluster;
                        goto print;
                }
index 08072568847d997ce0cc50d05ff3831ef33a07d9..50dd8bef850e92b1bc3451c17ab5ee17b1603760 100644 (file)
@@ -798,7 +798,7 @@ int mp_register_gsi(u32 gsi, int triggering, int polarity)
                return gsi;
 
        /* Don't set up the ACPI SCI because it's already set up */
-       if (acpi_fadt.sci_int == gsi)
+       if (acpi_gbl_FADT.sci_interrupt == gsi)
                return gsi;
 
        ioapic = mp_find_ioapic(gsi);
index 5cc76d0d331f0d0fe2b1f7913d7705887112b073..335cc91c49b722c87ba12e8b4040c1f0ee38869b 100644 (file)
@@ -498,7 +498,7 @@ static unsigned long get_cmos_time(void)
 {
        unsigned int year, mon, day, hour, min, sec;
        unsigned long flags;
-       unsigned extyear = 0;
+       unsigned century = 0;
 
        spin_lock_irqsave(&rtc_lock, flags);
 
@@ -510,9 +510,9 @@ static unsigned long get_cmos_time(void)
                mon = CMOS_READ(RTC_MONTH);
                year = CMOS_READ(RTC_YEAR);
 #ifdef CONFIG_ACPI
-               if (acpi_fadt.revision >= FADT2_REVISION_ID &&
-                                       acpi_fadt.century)
-                       extyear = CMOS_READ(acpi_fadt.century);
+               if (acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID &&
+                                       acpi_gbl_FADT.century)
+                       century = CMOS_READ(acpi_gbl_FADT.century);
 #endif
        } while (sec != CMOS_READ(RTC_SECONDS));
 
@@ -530,10 +530,10 @@ static unsigned long get_cmos_time(void)
        BCD_TO_BIN(mon);
        BCD_TO_BIN(year);
 
-       if (extyear) {
-               BCD_TO_BIN(extyear);
-               year += extyear;
-               printk(KERN_INFO "Extended CMOS year: %d\n", extyear);
+       if (century) {
+               BCD_TO_BIN(century);
+               year += century * 100;
+               printk(KERN_INFO "Extended CMOS year: %d\n", century * 100);
        } else { 
                /*
                 * x86-64 systems only exists since 2002.
@@ -954,7 +954,7 @@ __cpuinit int unsynchronized_tsc(void)
        if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) {
 #ifdef CONFIG_ACPI
                /* But TSC doesn't tick in C3 so don't use it there */
-               if (acpi_fadt.length > 0 && acpi_fadt.plvl3_lat < 1000)
+               if (acpi_gbl_FADT.header.length > 0 && acpi_gbl_FADT.C3latency < 1000)
                        return 1;
 #endif
                return 0;
index 1087e150a21896d1abfaadfccfe7fc4de98728ef..2efe215fc76a1db4353edbe231bc12070954af6c 100644 (file)
@@ -101,7 +101,7 @@ static __init inline int srat_disabled(void)
 static __init int slit_valid(struct acpi_table_slit *slit)
 {
        int i, j;
-       int d = slit->localities;
+       int d = slit->locality_count;
        for (i = 0; i < d; i++) {
                for (j = 0; j < d; j++)  {
                        u8 val = slit->entry[d*i + j];
@@ -127,18 +127,18 @@ void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
 
 /* Callback for Proximity Domain -> LAPIC mapping */
 void __init
-acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa)
+acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
 {
        int pxm, node;
        if (srat_disabled())
                return;
-       if (pa->header.length != sizeof(struct acpi_table_processor_affinity)) {
+       if (pa->header.length != sizeof(struct acpi_srat_cpu_affinity)) {
                bad_srat();
                return;
        }
-       if (pa->flags.enabled == 0)
+       if ((pa->flags & ACPI_SRAT_CPU_ENABLED) == 0)
                return;
-       pxm = pa->proximity_domain;
+       pxm = pa->proximity_domain_lo;
        node = setup_node(pxm);
        if (node < 0) {
                printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm);
@@ -254,21 +254,21 @@ static int reserve_hotadd(int node, unsigned long start, unsigned long end)
        /* Looks good */
 
        if (nd->start == nd->end) {
-               nd->start = start;
-               nd->end = end;
+               nd->start = start;
+               nd->end = end;
                changed = 1;
-       } else {
-               if (nd->start == end) {
-                       nd->start = start;
+       } else {
+               if (nd->start == end) {
+                       nd->start = start;
                        changed = 1;
                }
-               if (nd->end == start) {
-                       nd->end = end;
+               if (nd->end == start) {
+                       nd->end = end;
                        changed = 1;
                }
                if (!changed)
                        printk(KERN_ERR "SRAT: Hotplug zone not continuous. Partly ignored\n");
-       }
+       }
 
        ret = update_end_of_memory(nd->end);
 
@@ -279,7 +279,7 @@ static int reserve_hotadd(int node, unsigned long start, unsigned long end)
 
 /* Callback for parsing of the Proximity Domain <-> Memory Area mappings */
 void __init
-acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma)
+acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 {
        struct bootnode *nd, oldnode;
        unsigned long start, end;
@@ -288,16 +288,17 @@ acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma)
 
        if (srat_disabled())
                return;
-       if (ma->header.length != sizeof(struct acpi_table_memory_affinity)) {
+       if (ma->header.length != sizeof(struct acpi_srat_mem_affinity)) {
                bad_srat();
                return;
        }
-       if (ma->flags.enabled == 0)
+       if ((ma->flags & ACPI_SRAT_MEM_ENABLED) == 0)
                return;
-       if (ma->flags.hot_pluggable && !save_add_info())
+
+       if ((ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) && !save_add_info())
                return;
-       start = ma->base_addr_lo | ((u64)ma->base_addr_hi << 32);
-       end = start + (ma->length_lo | ((u64)ma->length_hi << 32));
+       start = ma->base_address;
+       end = start + ma->length;
        pxm = ma->proximity_domain;
        node = setup_node(pxm);
        if (node < 0) {
@@ -337,7 +338,8 @@ acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma)
        push_node_boundaries(node, nd->start >> PAGE_SHIFT,
                                                nd->end >> PAGE_SHIFT);
 
-       if (ma->flags.hot_pluggable && (reserve_hotadd(node, start, end) < 0)) {
+       if ((ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) &&
+           (reserve_hotadd(node, start, end) < 0)) {
                /* Ignore hotadd region. Undo damage */
                printk(KERN_NOTICE "SRAT: Hotplug region ignored\n");
                *nd = oldnode;
@@ -394,7 +396,7 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
 
        /* First clean up the node list */
        for (i = 0; i < MAX_NUMNODES; i++) {
-               cutoff_node(i, start, end);
+               cutoff_node(i, start, end);
                if ((nodes[i].end - nodes[i].start) < NODE_MIN_SIZE) {
                        unparse_node(i);
                        node_set_offline(i);
@@ -426,7 +428,7 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
                if (!node_online(i))
                        setup_node_bootmem(i, nodes[i].start, nodes[i].end);
 
-       for (i = 0; i < NR_CPUS; i++) { 
+       for (i = 0; i < NR_CPUS; i++) {
                if (cpu_to_node[i] == NUMA_NO_NODE)
                        continue;
                if (!node_isset(cpu_to_node[i], nodes_parsed))
@@ -461,7 +463,7 @@ int __node_distance(int a, int b)
 
        if (!acpi_slit)
                return a == b ? 10 : 20;
-       index = acpi_slit->localities * node_to_pxm(a);
+       index = acpi_slit->locality_count * node_to_pxm(a);
        return acpi_slit->entry[index + node_to_pxm(b)];
 }
 
index f8b6b2800a62c86641d94badfc5b1201951b2578..faabb6e87f12461de8c25bf4ec4f14f75216edaa 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * mmconfig.c - Low-level direct PCI config space access via MMCONFIG
- * 
+ *
  * This is an 64bit optimized version that always keeps the full mmconfig
  * space mapped. This allows lockless config space operation.
  */
@@ -25,7 +25,7 @@ static DECLARE_BITMAP(fallback_slots, 32*MAX_CHECK_BUS);
 
 /* Static virtual mapping of the MMCONFIG aperture */
 struct mmcfg_virt {
-       struct acpi_table_mcfg_config *cfg;
+       struct acpi_mcfg_allocation *cfg;
        char __iomem *virt;
 };
 static struct mmcfg_virt *pci_mmcfg_virt;
@@ -33,14 +33,14 @@ static struct mmcfg_virt *pci_mmcfg_virt;
 static char __iomem *get_virt(unsigned int seg, unsigned bus)
 {
        int cfg_num = -1;
-       struct acpi_table_mcfg_config *cfg;
+       struct acpi_mcfg_allocation *cfg;
 
        while (1) {
                ++cfg_num;
                if (cfg_num >= pci_mmcfg_config_num)
                        break;
                cfg = pci_mmcfg_virt[cfg_num].cfg;
-               if (cfg->pci_segment_group_number != seg)
+               if (cfg->pci_segment != seg)
                        continue;
                if ((cfg->start_bus_number <= bus) &&
                    (cfg->end_bus_number >= bus))
@@ -52,7 +52,7 @@ static char __iomem *get_virt(unsigned int seg, unsigned bus)
           this applies to all busses. */
        cfg = &pci_mmcfg_config[0];
        if (pci_mmcfg_config_num == 1 &&
-               cfg->pci_segment_group_number == 0 &&
+               cfg->pci_segment == 0 &&
                (cfg->start_bus_number | cfg->end_bus_number) == 0)
                return pci_mmcfg_virt[0].virt;
 
@@ -170,19 +170,19 @@ void __init pci_mmcfg_init(int type)
        if ((pci_probe & PCI_PROBE_MMCONF) == 0)
                return;
 
-       acpi_table_parse(ACPI_MCFG, acpi_parse_mcfg);
+       acpi_table_parse(ACPI_SIG_MCFG, acpi_parse_mcfg);
        if ((pci_mmcfg_config_num == 0) ||
            (pci_mmcfg_config == NULL) ||
-           (pci_mmcfg_config[0].base_address == 0))
+           (pci_mmcfg_config[0].address == 0))
                return;
 
        /* Only do this check when type 1 works. If it doesn't work
            assume we run on a Mac and always use MCFG */
-       if (type == 1 && !e820_all_mapped(pci_mmcfg_config[0].base_address,
-                       pci_mmcfg_config[0].base_address + MMCONFIG_APER_MIN,
+       if (type == 1 && !e820_all_mapped(pci_mmcfg_config[0].address,
+                       pci_mmcfg_config[0].address + MMCONFIG_APER_MIN,
                        E820_RESERVED)) {
-               printk(KERN_ERR "PCI: BIOS Bug: MCFG area at %x is not E820-reserved\n",
-                               pci_mmcfg_config[0].base_address);
+               printk(KERN_ERR "PCI: BIOS Bug: MCFG area at %lx is not E820-reserved\n",
+                               (unsigned long)pci_mmcfg_config[0].address);
                printk(KERN_ERR "PCI: Not using MMCONFIG.\n");
                return;
        }
@@ -194,15 +194,16 @@ void __init pci_mmcfg_init(int type)
        }
        for (i = 0; i < pci_mmcfg_config_num; ++i) {
                pci_mmcfg_virt[i].cfg = &pci_mmcfg_config[i];
-               pci_mmcfg_virt[i].virt = ioremap_nocache(pci_mmcfg_config[i].base_address,
+               pci_mmcfg_virt[i].virt = ioremap_nocache(pci_mmcfg_config[i].address,
                                                         MMCONFIG_APER_MAX);
                if (!pci_mmcfg_virt[i].virt) {
                        printk(KERN_ERR "PCI: Cannot map mmconfig aperture for "
                                        "segment %d\n",
-                              pci_mmcfg_config[i].pci_segment_group_number);
+                               pci_mmcfg_config[i].pci_segment);
                        return;
                }
-               printk(KERN_INFO "PCI: Using MMCONFIG at %x\n", pci_mmcfg_config[i].base_address);
+               printk(KERN_INFO "PCI: Using MMCONFIG at %lx\n",
+                       (unsigned long)pci_mmcfg_config[i].address);
        }
 
        unreachable_devices();
index 2528a0c0dec8bc906533d1b62163f6404d1c697c..65c6a3cba6d6e85d31d345dd75b322f7196889a5 100644 (file)
@@ -223,7 +223,7 @@ static int verify_command(struct file *file, unsigned char *cmd)
 static int sg_io(struct file *file, request_queue_t *q,
                struct gendisk *bd_disk, struct sg_io_hdr *hdr)
 {
-       unsigned long start_time;
+       unsigned long start_time, timeout;
        int writing = 0, ret = 0;
        struct request *rq;
        char sense[SCSI_SENSE_BUFFERSIZE];
@@ -271,7 +271,8 @@ static int sg_io(struct file *file, request_queue_t *q,
 
        rq->cmd_type = REQ_TYPE_BLOCK_PC;
 
-       rq->timeout = jiffies_to_msecs(hdr->timeout);
+       timeout = msecs_to_jiffies(hdr->timeout);
+       rq->timeout = (timeout < INT_MAX) ? timeout : INT_MAX;
        if (!rq->timeout)
                rq->timeout = q->sg_timeout;
        if (!rq->timeout)
index b61a0632b351baba0a413b866670f230fe8dd20e..20eacc2c9e0e5223f27d9f979672a5ed031b350b 100644 (file)
@@ -78,6 +78,20 @@ config ACPI_SLEEP_PROC_SLEEP
          Create /proc/acpi/sleep
          Deprecated by /sys/power/state
 
+config ACPI_PROCFS
+       bool "Procfs interface (deprecated)"
+       depends on ACPI
+       default y
+       ---help---
+         Procfs interface for ACPI is made optional for back-compatible.
+         As the same functions are duplicated in sysfs interface
+         and this proc interface will be removed some time later,
+         it's marked as deprecated.
+         ( /proc/acpi/debug_layer && debug_level are deprecated by
+           /sys/module/acpi/parameters/debug_layer && debug_level.
+           /proc/acpi/info is deprecated by
+           /sys/module/acpi/parameters/acpica_version )
+
 config ACPI_AC
        tristate "AC Adapter"
        depends on X86
@@ -108,7 +122,7 @@ config ACPI_BUTTON
 
 config ACPI_VIDEO
        tristate "Video"
-       depends on X86
+       depends on X86 && BACKLIGHT_CLASS_DEVICE
        help
          This driver implement the ACPI Extensions For Display Adapters
          for integrated graphics devices on motherboard, as specified in
@@ -140,6 +154,13 @@ config ACPI_DOCK
        help
          This driver adds support for ACPI controlled docking stations
 
+config ACPI_BAY
+       tristate "Removable Drive Bay (EXPERIMENTAL)"
+       depends on EXPERIMENTAL
+       help
+         This driver adds support for ACPI controlled removable drive
+         bays such as the IBM ultrabay or the Dell Module Bay.
+
 config ACPI_PROCESSOR
        tristate "Processor"
        default y
@@ -187,19 +208,22 @@ config ACPI_ASUS
 
          Note: display switching code is currently considered EXPERIMENTAL,
          toying with these values may even lock your machine.
-          
+
           All settings are changed via /proc/acpi/asus directory entries. Owner
           and group for these entries can be set with asus_uid and asus_gid
           parameters.
-          
+
           More information and a userspace daemon for handling the extra buttons
           at <http://sourceforge.net/projects/acpi4asus/>.
-          
+
           If you have an ACPI-compatible ASUS laptop, say Y or M here. This
           driver is still under development, so if your laptop is unsupported or
           something works not quite as expected, please use the mailing list
-          available on the above page (acpi4asus-user@lists.sourceforge.net)
-          
+          available on the above page (acpi4asus-user@lists.sourceforge.net).
+
+         NOTE: This driver is deprecated and will probably be removed soon,
+         use asus-laptop instead.
+
 config ACPI_IBM
        tristate "IBM ThinkPad Laptop Extras"
        depends on X86
index bce7ca27b429e2874eb4e78a229dd65871070d6c..856c32bccacb04024b7036282bed0c865ef7395e 100644 (file)
@@ -37,13 +37,15 @@ endif
 
 obj-y                          += sleep/
 obj-y                          += bus.o glue.o
+obj-y                          += scan.o
 obj-$(CONFIG_ACPI_AC)          += ac.o
 obj-$(CONFIG_ACPI_BATTERY)     += battery.o
 obj-$(CONFIG_ACPI_BUTTON)      += button.o
 obj-$(CONFIG_ACPI_EC)          += ec.o
 obj-$(CONFIG_ACPI_FAN)         += fan.o
 obj-$(CONFIG_ACPI_DOCK)                += dock.o
-obj-$(CONFIG_ACPI_VIDEO)       += video.o 
+obj-$(CONFIG_ACPI_BAY)         += bay.o
+obj-$(CONFIG_ACPI_VIDEO)       += video.o
 obj-$(CONFIG_ACPI_HOTKEY)      += hotkey.o
 obj-y                          += pci_root.o pci_link.o pci_irq.o pci_bind.o
 obj-$(CONFIG_ACPI_POWER)       += power.o
@@ -56,7 +58,6 @@ obj-$(CONFIG_ACPI_NUMA)               += numa.o
 obj-$(CONFIG_ACPI_ASUS)                += asus_acpi.o
 obj-$(CONFIG_ACPI_IBM)         += ibm_acpi.o
 obj-$(CONFIG_ACPI_TOSHIBA)     += toshiba_acpi.o
-obj-y                          += scan.o motherboard.o
 obj-$(CONFIG_ACPI_HOTPLUG_MEMORY)      += acpi_memhotplug.o
 obj-y                          += cm_sbs.o
 obj-$(CONFIG_ACPI_SBS)         += i2c_ec.o sbs.o
index 396140bbbe576bc83f945896c32ad7d8dcc6ef38..31ad70a6e22eb3074261b757fc7d831b841c9bed 100644 (file)
@@ -26,7 +26,7 @@
  *  Pontus Fuchs   - Helper functions, cleanup
  *  Johann Wiesner - Small compile fixes
  *  John Belmonte  - ACPI code for Toshiba laptop was a good starting point.
- *  Éric Burghard  - LED display support for W1N
+ *  ic Burghard  - LED display support for W1N
  *
  */
 
@@ -1128,7 +1128,6 @@ static int asus_model_match(char *model)
 static int asus_hotk_get_info(void)
 {
        struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
-       struct acpi_buffer dsdt = { ACPI_ALLOCATE_BUFFER, NULL };
        union acpi_object *model = NULL;
        int bsts_result;
        char *string = NULL;
@@ -1142,11 +1141,9 @@ static int asus_hotk_get_info(void)
         * HID), this bit will be moved. A global variable asus_info contains
         * the DSDT header.
         */
-       status = acpi_get_table(ACPI_TABLE_ID_DSDT, 1, &dsdt);
+       status = acpi_get_table(ACPI_SIG_DSDT, 1, &asus_info);
        if (ACPI_FAILURE(status))
                printk(KERN_WARNING "  Couldn't get the DSDT table header\n");
-       else
-               asus_info = dsdt.pointer;
 
        /* We have to write 0 on init this far for all ASUS models */
        if (!write_acpi_int(hotk->handle, "INIT", 0, &buffer)) {
@@ -1358,8 +1355,6 @@ static void __exit asus_acpi_exit(void)
        acpi_bus_unregister_driver(&asus_hotk_driver);
        remove_proc_entry(PROC_ASUS, acpi_root_dir);
 
-       kfree(asus_info);
-
        return;
 }
 
index 5f43e0d1489994673a75950838815acfe70c6704..2f4521a48fe7b6e3f66726d389cbe5c436540ef6 100644 (file)
@@ -64,7 +64,7 @@ extern void *acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir);
 
 static int acpi_battery_add(struct acpi_device *device);
 static int acpi_battery_remove(struct acpi_device *device, int type);
-static int acpi_battery_resume(struct acpi_device *device, int status);
+static int acpi_battery_resume(struct acpi_device *device);
 
 static struct acpi_driver acpi_battery_driver = {
        .name = ACPI_BATTERY_DRIVER_NAME,
@@ -753,7 +753,7 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
 }
 
 /* this is needed to learn about changes made in suspended state */
-static int acpi_battery_resume(struct acpi_device *device, int state)
+static int acpi_battery_resume(struct acpi_device *device)
 {
        struct acpi_battery *battery;
 
diff --git a/drivers/acpi/bay.c b/drivers/acpi/bay.c
new file mode 100644 (file)
index 0000000..667fa1d
--- /dev/null
@@ -0,0 +1,490 @@
+/*
+ *  bay.c - ACPI removable drive bay driver
+ *
+ *  Copyright (C) 2006 Kristen Carlson Accardi <kristen.c.accardi@intel.com>
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or (at
+ *  your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ */
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/notifier.h>
+#include <acpi/acpi_bus.h>
+#include <acpi/acpi_drivers.h>
+#include <linux/seq_file.h>
+#include <asm/uaccess.h>
+#include <linux/platform_device.h>
+
+#define ACPI_BAY_DRIVER_NAME "ACPI Removable Drive Bay Driver"
+
+ACPI_MODULE_NAME("bay")
+MODULE_AUTHOR("Kristen Carlson Accardi");
+MODULE_DESCRIPTION(ACPI_BAY_DRIVER_NAME);
+MODULE_LICENSE("GPL");
+#define ACPI_BAY_CLASS "bay"
+#define ACPI_BAY_COMPONENT     0x10000000
+#define _COMPONENT ACPI_BAY_COMPONENT
+#define bay_dprintk(h,s) {\
+       char prefix[80] = {'\0'};\
+       struct acpi_buffer buffer = {sizeof(prefix), prefix};\
+       acpi_get_name(h, ACPI_FULL_PATHNAME, &buffer);\
+       printk(KERN_DEBUG PREFIX "%s: %s\n", prefix, s); }
+static void bay_notify(acpi_handle handle, u32 event, void *data);
+static int acpi_bay_add(struct acpi_device *device);
+static int acpi_bay_remove(struct acpi_device *device, int type);
+
+static struct acpi_driver acpi_bay_driver = {
+       .name = ACPI_BAY_DRIVER_NAME,
+       .class = ACPI_BAY_CLASS,
+       .ids = ACPI_BAY_HID,
+       .ops = {
+               .add = acpi_bay_add,
+               .remove = acpi_bay_remove,
+               },
+};
+
+struct bay {
+       acpi_handle handle;
+       char *name;
+       struct list_head list;
+       struct platform_device *pdev;
+};
+
+static LIST_HEAD(drive_bays);
+
+
+/*****************************************************************************
+ *                         Drive Bay functions                               *
+ *****************************************************************************/
+/**
+ * is_ejectable - see if a device is ejectable
+ * @handle: acpi handle of the device
+ *
+ * If an acpi object has a _EJ0 method, then it is ejectable
+ */
+static int is_ejectable(acpi_handle handle)
+{
+       acpi_status status;
+       acpi_handle tmp;
+
+       status = acpi_get_handle(handle, "_EJ0", &tmp);
+       if (ACPI_FAILURE(status))
+               return 0;
+       return 1;
+}
+
+/**
+ * bay_present - see if the bay device is present
+ * @bay: the drive bay
+ *
+ * execute the _STA method.
+ */
+static int bay_present(struct bay *bay)
+{
+       unsigned long sta;
+       acpi_status status;
+
+       if (bay) {
+               status = acpi_evaluate_integer(bay->handle, "_STA", NULL, &sta);
+               if (ACPI_SUCCESS(status) && sta)
+                       return 1;
+       }
+       return 0;
+}
+
+/**
+ * eject_device - respond to an eject request
+ * @handle - the device to eject
+ *
+ * Call this devices _EJ0 method.
+ */
+static void eject_device(acpi_handle handle)
+{
+       struct acpi_object_list arg_list;
+       union acpi_object arg;
+
+       bay_dprintk(handle, "Ejecting device");
+
+       arg_list.count = 1;
+       arg_list.pointer = &arg;
+       arg.type = ACPI_TYPE_INTEGER;
+       arg.integer.value = 1;
+
+       if (ACPI_FAILURE(acpi_evaluate_object(handle, "_EJ0",
+                                             &arg_list, NULL)))
+               pr_debug("Failed to evaluate _EJ0!\n");
+}
+
+/*
+ * show_present - read method for "present" file in sysfs
+ */
+static ssize_t show_present(struct device *dev,
+                          struct device_attribute *attr, char *buf)
+{
+       struct bay *bay = dev_get_drvdata(dev);
+       return snprintf(buf, PAGE_SIZE, "%d\n", bay_present(bay));
+
+}
+DEVICE_ATTR(present, S_IRUGO, show_present, NULL);
+
+/*
+ * write_eject - write method for "eject" file in sysfs
+ */
+static ssize_t write_eject(struct device *dev, struct device_attribute *attr,
+                          const char *buf, size_t count)
+{
+       struct bay *bay = dev_get_drvdata(dev);
+
+       if (!count)
+               return -EINVAL;
+
+       eject_device(bay->handle);
+       return count;
+}
+DEVICE_ATTR(eject, S_IWUSR, NULL, write_eject);
+
+/**
+ * is_ata - see if a device is an ata device
+ * @handle: acpi handle of the device
+ *
+ * If an acpi object has one of 4 ATA ACPI methods defined,
+ * then it is an ATA device
+ */
+static int is_ata(acpi_handle handle)
+{
+       acpi_handle tmp;
+
+       if ((ACPI_SUCCESS(acpi_get_handle(handle, "_GTF", &tmp))) ||
+          (ACPI_SUCCESS(acpi_get_handle(handle, "_GTM", &tmp))) ||
+          (ACPI_SUCCESS(acpi_get_handle(handle, "_STM", &tmp))) ||
+          (ACPI_SUCCESS(acpi_get_handle(handle, "_SDD", &tmp))))
+               return 1;
+
+       return 0;
+}
+
+/**
+ * parent_is_ata(acpi_handle handle)
+ *
+ */
+static int parent_is_ata(acpi_handle handle)
+{
+       acpi_handle phandle;
+
+       if (acpi_get_parent(handle, &phandle))
+               return 0;
+
+       return is_ata(phandle);
+}
+
+/**
+ * is_ejectable_bay - see if a device is an ejectable drive bay
+ * @handle: acpi handle of the device
+ *
+ * If an acpi object is ejectable and has one of the ACPI ATA
+ * methods defined, then we can safely call it an ejectable
+ * drive bay
+ */
+static int is_ejectable_bay(acpi_handle handle)
+{
+       if ((is_ata(handle) || parent_is_ata(handle)) && is_ejectable(handle))
+               return 1;
+       return 0;
+}
+
+/**
+ * eject_removable_drive - try to eject this drive
+ * @dev : the device structure of the drive
+ *
+ * If a device is a removable drive that requires an _EJ0 method
+ * to be executed in order to safely remove from the system, do
+ * it.  ATM - always returns success
+ */
+int eject_removable_drive(struct device *dev)
+{
+       acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
+
+       if (handle) {
+               bay_dprintk(handle, "Got device handle");
+               if (is_ejectable_bay(handle))
+                       eject_device(handle);
+       } else {
+               printk("No acpi handle for device\n");
+       }
+
+       /* should I return an error code? */
+       return 0;
+}
+EXPORT_SYMBOL_GPL(eject_removable_drive);
+
+static int acpi_bay_add(struct acpi_device *device)
+{
+       bay_dprintk(device->handle, "adding bay device");
+       strcpy(acpi_device_name(device), "Dockable Bay");
+       strcpy(acpi_device_class(device), "bay");
+       return 0;
+}
+
+static int acpi_bay_add_fs(struct bay *bay)
+{
+       int ret;
+       struct device *dev = &bay->pdev->dev;
+
+       ret = device_create_file(dev, &dev_attr_present);
+       if (ret)
+               goto add_fs_err;
+       ret = device_create_file(dev, &dev_attr_eject);
+       if (ret) {
+               device_remove_file(dev, &dev_attr_present);
+               goto add_fs_err;
+       }
+       return 0;
+
+ add_fs_err:
+       bay_dprintk(bay->handle, "Error adding sysfs files\n");
+       return ret;
+}
+
+static void acpi_bay_remove_fs(struct bay *bay)
+{
+       struct device *dev = &bay->pdev->dev;
+
+       /* cleanup sysfs */
+       device_remove_file(dev, &dev_attr_present);
+       device_remove_file(dev, &dev_attr_eject);
+}
+
+static int bay_is_dock_device(acpi_handle handle)
+{
+       acpi_handle parent;
+
+       acpi_get_parent(handle, &parent);
+
+       /* if the device or it's parent is dependent on the
+        * dock, then we are a dock device
+        */
+       return (is_dock_device(handle) || is_dock_device(parent));
+}
+
+static int bay_add(acpi_handle handle, int id)
+{
+       acpi_status status;
+       struct bay *new_bay;
+       struct platform_device *pdev;
+       struct acpi_buffer nbuffer = {ACPI_ALLOCATE_BUFFER, NULL};
+       acpi_get_name(handle, ACPI_FULL_PATHNAME, &nbuffer);
+
+       bay_dprintk(handle, "Adding notify handler");
+
+       /*
+        * Initialize bay device structure
+        */
+       new_bay = kzalloc(GFP_ATOMIC, sizeof(*new_bay));
+       INIT_LIST_HEAD(&new_bay->list);
+       new_bay->handle = handle;
+       new_bay->name = (char *)nbuffer.pointer;
+
+       /* initialize platform device stuff */
+       pdev = platform_device_register_simple(ACPI_BAY_CLASS, id, NULL, 0);
+       if (pdev == NULL) {
+               printk(KERN_ERR PREFIX "Error registering bay device\n");
+               goto bay_add_err;
+       }
+       new_bay->pdev = pdev;
+       platform_set_drvdata(pdev, new_bay);
+
+       if (acpi_bay_add_fs(new_bay)) {
+               platform_device_unregister(new_bay->pdev);
+               goto bay_add_err;
+       }
+
+       /* register for events on this device */
+       status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
+                       bay_notify, new_bay);
+       if (ACPI_FAILURE(status)) {
+               printk(KERN_ERR PREFIX "Error installing bay notify handler\n");
+       }
+
+       /* if we are on a dock station, we should register for dock
+        * notifications.
+        */
+       if (bay_is_dock_device(handle)) {
+               bay_dprintk(handle, "Is dependent on dock\n");
+               register_hotplug_dock_device(handle, bay_notify, new_bay);
+       }
+       list_add(&new_bay->list, &drive_bays);
+       printk(KERN_INFO PREFIX "Bay [%s] Added\n", new_bay->name);
+       return 0;
+
+bay_add_err:
+       kfree(new_bay->name);
+       kfree(new_bay);
+       return -ENODEV;
+}
+
+static int acpi_bay_remove(struct acpi_device *device, int type)
+{
+       /*** FIXME: do something here */
+       return 0;
+}
+
+/**
+ * bay_create_acpi_device - add new devices to acpi
+ * @handle - handle of the device to add
+ *
+ *  This function will create a new acpi_device for the given
+ *  handle if one does not exist already.  This should cause
+ *  acpi to scan for drivers for the given devices, and call
+ *  matching driver's add routine.
+ *
+ *  Returns a pointer to the acpi_device corresponding to the handle.
+ */
+static struct acpi_device * bay_create_acpi_device(acpi_handle handle)
+{
+       struct acpi_device *device = NULL;
+       struct acpi_device *parent_device;
+       acpi_handle parent;
+       int ret;
+
+       bay_dprintk(handle, "Trying to get device");
+       if (acpi_bus_get_device(handle, &device)) {
+               /*
+                * no device created for this object,
+                * so we should create one.
+                */
+               bay_dprintk(handle, "No device for handle");
+               acpi_get_parent(handle, &parent);
+               if (acpi_bus_get_device(parent, &parent_device))
+                       parent_device = NULL;
+
+               ret = acpi_bus_add(&device, parent_device, handle,
+                       ACPI_BUS_TYPE_DEVICE);
+               if (ret) {
+                       pr_debug("error adding bus, %x\n",
+                               -ret);
+                       return NULL;
+               }
+       }
+       return device;
+}
+
+/**
+ * bay_notify - act upon an acpi bay notification
+ * @handle: the bay handle
+ * @event: the acpi event
+ * @data: our driver data struct
+ *
+ */
+static void bay_notify(acpi_handle handle, u32 event, void *data)
+{
+       struct acpi_device *dev;
+
+       bay_dprintk(handle, "Bay event");
+
+       switch(event) {
+       case ACPI_NOTIFY_BUS_CHECK:
+               printk("Bus Check\n");
+       case ACPI_NOTIFY_DEVICE_CHECK:
+               printk("Device Check\n");
+               dev = bay_create_acpi_device(handle);
+               if (dev)
+                       acpi_bus_generate_event(dev, event, 0);
+               else
+                       printk("No device for generating event\n");
+               /* wouldn't it be a good idea to just rescan SATA
+                * right here?
+                */
+               break;
+       case ACPI_NOTIFY_EJECT_REQUEST:
+               printk("Eject request\n");
+               dev = bay_create_acpi_device(handle);
+               if (dev)
+                       acpi_bus_generate_event(dev, event, 0);
+               else
+                       printk("No device for generating eventn");
+
+               /* wouldn't it be a good idea to just call the
+                * eject_device here if we were a SATA device?
+                */
+               break;
+       default:
+               printk("unknown event %d\n", event);
+       }
+}
+
+static acpi_status
+find_bay(acpi_handle handle, u32 lvl, void *context, void **rv)
+{
+       int *count = (int *)context;
+
+       /*
+        * there could be more than one ejectable bay.
+        * so, just return AE_OK always so that every object
+        * will be checked.
+        */
+       if (is_ejectable_bay(handle)) {
+               bay_dprintk(handle, "found ejectable bay");
+               if (!bay_add(handle, *count))
+                       (*count)++;
+       }
+       return AE_OK;
+}
+
+static int __init bay_init(void)
+{
+       int bays = 0;
+
+       INIT_LIST_HEAD(&drive_bays);
+
+       /* look for dockable drive bays */
+       acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
+               ACPI_UINT32_MAX, find_bay, &bays, NULL);
+
+       if (bays)
+               if ((acpi_bus_register_driver(&acpi_bay_driver) < 0))
+                       printk(KERN_ERR "Unable to register bay driver\n");
+
+       if (!bays)
+               return -ENODEV;
+
+       return 0;
+}
+
+static void __exit bay_exit(void)
+{
+       struct bay *bay, *tmp;
+
+       list_for_each_entry_safe(bay, tmp, &drive_bays, list) {
+               if (is_dock_device(bay->handle))
+                       unregister_hotplug_dock_device(bay->handle);
+               acpi_bay_remove_fs(bay);
+               acpi_remove_notify_handler(bay->handle, ACPI_SYSTEM_NOTIFY,
+                       bay_notify);
+               platform_device_unregister(bay->pdev);
+               kfree(bay->name);
+               kfree(bay);
+       }
+
+       acpi_bus_unregister_driver(&acpi_bay_driver);
+}
+
+postcore_initcall(bay_init);
+module_exit(bay_exit);
+
index f9c972b26f4fd49bd883508736ad5c04633b885d..f289fd41e77d5ef1bdb8d4d44359b08a43651930 100644 (file)
@@ -44,7 +44,7 @@ struct acpi_blacklist_item {
        char oem_id[7];
        char oem_table_id[9];
        u32 oem_revision;
-       acpi_table_type table;
+       char *table;
        enum acpi_blacklist_predicates oem_revision_predicate;
        char *reason;
        u32 is_critical_error;
@@ -56,18 +56,18 @@ struct acpi_blacklist_item {
  */
 static struct acpi_blacklist_item acpi_blacklist[] __initdata = {
        /* Compaq Presario 1700 */
-       {"PTLTD ", "  DSDT  ", 0x06040000, ACPI_DSDT, less_than_or_equal,
+       {"PTLTD ", "  DSDT  ", 0x06040000, ACPI_SIG_DSDT, less_than_or_equal,
         "Multiple problems", 1},
        /* Sony FX120, FX140, FX150? */
-       {"SONY  ", "U0      ", 0x20010313, ACPI_DSDT, less_than_or_equal,
+       {"SONY  ", "U0      ", 0x20010313, ACPI_SIG_DSDT, less_than_or_equal,
         "ACPI driver problem", 1},
        /* Compaq Presario 800, Insyde BIOS */
-       {"INT440", "SYSFexxx", 0x00001001, ACPI_DSDT, less_than_or_equal,
+       {"INT440", "SYSFexxx", 0x00001001, ACPI_SIG_DSDT, less_than_or_equal,
         "Does not use _REG to protect EC OpRegions", 1},
        /* IBM 600E - _ADR should return 7, but it returns 1 */
-       {"IBM   ", "TP600E  ", 0x00000105, ACPI_DSDT, less_than_or_equal,
+       {"IBM   ", "TP600E  ", 0x00000105, ACPI_SIG_DSDT, less_than_or_equal,
         "Incorrect _ADR", 1},
-       {"ASUS\0\0", "P2B-S   ", 0, ACPI_DSDT, all_versions,
+       {"ASUS\0\0", "P2B-S   ", 0, ACPI_SIG_DSDT, all_versions,
         "Bogus PCI routing", 1},
 
        {""}
@@ -79,7 +79,7 @@ static int __init blacklist_by_year(void)
 {
        int year = dmi_get_year(DMI_BIOS_DATE);
        /* Doesn't exist? Likely an old system */
-       if (year == -1) 
+       if (year == -1)
                return 1;
        /* 0? Likely a buggy new BIOS */
        if (year == 0)
@@ -103,22 +103,21 @@ int __init acpi_blacklisted(void)
 {
        int i = 0;
        int blacklisted = 0;
-       struct acpi_table_header *table_header;
+       struct acpi_table_header table_header;
 
        while (acpi_blacklist[i].oem_id[0] != '\0') {
-               if (acpi_get_table_header_early
-                   (acpi_blacklist[i].table, &table_header)) {
+               if (acpi_get_table_header(acpi_blacklist[i].table, 0, &table_header)) {
                        i++;
                        continue;
                }
 
-               if (strncmp(acpi_blacklist[i].oem_id, table_header->oem_id, 6)) {
+               if (strncmp(acpi_blacklist[i].oem_id, table_header.oem_id, 6)) {
                        i++;
                        continue;
                }
 
                if (strncmp
-                   (acpi_blacklist[i].oem_table_id, table_header->oem_table_id,
+                   (acpi_blacklist[i].oem_table_id, table_header.oem_table_id,
                     8)) {
                        i++;
                        continue;
@@ -127,14 +126,14 @@ int __init acpi_blacklisted(void)
                if ((acpi_blacklist[i].oem_revision_predicate == all_versions)
                    || (acpi_blacklist[i].oem_revision_predicate ==
                        less_than_or_equal
-                       && table_header->oem_revision <=
+                       && table_header.oem_revision <=
                        acpi_blacklist[i].oem_revision)
                    || (acpi_blacklist[i].oem_revision_predicate ==
                        greater_than_or_equal
-                       && table_header->oem_revision >=
+                       && table_header.oem_revision >=
                        acpi_blacklist[i].oem_revision)
                    || (acpi_blacklist[i].oem_revision_predicate == equal
-                       && table_header->oem_revision ==
+                       && table_header.oem_revision ==
                        acpi_blacklist[i].oem_revision)) {
 
                        printk(KERN_ERR PREFIX
index 766332e4559212aa9c253ddf3723e65367487b96..c26468da429507be4ccef20e3f1b57165d860d85 100644 (file)
@@ -44,9 +44,6 @@ ACPI_MODULE_NAME("acpi_bus")
 extern void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger);
 #endif
 
-struct fadt_descriptor acpi_fadt;
-EXPORT_SYMBOL(acpi_fadt);
-
 struct acpi_device *acpi_root;
 struct proc_dir_entry *acpi_root_dir;
 EXPORT_SYMBOL(acpi_root_dir);
@@ -195,7 +192,7 @@ int acpi_bus_set_power(acpi_handle handle, int state)
 
        if (!device->flags.power_manageable) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device `[%s]' is not power manageable\n",
-                               device->kobj.name));
+                               device->dev.kobj.name));
                return -ENODEV;
        }
        /*
@@ -582,11 +579,12 @@ static int __init acpi_bus_init_irq(void)
        return 0;
 }
 
+acpi_native_uint acpi_gbl_permanent_mmap;
+
+
 void __init acpi_early_init(void)
 {
        acpi_status status = AE_OK;
-       struct acpi_buffer buffer = { sizeof(acpi_fadt), &acpi_fadt };
-
 
        if (acpi_disabled)
                return;
@@ -597,6 +595,15 @@ void __init acpi_early_init(void)
        if (!acpi_strict)