aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2005-09-09 21:14:47 -0400
committerDmitry Torokhov <dtor_core@ameritech.net>2005-09-09 21:14:47 -0400
commitd344c5e0856ad03278d8700b503762dbc8b86e12 (patch)
treea6d893a643470a3c2580a58f3228a55fa1fd1d82 /include
parent010988e888a0abbe7118635c1b33d049caae6b29 (diff)
parent87fc767b832ef5a681a0ff9d203c3289bc3be2bf (diff)
Manual merge with Linus
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acconfig.h29
-rw-r--r--include/acpi/acdebug.h259
-rw-r--r--include/acpi/acdisasm.h322
-rw-r--r--include/acpi/acdispat.h405
-rw-r--r--include/acpi/acevents.h241
-rw-r--r--include/acpi/acexcep.h34
-rw-r--r--include/acpi/acglobal.h271
-rw-r--r--include/acpi/achware.h107
-rw-r--r--include/acpi/acinterp.h626
-rw-r--r--include/acpi/aclocal.h722
-rw-r--r--include/acpi/acmacros.h145
-rw-r--r--include/acpi/acnames.h13
-rw-r--r--include/acpi/acnamesp.h357
-rw-r--r--include/acpi/acobject.h390
-rw-r--r--include/acpi/acopcode.h6
-rw-r--r--include/acpi/acoutput.h10
-rw-r--r--include/acpi/acparser.h255
-rw-r--r--include/acpi/acpi.h35
-rw-r--r--include/acpi/acpi_bus.h334
-rw-r--r--include/acpi/acpi_drivers.h40
-rw-r--r--include/acpi/acpiosxf.h264
-rw-r--r--include/acpi/acpixf.h408
-rw-r--r--include/acpi/acresrc.h309
-rw-r--r--include/acpi/acstruct.h221
-rw-r--r--include/acpi/actables.h121
-rw-r--r--include/acpi/actbl.h282
-rw-r--r--include/acpi/actbl1.h141
-rw-r--r--include/acpi/actbl2.h260
-rw-r--r--include/acpi/actbl71.h148
-rw-r--r--include/acpi/actypes.h807
-rw-r--r--include/acpi/acutils.h718
-rw-r--r--include/acpi/amlcode.h172
-rw-r--r--include/acpi/amlresrc.h380
-rw-r--r--include/acpi/container.h3
-rw-r--r--include/acpi/pdc_intel.h4
-rw-r--r--include/acpi/platform/acenv.h70
-rw-r--r--include/acpi/platform/acgcc.h10
-rw-r--r--include/acpi/platform/aclinux.h15
-rw-r--r--include/acpi/processor.h238
-rw-r--r--include/asm-alpha/auxvec.h24
-rw-r--r--include/asm-alpha/elf.h22
-rw-r--r--include/asm-alpha/fcntl.h35
-rw-r--r--include/asm-alpha/futex.h53
-rw-r--r--include/asm-alpha/hdreg.h1
-rw-r--r--include/asm-alpha/page.h16
-rw-r--r--include/asm-alpha/pci.h13
-rw-r--r--include/asm-alpha/types.h2
-rw-r--r--include/asm-alpha/uaccess.h6
-rw-r--r--include/asm-arm/arch-omap/board-h4.h3
-rw-r--r--include/asm-arm/arch-omap/board-innovator.h25
-rw-r--r--include/asm-arm/arch-omap/board-perseus2.h17
-rw-r--r--include/asm-arm/arch-omap/board-voiceblue.h5
-rw-r--r--include/asm-arm/arch-omap/board.h19
-rw-r--r--include/asm-arm/arch-omap/cpu.h187
-rw-r--r--include/asm-arm/arch-omap/debug-macro.S13
-rw-r--r--include/asm-arm/arch-omap/dma.h1
-rw-r--r--include/asm-arm/arch-omap/dmtimer.h92
-rw-r--r--include/asm-arm/arch-omap/dsp.h244
-rw-r--r--include/asm-arm/arch-omap/dsp_common.h37
-rw-r--r--include/asm-arm/arch-omap/entry-macro.S28
-rw-r--r--include/asm-arm/arch-omap/gpio.h28
-rw-r--r--include/asm-arm/arch-omap/hardware.h39
-rw-r--r--include/asm-arm/arch-omap/io.h26
-rw-r--r--include/asm-arm/arch-omap/irqs.h6
-rw-r--r--include/asm-arm/arch-omap/memory.h14
-rw-r--r--include/asm-arm/arch-omap/mtd-xip.h61
-rw-r--r--include/asm-arm/arch-omap/mux.h10
-rw-r--r--include/asm-arm/arch-omap/omap1510.h13
-rw-r--r--include/asm-arm/arch-omap/omap16xx.h16
-rw-r--r--include/asm-arm/arch-omap/omap24xx.h15
-rw-r--r--include/asm-arm/arch-omap/omap730.h4
-rw-r--r--include/asm-arm/arch-omap/pm.h55
-rw-r--r--include/asm-arm/arch-omap/serial.h37
-rw-r--r--include/asm-arm/arch-omap/uncompress.h10
-rw-r--r--include/asm-arm/arch-pxa/corgi.h8
-rw-r--r--include/asm-arm/arch-pxa/hardware.h18
-rw-r--r--include/asm-arm/arch-pxa/i2c.h70
-rw-r--r--include/asm-arm/arch-pxa/mmc.h2
-rw-r--r--include/asm-arm/arch-pxa/pxafb.h1
-rw-r--r--include/asm-arm/arch-s3c2410/anubis-cpld.h24
-rw-r--r--include/asm-arm/arch-s3c2410/anubis-irq.h23
-rw-r--r--include/asm-arm/arch-s3c2410/anubis-map.h46
-rw-r--r--include/asm-arm/arch-s3c2410/fb.h69
-rw-r--r--include/asm-arm/arch-s3c2410/regs-lcd.h17
-rw-r--r--include/asm-arm/arch-sa1100/hardware.h18
-rw-r--r--include/asm-arm/auxvec.h4
-rw-r--r--include/asm-arm/cacheflush.h7
-rw-r--r--include/asm-arm/fcntl.h78
-rw-r--r--include/asm-arm/futex.h53
-rw-r--r--include/asm-arm/hardware/scoop.h13
-rw-r--r--include/asm-arm/hdreg.h1
-rw-r--r--include/asm-arm/mach/irq.h12
-rw-r--r--include/asm-arm/mach/time.h2
-rw-r--r--include/asm-arm/page.h16
-rw-r--r--include/asm-arm/pci.h13
-rw-r--r--include/asm-arm/types.h2
-rw-r--r--include/asm-arm/uaccess.h6
-rw-r--r--include/asm-arm26/auxvec.h4
-rw-r--r--include/asm-arm26/fcntl.h76
-rw-r--r--include/asm-arm26/futex.h53
-rw-r--r--include/asm-arm26/hdreg.h1
-rw-r--r--include/asm-arm26/page.h16
-rw-r--r--include/asm-arm26/types.h2
-rw-r--r--include/asm-arm26/uaccess.h6
-rw-r--r--include/asm-cris/auxvec.h4
-rw-r--r--include/asm-cris/fcntl.h91
-rw-r--r--include/asm-cris/futex.h53
-rw-r--r--include/asm-cris/irq.h5
-rw-r--r--include/asm-cris/page.h15
-rw-r--r--include/asm-cris/types.h2
-rw-r--r--include/asm-cris/uaccess.h7
-rw-r--r--include/asm-frv/auxvec.h4
-rw-r--r--include/asm-frv/fcntl.h89
-rw-r--r--include/asm-frv/futex.h53
-rw-r--r--include/asm-frv/page.h17
-rw-r--r--include/asm-frv/types.h2
-rw-r--r--include/asm-frv/uaccess.h6
-rw-r--r--include/asm-generic/fcntl.h149
-rw-r--r--include/asm-generic/hdreg.h8
-rw-r--r--include/asm-generic/page.h26
-rw-r--r--include/asm-generic/pci.h13
-rw-r--r--include/asm-generic/pgtable.h16
-rw-r--r--include/asm-generic/sections.h1
-rw-r--r--include/asm-generic/unaligned.h12
-rw-r--r--include/asm-generic/vmlinux.lds.h15
-rw-r--r--include/asm-h8300/auxvec.h4
-rw-r--r--include/asm-h8300/fcntl.h78
-rw-r--r--include/asm-h8300/futex.h53
-rw-r--r--include/asm-h8300/hdreg.h15
-rw-r--r--include/asm-h8300/page.h16
-rw-r--r--include/asm-h8300/types.h2
-rw-r--r--include/asm-h8300/uaccess.h6
-rw-r--r--include/asm-i386/acpi.h20
-rw-r--r--include/asm-i386/agp.h2
-rw-r--r--include/asm-i386/apicdef.h1
-rw-r--r--include/asm-i386/auxvec.h11
-rw-r--r--include/asm-i386/bugs.h5
-rw-r--r--include/asm-i386/desc.h33
-rw-r--r--include/asm-i386/elf.h8
-rw-r--r--include/asm-i386/fcntl.h89
-rw-r--r--include/asm-i386/fixmap.h2
-rw-r--r--include/asm-i386/futex.h108
-rw-r--r--include/asm-i386/hdreg.h1
-rw-r--r--include/asm-i386/io_apic.h4
-rw-r--r--include/asm-i386/kdebug.h11
-rw-r--r--include/asm-i386/mach-default/mach_reboot.h10
-rw-r--r--include/asm-i386/mach-es7000/mach_mpparse.h30
-rw-r--r--include/asm-i386/mach-generic/mach_apic.h2
-rw-r--r--include/asm-i386/mmzone.h2
-rw-r--r--include/asm-i386/mpspec.h5
-rw-r--r--include/asm-i386/msr.h15
-rw-r--r--include/asm-i386/page.h17
-rw-r--r--include/asm-i386/pgtable-3level.h2
-rw-r--r--include/asm-i386/pgtable.h42
-rw-r--r--include/asm-i386/processor.h44
-rw-r--r--include/asm-i386/ptrace.h7
-rw-r--r--include/asm-i386/setup.h2
-rw-r--r--include/asm-i386/smp.h2
-rw-r--r--include/asm-i386/system.h36
-rw-r--r--include/asm-i386/thread_info.h7
-rw-r--r--include/asm-i386/timer.h3
-rw-r--r--include/asm-i386/types.h2
-rw-r--r--include/asm-i386/uaccess.h24
-rw-r--r--include/asm-i386/xor.h26
-rw-r--r--include/asm-ia64/acpi-ext.h1
-rw-r--r--include/asm-ia64/auxvec.h11
-rw-r--r--include/asm-ia64/compat.h20
-rw-r--r--include/asm-ia64/elf.h8
-rw-r--r--include/asm-ia64/fcntl.h78
-rw-r--r--include/asm-ia64/futex.h53
-rw-r--r--include/asm-ia64/hdreg.h14
-rw-r--r--include/asm-ia64/hw_irq.h7
-rw-r--r--include/asm-ia64/iosapic.h4
-rw-r--r--include/asm-ia64/irq.h15
-rw-r--r--include/asm-ia64/kprobes.h1
-rw-r--r--include/asm-ia64/pci.h13
-rw-r--r--include/asm-ia64/processor.h3
-rw-r--r--include/asm-ia64/ptrace.h2
-rw-r--r--include/asm-ia64/system.h1
-rw-r--r--include/asm-ia64/thread_info.h2
-rw-r--r--include/asm-ia64/topology.h23
-rw-r--r--include/asm-ia64/types.h2
-rw-r--r--include/asm-ia64/uaccess.h7
-rw-r--r--include/asm-m32r/auxvec.h4
-rw-r--r--include/asm-m32r/fcntl.h93
-rw-r--r--include/asm-m32r/futex.h53
-rw-r--r--include/asm-m32r/hdreg.h1
-rw-r--r--include/asm-m32r/page.h21
-rw-r--r--include/asm-m32r/types.h2
-rw-r--r--include/asm-m32r/uaccess.h25
-rw-r--r--include/asm-m68k/auxvec.h4
-rw-r--r--include/asm-m68k/cacheflush.h31
-rw-r--r--include/asm-m68k/fcntl.h78
-rw-r--r--include/asm-m68k/futex.h53
-rw-r--r--include/asm-m68k/hdreg.h1
-rw-r--r--include/asm-m68k/page.h16
-rw-r--r--include/asm-m68k/string.h403
-rw-r--r--include/asm-m68k/types.h2
-rw-r--r--include/asm-m68k/uaccess.h6
-rw-r--r--include/asm-m68knommu/auxvec.h4
-rw-r--r--include/asm-m68knommu/coldfire.h6
-rw-r--r--include/asm-m68knommu/futex.h53
-rw-r--r--include/asm-m68knommu/hdreg.h1
-rw-r--r--include/asm-m68knommu/m523xsim.h46
-rw-r--r--include/asm-m68knommu/mcfsim.h6
-rw-r--r--include/asm-m68knommu/mcfuart.h2
-rw-r--r--include/asm-m68knommu/page.h16
-rw-r--r--include/asm-m68knommu/uaccess.h6
-rw-r--r--include/asm-mips/a.out.h4
-rw-r--r--include/asm-mips/addrspace.h2
-rw-r--r--include/asm-mips/asmmacro-32.h2
-rw-r--r--include/asm-mips/asmmacro-64.h2
-rw-r--r--include/asm-mips/asmmacro.h8
-rw-r--r--include/asm-mips/atomic.h4
-rw-r--r--include/asm-mips/auxvec.h4
-rw-r--r--include/asm-mips/bitops.h12
-rw-r--r--include/asm-mips/bugs.h2
-rw-r--r--include/asm-mips/checksum.h4
-rw-r--r--include/asm-mips/compat.h10
-rw-r--r--include/asm-mips/cpu-features.h4
-rw-r--r--include/asm-mips/ddb5xxx/ddb5477.h6
-rw-r--r--include/asm-mips/dec/prom.h12
-rw-r--r--include/asm-mips/delay.h6
-rw-r--r--include/asm-mips/elf.h16
-rw-r--r--include/asm-mips/fcntl.h75
-rw-r--r--include/asm-mips/fpregdef.h4
-rw-r--r--include/asm-mips/fpu.h8
-rw-r--r--include/asm-mips/futex.h53
-rw-r--r--include/asm-mips/hdreg.h1
-rw-r--r--include/asm-mips/hp-lj/asic.h7
-rw-r--r--include/asm-mips/ip32/mace.h8
-rw-r--r--include/asm-mips/irq.h3
-rw-r--r--include/asm-mips/lasat/serial.h4
-rw-r--r--include/asm-mips/local.h4
-rw-r--r--include/asm-mips/mach-au1x00/au1000.h2
-rw-r--r--include/asm-mips/mach-db1x00/db1x00.h2
-rw-r--r--include/asm-mips/mach-generic/spaces.h8
-rw-r--r--include/asm-mips/mach-ip22/spaces.h8
-rw-r--r--include/asm-mips/mach-ip32/cpu-feature-overrides.h2
-rw-r--r--include/asm-mips/mach-jazz/floppy.h2
-rw-r--r--include/asm-mips/mach-pb1x00/pb1500.h4
-rw-r--r--include/asm-mips/mach-qemu/cpu-feature-overrides.h31
-rw-r--r--include/asm-mips/mach-qemu/param.h13
-rw-r--r--include/asm-mips/mach-vr41xx/timex.h18
-rw-r--r--include/asm-mips/mmu_context.h6
-rw-r--r--include/asm-mips/module.h4
-rw-r--r--include/asm-mips/msgbuf.h12
-rw-r--r--include/asm-mips/paccess.h4
-rw-r--r--include/asm-mips/page.h16
-rw-r--r--include/asm-mips/pci.h21
-rw-r--r--include/asm-mips/pgalloc.h4
-rw-r--r--include/asm-mips/pgtable.h4
-rw-r--r--include/asm-mips/processor.h4
-rw-r--r--include/asm-mips/ptrace.h2
-rw-r--r--include/asm-mips/qemu.h24
-rw-r--r--include/asm-mips/r4kcache.h68
-rw-r--r--include/asm-mips/reg.h6
-rw-r--r--include/asm-mips/resource.h2
-rw-r--r--include/asm-mips/rtc.h2
-rw-r--r--include/asm-mips/sgi/gio.h2
-rw-r--r--include/asm-mips/sgi/hpc3.h4
-rw-r--r--include/asm-mips/sgi/ioc.h4
-rw-r--r--include/asm-mips/sgi/ip22.h2
-rw-r--r--include/asm-mips/sgi/mc.h6
-rw-r--r--include/asm-mips/sgiarcs.h8
-rw-r--r--include/asm-mips/sibyte/carmel.h12
-rw-r--r--include/asm-mips/sibyte/sb1250_defs.h38
-rw-r--r--include/asm-mips/sibyte/sb1250_dma.h42
-rw-r--r--include/asm-mips/sibyte/sb1250_genbus.h24
-rw-r--r--include/asm-mips/sibyte/sb1250_int.h24
-rw-r--r--include/asm-mips/sibyte/sb1250_l2c.h22
-rw-r--r--include/asm-mips/sibyte/sb1250_ldt.h32
-rw-r--r--include/asm-mips/sibyte/sb1250_mac.h26
-rw-r--r--include/asm-mips/sibyte/sb1250_mc.h28
-rw-r--r--include/asm-mips/sibyte/sb1250_regs.h68
-rw-r--r--include/asm-mips/sibyte/sb1250_scd.h36
-rw-r--r--include/asm-mips/sibyte/sb1250_smbus.h24
-rw-r--r--include/asm-mips/sibyte/sb1250_syncser.h12
-rw-r--r--include/asm-mips/sibyte/sb1250_uart.h30
-rw-r--r--include/asm-mips/sigcontext.h4
-rw-r--r--include/asm-mips/siginfo.h4
-rw-r--r--include/asm-mips/sim.h10
-rw-r--r--include/asm-mips/socket.h2
-rw-r--r--include/asm-mips/stackframe.h24
-rw-r--r--include/asm-mips/statfs.h2
-rw-r--r--include/asm-mips/string.h8
-rw-r--r--include/asm-mips/system.h4
-rw-r--r--include/asm-mips/thread_info.h4
-rw-r--r--include/asm-mips/titan_dep.h2
-rw-r--r--include/asm-mips/tx4927/tx4927.h52
-rw-r--r--include/asm-mips/tx4927/tx4927_pci.h4
-rw-r--r--include/asm-mips/types.h4
-rw-r--r--include/asm-mips/uaccess.h31
-rw-r--r--include/asm-mips/unistd.h2
-rw-r--r--include/asm-mips/vr4181/irq.h122
-rw-r--r--include/asm-mips/vr4181/vr4181.h413
-rw-r--r--include/asm-mips/vr41xx/tb0287.h43
-rw-r--r--include/asm-mips/vr41xx/vr41xx.h16
-rw-r--r--include/asm-mips/vr41xx/vrc4173.h4
-rw-r--r--include/asm-mips/war.h4
-rw-r--r--include/asm-mips/xxs1500.h2
-rw-r--r--include/asm-parisc/assembly.h2
-rw-r--r--include/asm-parisc/auxvec.h4
-rw-r--r--include/asm-parisc/compat.h10
-rw-r--r--include/asm-parisc/fcntl.h56
-rw-r--r--include/asm-parisc/futex.h53
-rw-r--r--include/asm-parisc/hdreg.h1
-rw-r--r--include/asm-parisc/irq.h5
-rw-r--r--include/asm-parisc/page.h16
-rw-r--r--include/asm-parisc/pci.h13
-rw-r--r--include/asm-parisc/types.h2
-rw-r--r--include/asm-parisc/uaccess.h4
-rw-r--r--include/asm-powerpc/8253pit.h8
-rw-r--r--include/asm-powerpc/agp.h8
-rw-r--r--include/asm-powerpc/bugs.h18
-rw-r--r--include/asm-powerpc/errno.h6
-rw-r--r--include/asm-powerpc/fcntl.h11
-rw-r--r--include/asm-powerpc/ioctl.h6
-rw-r--r--include/asm-powerpc/ioctls.h6
-rw-r--r--include/asm-powerpc/linkage.h6
-rw-r--r--include/asm-powerpc/mc146818rtc.h (renamed from include/asm-ppc64/mc146818rtc.h)10
-rw-r--r--include/asm-powerpc/mman.h (renamed from include/asm-ppc64/mman.h)6
-rw-r--r--include/asm-powerpc/module.h77
-rw-r--r--include/asm-powerpc/msgbuf.h (renamed from include/asm-ppc/msgbuf.h)16
-rw-r--r--include/asm-powerpc/namei.h14
-rw-r--r--include/asm-powerpc/param.h (renamed from include/asm-ppc/param.h)10
-rw-r--r--include/asm-powerpc/poll.h6
-rw-r--r--include/asm-powerpc/sembuf.h (renamed from include/asm-ppc64/sembuf.h)31
-rw-r--r--include/asm-powerpc/setup.h9
-rw-r--r--include/asm-powerpc/shmbuf.h (renamed from include/asm-ppc64/shmbuf.h)42
-rw-r--r--include/asm-powerpc/shmparam.h6
-rw-r--r--include/asm-powerpc/siginfo.h (renamed from include/asm-ppc64/siginfo.h)12
-rw-r--r--include/asm-powerpc/socket.h (renamed from include/asm-ppc64/socket.h)12
-rw-r--r--include/asm-powerpc/sockios.h (renamed from include/asm-ppc64/sockios.h)6
-rw-r--r--include/asm-powerpc/string.h6
-rw-r--r--include/asm-powerpc/termbits.h (renamed from include/asm-ppc64/termbits.h)8
-rw-r--r--include/asm-powerpc/termios.h (renamed from include/asm-ppc64/termios.h)7
-rw-r--r--include/asm-powerpc/timex.h (renamed from include/asm-ppc/timex.h)37
-rw-r--r--include/asm-powerpc/topology.h (renamed from include/asm-ppc64/topology.h)9
-rw-r--r--include/asm-powerpc/unaligned.h9
-rw-r--r--include/asm-powerpc/user.h (renamed from include/asm-ppc/user.h)15
-rw-r--r--include/asm-ppc/auxvec.h14
-rw-r--r--include/asm-ppc/bugs.h6
-rw-r--r--include/asm-ppc/dma-mapping.h3
-rw-r--r--include/asm-ppc/elf.h11
-rw-r--r--include/asm-ppc/fcntl.h93
-rw-r--r--include/asm-ppc/futex.h53
-rw-r--r--include/asm-ppc/ibm4xx.h12
-rw-r--r--include/asm-ppc/ibm_ocp.h19
-rw-r--r--include/asm-ppc/irq.h10
-rw-r--r--include/asm-ppc/kmap_types.h1
-rw-r--r--include/asm-ppc/mc146818rtc.h31
-rw-r--r--include/asm-ppc/mman.h44
-rw-r--r--include/asm-ppc/module.h44
-rw-r--r--include/asm-ppc/mpc8260.h18
-rw-r--r--include/asm-ppc/mpc8xx.h4
-rw-r--r--include/asm-ppc/mv64x60.h7
-rw-r--r--include/asm-ppc/mv64x60_defs.h9
-rw-r--r--include/asm-ppc/pci.h13
-rw-r--r--include/asm-ppc/pmac_feature.h1
-rw-r--r--include/asm-ppc/ppc_sys.h5
-rw-r--r--include/asm-ppc/reg.h6
-rw-r--r--include/asm-ppc/sembuf.h19
-rw-r--r--include/asm-ppc/serial.h2
-rw-r--r--include/asm-ppc/setup.h14
-rw-r--r--include/asm-ppc/shmbuf.h37
-rw-r--r--include/asm-ppc/siginfo.h6
-rw-r--r--include/asm-ppc/socket.h58
-rw-r--r--include/asm-ppc/sockios.h17
-rw-r--r--include/asm-ppc/system.h5
-rw-r--r--include/asm-ppc/termbits.h185
-rw-r--r--include/asm-ppc/termios.h232
-rw-r--r--include/asm-ppc/topology.h6
-rw-r--r--include/asm-ppc/types.h2
-rw-r--r--include/asm-ppc/uaccess.h7
-rw-r--r--include/asm-ppc64/auxvec.h19
-rw-r--r--include/asm-ppc64/bugs.h12
-rw-r--r--include/asm-ppc64/compat.h18
-rw-r--r--include/asm-ppc64/cputable.h12
-rw-r--r--include/asm-ppc64/eeh.h39
-rw-r--r--include/asm-ppc64/elf.h16
-rw-r--r--include/asm-ppc64/fcntl.h89
-rw-r--r--include/asm-ppc64/futex.h83
-rw-r--r--include/asm-ppc64/io.h42
-rw-r--r--include/asm-ppc64/irq.h5
-rw-r--r--include/asm-ppc64/kprobes.h3
-rw-r--r--include/asm-ppc64/lmb.h22
-rw-r--r--include/asm-ppc64/lppaca.h2
-rw-r--r--include/asm-ppc64/machdep.h5
-rw-r--r--include/asm-ppc64/memory.h2
-rw-r--r--include/asm-ppc64/mmu.h6
-rw-r--r--include/asm-ppc64/module.h36
-rw-r--r--include/asm-ppc64/msgbuf.h27
-rw-r--r--include/asm-ppc64/oprofile_impl.h111
-rw-r--r--include/asm-ppc64/page.h17
-rw-r--r--include/asm-ppc64/param.h31
-rw-r--r--include/asm-ppc64/pci-bridge.h45
-rw-r--r--include/asm-ppc64/pci.h13
-rw-r--r--include/asm-ppc64/processor.h14
-rw-r--r--include/asm-ppc64/prom.h19
-rw-r--r--include/asm-ppc64/segment.h6
-rw-r--r--include/asm-ppc64/setup.h6
-rw-r--r--include/asm-ppc64/system.h19
-rw-r--r--include/asm-ppc64/timex.h26
-rw-r--r--include/asm-ppc64/types.h1
-rw-r--r--include/asm-ppc64/uaccess.h7
-rw-r--r--include/asm-ppc64/udbg.h27
-rw-r--r--include/asm-ppc64/user.h58
-rw-r--r--include/asm-s390/auxvec.h4
-rw-r--r--include/asm-s390/compat.h20
-rw-r--r--include/asm-s390/debug.h2
-rw-r--r--include/asm-s390/fcntl.h98
-rw-r--r--include/asm-s390/futex.h53
-rw-r--r--include/asm-s390/lowcore.h8
-rw-r--r--include/asm-s390/page.h16
-rw-r--r--include/asm-s390/spinlock.h4
-rw-r--r--include/asm-s390/types.h2
-rw-r--r--include/asm-s390/uaccess.h7
-rw-r--r--include/asm-sh/auxvec.h4
-rw-r--r--include/asm-sh/fcntl.h89
-rw-r--r--include/asm-sh/futex.h53
-rw-r--r--include/asm-sh/hdreg.h1
-rw-r--r--include/asm-sh/irq.h4
-rw-r--r--include/asm-sh/page.h20
-rw-r--r--include/asm-sh/types.h2
-rw-r--r--include/asm-sh/uaccess.h6
-rw-r--r--include/asm-sh64/auxvec.h4
-rw-r--r--include/asm-sh64/fcntl.h6
-rw-r--r--include/asm-sh64/futex.h53
-rw-r--r--include/asm-sh64/hdreg.h6
-rw-r--r--include/asm-sh64/page.h20
-rw-r--r--include/asm-sh64/types.h2
-rw-r--r--include/asm-sh64/uaccess.h6
-rw-r--r--include/asm-sparc/auxvec.h4
-rw-r--r--include/asm-sparc/fcntl.h59
-rw-r--r--include/asm-sparc/futex.h53
-rw-r--r--include/asm-sparc/hdreg.h1
-rw-r--r--include/asm-sparc/page.h16
-rw-r--r--include/asm-sparc/pgtable.h3
-rw-r--r--include/asm-sparc/ptrace.h4
-rw-r--r--include/asm-sparc/types.h2
-rw-r--r--include/asm-sparc/uaccess.h6
-rw-r--r--include/asm-sparc64/auxvec.h4
-rw-r--r--include/asm-sparc64/compat.h18
-rw-r--r--include/asm-sparc64/cpudata.h4
-rw-r--r--include/asm-sparc64/fcntl.h46
-rw-r--r--include/asm-sparc64/futex.h53
-rw-r--r--include/asm-sparc64/hardirq.h16
-rw-r--r--include/asm-sparc64/hdreg.h1
-rw-r--r--include/asm-sparc64/io.h47
-rw-r--r--include/asm-sparc64/page.h16
-rw-r--r--include/asm-sparc64/pci.h2
-rw-r--r--include/asm-sparc64/pgtable.h3
-rw-r--r--include/asm-sparc64/system.h49
-rw-r--r--include/asm-sparc64/types.h2
-rw-r--r--include/asm-sparc64/uaccess.h6
-rw-r--r--include/asm-um/auxvec.h4
-rw-r--r--include/asm-um/futex.h53
-rw-r--r--include/asm-um/hdreg.h6
-rw-r--r--include/asm-um/mmu_context.h10
-rw-r--r--include/asm-um/page.h16
-rw-r--r--include/asm-um/pgalloc.h12
-rw-r--r--include/asm-um/pgtable-2level.h27
-rw-r--r--include/asm-um/pgtable-3level.h45
-rw-r--r--include/asm-um/pgtable.h54
-rw-r--r--include/asm-v850/auxvec.h4
-rw-r--r--include/asm-v850/fcntl.h78
-rw-r--r--include/asm-v850/futex.h53
-rw-r--r--include/asm-v850/page.h21
-rw-r--r--include/asm-v850/types.h2
-rw-r--r--include/asm-v850/uaccess.h6
-rw-r--r--include/asm-x86_64/acpi.h27
-rw-r--r--include/asm-x86_64/auxvec.h4
-rw-r--r--include/asm-x86_64/compat.h20
-rw-r--r--include/asm-x86_64/current.h2
-rw-r--r--include/asm-x86_64/fcntl.h77
-rw-r--r--include/asm-x86_64/futex.h98
-rw-r--r--include/asm-x86_64/hdreg.h1
-rw-r--r--include/asm-x86_64/io_apic.h2
-rw-r--r--include/asm-x86_64/irq.h4
-rw-r--r--include/asm-x86_64/mpspec.h2
-rw-r--r--include/asm-x86_64/page.h17
-rw-r--r--include/asm-x86_64/pgtable.h19
-rw-r--r--include/asm-x86_64/processor.h7
-rw-r--r--include/asm-x86_64/types.h2
-rw-r--r--include/asm-x86_64/uaccess.h7
-rw-r--r--include/asm-xtensa/atomic.h12
-rw-r--r--include/asm-xtensa/auxvec.h4
-rw-r--r--include/asm-xtensa/checksum.h4
-rw-r--r--include/asm-xtensa/delay.h2
-rw-r--r--include/asm-xtensa/fcntl.h48
-rw-r--r--include/asm-xtensa/hdreg.h17
-rw-r--r--include/asm-xtensa/io.h14
-rw-r--r--include/asm-xtensa/mmu_context.h18
-rw-r--r--include/asm-xtensa/page.h2
-rw-r--r--include/asm-xtensa/page.h.n135
-rw-r--r--include/asm-xtensa/pci.h4
-rw-r--r--include/asm-xtensa/pgtable.h6
-rw-r--r--include/asm-xtensa/ptrace.h2
-rw-r--r--include/asm-xtensa/semaphore.h10
-rw-r--r--include/asm-xtensa/string.h8
-rw-r--r--include/asm-xtensa/system.h10
-rw-r--r--include/asm-xtensa/tlbflush.h40
-rw-r--r--include/asm-xtensa/types.h2
-rw-r--r--include/asm-xtensa/uaccess.h12
-rw-r--r--include/linux/acpi.h45
-rw-r--r--include/linux/attribute_container.h12
-rw-r--r--include/linux/auxvec.h31
-rw-r--r--include/linux/bfs_fs.h23
-rw-r--r--include/linux/bio.h8
-rw-r--r--include/linux/blkdev.h10
-rw-r--r--include/linux/capability.h1
-rw-r--r--include/linux/compat.h3
-rw-r--r--include/linux/cpuset.h11
-rw-r--r--include/linux/crc16.h44
-rw-r--r--include/linux/crypto.h1
-rw-r--r--include/linux/dcache.h4
-rw-r--r--include/linux/dccp.h3
-rw-r--r--include/linux/dmi.h36
-rw-r--r--include/linux/efi.h14
-rw-r--r--include/linux/elf.h24
-rw-r--r--include/linux/ext2_fs.h3
-rw-r--r--include/linux/ext3_fs.h2
-rw-r--r--include/linux/fb.h28
-rw-r--r--include/linux/file.h30
-rw-r--r--include/linux/firmware.h5
-rw-r--r--include/linux/fs.h17
-rw-r--r--include/linux/fuse.h259
-rw-r--r--include/linux/futex.h36
-rw-r--r--include/linux/gfp.h8
-rw-r--r--include/linux/hugetlb.h6
-rw-r--r--include/linux/hwmon-sysfs.h15
-rw-r--r--include/linux/hwmon-vid.h45
-rw-r--r--include/linux/hwmon.h35
-rw-r--r--include/linux/i2c-id.h192
-rw-r--r--include/linux/i2c-isa.h36
-rw-r--r--include/linux/i2c-pxa.h48
-rw-r--r--include/linux/i2c-sensor.h263
-rw-r--r--include/linux/i2c-vid.h111
-rw-r--r--include/linux/i2c.h206
-rw-r--r--include/linux/if_tun.h1
-rw-r--r--include/linux/in6.h36
-rw-r--r--include/linux/init_task.h18
-rw-r--r--include/linux/inotify.h1
-rw-r--r--include/linux/input.h25
-rw-r--r--include/linux/ioctl32.h22
-rw-r--r--include/linux/ipmi.h34
-rw-r--r--include/linux/ipv6.h15
-rw-r--r--include/linux/irq.h130
-rw-r--r--include/linux/isdn.h1
-rw-r--r--include/linux/jbd.h1
-rw-r--r--include/linux/klist.h16
-rw-r--r--include/linux/kprobes.h3
-rw-r--r--include/linux/libata.h2
-rw-r--r--include/linux/linkage.h7
-rw-r--r--include/linux/mempolicy.h4
-rw-r--r--include/linux/mmc/card.h15
-rw-r--r--include/linux/mmc/host.h30
-rw-r--r--include/linux/mmc/mmc.h2
-rw-r--r--include/linux/mmc/protocol.h7
-rw-r--r--include/linux/mmzone.h25
-rw-r--r--include/linux/msg.h1
-rw-r--r--include/linux/mv643xx.h2
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack.h5
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_core.h2
-rw-r--r--include/linux/netfilter_ipv4/ip_nat_rule.h5
-rw-r--r--include/linux/page-flags.h2
-rw-r--r--include/linux/pci.h519
-rw-r--r--include/linux/pci_ids.h4
-rw-r--r--include/linux/pci_regs.h448
-rw-r--r--include/linux/pipe_fs_i.h3
-rw-r--r--include/linux/pm.h14
-rw-r--r--include/linux/pnp.h2
-rw-r--r--include/linux/ptrace.h3
-rw-r--r--include/linux/raid/bitmap.h15
-rw-r--r--include/linux/raid/linear.h4
-rw-r--r--include/linux/raid/md_k.h81
-rw-r--r--include/linux/raid/md_p.h16
-rw-r--r--include/linux/raid/raid1.h13
-rw-r--r--include/linux/raid/raid5.h14
-rw-r--r--include/linux/raid_class.h59
-rw-r--r--include/linux/rcupdate.h4
-rw-r--r--include/linux/rcuref.h220
-rw-r--r--include/linux/relayfs_fs.h255
-rw-r--r--include/linux/sched.h33
-rw-r--r--include/linux/security.h180
-rw-r--r--include/linux/sem.h1
-rw-r--r--include/linux/serial_8250.h15
-rw-r--r--include/linux/serial_core.h7
-rw-r--r--include/linux/skbuff.h6
-rw-r--r--include/linux/slab.h16
-rw-r--r--include/linux/sonypi.h2
-rw-r--r--include/linux/sunrpc/cache.h1
-rw-r--r--include/linux/swap.h22
-rw-r--r--include/linux/swapops.h2
-rw-r--r--include/linux/sysctl.h6
-rw-r--r--include/linux/time.h1
-rw-r--r--include/linux/timer.h4
-rw-r--r--include/linux/timex.h23
-rw-r--r--include/linux/topology.h23
-rw-r--r--include/linux/transport_class.h11
-rw-r--r--include/linux/tty.h3
-rw-r--r--include/linux/usb.h11
-rw-r--r--include/linux/usb_isp116x.h30
-rw-r--r--include/linux/videodev.h3
-rw-r--r--include/linux/videodev2.h4
-rw-r--r--include/linux/vmalloc.h8
-rw-r--r--include/linux/wireless.h38
-rw-r--r--include/media/audiochip.h1
-rw-r--r--include/media/id.h6
-rw-r--r--include/media/ir-common.h4
-rw-r--r--include/media/saa7146.h13
-rw-r--r--include/media/tuner.h193
-rw-r--r--include/media/tveeprom.h9
-rw-r--r--include/media/video-buf.h1
-rw-r--r--include/net/ax25.h4
-rw-r--r--include/net/compat.h5
-rw-r--r--include/net/ip_vs.h2
-rw-r--r--include/net/ipv6.h5
-rw-r--r--include/net/irda/irlan_filter.h2
-rw-r--r--include/net/iw_handler.h123
-rw-r--r--include/net/sock.h18
-rw-r--r--include/net/tcp.h1
-rw-r--r--include/net/transp_v6.h2
-rw-r--r--include/pcmcia/ds.h2
-rw-r--r--include/scsi/scsi_cmnd.h8
-rw-r--r--include/scsi/scsi_dbg.h2
-rw-r--r--include/scsi/scsi_device.h22
-rw-r--r--include/scsi/scsi_eh.h11
-rw-r--r--include/scsi/scsi_host.h26
-rw-r--r--include/scsi/scsi_request.h16
-rw-r--r--include/scsi/scsi_transport_spi.h6
-rw-r--r--include/sound/core.h2
-rw-r--r--include/sound/pcm.h7
-rw-r--r--include/sound/tea575x-tuner.h2
-rw-r--r--include/video/cyblafb.h171
-rw-r--r--include/video/pmag-ba-fb.h41
-rw-r--r--include/video/pmagb-b-fb.h74
-rw-r--r--include/video/sisfb.h188
-rw-r--r--include/video/w100fb.h138
640 files changed, 11813 insertions, 13075 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 2f6ab189fc6f..427cff1a3f83 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -44,7 +44,6 @@
44#ifndef _ACCONFIG_H 44#ifndef _ACCONFIG_H
45#define _ACCONFIG_H 45#define _ACCONFIG_H
46 46
47
48/****************************************************************************** 47/******************************************************************************
49 * 48 *
50 * Configuration options 49 * Configuration options
@@ -64,7 +63,7 @@
64 63
65/* Version string */ 64/* Version string */
66 65
67#define ACPI_CA_VERSION 0x20050408 66#define ACPI_CA_VERSION 0x20050902
68 67
69/* 68/*
70 * OS name, used for the _OS object. The _OS object is essentially obsolete, 69 * OS name, used for the _OS object. The _OS object is essentially obsolete,
@@ -78,11 +77,10 @@
78 77
79/* Maximum objects in the various object caches */ 78/* Maximum objects in the various object caches */
80 79
81#define ACPI_MAX_STATE_CACHE_DEPTH 64 /* State objects */ 80#define ACPI_MAX_STATE_CACHE_DEPTH 96 /* State objects */
82#define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */ 81#define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */
83#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 64 /* Parse tree objects */ 82#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */
84#define ACPI_MAX_OBJECT_CACHE_DEPTH 64 /* Interpreter operand objects */ 83#define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */
85#define ACPI_MAX_WALK_CACHE_DEPTH 4 /* Objects for parse tree walks */
86 84
87/* 85/*
88 * Should the subystem abort the loading of an ACPI table if the 86 * Should the subystem abort the loading of an ACPI table if the
@@ -90,7 +88,6 @@
90 */ 88 */
91#define ACPI_CHECKSUM_ABORT FALSE 89#define ACPI_CHECKSUM_ABORT FALSE
92 90
93
94/****************************************************************************** 91/******************************************************************************
95 * 92 *
96 * Subsystem Constants 93 * Subsystem Constants
@@ -104,7 +101,7 @@
104/* String size constants */ 101/* String size constants */
105 102
106#define ACPI_MAX_STRING_LENGTH 512 103#define ACPI_MAX_STRING_LENGTH 512
107#define ACPI_PATHNAME_MAX 256 /* A full namespace pathname */ 104#define ACPI_PATHNAME_MAX 256 /* A full namespace pathname */
108 105
109/* Maximum count for a semaphore object */ 106/* Maximum count for a semaphore object */
110 107
@@ -118,7 +115,6 @@
118 115
119#define ACPI_SYSMEM_REGION_WINDOW_SIZE 4096 116#define ACPI_SYSMEM_REGION_WINDOW_SIZE 4096
120 117
121
122/****************************************************************************** 118/******************************************************************************
123 * 119 *
124 * ACPI Specification constants (Do not change unless the specification changes) 120 * ACPI Specification constants (Do not change unless the specification changes)
@@ -156,15 +152,15 @@
156/* Names within the namespace are 4 bytes long */ 152/* Names within the namespace are 4 bytes long */
157 153
158#define ACPI_NAME_SIZE 4 154#define ACPI_NAME_SIZE 4
159#define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */ 155#define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */
160#define ACPI_PATH_SEPARATOR '.' 156#define ACPI_PATH_SEPARATOR '.'
161 157
162/* Constants used in searching for the RSDP in low memory */ 158/* Constants used in searching for the RSDP in low memory */
163 159
164#define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */ 160#define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */
165#define ACPI_EBDA_PTR_LENGTH 2 161#define ACPI_EBDA_PTR_LENGTH 2
166#define ACPI_EBDA_WINDOW_SIZE 1024 162#define ACPI_EBDA_WINDOW_SIZE 1024
167#define ACPI_HI_RSDP_WINDOW_BASE 0x000E0000 /* Physical Address */ 163#define ACPI_HI_RSDP_WINDOW_BASE 0x000E0000 /* Physical Address */
168#define ACPI_HI_RSDP_WINDOW_SIZE 0x00020000 164#define ACPI_HI_RSDP_WINDOW_SIZE 0x00020000
169#define ACPI_RSDP_SCAN_STEP 16 165#define ACPI_RSDP_SCAN_STEP 16
170 166
@@ -199,18 +195,15 @@
199 195
200#define ACPI_NUM_OSI_STRINGS 10 196#define ACPI_NUM_OSI_STRINGS 10
201 197
202
203/****************************************************************************** 198/******************************************************************************
204 * 199 *
205 * ACPI AML Debugger 200 * ACPI AML Debugger
206 * 201 *
207 *****************************************************************************/ 202 *****************************************************************************/
208 203
209#define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */ 204#define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */
210 205
211#define ACPI_DEBUGGER_COMMAND_PROMPT '-' 206#define ACPI_DEBUGGER_COMMAND_PROMPT '-'
212#define ACPI_DEBUGGER_EXECUTE_PROMPT '%' 207#define ACPI_DEBUGGER_EXECUTE_PROMPT '%'
213 208
214 209#endif /* _ACCONFIG_H */
215#endif /* _ACCONFIG_H */
216
diff --git a/include/acpi/acdebug.h b/include/acpi/acdebug.h
index 8ba372b0f245..70ce3b4d006e 100644
--- a/include/acpi/acdebug.h
+++ b/include/acpi/acdebug.h
@@ -44,22 +44,17 @@
44#ifndef __ACDEBUG_H__ 44#ifndef __ACDEBUG_H__
45#define __ACDEBUG_H__ 45#define __ACDEBUG_H__
46 46
47
48#define ACPI_DEBUG_BUFFER_SIZE 4196 47#define ACPI_DEBUG_BUFFER_SIZE 4196
49 48
50struct command_info 49struct command_info {
51{ 50 char *name; /* Command Name */
52 char *name; /* Command Name */ 51 u8 min_args; /* Minimum arguments required */
53 u8 min_args; /* Minimum arguments required */
54}; 52};
55 53
56 54struct argument_info {
57struct argument_info 55 char *name; /* Argument Name */
58{
59 char *name; /* Argument Name */
60}; 56};
61 57
62
63#define PARAM_LIST(pl) pl 58#define PARAM_LIST(pl) pl
64#define DBTEST_OUTPUT_LEVEL(lvl) if (acpi_gbl_db_opt_verbose) 59#define DBTEST_OUTPUT_LEVEL(lvl) if (acpi_gbl_db_opt_verbose)
65#define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\ 60#define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\
@@ -68,275 +63,155 @@ struct argument_info
68#define EX_NO_SINGLE_STEP 1 63#define EX_NO_SINGLE_STEP 1
69#define EX_SINGLE_STEP 2 64#define EX_SINGLE_STEP 2
70 65
71
72/* 66/*
73 * dbxface - external debugger interfaces 67 * dbxface - external debugger interfaces
74 */ 68 */
75acpi_status 69acpi_status acpi_db_initialize(void);
76acpi_db_initialize (
77 void);
78 70
79void 71void acpi_db_terminate(void);
80acpi_db_terminate (
81 void);
82 72
83acpi_status 73acpi_status
84acpi_db_single_step ( 74acpi_db_single_step(struct acpi_walk_state *walk_state,
85 struct acpi_walk_state *walk_state, 75 union acpi_parse_object *op, u32 op_type);
86 union acpi_parse_object *op,
87 u32 op_type);
88
89 76
90/* 77/*
91 * dbcmds - debug commands and output routines 78 * dbcmds - debug commands and output routines
92 */ 79 */
93acpi_status 80acpi_status acpi_db_disassemble_method(char *name);
94acpi_db_disassemble_method (
95 char *name);
96 81
97void 82void acpi_db_display_table_info(char *table_arg);
98acpi_db_display_table_info (
99 char *table_arg);
100 83
101void 84void acpi_db_unload_acpi_table(char *table_arg, char *instance_arg);
102acpi_db_unload_acpi_table (
103 char *table_arg,
104 char *instance_arg);
105 85
106void 86void
107acpi_db_set_method_breakpoint ( 87acpi_db_set_method_breakpoint(char *location,
108 char *location, 88 struct acpi_walk_state *walk_state,
109 struct acpi_walk_state *walk_state, 89 union acpi_parse_object *op);
110 union acpi_parse_object *op);
111 90
112void 91void acpi_db_set_method_call_breakpoint(union acpi_parse_object *op);
113acpi_db_set_method_call_breakpoint (
114 union acpi_parse_object *op);
115 92
116void 93void acpi_db_get_bus_info(void);
117acpi_db_disassemble_aml (
118 char *statements,
119 union acpi_parse_object *op);
120 94
121void 95void acpi_db_disassemble_aml(char *statements, union acpi_parse_object *op);
122acpi_db_dump_namespace (
123 char *start_arg,
124 char *depth_arg);
125 96
126void 97void acpi_db_dump_namespace(char *start_arg, char *depth_arg);
127acpi_db_dump_namespace_by_owner (
128 char *owner_arg,
129 char *depth_arg);
130 98
131void 99void acpi_db_dump_namespace_by_owner(char *owner_arg, char *depth_arg);
132acpi_db_send_notify (
133 char *name,
134 u32 value);
135 100
136void 101void acpi_db_send_notify(char *name, u32 value);
137acpi_db_set_method_data (
138 char *type_arg,
139 char *index_arg,
140 char *value_arg);
141 102
142acpi_status 103void acpi_db_set_method_data(char *type_arg, char *index_arg, char *value_arg);
143acpi_db_display_objects (
144 char *obj_type_arg,
145 char *display_count_arg);
146 104
147acpi_status 105acpi_status
148acpi_db_find_name_in_namespace ( 106acpi_db_display_objects(char *obj_type_arg, char *display_count_arg);
149 char *name_arg);
150 107
151void 108acpi_status acpi_db_find_name_in_namespace(char *name_arg);
152acpi_db_set_scope (
153 char *name);
154 109
155acpi_status 110void acpi_db_set_scope(char *name);
156acpi_db_sleep (
157 char *object_arg);
158 111
159void 112acpi_status acpi_db_sleep(char *object_arg);
160acpi_db_find_references (
161 char *object_arg);
162 113
163void 114void acpi_db_find_references(char *object_arg);
164acpi_db_display_locks (
165 void);
166 115
167void 116void acpi_db_display_locks(void);
168acpi_db_display_resources (
169 char *object_arg);
170 117
171void 118void acpi_db_display_resources(char *object_arg);
172acpi_db_display_gpes (
173 void);
174 119
175void 120void acpi_db_display_gpes(void);
176acpi_db_check_integrity (
177 void);
178 121
179void 122void acpi_db_check_integrity(void);
180acpi_db_generate_gpe (
181 char *gpe_arg,
182 char *block_arg);
183 123
124void acpi_db_generate_gpe(char *gpe_arg, char *block_arg);
184 125
185/* 126/*
186 * dbdisply - debug display commands 127 * dbdisply - debug display commands
187 */ 128 */
188void 129void acpi_db_display_method_info(union acpi_parse_object *op);
189acpi_db_display_method_info (
190 union acpi_parse_object *op);
191 130
192void 131void acpi_db_decode_and_display_object(char *target, char *output_type);
193acpi_db_decode_and_display_object (
194 char *target,
195 char *output_type);
196 132
197void 133void
198acpi_db_display_result_object ( 134acpi_db_display_result_object(union acpi_operand_object *obj_desc,
199 union acpi_operand_object *obj_desc, 135 struct acpi_walk_state *walk_state);
200 struct acpi_walk_state *walk_state);
201 136
202acpi_status 137acpi_status acpi_db_display_all_methods(char *display_count_arg);
203acpi_db_display_all_methods (
204 char *display_count_arg);
205 138
206void 139void acpi_db_display_arguments(void);
207acpi_db_display_arguments (
208 void);
209 140
210void 141void acpi_db_display_locals(void);
211acpi_db_display_locals (
212 void);
213 142
214void 143void acpi_db_display_results(void);
215acpi_db_display_results (
216 void);
217 144
218void 145void acpi_db_display_calling_tree(void);
219acpi_db_display_calling_tree (
220 void);
221 146
222void 147void acpi_db_display_object_type(char *object_arg);
223acpi_db_display_object_type (
224 char *object_arg);
225 148
226void 149void
227acpi_db_display_argument_object ( 150acpi_db_display_argument_object(union acpi_operand_object *obj_desc,
228 union acpi_operand_object *obj_desc, 151 struct acpi_walk_state *walk_state);
229 struct acpi_walk_state *walk_state);
230
231 152
232/* 153/*
233 * dbexec - debugger control method execution 154 * dbexec - debugger control method execution
234 */ 155 */
235void 156void acpi_db_execute(char *name, char **args, u32 flags);
236acpi_db_execute (
237 char *name,
238 char **args,
239 u32 flags);
240 157
241void 158void
242acpi_db_create_execution_threads ( 159acpi_db_create_execution_threads(char *num_threads_arg,
243 char *num_threads_arg, 160 char *num_loops_arg, char *method_name_arg);
244 char *num_loops_arg,
245 char *method_name_arg);
246
247 161
248/* 162/*
249 * dbfileio - Debugger file I/O commands 163 * dbfileio - Debugger file I/O commands
250 */ 164 */
251acpi_object_type 165acpi_object_type
252acpi_db_match_argument ( 166acpi_db_match_argument(char *user_argument, struct argument_info *arguments);
253 char *user_argument,
254 struct argument_info *arguments);
255 167
256void 168void acpi_db_close_debug_file(void);
257acpi_db_close_debug_file (
258 void);
259 169
260void 170void acpi_db_open_debug_file(char *name);
261acpi_db_open_debug_file (
262 char *name);
263 171
264acpi_status 172acpi_status acpi_db_load_acpi_table(char *filename);
265acpi_db_load_acpi_table (
266 char *filename);
267 173
268acpi_status 174acpi_status
269acpi_db_get_table_from_file ( 175acpi_db_get_table_from_file(char *filename, struct acpi_table_header **table);
270 char *filename,
271 struct acpi_table_header **table);
272 176
273acpi_status 177acpi_status
274acpi_db_read_table_from_file ( 178acpi_db_read_table_from_file(char *filename, struct acpi_table_header **table);
275 char *filename,
276 struct acpi_table_header **table);
277
278 179
279/* 180/*
280 * dbhistry - debugger HISTORY command 181 * dbhistry - debugger HISTORY command
281 */ 182 */
282void 183void acpi_db_add_to_history(char *command_line);
283acpi_db_add_to_history (
284 char *command_line);
285 184
286void 185void acpi_db_display_history(void);
287acpi_db_display_history (
288 void);
289
290char *
291acpi_db_get_from_history (
292 char *command_num_arg);
293 186
187char *acpi_db_get_from_history(char *command_num_arg);
294 188
295/* 189/*
296 * dbinput - user front-end to the AML debugger 190 * dbinput - user front-end to the AML debugger
297 */ 191 */
298acpi_status 192acpi_status
299acpi_db_command_dispatch ( 193acpi_db_command_dispatch(char *input_buffer,
300 char *input_buffer, 194 struct acpi_walk_state *walk_state,
301 struct acpi_walk_state *walk_state, 195 union acpi_parse_object *op);
302 union acpi_parse_object *op);
303
304void ACPI_SYSTEM_XFACE
305acpi_db_execute_thread (
306 void *context);
307 196
197void ACPI_SYSTEM_XFACE acpi_db_execute_thread(void *context);
308 198
309/* 199/*
310 * dbstats - Generation and display of ACPI table statistics 200 * dbstats - Generation and display of ACPI table statistics
311 */ 201 */
312void 202void acpi_db_generate_statistics(union acpi_parse_object *root, u8 is_method);
313acpi_db_generate_statistics (
314 union acpi_parse_object *root,
315 u8 is_method);
316
317acpi_status
318acpi_db_display_statistics (
319 char *type_arg);
320 203
204acpi_status acpi_db_display_statistics(char *type_arg);
321 205
322/* 206/*
323 * dbutils - AML debugger utilities 207 * dbutils - AML debugger utilities
324 */ 208 */
325void 209void acpi_db_set_output_destination(u32 where);
326acpi_db_set_output_destination (
327 u32 where);
328 210
329void 211void acpi_db_dump_external_object(union acpi_object *obj_desc, u32 level);
330acpi_db_dump_object (
331 union acpi_object *obj_desc,
332 u32 level);
333 212
334void 213void acpi_db_prep_namestring(char *name);
335acpi_db_prep_namestring (
336 char *name);
337 214
338struct acpi_namespace_node * 215struct acpi_namespace_node *acpi_db_local_ns_lookup(char *name);
339acpi_db_local_ns_lookup (
340 char *name);
341 216
342#endif /* __ACDEBUG_H__ */ 217#endif /* __ACDEBUG_H__ */
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index dbfa877121ba..3d96dcb1bb4b 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.h
@@ -46,327 +46,219 @@
46 46
47#include "amlresrc.h" 47#include "amlresrc.h"
48 48
49
50#define BLOCK_NONE 0 49#define BLOCK_NONE 0
51#define BLOCK_PAREN 1 50#define BLOCK_PAREN 1
52#define BLOCK_BRACE 2 51#define BLOCK_BRACE 2
53#define BLOCK_COMMA_LIST 4 52#define BLOCK_COMMA_LIST 4
54 53
55struct acpi_external_list 54struct acpi_external_list {
56{ 55 char *path;
57 char *path; 56 struct acpi_external_list *next;
58 struct acpi_external_list *next;
59}; 57};
60 58
61extern struct acpi_external_list *acpi_gbl_external_list; 59extern struct acpi_external_list *acpi_gbl_external_list;
62extern const char *acpi_gbl_io_decode[2]; 60extern const char *acpi_gbl_io_decode[2];
63extern const char *acpi_gbl_word_decode[4]; 61extern const char *acpi_gbl_word_decode[4];
64extern const char *acpi_gbl_consume_decode[2]; 62extern const char *acpi_gbl_consume_decode[2];
65extern const char *acpi_gbl_min_decode[2]; 63extern const char *acpi_gbl_min_decode[2];
66extern const char *acpi_gbl_max_decode[2]; 64extern const char *acpi_gbl_max_decode[2];
67extern const char *acpi_gbl_DECdecode[2]; 65extern const char *acpi_gbl_DECdecode[2];
68extern const char *acpi_gbl_RNGdecode[4]; 66extern const char *acpi_gbl_RNGdecode[4];
69extern const char *acpi_gbl_MEMdecode[4]; 67extern const char *acpi_gbl_MEMdecode[4];
70extern const char *acpi_gbl_RWdecode[2]; 68extern const char *acpi_gbl_RWdecode[2];
71extern const char *acpi_gbl_irq_decode[2]; 69extern const char *acpi_gbl_irq_decode[2];
72extern const char *acpi_gbl_HEdecode[2]; 70extern const char *acpi_gbl_HEdecode[2];
73extern const char *acpi_gbl_LLdecode[2]; 71extern const char *acpi_gbl_LLdecode[2];
74extern const char *acpi_gbl_SHRdecode[2]; 72extern const char *acpi_gbl_SHRdecode[2];
75extern const char *acpi_gbl_TYPdecode[4]; 73extern const char *acpi_gbl_TYPdecode[4];
76extern const char *acpi_gbl_BMdecode[2]; 74extern const char *acpi_gbl_BMdecode[2];
77extern const char *acpi_gbl_SIZdecode[4]; 75extern const char *acpi_gbl_SIZdecode[4];
78extern const char *acpi_gbl_TTPdecode[2]; 76extern const char *acpi_gbl_TTPdecode[2];
79extern const char *acpi_gbl_MTPdecode[4]; 77extern const char *acpi_gbl_MTPdecode[4];
80extern const char *acpi_gbl_TRSdecode[2]; 78extern const char *acpi_gbl_TRSdecode[2];
81 79
82 80extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES];
83extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES]; 81extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES];
84extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES]; 82extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES];
85extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES]; 83extern const char *acpi_gbl_match_ops[ACPI_NUM_MATCH_OPS];
86extern const char *acpi_gbl_match_ops[ACPI_NUM_MATCH_OPS]; 84
87 85struct acpi_op_walk_info {
88 86 u32 level;
89struct acpi_op_walk_info 87 u32 bit_offset;
90{ 88 struct acpi_walk_state *walk_state;
91 u32 level;
92 u32 bit_offset;
93}; 89};
94 90
95typedef 91typedef
96acpi_status (*asl_walk_callback) ( 92acpi_status(*asl_walk_callback) (union acpi_parse_object * op,
97 union acpi_parse_object *op, 93 u32 level, void *context);
98 u32 level,
99 void *context);
100
101 94
102/* 95/*
103 * dmwalk 96 * dmwalk
104 */ 97 */
105void 98void
106acpi_dm_disassemble ( 99acpi_dm_disassemble(struct acpi_walk_state *walk_state,
107 struct acpi_walk_state *walk_state, 100 union acpi_parse_object *origin, u32 num_opcodes);
108 union acpi_parse_object *origin,
109 u32 num_opcodes);
110
111 101
112/* 102/*
113 * dmopcode 103 * dmopcode
114 */ 104 */
115void 105void
116acpi_dm_disassemble_one_op ( 106acpi_dm_disassemble_one_op(struct acpi_walk_state *walk_state,
117 struct acpi_walk_state *walk_state, 107 struct acpi_op_walk_info *info,
118 struct acpi_op_walk_info *info, 108 union acpi_parse_object *op);
119 union acpi_parse_object *op);
120 109
121void 110void acpi_dm_decode_internal_object(union acpi_operand_object *obj_desc);
122acpi_dm_decode_internal_object (
123 union acpi_operand_object *obj_desc);
124 111
125u32 112u32 acpi_dm_list_type(union acpi_parse_object *op);
126acpi_dm_list_type (
127 union acpi_parse_object *op);
128 113
129void 114void acpi_dm_method_flags(union acpi_parse_object *op);
130acpi_dm_method_flags (
131 union acpi_parse_object *op);
132
133void
134acpi_dm_field_flags (
135 union acpi_parse_object *op);
136 115
137void 116void acpi_dm_field_flags(union acpi_parse_object *op);
138acpi_dm_address_space (
139 u8 space_id);
140 117
141void 118void acpi_dm_address_space(u8 space_id);
142acpi_dm_region_flags (
143 union acpi_parse_object *op);
144 119
145void 120void acpi_dm_region_flags(union acpi_parse_object *op);
146acpi_dm_match_op (
147 union acpi_parse_object *op);
148 121
149u8 122void acpi_dm_match_op(union acpi_parse_object *op);
150acpi_dm_comma_if_list_member (
151 union acpi_parse_object *op);
152 123
153void 124u8 acpi_dm_comma_if_list_member(union acpi_parse_object *op);
154acpi_dm_comma_if_field_member (
155 union acpi_parse_object *op);
156 125
126void acpi_dm_comma_if_field_member(union acpi_parse_object *op);
157 127
158/* 128/*
159 * dmnames 129 * dmnames
160 */ 130 */
161u32 131u32 acpi_dm_dump_name(char *name);
162acpi_dm_dump_name (
163 char *name);
164 132
165acpi_status 133acpi_status
166acpi_ps_display_object_pathname ( 134acpi_ps_display_object_pathname(struct acpi_walk_state *walk_state,
167 struct acpi_walk_state *walk_state, 135 union acpi_parse_object *op);
168 union acpi_parse_object *op);
169
170void
171acpi_dm_namestring (
172 char *name);
173 136
137void acpi_dm_namestring(char *name);
174 138
175/* 139/*
176 * dmobject 140 * dmobject
177 */ 141 */
178void 142void
179acpi_dm_display_internal_object ( 143acpi_dm_display_internal_object(union acpi_operand_object *obj_desc,
180 union acpi_operand_object *obj_desc, 144 struct acpi_walk_state *walk_state);
181 struct acpi_walk_state *walk_state);
182 145
183void 146void acpi_dm_display_arguments(struct acpi_walk_state *walk_state);
184acpi_dm_display_arguments (
185 struct acpi_walk_state *walk_state);
186 147
187void 148void acpi_dm_display_locals(struct acpi_walk_state *walk_state);
188acpi_dm_display_locals (
189 struct acpi_walk_state *walk_state);
190 149
191void 150void
192acpi_dm_dump_method_info ( 151acpi_dm_dump_method_info(acpi_status status,
193 acpi_status status, 152 struct acpi_walk_state *walk_state,
194 struct acpi_walk_state *walk_state, 153 union acpi_parse_object *op);
195 union acpi_parse_object *op);
196
197 154
198/* 155/*
199 * dmbuffer 156 * dmbuffer
200 */ 157 */
201void 158void acpi_dm_disasm_byte_list(u32 level, u8 * byte_data, u32 byte_count);
202acpi_dm_disasm_byte_list (
203 u32 level,
204 u8 *byte_data,
205 u32 byte_count);
206 159
207void 160void
208acpi_dm_byte_list ( 161acpi_dm_byte_list(struct acpi_op_walk_info *info, union acpi_parse_object *op);
209 struct acpi_op_walk_info *info,
210 union acpi_parse_object *op);
211 162
212void 163void acpi_dm_is_eisa_id(union acpi_parse_object *op);
213acpi_is_eisa_id (
214 union acpi_parse_object *op);
215 164
216void 165void acpi_dm_eisa_id(u32 encoded_id);
217acpi_dm_eisa_id (
218 u32 encoded_id);
219
220u8
221acpi_dm_is_unicode_buffer (
222 union acpi_parse_object *op);
223 166
224u8 167u8 acpi_dm_is_unicode_buffer(union acpi_parse_object *op);
225acpi_dm_is_string_buffer (
226 union acpi_parse_object *op);
227 168
169u8 acpi_dm_is_string_buffer(union acpi_parse_object *op);
228 170
229/* 171/*
230 * dmresrc 172 * dmresrc
231 */ 173 */
232void 174void
233acpi_dm_resource_descriptor ( 175acpi_dm_resource_descriptor(struct acpi_op_walk_info *info,
234 struct acpi_op_walk_info *info, 176 u8 * byte_data, u32 byte_count);
235 u8 *byte_data,
236 u32 byte_count);
237 177
238u8 178u8 acpi_dm_is_resource_descriptor(union acpi_parse_object *op);
239acpi_dm_is_resource_descriptor (
240 union acpi_parse_object *op);
241 179
242void 180void acpi_dm_indent(u32 level);
243acpi_dm_indent (
244 u32 level);
245 181
246void 182void acpi_dm_bit_list(u16 mask);
247acpi_dm_bit_list (
248 u16 mask);
249
250void
251acpi_dm_decode_attribute (
252 u8 attribute);
253 183
184void acpi_dm_decode_attribute(u8 attribute);
254 185
255/* 186/*
256 * dmresrcl 187 * dmresrcl
257 */ 188 */
258void 189void
259acpi_dm_word_descriptor ( 190acpi_dm_word_descriptor(struct asl_word_address_desc *resource,
260 struct asl_word_address_desc *resource, 191 u32 length, u32 level);
261 u32 length,
262 u32 level);
263 192
264void 193void
265acpi_dm_dword_descriptor ( 194acpi_dm_dword_descriptor(struct asl_dword_address_desc *resource,
266 struct asl_dword_address_desc *resource, 195 u32 length, u32 level);
267 u32 length,
268 u32 level);
269 196
270void 197void
271acpi_dm_extended_descriptor ( 198acpi_dm_extended_descriptor(struct asl_extended_address_desc *resource,
272 struct asl_extended_address_desc *resource, 199 u32 length, u32 level);
273 u32 length,
274 u32 level);
275 200
276void 201void
277acpi_dm_qword_descriptor ( 202acpi_dm_qword_descriptor(struct asl_qword_address_desc *resource,
278 struct asl_qword_address_desc *resource, 203 u32 length, u32 level);
279 u32 length,
280 u32 level);
281 204
282void 205void
283acpi_dm_memory24_descriptor ( 206acpi_dm_memory24_descriptor(struct asl_memory_24_desc *resource,
284 struct asl_memory_24_desc *resource, 207 u32 length, u32 level);
285 u32 length,
286 u32 level);
287 208
288void 209void
289acpi_dm_memory32_descriptor ( 210acpi_dm_memory32_descriptor(struct asl_memory_32_desc *resource,
290 struct asl_memory_32_desc *resource, 211 u32 length, u32 level);
291 u32 length,
292 u32 level);
293 212
294void 213void
295acpi_dm_fixed_mem32_descriptor ( 214acpi_dm_fixed_mem32_descriptor(struct asl_fixed_memory_32_desc *resource,
296 struct asl_fixed_memory_32_desc *resource, 215 u32 length, u32 level);
297 u32 length,
298 u32 level);
299 216
300void 217void
301acpi_dm_generic_register_descriptor ( 218acpi_dm_generic_register_descriptor(struct asl_general_register_desc *resource,
302 struct asl_general_register_desc *resource, 219 u32 length, u32 level);
303 u32 length,
304 u32 level);
305 220
306void 221void
307acpi_dm_interrupt_descriptor ( 222acpi_dm_interrupt_descriptor(struct asl_extended_xrupt_desc *resource,
308 struct asl_extended_xrupt_desc *resource, 223 u32 length, u32 level);
309 u32 length,
310 u32 level);
311 224
312void 225void
313acpi_dm_vendor_large_descriptor ( 226acpi_dm_vendor_large_descriptor(struct asl_large_vendor_desc *resource,
314 struct asl_large_vendor_desc *resource, 227 u32 length, u32 level);
315 u32 length,
316 u32 level);
317
318 228
319/* 229/*
320 * dmresrcs 230 * dmresrcs
321 */ 231 */
322void 232void
323acpi_dm_irq_descriptor ( 233acpi_dm_irq_descriptor(struct asl_irq_format_desc *resource,
324 struct asl_irq_format_desc *resource, 234 u32 length, u32 level);
325 u32 length,
326 u32 level);
327 235
328void 236void
329acpi_dm_dma_descriptor ( 237acpi_dm_dma_descriptor(struct asl_dma_format_desc *resource,
330 struct asl_dma_format_desc *resource, 238 u32 length, u32 level);
331 u32 length,
332 u32 level);
333 239
334void 240void
335acpi_dm_io_descriptor ( 241acpi_dm_io_descriptor(struct asl_io_port_desc *resource, u32 length, u32 level);
336 struct asl_io_port_desc *resource,
337 u32 length,
338 u32 level);
339 242
340void 243void
341acpi_dm_fixed_io_descriptor ( 244acpi_dm_fixed_io_descriptor(struct asl_fixed_io_port_desc *resource,
342 struct asl_fixed_io_port_desc *resource, 245 u32 length, u32 level);
343 u32 length,
344 u32 level);
345 246
346void 247void
347acpi_dm_start_dependent_descriptor ( 248acpi_dm_start_dependent_descriptor(struct asl_start_dependent_desc *resource,
348 struct asl_start_dependent_desc *resource, 249 u32 length, u32 level);
349 u32 length,
350 u32 level);
351 250
352void 251void
353acpi_dm_end_dependent_descriptor ( 252acpi_dm_end_dependent_descriptor(struct asl_start_dependent_desc *resource,
354 struct asl_start_dependent_desc *resource, 253 u32 length, u32 level);
355 u32 length,
356 u32 level);
357 254
358void 255void
359acpi_dm_vendor_small_descriptor ( 256acpi_dm_vendor_small_descriptor(struct asl_small_vendor_desc *resource,
360 struct asl_small_vendor_desc *resource, 257 u32 length, u32 level);
361 u32 length,
362 u32 level);
363
364 258
365/* 259/*
366 * dmutils 260 * dmutils
367 */ 261 */
368void 262void acpi_dm_add_to_external_list(char *path);
369acpi_dm_add_to_external_list (
370 char *path);
371 263
372#endif /* __ACDISASM_H__ */ 264#endif /* __ACDISASM_H__ */
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h
index 8f5f2f71b1de..065f24a77cfc 100644
--- a/include/acpi/acdispat.h
+++ b/include/acpi/acdispat.h
@@ -41,419 +41,304 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44
45#ifndef _ACDISPAT_H_ 44#ifndef _ACDISPAT_H_
46#define _ACDISPAT_H_ 45#define _ACDISPAT_H_
47 46
48
49#define NAMEOF_LOCAL_NTE "__L0" 47#define NAMEOF_LOCAL_NTE "__L0"
50#define NAMEOF_ARG_NTE "__A0" 48#define NAMEOF_ARG_NTE "__A0"
51 49
52
53/* 50/*
54 * dsopcode - support for late evaluation 51 * dsopcode - support for late evaluation
55 */ 52 */
56acpi_status 53acpi_status
57acpi_ds_get_buffer_field_arguments ( 54acpi_ds_get_buffer_field_arguments(union acpi_operand_object *obj_desc);
58 union acpi_operand_object *obj_desc);
59
60acpi_status
61acpi_ds_get_region_arguments (
62 union acpi_operand_object *rgn_desc);
63 55
64acpi_status 56acpi_status acpi_ds_get_region_arguments(union acpi_operand_object *rgn_desc);
65acpi_ds_get_buffer_arguments (
66 union acpi_operand_object *obj_desc);
67 57
68acpi_status 58acpi_status acpi_ds_get_buffer_arguments(union acpi_operand_object *obj_desc);
69acpi_ds_get_package_arguments (
70 union acpi_operand_object *obj_desc);
71 59
72acpi_status 60acpi_status acpi_ds_get_package_arguments(union acpi_operand_object *obj_desc);
73acpi_ds_eval_buffer_field_operands (
74 struct acpi_walk_state *walk_state,
75 union acpi_parse_object *op);
76 61
77acpi_status 62acpi_status
78acpi_ds_eval_region_operands ( 63acpi_ds_eval_buffer_field_operands(struct acpi_walk_state *walk_state,
79 struct acpi_walk_state *walk_state, 64 union acpi_parse_object *op);
80 union acpi_parse_object *op);
81 65
82acpi_status 66acpi_status
83acpi_ds_eval_data_object_operands ( 67acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
84 struct acpi_walk_state *walk_state, 68 union acpi_parse_object *op);
85 union acpi_parse_object *op,
86 union acpi_operand_object *obj_desc);
87 69
88acpi_status 70acpi_status
89acpi_ds_initialize_region ( 71acpi_ds_eval_data_object_operands(struct acpi_walk_state *walk_state,
90 acpi_handle obj_handle); 72 union acpi_parse_object *op,
73 union acpi_operand_object *obj_desc);
91 74
75acpi_status acpi_ds_initialize_region(acpi_handle obj_handle);
92 76
93/* 77/*
94 * dsctrl - Parser/Interpreter interface, control stack routines 78 * dsctrl - Parser/Interpreter interface, control stack routines
95 */ 79 */
96acpi_status 80acpi_status
97acpi_ds_exec_begin_control_op ( 81acpi_ds_exec_begin_control_op(struct acpi_walk_state *walk_state,
98 struct acpi_walk_state *walk_state, 82 union acpi_parse_object *op);
99 union acpi_parse_object *op);
100 83
101acpi_status 84acpi_status
102acpi_ds_exec_end_control_op ( 85acpi_ds_exec_end_control_op(struct acpi_walk_state *walk_state,
103 struct acpi_walk_state *walk_state, 86 union acpi_parse_object *op);
104 union acpi_parse_object *op);
105
106 87
107/* 88/*
108 * dsexec - Parser/Interpreter interface, method execution callbacks 89 * dsexec - Parser/Interpreter interface, method execution callbacks
109 */ 90 */
110acpi_status 91acpi_status
111acpi_ds_get_predicate_value ( 92acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state,
112 struct acpi_walk_state *walk_state, 93 union acpi_operand_object *result_obj);
113 union acpi_operand_object *result_obj);
114
115acpi_status
116acpi_ds_exec_begin_op (
117 struct acpi_walk_state *walk_state,
118 union acpi_parse_object **out_op);
119 94
120acpi_status 95acpi_status
121acpi_ds_exec_end_op ( 96acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state,
122 struct acpi_walk_state *state); 97 union acpi_parse_object **out_op);
123 98
99acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *state);
124 100
125/* 101/*
126 * dsfield - Parser/Interpreter interface for AML fields 102 * dsfield - Parser/Interpreter interface for AML fields
127 */ 103 */
128acpi_status 104acpi_status
129acpi_ds_create_field ( 105acpi_ds_create_field(union acpi_parse_object *op,
130 union acpi_parse_object *op, 106 struct acpi_namespace_node *region_node,
131 struct acpi_namespace_node *region_node, 107 struct acpi_walk_state *walk_state);
132 struct acpi_walk_state *walk_state);
133 108
134acpi_status 109acpi_status
135acpi_ds_create_bank_field ( 110acpi_ds_create_bank_field(union acpi_parse_object *op,
136 union acpi_parse_object *op, 111 struct acpi_namespace_node *region_node,
137 struct acpi_namespace_node *region_node, 112 struct acpi_walk_state *walk_state);
138 struct acpi_walk_state *walk_state);
139 113
140acpi_status 114acpi_status
141acpi_ds_create_index_field ( 115acpi_ds_create_index_field(union acpi_parse_object *op,
142 union acpi_parse_object *op, 116 struct acpi_namespace_node *region_node,
143 struct acpi_namespace_node *region_node, 117 struct acpi_walk_state *walk_state);
144 struct acpi_walk_state *walk_state);
145 118
146acpi_status 119acpi_status
147acpi_ds_create_buffer_field ( 120acpi_ds_create_buffer_field(union acpi_parse_object *op,
148 union acpi_parse_object *op, 121 struct acpi_walk_state *walk_state);
149 struct acpi_walk_state *walk_state);
150 122
151acpi_status 123acpi_status
152acpi_ds_init_field_objects ( 124acpi_ds_init_field_objects(union acpi_parse_object *op,
153 union acpi_parse_object *op, 125 struct acpi_walk_state *walk_state);
154 struct acpi_walk_state *walk_state);
155
156 126
157/* 127/*
158 * dsload - Parser/Interpreter interface, namespace load callbacks 128 * dsload - Parser/Interpreter interface, namespace load callbacks
159 */ 129 */
160acpi_status 130acpi_status
161acpi_ds_load1_begin_op ( 131acpi_ds_load1_begin_op(struct acpi_walk_state *walk_state,
162 struct acpi_walk_state *walk_state, 132 union acpi_parse_object **out_op);
163 union acpi_parse_object **out_op);
164 133
165acpi_status 134acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state);
166acpi_ds_load1_end_op (
167 struct acpi_walk_state *walk_state);
168 135
169acpi_status 136acpi_status
170acpi_ds_load2_begin_op ( 137acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
171 struct acpi_walk_state *walk_state, 138 union acpi_parse_object **out_op);
172 union acpi_parse_object **out_op);
173 139
174acpi_status 140acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state);
175acpi_ds_load2_end_op (
176 struct acpi_walk_state *walk_state);
177 141
178acpi_status 142acpi_status
179acpi_ds_init_callbacks ( 143acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number);
180 struct acpi_walk_state *walk_state,
181 u32 pass_number);
182
183 144
184/* 145/*
185 * dsmthdat - method data (locals/args) 146 * dsmthdat - method data (locals/args)
186 */ 147 */
187acpi_status 148acpi_status
188acpi_ds_store_object_to_local ( 149acpi_ds_store_object_to_local(u16 opcode,
189 u16 opcode, 150 u32 index,
190 u32 index, 151 union acpi_operand_object *src_desc,
191 union acpi_operand_object *src_desc, 152 struct acpi_walk_state *walk_state);
192 struct acpi_walk_state *walk_state);
193 153
194acpi_status 154acpi_status
195acpi_ds_method_data_get_entry ( 155acpi_ds_method_data_get_entry(u16 opcode,
196 u16 opcode, 156 u32 index,
197 u32 index, 157 struct acpi_walk_state *walk_state,
198 struct acpi_walk_state *walk_state, 158 union acpi_operand_object ***node);
199 union acpi_operand_object ***node);
200 159
201void 160void acpi_ds_method_data_delete_all(struct acpi_walk_state *walk_state);
202acpi_ds_method_data_delete_all (
203 struct acpi_walk_state *walk_state);
204 161
205u8 162u8 acpi_ds_is_method_value(union acpi_operand_object *obj_desc);
206acpi_ds_is_method_value (
207 union acpi_operand_object *obj_desc);
208 163
209acpi_status 164acpi_status
210acpi_ds_method_data_get_value ( 165acpi_ds_method_data_get_value(u16 opcode,
211 u16 opcode, 166 u32 index,
212 u32 index, 167 struct acpi_walk_state *walk_state,
213 struct acpi_walk_state *walk_state, 168 union acpi_operand_object **dest_desc);
214 union acpi_operand_object **dest_desc);
215 169
216acpi_status 170acpi_status
217acpi_ds_method_data_init_args ( 171acpi_ds_method_data_init_args(union acpi_operand_object **params,
218 union acpi_operand_object **params, 172 u32 max_param_count,
219 u32 max_param_count, 173 struct acpi_walk_state *walk_state);
220 struct acpi_walk_state *walk_state);
221 174
222acpi_status 175acpi_status
223acpi_ds_method_data_get_node ( 176acpi_ds_method_data_get_node(u16 opcode,
224 u16 opcode, 177 u32 index,
225 u32 index, 178 struct acpi_walk_state *walk_state,
226 struct acpi_walk_state *walk_state, 179 struct acpi_namespace_node **node);
227 struct acpi_namespace_node **node);
228
229void
230acpi_ds_method_data_init (
231 struct acpi_walk_state *walk_state);
232 180
181void acpi_ds_method_data_init(struct acpi_walk_state *walk_state);
233 182
234/* 183/*
235 * dsmethod - Parser/Interpreter interface - control method parsing 184 * dsmethod - Parser/Interpreter interface - control method parsing
236 */ 185 */
237acpi_status 186acpi_status acpi_ds_parse_method(struct acpi_namespace_node *node);
238acpi_ds_parse_method (
239 acpi_handle obj_handle);
240 187
241acpi_status 188acpi_status
242acpi_ds_call_control_method ( 189acpi_ds_call_control_method(struct acpi_thread_state *thread,
243 struct acpi_thread_state *thread, 190 struct acpi_walk_state *walk_state,
244 struct acpi_walk_state *walk_state, 191 union acpi_parse_object *op);
245 union acpi_parse_object *op);
246 192
247acpi_status 193acpi_status
248acpi_ds_restart_control_method ( 194acpi_ds_restart_control_method(struct acpi_walk_state *walk_state,
249 struct acpi_walk_state *walk_state, 195 union acpi_operand_object *return_desc);
250 union acpi_operand_object *return_desc);
251 196
252acpi_status 197void acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state);
253acpi_ds_terminate_control_method (
254 struct acpi_walk_state *walk_state);
255 198
256acpi_status 199acpi_status
257acpi_ds_begin_method_execution ( 200acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
258 struct acpi_namespace_node *method_node, 201 union acpi_operand_object *obj_desc,
259 union acpi_operand_object *obj_desc, 202 struct acpi_namespace_node *calling_method_node);
260 struct acpi_namespace_node *calling_method_node);
261
262 203
263/* 204/*
264 * dsinit 205 * dsinit
265 */ 206 */
266acpi_status 207acpi_status
267acpi_ds_initialize_objects ( 208acpi_ds_initialize_objects(struct acpi_table_desc *table_desc,
268 struct acpi_table_desc *table_desc, 209 struct acpi_namespace_node *start_node);
269 struct acpi_namespace_node *start_node);
270
271 210
272/* 211/*
273 * dsobject - Parser/Interpreter interface - object initialization and conversion 212 * dsobject - Parser/Interpreter interface - object initialization and conversion
274 */ 213 */
275acpi_status 214acpi_status
276acpi_ds_build_internal_buffer_obj ( 215acpi_ds_build_internal_buffer_obj(struct acpi_walk_state *walk_state,
277 struct acpi_walk_state *walk_state, 216 union acpi_parse_object *op,
278 union acpi_parse_object *op, 217 u32 buffer_length,
279 u32 buffer_length, 218 union acpi_operand_object **obj_desc_ptr);
280 union acpi_operand_object **obj_desc_ptr);
281 219
282acpi_status 220acpi_status
283acpi_ds_build_internal_package_obj ( 221acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
284 struct acpi_walk_state *walk_state, 222 union acpi_parse_object *op,
285 union acpi_parse_object *op, 223 u32 package_length,
286 u32 package_length, 224 union acpi_operand_object **obj_desc);
287 union acpi_operand_object **obj_desc);
288 225
289acpi_status 226acpi_status
290acpi_ds_init_object_from_op ( 227acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
291 struct acpi_walk_state *walk_state, 228 union acpi_parse_object *op,
292 union acpi_parse_object *op, 229 u16 opcode, union acpi_operand_object **obj_desc);
293 u16 opcode,
294 union acpi_operand_object **obj_desc);
295 230
296acpi_status 231acpi_status
297acpi_ds_create_node ( 232acpi_ds_create_node(struct acpi_walk_state *walk_state,
298 struct acpi_walk_state *walk_state, 233 struct acpi_namespace_node *node,
299 struct acpi_namespace_node *node, 234 union acpi_parse_object *op);
300 union acpi_parse_object *op);
301
302 235
303/* 236/*
304 * dsutils - Parser/Interpreter interface utility routines 237 * dsutils - Parser/Interpreter interface utility routines
305 */ 238 */
306void 239void acpi_ds_clear_implicit_return(struct acpi_walk_state *walk_state);
307acpi_ds_clear_implicit_return (
308 struct acpi_walk_state *walk_state);
309 240
310u8 241u8
311acpi_ds_do_implicit_return ( 242acpi_ds_do_implicit_return(union acpi_operand_object *return_desc,
312 union acpi_operand_object *return_desc, 243 struct acpi_walk_state *walk_state,
313 struct acpi_walk_state *walk_state, 244 u8 add_reference);
314 u8 add_reference);
315 245
316u8 246u8
317acpi_ds_is_result_used ( 247acpi_ds_is_result_used(union acpi_parse_object *op,
318 union acpi_parse_object *op, 248 struct acpi_walk_state *walk_state);
319 struct acpi_walk_state *walk_state);
320 249
321void 250void
322acpi_ds_delete_result_if_not_used ( 251acpi_ds_delete_result_if_not_used(union acpi_parse_object *op,
323 union acpi_parse_object *op, 252 union acpi_operand_object *result_obj,
324 union acpi_operand_object *result_obj, 253 struct acpi_walk_state *walk_state);
325 struct acpi_walk_state *walk_state);
326 254
327acpi_status 255acpi_status
328acpi_ds_create_operand ( 256acpi_ds_create_operand(struct acpi_walk_state *walk_state,
329 struct acpi_walk_state *walk_state, 257 union acpi_parse_object *arg, u32 args_remaining);
330 union acpi_parse_object *arg,
331 u32 args_remaining);
332 258
333acpi_status 259acpi_status
334acpi_ds_create_operands ( 260acpi_ds_create_operands(struct acpi_walk_state *walk_state,
335 struct acpi_walk_state *walk_state, 261 union acpi_parse_object *first_arg);
336 union acpi_parse_object *first_arg);
337 262
338acpi_status 263acpi_status acpi_ds_resolve_operands(struct acpi_walk_state *walk_state);
339acpi_ds_resolve_operands (
340 struct acpi_walk_state *walk_state);
341
342void
343acpi_ds_clear_operands (
344 struct acpi_walk_state *walk_state);
345 264
265void acpi_ds_clear_operands(struct acpi_walk_state *walk_state);
346 266
347/* 267/*
348 * dswscope - Scope Stack manipulation 268 * dswscope - Scope Stack manipulation
349 */ 269 */
350acpi_status 270acpi_status
351acpi_ds_scope_stack_push ( 271acpi_ds_scope_stack_push(struct acpi_namespace_node *node,
352 struct acpi_namespace_node *node, 272 acpi_object_type type,
353 acpi_object_type type, 273 struct acpi_walk_state *walk_state);
354 struct acpi_walk_state *walk_state);
355 274
275acpi_status acpi_ds_scope_stack_pop(struct acpi_walk_state *walk_state);
356 276
357acpi_status 277void acpi_ds_scope_stack_clear(struct acpi_walk_state *walk_state);
358acpi_ds_scope_stack_pop (
359 struct acpi_walk_state *walk_state);
360
361void
362acpi_ds_scope_stack_clear (
363 struct acpi_walk_state *walk_state);
364
365 278
366/* 279/*
367 * dswstate - parser WALK_STATE management routines 280 * dswstate - parser WALK_STATE management routines
368 */ 281 */
369acpi_status 282acpi_status
370acpi_ds_obj_stack_push ( 283acpi_ds_obj_stack_push(void *object, struct acpi_walk_state *walk_state);
371 void *object,
372 struct acpi_walk_state *walk_state);
373 284
374acpi_status 285acpi_status
375acpi_ds_obj_stack_pop ( 286acpi_ds_obj_stack_pop(u32 pop_count, struct acpi_walk_state *walk_state);
376 u32 pop_count,
377 struct acpi_walk_state *walk_state);
378 287
379struct acpi_walk_state * 288struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id,
380acpi_ds_create_walk_state ( 289 union acpi_parse_object
381 acpi_owner_id owner_id, 290 *origin,
382 union acpi_parse_object *origin, 291 union acpi_operand_object
383 union acpi_operand_object *mth_desc, 292 *mth_desc,
384 struct acpi_thread_state *thread); 293 struct acpi_thread_state
294 *thread);
385 295
386acpi_status 296acpi_status
387acpi_ds_init_aml_walk ( 297acpi_ds_init_aml_walk(struct acpi_walk_state *walk_state,
388 struct acpi_walk_state *walk_state, 298 union acpi_parse_object *op,
389 union acpi_parse_object *op, 299 struct acpi_namespace_node *method_node,
390 struct acpi_namespace_node *method_node, 300 u8 * aml_start,
391 u8 *aml_start, 301 u32 aml_length,
392 u32 aml_length, 302 struct acpi_parameter_info *info, u8 pass_number);
393 struct acpi_parameter_info *info,
394 u32 pass_number);
395 303
396acpi_status 304acpi_status
397acpi_ds_obj_stack_pop_and_delete ( 305acpi_ds_obj_stack_pop_and_delete(u32 pop_count,
398 u32 pop_count, 306 struct acpi_walk_state *walk_state);
399 struct acpi_walk_state *walk_state);
400 307
401void 308void acpi_ds_delete_walk_state(struct acpi_walk_state *walk_state);
402acpi_ds_delete_walk_state (
403 struct acpi_walk_state *walk_state);
404 309
405struct acpi_walk_state * 310struct acpi_walk_state *acpi_ds_pop_walk_state(struct acpi_thread_state
406acpi_ds_pop_walk_state ( 311 *thread);
407 struct acpi_thread_state *thread);
408 312
409void 313void
410acpi_ds_push_walk_state ( 314acpi_ds_push_walk_state(struct acpi_walk_state *walk_state,
411 struct acpi_walk_state *walk_state, 315 struct acpi_thread_state *thread);
412 struct acpi_thread_state *thread);
413 316
414acpi_status 317acpi_status acpi_ds_result_stack_pop(struct acpi_walk_state *walk_state);
415acpi_ds_result_stack_pop (
416 struct acpi_walk_state *walk_state);
417 318
418acpi_status 319acpi_status acpi_ds_result_stack_push(struct acpi_walk_state *walk_state);
419acpi_ds_result_stack_push (
420 struct acpi_walk_state *walk_state);
421 320
422acpi_status 321acpi_status acpi_ds_result_stack_clear(struct acpi_walk_state *walk_state);
423acpi_ds_result_stack_clear (
424 struct acpi_walk_state *walk_state);
425 322
426struct acpi_walk_state * 323struct acpi_walk_state *acpi_ds_get_current_walk_state(struct acpi_thread_state
427acpi_ds_get_current_walk_state ( 324 *thread);
428 struct acpi_thread_state *thread);
429 325
430#ifdef ACPI_FUTURE_USAGE 326#ifdef ACPI_FUTURE_USAGE
431acpi_status 327acpi_status
432acpi_ds_result_remove ( 328acpi_ds_result_remove(union acpi_operand_object **object,
433 union acpi_operand_object **object, 329 u32 index, struct acpi_walk_state *walk_state);
434 u32 index,
435 struct acpi_walk_state *walk_state);
436#endif 330#endif
437 331
438acpi_status 332acpi_status
439acpi_ds_result_pop ( 333acpi_ds_result_pop(union acpi_operand_object **object,
440 union acpi_operand_object **object, 334 struct acpi_walk_state *walk_state);
441 struct acpi_walk_state *walk_state);
442 335
443acpi_status 336acpi_status
444acpi_ds_result_push ( 337acpi_ds_result_push(union acpi_operand_object *object,
445 union acpi_operand_object *object, 338 struct acpi_walk_state *walk_state);
446 struct acpi_walk_state *walk_state);
447 339
448acpi_status 340acpi_status
449acpi_ds_result_pop_from_bottom ( 341acpi_ds_result_pop_from_bottom(union acpi_operand_object **object,
450 union acpi_operand_object **object, 342 struct acpi_walk_state *walk_state);
451 struct acpi_walk_state *walk_state);
452
453#ifdef ACPI_ENABLE_OBJECT_CACHE
454void
455acpi_ds_delete_walk_state_cache (
456 void);
457#endif
458 343
459#endif /* _ACDISPAT_H_ */ 344#endif /* _ACDISPAT_H_ */
diff --git a/include/acpi/acevents.h b/include/acpi/acevents.h
index 61a27c8c5079..bfa54600ecd9 100644
--- a/include/acpi/acevents.h
+++ b/include/acpi/acevents.h
@@ -44,250 +44,167 @@
44#ifndef __ACEVENTS_H__ 44#ifndef __ACEVENTS_H__
45#define __ACEVENTS_H__ 45#define __ACEVENTS_H__
46 46
47
48/* 47/*
49 * evevent 48 * evevent
50 */ 49 */
51acpi_status 50acpi_status acpi_ev_initialize_events(void);
52acpi_ev_initialize_events (
53 void);
54 51
55acpi_status 52acpi_status acpi_ev_install_xrupt_handlers(void);
56acpi_ev_install_xrupt_handlers (
57 void);
58
59u32
60acpi_ev_fixed_event_detect (
61 void);
62 53
54u32 acpi_ev_fixed_event_detect(void);
63 55
64/* 56/*
65 * evmisc 57 * evmisc
66 */ 58 */
67u8 59u8 acpi_ev_is_notify_object(struct acpi_namespace_node *node);
68acpi_ev_is_notify_object (
69 struct acpi_namespace_node *node);
70 60
71acpi_status 61acpi_status acpi_ev_acquire_global_lock(u16 timeout);
72acpi_ev_acquire_global_lock(
73 u16 timeout);
74 62
75acpi_status 63acpi_status acpi_ev_release_global_lock(void);
76acpi_ev_release_global_lock(
77 void);
78 64
79acpi_status 65acpi_status acpi_ev_init_global_lock_handler(void);
80acpi_ev_init_global_lock_handler (
81 void);
82 66
83u32 67u32 acpi_ev_get_gpe_number_index(u32 gpe_number);
84acpi_ev_get_gpe_number_index (
85 u32 gpe_number);
86 68
87acpi_status 69acpi_status
88acpi_ev_queue_notify_request ( 70acpi_ev_queue_notify_request(struct acpi_namespace_node *node,
89 struct acpi_namespace_node *node, 71 u32 notify_value);
90 u32 notify_value);
91
92 72
93/* 73/*
94 * evgpe - GPE handling and dispatch 74 * evgpe - GPE handling and dispatch
95 */ 75 */
96acpi_status 76acpi_status
97acpi_ev_update_gpe_enable_masks ( 77acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info,
98 struct acpi_gpe_event_info *gpe_event_info, 78 u8 type);
99 u8 type);
100 79
101acpi_status 80acpi_status
102acpi_ev_enable_gpe ( 81acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info,
103 struct acpi_gpe_event_info *gpe_event_info, 82 u8 write_to_hardware);
104 u8 write_to_hardware);
105 83
106acpi_status 84acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info);
107acpi_ev_disable_gpe (
108 struct acpi_gpe_event_info *gpe_event_info);
109
110struct acpi_gpe_event_info *
111acpi_ev_get_gpe_event_info (
112 acpi_handle gpe_device,
113 u32 gpe_number);
114 85
86struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
87 u32 gpe_number);
115 88
116/* 89/*
117 * evgpeblk 90 * evgpeblk
118 */ 91 */
119u8 92u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info);
120acpi_ev_valid_gpe_event (
121 struct acpi_gpe_event_info *gpe_event_info);
122
123acpi_status
124acpi_ev_walk_gpe_list (
125 ACPI_GPE_CALLBACK gpe_walk_callback,
126 u32 flags);
127 93
128acpi_status 94acpi_status acpi_ev_walk_gpe_list(ACPI_GPE_CALLBACK gpe_walk_callback);
129acpi_ev_delete_gpe_handlers (
130 struct acpi_gpe_xrupt_info *gpe_xrupt_info,
131 struct acpi_gpe_block_info *gpe_block);
132 95
133acpi_status 96acpi_status
134acpi_ev_create_gpe_block ( 97acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
135 struct acpi_namespace_node *gpe_device, 98 struct acpi_gpe_block_info *gpe_block);
136 struct acpi_generic_address *gpe_block_address,
137 u32 register_count,
138 u8 gpe_block_base_number,
139 u32 interrupt_level,
140 struct acpi_gpe_block_info **return_gpe_block);
141 99
142acpi_status 100acpi_status
143acpi_ev_delete_gpe_block ( 101acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
144 struct acpi_gpe_block_info *gpe_block); 102 struct acpi_generic_address *gpe_block_address,
103 u32 register_count,
104 u8 gpe_block_base_number,
105 u32 interrupt_number,
106 struct acpi_gpe_block_info **return_gpe_block);
145 107
146u32 108acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block);
147acpi_ev_gpe_dispatch (
148 struct acpi_gpe_event_info *gpe_event_info,
149 u32 gpe_number);
150 109
151u32 110u32
152acpi_ev_gpe_detect ( 111acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info,
153 struct acpi_gpe_xrupt_info *gpe_xrupt_list); 112 u32 gpe_number);
154 113
155acpi_status 114u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list);
156acpi_ev_set_gpe_type (
157 struct acpi_gpe_event_info *gpe_event_info,
158 u8 type);
159 115
160acpi_status 116acpi_status
161acpi_ev_check_for_wake_only_gpe ( 117acpi_ev_set_gpe_type(struct acpi_gpe_event_info *gpe_event_info, u8 type);
162 struct acpi_gpe_event_info *gpe_event_info);
163 118
164acpi_status 119acpi_status
165acpi_ev_gpe_initialize ( 120acpi_ev_check_for_wake_only_gpe(struct acpi_gpe_event_info *gpe_event_info);
166 void);
167 121
122acpi_status acpi_ev_gpe_initialize(void);
168 123
169/* 124/*
170 * evregion - Address Space handling 125 * evregion - Address Space handling
171 */ 126 */
172acpi_status 127acpi_status acpi_ev_install_region_handlers(void);
173acpi_ev_install_region_handlers (
174 void);
175 128
176acpi_status 129acpi_status acpi_ev_initialize_op_regions(void);
177acpi_ev_initialize_op_regions (
178 void);
179 130
180acpi_status 131acpi_status
181acpi_ev_address_space_dispatch ( 132acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
182 union acpi_operand_object *region_obj, 133 u32 function,
183 u32 function, 134 acpi_physical_address address,
184 acpi_physical_address address, 135 u32 bit_width, void *value);
185 u32 bit_width,
186 void *value);
187 136
188acpi_status 137acpi_status
189acpi_ev_attach_region ( 138acpi_ev_attach_region(union acpi_operand_object *handler_obj,
190 union acpi_operand_object *handler_obj, 139 union acpi_operand_object *region_obj,
191 union acpi_operand_object *region_obj, 140 u8 acpi_ns_is_locked);
192 u8 acpi_ns_is_locked);
193 141
194void 142void
195acpi_ev_detach_region ( 143acpi_ev_detach_region(union acpi_operand_object *region_obj,
196 union acpi_operand_object *region_obj, 144 u8 acpi_ns_is_locked);
197 u8 acpi_ns_is_locked);
198 145
199acpi_status 146acpi_status
200acpi_ev_install_space_handler ( 147acpi_ev_install_space_handler(struct acpi_namespace_node *node,
201 struct acpi_namespace_node *node, 148 acpi_adr_space_type space_id,
202 acpi_adr_space_type space_id, 149 acpi_adr_space_handler handler,
203 acpi_adr_space_handler handler, 150 acpi_adr_space_setup setup, void *context);
204 acpi_adr_space_setup setup,
205 void *context);
206 151
207acpi_status 152acpi_status
208acpi_ev_execute_reg_methods ( 153acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
209 struct acpi_namespace_node *node, 154 acpi_adr_space_type space_id);
210 acpi_adr_space_type space_id);
211 155
212acpi_status 156acpi_status
213acpi_ev_execute_reg_method ( 157acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function);
214 union acpi_operand_object *region_obj,
215 u32 function);
216
217 158
218/* 159/*
219 * evregini - Region initialization and setup 160 * evregini - Region initialization and setup
220 */ 161 */
221acpi_status 162acpi_status
222acpi_ev_system_memory_region_setup ( 163acpi_ev_system_memory_region_setup(acpi_handle handle,
223 acpi_handle handle, 164 u32 function,
224 u32 function, 165 void *handler_context,
225 void *handler_context, 166 void **region_context);
226 void **region_context);
227 167
228acpi_status 168acpi_status
229acpi_ev_io_space_region_setup ( 169acpi_ev_io_space_region_setup(acpi_handle handle,
230 acpi_handle handle, 170 u32 function,
231 u32 function, 171 void *handler_context, void **region_context);
232 void *handler_context,
233 void **region_context);
234 172
235acpi_status 173acpi_status
236acpi_ev_pci_config_region_setup ( 174acpi_ev_pci_config_region_setup(acpi_handle handle,
237 acpi_handle handle, 175 u32 function,
238 u32 function, 176 void *handler_context, void **region_context);
239 void *handler_context,
240 void **region_context);
241 177
242acpi_status 178acpi_status
243acpi_ev_cmos_region_setup ( 179acpi_ev_cmos_region_setup(acpi_handle handle,
244 acpi_handle handle, 180 u32 function,
245 u32 function, 181 void *handler_context, void **region_context);
246 void *handler_context,
247 void **region_context);
248 182
249acpi_status 183acpi_status
250acpi_ev_pci_bar_region_setup ( 184acpi_ev_pci_bar_region_setup(acpi_handle handle,
251 acpi_handle handle, 185 u32 function,
252 u32 function, 186 void *handler_context, void **region_context);
253 void *handler_context,
254 void **region_context);
255 187
256acpi_status 188acpi_status
257acpi_ev_default_region_setup ( 189acpi_ev_default_region_setup(acpi_handle handle,
258 acpi_handle handle, 190 u32 function,
259 u32 function, 191 void *handler_context, void **region_context);
260 void *handler_context,
261 void **region_context);
262 192
263acpi_status 193acpi_status
264acpi_ev_initialize_region ( 194acpi_ev_initialize_region(union acpi_operand_object *region_obj,
265 union acpi_operand_object *region_obj, 195 u8 acpi_ns_locked);
266 u8 acpi_ns_locked);
267
268 196
269/* 197/*
270 * evsci - SCI (System Control Interrupt) handling/dispatch 198 * evsci - SCI (System Control Interrupt) handling/dispatch
271 */ 199 */
272u32 ACPI_SYSTEM_XFACE 200u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context);
273acpi_ev_gpe_xrupt_handler (
274 void *context);
275
276u32
277acpi_ev_install_sci_handler (
278 void);
279 201
280acpi_status 202u32 acpi_ev_install_sci_handler(void);
281acpi_ev_remove_sci_handler (
282 void);
283 203
284u32 204acpi_status acpi_ev_remove_sci_handler(void);
285acpi_ev_initialize_sCI (
286 u32 program_sCI);
287 205
288void 206u32 acpi_ev_initialize_sCI(u32 program_sCI);
289acpi_ev_terminate (
290 void);
291 207
208void acpi_ev_terminate(void);
292 209
293#endif /* __ACEVENTS_H__ */ 210#endif /* __ACEVENTS_H__ */
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index 60d737b2d70f..4f005eb65928 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.h
@@ -44,7 +44,6 @@
44#ifndef __ACEXCEP_H__ 44#ifndef __ACEXCEP_H__
45#define __ACEXCEP_H__ 45#define __ACEXCEP_H__
46 46
47
48/* 47/*
49 * Exceptions returned by external ACPI interfaces 48 * Exceptions returned by external ACPI interfaces
50 */ 49 */
@@ -55,11 +54,9 @@
55#define AE_CODE_CONTROL 0x4000 54#define AE_CODE_CONTROL 0x4000
56#define AE_CODE_MASK 0xF000 55#define AE_CODE_MASK 0xF000
57 56
58
59#define ACPI_SUCCESS(a) (!(a)) 57#define ACPI_SUCCESS(a) (!(a))
60#define ACPI_FAILURE(a) (a) 58#define ACPI_FAILURE(a) (a)
61 59
62
63#define AE_OK (acpi_status) 0x0000 60#define AE_OK (acpi_status) 0x0000
64 61
65/* 62/*
@@ -95,9 +92,9 @@
95#define AE_ABORT_METHOD (acpi_status) (0x001C | AE_CODE_ENVIRONMENTAL) 92#define AE_ABORT_METHOD (acpi_status) (0x001C | AE_CODE_ENVIRONMENTAL)
96#define AE_SAME_HANDLER (acpi_status) (0x001D | AE_CODE_ENVIRONMENTAL) 93#define AE_SAME_HANDLER (acpi_status) (0x001D | AE_CODE_ENVIRONMENTAL)
97#define AE_WAKE_ONLY_GPE (acpi_status) (0x001E | AE_CODE_ENVIRONMENTAL) 94#define AE_WAKE_ONLY_GPE (acpi_status) (0x001E | AE_CODE_ENVIRONMENTAL)
95#define AE_OWNER_ID_LIMIT (acpi_status) (0x001F | AE_CODE_ENVIRONMENTAL)
98 96
99#define AE_CODE_ENV_MAX 0x001E 97#define AE_CODE_ENV_MAX 0x001F
100
101 98
102/* 99/*
103 * Programmer exceptions 100 * Programmer exceptions
@@ -114,7 +111,6 @@
114 111
115#define AE_CODE_PGM_MAX 0x0009 112#define AE_CODE_PGM_MAX 0x0009
116 113
117
118/* 114/*
119 * Acpi table exceptions 115 * Acpi table exceptions
120 */ 116 */
@@ -127,7 +123,6 @@
127 123
128#define AE_CODE_TBL_MAX 0x0006 124#define AE_CODE_TBL_MAX 0x0006
129 125
130
131/* 126/*
132 * AML exceptions. These are caused by problems with 127 * AML exceptions. These are caused by problems with
133 * the actual AML byte stream 128 * the actual AML byte stream
@@ -168,7 +163,6 @@
168 163
169#define AE_CODE_AML_MAX 0x0021 164#define AE_CODE_AML_MAX 0x0021
170 165
171
172/* 166/*
173 * Internal exceptions used for control 167 * Internal exceptions used for control
174 */ 168 */
@@ -186,16 +180,13 @@
186 180
187#define AE_CODE_CTRL_MAX 0x000B 181#define AE_CODE_CTRL_MAX 0x000B
188 182
189
190#ifdef DEFINE_ACPI_GLOBALS 183#ifdef DEFINE_ACPI_GLOBALS
191 184
192
193/* 185/*
194 * String versions of the exception codes above 186 * String versions of the exception codes above
195 * These strings must match the corresponding defines exactly 187 * These strings must match the corresponding defines exactly
196 */ 188 */
197char const *acpi_gbl_exception_names_env[] = 189char const *acpi_gbl_exception_names_env[] = {
198{
199 "AE_OK", 190 "AE_OK",
200 "AE_ERROR", 191 "AE_ERROR",
201 "AE_NO_ACPI_TABLES", 192 "AE_NO_ACPI_TABLES",
@@ -226,11 +217,11 @@ char const *acpi_gbl_exception_names_env[] =
226 "AE_LOGICAL_ADDRESS", 217 "AE_LOGICAL_ADDRESS",
227 "AE_ABORT_METHOD", 218 "AE_ABORT_METHOD",
228 "AE_SAME_HANDLER", 219 "AE_SAME_HANDLER",
229 "AE_WAKE_ONLY_GPE" 220 "AE_WAKE_ONLY_GPE",
221 "AE_OWNER_ID_LIMIT"
230}; 222};
231 223
232char const *acpi_gbl_exception_names_pgm[] = 224char const *acpi_gbl_exception_names_pgm[] = {
233{
234 "AE_BAD_PARAMETER", 225 "AE_BAD_PARAMETER",
235 "AE_BAD_CHARACTER", 226 "AE_BAD_CHARACTER",
236 "AE_BAD_PATHNAME", 227 "AE_BAD_PATHNAME",
@@ -242,8 +233,7 @@ char const *acpi_gbl_exception_names_pgm[] =
242 "AE_BAD_DECIMAL_CONSTANT" 233 "AE_BAD_DECIMAL_CONSTANT"
243}; 234};
244 235
245char const *acpi_gbl_exception_names_tbl[] = 236char const *acpi_gbl_exception_names_tbl[] = {
246{
247 "AE_BAD_SIGNATURE", 237 "AE_BAD_SIGNATURE",
248 "AE_BAD_HEADER", 238 "AE_BAD_HEADER",
249 "AE_BAD_CHECKSUM", 239 "AE_BAD_CHECKSUM",
@@ -252,8 +242,7 @@ char const *acpi_gbl_exception_names_tbl[] =
252 "AE_INVALID_TABLE_LENGTH" 242 "AE_INVALID_TABLE_LENGTH"
253}; 243};
254 244
255char const *acpi_gbl_exception_names_aml[] = 245char const *acpi_gbl_exception_names_aml[] = {
256{
257 "AE_AML_ERROR", 246 "AE_AML_ERROR",
258 "AE_AML_PARSE", 247 "AE_AML_PARSE",
259 "AE_AML_BAD_OPCODE", 248 "AE_AML_BAD_OPCODE",
@@ -289,8 +278,7 @@ char const *acpi_gbl_exception_names_aml[] =
289 "AE_AML_BAD_RESOURCE_LENGTH" 278 "AE_AML_BAD_RESOURCE_LENGTH"
290}; 279};
291 280
292char const *acpi_gbl_exception_names_ctrl[] = 281char const *acpi_gbl_exception_names_ctrl[] = {
293{
294 "AE_CTRL_RETURN_VALUE", 282 "AE_CTRL_RETURN_VALUE",
295 "AE_CTRL_PENDING", 283 "AE_CTRL_PENDING",
296 "AE_CTRL_TERMINATE", 284 "AE_CTRL_TERMINATE",
@@ -304,6 +292,6 @@ char const *acpi_gbl_exception_names_ctrl[] =
304 "AE_CTRL_SKIP" 292 "AE_CTRL_SKIP"
305}; 293};
306 294
307#endif /* ACPI GLOBALS */ 295#endif /* ACPI GLOBALS */
308 296
309#endif /* __ACEXCEP_H__ */ 297#endif /* __ACEXCEP_H__ */
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index 4946696088c3..e9c2790139ec 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -44,7 +44,6 @@
44#ifndef __ACGLOBAL_H__ 44#ifndef __ACGLOBAL_H__
45#define __ACGLOBAL_H__ 45#define __ACGLOBAL_H__
46 46
47
48/* 47/*
49 * Ensure that the globals are actually defined and initialized only once. 48 * Ensure that the globals are actually defined and initialized only once.
50 * 49 *
@@ -63,9 +62,8 @@
63 * Keep local copies of these FADT-based registers. NOTE: These globals 62 * Keep local copies of these FADT-based registers. NOTE: These globals
64 * are first in this file for alignment reasons on 64-bit systems. 63 * are first in this file for alignment reasons on 64-bit systems.
65 */ 64 */
66ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable; 65ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable;
67ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable; 66ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable;
68
69 67
70/***************************************************************************** 68/*****************************************************************************
71 * 69 *
@@ -75,13 +73,12 @@ ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable;
75 73
76/* Runtime configuration of debug print levels */ 74/* Runtime configuration of debug print levels */
77 75
78extern u32 acpi_dbg_level; 76extern u32 acpi_dbg_level;
79extern u32 acpi_dbg_layer; 77extern u32 acpi_dbg_layer;
80 78
81/* Procedure nesting level for debug output */ 79/* Procedure nesting level for debug output */
82 80
83extern u32 acpi_gbl_nesting_level; 81extern u32 acpi_gbl_nesting_level;
84
85 82
86/***************************************************************************** 83/*****************************************************************************
87 * 84 *
@@ -98,7 +95,7 @@ extern u32 acpi_gbl_nesting_level;
98 * 3) Allow access to uninitialized locals/args (auto-init to integer 0) 95 * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
99 * 4) Allow ANY object type to be a source operand for the Store() operator 96 * 4) Allow ANY object type to be a source operand for the Store() operator
100 */ 97 */
101ACPI_EXTERN u8 ACPI_INIT_GLOBAL (acpi_gbl_enable_interpreter_slack, FALSE); 98ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE);
102 99
103/* 100/*
104 * Automatically serialize ALL control methods? Default is FALSE, meaning 101 * Automatically serialize ALL control methods? Default is FALSE, meaning
@@ -106,22 +103,21 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL (acpi_gbl_enable_interpreter_slack, FALSE)
106 * Only change this if the ASL code is poorly written and cannot handle 103 * Only change this if the ASL code is poorly written and cannot handle
107 * reentrancy even though methods are marked "not_serialized". 104 * reentrancy even though methods are marked "not_serialized".
108 */ 105 */
109ACPI_EXTERN u8 ACPI_INIT_GLOBAL (acpi_gbl_all_methods_serialized, FALSE); 106ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_all_methods_serialized, FALSE);
110 107
111/* 108/*
112 * Create the predefined _OSI method in the namespace? Default is TRUE 109 * Create the predefined _OSI method in the namespace? Default is TRUE
113 * because ACPI CA is fully compatible with other ACPI implementations. 110 * because ACPI CA is fully compatible with other ACPI implementations.
114 * Changing this will revert ACPI CA (and machine ASL) to pre-OSI behavior. 111 * Changing this will revert ACPI CA (and machine ASL) to pre-OSI behavior.
115 */ 112 */
116ACPI_EXTERN u8 ACPI_INIT_GLOBAL (acpi_gbl_create_osi_method, TRUE); 113ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_create_osi_method, TRUE);
117 114
118/* 115/*
119 * Disable wakeup GPEs during runtime? Default is TRUE because WAKE and 116 * Disable wakeup GPEs during runtime? Default is TRUE because WAKE and
120 * RUNTIME GPEs should never be shared, and WAKE GPEs should typically only 117 * RUNTIME GPEs should never be shared, and WAKE GPEs should typically only
121 * be enabled just before going to sleep. 118 * be enabled just before going to sleep.
122 */ 119 */
123ACPI_EXTERN u8 ACPI_INIT_GLOBAL (acpi_gbl_leave_wake_gpes_disabled, TRUE); 120ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_leave_wake_gpes_disabled, TRUE);
124
125 121
126/***************************************************************************** 122/*****************************************************************************
127 * 123 *
@@ -137,42 +133,46 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL (acpi_gbl_leave_wake_gpes_disabled, TRUE);
137 * These tables are single-table only; meaning that there can be at most one 133 * These tables are single-table only; meaning that there can be at most one
138 * of each in the system. Each global points to the actual table. 134 * of each in the system. Each global points to the actual table.
139 */ 135 */
140ACPI_EXTERN u32 acpi_gbl_table_flags; 136ACPI_EXTERN u32 acpi_gbl_table_flags;
141ACPI_EXTERN u32 acpi_gbl_rsdt_table_count; 137ACPI_EXTERN u32 acpi_gbl_rsdt_table_count;
142ACPI_EXTERN struct rsdp_descriptor *acpi_gbl_RSDP; 138ACPI_EXTERN struct rsdp_descriptor *acpi_gbl_RSDP;
143ACPI_EXTERN XSDT_DESCRIPTOR *acpi_gbl_XSDT; 139ACPI_EXTERN XSDT_DESCRIPTOR *acpi_gbl_XSDT;
144ACPI_EXTERN FADT_DESCRIPTOR *acpi_gbl_FADT; 140ACPI_EXTERN FADT_DESCRIPTOR *acpi_gbl_FADT;
145ACPI_EXTERN struct acpi_table_header *acpi_gbl_DSDT; 141ACPI_EXTERN struct acpi_table_header *acpi_gbl_DSDT;
146ACPI_EXTERN FACS_DESCRIPTOR *acpi_gbl_FACS; 142ACPI_EXTERN FACS_DESCRIPTOR *acpi_gbl_FACS;
147ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS; 143ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS;
148/* 144/*
149 * Since there may be multiple SSDTs and PSDTs, a single pointer is not 145 * Since there may be multiple SSDTs and PSDTs, a single pointer is not
150 * sufficient; Therefore, there isn't one! 146 * sufficient; Therefore, there isn't one!
151 */ 147 */
152 148
149/* The root table can be either an RSDT or an XSDT */
150
151ACPI_EXTERN u8 acpi_gbl_root_table_type;
152#define ACPI_TABLE_TYPE_RSDT 'R'
153#define ACPI_TABLE_TYPE_XSDT 'X'
153 154
154/* 155/*
155 * Handle both ACPI 1.0 and ACPI 2.0 Integer widths: 156 * Handle both ACPI 1.0 and ACPI 2.0 Integer widths:
156 * If we are executing a method that exists in a 32-bit ACPI table, 157 * If we are executing a method that exists in a 32-bit ACPI table,
157 * use only the lower 32 bits of the (internal) 64-bit Integer. 158 * use only the lower 32 bits of the (internal) 64-bit Integer.
158 */ 159 */
159ACPI_EXTERN u8 acpi_gbl_integer_bit_width; 160ACPI_EXTERN u8 acpi_gbl_integer_bit_width;
160ACPI_EXTERN u8 acpi_gbl_integer_byte_width; 161ACPI_EXTERN u8 acpi_gbl_integer_byte_width;
161ACPI_EXTERN u8 acpi_gbl_integer_nybble_width; 162ACPI_EXTERN u8 acpi_gbl_integer_nybble_width;
162 163
163/* 164/*
164 * ACPI Table info arrays 165 * ACPI Table info arrays
165 */ 166 */
166extern struct acpi_table_list acpi_gbl_table_lists[NUM_ACPI_TABLE_TYPES]; 167extern struct acpi_table_list acpi_gbl_table_lists[NUM_ACPI_TABLE_TYPES];
167extern struct acpi_table_support acpi_gbl_table_data[NUM_ACPI_TABLE_TYPES]; 168extern struct acpi_table_support acpi_gbl_table_data[NUM_ACPI_TABLE_TYPES];
168 169
169/* 170/*
170 * Predefined mutex objects. This array contains the 171 * Predefined mutex objects. This array contains the
171 * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs. 172 * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs.
172 * (The table maps local handles to the real OS handles) 173 * (The table maps local handles to the real OS handles)
173 */ 174 */
174ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[NUM_MUTEX]; 175ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[NUM_MUTEX];
175
176 176
177/***************************************************************************** 177/*****************************************************************************
178 * 178 *
@@ -180,41 +180,56 @@ ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[NUM_MUTEX];
180 * 180 *
181 ****************************************************************************/ 181 ****************************************************************************/
182 182
183#ifdef ACPI_DBG_TRACK_ALLOCATIONS
184
185/* Lists for tracking memory allocations */
183 186
184ACPI_EXTERN struct acpi_memory_list acpi_gbl_memory_lists[ACPI_NUM_MEM_LISTS]; 187ACPI_EXTERN struct acpi_memory_list *acpi_gbl_global_list;
185ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_device_notify; 188ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list;
186ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_system_notify; 189#endif
187ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler;
188ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler;
189ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk;
190ACPI_EXTERN acpi_handle acpi_gbl_global_lock_semaphore;
191
192ACPI_EXTERN u32 acpi_gbl_global_lock_thread_count;
193ACPI_EXTERN u32 acpi_gbl_original_mode;
194ACPI_EXTERN u32 acpi_gbl_rsdp_original_location;
195ACPI_EXTERN u32 acpi_gbl_ns_lookup_count;
196ACPI_EXTERN u32 acpi_gbl_ps_find_count;
197ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save;
198ACPI_EXTERN u16 acpi_gbl_next_table_owner_id;
199ACPI_EXTERN u16 acpi_gbl_next_method_owner_id;
200ACPI_EXTERN u16 acpi_gbl_global_lock_handle;
201ACPI_EXTERN u8 acpi_gbl_debugger_configuration;
202ACPI_EXTERN u8 acpi_gbl_global_lock_acquired;
203ACPI_EXTERN u8 acpi_gbl_step_to_next_call;
204ACPI_EXTERN u8 acpi_gbl_acpi_hardware_present;
205ACPI_EXTERN u8 acpi_gbl_global_lock_present;
206ACPI_EXTERN u8 acpi_gbl_events_initialized;
207ACPI_EXTERN u8 acpi_gbl_system_awake_and_running;
208
209extern u8 acpi_gbl_shutdown;
210extern u32 acpi_gbl_startup_flags;
211extern const u8 acpi_gbl_decode_to8bit[8];
212extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT];
213extern const char *acpi_gbl_highest_dstate_names[4];
214extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES];
215extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];
216extern const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STRINGS];
217 190
191/* Object caches */
192
193ACPI_EXTERN acpi_cache_t *acpi_gbl_state_cache;
194ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_cache;
195ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_ext_cache;
196ACPI_EXTERN acpi_cache_t *acpi_gbl_operand_cache;
197
198/* Global handlers */
199
200ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_device_notify;
201ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_system_notify;
202ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler;
203ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler;
204ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk;
205ACPI_EXTERN acpi_handle acpi_gbl_global_lock_semaphore;
206
207/* Misc */
208
209ACPI_EXTERN u32 acpi_gbl_global_lock_thread_count;
210ACPI_EXTERN u32 acpi_gbl_original_mode;
211ACPI_EXTERN u32 acpi_gbl_rsdp_original_location;
212ACPI_EXTERN u32 acpi_gbl_ns_lookup_count;
213ACPI_EXTERN u32 acpi_gbl_ps_find_count;
214ACPI_EXTERN u32 acpi_gbl_owner_id_mask;
215ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save;
216ACPI_EXTERN u16 acpi_gbl_global_lock_handle;
217ACPI_EXTERN u8 acpi_gbl_debugger_configuration;
218ACPI_EXTERN u8 acpi_gbl_global_lock_acquired;
219ACPI_EXTERN u8 acpi_gbl_step_to_next_call;
220ACPI_EXTERN u8 acpi_gbl_acpi_hardware_present;
221ACPI_EXTERN u8 acpi_gbl_global_lock_present;
222ACPI_EXTERN u8 acpi_gbl_events_initialized;
223ACPI_EXTERN u8 acpi_gbl_system_awake_and_running;
224
225extern u8 acpi_gbl_shutdown;
226extern u32 acpi_gbl_startup_flags;
227extern const u8 acpi_gbl_decode_to8bit[8];
228extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT];
229extern const char *acpi_gbl_highest_dstate_names[4];
230extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES];
231extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];
232extern const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STRINGS];
218 233
219/***************************************************************************** 234/*****************************************************************************
220 * 235 *
@@ -230,36 +245,34 @@ extern const char *acpi_gbl_valid_osi_strings[ACPI_
230#define NUM_PREDEFINED_NAMES 9 245#define NUM_PREDEFINED_NAMES 9
231#endif 246#endif
232 247
233ACPI_EXTERN struct acpi_namespace_node acpi_gbl_root_node_struct; 248ACPI_EXTERN struct acpi_namespace_node acpi_gbl_root_node_struct;
234ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_root_node; 249ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_root_node;
235ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_fadt_gpe_device; 250ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_fadt_gpe_device;
236 251
237extern const u8 acpi_gbl_ns_properties[NUM_NS_TYPES]; 252extern const u8 acpi_gbl_ns_properties[NUM_NS_TYPES];
238extern const struct acpi_predefined_names acpi_gbl_pre_defined_names [NUM_PREDEFINED_NAMES]; 253extern const struct acpi_predefined_names
254 acpi_gbl_pre_defined_names[NUM_PREDEFINED_NAMES];
239 255
240#ifdef ACPI_DEBUG_OUTPUT 256#ifdef ACPI_DEBUG_OUTPUT
241ACPI_EXTERN u32 acpi_gbl_current_node_count; 257ACPI_EXTERN u32 acpi_gbl_current_node_count;
242ACPI_EXTERN u32 acpi_gbl_current_node_size; 258ACPI_EXTERN u32 acpi_gbl_current_node_size;
243ACPI_EXTERN u32 acpi_gbl_max_concurrent_node_count; 259ACPI_EXTERN u32 acpi_gbl_max_concurrent_node_count;
244ACPI_EXTERN acpi_size acpi_gbl_entry_stack_pointer; 260ACPI_EXTERN acpi_size acpi_gbl_entry_stack_pointer;
245ACPI_EXTERN acpi_size acpi_gbl_lowest_stack_pointer; 261ACPI_EXTERN acpi_size acpi_gbl_lowest_stack_pointer;
246ACPI_EXTERN u32 acpi_gbl_deepest_nesting; 262ACPI_EXTERN u32 acpi_gbl_deepest_nesting;
247#endif 263#endif
248 264
249
250/***************************************************************************** 265/*****************************************************************************
251 * 266 *
252 * Interpreter globals 267 * Interpreter globals
253 * 268 *
254 ****************************************************************************/ 269 ****************************************************************************/
255 270
256 271ACPI_EXTERN struct acpi_thread_state *acpi_gbl_current_walk_list;
257ACPI_EXTERN struct acpi_thread_state *acpi_gbl_current_walk_list;
258 272
259/* Control method single step flag */ 273/* Control method single step flag */
260 274
261ACPI_EXTERN u8 acpi_gbl_cm_single_step; 275ACPI_EXTERN u8 acpi_gbl_cm_single_step;
262
263 276
264/***************************************************************************** 277/*****************************************************************************
265 * 278 *
@@ -267,8 +280,7 @@ ACPI_EXTERN u8 acpi_gbl_cm_single_step;
267 * 280 *
268 ****************************************************************************/ 281 ****************************************************************************/
269 282
270ACPI_EXTERN union acpi_parse_object *acpi_gbl_parsed_namespace_root; 283ACPI_EXTERN union acpi_parse_object *acpi_gbl_parsed_namespace_root;
271
272 284
273/***************************************************************************** 285/*****************************************************************************
274 * 286 *
@@ -276,10 +288,10 @@ ACPI_EXTERN union acpi_parse_object *acpi_gbl_parsed_namespace_root;
276 * 288 *
277 ****************************************************************************/ 289 ****************************************************************************/
278 290
279extern struct acpi_bit_register_info acpi_gbl_bit_register_info[ACPI_NUM_BITREG]; 291extern struct acpi_bit_register_info
280ACPI_EXTERN u8 acpi_gbl_sleep_type_a; 292 acpi_gbl_bit_register_info[ACPI_NUM_BITREG];
281ACPI_EXTERN u8 acpi_gbl_sleep_type_b; 293ACPI_EXTERN u8 acpi_gbl_sleep_type_a;
282 294ACPI_EXTERN u8 acpi_gbl_sleep_type_b;
283 295
284/***************************************************************************** 296/*****************************************************************************
285 * 297 *
@@ -287,12 +299,14 @@ ACPI_EXTERN u8 acpi_gbl_sleep_type_b;
287 * 299 *
288 ****************************************************************************/ 300 ****************************************************************************/
289 301
290extern struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS]; 302extern struct acpi_fixed_event_info
291ACPI_EXTERN struct acpi_fixed_event_handler acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS]; 303 acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS];
292ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head; 304ACPI_EXTERN struct acpi_fixed_event_handler
293ACPI_EXTERN struct acpi_gpe_block_info *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS]; 305 acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS];
294ACPI_EXTERN acpi_handle acpi_gbl_gpe_lock; 306ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head;
295 307ACPI_EXTERN struct acpi_gpe_block_info
308 *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS];
309ACPI_EXTERN acpi_handle acpi_gbl_gpe_lock;
296 310
297/***************************************************************************** 311/*****************************************************************************
298 * 312 *
@@ -300,58 +314,55 @@ ACPI_EXTERN acpi_handle acpi_gbl_gpe_lock;
300 * 314 *
301 ****************************************************************************/ 315 ****************************************************************************/
302 316
303ACPI_EXTERN u8 acpi_gbl_db_output_flags; 317ACPI_EXTERN u8 acpi_gbl_db_output_flags;
304 318
305#ifdef ACPI_DISASSEMBLER 319#ifdef ACPI_DISASSEMBLER
306 320
307ACPI_EXTERN u8 acpi_gbl_db_opt_disasm; 321ACPI_EXTERN u8 acpi_gbl_db_opt_disasm;
308ACPI_EXTERN u8 acpi_gbl_db_opt_verbose; 322ACPI_EXTERN u8 acpi_gbl_db_opt_verbose;
309#endif 323#endif
310 324
311
312#ifdef ACPI_DEBUGGER 325#ifdef ACPI_DEBUGGER
313 326
314extern u8 acpi_gbl_method_executing; 327extern u8 acpi_gbl_method_executing;
315extern u8 acpi_gbl_abort_method; 328extern u8 acpi_gbl_abort_method;
316extern u8 acpi_gbl_db_terminate_threads; 329extern u8 acpi_gbl_db_terminate_threads;
317 330
318ACPI_EXTERN int optind; 331ACPI_EXTERN int optind;
319ACPI_EXTERN char *optarg; 332ACPI_EXTERN char *optarg;
320 333
321ACPI_EXTERN u8 acpi_gbl_db_opt_tables; 334ACPI_EXTERN u8 acpi_gbl_db_opt_tables;
322ACPI_EXTERN u8 acpi_gbl_db_opt_stats; 335ACPI_EXTERN u8 acpi_gbl_db_opt_stats;
323ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods; 336ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods;
324 337
325 338ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS];
326ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS]; 339ACPI_EXTERN char acpi_gbl_db_line_buf[80];
327ACPI_EXTERN char acpi_gbl_db_line_buf[80]; 340ACPI_EXTERN char acpi_gbl_db_parsed_buf[80];
328ACPI_EXTERN char acpi_gbl_db_parsed_buf[80]; 341ACPI_EXTERN char acpi_gbl_db_scope_buf[40];
329ACPI_EXTERN char acpi_gbl_db_scope_buf[40]; 342ACPI_EXTERN char acpi_gbl_db_debug_filename[40];
330ACPI_EXTERN char acpi_gbl_db_debug_filename[40]; 343ACPI_EXTERN u8 acpi_gbl_db_output_to_file;
331ACPI_EXTERN u8 acpi_gbl_db_output_to_file; 344ACPI_EXTERN char *acpi_gbl_db_buffer;
332ACPI_EXTERN char *acpi_gbl_db_buffer; 345ACPI_EXTERN char *acpi_gbl_db_filename;
333ACPI_EXTERN char *acpi_gbl_db_filename; 346ACPI_EXTERN u32 acpi_gbl_db_debug_level;
334ACPI_EXTERN u32 acpi_gbl_db_debug_level; 347ACPI_EXTERN u32 acpi_gbl_db_console_debug_level;
335ACPI_EXTERN u32 acpi_gbl_db_console_debug_level; 348ACPI_EXTERN struct acpi_table_header *acpi_gbl_db_table_ptr;
336ACPI_EXTERN struct acpi_table_header *acpi_gbl_db_table_ptr; 349ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_db_scope_node;
337ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_db_scope_node;
338 350
339/* 351/*
340 * Statistic globals 352 * Statistic globals
341 */ 353 */
342ACPI_EXTERN u16 acpi_gbl_obj_type_count[ACPI_TYPE_NS_NODE_MAX+1]; 354ACPI_EXTERN u16 acpi_gbl_obj_type_count[ACPI_TYPE_NS_NODE_MAX + 1];
343ACPI_EXTERN u16 acpi_gbl_node_type_count[ACPI_TYPE_NS_NODE_MAX+1]; 355ACPI_EXTERN u16 acpi_gbl_node_type_count[ACPI_TYPE_NS_NODE_MAX + 1];
344ACPI_EXTERN u16 acpi_gbl_obj_type_count_misc; 356ACPI_EXTERN u16 acpi_gbl_obj_type_count_misc;
345ACPI_EXTERN u16 acpi_gbl_node_type_count_misc; 357ACPI_EXTERN u16 acpi_gbl_node_type_count_misc;
346ACPI_EXTERN u32 acpi_gbl_num_nodes; 358ACPI_EXTERN u32 acpi_gbl_num_nodes;
347ACPI_EXTERN u32 acpi_gbl_num_objects; 359ACPI_EXTERN u32 acpi_gbl_num_objects;
348
349 360
350ACPI_EXTERN u32 acpi_gbl_size_of_parse_tree; 361ACPI_EXTERN u32 acpi_gbl_size_of_parse_tree;
351ACPI_EXTERN u32 acpi_gbl_size_of_method_trees; 362ACPI_EXTERN u32 acpi_gbl_size_of_method_trees;
352ACPI_EXTERN u32 acpi_gbl_size_of_node_entries; 363ACPI_EXTERN u32 acpi_gbl_size_of_node_entries;
353ACPI_EXTERN u32 acpi_gbl_size_of_acpi_objects; 364ACPI_EXTERN u32 acpi_gbl_size_of_acpi_objects;
354 365
355#endif /* ACPI_DEBUGGER */ 366#endif /* ACPI_DEBUGGER */
356 367
357#endif /* __ACGLOBAL_H__ */ 368#endif /* __ACGLOBAL_H__ */
diff --git a/include/acpi/achware.h b/include/acpi/achware.h
index 9d63641b8e7d..3644d7248e7e 100644
--- a/include/acpi/achware.h
+++ b/include/acpi/achware.h
@@ -44,7 +44,6 @@
44#ifndef __ACHWARE_H__ 44#ifndef __ACHWARE_H__
45#define __ACHWARE_H__ 45#define __ACHWARE_H__
46 46
47
48/* PM Timer ticks per second (HZ) */ 47/* PM Timer ticks per second (HZ) */
49 48
50#define PM_TIMER_FREQUENCY 3579545 49#define PM_TIMER_FREQUENCY 3579545
@@ -57,126 +56,78 @@
57#define ACPI_SST_SLEEPING 3 56#define ACPI_SST_SLEEPING 3
58#define ACPI_SST_SLEEP_CONTEXT 4 57#define ACPI_SST_SLEEP_CONTEXT 4
59 58
60
61/* Prototypes */ 59/* Prototypes */
62 60
63
64/* 61/*
65 * hwacpi - high level functions 62 * hwacpi - high level functions
66 */ 63 */
67acpi_status 64acpi_status acpi_hw_initialize(void);
68acpi_hw_initialize (
69 void);
70 65
71acpi_status 66acpi_status acpi_hw_set_mode(u32 mode);
72acpi_hw_set_mode (
73 u32 mode);
74
75u32
76acpi_hw_get_mode (
77 void);
78 67
68u32 acpi_hw_get_mode(void);
79 69
80/* 70/*
81 * hwregs - ACPI Register I/O 71 * hwregs - ACPI Register I/O
82 */ 72 */
83struct acpi_bit_register_info * 73struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id);
84acpi_hw_get_bit_register_info (
85 u32 register_id);
86
87acpi_status
88acpi_hw_register_read (
89 u8 use_lock,
90 u32 register_id,
91 u32 *return_value);
92 74
93acpi_status 75acpi_status
94acpi_hw_register_write ( 76acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value);
95 u8 use_lock,
96 u32 register_id,
97 u32 value);
98 77
99acpi_status 78acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value);
100acpi_hw_low_level_read (
101 u32 width,
102 u32 *value,
103 struct acpi_generic_address *reg);
104 79
105acpi_status 80acpi_status
106acpi_hw_low_level_write ( 81acpi_hw_low_level_read(u32 width,
107 u32 width, 82 u32 * value, struct acpi_generic_address *reg);
108 u32 value,
109 struct acpi_generic_address *reg);
110 83
111acpi_status 84acpi_status
112acpi_hw_clear_acpi_status ( 85acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address *reg);
113 u32 flags);
114 86
87acpi_status acpi_hw_clear_acpi_status(u32 flags);
115 88
116/* 89/*
117 * hwgpe - GPE support 90 * hwgpe - GPE support
118 */ 91 */
119acpi_status 92acpi_status
120acpi_hw_write_gpe_enable_reg ( 93acpi_hw_write_gpe_enable_reg(struct acpi_gpe_event_info *gpe_event_info);
121 struct acpi_gpe_event_info *gpe_event_info);
122 94
123acpi_status 95acpi_status
124acpi_hw_disable_gpe_block ( 96acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
125 struct acpi_gpe_xrupt_info *gpe_xrupt_info, 97 struct acpi_gpe_block_info *gpe_block);
126 struct acpi_gpe_block_info *gpe_block);
127 98
128acpi_status 99acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info *gpe_event_info);
129acpi_hw_clear_gpe (
130 struct acpi_gpe_event_info *gpe_event_info);
131 100
132acpi_status 101acpi_status
133acpi_hw_clear_gpe_block ( 102acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
134 struct acpi_gpe_xrupt_info *gpe_xrupt_info, 103 struct acpi_gpe_block_info *gpe_block);
135 struct acpi_gpe_block_info *gpe_block);
136 104
137#ifdef ACPI_FUTURE_USAGE 105#ifdef ACPI_FUTURE_USAGE
138acpi_status 106acpi_status
139acpi_hw_get_gpe_status ( 107acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info,
140 struct acpi_gpe_event_info *gpe_event_info, 108 acpi_event_status * event_status);
141 acpi_event_status *event_status); 109#endif /* ACPI_FUTURE_USAGE */
142#endif /* ACPI_FUTURE_USAGE */
143 110
144acpi_status 111acpi_status acpi_hw_disable_all_gpes(void);
145acpi_hw_disable_all_gpes (
146 u32 flags);
147 112
148acpi_status 113acpi_status acpi_hw_enable_all_runtime_gpes(void);
149acpi_hw_enable_all_runtime_gpes (
150 u32 flags);
151 114
152acpi_status 115acpi_status acpi_hw_enable_all_wakeup_gpes(void);
153acpi_hw_enable_all_wakeup_gpes (
154 u32 flags);
155 116
156acpi_status 117acpi_status
157acpi_hw_enable_runtime_gpe_block ( 118acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
158 struct acpi_gpe_xrupt_info *gpe_xrupt_info, 119 struct acpi_gpe_block_info *gpe_block);
159 struct acpi_gpe_block_info *gpe_block);
160
161 120
162#ifdef ACPI_FUTURE_USAGE 121#ifdef ACPI_FUTURE_USAGE
163/* 122/*
164 * hwtimer - ACPI Timer prototypes 123 * hwtimer - ACPI Timer prototypes
165 */ 124 */
166acpi_status 125acpi_status acpi_get_timer_resolution(u32 * resolution);
167acpi_get_timer_resolution (
168 u32 *resolution);
169 126
170acpi_status 127acpi_status acpi_get_timer(u32 * ticks);
171acpi_get_timer (
172 u32 *ticks);
173 128
174acpi_status 129acpi_status
175acpi_get_timer_duration ( 130acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 * time_elapsed);
176 u32 start_ticks, 131#endif /* ACPI_FUTURE_USAGE */
177 u32 end_ticks,
178 u32 *time_elapsed);
179#endif /* ACPI_FUTURE_USAGE */
180
181 132
182#endif /* __ACHWARE_H__ */ 133#endif /* __ACHWARE_H__ */
diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h
index 5c7172477a0f..2c9c1a1d1b7f 100644
--- a/include/acpi/acinterp.h
+++ b/include/acpi/acinterp.h
@@ -44,29 +44,22 @@
44#ifndef __ACINTERP_H__ 44#ifndef __ACINTERP_H__
45#define __ACINTERP_H__ 45#define __ACINTERP_H__
46 46
47
48#define ACPI_WALK_OPERANDS (&(walk_state->operands [walk_state->num_operands -1])) 47#define ACPI_WALK_OPERANDS (&(walk_state->operands [walk_state->num_operands -1]))
49 48
50
51/* 49/*
52 * exconvrt - object conversion 50 * exconvrt - object conversion
53 */ 51 */
54acpi_status 52acpi_status
55acpi_ex_convert_to_integer ( 53acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc,
56 union acpi_operand_object *obj_desc, 54 union acpi_operand_object **result_desc, u32 flags);
57 union acpi_operand_object **result_desc,
58 u32 flags);
59 55
60acpi_status 56acpi_status
61acpi_ex_convert_to_buffer ( 57acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc,
62 union acpi_operand_object *obj_desc, 58 union acpi_operand_object **result_desc);
63 union acpi_operand_object **result_desc);
64 59
65acpi_status 60acpi_status
66acpi_ex_convert_to_string ( 61acpi_ex_convert_to_string(union acpi_operand_object *obj_desc,
67 union acpi_operand_object *obj_desc, 62 union acpi_operand_object **result_desc, u32 type);
68 union acpi_operand_object **result_desc,
69 u32 type);
70 63
71/* Types for ->String conversion */ 64/* Types for ->String conversion */
72 65
@@ -76,587 +69,412 @@ acpi_ex_convert_to_string (
76#define ACPI_EXPLICIT_CONVERT_DECIMAL 0x00000003 69#define ACPI_EXPLICIT_CONVERT_DECIMAL 0x00000003
77 70
78acpi_status 71acpi_status
79acpi_ex_convert_to_target_type ( 72acpi_ex_convert_to_target_type(acpi_object_type destination_type,
80 acpi_object_type destination_type, 73 union acpi_operand_object *source_desc,
81 union acpi_operand_object *source_desc, 74 union acpi_operand_object **result_desc,
82 union acpi_operand_object **result_desc, 75 struct acpi_walk_state *walk_state);
83 struct acpi_walk_state *walk_state);
84
85 76
86/* 77/*
87 * exfield - ACPI AML (p-code) execution - field manipulation 78 * exfield - ACPI AML (p-code) execution - field manipulation
88 */ 79 */
89acpi_status 80acpi_status
90acpi_ex_common_buffer_setup ( 81acpi_ex_common_buffer_setup(union acpi_operand_object *obj_desc,
91 union acpi_operand_object *obj_desc, 82 u32 buffer_length, u32 * datum_count);
92 u32 buffer_length,
93 u32 *datum_count);
94 83
95acpi_status 84acpi_status
96acpi_ex_write_with_update_rule ( 85acpi_ex_write_with_update_rule(union acpi_operand_object *obj_desc,
97 union acpi_operand_object *obj_desc, 86 acpi_integer mask,
98 acpi_integer mask, 87 acpi_integer field_value,
99 acpi_integer field_value, 88 u32 field_datum_byte_offset);
100 u32 field_datum_byte_offset);
101 89
102void 90void
103acpi_ex_get_buffer_datum( 91acpi_ex_get_buffer_datum(acpi_integer * datum,
104 acpi_integer *datum, 92 void *buffer,
105 void *buffer, 93 u32 buffer_length,
106 u32 buffer_length, 94 u32 byte_granularity, u32 buffer_offset);
107 u32 byte_granularity,
108 u32 buffer_offset);
109 95
110void 96void
111acpi_ex_set_buffer_datum ( 97acpi_ex_set_buffer_datum(acpi_integer merged_datum,
112 acpi_integer merged_datum, 98 void *buffer,
113 void *buffer, 99 u32 buffer_length,
114 u32 buffer_length, 100 u32 byte_granularity, u32 buffer_offset);
115 u32 byte_granularity,
116 u32 buffer_offset);
117 101
118acpi_status 102acpi_status
119acpi_ex_read_data_from_field ( 103acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state,
120 struct acpi_walk_state *walk_state, 104 union acpi_operand_object *obj_desc,
121 union acpi_operand_object *obj_desc, 105 union acpi_operand_object **ret_buffer_desc);
122 union acpi_operand_object **ret_buffer_desc);
123 106
124acpi_status 107acpi_status
125acpi_ex_write_data_to_field ( 108acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
126 union acpi_operand_object *source_desc, 109 union acpi_operand_object *obj_desc,
127 union acpi_operand_object *obj_desc, 110 union acpi_operand_object **result_desc);
128 union acpi_operand_object **result_desc);
129
130 111
131/* 112/*
132 * exfldio - low level field I/O 113 * exfldio - low level field I/O
133 */ 114 */
134acpi_status 115acpi_status
135acpi_ex_extract_from_field ( 116acpi_ex_extract_from_field(union acpi_operand_object *obj_desc,
136 union acpi_operand_object *obj_desc, 117 void *buffer, u32 buffer_length);
137 void *buffer,
138 u32 buffer_length);
139 118
140acpi_status 119acpi_status
141acpi_ex_insert_into_field ( 120acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
142 union acpi_operand_object *obj_desc, 121 void *buffer, u32 buffer_length);
143 void *buffer,
144 u32 buffer_length);
145 122
146acpi_status 123acpi_status
147acpi_ex_access_region ( 124acpi_ex_access_region(union acpi_operand_object *obj_desc,
148 union acpi_operand_object *obj_desc, 125 u32 field_datum_byte_offset,
149 u32 field_datum_byte_offset, 126 acpi_integer * value, u32 read_write);
150 acpi_integer *value,
151 u32 read_write);
152
153 127
154/* 128/*
155 * exmisc - misc support routines 129 * exmisc - misc support routines
156 */ 130 */
157acpi_status 131acpi_status
158acpi_ex_get_object_reference ( 132acpi_ex_get_object_reference(union acpi_operand_object *obj_desc,
159 union acpi_operand_object *obj_desc, 133 union acpi_operand_object **return_desc,
160 union acpi_operand_object **return_desc, 134 struct acpi_walk_state *walk_state);
161 struct acpi_walk_state *walk_state);
162 135
163acpi_status 136acpi_status
164acpi_ex_concat_template ( 137acpi_ex_concat_template(union acpi_operand_object *obj_desc,
165 union acpi_operand_object *obj_desc, 138 union acpi_operand_object *obj_desc2,
166 union acpi_operand_object *obj_desc2, 139 union acpi_operand_object **actual_return_desc,
167 union acpi_operand_object **actual_return_desc, 140 struct acpi_walk_state *walk_state);
168 struct acpi_walk_state *walk_state);
169 141
170acpi_status 142acpi_status
171acpi_ex_do_concatenate ( 143acpi_ex_do_concatenate(union acpi_operand_object *obj_desc,
172 union acpi_operand_object *obj_desc, 144 union acpi_operand_object *obj_desc2,
173 union acpi_operand_object *obj_desc2, 145 union acpi_operand_object **actual_return_desc,
174 union acpi_operand_object **actual_return_desc, 146 struct acpi_walk_state *walk_state);
175 struct acpi_walk_state *walk_state);
176 147
177acpi_status 148acpi_status
178acpi_ex_do_logical_numeric_op ( 149acpi_ex_do_logical_numeric_op(u16 opcode,
179 u16 opcode, 150 acpi_integer integer0,
180 acpi_integer integer0, 151 acpi_integer integer1, u8 * logical_result);
181 acpi_integer integer1,
182 u8 *logical_result);
183 152
184acpi_status 153acpi_status
185acpi_ex_do_logical_op ( 154acpi_ex_do_logical_op(u16 opcode,
186 u16 opcode, 155 union acpi_operand_object *operand0,
187 union acpi_operand_object *operand0, 156 union acpi_operand_object *operand1, u8 * logical_result);
188 union acpi_operand_object *operand1,
189 u8 *logical_result);
190 157
191acpi_integer 158acpi_integer
192acpi_ex_do_math_op ( 159acpi_ex_do_math_op(u16 opcode, acpi_integer operand0, acpi_integer operand1);
193 u16 opcode,
194 acpi_integer operand0,
195 acpi_integer operand1);
196 160
197acpi_status 161acpi_status acpi_ex_create_mutex(struct acpi_walk_state *walk_state);
198acpi_ex_create_mutex (
199 struct acpi_walk_state *walk_state);
200 162
201acpi_status 163acpi_status acpi_ex_create_processor(struct acpi_walk_state *walk_state);
202acpi_ex_create_processor (
203 struct acpi_walk_state *walk_state);
204 164
205acpi_status 165acpi_status acpi_ex_create_power_resource(struct acpi_walk_state *walk_state);
206acpi_ex_create_power_resource (
207 struct acpi_walk_state *walk_state);
208 166
209acpi_status 167acpi_status
210acpi_ex_create_region ( 168acpi_ex_create_region(u8 * aml_start,
211 u8 *aml_start, 169 u32 aml_length,
212 u32 aml_length, 170 u8 region_space, struct acpi_walk_state *walk_state);
213 u8 region_space,
214 struct acpi_walk_state *walk_state);
215 171
216acpi_status 172acpi_status acpi_ex_create_table_region(struct acpi_walk_state *walk_state);
217acpi_ex_create_table_region (
218 struct acpi_walk_state *walk_state);
219 173
220acpi_status 174acpi_status acpi_ex_create_event(struct acpi_walk_state *walk_state);
221acpi_ex_create_event (
222 struct acpi_walk_state *walk_state);
223 175
224acpi_status 176acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state);
225acpi_ex_create_alias (
226 struct acpi_walk_state *walk_state);
227 177
228acpi_status 178acpi_status
229acpi_ex_create_method ( 179acpi_ex_create_method(u8 * aml_start,
230 u8 *aml_start, 180 u32 aml_length, struct acpi_walk_state *walk_state);
231 u32 aml_length,
232 struct acpi_walk_state *walk_state);
233
234 181
235/* 182/*
236 * exconfig - dynamic table load/unload 183 * exconfig - dynamic table load/unload
237 */ 184 */
238acpi_status 185acpi_status
239acpi_ex_load_op ( 186acpi_ex_load_op(union acpi_operand_object *obj_desc,
240 union acpi_operand_object *obj_desc, 187 union acpi_operand_object *target,
241 union acpi_operand_object *target, 188 struct acpi_walk_state *walk_state);
242 struct acpi_walk_state *walk_state);
243 189
244acpi_status 190acpi_status
245acpi_ex_load_table_op ( 191acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
246 struct acpi_walk_state *walk_state, 192 union acpi_operand_object **return_desc);
247 union acpi_operand_object **return_desc);
248
249acpi_status
250acpi_ex_unload_table (
251 union acpi_operand_object *ddb_handle);
252 193
194acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle);
253 195
254/* 196/*
255 * exmutex - mutex support 197 * exmutex - mutex support
256 */ 198 */
257acpi_status 199acpi_status
258acpi_ex_acquire_mutex ( 200acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
259 union acpi_operand_object *time_desc, 201 union acpi_operand_object *obj_desc,
260 union acpi_operand_object *obj_desc, 202 struct acpi_walk_state *walk_state);
261 struct acpi_walk_state *walk_state);
262 203
263acpi_status 204acpi_status
264acpi_ex_release_mutex ( 205acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
265 union acpi_operand_object *obj_desc, 206 struct acpi_walk_state *walk_state);
266 struct acpi_walk_state *walk_state);
267 207
268void 208void acpi_ex_release_all_mutexes(struct acpi_thread_state *thread);
269acpi_ex_release_all_mutexes (
270 struct acpi_thread_state *thread);
271
272void
273acpi_ex_unlink_mutex (
274 union acpi_operand_object *obj_desc);
275 209
210void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc);
276 211
277/* 212/*
278 * exprep - ACPI AML execution - prep utilities 213 * exprep - ACPI AML execution - prep utilities
279 */ 214 */
280acpi_status 215acpi_status
281acpi_ex_prep_common_field_object ( 216acpi_ex_prep_common_field_object(union acpi_operand_object *obj_desc,
282 union acpi_operand_object *obj_desc, 217 u8 field_flags,
283 u8 field_flags, 218 u8 field_attribute,
284 u8 field_attribute, 219 u32 field_bit_position, u32 field_bit_length);
285 u32 field_bit_position,
286 u32 field_bit_length);
287
288acpi_status
289acpi_ex_prep_field_value (
290 struct acpi_create_field_info *info);
291 220
221acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info);
292 222
293/* 223/*
294 * exsystem - Interface to OS services 224 * exsystem - Interface to OS services
295 */ 225 */
296acpi_status 226acpi_status
297acpi_ex_system_do_notify_op ( 227acpi_ex_system_do_notify_op(union acpi_operand_object *value,
298 union acpi_operand_object *value, 228 union acpi_operand_object *obj_desc);
299 union acpi_operand_object *obj_desc);
300 229
301acpi_status 230acpi_status acpi_ex_system_do_suspend(acpi_integer time);
302acpi_ex_system_do_suspend(
303 acpi_integer time);
304 231
305acpi_status 232acpi_status acpi_ex_system_do_stall(u32 time);
306acpi_ex_system_do_stall (
307 u32 time);
308 233
309acpi_status 234acpi_status
310acpi_ex_system_acquire_mutex( 235acpi_ex_system_acquire_mutex(union acpi_operand_object *time,
311 union acpi_operand_object *time, 236 union acpi_operand_object *obj_desc);
312 union acpi_operand_object *obj_desc);
313 237
314acpi_status 238acpi_status acpi_ex_system_release_mutex(union acpi_operand_object *obj_desc);
315acpi_ex_system_release_mutex(
316 union acpi_operand_object *obj_desc);
317 239
318acpi_status 240acpi_status acpi_ex_system_signal_event(union acpi_operand_object *obj_desc);
319acpi_ex_system_signal_event(
320 union acpi_operand_object *obj_desc);
321 241
322acpi_status 242acpi_status
323acpi_ex_system_wait_event( 243acpi_ex_system_wait_event(union acpi_operand_object *time,
324 union acpi_operand_object *time, 244 union acpi_operand_object *obj_desc);
325 union acpi_operand_object *obj_desc);
326 245
327acpi_status 246acpi_status acpi_ex_system_reset_event(union acpi_operand_object *obj_desc);
328acpi_ex_system_reset_event(
329 union acpi_operand_object *obj_desc);
330
331acpi_status
332acpi_ex_system_wait_semaphore (
333 acpi_handle semaphore,
334 u16 timeout);
335 247
248acpi_status acpi_ex_system_wait_semaphore(acpi_handle semaphore, u16 timeout);
336 249
337/* 250/*
338 * exoparg1 - ACPI AML execution, 1 operand 251 * exoparg1 - ACPI AML execution, 1 operand
339 */ 252 */
340acpi_status 253acpi_status acpi_ex_opcode_0A_0T_1R(struct acpi_walk_state *walk_state);
341acpi_ex_opcode_0A_0T_1R (
342 struct acpi_walk_state *walk_state);
343 254
344acpi_status 255acpi_status acpi_ex_opcode_1A_0T_0R(struct acpi_walk_state *walk_state);
345acpi_ex_opcode_1A_0T_0R (
346 struct acpi_walk_state *walk_state);
347 256
348acpi_status 257acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state);
349acpi_ex_opcode_1A_0T_1R (
350 struct acpi_walk_state *walk_state);
351 258
352acpi_status 259acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state);
353acpi_ex_opcode_1A_1T_1R (
354 struct acpi_walk_state *walk_state);
355 260
356acpi_status 261acpi_status acpi_ex_opcode_1A_1T_0R(struct acpi_walk_state *walk_state);
357acpi_ex_opcode_1A_1T_0R (
358 struct acpi_walk_state *walk_state);
359 262
360/* 263/*
361 * exoparg2 - ACPI AML execution, 2 operands 264 * exoparg2 - ACPI AML execution, 2 operands
362 */ 265 */
363acpi_status 266acpi_status acpi_ex_opcode_2A_0T_0R(struct acpi_walk_state *walk_state);
364acpi_ex_opcode_2A_0T_0R (
365 struct acpi_walk_state *walk_state);
366 267
367acpi_status 268acpi_status acpi_ex_opcode_2A_0T_1R(struct acpi_walk_state *walk_state);
368acpi_ex_opcode_2A_0T_1R (
369 struct acpi_walk_state *walk_state);
370 269
371acpi_status 270acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state);
372acpi_ex_opcode_2A_1T_1R (
373 struct acpi_walk_state *walk_state);
374
375acpi_status
376acpi_ex_opcode_2A_2T_1R (
377 struct acpi_walk_state *walk_state);
378 271
272acpi_status acpi_ex_opcode_2A_2T_1R(struct acpi_walk_state *walk_state);
379 273
380/* 274/*
381 * exoparg3 - ACPI AML execution, 3 operands 275 * exoparg3 - ACPI AML execution, 3 operands
382 */ 276 */
383acpi_status 277acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state);
384acpi_ex_opcode_3A_0T_0R (
385 struct acpi_walk_state *walk_state);
386
387acpi_status
388acpi_ex_opcode_3A_1T_1R (
389 struct acpi_walk_state *walk_state);
390 278
279acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state);
391 280
392/* 281/*
393 * exoparg6 - ACPI AML execution, 6 operands 282 * exoparg6 - ACPI AML execution, 6 operands
394 */ 283 */
395acpi_status 284acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state *walk_state);
396acpi_ex_opcode_6A_0T_1R (
397 struct acpi_walk_state *walk_state);
398
399 285
400/* 286/*
401 * exresolv - Object resolution and get value functions 287 * exresolv - Object resolution and get value functions
402 */ 288 */
403acpi_status 289acpi_status
404acpi_ex_resolve_to_value ( 290acpi_ex_resolve_to_value(union acpi_operand_object **stack_ptr,
405 union acpi_operand_object **stack_ptr, 291 struct acpi_walk_state *walk_state);
406 struct acpi_walk_state *walk_state);
407 292
408acpi_status 293acpi_status
409acpi_ex_resolve_multiple ( 294acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
410 struct acpi_walk_state *walk_state, 295 union acpi_operand_object *operand,
411 union acpi_operand_object *operand, 296 acpi_object_type * return_type,
412 acpi_object_type *return_type, 297 union acpi_operand_object **return_desc);
413 union acpi_operand_object **return_desc);
414
415 298
416/* 299/*
417 * exresnte - resolve namespace node 300 * exresnte - resolve namespace node
418 */ 301 */
419acpi_status 302acpi_status
420acpi_ex_resolve_node_to_value ( 303acpi_ex_resolve_node_to_value(struct acpi_namespace_node **stack_ptr,
421 struct acpi_namespace_node **stack_ptr, 304 struct acpi_walk_state *walk_state);
422 struct acpi_walk_state *walk_state);
423
424 305
425/* 306/*
426 * exresop - resolve operand to value 307 * exresop - resolve operand to value
427 */ 308 */
428acpi_status 309acpi_status
429acpi_ex_resolve_operands ( 310acpi_ex_resolve_operands(u16 opcode,
430 u16 opcode, 311 union acpi_operand_object **stack_ptr,
431 union acpi_operand_object **stack_ptr, 312 struct acpi_walk_state *walk_state);
432 struct acpi_walk_state *walk_state);
433
434 313
435/* 314/*
436 * exdump - Interpreter debug output routines 315 * exdump - Interpreter debug output routines
437 */ 316 */
438void 317void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth);
439acpi_ex_dump_operand (
440 union acpi_operand_object *obj_desc,
441 u32 depth);
442 318
443void 319void
444acpi_ex_dump_operands ( 320acpi_ex_dump_operands(union acpi_operand_object **operands,
445 union acpi_operand_object **operands, 321 acpi_interpreter_mode interpreter_mode,
446 acpi_interpreter_mode interpreter_mode, 322 char *ident,
447 char *ident, 323 u32 num_levels,
448 u32 num_levels, 324 char *note, char *module_name, u32 line_number);
449 char *note,
450 char *module_name,
451 u32 line_number);
452 325
453#ifdef ACPI_FUTURE_USAGE 326#ifdef ACPI_FUTURE_USAGE
454void 327void
455acpi_ex_dump_object_descriptor ( 328acpi_ex_dump_object_descriptor(union acpi_operand_object *object, u32 flags);
456 union acpi_operand_object *object,
457 u32 flags);
458
459void
460acpi_ex_dump_node (
461 struct acpi_namespace_node *node,
462 u32 flags);
463#endif /* ACPI_FUTURE_USAGE */
464 329
330void acpi_ex_dump_node(struct acpi_namespace_node *node, u32 flags);
331#endif /* ACPI_FUTURE_USAGE */
465 332
466/* 333/*
467 * exnames - AML namestring support 334 * exnames - AML namestring support
468 */ 335 */
469acpi_status 336acpi_status
470acpi_ex_get_name_string ( 337acpi_ex_get_name_string(acpi_object_type data_type,
471 acpi_object_type data_type, 338 u8 * in_aml_address,
472 u8 *in_aml_address, 339 char **out_name_string, u32 * out_name_length);
473 char **out_name_string,
474 u32 *out_name_length);
475
476 340
477/* 341/*
478 * exstore - Object store support 342 * exstore - Object store support
479 */ 343 */
480acpi_status 344acpi_status
481acpi_ex_store ( 345acpi_ex_store(union acpi_operand_object *val_desc,
482 union acpi_operand_object *val_desc, 346 union acpi_operand_object *dest_desc,
483 union acpi_operand_object *dest_desc, 347 struct acpi_walk_state *walk_state);
484 struct acpi_walk_state *walk_state);
485 348
486acpi_status 349acpi_status
487acpi_ex_store_object_to_node ( 350acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
488 union acpi_operand_object *source_desc, 351 struct acpi_namespace_node *node,
489 struct acpi_namespace_node *node, 352 struct acpi_walk_state *walk_state,
490 struct acpi_walk_state *walk_state, 353 u8 implicit_conversion);
491 u8 implicit_conversion);
492 354
493#define ACPI_IMPLICIT_CONVERSION TRUE 355#define ACPI_IMPLICIT_CONVERSION TRUE
494#define ACPI_NO_IMPLICIT_CONVERSION FALSE 356#define ACPI_NO_IMPLICIT_CONVERSION FALSE
495 357
496
497/* 358/*
498 * exstoren - resolve/store object 359 * exstoren - resolve/store object
499 */ 360 */
500acpi_status 361acpi_status
501acpi_ex_resolve_object ( 362acpi_ex_resolve_object(union acpi_operand_object **source_desc_ptr,
502 union acpi_operand_object **source_desc_ptr, 363 acpi_object_type target_type,
503 acpi_object_type target_type, 364 struct acpi_walk_state *walk_state);
504 struct acpi_walk_state *walk_state);
505 365
506acpi_status 366acpi_status
507acpi_ex_store_object_to_object ( 367acpi_ex_store_object_to_object(union acpi_operand_object *source_desc,
508 union acpi_operand_object *source_desc, 368 union acpi_operand_object *dest_desc,
509 union acpi_operand_object *dest_desc, 369 union acpi_operand_object **new_desc,
510 union acpi_operand_object **new_desc, 370 struct acpi_walk_state *walk_state);
511 struct acpi_walk_state *walk_state);
512
513 371
514/* 372/*
515 * exstorob - store object - buffer/string 373 * exstorob - store object - buffer/string
516 */ 374 */
517acpi_status 375acpi_status
518acpi_ex_store_buffer_to_buffer ( 376acpi_ex_store_buffer_to_buffer(union acpi_operand_object *source_desc,
519 union acpi_operand_object *source_desc, 377 union acpi_operand_object *target_desc);
520 union acpi_operand_object *target_desc);
521 378
522acpi_status 379acpi_status
523acpi_ex_store_string_to_string ( 380acpi_ex_store_string_to_string(union acpi_operand_object *source_desc,
524 union acpi_operand_object *source_desc, 381 union acpi_operand_object *target_desc);
525 union acpi_operand_object *target_desc);
526
527 382
528/* 383/*
529 * excopy - object copy 384 * excopy - object copy
530 */ 385 */
531acpi_status 386acpi_status
532acpi_ex_copy_integer_to_index_field ( 387acpi_ex_copy_integer_to_index_field(union acpi_operand_object *source_desc,
533 union acpi_operand_object *source_desc, 388 union acpi_operand_object *target_desc);
534 union acpi_operand_object *target_desc);
535 389
536acpi_status 390acpi_status
537acpi_ex_copy_integer_to_bank_field ( 391acpi_ex_copy_integer_to_bank_field(union acpi_operand_object *source_desc,
538 union acpi_operand_object *source_desc, 392 union acpi_operand_object *target_desc);
539 union acpi_operand_object *target_desc);
540 393
541acpi_status 394acpi_status
542acpi_ex_copy_data_to_named_field ( 395acpi_ex_copy_data_to_named_field(union acpi_operand_object *source_desc,
543 union acpi_operand_object *source_desc, 396 struct acpi_namespace_node *node);
544 struct acpi_namespace_node *node);
545 397
546acpi_status 398acpi_status
547acpi_ex_copy_integer_to_buffer_field ( 399acpi_ex_copy_integer_to_buffer_field(union acpi_operand_object *source_desc,
548 union acpi_operand_object *source_desc, 400 union acpi_operand_object *target_desc);
549 union acpi_operand_object *target_desc);
550
551 401
552/* 402/*
553 * exutils - interpreter/scanner utilities 403 * exutils - interpreter/scanner utilities
554 */ 404 */
555acpi_status 405acpi_status acpi_ex_enter_interpreter(void);
556acpi_ex_enter_interpreter (
557 void);
558 406
559void 407void acpi_ex_exit_interpreter(void);
560acpi_ex_exit_interpreter (
561 void);
562 408
563void 409void acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc);
564acpi_ex_truncate_for32bit_table (
565 union acpi_operand_object *obj_desc);
566 410
567u8 411u8 acpi_ex_acquire_global_lock(u32 rule);
568acpi_ex_acquire_global_lock (
569 u32 rule);
570 412
571void 413void acpi_ex_release_global_lock(u8 locked);
572acpi_ex_release_global_lock (
573 u8 locked);
574 414
575void 415void acpi_ex_eisa_id_to_string(u32 numeric_id, char *out_string);
576acpi_ex_eisa_id_to_string (
577 u32 numeric_id,
578 char *out_string);
579
580void
581acpi_ex_unsigned_integer_to_string (
582 acpi_integer value,
583 char *out_string);
584 416
417void acpi_ex_unsigned_integer_to_string(acpi_integer value, char *out_string);
585 418
586/* 419/*
587 * exregion - default op_region handlers 420 * exregion - default op_region handlers
588 */ 421 */
589acpi_status 422acpi_status
590acpi_ex_system_memory_space_handler ( 423acpi_ex_system_memory_space_handler(u32 function,
591 u32 function, 424 acpi_physical_address address,
592 acpi_physical_address address, 425 u32 bit_width,
593 u32 bit_width, 426 acpi_integer * value,
594 acpi_integer *value, 427 void *handler_context,
595 void *handler_context, 428 void *region_context);
596 void *region_context); 429
597 430acpi_status
598acpi_status 431acpi_ex_system_io_space_handler(u32 function,
599acpi_ex_system_io_space_handler ( 432 acpi_physical_address address,
600 u32 function, 433 u32 bit_width,
601 acpi_physical_address address, 434 acpi_integer * value,
602 u32 bit_width, 435 void *handler_context, void *region_context);
603 acpi_integer *value, 436
604 void *handler_context, 437acpi_status
605 void *region_context); 438acpi_ex_pci_config_space_handler(u32 function,
606 439 acpi_physical_address address,
607acpi_status 440 u32 bit_width,
608acpi_ex_pci_config_space_handler ( 441 acpi_integer * value,
609 u32 function, 442 void *handler_context, void *region_context);
610 acpi_physical_address address, 443
611 u32 bit_width, 444acpi_status
612 acpi_integer *value, 445acpi_ex_cmos_space_handler(u32 function,
613 void *handler_context, 446 acpi_physical_address address,
614 void *region_context); 447 u32 bit_width,
615 448 acpi_integer * value,
616acpi_status 449 void *handler_context, void *region_context);
617acpi_ex_cmos_space_handler ( 450
618 u32 function, 451acpi_status
619 acpi_physical_address address, 452acpi_ex_pci_bar_space_handler(u32 function,
620 u32 bit_width, 453 acpi_physical_address address,
621 acpi_integer *value, 454 u32 bit_width,
622 void *handler_context, 455 acpi_integer * value,
623 void *region_context); 456 void *handler_context, void *region_context);
624 457
625acpi_status 458acpi_status
626acpi_ex_pci_bar_space_handler ( 459acpi_ex_embedded_controller_space_handler(u32 function,
627 u32 function, 460 acpi_physical_address address,
628 acpi_physical_address address, 461 u32 bit_width,
629 u32 bit_width, 462 acpi_integer * value,
630 acpi_integer *value, 463 void *handler_context,
631 void *handler_context, 464 void *region_context);
632 void *region_context); 465
633 466acpi_status
634acpi_status 467acpi_ex_sm_bus_space_handler(u32 function,
635acpi_ex_embedded_controller_space_handler ( 468 acpi_physical_address address,
636 u32 function, 469 u32 bit_width,
637 acpi_physical_address address, 470 acpi_integer * value,
638 u32 bit_width, 471 void *handler_context, void *region_context);
639 acpi_integer *value, 472
640 void *handler_context, 473acpi_status
641 void *region_context); 474acpi_ex_data_table_space_handler(u32 function,
642 475 acpi_physical_address address,
643acpi_status 476 u32 bit_width,
644acpi_ex_sm_bus_space_handler ( 477 acpi_integer * value,
645 u32 function, 478 void *handler_context, void *region_context);
646 acpi_physical_address address, 479
647 u32 bit_width, 480#endif /* __INTERP_H__ */
648 acpi_integer *value,
649 void *handler_context,
650 void *region_context);
651
652
653acpi_status
654acpi_ex_data_table_space_handler (
655 u32 function,
656 acpi_physical_address address,
657 u32 bit_width,
658 acpi_integer *value,
659 void *handler_context,
660 void *region_context);
661
662#endif /* __INTERP_H__ */
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 030e641115cb..9fba0fddda90 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -44,17 +44,20 @@
44#ifndef __ACLOCAL_H__ 44#ifndef __ACLOCAL_H__
45#define __ACLOCAL_H__ 45#define __ACLOCAL_H__
46 46
47#define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */
47 48
48#define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */ 49typedef void *acpi_mutex;
49 50typedef u32 acpi_mutex_handle;
50typedef void * acpi_mutex;
51typedef u32 acpi_mutex_handle;
52
53 51
54/* Total number of aml opcodes defined */ 52/* Total number of aml opcodes defined */
55 53
56#define AML_NUM_OPCODES 0x7F 54#define AML_NUM_OPCODES 0x7F
57 55
56/* Forward declarations */
57
58struct acpi_walk_state;
59struct acpi_obj_mutex;
60union acpi_parse_object;
58 61
59/***************************************************************************** 62/*****************************************************************************
60 * 63 *
@@ -62,7 +65,6 @@ typedef u32 acpi_mutex_handle;
62 * 65 *
63 ****************************************************************************/ 66 ****************************************************************************/
64 67
65
66/* 68/*
67 * Predefined handles for the mutex objects used within the subsystem 69 * Predefined handles for the mutex objects used within the subsystem
68 * All mutex objects are automatically created by acpi_ut_mutex_initialize. 70 * All mutex objects are automatically created by acpi_ut_mutex_initialize.
@@ -89,14 +91,12 @@ typedef u32 acpi_mutex_handle;
89#define MAX_MUTEX 12 91#define MAX_MUTEX 12
90#define NUM_MUTEX MAX_MUTEX+1 92#define NUM_MUTEX MAX_MUTEX+1
91 93
92
93#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 94#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
94#ifdef DEFINE_ACPI_GLOBALS 95#ifdef DEFINE_ACPI_GLOBALS
95 96
96/* Names for the mutexes used in the subsystem */ 97/* Names for the mutexes used in the subsystem */
97 98
98static char *acpi_gbl_mutex_names[] = 99static char *acpi_gbl_mutex_names[] = {
99{
100 "ACPI_MTX_Execute", 100 "ACPI_MTX_Execute",
101 "ACPI_MTX_Interpreter", 101 "ACPI_MTX_Interpreter",
102 "ACPI_MTX_Parser", 102 "ACPI_MTX_Parser",
@@ -115,34 +115,28 @@ static char *acpi_gbl_mutex_names[] =
115#endif 115#endif
116#endif 116#endif
117 117
118/* Owner IDs are used to track namespace nodes for selective deletion */
118 119
119/* Table for the global mutexes */ 120typedef u8 acpi_owner_id;
121#define ACPI_OWNER_ID_MAX 0xFF
120 122
121struct acpi_mutex_info 123/* This Thread ID means that the mutex is not in use (unlocked) */
122{
123 acpi_mutex mutex;
124 u32 use_count;
125 u32 owner_id;
126};
127 124
128/* This owner ID means that the mutex is not in use (unlocked) */ 125#define ACPI_MUTEX_NOT_ACQUIRED (u32) -1
129 126
130#define ACPI_MUTEX_NOT_ACQUIRED (u32) (-1) 127/* Table for the global mutexes */
131 128
129struct acpi_mutex_info {
130 acpi_mutex mutex;
131 u32 use_count;
132 u32 thread_id;
133};
132 134
133/* Lock flag parameter for various interfaces */ 135/* Lock flag parameter for various interfaces */
134 136
135#define ACPI_MTX_DO_NOT_LOCK 0 137#define ACPI_MTX_DO_NOT_LOCK 0
136#define ACPI_MTX_LOCK 1 138#define ACPI_MTX_LOCK 1
137 139
138
139typedef u16 acpi_owner_id;
140#define ACPI_OWNER_TYPE_TABLE 0x0
141#define ACPI_OWNER_TYPE_METHOD 0x1
142#define ACPI_FIRST_METHOD_ID 0x0001
143#define ACPI_FIRST_TABLE_ID 0xF000
144
145
146/* Field access granularities */ 140/* Field access granularities */
147 141
148#define ACPI_FIELD_BYTE_GRANULARITY 1 142#define ACPI_FIELD_BYTE_GRANULARITY 1
@@ -150,7 +144,6 @@ typedef u16 acpi_owner_id;
150#define ACPI_FIELD_DWORD_GRANULARITY 4 144#define ACPI_FIELD_DWORD_GRANULARITY 4
151#define ACPI_FIELD_QWORD_GRANULARITY 8 145#define ACPI_FIELD_QWORD_GRANULARITY 8
152 146
153
154/***************************************************************************** 147/*****************************************************************************
155 * 148 *
156 * Namespace typedefs and structs 149 * Namespace typedefs and structs
@@ -159,15 +152,12 @@ typedef u16 acpi_owner_id;
159 152
160/* Operational modes of the AML interpreter/scanner */ 153/* Operational modes of the AML interpreter/scanner */
161 154
162typedef enum 155typedef enum {
163{ 156 ACPI_IMODE_LOAD_PASS1 = 0x01,
164 ACPI_IMODE_LOAD_PASS1 = 0x01, 157 ACPI_IMODE_LOAD_PASS2 = 0x02,
165 ACPI_IMODE_LOAD_PASS2 = 0x02, 158 ACPI_IMODE_EXECUTE = 0x0E
166 ACPI_IMODE_EXECUTE = 0x0E
167
168} acpi_interpreter_mode; 159} acpi_interpreter_mode;
169 160
170
171/* 161/*
172 * The Node describes a named object that appears in the AML 162 * The Node describes a named object that appears in the AML
173 * An acpi_node is used to store Nodes. 163 * An acpi_node is used to store Nodes.
@@ -175,34 +165,37 @@ typedef enum
175 * data_type is used to differentiate between internal descriptors, and MUST 165 * data_type is used to differentiate between internal descriptors, and MUST
176 * be the first byte in this structure. 166 * be the first byte in this structure.
177 */ 167 */
178union acpi_name_union 168union acpi_name_union {
179{ 169 u32 integer;
180 u32 integer; 170 char ascii[4];
181 char ascii[4]; 171};
182}; 172
183 173struct acpi_namespace_node {
184struct acpi_namespace_node 174 u8 descriptor; /* Used to differentiate object descriptor types */
185{ 175 u8 type; /* Type associated with this name */
186 u8 descriptor; /* Used to differentiate object descriptor types */ 176 u16 reference_count; /* Current count of references and children */
187 u8 type; /* Type associated with this name */ 177 union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */
188 u16 owner_id; 178 union acpi_operand_object *object; /* Pointer to attached ACPI object (optional) */
189 union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */ 179 struct acpi_namespace_node *child; /* First child */
190 union acpi_operand_object *object; /* Pointer to attached ACPI object (optional) */ 180 struct acpi_namespace_node *peer; /* Next peer */
191 struct acpi_namespace_node *child; /* First child */ 181 u8 owner_id; /* Who created this node */
192 struct acpi_namespace_node *peer; /* Next peer*/ 182 u8 flags;
193 u16 reference_count; /* Current count of references and children */ 183
194 u8 flags; 184 /* Fields used by the ASL compiler only */
185
186#ifdef ACPI_ASL_COMPILER
187 u32 value;
188 union acpi_parse_object *op;
189#endif
195}; 190};
196 191
197
198#define ACPI_ENTRY_NOT_FOUND NULL 192#define ACPI_ENTRY_NOT_FOUND NULL
199 193
200
201/* Node flags */ 194/* Node flags */
202 195
203#define ANOBJ_RESERVED 0x01 196#define ANOBJ_RESERVED 0x01
204#define ANOBJ_END_OF_PEER_LIST 0x02 197#define ANOBJ_END_OF_PEER_LIST 0x02
205#define ANOBJ_DATA_WIDTH_32 0x04 /* Parent table is 64-bits */ 198#define ANOBJ_DATA_WIDTH_32 0x04 /* Parent table is 64-bits */
206#define ANOBJ_METHOD_ARG 0x08 199#define ANOBJ_METHOD_ARG 0x08
207#define ANOBJ_METHOD_LOCAL 0x10 200#define ANOBJ_METHOD_LOCAL 0x10
208#define ANOBJ_METHOD_NO_RETVAL 0x20 201#define ANOBJ_METHOD_NO_RETVAL 0x20
@@ -212,91 +205,77 @@ struct acpi_namespace_node
212/* 205/*
213 * ACPI Table Descriptor. One per ACPI table 206 * ACPI Table Descriptor. One per ACPI table
214 */ 207 */
215struct acpi_table_desc 208struct acpi_table_desc {
216{ 209 struct acpi_table_desc *prev;
217 struct acpi_table_desc *prev; 210 struct acpi_table_desc *next;
218 struct acpi_table_desc *next; 211 struct acpi_table_desc *installed_desc;
219 struct acpi_table_desc *installed_desc; 212 struct acpi_table_header *pointer;
220 struct acpi_table_header *pointer; 213 u8 *aml_start;
221 u8 *aml_start; 214 u64 physical_address;
222 u64 physical_address; 215 u32 aml_length;
223 u32 aml_length; 216 acpi_size length;
224 acpi_size length; 217 acpi_owner_id owner_id;
225 acpi_owner_id table_id; 218 u8 type;
226 u8 type; 219 u8 allocation;
227 u8 allocation; 220 u8 loaded_into_namespace;
228 u8 loaded_into_namespace;
229}; 221};
230 222
231struct acpi_table_list 223struct acpi_table_list {
232{ 224 struct acpi_table_desc *next;
233 struct acpi_table_desc *next; 225 u32 count;
234 u32 count;
235}; 226};
236 227
237 228struct acpi_find_context {
238struct acpi_find_context 229 char *search_for;
239{ 230 acpi_handle *list;
240 char *search_for; 231 u32 *count;
241 acpi_handle *list;
242 u32 *count;
243}; 232};
244 233
245 234struct acpi_ns_search_data {
246struct acpi_ns_search_data 235 struct acpi_namespace_node *node;
247{
248 struct acpi_namespace_node *node;
249}; 236};
250 237
251
252/* 238/*
253 * Predefined Namespace items 239 * Predefined Namespace items
254 */ 240 */
255struct acpi_predefined_names 241struct acpi_predefined_names {
256{ 242 char *name;
257 char *name; 243 u8 type;
258 u8 type; 244 char *val;
259 char *val;
260}; 245};
261 246
262
263/* Object types used during package copies */ 247/* Object types used during package copies */
264 248
265
266#define ACPI_COPY_TYPE_SIMPLE 0 249#define ACPI_COPY_TYPE_SIMPLE 0
267#define ACPI_COPY_TYPE_PACKAGE 1 250#define ACPI_COPY_TYPE_PACKAGE 1
268 251
269/* Info structure used to convert external<->internal namestrings */ 252/* Info structure used to convert external<->internal namestrings */
270 253
271struct acpi_namestring_info 254struct acpi_namestring_info {
272{ 255 char *external_name;
273 char *external_name; 256 char *next_external_char;
274 char *next_external_char; 257 char *internal_name;
275 char *internal_name; 258 u32 length;
276 u32 length; 259 u32 num_segments;
277 u32 num_segments; 260 u32 num_carats;
278 u32 num_carats; 261 u8 fully_qualified;
279 u8 fully_qualified;
280}; 262};
281 263
282
283/* Field creation info */ 264/* Field creation info */
284 265
285struct acpi_create_field_info 266struct acpi_create_field_info {
286{ 267 struct acpi_namespace_node *region_node;
287 struct acpi_namespace_node *region_node; 268 struct acpi_namespace_node *field_node;
288 struct acpi_namespace_node *field_node; 269 struct acpi_namespace_node *register_node;
289 struct acpi_namespace_node *register_node; 270 struct acpi_namespace_node *data_register_node;
290 struct acpi_namespace_node *data_register_node; 271 u32 bank_value;
291 u32 bank_value; 272 u32 field_bit_position;
292 u32 field_bit_position; 273 u32 field_bit_length;
293 u32 field_bit_length; 274 u8 field_flags;
294 u8 field_flags; 275 u8 attribute;
295 u8 attribute; 276 u8 field_type;
296 u8 field_type;
297}; 277};
298 278
299
300/***************************************************************************** 279/*****************************************************************************
301 * 280 *
302 * Event typedefs and structs 281 * Event typedefs and structs
@@ -305,108 +284,95 @@ struct acpi_create_field_info
305 284
306/* Dispatch info for each GPE -- either a method or handler, cannot be both */ 285/* Dispatch info for each GPE -- either a method or handler, cannot be both */
307 286
308struct acpi_handler_info 287struct acpi_handler_info {
309{ 288 acpi_event_handler address; /* Address of handler, if any */
310 acpi_event_handler address; /* Address of handler, if any */ 289 void *context; /* Context to be passed to handler */
311 void *context; /* Context to be passed to handler */ 290 struct acpi_namespace_node *method_node; /* Method node for this GPE level (saved) */
312 struct acpi_namespace_node *method_node; /* Method node for this GPE level (saved) */
313}; 291};
314 292
315union acpi_gpe_dispatch_info 293union acpi_gpe_dispatch_info {
316{ 294 struct acpi_namespace_node *method_node; /* Method node for this GPE level */
317 struct acpi_namespace_node *method_node; /* Method node for this GPE level */ 295 struct acpi_handler_info *handler;
318 struct acpi_handler_info *handler;
319}; 296};
320 297
321/* 298/*
322 * Information about a GPE, one per each GPE in an array. 299 * Information about a GPE, one per each GPE in an array.
323 * NOTE: Important to keep this struct as small as possible. 300 * NOTE: Important to keep this struct as small as possible.
324 */ 301 */
325struct acpi_gpe_event_info 302struct acpi_gpe_event_info {
326{ 303 union acpi_gpe_dispatch_info dispatch; /* Either Method or Handler */
327 union acpi_gpe_dispatch_info dispatch; /* Either Method or Handler */ 304 struct acpi_gpe_register_info *register_info; /* Backpointer to register info */
328 struct acpi_gpe_register_info *register_info; /* Backpointer to register info */ 305 u8 flags; /* Misc info about this GPE */
329 u8 flags; /* Misc info about this GPE */ 306 u8 register_bit; /* This GPE bit within the register */
330 u8 register_bit; /* This GPE bit within the register */
331}; 307};
332 308
333/* Information about a GPE register pair, one per each status/enable pair in an array */ 309/* Information about a GPE register pair, one per each status/enable pair in an array */
334 310
335struct acpi_gpe_register_info 311struct acpi_gpe_register_info {
336{ 312 struct acpi_generic_address status_address; /* Address of status reg */
337 struct acpi_generic_address status_address; /* Address of status reg */ 313 struct acpi_generic_address enable_address; /* Address of enable reg */
338 struct acpi_generic_address enable_address; /* Address of enable reg */ 314 u8 enable_for_wake; /* GPEs to keep enabled when sleeping */
339 u8 enable_for_wake; /* GPEs to keep enabled when sleeping */ 315 u8 enable_for_run; /* GPEs to keep enabled when running */
340 u8 enable_for_run; /* GPEs to keep enabled when running */ 316 u8 base_gpe_number; /* Base GPE number for this register */
341 u8 base_gpe_number; /* Base GPE number for this register */
342}; 317};
343 318
344/* 319/*
345 * Information about a GPE register block, one per each installed block -- 320 * Information about a GPE register block, one per each installed block --
346 * GPE0, GPE1, and one per each installed GPE Block Device. 321 * GPE0, GPE1, and one per each installed GPE Block Device.
347 */ 322 */
348struct acpi_gpe_block_info 323struct acpi_gpe_block_info {
349{ 324 struct acpi_namespace_node *node;
350 struct acpi_namespace_node *node; 325 struct acpi_gpe_block_info *previous;
351 struct acpi_gpe_block_info *previous; 326 struct acpi_gpe_block_info *next;
352 struct acpi_gpe_block_info *next; 327 struct acpi_gpe_xrupt_info *xrupt_block; /* Backpointer to interrupt block */
353 struct acpi_gpe_xrupt_info *xrupt_block; /* Backpointer to interrupt block */ 328 struct acpi_gpe_register_info *register_info; /* One per GPE register pair */
354 struct acpi_gpe_register_info *register_info; /* One per GPE register pair */ 329 struct acpi_gpe_event_info *event_info; /* One for each GPE */
355 struct acpi_gpe_event_info *event_info; /* One for each GPE */ 330 struct acpi_generic_address block_address; /* Base address of the block */
356 struct acpi_generic_address block_address; /* Base address of the block */ 331 u32 register_count; /* Number of register pairs in block */
357 u32 register_count; /* Number of register pairs in block */ 332 u8 block_base_number; /* Base GPE number for this block */
358 u8 block_base_number;/* Base GPE number for this block */
359}; 333};
360 334
361/* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */ 335/* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */
362 336
363struct acpi_gpe_xrupt_info 337struct acpi_gpe_xrupt_info {
364{ 338 struct acpi_gpe_xrupt_info *previous;
365 struct acpi_gpe_xrupt_info *previous; 339 struct acpi_gpe_xrupt_info *next;
366 struct acpi_gpe_xrupt_info *next; 340 struct acpi_gpe_block_info *gpe_block_list_head; /* List of GPE blocks for this xrupt */
367 struct acpi_gpe_block_info *gpe_block_list_head; /* List of GPE blocks for this xrupt */ 341 u32 interrupt_number; /* System interrupt number */
368 u32 interrupt_level; /* System interrupt level */
369}; 342};
370 343
371 344struct acpi_gpe_walk_info {
372struct acpi_gpe_walk_info 345 struct acpi_namespace_node *gpe_device;
373{ 346 struct acpi_gpe_block_info *gpe_block;
374 struct acpi_namespace_node *gpe_device;
375 struct acpi_gpe_block_info *gpe_block;
376}; 347};
377 348
378 349typedef acpi_status(*ACPI_GPE_CALLBACK) (struct acpi_gpe_xrupt_info *
379typedef acpi_status (*ACPI_GPE_CALLBACK) ( 350 gpe_xrupt_info,
380 struct acpi_gpe_xrupt_info *gpe_xrupt_info, 351 struct acpi_gpe_block_info *
381 struct acpi_gpe_block_info *gpe_block); 352 gpe_block);
382
383 353
384/* Information about each particular fixed event */ 354/* Information about each particular fixed event */
385 355
386struct acpi_fixed_event_handler 356struct acpi_fixed_event_handler {
387{ 357 acpi_event_handler handler; /* Address of handler. */
388 acpi_event_handler handler; /* Address of handler. */ 358 void *context; /* Context to be passed to handler */
389 void *context; /* Context to be passed to handler */
390}; 359};
391 360
392struct acpi_fixed_event_info 361struct acpi_fixed_event_info {
393{ 362 u8 status_register_id;
394 u8 status_register_id; 363 u8 enable_register_id;
395 u8 enable_register_id; 364 u16 status_bit_mask;
396 u16 status_bit_mask; 365 u16 enable_bit_mask;
397 u16 enable_bit_mask;
398}; 366};
399 367
400/* Information used during field processing */ 368/* Information used during field processing */
401 369
402struct acpi_field_info 370struct acpi_field_info {
403{ 371 u8 skip_field;
404 u8 skip_field; 372 u8 field_flag;
405 u8 field_flag; 373 u32 pkg_length;
406 u32 pkg_length;
407}; 374};
408 375
409
410/***************************************************************************** 376/*****************************************************************************
411 * 377 *
412 * Generic "state" object for stacks 378 * Generic "state" object for stacks
@@ -419,14 +385,6 @@ struct acpi_field_info
419#define ACPI_CONTROL_PREDICATE_FALSE 0xC3 385#define ACPI_CONTROL_PREDICATE_FALSE 0xC3
420#define ACPI_CONTROL_PREDICATE_TRUE 0xC4 386#define ACPI_CONTROL_PREDICATE_TRUE 0xC4
421 387
422
423/* Forward declarations */
424
425struct acpi_walk_state ;
426struct acpi_obj_mutex;
427union acpi_parse_object ;
428
429
430#define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\ 388#define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\
431 u8 data_type; /* To differentiate various internal objs */\ 389 u8 data_type; /* To differentiate various internal objs */\
432 u8 flags; \ 390 u8 flags; \
@@ -435,147 +393,112 @@ union acpi_parse_object ;
435 u16 reserved; \ 393 u16 reserved; \
436 void *next; \ 394 void *next; \
437 395
438struct acpi_common_state 396struct acpi_common_state {
439{ 397ACPI_STATE_COMMON};
440 ACPI_STATE_COMMON
441};
442
443 398
444/* 399/*
445 * Update state - used to traverse complex objects such as packages 400 * Update state - used to traverse complex objects such as packages
446 */ 401 */
447struct acpi_update_state 402struct acpi_update_state {
448{ 403 ACPI_STATE_COMMON union acpi_operand_object *object;
449 ACPI_STATE_COMMON
450 union acpi_operand_object *object;
451}; 404};
452 405
453
454/* 406/*
455 * Pkg state - used to traverse nested package structures 407 * Pkg state - used to traverse nested package structures
456 */ 408 */
457struct acpi_pkg_state 409struct acpi_pkg_state {
458{ 410 ACPI_STATE_COMMON union acpi_operand_object *source_object;
459 ACPI_STATE_COMMON 411 union acpi_operand_object *dest_object;
460 union acpi_operand_object *source_object; 412 struct acpi_walk_state *walk_state;
461 union acpi_operand_object *dest_object; 413 void *this_target_obj;
462 struct acpi_walk_state *walk_state; 414 u32 num_packages;
463 void *this_target_obj; 415 u16 index;
464 u32 num_packages;
465 u16 index;
466}; 416};
467 417
468
469/* 418/*
470 * Control state - one per if/else and while constructs. 419 * Control state - one per if/else and while constructs.
471 * Allows nesting of these constructs 420 * Allows nesting of these constructs
472 */ 421 */
473struct acpi_control_state 422struct acpi_control_state {
474{ 423 ACPI_STATE_COMMON union acpi_parse_object *predicate_op;
475 ACPI_STATE_COMMON 424 u8 *aml_predicate_start; /* Start of if/while predicate */
476 union acpi_parse_object *predicate_op; 425 u8 *package_end; /* End of if/while block */
477 u8 *aml_predicate_start; /* Start of if/while predicate */ 426 u16 opcode;
478 u8 *package_end; /* End of if/while block */
479 u16 opcode;
480}; 427};
481 428
482
483/* 429/*
484 * Scope state - current scope during namespace lookups 430 * Scope state - current scope during namespace lookups
485 */ 431 */
486struct acpi_scope_state 432struct acpi_scope_state {
487{ 433 ACPI_STATE_COMMON struct acpi_namespace_node *node;
488 ACPI_STATE_COMMON
489 struct acpi_namespace_node *node;
490}; 434};
491 435
492 436struct acpi_pscope_state {
493struct acpi_pscope_state 437 ACPI_STATE_COMMON union acpi_parse_object *op; /* Current op being parsed */
494{ 438 u8 *arg_end; /* Current argument end */
495 ACPI_STATE_COMMON 439 u8 *pkg_end; /* Current package end */
496 union acpi_parse_object *op; /* Current op being parsed */ 440 u32 arg_list; /* Next argument to parse */
497 u8 *arg_end; /* Current argument end */ 441 u32 arg_count; /* Number of fixed arguments */
498 u8 *pkg_end; /* Current package end */
499 u32 arg_list; /* Next argument to parse */
500 u32 arg_count; /* Number of fixed arguments */
501}; 442};
502 443
503
504/* 444/*
505 * Thread state - one per thread across multiple walk states. Multiple walk 445 * Thread state - one per thread across multiple walk states. Multiple walk
506 * states are created when there are nested control methods executing. 446 * states are created when there are nested control methods executing.
507 */ 447 */
508struct acpi_thread_state 448struct acpi_thread_state {
509{ 449 ACPI_STATE_COMMON struct acpi_walk_state *walk_state_list; /* Head of list of walk_states for this thread */
510 ACPI_STATE_COMMON 450 union acpi_operand_object *acquired_mutex_list; /* List of all currently acquired mutexes */
511 struct acpi_walk_state *walk_state_list; /* Head of list of walk_states for this thread */ 451 u32 thread_id; /* Running thread ID */
512 union acpi_operand_object *acquired_mutex_list; /* List of all currently acquired mutexes */ 452 u8 current_sync_level; /* Mutex Sync (nested acquire) level */
513 u32 thread_id; /* Running thread ID */
514 u8 current_sync_level; /* Mutex Sync (nested acquire) level */
515}; 453};
516 454
517
518/* 455/*
519 * Result values - used to accumulate the results of nested 456 * Result values - used to accumulate the results of nested
520 * AML arguments 457 * AML arguments
521 */ 458 */
522struct acpi_result_values 459struct acpi_result_values {
523{
524 ACPI_STATE_COMMON 460 ACPI_STATE_COMMON
525 union acpi_operand_object *obj_desc [ACPI_OBJ_NUM_OPERANDS]; 461 union acpi_operand_object *obj_desc[ACPI_OBJ_NUM_OPERANDS];
526 u8 num_results; 462 u8 num_results;
527 u8 last_insert; 463 u8 last_insert;
528}; 464};
529 465
530
531typedef
532acpi_status (*acpi_parse_downwards) (
533 struct acpi_walk_state *walk_state,
534 union acpi_parse_object **out_op);
535
536typedef 466typedef
537acpi_status (*acpi_parse_upwards) ( 467acpi_status(*acpi_parse_downwards) (struct acpi_walk_state * walk_state,
538 struct acpi_walk_state *walk_state); 468 union acpi_parse_object ** out_op);
539 469
470typedef acpi_status(*acpi_parse_upwards) (struct acpi_walk_state * walk_state);
540 471
541/* 472/*
542 * Notify info - used to pass info to the deferred notify 473 * Notify info - used to pass info to the deferred notify
543 * handler/dispatcher. 474 * handler/dispatcher.
544 */ 475 */
545struct acpi_notify_info 476struct acpi_notify_info {
546{ 477 ACPI_STATE_COMMON struct acpi_namespace_node *node;
547 ACPI_STATE_COMMON 478 union acpi_operand_object *handler_obj;
548 struct acpi_namespace_node *node;
549 union acpi_operand_object *handler_obj;
550}; 479};
551 480
552
553/* Generic state is union of structs above */ 481/* Generic state is union of structs above */
554 482
555union acpi_generic_state 483union acpi_generic_state {
556{ 484 struct acpi_common_state common;
557 struct acpi_common_state common; 485 struct acpi_control_state control;
558 struct acpi_control_state control; 486 struct acpi_update_state update;
559 struct acpi_update_state update; 487 struct acpi_scope_state scope;
560 struct acpi_scope_state scope; 488 struct acpi_pscope_state parse_scope;
561 struct acpi_pscope_state parse_scope; 489 struct acpi_pkg_state pkg;
562 struct acpi_pkg_state pkg; 490 struct acpi_thread_state thread;
563 struct acpi_thread_state thread; 491 struct acpi_result_values results;
564 struct acpi_result_values results; 492 struct acpi_notify_info notify;
565 struct acpi_notify_info notify;
566}; 493};
567 494
568
569/***************************************************************************** 495/*****************************************************************************
570 * 496 *
571 * Interpreter typedefs and structs 497 * Interpreter typedefs and structs
572 * 498 *
573 ****************************************************************************/ 499 ****************************************************************************/
574 500
575typedef 501typedef acpi_status(*ACPI_EXECUTE_OP) (struct acpi_walk_state * walk_state);
576acpi_status (*ACPI_EXECUTE_OP) (
577 struct acpi_walk_state *walk_state);
578
579 502
580/***************************************************************************** 503/*****************************************************************************
581 * 504 *
@@ -586,28 +509,26 @@ acpi_status (*ACPI_EXECUTE_OP) (
586/* 509/*
587 * AML opcode, name, and argument layout 510 * AML opcode, name, and argument layout
588 */ 511 */
589struct acpi_opcode_info 512struct acpi_opcode_info {
590{
591#if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT) 513#if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT)
592 char *name; /* Opcode name (disassembler/debug only) */ 514 char *name; /* Opcode name (disassembler/debug only) */
593#endif 515#endif
594 u32 parse_args; /* Grammar/Parse time arguments */ 516 u32 parse_args; /* Grammar/Parse time arguments */
595 u32 runtime_args; /* Interpret time arguments */ 517 u32 runtime_args; /* Interpret time arguments */
596 u32 flags; /* Misc flags */ 518 u32 flags; /* Misc flags */
597 u8 object_type; /* Corresponding internal object type */ 519 u8 object_type; /* Corresponding internal object type */
598 u8 class; /* Opcode class */ 520 u8 class; /* Opcode class */
599 u8 type; /* Opcode type */ 521 u8 type; /* Opcode type */
600}; 522};
601 523
602union acpi_parse_value 524union acpi_parse_value {
603{ 525 acpi_integer integer; /* Integer constant (Up to 64 bits) */
604 acpi_integer integer; /* Integer constant (Up to 64 bits) */ 526 struct uint64_struct integer64; /* Structure overlay for 2 32-bit Dwords */
605 struct uint64_struct integer64; /* Structure overlay for 2 32-bit Dwords */ 527 u32 size; /* bytelist or field size */
606 u32 size; /* bytelist or field size */ 528 char *string; /* NULL terminated string */
607 char *string; /* NULL terminated string */ 529 u8 *buffer; /* buffer or string */
608 u8 *buffer; /* buffer or string */ 530 char *name; /* NULL terminated string */
609 char *name; /* NULL terminated string */ 531 union acpi_parse_object *arg; /* arguments and contained ops */
610 union acpi_parse_object *arg; /* arguments and contained ops */
611}; 532};
612 533
613#define ACPI_PARSE_COMMON \ 534#define ACPI_PARSE_COMMON \
@@ -636,84 +557,72 @@ union acpi_parse_value
636/* 557/*
637 * generic operation (for example: If, While, Store) 558 * generic operation (for example: If, While, Store)
638 */ 559 */
639struct acpi_parse_obj_common 560struct acpi_parse_obj_common {
640{ 561ACPI_PARSE_COMMON};
641 ACPI_PARSE_COMMON
642};
643
644 562
645/* 563/*
646 * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and op_regions), 564 * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and op_regions),
647 * and bytelists. 565 * and bytelists.
648 */ 566 */
649struct acpi_parse_obj_named 567struct acpi_parse_obj_named {
650{ 568 ACPI_PARSE_COMMON u8 * path;
651 ACPI_PARSE_COMMON 569 u8 *data; /* AML body or bytelist data */
652 u8 *path; 570 u32 length; /* AML length */
653 u8 *data; /* AML body or bytelist data */ 571 u32 name; /* 4-byte name or zero if no name */
654 u32 length; /* AML length */
655 u32 name; /* 4-byte name or zero if no name */
656}; 572};
657 573
658
659/* The parse node is the fundamental element of the parse tree */ 574/* The parse node is the fundamental element of the parse tree */
660 575
661struct acpi_parse_obj_asl 576struct acpi_parse_obj_asl {
662{ 577 ACPI_PARSE_COMMON union acpi_parse_object *child;
663 ACPI_PARSE_COMMON 578 union acpi_parse_object *parent_method;
664 union acpi_parse_object *child; 579 char *filename;
665 union acpi_parse_object *parent_method; 580 char *external_name;
666 char *filename; 581 char *namepath;
667 char *external_name; 582 char name_seg[4];
668 char *namepath; 583 u32 extra_value;
669 char name_seg[4]; 584 u32 column;
670 u32 extra_value; 585 u32 line_number;
671 u32 column; 586 u32 logical_line_number;
672 u32 line_number; 587 u32 logical_byte_offset;
673 u32 logical_line_number; 588 u32 end_line;
674 u32 logical_byte_offset; 589 u32 end_logical_line;
675 u32 end_line; 590 u32 acpi_btype;
676 u32 end_logical_line; 591 u32 aml_length;
677 u32 acpi_btype; 592 u32 aml_subtree_length;
678 u32 aml_length; 593 u32 final_aml_length;
679 u32 aml_subtree_length; 594 u32 final_aml_offset;
680 u32 final_aml_length; 595 u32 compile_flags;
681 u32 final_aml_offset; 596 u16 parse_opcode;
682 u32 compile_flags; 597 u8 aml_opcode_length;
683 u16 parse_opcode; 598 u8 aml_pkg_len_bytes;
684 u8 aml_opcode_length; 599 u8 extra;
685 u8 aml_pkg_len_bytes; 600 char parse_op_name[12];
686 u8 extra; 601};
687 char parse_op_name[12]; 602
688}; 603union acpi_parse_object {
689 604 struct acpi_parse_obj_common common;
690union acpi_parse_object 605 struct acpi_parse_obj_named named;
691{ 606 struct acpi_parse_obj_asl asl;
692 struct acpi_parse_obj_common common;
693 struct acpi_parse_obj_named named;
694 struct acpi_parse_obj_asl asl;
695}; 607};
696 608
697
698/* 609/*
699 * Parse state - one state per parser invocation and each control 610 * Parse state - one state per parser invocation and each control
700 * method. 611 * method.
701 */ 612 */
702struct acpi_parse_state 613struct acpi_parse_state {
703{ 614 u32 aml_size;
704 u32 aml_size; 615 u8 *aml_start; /* First AML byte */
705 u8 *aml_start; /* First AML byte */ 616 u8 *aml; /* Next AML byte */
706 u8 *aml; /* Next AML byte */ 617 u8 *aml_end; /* (last + 1) AML byte */
707 u8 *aml_end; /* (last + 1) AML byte */ 618 u8 *pkg_start; /* Current package begin */
708 u8 *pkg_start; /* Current package begin */ 619 u8 *pkg_end; /* Current package end */
709 u8 *pkg_end; /* Current package end */ 620 union acpi_parse_object *start_op; /* Root of parse tree */
710 union acpi_parse_object *start_op; /* Root of parse tree */ 621 struct acpi_namespace_node *start_node;
711 struct acpi_namespace_node *start_node; 622 union acpi_generic_state *scope; /* Current scope */
712 union acpi_generic_state *scope; /* Current scope */ 623 union acpi_parse_object *start_scope;
713 union acpi_parse_object *start_scope;
714}; 624};
715 625
716
717/* Parse object flags */ 626/* Parse object flags */
718 627
719#define ACPI_PARSEOP_GENERIC 0x01 628#define ACPI_PARSEOP_GENERIC 0x01
@@ -729,7 +638,6 @@ struct acpi_parse_state
729#define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 638#define ACPI_PARSEOP_EMPTY_TERMLIST 0x04
730#define ACPI_PARSEOP_SPECIAL 0x10 639#define ACPI_PARSEOP_SPECIAL 0x10
731 640
732
733/***************************************************************************** 641/*****************************************************************************
734 * 642 *
735 * Hardware (ACPI registers) and PNP 643 * Hardware (ACPI registers) and PNP
@@ -737,15 +645,14 @@ struct acpi_parse_state
737 ****************************************************************************/ 645 ****************************************************************************/
738 646
739#define PCI_ROOT_HID_STRING "PNP0A03" 647#define PCI_ROOT_HID_STRING "PNP0A03"
648#define PCI_EXPRESS_ROOT_HID_STRING "PNP0A08"
740 649
741struct acpi_bit_register_info 650struct acpi_bit_register_info {
742{ 651 u8 parent_register;
743 u8 parent_register; 652 u8 bit_position;
744 u8 bit_position; 653 u16 access_bit_mask;
745 u16 access_bit_mask;
746}; 654};
747 655
748
749/* 656/*
750 * Register IDs 657 * Register IDs
751 * These are the full ACPI registers 658 * These are the full ACPI registers
@@ -760,7 +667,6 @@ struct acpi_bit_register_info
760#define ACPI_REGISTER_PROCESSOR_BLOCK 0x08 667#define ACPI_REGISTER_PROCESSOR_BLOCK 0x08
761#define ACPI_REGISTER_SMI_COMMAND_BLOCK 0x09 668#define ACPI_REGISTER_SMI_COMMAND_BLOCK 0x09
762 669
763
764/* Masks used to access the bit_registers */ 670/* Masks used to access the bit_registers */
765 671
766#define ACPI_BITMASK_TIMER_STATUS 0x0001 672#define ACPI_BITMASK_TIMER_STATUS 0x0001
@@ -769,7 +675,7 @@ struct acpi_bit_register_info
769#define ACPI_BITMASK_POWER_BUTTON_STATUS 0x0100 675#define ACPI_BITMASK_POWER_BUTTON_STATUS 0x0100
770#define ACPI_BITMASK_SLEEP_BUTTON_STATUS 0x0200 676#define ACPI_BITMASK_SLEEP_BUTTON_STATUS 0x0200
771#define ACPI_BITMASK_RT_CLOCK_STATUS 0x0400 677#define ACPI_BITMASK_RT_CLOCK_STATUS 0x0400
772#define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */ 678#define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */
773#define ACPI_BITMASK_WAKE_STATUS 0x8000 679#define ACPI_BITMASK_WAKE_STATUS 0x8000
774 680
775#define ACPI_BITMASK_ALL_FIXED_STATUS (ACPI_BITMASK_TIMER_STATUS | \ 681#define ACPI_BITMASK_ALL_FIXED_STATUS (ACPI_BITMASK_TIMER_STATUS | \
@@ -785,7 +691,7 @@ struct acpi_bit_register_info
785#define ACPI_BITMASK_POWER_BUTTON_ENABLE 0x0100 691#define ACPI_BITMASK_POWER_BUTTON_ENABLE 0x0100
786#define ACPI_BITMASK_SLEEP_BUTTON_ENABLE 0x0200 692#define ACPI_BITMASK_SLEEP_BUTTON_ENABLE 0x0200
787#define ACPI_BITMASK_RT_CLOCK_ENABLE 0x0400 693#define ACPI_BITMASK_RT_CLOCK_ENABLE 0x0400
788#define ACPI_BITMASK_PCIEXP_WAKE_DISABLE 0x4000 /* ACPI 3.0 */ 694#define ACPI_BITMASK_PCIEXP_WAKE_DISABLE 0x4000 /* ACPI 3.0 */
789 695
790#define ACPI_BITMASK_SCI_ENABLE 0x0001 696#define ACPI_BITMASK_SCI_ENABLE 0x0001
791#define ACPI_BITMASK_BUS_MASTER_RLD 0x0002 697#define ACPI_BITMASK_BUS_MASTER_RLD 0x0002
@@ -795,7 +701,6 @@ struct acpi_bit_register_info
795 701
796#define ACPI_BITMASK_ARB_DISABLE 0x0001 702#define ACPI_BITMASK_ARB_DISABLE 0x0001
797 703
798
799/* Raw bit position of each bit_register */ 704/* Raw bit position of each bit_register */
800 705
801#define ACPI_BITPOSITION_TIMER_STATUS 0x00 706#define ACPI_BITPOSITION_TIMER_STATUS 0x00
@@ -804,7 +709,7 @@ struct acpi_bit_register_info
804#define ACPI_BITPOSITION_POWER_BUTTON_STATUS 0x08 709#define ACPI_BITPOSITION_POWER_BUTTON_STATUS 0x08
805#define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS 0x09 710#define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS 0x09
806#define ACPI_BITPOSITION_RT_CLOCK_STATUS 0x0A 711#define ACPI_BITPOSITION_RT_CLOCK_STATUS 0x0A
807#define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS 0x0E /* ACPI 3.0 */ 712#define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS 0x0E /* ACPI 3.0 */
808#define ACPI_BITPOSITION_WAKE_STATUS 0x0F 713#define ACPI_BITPOSITION_WAKE_STATUS 0x0F
809 714
810#define ACPI_BITPOSITION_TIMER_ENABLE 0x00 715#define ACPI_BITPOSITION_TIMER_ENABLE 0x00
@@ -812,7 +717,7 @@ struct acpi_bit_register_info
812#define ACPI_BITPOSITION_POWER_BUTTON_ENABLE 0x08 717#define ACPI_BITPOSITION_POWER_BUTTON_ENABLE 0x08
813#define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE 0x09 718#define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE 0x09
814#define ACPI_BITPOSITION_RT_CLOCK_ENABLE 0x0A 719#define ACPI_BITPOSITION_RT_CLOCK_ENABLE 0x0A
815#define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE 0x0E /* ACPI 3.0 */ 720#define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE 0x0E /* ACPI 3.0 */
816 721
817#define ACPI_BITPOSITION_SCI_ENABLE 0x00 722#define ACPI_BITPOSITION_SCI_ENABLE 0x00
818#define ACPI_BITPOSITION_BUS_MASTER_RLD 0x01 723#define ACPI_BITPOSITION_BUS_MASTER_RLD 0x01
@@ -822,7 +727,6 @@ struct acpi_bit_register_info
822 727
823#define ACPI_BITPOSITION_ARB_DISABLE 0x00 728#define ACPI_BITPOSITION_ARB_DISABLE 0x00
824 729
825
826/***************************************************************************** 730/*****************************************************************************
827 * 731 *
828 * Resource descriptors 732 * Resource descriptors
@@ -841,8 +745,7 @@ struct acpi_bit_register_info
841#define ACPI_RDESC_TYPE_SMALL 0x00 745#define ACPI_RDESC_TYPE_SMALL 0x00
842 746
843#define ACPI_RDESC_TYPE_MASK 0x80 747#define ACPI_RDESC_TYPE_MASK 0x80
844#define ACPI_RDESC_SMALL_MASK 0x78 /* Only bits 6:3 contain the type */ 748#define ACPI_RDESC_SMALL_MASK 0x78 /* Only bits 6:3 contain the type */
845
846 749
847/* 750/*
848 * Small resource descriptor types 751 * Small resource descriptor types
@@ -871,7 +774,6 @@ struct acpi_bit_register_info
871#define ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE 0x8A 774#define ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE 0x8A
872#define ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE 0x8B 775#define ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE 0x8B
873 776
874
875/***************************************************************************** 777/*****************************************************************************
876 * 778 *
877 * Miscellaneous 779 * Miscellaneous
@@ -880,49 +782,36 @@ struct acpi_bit_register_info
880 782
881#define ACPI_ASCII_ZERO 0x30 783#define ACPI_ASCII_ZERO 0x30
882 784
883
884/***************************************************************************** 785/*****************************************************************************
885 * 786 *
886 * Debugger 787 * Debugger
887 * 788 *
888 ****************************************************************************/ 789 ****************************************************************************/
889 790
890struct acpi_db_method_info 791struct acpi_db_method_info {
891{ 792 acpi_handle thread_gate;
892 acpi_handle thread_gate; 793 char *name;
893 char *name; 794 char **args;
894 char **args; 795 u32 flags;
895 u32 flags; 796 u32 num_loops;
896 u32 num_loops; 797 char pathname[128];
897 char pathname[128];
898}; 798};
899 799
900struct acpi_integrity_info 800struct acpi_integrity_info {
901{ 801 u32 nodes;
902 u32 nodes; 802 u32 objects;
903 u32 objects;
904}; 803};
905 804
906
907#define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 805#define ACPI_DB_REDIRECTABLE_OUTPUT 0x01
908#define ACPI_DB_CONSOLE_OUTPUT 0x02 806#define ACPI_DB_CONSOLE_OUTPUT 0x02
909#define ACPI_DB_DUPLICATE_OUTPUT 0x03 807#define ACPI_DB_DUPLICATE_OUTPUT 0x03
910 808
911
912/***************************************************************************** 809/*****************************************************************************
913 * 810 *
914 * Debug 811 * Debug
915 * 812 *
916 ****************************************************************************/ 813 ****************************************************************************/
917 814
918struct acpi_debug_print_info
919{
920 u32 component_id;
921 char *proc_name;
922 char *module_name;
923};
924
925
926/* Entry for a memory allocation (debug only) */ 815/* Entry for a memory allocation (debug only) */
927 816
928#define ACPI_MEM_MALLOC 0 817#define ACPI_MEM_MALLOC 0
@@ -938,51 +827,36 @@ struct acpi_debug_print_info
938 char module[ACPI_MAX_MODULE_NAME]; \ 827 char module[ACPI_MAX_MODULE_NAME]; \
939 u8 alloc_type; 828 u8 alloc_type;
940 829
941struct acpi_debug_mem_header 830struct acpi_debug_mem_header {
942{ 831ACPI_COMMON_DEBUG_MEM_HEADER};
943 ACPI_COMMON_DEBUG_MEM_HEADER
944};
945 832
946struct acpi_debug_mem_block 833struct acpi_debug_mem_block {
947{ 834 ACPI_COMMON_DEBUG_MEM_HEADER u64 user_space;
948 ACPI_COMMON_DEBUG_MEM_HEADER
949 u64 user_space;
950}; 835};
951 836
952
953#define ACPI_MEM_LIST_GLOBAL 0 837#define ACPI_MEM_LIST_GLOBAL 0
954#define ACPI_MEM_LIST_NSNODE 1 838#define ACPI_MEM_LIST_NSNODE 1
839#define ACPI_MEM_LIST_MAX 1
840#define ACPI_NUM_MEM_LISTS 2
955 841
956#define ACPI_MEM_LIST_FIRST_CACHE_LIST 2 842struct acpi_memory_list {
957#define ACPI_MEM_LIST_STATE 2 843 char *list_name;
958#define ACPI_MEM_LIST_PSNODE 3 844 void *list_head;
959#define ACPI_MEM_LIST_PSNODE_EXT 4 845 u16 object_size;
960#define ACPI_MEM_LIST_OPERAND 5 846 u16 max_depth;
961#define ACPI_MEM_LIST_WALK 6 847 u16 current_depth;
962#define ACPI_MEM_LIST_MAX 6 848 u16 link_offset;
963#define ACPI_NUM_MEM_LISTS 7
964
965
966struct acpi_memory_list
967{
968 void *list_head;
969 u16 link_offset;
970 u16 max_cache_depth;
971 u16 cache_depth;
972 u16 object_size;
973 849
974#ifdef ACPI_DBG_TRACK_ALLOCATIONS 850#ifdef ACPI_DBG_TRACK_ALLOCATIONS
975 851
976 /* Statistics for debug memory tracking only */ 852 /* Statistics for debug memory tracking only */
977 853
978 u32 total_allocated; 854 u32 total_allocated;
979 u32 total_freed; 855 u32 total_freed;
980 u32 current_total_size; 856 u32 current_total_size;
981 u32 cache_requests; 857 u32 requests;
982 u32 cache_hits; 858 u32 hits;
983 char *list_name;
984#endif 859#endif
985}; 860};
986 861
987 862#endif /* __ACLOCAL_H__ */
988#endif /* __ACLOCAL_H__ */
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index 09be937d2c39..702cc4e57f5f 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -44,7 +44,6 @@
44#ifndef __ACMACROS_H__ 44#ifndef __ACMACROS_H__
45#define __ACMACROS_H__ 45#define __ACMACROS_H__
46 46
47
48/* 47/*
49 * Data manipulation macros 48 * Data manipulation macros
50 */ 49 */
@@ -57,7 +56,6 @@
57#define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit)) 56#define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit))
58#define ACPI_MIN(a,b) (((a)<(b))?(a):(b)) 57#define ACPI_MIN(a,b) (((a)<(b))?(a):(b))
59 58
60
61#if ACPI_MACHINE_WIDTH == 16 59#if ACPI_MACHINE_WIDTH == 16
62 60
63/* 61/*
@@ -168,7 +166,7 @@
168 166
169/* 32-bit source, 16/32/64 destination */ 167/* 32-bit source, 16/32/64 destination */
170 168
171#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ 169#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */
172 170
173#define ACPI_MOVE_32_TO_32(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[3];\ 171#define ACPI_MOVE_32_TO_32(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[3];\
174 (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[2];\ 172 (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[2];\
@@ -183,9 +181,9 @@
183 181
184/* 64-bit source, 16/32/64 destination */ 182/* 64-bit source, 16/32/64 destination */
185 183
186#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ 184#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */
187 185
188#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ 186#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */
189 187
190#define ACPI_MOVE_64_TO_64(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[7];\ 188#define ACPI_MOVE_64_TO_64(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[7];\
191 (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[6];\ 189 (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[6];\
@@ -219,14 +217,14 @@
219 217
220/* 32-bit source, 16/32/64 destination */ 218/* 32-bit source, 16/32/64 destination */
221 219
222#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ 220#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */
223#define ACPI_MOVE_32_TO_32(d,s) *(u32 *)(void *)(d) = *(u32 *)(void *)(s) 221#define ACPI_MOVE_32_TO_32(d,s) *(u32 *)(void *)(d) = *(u32 *)(void *)(s)
224#define ACPI_MOVE_32_TO_64(d,s) ACPI_MOVE_32_TO_32(d,s) 222#define ACPI_MOVE_32_TO_64(d,s) ACPI_MOVE_32_TO_32(d,s)
225 223
226/* 64-bit source, 16/32/64 destination */ 224/* 64-bit source, 16/32/64 destination */
227 225
228#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ 226#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */
229#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ 227#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */
230#define ACPI_MOVE_64_TO_64(d,s) ACPI_MOVE_32_TO_32(d,s) 228#define ACPI_MOVE_64_TO_64(d,s) ACPI_MOVE_32_TO_32(d,s)
231 229
232#else 230#else
@@ -238,14 +236,14 @@
238 236
239/* 32-bit source, 16/32/64 destination */ 237/* 32-bit source, 16/32/64 destination */
240 238
241#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ 239#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */
242#define ACPI_MOVE_32_TO_32(d,s) *(u32 *)(void *)(d) = *(u32 *)(void *)(s) 240#define ACPI_MOVE_32_TO_32(d,s) *(u32 *)(void *)(d) = *(u32 *)(void *)(s)
243#define ACPI_MOVE_32_TO_64(d,s) *(u64 *)(void *)(d) = *(u32 *)(void *)(s) 241#define ACPI_MOVE_32_TO_64(d,s) *(u64 *)(void *)(d) = *(u32 *)(void *)(s)
244 242
245/* 64-bit source, 16/32/64 destination */ 243/* 64-bit source, 16/32/64 destination */
246 244
247#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ 245#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */
248#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ 246#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */
249#define ACPI_MOVE_64_TO_64(d,s) *(u64 *)(void *)(d) = *(u64 *)(void *)(s) 247#define ACPI_MOVE_64_TO_64(d,s) *(u64 *)(void *)(d) = *(u64 *)(void *)(s)
250#endif 248#endif
251 249
@@ -266,7 +264,7 @@
266 264
267/* 32-bit source, 16/32/64 destination */ 265/* 32-bit source, 16/32/64 destination */
268 266
269#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ 267#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */
270 268
271#define ACPI_MOVE_32_TO_32(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ 269#define ACPI_MOVE_32_TO_32(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\
272 (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\ 270 (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\
@@ -277,8 +275,8 @@
277 275
278/* 64-bit source, 16/32/64 destination */ 276/* 64-bit source, 16/32/64 destination */
279 277
280#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ 278#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */
281#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ 279#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */
282#define ACPI_MOVE_64_TO_64(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ 280#define ACPI_MOVE_64_TO_64(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\
283 (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\ 281 (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\
284 (( u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[2];\ 282 (( u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[2];\
@@ -305,7 +303,6 @@
305#error unknown ACPI_MACHINE_WIDTH 303#error unknown ACPI_MACHINE_WIDTH
306#endif 304#endif
307 305
308
309/* 306/*
310 * Fast power-of-two math macros for non-optimized compilers 307 * Fast power-of-two math macros for non-optimized compilers
311 */ 308 */
@@ -329,7 +326,6 @@
329#define ACPI_MUL_16(a) _ACPI_MUL(a,4) 326#define ACPI_MUL_16(a) _ACPI_MUL(a,4)
330#define ACPI_MOD_16(a) _ACPI_MOD(a,16) 327#define ACPI_MOD_16(a) _ACPI_MOD(a,16)
331 328
332
333/* 329/*
334 * Rounding macros (Power of two boundaries only) 330 * Rounding macros (Power of two boundaries only)
335 */ 331 */
@@ -344,7 +340,6 @@
344#define ACPI_ROUND_UP_to_64_bITS(a) ACPI_ROUND_UP(a,8) 340#define ACPI_ROUND_UP_to_64_bITS(a) ACPI_ROUND_UP(a,8)
345#define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,ALIGNED_ADDRESS_BOUNDARY) 341#define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,ALIGNED_ADDRESS_BOUNDARY)
346 342
347
348#define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7) 343#define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7)
349#define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a)) 344#define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a))
350 345
@@ -365,7 +360,6 @@
365 360
366#define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7')) 361#define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7'))
367 362
368
369/* Bitfields within ACPI registers */ 363/* Bitfields within ACPI registers */
370 364
371#define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) ((val << pos) & mask) 365#define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) ((val << pos) & mask)
@@ -381,7 +375,6 @@
381#define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->descriptor_id) 375#define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->descriptor_id)
382#define ACPI_SET_DESCRIPTOR_TYPE(d,t) (((union acpi_descriptor *)(void *)(d))->descriptor_id = t) 376#define ACPI_SET_DESCRIPTOR_TYPE(d,t) (((union acpi_descriptor *)(void *)(d))->descriptor_id = t)
383 377
384
385/* Macro to test the object type */ 378/* Macro to test the object type */
386 379
387#define ACPI_GET_OBJECT_TYPE(d) (((union acpi_operand_object *)(void *)(d))->common.type) 380#define ACPI_GET_OBJECT_TYPE(d) (((union acpi_operand_object *)(void *)(d))->common.type)
@@ -430,28 +423,28 @@
430#define GET_CURRENT_ARG_TYPE(list) (list & ((u32) 0x1F)) 423#define GET_CURRENT_ARG_TYPE(list) (list & ((u32) 0x1F))
431#define INCREMENT_ARG_LIST(list) (list >>= ((u32) ARG_TYPE_WIDTH)) 424#define INCREMENT_ARG_LIST(list) (list >>= ((u32) ARG_TYPE_WIDTH))
432 425
433
434/* 426/*
435 * Reporting macros that are never compiled out 427 * Reporting macros that are never compiled out
436 */ 428 */
437#define ACPI_PARAM_LIST(pl) pl 429#define ACPI_PARAM_LIST(pl) pl
438 430
439/* 431/*
440 * Error reporting. These versions add callers module and line#. Since 432 * Error reporting. These versions add callers module and line#.
441 * _THIS_MODULE gets compiled out when ACPI_DEBUG_OUTPUT isn't defined, only 433 *
442 * use it in debug mode. 434 * Since _acpi_module_name gets compiled out when ACPI_DEBUG_OUTPUT
435 * isn't defined, only use it in debug mode.
443 */ 436 */
444#ifdef ACPI_DEBUG_OUTPUT 437#ifdef ACPI_DEBUG_OUTPUT
445 438
446#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info(_THIS_MODULE,__LINE__,_COMPONENT); \ 439#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info(_acpi_module_name,__LINE__,_COMPONENT); \
447 acpi_os_printf ACPI_PARAM_LIST(fp);} 440 acpi_os_printf ACPI_PARAM_LIST(fp);}
448#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error(_THIS_MODULE,__LINE__,_COMPONENT); \ 441#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error(_acpi_module_name,__LINE__,_COMPONENT); \
449 acpi_os_printf ACPI_PARAM_LIST(fp);} 442 acpi_os_printf ACPI_PARAM_LIST(fp);}
450#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning(_THIS_MODULE,__LINE__,_COMPONENT); \ 443#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning(_acpi_module_name,__LINE__,_COMPONENT); \
451 acpi_os_printf ACPI_PARAM_LIST(fp);} 444 acpi_os_printf ACPI_PARAM_LIST(fp);}
452#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error(_THIS_MODULE,__LINE__,_COMPONENT, s, e); 445#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error(_acpi_module_name,__LINE__,_COMPONENT, s, e);
453 446
454#define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error(_THIS_MODULE,__LINE__,_COMPONENT, s, n, p, e); 447#define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error(_acpi_module_name,__LINE__,_COMPONENT, s, n, p, e);
455 448
456#else 449#else
457 450
@@ -480,36 +473,58 @@
480 * Debug macros that are conditionally compiled 473 * Debug macros that are conditionally compiled
481 */ 474 */
482#ifdef ACPI_DEBUG_OUTPUT 475#ifdef ACPI_DEBUG_OUTPUT
476#define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_acpi_module_name = name;
483 477
484#define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_THIS_MODULE = name; 478/*
479 * Common parameters used for debug output functions:
480 * line number, function name, module(file) name, component ID
481 */
482#define ACPI_DEBUG_PARAMETERS __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
485 483
486/* 484/*
487 * Function entry tracing. 485 * Function entry tracing
488 * The first parameter should be the procedure name as a quoted string. This is declared 486 */
489 * as a local string ("_proc_name) so that it can be also used by the function exit macros below. 487
488/*
489 * If ACPI_GET_FUNCTION_NAME was not defined in the compiler-dependent header,
490 * define it now. This is the case where there the compiler does not support
491 * a __FUNCTION__ macro or equivalent. We save the function name on the
492 * local stack.
493 */
494#ifndef ACPI_GET_FUNCTION_NAME
495#define ACPI_GET_FUNCTION_NAME _acpi_function_name
496/*
497 * The Name parameter should be the procedure name as a quoted string.
498 * This is declared as a local string ("my_function_name") so that it can
499 * be also used by the function exit macros below.
500 * Note: (const char) is used to be compatible with the debug interfaces
501 * and macros such as __FUNCTION__.
490 */ 502 */
491#define ACPI_FUNCTION_NAME(a) struct acpi_debug_print_info _debug_info; \ 503#define ACPI_FUNCTION_NAME(name) const char *_acpi_function_name = name;
492 _debug_info.component_id = _COMPONENT; \ 504
493 _debug_info.proc_name = a; \ 505#else
494 _debug_info.module_name = _THIS_MODULE; 506/* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */
495 507
496#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ 508#define ACPI_FUNCTION_NAME(name)
497 acpi_ut_trace(__LINE__,&_debug_info) 509#endif
498#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ 510
499 acpi_ut_trace_ptr(__LINE__,&_debug_info,(void *)b) 511#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \
500#define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \ 512 acpi_ut_trace(ACPI_DEBUG_PARAMETERS)
501 acpi_ut_trace_u32(__LINE__,&_debug_info,(u32)b) 513#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \
502#define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a) \ 514 acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b)
503 acpi_ut_trace_str(__LINE__,&_debug_info,(char *)b) 515#define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \
504 516 acpi_ut_trace_u32(ACPI_DEBUG_PARAMETERS,(u32)b)
505#define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr() 517#define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a) \
518 acpi_ut_trace_str(ACPI_DEBUG_PARAMETERS,(char *)b)
519
520#define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr()
506 521
507/* 522/*
508 * Function exit tracing. 523 * Function exit tracing.
509 * WARNING: These macros include a return statement. This is usually considered 524 * WARNING: These macros include a return statement. This is usually considered
510 * bad form, but having a separate exit macro is very ugly and difficult to maintain. 525 * bad form, but having a separate exit macro is very ugly and difficult to maintain.
511 * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros 526 * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros
512 * so that "_proc_name" is defined. 527 * so that "_acpi_function_name" is defined.
513 */ 528 */
514#ifdef ACPI_USE_DO_WHILE_0 529#ifdef ACPI_USE_DO_WHILE_0
515#define ACPI_DO_WHILE0(a) do a while(0) 530#define ACPI_DO_WHILE0(a) do a while(0)
@@ -517,10 +532,10 @@
517#define ACPI_DO_WHILE0(a) a 532#define ACPI_DO_WHILE0(a) a
518#endif 533#endif
519 534
520#define return_VOID ACPI_DO_WHILE0 ({acpi_ut_exit(__LINE__,&_debug_info);return;}) 535#define return_VOID ACPI_DO_WHILE0 ({acpi_ut_exit(ACPI_DEBUG_PARAMETERS);return;})
521#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({acpi_ut_status_exit(__LINE__,&_debug_info,(s));return((s));}) 536#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({acpi_ut_status_exit(ACPI_DEBUG_PARAMETERS,(s));return((s));})
522#define return_VALUE(s) ACPI_DO_WHILE0 ({acpi_ut_value_exit(__LINE__,&_debug_info,(acpi_integer)(s));return((s));}) 537#define return_VALUE(s) ACPI_DO_WHILE0 ({acpi_ut_value_exit(ACPI_DEBUG_PARAMETERS,(acpi_integer)(s));return((s));})
523#define return_PTR(s) ACPI_DO_WHILE0 ({acpi_ut_ptr_exit(__LINE__,&_debug_info,(u8 *)(s));return((s));}) 538#define return_PTR(s) ACPI_DO_WHILE0 ({acpi_ut_ptr_exit(ACPI_DEBUG_PARAMETERS,(u8 *)(s));return((s));})
524 539
525/* Conditional execution */ 540/* Conditional execution */
526 541
@@ -531,12 +546,10 @@
531#define ACPI_DEBUG_ONLY_MEMBERS(a) a; 546#define ACPI_DEBUG_ONLY_MEMBERS(a) a;
532#define _VERBOSE_STRUCTURES 547#define _VERBOSE_STRUCTURES
533 548
534
535/* Stack and buffer dumping */ 549/* Stack and buffer dumping */
536 550
537#define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a),0) 551#define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a),0)
538#define ACPI_DUMP_OPERANDS(a,b,c,d,e) acpi_ex_dump_operands(a,b,c,d,e,_THIS_MODULE,__LINE__) 552#define ACPI_DUMP_OPERANDS(a,b,c,d,e) acpi_ex_dump_operands(a,b,c,d,e,_acpi_module_name,__LINE__)
539
540 553
541#define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b) 554#define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b)
542#define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d) 555#define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d)
@@ -544,7 +557,6 @@
544#define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT) 557#define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT)
545#define ACPI_BREAK_MSG(a) acpi_os_signal (ACPI_SIGNAL_BREAKPOINT,(a)) 558#define ACPI_BREAK_MSG(a) acpi_os_signal (ACPI_SIGNAL_BREAKPOINT,(a))
546 559
547
548/* 560/*
549 * Generate INT3 on ACPI_ERROR (Debug only!) 561 * Generate INT3 on ACPI_ERROR (Debug only!)
550 */ 562 */
@@ -565,14 +577,13 @@
565#define ACPI_DEBUG_PRINT(pl) acpi_ut_debug_print ACPI_PARAM_LIST(pl) 577#define ACPI_DEBUG_PRINT(pl) acpi_ut_debug_print ACPI_PARAM_LIST(pl)
566#define ACPI_DEBUG_PRINT_RAW(pl) acpi_ut_debug_print_raw ACPI_PARAM_LIST(pl) 578#define ACPI_DEBUG_PRINT_RAW(pl) acpi_ut_debug_print_raw ACPI_PARAM_LIST(pl)
567 579
568
569#else 580#else
570/* 581/*
571 * This is the non-debug case -- make everything go away, 582 * This is the non-debug case -- make everything go away,
572 * leaving no executable debug code! 583 * leaving no executable debug code!
573 */ 584 */
574#define ACPI_MODULE_NAME(name) 585#define ACPI_MODULE_NAME(name)
575#define _THIS_MODULE "" 586#define _acpi_module_name ""
576 587
577#define ACPI_DEBUG_EXEC(a) 588#define ACPI_DEBUG_EXEC(a)
578#define ACPI_NORMAL_EXEC(a) a; 589#define ACPI_NORMAL_EXEC(a) a;
@@ -616,7 +627,6 @@
616#define ACPI_DEBUGGER_EXEC(a) 627#define ACPI_DEBUGGER_EXEC(a)
617#endif 628#endif
618 629
619
620/* 630/*
621 * For 16-bit code, we want to shrink some things even though 631 * For 16-bit code, we want to shrink some things even though
622 * we are using ACPI_DEBUG_OUTPUT to get the debug output 632 * we are using ACPI_DEBUG_OUTPUT to get the debug output
@@ -627,7 +637,6 @@
627#define ACPI_DEBUG_ONLY_MEMBERS(a) 637#define ACPI_DEBUG_ONLY_MEMBERS(a)
628#endif 638#endif
629 639
630
631#ifdef ACPI_DEBUG_OUTPUT 640#ifdef ACPI_DEBUG_OUTPUT
632/* 641/*
633 * 1) Set name to blanks 642 * 1) Set name to blanks
@@ -640,7 +649,6 @@
640#define ACPI_ADD_OBJECT_NAME(a,b) 649#define ACPI_ADD_OBJECT_NAME(a,b)
641#endif 650#endif
642 651
643
644/* 652/*
645 * Memory allocation tracking (DEBUG ONLY) 653 * Memory allocation tracking (DEBUG ONLY)
646 */ 654 */
@@ -648,21 +656,20 @@
648 656
649/* Memory allocation */ 657/* Memory allocation */
650 658
651#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_THIS_MODULE,__LINE__) 659#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__)
652#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate((acpi_size)(a), _COMPONENT,_THIS_MODULE,__LINE__) 660#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__)
653#define ACPI_MEM_FREE(a) acpi_os_free(a) 661#define ACPI_MEM_FREE(a) acpi_os_free(a)
654#define ACPI_MEM_TRACKING(a) 662#define ACPI_MEM_TRACKING(a)
655 663
656
657#else 664#else
658 665
659/* Memory allocation */ 666/* Memory allocation */
660 667
661#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_THIS_MODULE,__LINE__) 668#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__)
662#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate_and_track((acpi_size)(a), _COMPONENT,_THIS_MODULE,__LINE__) 669#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate_and_track((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__)
663#define ACPI_MEM_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_THIS_MODULE,__LINE__) 670#define ACPI_MEM_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_acpi_module_name,__LINE__)
664#define ACPI_MEM_TRACKING(a) a 671#define ACPI_MEM_TRACKING(a) a
665 672
666#endif /* ACPI_DBG_TRACK_ALLOCATIONS */ 673#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
667 674
668#endif /* ACMACROS_H */ 675#endif /* ACMACROS_H */
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h
index deb7cb06f5f0..4f9063f3e951 100644
--- a/include/acpi/acnames.h
+++ b/include/acpi/acnames.h
@@ -71,14 +71,13 @@
71 71
72/* Definitions of the predefined namespace names */ 72/* Definitions of the predefined namespace names */
73 73
74#define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */ 74#define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */
75#define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */ 75#define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */
76#define ACPI_SYS_BUS_NAME (u32) 0x5F53425F /* Sys bus name is "_SB_" */ 76
77#define ACPI_PREFIX_MIXED (u32) 0x69706341 /* "Acpi" */
78#define ACPI_PREFIX_LOWER (u32) 0x69706361 /* "acpi" */
77 79
78#define ACPI_NS_ROOT_PATH "\\" 80#define ACPI_NS_ROOT_PATH "\\"
79#define ACPI_NS_SYSTEM_BUS "_SB_" 81#define ACPI_NS_SYSTEM_BUS "_SB_"
80 82
81 83#endif /* __ACNAMES_H__ */
82#endif /* __ACNAMES_H__ */
83
84
diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h
index d1b3ce80056f..dd3501f7e5d6 100644
--- a/include/acpi/acnamesp.h
+++ b/include/acpi/acnamesp.h
@@ -44,7 +44,6 @@
44#ifndef __ACNAMESP_H__ 44#ifndef __ACNAMESP_H__
45#define __ACNAMESP_H__ 45#define __ACNAMESP_H__
46 46
47
48/* To search the entire name space, pass this as search_base */ 47/* To search the entire name space, pass this as search_base */
49 48
50#define ACPI_NS_ALL ((acpi_handle)0) 49#define ACPI_NS_ALL ((acpi_handle)0)
@@ -54,8 +53,8 @@
54 * and should be one-to-one with values of acpi_object_type 53 * and should be one-to-one with values of acpi_object_type
55 */ 54 */
56#define ACPI_NS_NORMAL 0 55#define ACPI_NS_NORMAL 0
57#define ACPI_NS_NEWSCOPE 1 /* a definition of this type opens a name scope */ 56#define ACPI_NS_NEWSCOPE 1 /* a definition of this type opens a name scope */
58#define ACPI_NS_LOCAL 2 /* suppress search of enclosing scopes */ 57#define ACPI_NS_LOCAL 2 /* suppress search of enclosing scopes */
59 58
60/* Flags for acpi_ns_lookup, acpi_ns_search_and_enter */ 59/* Flags for acpi_ns_lookup, acpi_ns_search_and_enter */
61 60
@@ -68,357 +67,237 @@
68#define ACPI_NS_WALK_UNLOCK TRUE 67#define ACPI_NS_WALK_UNLOCK TRUE
69#define ACPI_NS_WALK_NO_UNLOCK FALSE 68#define ACPI_NS_WALK_NO_UNLOCK FALSE
70 69
71
72/* 70/*
73 * nsinit - Namespace initialization 71 * nsinit - Namespace initialization
74 */ 72 */
75acpi_status 73acpi_status acpi_ns_initialize_objects(void);
76acpi_ns_initialize_objects (
77 void);
78
79acpi_status
80acpi_ns_initialize_devices (
81 void);
82 74
75acpi_status acpi_ns_initialize_devices(void);
83 76
84/* 77/*
85 * nsload - Namespace loading 78 * nsload - Namespace loading
86 */ 79 */
87acpi_status 80acpi_status acpi_ns_load_namespace(void);
88acpi_ns_load_namespace (
89 void);
90 81
91acpi_status 82acpi_status
92acpi_ns_load_table ( 83acpi_ns_load_table(struct acpi_table_desc *table_desc,
93 struct acpi_table_desc *table_desc, 84 struct acpi_namespace_node *node);
94 struct acpi_namespace_node *node);
95
96 85
97/* 86/*
98 * nswalk - walk the namespace 87 * nswalk - walk the namespace
99 */ 88 */
100acpi_status 89acpi_status
101acpi_ns_walk_namespace ( 90acpi_ns_walk_namespace(acpi_object_type type,
102 acpi_object_type type, 91 acpi_handle start_object,
103 acpi_handle start_object, 92 u32 max_depth,
104 u32 max_depth, 93 u8 unlock_before_callback,
105 u8 unlock_before_callback, 94 acpi_walk_callback user_function,
106 acpi_walk_callback user_function, 95 void *context, void **return_value);
107 void *context, 96
108 void **return_value); 97struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type,
109 98 struct acpi_namespace_node
110struct acpi_namespace_node * 99 *parent,
111acpi_ns_get_next_node ( 100 struct acpi_namespace_node
112 acpi_object_type type, 101 *child);
113 struct acpi_namespace_node *parent,
114 struct acpi_namespace_node *child);
115
116 102
117/* 103/*
118 * nsparse - table parsing 104 * nsparse - table parsing
119 */ 105 */
120acpi_status 106acpi_status
121acpi_ns_parse_table ( 107acpi_ns_parse_table(struct acpi_table_desc *table_desc,
122 struct acpi_table_desc *table_desc, 108 struct acpi_namespace_node *scope);
123 struct acpi_namespace_node *scope);
124 109
125acpi_status 110acpi_status
126acpi_ns_one_complete_parse ( 111acpi_ns_one_complete_parse(u8 pass_number, struct acpi_table_desc *table_desc);
127 u32 pass_number,
128 struct acpi_table_desc *table_desc);
129
130 112
131/* 113/*
132 * nsaccess - Top-level namespace access 114 * nsaccess - Top-level namespace access
133 */ 115 */
134acpi_status 116acpi_status acpi_ns_root_initialize(void);
135acpi_ns_root_initialize (
136 void);
137 117
138acpi_status 118acpi_status
139acpi_ns_lookup ( 119acpi_ns_lookup(union acpi_generic_state *scope_info,
140 union acpi_generic_state *scope_info, 120 char *name,
141 char *name, 121 acpi_object_type type,
142 acpi_object_type type, 122 acpi_interpreter_mode interpreter_mode,
143 acpi_interpreter_mode interpreter_mode, 123 u32 flags,
144 u32 flags, 124 struct acpi_walk_state *walk_state,
145 struct acpi_walk_state *walk_state, 125 struct acpi_namespace_node **ret_node);
146 struct acpi_namespace_node **ret_node);
147
148 126
149/* 127/*
150 * nsalloc - Named object allocation/deallocation 128 * nsalloc - Named object allocation/deallocation
151 */ 129 */
152struct acpi_namespace_node * 130struct acpi_namespace_node *acpi_ns_create_node(u32 name);
153acpi_ns_create_node (
154 u32 name);
155
156void
157acpi_ns_delete_node (
158 struct acpi_namespace_node *node);
159 131
160void 132void acpi_ns_delete_node(struct acpi_namespace_node *node);
161acpi_ns_delete_namespace_subtree (
162 struct acpi_namespace_node *parent_handle);
163 133
164void 134void
165acpi_ns_delete_namespace_by_owner ( 135acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_handle);
166 u16 table_id);
167 136
168void 137void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id);
169acpi_ns_detach_object (
170 struct acpi_namespace_node *node);
171 138
172void 139void acpi_ns_detach_object(struct acpi_namespace_node *node);
173acpi_ns_delete_children (
174 struct acpi_namespace_node *parent);
175 140
176int 141void acpi_ns_delete_children(struct acpi_namespace_node *parent);
177acpi_ns_compare_names (
178 char *name1,
179 char *name2);
180 142
143int acpi_ns_compare_names(char *name1, char *name2);
181 144
182/* 145/*
183 * nsdump - Namespace dump/print utilities 146 * nsdump - Namespace dump/print utilities
184 */ 147 */
185#ifdef ACPI_FUTURE_USAGE 148#ifdef ACPI_FUTURE_USAGE
186void 149void acpi_ns_dump_tables(acpi_handle search_base, u32 max_depth);
187acpi_ns_dump_tables ( 150#endif /* ACPI_FUTURE_USAGE */
188 acpi_handle search_base,
189 u32 max_depth);
190#endif /* ACPI_FUTURE_USAGE */
191 151
192void 152void acpi_ns_dump_entry(acpi_handle handle, u32 debug_level);
193acpi_ns_dump_entry (
194 acpi_handle handle,
195 u32 debug_level);
196 153
197void 154void
198acpi_ns_dump_pathname ( 155acpi_ns_dump_pathname(acpi_handle handle, char *msg, u32 level, u32 component);
199 acpi_handle handle,
200 char *msg,
201 u32 level,
202 u32 component);
203 156
204void 157void acpi_ns_print_pathname(u32 num_segments, char *pathname);
205acpi_ns_print_pathname (
206 u32 num_segments,
207 char *pathname);
208 158
209acpi_status 159acpi_status
210acpi_ns_dump_one_object ( 160acpi_ns_dump_one_object(acpi_handle obj_handle,
211 acpi_handle obj_handle, 161 u32 level, void *context, void **return_value);
212 u32 level,
213 void *context,
214 void **return_value);
215 162
216#ifdef ACPI_FUTURE_USAGE 163#ifdef ACPI_FUTURE_USAGE
217void 164void
218acpi_ns_dump_objects ( 165acpi_ns_dump_objects(acpi_object_type type,
219 acpi_object_type type, 166 u8 display_type,
220 u8 display_type, 167 u32 max_depth,
221 u32 max_depth, 168 acpi_owner_id owner_id, acpi_handle start_handle);
222 u32 ownder_id, 169#endif /* ACPI_FUTURE_USAGE */
223 acpi_handle start_handle);
224#endif /* ACPI_FUTURE_USAGE */
225
226 170
227/* 171/*
228 * nseval - Namespace evaluation functions 172 * nseval - Namespace evaluation functions
229 */ 173 */
230acpi_status 174acpi_status acpi_ns_evaluate_by_handle(struct acpi_parameter_info *info);
231acpi_ns_evaluate_by_handle (
232 struct acpi_parameter_info *info);
233 175
234acpi_status 176acpi_status
235acpi_ns_evaluate_by_name ( 177acpi_ns_evaluate_by_name(char *pathname, struct acpi_parameter_info *info);
236 char *pathname,
237 struct acpi_parameter_info *info);
238 178
239acpi_status 179acpi_status
240acpi_ns_evaluate_relative ( 180acpi_ns_evaluate_relative(char *pathname, struct acpi_parameter_info *info);
241 char *pathname,
242 struct acpi_parameter_info *info);
243
244 181
245/* 182/*
246 * nsnames - Name and Scope manipulation 183 * nsnames - Name and Scope manipulation
247 */ 184 */
248u32 185u32 acpi_ns_opens_scope(acpi_object_type type);
249acpi_ns_opens_scope (
250 acpi_object_type type);
251 186
252char * 187char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node);
253acpi_ns_get_external_pathname (
254 struct acpi_namespace_node *node);
255 188
256char * 189char *acpi_ns_name_of_current_scope(struct acpi_walk_state *walk_state);
257acpi_ns_name_of_current_scope (
258 struct acpi_walk_state *walk_state);
259 190
260acpi_status 191acpi_status
261acpi_ns_handle_to_pathname ( 192acpi_ns_handle_to_pathname(acpi_handle target_handle,
262 acpi_handle target_handle, 193 struct acpi_buffer *buffer);
263 struct acpi_buffer *buffer);
264 194
265u8 195u8
266acpi_ns_pattern_match ( 196acpi_ns_pattern_match(struct acpi_namespace_node *obj_node, char *search_for);
267 struct acpi_namespace_node *obj_node,
268 char *search_for);
269 197
270acpi_status 198acpi_status
271acpi_ns_get_node_by_path ( 199acpi_ns_get_node_by_path(char *external_pathname,
272 char *external_pathname, 200 struct acpi_namespace_node *in_prefix_node,
273 struct acpi_namespace_node *in_prefix_node, 201 u32 flags, struct acpi_namespace_node **out_node);
274 u32 flags,
275 struct acpi_namespace_node **out_node);
276
277acpi_size
278acpi_ns_get_pathname_length (
279 struct acpi_namespace_node *node);
280 202
203acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node);
281 204
282/* 205/*
283 * nsobject - Object management for namespace nodes 206 * nsobject - Object management for namespace nodes
284 */ 207 */
285acpi_status 208acpi_status
286acpi_ns_attach_object ( 209acpi_ns_attach_object(struct acpi_namespace_node *node,
287 struct acpi_namespace_node *node, 210 union acpi_operand_object *object, acpi_object_type type);
288 union acpi_operand_object *object,
289 acpi_object_type type);
290 211
291union acpi_operand_object * 212union acpi_operand_object *acpi_ns_get_attached_object(struct
292acpi_ns_get_attached_object ( 213 acpi_namespace_node
293 struct acpi_namespace_node *node); 214 *node);
294 215
295union acpi_operand_object * 216union acpi_operand_object *acpi_ns_get_secondary_object(union
296acpi_ns_get_secondary_object ( 217 acpi_operand_object
297 union acpi_operand_object *obj_desc); 218 *obj_desc);
298 219
299acpi_status 220acpi_status
300acpi_ns_attach_data ( 221acpi_ns_attach_data(struct acpi_namespace_node *node,
301 struct acpi_namespace_node *node, 222 acpi_object_handler handler, void *data);
302 acpi_object_handler handler,
303 void *data);
304 223
305acpi_status 224acpi_status
306acpi_ns_detach_data ( 225acpi_ns_detach_data(struct acpi_namespace_node *node,
307 struct acpi_namespace_node *node, 226 acpi_object_handler handler);
308 acpi_object_handler handler);
309 227
310acpi_status 228acpi_status
311acpi_ns_get_attached_data ( 229acpi_ns_get_attached_data(struct acpi_namespace_node *node,
312 struct acpi_namespace_node *node, 230 acpi_object_handler handler, void **data);
313 acpi_object_handler handler,
314 void **data);
315
316 231
317/* 232/*
318 * nssearch - Namespace searching and entry 233 * nssearch - Namespace searching and entry
319 */ 234 */
320acpi_status 235acpi_status
321acpi_ns_search_and_enter ( 236acpi_ns_search_and_enter(u32 entry_name,
322 u32 entry_name, 237 struct acpi_walk_state *walk_state,
323 struct acpi_walk_state *walk_state, 238 struct acpi_namespace_node *node,
324 struct acpi_namespace_node *node, 239 acpi_interpreter_mode interpreter_mode,
325 acpi_interpreter_mode interpreter_mode, 240 acpi_object_type type,
326 acpi_object_type type, 241 u32 flags, struct acpi_namespace_node **ret_node);
327 u32 flags,
328 struct acpi_namespace_node **ret_node);
329 242
330acpi_status 243acpi_status
331acpi_ns_search_node ( 244acpi_ns_search_node(u32 entry_name,
332 u32 entry_name, 245 struct acpi_namespace_node *node,
333 struct acpi_namespace_node *node, 246 acpi_object_type type,
334 acpi_object_type type, 247 struct acpi_namespace_node **ret_node);
335 struct acpi_namespace_node **ret_node);
336 248
337void 249void
338acpi_ns_install_node ( 250acpi_ns_install_node(struct acpi_walk_state *walk_state,
339 struct acpi_walk_state *walk_state, 251 struct acpi_namespace_node *parent_node,
340 struct acpi_namespace_node *parent_node, 252 struct acpi_namespace_node *node, acpi_object_type type);
341 struct acpi_namespace_node *node,
342 acpi_object_type type);
343
344 253
345/* 254/*
346 * nsutils - Utility functions 255 * nsutils - Utility functions
347 */ 256 */
348u8 257u8 acpi_ns_valid_root_prefix(char prefix);
349acpi_ns_valid_root_prefix (
350 char prefix);
351 258
352acpi_object_type 259acpi_object_type acpi_ns_get_type(struct acpi_namespace_node *node);
353acpi_ns_get_type (
354 struct acpi_namespace_node *node);
355 260
356u32 261u32 acpi_ns_local(acpi_object_type type);
357acpi_ns_local (
358 acpi_object_type type);
359 262
360void 263void
361acpi_ns_report_error ( 264acpi_ns_report_error(char *module_name,
362 char *module_name, 265 u32 line_number,
363 u32 line_number, 266 u32 component_id,
364 u32 component_id, 267 char *internal_name, acpi_status lookup_status);
365 char *internal_name,
366 acpi_status lookup_status);
367 268
368void 269void
369acpi_ns_report_method_error ( 270acpi_ns_report_method_error(char *module_name,
370 char *module_name, 271 u32 line_number,
371 u32 line_number, 272 u32 component_id,
372 u32 component_id, 273 char *message,
373 char *message, 274 struct acpi_namespace_node *node,
374 struct acpi_namespace_node *node, 275 char *path, acpi_status lookup_status);
375 char *path,
376 acpi_status lookup_status);
377 276
378void 277void acpi_ns_print_node_pathname(struct acpi_namespace_node *node, char *msg);
379acpi_ns_print_node_pathname (
380 struct acpi_namespace_node *node,
381 char *msg);
382 278
383acpi_status 279acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info);
384acpi_ns_build_internal_name (
385 struct acpi_namestring_info *info);
386 280
387void 281void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info);
388acpi_ns_get_internal_name_length (
389 struct acpi_namestring_info *info);
390 282
391acpi_status 283acpi_status acpi_ns_internalize_name(char *dotted_name, char **converted_name);
392acpi_ns_internalize_name (
393 char *dotted_name,
394 char **converted_name);
395 284
396acpi_status 285acpi_status
397acpi_ns_externalize_name ( 286acpi_ns_externalize_name(u32 internal_name_length,
398 u32 internal_name_length, 287 char *internal_name,
399 char *internal_name, 288 u32 * converted_name_length, char **converted_name);
400 u32 *converted_name_length,
401 char **converted_name);
402 289
403struct acpi_namespace_node * 290struct acpi_namespace_node *acpi_ns_map_handle_to_node(acpi_handle handle);
404acpi_ns_map_handle_to_node (
405 acpi_handle handle);
406 291
407acpi_handle 292acpi_handle acpi_ns_convert_entry_to_handle(struct acpi_namespace_node *node);
408acpi_ns_convert_entry_to_handle(
409 struct acpi_namespace_node *node);
410
411void
412acpi_ns_terminate (
413 void);
414 293
415struct acpi_namespace_node * 294void acpi_ns_terminate(void);
416acpi_ns_get_parent_node (
417 struct acpi_namespace_node *node);
418 295
296struct acpi_namespace_node *acpi_ns_get_parent_node(struct acpi_namespace_node
297 *node);
419 298
420struct acpi_namespace_node * 299struct acpi_namespace_node *acpi_ns_get_next_valid_node(struct
421acpi_ns_get_next_valid_node ( 300 acpi_namespace_node
422 struct acpi_namespace_node *node); 301 *node);
423 302
424#endif /* __ACNAMESP_H__ */ 303#endif /* __ACNAMESP_H__ */
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h
index e079b94e4fce..4a326ba6d482 100644
--- a/include/acpi/acobject.h
+++ b/include/acpi/acobject.h
@@ -45,7 +45,6 @@
45#ifndef _ACOBJECT_H 45#ifndef _ACOBJECT_H
46#define _ACOBJECT_H 46#define _ACOBJECT_H
47 47
48
49/* 48/*
50 * The union acpi_operand_object is used to pass AML operands from the dispatcher 49 * The union acpi_operand_object is used to pass AML operands from the dispatcher
51 * to the interpreter, and to keep track of the various handlers such as 50 * to the interpreter, and to keep track of the various handlers such as
@@ -81,7 +80,6 @@
81#define AOPOBJ_SETUP_COMPLETE 0x10 80#define AOPOBJ_SETUP_COMPLETE 0x10
82#define AOPOBJ_SINGLE_DATUM 0x20 81#define AOPOBJ_SINGLE_DATUM 0x20
83 82
84
85/* 83/*
86 * Common bitfield for the field objects 84 * Common bitfield for the field objects
87 * "Field Datum" -- a datum from the actual field object 85 * "Field Datum" -- a datum from the actual field object
@@ -96,8 +94,7 @@
96 u8 start_field_bit_offset;/* Bit offset within first field datum (0-63) */\ 94 u8 start_field_bit_offset;/* Bit offset within first field datum (0-63) */\
97 u8 access_bit_width; /* Read/Write size in bits (8-64) */\ 95 u8 access_bit_width; /* Read/Write size in bits (8-64) */\
98 u32 value; /* Value to store into the Bank or Index register */\ 96 u32 value; /* Value to store into the Bank or Index register */\
99 struct acpi_namespace_node *node; /* Link back to parent node */ 97 struct acpi_namespace_node *node; /* Link back to parent node */
100
101 98
102/* 99/*
103 * Fields common to both Strings and Buffers 100 * Fields common to both Strings and Buffers
@@ -105,15 +102,13 @@
105#define ACPI_COMMON_BUFFER_INFO \ 102#define ACPI_COMMON_BUFFER_INFO \
106 u32 length; 103 u32 length;
107 104
108
109/* 105/*
110 * Common fields for objects that support ASL notifications 106 * Common fields for objects that support ASL notifications
111 */ 107 */
112#define ACPI_COMMON_NOTIFY_INFO \ 108#define ACPI_COMMON_NOTIFY_INFO \
113 union acpi_operand_object *system_notify; /* Handler for system notifies */\ 109 union acpi_operand_object *system_notify; /* Handler for system notifies */\
114 union acpi_operand_object *device_notify; /* Handler for driver notifies */\ 110 union acpi_operand_object *device_notify; /* Handler for driver notifies */\
115 union acpi_operand_object *handler; /* Handler for Address space */ 111 union acpi_operand_object *handler; /* Handler for Address space */
116
117 112
118/****************************************************************************** 113/******************************************************************************
119 * 114 *
@@ -121,161 +116,110 @@
121 * 116 *
122 *****************************************************************************/ 117 *****************************************************************************/
123 118
124struct acpi_object_common 119struct acpi_object_common {
125{ 120ACPI_OBJECT_COMMON_HEADER};
126 ACPI_OBJECT_COMMON_HEADER
127};
128 121
129 122struct acpi_object_integer {
130struct acpi_object_integer 123 ACPI_OBJECT_COMMON_HEADER acpi_integer value;
131{
132 ACPI_OBJECT_COMMON_HEADER
133 acpi_integer value;
134}; 124};
135 125
136
137/* 126/*
138 * Note: The String and Buffer object must be identical through the Pointer 127 * Note: The String and Buffer object must be identical through the Pointer
139 * element. There is code that depends on this. 128 * element. There is code that depends on this.
140 */ 129 */
141struct acpi_object_string /* Null terminated, ASCII characters only */ 130struct acpi_object_string { /* Null terminated, ASCII characters only */
142{ 131 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO char *pointer; /* String in AML stream or allocated string */
143 ACPI_OBJECT_COMMON_HEADER
144 ACPI_COMMON_BUFFER_INFO
145 char *pointer; /* String in AML stream or allocated string */
146}; 132};
147 133
148 134struct acpi_object_buffer {
149struct acpi_object_buffer 135 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO u8 * pointer; /* Buffer in AML stream or allocated buffer */
150{ 136 struct acpi_namespace_node *node; /* Link back to parent node */
151 ACPI_OBJECT_COMMON_HEADER 137 u8 *aml_start;
152 ACPI_COMMON_BUFFER_INFO 138 u32 aml_length;
153 u8 *pointer; /* Buffer in AML stream or allocated buffer */
154 struct acpi_namespace_node *node; /* Link back to parent node */
155 u8 *aml_start;
156 u32 aml_length;
157}; 139};
158 140
159 141struct acpi_object_package {
160struct acpi_object_package 142 ACPI_OBJECT_COMMON_HEADER u32 count; /* # of elements in package */
161{ 143 u32 aml_length;
162 ACPI_OBJECT_COMMON_HEADER 144 u8 *aml_start;
163 145 struct acpi_namespace_node *node; /* Link back to parent node */
164 u32 count; /* # of elements in package */ 146 union acpi_operand_object **elements; /* Array of pointers to acpi_objects */
165 u32 aml_length;
166 u8 *aml_start;
167 struct acpi_namespace_node *node; /* Link back to parent node */
168 union acpi_operand_object **elements; /* Array of pointers to acpi_objects */
169}; 147};
170 148
171
172/****************************************************************************** 149/******************************************************************************
173 * 150 *
174 * Complex data types 151 * Complex data types
175 * 152 *
176 *****************************************************************************/ 153 *****************************************************************************/
177 154
178struct acpi_object_event 155struct acpi_object_event {
179{ 156 ACPI_OBJECT_COMMON_HEADER void *semaphore;
180 ACPI_OBJECT_COMMON_HEADER
181 void *semaphore;
182}; 157};
183 158
184
185#define ACPI_INFINITE_CONCURRENCY 0xFF 159#define ACPI_INFINITE_CONCURRENCY 0xFF
186 160
187typedef 161typedef
188acpi_status (*ACPI_INTERNAL_METHOD) ( 162acpi_status(*ACPI_INTERNAL_METHOD) (struct acpi_walk_state * walk_state);
189 struct acpi_walk_state *walk_state); 163
190 164struct acpi_object_method {
191struct acpi_object_method 165 ACPI_OBJECT_COMMON_HEADER u8 method_flags;
192{ 166 u8 param_count;
193 ACPI_OBJECT_COMMON_HEADER 167 u32 aml_length;
194 u8 method_flags; 168 void *semaphore;
195 u8 param_count; 169 u8 *aml_start;
196 u32 aml_length; 170 ACPI_INTERNAL_METHOD implementation;
197 void *semaphore; 171 u8 concurrency;
198 u8 *aml_start; 172 u8 thread_count;
199 ACPI_INTERNAL_METHOD implementation; 173 acpi_owner_id owner_id;
200 u8 concurrency;
201 u8 thread_count;
202 acpi_owner_id owning_id;
203}; 174};
204 175
205 176struct acpi_object_mutex {
206struct acpi_object_mutex 177 ACPI_OBJECT_COMMON_HEADER u8 sync_level; /* 0-15, specified in Mutex() call */
207{ 178 u16 acquisition_depth; /* Allow multiple Acquires, same thread */
208 ACPI_OBJECT_COMMON_HEADER 179 struct acpi_thread_state *owner_thread; /* Current owner of the mutex */
209 u8 sync_level; /* 0-15, specified in Mutex() call */ 180 void *semaphore; /* Actual OS synchronization object */
210 u16 acquisition_depth; /* Allow multiple Acquires, same thread */ 181 union acpi_operand_object *prev; /* Link for list of acquired mutexes */
211 struct acpi_thread_state *owner_thread; /* Current owner of the mutex */ 182 union acpi_operand_object *next; /* Link for list of acquired mutexes */
212 void *semaphore; /* Actual OS synchronization object */ 183 struct acpi_namespace_node *node; /* Containing namespace node */
213 union acpi_operand_object *prev; /* Link for list of acquired mutexes */ 184 u8 original_sync_level; /* Owner's original sync level (0-15) */
214 union acpi_operand_object *next; /* Link for list of acquired mutexes */
215 struct acpi_namespace_node *node; /* Containing namespace node */
216 u8 original_sync_level; /* Owner's original sync level (0-15) */
217}; 185};
218 186
219 187struct acpi_object_region {
220struct acpi_object_region 188 ACPI_OBJECT_COMMON_HEADER u8 space_id;
221{ 189 union acpi_operand_object *handler; /* Handler for region access */
222 ACPI_OBJECT_COMMON_HEADER 190 struct acpi_namespace_node *node; /* Containing namespace node */
223 191 union acpi_operand_object *next;
224 u8 space_id; 192 u32 length;
225 union acpi_operand_object *handler; /* Handler for region access */ 193 acpi_physical_address address;
226 struct acpi_namespace_node *node; /* Containing namespace node */
227 union acpi_operand_object *next;
228 u32 length;
229 acpi_physical_address address;
230}; 194};
231 195
232
233/****************************************************************************** 196/******************************************************************************
234 * 197 *
235 * Objects that can be notified. All share a common notify_info area. 198 * Objects that can be notified. All share a common notify_info area.
236 * 199 *
237 *****************************************************************************/ 200 *****************************************************************************/
238 201
239struct acpi_object_notify_common /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ 202struct acpi_object_notify_common { /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */
240{ 203ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO};
241 ACPI_OBJECT_COMMON_HEADER
242 ACPI_COMMON_NOTIFY_INFO
243};
244
245
246struct acpi_object_device
247{
248 ACPI_OBJECT_COMMON_HEADER
249 ACPI_COMMON_NOTIFY_INFO
250 struct acpi_gpe_block_info *gpe_block;
251};
252
253 204
254struct acpi_object_power_resource 205struct acpi_object_device {
255{
256 ACPI_OBJECT_COMMON_HEADER 206 ACPI_OBJECT_COMMON_HEADER
257 ACPI_COMMON_NOTIFY_INFO 207 ACPI_COMMON_NOTIFY_INFO struct acpi_gpe_block_info *gpe_block;
258 u32 system_level;
259 u32 resource_order;
260}; 208};
261 209
262 210struct acpi_object_power_resource {
263struct acpi_object_processor 211 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO u32 system_level;
264{ 212 u32 resource_order;
265 ACPI_OBJECT_COMMON_HEADER
266 ACPI_COMMON_NOTIFY_INFO
267 u32 proc_id;
268 u32 length;
269 acpi_io_address address;
270}; 213};
271 214
272 215struct acpi_object_processor {
273struct acpi_object_thermal_zone 216 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO u32 proc_id;
274{ 217 u32 length;
275 ACPI_OBJECT_COMMON_HEADER 218 acpi_io_address address;
276 ACPI_COMMON_NOTIFY_INFO
277}; 219};
278 220
221struct acpi_object_thermal_zone {
222ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO};
279 223
280/****************************************************************************** 224/******************************************************************************
281 * 225 *
@@ -283,90 +227,63 @@ struct acpi_object_thermal_zone
283 * 227 *
284 *****************************************************************************/ 228 *****************************************************************************/
285 229
286struct acpi_object_field_common /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ 230struct acpi_object_field_common { /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */
287{ 231 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj; /* Containing Operation Region object */
288 ACPI_OBJECT_COMMON_HEADER 232 /* (REGION/BANK fields only) */
289 ACPI_COMMON_FIELD_INFO
290 union acpi_operand_object *region_obj; /* Containing Operation Region object */
291 /* (REGION/BANK fields only) */
292}; 233};
293 234
294 235struct acpi_object_region_field {
295struct acpi_object_region_field 236 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj; /* Containing op_region object */
296{
297 ACPI_OBJECT_COMMON_HEADER
298 ACPI_COMMON_FIELD_INFO
299 union acpi_operand_object *region_obj; /* Containing op_region object */
300}; 237};
301 238
302 239struct acpi_object_bank_field {
303struct acpi_object_bank_field 240 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj; /* Containing op_region object */
304{ 241 union acpi_operand_object *bank_obj; /* bank_select Register object */
305 ACPI_OBJECT_COMMON_HEADER
306 ACPI_COMMON_FIELD_INFO
307 union acpi_operand_object *region_obj; /* Containing op_region object */
308 union acpi_operand_object *bank_obj; /* bank_select Register object */
309}; 242};
310 243
311 244struct acpi_object_index_field {
312struct acpi_object_index_field 245 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO
313{ 246 /*
314 ACPI_OBJECT_COMMON_HEADER 247 * No "region_obj" pointer needed since the Index and Data registers
315 ACPI_COMMON_FIELD_INFO 248 * are each field definitions unto themselves.
316 249 */
317 /* 250 union acpi_operand_object *index_obj; /* Index register */
318 * No "region_obj" pointer needed since the Index and Data registers 251 union acpi_operand_object *data_obj; /* Data register */
319 * are each field definitions unto themselves.
320 */
321 union acpi_operand_object *index_obj; /* Index register */
322 union acpi_operand_object *data_obj; /* Data register */
323}; 252};
324 253
325
326/* The buffer_field is different in that it is part of a Buffer, not an op_region */ 254/* The buffer_field is different in that it is part of a Buffer, not an op_region */
327 255
328struct acpi_object_buffer_field 256struct acpi_object_buffer_field {
329{ 257 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *buffer_obj; /* Containing Buffer object */
330 ACPI_OBJECT_COMMON_HEADER
331 ACPI_COMMON_FIELD_INFO
332 union acpi_operand_object *buffer_obj; /* Containing Buffer object */
333}; 258};
334 259
335
336/****************************************************************************** 260/******************************************************************************
337 * 261 *
338 * Objects for handlers 262 * Objects for handlers
339 * 263 *
340 *****************************************************************************/ 264 *****************************************************************************/
341 265
342struct acpi_object_notify_handler 266struct acpi_object_notify_handler {
343{ 267 ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *node; /* Parent device */
344 ACPI_OBJECT_COMMON_HEADER 268 acpi_notify_handler handler;
345 struct acpi_namespace_node *node; /* Parent device */ 269 void *context;
346 acpi_notify_handler handler;
347 void *context;
348}; 270};
349 271
350
351/* Flags for address handler */ 272/* Flags for address handler */
352 273
353#define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED 0x1 274#define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED 0x1
354 275
355 276struct acpi_object_addr_handler {
356struct acpi_object_addr_handler 277 ACPI_OBJECT_COMMON_HEADER u8 space_id;
357{ 278 u16 hflags;
358 ACPI_OBJECT_COMMON_HEADER 279 acpi_adr_space_handler handler;
359 u8 space_id; 280 struct acpi_namespace_node *node; /* Parent device */
360 u16 hflags; 281 void *context;
361 acpi_adr_space_handler handler; 282 acpi_adr_space_setup setup;
362 struct acpi_namespace_node *node; /* Parent device */ 283 union acpi_operand_object *region_list; /* regions using this handler */
363 void *context; 284 union acpi_operand_object *next;
364 acpi_adr_space_setup setup;
365 union acpi_operand_object *region_list; /* regions using this handler */
366 union acpi_operand_object *next;
367}; 285};
368 286
369
370/****************************************************************************** 287/******************************************************************************
371 * 288 *
372 * Special internal objects 289 * Special internal objects
@@ -377,18 +294,15 @@ struct acpi_object_addr_handler
377 * The Reference object type is used for these opcodes: 294 * The Reference object type is used for these opcodes:
378 * Arg[0-6], Local[0-7], index_op, name_op, zero_op, one_op, ones_op, debug_op 295 * Arg[0-6], Local[0-7], index_op, name_op, zero_op, one_op, ones_op, debug_op
379 */ 296 */
380struct acpi_object_reference 297struct acpi_object_reference {
381{ 298 ACPI_OBJECT_COMMON_HEADER u8 target_type; /* Used for index_op */
382 ACPI_OBJECT_COMMON_HEADER 299 u16 opcode;
383 u8 target_type; /* Used for index_op */ 300 u32 offset; /* Used for arg_op, local_op, and index_op */
384 u16 opcode; 301 void *object; /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */
385 u32 offset; /* Used for arg_op, local_op, and index_op */ 302 struct acpi_namespace_node *node;
386 void *object; /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */ 303 union acpi_operand_object **where;
387 struct acpi_namespace_node *node;
388 union acpi_operand_object **where;
389}; 304};
390 305
391
392/* 306/*
393 * Extra object is used as additional storage for types that 307 * Extra object is used as additional storage for types that
394 * have AML code in their declarations (term_args) that must be 308 * have AML code in their declarations (term_args) that must be
@@ -396,73 +310,62 @@ struct acpi_object_reference
396 * 310 *
397 * Currently: Region and field_unit types 311 * Currently: Region and field_unit types
398 */ 312 */
399struct acpi_object_extra 313struct acpi_object_extra {
400{ 314 ACPI_OBJECT_COMMON_HEADER u8 byte_fill1;
401 ACPI_OBJECT_COMMON_HEADER 315 u16 word_fill1;
402 u8 byte_fill1; 316 u32 aml_length;
403 u16 word_fill1; 317 u8 *aml_start;
404 u32 aml_length; 318 struct acpi_namespace_node *method_REG; /* _REG method for this region (if any) */
405 u8 *aml_start; 319 void *region_context; /* Region-specific data */
406 struct acpi_namespace_node *method_REG; /* _REG method for this region (if any) */
407 void *region_context; /* Region-specific data */
408}; 320};
409 321
410
411/* Additional data that can be attached to namespace nodes */ 322/* Additional data that can be attached to namespace nodes */
412 323
413struct acpi_object_data 324struct acpi_object_data {
414{ 325 ACPI_OBJECT_COMMON_HEADER acpi_object_handler handler;
415 ACPI_OBJECT_COMMON_HEADER 326 void *pointer;
416 acpi_object_handler handler;
417 void *pointer;
418}; 327};
419 328
420
421/* Structure used when objects are cached for reuse */ 329/* Structure used when objects are cached for reuse */
422 330
423struct acpi_object_cache_list 331struct acpi_object_cache_list {
424{ 332 ACPI_OBJECT_COMMON_HEADER union acpi_operand_object *next; /* Link for object cache and internal lists */
425 ACPI_OBJECT_COMMON_HEADER
426 union acpi_operand_object *next; /* Link for object cache and internal lists*/
427}; 333};
428 334
429
430/****************************************************************************** 335/******************************************************************************
431 * 336 *
432 * union acpi_operand_object Descriptor - a giant union of all of the above 337 * union acpi_operand_object Descriptor - a giant union of all of the above
433 * 338 *
434 *****************************************************************************/ 339 *****************************************************************************/
435 340
436union acpi_operand_object 341union acpi_operand_object {
437{ 342 struct acpi_object_common common;
438 struct acpi_object_common common; 343 struct acpi_object_integer integer;
439 struct acpi_object_integer integer; 344 struct acpi_object_string string;
440 struct acpi_object_string string; 345 struct acpi_object_buffer buffer;
441 struct acpi_object_buffer buffer; 346 struct acpi_object_package package;
442 struct acpi_object_package package; 347 struct acpi_object_event event;
443 struct acpi_object_event event; 348 struct acpi_object_method method;
444 struct acpi_object_method method; 349 struct acpi_object_mutex mutex;
445 struct acpi_object_mutex mutex; 350 struct acpi_object_region region;
446 struct acpi_object_region region; 351 struct acpi_object_notify_common common_notify;
447 struct acpi_object_notify_common common_notify; 352 struct acpi_object_device device;
448 struct acpi_object_device device; 353 struct acpi_object_power_resource power_resource;
449 struct acpi_object_power_resource power_resource; 354 struct acpi_object_processor processor;
450 struct acpi_object_processor processor; 355 struct acpi_object_thermal_zone thermal_zone;
451 struct acpi_object_thermal_zone thermal_zone; 356 struct acpi_object_field_common common_field;
452 struct acpi_object_field_common common_field; 357 struct acpi_object_region_field field;
453 struct acpi_object_region_field field; 358 struct acpi_object_buffer_field buffer_field;
454 struct acpi_object_buffer_field buffer_field; 359 struct acpi_object_bank_field bank_field;
455 struct acpi_object_bank_field bank_field; 360 struct acpi_object_index_field index_field;
456 struct acpi_object_index_field index_field; 361 struct acpi_object_notify_handler notify;
457 struct acpi_object_notify_handler notify; 362 struct acpi_object_addr_handler address_space;
458 struct acpi_object_addr_handler address_space; 363 struct acpi_object_reference reference;
459 struct acpi_object_reference reference; 364 struct acpi_object_extra extra;
460 struct acpi_object_extra extra; 365 struct acpi_object_data data;
461 struct acpi_object_data data; 366 struct acpi_object_cache_list cache;
462 struct acpi_object_cache_list cache;
463}; 367};
464 368
465
466/****************************************************************************** 369/******************************************************************************
467 * 370 *
468 * union acpi_descriptor - objects that share a common descriptor identifier 371 * union acpi_descriptor - objects that share a common descriptor identifier
@@ -471,7 +374,7 @@ union acpi_operand_object
471 374
472/* Object descriptor types */ 375/* Object descriptor types */
473 376
474#define ACPI_DESC_TYPE_CACHED 0x01 /* Used only when object is cached */ 377#define ACPI_DESC_TYPE_CACHED 0x01 /* Used only when object is cached */
475#define ACPI_DESC_TYPE_STATE 0x02 378#define ACPI_DESC_TYPE_STATE 0x02
476#define ACPI_DESC_TYPE_STATE_UPDATE 0x03 379#define ACPI_DESC_TYPE_STATE_UPDATE 0x03
477#define ACPI_DESC_TYPE_STATE_PACKAGE 0x04 380#define ACPI_DESC_TYPE_STATE_PACKAGE 0x04
@@ -488,14 +391,11 @@ union acpi_operand_object
488#define ACPI_DESC_TYPE_NAMED 0x0F 391#define ACPI_DESC_TYPE_NAMED 0x0F
489#define ACPI_DESC_TYPE_MAX 0x0F 392#define ACPI_DESC_TYPE_MAX 0x0F
490 393
491 394union acpi_descriptor {
492union acpi_descriptor 395 u8 descriptor_id; /* To differentiate various internal objs */
493{ 396 union acpi_operand_object object;
494 u8 descriptor_id; /* To differentiate various internal objs */\ 397 struct acpi_namespace_node node;
495 union acpi_operand_object object; 398 union acpi_parse_object op;
496 struct acpi_namespace_node node;
497 union acpi_parse_object op;
498}; 399};
499 400
500 401#endif /* _ACOBJECT_H */
501#endif /* _ACOBJECT_H */
diff --git a/include/acpi/acopcode.h b/include/acpi/acopcode.h
index 118ecba4cf05..64da42992199 100644
--- a/include/acpi/acopcode.h
+++ b/include/acpi/acopcode.h
@@ -62,7 +62,6 @@
62#define _NAM 0x6C 62#define _NAM 0x6C
63#define _PFX 0x6D 63#define _PFX 0x6D
64 64
65
66/* 65/*
67 * All AML opcodes and the parse-time arguments for each. Used by the AML 66 * All AML opcodes and the parse-time arguments for each. Used by the AML
68 * parser Each list is compressed into a 32-bit number and stored in the 67 * parser Each list is compressed into a 32-bit number and stored in the
@@ -191,7 +190,6 @@
191#define ARGP_WORD_OP ARGP_LIST1 (ARGP_WORDDATA) 190#define ARGP_WORD_OP ARGP_LIST1 (ARGP_WORDDATA)
192#define ARGP_ZERO_OP ARG_NONE 191#define ARGP_ZERO_OP ARG_NONE
193 192
194
195/* 193/*
196 * All AML opcodes and the runtime arguments for each. Used by the AML 194 * All AML opcodes and the runtime arguments for each. Used by the AML
197 * interpreter Each list is compressed into a 32-bit number and stored 195 * interpreter Each list is compressed into a 32-bit number and stored
@@ -246,7 +244,7 @@
246#define ARGI_FIELD_OP ARGI_INVALID_OPCODE 244#define ARGI_FIELD_OP ARGI_INVALID_OPCODE
247#define ARGI_FIND_SET_LEFT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF) 245#define ARGI_FIND_SET_LEFT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
248#define ARGI_FIND_SET_RIGHT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF) 246#define ARGI_FIND_SET_RIGHT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
249#define ARGI_FROM_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF) 247#define ARGI_FROM_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_FIXED_TARGET)
250#define ARGI_IF_OP ARGI_INVALID_OPCODE 248#define ARGI_IF_OP ARGI_INVALID_OPCODE
251#define ARGI_INCREMENT_OP ARGI_LIST1 (ARGI_INTEGER_REF) 249#define ARGI_INCREMENT_OP ARGI_LIST1 (ARGI_INTEGER_REF)
252#define ARGI_INDEX_FIELD_OP ARGI_INVALID_OPCODE 250#define ARGI_INDEX_FIELD_OP ARGI_INVALID_OPCODE
@@ -322,4 +320,4 @@
322#define ARGI_WORD_OP ARGI_INVALID_OPCODE 320#define ARGI_WORD_OP ARGI_INVALID_OPCODE
323#define ARGI_ZERO_OP ARG_NONE 321#define ARGI_ZERO_OP ARG_NONE
324 322
325#endif /* __ACOPCODE_H__ */ 323#endif /* __ACOPCODE_H__ */
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 2fbe180fee6b..68d7edf0f697 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -73,12 +73,10 @@
73#define ACPI_ALL_COMPONENTS 0x00003FFF 73#define ACPI_ALL_COMPONENTS 0x00003FFF
74#define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS) 74#define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS)
75 75
76
77/* Component IDs reserved for ACPI drivers */ 76/* Component IDs reserved for ACPI drivers */
78 77
79#define ACPI_ALL_DRIVERS 0xFFFF0000 78#define ACPI_ALL_DRIVERS 0xFFFF0000
80 79
81
82/* 80/*
83 * Raw debug output levels, do not use these in the DEBUG_PRINT macros 81 * Raw debug output levels, do not use these in the DEBUG_PRINT macros
84 */ 82 */
@@ -132,11 +130,10 @@
132 130
133#define ACPI_LV_VERBOSE 0xF0000000 131#define ACPI_LV_VERBOSE 0xF0000000
134 132
135
136/* 133/*
137 * Debug level macros that are used in the DEBUG_PRINT macros 134 * Debug level macros that are used in the DEBUG_PRINT macros
138 */ 135 */
139#define ACPI_DEBUG_LEVEL(dl) (u32) dl,__LINE__,&_debug_info 136#define ACPI_DEBUG_LEVEL(dl) (u32) dl,ACPI_DEBUG_PARAMETERS
140 137
141/* Exception level -- used in the global "debug_level" */ 138/* Exception level -- used in the global "debug_level" */
142 139
@@ -147,7 +144,6 @@
147#define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO) 144#define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO)
148#define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS) 145#define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS)
149 146
150
151/* Trace level -- also used in the global "debug_level" */ 147/* Trace level -- also used in the global "debug_level" */
152 148
153#define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES) 149#define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES)
@@ -174,12 +170,10 @@
174 170
175#define ACPI_DB_ALL ACPI_DEBUG_LEVEL (ACPI_LV_ALL) 171#define ACPI_DB_ALL ACPI_DEBUG_LEVEL (ACPI_LV_ALL)
176 172
177
178/* Defaults for debug_level, debug and normal */ 173/* Defaults for debug_level, debug and normal */
179 174
180#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT) 175#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT)
181#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT) 176#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT)
182#define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL) 177#define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL)
183 178
184 179#endif /* __ACOUTPUT_H__ */
185#endif /* __ACOUTPUT_H__ */
diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h
index 698276571818..d352d40de1f3 100644
--- a/include/acpi/acparser.h
+++ b/include/acpi/acparser.h
@@ -41,18 +41,15 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44
45#ifndef __ACPARSER_H__ 44#ifndef __ACPARSER_H__
46#define __ACPARSER_H__ 45#define __ACPARSER_H__
47 46
48
49#define OP_HAS_RETURN_VALUE 1 47#define OP_HAS_RETURN_VALUE 1
50 48
51/* variable # arguments */ 49/* variable # arguments */
52 50
53#define ACPI_VAR_ARGS ACPI_UINT32_MAX 51#define ACPI_VAR_ARGS ACPI_UINT32_MAX
54 52
55
56#define ACPI_PARSE_DELETE_TREE 0x0001 53#define ACPI_PARSE_DELETE_TREE 0x0001
57#define ACPI_PARSE_NO_TREE_DELETE 0x0000 54#define ACPI_PARSE_NO_TREE_DELETE 0x0000
58#define ACPI_PARSE_TREE_MASK 0x0001 55#define ACPI_PARSE_TREE_MASK 0x0001
@@ -63,7 +60,7 @@
63#define ACPI_PARSE_MODE_MASK 0x0030 60#define ACPI_PARSE_MODE_MASK 0x0030
64 61
65#define ACPI_PARSE_DEFERRED_OP 0x0100 62#define ACPI_PARSE_DEFERRED_OP 0x0100
66 63#define ACPI_PARSE_DISASSEMBLE 0x0200
67 64
68/****************************************************************************** 65/******************************************************************************
69 * 66 *
@@ -71,251 +68,165 @@
71 * 68 *
72 *****************************************************************************/ 69 *****************************************************************************/
73 70
74
75/* 71/*
76 * psxface - Parser external interfaces 72 * psxface - Parser external interfaces
77 */ 73 */
78acpi_status 74acpi_status acpi_ps_execute_method(struct acpi_parameter_info *info);
79acpi_psx_load_table (
80 u8 *pcode_addr,
81 u32 pcode_length);
82
83acpi_status
84acpi_psx_execute (
85 struct acpi_parameter_info *info);
86
87 75
88/* 76/*
89 * psargs - Parse AML opcode arguments 77 * psargs - Parse AML opcode arguments
90 */ 78 */
91u8 * 79u8 *acpi_ps_get_next_package_end(struct acpi_parse_state *parser_state);
92acpi_ps_get_next_package_end (
93 struct acpi_parse_state *parser_state);
94 80
95char * 81char *acpi_ps_get_next_namestring(struct acpi_parse_state *parser_state);
96acpi_ps_get_next_namestring (
97 struct acpi_parse_state *parser_state);
98 82
99void 83void
100acpi_ps_get_next_simple_arg ( 84acpi_ps_get_next_simple_arg(struct acpi_parse_state *parser_state,
101 struct acpi_parse_state *parser_state, 85 u32 arg_type, union acpi_parse_object *arg);
102 u32 arg_type,
103 union acpi_parse_object *arg);
104 86
105acpi_status 87acpi_status
106acpi_ps_get_next_namepath ( 88acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state,
107 struct acpi_walk_state *walk_state, 89 struct acpi_parse_state *parser_state,
108 struct acpi_parse_state *parser_state, 90 union acpi_parse_object *arg, u8 method_call);
109 union acpi_parse_object *arg,
110 u8 method_call);
111 91
112acpi_status 92acpi_status
113acpi_ps_get_next_arg ( 93acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
114 struct acpi_walk_state *walk_state, 94 struct acpi_parse_state *parser_state,
115 struct acpi_parse_state *parser_state, 95 u32 arg_type, union acpi_parse_object **return_arg);
116 u32 arg_type,
117 union acpi_parse_object **return_arg);
118
119 96
120/* 97/*
121 * psfind 98 * psfind
122 */ 99 */
123union acpi_parse_object * 100union acpi_parse_object *acpi_ps_find_name(union acpi_parse_object *scope,
124acpi_ps_find_name ( 101 u32 name, u32 opcode);
125 union acpi_parse_object *scope,
126 u32 name,
127 u32 opcode);
128
129union acpi_parse_object*
130acpi_ps_get_parent (
131 union acpi_parse_object *op);
132 102
103union acpi_parse_object *acpi_ps_get_parent(union acpi_parse_object *op);
133 104
134/* 105/*
135 * psopcode - AML Opcode information 106 * psopcode - AML Opcode information
136 */ 107 */
137const struct acpi_opcode_info * 108const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode);
138acpi_ps_get_opcode_info (
139 u16 opcode);
140
141char *
142acpi_ps_get_opcode_name (
143 u16 opcode);
144 109
110char *acpi_ps_get_opcode_name(u16 opcode);
145 111
146/* 112/*
147 * psparse - top level parsing routines 113 * psparse - top level parsing routines
148 */ 114 */
149acpi_status 115acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state);
150acpi_ps_parse_aml (
151 struct acpi_walk_state *walk_state);
152 116
153u32 117u32 acpi_ps_get_opcode_size(u32 opcode);
154acpi_ps_get_opcode_size (
155 u32 opcode);
156 118
157u16 119u16 acpi_ps_peek_opcode(struct acpi_parse_state *state);
158acpi_ps_peek_opcode (
159 struct acpi_parse_state *state);
160 120
121acpi_status
122acpi_ps_complete_this_op(struct acpi_walk_state *walk_state,
123 union acpi_parse_object *op);
124
125acpi_status
126acpi_ps_next_parse_state(struct acpi_walk_state *walk_state,
127 union acpi_parse_object *op,
128 acpi_status callback_status);
129
130/*
131 * psloop - main parse loop
132 */
133acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state);
161 134
162/* 135/*
163 * psscope - Scope stack management routines 136 * psscope - Scope stack management routines
164 */ 137 */
165acpi_status 138acpi_status
166acpi_ps_init_scope ( 139acpi_ps_init_scope(struct acpi_parse_state *parser_state,
167 struct acpi_parse_state *parser_state, 140 union acpi_parse_object *root);
168 union acpi_parse_object *root);
169 141
170union acpi_parse_object * 142union acpi_parse_object *acpi_ps_get_parent_scope(struct acpi_parse_state
171acpi_ps_get_parent_scope ( 143 *state);
172 struct acpi_parse_state *state);
173 144
174u8 145u8 acpi_ps_has_completed_scope(struct acpi_parse_state *parser_state);
175acpi_ps_has_completed_scope (
176 struct acpi_parse_state *parser_state);
177 146
178void 147void
179acpi_ps_pop_scope ( 148acpi_ps_pop_scope(struct acpi_parse_state *parser_state,
180 struct acpi_parse_state *parser_state, 149 union acpi_parse_object **op,
181 union acpi_parse_object **op, 150 u32 * arg_list, u32 * arg_count);
182 u32 *arg_list,
183 u32 *arg_count);
184 151
185acpi_status 152acpi_status
186acpi_ps_push_scope ( 153acpi_ps_push_scope(struct acpi_parse_state *parser_state,
187 struct acpi_parse_state *parser_state, 154 union acpi_parse_object *op,
188 union acpi_parse_object *op, 155 u32 remaining_args, u32 arg_count);
189 u32 remaining_args,
190 u32 arg_count);
191
192void
193acpi_ps_cleanup_scope (
194 struct acpi_parse_state *state);
195 156
157void acpi_ps_cleanup_scope(struct acpi_parse_state *state);
196 158
197/* 159/*
198 * pstree - parse tree manipulation routines 160 * pstree - parse tree manipulation routines
199 */ 161 */
200void 162void
201acpi_ps_append_arg( 163acpi_ps_append_arg(union acpi_parse_object *op, union acpi_parse_object *arg);
202 union acpi_parse_object *op,
203 union acpi_parse_object *arg);
204
205union acpi_parse_object*
206acpi_ps_find (
207 union acpi_parse_object *scope,
208 char *path,
209 u16 opcode,
210 u32 create);
211
212union acpi_parse_object *
213acpi_ps_get_arg(
214 union acpi_parse_object *op,
215 u32 argn);
216 164
217#ifdef ACPI_FUTURE_USAGE 165union acpi_parse_object *acpi_ps_find(union acpi_parse_object *scope,
218union acpi_parse_object * 166 char *path, u16 opcode, u32 create);
219acpi_ps_get_depth_next (
220 union acpi_parse_object *origin,
221 union acpi_parse_object *op);
222#endif /* ACPI_FUTURE_USAGE */
223 167
168union acpi_parse_object *acpi_ps_get_arg(union acpi_parse_object *op, u32 argn);
169
170#ifdef ACPI_FUTURE_USAGE
171union acpi_parse_object *acpi_ps_get_depth_next(union acpi_parse_object *origin,
172 union acpi_parse_object *op);
173#endif /* ACPI_FUTURE_USAGE */
224 174
225/* 175/*
226 * pswalk - parse tree walk routines 176 * pswalk - parse tree walk routines
227 */ 177 */
228acpi_status 178acpi_status
229acpi_ps_walk_parsed_aml ( 179acpi_ps_walk_parsed_aml(union acpi_parse_object *start_op,
230 union acpi_parse_object *start_op, 180 union acpi_parse_object *end_op,
231 union acpi_parse_object *end_op, 181 union acpi_operand_object *mth_desc,
232 union acpi_operand_object *mth_desc, 182 struct acpi_namespace_node *start_node,
233 struct acpi_namespace_node *start_node, 183 union acpi_operand_object **params,
234 union acpi_operand_object **params, 184 union acpi_operand_object **caller_return_desc,
235 union acpi_operand_object **caller_return_desc, 185 acpi_owner_id owner_id,
236 acpi_owner_id owner_id, 186 acpi_parse_downwards descending_callback,
237 acpi_parse_downwards descending_callback, 187 acpi_parse_upwards ascending_callback);
238 acpi_parse_upwards ascending_callback);
239
240acpi_status
241acpi_ps_get_next_walk_op (
242 struct acpi_walk_state *walk_state,
243 union acpi_parse_object *op,
244 acpi_parse_upwards ascending_callback);
245 188
246acpi_status 189acpi_status
247acpi_ps_delete_completed_op ( 190acpi_ps_get_next_walk_op(struct acpi_walk_state *walk_state,
248 struct acpi_walk_state *walk_state); 191 union acpi_parse_object *op,
192 acpi_parse_upwards ascending_callback);
249 193
250void 194acpi_status acpi_ps_delete_completed_op(struct acpi_walk_state *walk_state);
251acpi_ps_delete_parse_tree (
252 union acpi_parse_object *root);
253 195
196void acpi_ps_delete_parse_tree(union acpi_parse_object *root);
254 197
255/* 198/*
256 * psutils - parser utilities 199 * psutils - parser utilities
257 */ 200 */
258union acpi_parse_object * 201union acpi_parse_object *acpi_ps_create_scope_op(void);
259acpi_ps_create_scope_op (
260 void);
261 202
262void 203void acpi_ps_init_op(union acpi_parse_object *op, u16 opcode);
263acpi_ps_init_op (
264 union acpi_parse_object *op,
265 u16 opcode);
266 204
267union acpi_parse_object * 205union acpi_parse_object *acpi_ps_alloc_op(u16 opcode);
268acpi_ps_alloc_op (
269 u16 opcode);
270 206
271void 207void acpi_ps_free_op(union acpi_parse_object *op);
272acpi_ps_free_op (
273 union acpi_parse_object *op);
274 208
275u8 209u8 acpi_ps_is_leading_char(u32 c);
276acpi_ps_is_leading_char (
277 u32 c);
278 210
279u8 211u8 acpi_ps_is_prefix_char(u32 c);
280acpi_ps_is_prefix_char (
281 u32 c);
282 212
283#ifdef ACPI_FUTURE_USAGE 213#ifdef ACPI_FUTURE_USAGE
284u32 214u32 acpi_ps_get_name(union acpi_parse_object *op);
285acpi_ps_get_name( 215#endif /* ACPI_FUTURE_USAGE */
286 union acpi_parse_object *op);
287#endif /* ACPI_FUTURE_USAGE */
288
289void
290acpi_ps_set_name(
291 union acpi_parse_object *op,
292 u32 name);
293
294#ifdef ACPI_ENABLE_OBJECT_CACHE
295void
296acpi_ps_delete_parse_cache (
297 void);
298#endif
299 216
217void acpi_ps_set_name(union acpi_parse_object *op, u32 name);
300 218
301/* 219/*
302 * psdump - display parser tree 220 * psdump - display parser tree
303 */ 221 */
304u32 222u32
305acpi_ps_sprint_path ( 223acpi_ps_sprint_path(char *buffer_start,
306 char *buffer_start, 224 u32 buffer_size, union acpi_parse_object *op);
307 u32 buffer_size,
308 union acpi_parse_object *op);
309 225
310u32 226u32
311acpi_ps_sprint_op ( 227acpi_ps_sprint_op(char *buffer_start,
312 char *buffer_start, 228 u32 buffer_size, union acpi_parse_object *op);
313 u32 buffer_size,
314 union acpi_parse_object *op);
315
316void
317acpi_ps_show (
318 union acpi_parse_object *op);
319 229
230void acpi_ps_show(union acpi_parse_object *op);
320 231
321#endif /* __ACPARSER_H__ */ 232#endif /* __ACPARSER_H__ */
diff --git a/include/acpi/acpi.h b/include/acpi/acpi.h
index a69d78942040..ccf34f9dac64 100644
--- a/include/acpi/acpi.h
+++ b/include/acpi/acpi.h
@@ -49,22 +49,21 @@
49 * We put them here because we don't want to duplicate them 49 * We put them here because we don't want to duplicate them
50 * in the rest of the source code again and again. 50 * in the rest of the source code again and again.
51 */ 51 */
52#include "acnames.h" /* Global ACPI names and strings */ 52#include "acnames.h" /* Global ACPI names and strings */
53#include "acconfig.h" /* Configuration constants */ 53#include "acconfig.h" /* Configuration constants */
54#include "platform/acenv.h" /* Target environment specific items */ 54#include "platform/acenv.h" /* Target environment specific items */
55#include "actypes.h" /* Fundamental common data types */ 55#include "actypes.h" /* Fundamental common data types */
56#include "acexcep.h" /* ACPI exception codes */ 56#include "acexcep.h" /* ACPI exception codes */
57#include "acmacros.h" /* C macros */ 57#include "acmacros.h" /* C macros */
58#include "actbl.h" /* ACPI table definitions */ 58#include "actbl.h" /* ACPI table definitions */
59#include "aclocal.h" /* Internal data types */ 59#include "aclocal.h" /* Internal data types */
60#include "acoutput.h" /* Error output and Debug macros */ 60#include "acoutput.h" /* Error output and Debug macros */
61#include "acpiosxf.h" /* Interfaces to the ACPI-to-OS layer*/ 61#include "acpiosxf.h" /* Interfaces to the ACPI-to-OS layer */
62#include "acpixf.h" /* ACPI core subsystem external interfaces */ 62#include "acpixf.h" /* ACPI core subsystem external interfaces */
63#include "acobject.h" /* ACPI internal object */ 63#include "acobject.h" /* ACPI internal object */
64#include "acstruct.h" /* Common structures */ 64#include "acstruct.h" /* Common structures */
65#include "acglobal.h" /* All global variables */ 65#include "acglobal.h" /* All global variables */
66#include "achware.h" /* Hardware defines and interfaces */ 66#include "achware.h" /* Hardware defines and interfaces */
67#include "acutils.h" /* Utility interfaces */ 67#include "acutils.h" /* Utility interfaces */
68 68
69 69#endif /* __ACPI_H__ */
70#endif /* __ACPI_H__ */
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 8d0e1290bc76..0b54e9a4a8a1 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -35,48 +35,41 @@
35/* TBD: Make dynamic */ 35/* TBD: Make dynamic */
36#define ACPI_MAX_HANDLES 10 36#define ACPI_MAX_HANDLES 10
37struct acpi_handle_list { 37struct acpi_handle_list {
38 u32 count; 38 u32 count;
39 acpi_handle handles[ACPI_MAX_HANDLES]; 39 acpi_handle handles[ACPI_MAX_HANDLES];
40}; 40};
41 41
42
43/* acpi_utils.h */ 42/* acpi_utils.h */
44acpi_status 43acpi_status
45acpi_extract_package ( 44acpi_extract_package(union acpi_object *package,
46 union acpi_object *package, 45 struct acpi_buffer *format, struct acpi_buffer *buffer);
47 struct acpi_buffer *format,
48 struct acpi_buffer *buffer);
49acpi_status 46acpi_status
50acpi_evaluate_integer ( 47acpi_evaluate_integer(acpi_handle handle,
51 acpi_handle handle, 48 acpi_string pathname,
52 acpi_string pathname, 49 struct acpi_object_list *arguments, unsigned long *data);
53 struct acpi_object_list *arguments,
54 unsigned long *data);
55acpi_status 50acpi_status
56acpi_evaluate_reference ( 51acpi_evaluate_reference(acpi_handle handle,
57 acpi_handle handle, 52 acpi_string pathname,
58 acpi_string pathname, 53 struct acpi_object_list *arguments,
59 struct acpi_object_list *arguments, 54 struct acpi_handle_list *list);
60 struct acpi_handle_list *list);
61
62 55
63#ifdef CONFIG_ACPI_BUS 56#ifdef CONFIG_ACPI
64 57
65#include <linux/proc_fs.h> 58#include <linux/proc_fs.h>
66 59
67#define ACPI_BUS_FILE_ROOT "acpi" 60#define ACPI_BUS_FILE_ROOT "acpi"
68extern struct proc_dir_entry *acpi_root_dir; 61extern struct proc_dir_entry *acpi_root_dir;
69extern FADT_DESCRIPTOR acpi_fadt; 62extern FADT_DESCRIPTOR acpi_fadt;
70 63
71enum acpi_bus_removal_type { 64enum acpi_bus_removal_type {
72 ACPI_BUS_REMOVAL_NORMAL = 0, 65 ACPI_BUS_REMOVAL_NORMAL = 0,
73 ACPI_BUS_REMOVAL_EJECT, 66 ACPI_BUS_REMOVAL_EJECT,
74 ACPI_BUS_REMOVAL_SUPRISE, 67 ACPI_BUS_REMOVAL_SUPRISE,
75 ACPI_BUS_REMOVAL_TYPE_COUNT 68 ACPI_BUS_REMOVAL_TYPE_COUNT
76}; 69};
77 70
78enum acpi_bus_device_type { 71enum acpi_bus_device_type {
79 ACPI_BUS_TYPE_DEVICE = 0, 72 ACPI_BUS_TYPE_DEVICE = 0,
80 ACPI_BUS_TYPE_POWER, 73 ACPI_BUS_TYPE_POWER,
81 ACPI_BUS_TYPE_PROCESSOR, 74 ACPI_BUS_TYPE_PROCESSOR,
82 ACPI_BUS_TYPE_THERMAL, 75 ACPI_BUS_TYPE_THERMAL,
@@ -89,61 +82,60 @@ enum acpi_bus_device_type {
89struct acpi_driver; 82struct acpi_driver;
90struct acpi_device; 83struct acpi_device;
91 84
92
93/* 85/*
94 * ACPI Driver 86 * ACPI Driver
95 * ----------- 87 * -----------
96 */ 88 */
97 89
98typedef int (*acpi_op_add) (struct acpi_device *device); 90typedef int (*acpi_op_add) (struct acpi_device * device);
99typedef int (*acpi_op_remove) (struct acpi_device *device, int type); 91typedef int (*acpi_op_remove) (struct acpi_device * device, int type);
100typedef int (*acpi_op_lock) (struct acpi_device *device, int type); 92typedef int (*acpi_op_lock) (struct acpi_device * device, int type);
101typedef int (*acpi_op_start) (struct acpi_device *device); 93typedef int (*acpi_op_start) (struct acpi_device * device);
102typedef int (*acpi_op_stop) (struct acpi_device *device, int type); 94typedef int (*acpi_op_stop) (struct acpi_device * device, int type);
103typedef int (*acpi_op_suspend) (struct acpi_device *device, int state); 95typedef int (*acpi_op_suspend) (struct acpi_device * device, int state);
104typedef int (*acpi_op_resume) (struct acpi_device *device, int state); 96typedef int (*acpi_op_resume) (struct acpi_device * device, int state);
105typedef int (*acpi_op_scan) (struct acpi_device *device); 97typedef int (*acpi_op_scan) (struct acpi_device * device);
106typedef int (*acpi_op_bind) (struct acpi_device *device); 98typedef int (*acpi_op_bind) (struct acpi_device * device);
107typedef int (*acpi_op_unbind) (struct acpi_device *device); 99typedef int (*acpi_op_unbind) (struct acpi_device * device);
108typedef int (*acpi_op_match) (struct acpi_device *device, 100typedef int (*acpi_op_match) (struct acpi_device * device,
109 struct acpi_driver *driver); 101 struct acpi_driver * driver);
110 102
111struct acpi_bus_ops { 103struct acpi_bus_ops {
112 u32 acpi_op_add:1; 104 u32 acpi_op_add:1;
113 u32 acpi_op_remove:1; 105 u32 acpi_op_remove:1;
114 u32 acpi_op_lock:1; 106 u32 acpi_op_lock:1;
115 u32 acpi_op_start:1; 107 u32 acpi_op_start:1;
116 u32 acpi_op_stop:1; 108 u32 acpi_op_stop:1;
117 u32 acpi_op_suspend:1; 109 u32 acpi_op_suspend:1;
118 u32 acpi_op_resume:1; 110 u32 acpi_op_resume:1;
119 u32 acpi_op_scan:1; 111 u32 acpi_op_scan:1;
120 u32 acpi_op_bind:1; 112 u32 acpi_op_bind:1;
121 u32 acpi_op_unbind:1; 113 u32 acpi_op_unbind:1;
122 u32 acpi_op_match:1; 114 u32 acpi_op_match:1;
123 u32 reserved:21; 115 u32 reserved:21;
124}; 116};
125 117
126struct acpi_device_ops { 118struct acpi_device_ops {
127 acpi_op_add add; 119 acpi_op_add add;
128 acpi_op_remove remove; 120 acpi_op_remove remove;
129 acpi_op_lock lock; 121 acpi_op_lock lock;
130 acpi_op_start start; 122 acpi_op_start start;
131 acpi_op_stop stop; 123 acpi_op_stop stop;
132 acpi_op_suspend suspend; 124 acpi_op_suspend suspend;
133 acpi_op_resume resume; 125 acpi_op_resume resume;
134 acpi_op_scan scan; 126 acpi_op_scan scan;
135 acpi_op_bind bind; 127 acpi_op_bind bind;
136 acpi_op_unbind unbind; 128 acpi_op_unbind unbind;
137 acpi_op_match match; 129 acpi_op_match match;
138}; 130};
139 131
140struct acpi_driver { 132struct acpi_driver {
141 struct list_head node; 133 struct list_head node;
142 char name[80]; 134 char name[80];
143 char class[80]; 135 char class[80];
144 atomic_t references; 136 atomic_t references;
145 char *ids; /* Supported Hardware IDs */ 137 char *ids; /* Supported Hardware IDs */
146 struct acpi_device_ops ops; 138 struct acpi_device_ops ops;
147}; 139};
148 140
149/* 141/*
@@ -154,60 +146,57 @@ struct acpi_driver {
154/* Status (_STA) */ 146/* Status (_STA) */
155 147
156struct acpi_device_status { 148struct acpi_device_status {
157 u32 present:1; 149 u32 present:1;
158 u32 enabled:1; 150 u32 enabled:1;
159 u32 show_in_ui:1; 151 u32 show_in_ui:1;
160 u32 functional:1; 152 u32 functional:1;
161 u32 battery_present:1; 153 u32 battery_present:1;
162 u32 reserved:27; 154 u32 reserved:27;
163}; 155};
164 156
165
166/* Flags */ 157/* Flags */
167 158
168struct acpi_device_flags { 159struct acpi_device_flags {
169 u32 dynamic_status:1; 160 u32 dynamic_status:1;
170 u32 hardware_id:1; 161 u32 hardware_id:1;
171 u32 compatible_ids:1; 162 u32 compatible_ids:1;
172 u32 bus_address:1; 163 u32 bus_address:1;
173 u32 unique_id:1; 164 u32 unique_id:1;
174 u32 removable:1; 165 u32 removable:1;
175 u32 ejectable:1; 166 u32 ejectable:1;
176 u32 lockable:1; 167 u32 lockable:1;
177 u32 suprise_removal_ok:1; 168 u32 suprise_removal_ok:1;
178 u32 power_manageable:1; 169 u32 power_manageable:1;
179 u32 performance_manageable:1; 170 u32 performance_manageable:1;
180 u32 wake_capable:1; /* Wakeup(_PRW) supported? */ 171 u32 wake_capable:1; /* Wakeup(_PRW) supported? */
181 u32 reserved:20; 172 u32 reserved:20;
182}; 173};
183 174
184
185/* File System */ 175/* File System */
186 176
187struct acpi_device_dir { 177struct acpi_device_dir {
188 struct proc_dir_entry *entry; 178 struct proc_dir_entry *entry;
189}; 179};
190 180
191#define acpi_device_dir(d) ((d)->dir.entry) 181#define acpi_device_dir(d) ((d)->dir.entry)
192 182
193
194/* Plug and Play */ 183/* Plug and Play */
195 184
196typedef char acpi_bus_id[5]; 185typedef char acpi_bus_id[5];
197typedef unsigned long acpi_bus_address; 186typedef unsigned long acpi_bus_address;
198typedef char acpi_hardware_id[9]; 187typedef char acpi_hardware_id[9];
199typedef char acpi_unique_id[9]; 188typedef char acpi_unique_id[9];
200typedef char acpi_device_name[40]; 189typedef char acpi_device_name[40];
201typedef char acpi_device_class[20]; 190typedef char acpi_device_class[20];
202 191
203struct acpi_device_pnp { 192struct acpi_device_pnp {
204 acpi_bus_id bus_id; /* Object name */ 193 acpi_bus_id bus_id; /* Object name */
205 acpi_bus_address bus_address; /* _ADR */ 194 acpi_bus_address bus_address; /* _ADR */
206 acpi_hardware_id hardware_id; /* _HID */ 195 acpi_hardware_id hardware_id; /* _HID */
207 struct acpi_compatible_id_list *cid_list; /* _CIDs */ 196 struct acpi_compatible_id_list *cid_list; /* _CIDs */
208 acpi_unique_id unique_id; /* _UID */ 197 acpi_unique_id unique_id; /* _UID */
209 acpi_device_name device_name; /* Driver-determined */ 198 acpi_device_name device_name; /* Driver-determined */
210 acpi_device_class device_class; /* " */ 199 acpi_device_class device_class; /* " */
211}; 200};
212 201
213#define acpi_device_bid(d) ((d)->pnp.bus_id) 202#define acpi_device_bid(d) ((d)->pnp.bus_id)
@@ -217,114 +206,111 @@ struct acpi_device_pnp {
217#define acpi_device_name(d) ((d)->pnp.device_name) 206#define acpi_device_name(d) ((d)->pnp.device_name)
218#define acpi_device_class(d) ((d)->pnp.device_class) 207#define acpi_device_class(d) ((d)->pnp.device_class)
219 208
220
221/* Power Management */ 209/* Power Management */
222 210
223struct acpi_device_power_flags { 211struct acpi_device_power_flags {
224 u32 explicit_get:1; /* _PSC present? */ 212 u32 explicit_get:1; /* _PSC present? */
225 u32 power_resources:1; /* Power resources */ 213 u32 power_resources:1; /* Power resources */
226 u32 inrush_current:1; /* Serialize Dx->D0 */ 214 u32 inrush_current:1; /* Serialize Dx->D0 */
227 u32 power_removed:1; /* Optimize Dx->D0 */ 215 u32 power_removed:1; /* Optimize Dx->D0 */
228 u32 reserved:28; 216 u32 reserved:28;
229}; 217};
230 218
231struct acpi_device_power_state { 219struct acpi_device_power_state {
232 struct { 220 struct {
233 u8 valid:1; 221 u8 valid:1;
234 u8 explicit_set:1; /* _PSx present? */ 222 u8 explicit_set:1; /* _PSx present? */
235 u8 reserved:6; 223 u8 reserved:6;
236 } flags; 224 } flags;
237 int power; /* % Power (compared to D0) */ 225 int power; /* % Power (compared to D0) */
238 int latency; /* Dx->D0 time (microseconds) */ 226 int latency; /* Dx->D0 time (microseconds) */
239 struct acpi_handle_list resources; /* Power resources referenced */ 227 struct acpi_handle_list resources; /* Power resources referenced */
240}; 228};
241 229
242struct acpi_device_power { 230struct acpi_device_power {
243 int state; /* Current state */ 231 int state; /* Current state */
244 struct acpi_device_power_flags flags; 232 struct acpi_device_power_flags flags;
245 struct acpi_device_power_state states[4]; /* Power states (D0-D3) */ 233 struct acpi_device_power_state states[4]; /* Power states (D0-D3) */
246}; 234};
247 235
248
249/* Performance Management */ 236/* Performance Management */
250 237
251struct acpi_device_perf_flags { 238struct acpi_device_perf_flags {
252 u8 reserved:8; 239 u8 reserved:8;
253}; 240};
254 241
255struct acpi_device_perf_state { 242struct acpi_device_perf_state {
256 struct { 243 struct {
257 u8 valid:1; 244 u8 valid:1;
258 u8 reserved:7; 245 u8 reserved:7;
259 } flags; 246 } flags;
260 u8 power; /* % Power (compared to P0) */ 247 u8 power; /* % Power (compared to P0) */
261 u8 performance; /* % Performance ( " ) */ 248 u8 performance; /* % Performance ( " ) */
262 int latency; /* Px->P0 time (microseconds) */ 249 int latency; /* Px->P0 time (microseconds) */
263}; 250};
264 251
265struct acpi_device_perf { 252struct acpi_device_perf {
266 int state; 253 int state;
267 struct acpi_device_perf_flags flags; 254 struct acpi_device_perf_flags flags;
268 int state_count; 255 int state_count;
269 struct acpi_device_perf_state *states; 256 struct acpi_device_perf_state *states;
270}; 257};
271 258
272/* Wakeup Management */ 259/* Wakeup Management */
273struct acpi_device_wakeup_flags { 260struct acpi_device_wakeup_flags {
274 u8 valid:1; /* Can successfully enable wakeup? */ 261 u8 valid:1; /* Can successfully enable wakeup? */
275 u8 run_wake:1; /* Run-Wake GPE devices */ 262 u8 run_wake:1; /* Run-Wake GPE devices */
276}; 263};
277 264
278struct acpi_device_wakeup_state { 265struct acpi_device_wakeup_state {
279 u8 enabled:1; 266 u8 enabled:1;
280 u8 active:1; 267 u8 active:1;
281}; 268};
282 269
283struct acpi_device_wakeup { 270struct acpi_device_wakeup {
284 acpi_handle gpe_device; 271 acpi_handle gpe_device;
285 acpi_integer gpe_number;; 272 acpi_integer gpe_number;;
286 acpi_integer sleep_state; 273 acpi_integer sleep_state;
287 struct acpi_handle_list resources; 274 struct acpi_handle_list resources;
288 struct acpi_device_wakeup_state state; 275 struct acpi_device_wakeup_state state;
289 struct acpi_device_wakeup_flags flags; 276 struct acpi_device_wakeup_flags flags;
290}; 277};
291 278
292/* Device */ 279/* Device */
293 280
294struct acpi_device { 281struct acpi_device {
295 acpi_handle handle; 282 acpi_handle handle;
296 struct acpi_device *parent; 283 struct acpi_device *parent;
297 struct list_head children; 284 struct list_head children;
298 struct list_head node; 285 struct list_head node;
299 struct list_head wakeup_list; 286 struct list_head wakeup_list;
300 struct list_head g_list; 287 struct list_head g_list;
301 struct acpi_device_status status; 288 struct acpi_device_status status;
302 struct acpi_device_flags flags; 289 struct acpi_device_flags flags;
303 struct acpi_device_pnp pnp; 290 struct acpi_device_pnp pnp;
304 struct acpi_device_power power; 291 struct acpi_device_power power;
305 struct acpi_device_wakeup wakeup; 292 struct acpi_device_wakeup wakeup;
306 struct acpi_device_perf performance; 293 struct acpi_device_perf performance;
307 struct acpi_device_dir dir; 294 struct acpi_device_dir dir;
308 struct acpi_device_ops ops; 295 struct acpi_device_ops ops;
309 struct acpi_driver *driver; 296 struct acpi_driver *driver;
310 void *driver_data; 297 void *driver_data;
311 struct kobject kobj; 298 struct kobject kobj;
312}; 299};
313 300
314#define acpi_driver_data(d) ((d)->driver_data) 301#define acpi_driver_data(d) ((d)->driver_data)
315 302
316
317/* 303/*
318 * Events 304 * Events
319 * ------ 305 * ------
320 */ 306 */
321 307
322struct acpi_bus_event { 308struct acpi_bus_event {
323 struct list_head node; 309 struct list_head node;
324 acpi_device_class device_class; 310 acpi_device_class device_class;
325 acpi_bus_id bus_id; 311 acpi_bus_id bus_id;
326 u32 type; 312 u32 type;
327 u32 data; 313 u32 data;
328}; 314};
329 315
330extern struct subsystem acpi_subsys; 316extern struct subsystem acpi_subsys;
@@ -335,34 +321,32 @@ extern struct subsystem acpi_subsys;
335 321
336int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device); 322int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device);
337void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context); 323void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context);
338int acpi_bus_get_status (struct acpi_device *device); 324int acpi_bus_get_status(struct acpi_device *device);
339int acpi_bus_get_power (acpi_handle handle, int *state); 325int acpi_bus_get_power(acpi_handle handle, int *state);
340int acpi_bus_set_power (acpi_handle handle, int state); 326int acpi_bus_set_power(acpi_handle handle, int state);
341int acpi_bus_generate_event (struct acpi_device *device, u8 type, int data); 327int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data);
342int acpi_bus_receive_event (struct acpi_bus_event *event); 328int acpi_bus_receive_event(struct acpi_bus_event *event);
343int acpi_bus_register_driver (struct acpi_driver *driver); 329int acpi_bus_register_driver(struct acpi_driver *driver);
344int acpi_bus_unregister_driver (struct acpi_driver *driver); 330int acpi_bus_unregister_driver(struct acpi_driver *driver);
345int acpi_bus_add (struct acpi_device **child, struct acpi_device *parent, 331int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent,
346 acpi_handle handle, int type); 332 acpi_handle handle, int type);
347int acpi_bus_start (struct acpi_device *device); 333int acpi_bus_start(struct acpi_device *device);
348 334
349 335int acpi_match_ids(struct acpi_device *device, char *ids);
350int acpi_match_ids (struct acpi_device *device, char *ids);
351int acpi_create_dir(struct acpi_device *); 336int acpi_create_dir(struct acpi_device *);
352void acpi_remove_dir(struct acpi_device *); 337void acpi_remove_dir(struct acpi_device *);
353 338
354
355/* 339/*
356 * Bind physical devices with ACPI devices 340 * Bind physical devices with ACPI devices
357 */ 341 */
358#include <linux/device.h> 342#include <linux/device.h>
359struct acpi_bus_type { 343struct acpi_bus_type {
360 struct list_head list; 344 struct list_head list;
361 struct bus_type *bus; 345 struct bus_type *bus;
362 /* For general devices under the bus*/ 346 /* For general devices under the bus */
363 int (*find_device)(struct device *, acpi_handle*); 347 int (*find_device) (struct device *, acpi_handle *);
364 /* For bridges, such as PCI root bridge, IDE controller */ 348 /* For bridges, such as PCI root bridge, IDE controller */
365 int (*find_bridge)(struct device *, acpi_handle *); 349 int (*find_bridge) (struct device *, acpi_handle *);
366}; 350};
367int register_acpi_bus_type(struct acpi_bus_type *); 351int register_acpi_bus_type(struct acpi_bus_type *);
368int unregister_acpi_bus_type(struct acpi_bus_type *); 352int unregister_acpi_bus_type(struct acpi_bus_type *);
@@ -372,6 +356,6 @@ acpi_handle acpi_get_child(acpi_handle, acpi_integer);
372acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); 356acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int);
373#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->firmware_data)) 357#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->firmware_data))
374 358
375#endif /*CONFIG_ACPI_BUS*/ 359#endif /* CONFIG_ACPI */
376 360
377#endif /*__ACPI_BUS_H__*/ 361#endif /*__ACPI_BUS_H__*/
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index 579fe191b7e7..c1b4e1f882e4 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -29,7 +29,6 @@
29#include <linux/acpi.h> 29#include <linux/acpi.h>
30#include <acpi/acpi_bus.h> 30#include <acpi/acpi_bus.h>
31 31
32
33#define ACPI_MAX_STRING 80 32#define ACPI_MAX_STRING 80
34 33
35#define ACPI_BUS_COMPONENT 0x00010000 34#define ACPI_BUS_COMPONENT 0x00010000
@@ -44,60 +43,55 @@
44#define ACPI_BUTTON_HID_POWERF "ACPI_FPB" 43#define ACPI_BUTTON_HID_POWERF "ACPI_FPB"
45#define ACPI_BUTTON_HID_SLEEPF "ACPI_FSB" 44#define ACPI_BUTTON_HID_SLEEPF "ACPI_FSB"
46 45
47
48/* -------------------------------------------------------------------------- 46/* --------------------------------------------------------------------------
49 PCI 47 PCI
50 -------------------------------------------------------------------------- */ 48 -------------------------------------------------------------------------- */
51 49
52#ifdef CONFIG_ACPI_PCI
53
54#define ACPI_PCI_COMPONENT 0x00400000 50#define ACPI_PCI_COMPONENT 0x00400000
55 51
56/* ACPI PCI Interrupt Link (pci_link.c) */ 52/* ACPI PCI Interrupt Link (pci_link.c) */
57 53
58int acpi_irq_penalty_init (void); 54int acpi_irq_penalty_init(void);
59int acpi_pci_link_allocate_irq (acpi_handle handle, int index, int *edge_level, 55int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *edge_level,
60 int *active_high_low, char **name); 56 int *active_high_low, char **name);
61int acpi_pci_link_free_irq(acpi_handle handle); 57int acpi_pci_link_free_irq(acpi_handle handle);
62 58
63/* ACPI PCI Interrupt Routing (pci_irq.c) */ 59/* ACPI PCI Interrupt Routing (pci_irq.c) */
64 60
65int acpi_pci_irq_add_prt (acpi_handle handle, int segment, int bus); 61int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus);
66void acpi_pci_irq_del_prt (int segment, int bus); 62void acpi_pci_irq_del_prt(int segment, int bus);
67 63
68/* ACPI PCI Device Binding (pci_bind.c) */ 64/* ACPI PCI Device Binding (pci_bind.c) */
69 65
70struct pci_bus; 66struct pci_bus;
71 67
72acpi_status acpi_get_pci_id (acpi_handle handle, struct acpi_pci_id *id); 68acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id);
73int acpi_pci_bind (struct acpi_device *device); 69int acpi_pci_bind(struct acpi_device *device);
74int acpi_pci_unbind (struct acpi_device *device); 70int acpi_pci_unbind(struct acpi_device *device);
75int acpi_pci_bind_root (struct acpi_device *device, struct acpi_pci_id *id, struct pci_bus *bus); 71int acpi_pci_bind_root(struct acpi_device *device, struct acpi_pci_id *id,
72 struct pci_bus *bus);
76 73
77/* Arch-defined function to add a bus to the system */ 74/* Arch-defined function to add a bus to the system */
78 75
79struct pci_bus *pci_acpi_scan_root(struct acpi_device *device, int domain, int bus); 76struct pci_bus *pci_acpi_scan_root(struct acpi_device *device, int domain,
80 77 int bus);
81#endif /*CONFIG_ACPI_PCI*/
82
83 78
84/* -------------------------------------------------------------------------- 79/* --------------------------------------------------------------------------
85 Power Resource 80 Power Resource
86 -------------------------------------------------------------------------- */ 81 -------------------------------------------------------------------------- */
87 82
88#ifdef CONFIG_ACPI_POWER 83#ifdef CONFIG_ACPI_POWER
89int acpi_enable_wakeup_device_power (struct acpi_device *dev); 84int acpi_enable_wakeup_device_power(struct acpi_device *dev);
90int acpi_disable_wakeup_device_power (struct acpi_device *dev); 85int acpi_disable_wakeup_device_power(struct acpi_device *dev);
91int acpi_power_get_inferred_state (struct acpi_device *device); 86int acpi_power_get_inferred_state(struct acpi_device *device);
92int acpi_power_transition (struct acpi_device *device, int state); 87int acpi_power_transition(struct acpi_device *device, int state);
93#endif 88#endif
94 89
95
96/* -------------------------------------------------------------------------- 90/* --------------------------------------------------------------------------
97 Embedded Controller 91 Embedded Controller
98 -------------------------------------------------------------------------- */ 92 -------------------------------------------------------------------------- */
99#ifdef CONFIG_ACPI_EC 93#ifdef CONFIG_ACPI_EC
100int acpi_ec_ecdt_probe (void); 94int acpi_ec_ecdt_probe(void);
101#endif 95#endif
102 96
103/* -------------------------------------------------------------------------- 97/* --------------------------------------------------------------------------
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index ea489f235216..98e0b8cd14ed 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -7,7 +7,6 @@
7 * 7 *
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
10
11/* 10/*
12 * Copyright (C) 2000 - 2005, R. Byron Moore 11 * Copyright (C) 2000 - 2005, R. Byron Moore
13 * All rights reserved. 12 * All rights reserved.
@@ -51,7 +50,6 @@
51#include "platform/acenv.h" 50#include "platform/acenv.h"
52#include "actypes.h" 51#include "actypes.h"
53 52
54
55/* Priorities for acpi_os_queue_for_execution */ 53/* Priorities for acpi_os_queue_for_execution */
56 54
57#define OSD_PRIORITY_GPE 1 55#define OSD_PRIORITY_GPE 1
@@ -62,200 +60,136 @@
62#define ACPI_NO_UNIT_LIMIT ((u32) -1) 60#define ACPI_NO_UNIT_LIMIT ((u32) -1)
63#define ACPI_MUTEX_SEM 1 61#define ACPI_MUTEX_SEM 1
64 62
65
66/* Functions for acpi_os_signal */ 63/* Functions for acpi_os_signal */
67 64
68#define ACPI_SIGNAL_FATAL 0 65#define ACPI_SIGNAL_FATAL 0
69#define ACPI_SIGNAL_BREAKPOINT 1 66#define ACPI_SIGNAL_BREAKPOINT 1
70 67
71struct acpi_signal_fatal_info 68struct acpi_signal_fatal_info {
72{ 69 u32 type;
73 u32 type; 70 u32 code;
74 u32 code; 71 u32 argument;
75 u32 argument;
76}; 72};
77 73
78
79/* 74/*
80 * OSL Initialization and shutdown primitives 75 * OSL Initialization and shutdown primitives
81 */ 76 */
82acpi_status 77acpi_status acpi_os_initialize(void);
83acpi_os_initialize (
84 void);
85
86acpi_status
87acpi_os_terminate (
88 void);
89 78
79acpi_status acpi_os_terminate(void);
90 80
91/* 81/*
92 * ACPI Table interfaces 82 * ACPI Table interfaces
93 */ 83 */
94acpi_status 84acpi_status acpi_os_get_root_pointer(u32 flags, struct acpi_pointer *address);
95acpi_os_get_root_pointer (
96 u32 flags,
97 struct acpi_pointer *address);
98 85
99acpi_status 86acpi_status
100acpi_os_predefined_override ( 87acpi_os_predefined_override(const struct acpi_predefined_names *init_val,
101 const struct acpi_predefined_names *init_val, 88 acpi_string * new_val);
102 acpi_string *new_val);
103 89
104acpi_status 90acpi_status
105acpi_os_table_override ( 91acpi_os_table_override(struct acpi_table_header *existing_table,
106 struct acpi_table_header *existing_table, 92 struct acpi_table_header **new_table);
107 struct acpi_table_header **new_table);
108
109 93
110/* 94/*
111 * Synchronization primitives 95 * Synchronization primitives
112 */ 96 */
113acpi_status 97acpi_status
114acpi_os_create_semaphore ( 98acpi_os_create_semaphore(u32 max_units,
115 u32 max_units, 99 u32 initial_units, acpi_handle * out_handle);
116 u32 initial_units,
117 acpi_handle *out_handle);
118
119acpi_status
120acpi_os_delete_semaphore (
121 acpi_handle handle);
122 100
123acpi_status 101acpi_status acpi_os_delete_semaphore(acpi_handle handle);
124acpi_os_wait_semaphore (
125 acpi_handle handle,
126 u32 units,
127 u16 timeout);
128 102
129acpi_status 103acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout);
130acpi_os_signal_semaphore (
131 acpi_handle handle,
132 u32 units);
133 104
134acpi_status 105acpi_status acpi_os_signal_semaphore(acpi_handle handle, u32 units);
135acpi_os_create_lock (
136 acpi_handle *out_handle);
137 106
138void 107acpi_status acpi_os_create_lock(acpi_handle * out_handle);
139acpi_os_delete_lock (
140 acpi_handle handle);
141 108
142void 109void acpi_os_delete_lock(acpi_handle handle);
143acpi_os_acquire_lock (
144 acpi_handle handle,
145 u32 flags);
146 110
147void 111unsigned long acpi_os_acquire_lock(acpi_handle handle);
148acpi_os_release_lock (
149 acpi_handle handle,
150 u32 flags);
151 112
113void acpi_os_release_lock(acpi_handle handle, unsigned long flags);
152 114
153/* 115/*
154 * Memory allocation and mapping 116 * Memory allocation and mapping
155 */ 117 */
156void * 118void *acpi_os_allocate(acpi_size size);
157acpi_os_allocate (
158 acpi_size size);
159 119
160void 120void acpi_os_free(void *memory);
161acpi_os_free (
162 void * memory);
163 121
164acpi_status 122acpi_status
165acpi_os_map_memory ( 123acpi_os_map_memory(acpi_physical_address physical_address,
166 acpi_physical_address physical_address, 124 acpi_size size, void __iomem ** logical_address);
167 acpi_size size,
168 void __iomem **logical_address);
169 125
170void 126void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size);
171acpi_os_unmap_memory (
172 void __iomem *logical_address,
173 acpi_size size);
174 127
175#ifdef ACPI_FUTURE_USAGE 128#ifdef ACPI_FUTURE_USAGE
176acpi_status 129acpi_status
177acpi_os_get_physical_address ( 130acpi_os_get_physical_address(void *logical_address,
178 void *logical_address, 131 acpi_physical_address * physical_address);
179 acpi_physical_address *physical_address);
180#endif 132#endif
181 133
134/*
135 * Memory/Object Cache
136 */
137acpi_status
138acpi_os_create_cache(char *cache_name,
139 u16 object_size,
140 u16 max_depth, acpi_cache_t ** return_cache);
141
142acpi_status acpi_os_delete_cache(acpi_cache_t * cache);
143
144acpi_status acpi_os_purge_cache(acpi_cache_t * cache);
145
146void *acpi_os_acquire_object(acpi_cache_t * cache);
147
148acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object);
182 149
183/* 150/*
184 * Interrupt handlers 151 * Interrupt handlers
185 */ 152 */
186acpi_status 153acpi_status
187acpi_os_install_interrupt_handler ( 154acpi_os_install_interrupt_handler(u32 gsi,
188 u32 gsi, 155 acpi_osd_handler service_routine,
189 acpi_osd_handler service_routine, 156 void *context);
190 void *context);
191 157
192acpi_status 158acpi_status
193acpi_os_remove_interrupt_handler ( 159acpi_os_remove_interrupt_handler(u32 gsi, acpi_osd_handler service_routine);
194 u32 gsi,
195 acpi_osd_handler service_routine);
196
197 160
198/* 161/*
199 * Threads and Scheduling 162 * Threads and Scheduling
200 */ 163 */
201u32 164u32 acpi_os_get_thread_id(void);
202acpi_os_get_thread_id (
203 void);
204 165
205acpi_status 166acpi_status
206acpi_os_queue_for_execution ( 167acpi_os_queue_for_execution(u32 priority,
207 u32 priority, 168 acpi_osd_exec_callback function, void *context);
208 acpi_osd_exec_callback function,
209 void *context);
210 169
211void 170void acpi_os_wait_events_complete(void *context);
212acpi_os_wait_events_complete(
213 void * context);
214 171
215void 172void acpi_os_wait_events_complete(void *context);
216acpi_os_wait_events_complete (
217 void *context);
218 173
219void 174void acpi_os_sleep(acpi_integer milliseconds);
220acpi_os_sleep (
221 acpi_integer milliseconds);
222
223void
224acpi_os_stall (
225 u32 microseconds);
226 175
176void acpi_os_stall(u32 microseconds);
227 177
228/* 178/*
229 * Platform and hardware-independent I/O interfaces 179 * Platform and hardware-independent I/O interfaces
230 */ 180 */
231acpi_status 181acpi_status acpi_os_read_port(acpi_io_address address, u32 * value, u32 width);
232acpi_os_read_port (
233 acpi_io_address address,
234 u32 *value,
235 u32 width);
236
237acpi_status
238acpi_os_write_port (
239 acpi_io_address address,
240 u32 value,
241 u32 width);
242 182
183acpi_status acpi_os_write_port(acpi_io_address address, u32 value, u32 width);
243 184
244/* 185/*
245 * Platform and hardware-independent physical memory interfaces 186 * Platform and hardware-independent physical memory interfaces
246 */ 187 */
247acpi_status 188acpi_status
248acpi_os_read_memory ( 189acpi_os_read_memory(acpi_physical_address address, u32 * value, u32 width);
249 acpi_physical_address address,
250 u32 *value,
251 u32 width);
252 190
253acpi_status 191acpi_status
254acpi_os_write_memory ( 192acpi_os_write_memory(acpi_physical_address address, u32 value, u32 width);
255 acpi_physical_address address,
256 u32 value,
257 u32 width);
258
259 193
260/* 194/*
261 * Platform and hardware-independent PCI configuration space access 195 * Platform and hardware-independent PCI configuration space access
@@ -263,111 +197,69 @@ acpi_os_write_memory (
263 * certain compilers complain. 197 * certain compilers complain.
264 */ 198 */
265acpi_status 199acpi_status
266acpi_os_read_pci_configuration ( 200acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id,
267 struct acpi_pci_id *pci_id, 201 u32 reg, void *value, u32 width);
268 u32 reg,
269 void *value,
270 u32 width);
271 202
272acpi_status 203acpi_status
273acpi_os_write_pci_configuration ( 204acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id,
274 struct acpi_pci_id *pci_id, 205 u32 reg, acpi_integer value, u32 width);
275 u32 reg,
276 acpi_integer value,
277 u32 width);
278 206
279/* 207/*
280 * Interim function needed for PCI IRQ routing 208 * Interim function needed for PCI IRQ routing
281 */ 209 */
282void 210void
283acpi_os_derive_pci_id( 211acpi_os_derive_pci_id(acpi_handle rhandle,
284 acpi_handle rhandle, 212 acpi_handle chandle, struct acpi_pci_id **pci_id);
285 acpi_handle chandle,
286 struct acpi_pci_id **pci_id);
287 213
288/* 214/*
289 * Miscellaneous 215 * Miscellaneous
290 */ 216 */
291u8 217u8 acpi_os_readable(void *pointer, acpi_size length);
292acpi_os_readable (
293 void *pointer,
294 acpi_size length);
295 218
296#ifdef ACPI_FUTURE_USAGE 219#ifdef ACPI_FUTURE_USAGE
297u8 220u8 acpi_os_writable(void *pointer, acpi_size length);
298acpi_os_writable (
299 void *pointer,
300 acpi_size length);
301#endif 221#endif
302 222
303u64 223u64 acpi_os_get_timer(void);
304acpi_os_get_timer (
305 void);
306 224
307acpi_status 225acpi_status acpi_os_signal(u32 function, void *info);
308acpi_os_signal (
309 u32 function,
310 void *info);
311 226
312/* 227/*
313 * Debug print routines 228 * Debug print routines
314 */ 229 */
315void ACPI_INTERNAL_VAR_XFACE 230void ACPI_INTERNAL_VAR_XFACE acpi_os_printf(const char *format, ...);
316acpi_os_printf (
317 const char *format,
318 ...);
319
320void
321acpi_os_vprintf (
322 const char *format,
323 va_list args);
324 231
325void 232void acpi_os_vprintf(const char *format, va_list args);
326acpi_os_redirect_output (
327 void *destination);
328 233
234void acpi_os_redirect_output(void *destination);
329 235
330#ifdef ACPI_FUTURE_USAGE 236#ifdef ACPI_FUTURE_USAGE
331/* 237/*
332 * Debug input 238 * Debug input
333 */ 239 */
334u32 240u32 acpi_os_get_line(char *buffer);
335acpi_os_get_line (
336 char *buffer);
337#endif 241#endif
338 242
339
340/* 243/*
341 * Directory manipulation 244 * Directory manipulation
342 */ 245 */
343void * 246void *acpi_os_open_directory(char *pathname,
344acpi_os_open_directory ( 247 char *wildcard_spec, char requested_file_type);
345 char *pathname,
346 char *wildcard_spec,
347 char requested_file_type);
348 248
349/* requeste_file_type values */ 249/* requeste_file_type values */
350 250
351#define REQUEST_FILE_ONLY 0 251#define REQUEST_FILE_ONLY 0
352#define REQUEST_DIR_ONLY 1 252#define REQUEST_DIR_ONLY 1
353 253
254char *acpi_os_get_next_filename(void *dir_handle);
354 255
355char * 256void acpi_os_close_directory(void *dir_handle);
356acpi_os_get_next_filename (
357 void *dir_handle);
358
359void
360acpi_os_close_directory (
361 void *dir_handle);
362 257
363/* 258/*
364 * Debug 259 * Debug
365 */ 260 */
366void 261void
367acpi_os_dbg_assert( 262acpi_os_dbg_assert(void *failed_assertion,
368 void *failed_assertion, 263 void *file_name, u32 line_number, char *message);
369 void *file_name,
370 u32 line_number,
371 char *message);
372 264
373#endif /* __ACPIOSXF_H__ */ 265#endif /* __ACPIOSXF_H__ */
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index f8f619f8e4f8..2a9dbc13b0f2 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -42,447 +42,283 @@
42 * POSSIBILITY OF SUCH DAMAGES. 42 * POSSIBILITY OF SUCH DAMAGES.
43 */ 43 */
44 44
45
46#ifndef __ACXFACE_H__ 45#ifndef __ACXFACE_H__
47#define __ACXFACE_H__ 46#define __ACXFACE_H__
48 47
49#include "actypes.h" 48#include "actypes.h"
50#include "actbl.h" 49#include "actbl.h"
51 50
52
53/* 51/*
54 * Global interfaces 52 * Global interfaces
55 */ 53 */
56acpi_status 54acpi_status acpi_initialize_subsystem(void);
57acpi_initialize_subsystem (
58 void);
59 55
60acpi_status 56acpi_status acpi_enable_subsystem(u32 flags);
61acpi_enable_subsystem (
62 u32 flags);
63 57
64acpi_status 58acpi_status acpi_initialize_objects(u32 flags);
65acpi_initialize_objects (
66 u32 flags);
67 59
68acpi_status 60acpi_status acpi_terminate(void);
69acpi_terminate (
70 void);
71 61
72#ifdef ACPI_FUTURE_USAGE 62#ifdef ACPI_FUTURE_USAGE
73acpi_status 63acpi_status acpi_subsystem_status(void);
74acpi_subsystem_status (
75 void);
76#endif 64#endif
77 65
78acpi_status 66acpi_status acpi_enable(void);
79acpi_enable (
80 void);
81 67
82acpi_status 68acpi_status acpi_disable(void);
83acpi_disable (
84 void);
85 69
86#ifdef ACPI_FUTURE_USAGE 70#ifdef ACPI_FUTURE_USAGE
87acpi_status 71acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer);
88acpi_get_system_info (
89 struct acpi_buffer *ret_buffer);
90#endif 72#endif
91 73
92const char * 74const char *acpi_format_exception(acpi_status exception);
93acpi_format_exception (
94 acpi_status exception);
95 75
96acpi_status 76acpi_status acpi_purge_cached_objects(void);
97acpi_purge_cached_objects (
98 void);
99 77
100#ifdef ACPI_FUTURE_USAGE 78#ifdef ACPI_FUTURE_USAGE
101acpi_status 79acpi_status
102acpi_install_initialization_handler ( 80acpi_install_initialization_handler(acpi_init_handler handler, u32 function);
103 acpi_init_handler handler,
104 u32 function);
105#endif 81#endif
106 82
107/* 83/*
108 * ACPI Memory managment 84 * ACPI Memory managment
109 */ 85 */
110void * 86void *acpi_allocate(u32 size);
111acpi_allocate (
112 u32 size);
113
114void *
115acpi_callocate (
116 u32 size);
117 87
118void 88void *acpi_callocate(u32 size);
119acpi_free (
120 void *address);
121 89
90void acpi_free(void *address);
122 91
123/* 92/*
124 * ACPI table manipulation interfaces 93 * ACPI table manipulation interfaces
125 */ 94 */
126acpi_status 95acpi_status
127acpi_find_root_pointer ( 96acpi_find_root_pointer(u32 flags, struct acpi_pointer *rsdp_address);
128 u32 flags,
129 struct acpi_pointer *rsdp_address);
130 97
131acpi_status 98acpi_status acpi_load_tables(void);
132acpi_load_tables (
133 void);
134 99
135#ifdef ACPI_FUTURE_USAGE 100#ifdef ACPI_FUTURE_USAGE
136acpi_status 101acpi_status acpi_load_table(struct acpi_table_header *table_ptr);
137acpi_load_table (
138 struct acpi_table_header *table_ptr);
139 102
140acpi_status 103acpi_status acpi_unload_table(acpi_table_type table_type);
141acpi_unload_table (
142 acpi_table_type table_type);
143 104
144acpi_status 105acpi_status
145acpi_get_table_header ( 106acpi_get_table_header(acpi_table_type table_type,
146 acpi_table_type table_type, 107 u32 instance, struct acpi_table_header *out_table_header);
147 u32 instance, 108#endif /* ACPI_FUTURE_USAGE */
148 struct acpi_table_header *out_table_header);
149#endif /* ACPI_FUTURE_USAGE */
150 109
151acpi_status 110acpi_status
152acpi_get_table ( 111acpi_get_table(acpi_table_type table_type,
153 acpi_table_type table_type, 112 u32 instance, struct acpi_buffer *ret_buffer);
154 u32 instance,
155 struct acpi_buffer *ret_buffer);
156 113
157acpi_status 114acpi_status
158acpi_get_firmware_table ( 115acpi_get_firmware_table(acpi_string signature,
159 acpi_string signature, 116 u32 instance,
160 u32 instance, 117 u32 flags, struct acpi_table_header **table_pointer);
161 u32 flags,
162 struct acpi_table_header **table_pointer);
163
164 118
165/* 119/*
166 * Namespace and name interfaces 120 * Namespace and name interfaces
167 */ 121 */
168acpi_status 122acpi_status
169acpi_walk_namespace ( 123acpi_walk_namespace(acpi_object_type type,
170 acpi_object_type type, 124 acpi_handle start_object,
171 acpi_handle start_object, 125 u32 max_depth,
172 u32 max_depth, 126 acpi_walk_callback user_function,
173 acpi_walk_callback user_function, 127 void *context, void **return_value);
174 void *context,
175 void **return_value);
176 128
177acpi_status 129acpi_status
178acpi_get_devices ( 130acpi_get_devices(char *HID,
179 char *HID, 131 acpi_walk_callback user_function,
180 acpi_walk_callback user_function, 132 void *context, void **return_value);
181 void *context,
182 void **return_value);
183 133
184acpi_status 134acpi_status
185acpi_get_name ( 135acpi_get_name(acpi_handle handle,
186 acpi_handle handle, 136 u32 name_type, struct acpi_buffer *ret_path_ptr);
187 u32 name_type,
188 struct acpi_buffer *ret_path_ptr);
189 137
190acpi_status 138acpi_status
191acpi_get_handle ( 139acpi_get_handle(acpi_handle parent,
192 acpi_handle parent, 140 acpi_string pathname, acpi_handle * ret_handle);
193 acpi_string pathname,
194 acpi_handle *ret_handle);
195 141
196acpi_status 142acpi_status
197acpi_attach_data ( 143acpi_attach_data(acpi_handle obj_handle,
198 acpi_handle obj_handle, 144 acpi_object_handler handler, void *data);
199 acpi_object_handler handler,
200 void *data);
201 145
202acpi_status 146acpi_status
203acpi_detach_data ( 147acpi_detach_data(acpi_handle obj_handle, acpi_object_handler handler);
204 acpi_handle obj_handle,
205 acpi_object_handler handler);
206 148
207acpi_status 149acpi_status
208acpi_get_data ( 150acpi_get_data(acpi_handle obj_handle, acpi_object_handler handler, void **data);
209 acpi_handle obj_handle,
210 acpi_object_handler handler,
211 void **data);
212
213 151
214/* 152/*
215 * Object manipulation and enumeration 153 * Object manipulation and enumeration
216 */ 154 */
217acpi_status 155acpi_status
218acpi_evaluate_object ( 156acpi_evaluate_object(acpi_handle object,
219 acpi_handle object, 157 acpi_string pathname,
220 acpi_string pathname, 158 struct acpi_object_list *parameter_objects,
221 struct acpi_object_list *parameter_objects, 159 struct acpi_buffer *return_object_buffer);
222 struct acpi_buffer *return_object_buffer);
223 160
224#ifdef ACPI_FUTURE_USAGE 161#ifdef ACPI_FUTURE_USAGE
225acpi_status 162acpi_status
226acpi_evaluate_object_typed ( 163acpi_evaluate_object_typed(acpi_handle object,
227 acpi_handle object, 164 acpi_string pathname,
228 acpi_string pathname, 165 struct acpi_object_list *external_params,
229 struct acpi_object_list *external_params, 166 struct acpi_buffer *return_buffer,
230 struct acpi_buffer *return_buffer, 167 acpi_object_type return_type);
231 acpi_object_type return_type);
232#endif 168#endif
233 169
234acpi_status 170acpi_status
235acpi_get_object_info ( 171acpi_get_object_info(acpi_handle handle, struct acpi_buffer *return_buffer);
236 acpi_handle handle,
237 struct acpi_buffer *return_buffer);
238 172
239acpi_status 173acpi_status
240acpi_get_next_object ( 174acpi_get_next_object(acpi_object_type type,
241 acpi_object_type type, 175 acpi_handle parent,
242 acpi_handle parent, 176 acpi_handle child, acpi_handle * out_handle);
243 acpi_handle child,
244 acpi_handle *out_handle);
245 177
246acpi_status 178acpi_status acpi_get_type(acpi_handle object, acpi_object_type * out_type);
247acpi_get_type (
248 acpi_handle object,
249 acpi_object_type *out_type);
250
251acpi_status
252acpi_get_parent (
253 acpi_handle object,
254 acpi_handle *out_handle);
255 179
180acpi_status acpi_get_parent(acpi_handle object, acpi_handle * out_handle);
256 181
257/* 182/*
258 * Event handler interfaces 183 * Event handler interfaces
259 */ 184 */
260acpi_status 185acpi_status
261acpi_install_fixed_event_handler ( 186acpi_install_fixed_event_handler(u32 acpi_event,
262 u32 acpi_event, 187 acpi_event_handler handler, void *context);
263 acpi_event_handler handler,
264 void *context);
265 188
266acpi_status 189acpi_status
267acpi_remove_fixed_event_handler ( 190acpi_remove_fixed_event_handler(u32 acpi_event, acpi_event_handler handler);
268 u32 acpi_event,
269 acpi_event_handler handler);
270 191
271acpi_status 192acpi_status
272acpi_install_notify_handler ( 193acpi_install_notify_handler(acpi_handle device,
273 acpi_handle device, 194 u32 handler_type,
274 u32 handler_type, 195 acpi_notify_handler handler, void *context);
275 acpi_notify_handler handler,
276 void *context);
277 196
278acpi_status 197acpi_status
279acpi_remove_notify_handler ( 198acpi_remove_notify_handler(acpi_handle device,
280 acpi_handle device, 199 u32 handler_type, acpi_notify_handler handler);
281 u32 handler_type,
282 acpi_notify_handler handler);
283 200
284acpi_status 201acpi_status
285acpi_install_address_space_handler ( 202acpi_install_address_space_handler(acpi_handle device,
286 acpi_handle device, 203 acpi_adr_space_type space_id,
287 acpi_adr_space_type space_id, 204 acpi_adr_space_handler handler,
288 acpi_adr_space_handler handler, 205 acpi_adr_space_setup setup, void *context);
289 acpi_adr_space_setup setup,
290 void *context);
291 206
292acpi_status 207acpi_status
293acpi_remove_address_space_handler ( 208acpi_remove_address_space_handler(acpi_handle device,
294 acpi_handle device, 209 acpi_adr_space_type space_id,
295 acpi_adr_space_type space_id, 210 acpi_adr_space_handler handler);
296 acpi_adr_space_handler handler);
297 211
298acpi_status 212acpi_status
299acpi_install_gpe_handler ( 213acpi_install_gpe_handler(acpi_handle gpe_device,
300 acpi_handle gpe_device, 214 u32 gpe_number,
301 u32 gpe_number, 215 u32 type, acpi_event_handler address, void *context);
302 u32 type,
303 acpi_event_handler address,
304 void *context);
305 216
306#ifdef ACPI_FUTURE_USAGE 217#ifdef ACPI_FUTURE_USAGE
307acpi_status 218acpi_status acpi_install_exception_handler(acpi_exception_handler handler);
308acpi_install_exception_handler (
309 acpi_exception_handler handler);
310#endif 219#endif
311 220
312
313/* 221/*
314 * Event interfaces 222 * Event interfaces
315 */ 223 */
316acpi_status 224acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle);
317acpi_acquire_global_lock (
318 u16 timeout,
319 u32 *handle);
320 225
321acpi_status 226acpi_status acpi_release_global_lock(u32 handle);
322acpi_release_global_lock (
323 u32 handle);
324 227
325acpi_status 228acpi_status
326acpi_remove_gpe_handler ( 229acpi_remove_gpe_handler(acpi_handle gpe_device,
327 acpi_handle gpe_device, 230 u32 gpe_number, acpi_event_handler address);
328 u32 gpe_number,
329 acpi_event_handler address);
330 231
331acpi_status 232acpi_status acpi_enable_event(u32 event, u32 flags);
332acpi_enable_event (
333 u32 event,
334 u32 flags);
335 233
336acpi_status 234acpi_status acpi_disable_event(u32 event, u32 flags);
337acpi_disable_event (
338 u32 event,
339 u32 flags);
340 235
341acpi_status 236acpi_status acpi_clear_event(u32 event);
342acpi_clear_event (
343 u32 event);
344 237
345#ifdef ACPI_FUTURE_USAGE 238#ifdef ACPI_FUTURE_USAGE
346acpi_status 239acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status);
347acpi_get_event_status ( 240#endif /* ACPI_FUTURE_USAGE */
348 u32 event,
349 acpi_event_status *event_status);
350#endif /* ACPI_FUTURE_USAGE */
351 241
352acpi_status 242acpi_status acpi_set_gpe_type(acpi_handle gpe_device, u32 gpe_number, u8 type);
353acpi_set_gpe_type (
354 acpi_handle gpe_device,
355 u32 gpe_number,
356 u8 type);
357 243
358acpi_status 244acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags);
359acpi_enable_gpe (
360 acpi_handle gpe_device,
361 u32 gpe_number,
362 u32 flags);
363 245
364acpi_status 246acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags);
365acpi_disable_gpe (
366 acpi_handle gpe_device,
367 u32 gpe_number,
368 u32 flags);
369 247
370acpi_status 248acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags);
371acpi_clear_gpe (
372 acpi_handle gpe_device,
373 u32 gpe_number,
374 u32 flags);
375 249
376#ifdef ACPI_FUTURE_USAGE 250#ifdef ACPI_FUTURE_USAGE
377acpi_status 251acpi_status
378acpi_get_gpe_status ( 252acpi_get_gpe_status(acpi_handle gpe_device,
379 acpi_handle gpe_device, 253 u32 gpe_number,
380 u32 gpe_number, 254 u32 flags, acpi_event_status * event_status);
381 u32 flags, 255#endif /* ACPI_FUTURE_USAGE */
382 acpi_event_status *event_status);
383#endif /* ACPI_FUTURE_USAGE */
384 256
385acpi_status 257acpi_status
386acpi_install_gpe_block ( 258acpi_install_gpe_block(acpi_handle gpe_device,
387 acpi_handle gpe_device, 259 struct acpi_generic_address *gpe_block_address,
388 struct acpi_generic_address *gpe_block_address, 260 u32 register_count, u32 interrupt_number);
389 u32 register_count,
390 u32 interrupt_level);
391
392acpi_status
393acpi_remove_gpe_block (
394 acpi_handle gpe_device);
395 261
262acpi_status acpi_remove_gpe_block(acpi_handle gpe_device);
396 263
397/* 264/*
398 * Resource interfaces 265 * Resource interfaces
399 */ 266 */
400typedef 267typedef
401acpi_status (*ACPI_WALK_RESOURCE_CALLBACK) ( 268acpi_status(*ACPI_WALK_RESOURCE_CALLBACK) (struct acpi_resource * resource,
402 struct acpi_resource *resource, 269 void *context);
403 void *context);
404
405 270
406acpi_status 271acpi_status
407acpi_get_current_resources( 272acpi_get_current_resources(acpi_handle device_handle,
408 acpi_handle device_handle, 273 struct acpi_buffer *ret_buffer);
409 struct acpi_buffer *ret_buffer);
410 274
411#ifdef ACPI_FUTURE_USAGE 275#ifdef ACPI_FUTURE_USAGE
412acpi_status 276acpi_status
413acpi_get_possible_resources( 277acpi_get_possible_resources(acpi_handle device_handle,
414 acpi_handle device_handle, 278 struct acpi_buffer *ret_buffer);
415 struct acpi_buffer *ret_buffer);
416#endif 279#endif
417 280
418acpi_status 281acpi_status
419acpi_walk_resources ( 282acpi_walk_resources(acpi_handle device_handle,
420 acpi_handle device_handle, 283 char *path,
421 char *path, 284 ACPI_WALK_RESOURCE_CALLBACK user_function, void *context);
422 ACPI_WALK_RESOURCE_CALLBACK user_function,
423 void *context);
424 285
425acpi_status 286acpi_status
426acpi_set_current_resources ( 287acpi_set_current_resources(acpi_handle device_handle,
427 acpi_handle device_handle, 288 struct acpi_buffer *in_buffer);
428 struct acpi_buffer *in_buffer);
429 289
430acpi_status 290acpi_status
431acpi_get_irq_routing_table ( 291acpi_get_irq_routing_table(acpi_handle bus_device_handle,
432 acpi_handle bus_device_handle, 292 struct acpi_buffer *ret_buffer);
433 struct acpi_buffer *ret_buffer);
434 293
435acpi_status 294acpi_status
436acpi_resource_to_address64 ( 295acpi_resource_to_address64(struct acpi_resource *resource,
437 struct acpi_resource *resource, 296 struct acpi_resource_address64 *out);
438 struct acpi_resource_address64 *out);
439 297
440/* 298/*
441 * Hardware (ACPI device) interfaces 299 * Hardware (ACPI device) interfaces
442 */ 300 */
443acpi_status 301acpi_status acpi_get_register(u32 register_id, u32 * return_value, u32 flags);
444acpi_get_register (
445 u32 register_id,
446 u32 *return_value,
447 u32 flags);
448 302
449acpi_status 303acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags);
450acpi_set_register (
451 u32 register_id,
452 u32 value,
453 u32 flags);
454 304
455acpi_status 305acpi_status
456acpi_set_firmware_waking_vector ( 306acpi_set_firmware_waking_vector(acpi_physical_address physical_address);
457 acpi_physical_address physical_address);
458 307
459#ifdef ACPI_FUTURE_USAGE 308#ifdef ACPI_FUTURE_USAGE
460acpi_status 309acpi_status
461acpi_get_firmware_waking_vector ( 310acpi_get_firmware_waking_vector(acpi_physical_address * physical_address);
462 acpi_physical_address *physical_address);
463#endif 311#endif
464 312
465acpi_status 313acpi_status
466acpi_get_sleep_type_data ( 314acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b);
467 u8 sleep_state,
468 u8 *slp_typ_a,
469 u8 *slp_typ_b);
470 315
471acpi_status 316acpi_status acpi_enter_sleep_state_prep(u8 sleep_state);
472acpi_enter_sleep_state_prep (
473 u8 sleep_state);
474 317
475acpi_status asmlinkage 318acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state);
476acpi_enter_sleep_state (
477 u8 sleep_state);
478 319
479acpi_status asmlinkage 320acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void);
480acpi_enter_sleep_state_s4bios (
481 void);
482
483acpi_status
484acpi_leave_sleep_state (
485 u8 sleep_state);
486 321
322acpi_status acpi_leave_sleep_state(u8 sleep_state);
487 323
488#endif /* __ACXFACE_H__ */ 324#endif /* __ACXFACE_H__ */
diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h
index ed679264c12c..38e798b05d08 100644
--- a/include/acpi/acresrc.h
+++ b/include/acpi/acresrc.h
@@ -44,303 +44,216 @@
44#ifndef __ACRESRC_H__ 44#ifndef __ACRESRC_H__
45#define __ACRESRC_H__ 45#define __ACRESRC_H__
46 46
47
48/* 47/*
49 * Function prototypes called from Acpi* APIs 48 * Function prototypes called from Acpi* APIs
50 */ 49 */
51acpi_status 50acpi_status
52acpi_rs_get_prt_method_data ( 51acpi_rs_get_prt_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
53 acpi_handle handle,
54 struct acpi_buffer *ret_buffer);
55
56 52
57acpi_status 53acpi_status
58acpi_rs_get_crs_method_data ( 54acpi_rs_get_crs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
59 acpi_handle handle,
60 struct acpi_buffer *ret_buffer);
61 55
62#ifdef ACPI_FUTURE_USAGE 56#ifdef ACPI_FUTURE_USAGE
63acpi_status 57acpi_status
64acpi_rs_get_prs_method_data ( 58acpi_rs_get_prs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
65 acpi_handle handle, 59#endif /* ACPI_FUTURE_USAGE */
66 struct acpi_buffer *ret_buffer);
67#endif /* ACPI_FUTURE_USAGE */
68 60
69acpi_status 61acpi_status
70acpi_rs_get_method_data ( 62acpi_rs_get_method_data(acpi_handle handle,
71 acpi_handle handle, 63 char *path, struct acpi_buffer *ret_buffer);
72 char *path,
73 struct acpi_buffer *ret_buffer);
74 64
75acpi_status 65acpi_status
76acpi_rs_set_srs_method_data ( 66acpi_rs_set_srs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
77 acpi_handle handle,
78 struct acpi_buffer *ret_buffer);
79 67
80acpi_status 68acpi_status
81acpi_rs_create_resource_list ( 69acpi_rs_create_resource_list(union acpi_operand_object *byte_stream_buffer,
82 union acpi_operand_object *byte_stream_buffer, 70 struct acpi_buffer *output_buffer);
83 struct acpi_buffer *output_buffer);
84 71
85acpi_status 72acpi_status
86acpi_rs_create_byte_stream ( 73acpi_rs_create_byte_stream(struct acpi_resource *linked_list_buffer,
87 struct acpi_resource *linked_list_buffer, 74 struct acpi_buffer *output_buffer);
88 struct acpi_buffer *output_buffer);
89 75
90acpi_status 76acpi_status
91acpi_rs_create_pci_routing_table ( 77acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
92 union acpi_operand_object *package_object, 78 struct acpi_buffer *output_buffer);
93 struct acpi_buffer *output_buffer);
94
95 79
96/* 80/*
97 * rsdump 81 * rsdump
98 */ 82 */
99#ifdef ACPI_FUTURE_USAGE 83#ifdef ACPI_FUTURE_USAGE
100void 84void acpi_rs_dump_resource_list(struct acpi_resource *resource);
101acpi_rs_dump_resource_list (
102 struct acpi_resource *resource);
103
104void
105acpi_rs_dump_irq_list (
106 u8 *route_table);
107#endif /* ACPI_FUTURE_USAGE */
108 85
86void acpi_rs_dump_irq_list(u8 * route_table);
87#endif /* ACPI_FUTURE_USAGE */
109 88
110/* 89/*
111 * rscalc 90 * rscalc
112 */ 91 */
113acpi_status 92acpi_status
114acpi_rs_get_byte_stream_start ( 93acpi_rs_get_byte_stream_start(u8 * byte_stream_buffer,
115 u8 *byte_stream_buffer, 94 u8 ** byte_stream_start, u32 * size);
116 u8 **byte_stream_start,
117 u32 *size);
118 95
119acpi_status 96acpi_status
120acpi_rs_get_list_length ( 97acpi_rs_get_list_length(u8 * byte_stream_buffer,
121 u8 *byte_stream_buffer, 98 u32 byte_stream_buffer_length, acpi_size * size_needed);
122 u32 byte_stream_buffer_length,
123 acpi_size *size_needed);
124 99
125acpi_status 100acpi_status
126acpi_rs_get_byte_stream_length ( 101acpi_rs_get_byte_stream_length(struct acpi_resource *linked_list_buffer,
127 struct acpi_resource *linked_list_buffer, 102 acpi_size * size_needed);
128 acpi_size *size_needed);
129 103
130acpi_status 104acpi_status
131acpi_rs_get_pci_routing_table_length ( 105acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object,
132 union acpi_operand_object *package_object, 106 acpi_size * buffer_size_needed);
133 acpi_size *buffer_size_needed);
134 107
135acpi_status 108acpi_status
136acpi_rs_byte_stream_to_list ( 109acpi_rs_byte_stream_to_list(u8 * byte_stream_buffer,
137 u8 *byte_stream_buffer, 110 u32 byte_stream_buffer_length, u8 * output_buffer);
138 u32 byte_stream_buffer_length,
139 u8 *output_buffer);
140 111
141acpi_status 112acpi_status
142acpi_rs_list_to_byte_stream ( 113acpi_rs_list_to_byte_stream(struct acpi_resource *linked_list,
143 struct acpi_resource *linked_list, 114 acpi_size byte_stream_size_needed,
144 acpi_size byte_stream_size_needed, 115 u8 * output_buffer);
145 u8 *output_buffer);
146 116
147acpi_status 117acpi_status
148acpi_rs_io_resource ( 118acpi_rs_io_resource(u8 * byte_stream_buffer,
149 u8 *byte_stream_buffer, 119 acpi_size * bytes_consumed,
150 acpi_size *bytes_consumed, 120 u8 ** output_buffer, acpi_size * structure_size);
151 u8 **output_buffer,
152 acpi_size *structure_size);
153 121
154acpi_status 122acpi_status
155acpi_rs_fixed_io_resource ( 123acpi_rs_fixed_io_resource(u8 * byte_stream_buffer,
156 u8 *byte_stream_buffer, 124 acpi_size * bytes_consumed,
157 acpi_size *bytes_consumed, 125 u8 ** output_buffer, acpi_size * structure_size);
158 u8 **output_buffer,
159 acpi_size *structure_size);
160 126
161acpi_status 127acpi_status
162acpi_rs_io_stream ( 128acpi_rs_io_stream(struct acpi_resource *linked_list,
163 struct acpi_resource *linked_list, 129 u8 ** output_buffer, acpi_size * bytes_consumed);
164 u8 **output_buffer,
165 acpi_size *bytes_consumed);
166 130
167acpi_status 131acpi_status
168acpi_rs_fixed_io_stream ( 132acpi_rs_fixed_io_stream(struct acpi_resource *linked_list,
169 struct acpi_resource *linked_list, 133 u8 ** output_buffer, acpi_size * bytes_consumed);
170 u8 **output_buffer,
171 acpi_size *bytes_consumed);
172 134
173acpi_status 135acpi_status
174acpi_rs_irq_resource ( 136acpi_rs_irq_resource(u8 * byte_stream_buffer,
175 u8 *byte_stream_buffer, 137 acpi_size * bytes_consumed,
176 acpi_size *bytes_consumed, 138 u8 ** output_buffer, acpi_size * structure_size);
177 u8 **output_buffer,
178 acpi_size *structure_size);
179 139
180acpi_status 140acpi_status
181acpi_rs_irq_stream ( 141acpi_rs_irq_stream(struct acpi_resource *linked_list,
182 struct acpi_resource *linked_list, 142 u8 ** output_buffer, acpi_size * bytes_consumed);
183 u8 **output_buffer,
184 acpi_size *bytes_consumed);
185 143
186acpi_status 144acpi_status
187acpi_rs_dma_resource ( 145acpi_rs_dma_resource(u8 * byte_stream_buffer,
188 u8 *byte_stream_buffer, 146 acpi_size * bytes_consumed,
189 acpi_size *bytes_consumed, 147 u8 ** output_buffer, acpi_size * structure_size);
190 u8 **output_buffer,
191 acpi_size *structure_size);
192 148
193acpi_status 149acpi_status
194acpi_rs_dma_stream ( 150acpi_rs_dma_stream(struct acpi_resource *linked_list,
195 struct acpi_resource *linked_list, 151 u8 ** output_buffer, acpi_size * bytes_consumed);
196 u8 **output_buffer,
197 acpi_size *bytes_consumed);
198 152
199acpi_status 153acpi_status
200acpi_rs_address16_resource ( 154acpi_rs_address16_resource(u8 * byte_stream_buffer,
201 u8 *byte_stream_buffer, 155 acpi_size * bytes_consumed,
202 acpi_size *bytes_consumed, 156 u8 ** output_buffer, acpi_size * structure_size);
203 u8 **output_buffer,
204 acpi_size *structure_size);
205 157
206acpi_status 158acpi_status
207acpi_rs_address16_stream ( 159acpi_rs_address16_stream(struct acpi_resource *linked_list,
208 struct acpi_resource *linked_list, 160 u8 ** output_buffer, acpi_size * bytes_consumed);
209 u8 **output_buffer,
210 acpi_size *bytes_consumed);
211 161
212acpi_status 162acpi_status
213acpi_rs_address32_resource ( 163acpi_rs_address32_resource(u8 * byte_stream_buffer,
214 u8 *byte_stream_buffer, 164 acpi_size * bytes_consumed,
215 acpi_size *bytes_consumed, 165 u8 ** output_buffer, acpi_size * structure_size);
216 u8 **output_buffer,
217 acpi_size *structure_size);
218 166
219acpi_status 167acpi_status
220acpi_rs_address32_stream ( 168acpi_rs_address32_stream(struct acpi_resource *linked_list,
221 struct acpi_resource *linked_list, 169 u8 ** output_buffer, acpi_size * bytes_consumed);
222 u8 **output_buffer,
223 acpi_size *bytes_consumed);
224 170
225acpi_status 171acpi_status
226acpi_rs_address64_resource ( 172acpi_rs_address64_resource(u8 * byte_stream_buffer,
227 u8 *byte_stream_buffer, 173 acpi_size * bytes_consumed,
228 acpi_size *bytes_consumed, 174 u8 ** output_buffer, acpi_size * structure_size);
229 u8 **output_buffer,
230 acpi_size *structure_size);
231 175
232acpi_status 176acpi_status
233acpi_rs_address64_stream ( 177acpi_rs_address64_stream(struct acpi_resource *linked_list,
234 struct acpi_resource *linked_list, 178 u8 ** output_buffer, acpi_size * bytes_consumed);
235 u8 **output_buffer,
236 acpi_size *bytes_consumed);
237 179
238acpi_status 180acpi_status
239acpi_rs_start_depend_fns_resource ( 181acpi_rs_start_depend_fns_resource(u8 * byte_stream_buffer,
240 u8 *byte_stream_buffer, 182 acpi_size * bytes_consumed,
241 acpi_size *bytes_consumed, 183 u8 ** output_buffer,
242 u8 **output_buffer, 184 acpi_size * structure_size);
243 acpi_size *structure_size);
244 185
245acpi_status 186acpi_status
246acpi_rs_end_depend_fns_resource ( 187acpi_rs_end_depend_fns_resource(u8 * byte_stream_buffer,
247 u8 *byte_stream_buffer, 188 acpi_size * bytes_consumed,
248 acpi_size *bytes_consumed, 189 u8 ** output_buffer,
249 u8 **output_buffer, 190 acpi_size * structure_size);
250 acpi_size *structure_size);
251 191
252acpi_status 192acpi_status
253acpi_rs_start_depend_fns_stream ( 193acpi_rs_start_depend_fns_stream(struct acpi_resource *linked_list,
254 struct acpi_resource *linked_list, 194 u8 ** output_buffer,
255 u8 **output_buffer, 195 acpi_size * bytes_consumed);
256 acpi_size *bytes_consumed);
257 196
258acpi_status 197acpi_status
259acpi_rs_end_depend_fns_stream ( 198acpi_rs_end_depend_fns_stream(struct acpi_resource *linked_list,
260 struct acpi_resource *linked_list, 199 u8 ** output_buffer, acpi_size * bytes_consumed);
261 u8 **output_buffer,
262 acpi_size *bytes_consumed);
263 200
264acpi_status 201acpi_status
265acpi_rs_memory24_resource ( 202acpi_rs_memory24_resource(u8 * byte_stream_buffer,
266 u8 *byte_stream_buffer, 203 acpi_size * bytes_consumed,
267 acpi_size *bytes_consumed, 204 u8 ** output_buffer, acpi_size * structure_size);
268 u8 **output_buffer,
269 acpi_size *structure_size);
270 205
271acpi_status 206acpi_status
272acpi_rs_memory24_stream ( 207acpi_rs_memory24_stream(struct acpi_resource *linked_list,
273 struct acpi_resource *linked_list, 208 u8 ** output_buffer, acpi_size * bytes_consumed);
274 u8 **output_buffer,
275 acpi_size *bytes_consumed);
276 209
277acpi_status 210acpi_status
278acpi_rs_memory32_range_resource ( 211acpi_rs_memory32_range_resource(u8 * byte_stream_buffer,
279 u8 *byte_stream_buffer, 212 acpi_size * bytes_consumed,
280 acpi_size *bytes_consumed, 213 u8 ** output_buffer,
281 u8 **output_buffer, 214 acpi_size * structure_size);
282 acpi_size *structure_size);
283 215
284acpi_status 216acpi_status
285acpi_rs_fixed_memory32_resource ( 217acpi_rs_fixed_memory32_resource(u8 * byte_stream_buffer,
286 u8 *byte_stream_buffer, 218 acpi_size * bytes_consumed,
287 acpi_size *bytes_consumed, 219 u8 ** output_buffer,
288 u8 **output_buffer, 220 acpi_size * structure_size);
289 acpi_size *structure_size);
290 221
291acpi_status 222acpi_status
292acpi_rs_memory32_range_stream ( 223acpi_rs_memory32_range_stream(struct acpi_resource *linked_list,
293 struct acpi_resource *linked_list, 224 u8 ** output_buffer, acpi_size * bytes_consumed);
294 u8 **output_buffer,
295 acpi_size *bytes_consumed);
296 225
297acpi_status 226acpi_status
298acpi_rs_fixed_memory32_stream ( 227acpi_rs_fixed_memory32_stream(struct acpi_resource *linked_list,
299 struct acpi_resource *linked_list, 228 u8 ** output_buffer, acpi_size * bytes_consumed);
300 u8 **output_buffer,
301 acpi_size *bytes_consumed);
302 229
303acpi_status 230acpi_status
304acpi_rs_extended_irq_resource ( 231acpi_rs_extended_irq_resource(u8 * byte_stream_buffer,
305 u8 *byte_stream_buffer, 232 acpi_size * bytes_consumed,
306 acpi_size *bytes_consumed, 233 u8 ** output_buffer, acpi_size * structure_size);
307 u8 **output_buffer,
308 acpi_size *structure_size);
309 234
310acpi_status 235acpi_status
311acpi_rs_extended_irq_stream ( 236acpi_rs_extended_irq_stream(struct acpi_resource *linked_list,
312 struct acpi_resource *linked_list, 237 u8 ** output_buffer, acpi_size * bytes_consumed);
313 u8 **output_buffer,
314 acpi_size *bytes_consumed);
315 238
316acpi_status 239acpi_status
317acpi_rs_end_tag_resource ( 240acpi_rs_end_tag_resource(u8 * byte_stream_buffer,
318 u8 *byte_stream_buffer, 241 acpi_size * bytes_consumed,
319 acpi_size *bytes_consumed, 242 u8 ** output_buffer, acpi_size * structure_size);
320 u8 **output_buffer,
321 acpi_size *structure_size);
322 243
323acpi_status 244acpi_status
324acpi_rs_end_tag_stream ( 245acpi_rs_end_tag_stream(struct acpi_resource *linked_list,
325 struct acpi_resource *linked_list, 246 u8 ** output_buffer, acpi_size * bytes_consumed);
326 u8 **output_buffer,
327 acpi_size *bytes_consumed);
328 247
329acpi_status 248acpi_status
330acpi_rs_vendor_resource ( 249acpi_rs_vendor_resource(u8 * byte_stream_buffer,
331 u8 *byte_stream_buffer, 250 acpi_size * bytes_consumed,
332 acpi_size *bytes_consumed, 251 u8 ** output_buffer, acpi_size * structure_size);
333 u8 **output_buffer,
334 acpi_size *structure_size);
335 252
336acpi_status 253acpi_status
337acpi_rs_vendor_stream ( 254acpi_rs_vendor_stream(struct acpi_resource *linked_list,
338 struct acpi_resource *linked_list, 255 u8 ** output_buffer, acpi_size * bytes_consumed);
339 u8 **output_buffer,
340 acpi_size *bytes_consumed);
341 256
342u8 257u8 acpi_rs_get_resource_type(u8 resource_start_byte);
343acpi_rs_get_resource_type (
344 u8 resource_start_byte);
345 258
346#endif /* __ACRESRC_H__ */ 259#endif /* __ACRESRC_H__ */
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h
index e6b9e36a2eda..99d235339801 100644
--- a/include/acpi/acstruct.h
+++ b/include/acpi/acstruct.h
@@ -44,14 +44,12 @@
44#ifndef __ACSTRUCT_H__ 44#ifndef __ACSTRUCT_H__
45#define __ACSTRUCT_H__ 45#define __ACSTRUCT_H__
46 46
47
48/***************************************************************************** 47/*****************************************************************************
49 * 48 *
50 * Tree walking typedefs and structs 49 * Tree walking typedefs and structs
51 * 50 *
52 ****************************************************************************/ 51 ****************************************************************************/
53 52
54
55/* 53/*
56 * Walk state - current state of a parse tree walk. Used for both a leisurely stroll through 54 * Walk state - current state of a parse tree walk. Used for both a leisurely stroll through
57 * the tree (for whatever reason), and for control method execution. 55 * the tree (for whatever reason), and for control method execution.
@@ -65,152 +63,142 @@
65#define ACPI_WALK_CONST_REQUIRED 3 63#define ACPI_WALK_CONST_REQUIRED 3
66#define ACPI_WALK_CONST_OPTIONAL 4 64#define ACPI_WALK_CONST_OPTIONAL 4
67 65
68struct acpi_walk_state 66struct acpi_walk_state {
69{ 67 u8 data_type; /* To differentiate various internal objs MUST BE FIRST! */
70 u8 data_type; /* To differentiate various internal objs MUST BE FIRST!*/\ 68 u8 walk_type;
71 u8 walk_type; 69 acpi_owner_id owner_id; /* Owner of objects created during the walk */
72 acpi_owner_id owner_id; /* Owner of objects created during the walk */ 70 u8 last_predicate; /* Result of last predicate */
73 u8 last_predicate; /* Result of last predicate */ 71 u8 current_result; /* */
74 u8 reserved; /* For alignment */ 72 u8 next_op_info; /* Info about next_op */
75 u8 current_result; /* */ 73 u8 num_operands; /* Stack pointer for Operands[] array */
76 u8 next_op_info; /* Info about next_op */ 74 u8 return_used;
77 u8 num_operands; /* Stack pointer for Operands[] array */ 75 u16 opcode; /* Current AML opcode */
78 u8 return_used; 76 u8 scope_depth;
79 u16 opcode; /* Current AML opcode */ 77 u8 pass_number; /* Parse pass during table load */
80 u8 scope_depth; 78 u32 arg_count; /* push for fixed or var args */
81 u8 reserved1; 79 u32 aml_offset;
82 u32 arg_count; /* push for fixed or var args */ 80 u32 arg_types;
83 u32 aml_offset; 81 u32 method_breakpoint; /* For single stepping */
84 u32 arg_types; 82 u32 user_breakpoint; /* User AML breakpoint */
85 u32 method_breakpoint; /* For single stepping */ 83 u32 parse_flags;
86 u32 user_breakpoint; /* User AML breakpoint */ 84 u32 prev_arg_types;
87 u32 parse_flags; 85
88 u32 prev_arg_types; 86 u8 *aml_last_while;
89 87 struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */
90 u8 *aml_last_while; 88 union acpi_operand_object **caller_return_desc;
91 struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */ 89 union acpi_generic_state *control_state; /* List of control states (nested IFs) */
92 union acpi_operand_object **caller_return_desc; 90 struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */
93 union acpi_generic_state *control_state; /* List of control states (nested IFs) */ 91 struct acpi_gpe_event_info *gpe_event_info; /* Info for GPE (_Lxx/_Exx methods only */
94 struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */ 92 union acpi_operand_object *implicit_return_obj;
95 struct acpi_gpe_event_info *gpe_event_info; /* Info for GPE (_Lxx/_Exx methods only */ 93 struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */
96 union acpi_operand_object *implicit_return_obj; 94 struct acpi_namespace_node *method_call_node; /* Called method Node */
97 struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */ 95 union acpi_parse_object *method_call_op; /* method_call Op if running a method */
98 struct acpi_namespace_node *method_call_node; /* Called method Node*/ 96 union acpi_operand_object *method_desc; /* Method descriptor if running a method */
99 union acpi_parse_object *method_call_op; /* method_call Op if running a method */ 97 struct acpi_namespace_node *method_node; /* Method node if running a method. */
100 union acpi_operand_object *method_desc; /* Method descriptor if running a method */ 98 union acpi_parse_object *op; /* Current parser op */
101 struct acpi_namespace_node *method_node; /* Method node if running a method. */ 99 union acpi_operand_object *operands[ACPI_OBJ_NUM_OPERANDS + 1]; /* Operands passed to the interpreter (+1 for NULL terminator) */
102 union acpi_parse_object *op; /* Current parser op */ 100 const struct acpi_opcode_info *op_info; /* Info on current opcode */
103 union acpi_operand_object *operands[ACPI_OBJ_NUM_OPERANDS+1]; /* Operands passed to the interpreter (+1 for NULL terminator) */ 101 union acpi_parse_object *origin; /* Start of walk [Obsolete] */
104 const struct acpi_opcode_info *op_info; /* Info on current opcode */ 102 union acpi_operand_object **params;
105 union acpi_parse_object *origin; /* Start of walk [Obsolete] */ 103 struct acpi_parse_state parser_state; /* Current state of parser */
106 union acpi_operand_object **params; 104 union acpi_operand_object *result_obj;
107 struct acpi_parse_state parser_state; /* Current state of parser */ 105 union acpi_generic_state *results; /* Stack of accumulated results */
108 union acpi_operand_object *result_obj; 106 union acpi_operand_object *return_desc; /* Return object, if any */
109 union acpi_generic_state *results; /* Stack of accumulated results */ 107 union acpi_generic_state *scope_info; /* Stack of nested scopes */
110 union acpi_operand_object *return_desc; /* Return object, if any */ 108
111 union acpi_generic_state *scope_info; /* Stack of nested scopes */ 109 union acpi_parse_object *prev_op; /* Last op that was processed */
112 110 union acpi_parse_object *next_op; /* next op to be processed */
113 union acpi_parse_object *prev_op; /* Last op that was processed */ 111 acpi_parse_downwards descending_callback;
114 union acpi_parse_object *next_op; /* next op to be processed */ 112 acpi_parse_upwards ascending_callback;
115 acpi_parse_downwards descending_callback; 113 struct acpi_thread_state *thread;
116 acpi_parse_upwards ascending_callback; 114 struct acpi_walk_state *next; /* Next walk_state in list */
117 struct acpi_thread_state *thread;
118 struct acpi_walk_state *next; /* Next walk_state in list */
119}; 115};
120 116
121
122/* Info used by acpi_ps_init_objects */ 117/* Info used by acpi_ps_init_objects */
123 118
124struct acpi_init_walk_info 119struct acpi_init_walk_info {
125{ 120 u16 method_count;
126 u16 method_count; 121 u16 device_count;
127 u16 device_count; 122 u16 op_region_count;
128 u16 op_region_count; 123 u16 field_count;
129 u16 field_count; 124 u16 buffer_count;
130 u16 buffer_count; 125 u16 package_count;
131 u16 package_count; 126 u16 op_region_init;
132 u16 op_region_init; 127 u16 field_init;
133 u16 field_init; 128 u16 buffer_init;
134 u16 buffer_init; 129 u16 package_init;
135 u16 package_init; 130 u16 object_count;
136 u16 object_count; 131 struct acpi_table_desc *table_desc;
137 struct acpi_table_desc *table_desc;
138}; 132};
139 133
140
141/* Info used by acpi_ns_initialize_devices */ 134/* Info used by acpi_ns_initialize_devices */
142 135
143struct acpi_device_walk_info 136struct acpi_device_walk_info {
144{ 137 u16 device_count;
145 u16 device_count; 138 u16 num_STA;
146 u16 num_STA; 139 u16 num_INI;
147 u16 num_INI; 140 struct acpi_table_desc *table_desc;
148 struct acpi_table_desc *table_desc;
149}; 141};
150 142
151
152/* TBD: [Restructure] Merge with struct above */ 143/* TBD: [Restructure] Merge with struct above */
153 144
154struct acpi_walk_info 145struct acpi_walk_info {
155{ 146 u32 debug_level;
156 u32 debug_level; 147 u32 count;
157 u32 owner_id; 148 acpi_owner_id owner_id;
158 u8 display_type; 149 u8 display_type;
159}; 150};
160 151
161/* Display Types */ 152/* Display Types */
162 153
163#define ACPI_DISPLAY_SUMMARY 0 154#define ACPI_DISPLAY_SUMMARY (u8) 0
164#define ACPI_DISPLAY_OBJECTS 1 155#define ACPI_DISPLAY_OBJECTS (u8) 1
156#define ACPI_DISPLAY_MASK (u8) 1
165 157
166struct acpi_get_devices_info 158#define ACPI_DISPLAY_SHORT (u8) 2
167{
168 acpi_walk_callback user_function;
169 void *context;
170 char *hid;
171};
172 159
160struct acpi_get_devices_info {
161 acpi_walk_callback user_function;
162 void *context;
163 char *hid;
164};
173 165
174union acpi_aml_operands 166union acpi_aml_operands {
175{ 167 union acpi_operand_object *operands[7];
176 union acpi_operand_object *operands[7];
177 168
178 struct 169 struct {
179 { 170 struct acpi_object_integer *type;
180 struct acpi_object_integer *type; 171 struct acpi_object_integer *code;
181 struct acpi_object_integer *code; 172 struct acpi_object_integer *argument;
182 struct acpi_object_integer *argument;
183 173
184 } fatal; 174 } fatal;
185 175
186 struct 176 struct {
187 { 177 union acpi_operand_object *source;
188 union acpi_operand_object *source; 178 struct acpi_object_integer *index;
189 struct acpi_object_integer *index; 179 union acpi_operand_object *target;
190 union acpi_operand_object *target;
191 180
192 } index; 181 } index;
193 182
194 struct 183 struct {
195 { 184 union acpi_operand_object *source;
196 union acpi_operand_object *source; 185 struct acpi_object_integer *index;
197 struct acpi_object_integer *index; 186 struct acpi_object_integer *length;
198 struct acpi_object_integer *length; 187 union acpi_operand_object *target;
199 union acpi_operand_object *target;
200 188
201 } mid; 189 } mid;
202}; 190};
203 191
204
205/* Internal method parameter list */ 192/* Internal method parameter list */
206 193
207struct acpi_parameter_info 194struct acpi_parameter_info {
208{ 195 struct acpi_namespace_node *node;
209 struct acpi_namespace_node *node; 196 union acpi_operand_object *obj_desc;
210 union acpi_operand_object **parameters; 197 union acpi_operand_object **parameters;
211 union acpi_operand_object *return_object; 198 union acpi_operand_object *return_object;
212 u8 parameter_type; 199 u8 pass_number;
213 u8 return_object_type; 200 u8 parameter_type;
201 u8 return_object_type;
214}; 202};
215 203
216/* Types for parameter_type above */ 204/* Types for parameter_type above */
@@ -218,5 +206,4 @@ struct acpi_parameter_info
218#define ACPI_PARAM_ARGS 0 206#define ACPI_PARAM_ARGS 0
219#define ACPI_PARAM_GPE 1 207#define ACPI_PARAM_GPE 1
220 208
221
222#endif 209#endif
diff --git a/include/acpi/actables.h b/include/acpi/actables.h
index 39df92e21a0d..f92c1858b808 100644
--- a/include/acpi/actables.h
+++ b/include/acpi/actables.h
@@ -44,146 +44,101 @@
44#ifndef __ACTABLES_H__ 44#ifndef __ACTABLES_H__
45#define __ACTABLES_H__ 45#define __ACTABLES_H__
46 46
47
48/* Used in acpi_tb_map_acpi_table for size parameter if table header is to be used */ 47/* Used in acpi_tb_map_acpi_table for size parameter if table header is to be used */
49 48
50#define SIZE_IN_HEADER 0 49#define SIZE_IN_HEADER 0
51 50
52
53/* 51/*
54 * tbconvrt - Table conversion routines 52 * tbconvrt - Table conversion routines
55 */ 53 */
56acpi_status 54acpi_status acpi_tb_convert_to_xsdt(struct acpi_table_desc *table_info);
57acpi_tb_convert_to_xsdt (
58 struct acpi_table_desc *table_info);
59 55
60acpi_status 56acpi_status acpi_tb_convert_table_fadt(void);
61acpi_tb_convert_table_fadt (
62 void);
63 57
64acpi_status 58acpi_status acpi_tb_build_common_facs(struct acpi_table_desc *table_info);
65acpi_tb_build_common_facs (
66 struct acpi_table_desc *table_info);
67 59
68u32 60u32
69acpi_tb_get_table_count ( 61acpi_tb_get_table_count(struct rsdp_descriptor *RSDP,
70 struct rsdp_descriptor *RSDP, 62 struct acpi_table_header *RSDT);
71 struct acpi_table_header *RSDT);
72
73 63
74/* 64/*
75 * tbget - Table "get" routines 65 * tbget - Table "get" routines
76 */ 66 */
77acpi_status 67acpi_status
78acpi_tb_get_table ( 68acpi_tb_get_table(struct acpi_pointer *address,
79 struct acpi_pointer *address, 69 struct acpi_table_desc *table_info);
80 struct acpi_table_desc *table_info);
81
82acpi_status
83acpi_tb_get_table_header (
84 struct acpi_pointer *address,
85 struct acpi_table_header *return_header);
86 70
87acpi_status 71acpi_status
88acpi_tb_get_table_body ( 72acpi_tb_get_table_header(struct acpi_pointer *address,
89 struct acpi_pointer *address, 73 struct acpi_table_header *return_header);
90 struct acpi_table_header *header,
91 struct acpi_table_desc *table_info);
92 74
93acpi_status 75acpi_status
94acpi_tb_get_table_ptr ( 76acpi_tb_get_table_body(struct acpi_pointer *address,
95 acpi_table_type table_type, 77 struct acpi_table_header *header,
96 u32 instance, 78 struct acpi_table_desc *table_info);
97 struct acpi_table_header **table_ptr_loc);
98 79
99acpi_status 80acpi_status
100acpi_tb_verify_rsdp ( 81acpi_tb_get_table_ptr(acpi_table_type table_type,
101 struct acpi_pointer *address); 82 u32 instance, struct acpi_table_header **table_ptr_loc);
102 83
103void 84acpi_status acpi_tb_verify_rsdp(struct acpi_pointer *address);
104acpi_tb_get_rsdt_address (
105 struct acpi_pointer *out_address);
106 85
107acpi_status 86void acpi_tb_get_rsdt_address(struct acpi_pointer *out_address);
108acpi_tb_validate_rsdt (
109 struct acpi_table_header *table_ptr);
110 87
88acpi_status acpi_tb_validate_rsdt(struct acpi_table_header *table_ptr);
111 89
112/* 90/*
113 * tbgetall - get multiple required tables 91 * tbgetall - get multiple required tables
114 */ 92 */
115acpi_status 93acpi_status acpi_tb_get_required_tables(void);
116acpi_tb_get_required_tables (
117 void);
118
119 94
120/* 95/*
121 * tbinstall - Table installation 96 * tbinstall - Table installation
122 */ 97 */
123acpi_status 98acpi_status acpi_tb_install_table(struct acpi_table_desc *table_info);
124acpi_tb_install_table (
125 struct acpi_table_desc *table_info);
126 99
127acpi_status 100acpi_status
128acpi_tb_recognize_table ( 101acpi_tb_recognize_table(struct acpi_table_desc *table_info, u8 search_type);
129 struct acpi_table_desc *table_info,
130 u8 search_type);
131 102
132acpi_status 103acpi_status
133acpi_tb_init_table_descriptor ( 104acpi_tb_init_table_descriptor(acpi_table_type table_type,
134 acpi_table_type table_type, 105 struct acpi_table_desc *table_info);
135 struct acpi_table_desc *table_info);
136
137 106
138/* 107/*
139 * tbremove - Table removal and deletion 108 * tbremove - Table removal and deletion
140 */ 109 */
141void 110void acpi_tb_delete_all_tables(void);
142acpi_tb_delete_all_tables (
143 void);
144
145void
146acpi_tb_delete_tables_by_type (
147 acpi_table_type type);
148 111
149void 112void acpi_tb_delete_tables_by_type(acpi_table_type type);
150acpi_tb_delete_single_table (
151 struct acpi_table_desc *table_desc);
152 113
153struct acpi_table_desc * 114void acpi_tb_delete_single_table(struct acpi_table_desc *table_desc);
154acpi_tb_uninstall_table (
155 struct acpi_table_desc *table_desc);
156 115
116struct acpi_table_desc *acpi_tb_uninstall_table(struct acpi_table_desc
117 *table_desc);
157 118
158/* 119/*
159 * tbxfroot - RSDP, RSDT utilities 120 * tbxfroot - RSDP, RSDT utilities
160 */ 121 */
161acpi_status 122acpi_status
162acpi_tb_find_table ( 123acpi_tb_find_table(char *signature,
163 char *signature, 124 char *oem_id,
164 char *oem_id, 125 char *oem_table_id, struct acpi_table_header **table_ptr);
165 char *oem_table_id,
166 struct acpi_table_header **table_ptr);
167 126
168acpi_status 127acpi_status acpi_tb_get_table_rsdt(void);
169acpi_tb_get_table_rsdt (
170 void);
171 128
129acpi_status acpi_tb_validate_rsdp(struct rsdp_descriptor *rsdp);
172 130
173/* 131/*
174 * tbutils - common table utilities 132 * tbutils - common table utilities
175 */ 133 */
134acpi_status acpi_tb_is_table_installed(struct acpi_table_desc *new_table_desc);
135
176acpi_status 136acpi_status
177acpi_tb_verify_table_checksum ( 137acpi_tb_verify_table_checksum(struct acpi_table_header *table_header);
178 struct acpi_table_header *table_header);
179 138
180u8 139u8 acpi_tb_generate_checksum(void *buffer, u32 length);
181acpi_tb_checksum (
182 void *buffer,
183 u32 length);
184 140
185acpi_status 141acpi_status
186acpi_tb_validate_table_header ( 142acpi_tb_validate_table_header(struct acpi_table_header *table_header);
187 struct acpi_table_header *table_header);
188 143
189#endif /* __ACTABLES_H__ */ 144#endif /* __ACTABLES_H__ */
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index b5cdcca444c8..a46f406e1c94 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -44,27 +44,24 @@
44#ifndef __ACTBL_H__ 44#ifndef __ACTBL_H__
45#define __ACTBL_H__ 45#define __ACTBL_H__
46 46
47
48/* 47/*
49 * Values for description table header signatures 48 * Values for description table header signatures
50 */ 49 */
51#define RSDP_NAME "RSDP" 50#define RSDP_NAME "RSDP"
52#define RSDP_SIG "RSD PTR " /* RSDT Pointer signature */ 51#define RSDP_SIG "RSD PTR " /* RSDT Pointer signature */
53#define APIC_SIG "APIC" /* Multiple APIC Description Table */ 52#define APIC_SIG "APIC" /* Multiple APIC Description Table */
54#define DSDT_SIG "DSDT" /* Differentiated System Description Table */ 53#define DSDT_SIG "DSDT" /* Differentiated System Description Table */
55#define FADT_SIG "FACP" /* Fixed ACPI Description Table */ 54#define FADT_SIG "FACP" /* Fixed ACPI Description Table */
56#define FACS_SIG "FACS" /* Firmware ACPI Control Structure */ 55#define FACS_SIG "FACS" /* Firmware ACPI Control Structure */
57#define PSDT_SIG "PSDT" /* Persistent System Description Table */ 56#define PSDT_SIG "PSDT" /* Persistent System Description Table */
58#define RSDT_SIG "RSDT" /* Root System Description Table */ 57#define RSDT_SIG "RSDT" /* Root System Description Table */
59#define XSDT_SIG "XSDT" /* Extended System Description Table */ 58#define XSDT_SIG "XSDT" /* Extended System Description Table */
60#define SSDT_SIG "SSDT" /* Secondary System Description Table */ 59#define SSDT_SIG "SSDT" /* Secondary System Description Table */
61#define SBST_SIG "SBST" /* Smart Battery Specification Table */ 60#define SBST_SIG "SBST" /* Smart Battery Specification Table */
62#define SPIC_SIG "SPIC" /* IOSAPIC table */ 61#define SPIC_SIG "SPIC" /* IOSAPIC table */
63#define BOOT_SIG "BOOT" /* Boot table */ 62#define BOOT_SIG "BOOT" /* Boot table */
64 63
65 64#define GL_OWNED 0x02 /* Ownership of global lock is bit 1 */
66#define GL_OWNED 0x02 /* Ownership of global lock is bit 1 */
67
68 65
69/* 66/*
70 * Common table types. The base code can remain 67 * Common table types. The base code can remain
@@ -75,7 +72,6 @@
75#define FACS_DESCRIPTOR struct facs_descriptor_rev2 72#define FACS_DESCRIPTOR struct facs_descriptor_rev2
76#define FADT_DESCRIPTOR struct fadt_descriptor_rev2 73#define FADT_DESCRIPTOR struct fadt_descriptor_rev2
77 74
78
79#pragma pack(1) 75#pragma pack(1)
80 76
81/* 77/*
@@ -84,45 +80,37 @@
84 * NOTE: The tables that are specific to ACPI versions (1.0, 2.0, etc.) 80 * NOTE: The tables that are specific to ACPI versions (1.0, 2.0, etc.)
85 * are in separate files. 81 * are in separate files.
86 */ 82 */
87struct rsdp_descriptor /* Root System Descriptor Pointer */ 83struct rsdp_descriptor { /* Root System Descriptor Pointer */
88{ 84 char signature[8]; /* ACPI signature, contains "RSD PTR " */
89 char signature [8]; /* ACPI signature, contains "RSD PTR " */ 85 u8 checksum; /* ACPI 1.0 checksum */
90 u8 checksum; /* To make sum of struct == 0 */ 86 char oem_id[6]; /* OEM identification */
91 char oem_id [6]; /* OEM identification */ 87 u8 revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */
92 u8 revision; /* Must be 0 for 1.0, 2 for 2.0 */ 88 u32 rsdt_physical_address; /* 32-bit physical address of the RSDT */
93 u32 rsdt_physical_address; /* 32-bit physical address of RSDT */ 89 u32 length; /* XSDT Length in bytes, including header */
94 u32 length; /* XSDT Length in bytes including hdr */ 90 u64 xsdt_physical_address; /* 64-bit physical address of the XSDT */
95 u64 xsdt_physical_address; /* 64-bit physical address of XSDT */ 91 u8 extended_checksum; /* Checksum of entire table (ACPI 2.0) */
96 u8 extended_checksum; /* Checksum of entire table */ 92 char reserved[3]; /* Reserved, must be zero */
97 char reserved [3]; /* Reserved field must be 0 */
98}; 93};
99 94
100 95struct acpi_common_facs { /* Common FACS for internal use */
101struct acpi_common_facs /* Common FACS for internal use */ 96 u32 *global_lock;
102{ 97 u64 *firmware_waking_vector;
103 u32 *global_lock; 98 u8 vector_width;
104 u64 *firmware_waking_vector;
105 u8 vector_width;
106}; 99};
107 100
108
109#define ACPI_TABLE_HEADER_DEF /* ACPI common table header */ \ 101#define ACPI_TABLE_HEADER_DEF /* ACPI common table header */ \
110 char signature [4]; /* ACPI signature (4 ASCII characters) */\ 102 char signature[4]; /* ASCII table signature */\
111 u32 length; /* Length of table, in bytes, including header */\ 103 u32 length; /* Length of table in bytes, including this header */\
112 u8 revision; /* ACPI Specification minor version # */\ 104 u8 revision; /* ACPI Specification minor version # */\
113 u8 checksum; /* To make sum of entire table == 0 */\ 105 u8 checksum; /* To make sum of entire table == 0 */\
114 char oem_id [6]; /* OEM identification */\ 106 char oem_id[6]; /* ASCII OEM identification */\
115 char oem_table_id [8]; /* OEM table identification */\ 107 char oem_table_id[8]; /* ASCII OEM table identification */\
116 u32 oem_revision; /* OEM revision number */\ 108 u32 oem_revision; /* OEM revision number */\
117 char asl_compiler_id [4]; /* ASL compiler vendor ID */\ 109 char asl_compiler_id [4]; /* ASCII ASL compiler vendor ID */\
118 u32 asl_compiler_revision; /* ASL compiler revision number */ 110 u32 asl_compiler_revision; /* ASL compiler version */
119
120
121struct acpi_table_header /* ACPI common table header */
122{
123 ACPI_TABLE_HEADER_DEF
124};
125 111
112struct acpi_table_header { /* ACPI common table header */
113ACPI_TABLE_HEADER_DEF};
126 114
127/* 115/*
128 * MADT values and structures 116 * MADT values and structures
@@ -135,12 +123,15 @@ struct acpi_table_header /* ACPI common table header */
135 123
136/* Master MADT */ 124/* Master MADT */
137 125
138struct multiple_apic_table 126struct multiple_apic_table {
139{ 127 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
140 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 128 u32 local_apic_address; /* Physical address of local APIC */
141 u32 local_apic_address; /* Physical address of local APIC */ 129
142 u32 PCATcompat : 1; /* A one indicates system also has dual 8259s */ 130 /* Flags (32 bits) */
143 u32 reserved1 : 31; 131
132 u8 PCATcompat:1; /* 00: System also has dual 8259s */
133 u8:7; /* 01-07: Reserved, must be zero */
134 u8 reserved1[3]; /* 08-31: Reserved, must be zero */
144}; 135};
145 136
146/* Values for Type in APIC_HEADER_DEF */ 137/* Values for Type in APIC_HEADER_DEF */
@@ -154,7 +145,7 @@ struct multiple_apic_table
154#define APIC_IO_SAPIC 6 145#define APIC_IO_SAPIC 6
155#define APIC_LOCAL_SAPIC 7 146#define APIC_LOCAL_SAPIC 7
156#define APIC_XRUPT_SOURCE 8 147#define APIC_XRUPT_SOURCE 8
157#define APIC_RESERVED 9 /* 9 and greater are reserved */ 148#define APIC_RESERVED 9 /* 9 and greater are reserved */
158 149
159/* 150/*
160 * MADT sub-structures (Follow MULTIPLE_APIC_DESCRIPTION_TABLE) 151 * MADT sub-structures (Follow MULTIPLE_APIC_DESCRIPTION_TABLE)
@@ -163,10 +154,8 @@ struct multiple_apic_table
163 u8 type; \ 154 u8 type; \
164 u8 length; 155 u8 length;
165 156
166struct apic_header 157struct apic_header {
167{ 158APIC_HEADER_DEF};
168 APIC_HEADER_DEF
169};
170 159
171/* Values for MPS INTI flags */ 160/* Values for MPS INTI flags */
172 161
@@ -180,117 +169,90 @@ struct apic_header
180#define TRIGGER_RESERVED 2 169#define TRIGGER_RESERVED 2
181#define TRIGGER_LEVEL 3 170#define TRIGGER_LEVEL 3
182 171
183/* Common flag definitions */ 172/* Common flag definitions (16 bits each) */
184 173
185#define MPS_INTI_FLAGS \ 174#define MPS_INTI_FLAGS \
186 u16 polarity : 2; /* Polarity of APIC I/O input signals */\ 175 u8 polarity : 2; /* 00-01: Polarity of APIC I/O input signals */\
187 u16 trigger_mode : 2; /* Trigger mode of APIC input signals */\ 176 u8 trigger_mode : 2; /* 02-03: Trigger mode of APIC input signals */\
188 u16 reserved1 : 12; /* Reserved, must be zero */ 177 u8 : 4; /* 04-07: Reserved, must be zero */\
178 u8 reserved1; /* 08-15: Reserved, must be zero */
189 179
190#define LOCAL_APIC_FLAGS \ 180#define LOCAL_APIC_FLAGS \
191 u32 processor_enabled: 1; /* Processor is usable if set */\ 181 u8 processor_enabled: 1; /* 00: Processor is usable if set */\
192 u32 reserved2 : 31; /* Reserved, must be zero */ 182 u8 : 7; /* 01-07: Reserved, must be zero */\
183 u8 reserved2; /* 08-15: Reserved, must be zero */
193 184
194/* Sub-structures for MADT */ 185/* Sub-structures for MADT */
195 186
196struct madt_processor_apic 187struct madt_processor_apic {
197{ 188 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */
198 APIC_HEADER_DEF 189 u8 local_apic_id; /* Processor's local APIC id */
199 u8 processor_id; /* ACPI processor id */ 190 LOCAL_APIC_FLAGS};
200 u8 local_apic_id; /* Processor's local APIC id */ 191
201 LOCAL_APIC_FLAGS 192struct madt_io_apic {
202}; 193 APIC_HEADER_DEF u8 io_apic_id; /* I/O APIC ID */
203 194 u8 reserved; /* Reserved - must be zero */
204struct madt_io_apic 195 u32 address; /* APIC physical address */
205{ 196 u32 interrupt; /* Global system interrupt where INTI
206 APIC_HEADER_DEF 197 * lines start */
207 u8 io_apic_id; /* I/O APIC ID */
208 u8 reserved; /* Reserved - must be zero */
209 u32 address; /* APIC physical address */
210 u32 interrupt; /* Global system interrupt where INTI
211 * lines start */
212}; 198};
213 199
214struct madt_interrupt_override 200struct madt_interrupt_override {
215{ 201 APIC_HEADER_DEF u8 bus; /* 0 - ISA */
216 APIC_HEADER_DEF 202 u8 source; /* Interrupt source (IRQ) */
217 u8 bus; /* 0 - ISA */ 203 u32 interrupt; /* Global system interrupt */
218 u8 source; /* Interrupt source (IRQ) */ 204 MPS_INTI_FLAGS};
219 u32 interrupt; /* Global system interrupt */
220 MPS_INTI_FLAGS
221};
222 205
223struct madt_nmi_source 206struct madt_nmi_source {
224{ 207 APIC_HEADER_DEF MPS_INTI_FLAGS u32 interrupt; /* Global system interrupt */
225 APIC_HEADER_DEF
226 MPS_INTI_FLAGS
227 u32 interrupt; /* Global system interrupt */
228}; 208};
229 209
230struct madt_local_apic_nmi 210struct madt_local_apic_nmi {
231{ 211 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */
232 APIC_HEADER_DEF 212 MPS_INTI_FLAGS u8 lint; /* LINTn to which NMI is connected */
233 u8 processor_id; /* ACPI processor id */
234 MPS_INTI_FLAGS
235 u8 lint; /* LINTn to which NMI is connected */
236}; 213};
237 214
238struct madt_address_override 215struct madt_address_override {
239{ 216 APIC_HEADER_DEF u16 reserved; /* Reserved, must be zero */
240 APIC_HEADER_DEF 217 u64 address; /* APIC physical address */
241 u16 reserved; /* Reserved - must be zero */
242 u64 address; /* APIC physical address */
243}; 218};
244 219
245struct madt_io_sapic 220struct madt_io_sapic {
246{ 221 APIC_HEADER_DEF u8 io_sapic_id; /* I/O SAPIC ID */
247 APIC_HEADER_DEF 222 u8 reserved; /* Reserved, must be zero */
248 u8 io_sapic_id; /* I/O SAPIC ID */ 223 u32 interrupt_base; /* Glocal interrupt for SAPIC start */
249 u8 reserved; /* Reserved - must be zero */ 224 u64 address; /* SAPIC physical address */
250 u32 interrupt_base; /* Glocal interrupt for SAPIC start */
251 u64 address; /* SAPIC physical address */
252}; 225};
253 226
254struct madt_local_sapic 227struct madt_local_sapic {
255{ 228 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */
256 APIC_HEADER_DEF 229 u8 local_sapic_id; /* SAPIC ID */
257 u8 processor_id; /* ACPI processor id */ 230 u8 local_sapic_eid; /* SAPIC EID */
258 u8 local_sapic_id; /* SAPIC ID */ 231 u8 reserved[3]; /* Reserved, must be zero */
259 u8 local_sapic_eid; /* SAPIC EID */ 232 LOCAL_APIC_FLAGS u32 processor_uID; /* Numeric UID - ACPI 3.0 */
260 u8 reserved [3]; /* Reserved - must be zero */ 233 char processor_uIDstring[1]; /* String UID - ACPI 3.0 */
261 LOCAL_APIC_FLAGS
262 u32 processor_uID; /* Numeric UID - ACPI 3.0 */
263 char processor_uIDstring[1]; /* String UID - ACPI 3.0 */
264}; 234};
265 235
266struct madt_interrupt_source 236struct madt_interrupt_source {
267{ 237 APIC_HEADER_DEF MPS_INTI_FLAGS u8 interrupt_type; /* 1=PMI, 2=INIT, 3=corrected */
268 APIC_HEADER_DEF 238 u8 processor_id; /* Processor ID */
269 MPS_INTI_FLAGS 239 u8 processor_eid; /* Processor EID */
270 u8 interrupt_type; /* 1=PMI, 2=INIT, 3=corrected */ 240 u8 io_sapic_vector; /* Vector value for PMI interrupts */
271 u8 processor_id; /* Processor ID */ 241 u32 interrupt; /* Global system interrupt */
272 u8 processor_eid; /* Processor EID */ 242 u32 flags; /* Interrupt Source Flags */
273 u8 io_sapic_vector; /* Vector value for PMI interrupts */
274 u32 interrupt; /* Global system interrupt */
275 u32 flags; /* Interrupt Source Flags */
276}; 243};
277 244
278
279/* 245/*
280 * Smart Battery 246 * Smart Battery
281 */ 247 */
282struct smart_battery_table 248struct smart_battery_table {
283{ 249 ACPI_TABLE_HEADER_DEF u32 warning_level;
284 ACPI_TABLE_HEADER_DEF 250 u32 low_level;
285 u32 warning_level; 251 u32 critical_level;
286 u32 low_level;
287 u32 critical_level;
288}; 252};
289 253
290
291#pragma pack() 254#pragma pack()
292 255
293
294/* 256/*
295 * ACPI Table information. We save the table address, length, 257 * ACPI Table information. We save the table address, length,
296 * and type of memory allocation (mapped or allocated) for each 258 * and type of memory allocation (mapped or allocated) for each
@@ -314,39 +276,35 @@ struct smart_battery_table
314 276
315/* Data about each known table type */ 277/* Data about each known table type */
316 278
317struct acpi_table_support 279struct acpi_table_support {
318{ 280 char *name;
319 char *name; 281 char *signature;
320 char *signature; 282 void **global_ptr;
321 void **global_ptr; 283 u8 sig_length;
322 u8 sig_length; 284 u8 flags;
323 u8 flags;
324}; 285};
325 286
326
327/* 287/*
328 * Get the ACPI version-specific tables 288 * Get the ACPI version-specific tables
329 */ 289 */
330#include "actbl1.h" /* Acpi 1.0 table definitions */ 290#include "actbl1.h" /* Acpi 1.0 table definitions */
331#include "actbl2.h" /* Acpi 2.0 table definitions */ 291#include "actbl2.h" /* Acpi 2.0 table definitions */
332 292
333extern u8 acpi_fadt_is_v1; /* is set to 1 if FADT is revision 1, 293extern u8 acpi_fadt_is_v1; /* is set to 1 if FADT is revision 1,
334 * needed for certain workarounds */ 294 * needed for certain workarounds */
335 295
336#pragma pack(1) 296#pragma pack(1)
337/* 297/*
338 * High performance timer 298 * High performance timer
339 */ 299 */
340struct hpet_table 300struct hpet_table {
341{ 301 ACPI_TABLE_HEADER_DEF u32 hardware_id;
342 ACPI_TABLE_HEADER_DEF 302 struct acpi_generic_address base_address;
343 u32 hardware_id; 303 u8 hpet_number;
344 struct acpi_generic_address base_address; 304 u16 clock_tick;
345 u8 hpet_number; 305 u8 attributes;
346 u16 clock_tick;
347 u8 attributes;
348}; 306};
349 307
350#pragma pack() 308#pragma pack()
351 309
352#endif /* __ACTBL_H__ */ 310#endif /* __ACTBL_H__ */
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 33de5f4d2ccc..67312c3a915a 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -49,88 +49,87 @@
49/* 49/*
50 * ACPI 1.0 Root System Description Table (RSDT) 50 * ACPI 1.0 Root System Description Table (RSDT)
51 */ 51 */
52struct rsdt_descriptor_rev1 52struct rsdt_descriptor_rev1 {
53{ 53 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
54 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 54 u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */
55 u32 table_offset_entry [1]; /* Array of pointers to other */
56 /* ACPI tables */
57}; 55};
58 56
59
60/* 57/*
61 * ACPI 1.0 Firmware ACPI Control Structure (FACS) 58 * ACPI 1.0 Firmware ACPI Control Structure (FACS)
62 */ 59 */
63struct facs_descriptor_rev1 60struct facs_descriptor_rev1 {
64{ 61 char signature[4]; /* ASCII table signature */
65 char signature[4]; /* ACPI Signature */ 62 u32 length; /* Length of structure in bytes */
66 u32 length; /* Length of structure, in bytes */ 63 u32 hardware_signature; /* Hardware configuration signature */
67 u32 hardware_signature; /* Hardware configuration signature */ 64 u32 firmware_waking_vector; /* ACPI OS waking vector */
68 u32 firmware_waking_vector; /* ACPI OS waking vector */ 65 u32 global_lock; /* Global Lock */
69 u32 global_lock; /* Global Lock */ 66
70 u32 S4bios_f : 1; /* Indicates if S4BIOS support is present */ 67 /* Flags (32 bits) */
71 u32 reserved1 : 31; /* Must be 0 */
72 u8 resverved3 [40]; /* Reserved - must be zero */
73};
74 68
69 u8 S4bios_f:1; /* 00: S4BIOS support is present */
70 u8:7; /* 01-07: Reserved, must be zero */
71 u8 reserved1[3]; /* 08-31: Reserved, must be zero */
72
73 u8 reserved2[40]; /* Reserved, must be zero */
74};
75 75
76/* 76/*
77 * ACPI 1.0 Fixed ACPI Description Table (FADT) 77 * ACPI 1.0 Fixed ACPI Description Table (FADT)
78 */ 78 */
79struct fadt_descriptor_rev1 79struct fadt_descriptor_rev1 {
80{ 80 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
81 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 81 u32 firmware_ctrl; /* Physical address of FACS */
82 u32 firmware_ctrl; /* Physical address of FACS */ 82 u32 dsdt; /* Physical address of DSDT */
83 u32 dsdt; /* Physical address of DSDT */ 83 u8 model; /* System Interrupt Model */
84 u8 model; /* System Interrupt Model */ 84 u8 reserved1; /* Reserved, must be zero */
85 u8 reserved1; /* Reserved */ 85 u16 sci_int; /* System vector of SCI interrupt */
86 u16 sci_int; /* System vector of SCI interrupt */ 86 u32 smi_cmd; /* Port address of SMI command port */
87 u32 smi_cmd; /* Port address of SMI command port */ 87 u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */
88 u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ 88 u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */
89 u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ 89 u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */
90 u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ 90 u8 reserved2; /* Reserved, must be zero */
91 u8 reserved2; /* Reserved - must be zero */ 91 u32 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */
92 u32 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ 92 u32 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */
93 u32 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ 93 u32 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */
94 u32 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ 94 u32 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */
95 u32 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ 95 u32 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */
96 u32 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ 96 u32 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */
97 u32 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ 97 u32 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */
98 u32 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ 98 u32 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */
99 u32 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ 99 u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */
100 u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */ 100 u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */
101 u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */ 101 u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */
102 u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ 102 u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */
103 u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ 103 u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */
104 u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ 104 u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */
105 u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ 105 u8 gpe1_base; /* Offset in gpe model where gpe1 events start */
106 u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ 106 u8 reserved3; /* Reserved, must be zero */
107 u8 reserved3; /* Reserved */ 107 u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */
108 u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ 108 u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */
109 u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ 109 u16 flush_size; /* Size of area read to flush caches */
110 u16 flush_size; /* Size of area read to flush caches */ 110 u16 flush_stride; /* Stride used in flushing caches */
111 u16 flush_stride; /* Stride used in flushing caches */ 111 u8 duty_offset; /* Bit location of duty cycle field in p_cnt reg */
112 u8 duty_offset; /* Bit location of duty cycle field in p_cnt reg */ 112 u8 duty_width; /* Bit width of duty cycle field in p_cnt reg */
113 u8 duty_width; /* Bit width of duty cycle field in p_cnt reg */ 113 u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */
114 u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ 114 u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */
115 u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ 115 u8 century; /* Index to century in RTC CMOS RAM */
116 u8 century; /* Index to century in RTC CMOS RAM */ 116 u8 reserved4[3]; /* Reserved, must be zero */
117 u8 reserved4; /* Reserved */
118 u8 reserved4a; /* Reserved */
119 u8 reserved4b; /* Reserved */
120 u32 wb_invd : 1; /* The wbinvd instruction works properly */
121 u32 wb_invd_flush : 1; /* The wbinvd flushes but does not invalidate */
122 u32 proc_c1 : 1; /* All processors support C1 state */
123 u32 plvl2_up : 1; /* C2 state works on MP system */
124 u32 pwr_button : 1; /* Power button is handled as a generic feature */
125 u32 sleep_button : 1; /* Sleep button is handled as a generic feature, or not present */
126 u32 fixed_rTC : 1; /* RTC wakeup stat not in fixed register space */
127 u32 rtcs4 : 1; /* RTC wakeup stat not possible from S4 */
128 u32 tmr_val_ext : 1; /* The tmr_val width is 32 bits (0 = 24 bits) */
129 u32 reserved5 : 23; /* Reserved - must be zero */
130};
131 117
132#pragma pack() 118 /* Flags (32 bits) */
133 119
134#endif /* __ACTBL1_H__ */ 120 u8 wb_invd:1; /* 00: The wbinvd instruction works properly */
121 u8 wb_invd_flush:1; /* 01: The wbinvd flushes but does not invalidate */
122 u8 proc_c1:1; /* 02: All processors support C1 state */
123 u8 plvl2_up:1; /* 03: C2 state works on MP system */
124 u8 pwr_button:1; /* 04: Power button is handled as a generic feature */
125 u8 sleep_button:1; /* 05: Sleep button is handled as a generic feature, or not present */
126 u8 fixed_rTC:1; /* 06: RTC wakeup stat not in fixed register space */
127 u8 rtcs4:1; /* 07: RTC wakeup stat not possible from S4 */
128 u8 tmr_val_ext:1; /* 08: tmr_val width is 32 bits (0 = 24 bits) */
129 u8:7; /* 09-15: Reserved, must be zero */
130 u8 reserved5[2]; /* 16-31: Reserved, must be zero */
131};
135 132
133#pragma pack()
136 134
135#endif /* __ACTBL1_H__ */
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index e1729c967e05..50305ce2681a 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -64,62 +64,56 @@
64#define FADT2_REVISION_ID 3 64#define FADT2_REVISION_ID 3
65#define FADT2_MINUS_REVISION_ID 2 65#define FADT2_MINUS_REVISION_ID 2
66 66
67
68#pragma pack(1) 67#pragma pack(1)
69 68
70/* 69/*
71 * ACPI 2.0 Root System Description Table (RSDT) 70 * ACPI 2.0 Root System Description Table (RSDT)
72 */ 71 */
73struct rsdt_descriptor_rev2 72struct rsdt_descriptor_rev2 {
74{ 73 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
75 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 74 u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */
76 u32 table_offset_entry [1]; /* Array of pointers to */
77 /* ACPI table headers */
78}; 75};
79 76
80
81/* 77/*
82 * ACPI 2.0 Extended System Description Table (XSDT) 78 * ACPI 2.0 Extended System Description Table (XSDT)
83 */ 79 */
84struct xsdt_descriptor_rev2 80struct xsdt_descriptor_rev2 {
85{ 81 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
86 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 82 u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */
87 u64 table_offset_entry [1]; /* Array of pointers to */
88 /* ACPI table headers */
89}; 83};
90 84
91
92/* 85/*
93 * ACPI 2.0 Firmware ACPI Control Structure (FACS) 86 * ACPI 2.0 Firmware ACPI Control Structure (FACS)
94 */ 87 */
95struct facs_descriptor_rev2 88struct facs_descriptor_rev2 {
96{ 89 char signature[4]; /* ASCII table signature */
97 char signature[4]; /* ACPI signature */ 90 u32 length; /* Length of structure, in bytes */
98 u32 length; /* Length of structure, in bytes */ 91 u32 hardware_signature; /* Hardware configuration signature */
99 u32 hardware_signature; /* Hardware configuration signature */ 92 u32 firmware_waking_vector; /* 32-bit physical address of the Firmware Waking Vector. */
100 u32 firmware_waking_vector; /* 32bit physical address of the Firmware Waking Vector. */ 93 u32 global_lock; /* Global Lock used to synchronize access to shared hardware resources */
101 u32 global_lock; /* Global Lock used to synchronize access to shared hardware resources */ 94
102 u32 S4bios_f : 1; /* S4Bios_f - Indicates if S4BIOS support is present */ 95 /* Flags (32 bits) */
103 u32 reserved1 : 31; /* Must be 0 */ 96
104 u64 xfirmware_waking_vector; /* 64bit physical address of the Firmware Waking Vector. */ 97 u8 S4bios_f:1; /* 00: S4BIOS support is present */
105 u8 version; /* Version of this table */ 98 u8:7; /* 01-07: Reserved, must be zero */
106 u8 reserved3 [31]; /* Reserved - must be zero */ 99 u8 reserved1[3]; /* 08-31: Reserved, must be zero */
100
101 u64 xfirmware_waking_vector; /* 64-bit physical address of the Firmware Waking Vector. */
102 u8 version; /* Version of this table */
103 u8 reserved3[31]; /* Reserved, must be zero */
107}; 104};
108 105
109
110/* 106/*
111 * ACPI 2.0+ Generic Address Structure (GAS) 107 * ACPI 2.0+ Generic Address Structure (GAS)
112 */ 108 */
113struct acpi_generic_address 109struct acpi_generic_address {
114{ 110 u8 address_space_id; /* Address space where struct or register exists. */
115 u8 address_space_id; /* Address space where struct or register exists. */ 111 u8 register_bit_width; /* Size in bits of given register */
116 u8 register_bit_width; /* Size in bits of given register */ 112 u8 register_bit_offset; /* Bit offset within the register */
117 u8 register_bit_offset; /* Bit offset within the register */ 113 u8 access_width; /* Minimum Access size (ACPI 3.0) */
118 u8 access_width; /* Minimum Access size (ACPI 3.0) */ 114 u64 address; /* 64-bit address of struct or register */
119 u64 address; /* 64-bit address of struct or register */
120}; 115};
121 116
122
123#define FADT_REV2_COMMON \ 117#define FADT_REV2_COMMON \
124 u32 V1_firmware_ctrl; /* 32-bit physical address of FACS */ \ 118 u32 V1_firmware_ctrl; /* 32-bit physical address of FACS */ \
125 u32 V1_dsdt; /* 32-bit physical address of DSDT */ \ 119 u32 V1_dsdt; /* 32-bit physical address of DSDT */ \
@@ -161,129 +155,123 @@ struct acpi_generic_address
161/* 155/*
162 * ACPI 2.0+ Fixed ACPI Description Table (FADT) 156 * ACPI 2.0+ Fixed ACPI Description Table (FADT)
163 */ 157 */
164struct fadt_descriptor_rev2 158struct fadt_descriptor_rev2 {
165{ 159 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
166 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 160 FADT_REV2_COMMON u8 reserved2; /* Reserved, must be zero */
167 FADT_REV2_COMMON 161
168 u8 reserved2; /* Reserved */ 162 /* Flags (32 bits) */
169 u32 wb_invd : 1; /* The wbinvd instruction works properly */ 163
170 u32 wb_invd_flush : 1; /* The wbinvd flushes but does not invalidate */ 164 u8 wb_invd:1; /* 00: The wbinvd instruction works properly */
171 u32 proc_c1 : 1; /* All processors support C1 state */ 165 u8 wb_invd_flush:1; /* 01: The wbinvd flushes but does not invalidate */
172 u32 plvl2_up : 1; /* C2 state works on MP system */ 166 u8 proc_c1:1; /* 02: All processors support C1 state */
173 u32 pwr_button : 1; /* Power button is handled as a generic feature */ 167 u8 plvl2_up:1; /* 03: C2 state works on MP system */
174 u32 sleep_button : 1; /* Sleep button is handled as a generic feature, or not present */ 168 u8 pwr_button:1; /* 04: Power button is handled as a generic feature */
175 u32 fixed_rTC : 1; /* RTC wakeup stat not in fixed register space */ 169 u8 sleep_button:1; /* 05: Sleep button is handled as a generic feature, or not present */
176 u32 rtcs4 : 1; /* RTC wakeup stat not possible from S4 */ 170 u8 fixed_rTC:1; /* 06: RTC wakeup stat not in fixed register space */
177 u32 tmr_val_ext : 1; /* Indicates tmr_val is 32 bits 0=24-bits */ 171 u8 rtcs4:1; /* 07: RTC wakeup stat not possible from S4 */
178 u32 dock_cap : 1; /* Supports Docking */ 172 u8 tmr_val_ext:1; /* 08: tmr_val is 32 bits 0=24-bits */
179 u32 reset_reg_sup : 1; /* Indicates system supports system reset via the FADT RESET_REG */ 173 u8 dock_cap:1; /* 09: Docking supported */
180 u32 sealed_case : 1; /* Indicates system has no internal expansion capabilities and case is sealed */ 174 u8 reset_reg_sup:1; /* 10: System reset via the FADT RESET_REG supported */
181 u32 headless : 1; /* Indicates system does not have local video capabilities or local input devices */ 175 u8 sealed_case:1; /* 11: No internal expansion capabilities and case is sealed */
182 u32 cpu_sw_sleep : 1; /* Indicates to OSPM that a processor native instruction */ 176 u8 headless:1; /* 12: No local video capabilities or local input devices */
183 /* must be executed after writing the SLP_TYPx register */ 177 u8 cpu_sw_sleep:1; /* 13: Must execute native instruction after writing SLP_TYPx register */
184 /* ACPI 3.0 flag bits */ 178
185 179 u8 pci_exp_wak:1; /* 14: System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */
186 u32 pci_exp_wak : 1; /* System supports PCIEXP_WAKE (STS/EN) bits */ 180 u8 use_platform_clock:1; /* 15: OSPM should use platform-provided timer (ACPI 3.0) */
187 u32 use_platform_clock : 1; /* OSPM should use platform-provided timer */ 181 u8 S4rtc_sts_valid:1; /* 16: Contents of RTC_STS valid after S4 wake (ACPI 3.0) */
188 u32 S4rtc_sts_valid : 1; /* Contents of RTC_STS valid after S4 wake */ 182 u8 remote_power_on_capable:1; /* 17: System is compatible with remote power on (ACPI 3.0) */
189 u32 remote_power_on_capable : 1; /* System is compatible with remote power on */ 183 u8 force_apic_cluster_model:1; /* 18: All local APICs must use cluster model (ACPI 3.0) */
190 u32 force_apic_cluster_model : 1; /* All local APICs must use cluster model */ 184 u8 force_apic_physical_destination_mode:1; /* 19: all local x_aPICs must use physical dest mode (ACPI 3.0) */
191 u32 force_apic_physical_destination_mode : 1; /* all local x_aPICs must use physical dest mode */ 185 u8:4; /* 20-23: Reserved, must be zero */
192 u32 reserved6 : 12;/* Reserved - must be zero */ 186 u8 reserved3; /* 24-31: Reserved, must be zero */
193 187
194 struct acpi_generic_address reset_register; /* Reset register address in GAS format */ 188 struct acpi_generic_address reset_register; /* Reset register address in GAS format */
195 u8 reset_value; /* Value to write to the reset_register port to reset the system */ 189 u8 reset_value; /* Value to write to the reset_register port to reset the system */
196 u8 reserved7[3]; /* These three bytes must be zero */ 190 u8 reserved4[3]; /* These three bytes must be zero */
197 u64 xfirmware_ctrl; /* 64-bit physical address of FACS */ 191 u64 xfirmware_ctrl; /* 64-bit physical address of FACS */
198 u64 Xdsdt; /* 64-bit physical address of DSDT */ 192 u64 Xdsdt; /* 64-bit physical address of DSDT */
199 struct acpi_generic_address xpm1a_evt_blk; /* Extended Power Mgt 1a acpi_event Reg Blk address */ 193 struct acpi_generic_address xpm1a_evt_blk; /* Extended Power Mgt 1a acpi_event Reg Blk address */
200 struct acpi_generic_address xpm1b_evt_blk; /* Extended Power Mgt 1b acpi_event Reg Blk address */ 194 struct acpi_generic_address xpm1b_evt_blk; /* Extended Power Mgt 1b acpi_event Reg Blk address */
201 struct acpi_generic_address xpm1a_cnt_blk; /* Extended Power Mgt 1a Control Reg Blk address */ 195 struct acpi_generic_address xpm1a_cnt_blk; /* Extended Power Mgt 1a Control Reg Blk address */
202 struct acpi_generic_address xpm1b_cnt_blk; /* Extended Power Mgt 1b Control Reg Blk address */ 196 struct acpi_generic_address xpm1b_cnt_blk; /* Extended Power Mgt 1b Control Reg Blk address */
203 struct acpi_generic_address xpm2_cnt_blk; /* Extended Power Mgt 2 Control Reg Blk address */ 197 struct acpi_generic_address xpm2_cnt_blk; /* Extended Power Mgt 2 Control Reg Blk address */
204 struct acpi_generic_address xpm_tmr_blk; /* Extended Power Mgt Timer Ctrl Reg Blk address */ 198 struct acpi_generic_address xpm_tmr_blk; /* Extended Power Mgt Timer Ctrl Reg Blk address */
205 struct acpi_generic_address xgpe0_blk; /* Extended General Purpose acpi_event 0 Reg Blk address */ 199 struct acpi_generic_address xgpe0_blk; /* Extended General Purpose acpi_event 0 Reg Blk address */
206 struct acpi_generic_address xgpe1_blk; /* Extended General Purpose acpi_event 1 Reg Blk address */ 200 struct acpi_generic_address xgpe1_blk; /* Extended General Purpose acpi_event 1 Reg Blk address */
207}; 201};
208 202
209
210/* "Down-revved" ACPI 2.0 FADT descriptor */ 203/* "Down-revved" ACPI 2.0 FADT descriptor */
211 204
212struct fadt_descriptor_rev2_minus 205struct fadt_descriptor_rev2_minus {
213{ 206 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
214 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 207 FADT_REV2_COMMON u8 reserved2; /* Reserved, must be zero */
215 FADT_REV2_COMMON 208 u32 flags;
216 u8 reserved2; /* Reserved */ 209 struct acpi_generic_address reset_register; /* Reset register address in GAS format */
217 u32 flags; 210 u8 reset_value; /* Value to write to the reset_register port to reset the system. */
218 struct acpi_generic_address reset_register; /* Reset register address in GAS format */ 211 u8 reserved7[3]; /* Reserved, must be zero */
219 u8 reset_value; /* Value to write to the reset_register port to reset the system. */
220 u8 reserved7[3]; /* These three bytes must be zero */
221}; 212};
222 213
223
224/* ECDT - Embedded Controller Boot Resources Table */ 214/* ECDT - Embedded Controller Boot Resources Table */
225 215
226struct ec_boot_resources 216struct ec_boot_resources {
227{ 217 ACPI_TABLE_HEADER_DEF struct acpi_generic_address ec_control; /* Address of EC command/status register */
228 ACPI_TABLE_HEADER_DEF 218 struct acpi_generic_address ec_data; /* Address of EC data register */
229 struct acpi_generic_address ec_control; /* Address of EC command/status register */ 219 u32 uid; /* Unique ID - must be same as the EC _UID method */
230 struct acpi_generic_address ec_data; /* Address of EC data register */ 220 u8 gpe_bit; /* The GPE for the EC */
231 u32 uid; /* Unique ID - must be same as the EC _UID method */ 221 u8 ec_id[1]; /* Full namepath of the EC in the ACPI namespace */
232 u8 gpe_bit; /* The GPE for the EC */
233 u8 ec_id[1]; /* Full namepath of the EC in the ACPI namespace */
234}; 222};
235 223
236
237/* SRAT - System Resource Affinity Table */ 224/* SRAT - System Resource Affinity Table */
238 225
239struct static_resource_alloc 226struct static_resource_alloc {
240{ 227 u8 type;
241 u8 type; 228 u8 length;
242 u8 length; 229 u8 proximity_domain_lo;
243 u8 proximity_domain_lo; 230 u8 apic_id;
244 u8 apic_id;
245 u32 enabled :1;
246 u32 reserved3 :31;
247 u8 local_sapic_eid;
248 u8 proximity_domain_hi[3];
249 u32 reserved4;
250};
251 231
252struct memory_affinity 232 /* Flags (32 bits) */
253{ 233
254 u8 type; 234 u8 enabled:1; /* 00: Use affinity structure */
255 u8 length; 235 u8:7; /* 01-07: Reserved, must be zero */
256 u32 proximity_domain; 236 u8 reserved3[3]; /* 08-31: Reserved, must be zero */
257 u16 reserved3; 237
258 u64 base_address; 238 u8 local_sapic_eid;
259 u64 address_length; 239 u8 proximity_domain_hi[3];
260 u32 reserved4; 240 u32 reserved4; /* Reserved, must be zero */
261 u32 enabled :1;
262 u32 hot_pluggable :1;
263 u32 non_volatile :1;
264 u32 reserved5 :29;
265 u64 reserved6;
266}; 241};
267 242
268struct system_resource_affinity 243struct memory_affinity {
269{ 244 u8 type;
270 ACPI_TABLE_HEADER_DEF 245 u8 length;
271 u32 reserved1; /* Must be value '1' */ 246 u32 proximity_domain;
272 u64 reserved2; 247 u16 reserved3;
248 u64 base_address;
249 u64 address_length;
250 u32 reserved4;
251
252 /* Flags (32 bits) */
253
254 u8 enabled:1; /* 00: Use affinity structure */
255 u8 hot_pluggable:1; /* 01: Memory region is hot pluggable */
256 u8 non_volatile:1; /* 02: Memory is non-volatile */
257 u8:5; /* 03-07: Reserved, must be zero */
258 u8 reserved5[3]; /* 08-31: Reserved, must be zero */
259
260 u64 reserved6; /* Reserved, must be zero */
273}; 261};
274 262
263struct system_resource_affinity {
264 ACPI_TABLE_HEADER_DEF u32 reserved1; /* Must be value '1' */
265 u64 reserved2; /* Reserved, must be zero */
266};
275 267
276/* SLIT - System Locality Distance Information Table */ 268/* SLIT - System Locality Distance Information Table */
277 269
278struct system_locality_info 270struct system_locality_info {
279{ 271 ACPI_TABLE_HEADER_DEF u64 locality_count;
280 ACPI_TABLE_HEADER_DEF 272 u8 entry[1][1];
281 u64 locality_count;
282 u8 entry[1][1];
283}; 273};
284 274
285
286#pragma pack() 275#pragma pack()
287 276
288#endif /* __ACTBL2_H__ */ 277#endif /* __ACTBL2_H__ */
289
diff --git a/include/acpi/actbl71.h b/include/acpi/actbl71.h
index 7b4fb44261f3..10ac05bb36bc 100644
--- a/include/acpi/actbl71.h
+++ b/include/acpi/actbl71.h
@@ -27,7 +27,6 @@
27#ifndef __ACTBL71_H__ 27#ifndef __ACTBL71_H__
28#define __ACTBL71_H__ 28#define __ACTBL71_H__
29 29
30
31/* 0.71 FADT address_space data item bitmasks defines */ 30/* 0.71 FADT address_space data item bitmasks defines */
32/* If the associated bit is zero then it is in memory space else in io space */ 31/* If the associated bit is zero then it is in memory space else in io space */
33 32
@@ -40,105 +39,96 @@
40 39
41/* Only for clarity in declarations */ 40/* Only for clarity in declarations */
42 41
43typedef u64 IO_ADDRESS; 42typedef u64 IO_ADDRESS;
44
45 43
46#pragma pack(1) 44#pragma pack(1)
47struct /* Root System Descriptor Pointer */ 45struct { /* Root System Descriptor Pointer */
48{ 46 NATIVE_CHAR signature[8]; /* contains "RSD PTR " */
49 NATIVE_CHAR signature [8]; /* contains "RSD PTR " */ 47 u8 checksum; /* to make sum of struct == 0 */
50 u8 checksum; /* to make sum of struct == 0 */ 48 NATIVE_CHAR oem_id[6]; /* OEM identification */
51 NATIVE_CHAR oem_id [6]; /* OEM identification */ 49 u8 reserved; /* Must be 0 for 1.0, 2 for 2.0 */
52 u8 reserved; /* Must be 0 for 1.0, 2 for 2.0 */ 50 u64 rsdt_physical_address; /* 64-bit physical address of RSDT */
53 u64 rsdt_physical_address; /* 64-bit physical address of RSDT */
54}; 51};
55 52
56
57/*****************************************/ 53/*****************************************/
58/* IA64 Extensions to ACPI Spec Rev 0.71 */ 54/* IA64 Extensions to ACPI Spec Rev 0.71 */
59/* for the Root System Description Table */ 55/* for the Root System Description Table */
60/*****************************************/ 56/*****************************************/
61struct 57struct {
62{ 58 struct acpi_table_header header; /* Table header */
63 struct acpi_table_header header; /* Table header */ 59 u32 reserved_pad; /* IA64 alignment, must be 0 */
64 u32 reserved_pad; /* IA64 alignment, must be 0 */ 60 u64 table_offset_entry[1]; /* Array of pointers to other */
65 u64 table_offset_entry [1]; /* Array of pointers to other */ 61 /* tables' headers */
66 /* tables' headers */
67}; 62};
68 63
69
70/*******************************************/ 64/*******************************************/
71/* IA64 Extensions to ACPI Spec Rev 0.71 */ 65/* IA64 Extensions to ACPI Spec Rev 0.71 */
72/* for the Firmware ACPI Control Structure */ 66/* for the Firmware ACPI Control Structure */
73/*******************************************/ 67/*******************************************/
74struct 68struct {
75{ 69 NATIVE_CHAR signature[4]; /* signature "FACS" */
76 NATIVE_CHAR signature[4]; /* signature "FACS" */ 70 u32 length; /* length of structure, in bytes */
77 u32 length; /* length of structure, in bytes */ 71 u32 hardware_signature; /* hardware configuration signature */
78 u32 hardware_signature; /* hardware configuration signature */ 72 u32 reserved4; /* must be 0 */
79 u32 reserved4; /* must be 0 */ 73 u64 firmware_waking_vector; /* ACPI OS waking vector */
80 u64 firmware_waking_vector; /* ACPI OS waking vector */ 74 u64 global_lock; /* Global Lock */
81 u64 global_lock; /* Global Lock */ 75 u32 S4bios_f:1; /* Indicates if S4BIOS support is present */
82 u32 S4bios_f : 1; /* Indicates if S4BIOS support is present */ 76 u32 reserved1:31; /* must be 0 */
83 u32 reserved1 : 31; /* must be 0 */ 77 u8 reserved3[28]; /* reserved - must be zero */
84 u8 reserved3 [28]; /* reserved - must be zero */
85}; 78};
86 79
87
88/******************************************/ 80/******************************************/
89/* IA64 Extensions to ACPI Spec Rev 0.71 */ 81/* IA64 Extensions to ACPI Spec Rev 0.71 */
90/* for the Fixed ACPI Description Table */ 82/* for the Fixed ACPI Description Table */
91/******************************************/ 83/******************************************/
92struct 84struct {
93{ 85 struct acpi_table_header header; /* table header */
94 struct acpi_table_header header; /* table header */ 86 u32 reserved_pad; /* IA64 alignment, must be 0 */
95 u32 reserved_pad; /* IA64 alignment, must be 0 */ 87 u64 firmware_ctrl; /* 64-bit Physical address of FACS */
96 u64 firmware_ctrl; /* 64-bit Physical address of FACS */ 88 u64 dsdt; /* 64-bit Physical address of DSDT */
97 u64 dsdt; /* 64-bit Physical address of DSDT */ 89 u8 model; /* System Interrupt Model */
98 u8 model; /* System Interrupt Model */ 90 u8 address_space; /* Address Space Bitmask */
99 u8 address_space; /* Address Space Bitmask */ 91 u16 sci_int; /* System vector of SCI interrupt */
100 u16 sci_int; /* System vector of SCI interrupt */ 92 u8 acpi_enable; /* value to write to smi_cmd to enable ACPI */
101 u8 acpi_enable; /* value to write to smi_cmd to enable ACPI */ 93 u8 acpi_disable; /* value to write to smi_cmd to disable ACPI */
102 u8 acpi_disable; /* value to write to smi_cmd to disable ACPI */ 94 u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */
103 u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ 95 u8 reserved2; /* reserved - must be zero */
104 u8 reserved2; /* reserved - must be zero */ 96 u64 smi_cmd; /* Port address of SMI command port */
105 u64 smi_cmd; /* Port address of SMI command port */ 97 u64 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */
106 u64 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ 98 u64 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */
107 u64 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ 99 u64 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */
108 u64 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ 100 u64 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */
109 u64 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ 101 u64 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */
110 u64 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ 102 u64 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */
111 u64 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ 103 u64 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */
112 u64 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ 104 u64 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */
113 u64 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ 105 u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */
114 u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */ 106 u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */
115 u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */ 107 u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */
116 u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ 108 u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */
117 u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ 109 u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */
118 u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ 110 u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */
119 u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ 111 u8 gpe1_base; /* offset in gpe model where gpe1 events start */
120 u8 gpe1_base; /* offset in gpe model where gpe1 events start */ 112 u8 reserved3; /* reserved */
121 u8 reserved3; /* reserved */ 113 u16 plvl2_lat; /* worst case HW latency to enter/exit C2 state */
122 u16 plvl2_lat; /* worst case HW latency to enter/exit C2 state */ 114 u16 plvl3_lat; /* worst case HW latency to enter/exit C3 state */
123 u16 plvl3_lat; /* worst case HW latency to enter/exit C3 state */ 115 u8 day_alrm; /* index to day-of-month alarm in RTC CMOS RAM */
124 u8 day_alrm; /* index to day-of-month alarm in RTC CMOS RAM */ 116 u8 mon_alrm; /* index to month-of-year alarm in RTC CMOS RAM */
125 u8 mon_alrm; /* index to month-of-year alarm in RTC CMOS RAM */ 117 u8 century; /* index to century in RTC CMOS RAM */
126 u8 century; /* index to century in RTC CMOS RAM */ 118 u8 reserved4; /* reserved */
127 u8 reserved4; /* reserved */ 119 u32 flush_cash:1; /* PAL_FLUSH_CACHE is correctly supported */
128 u32 flush_cash : 1; /* PAL_FLUSH_CACHE is correctly supported */ 120 u32 reserved5:1; /* reserved - must be zero */
129 u32 reserved5 : 1; /* reserved - must be zero */ 121 u32 proc_c1:1; /* all processors support C1 state */
130 u32 proc_c1 : 1; /* all processors support C1 state */ 122 u32 plvl2_up:1; /* C2 state works on MP system */
131 u32 plvl2_up : 1; /* C2 state works on MP system */ 123 u32 pwr_button:1; /* Power button is handled as a generic feature */
132 u32 pwr_button : 1; /* Power button is handled as a generic feature */ 124 u32 sleep_button:1; /* Sleep button is handled as a generic feature, or not present */
133 u32 sleep_button : 1; /* Sleep button is handled as a generic feature, or not present */ 125 u32 fixed_rTC:1; /* RTC wakeup stat not in fixed register space */
134 u32 fixed_rTC : 1; /* RTC wakeup stat not in fixed register space */ 126 u32 rtcs4:1; /* RTC wakeup stat not possible from S4 */
135 u32 rtcs4 : 1; /* RTC wakeup stat not possible from S4 */ 127 u32 tmr_val_ext:1; /* tmr_val is 32 bits */
136 u32 tmr_val_ext : 1; /* tmr_val is 32 bits */ 128 u32 dock_cap:1; /* Supports Docking */
137 u32 dock_cap : 1; /* Supports Docking */ 129 u32 reserved6:22; /* reserved - must be zero */
138 u32 reserved6 : 22; /* reserved - must be zero */
139}; 130};
140 131
141#pragma pack() 132#pragma pack()
142 133
143#endif /* __ACTBL71_H__ */ 134#endif /* __ACTBL71_H__ */
144
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 3a451dc48ac8..6213b27516e8 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -46,35 +46,31 @@
46 46
47/*! [Begin] no source code translation (keep the typedefs) */ 47/*! [Begin] no source code translation (keep the typedefs) */
48 48
49
50
51/* 49/*
52 * Data type ranges 50 * Data type ranges
53 * Note: These macros are designed to be compiler independent as well as 51 * Note: These macros are designed to be compiler independent as well as
54 * working around problems that some 32-bit compilers have with 64-bit 52 * working around problems that some 32-bit compilers have with 64-bit
55 * constants. 53 * constants.
56 */ 54 */
57#define ACPI_UINT8_MAX (UINT8) (~((UINT8) 0)) /* 0xFF */ 55#define ACPI_UINT8_MAX (UINT8) (~((UINT8) 0)) /* 0xFF */
58#define ACPI_UINT16_MAX (UINT16)(~((UINT16) 0)) /* 0xFFFF */ 56#define ACPI_UINT16_MAX (UINT16)(~((UINT16) 0)) /* 0xFFFF */
59#define ACPI_UINT32_MAX (UINT32)(~((UINT32) 0)) /* 0xFFFFFFFF */ 57#define ACPI_UINT32_MAX (UINT32)(~((UINT32) 0)) /* 0xFFFFFFFF */
60#define ACPI_UINT64_MAX (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */ 58#define ACPI_UINT64_MAX (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */
61#define ACPI_ASCII_MAX 0x7F 59#define ACPI_ASCII_MAX 0x7F
62 60
63
64#ifdef DEFINE_ALTERNATE_TYPES 61#ifdef DEFINE_ALTERNATE_TYPES
65/* 62/*
66 * Types used only in translated source, defined here to enable 63 * Types used only in translated source, defined here to enable
67 * cross-platform compilation only. 64 * cross-platform compilation only.
68 */ 65 */
69typedef int s32; 66typedef int s32;
70typedef unsigned char u8; 67typedef unsigned char u8;
71typedef unsigned short u16; 68typedef unsigned short u16;
72typedef unsigned int u32; 69typedef unsigned int u32;
73typedef COMPILER_DEPENDENT_UINT64 u64; 70typedef COMPILER_DEPENDENT_UINT64 u64;
74 71
75#endif 72#endif
76 73
77
78/* 74/*
79 * Data types - Fixed across all compilation models (16/32/64) 75 * Data types - Fixed across all compilation models (16/32/64)
80 * 76 *
@@ -102,30 +98,29 @@ typedef COMPILER_DEPENDENT_UINT64 u64;
102/* 98/*
103 * 64-bit type definitions 99 * 64-bit type definitions
104 */ 100 */
105typedef unsigned char UINT8; 101typedef unsigned char UINT8;
106typedef unsigned char BOOLEAN; 102typedef unsigned char BOOLEAN;
107typedef unsigned short UINT16; 103typedef unsigned short UINT16;
108typedef int INT32; 104typedef int INT32;
109typedef unsigned int UINT32; 105typedef unsigned int UINT32;
110typedef COMPILER_DEPENDENT_INT64 INT64; 106typedef COMPILER_DEPENDENT_INT64 INT64;
111typedef COMPILER_DEPENDENT_UINT64 UINT64; 107typedef COMPILER_DEPENDENT_UINT64 UINT64;
112 108
113/*! [End] no source code translation !*/ 109/*! [End] no source code translation !*/
114 110
115typedef s64 acpi_native_int; 111typedef s64 acpi_native_int;
116typedef u64 acpi_native_uint; 112typedef u64 acpi_native_uint;
117 113
118typedef u64 acpi_table_ptr; 114typedef u64 acpi_table_ptr;
119typedef u64 acpi_io_address; 115typedef u64 acpi_io_address;
120typedef u64 acpi_physical_address; 116typedef u64 acpi_physical_address;
121typedef u64 acpi_size; 117typedef u64 acpi_size;
122 118
123#define ALIGNED_ADDRESS_BOUNDARY 0x00000008 /* No hardware alignment support in IA64 */ 119#define ALIGNED_ADDRESS_BOUNDARY 0x00000008 /* No hardware alignment support in IA64 */
124#define ACPI_USE_NATIVE_DIVIDE /* Native 64-bit integer support */ 120#define ACPI_USE_NATIVE_DIVIDE /* Native 64-bit integer support */
125#define ACPI_MAX_PTR ACPI_UINT64_MAX 121#define ACPI_MAX_PTR ACPI_UINT64_MAX
126#define ACPI_SIZE_MAX ACPI_UINT64_MAX 122#define ACPI_SIZE_MAX ACPI_UINT64_MAX
127 123
128
129#elif ACPI_MACHINE_WIDTH == 16 124#elif ACPI_MACHINE_WIDTH == 16
130 125
131/*! [Begin] no source code translation (keep the typedefs) */ 126/*! [Begin] no source code translation (keep the typedefs) */
@@ -133,32 +128,31 @@ typedef u64 acpi_size;
133/* 128/*
134 * 16-bit type definitions 129 * 16-bit type definitions
135 */ 130 */
136typedef unsigned char UINT8; 131typedef unsigned char UINT8;
137typedef unsigned char BOOLEAN; 132typedef unsigned char BOOLEAN;
138typedef unsigned int UINT16; 133typedef unsigned int UINT16;
139typedef long INT32; 134typedef long INT32;
140typedef int INT16; 135typedef int INT16;
141typedef unsigned long UINT32; 136typedef unsigned long UINT32;
142 137
143struct 138struct {
144{ 139 UINT32 Lo;
145 UINT32 Lo; 140 UINT32 Hi;
146 UINT32 Hi;
147}; 141};
148 142
149/*! [End] no source code translation !*/ 143/*! [End] no source code translation !*/
150 144
151typedef u16 acpi_native_uint; 145typedef u16 acpi_native_uint;
152typedef s16 acpi_native_int; 146typedef s16 acpi_native_int;
153 147
154typedef u32 acpi_table_ptr; 148typedef u32 acpi_table_ptr;
155typedef u32 acpi_io_address; 149typedef u32 acpi_io_address;
156typedef char *acpi_physical_address; 150typedef char *acpi_physical_address;
157typedef u16 acpi_size; 151typedef u16 acpi_size;
158 152
159#define ALIGNED_ADDRESS_BOUNDARY 0x00000002 153#define ALIGNED_ADDRESS_BOUNDARY 0x00000002
160#define ACPI_MISALIGNED_TRANSFERS 154#define ACPI_MISALIGNED_TRANSFERS
161#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */ 155#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */
162#define ACPI_MAX_PTR ACPI_UINT16_MAX 156#define ACPI_MAX_PTR ACPI_UINT16_MAX
163#define ACPI_SIZE_MAX ACPI_UINT16_MAX 157#define ACPI_SIZE_MAX ACPI_UINT16_MAX
164 158
@@ -168,7 +162,6 @@ typedef u16 acpi_size;
168 */ 162 */
169#define ACPI_NO_INTEGER64_SUPPORT 163#define ACPI_NO_INTEGER64_SUPPORT
170 164
171
172#elif ACPI_MACHINE_WIDTH == 32 165#elif ACPI_MACHINE_WIDTH == 32
173 166
174/*! [Begin] no source code translation (keep the typedefs) */ 167/*! [Begin] no source code translation (keep the typedefs) */
@@ -176,23 +169,23 @@ typedef u16 acpi_size;
176/* 169/*
177 * 32-bit type definitions (default) 170 * 32-bit type definitions (default)
178 */ 171 */
179typedef unsigned char UINT8; 172typedef unsigned char UINT8;
180typedef unsigned char BOOLEAN; 173typedef unsigned char BOOLEAN;
181typedef unsigned short UINT16; 174typedef unsigned short UINT16;
182typedef int INT32; 175typedef int INT32;
183typedef unsigned int UINT32; 176typedef unsigned int UINT32;
184typedef COMPILER_DEPENDENT_INT64 INT64; 177typedef COMPILER_DEPENDENT_INT64 INT64;
185typedef COMPILER_DEPENDENT_UINT64 UINT64; 178typedef COMPILER_DEPENDENT_UINT64 UINT64;
186 179
187/*! [End] no source code translation !*/ 180/*! [End] no source code translation !*/
188 181
189typedef s32 acpi_native_int; 182typedef s32 acpi_native_int;
190typedef u32 acpi_native_uint; 183typedef u32 acpi_native_uint;
191 184
192typedef u64 acpi_table_ptr; 185typedef u64 acpi_table_ptr;
193typedef u32 acpi_io_address; 186typedef u32 acpi_io_address;
194typedef u64 acpi_physical_address; 187typedef u64 acpi_physical_address;
195typedef u32 acpi_size; 188typedef u32 acpi_size;
196 189
197#define ALIGNED_ADDRESS_BOUNDARY 0x00000004 190#define ALIGNED_ADDRESS_BOUNDARY 0x00000004
198#define ACPI_MISALIGNED_TRANSFERS 191#define ACPI_MISALIGNED_TRANSFERS
@@ -203,29 +196,27 @@ typedef u32 acpi_size;
203#error unknown ACPI_MACHINE_WIDTH 196#error unknown ACPI_MACHINE_WIDTH
204#endif 197#endif
205 198
206
207/* 199/*
208 * Miscellaneous common types 200 * This type is used for bitfields in ACPI tables. The only type that is
201 * even remotely portable is u8. Anything else is not portable, so
202 * do not add any more bitfield types.
209 */ 203 */
210typedef u16 UINT16_BIT; 204typedef u8 UINT8_BIT;
211typedef u32 UINT32_BIT; 205typedef acpi_native_uint ACPI_PTRDIFF;
212typedef acpi_native_uint ACPI_PTRDIFF;
213 206
214/* 207/*
215 * Pointer overlays to avoid lots of typecasting for 208 * Pointer overlays to avoid lots of typecasting for
216 * code that accepts both physical and logical pointers. 209 * code that accepts both physical and logical pointers.
217 */ 210 */
218union acpi_pointers 211union acpi_pointers {
219{ 212 acpi_physical_address physical;
220 acpi_physical_address physical; 213 void *logical;
221 void *logical; 214 acpi_table_ptr value;
222 acpi_table_ptr value;
223}; 215};
224 216
225struct acpi_pointer 217struct acpi_pointer {
226{ 218 u32 pointer_type;
227 u32 pointer_type; 219 union acpi_pointers pointer;
228 union acpi_pointers pointer;
229}; 220};
230 221
231/* pointer_types for above */ 222/* pointer_types for above */
@@ -243,6 +234,14 @@ struct acpi_pointer
243#define ACPI_LOGMODE_PHYSPTR ACPI_LOGICAL_ADDRESSING | ACPI_PHYSICAL_POINTER 234#define ACPI_LOGMODE_PHYSPTR ACPI_LOGICAL_ADDRESSING | ACPI_PHYSICAL_POINTER
244#define ACPI_LOGMODE_LOGPTR ACPI_LOGICAL_ADDRESSING | ACPI_LOGICAL_POINTER 235#define ACPI_LOGMODE_LOGPTR ACPI_LOGICAL_ADDRESSING | ACPI_LOGICAL_POINTER
245 236
237/*
238 * If acpi_cache_t was not defined in the OS-dependent header,
239 * define it now. This is typically the case where the local cache
240 * manager implementation is to be used (ACPI_USE_LOCAL_CACHE)
241 */
242#ifndef acpi_cache_t
243#define acpi_cache_t struct acpi_memory_list
244#endif
246 245
247/* 246/*
248 * Useful defines 247 * Useful defines
@@ -261,34 +260,29 @@ struct acpi_pointer
261#define NULL (void *) 0 260#define NULL (void *) 0
262#endif 261#endif
263 262
264
265/* 263/*
266 * Local datatypes 264 * Local datatypes
267 */ 265 */
268typedef u32 acpi_status; /* All ACPI Exceptions */ 266typedef u32 acpi_status; /* All ACPI Exceptions */
269typedef u32 acpi_name; /* 4-byte ACPI name */ 267typedef u32 acpi_name; /* 4-byte ACPI name */
270typedef char * acpi_string; /* Null terminated ASCII string */ 268typedef char *acpi_string; /* Null terminated ASCII string */
271typedef void * acpi_handle; /* Actually a ptr to an Node */ 269typedef void *acpi_handle; /* Actually a ptr to an Node */
272 270
273struct uint64_struct 271struct uint64_struct {
274{ 272 u32 lo;
275 u32 lo; 273 u32 hi;
276 u32 hi;
277}; 274};
278 275
279union uint64_overlay 276union uint64_overlay {
280{ 277 u64 full;
281 u64 full; 278 struct uint64_struct part;
282 struct uint64_struct part;
283}; 279};
284 280
285struct uint32_struct 281struct uint32_struct {
286{ 282 u32 lo;
287 u32 lo; 283 u32 hi;
288 u32 hi;
289}; 284};
290 285
291
292/* 286/*
293 * Acpi integer width. In ACPI version 1, integers are 287 * Acpi integer width. In ACPI version 1, integers are
294 * 32 bits. In ACPI version 2, integers are 64 bits. 288 * 32 bits. In ACPI version 2, integers are 64 bits.
@@ -300,26 +294,24 @@ struct uint32_struct
300 294
301/* 32-bit integers only, no 64-bit support */ 295/* 32-bit integers only, no 64-bit support */
302 296
303typedef u32 acpi_integer; 297typedef u32 acpi_integer;
304#define ACPI_INTEGER_MAX ACPI_UINT32_MAX 298#define ACPI_INTEGER_MAX ACPI_UINT32_MAX
305#define ACPI_INTEGER_BIT_SIZE 32 299#define ACPI_INTEGER_BIT_SIZE 32
306#define ACPI_MAX_DECIMAL_DIGITS 10 /* 2^32 = 4,294,967,296 */ 300#define ACPI_MAX_DECIMAL_DIGITS 10 /* 2^32 = 4,294,967,296 */
307
308#define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 32-bit divide */
309 301
302#define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 32-bit divide */
310 303
311#else 304#else
312 305
313/* 64-bit integers */ 306/* 64-bit integers */
314 307
315typedef u64 acpi_integer; 308typedef u64 acpi_integer;
316#define ACPI_INTEGER_MAX ACPI_UINT64_MAX 309#define ACPI_INTEGER_MAX ACPI_UINT64_MAX
317#define ACPI_INTEGER_BIT_SIZE 64 310#define ACPI_INTEGER_BIT_SIZE 64
318#define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */ 311#define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */
319
320 312
321#if ACPI_MACHINE_WIDTH == 64 313#if ACPI_MACHINE_WIDTH == 64
322#define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 64-bit divide */ 314#define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 64-bit divide */
323#endif 315#endif
324#endif 316#endif
325 317
@@ -333,7 +325,6 @@ typedef u64 acpi_integer;
333 */ 325 */
334#define ACPI_ROOT_OBJECT (acpi_handle) ACPI_PTR_ADD (char, NULL, ACPI_MAX_PTR) 326#define ACPI_ROOT_OBJECT (acpi_handle) ACPI_PTR_ADD (char, NULL, ACPI_MAX_PTR)
335 327
336
337/* 328/*
338 * Initialization sequence 329 * Initialization sequence
339 */ 330 */
@@ -400,7 +391,7 @@ typedef u64 acpi_integer;
400/* 391/*
401 * Table types. These values are passed to the table related APIs 392 * Table types. These values are passed to the table related APIs
402 */ 393 */
403typedef u32 acpi_table_type; 394typedef u32 acpi_table_type;
404 395
405#define ACPI_TABLE_RSDP (acpi_table_type) 0 396#define ACPI_TABLE_RSDP (acpi_table_type) 0
406#define ACPI_TABLE_DSDT (acpi_table_type) 1 397#define ACPI_TABLE_DSDT (acpi_table_type) 1
@@ -421,22 +412,22 @@ typedef u32 acpi_table_type;
421 * NOTE: Types must be kept in sync with the global acpi_ns_properties 412 * NOTE: Types must be kept in sync with the global acpi_ns_properties
422 * and acpi_ns_type_names arrays. 413 * and acpi_ns_type_names arrays.
423 */ 414 */
424typedef u32 acpi_object_type; 415typedef u32 acpi_object_type;
425 416
426#define ACPI_TYPE_ANY 0x00 417#define ACPI_TYPE_ANY 0x00
427#define ACPI_TYPE_INTEGER 0x01 /* Byte/Word/Dword/Zero/One/Ones */ 418#define ACPI_TYPE_INTEGER 0x01 /* Byte/Word/Dword/Zero/One/Ones */
428#define ACPI_TYPE_STRING 0x02 419#define ACPI_TYPE_STRING 0x02
429#define ACPI_TYPE_BUFFER 0x03 420#define ACPI_TYPE_BUFFER 0x03
430#define ACPI_TYPE_PACKAGE 0x04 /* byte_const, multiple data_term/Constant/super_name */ 421#define ACPI_TYPE_PACKAGE 0x04 /* byte_const, multiple data_term/Constant/super_name */
431#define ACPI_TYPE_FIELD_UNIT 0x05 422#define ACPI_TYPE_FIELD_UNIT 0x05
432#define ACPI_TYPE_DEVICE 0x06 /* Name, multiple Node */ 423#define ACPI_TYPE_DEVICE 0x06 /* Name, multiple Node */
433#define ACPI_TYPE_EVENT 0x07 424#define ACPI_TYPE_EVENT 0x07
434#define ACPI_TYPE_METHOD 0x08 /* Name, byte_const, multiple Code */ 425#define ACPI_TYPE_METHOD 0x08 /* Name, byte_const, multiple Code */
435#define ACPI_TYPE_MUTEX 0x09 426#define ACPI_TYPE_MUTEX 0x09
436#define ACPI_TYPE_REGION 0x0A 427#define ACPI_TYPE_REGION 0x0A
437#define ACPI_TYPE_POWER 0x0B /* Name,byte_const,word_const,multi Node */ 428#define ACPI_TYPE_POWER 0x0B /* Name,byte_const,word_const,multi Node */
438#define ACPI_TYPE_PROCESSOR 0x0C /* Name,byte_const,Dword_const,byte_const,multi nm_o */ 429#define ACPI_TYPE_PROCESSOR 0x0C /* Name,byte_const,Dword_const,byte_const,multi nm_o */
439#define ACPI_TYPE_THERMAL 0x0D /* Name, multiple Node */ 430#define ACPI_TYPE_THERMAL 0x0D /* Name, multiple Node */
440#define ACPI_TYPE_BUFFER_FIELD 0x0E 431#define ACPI_TYPE_BUFFER_FIELD 0x0E
441#define ACPI_TYPE_DDB_HANDLE 0x0F 432#define ACPI_TYPE_DDB_HANDLE 0x0F
442#define ACPI_TYPE_DEBUG_OBJECT 0x10 433#define ACPI_TYPE_DEBUG_OBJECT 0x10
@@ -453,16 +444,16 @@ typedef u32 acpi_object_type;
453#define ACPI_TYPE_LOCAL_REGION_FIELD 0x11 444#define ACPI_TYPE_LOCAL_REGION_FIELD 0x11
454#define ACPI_TYPE_LOCAL_BANK_FIELD 0x12 445#define ACPI_TYPE_LOCAL_BANK_FIELD 0x12
455#define ACPI_TYPE_LOCAL_INDEX_FIELD 0x13 446#define ACPI_TYPE_LOCAL_INDEX_FIELD 0x13
456#define ACPI_TYPE_LOCAL_REFERENCE 0x14 /* Arg#, Local#, Name, Debug, ref_of, Index */ 447#define ACPI_TYPE_LOCAL_REFERENCE 0x14 /* Arg#, Local#, Name, Debug, ref_of, Index */
457#define ACPI_TYPE_LOCAL_ALIAS 0x15 448#define ACPI_TYPE_LOCAL_ALIAS 0x15
458#define ACPI_TYPE_LOCAL_METHOD_ALIAS 0x16 449#define ACPI_TYPE_LOCAL_METHOD_ALIAS 0x16
459#define ACPI_TYPE_LOCAL_NOTIFY 0x17 450#define ACPI_TYPE_LOCAL_NOTIFY 0x17
460#define ACPI_TYPE_LOCAL_ADDRESS_HANDLER 0x18 451#define ACPI_TYPE_LOCAL_ADDRESS_HANDLER 0x18
461#define ACPI_TYPE_LOCAL_RESOURCE 0x19 452#define ACPI_TYPE_LOCAL_RESOURCE 0x19
462#define ACPI_TYPE_LOCAL_RESOURCE_FIELD 0x1A 453#define ACPI_TYPE_LOCAL_RESOURCE_FIELD 0x1A
463#define ACPI_TYPE_LOCAL_SCOPE 0x1B /* 1 Name, multiple object_list Nodes */ 454#define ACPI_TYPE_LOCAL_SCOPE 0x1B /* 1 Name, multiple object_list Nodes */
464 455
465#define ACPI_TYPE_NS_NODE_MAX 0x1B /* Last typecode used within a NS Node */ 456#define ACPI_TYPE_NS_NODE_MAX 0x1B /* Last typecode used within a NS Node */
466 457
467/* 458/*
468 * These are special object types that never appear in 459 * These are special object types that never appear in
@@ -506,7 +497,7 @@ typedef u32 acpi_object_type;
506#define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE) 497#define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE)
507#define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE) 498#define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE)
508#define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR) 499#define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR)
509#define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */ 500#define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */
510#define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF 501#define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF
511 502
512/* 503/*
@@ -519,7 +510,7 @@ typedef u32 acpi_object_type;
519/* 510/*
520 * Event Types: Fixed & General Purpose 511 * Event Types: Fixed & General Purpose
521 */ 512 */
522typedef u32 acpi_event_type; 513typedef u32 acpi_event_type;
523 514
524/* 515/*
525 * Fixed events 516 * Fixed events
@@ -547,7 +538,7 @@ typedef u32 acpi_event_type;
547 * | +----- Set? 538 * | +----- Set?
548 * +----------- <Reserved> 539 * +----------- <Reserved>
549 */ 540 */
550typedef u32 acpi_event_status; 541typedef u32 acpi_event_status;
551 542
552#define ACPI_EVENT_FLAG_DISABLED (acpi_event_status) 0x00 543#define ACPI_EVENT_FLAG_DISABLED (acpi_event_status) 0x00
553#define ACPI_EVENT_FLAG_ENABLED (acpi_event_status) 0x01 544#define ACPI_EVENT_FLAG_ENABLED (acpi_event_status) 0x01
@@ -564,7 +555,6 @@ typedef u32 acpi_event_status;
564#define ACPI_GPE_ENABLE 0 555#define ACPI_GPE_ENABLE 0
565#define ACPI_GPE_DISABLE 1 556#define ACPI_GPE_DISABLE 1
566 557
567
568/* 558/*
569 * GPE info flags - Per GPE 559 * GPE info flags - Per GPE
570 * +-+-+-+---+---+-+ 560 * +-+-+-+---+---+-+
@@ -585,22 +575,22 @@ typedef u32 acpi_event_status;
585#define ACPI_GPE_TYPE_MASK (u8) 0x06 575#define ACPI_GPE_TYPE_MASK (u8) 0x06
586#define ACPI_GPE_TYPE_WAKE_RUN (u8) 0x06 576#define ACPI_GPE_TYPE_WAKE_RUN (u8) 0x06
587#define ACPI_GPE_TYPE_WAKE (u8) 0x02 577#define ACPI_GPE_TYPE_WAKE (u8) 0x02
588#define ACPI_GPE_TYPE_RUNTIME (u8) 0x04 /* Default */ 578#define ACPI_GPE_TYPE_RUNTIME (u8) 0x04 /* Default */
589 579
590#define ACPI_GPE_DISPATCH_MASK (u8) 0x18 580#define ACPI_GPE_DISPATCH_MASK (u8) 0x18
591#define ACPI_GPE_DISPATCH_HANDLER (u8) 0x08 581#define ACPI_GPE_DISPATCH_HANDLER (u8) 0x08
592#define ACPI_GPE_DISPATCH_METHOD (u8) 0x10 582#define ACPI_GPE_DISPATCH_METHOD (u8) 0x10
593#define ACPI_GPE_DISPATCH_NOT_USED (u8) 0x00 /* Default */ 583#define ACPI_GPE_DISPATCH_NOT_USED (u8) 0x00 /* Default */
594 584
595#define ACPI_GPE_RUN_ENABLE_MASK (u8) 0x20 585#define ACPI_GPE_RUN_ENABLE_MASK (u8) 0x20
596#define ACPI_GPE_RUN_ENABLED (u8) 0x20 586#define ACPI_GPE_RUN_ENABLED (u8) 0x20
597#define ACPI_GPE_RUN_DISABLED (u8) 0x00 /* Default */ 587#define ACPI_GPE_RUN_DISABLED (u8) 0x00 /* Default */
598 588
599#define ACPI_GPE_WAKE_ENABLE_MASK (u8) 0x40 589#define ACPI_GPE_WAKE_ENABLE_MASK (u8) 0x40
600#define ACPI_GPE_WAKE_ENABLED (u8) 0x40 590#define ACPI_GPE_WAKE_ENABLED (u8) 0x40
601#define ACPI_GPE_WAKE_DISABLED (u8) 0x00 /* Default */ 591#define ACPI_GPE_WAKE_DISABLED (u8) 0x00 /* Default */
602 592
603#define ACPI_GPE_ENABLE_MASK (u8) 0x60 /* Both run/wake */ 593#define ACPI_GPE_ENABLE_MASK (u8) 0x60 /* Both run/wake */
604 594
605#define ACPI_GPE_SYSTEM_MASK (u8) 0x80 595#define ACPI_GPE_SYSTEM_MASK (u8) 0x80
606#define ACPI_GPE_SYSTEM_RUNNING (u8) 0x80 596#define ACPI_GPE_SYSTEM_RUNNING (u8) 0x80
@@ -609,13 +599,12 @@ typedef u32 acpi_event_status;
609/* 599/*
610 * Flags for GPE and Lock interfaces 600 * Flags for GPE and Lock interfaces
611 */ 601 */
612#define ACPI_EVENT_WAKE_ENABLE 0x2 /* acpi_gpe_enable */ 602#define ACPI_EVENT_WAKE_ENABLE 0x2 /* acpi_gpe_enable */
613#define ACPI_EVENT_WAKE_DISABLE 0x2 /* acpi_gpe_disable */ 603#define ACPI_EVENT_WAKE_DISABLE 0x2 /* acpi_gpe_disable */
614 604
615#define ACPI_NOT_ISR 0x1 605#define ACPI_NOT_ISR 0x1
616#define ACPI_ISR 0x0 606#define ACPI_ISR 0x0
617 607
618
619/* Notify types */ 608/* Notify types */
620 609
621#define ACPI_SYSTEM_NOTIFY 0x1 610#define ACPI_SYSTEM_NOTIFY 0x1
@@ -625,10 +614,9 @@ typedef u32 acpi_event_status;
625 614
626#define ACPI_MAX_SYS_NOTIFY 0x7f 615#define ACPI_MAX_SYS_NOTIFY 0x7f
627 616
628
629/* Address Space (Operation Region) Types */ 617/* Address Space (Operation Region) Types */
630 618
631typedef u8 acpi_adr_space_type; 619typedef u8 acpi_adr_space_type;
632 620
633#define ACPI_ADR_SPACE_SYSTEM_MEMORY (acpi_adr_space_type) 0 621#define ACPI_ADR_SPACE_SYSTEM_MEMORY (acpi_adr_space_type) 0
634#define ACPI_ADR_SPACE_SYSTEM_IO (acpi_adr_space_type) 1 622#define ACPI_ADR_SPACE_SYSTEM_IO (acpi_adr_space_type) 1
@@ -640,7 +628,6 @@ typedef u8 acpi_adr_space_type;
640#define ACPI_ADR_SPACE_DATA_TABLE (acpi_adr_space_type) 7 628#define ACPI_ADR_SPACE_DATA_TABLE (acpi_adr_space_type) 7
641#define ACPI_ADR_SPACE_FIXED_HARDWARE (acpi_adr_space_type) 127 629#define ACPI_ADR_SPACE_FIXED_HARDWARE (acpi_adr_space_type) 127
642 630
643
644/* 631/*
645 * bit_register IDs 632 * bit_register IDs
646 * These are bitfields defined within the full ACPI registers 633 * These are bitfields defined within the full ACPI registers
@@ -674,74 +661,62 @@ typedef u8 acpi_adr_space_type;
674#define ACPI_BITREG_MAX 0x15 661#define ACPI_BITREG_MAX 0x15
675#define ACPI_NUM_BITREG ACPI_BITREG_MAX + 1 662#define ACPI_NUM_BITREG ACPI_BITREG_MAX + 1
676 663
677
678/* 664/*
679 * External ACPI object definition 665 * External ACPI object definition
680 */ 666 */
681union acpi_object 667union acpi_object {
682{ 668 acpi_object_type type; /* See definition of acpi_ns_type for values */
683 acpi_object_type type; /* See definition of acpi_ns_type for values */ 669 struct {
684 struct 670 acpi_object_type type;
685 { 671 acpi_integer value; /* The actual number */
686 acpi_object_type type;
687 acpi_integer value; /* The actual number */
688 } integer; 672 } integer;
689 673
690 struct 674 struct {
691 { 675 acpi_object_type type;
692 acpi_object_type type; 676 u32 length; /* # of bytes in string, excluding trailing null */
693 u32 length; /* # of bytes in string, excluding trailing null */ 677 char *pointer; /* points to the string value */
694 char *pointer; /* points to the string value */
695 } string; 678 } string;
696 679
697 struct 680 struct {
698 { 681 acpi_object_type type;
699 acpi_object_type type; 682 u32 length; /* # of bytes in buffer */
700 u32 length; /* # of bytes in buffer */ 683 u8 *pointer; /* points to the buffer */
701 u8 *pointer; /* points to the buffer */
702 } buffer; 684 } buffer;
703 685
704 struct 686 struct {
705 { 687 acpi_object_type type;
706 acpi_object_type type; 688 u32 fill1;
707 u32 fill1; 689 acpi_handle handle; /* object reference */
708 acpi_handle handle; /* object reference */
709 } reference; 690 } reference;
710 691
711 struct 692 struct {
712 { 693 acpi_object_type type;
713 acpi_object_type type; 694 u32 count; /* # of elements in package */
714 u32 count; /* # of elements in package */ 695 union acpi_object *elements; /* Pointer to an array of ACPI_OBJECTs */
715 union acpi_object *elements; /* Pointer to an array of ACPI_OBJECTs */
716 } package; 696 } package;
717 697
718 struct 698 struct {
719 { 699 acpi_object_type type;
720 acpi_object_type type; 700 u32 proc_id;
721 u32 proc_id; 701 acpi_io_address pblk_address;
722 acpi_io_address pblk_address; 702 u32 pblk_length;
723 u32 pblk_length;
724 } processor; 703 } processor;
725 704
726 struct 705 struct {
727 { 706 acpi_object_type type;
728 acpi_object_type type; 707 u32 system_level;
729 u32 system_level; 708 u32 resource_order;
730 u32 resource_order;
731 } power_resource; 709 } power_resource;
732}; 710};
733 711
734
735/* 712/*
736 * List of objects, used as a parameter list for control method evaluation 713 * List of objects, used as a parameter list for control method evaluation
737 */ 714 */
738struct acpi_object_list 715struct acpi_object_list {
739{ 716 u32 count;
740 u32 count; 717 union acpi_object *pointer;
741 union acpi_object *pointer;
742}; 718};
743 719
744
745/* 720/*
746 * Miscellaneous common Data Structures used by the interfaces 721 * Miscellaneous common Data Structures used by the interfaces
747 */ 722 */
@@ -749,13 +724,11 @@ struct acpi_object_list
749#define ACPI_ALLOCATE_BUFFER (acpi_size) (-1) 724#define ACPI_ALLOCATE_BUFFER (acpi_size) (-1)
750#define ACPI_ALLOCATE_LOCAL_BUFFER (acpi_size) (-2) 725#define ACPI_ALLOCATE_LOCAL_BUFFER (acpi_size) (-2)
751 726
752struct acpi_buffer 727struct acpi_buffer {
753{ 728 acpi_size length; /* Length in bytes of the buffer */
754 acpi_size length; /* Length in bytes of the buffer */ 729 void *pointer; /* pointer to buffer */
755 void *pointer; /* pointer to buffer */
756}; 730};
757 731
758
759/* 732/*
760 * name_type for acpi_get_name 733 * name_type for acpi_get_name
761 */ 734 */
@@ -763,7 +736,6 @@ struct acpi_buffer
763#define ACPI_SINGLE_NAME 1 736#define ACPI_SINGLE_NAME 1
764#define ACPI_NAME_TYPE_MAX 1 737#define ACPI_NAME_TYPE_MAX 1
765 738
766
767/* 739/*
768 * Structure and flags for acpi_get_system_info 740 * Structure and flags for acpi_get_system_info
769 */ 741 */
@@ -772,139 +744,106 @@ struct acpi_buffer
772#define ACPI_SYS_MODE_LEGACY 0x0002 744#define ACPI_SYS_MODE_LEGACY 0x0002
773#define ACPI_SYS_MODES_MASK 0x0003 745#define ACPI_SYS_MODES_MASK 0x0003
774 746
775
776/* 747/*
777 * ACPI Table Info. One per ACPI table _type_ 748 * ACPI Table Info. One per ACPI table _type_
778 */ 749 */
779struct acpi_table_info 750struct acpi_table_info {
780{ 751 u32 count;
781 u32 count;
782}; 752};
783 753
784
785/* 754/*
786 * System info returned by acpi_get_system_info() 755 * System info returned by acpi_get_system_info()
787 */ 756 */
788struct acpi_system_info 757struct acpi_system_info {
789{ 758 u32 acpi_ca_version;
790 u32 acpi_ca_version; 759 u32 flags;
791 u32 flags; 760 u32 timer_resolution;
792 u32 timer_resolution; 761 u32 reserved1;
793 u32 reserved1; 762 u32 reserved2;
794 u32 reserved2; 763 u32 debug_level;
795 u32 debug_level; 764 u32 debug_layer;
796 u32 debug_layer; 765 u32 num_table_types;
797 u32 num_table_types; 766 struct acpi_table_info table_info[NUM_ACPI_TABLE_TYPES];
798 struct acpi_table_info table_info [NUM_ACPI_TABLE_TYPES];
799}; 767};
800 768
801
802/* 769/*
803 * Types specific to the OS service interfaces 770 * Types specific to the OS service interfaces
804 */ 771 */
805typedef u32 772typedef u32(ACPI_SYSTEM_XFACE * acpi_osd_handler) (void *context);
806(ACPI_SYSTEM_XFACE *acpi_osd_handler) (
807 void *context);
808 773
809typedef void 774typedef void
810(ACPI_SYSTEM_XFACE *acpi_osd_exec_callback) ( 775 (ACPI_SYSTEM_XFACE * acpi_osd_exec_callback) (void *context);
811 void *context);
812 776
813/* 777/*
814 * Various handlers and callback procedures 778 * Various handlers and callback procedures
815 */ 779 */
816typedef 780typedef u32(*acpi_event_handler) (void *context);
817u32 (*acpi_event_handler) (
818 void *context);
819 781
820typedef 782typedef
821void (*acpi_notify_handler) ( 783void (*acpi_notify_handler) (acpi_handle device, u32 value, void *context);
822 acpi_handle device,
823 u32 value,
824 void *context);
825 784
826typedef 785typedef
827void (*acpi_object_handler) ( 786void (*acpi_object_handler) (acpi_handle object, u32 function, void *data);
828 acpi_handle object,
829 u32 function,
830 void *data);
831 787
832typedef 788typedef acpi_status(*acpi_init_handler) (acpi_handle object, u32 function);
833acpi_status (*acpi_init_handler) (
834 acpi_handle object,
835 u32 function);
836 789
837#define ACPI_INIT_DEVICE_INI 1 790#define ACPI_INIT_DEVICE_INI 1
838 791
839typedef 792typedef
840acpi_status (*acpi_exception_handler) ( 793acpi_status(*acpi_exception_handler) (acpi_status aml_status,
841 acpi_status aml_status, 794 acpi_name name,
842 acpi_name name, 795 u16 opcode,
843 u16 opcode, 796 u32 aml_offset, void *context);
844 u32 aml_offset,
845 void *context);
846
847 797
848/* Address Spaces (For Operation Regions) */ 798/* Address Spaces (For Operation Regions) */
849 799
850typedef 800typedef
851acpi_status (*acpi_adr_space_handler) ( 801acpi_status(*acpi_adr_space_handler) (u32 function,
852 u32 function, 802 acpi_physical_address address,
853 acpi_physical_address address, 803 u32 bit_width,
854 u32 bit_width, 804 acpi_integer * value,
855 acpi_integer *value, 805 void *handler_context,
856 void *handler_context, 806 void *region_context);
857 void *region_context);
858 807
859#define ACPI_DEFAULT_HANDLER NULL 808#define ACPI_DEFAULT_HANDLER NULL
860 809
861
862typedef 810typedef
863acpi_status (*acpi_adr_space_setup) ( 811acpi_status(*acpi_adr_space_setup) (acpi_handle region_handle,
864 acpi_handle region_handle, 812 u32 function,
865 u32 function, 813 void *handler_context,
866 void *handler_context, 814 void **region_context);
867 void **region_context);
868 815
869#define ACPI_REGION_ACTIVATE 0 816#define ACPI_REGION_ACTIVATE 0
870#define ACPI_REGION_DEACTIVATE 1 817#define ACPI_REGION_DEACTIVATE 1
871 818
872typedef 819typedef
873acpi_status (*acpi_walk_callback) ( 820acpi_status(*acpi_walk_callback) (acpi_handle obj_handle,
874 acpi_handle obj_handle, 821 u32 nesting_level,
875 u32 nesting_level, 822 void *context, void **return_value);
876 void *context,
877 void **return_value);
878
879 823
880/* Interrupt handler return values */ 824/* Interrupt handler return values */
881 825
882#define ACPI_INTERRUPT_NOT_HANDLED 0x00 826#define ACPI_INTERRUPT_NOT_HANDLED 0x00
883#define ACPI_INTERRUPT_HANDLED 0x01 827#define ACPI_INTERRUPT_HANDLED 0x01
884 828
885
886/* Common string version of device HIDs and UIDs */ 829/* Common string version of device HIDs and UIDs */
887 830
888struct acpi_device_id 831struct acpi_device_id {
889{ 832 char value[ACPI_DEVICE_ID_LENGTH];
890 char value[ACPI_DEVICE_ID_LENGTH];
891}; 833};
892 834
893/* Common string version of device CIDs */ 835/* Common string version of device CIDs */
894 836
895struct acpi_compatible_id 837struct acpi_compatible_id {
896{ 838 char value[ACPI_MAX_CID_LENGTH];
897 char value[ACPI_MAX_CID_LENGTH];
898}; 839};
899 840
900struct acpi_compatible_id_list 841struct acpi_compatible_id_list {
901{ 842 u32 count;
902 u32 count; 843 u32 size;
903 u32 size; 844 struct acpi_compatible_id id[1];
904 struct acpi_compatible_id id[1];
905}; 845};
906 846
907
908/* Structure and flags for acpi_get_object_info */ 847/* Structure and flags for acpi_get_object_info */
909 848
910#define ACPI_VALID_STA 0x0001 849#define ACPI_VALID_STA 0x0001
@@ -914,55 +853,45 @@ struct acpi_compatible_id_list
914#define ACPI_VALID_CID 0x0010 853#define ACPI_VALID_CID 0x0010
915#define ACPI_VALID_SXDS 0x0020 854#define ACPI_VALID_SXDS 0x0020
916 855
917
918#define ACPI_COMMON_OBJ_INFO \ 856#define ACPI_COMMON_OBJ_INFO \
919 acpi_object_type type; /* ACPI object type */ \ 857 acpi_object_type type; /* ACPI object type */ \
920 acpi_name name /* ACPI object Name */ 858 acpi_name name /* ACPI object Name */
921
922 859
923struct acpi_obj_info_header 860struct acpi_obj_info_header {
924{
925 ACPI_COMMON_OBJ_INFO; 861 ACPI_COMMON_OBJ_INFO;
926}; 862};
927 863
928
929/* Structure returned from Get Object Info */ 864/* Structure returned from Get Object Info */
930 865
931struct acpi_device_info 866struct acpi_device_info {
932{
933 ACPI_COMMON_OBJ_INFO; 867 ACPI_COMMON_OBJ_INFO;
934 868
935 u32 valid; /* Indicates which fields below are valid */ 869 u32 valid; /* Indicates which fields below are valid */
936 u32 current_status; /* _STA value */ 870 u32 current_status; /* _STA value */
937 acpi_integer address; /* _ADR value if any */ 871 acpi_integer address; /* _ADR value if any */
938 struct acpi_device_id hardware_id; /* _HID value if any */ 872 struct acpi_device_id hardware_id; /* _HID value if any */
939 struct acpi_device_id unique_id; /* _UID value if any */ 873 struct acpi_device_id unique_id; /* _UID value if any */
940 u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */ 874 u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */
941 struct acpi_compatible_id_list compatibility_id; /* List of _CIDs if any */ 875 struct acpi_compatible_id_list compatibility_id; /* List of _CIDs if any */
942}; 876};
943 877
944
945/* Context structs for address space handlers */ 878/* Context structs for address space handlers */
946 879
947struct acpi_pci_id 880struct acpi_pci_id {
948{ 881 u16 segment;
949 u16 segment; 882 u16 bus;
950 u16 bus; 883 u16 device;
951 u16 device; 884 u16 function;
952 u16 function;
953}; 885};
954 886
955 887struct acpi_mem_space_context {
956struct acpi_mem_space_context 888 u32 length;
957{ 889 acpi_physical_address address;
958 u32 length; 890 acpi_physical_address mapped_physical_address;
959 acpi_physical_address address; 891 u8 *mapped_logical_address;
960 acpi_physical_address mapped_physical_address; 892 acpi_size mapped_length;
961 u8 *mapped_logical_address;
962 acpi_size mapped_length;
963}; 893};
964 894
965
966/* 895/*
967 * Definitions for Resource Attributes 896 * Definitions for Resource Attributes
968 */ 897 */
@@ -992,8 +921,8 @@ struct acpi_mem_space_context
992/* 921/*
993 * IO Port Descriptor Decode 922 * IO Port Descriptor Decode
994 */ 923 */
995#define ACPI_DECODE_10 (u8) 0x00 /* 10-bit IO address decode */ 924#define ACPI_DECODE_10 (u8) 0x00 /* 10-bit IO address decode */
996#define ACPI_DECODE_16 (u8) 0x01 /* 16-bit IO address decode */ 925#define ACPI_DECODE_16 (u8) 0x01 /* 16-bit IO address decode */
997 926
998/* 927/*
999 * IRQ Attributes 928 * IRQ Attributes
@@ -1045,32 +974,28 @@ struct acpi_mem_space_context
1045#define ACPI_PRODUCER (u8) 0x00 974#define ACPI_PRODUCER (u8) 0x00
1046#define ACPI_CONSUMER (u8) 0x01 975#define ACPI_CONSUMER (u8) 0x01
1047 976
1048
1049/* 977/*
1050 * Structures used to describe device resources 978 * Structures used to describe device resources
1051 */ 979 */
1052struct acpi_resource_irq 980struct acpi_resource_irq {
1053{ 981 u32 edge_level;
1054 u32 edge_level; 982 u32 active_high_low;
1055 u32 active_high_low; 983 u32 shared_exclusive;
1056 u32 shared_exclusive; 984 u32 number_of_interrupts;
1057 u32 number_of_interrupts; 985 u32 interrupts[1];
1058 u32 interrupts[1];
1059}; 986};
1060 987
1061struct acpi_resource_dma 988struct acpi_resource_dma {
1062{ 989 u32 type;
1063 u32 type; 990 u32 bus_master;
1064 u32 bus_master; 991 u32 transfer;
1065 u32 transfer; 992 u32 number_of_channels;
1066 u32 number_of_channels; 993 u32 channels[1];
1067 u32 channels[1];
1068}; 994};
1069 995
1070struct acpi_resource_start_dpf 996struct acpi_resource_start_dpf {
1071{ 997 u32 compatibility_priority;
1072 u32 compatibility_priority; 998 u32 performance_robustness;
1073 u32 performance_robustness;
1074}; 999};
1075 1000
1076/* 1001/*
@@ -1078,149 +1003,127 @@ struct acpi_resource_start_dpf
1078 * needed because it has no fields 1003 * needed because it has no fields
1079 */ 1004 */
1080 1005
1081struct acpi_resource_io 1006struct acpi_resource_io {
1082{ 1007 u32 io_decode;
1083 u32 io_decode; 1008 u32 min_base_address;
1084 u32 min_base_address; 1009 u32 max_base_address;
1085 u32 max_base_address; 1010 u32 alignment;
1086 u32 alignment; 1011 u32 range_length;
1087 u32 range_length;
1088}; 1012};
1089 1013
1090struct acpi_resource_fixed_io 1014struct acpi_resource_fixed_io {
1091{ 1015 u32 base_address;
1092 u32 base_address; 1016 u32 range_length;
1093 u32 range_length;
1094}; 1017};
1095 1018
1096struct acpi_resource_vendor 1019struct acpi_resource_vendor {
1097{ 1020 u32 length;
1098 u32 length; 1021 u8 reserved[1];
1099 u8 reserved[1];
1100}; 1022};
1101 1023
1102struct acpi_resource_end_tag 1024struct acpi_resource_end_tag {
1103{ 1025 u8 checksum;
1104 u8 checksum;
1105}; 1026};
1106 1027
1107struct acpi_resource_mem24 1028struct acpi_resource_mem24 {
1108{ 1029 u32 read_write_attribute;
1109 u32 read_write_attribute; 1030 u32 min_base_address;
1110 u32 min_base_address; 1031 u32 max_base_address;
1111 u32 max_base_address; 1032 u32 alignment;
1112 u32 alignment; 1033 u32 range_length;
1113 u32 range_length;
1114}; 1034};
1115 1035
1116struct acpi_resource_mem32 1036struct acpi_resource_mem32 {
1117{ 1037 u32 read_write_attribute;
1118 u32 read_write_attribute; 1038 u32 min_base_address;
1119 u32 min_base_address; 1039 u32 max_base_address;
1120 u32 max_base_address; 1040 u32 alignment;
1121 u32 alignment; 1041 u32 range_length;
1122 u32 range_length;
1123}; 1042};
1124 1043
1125struct acpi_resource_fixed_mem32 1044struct acpi_resource_fixed_mem32 {
1126{ 1045 u32 read_write_attribute;
1127 u32 read_write_attribute; 1046 u32 range_base_address;
1128 u32 range_base_address; 1047 u32 range_length;
1129 u32 range_length;
1130}; 1048};
1131 1049
1132struct acpi_memory_attribute 1050struct acpi_memory_attribute {
1133{ 1051 u16 cache_attribute;
1134 u16 cache_attribute; 1052 u16 read_write_attribute;
1135 u16 read_write_attribute;
1136}; 1053};
1137 1054
1138struct acpi_io_attribute 1055struct acpi_io_attribute {
1139{ 1056 u16 range_attribute;
1140 u16 range_attribute; 1057 u16 translation_attribute;
1141 u16 translation_attribute;
1142}; 1058};
1143 1059
1144struct acpi_bus_attribute 1060struct acpi_bus_attribute {
1145{ 1061 u16 reserved1;
1146 u16 reserved1; 1062 u16 reserved2;
1147 u16 reserved2;
1148}; 1063};
1149 1064
1150union acpi_resource_attribute 1065union acpi_resource_attribute {
1151{ 1066 struct acpi_memory_attribute memory;
1152 struct acpi_memory_attribute memory; 1067 struct acpi_io_attribute io;
1153 struct acpi_io_attribute io; 1068 struct acpi_bus_attribute bus;
1154 struct acpi_bus_attribute bus;
1155}; 1069};
1156 1070
1157struct acpi_resource_source 1071struct acpi_resource_source {
1158{ 1072 u32 index;
1159 u32 index; 1073 u32 string_length;
1160 u32 string_length; 1074 char *string_ptr;
1161 char *string_ptr;
1162}; 1075};
1163 1076
1164struct acpi_resource_address16 1077/* Fields common to all address descriptors, 16/32/64 bit */
1165{
1166 u32 resource_type;
1167 u32 producer_consumer;
1168 u32 decode;
1169 u32 min_address_fixed;
1170 u32 max_address_fixed;
1171 union acpi_resource_attribute attribute;
1172 u32 granularity;
1173 u32 min_address_range;
1174 u32 max_address_range;
1175 u32 address_translation_offset;
1176 u32 address_length;
1177 struct acpi_resource_source resource_source;
1178};
1179 1078
1180struct acpi_resource_address32 1079#define ACPI_RESOURCE_ADDRESS_COMMON \
1181{ 1080 u32 resource_type; \
1182 u32 resource_type; 1081 u32 producer_consumer; \
1183 u32 producer_consumer; 1082 u32 decode; \
1184 u32 decode; 1083 u32 min_address_fixed; \
1185 u32 min_address_fixed; 1084 u32 max_address_fixed; \
1186 u32 max_address_fixed;
1187 union acpi_resource_attribute attribute; 1085 union acpi_resource_attribute attribute;
1188 u32 granularity; 1086
1189 u32 min_address_range; 1087struct acpi_resource_address {
1190 u32 max_address_range; 1088ACPI_RESOURCE_ADDRESS_COMMON};
1191 u32 address_translation_offset; 1089
1192 u32 address_length; 1090struct acpi_resource_address16 {
1193 struct acpi_resource_source resource_source; 1091 ACPI_RESOURCE_ADDRESS_COMMON u32 granularity;
1092 u32 min_address_range;
1093 u32 max_address_range;
1094 u32 address_translation_offset;
1095 u32 address_length;
1096 struct acpi_resource_source resource_source;
1194}; 1097};
1195 1098
1196struct acpi_resource_address64 1099struct acpi_resource_address32 {
1197{ 1100 ACPI_RESOURCE_ADDRESS_COMMON u32 granularity;
1198 u32 resource_type; 1101 u32 min_address_range;
1199 u32 producer_consumer; 1102 u32 max_address_range;
1200 u32 decode; 1103 u32 address_translation_offset;
1201 u32 min_address_fixed; 1104 u32 address_length;
1202 u32 max_address_fixed; 1105 struct acpi_resource_source resource_source;
1203 union acpi_resource_attribute attribute;
1204 u64 granularity;
1205 u64 min_address_range;
1206 u64 max_address_range;
1207 u64 address_translation_offset;
1208 u64 address_length;
1209 u64 type_specific_attributes;
1210 struct acpi_resource_source resource_source;
1211}; 1106};
1212 1107
1213struct acpi_resource_ext_irq 1108struct acpi_resource_address64 {
1214{ 1109 ACPI_RESOURCE_ADDRESS_COMMON u64 granularity;
1215 u32 producer_consumer; 1110 u64 min_address_range;
1216 u32 edge_level; 1111 u64 max_address_range;
1217 u32 active_high_low; 1112 u64 address_translation_offset;
1218 u32 shared_exclusive; 1113 u64 address_length;
1219 u32 number_of_interrupts; 1114 u64 type_specific_attributes;
1220 struct acpi_resource_source resource_source; 1115 struct acpi_resource_source resource_source;
1221 u32 interrupts[1];
1222}; 1116};
1223 1117
1118struct acpi_resource_ext_irq {
1119 u32 producer_consumer;
1120 u32 edge_level;
1121 u32 active_high_low;
1122 u32 shared_exclusive;
1123 u32 number_of_interrupts;
1124 struct acpi_resource_source resource_source;
1125 u32 interrupts[1];
1126};
1224 1127
1225/* ACPI_RESOURCE_TYPEs */ 1128/* ACPI_RESOURCE_TYPEs */
1226 1129
@@ -1240,35 +1143,34 @@ struct acpi_resource_ext_irq
1240#define ACPI_RSTYPE_ADDRESS64 13 1143#define ACPI_RSTYPE_ADDRESS64 13
1241#define ACPI_RSTYPE_EXT_IRQ 14 1144#define ACPI_RSTYPE_EXT_IRQ 14
1242 1145
1243typedef u32 acpi_resource_type; 1146typedef u32 acpi_resource_type;
1244 1147
1245union acpi_resource_data 1148union acpi_resource_data {
1246{ 1149 struct acpi_resource_irq irq;
1247 struct acpi_resource_irq irq; 1150 struct acpi_resource_dma dma;
1248 struct acpi_resource_dma dma; 1151 struct acpi_resource_start_dpf start_dpf;
1249 struct acpi_resource_start_dpf start_dpf; 1152 struct acpi_resource_io io;
1250 struct acpi_resource_io io; 1153 struct acpi_resource_fixed_io fixed_io;
1251 struct acpi_resource_fixed_io fixed_io; 1154 struct acpi_resource_vendor vendor_specific;
1252 struct acpi_resource_vendor vendor_specific; 1155 struct acpi_resource_end_tag end_tag;
1253 struct acpi_resource_end_tag end_tag; 1156 struct acpi_resource_mem24 memory24;
1254 struct acpi_resource_mem24 memory24; 1157 struct acpi_resource_mem32 memory32;
1255 struct acpi_resource_mem32 memory32; 1158 struct acpi_resource_fixed_mem32 fixed_memory32;
1256 struct acpi_resource_fixed_mem32 fixed_memory32; 1159 struct acpi_resource_address address; /* Common 16/32/64 address fields */
1257 struct acpi_resource_address16 address16; 1160 struct acpi_resource_address16 address16;
1258 struct acpi_resource_address32 address32; 1161 struct acpi_resource_address32 address32;
1259 struct acpi_resource_address64 address64; 1162 struct acpi_resource_address64 address64;
1260 struct acpi_resource_ext_irq extended_irq; 1163 struct acpi_resource_ext_irq extended_irq;
1261}; 1164};
1262 1165
1263struct acpi_resource 1166struct acpi_resource {
1264{ 1167 acpi_resource_type id;
1265 acpi_resource_type id; 1168 u32 length;
1266 u32 length; 1169 union acpi_resource_data data;
1267 union acpi_resource_data data;
1268}; 1170};
1269 1171
1270#define ACPI_RESOURCE_LENGTH 12 1172#define ACPI_RESOURCE_LENGTH 12
1271#define ACPI_RESOURCE_LENGTH_NO_DATA 8 /* Id + Length fields */ 1173#define ACPI_RESOURCE_LENGTH_NO_DATA 8 /* Id + Length fields */
1272 1174
1273#define ACPI_SIZEOF_RESOURCE(type) (ACPI_RESOURCE_LENGTH_NO_DATA + sizeof (type)) 1175#define ACPI_SIZEOF_RESOURCE(type) (ACPI_RESOURCE_LENGTH_NO_DATA + sizeof (type))
1274 1176
@@ -1284,19 +1186,16 @@ struct acpi_resource
1284 * END: of definitions for Resource Attributes 1186 * END: of definitions for Resource Attributes
1285 */ 1187 */
1286 1188
1287 1189struct acpi_pci_routing_table {
1288struct acpi_pci_routing_table 1190 u32 length;
1289{ 1191 u32 pin;
1290 u32 length; 1192 acpi_integer address; /* here for 64-bit alignment */
1291 u32 pin; 1193 u32 source_index;
1292 acpi_integer address; /* here for 64-bit alignment */ 1194 char source[4]; /* pad to 64 bits so sizeof() works in all cases */
1293 u32 source_index;
1294 char source[4]; /* pad to 64 bits so sizeof() works in all cases */
1295}; 1195};
1296 1196
1297/* 1197/*
1298 * END: of definitions for PCI Routing tables 1198 * END: of definitions for PCI Routing tables
1299 */ 1199 */
1300 1200
1301 1201#endif /* __ACTYPES_H__ */
1302#endif /* __ACTYPES_H__ */
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index 192d0bea3884..c1086452696e 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -44,20 +44,17 @@
44#ifndef _ACUTILS_H 44#ifndef _ACUTILS_H
45#define _ACUTILS_H 45#define _ACUTILS_H
46 46
47
48typedef 47typedef
49acpi_status (*acpi_pkg_callback) ( 48acpi_status(*acpi_pkg_callback) (u8 object_type,
50 u8 object_type, 49 union acpi_operand_object * source_object,
51 union acpi_operand_object *source_object, 50 union acpi_generic_state * state,
52 union acpi_generic_state *state, 51 void *context);
53 void *context); 52
54 53struct acpi_pkg_info {
55struct acpi_pkg_info 54 u8 *free_space;
56{ 55 acpi_size length;
57 u8 *free_space; 56 u32 object_space;
58 acpi_size length; 57 u32 num_packages;
59 u32 object_space;
60 u32 num_packages;
61}; 58};
62 59
63#define REF_INCREMENT (u16) 0 60#define REF_INCREMENT (u16) 0
@@ -71,167 +68,89 @@ struct acpi_pkg_info
71#define DB_DWORD_DISPLAY 4 68#define DB_DWORD_DISPLAY 4
72#define DB_QWORD_DISPLAY 8 69#define DB_QWORD_DISPLAY 8
73 70
74
75/* 71/*
76 * utglobal - Global data structures and procedures 72 * utglobal - Global data structures and procedures
77 */ 73 */
78void 74void acpi_ut_init_globals(void);
79acpi_ut_init_globals (
80 void);
81 75
82#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 76#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
83 77
84char * 78char *acpi_ut_get_mutex_name(u32 mutex_id);
85acpi_ut_get_mutex_name (
86 u32 mutex_id);
87 79
88#endif 80#endif
89 81
90char * 82char *acpi_ut_get_type_name(acpi_object_type type);
91acpi_ut_get_type_name (
92 acpi_object_type type);
93
94char *
95acpi_ut_get_node_name (
96 void *object);
97
98char *
99acpi_ut_get_descriptor_name (
100 void *object);
101 83
102char * 84char *acpi_ut_get_node_name(void *object);
103acpi_ut_get_object_type_name (
104 union acpi_operand_object *obj_desc);
105 85
106char * 86char *acpi_ut_get_descriptor_name(void *object);
107acpi_ut_get_region_name (
108 u8 space_id);
109 87
110char * 88char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc);
111acpi_ut_get_event_name (
112 u32 event_id);
113 89
114char 90char *acpi_ut_get_region_name(u8 space_id);
115acpi_ut_hex_to_ascii_char (
116 acpi_integer integer,
117 u32 position);
118 91
119u8 92char *acpi_ut_get_event_name(u32 event_id);
120acpi_ut_valid_object_type (
121 acpi_object_type type);
122 93
123acpi_owner_id 94char acpi_ut_hex_to_ascii_char(acpi_integer integer, u32 position);
124acpi_ut_allocate_owner_id (
125 u32 id_type);
126 95
96u8 acpi_ut_valid_object_type(acpi_object_type type);
127 97
128/* 98/*
129 * utinit - miscellaneous initialization and shutdown 99 * utinit - miscellaneous initialization and shutdown
130 */ 100 */
131acpi_status 101acpi_status acpi_ut_hardware_initialize(void);
132acpi_ut_hardware_initialize (
133 void);
134 102
135void 103void acpi_ut_subsystem_shutdown(void);
136acpi_ut_subsystem_shutdown (
137 void);
138
139acpi_status
140acpi_ut_validate_fadt (
141 void);
142 104
105acpi_status acpi_ut_validate_fadt(void);
143 106
144/* 107/*
145 * utclib - Local implementations of C library functions 108 * utclib - Local implementations of C library functions
146 */ 109 */
147#ifndef ACPI_USE_SYSTEM_CLIBRARY 110#ifndef ACPI_USE_SYSTEM_CLIBRARY
148 111
149acpi_size 112acpi_size acpi_ut_strlen(const char *string);
150acpi_ut_strlen ( 113
151 const char *string); 114char *acpi_ut_strcpy(char *dst_string, const char *src_string);
152 115
153char * 116char *acpi_ut_strncpy(char *dst_string,
154acpi_ut_strcpy ( 117 const char *src_string, acpi_size count);
155 char *dst_string, 118
156 const char *src_string); 119int acpi_ut_memcmp(const char *buffer1, const char *buffer2, acpi_size count);
157 120
158char * 121int acpi_ut_strncmp(const char *string1, const char *string2, acpi_size count);
159acpi_ut_strncpy ( 122
160 char *dst_string, 123int acpi_ut_strcmp(const char *string1, const char *string2);
161 const char *src_string, 124
162 acpi_size count); 125char *acpi_ut_strcat(char *dst_string, const char *src_string);
163 126
164int 127char *acpi_ut_strncat(char *dst_string,
165acpi_ut_memcmp ( 128 const char *src_string, acpi_size count);
166 const char *buffer1, 129
167 const char *buffer2, 130u32 acpi_ut_strtoul(const char *string, char **terminator, u32 base);
168 acpi_size count); 131
169 132char *acpi_ut_strstr(char *string1, char *string2);
170int 133
171acpi_ut_strncmp ( 134void *acpi_ut_memcpy(void *dest, const void *src, acpi_size count);
172 const char *string1, 135
173 const char *string2, 136void *acpi_ut_memset(void *dest, acpi_native_uint value, acpi_size count);
174 acpi_size count); 137
175 138int acpi_ut_to_upper(int c);
176int 139
177acpi_ut_strcmp ( 140int acpi_ut_to_lower(int c);
178 const char *string1,
179 const char *string2);
180
181char *
182acpi_ut_strcat (
183 char *dst_string,
184 const char *src_string);
185
186char *
187acpi_ut_strncat (
188 char *dst_string,
189 const char *src_string,
190 acpi_size count);
191
192u32
193acpi_ut_strtoul (
194 const char *string,
195 char **terminator,
196 u32 base);
197
198char *
199acpi_ut_strstr (
200 char *string1,
201 char *string2);
202
203void *
204acpi_ut_memcpy (
205 void *dest,
206 const void *src,
207 acpi_size count);
208
209void *
210acpi_ut_memset (
211 void *dest,
212 acpi_native_uint value,
213 acpi_size count);
214
215int
216acpi_ut_to_upper (
217 int c);
218
219int
220acpi_ut_to_lower (
221 int c);
222 141
223extern const u8 _acpi_ctype[]; 142extern const u8 _acpi_ctype[];
224 143
225#define _ACPI_XA 0x00 /* extra alphabetic - not supported */ 144#define _ACPI_XA 0x00 /* extra alphabetic - not supported */
226#define _ACPI_XS 0x40 /* extra space */ 145#define _ACPI_XS 0x40 /* extra space */
227#define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */ 146#define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */
228#define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */ 147#define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */
229#define _ACPI_DI 0x04 /* '0'-'9' */ 148#define _ACPI_DI 0x04 /* '0'-'9' */
230#define _ACPI_LO 0x02 /* 'a'-'z' */ 149#define _ACPI_LO 0x02 /* 'a'-'z' */
231#define _ACPI_PU 0x10 /* punctuation */ 150#define _ACPI_PU 0x10 /* punctuation */
232#define _ACPI_SP 0x08 /* space */ 151#define _ACPI_SP 0x08 /* space */
233#define _ACPI_UP 0x01 /* 'A'-'Z' */ 152#define _ACPI_UP 0x01 /* 'A'-'Z' */
234#define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */ 153#define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */
235 154
236#define ACPI_IS_DIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI)) 155#define ACPI_IS_DIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI))
237#define ACPI_IS_SPACE(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP)) 156#define ACPI_IS_SPACE(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP))
@@ -242,502 +161,323 @@ extern const u8 _acpi_ctype[];
242#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) 161#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
243#define ACPI_IS_ASCII(c) ((c) < 0x80) 162#define ACPI_IS_ASCII(c) ((c) < 0x80)
244 163
245#endif /* ACPI_USE_SYSTEM_CLIBRARY */ 164#endif /* ACPI_USE_SYSTEM_CLIBRARY */
246
247 165
248/* 166/*
249 * utcopy - Object construction and conversion interfaces 167 * utcopy - Object construction and conversion interfaces
250 */ 168 */
251acpi_status 169acpi_status
252acpi_ut_build_simple_object( 170acpi_ut_build_simple_object(union acpi_operand_object *obj,
253 union acpi_operand_object *obj, 171 union acpi_object *user_obj,
254 union acpi_object *user_obj, 172 u8 * data_space, u32 * buffer_space_used);
255 u8 *data_space,
256 u32 *buffer_space_used);
257 173
258acpi_status 174acpi_status
259acpi_ut_build_package_object ( 175acpi_ut_build_package_object(union acpi_operand_object *obj,
260 union acpi_operand_object *obj, 176 u8 * buffer, u32 * space_used);
261 u8 *buffer,
262 u32 *space_used);
263 177
264acpi_status 178acpi_status
265acpi_ut_copy_iobject_to_eobject ( 179acpi_ut_copy_iobject_to_eobject(union acpi_operand_object *obj,
266 union acpi_operand_object *obj, 180 struct acpi_buffer *ret_buffer);
267 struct acpi_buffer *ret_buffer);
268 181
269acpi_status 182acpi_status
270acpi_ut_copy_eobject_to_iobject ( 183acpi_ut_copy_eobject_to_iobject(union acpi_object *obj,
271 union acpi_object *obj, 184 union acpi_operand_object **internal_obj);
272 union acpi_operand_object **internal_obj);
273 185
274acpi_status 186acpi_status
275acpi_ut_copy_isimple_to_isimple ( 187acpi_ut_copy_isimple_to_isimple(union acpi_operand_object *source_obj,
276 union acpi_operand_object *source_obj, 188 union acpi_operand_object *dest_obj);
277 union acpi_operand_object *dest_obj);
278 189
279acpi_status 190acpi_status
280acpi_ut_copy_iobject_to_iobject ( 191acpi_ut_copy_iobject_to_iobject(union acpi_operand_object *source_desc,
281 union acpi_operand_object *source_desc, 192 union acpi_operand_object **dest_desc,
282 union acpi_operand_object **dest_desc, 193 struct acpi_walk_state *walk_state);
283 struct acpi_walk_state *walk_state);
284
285 194
286/* 195/*
287 * utcreate - Object creation 196 * utcreate - Object creation
288 */ 197 */
289acpi_status 198acpi_status
290acpi_ut_update_object_reference ( 199acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action);
291 union acpi_operand_object *object,
292 u16 action);
293
294 200
295/* 201/*
296 * utdebug - Debug interfaces 202 * utdebug - Debug interfaces
297 */ 203 */
298void 204void acpi_ut_init_stack_ptr_trace(void);
299acpi_ut_init_stack_ptr_trace (
300 void);
301 205
302void 206void acpi_ut_track_stack_ptr(void);
303acpi_ut_track_stack_ptr (
304 void);
305 207
306void 208void
307acpi_ut_trace ( 209acpi_ut_trace(u32 line_number,
308 u32 line_number, 210 const char *function_name, char *module_name, u32 component_id);
309 struct acpi_debug_print_info *dbg_info);
310 211
311void 212void
312acpi_ut_trace_ptr ( 213acpi_ut_trace_ptr(u32 line_number,
313 u32 line_number, 214 const char *function_name,
314 struct acpi_debug_print_info *dbg_info, 215 char *module_name, u32 component_id, void *pointer);
315 void *pointer);
316 216
317void 217void
318acpi_ut_trace_u32 ( 218acpi_ut_trace_u32(u32 line_number,
319 u32 line_number, 219 const char *function_name,
320 struct acpi_debug_print_info *dbg_info, 220 char *module_name, u32 component_id, u32 integer);
321 u32 integer);
322 221
323void 222void
324acpi_ut_trace_str ( 223acpi_ut_trace_str(u32 line_number,
325 u32 line_number, 224 const char *function_name,
326 struct acpi_debug_print_info *dbg_info, 225 char *module_name, u32 component_id, char *string);
327 char *string);
328 226
329void 227void
330acpi_ut_exit ( 228acpi_ut_exit(u32 line_number,
331 u32 line_number, 229 const char *function_name, char *module_name, u32 component_id);
332 struct acpi_debug_print_info *dbg_info);
333 230
334void 231void
335acpi_ut_status_exit ( 232acpi_ut_status_exit(u32 line_number,
336 u32 line_number, 233 const char *function_name,
337 struct acpi_debug_print_info *dbg_info, 234 char *module_name, u32 component_id, acpi_status status);
338 acpi_status status);
339 235
340void 236void
341acpi_ut_value_exit ( 237acpi_ut_value_exit(u32 line_number,
342 u32 line_number, 238 const char *function_name,
343 struct acpi_debug_print_info *dbg_info, 239 char *module_name, u32 component_id, acpi_integer value);
344 acpi_integer value);
345 240
346void 241void
347acpi_ut_ptr_exit ( 242acpi_ut_ptr_exit(u32 line_number,
348 u32 line_number, 243 const char *function_name,
349 struct acpi_debug_print_info *dbg_info, 244 char *module_name, u32 component_id, u8 * ptr);
350 u8 *ptr);
351 245
352void 246void acpi_ut_report_info(char *module_name, u32 line_number, u32 component_id);
353acpi_ut_report_info (
354 char *module_name,
355 u32 line_number,
356 u32 component_id);
357 247
358void 248void acpi_ut_report_error(char *module_name, u32 line_number, u32 component_id);
359acpi_ut_report_error (
360 char *module_name,
361 u32 line_number,
362 u32 component_id);
363 249
364void 250void
365acpi_ut_report_warning ( 251acpi_ut_report_warning(char *module_name, u32 line_number, u32 component_id);
366 char *module_name,
367 u32 line_number,
368 u32 component_id);
369 252
370void 253void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id);
371acpi_ut_dump_buffer (
372 u8 *buffer,
373 u32 count,
374 u32 display,
375 u32 component_id);
376 254
377void ACPI_INTERNAL_VAR_XFACE 255void ACPI_INTERNAL_VAR_XFACE
378acpi_ut_debug_print ( 256acpi_ut_debug_print(u32 requested_debug_level,
379 u32 requested_debug_level, 257 u32 line_number,
380 u32 line_number, 258 const char *function_name,
381 struct acpi_debug_print_info *dbg_info, 259 char *module_name,
382 char *format, 260 u32 component_id, char *format, ...) ACPI_PRINTF_LIKE_FUNC;
383 ...) ACPI_PRINTF_LIKE_FUNC;
384 261
385void ACPI_INTERNAL_VAR_XFACE 262void ACPI_INTERNAL_VAR_XFACE
386acpi_ut_debug_print_raw ( 263acpi_ut_debug_print_raw(u32 requested_debug_level,
387 u32 requested_debug_level, 264 u32 line_number,
388 u32 line_number, 265 const char *function_name,
389 struct acpi_debug_print_info *dbg_info, 266 char *module_name,
390 char *format, 267 u32 component_id,
391 ...) ACPI_PRINTF_LIKE_FUNC; 268 char *format, ...) ACPI_PRINTF_LIKE_FUNC;
392
393 269
394/* 270/*
395 * utdelete - Object deletion and reference counts 271 * utdelete - Object deletion and reference counts
396 */ 272 */
397void 273void acpi_ut_add_reference(union acpi_operand_object *object);
398acpi_ut_add_reference (
399 union acpi_operand_object *object);
400 274
401void 275void acpi_ut_remove_reference(union acpi_operand_object *object);
402acpi_ut_remove_reference (
403 union acpi_operand_object *object);
404 276
405void 277void acpi_ut_delete_internal_package_object(union acpi_operand_object *object);
406acpi_ut_delete_internal_package_object (
407 union acpi_operand_object *object);
408 278
409void 279void acpi_ut_delete_internal_simple_object(union acpi_operand_object *object);
410acpi_ut_delete_internal_simple_object (
411 union acpi_operand_object *object);
412
413void
414acpi_ut_delete_internal_object_list (
415 union acpi_operand_object **obj_list);
416 280
281void acpi_ut_delete_internal_object_list(union acpi_operand_object **obj_list);
417 282
418/* 283/*
419 * uteval - object evaluation 284 * uteval - object evaluation
420 */ 285 */
421acpi_status 286acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state);
422acpi_ut_osi_implementation (
423 struct acpi_walk_state *walk_state);
424 287
425acpi_status 288acpi_status
426acpi_ut_evaluate_object ( 289acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node,
427 struct acpi_namespace_node *prefix_node, 290 char *path,
428 char *path, 291 u32 expected_return_btypes,
429 u32 expected_return_btypes, 292 union acpi_operand_object **return_desc);
430 union acpi_operand_object **return_desc);
431 293
432acpi_status 294acpi_status
433acpi_ut_evaluate_numeric_object ( 295acpi_ut_evaluate_numeric_object(char *object_name,
434 char *object_name, 296 struct acpi_namespace_node *device_node,
435 struct acpi_namespace_node *device_node, 297 acpi_integer * address);
436 acpi_integer *address);
437 298
438acpi_status 299acpi_status
439acpi_ut_execute_HID ( 300acpi_ut_execute_HID(struct acpi_namespace_node *device_node,
440 struct acpi_namespace_node *device_node, 301 struct acpi_device_id *hid);
441 struct acpi_device_id *hid);
442 302
443acpi_status 303acpi_status
444acpi_ut_execute_CID ( 304acpi_ut_execute_CID(struct acpi_namespace_node *device_node,
445 struct acpi_namespace_node *device_node, 305 struct acpi_compatible_id_list **return_cid_list);
446 struct acpi_compatible_id_list **return_cid_list);
447 306
448acpi_status 307acpi_status
449acpi_ut_execute_STA ( 308acpi_ut_execute_STA(struct acpi_namespace_node *device_node,
450 struct acpi_namespace_node *device_node, 309 u32 * status_flags);
451 u32 *status_flags);
452 310
453acpi_status 311acpi_status
454acpi_ut_execute_UID ( 312acpi_ut_execute_UID(struct acpi_namespace_node *device_node,
455 struct acpi_namespace_node *device_node, 313 struct acpi_device_id *uid);
456 struct acpi_device_id *uid);
457 314
458acpi_status 315acpi_status
459acpi_ut_execute_sxds ( 316acpi_ut_execute_sxds(struct acpi_namespace_node *device_node, u8 * highest);
460 struct acpi_namespace_node *device_node,
461 u8 *highest);
462
463 317
464/* 318/*
465 * utobject - internal object create/delete/cache routines 319 * utobject - internal object create/delete/cache routines
466 */ 320 */
467union acpi_operand_object * 321union acpi_operand_object *acpi_ut_create_internal_object_dbg(char *module_name,
468acpi_ut_create_internal_object_dbg ( 322 u32 line_number,
469 char *module_name, 323 u32 component_id,
470 u32 line_number, 324 acpi_object_type
471 u32 component_id, 325 type);
472 acpi_object_type type);
473
474void *
475acpi_ut_allocate_object_desc_dbg (
476 char *module_name,
477 u32 line_number,
478 u32 component_id);
479
480#define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_THIS_MODULE,__LINE__,_COMPONENT,t)
481#define acpi_ut_allocate_object_desc() acpi_ut_allocate_object_desc_dbg (_THIS_MODULE,__LINE__,_COMPONENT)
482 326
483void 327void *acpi_ut_allocate_object_desc_dbg(char *module_name,
484acpi_ut_delete_object_desc ( 328 u32 line_number, u32 component_id);
485 union acpi_operand_object *object);
486 329
487u8 330#define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_acpi_module_name,__LINE__,_COMPONENT,t)
488acpi_ut_valid_internal_object ( 331#define acpi_ut_allocate_object_desc() acpi_ut_allocate_object_desc_dbg (_acpi_module_name,__LINE__,_COMPONENT)
489 void *object);
490 332
491union acpi_operand_object * 333void acpi_ut_delete_object_desc(union acpi_operand_object *object);
492acpi_ut_create_buffer_object (
493 acpi_size buffer_size);
494 334
495union acpi_operand_object * 335u8 acpi_ut_valid_internal_object(void *object);
496acpi_ut_create_string_object (
497 acpi_size string_size);
498 336
499acpi_status 337union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size);
500acpi_ut_get_object_size(
501 union acpi_operand_object *obj,
502 acpi_size *obj_length);
503 338
339union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size);
340
341acpi_status
342acpi_ut_get_object_size(union acpi_operand_object *obj, acpi_size * obj_length);
504 343
505/* 344/*
506 * utstate - Generic state creation/cache routines 345 * utstate - Generic state creation/cache routines
507 */ 346 */
508void 347void
509acpi_ut_push_generic_state ( 348acpi_ut_push_generic_state(union acpi_generic_state **list_head,
510 union acpi_generic_state **list_head, 349 union acpi_generic_state *state);
511 union acpi_generic_state *state);
512 350
513union acpi_generic_state * 351union acpi_generic_state *acpi_ut_pop_generic_state(union acpi_generic_state
514acpi_ut_pop_generic_state ( 352 **list_head);
515 union acpi_generic_state **list_head);
516 353
354union acpi_generic_state *acpi_ut_create_generic_state(void);
517 355
518union acpi_generic_state * 356struct acpi_thread_state *acpi_ut_create_thread_state(void);
519acpi_ut_create_generic_state (
520 void);
521 357
522struct acpi_thread_state * 358union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object
523acpi_ut_create_thread_state ( 359 *object, u16 action);
524 void);
525 360
526union acpi_generic_state * 361union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object,
527acpi_ut_create_update_state ( 362 void *external_object,
528 union acpi_operand_object *object, 363 u16 index);
529 u16 action);
530
531union acpi_generic_state *
532acpi_ut_create_pkg_state (
533 void *internal_object,
534 void *external_object,
535 u16 index);
536 364
537acpi_status 365acpi_status
538acpi_ut_create_update_state_and_push ( 366acpi_ut_create_update_state_and_push(union acpi_operand_object *object,
539 union acpi_operand_object *object, 367 u16 action,
540 u16 action, 368 union acpi_generic_state **state_list);
541 union acpi_generic_state **state_list);
542 369
543#ifdef ACPI_FUTURE_USAGE 370#ifdef ACPI_FUTURE_USAGE
544acpi_status 371acpi_status
545acpi_ut_create_pkg_state_and_push ( 372acpi_ut_create_pkg_state_and_push(void *internal_object,
546 void *internal_object, 373 void *external_object,
547 void *external_object, 374 u16 index,
548 u16 index, 375 union acpi_generic_state **state_list);
549 union acpi_generic_state **state_list); 376#endif /* ACPI_FUTURE_USAGE */
550#endif /* ACPI_FUTURE_USAGE */
551 377
552union acpi_generic_state * 378union acpi_generic_state *acpi_ut_create_control_state(void);
553acpi_ut_create_control_state (
554 void);
555
556void
557acpi_ut_delete_generic_state (
558 union acpi_generic_state *state);
559
560#ifdef ACPI_ENABLE_OBJECT_CACHE
561void
562acpi_ut_delete_generic_state_cache (
563 void);
564
565void
566acpi_ut_delete_object_cache (
567 void);
568#endif
569 379
380void acpi_ut_delete_generic_state(union acpi_generic_state *state);
570 381
571/* 382/*
572 * utmath 383 * utmath
573 */ 384 */
574acpi_status 385acpi_status
575acpi_ut_divide ( 386acpi_ut_divide(acpi_integer in_dividend,
576 acpi_integer in_dividend, 387 acpi_integer in_divisor,
577 acpi_integer in_divisor, 388 acpi_integer * out_quotient, acpi_integer * out_remainder);
578 acpi_integer *out_quotient,
579 acpi_integer *out_remainder);
580 389
581acpi_status 390acpi_status
582acpi_ut_short_divide ( 391acpi_ut_short_divide(acpi_integer in_dividend,
583 acpi_integer in_dividend, 392 u32 divisor,
584 u32 divisor, 393 acpi_integer * out_quotient, u32 * out_remainder);
585 acpi_integer *out_quotient,
586 u32 *out_remainder);
587 394
588/* 395/*
589 * utmisc 396 * utmisc
590 */ 397 */
398acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id);
399
400void acpi_ut_release_owner_id(acpi_owner_id * owner_id);
401
591acpi_status 402acpi_status
592acpi_ut_walk_package_tree ( 403acpi_ut_walk_package_tree(union acpi_operand_object *source_object,
593 union acpi_operand_object *source_object, 404 void *target_object,
594 void *target_object, 405 acpi_pkg_callback walk_callback, void *context);
595 acpi_pkg_callback walk_callback,
596 void *context);
597 406
598char * 407void acpi_ut_strupr(char *src_string);
599acpi_ut_strupr (
600 char *src_string);
601 408
602void 409void acpi_ut_print_string(char *string, u8 max_length);
603acpi_ut_print_string (
604 char *string,
605 u8 max_length);
606 410
607u8 411u8 acpi_ut_valid_acpi_name(u32 name);
608acpi_ut_valid_acpi_name (
609 u32 name);
610 412
611u8 413u8 acpi_ut_valid_acpi_character(char character);
612acpi_ut_valid_acpi_character (
613 char character);
614 414
615acpi_status 415acpi_status
616acpi_ut_strtoul64 ( 416acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer);
617 char *string,
618 u32 base,
619 acpi_integer *ret_integer);
620 417
621/* Values for Base above (16=Hex, 10=Decimal) */ 418/* Values for Base above (16=Hex, 10=Decimal) */
622 419
623#define ACPI_ANY_BASE 0 420#define ACPI_ANY_BASE 0
624 421
625acpi_status 422u8 *acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc);
626acpi_ut_mutex_initialize (
627 void);
628
629void
630acpi_ut_mutex_terminate (
631 void);
632
633acpi_status
634acpi_ut_acquire_mutex (
635 acpi_mutex_handle mutex_id);
636
637acpi_status
638acpi_ut_release_mutex (
639 acpi_mutex_handle mutex_id);
640
641u8 *
642acpi_ut_get_resource_end_tag (
643 union acpi_operand_object *obj_desc);
644 423
645u8 424u8 acpi_ut_generate_checksum(u8 * buffer, u32 length);
646acpi_ut_generate_checksum (
647 u8 *buffer,
648 u32 length);
649 425
650u32 426u32 acpi_ut_dword_byte_swap(u32 value);
651acpi_ut_dword_byte_swap (
652 u32 value);
653 427
654void 428void acpi_ut_set_integer_width(u8 revision);
655acpi_ut_set_integer_width (
656 u8 revision);
657 429
658#ifdef ACPI_DEBUG_OUTPUT 430#ifdef ACPI_DEBUG_OUTPUT
659void 431void
660acpi_ut_display_init_pathname ( 432acpi_ut_display_init_pathname(u8 type,
661 u8 type, 433 struct acpi_namespace_node *obj_handle,
662 struct acpi_namespace_node *obj_handle, 434 char *path);
663 char *path);
664 435
665#endif 436#endif
666 437
438/*
439 * utmutex - mutex support
440 */
441acpi_status acpi_ut_mutex_initialize(void);
442
443void acpi_ut_mutex_terminate(void);
444
445acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id);
446
447acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id);
667 448
668/* 449/*
669 * utalloc - memory allocation and object caching 450 * utalloc - memory allocation and object caching
670 */ 451 */
671void * 452acpi_status acpi_ut_create_caches(void);
672acpi_ut_acquire_from_cache (
673 u32 list_id);
674 453
675void 454acpi_status acpi_ut_delete_caches(void);
676acpi_ut_release_to_cache (
677 u32 list_id,
678 void *object);
679 455
680#ifdef ACPI_ENABLE_OBJECT_CACHE 456acpi_status acpi_ut_validate_buffer(struct acpi_buffer *buffer);
681void
682acpi_ut_delete_generic_cache (
683 u32 list_id);
684#endif
685 457
686acpi_status 458acpi_status
687acpi_ut_validate_buffer ( 459acpi_ut_initialize_buffer(struct acpi_buffer *buffer,
688 struct acpi_buffer *buffer); 460 acpi_size required_length);
689 461
690acpi_status 462void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line);
691acpi_ut_initialize_buffer ( 463
692 struct acpi_buffer *buffer, 464void *acpi_ut_callocate(acpi_size size, u32 component, char *module, u32 line);
693 acpi_size required_length);
694
695void *
696acpi_ut_allocate (
697 acpi_size size,
698 u32 component,
699 char *module,
700 u32 line);
701
702void *
703acpi_ut_callocate (
704 acpi_size size,
705 u32 component,
706 char *module,
707 u32 line);
708 465
709#ifdef ACPI_DBG_TRACK_ALLOCATIONS 466#ifdef ACPI_DBG_TRACK_ALLOCATIONS
710void * 467void *acpi_ut_allocate_and_track(acpi_size size,
711acpi_ut_allocate_and_track ( 468 u32 component, char *module, u32 line);
712 acpi_size size, 469
713 u32 component, 470void *acpi_ut_callocate_and_track(acpi_size size,
714 char *module, 471 u32 component, char *module, u32 line);
715 u32 line);
716
717void *
718acpi_ut_callocate_and_track (
719 acpi_size size,
720 u32 component,
721 char *module,
722 u32 line);
723 472
724void 473void
725acpi_ut_free_and_track ( 474acpi_ut_free_and_track(void *address, u32 component, char *module, u32 line);
726 void *address,
727 u32 component,
728 char *module,
729 u32 line);
730 475
731#ifdef ACPI_FUTURE_USAGE 476#ifdef ACPI_FUTURE_USAGE
732void 477void acpi_ut_dump_allocation_info(void);
733acpi_ut_dump_allocation_info ( 478#endif /* ACPI_FUTURE_USAGE */
734 void);
735#endif /* ACPI_FUTURE_USAGE */
736 479
737void 480void acpi_ut_dump_allocations(u32 component, char *module);
738acpi_ut_dump_allocations (
739 u32 component,
740 char *module);
741#endif 481#endif
742 482
743#endif /* _ACUTILS_H */ 483#endif /* _ACUTILS_H */
diff --git a/include/acpi/amlcode.h b/include/acpi/amlcode.h
index 55e97ed29190..7fdf5299f501 100644
--- a/include/acpi/amlcode.h
+++ b/include/acpi/amlcode.h
@@ -59,17 +59,17 @@
59#define AML_WORD_OP (u16) 0x0b 59#define AML_WORD_OP (u16) 0x0b
60#define AML_DWORD_OP (u16) 0x0c 60#define AML_DWORD_OP (u16) 0x0c
61#define AML_STRING_OP (u16) 0x0d 61#define AML_STRING_OP (u16) 0x0d
62#define AML_QWORD_OP (u16) 0x0e /* ACPI 2.0 */ 62#define AML_QWORD_OP (u16) 0x0e /* ACPI 2.0 */
63#define AML_SCOPE_OP (u16) 0x10 63#define AML_SCOPE_OP (u16) 0x10
64#define AML_BUFFER_OP (u16) 0x11 64#define AML_BUFFER_OP (u16) 0x11
65#define AML_PACKAGE_OP (u16) 0x12 65#define AML_PACKAGE_OP (u16) 0x12
66#define AML_VAR_PACKAGE_OP (u16) 0x13 /* ACPI 2.0 */ 66#define AML_VAR_PACKAGE_OP (u16) 0x13 /* ACPI 2.0 */
67#define AML_METHOD_OP (u16) 0x14 67#define AML_METHOD_OP (u16) 0x14
68#define AML_DUAL_NAME_PREFIX (u16) 0x2e 68#define AML_DUAL_NAME_PREFIX (u16) 0x2e
69#define AML_MULTI_NAME_PREFIX_OP (u16) 0x2f 69#define AML_MULTI_NAME_PREFIX_OP (u16) 0x2f
70#define AML_NAME_CHAR_SUBSEQ (u16) 0x30 70#define AML_NAME_CHAR_SUBSEQ (u16) 0x30
71#define AML_NAME_CHAR_FIRST (u16) 0x41 71#define AML_NAME_CHAR_FIRST (u16) 0x41
72#define AML_OP_PREFIX (u16) 0x5b 72#define AML_EXTENDED_OP_PREFIX (u16) 0x5b
73#define AML_ROOT_PREFIX (u16) 0x5c 73#define AML_ROOT_PREFIX (u16) 0x5c
74#define AML_PARENT_PREFIX (u16) 0x5e 74#define AML_PARENT_PREFIX (u16) 0x5e
75#define AML_LOCAL_OP (u16) 0x60 75#define AML_LOCAL_OP (u16) 0x60
@@ -109,8 +109,8 @@
109#define AML_FIND_SET_LEFT_BIT_OP (u16) 0x81 109#define AML_FIND_SET_LEFT_BIT_OP (u16) 0x81
110#define AML_FIND_SET_RIGHT_BIT_OP (u16) 0x82 110#define AML_FIND_SET_RIGHT_BIT_OP (u16) 0x82
111#define AML_DEREF_OF_OP (u16) 0x83 111#define AML_DEREF_OF_OP (u16) 0x83
112#define AML_CONCAT_RES_OP (u16) 0x84 /* ACPI 2.0 */ 112#define AML_CONCAT_RES_OP (u16) 0x84 /* ACPI 2.0 */
113#define AML_MOD_OP (u16) 0x85 /* ACPI 2.0 */ 113#define AML_MOD_OP (u16) 0x85 /* ACPI 2.0 */
114#define AML_NOTIFY_OP (u16) 0x86 114#define AML_NOTIFY_OP (u16) 0x86
115#define AML_SIZE_OF_OP (u16) 0x87 115#define AML_SIZE_OF_OP (u16) 0x87
116#define AML_INDEX_OP (u16) 0x88 116#define AML_INDEX_OP (u16) 0x88
@@ -120,21 +120,21 @@
120#define AML_CREATE_BYTE_FIELD_OP (u16) 0x8c 120#define AML_CREATE_BYTE_FIELD_OP (u16) 0x8c
121#define AML_CREATE_BIT_FIELD_OP (u16) 0x8d 121#define AML_CREATE_BIT_FIELD_OP (u16) 0x8d
122#define AML_TYPE_OP (u16) 0x8e 122#define AML_TYPE_OP (u16) 0x8e
123#define AML_CREATE_QWORD_FIELD_OP (u16) 0x8f /* ACPI 2.0 */ 123#define AML_CREATE_QWORD_FIELD_OP (u16) 0x8f /* ACPI 2.0 */
124#define AML_LAND_OP (u16) 0x90 124#define AML_LAND_OP (u16) 0x90
125#define AML_LOR_OP (u16) 0x91 125#define AML_LOR_OP (u16) 0x91
126#define AML_LNOT_OP (u16) 0x92 126#define AML_LNOT_OP (u16) 0x92
127#define AML_LEQUAL_OP (u16) 0x93 127#define AML_LEQUAL_OP (u16) 0x93
128#define AML_LGREATER_OP (u16) 0x94 128#define AML_LGREATER_OP (u16) 0x94
129#define AML_LLESS_OP (u16) 0x95 129#define AML_LLESS_OP (u16) 0x95
130#define AML_TO_BUFFER_OP (u16) 0x96 /* ACPI 2.0 */ 130#define AML_TO_BUFFER_OP (u16) 0x96 /* ACPI 2.0 */
131#define AML_TO_DECSTRING_OP (u16) 0x97 /* ACPI 2.0 */ 131#define AML_TO_DECSTRING_OP (u16) 0x97 /* ACPI 2.0 */
132#define AML_TO_HEXSTRING_OP (u16) 0x98 /* ACPI 2.0 */ 132#define AML_TO_HEXSTRING_OP (u16) 0x98 /* ACPI 2.0 */
133#define AML_TO_INTEGER_OP (u16) 0x99 /* ACPI 2.0 */ 133#define AML_TO_INTEGER_OP (u16) 0x99 /* ACPI 2.0 */
134#define AML_TO_STRING_OP (u16) 0x9c /* ACPI 2.0 */ 134#define AML_TO_STRING_OP (u16) 0x9c /* ACPI 2.0 */
135#define AML_COPY_OP (u16) 0x9d /* ACPI 2.0 */ 135#define AML_COPY_OP (u16) 0x9d /* ACPI 2.0 */
136#define AML_MID_OP (u16) 0x9e /* ACPI 2.0 */ 136#define AML_MID_OP (u16) 0x9e /* ACPI 2.0 */
137#define AML_CONTINUE_OP (u16) 0x9f /* ACPI 2.0 */ 137#define AML_CONTINUE_OP (u16) 0x9f /* ACPI 2.0 */
138#define AML_IF_OP (u16) 0xa0 138#define AML_IF_OP (u16) 0xa0
139#define AML_ELSE_OP (u16) 0xa1 139#define AML_ELSE_OP (u16) 0xa1
140#define AML_WHILE_OP (u16) 0xa2 140#define AML_WHILE_OP (u16) 0xa2
@@ -146,7 +146,7 @@
146 146
147/* prefixed opcodes */ 147/* prefixed opcodes */
148 148
149#define AML_EXTOP (u16) 0x005b /* prefix for 2-byte opcodes */ 149#define AML_EXTENDED_OPCODE (u16) 0x5b00 /* prefix for 2-byte opcodes */
150 150
151#define AML_MUTEX_OP (u16) 0x5b01 151#define AML_MUTEX_OP (u16) 0x5b01
152#define AML_EVENT_OP (u16) 0x5b02 152#define AML_EVENT_OP (u16) 0x5b02
@@ -154,7 +154,7 @@
154#define AML_SHIFT_LEFT_BIT_OP (u16) 0x5b11 154#define AML_SHIFT_LEFT_BIT_OP (u16) 0x5b11
155#define AML_COND_REF_OF_OP (u16) 0x5b12 155#define AML_COND_REF_OF_OP (u16) 0x5b12
156#define AML_CREATE_FIELD_OP (u16) 0x5b13 156#define AML_CREATE_FIELD_OP (u16) 0x5b13
157#define AML_LOAD_TABLE_OP (u16) 0x5b1f /* ACPI 2.0 */ 157#define AML_LOAD_TABLE_OP (u16) 0x5b1f /* ACPI 2.0 */
158#define AML_LOAD_OP (u16) 0x5b20 158#define AML_LOAD_OP (u16) 0x5b20
159#define AML_STALL_OP (u16) 0x5b21 159#define AML_STALL_OP (u16) 0x5b21
160#define AML_SLEEP_OP (u16) 0x5b22 160#define AML_SLEEP_OP (u16) 0x5b22
@@ -169,7 +169,7 @@
169#define AML_REVISION_OP (u16) 0x5b30 169#define AML_REVISION_OP (u16) 0x5b30
170#define AML_DEBUG_OP (u16) 0x5b31 170#define AML_DEBUG_OP (u16) 0x5b31
171#define AML_FATAL_OP (u16) 0x5b32 171#define AML_FATAL_OP (u16) 0x5b32
172#define AML_TIMER_OP (u16) 0x5b33 /* ACPI 3.0 */ 172#define AML_TIMER_OP (u16) 0x5b33 /* ACPI 3.0 */
173#define AML_REGION_OP (u16) 0x5b80 173#define AML_REGION_OP (u16) 0x5b80
174#define AML_FIELD_OP (u16) 0x5b81 174#define AML_FIELD_OP (u16) 0x5b81
175#define AML_DEVICE_OP (u16) 0x5b82 175#define AML_DEVICE_OP (u16) 0x5b82
@@ -178,8 +178,7 @@
178#define AML_THERMAL_ZONE_OP (u16) 0x5b85 178#define AML_THERMAL_ZONE_OP (u16) 0x5b85
179#define AML_INDEX_FIELD_OP (u16) 0x5b86 179#define AML_INDEX_FIELD_OP (u16) 0x5b86
180#define AML_BANK_FIELD_OP (u16) 0x5b87 180#define AML_BANK_FIELD_OP (u16) 0x5b87
181#define AML_DATA_REGION_OP (u16) 0x5b88 /* ACPI 2.0 */ 181#define AML_DATA_REGION_OP (u16) 0x5b88 /* ACPI 2.0 */
182
183 182
184/* Bogus opcodes (they are actually two separate opcodes) */ 183/* Bogus opcodes (they are actually two separate opcodes) */
185 184
@@ -187,7 +186,6 @@
187#define AML_LLESSEQUAL_OP (u16) 0x9294 186#define AML_LLESSEQUAL_OP (u16) 0x9294
188#define AML_LNOTEQUAL_OP (u16) 0x9293 187#define AML_LNOTEQUAL_OP (u16) 0x9293
189 188
190
191/* 189/*
192 * Internal opcodes 190 * Internal opcodes
193 * Use only "Unknown" AML opcodes, don't attempt to use 191 * Use only "Unknown" AML opcodes, don't attempt to use
@@ -203,7 +201,6 @@
203#define AML_INT_RETURN_VALUE_OP (u16) 0x0036 201#define AML_INT_RETURN_VALUE_OP (u16) 0x0036
204#define AML_INT_EVAL_SUBTREE_OP (u16) 0x0037 202#define AML_INT_EVAL_SUBTREE_OP (u16) 0x0037
205 203
206
207#define ARG_NONE 0x0 204#define ARG_NONE 0x0
208 205
209/* 206/*
@@ -245,7 +242,7 @@
245 242
246/* Single, simple types */ 243/* Single, simple types */
247 244
248#define ARGI_ANYTYPE 0x01 /* Don't care */ 245#define ARGI_ANYTYPE 0x01 /* Don't care */
249#define ARGI_PACKAGE 0x02 246#define ARGI_PACKAGE 0x02
250#define ARGI_EVENT 0x03 247#define ARGI_EVENT 0x03
251#define ARGI_MUTEX 0x04 248#define ARGI_MUTEX 0x04
@@ -256,8 +253,8 @@
256#define ARGI_INTEGER 0x06 253#define ARGI_INTEGER 0x06
257#define ARGI_STRING 0x07 254#define ARGI_STRING 0x07
258#define ARGI_BUFFER 0x08 255#define ARGI_BUFFER 0x08
259#define ARGI_BUFFER_OR_STRING 0x09 /* Used by MID op only */ 256#define ARGI_BUFFER_OR_STRING 0x09 /* Used by MID op only */
260#define ARGI_COMPUTEDATA 0x0A /* Buffer, String, or Integer */ 257#define ARGI_COMPUTEDATA 0x0A /* Buffer, String, or Integer */
261 258
262/* Reference objects */ 259/* Reference objects */
263 260
@@ -265,30 +262,28 @@
265#define ARGI_OBJECT_REF 0x0C 262#define ARGI_OBJECT_REF 0x0C
266#define ARGI_DEVICE_REF 0x0D 263#define ARGI_DEVICE_REF 0x0D
267#define ARGI_REFERENCE 0x0E 264#define ARGI_REFERENCE 0x0E
268#define ARGI_TARGETREF 0x0F /* Target, subject to implicit conversion */ 265#define ARGI_TARGETREF 0x0F /* Target, subject to implicit conversion */
269#define ARGI_FIXED_TARGET 0x10 /* Target, no implicit conversion */ 266#define ARGI_FIXED_TARGET 0x10 /* Target, no implicit conversion */
270#define ARGI_SIMPLE_TARGET 0x11 /* Name, Local, Arg -- no implicit conversion */ 267#define ARGI_SIMPLE_TARGET 0x11 /* Name, Local, Arg -- no implicit conversion */
271 268
272/* Multiple/complex types */ 269/* Multiple/complex types */
273 270
274#define ARGI_DATAOBJECT 0x12 /* Buffer, String, package or reference to a Node - Used only by size_of operator*/ 271#define ARGI_DATAOBJECT 0x12 /* Buffer, String, package or reference to a Node - Used only by size_of operator */
275#define ARGI_COMPLEXOBJ 0x13 /* Buffer, String, or package (Used by INDEX op only) */ 272#define ARGI_COMPLEXOBJ 0x13 /* Buffer, String, or package (Used by INDEX op only) */
276#define ARGI_REF_OR_STRING 0x14 /* Reference or String (Used by DEREFOF op only) */ 273#define ARGI_REF_OR_STRING 0x14 /* Reference or String (Used by DEREFOF op only) */
277#define ARGI_REGION_OR_FIELD 0x15 /* Used by LOAD op only */ 274#define ARGI_REGION_OR_FIELD 0x15 /* Used by LOAD op only */
278#define ARGI_DATAREFOBJ 0x16 275#define ARGI_DATAREFOBJ 0x16
279 276
280/* Note: types above can expand to 0x1F maximum */ 277/* Note: types above can expand to 0x1F maximum */
281 278
282#define ARGI_INVALID_OPCODE 0xFFFFFFFF 279#define ARGI_INVALID_OPCODE 0xFFFFFFFF
283 280
284
285/* 281/*
286 * hash offsets 282 * hash offsets
287 */ 283 */
288#define AML_EXTOP_HASH_OFFSET 22 284#define AML_EXTOP_HASH_OFFSET 22
289#define AML_LNOT_HASH_OFFSET 19 285#define AML_LNOT_HASH_OFFSET 19
290 286
291
292/* 287/*
293 * opcode groups and types 288 * opcode groups and types
294 */ 289 */
@@ -296,7 +291,6 @@
296#define OPGRP_FIELD 0x02 291#define OPGRP_FIELD 0x02
297#define OPGRP_BYTELIST 0x04 292#define OPGRP_BYTELIST 0x04
298 293
299
300/* 294/*
301 * Opcode information 295 * Opcode information
302 */ 296 */
@@ -322,31 +316,30 @@
322/* Convenient flag groupings */ 316/* Convenient flag groupings */
323 317
324#define AML_FLAGS_EXEC_0A_0T_1R AML_HAS_RETVAL 318#define AML_FLAGS_EXEC_0A_0T_1R AML_HAS_RETVAL
325#define AML_FLAGS_EXEC_1A_0T_0R AML_HAS_ARGS /* Monadic1 */ 319#define AML_FLAGS_EXEC_1A_0T_0R AML_HAS_ARGS /* Monadic1 */
326#define AML_FLAGS_EXEC_1A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL /* Monadic2 */ 320#define AML_FLAGS_EXEC_1A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL /* Monadic2 */
327#define AML_FLAGS_EXEC_1A_1T_0R AML_HAS_ARGS | AML_HAS_TARGET 321#define AML_FLAGS_EXEC_1A_1T_0R AML_HAS_ARGS | AML_HAS_TARGET
328#define AML_FLAGS_EXEC_1A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* monadic2_r */ 322#define AML_FLAGS_EXEC_1A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* monadic2_r */
329#define AML_FLAGS_EXEC_2A_0T_0R AML_HAS_ARGS /* Dyadic1 */ 323#define AML_FLAGS_EXEC_2A_0T_0R AML_HAS_ARGS /* Dyadic1 */
330#define AML_FLAGS_EXEC_2A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL /* Dyadic2 */ 324#define AML_FLAGS_EXEC_2A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL /* Dyadic2 */
331#define AML_FLAGS_EXEC_2A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* dyadic2_r */ 325#define AML_FLAGS_EXEC_2A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* dyadic2_r */
332#define AML_FLAGS_EXEC_2A_2T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL 326#define AML_FLAGS_EXEC_2A_2T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL
333#define AML_FLAGS_EXEC_3A_0T_0R AML_HAS_ARGS 327#define AML_FLAGS_EXEC_3A_0T_0R AML_HAS_ARGS
334#define AML_FLAGS_EXEC_3A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL 328#define AML_FLAGS_EXEC_3A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL
335#define AML_FLAGS_EXEC_6A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL 329#define AML_FLAGS_EXEC_6A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL
336 330
337
338/* 331/*
339 * The opcode Type is used in a dispatch table, do not change 332 * The opcode Type is used in a dispatch table, do not change
340 * without updating the table. 333 * without updating the table.
341 */ 334 */
342#define AML_TYPE_EXEC_0A_0T_1R 0x00 335#define AML_TYPE_EXEC_0A_0T_1R 0x00
343#define AML_TYPE_EXEC_1A_0T_0R 0x01 /* Monadic1 */ 336#define AML_TYPE_EXEC_1A_0T_0R 0x01 /* Monadic1 */
344#define AML_TYPE_EXEC_1A_0T_1R 0x02 /* Monadic2 */ 337#define AML_TYPE_EXEC_1A_0T_1R 0x02 /* Monadic2 */
345#define AML_TYPE_EXEC_1A_1T_0R 0x03 338#define AML_TYPE_EXEC_1A_1T_0R 0x03
346#define AML_TYPE_EXEC_1A_1T_1R 0x04 /* monadic2_r */ 339#define AML_TYPE_EXEC_1A_1T_1R 0x04 /* monadic2_r */
347#define AML_TYPE_EXEC_2A_0T_0R 0x05 /* Dyadic1 */ 340#define AML_TYPE_EXEC_2A_0T_0R 0x05 /* Dyadic1 */
348#define AML_TYPE_EXEC_2A_0T_1R 0x06 /* Dyadic2 */ 341#define AML_TYPE_EXEC_2A_0T_1R 0x06 /* Dyadic2 */
349#define AML_TYPE_EXEC_2A_1T_1R 0x07 /* dyadic2_r */ 342#define AML_TYPE_EXEC_2A_1T_1R 0x07 /* dyadic2_r */
350#define AML_TYPE_EXEC_2A_2T_1R 0x08 343#define AML_TYPE_EXEC_2A_2T_1R 0x08
351#define AML_TYPE_EXEC_3A_0T_0R 0x09 344#define AML_TYPE_EXEC_3A_0T_0R 0x09
352#define AML_TYPE_EXEC_3A_1T_1R 0x0A 345#define AML_TYPE_EXEC_3A_1T_1R 0x0A
@@ -399,40 +392,33 @@
399#define AML_CLASS_METHOD_CALL 0x09 392#define AML_CLASS_METHOD_CALL 0x09
400#define AML_CLASS_UNKNOWN 0x0A 393#define AML_CLASS_UNKNOWN 0x0A
401 394
402
403/* Predefined Operation Region space_iDs */ 395/* Predefined Operation Region space_iDs */
404 396
405typedef enum 397typedef enum {
406{ 398 REGION_MEMORY = 0,
407 REGION_MEMORY = 0,
408 REGION_IO, 399 REGION_IO,
409 REGION_PCI_CONFIG, 400 REGION_PCI_CONFIG,
410 REGION_EC, 401 REGION_EC,
411 REGION_SMBUS, 402 REGION_SMBUS,
412 REGION_CMOS, 403 REGION_CMOS,
413 REGION_PCI_BAR, 404 REGION_PCI_BAR,
414 REGION_DATA_TABLE, /* Internal use only */ 405 REGION_DATA_TABLE, /* Internal use only */
415 REGION_FIXED_HW = 0x7F 406 REGION_FIXED_HW = 0x7F
416
417} AML_REGION_TYPES; 407} AML_REGION_TYPES;
418 408
419
420/* Comparison operation codes for match_op operator */ 409/* Comparison operation codes for match_op operator */
421 410
422typedef enum 411typedef enum {
423{ 412 MATCH_MTR = 0,
424 MATCH_MTR = 0, 413 MATCH_MEQ = 1,
425 MATCH_MEQ = 1, 414 MATCH_MLE = 2,
426 MATCH_MLE = 2, 415 MATCH_MLT = 3,
427 MATCH_MLT = 3, 416 MATCH_MGE = 4,
428 MATCH_MGE = 4, 417 MATCH_MGT = 5
429 MATCH_MGT = 5
430
431} AML_MATCH_OPERATOR; 418} AML_MATCH_OPERATOR;
432 419
433#define MAX_MATCH_OPERATOR 5 420#define MAX_MATCH_OPERATOR 5
434 421
435
436/* 422/*
437 * field_flags 423 * field_flags
438 * 424 *
@@ -450,60 +436,47 @@ typedef enum
450#define AML_FIELD_LOCK_RULE_MASK 0x10 436#define AML_FIELD_LOCK_RULE_MASK 0x10
451#define AML_FIELD_UPDATE_RULE_MASK 0x60 437#define AML_FIELD_UPDATE_RULE_MASK 0x60
452 438
453
454/* 1) Field Access Types */ 439/* 1) Field Access Types */
455 440
456typedef enum 441typedef enum {
457{ 442 AML_FIELD_ACCESS_ANY = 0x00,
458 AML_FIELD_ACCESS_ANY = 0x00, 443 AML_FIELD_ACCESS_BYTE = 0x01,
459 AML_FIELD_ACCESS_BYTE = 0x01, 444 AML_FIELD_ACCESS_WORD = 0x02,
460 AML_FIELD_ACCESS_WORD = 0x02, 445 AML_FIELD_ACCESS_DWORD = 0x03,
461 AML_FIELD_ACCESS_DWORD = 0x03, 446 AML_FIELD_ACCESS_QWORD = 0x04, /* ACPI 2.0 */
462 AML_FIELD_ACCESS_QWORD = 0x04, /* ACPI 2.0 */ 447 AML_FIELD_ACCESS_BUFFER = 0x05 /* ACPI 2.0 */
463 AML_FIELD_ACCESS_BUFFER = 0x05 /* ACPI 2.0 */
464
465} AML_ACCESS_TYPE; 448} AML_ACCESS_TYPE;
466 449
467
468/* 2) Field Lock Rules */ 450/* 2) Field Lock Rules */
469 451
470typedef enum 452typedef enum {
471{ 453 AML_FIELD_LOCK_NEVER = 0x00,
472 AML_FIELD_LOCK_NEVER = 0x00, 454 AML_FIELD_LOCK_ALWAYS = 0x10
473 AML_FIELD_LOCK_ALWAYS = 0x10
474
475} AML_LOCK_RULE; 455} AML_LOCK_RULE;
476 456
477
478/* 3) Field Update Rules */ 457/* 3) Field Update Rules */
479 458
480typedef enum 459typedef enum {
481{ 460 AML_FIELD_UPDATE_PRESERVE = 0x00,
482 AML_FIELD_UPDATE_PRESERVE = 0x00, 461 AML_FIELD_UPDATE_WRITE_AS_ONES = 0x20,
483 AML_FIELD_UPDATE_WRITE_AS_ONES = 0x20,
484 AML_FIELD_UPDATE_WRITE_AS_ZEROS = 0x40 462 AML_FIELD_UPDATE_WRITE_AS_ZEROS = 0x40
485
486} AML_UPDATE_RULE; 463} AML_UPDATE_RULE;
487 464
488
489/* 465/*
490 * Field Access Attributes. 466 * Field Access Attributes.
491 * This byte is extracted from the AML via the 467 * This byte is extracted from the AML via the
492 * access_as keyword 468 * access_as keyword
493 */ 469 */
494typedef enum 470typedef enum {
495{ 471 AML_FIELD_ATTRIB_SMB_QUICK = 0x02,
496 AML_FIELD_ATTRIB_SMB_QUICK = 0x02, 472 AML_FIELD_ATTRIB_SMB_SEND_RCV = 0x04,
497 AML_FIELD_ATTRIB_SMB_SEND_RCV = 0x04, 473 AML_FIELD_ATTRIB_SMB_BYTE = 0x06,
498 AML_FIELD_ATTRIB_SMB_BYTE = 0x06, 474 AML_FIELD_ATTRIB_SMB_WORD = 0x08,
499 AML_FIELD_ATTRIB_SMB_WORD = 0x08, 475 AML_FIELD_ATTRIB_SMB_BLOCK = 0x0A,
500 AML_FIELD_ATTRIB_SMB_BLOCK = 0x0A, 476 AML_FIELD_ATTRIB_SMB_WORD_CALL = 0x0C,
501 AML_FIELD_ATTRIB_SMB_WORD_CALL = 0x0C,
502 AML_FIELD_ATTRIB_SMB_BLOCK_CALL = 0x0D 477 AML_FIELD_ATTRIB_SMB_BLOCK_CALL = 0x0D
503
504} AML_ACCESS_ATTRIBUTE; 478} AML_ACCESS_ATTRIBUTE;
505 479
506
507/* Bit fields in method_flags byte */ 480/* Bit fields in method_flags byte */
508 481
509#define AML_METHOD_ARG_COUNT 0x07 482#define AML_METHOD_ARG_COUNT 0x07
@@ -516,5 +489,4 @@ typedef enum
516#define AML_METHOD_RESERVED1 0x02 489#define AML_METHOD_RESERVED1 0x02
517#define AML_METHOD_RESERVED2 0x04 490#define AML_METHOD_RESERVED2 0x04
518 491
519 492#endif /* __AMLCODE_H__ */
520#endif /* __AMLCODE_H__ */
diff --git a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h
index b20ec303df07..051786e4b210 100644
--- a/include/acpi/amlresrc.h
+++ b/include/acpi/amlresrc.h
@@ -42,29 +42,27 @@
42 * POSSIBILITY OF SUCH DAMAGES. 42 * POSSIBILITY OF SUCH DAMAGES.
43 */ 43 */
44 44
45
46#ifndef __AMLRESRC_H 45#ifndef __AMLRESRC_H
47#define __AMLRESRC_H 46#define __AMLRESRC_H
48 47
49
50#define ASL_RESNAME_ADDRESS "_ADR" 48#define ASL_RESNAME_ADDRESS "_ADR"
51#define ASL_RESNAME_ALIGNMENT "_ALN" 49#define ASL_RESNAME_ALIGNMENT "_ALN"
52#define ASL_RESNAME_ADDRESSSPACE "_ASI" 50#define ASL_RESNAME_ADDRESSSPACE "_ASI"
53#define ASL_RESNAME_ACCESSSIZE "_ASZ" 51#define ASL_RESNAME_ACCESSSIZE "_ASZ"
54#define ASL_RESNAME_TYPESPECIFICATTRIBUTES "_ATT" 52#define ASL_RESNAME_TYPESPECIFICATTRIBUTES "_ATT"
55#define ASL_RESNAME_BASEADDRESS "_BAS" 53#define ASL_RESNAME_BASEADDRESS "_BAS"
56#define ASL_RESNAME_BUSMASTER "_BM_" /* Master(1), Slave(0) */ 54#define ASL_RESNAME_BUSMASTER "_BM_" /* Master(1), Slave(0) */
57#define ASL_RESNAME_DECODE "_DEC" 55#define ASL_RESNAME_DECODE "_DEC"
58#define ASL_RESNAME_DMA "_DMA" 56#define ASL_RESNAME_DMA "_DMA"
59#define ASL_RESNAME_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */ 57#define ASL_RESNAME_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */
60#define ASL_RESNAME_GRANULARITY "_GRA" 58#define ASL_RESNAME_GRANULARITY "_GRA"
61#define ASL_RESNAME_INTERRUPT "_INT" 59#define ASL_RESNAME_INTERRUPT "_INT"
62#define ASL_RESNAME_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */ 60#define ASL_RESNAME_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */
63#define ASL_RESNAME_INTERRUPTSHARE "_SHR" /* Shareable(1), no_share(0) */ 61#define ASL_RESNAME_INTERRUPTSHARE "_SHR" /* Shareable(1), no_share(0) */
64#define ASL_RESNAME_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */ 62#define ASL_RESNAME_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */
65#define ASL_RESNAME_LENGTH "_LEN" 63#define ASL_RESNAME_LENGTH "_LEN"
66#define ASL_RESNAME_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */ 64#define ASL_RESNAME_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */
67#define ASL_RESNAME_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */ 65#define ASL_RESNAME_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */
68#define ASL_RESNAME_MAXADDR "_MAX" 66#define ASL_RESNAME_MAXADDR "_MAX"
69#define ASL_RESNAME_MINADDR "_MIN" 67#define ASL_RESNAME_MINADDR "_MIN"
70#define ASL_RESNAME_MAXTYPE "_MAF" 68#define ASL_RESNAME_MAXTYPE "_MAF"
@@ -72,12 +70,11 @@
72#define ASL_RESNAME_REGISTERBITOFFSET "_RBO" 70#define ASL_RESNAME_REGISTERBITOFFSET "_RBO"
73#define ASL_RESNAME_REGISTERBITWIDTH "_RBW" 71#define ASL_RESNAME_REGISTERBITWIDTH "_RBW"
74#define ASL_RESNAME_RANGETYPE "_RNG" 72#define ASL_RESNAME_RANGETYPE "_RNG"
75#define ASL_RESNAME_READWRITETYPE "_RW_" /* read_only(0), Writeable (1) */ 73#define ASL_RESNAME_READWRITETYPE "_RW_" /* read_only(0), Writeable (1) */
76#define ASL_RESNAME_TRANSLATION "_TRA" 74#define ASL_RESNAME_TRANSLATION "_TRA"
77#define ASL_RESNAME_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ 75#define ASL_RESNAME_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */
78#define ASL_RESNAME_TYPE "_TTP" /* Translation(1), Static (0) */ 76#define ASL_RESNAME_TYPE "_TTP" /* Translation(1), Static (0) */
79#define ASL_RESNAME_XFERTYPE "_SIz" /* 8(0), 8_and16(1), 16(2) */ 77#define ASL_RESNAME_XFERTYPE "_SIz" /* 8(0), 8_and16(1), 16(2) */
80
81 78
82/* Default sizes for "small" resource descriptors */ 79/* Default sizes for "small" resource descriptors */
83 80
@@ -89,15 +86,12 @@
89#define ASL_RDESC_FIXED_IO_SIZE 0x03 86#define ASL_RDESC_FIXED_IO_SIZE 0x03
90#define ASL_RDESC_END_TAG_SIZE 0x01 87#define ASL_RDESC_END_TAG_SIZE 0x01
91 88
92 89struct asl_resource_node {
93struct asl_resource_node 90 u32 buffer_length;
94{ 91 void *buffer;
95 u32 buffer_length; 92 struct asl_resource_node *next;
96 void *buffer;
97 struct asl_resource_node *next;
98}; 93};
99 94
100
101/* 95/*
102 * Resource descriptors defined in the ACPI specification. 96 * Resource descriptors defined in the ACPI specification.
103 * 97 *
@@ -106,214 +100,175 @@ struct asl_resource_node
106 */ 100 */
107#pragma pack(1) 101#pragma pack(1)
108 102
109struct asl_irq_format_desc 103struct asl_irq_format_desc {
110{ 104 u8 descriptor_type;
111 u8 descriptor_type; 105 u16 irq_mask;
112 u16 irq_mask; 106 u8 flags;
113 u8 flags;
114}; 107};
115 108
116 109struct asl_irq_noflags_desc {
117struct asl_irq_noflags_desc 110 u8 descriptor_type;
118{ 111 u16 irq_mask;
119 u8 descriptor_type;
120 u16 irq_mask;
121}; 112};
122 113
123 114struct asl_dma_format_desc {
124struct asl_dma_format_desc 115 u8 descriptor_type;
125{ 116 u8 dma_channel_mask;
126 u8 descriptor_type; 117 u8 flags;
127 u8 dma_channel_mask;
128 u8 flags;
129}; 118};
130 119
131 120struct asl_start_dependent_desc {
132struct asl_start_dependent_desc 121 u8 descriptor_type;
133{ 122 u8 flags;
134 u8 descriptor_type;
135 u8 flags;
136}; 123};
137 124
138 125struct asl_start_dependent_noprio_desc {
139struct asl_start_dependent_noprio_desc 126 u8 descriptor_type;
140{
141 u8 descriptor_type;
142}; 127};
143 128
144 129struct asl_end_dependent_desc {
145struct asl_end_dependent_desc 130 u8 descriptor_type;
146{
147 u8 descriptor_type;
148}; 131};
149 132
150 133struct asl_io_port_desc {
151struct asl_io_port_desc 134 u8 descriptor_type;
152{ 135 u8 information;
153 u8 descriptor_type; 136 u16 address_min;
154 u8 information; 137 u16 address_max;
155 u16 address_min; 138 u8 alignment;
156 u16 address_max; 139 u8 length;
157 u8 alignment;
158 u8 length;
159}; 140};
160 141
161 142struct asl_fixed_io_port_desc {
162struct asl_fixed_io_port_desc 143 u8 descriptor_type;
163{ 144 u16 base_address;
164 u8 descriptor_type; 145 u8 length;
165 u16 base_address;
166 u8 length;
167}; 146};
168 147
169 148struct asl_small_vendor_desc {
170struct asl_small_vendor_desc 149 u8 descriptor_type;
171{ 150 u8 vendor_defined[7];
172 u8 descriptor_type;
173 u8 vendor_defined[7];
174}; 151};
175 152
176 153struct asl_end_tag_desc {
177struct asl_end_tag_desc 154 u8 descriptor_type;
178{ 155 u8 checksum;
179 u8 descriptor_type;
180 u8 checksum;
181}; 156};
182 157
183
184/* LARGE descriptors */ 158/* LARGE descriptors */
185 159
186struct asl_memory_24_desc 160struct asl_memory_24_desc {
187{ 161 u8 descriptor_type;
188 u8 descriptor_type; 162 u16 length;
189 u16 length; 163 u8 information;
190 u8 information; 164 u16 address_min;
191 u16 address_min; 165 u16 address_max;
192 u16 address_max; 166 u16 alignment;
193 u16 alignment; 167 u16 range_length;
194 u16 range_length;
195}; 168};
196 169
197 170struct asl_large_vendor_desc {
198struct asl_large_vendor_desc 171 u8 descriptor_type;
199{ 172 u16 length;
200 u8 descriptor_type; 173 u8 vendor_defined[1];
201 u16 length;
202 u8 vendor_defined[1];
203}; 174};
204 175
205 176struct asl_memory_32_desc {
206struct asl_memory_32_desc 177 u8 descriptor_type;
207{ 178 u16 length;
208 u8 descriptor_type; 179 u8 information;
209 u16 length; 180 u32 address_min;
210 u8 information; 181 u32 address_max;
211 u32 address_min; 182 u32 alignment;
212 u32 address_max; 183 u32 range_length;
213 u32 alignment;
214 u32 range_length;
215}; 184};
216 185
217 186struct asl_fixed_memory_32_desc {
218struct asl_fixed_memory_32_desc 187 u8 descriptor_type;
219{ 188 u16 length;
220 u8 descriptor_type; 189 u8 information;
221 u16 length; 190 u32 base_address;
222 u8 information; 191 u32 range_length;
223 u32 base_address;
224 u32 range_length;
225}; 192};
226 193
227 194struct asl_extended_address_desc {
228struct asl_extended_address_desc 195 u8 descriptor_type;
229{ 196 u16 length;
230 u8 descriptor_type; 197 u8 resource_type;
231 u16 length; 198 u8 flags;
232 u8 resource_type; 199 u8 specific_flags;
233 u8 flags; 200 u8 revision_iD;
234 u8 specific_flags; 201 u8 reserved;
235 u8 revision_iD; 202 u64 granularity;
236 u8 reserved; 203 u64 address_min;
237 u64 granularity; 204 u64 address_max;
238 u64 address_min; 205 u64 translation_offset;
239 u64 address_max; 206 u64 address_length;
240 u64 translation_offset; 207 u64 type_specific_attributes;
241 u64 address_length; 208 u8 optional_fields[2]; /* Used for length calculation only */
242 u64 type_specific_attributes;
243 u8 optional_fields[2]; /* Used for length calculation only */
244}; 209};
245 210
246#define ASL_EXTENDED_ADDRESS_DESC_REVISION 1 /* ACPI 3.0 */ 211#define ASL_EXTENDED_ADDRESS_DESC_REVISION 1 /* ACPI 3.0 */
247 212
248 213struct asl_qword_address_desc {
249struct asl_qword_address_desc 214 u8 descriptor_type;
250{ 215 u16 length;
251 u8 descriptor_type; 216 u8 resource_type;
252 u16 length; 217 u8 flags;
253 u8 resource_type; 218 u8 specific_flags;
254 u8 flags; 219 u64 granularity;
255 u8 specific_flags; 220 u64 address_min;
256 u64 granularity; 221 u64 address_max;
257 u64 address_min; 222 u64 translation_offset;
258 u64 address_max; 223 u64 address_length;
259 u64 translation_offset; 224 u8 optional_fields[2];
260 u64 address_length;
261 u8 optional_fields[2];
262}; 225};
263 226
264 227struct asl_dword_address_desc {
265struct asl_dword_address_desc 228 u8 descriptor_type;
266{ 229 u16 length;
267 u8 descriptor_type; 230 u8 resource_type;
268 u16 length; 231 u8 flags;
269 u8 resource_type; 232 u8 specific_flags;
270 u8 flags; 233 u32 granularity;
271 u8 specific_flags; 234 u32 address_min;
272 u32 granularity; 235 u32 address_max;
273 u32 address_min; 236 u32 translation_offset;
274 u32 address_max; 237 u32 address_length;
275 u32 translation_offset; 238 u8 optional_fields[2];
276 u32 address_length;
277 u8 optional_fields[2];
278}; 239};
279 240
280 241struct asl_word_address_desc {
281struct asl_word_address_desc 242 u8 descriptor_type;
282{ 243 u16 length;
283 u8 descriptor_type; 244 u8 resource_type;
284 u16 length; 245 u8 flags;
285 u8 resource_type; 246 u8 specific_flags;
286 u8 flags; 247 u16 granularity;
287 u8 specific_flags; 248 u16 address_min;
288 u16 granularity; 249 u16 address_max;
289 u16 address_min; 250 u16 translation_offset;
290 u16 address_max; 251 u16 address_length;
291 u16 translation_offset; 252 u8 optional_fields[2];
292 u16 address_length;
293 u8 optional_fields[2];
294}; 253};
295 254
296 255struct asl_extended_xrupt_desc {
297struct asl_extended_xrupt_desc 256 u8 descriptor_type;
298{ 257 u16 length;
299 u8 descriptor_type; 258 u8 flags;
300 u16 length; 259 u8 table_length;
301 u8 flags; 260 u32 interrupt_number[1];
302 u8 table_length;
303 u32 interrupt_number[1];
304 /* res_source_index, res_source optional fields follow */ 261 /* res_source_index, res_source optional fields follow */
305}; 262};
306 263
307 264struct asl_general_register_desc {
308struct asl_general_register_desc 265 u8 descriptor_type;
309{ 266 u16 length;
310 u8 descriptor_type; 267 u8 address_space_id;
311 u16 length; 268 u8 bit_width;
312 u8 address_space_id; 269 u8 bit_offset;
313 u8 bit_width; 270 u8 access_size; /* ACPI 3.0, was Reserved */
314 u8 bit_offset; 271 u64 address;
315 u8 access_size; /* ACPI 3.0, was Reserved */
316 u64 address;
317}; 272};
318 273
319/* restore default alignment */ 274/* restore default alignment */
@@ -322,32 +277,29 @@ struct asl_general_register_desc
322 277
323/* Union of all resource descriptors, so we can allocate the worst case */ 278/* Union of all resource descriptors, so we can allocate the worst case */
324 279
325union asl_resource_desc 280union asl_resource_desc {
326{ 281 struct asl_irq_format_desc irq;
327 struct asl_irq_format_desc irq; 282 struct asl_dma_format_desc dma;
328 struct asl_dma_format_desc dma; 283 struct asl_start_dependent_desc std;
329 struct asl_start_dependent_desc std; 284 struct asl_end_dependent_desc end;
330 struct asl_end_dependent_desc end; 285 struct asl_io_port_desc iop;
331 struct asl_io_port_desc iop; 286 struct asl_fixed_io_port_desc fio;
332 struct asl_fixed_io_port_desc fio; 287 struct asl_small_vendor_desc smv;
333 struct asl_small_vendor_desc smv; 288 struct asl_end_tag_desc et;
334 struct asl_end_tag_desc et; 289
335 290 struct asl_memory_24_desc M24;
336 struct asl_memory_24_desc M24; 291 struct asl_large_vendor_desc lgv;
337 struct asl_large_vendor_desc lgv; 292 struct asl_memory_32_desc M32;
338 struct asl_memory_32_desc M32; 293 struct asl_fixed_memory_32_desc F32;
339 struct asl_fixed_memory_32_desc F32; 294 struct asl_qword_address_desc qas;
340 struct asl_qword_address_desc qas; 295 struct asl_dword_address_desc das;
341 struct asl_dword_address_desc das; 296 struct asl_word_address_desc was;
342 struct asl_word_address_desc was; 297 struct asl_extended_address_desc eas;
343 struct asl_extended_address_desc eas; 298 struct asl_extended_xrupt_desc exx;
344 struct asl_extended_xrupt_desc exx; 299 struct asl_general_register_desc grg;
345 struct asl_general_register_desc grg; 300 u32 u32_item;
346 u32 u32_item; 301 u16 u16_item;
347 u16 u16_item; 302 u8 U8item;
348 u8 U8item;
349}; 303};
350 304
351
352#endif 305#endif
353
diff --git a/include/acpi/container.h b/include/acpi/container.h
index d716df04d9dc..a703f14e049e 100644
--- a/include/acpi/container.h
+++ b/include/acpi/container.h
@@ -9,5 +9,4 @@ struct acpi_container {
9 int state; 9 int state;
10}; 10};
11 11
12#endif /* __ACPI_CONTAINER_H */ 12#endif /* __ACPI_CONTAINER_H */
13
diff --git a/include/acpi/pdc_intel.h b/include/acpi/pdc_intel.h
index fd6730e4e567..91f4a12a99a1 100644
--- a/include/acpi/pdc_intel.h
+++ b/include/acpi/pdc_intel.h
@@ -14,7 +14,6 @@
14#define ACPI_PDC_SMP_T_SWCOORD (0x0080) 14#define ACPI_PDC_SMP_T_SWCOORD (0x0080)
15#define ACPI_PDC_C_C1_FFH (0x0100) 15#define ACPI_PDC_C_C1_FFH (0x0100)
16 16
17
18#define ACPI_PDC_EST_CAPABILITY_SMP (ACPI_PDC_SMP_C1PT | \ 17#define ACPI_PDC_EST_CAPABILITY_SMP (ACPI_PDC_SMP_C1PT | \
19 ACPI_PDC_C_C1_HALT) 18 ACPI_PDC_C_C1_HALT)
20 19
@@ -25,5 +24,4 @@
25 ACPI_PDC_SMP_C1PT | \ 24 ACPI_PDC_SMP_C1PT | \
26 ACPI_PDC_C_C1_HALT) 25 ACPI_PDC_C_C1_HALT)
27 26
28#endif /* __PDC_INTEL_H__ */ 27#endif /* __PDC_INTEL_H__ */
29
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index adf969efa510..16609c1ab2eb 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -44,40 +44,42 @@
44#ifndef __ACENV_H__ 44#ifndef __ACENV_H__
45#define __ACENV_H__ 45#define __ACENV_H__
46 46
47
48/* 47/*
49 * Configuration for ACPI tools and utilities 48 * Configuration for ACPI tools and utilities
50 */ 49 */
51 50
52#ifdef _ACPI_DUMP_APP 51#ifdef ACPI_LIBRARY
52#define ACPI_USE_LOCAL_CACHE
53#endif
54
55#ifdef ACPI_DUMP_APP
53#ifndef MSDOS 56#ifndef MSDOS
54#define ACPI_DEBUG_OUTPUT 57#define ACPI_DEBUG_OUTPUT
55#endif 58#endif
56#define ACPI_APPLICATION 59#define ACPI_APPLICATION
57#define ACPI_DISASSEMBLER 60#define ACPI_DISASSEMBLER
58#define ACPI_NO_METHOD_EXECUTION 61#define ACPI_NO_METHOD_EXECUTION
59#define ACPI_USE_SYSTEM_CLIBRARY
60#define ACPI_ENABLE_OBJECT_CACHE
61#endif 62#endif
62 63
63#ifdef _ACPI_EXEC_APP 64#ifdef ACPI_EXEC_APP
64#undef DEBUGGER_THREADING 65#undef DEBUGGER_THREADING
65#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED 66#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
66#define ACPI_DEBUG_OUTPUT 67#define ACPI_DEBUG_OUTPUT
67#define ACPI_APPLICATION 68#define ACPI_APPLICATION
68#define ACPI_DEBUGGER 69#define ACPI_DEBUGGER
69#define ACPI_DISASSEMBLER 70#define ACPI_DISASSEMBLER
70#define ACPI_USE_SYSTEM_CLIBRARY
71#define ACPI_ENABLE_OBJECT_CACHE
72#endif 71#endif
73 72
74#ifdef _ACPI_ASL_COMPILER 73#ifdef ACPI_ASL_COMPILER
75#define ACPI_DEBUG_OUTPUT 74#define ACPI_DEBUG_OUTPUT
76#define ACPI_APPLICATION 75#define ACPI_APPLICATION
77#define ACPI_DISASSEMBLER 76#define ACPI_DISASSEMBLER
78#define ACPI_CONSTANT_EVAL_ONLY 77#define ACPI_CONSTANT_EVAL_ONLY
78#endif
79
80#ifdef ACPI_APPLICATION
79#define ACPI_USE_SYSTEM_CLIBRARY 81#define ACPI_USE_SYSTEM_CLIBRARY
80#define ACPI_ENABLE_OBJECT_CACHE 82#define ACPI_USE_LOCAL_CACHE
81#endif 83#endif
82 84
83/* 85/*
@@ -131,7 +133,7 @@
131#elif defined(WIN64) 133#elif defined(WIN64)
132#include "acwin64.h" 134#include "acwin64.h"
133 135
134#elif defined(MSDOS) /* Must appear after WIN32 and WIN64 check */ 136#elif defined(MSDOS) /* Must appear after WIN32 and WIN64 check */
135#include "acdos16.h" 137#include "acdos16.h"
136 138
137#elif defined(__FreeBSD__) 139#elif defined(__FreeBSD__)
@@ -177,7 +179,6 @@
177 179
178/*! [End] no source code translation !*/ 180/*! [End] no source code translation !*/
179 181
180
181/* 182/*
182 * Debugger threading model 183 * Debugger threading model
183 * Use single threaded if the entire subsystem is contained in an application 184 * Use single threaded if the entire subsystem is contained in an application
@@ -196,8 +197,7 @@
196#else 197#else
197#define DEBUGGER_THREADING DEBUGGER_MULTI_THREADED 198#define DEBUGGER_THREADING DEBUGGER_MULTI_THREADED
198#endif 199#endif
199#endif /* !DEBUGGER_THREADING */ 200#endif /* !DEBUGGER_THREADING */
200
201 201
202/****************************************************************************** 202/******************************************************************************
203 * 203 *
@@ -219,7 +219,7 @@
219#include <string.h> 219#include <string.h>
220#include <ctype.h> 220#include <ctype.h>
221 221
222#endif /* ACPI_USE_STANDARD_HEADERS */ 222#endif /* ACPI_USE_STANDARD_HEADERS */
223 223
224/* 224/*
225 * We will be linking to the standard Clib functions 225 * We will be linking to the standard Clib functions
@@ -238,15 +238,15 @@
238#define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (acpi_size)(n)) 238#define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (acpi_size)(n))
239#define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (acpi_size)(n)) 239#define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (acpi_size)(n))
240 240
241#define ACPI_TOUPPER toupper 241#define ACPI_TOUPPER(i) toupper((int) (i))
242#define ACPI_TOLOWER tolower 242#define ACPI_TOLOWER(i) tolower((int) (i))
243#define ACPI_IS_XDIGIT isxdigit 243#define ACPI_IS_XDIGIT(i) isxdigit((int) (i))
244#define ACPI_IS_DIGIT isdigit 244#define ACPI_IS_DIGIT(i) isdigit((int) (i))
245#define ACPI_IS_SPACE isspace 245#define ACPI_IS_SPACE(i) isspace((int) (i))
246#define ACPI_IS_UPPER isupper 246#define ACPI_IS_UPPER(i) isupper((int) (i))
247#define ACPI_IS_PRINT isprint 247#define ACPI_IS_PRINT(i) isprint((int) (i))
248#define ACPI_IS_ALPHA isalpha 248#define ACPI_IS_ALPHA(i) isalpha((int) (i))
249#define ACPI_IS_ASCII isascii 249#define ACPI_IS_ASCII(i) isascii((int) (i))
250 250
251#else 251#else
252 252
@@ -257,18 +257,18 @@
257 *****************************************************************************/ 257 *****************************************************************************/
258 258
259 /* 259 /*
260 * Use local definitions of C library macros and functions 260 * Use local definitions of C library macros and functions
261 * NOTE: The function implementations may not be as efficient 261 * NOTE: The function implementations may not be as efficient
262 * as an inline or assembly code implementation provided by a 262 * as an inline or assembly code implementation provided by a
263 * native C library. 263 * native C library.
264 */ 264 */
265 265
266#ifndef va_arg 266#ifndef va_arg
267 267
268#ifndef _VALIST 268#ifndef _VALIST
269#define _VALIST 269#define _VALIST
270typedef char *va_list; 270typedef char *va_list;
271#endif /* _VALIST */ 271#endif /* _VALIST */
272 272
273/* 273/*
274 * Storage alignment properties 274 * Storage alignment properties
@@ -284,8 +284,7 @@ typedef char *va_list;
284#define va_end(ap) (void) 0 284#define va_end(ap) (void) 0
285#define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND)))) 285#define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND))))
286 286
287#endif /* va_arg */ 287#endif /* va_arg */
288
289 288
290#define ACPI_STRSTR(s1,s2) acpi_ut_strstr ((s1), (s2)) 289#define ACPI_STRSTR(s1,s2) acpi_ut_strstr ((s1), (s2))
291#define ACPI_STRCHR(s1,c) acpi_ut_strchr ((s1), (c)) 290#define ACPI_STRCHR(s1,c) acpi_ut_strchr ((s1), (c))
@@ -303,8 +302,7 @@ typedef char *va_list;
303#define ACPI_TOUPPER acpi_ut_to_upper 302#define ACPI_TOUPPER acpi_ut_to_upper
304#define ACPI_TOLOWER acpi_ut_to_lower 303#define ACPI_TOLOWER acpi_ut_to_lower
305 304
306#endif /* ACPI_USE_SYSTEM_CLIBRARY */ 305#endif /* ACPI_USE_SYSTEM_CLIBRARY */
307
308 306
309/****************************************************************************** 307/******************************************************************************
310 * 308 *
@@ -345,8 +343,7 @@ typedef char *va_list;
345#define ACPI_ACQUIRE_GLOBAL_LOCK(Glptr, acq) 343#define ACPI_ACQUIRE_GLOBAL_LOCK(Glptr, acq)
346#define ACPI_RELEASE_GLOBAL_LOCK(Glptr, acq) 344#define ACPI_RELEASE_GLOBAL_LOCK(Glptr, acq)
347 345
348#endif /* ACPI_ASM_MACROS */ 346#endif /* ACPI_ASM_MACROS */
349
350 347
351#ifdef ACPI_APPLICATION 348#ifdef ACPI_APPLICATION
352 349
@@ -356,11 +353,10 @@ typedef char *va_list;
356#define BREAKPOINT3 353#define BREAKPOINT3
357#endif 354#endif
358 355
359
360/****************************************************************************** 356/******************************************************************************
361 * 357 *
362 * Compiler-specific information is contained in the compiler-specific 358 * Compiler-specific information is contained in the compiler-specific
363 * headers. 359 * headers.
364 * 360 *
365 *****************************************************************************/ 361 *****************************************************************************/
366#endif /* __ACENV_H__ */ 362#endif /* __ACENV_H__ */
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h
index 91fda36b042b..4c0e0ba09ba0 100644
--- a/include/acpi/platform/acgcc.h
+++ b/include/acpi/platform/acgcc.h
@@ -44,16 +44,20 @@
44#ifndef __ACGCC_H__ 44#ifndef __ACGCC_H__
45#define __ACGCC_H__ 45#define __ACGCC_H__
46 46
47/* Function name is used for debug output. Non-ANSI, compiler-dependent */
48
49#define ACPI_GET_FUNCTION_NAME __FUNCTION__
50
47/* This macro is used to tag functions as "printf-like" because 51/* This macro is used to tag functions as "printf-like" because
48 * some compilers (like GCC) can catch printf format string problems. 52 * some compilers (like GCC) can catch printf format string problems.
49 */ 53 */
50#define ACPI_PRINTF_LIKE_FUNC __attribute__ ((__format__ (__printf__, 4, 5))) 54#define ACPI_PRINTF_LIKE_FUNC __attribute__ ((__format__ (__printf__, 6, 7)))
51 55
52/* Some compilers complain about unused variables. Sometimes we don't want to 56/* Some compilers complain about unused variables. Sometimes we don't want to
53 * use all the variables (most specifically for _THIS_MODULE). This allow us 57 * use all the variables (for example, _acpi_module_name). This allows us
54 * to to tell the compiler warning in a per-variable manner that a variable 58 * to to tell the compiler warning in a per-variable manner that a variable
55 * is unused. 59 * is unused.
56 */ 60 */
57#define ACPI_UNUSED_VAR __attribute__ ((unused)) 61#define ACPI_UNUSED_VAR __attribute__ ((unused))
58 62
59#endif /* __ACGCC_H__ */ 63#endif /* __ACGCC_H__ */
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index a3de0db85694..c93e6562f0e1 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -62,7 +62,16 @@
62 62
63#define ACPI_MACHINE_WIDTH BITS_PER_LONG 63#define ACPI_MACHINE_WIDTH BITS_PER_LONG
64 64
65#else /* !__KERNEL__ */ 65/* Type(s) for the OSL */
66
67#ifdef ACPI_USE_LOCAL_CACHE
68#define acpi_cache_t struct acpi_memory_list
69#else
70#include <linux/slab.h>
71#define acpi_cache_t kmem_cache_t
72#endif
73
74#else /* !__KERNEL__ */
66 75
67#include <stdarg.h> 76#include <stdarg.h>
68#include <string.h> 77#include <string.h>
@@ -83,10 +92,10 @@
83 92
84#define __cdecl 93#define __cdecl
85#define ACPI_FLUSH_CPU_CACHE() 94#define ACPI_FLUSH_CPU_CACHE()
86#endif /* __KERNEL__ */ 95#endif /* __KERNEL__ */
87 96
88/* Linux uses GCC */ 97/* Linux uses GCC */
89 98
90#include "acgcc.h" 99#include "acgcc.h"
91 100
92#endif /* __ACLINUX_H__ */ 101#endif /* __ACLINUX_H__ */
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index 50cfea4ff6ca..7a00d5089de9 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -23,45 +23,44 @@
23struct acpi_processor_cx; 23struct acpi_processor_cx;
24 24
25struct acpi_power_register { 25struct acpi_power_register {
26 u8 descriptor; 26 u8 descriptor;
27 u16 length; 27 u16 length;
28 u8 space_id; 28 u8 space_id;
29 u8 bit_width; 29 u8 bit_width;
30 u8 bit_offset; 30 u8 bit_offset;
31 u8 reserved; 31 u8 reserved;
32 u64 address; 32 u64 address;
33} __attribute__ ((packed)); 33} __attribute__ ((packed));
34 34
35
36struct acpi_processor_cx_policy { 35struct acpi_processor_cx_policy {
37 u32 count; 36 u32 count;
38 struct acpi_processor_cx *state; 37 struct acpi_processor_cx *state;
39 struct { 38 struct {
40 u32 time; 39 u32 time;
41 u32 ticks; 40 u32 ticks;
42 u32 count; 41 u32 count;
43 u32 bm; 42 u32 bm;
44 } threshold; 43 } threshold;
45}; 44};
46 45
47struct acpi_processor_cx { 46struct acpi_processor_cx {
48 u8 valid; 47 u8 valid;
49 u8 type; 48 u8 type;
50 u32 address; 49 u32 address;
51 u32 latency; 50 u32 latency;
52 u32 latency_ticks; 51 u32 latency_ticks;
53 u32 power; 52 u32 power;
54 u32 usage; 53 u32 usage;
55 struct acpi_processor_cx_policy promotion; 54 struct acpi_processor_cx_policy promotion;
56 struct acpi_processor_cx_policy demotion; 55 struct acpi_processor_cx_policy demotion;
57}; 56};
58 57
59struct acpi_processor_power { 58struct acpi_processor_power {
60 struct acpi_processor_cx *state; 59 struct acpi_processor_cx *state;
61 unsigned long bm_check_timestamp; 60 unsigned long bm_check_timestamp;
62 u32 default_state; 61 u32 default_state;
63 u32 bm_activity; 62 u32 bm_activity;
64 int count; 63 int count;
65 struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER]; 64 struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER];
66 65
67 /* the _PDC objects passed by the driver, if any */ 66 /* the _PDC objects passed by the driver, if any */
@@ -71,85 +70,82 @@ struct acpi_processor_power {
71/* Performance Management */ 70/* Performance Management */
72 71
73struct acpi_pct_register { 72struct acpi_pct_register {
74 u8 descriptor; 73 u8 descriptor;
75 u16 length; 74 u16 length;
76 u8 space_id; 75 u8 space_id;
77 u8 bit_width; 76 u8 bit_width;
78 u8 bit_offset; 77 u8 bit_offset;
79 u8 reserved; 78 u8 reserved;
80 u64 address; 79 u64 address;
81} __attribute__ ((packed)); 80} __attribute__ ((packed));
82 81
83struct acpi_processor_px { 82struct acpi_processor_px {
84 acpi_integer core_frequency; /* megahertz */ 83 acpi_integer core_frequency; /* megahertz */
85 acpi_integer power; /* milliWatts */ 84 acpi_integer power; /* milliWatts */
86 acpi_integer transition_latency; /* microseconds */ 85 acpi_integer transition_latency; /* microseconds */
87 acpi_integer bus_master_latency; /* microseconds */ 86 acpi_integer bus_master_latency; /* microseconds */
88 acpi_integer control; /* control value */ 87 acpi_integer control; /* control value */
89 acpi_integer status; /* success indicator */ 88 acpi_integer status; /* success indicator */
90}; 89};
91 90
92struct acpi_processor_performance { 91struct acpi_processor_performance {
93 unsigned int state; 92 unsigned int state;
94 unsigned int platform_limit; 93 unsigned int platform_limit;
95 struct acpi_pct_register control_register; 94 struct acpi_pct_register control_register;
96 struct acpi_pct_register status_register; 95 struct acpi_pct_register status_register;
97 unsigned int state_count; 96 unsigned int state_count;
98 struct acpi_processor_px *states; 97 struct acpi_processor_px *states;
99 98
100 /* the _PDC objects passed by the driver, if any */ 99 /* the _PDC objects passed by the driver, if any */
101 struct acpi_object_list *pdc; 100 struct acpi_object_list *pdc;
102}; 101};
103 102
104
105
106/* Throttling Control */ 103/* Throttling Control */
107 104
108struct acpi_processor_tx { 105struct acpi_processor_tx {
109 u16 power; 106 u16 power;
110 u16 performance; 107 u16 performance;
111}; 108};
112 109
113struct acpi_processor_throttling { 110struct acpi_processor_throttling {
114 int state; 111 int state;
115 u32 address; 112 u32 address;
116 u8 duty_offset; 113 u8 duty_offset;
117 u8 duty_width; 114 u8 duty_width;
118 int state_count; 115 int state_count;
119 struct acpi_processor_tx states[ACPI_PROCESSOR_MAX_THROTTLING]; 116 struct acpi_processor_tx states[ACPI_PROCESSOR_MAX_THROTTLING];
120}; 117};
121 118
122/* Limit Interface */ 119/* Limit Interface */
123 120
124struct acpi_processor_lx { 121struct acpi_processor_lx {
125 int px; /* performace state */ 122 int px; /* performace state */
126 int tx; /* throttle level */ 123 int tx; /* throttle level */
127}; 124};
128 125
129struct acpi_processor_limit { 126struct acpi_processor_limit {
130 struct acpi_processor_lx state; /* current limit */ 127 struct acpi_processor_lx state; /* current limit */
131 struct acpi_processor_lx thermal; /* thermal limit */ 128 struct acpi_processor_lx thermal; /* thermal limit */
132 struct acpi_processor_lx user; /* user limit */ 129 struct acpi_processor_lx user; /* user limit */
133}; 130};
134 131
135
136struct acpi_processor_flags { 132struct acpi_processor_flags {
137 u8 power:1; 133 u8 power:1;
138 u8 performance:1; 134 u8 performance:1;
139 u8 throttling:1; 135 u8 throttling:1;
140 u8 limit:1; 136 u8 limit:1;
141 u8 bm_control:1; 137 u8 bm_control:1;
142 u8 bm_check:1; 138 u8 bm_check:1;
143 u8 has_cst:1; 139 u8 has_cst:1;
144 u8 power_setup_done:1; 140 u8 power_setup_done:1;
145}; 141};
146 142
147struct acpi_processor { 143struct acpi_processor {
148 acpi_handle handle; 144 acpi_handle handle;
149 u32 acpi_id; 145 u32 acpi_id;
150 u32 id; 146 u32 id;
151 u32 pblk; 147 u32 pblk;
152 int performance_platform_limit; 148 int performance_platform_limit;
153 struct acpi_processor_flags flags; 149 struct acpi_processor_flags flags;
154 struct acpi_processor_power power; 150 struct acpi_processor_power power;
155 struct acpi_processor_performance *performance; 151 struct acpi_processor_performance *performance;
@@ -158,50 +154,49 @@ struct acpi_processor {
158}; 154};
159 155
160struct acpi_processor_errata { 156struct acpi_processor_errata {
161 u8 smp; 157 u8 smp;
162 struct { 158 struct {
163 u8 throttle:1; 159 u8 throttle:1;
164 u8 fdma:1; 160 u8 fdma:1;
165 u8 reserved:6; 161 u8 reserved:6;
166 u32 bmisx; 162 u32 bmisx;
167 } piix4; 163 } piix4;
168}; 164};
169 165
170extern int acpi_processor_register_performance ( 166extern int acpi_processor_register_performance(struct acpi_processor_performance
171 struct acpi_processor_performance * performance, 167 *performance, unsigned int cpu);
172 unsigned int cpu); 168extern void acpi_processor_unregister_performance(struct
173extern void acpi_processor_unregister_performance ( 169 acpi_processor_performance
174 struct acpi_processor_performance * performance, 170 *performance,
175 unsigned int cpu); 171 unsigned int cpu);
176 172
177/* note: this locks both the calling module and the processor module 173/* note: this locks both the calling module and the processor module
178 if a _PPC object exists, rmmod is disallowed then */ 174 if a _PPC object exists, rmmod is disallowed then */
179int acpi_processor_notify_smm(struct module *calling_module); 175int acpi_processor_notify_smm(struct module *calling_module);
180 176
181
182
183/* for communication between multiple parts of the processor kernel module */ 177/* for communication between multiple parts of the processor kernel module */
184extern struct acpi_processor *processors[NR_CPUS]; 178extern struct acpi_processor *processors[NR_CPUS];
185extern struct acpi_processor_errata errata; 179extern struct acpi_processor_errata errata;
186 180
187int acpi_processor_set_pdc(struct acpi_processor *pr, 181int acpi_processor_set_pdc(struct acpi_processor *pr,
188 struct acpi_object_list *pdc_in); 182 struct acpi_object_list *pdc_in);
189 183
190#ifdef ARCH_HAS_POWER_PDC_INIT 184#ifdef ARCH_HAS_POWER_PDC_INIT
191void acpi_processor_power_init_pdc(struct acpi_processor_power *pow, 185void acpi_processor_power_init_pdc(struct acpi_processor_power *pow,
192 unsigned int cpu); 186 unsigned int cpu);
193void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, 187void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags,
194 unsigned int cpu); 188 unsigned int cpu);
195#else 189#else
196static inline void acpi_processor_power_init_pdc( 190static inline void acpi_processor_power_init_pdc(struct acpi_processor_power
197 struct acpi_processor_power *pow, unsigned int cpu) 191 *pow, unsigned int cpu)
198{ 192{
199 pow->pdc = NULL; 193 pow->pdc = NULL;
200 return; 194 return;
201} 195}
202 196
203static inline void acpi_processor_power_init_bm_check( 197static inline void acpi_processor_power_init_bm_check(struct
204 struct acpi_processor_flags *flags, unsigned int cpu) 198 acpi_processor_flags
199 *flags, unsigned int cpu)
205{ 200{
206 flags->bm_check = 1; 201 flags->bm_check = 1;
207 return; 202 return;
@@ -215,51 +210,62 @@ void acpi_processor_ppc_init(void);
215void acpi_processor_ppc_exit(void); 210void acpi_processor_ppc_exit(void);
216int acpi_processor_ppc_has_changed(struct acpi_processor *pr); 211int acpi_processor_ppc_has_changed(struct acpi_processor *pr);
217#else 212#else
218static inline void acpi_processor_ppc_init(void) { return; } 213static inline void acpi_processor_ppc_init(void)
219static inline void acpi_processor_ppc_exit(void) { return; } 214{
220static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr) { 215 return;
216}
217static inline void acpi_processor_ppc_exit(void)
218{
219 return;
220}
221static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr)
222{
221 static unsigned int printout = 1; 223 static unsigned int printout = 1;
222 if (printout) { 224 if (printout) {
223 printk(KERN_WARNING "Warning: Processor Platform Limit event detected, but not handled.\n"); 225 printk(KERN_WARNING
224 printk(KERN_WARNING "Consider compiling CPUfreq support into your kernel.\n"); 226 "Warning: Processor Platform Limit event detected, but not handled.\n");
227 printk(KERN_WARNING
228 "Consider compiling CPUfreq support into your kernel.\n");
225 printout = 0; 229 printout = 0;
226 } 230 }
227 return 0; 231 return 0;
228} 232}
229#endif /* CONFIG_CPU_FREQ */ 233#endif /* CONFIG_CPU_FREQ */
230 234
231/* in processor_throttling.c */ 235/* in processor_throttling.c */
232int acpi_processor_get_throttling_info (struct acpi_processor *pr); 236int acpi_processor_get_throttling_info(struct acpi_processor *pr);
233int acpi_processor_set_throttling (struct acpi_processor *pr, int state); 237int acpi_processor_set_throttling(struct acpi_processor *pr, int state);
234ssize_t acpi_processor_write_throttling ( 238ssize_t acpi_processor_write_throttling(struct file *file,
235 struct file *file, 239 const char __user * buffer,
236 const char __user *buffer, 240 size_t count, loff_t * data);
237 size_t count,
238 loff_t *data);
239extern struct file_operations acpi_processor_throttling_fops; 241extern struct file_operations acpi_processor_throttling_fops;
240 242
241/* in processor_idle.c */ 243/* in processor_idle.c */
242int acpi_processor_power_init(struct acpi_processor *pr, struct acpi_device *device); 244int acpi_processor_power_init(struct acpi_processor *pr,
243int acpi_processor_cst_has_changed (struct acpi_processor *pr); 245 struct acpi_device *device);
244int acpi_processor_power_exit(struct acpi_processor *pr, struct acpi_device *device); 246int acpi_processor_cst_has_changed(struct acpi_processor *pr);
245 247int acpi_processor_power_exit(struct acpi_processor *pr,
248 struct acpi_device *device);
246 249
247/* in processor_thermal.c */ 250/* in processor_thermal.c */
248int acpi_processor_get_limit_info (struct acpi_processor *pr); 251int acpi_processor_get_limit_info(struct acpi_processor *pr);
249ssize_t acpi_processor_write_limit ( 252ssize_t acpi_processor_write_limit(struct file *file,
250 struct file *file, 253 const char __user * buffer,
251 const char __user *buffer, 254 size_t count, loff_t * data);
252 size_t count,
253 loff_t *data);
254extern struct file_operations acpi_processor_limit_fops; 255extern struct file_operations acpi_processor_limit_fops;
255 256
256#ifdef CONFIG_CPU_FREQ 257#ifdef CONFIG_CPU_FREQ
257void acpi_thermal_cpufreq_init(void); 258void acpi_thermal_cpufreq_init(void);
258void acpi_thermal_cpufreq_exit(void); 259void acpi_thermal_cpufreq_exit(void);
259#else 260#else
260static inline void acpi_thermal_cpufreq_init(void) { return; } 261static inline void acpi_thermal_cpufreq_init(void)
261static inline void acpi_thermal_cpufreq_exit(void) { return; } 262{
263 return;
264}
265static inline void acpi_thermal_cpufreq_exit(void)
266{
267 return;
268}
262#endif 269#endif
263 270
264
265#endif 271#endif
diff --git a/include/asm-alpha/auxvec.h b/include/asm-alpha/auxvec.h
new file mode 100644
index 000000000000..e96fe880e310
--- /dev/null
+++ b/include/asm-alpha/auxvec.h
@@ -0,0 +1,24 @@
1#ifndef __ASM_ALPHA_AUXVEC_H
2#define __ASM_ALPHA_AUXVEC_H
3
4/* Reserve these numbers for any future use of a VDSO. */
5#if 0
6#define AT_SYSINFO 32
7#define AT_SYSINFO_EHDR 33
8#endif
9
10/* More complete cache descriptions than AT_[DIU]CACHEBSIZE. If the
11 value is -1, then the cache doesn't exist. Otherwise:
12
13 bit 0-3: Cache set-associativity; 0 means fully associative.
14 bit 4-7: Log2 of cacheline size.
15 bit 8-31: Size of the entire cache >> 8.
16 bit 32-63: Reserved.
17*/
18
19#define AT_L1I_CACHESHAPE 34
20#define AT_L1D_CACHESHAPE 35
21#define AT_L2_CACHESHAPE 36
22#define AT_L3_CACHESHAPE 37
23
24#endif /* __ASM_ALPHA_AUXVEC_H */
diff --git a/include/asm-alpha/elf.h b/include/asm-alpha/elf.h
index e94a945a2314..6c2d78fba264 100644
--- a/include/asm-alpha/elf.h
+++ b/include/asm-alpha/elf.h
@@ -1,6 +1,8 @@
1#ifndef __ASM_ALPHA_ELF_H 1#ifndef __ASM_ALPHA_ELF_H
2#define __ASM_ALPHA_ELF_H 2#define __ASM_ALPHA_ELF_H
3 3
4#include <asm/auxvec.h>
5
4/* Special values for the st_other field in the symbol table. */ 6/* Special values for the st_other field in the symbol table. */
5 7
6#define STO_ALPHA_NOPV 0x80 8#define STO_ALPHA_NOPV 0x80
@@ -142,26 +144,6 @@ extern int dump_elf_task_fp(elf_fpreg_t *dest, struct task_struct *task);
142 : amask (AMASK_CIX) ? "ev6" : "ev67"); \ 144 : amask (AMASK_CIX) ? "ev6" : "ev67"); \
143}) 145})
144 146
145/* Reserve these numbers for any future use of a VDSO. */
146#if 0
147#define AT_SYSINFO 32
148#define AT_SYSINFO_EHDR 33
149#endif
150
151/* More complete cache descriptions than AT_[DIU]CACHEBSIZE. If the
152 value is -1, then the cache doesn't exist. Otherwise:
153
154 bit 0-3: Cache set-associativity; 0 means fully associative.
155 bit 4-7: Log2 of cacheline size.
156 bit 8-31: Size of the entire cache >> 8.
157 bit 32-63: Reserved.
158*/
159
160#define AT_L1I_CACHESHAPE 34
161#define AT_L1D_CACHESHAPE 35
162#define AT_L2_CACHESHAPE 36
163#define AT_L3_CACHESHAPE 37
164
165#ifdef __KERNEL__ 147#ifdef __KERNEL__
166 148
167#define SET_PERSONALITY(EX, IBCS2) \ 149#define SET_PERSONALITY(EX, IBCS2) \
diff --git a/include/asm-alpha/fcntl.h b/include/asm-alpha/fcntl.h
index 6b7d6c1649ce..87f2cf459e26 100644
--- a/include/asm-alpha/fcntl.h
+++ b/include/asm-alpha/fcntl.h
@@ -3,10 +3,6 @@
3 3
4/* open/fcntl - O_SYNC is only implemented on blocks devices and on files 4/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
5 located on an ext2 file system */ 5 located on an ext2 file system */
6#define O_ACCMODE 0003
7#define O_RDONLY 00
8#define O_WRONLY 01
9#define O_RDWR 02
10#define O_CREAT 01000 /* not fcntl */ 6#define O_CREAT 01000 /* not fcntl */
11#define O_TRUNC 02000 /* not fcntl */ 7#define O_TRUNC 02000 /* not fcntl */
12#define O_EXCL 04000 /* not fcntl */ 8#define O_EXCL 04000 /* not fcntl */
@@ -14,20 +10,13 @@
14 10
15#define O_NONBLOCK 00004 11#define O_NONBLOCK 00004
16#define O_APPEND 00010 12#define O_APPEND 00010
17#define O_NDELAY O_NONBLOCK
18#define O_SYNC 040000 13#define O_SYNC 040000
19#define FASYNC 020000 /* fcntl, for BSD compatibility */
20#define O_DIRECTORY 0100000 /* must be a directory */ 14#define O_DIRECTORY 0100000 /* must be a directory */
21#define O_NOFOLLOW 0200000 /* don't follow links */ 15#define O_NOFOLLOW 0200000 /* don't follow links */
22#define O_LARGEFILE 0400000 /* will be set by the kernel on every open */ 16#define O_LARGEFILE 0400000 /* will be set by the kernel on every open */
23#define O_DIRECT 02000000 /* direct disk access - should check with OSF/1 */ 17#define O_DIRECT 02000000 /* direct disk access - should check with OSF/1 */
24#define O_NOATIME 04000000 18#define O_NOATIME 04000000
25 19
26#define F_DUPFD 0 /* dup */
27#define F_GETFD 1 /* get close_on_exec */
28#define F_SETFD 2 /* set/clear close_on_exec */
29#define F_GETFL 3 /* get file->f_flags */
30#define F_SETFL 4 /* set file->f_flags */
31#define F_GETLK 7 20#define F_GETLK 7
32#define F_SETLK 8 21#define F_SETLK 8
33#define F_SETLKW 9 22#define F_SETLKW 9
@@ -37,9 +26,6 @@
37#define F_SETSIG 10 /* for sockets. */ 26#define F_SETSIG 10 /* for sockets. */
38#define F_GETSIG 11 /* for sockets. */ 27#define F_GETSIG 11 /* for sockets. */
39 28
40/* for F_[GET|SET]FL */
41#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
42
43/* for posix fcntl() and lockf() */ 29/* for posix fcntl() and lockf() */
44#define F_RDLCK 1 30#define F_RDLCK 1
45#define F_WRLCK 2 31#define F_WRLCK 2
@@ -51,25 +37,6 @@
51 37
52#define F_INPROGRESS 64 38#define F_INPROGRESS 64
53 39
54/* operations for bsd flock(), also used by the kernel implementation */ 40#include <asm-generic/fcntl.h>
55#define LOCK_SH 1 /* shared lock */
56#define LOCK_EX 2 /* exclusive lock */
57#define LOCK_NB 4 /* or'd with one of the above to prevent
58 blocking */
59#define LOCK_UN 8 /* remove lock */
60#define LOCK_MAND 32 /* This is a mandatory flock */
61#define LOCK_READ 64 /* ... Which allows concurrent read operations */
62#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
63#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
64
65struct flock {
66 short l_type;
67 short l_whence;
68 __kernel_off_t l_start;
69 __kernel_off_t l_len;
70 __kernel_pid_t l_pid;
71};
72
73#define F_LINUX_SPECIFIC_BASE 1024
74 41
75#endif 42#endif
diff --git a/include/asm-alpha/futex.h b/include/asm-alpha/futex.h
new file mode 100644
index 000000000000..2cac5ecd9d00
--- /dev/null
+++ b/include/asm-alpha/futex.h
@@ -0,0 +1,53 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/uaccess.h>
9
10static inline int
11futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
12{
13 int op = (encoded_op >> 28) & 7;
14 int cmp = (encoded_op >> 24) & 15;
15 int oparg = (encoded_op << 8) >> 20;
16 int cmparg = (encoded_op << 20) >> 20;
17 int oldval = 0, ret, tem;
18 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
19 oparg = 1 << oparg;
20
21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
22 return -EFAULT;
23
24 inc_preempt_count();
25
26 switch (op) {
27 case FUTEX_OP_SET:
28 case FUTEX_OP_ADD:
29 case FUTEX_OP_OR:
30 case FUTEX_OP_ANDN:
31 case FUTEX_OP_XOR:
32 default:
33 ret = -ENOSYS;
34 }
35
36 dec_preempt_count();
37
38 if (!ret) {
39 switch (cmp) {
40 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
41 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
42 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
43 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
44 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
45 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
46 default: ret = -ENOSYS;
47 }
48 }
49 return ret;
50}
51
52#endif
53#endif
diff --git a/include/asm-alpha/hdreg.h b/include/asm-alpha/hdreg.h
deleted file mode 100644
index 7f7fd1af0af3..000000000000
--- a/include/asm-alpha/hdreg.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/hdreg.h>
diff --git a/include/asm-alpha/page.h b/include/asm-alpha/page.h
index 0577daffc720..fa0b41b164a7 100644
--- a/include/asm-alpha/page.h
+++ b/include/asm-alpha/page.h
@@ -63,20 +63,6 @@ typedef unsigned long pgprot_t;
63 63
64#endif /* STRICT_MM_TYPECHECKS */ 64#endif /* STRICT_MM_TYPECHECKS */
65 65
66/* Pure 2^n version of get_order */
67extern __inline__ int get_order(unsigned long size)
68{
69 int order;
70
71 size = (size-1) >> (PAGE_SHIFT-1);
72 order = -1;
73 do {
74 size >>= 1;
75 order++;
76 } while (size);
77 return order;
78}
79
80#ifdef USE_48_BIT_KSEG 66#ifdef USE_48_BIT_KSEG
81#define PAGE_OFFSET 0xffff800000000000UL 67#define PAGE_OFFSET 0xffff800000000000UL
82#else 68#else
@@ -112,4 +98,6 @@ extern __inline__ int get_order(unsigned long size)
112 98
113#endif /* __KERNEL__ */ 99#endif /* __KERNEL__ */
114 100
101#include <asm-generic/page.h>
102
115#endif /* _ALPHA_PAGE_H */ 103#endif /* _ALPHA_PAGE_H */
diff --git a/include/asm-alpha/pci.h b/include/asm-alpha/pci.h
index f681e675b823..4e115f368d5f 100644
--- a/include/asm-alpha/pci.h
+++ b/include/asm-alpha/pci.h
@@ -254,6 +254,19 @@ extern void pcibios_resource_to_bus(struct pci_dev *, struct pci_bus_region *,
254extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, 254extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
255 struct pci_bus_region *region); 255 struct pci_bus_region *region);
256 256
257static inline struct resource *
258pcibios_select_root(struct pci_dev *pdev, struct resource *res)
259{
260 struct resource *root = NULL;
261
262 if (res->flags & IORESOURCE_IO)
263 root = &ioport_resource;
264 if (res->flags & IORESOURCE_MEM)
265 root = &iomem_resource;
266
267 return root;
268}
269
257#define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index 270#define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index
258 271
259static inline int pci_proc_domain(struct pci_bus *bus) 272static inline int pci_proc_domain(struct pci_bus *bus)
diff --git a/include/asm-alpha/types.h b/include/asm-alpha/types.h
index 43264d219246..f5716139ec89 100644
--- a/include/asm-alpha/types.h
+++ b/include/asm-alpha/types.h
@@ -56,8 +56,6 @@ typedef unsigned long u64;
56typedef u64 dma_addr_t; 56typedef u64 dma_addr_t;
57typedef u64 dma64_addr_t; 57typedef u64 dma64_addr_t;
58 58
59typedef unsigned short kmem_bufctl_t;
60
61#endif /* __ASSEMBLY__ */ 59#endif /* __ASSEMBLY__ */
62#endif /* __KERNEL__ */ 60#endif /* __KERNEL__ */
63#endif /* _ALPHA_TYPES_H */ 61#endif /* _ALPHA_TYPES_H */
diff --git a/include/asm-alpha/uaccess.h b/include/asm-alpha/uaccess.h
index 4c39ee750f38..22de3b434a22 100644
--- a/include/asm-alpha/uaccess.h
+++ b/include/asm-alpha/uaccess.h
@@ -48,12 +48,6 @@
48 __access_ok(((unsigned long)(addr)),(size),get_fs()); \ 48 __access_ok(((unsigned long)(addr)),(size),get_fs()); \
49}) 49})
50 50
51/* this function will go away soon - use access_ok() instead */
52extern inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size)
53{
54 return access_ok(type,addr,size) ? 0 : -EFAULT;
55}
56
57/* 51/*
58 * These are the main single-value transfer routines. They automatically 52 * These are the main single-value transfer routines. They automatically
59 * use the right size if we just have the right pointer type. 53 * use the right size if we just have the right pointer type.
diff --git a/include/asm-arm/arch-omap/board-h4.h b/include/asm-arm/arch-omap/board-h4.h
index 79138dcfb4ac..d64ee9211eed 100644
--- a/include/asm-arm/arch-omap/board-h4.h
+++ b/include/asm-arm/arch-omap/board-h4.h
@@ -30,6 +30,9 @@
30#define __ASM_ARCH_OMAP_H4_H 30#define __ASM_ARCH_OMAP_H4_H
31 31
32/* Placeholder for H4 specific defines */ 32/* Placeholder for H4 specific defines */
33/* GPMC CS1 */
34#define OMAP24XX_ETHR_START 0x08000300
35#define OMAP24XX_ETHR_GPIO_IRQ 92
33 36
34#endif /* __ASM_ARCH_OMAP_H4_H */ 37#endif /* __ASM_ARCH_OMAP_H4_H */
35 38
diff --git a/include/asm-arm/arch-omap/board-innovator.h b/include/asm-arm/arch-omap/board-innovator.h
index 0f1abaefe4de..79574e0ed13d 100644
--- a/include/asm-arm/arch-omap/board-innovator.h
+++ b/include/asm-arm/arch-omap/board-innovator.h
@@ -36,31 +36,6 @@
36#define OMAP1510P1_EMIFS_PRI_VALUE 0x00 36#define OMAP1510P1_EMIFS_PRI_VALUE 0x00
37#define OMAP1510P1_EMIFF_PRI_VALUE 0x00 37#define OMAP1510P1_EMIFF_PRI_VALUE 0x00
38 38
39/*
40 * These definitions define an area of FLASH set aside
41 * for the use of MTD/JFFS2. This is the area of flash
42 * that a JFFS2 filesystem will reside which is mounted
43 * at boot with the "root=/dev/mtdblock/0 rw"
44 * command line option. The flash address used here must
45 * fall within the legal range defined by rrload for storing
46 * the filesystem component. This address will be sufficiently
47 * deep into the overall flash range to avoid the other
48 * components also stored in flash such as the bootloader,
49 * the bootloader params, and the kernel.
50 * The SW2 settings for the map below are:
51 * 1 off, 2 off, 3 on, 4 off.
52 */
53
54/* Intel flash_0, partitioned as expected by rrload */
55#define OMAP_FLASH_0_BASE 0xD8000000
56#define OMAP_FLASH_0_START 0x00000000
57#define OMAP_FLASH_0_SIZE SZ_16M
58
59/* Intel flash_1, used for cramfs or other flash file systems */
60#define OMAP_FLASH_1_BASE 0xD9000000
61#define OMAP_FLASH_1_START 0x01000000
62#define OMAP_FLASH_1_SIZE SZ_16M
63
64#define NR_FPGA_IRQS 24 39#define NR_FPGA_IRQS 24
65#define NR_IRQS IH_BOARD_BASE + NR_FPGA_IRQS 40#define NR_IRQS IH_BOARD_BASE + NR_FPGA_IRQS
66 41
diff --git a/include/asm-arm/arch-omap/board-perseus2.h b/include/asm-arm/arch-omap/board-perseus2.h
index 0c224cc74fe4..691e52a52b43 100644
--- a/include/asm-arm/arch-omap/board-perseus2.h
+++ b/include/asm-arm/arch-omap/board-perseus2.h
@@ -36,23 +36,14 @@
36#define OMAP_SDRAM_DEVICE D256M_1X16_4B 36#define OMAP_SDRAM_DEVICE D256M_1X16_4B
37#endif 37#endif
38 38
39/*
40 * These definitions define an area of FLASH set aside
41 * for the use of MTD/JFFS2. This is the area of flash
42 * that a JFFS2 filesystem will reside which is mounted
43 * at boot with the "root=/dev/mtdblock/0 rw"
44 * command line option.
45 */
46
47/* Intel flash_0, partitioned as expected by rrload */
48#define OMAP_FLASH_0_BASE 0xD8000000 /* VA */
49#define OMAP_FLASH_0_START 0x00000000 /* PA */
50#define OMAP_FLASH_0_SIZE SZ_32M
51
52#define MAXIRQNUM IH_BOARD_BASE 39#define MAXIRQNUM IH_BOARD_BASE
53#define MAXFIQNUM MAXIRQNUM 40#define MAXFIQNUM MAXIRQNUM
54#define MAXSWINUM MAXIRQNUM 41#define MAXSWINUM MAXIRQNUM
55 42
56#define NR_IRQS (MAXIRQNUM + 1) 43#define NR_IRQS (MAXIRQNUM + 1)
57 44
45/* Samsung NAND flash at CS2B or CS3(NAND Boot) */
46#define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */
47#define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */
48
58#endif 49#endif
diff --git a/include/asm-arm/arch-omap/board-voiceblue.h b/include/asm-arm/arch-omap/board-voiceblue.h
index 33977b8956fb..ed6d346ee123 100644
--- a/include/asm-arm/arch-omap/board-voiceblue.h
+++ b/include/asm-arm/arch-omap/board-voiceblue.h
@@ -11,11 +11,6 @@
11#ifndef __ASM_ARCH_VOICEBLUE_H 11#ifndef __ASM_ARCH_VOICEBLUE_H
12#define __ASM_ARCH_VOICEBLUE_H 12#define __ASM_ARCH_VOICEBLUE_H
13 13
14#if (EXTERNAL_MAX_NR_PORTS < 4)
15#undef EXTERNAL_MAX_NR_PORTS
16#define EXTERNAL_MAX_NR_PORTS 4
17#endif
18
19extern void voiceblue_wdt_enable(void); 14extern void voiceblue_wdt_enable(void);
20extern void voiceblue_wdt_disable(void); 15extern void voiceblue_wdt_disable(void);
21extern void voiceblue_wdt_ping(void); 16extern void voiceblue_wdt_ping(void);
diff --git a/include/asm-arm/arch-omap/board.h b/include/asm-arm/arch-omap/board.h
index 95bd625480c1..a0040cd86639 100644
--- a/include/asm-arm/arch-omap/board.h
+++ b/include/asm-arm/arch-omap/board.h
@@ -30,10 +30,23 @@ struct omap_clock_config {
30 u8 system_clock_type; 30 u8 system_clock_type;
31}; 31};
32 32
33struct omap_mmc_conf {
34 unsigned enabled:1;
35 /* nomux means "standard" muxing is wrong on this board, and that
36 * board-specific code handled it before common init logic.
37 */
38 unsigned nomux:1;
39 /* switch pin can be for card detect (default) or card cover */
40 unsigned cover:1;
41 /* 4 wire signaling is optional, and is only used for SD/SDIO */
42 unsigned wire4:1;
43 s16 power_pin;
44 s16 switch_pin;
45 s16 wp_pin;
46};
47
33struct omap_mmc_config { 48struct omap_mmc_config {
34 u8 mmc_blocks; 49 struct omap_mmc_conf mmc[2];
35 s16 mmc1_power_pin, mmc2_power_pin;
36 s16 mmc1_switch_pin, mmc2_switch_pin;
37}; 50};
38 51
39struct omap_serial_console_config { 52struct omap_serial_console_config {
diff --git a/include/asm-arm/arch-omap/cpu.h b/include/asm-arm/arch-omap/cpu.h
index e8786713ee5c..1119e2b53e72 100644
--- a/include/asm-arm/arch-omap/cpu.h
+++ b/include/asm-arm/arch-omap/cpu.h
@@ -38,146 +38,179 @@ extern unsigned int system_rev;
38/* 38/*
39 * Test if multicore OMAP support is needed 39 * Test if multicore OMAP support is needed
40 */ 40 */
41#undef MULTI_OMAP 41#undef MULTI_OMAP1
42#undef MULTI_OMAP2
42#undef OMAP_NAME 43#undef OMAP_NAME
43 44
44#ifdef CONFIG_ARCH_OMAP730 45#ifdef CONFIG_ARCH_OMAP730
45# ifdef OMAP_NAME 46# ifdef OMAP_NAME
46# undef MULTI_OMAP 47# undef MULTI_OMAP1
47# define MULTI_OMAP 48# define MULTI_OMAP1
48# else 49# else
49# define OMAP_NAME omap730 50# define OMAP_NAME omap730
50# endif 51# endif
51#endif 52#endif
52#ifdef CONFIG_ARCH_OMAP1510 53#ifdef CONFIG_ARCH_OMAP1510
53# ifdef OMAP_NAME 54# ifdef OMAP_NAME
54# undef MULTI_OMAP 55# undef MULTI_OMAP1
55# define MULTI_OMAP 56# define MULTI_OMAP1
56# else 57# else
57# define OMAP_NAME omap1510 58# define OMAP_NAME omap1510
58# endif 59# endif
59#endif 60#endif
60#ifdef CONFIG_ARCH_OMAP16XX 61#ifdef CONFIG_ARCH_OMAP16XX
61# ifdef OMAP_NAME 62# ifdef OMAP_NAME
62# undef MULTI_OMAP 63# undef MULTI_OMAP1
63# define MULTI_OMAP 64# define MULTI_OMAP1
64# else 65# else
65# define OMAP_NAME omap1610 66# define OMAP_NAME omap16xx
66# endif 67# endif
67#endif 68#endif
68#ifdef CONFIG_ARCH_OMAP16XX 69#ifdef CONFIG_ARCH_OMAP24XX
69# ifdef OMAP_NAME 70# if (defined(OMAP_NAME) || defined(MULTI_OMAP1))
70# undef MULTI_OMAP 71# error "OMAP1 and OMAP2 can't be selected at the same time"
71# define MULTI_OMAP
72# else 72# else
73# define OMAP_NAME omap1710 73# undef MULTI_OMAP2
74# define OMAP_NAME omap24xx
74# endif 75# endif
75#endif 76#endif
76 77
77/* 78/*
78 * Generate various OMAP cpu specific macros, and cpu class 79 * Macros to group OMAP into cpu classes.
79 * specific macros 80 * These can be used in most places.
81 * cpu_is_omap7xx(): True for OMAP730
82 * cpu_is_omap15xx(): True for OMAP1510 and OMAP5910
83 * cpu_is_omap16xx(): True for OMAP1610, OMAP5912 and OMAP1710
84 * cpu_is_omap24xx(): True for OMAP2420
80 */ 85 */
81#define GET_OMAP_TYPE ((system_rev >> 24) & 0xff)
82#define GET_OMAP_CLASS (system_rev & 0xff) 86#define GET_OMAP_CLASS (system_rev & 0xff)
83 87
84#define IS_OMAP_TYPE(type, id) \
85static inline int is_omap ##type (void) \
86{ \
87 return (GET_OMAP_TYPE == (id)) ? 1 : 0; \
88}
89
90#define IS_OMAP_CLASS(class, id) \ 88#define IS_OMAP_CLASS(class, id) \
91static inline int is_omap ##class (void) \ 89static inline int is_omap ##class (void) \
92{ \ 90{ \
93 return (GET_OMAP_CLASS == (id)) ? 1 : 0; \ 91 return (GET_OMAP_CLASS == (id)) ? 1 : 0; \
94} 92}
95 93
96IS_OMAP_TYPE(730, 0x07)
97IS_OMAP_TYPE(1510, 0x15)
98IS_OMAP_TYPE(1610, 0x16)
99IS_OMAP_TYPE(5912, 0x16)
100IS_OMAP_TYPE(1710, 0x17)
101IS_OMAP_TYPE(2420, 0x24)
102
103IS_OMAP_CLASS(7xx, 0x07) 94IS_OMAP_CLASS(7xx, 0x07)
104IS_OMAP_CLASS(15xx, 0x15) 95IS_OMAP_CLASS(15xx, 0x15)
105IS_OMAP_CLASS(16xx, 0x16) 96IS_OMAP_CLASS(16xx, 0x16)
106IS_OMAP_CLASS(24xx, 0x24) 97IS_OMAP_CLASS(24xx, 0x24)
107 98
108/* 99#define cpu_is_omap7xx() 0
109 * Macros to group OMAP types into cpu classes. 100#define cpu_is_omap15xx() 0
110 * These can be used in most places. 101#define cpu_is_omap16xx() 0
111 * cpu_is_omap15xx(): True for 1510 and 5910 102#define cpu_is_omap24xx() 0
112 * cpu_is_omap16xx(): True for 1610, 5912 and 1710 103
113 */ 104#if defined(MULTI_OMAP1)
114#if defined(MULTI_OMAP) 105# if defined(CONFIG_ARCH_OMAP730)
115# define cpu_is_omap7xx() is_omap7xx() 106# undef cpu_is_omap7xx
116# define cpu_is_omap15xx() is_omap15xx() 107# define cpu_is_omap7xx() is_omap7xx()
117# if !(defined(CONFIG_ARCH_OMAP1510) || defined(CONFIG_ARCH_OMAP730)) 108# endif
118# define cpu_is_omap16xx() 1 109# if defined(CONFIG_ARCH_OMAP1510)
119# else 110# undef cpu_is_omap15xx
111# define cpu_is_omap15xx() is_omap15xx()
112# endif
113# if defined(CONFIG_ARCH_OMAP16XX)
114# undef cpu_is_omap16xx
120# define cpu_is_omap16xx() is_omap16xx() 115# define cpu_is_omap16xx() is_omap16xx()
121# endif 116# endif
122#else 117#else
123# if defined(CONFIG_ARCH_OMAP730) 118# if defined(CONFIG_ARCH_OMAP730)
119# undef cpu_is_omap7xx
124# define cpu_is_omap7xx() 1 120# define cpu_is_omap7xx() 1
125# else
126# define cpu_is_omap7xx() 0
127# endif 121# endif
128# if defined(CONFIG_ARCH_OMAP1510) 122# if defined(CONFIG_ARCH_OMAP1510)
123# undef cpu_is_omap15xx
129# define cpu_is_omap15xx() 1 124# define cpu_is_omap15xx() 1
130# else
131# define cpu_is_omap15xx() 0
132# endif 125# endif
133# if defined(CONFIG_ARCH_OMAP16XX) 126# if defined(CONFIG_ARCH_OMAP16XX)
127# undef cpu_is_omap16xx
134# define cpu_is_omap16xx() 1 128# define cpu_is_omap16xx() 1
135# else 129# endif
136# define cpu_is_omap16xx() 0 130# if defined(CONFIG_ARCH_OMAP24XX)
131# undef cpu_is_omap24xx
132# define cpu_is_omap24xx() 1
137# endif 133# endif
138#endif 134#endif
139 135
140#if defined(MULTI_OMAP) 136/*
141# define cpu_is_omap730() is_omap730() 137 * Macros to detect individual cpu types.
142# define cpu_is_omap1510() is_omap1510() 138 * These are only rarely needed.
143# define cpu_is_omap1610() is_omap1610() 139 * cpu_is_omap730(): True for OMAP730
144# define cpu_is_omap5912() is_omap5912() 140 * cpu_is_omap1510(): True for OMAP1510
145# define cpu_is_omap1710() is_omap1710() 141 * cpu_is_omap1610(): True for OMAP1610
142 * cpu_is_omap1611(): True for OMAP1611
143 * cpu_is_omap5912(): True for OMAP5912
144 * cpu_is_omap1621(): True for OMAP1621
145 * cpu_is_omap1710(): True for OMAP1710
146 * cpu_is_omap2420(): True for OMAP2420
147 */
148#define GET_OMAP_TYPE ((system_rev >> 16) & 0xffff)
149
150#define IS_OMAP_TYPE(type, id) \
151static inline int is_omap ##type (void) \
152{ \
153 return (GET_OMAP_TYPE == (id)) ? 1 : 0; \
154}
155
156IS_OMAP_TYPE(730, 0x0730)
157IS_OMAP_TYPE(1510, 0x1510)
158IS_OMAP_TYPE(1610, 0x1610)
159IS_OMAP_TYPE(1611, 0x1611)
160IS_OMAP_TYPE(5912, 0x1611)
161IS_OMAP_TYPE(1621, 0x1621)
162IS_OMAP_TYPE(1710, 0x1710)
163IS_OMAP_TYPE(2420, 0x2420)
164
165#define cpu_is_omap730() 0
166#define cpu_is_omap1510() 0
167#define cpu_is_omap1610() 0
168#define cpu_is_omap5912() 0
169#define cpu_is_omap1611() 0
170#define cpu_is_omap1621() 0
171#define cpu_is_omap1710() 0
172#define cpu_is_omap2420() 0
173
174#if defined(MULTI_OMAP1)
175# if defined(CONFIG_ARCH_OMAP730)
176# undef cpu_is_omap730
177# define cpu_is_omap730() is_omap730()
178# endif
179# if defined(CONFIG_ARCH_OMAP1510)
180# undef cpu_is_omap1510
181# define cpu_is_omap1510() is_omap1510()
182# endif
146#else 183#else
147# if defined(CONFIG_ARCH_OMAP730) 184# if defined(CONFIG_ARCH_OMAP730)
185# undef cpu_is_omap730
148# define cpu_is_omap730() 1 186# define cpu_is_omap730() 1
149# else
150# define cpu_is_omap730() 0
151# endif 187# endif
152# if defined(CONFIG_ARCH_OMAP1510) 188# if defined(CONFIG_ARCH_OMAP1510)
189# undef cpu_is_omap1510
153# define cpu_is_omap1510() 1 190# define cpu_is_omap1510() 1
154# else
155# define cpu_is_omap1510() 0
156# endif 191# endif
157# if defined(CONFIG_ARCH_OMAP16XX) 192#endif
158# define cpu_is_omap1610() 1 193
159# else 194/*
160# define cpu_is_omap1610() 0 195 * Whether we have MULTI_OMAP1 or not, we still need to distinguish
161# endif 196 * between 1611B/5912 and 1710.
162# if defined(CONFIG_ARCH_OMAP16XX) 197 */
163# define cpu_is_omap5912() 1 198#if defined(CONFIG_ARCH_OMAP16XX)
164# else 199# undef cpu_is_omap1610
165# define cpu_is_omap5912() 0 200# undef cpu_is_omap1611
166# endif 201# undef cpu_is_omap5912
167# if defined(CONFIG_ARCH_OMAP16XX) 202# undef cpu_is_omap1621
203# undef cpu_is_omap1710
168# define cpu_is_omap1610() is_omap1610() 204# define cpu_is_omap1610() is_omap1610()
205# define cpu_is_omap1611() is_omap1611()
169# define cpu_is_omap5912() is_omap5912() 206# define cpu_is_omap5912() is_omap5912()
207# define cpu_is_omap1621() is_omap1621()
170# define cpu_is_omap1710() is_omap1710() 208# define cpu_is_omap1710() is_omap1710()
171# else 209#endif
172# define cpu_is_omap1610() 0 210
173# define cpu_is_omap5912() 0 211#if defined(CONFIG_ARCH_OMAP2420)
174# define cpu_is_omap1710() 0 212# undef cpu_is_omap2420
175# endif
176# if defined(CONFIG_ARCH_OMAP2420)
177# define cpu_is_omap2420() 1 213# define cpu_is_omap2420() 1
178# else
179# define cpu_is_omap2420() 0
180# endif
181#endif 214#endif
182 215
183#endif 216#endif
diff --git a/include/asm-arm/arch-omap/debug-macro.S b/include/asm-arm/arch-omap/debug-macro.S
index 83bb458afd0b..ca4f577f9675 100644
--- a/include/asm-arm/arch-omap/debug-macro.S
+++ b/include/asm-arm/arch-omap/debug-macro.S
@@ -14,6 +14,7 @@
14 .macro addruart,rx 14 .macro addruart,rx
15 mrc p15, 0, \rx, c1, c0 15 mrc p15, 0, \rx, c1, c0
16 tst \rx, #1 @ MMU enabled? 16 tst \rx, #1 @ MMU enabled?
17#ifdef CONFIG_ARCH_OMAP1
17 moveq \rx, #0xff000000 @ physical base address 18 moveq \rx, #0xff000000 @ physical base address
18 movne \rx, #0xfe000000 @ virtual base 19 movne \rx, #0xfe000000 @ virtual base
19 orr \rx, \rx, #0x00fb0000 20 orr \rx, \rx, #0x00fb0000
@@ -23,6 +24,18 @@
23#if defined(CONFIG_OMAP_LL_DEBUG_UART2) || defined(CONFIG_OMAP_LL_DEBUG_UART3) 24#if defined(CONFIG_OMAP_LL_DEBUG_UART2) || defined(CONFIG_OMAP_LL_DEBUG_UART3)
24 orr \rx, \rx, #0x00000800 @ UART 2 & 3 25 orr \rx, \rx, #0x00000800 @ UART 2 & 3
25#endif 26#endif
27
28#elif CONFIG_ARCH_OMAP2
29 moveq \rx, #0x48000000 @ physical base address
30 movne \rx, #0xd8000000 @ virtual base
31 orr \rx, \rx, #0x0006a000
32#ifdef CONFIG_OMAP_LL_DEBUG_UART2
33 add \rx, \rx, #0x00002000 @ UART 2
34#endif
35#ifdef CONFIG_OMAP_LL_DEBUG_UART3
36 add \rx, \rx, #0x00004000 @ UART 3
37#endif
38#endif
26 .endm 39 .endm
27 40
28 .macro senduart,rd,rx 41 .macro senduart,rd,rx
diff --git a/include/asm-arm/arch-omap/dma.h b/include/asm-arm/arch-omap/dma.h
index ce114ce5af5d..04ebef5c6e95 100644
--- a/include/asm-arm/arch-omap/dma.h
+++ b/include/asm-arm/arch-omap/dma.h
@@ -240,6 +240,7 @@ extern void omap_dma_unlink_lch (int lch_head, int lch_queue);
240 240
241extern dma_addr_t omap_get_dma_src_pos(int lch); 241extern dma_addr_t omap_get_dma_src_pos(int lch);
242extern dma_addr_t omap_get_dma_dst_pos(int lch); 242extern dma_addr_t omap_get_dma_dst_pos(int lch);
243extern int omap_get_dma_src_addr_counter(int lch);
243extern void omap_clear_dma(int lch); 244extern void omap_clear_dma(int lch);
244extern int omap_dma_running(void); 245extern int omap_dma_running(void);
245 246
diff --git a/include/asm-arm/arch-omap/dmtimer.h b/include/asm-arm/arch-omap/dmtimer.h
new file mode 100644
index 000000000000..11772c792f3e
--- /dev/null
+++ b/include/asm-arm/arch-omap/dmtimer.h
@@ -0,0 +1,92 @@
1/*
2 * linux/include/asm-arm/arm/arch-omap/dmtimer.h
3 *
4 * OMAP Dual-Mode Timers
5 *
6 * Copyright (C) 2005 Nokia Corporation
7 * Author: Lauri Leukkunen <lauri.leukkunen@nokia.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27
28#ifndef __ASM_ARCH_TIMER_H
29#define __ASM_ARCH_TIMER_H
30
31#include <linux/list.h>
32
33#define OMAP_TIMER_SRC_ARMXOR 0x00
34#define OMAP_TIMER_SRC_32_KHZ 0x01
35#define OMAP_TIMER_SRC_EXT_CLK 0x02
36
37/* timer control reg bits */
38#define OMAP_TIMER_CTRL_CAPTMODE (1 << 13)
39#define OMAP_TIMER_CTRL_PT (1 << 12)
40#define OMAP_TIMER_CTRL_TRG_OVERFLOW (0x1 << 10)
41#define OMAP_TIMER_CTRL_TRG_OFANDMATCH (0x2 << 10)
42#define OMAP_TIMER_CTRL_TCM_LOWTOHIGH (0x1 << 8)
43#define OMAP_TIMER_CTRL_TCM_HIGHTOLOW (0x2 << 8)
44#define OMAP_TIMER_CTRL_TCM_BOTHEDGES (0x3 << 8)
45#define OMAP_TIMER_CTRL_SCPWM (1 << 7)
46#define OMAP_TIMER_CTRL_CE (1 << 6) /* compare enable */
47#define OMAP_TIMER_CTRL_PRE (1 << 5) /* prescaler enable */
48#define OMAP_TIMER_CTRL_PTV_SHIFT 2 /* how much to shift the prescaler value */
49#define OMAP_TIMER_CTRL_AR (1 << 1) /* auto-reload enable */
50#define OMAP_TIMER_CTRL_ST (1 << 0) /* start timer */
51
52/* timer interrupt enable bits */
53#define OMAP_TIMER_INT_CAPTURE (1 << 2)
54#define OMAP_TIMER_INT_OVERFLOW (1 << 1)
55#define OMAP_TIMER_INT_MATCH (1 << 0)
56
57
58struct omap_dm_timer {
59 struct list_head timer_list;
60
61 u32 base;
62 unsigned int irq;
63};
64
65u32 omap_dm_timer_read_reg(struct omap_dm_timer *timer, int reg);
66void omap_dm_timer_write_reg(struct omap_dm_timer *timer, int reg, u32 value);
67
68struct omap_dm_timer * omap_dm_timer_request(void);
69void omap_dm_timer_free(struct omap_dm_timer *timer);
70void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source);
71
72void omap_dm_timer_set_int_enable(struct omap_dm_timer *timer, unsigned int value);
73void omap_dm_timer_set_trigger(struct omap_dm_timer *timer, unsigned int value);
74void omap_dm_timer_enable_compare(struct omap_dm_timer *timer);
75void omap_dm_timer_enable_autoreload(struct omap_dm_timer *timer);
76
77void omap_dm_timer_trigger(struct omap_dm_timer *timer);
78void omap_dm_timer_start(struct omap_dm_timer *timer);
79void omap_dm_timer_stop(struct omap_dm_timer *timer);
80
81void omap_dm_timer_set_load(struct omap_dm_timer *timer, unsigned int load);
82void omap_dm_timer_set_match(struct omap_dm_timer *timer, unsigned int match);
83
84unsigned int omap_dm_timer_read_status(struct omap_dm_timer *timer);
85void omap_dm_timer_write_status(struct omap_dm_timer *timer, unsigned int value);
86
87unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer);
88void omap_dm_timer_reset_counter(struct omap_dm_timer *timer);
89
90int omap_dm_timers_active(void);
91
92#endif /* __ASM_ARCH_TIMER_H */
diff --git a/include/asm-arm/arch-omap/dsp.h b/include/asm-arm/arch-omap/dsp.h
new file mode 100644
index 000000000000..57bf4f39ca58
--- /dev/null
+++ b/include/asm-arm/arch-omap/dsp.h
@@ -0,0 +1,244 @@
1/*
2 * linux/include/asm-arm/arch-omap/dsp.h
3 *
4 * Header for OMAP DSP driver
5 *
6 * Copyright (C) 2002-2005 Nokia Corporation
7 *
8 * Written by Toshihiro Kobayashi <toshihiro.kobayashi@nokia.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 * 2005/06/01: DSP Gateway version 3.3
25 */
26
27#ifndef ASM_ARCH_DSP_H
28#define ASM_ARCH_DSP_H
29
30
31/*
32 * for /dev/dspctl/ctl
33 */
34#define OMAP_DSP_IOCTL_RESET 1
35#define OMAP_DSP_IOCTL_RUN 2
36#define OMAP_DSP_IOCTL_SETRSTVECT 3
37#define OMAP_DSP_IOCTL_CPU_IDLE 4
38#define OMAP_DSP_IOCTL_MPUI_WORDSWAP_ON 5
39#define OMAP_DSP_IOCTL_MPUI_WORDSWAP_OFF 6
40#define OMAP_DSP_IOCTL_MPUI_BYTESWAP_ON 7
41#define OMAP_DSP_IOCTL_MPUI_BYTESWAP_OFF 8
42#define OMAP_DSP_IOCTL_GBL_IDLE 9
43#define OMAP_DSP_IOCTL_DSPCFG 10
44#define OMAP_DSP_IOCTL_DSPUNCFG 11
45#define OMAP_DSP_IOCTL_TASKCNT 12
46#define OMAP_DSP_IOCTL_POLL 13
47#define OMAP_DSP_IOCTL_REGMEMR 40
48#define OMAP_DSP_IOCTL_REGMEMW 41
49#define OMAP_DSP_IOCTL_REGIOR 42
50#define OMAP_DSP_IOCTL_REGIOW 43
51#define OMAP_DSP_IOCTL_GETVAR 44
52#define OMAP_DSP_IOCTL_SETVAR 45
53#define OMAP_DSP_IOCTL_RUNLEVEL 50
54#define OMAP_DSP_IOCTL_SUSPEND 51
55#define OMAP_DSP_IOCTL_RESUME 52
56#define OMAP_DSP_IOCTL_FBEN 53
57#define OMAP_DSP_IOCTL_FBDIS 54
58#define OMAP_DSP_IOCTL_MBSEND 99
59
60/*
61 * for taskdev
62 * (ioctls below should be >= 0x10000)
63 */
64#define OMAP_DSP_TASK_IOCTL_BFLSH 0x10000
65#define OMAP_DSP_TASK_IOCTL_SETBSZ 0x10001
66#define OMAP_DSP_TASK_IOCTL_LOCK 0x10002
67#define OMAP_DSP_TASK_IOCTL_UNLOCK 0x10003
68#define OMAP_DSP_TASK_IOCTL_GETNAME 0x10004
69
70/*
71 * for /dev/dspctl/mem
72 */
73#define OMAP_DSP_MEM_IOCTL_EXMAP 1
74#define OMAP_DSP_MEM_IOCTL_EXUNMAP 2
75#define OMAP_DSP_MEM_IOCTL_EXMAP_FLUSH 3
76#define OMAP_DSP_MEM_IOCTL_FBEXPORT 5
77#define OMAP_DSP_MEM_IOCTL_MMUITACK 7
78#define OMAP_DSP_MEM_IOCTL_MMUINIT 9
79#define OMAP_DSP_MEM_IOCTL_KMEM_RESERVE 11
80#define OMAP_DSP_MEM_IOCTL_KMEM_RELEASE 12
81
82struct omap_dsp_mapinfo {
83 unsigned long dspadr;
84 unsigned long size;
85};
86
87/*
88 * for /dev/dspctl/twch
89 */
90#define OMAP_DSP_TWCH_IOCTL_MKDEV 1
91#define OMAP_DSP_TWCH_IOCTL_RMDEV 2
92#define OMAP_DSP_TWCH_IOCTL_TADD 11
93#define OMAP_DSP_TWCH_IOCTL_TDEL 12
94#define OMAP_DSP_TWCH_IOCTL_TKILL 13
95
96#define OMAP_DSP_DEVSTATE_NOTASK 0x00000001
97#define OMAP_DSP_DEVSTATE_ATTACHED 0x00000002
98#define OMAP_DSP_DEVSTATE_GARBAGE 0x00000004
99#define OMAP_DSP_DEVSTATE_INVALID 0x00000008
100#define OMAP_DSP_DEVSTATE_ADDREQ 0x00000100
101#define OMAP_DSP_DEVSTATE_DELREQ 0x00000200
102#define OMAP_DSP_DEVSTATE_ADDFAIL 0x00001000
103#define OMAP_DSP_DEVSTATE_ADDING 0x00010000
104#define OMAP_DSP_DEVSTATE_DELING 0x00020000
105#define OMAP_DSP_DEVSTATE_KILLING 0x00040000
106#define OMAP_DSP_DEVSTATE_STATE_MASK 0x7fffffff
107#define OMAP_DSP_DEVSTATE_STALE 0x80000000
108
109struct omap_dsp_taddinfo {
110 unsigned char minor;
111 unsigned long taskadr;
112};
113#define OMAP_DSP_TADD_ABORTADR 0xffffffff
114
115
116/*
117 * error cause definition (for error detection device)
118 */
119#define OMAP_DSP_ERRDT_WDT 0x00000001
120#define OMAP_DSP_ERRDT_MMU 0x00000002
121
122
123/*
124 * mailbox protocol definitions
125 */
126
127struct omap_dsp_mailbox_cmd {
128 unsigned short cmd;
129 unsigned short data;
130};
131
132struct omap_dsp_reginfo {
133 unsigned short adr;
134 unsigned short val;
135};
136
137struct omap_dsp_varinfo {
138 unsigned char varid;
139 unsigned short val[0];
140};
141
142#define OMAP_DSP_MBPROT_REVISION 0x0019
143
144#define OMAP_DSP_MBCMD_WDSND 0x10
145#define OMAP_DSP_MBCMD_WDREQ 0x11
146#define OMAP_DSP_MBCMD_BKSND 0x20
147#define OMAP_DSP_MBCMD_BKREQ 0x21
148#define OMAP_DSP_MBCMD_BKYLD 0x23
149#define OMAP_DSP_MBCMD_BKSNDP 0x24
150#define OMAP_DSP_MBCMD_BKREQP 0x25
151#define OMAP_DSP_MBCMD_TCTL 0x30
152#define OMAP_DSP_MBCMD_TCTLDATA 0x31
153#define OMAP_DSP_MBCMD_POLL 0x32
154#define OMAP_DSP_MBCMD_WDT 0x50 /* v3.3: obsolete */
155#define OMAP_DSP_MBCMD_RUNLEVEL 0x51
156#define OMAP_DSP_MBCMD_PM 0x52
157#define OMAP_DSP_MBCMD_SUSPEND 0x53
158#define OMAP_DSP_MBCMD_KFUNC 0x54
159#define OMAP_DSP_MBCMD_TCFG 0x60
160#define OMAP_DSP_MBCMD_TADD 0x62
161#define OMAP_DSP_MBCMD_TDEL 0x63
162#define OMAP_DSP_MBCMD_TSTOP 0x65
163#define OMAP_DSP_MBCMD_DSPCFG 0x70
164#define OMAP_DSP_MBCMD_REGRW 0x72
165#define OMAP_DSP_MBCMD_GETVAR 0x74
166#define OMAP_DSP_MBCMD_SETVAR 0x75
167#define OMAP_DSP_MBCMD_ERR 0x78
168#define OMAP_DSP_MBCMD_DBG 0x79
169
170#define OMAP_DSP_MBCMD_TCTL_TINIT 0x0000
171#define OMAP_DSP_MBCMD_TCTL_TEN 0x0001
172#define OMAP_DSP_MBCMD_TCTL_TDIS 0x0002
173#define OMAP_DSP_MBCMD_TCTL_TCLR 0x0003
174#define OMAP_DSP_MBCMD_TCTL_TCLR_FORCE 0x0004
175
176#define OMAP_DSP_MBCMD_RUNLEVEL_USER 0x01
177#define OMAP_DSP_MBCMD_RUNLEVEL_SUPER 0x0e
178#define OMAP_DSP_MBCMD_RUNLEVEL_RECOVERY 0x10
179
180#define OMAP_DSP_MBCMD_PM_DISABLE 0x00
181#define OMAP_DSP_MBCMD_PM_ENABLE 0x01
182
183#define OMAP_DSP_MBCMD_KFUNC_FBCTL 0x00
184
185#define OMAP_DSP_MBCMD_FBCTL_ENABLE 0x0002
186#define OMAP_DSP_MBCMD_FBCTL_DISABLE 0x0003
187
188#define OMAP_DSP_MBCMD_TDEL_SAFE 0x0000
189#define OMAP_DSP_MBCMD_TDEL_KILL 0x0001
190
191#define OMAP_DSP_MBCMD_DSPCFG_REQ 0x00
192#define OMAP_DSP_MBCMD_DSPCFG_SYSADRH 0x28
193#define OMAP_DSP_MBCMD_DSPCFG_SYSADRL 0x29
194#define OMAP_DSP_MBCMD_DSPCFG_PROTREV 0x70
195#define OMAP_DSP_MBCMD_DSPCFG_ABORT 0x78
196#define OMAP_DSP_MBCMD_DSPCFG_LAST 0x80
197
198#define OMAP_DSP_MBCMD_REGRW_MEMR 0x00
199#define OMAP_DSP_MBCMD_REGRW_MEMW 0x01
200#define OMAP_DSP_MBCMD_REGRW_IOR 0x02
201#define OMAP_DSP_MBCMD_REGRW_IOW 0x03
202#define OMAP_DSP_MBCMD_REGRW_DATA 0x04
203
204#define OMAP_DSP_MBCMD_VARID_ICRMASK 0x00
205#define OMAP_DSP_MBCMD_VARID_LOADINFO 0x01
206
207#define OMAP_DSP_TTYP_ARCV 0x0001
208#define OMAP_DSP_TTYP_ASND 0x0002
209#define OMAP_DSP_TTYP_BKMD 0x0004
210#define OMAP_DSP_TTYP_BKDM 0x0008
211#define OMAP_DSP_TTYP_PVMD 0x0010
212#define OMAP_DSP_TTYP_PVDM 0x0020
213
214#define OMAP_DSP_EID_BADTID 0x10
215#define OMAP_DSP_EID_BADTCN 0x11
216#define OMAP_DSP_EID_BADBID 0x20
217#define OMAP_DSP_EID_BADCNT 0x21
218#define OMAP_DSP_EID_NOTLOCKED 0x22
219#define OMAP_DSP_EID_STVBUF 0x23
220#define OMAP_DSP_EID_BADADR 0x24
221#define OMAP_DSP_EID_BADTCTL 0x30
222#define OMAP_DSP_EID_BADPARAM 0x50
223#define OMAP_DSP_EID_FATAL 0x58
224#define OMAP_DSP_EID_NOMEM 0xc0
225#define OMAP_DSP_EID_NORES 0xc1
226#define OMAP_DSP_EID_IPBFULL 0xc2
227#define OMAP_DSP_EID_WDT 0xd0
228#define OMAP_DSP_EID_TASKNOTRDY 0xe0
229#define OMAP_DSP_EID_TASKBSY 0xe1
230#define OMAP_DSP_EID_TASKERR 0xef
231#define OMAP_DSP_EID_BADCFGTYP 0xf0
232#define OMAP_DSP_EID_DEBUG 0xf8
233#define OMAP_DSP_EID_BADSEQ 0xfe
234#define OMAP_DSP_EID_BADCMD 0xff
235
236#define OMAP_DSP_TNM_LEN 16
237
238#define OMAP_DSP_TID_FREE 0xff
239#define OMAP_DSP_TID_ANON 0xfe
240
241#define OMAP_DSP_BID_NULL 0xffff
242#define OMAP_DSP_BID_PVT 0xfffe
243
244#endif /* ASM_ARCH_DSP_H */
diff --git a/include/asm-arm/arch-omap/dsp_common.h b/include/asm-arm/arch-omap/dsp_common.h
new file mode 100644
index 000000000000..4fcce6944056
--- /dev/null
+++ b/include/asm-arm/arch-omap/dsp_common.h
@@ -0,0 +1,37 @@
1/*
2 * linux/include/asm-arm/arch-omap/dsp_common.h
3 *
4 * Header for OMAP DSP subsystem control
5 *
6 * Copyright (C) 2004,2005 Nokia Corporation
7 *
8 * Written by Toshihiro Kobayashi <toshihiro.kobayashi@nokia.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 * 2005/06/03: DSP Gateway version 3.3
25 */
26
27#ifndef ASM_ARCH_DSP_COMMON_H
28#define ASM_ARCH_DSP_COMMON_H
29
30void omap_dsp_pm_suspend(void);
31void omap_dsp_pm_resume(void);
32void omap_dsp_request_mpui(void);
33void omap_dsp_release_mpui(void);
34int omap_dsp_request_mem(void);
35int omap_dsp_release_mem(void);
36
37#endif /* ASM_ARCH_DSP_COMMON_H */
diff --git a/include/asm-arm/arch-omap/entry-macro.S b/include/asm-arm/arch-omap/entry-macro.S
index 57b126889b98..0d29b9c56a95 100644
--- a/include/asm-arm/arch-omap/entry-macro.S
+++ b/include/asm-arm/arch-omap/entry-macro.S
@@ -8,6 +8,8 @@
8 * warranty of any kind, whether express or implied. 8 * warranty of any kind, whether express or implied.
9 */ 9 */
10 10
11#if defined(CONFIG_ARCH_OMAP1)
12
11 .macro disable_fiq 13 .macro disable_fiq
12 .endm 14 .endm
13 15
@@ -30,3 +32,29 @@
301510: 321510:
31 .endm 33 .endm
32 34
35#elif defined(CONFIG_ARCH_OMAP24XX)
36
37#include <asm/arch/omap24xx.h>
38
39 .macro disable_fiq
40 .endm
41
42 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
43 ldr \base, =VA_IC_BASE
44 ldr \irqnr, [\base, #0x98] /* IRQ pending reg 1 */
45 cmp \irqnr, #0x0
46 bne 2222f
47 ldr \irqnr, [\base, #0xb8] /* IRQ pending reg 2 */
48 cmp \irqnr, #0x0
49 bne 2222f
50 ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
51 cmp \irqnr, #0x0
522222:
53 ldrne \irqnr, [\base, #IRQ_SIR_IRQ]
54
55 .endm
56
57 .macro irq_prio_table
58 .endm
59
60#endif
diff --git a/include/asm-arm/arch-omap/gpio.h b/include/asm-arm/arch-omap/gpio.h
index fad2fc93ee70..74cb2b93b700 100644
--- a/include/asm-arm/arch-omap/gpio.h
+++ b/include/asm-arm/arch-omap/gpio.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * OMAP GPIO handling defines and functions 4 * OMAP GPIO handling defines and functions
5 * 5 *
6 * Copyright (C) 2003 Nokia Corporation 6 * Copyright (C) 2003-2005 Nokia Corporation
7 * 7 *
8 * Written by Juha Yrjölä <juha.yrjola@nokia.com> 8 * Written by Juha Yrjölä <juha.yrjola@nokia.com>
9 * 9 *
@@ -30,7 +30,23 @@
30#include <asm/arch/irqs.h> 30#include <asm/arch/irqs.h>
31#include <asm/io.h> 31#include <asm/io.h>
32 32
33#define OMAP_MPUIO_BASE 0xfffb5000 33#define OMAP_MPUIO_BASE (void __iomem *)0xfffb5000
34
35#ifdef CONFIG_ARCH_OMAP730
36#define OMAP_MPUIO_INPUT_LATCH 0x00
37#define OMAP_MPUIO_OUTPUT 0x02
38#define OMAP_MPUIO_IO_CNTL 0x04
39#define OMAP_MPUIO_KBR_LATCH 0x08
40#define OMAP_MPUIO_KBC 0x0a
41#define OMAP_MPUIO_GPIO_EVENT_MODE 0x0c
42#define OMAP_MPUIO_GPIO_INT_EDGE 0x0e
43#define OMAP_MPUIO_KBD_INT 0x10
44#define OMAP_MPUIO_GPIO_INT 0x12
45#define OMAP_MPUIO_KBD_MASKIT 0x14
46#define OMAP_MPUIO_GPIO_MASKIT 0x16
47#define OMAP_MPUIO_GPIO_DEBOUNCING 0x18
48#define OMAP_MPUIO_LATCH 0x1a
49#else
34#define OMAP_MPUIO_INPUT_LATCH 0x00 50#define OMAP_MPUIO_INPUT_LATCH 0x00
35#define OMAP_MPUIO_OUTPUT 0x04 51#define OMAP_MPUIO_OUTPUT 0x04
36#define OMAP_MPUIO_IO_CNTL 0x08 52#define OMAP_MPUIO_IO_CNTL 0x08
@@ -44,6 +60,7 @@
44#define OMAP_MPUIO_GPIO_MASKIT 0x2c 60#define OMAP_MPUIO_GPIO_MASKIT 0x2c
45#define OMAP_MPUIO_GPIO_DEBOUNCING 0x30 61#define OMAP_MPUIO_GPIO_DEBOUNCING 0x30
46#define OMAP_MPUIO_LATCH 0x34 62#define OMAP_MPUIO_LATCH 0x34
63#endif
47 64
48#define OMAP_MPUIO(nr) (OMAP_MAX_GPIO_LINES + (nr)) 65#define OMAP_MPUIO(nr) (OMAP_MAX_GPIO_LINES + (nr))
49#define OMAP_GPIO_IS_MPUIO(nr) ((nr) >= OMAP_MAX_GPIO_LINES) 66#define OMAP_GPIO_IS_MPUIO(nr) ((nr) >= OMAP_MAX_GPIO_LINES)
@@ -52,18 +69,11 @@
52 IH_MPUIO_BASE + ((nr) & 0x0f) : \ 69 IH_MPUIO_BASE + ((nr) & 0x0f) : \
53 IH_GPIO_BASE + ((nr) & 0x3f)) 70 IH_GPIO_BASE + ((nr) & 0x3f))
54 71
55/* For EDGECTRL */
56#define OMAP_GPIO_NO_EDGE 0x00
57#define OMAP_GPIO_FALLING_EDGE 0x01
58#define OMAP_GPIO_RISING_EDGE 0x02
59#define OMAP_GPIO_BOTH_EDGES 0x03
60
61extern int omap_gpio_init(void); /* Call from board init only */ 72extern int omap_gpio_init(void); /* Call from board init only */
62extern int omap_request_gpio(int gpio); 73extern int omap_request_gpio(int gpio);
63extern void omap_free_gpio(int gpio); 74extern void omap_free_gpio(int gpio);
64extern void omap_set_gpio_direction(int gpio, int is_input); 75extern void omap_set_gpio_direction(int gpio, int is_input);
65extern void omap_set_gpio_dataout(int gpio, int enable); 76extern void omap_set_gpio_dataout(int gpio, int enable);
66extern int omap_get_gpio_datain(int gpio); 77extern int omap_get_gpio_datain(int gpio);
67extern void omap_set_gpio_edge_ctrl(int gpio, int edge);
68 78
69#endif 79#endif
diff --git a/include/asm-arm/arch-omap/hardware.h b/include/asm-arm/arch-omap/hardware.h
index 48258c7f6541..60201e1dd6ad 100644
--- a/include/asm-arm/arch-omap/hardware.h
+++ b/include/asm-arm/arch-omap/hardware.h
@@ -43,6 +43,7 @@
43#include <asm/arch/cpu.h> 43#include <asm/arch/cpu.h>
44#endif 44#endif
45#include <asm/arch/io.h> 45#include <asm/arch/io.h>
46#include <asm/arch/serial.h>
46 47
47/* 48/*
48 * --------------------------------------------------------------------------- 49 * ---------------------------------------------------------------------------
@@ -89,11 +90,12 @@
89/* DPLL control registers */ 90/* DPLL control registers */
90#define DPLL_CTL (0xfffecf00) 91#define DPLL_CTL (0xfffecf00)
91 92
92/* DSP clock control */ 93/* DSP clock control. Must use __raw_readw() and __raw_writew() with these */
93#define DSP_CONFIG_REG_BASE (0xe1008000) 94#define DSP_CONFIG_REG_BASE (0xe1008000)
94#define DSP_CKCTL (DSP_CONFIG_REG_BASE + 0x0) 95#define DSP_CKCTL (DSP_CONFIG_REG_BASE + 0x0)
95#define DSP_IDLECT1 (DSP_CONFIG_REG_BASE + 0x4) 96#define DSP_IDLECT1 (DSP_CONFIG_REG_BASE + 0x4)
96#define DSP_IDLECT2 (DSP_CONFIG_REG_BASE + 0x8) 97#define DSP_IDLECT2 (DSP_CONFIG_REG_BASE + 0x8)
98#define DSP_RSTCT2 (DSP_CONFIG_REG_BASE + 0x14)
97 99
98/* 100/*
99 * --------------------------------------------------------------------------- 101 * ---------------------------------------------------------------------------
@@ -142,6 +144,13 @@
142 * Interrupts 144 * Interrupts
143 * --------------------------------------------------------------------------- 145 * ---------------------------------------------------------------------------
144 */ 146 */
147#ifdef CONFIG_ARCH_OMAP1
148
149/*
150 * XXX: These probably want to be moved to arch/arm/mach-omap/omap1/irq.c
151 * or something similar.. -- PFM.
152 */
153
145#define OMAP_IH1_BASE 0xfffecb00 154#define OMAP_IH1_BASE 0xfffecb00
146#define OMAP_IH2_BASE 0xfffe0000 155#define OMAP_IH2_BASE 0xfffe0000
147 156
@@ -170,6 +179,8 @@
170#define IRQ_ILR0_REG_OFFSET 0x1c 179#define IRQ_ILR0_REG_OFFSET 0x1c
171#define IRQ_GMR_REG_OFFSET 0xa0 180#define IRQ_GMR_REG_OFFSET 0xa0
172 181
182#endif
183
173/* 184/*
174 * ---------------------------------------------------------------------------- 185 * ----------------------------------------------------------------------------
175 * System control registers 186 * System control registers
@@ -260,32 +271,17 @@
260 271
261/* 272/*
262 * --------------------------------------------------------------------------- 273 * ---------------------------------------------------------------------------
263 * Serial ports
264 * ---------------------------------------------------------------------------
265 */
266#define OMAP_UART1_BASE (unsigned char *)0xfffb0000
267#define OMAP_UART2_BASE (unsigned char *)0xfffb0800
268#define OMAP_UART3_BASE (unsigned char *)0xfffb9800
269#define OMAP_MAX_NR_PORTS 3
270#define OMAP1510_BASE_BAUD (12000000/16)
271#define OMAP16XX_BASE_BAUD (48000000/16)
272
273#define is_omap_port(p) ({int __ret = 0; \
274 if (p == IO_ADDRESS(OMAP_UART1_BASE) || \
275 p == IO_ADDRESS(OMAP_UART2_BASE) || \
276 p == IO_ADDRESS(OMAP_UART3_BASE)) \
277 __ret = 1; \
278 __ret; \
279 })
280
281/*
282 * ---------------------------------------------------------------------------
283 * Processor specific defines 274 * Processor specific defines
284 * --------------------------------------------------------------------------- 275 * ---------------------------------------------------------------------------
285 */ 276 */
286 277
287#include "omap730.h" 278#include "omap730.h"
288#include "omap1510.h" 279#include "omap1510.h"
280
281#ifdef CONFIG_ARCH_OMAP24XX
282#include "omap24xx.h"
283#endif
284
289#include "omap16xx.h" 285#include "omap16xx.h"
290 286
291/* 287/*
@@ -312,7 +308,6 @@
312 308
313#ifdef CONFIG_MACH_OMAP_H4 309#ifdef CONFIG_MACH_OMAP_H4
314#include "board-h4.h" 310#include "board-h4.h"
315#error "Support for H4 board not yet implemented."
316#endif 311#endif
317 312
318#ifdef CONFIG_MACH_OMAP_OSK 313#ifdef CONFIG_MACH_OMAP_OSK
diff --git a/include/asm-arm/arch-omap/io.h b/include/asm-arm/arch-omap/io.h
index 1c8c9fcc766e..11fbf629bf75 100644
--- a/include/asm-arm/arch-omap/io.h
+++ b/include/asm-arm/arch-omap/io.h
@@ -49,16 +49,24 @@
49 * I/O mapping 49 * I/O mapping
50 * ---------------------------------------------------------------------------- 50 * ----------------------------------------------------------------------------
51 */ 51 */
52#define IO_PHYS 0xFFFB0000
53#define IO_OFFSET 0x01000000 /* Virtual IO = 0xfefb0000 */
54#define IO_VIRT (IO_PHYS - IO_OFFSET)
55#define IO_SIZE 0x40000
56#define IO_ADDRESS(x) ((x) - IO_OFFSET)
57 52
58#define PCIO_BASE 0 53#if defined(CONFIG_ARCH_OMAP1)
54#define IO_PHYS 0xFFFB0000
55#define IO_OFFSET -0x01000000 /* Virtual IO = 0xfefb0000 */
56#define IO_SIZE 0x40000
59 57
60#define io_p2v(x) ((x) - IO_OFFSET) 58#elif defined(CONFIG_ARCH_OMAP2)
61#define io_v2p(x) ((x) + IO_OFFSET) 59#define IO_PHYS 0x48000000 /* L4 peripherals; other stuff has to be mapped *
60 * manually. */
61#define IO_OFFSET 0x90000000 /* Virtual IO = 0xd8000000 */
62#define IO_SIZE 0x08000000
63#endif
64
65#define IO_VIRT (IO_PHYS + IO_OFFSET)
66#define IO_ADDRESS(x) ((x) + IO_OFFSET)
67#define PCIO_BASE 0
68#define io_p2v(x) ((x) + IO_OFFSET)
69#define io_v2p(x) ((x) - IO_OFFSET)
62 70
63#ifndef __ASSEMBLER__ 71#ifndef __ASSEMBLER__
64 72
@@ -96,6 +104,8 @@ typedef struct { volatile u32 offset[4096]; } __regbase32;
96 ->offset[((vaddr)&4095)>>2] 104 ->offset[((vaddr)&4095)>>2]
97#define __REG32(paddr) __REGV32(io_p2v(paddr)) 105#define __REG32(paddr) __REGV32(io_p2v(paddr))
98 106
107extern void omap_map_common_io(void);
108
99#else 109#else
100 110
101#define __REG8(paddr) io_p2v(paddr) 111#define __REG8(paddr) io_p2v(paddr)
diff --git a/include/asm-arm/arch-omap/irqs.h b/include/asm-arm/arch-omap/irqs.h
index 0d05a7c957d1..74e108ccac16 100644
--- a/include/asm-arm/arch-omap/irqs.h
+++ b/include/asm-arm/arch-omap/irqs.h
@@ -135,7 +135,6 @@
135/* 135/*
136 * OMAP-1510 specific IRQ numbers for interrupt handler 2 136 * OMAP-1510 specific IRQ numbers for interrupt handler 2
137 */ 137 */
138#define INT_1510_OS_32kHz_TIMER (22 + IH2_BASE)
139#define INT_1510_COM_SPI_RO (31 + IH2_BASE) 138#define INT_1510_COM_SPI_RO (31 + IH2_BASE)
140 139
141/* 140/*
@@ -232,6 +231,11 @@
232#define INT_730_DMA_CH15 (62 + IH2_BASE) 231#define INT_730_DMA_CH15 (62 + IH2_BASE)
233#define INT_730_NAND (63 + IH2_BASE) 232#define INT_730_NAND (63 + IH2_BASE)
234 233
234#define INT_24XX_GPIO_BANK1 29
235#define INT_24XX_GPIO_BANK2 30
236#define INT_24XX_GPIO_BANK3 31
237#define INT_24XX_GPIO_BANK4 32
238
235/* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730) and 239/* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730) and
236 * 16 MPUIO lines */ 240 * 16 MPUIO lines */
237#define OMAP_MAX_GPIO_LINES 192 241#define OMAP_MAX_GPIO_LINES 192
diff --git a/include/asm-arm/arch-omap/memory.h b/include/asm-arm/arch-omap/memory.h
index f6b57dd846a3..84f81e315a25 100644
--- a/include/asm-arm/arch-omap/memory.h
+++ b/include/asm-arm/arch-omap/memory.h
@@ -36,12 +36,11 @@
36/* 36/*
37 * Physical DRAM offset. 37 * Physical DRAM offset.
38 */ 38 */
39#if defined(CONFIG_ARCH_OMAP1)
39#define PHYS_OFFSET (0x10000000UL) 40#define PHYS_OFFSET (0x10000000UL)
40 41#elif defined(CONFIG_ARCH_OMAP2)
41/* 42#define PHYS_OFFSET (0x80000000UL)
42 * OMAP-1510 Local Bus address offset 43#endif
43 */
44#define OMAP1510_LB_OFFSET (0x30000000UL)
45 44
46/* 45/*
47 * Conversion between SDRAM and fake PCI bus, used by USB 46 * Conversion between SDRAM and fake PCI bus, used by USB
@@ -64,6 +63,11 @@
64 */ 63 */
65#ifdef CONFIG_ARCH_OMAP1510 64#ifdef CONFIG_ARCH_OMAP1510
66 65
66/*
67 * OMAP-1510 Local Bus address offset
68 */
69#define OMAP1510_LB_OFFSET (0x30000000UL)
70
67#define virt_to_lbus(x) ((x) - PAGE_OFFSET + OMAP1510_LB_OFFSET) 71#define virt_to_lbus(x) ((x) - PAGE_OFFSET + OMAP1510_LB_OFFSET)
68#define lbus_to_virt(x) ((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET) 72#define lbus_to_virt(x) ((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET)
69#define is_lbus_device(dev) (cpu_is_omap1510() && dev && (strncmp(dev->bus_id, "ohci", 4) == 0)) 73#define is_lbus_device(dev) (cpu_is_omap1510() && dev && (strncmp(dev->bus_id, "ohci", 4) == 0))
diff --git a/include/asm-arm/arch-omap/mtd-xip.h b/include/asm-arm/arch-omap/mtd-xip.h
new file mode 100644
index 000000000000..a73a28571fee
--- /dev/null
+++ b/include/asm-arm/arch-omap/mtd-xip.h
@@ -0,0 +1,61 @@
1/*
2 * MTD primitives for XIP support. Architecture specific functions.
3 *
4 * Do not include this file directly. It's included from linux/mtd/xip.h
5 *
6 * Author: Vladimir Barinov <vbarinov@ru.mvista.com>
7 *
8 * (c) 2005 MontaVista Software, Inc. This file is licensed under the
9 * terms of the GNU General Public License version 2. This program is
10 * licensed "as is" without any warranty of any kind, whether express or
11 * implied.
12 */
13
14#ifndef __ARCH_OMAP_MTD_XIP_H__
15#define __ARCH_OMAP_MTD_XIP_H__
16
17#include <asm/hardware.h>
18#define OMAP_MPU_TIMER_BASE (0xfffec500)
19#define OMAP_MPU_TIMER_OFFSET 0x100
20
21typedef struct {
22 u32 cntl; /* CNTL_TIMER, R/W */
23 u32 load_tim; /* LOAD_TIM, W */
24 u32 read_tim; /* READ_TIM, R */
25} xip_omap_mpu_timer_regs_t;
26
27#define xip_omap_mpu_timer_base(n) \
28((volatile xip_omap_mpu_timer_regs_t*)IO_ADDRESS(OMAP_MPU_TIMER_BASE + \
29 (n)*OMAP_MPU_TIMER_OFFSET))
30
31static inline unsigned long xip_omap_mpu_timer_read(int nr)
32{
33 volatile xip_omap_mpu_timer_regs_t* timer = xip_omap_mpu_timer_base(nr);
34 return timer->read_tim;
35}
36
37#define xip_irqpending() \
38 (omap_readl(OMAP_IH1_ITR) & ~omap_readl(OMAP_IH1_MIR))
39#define xip_currtime() (~xip_omap_mpu_timer_read(0))
40
41/*
42 * It's permitted to do approxmation for xip_elapsed_since macro
43 * (see linux/mtd/xip.h)
44 */
45
46#ifdef CONFIG_MACH_OMAP_PERSEUS2
47#define xip_elapsed_since(x) (signed)((~xip_omap_mpu_timer_read(0) - (x)) / 7)
48#else
49#define xip_elapsed_since(x) (signed)((~xip_omap_mpu_timer_read(0) - (x)) / 6)
50#endif
51
52/*
53 * xip_cpu_idle() is used when waiting for a delay equal or larger than
54 * the system timer tick period. This should put the CPU into idle mode
55 * to save power and to be woken up only when some interrupts are pending.
56 * As above, this should not rely upon standard kernel code.
57 */
58
59#define xip_cpu_idle() asm volatile ("mcr p15, 0, %0, c7, c0, 4" :: "r" (1))
60
61#endif /* __ARCH_OMAP_MTD_XIP_H__ */
diff --git a/include/asm-arm/arch-omap/mux.h b/include/asm-arm/arch-omap/mux.h
index 5bd3f0097fc6..1b1ad4105349 100644
--- a/include/asm-arm/arch-omap/mux.h
+++ b/include/asm-arm/arch-omap/mux.h
@@ -185,6 +185,7 @@ typedef enum {
185 185
186 /* MPUIO */ 186 /* MPUIO */
187 MPUIO2, 187 MPUIO2,
188 N15_1610_MPUIO2,
188 MPUIO4, 189 MPUIO4,
189 MPUIO5, 190 MPUIO5,
190 T20_1610_MPUIO5, 191 T20_1610_MPUIO5,
@@ -210,6 +211,7 @@ typedef enum {
210 211
211 /* Misc ballouts */ 212 /* Misc ballouts */
212 BALLOUT_V8_ARMIO3, 213 BALLOUT_V8_ARMIO3,
214 N20_HDQ,
213 215
214 /* OMAP-1610 MMC2 */ 216 /* OMAP-1610 MMC2 */
215 W8_1610_MMC2_DAT0, 217 W8_1610_MMC2_DAT0,
@@ -235,6 +237,7 @@ typedef enum {
235 P20_1610_GPIO4, 237 P20_1610_GPIO4,
236 V9_1610_GPIO7, 238 V9_1610_GPIO7,
237 W8_1610_GPIO9, 239 W8_1610_GPIO9,
240 N20_1610_GPIO11,
238 N19_1610_GPIO13, 241 N19_1610_GPIO13,
239 P10_1610_GPIO22, 242 P10_1610_GPIO22,
240 V5_1610_GPIO24, 243 V5_1610_GPIO24,
@@ -250,7 +253,7 @@ typedef enum {
250 U18_1610_UWIRE_SDI, 253 U18_1610_UWIRE_SDI,
251 W21_1610_UWIRE_SDO, 254 W21_1610_UWIRE_SDO,
252 N14_1610_UWIRE_CS0, 255 N14_1610_UWIRE_CS0,
253 P15_1610_UWIRE_CS0, 256 P15_1610_UWIRE_CS3,
254 N15_1610_UWIRE_CS1, 257 N15_1610_UWIRE_CS1,
255 258
256 /* OMAP-1610 Flash */ 259 /* OMAP-1610 Flash */
@@ -411,7 +414,8 @@ MUX_CFG("N21_1710_GPIO14", 6, 9, 0, 1, 1, 1, 1, 1, 1)
411MUX_CFG("W15_1710_GPIO40", 9, 27, 7, 2, 5, 1, 2, 1, 1) 414MUX_CFG("W15_1710_GPIO40", 9, 27, 7, 2, 5, 1, 2, 1, 1)
412 415
413/* MPUIO */ 416/* MPUIO */
414MUX_CFG("MPUIO2", 7, 18, 0, 1, 1, 1, NA, 0, 1) 417MUX_CFG("MPUIO2", 7, 18, 0, 1, 14, 1, NA, 0, 1)
418MUX_CFG("N15_1610_MPUIO2", 7, 18, 0, 1, 14, 1, 1, 0, 1)
415MUX_CFG("MPUIO4", 7, 15, 0, 1, 13, 1, NA, 0, 1) 419MUX_CFG("MPUIO4", 7, 15, 0, 1, 13, 1, NA, 0, 1)
416MUX_CFG("MPUIO5", 7, 12, 0, 1, 12, 1, NA, 0, 1) 420MUX_CFG("MPUIO5", 7, 12, 0, 1, 12, 1, NA, 0, 1)
417 421
@@ -438,6 +442,7 @@ MUX_CFG("MCBSP3_CLKX", 9, 3, 1, 1, 29, 0, NA, 0, 1)
438 442
439/* Misc ballouts */ 443/* Misc ballouts */
440MUX_CFG("BALLOUT_V8_ARMIO3", B, 18, 0, 2, 25, 1, NA, 0, 1) 444MUX_CFG("BALLOUT_V8_ARMIO3", B, 18, 0, 2, 25, 1, NA, 0, 1)
445MUX_CFG("N20_HDQ", 6, 18, 1, 1, 4, 0, 1, 4, 0)
441 446
442/* OMAP-1610 MMC2 */ 447/* OMAP-1610 MMC2 */
443MUX_CFG("W8_1610_MMC2_DAT0", B, 21, 6, 2, 23, 1, 2, 1, 1) 448MUX_CFG("W8_1610_MMC2_DAT0", B, 21, 6, 2, 23, 1, 2, 1, 1)
@@ -463,6 +468,7 @@ MUX_CFG("J18_1610_ETM_D7", 5, 27, 1, 0, 19, 0, 0, 0, 1)
463MUX_CFG("P20_1610_GPIO4", 6, 27, 0, 1, 7, 0, 1, 1, 1) 468MUX_CFG("P20_1610_GPIO4", 6, 27, 0, 1, 7, 0, 1, 1, 1)
464MUX_CFG("V9_1610_GPIO7", B, 12, 1, 2, 20, 0, 2, 1, 1) 469MUX_CFG("V9_1610_GPIO7", B, 12, 1, 2, 20, 0, 2, 1, 1)
465MUX_CFG("W8_1610_GPIO9", B, 21, 0, 2, 23, 0, 2, 1, 1) 470MUX_CFG("W8_1610_GPIO9", B, 21, 0, 2, 23, 0, 2, 1, 1)
471MUX_CFG("N20_1610_GPIO11", 6, 18, 0, 1, 4, 0, 1, 1, 1)
466MUX_CFG("N19_1610_GPIO13", 6, 12, 0, 1, 2, 0, 1, 1, 1) 472MUX_CFG("N19_1610_GPIO13", 6, 12, 0, 1, 2, 0, 1, 1, 1)
467MUX_CFG("P10_1610_GPIO22", C, 0, 7, 2, 26, 0, 2, 1, 1) 473MUX_CFG("P10_1610_GPIO22", C, 0, 7, 2, 26, 0, 2, 1, 1)
468MUX_CFG("V5_1610_GPIO24", B, 15, 7, 2, 21, 0, 2, 1, 1) 474MUX_CFG("V5_1610_GPIO24", B, 15, 7, 2, 21, 0, 2, 1, 1)
diff --git a/include/asm-arm/arch-omap/omap1510.h b/include/asm-arm/arch-omap/omap1510.h
index f491a48ef2e1..f086a3933906 100644
--- a/include/asm-arm/arch-omap/omap1510.h
+++ b/include/asm-arm/arch-omap/omap1510.h
@@ -36,10 +36,6 @@
36 36
37/* Syntax: XX_BASE = Virtual base address, XX_START = Physical base address */ 37/* Syntax: XX_BASE = Virtual base address, XX_START = Physical base address */
38 38
39#define OMAP1510_SRAM_BASE 0xD0000000
40#define OMAP1510_SRAM_SIZE (SZ_128K + SZ_64K)
41#define OMAP1510_SRAM_START 0x20000000
42
43#define OMAP1510_DSP_BASE 0xE0000000 39#define OMAP1510_DSP_BASE 0xE0000000
44#define OMAP1510_DSP_SIZE 0x28000 40#define OMAP1510_DSP_SIZE 0x28000
45#define OMAP1510_DSP_START 0xE0000000 41#define OMAP1510_DSP_START 0xE0000000
@@ -48,14 +44,5 @@
48#define OMAP1510_DSPREG_SIZE SZ_128K 44#define OMAP1510_DSPREG_SIZE SZ_128K
49#define OMAP1510_DSPREG_START 0xE1000000 45#define OMAP1510_DSPREG_START 0xE1000000
50 46
51/*
52 * ----------------------------------------------------------------------------
53 * Memory used by power management
54 * ----------------------------------------------------------------------------
55 */
56
57#define OMAP1510_SRAM_IDLE_SUSPEND (OMAP1510_SRAM_BASE + OMAP1510_SRAM_SIZE - 0x200)
58#define OMAP1510_SRAM_API_SUSPEND (OMAP1510_SRAM_IDLE_SUSPEND + 0x100)
59
60#endif /* __ASM_ARCH_OMAP1510_H */ 47#endif /* __ASM_ARCH_OMAP1510_H */
61 48
diff --git a/include/asm-arm/arch-omap/omap16xx.h b/include/asm-arm/arch-omap/omap16xx.h
index 38a9b95e6a33..f0c7f0fb4dc0 100644
--- a/include/asm-arm/arch-omap/omap16xx.h
+++ b/include/asm-arm/arch-omap/omap16xx.h
@@ -36,11 +36,6 @@
36 36
37/* Syntax: XX_BASE = Virtual base address, XX_START = Physical base address */ 37/* Syntax: XX_BASE = Virtual base address, XX_START = Physical base address */
38 38
39#define OMAP16XX_SRAM_BASE 0xD0000000
40#define OMAP1610_SRAM_SIZE (SZ_16K)
41#define OMAP5912_SRAM_SIZE 0x3E800
42#define OMAP16XX_SRAM_START 0x20000000
43
44#define OMAP16XX_DSP_BASE 0xE0000000 39#define OMAP16XX_DSP_BASE 0xE0000000
45#define OMAP16XX_DSP_SIZE 0x28000 40#define OMAP16XX_DSP_SIZE 0x28000
46#define OMAP16XX_DSP_START 0xE0000000 41#define OMAP16XX_DSP_START 0xE0000000
@@ -50,17 +45,6 @@
50#define OMAP16XX_DSPREG_START 0xE1000000 45#define OMAP16XX_DSPREG_START 0xE1000000
51 46
52/* 47/*
53 * ----------------------------------------------------------------------------
54 * Memory used by power management
55 * ----------------------------------------------------------------------------
56 */
57
58#define OMAP1610_SRAM_IDLE_SUSPEND (OMAP16XX_SRAM_BASE + OMAP1610_SRAM_SIZE - 0x200)
59#define OMAP1610_SRAM_API_SUSPEND (OMAP1610_SRAM_IDLE_SUSPEND + 0x100)
60#define OMAP5912_SRAM_IDLE_SUSPEND (OMAP16XX_SRAM_BASE + OMAP5912_SRAM_SIZE - 0x200)
61#define OMAP5912_SRAM_API_SUSPEND (OMAP5912_SRAM_IDLE_SUSPEND + 0x100)
62
63/*
64 * --------------------------------------------------------------------------- 48 * ---------------------------------------------------------------------------
65 * Interrupts 49 * Interrupts
66 * --------------------------------------------------------------------------- 50 * ---------------------------------------------------------------------------
diff --git a/include/asm-arm/arch-omap/omap24xx.h b/include/asm-arm/arch-omap/omap24xx.h
new file mode 100644
index 000000000000..a9105466a417
--- /dev/null
+++ b/include/asm-arm/arch-omap/omap24xx.h
@@ -0,0 +1,15 @@
1#ifndef __ASM_ARCH_OMAP24XX_H
2#define __ASM_ARCH_OMAP24XX_H
3
4#define OMAP24XX_L4_IO_BASE 0x48000000
5
6/* interrupt controller */
7#define OMAP24XX_IC_BASE (OMAP24XX_L4_IO_BASE + 0xfe000)
8#define VA_IC_BASE IO_ADDRESS(OMAP24XX_IC_BASE)
9
10#define OMAP24XX_IVA_INTC_BASE 0x40000000
11
12#define IRQ_SIR_IRQ 0x0040
13
14#endif /* __ASM_ARCH_OMAP24XX_H */
15
diff --git a/include/asm-arm/arch-omap/omap730.h b/include/asm-arm/arch-omap/omap730.h
index 599ab00f5488..755b64c5e9f0 100644
--- a/include/asm-arm/arch-omap/omap730.h
+++ b/include/asm-arm/arch-omap/omap730.h
@@ -36,10 +36,6 @@
36 36
37/* Syntax: XX_BASE = Virtual base address, XX_START = Physical base address */ 37/* Syntax: XX_BASE = Virtual base address, XX_START = Physical base address */
38 38
39#define OMAP730_SRAM_BASE 0xD0000000
40#define OMAP730_SRAM_SIZE (SZ_128K + SZ_64K + SZ_8K)
41#define OMAP730_SRAM_START 0x20000000
42
43#define OMAP730_DSP_BASE 0xE0000000 39#define OMAP730_DSP_BASE 0xE0000000
44#define OMAP730_DSP_SIZE 0x50000 40#define OMAP730_DSP_SIZE 0x50000
45#define OMAP730_DSP_START 0xE0000000 41#define OMAP730_DSP_START 0xE0000000
diff --git a/include/asm-arm/arch-omap/pm.h b/include/asm-arm/arch-omap/pm.h
index f209fc0953fb..fbd742d0c499 100644
--- a/include/asm-arm/arch-omap/pm.h
+++ b/include/asm-arm/arch-omap/pm.h
@@ -61,7 +61,10 @@
61#define PER_EN 0x1 61#define PER_EN 0x1
62 62
63#define CPU_SUSPEND_SIZE 200 63#define CPU_SUSPEND_SIZE 200
64#define ULPD_LOW_POWER_EN 0x0001 64#define ULPD_LOW_PWR_EN 0x0001
65#define ULPD_DEEP_SLEEP_TRANSITION_EN 0x0010
66#define ULPD_SETUP_ANALOG_CELL_3_VAL 0
67#define ULPD_POWER_CTRL_REG_VAL 0x0219
65 68
66#define DSP_IDLE_DELAY 10 69#define DSP_IDLE_DELAY 10
67#define DSP_IDLE 0x0040 70#define DSP_IDLE 0x0040
@@ -86,46 +89,35 @@
86#define OMAP1510_BIG_SLEEP_REQUEST 0x0cc5 89#define OMAP1510_BIG_SLEEP_REQUEST 0x0cc5
87#define OMAP1510_IDLE_LOOP_REQUEST 0x0c00 90#define OMAP1510_IDLE_LOOP_REQUEST 0x0c00
88#define OMAP1510_IDLE_CLOCK_DOMAINS 0x2 91#define OMAP1510_IDLE_CLOCK_DOMAINS 0x2
89#define OMAP1510_ULPD_LOW_POWER_REQ 0x0001
90 92
91#define OMAP1610_DEEP_SLEEP_REQUEST 0x17c7 93/* Both big sleep and deep sleep use same values. Difference is in ULPD. */
92#define OMAP1610_BIG_SLEEP_REQUEST TBD 94#define OMAP1610_IDLECT1_SLEEP_VAL 0x13c7
95#define OMAP1610_IDLECT2_SLEEP_VAL 0x09c7
96#define OMAP1610_IDLECT3_VAL 0x3f
97#define OMAP1610_IDLECT3_SLEEP_ORMASK 0x2c
98#define OMAP1610_IDLECT3 0xfffece24
93#define OMAP1610_IDLE_LOOP_REQUEST 0x0400 99#define OMAP1610_IDLE_LOOP_REQUEST 0x0400
94#define OMAP1610_IDLE_CLOCK_DOMAINS 0x09c7
95#define OMAP1610_ULPD_LOW_POWER_REQ 0x3
96
97#ifndef OMAP1510_SRAM_IDLE_SUSPEND
98#define OMAP1510_SRAM_IDLE_SUSPEND 0
99#endif
100#ifndef OMAP1610_SRAM_IDLE_SUSPEND
101#define OMAP1610_SRAM_IDLE_SUSPEND 0
102#endif
103#ifndef OMAP5912_SRAM_IDLE_SUSPEND
104#define OMAP5912_SRAM_IDLE_SUSPEND 0
105#endif
106
107#ifndef OMAP1510_SRAM_API_SUSPEND
108#define OMAP1510_SRAM_API_SUSPEND 0
109#endif
110#ifndef OMAP1610_SRAM_API_SUSPEND
111#define OMAP1610_SRAM_API_SUSPEND 0
112#endif
113#ifndef OMAP5912_SRAM_API_SUSPEND
114#define OMAP5912_SRAM_API_SUSPEND 0
115#endif
116 100
117#if !defined(CONFIG_ARCH_OMAP1510) && \ 101#if !defined(CONFIG_ARCH_OMAP1510) && \
118 !defined(CONFIG_ARCH_OMAP16XX) 102 !defined(CONFIG_ARCH_OMAP16XX) && \
103 !defined(CONFIG_ARCH_OMAP24XX)
119#error "Power management for this processor not implemented yet" 104#error "Power management for this processor not implemented yet"
120#endif 105#endif
121 106
122#ifndef __ASSEMBLER__ 107#ifndef __ASSEMBLER__
123extern void omap_pm_idle(void); 108extern void omap_pm_idle(void);
124extern void omap_pm_suspend(void); 109extern void omap_pm_suspend(void);
125extern int omap1510_cpu_suspend(unsigned short, unsigned short); 110extern void omap1510_cpu_suspend(unsigned short, unsigned short);
126extern int omap1610_cpu_suspend(unsigned short, unsigned short); 111extern void omap1610_cpu_suspend(unsigned short, unsigned short);
127extern int omap1510_idle_loop_suspend(void); 112extern void omap1510_idle_loop_suspend(void);
128extern int omap1610_idle_loop_suspend(void); 113extern void omap1610_idle_loop_suspend(void);
114
115#ifdef CONFIG_OMAP_SERIAL_WAKE
116extern void omap_serial_wake_trigger(int enable);
117#else
118#define omap_serial_wake_trigger(x) {}
119#endif /* CONFIG_OMAP_SERIAL_WAKE */
120
129extern unsigned int omap1510_cpu_suspend_sz; 121extern unsigned int omap1510_cpu_suspend_sz;
130extern unsigned int omap1510_idle_loop_suspend_sz; 122extern unsigned int omap1510_idle_loop_suspend_sz;
131extern unsigned int omap1610_cpu_suspend_sz; 123extern unsigned int omap1610_cpu_suspend_sz;
@@ -161,6 +153,7 @@ enum arm_save_state {
161 ARM_SLEEP_SAVE_ARM_CKCTL, 153 ARM_SLEEP_SAVE_ARM_CKCTL,
162 ARM_SLEEP_SAVE_ARM_IDLECT1, 154 ARM_SLEEP_SAVE_ARM_IDLECT1,
163 ARM_SLEEP_SAVE_ARM_IDLECT2, 155 ARM_SLEEP_SAVE_ARM_IDLECT2,
156 ARM_SLEEP_SAVE_ARM_IDLECT3,
164 ARM_SLEEP_SAVE_ARM_EWUPCT, 157 ARM_SLEEP_SAVE_ARM_EWUPCT,
165 ARM_SLEEP_SAVE_ARM_RSTCT1, 158 ARM_SLEEP_SAVE_ARM_RSTCT1,
166 ARM_SLEEP_SAVE_ARM_RSTCT2, 159 ARM_SLEEP_SAVE_ARM_RSTCT2,
diff --git a/include/asm-arm/arch-omap/serial.h b/include/asm-arm/arch-omap/serial.h
new file mode 100644
index 000000000000..79a5297af9fc
--- /dev/null
+++ b/include/asm-arm/arch-omap/serial.h
@@ -0,0 +1,37 @@
1/*
2 * linux/include/asm-arm/arch-omap/serial.h
3 *
4 * This program is distributed in the hope that it will be useful,
5 * but WITHOUT ANY WARRANTY; without even the implied warranty of
6 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7 * GNU General Public License for more details.
8 */
9
10#ifndef __ASM_ARCH_SERIAL_H
11#define __ASM_ARCH_SERIAL_H
12
13#if defined(CONFIG_ARCH_OMAP1)
14/* OMAP1 serial ports */
15#define OMAP_UART1_BASE 0xfffb0000
16#define OMAP_UART2_BASE 0xfffb0800
17#define OMAP_UART3_BASE 0xfffb9800
18#elif defined(CONFIG_ARCH_OMAP2)
19/* OMAP2 serial ports */
20#define OMAP_UART1_BASE 0x4806a000
21#define OMAP_UART2_BASE 0x4806c000
22#define OMAP_UART3_BASE 0x4806e000
23#endif
24
25#define OMAP_MAX_NR_PORTS 3
26#define OMAP1510_BASE_BAUD (12000000/16)
27#define OMAP16XX_BASE_BAUD (48000000/16)
28
29#define is_omap_port(p) ({int __ret = 0; \
30 if (p == IO_ADDRESS(OMAP_UART1_BASE) || \
31 p == IO_ADDRESS(OMAP_UART2_BASE) || \
32 p == IO_ADDRESS(OMAP_UART3_BASE)) \
33 __ret = 1; \
34 __ret; \
35 })
36
37#endif
diff --git a/include/asm-arm/arch-omap/uncompress.h b/include/asm-arm/arch-omap/uncompress.h
index 3e640aba8c20..3545c86859cc 100644
--- a/include/asm-arm/arch-omap/uncompress.h
+++ b/include/asm-arm/arch-omap/uncompress.h
@@ -20,7 +20,7 @@
20#include <linux/config.h> 20#include <linux/config.h>
21#include <linux/types.h> 21#include <linux/types.h>
22#include <linux/serial_reg.h> 22#include <linux/serial_reg.h>
23#include <asm/arch/hardware.h> 23#include <asm/arch/serial.h>
24 24
25unsigned int system_rev; 25unsigned int system_rev;
26 26
@@ -34,8 +34,9 @@ static void
34putstr(const char *s) 34putstr(const char *s)
35{ 35{
36 volatile u8 * uart = 0; 36 volatile u8 * uart = 0;
37 int shift; 37 int shift = 2;
38 38
39#ifdef CONFIG_ARCH_OMAP
39#ifdef CONFIG_OMAP_LL_DEBUG_UART3 40#ifdef CONFIG_OMAP_LL_DEBUG_UART3
40 uart = (volatile u8 *)(OMAP_UART3_BASE); 41 uart = (volatile u8 *)(OMAP_UART3_BASE);
41#elif CONFIG_OMAP_LL_DEBUG_UART2 42#elif CONFIG_OMAP_LL_DEBUG_UART2
@@ -44,6 +45,7 @@ putstr(const char *s)
44 uart = (volatile u8 *)(OMAP_UART1_BASE); 45 uart = (volatile u8 *)(OMAP_UART1_BASE);
45#endif 46#endif
46 47
48#ifdef CONFIG_ARCH_OMAP1
47 /* Determine which serial port to use */ 49 /* Determine which serial port to use */
48 do { 50 do {
49 /* MMU is not on, so cpu_is_omapXXXX() won't work here */ 51 /* MMU is not on, so cpu_is_omapXXXX() won't work here */
@@ -51,14 +53,14 @@ putstr(const char *s)
51 53
52 if (omap_id == OMAP_ID_730) 54 if (omap_id == OMAP_ID_730)
53 shift = 0; 55 shift = 0;
54 else
55 shift = 2;
56 56
57 if (check_port(uart, shift)) 57 if (check_port(uart, shift))
58 break; 58 break;
59 /* Silent boot if no serial ports are enabled. */ 59 /* Silent boot if no serial ports are enabled. */
60 return; 60 return;
61 } while (0); 61 } while (0);
62#endif /* CONFIG_ARCH_OMAP1 */
63#endif
62 64
63 /* 65 /*
64 * Now, xmit each character 66 * Now, xmit each character
diff --git a/include/asm-arm/arch-pxa/corgi.h b/include/asm-arm/arch-pxa/corgi.h
index 324db06b5dd4..4b7aa0b8391e 100644
--- a/include/asm-arm/arch-pxa/corgi.h
+++ b/include/asm-arm/arch-pxa/corgi.h
@@ -103,18 +103,20 @@
103 * Shared data structures 103 * Shared data structures
104 */ 104 */
105extern struct platform_device corgiscoop_device; 105extern struct platform_device corgiscoop_device;
106extern struct platform_device corgissp_device;
107extern struct platform_device corgifb_device;
106 108
107/* 109/*
108 * External Functions 110 * External Functions
109 */ 111 */
110extern unsigned long corgi_ssp_ads7846_putget(unsigned long); 112extern unsigned long corgi_ssp_ads7846_putget(unsigned long);
111extern unsigned long corgi_ssp_ads7846_get(void); 113extern unsigned long corgi_ssp_ads7846_get(void);
112extern void corgi_ssp_ads7846_put(ulong data); 114extern void corgi_ssp_ads7846_put(unsigned long data);
113extern void corgi_ssp_ads7846_lock(void); 115extern void corgi_ssp_ads7846_lock(void);
114extern void corgi_ssp_ads7846_unlock(void); 116extern void corgi_ssp_ads7846_unlock(void);
115extern void corgi_ssp_lcdtg_send (u8 adrs, u8 data); 117extern void corgi_ssp_lcdtg_send (unsigned char adrs, unsigned char data);
116extern void corgi_ssp_blduty_set(int duty); 118extern void corgi_ssp_blduty_set(int duty);
117extern int corgi_ssp_max1111_get(ulong data); 119extern int corgi_ssp_max1111_get(unsigned long data);
118 120
119#endif /* __ASM_ARCH_CORGI_H */ 121#endif /* __ASM_ARCH_CORGI_H */
120 122
diff --git a/include/asm-arm/arch-pxa/hardware.h b/include/asm-arm/arch-pxa/hardware.h
index 72b04d846a23..cf35721cfa45 100644
--- a/include/asm-arm/arch-pxa/hardware.h
+++ b/include/asm-arm/arch-pxa/hardware.h
@@ -44,24 +44,12 @@
44 44
45#ifndef __ASSEMBLY__ 45#ifndef __ASSEMBLY__
46 46
47#if 0 47# define __REG(x) (*((volatile unsigned long *)io_p2v(x)))
48# define __REG(x) (*((volatile u32 *)io_p2v(x)))
49#else
50/*
51 * This __REG() version gives the same results as the one above, except
52 * that we are fooling gcc somehow so it generates far better and smaller
53 * assembly code for access to contigous registers. It's a shame that gcc
54 * doesn't guess this by itself.
55 */
56#include <asm/types.h>
57typedef struct { volatile u32 offset[4096]; } __regbase;
58# define __REGP(x) ((__regbase *)((x)&~4095))->offset[((x)&4095)>>2]
59# define __REG(x) __REGP(io_p2v(x))
60#endif
61 48
62/* With indexed regs we don't want to feed the index through io_p2v() 49/* With indexed regs we don't want to feed the index through io_p2v()
63 especially if it is a variable, otherwise horrible code will result. */ 50 especially if it is a variable, otherwise horrible code will result. */
64# define __REG2(x,y) (*(volatile u32 *)((u32)&__REG(x) + (y))) 51# define __REG2(x,y) \
52 (*(volatile unsigned long *)((unsigned long)&__REG(x) + (y)))
65 53
66# define __PREG(x) (io_v2p((u32)&(x))) 54# define __PREG(x) (io_v2p((u32)&(x)))
67 55
diff --git a/include/asm-arm/arch-pxa/i2c.h b/include/asm-arm/arch-pxa/i2c.h
new file mode 100644
index 000000000000..46ec2243974a
--- /dev/null
+++ b/include/asm-arm/arch-pxa/i2c.h
@@ -0,0 +1,70 @@
1/*
2 * i2c_pxa.h
3 *
4 * Copyright (C) 2002 Intrinsyc Software Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11#ifndef _I2C_PXA_H_
12#define _I2C_PXA_H_
13
14#if 0
15#define DEF_TIMEOUT 3
16#else
17/* need a longer timeout if we're dealing with the fact we may well be
18 * looking at a multi-master environment
19*/
20#define DEF_TIMEOUT 32
21#endif
22
23#define BUS_ERROR (-EREMOTEIO)
24#define XFER_NAKED (-ECONNREFUSED)
25#define I2C_RETRY (-2000) /* an error has occurred retry transmit */
26
27/* ICR initialize bit values
28*
29* 15. FM 0 (100 Khz operation)
30* 14. UR 0 (No unit reset)
31* 13. SADIE 0 (Disables the unit from interrupting on slave addresses
32* matching its slave address)
33* 12. ALDIE 0 (Disables the unit from interrupt when it loses arbitration
34* in master mode)
35* 11. SSDIE 0 (Disables interrupts from a slave stop detected, in slave mode)
36* 10. BEIE 1 (Enable interrupts from detected bus errors, no ACK sent)
37* 9. IRFIE 1 (Enable interrupts from full buffer received)
38* 8. ITEIE 1 (Enables the I2C unit to interrupt when transmit buffer empty)
39* 7. GCD 1 (Disables i2c unit response to general call messages as a slave)
40* 6. IUE 0 (Disable unit until we change settings)
41* 5. SCLE 1 (Enables the i2c clock output for master mode (drives SCL)
42* 4. MA 0 (Only send stop with the ICR stop bit)
43* 3. TB 0 (We are not transmitting a byte initially)
44* 2. ACKNAK 0 (Send an ACK after the unit receives a byte)
45* 1. STOP 0 (Do not send a STOP)
46* 0. START 0 (Do not send a START)
47*
48*/
49#define I2C_ICR_INIT (ICR_BEIE | ICR_IRFIE | ICR_ITEIE | ICR_GCD | ICR_SCLE)
50
51/* I2C status register init values
52 *
53 * 10. BED 1 (Clear bus error detected)
54 * 9. SAD 1 (Clear slave address detected)
55 * 7. IRF 1 (Clear IDBR Receive Full)
56 * 6. ITE 1 (Clear IDBR Transmit Empty)
57 * 5. ALD 1 (Clear Arbitration Loss Detected)
58 * 4. SSD 1 (Clear Slave Stop Detected)
59 */
60#define I2C_ISR_INIT 0x7FF /* status register init */
61
62struct i2c_slave_client;
63
64struct i2c_pxa_platform_data {
65 unsigned int slave_addr;
66 struct i2c_slave_client *slave;
67};
68
69extern void pxa_set_i2c_info(struct i2c_pxa_platform_data *info);
70#endif
diff --git a/include/asm-arm/arch-pxa/mmc.h b/include/asm-arm/arch-pxa/mmc.h
index 7492ea7ea614..88c17dd02ed2 100644
--- a/include/asm-arm/arch-pxa/mmc.h
+++ b/include/asm-arm/arch-pxa/mmc.h
@@ -9,7 +9,9 @@ struct mmc_host;
9 9
10struct pxamci_platform_data { 10struct pxamci_platform_data {
11 unsigned int ocr_mask; /* available voltages */ 11 unsigned int ocr_mask; /* available voltages */
12 unsigned long detect_delay; /* delay in jiffies before detecting cards after interrupt */
12 int (*init)(struct device *, irqreturn_t (*)(int, void *, struct pt_regs *), void *); 13 int (*init)(struct device *, irqreturn_t (*)(int, void *, struct pt_regs *), void *);
14 int (*get_ro)(struct device *);
13 void (*setpower)(struct device *, unsigned int); 15 void (*setpower)(struct device *, unsigned int);
14 void (*exit)(struct device *, void *); 16 void (*exit)(struct device *, void *);
15}; 17};
diff --git a/include/asm-arm/arch-pxa/pxafb.h b/include/asm-arm/arch-pxa/pxafb.h
index 27d71e9d413b..21c0e16dce5f 100644
--- a/include/asm-arm/arch-pxa/pxafb.h
+++ b/include/asm-arm/arch-pxa/pxafb.h
@@ -66,3 +66,4 @@ struct pxafb_mach_info {
66 66
67}; 67};
68void set_pxa_fb_info(struct pxafb_mach_info *hard_pxa_fb_info); 68void set_pxa_fb_info(struct pxafb_mach_info *hard_pxa_fb_info);
69unsigned long pxafb_get_hsync_time(struct device *dev);
diff --git a/include/asm-arm/arch-s3c2410/anubis-cpld.h b/include/asm-arm/arch-s3c2410/anubis-cpld.h
new file mode 100644
index 000000000000..5675b1796b55
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/anubis-cpld.h
@@ -0,0 +1,24 @@
1/* linux/include/asm-arm/arch-s3c2410/anubis-cpld.h
2 *
3 * (c) 2005 Simtec Electronics
4 * http://www.simtec.co.uk/products/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * ANUBIS - CPLD control constants
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 * Changelog:
14 *
15*/
16
17#ifndef __ASM_ARCH_ANUBISCPLD_H
18#define __ASM_ARCH_ANUBISCPLD_H
19
20/* CTRL2 - NAND WP control, IDE Reset assert/check */
21
22#define ANUBIS_CTRL1_NANDSEL (0x3)
23
24#endif /* __ASM_ARCH_ANUBISCPLD_H */
diff --git a/include/asm-arm/arch-s3c2410/anubis-irq.h b/include/asm-arm/arch-s3c2410/anubis-irq.h
new file mode 100644
index 000000000000..82f15dbd97e8
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/anubis-irq.h
@@ -0,0 +1,23 @@
1/* linux/include/asm-arm/arch-s3c2410/anubis-irq.h
2 *
3 * (c) 2005 Simtec Electronics
4 * http://www.simtec.co.uk/products/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * ANUBIS - IRQ Number definitions
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 * Changelog:
14 */
15
16#ifndef __ASM_ARCH_ANUBISIRQ_H
17#define __ASM_ARCH_ANUBISIRQ_H
18
19#define IRQ_IDE0 IRQ_EINT2
20#define IRQ_IDE1 IRQ_EINT3
21#define IRQ_ASIX IRQ_EINT1
22
23#endif /* __ASM_ARCH_ANUBISIRQ_H */
diff --git a/include/asm-arm/arch-s3c2410/anubis-map.h b/include/asm-arm/arch-s3c2410/anubis-map.h
new file mode 100644
index 000000000000..97741d6e506a
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/anubis-map.h
@@ -0,0 +1,46 @@
1/* linux/include/asm-arm/arch-s3c2410/anubis-map.h
2 *
3 * (c) 2005 Simtec Electronics
4 * http://www.simtec.co.uk/products/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * ANUBIS - Memory map definitions
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 * Changelog:
14*/
15
16/* needs arch/map.h including with this */
17
18#ifndef __ASM_ARCH_ANUBISMAP_H
19#define __ASM_ARCH_ANUBISMAP_H
20
21/* start peripherals off after the S3C2410 */
22
23#define ANUBIS_IOADDR(x) (S3C2410_ADDR((x) + 0x02000000))
24
25#define ANUBIS_PA_CPLD (S3C2410_CS1 | (1<<26))
26
27/* we put the CPLD registers next, to get them out of the way */
28
29#define ANUBIS_VA_CTRL1 ANUBIS_IOADDR(0x00000000) /* 0x01300000 */
30#define ANUBIS_PA_CTRL1 (ANUBIS_PA_CPLD)
31
32#define ANUBIS_VA_CTRL2 ANUBIS_IOADDR(0x00100000) /* 0x01400000 */
33#define ANUBIS_PA_CTRL2 (ANUBIS_PA_CPLD)
34
35#define ANUBIS_VA_CTRL3 ANUBIS_IOADDR(0x00200000) /* 0x01500000 */
36#define ANUBIS_PA_CTRL3 (ANUBIS_PA_CPLD)
37
38#define ANUBIS_VA_CTRL4 ANUBIS_IOADDR(0x00300000) /* 0x01600000 */
39#define ANUBIS_PA_CTRL4 (ANUBIS_PA_CPLD)
40
41#define ANUBIS_IDEPRI ANUBIS_IOADDR(0x01000000)
42#define ANUBIS_IDEPRIAUX ANUBIS_IOADDR(0x01100000)
43#define ANUBIS_IDESEC ANUBIS_IOADDR(0x01200000)
44#define ANUBIS_IDESECAUX ANUBIS_IOADDR(0x01300000)
45
46#endif /* __ASM_ARCH_ANUBISMAP_H */
diff --git a/include/asm-arm/arch-s3c2410/fb.h b/include/asm-arm/arch-s3c2410/fb.h
new file mode 100644
index 000000000000..ac57bc887d82
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/fb.h
@@ -0,0 +1,69 @@
1/* linux/include/asm/arch-s3c2410/fb.h
2 *
3 * Copyright (c) 2004 Arnaud Patard <arnaud.patard@rtp-net.org>
4 *
5 * Inspired by pxafb.h
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 *
12 * Changelog:
13 * 07-Sep-2004 RTP Created file
14 * 03-Nov-2004 BJD Updated and minor cleanups
15 * 03-Aug-2005 RTP Renamed to fb.h
16*/
17
18#ifndef __ASM_ARM_FB_H
19#define __ASM_ARM_FB_H
20
21#include <asm/arch/regs-lcd.h>
22
23struct s3c2410fb_val {
24 unsigned int defval;
25 unsigned int min;
26 unsigned int max;
27};
28
29struct s3c2410fb_hw {
30 unsigned long lcdcon1;
31 unsigned long lcdcon2;
32 unsigned long lcdcon3;
33 unsigned long lcdcon4;
34 unsigned long lcdcon5;
35};
36
37struct s3c2410fb_mach_info {
38 unsigned char fixed_syncs; /* do not update sync/border */
39
40 /* Screen size */
41 int width;
42 int height;
43
44 /* Screen info */
45 struct s3c2410fb_val xres;
46 struct s3c2410fb_val yres;
47 struct s3c2410fb_val bpp;
48
49 /* lcd configuration registers */
50 struct s3c2410fb_hw regs;
51
52 /* GPIOs */
53
54 unsigned long gpcup;
55 unsigned long gpcup_mask;
56 unsigned long gpccon;
57 unsigned long gpccon_mask;
58 unsigned long gpdup;
59 unsigned long gpdup_mask;
60 unsigned long gpdcon;
61 unsigned long gpdcon_mask;
62
63 /* lpc3600 control register */
64 unsigned long lpcsel;
65};
66
67void __init set_s3c2410fb_info(struct s3c2410fb_mach_info *hard_s3c2410fb_info);
68
69#endif /* __ASM_ARM_FB_H */
diff --git a/include/asm-arm/arch-s3c2410/regs-lcd.h b/include/asm-arm/arch-s3c2410/regs-lcd.h
index 7f882ea92b2a..b6b1b4e8bbeb 100644
--- a/include/asm-arm/arch-s3c2410/regs-lcd.h
+++ b/include/asm-arm/arch-s3c2410/regs-lcd.h
@@ -51,21 +51,32 @@
51 51
52#define S3C2410_LCDCON1_ENVID (1) 52#define S3C2410_LCDCON1_ENVID (1)
53 53
54#define S3C2410_LCDCON1_MODEMASK 0x1E
55
54#define S3C2410_LCDCON2_VBPD(x) ((x) << 24) 56#define S3C2410_LCDCON2_VBPD(x) ((x) << 24)
55#define S3C2410_LCDCON2_LINEVAL(x) ((x) << 14) 57#define S3C2410_LCDCON2_LINEVAL(x) ((x) << 14)
56#define S3C2410_LCDCON2_VFPD(x) ((x) << 6) 58#define S3C2410_LCDCON2_VFPD(x) ((x) << 6)
57#define S3C2410_LCDCON2_VSPW(x) ((x) << 0) 59#define S3C2410_LCDCON2_VSPW(x) ((x) << 0)
58 60
61#define S3C2410_LCDCON2_GET_VBPD(x) ( ((x) >> 24) & 0xFF)
62#define S3C2410_LCDCON2_GET_VFPD(x) ( ((x) >> 6) & 0xFF)
63#define S3C2410_LCDCON2_GET_VSPW(x) ( ((x) >> 0) & 0x3F)
64
59#define S3C2410_LCDCON3_HBPD(x) ((x) << 19) 65#define S3C2410_LCDCON3_HBPD(x) ((x) << 19)
60#define S3C2410_LCDCON3_WDLY(x) ((x) << 19) 66#define S3C2410_LCDCON3_WDLY(x) ((x) << 19)
61#define S3C2410_LCDCON3_HOZVAL(x) ((x) << 8) 67#define S3C2410_LCDCON3_HOZVAL(x) ((x) << 8)
62#define S3C2410_LCDCON3_HFPD(x) ((x) << 0) 68#define S3C2410_LCDCON3_HFPD(x) ((x) << 0)
63#define S3C2410_LCDCON3_LINEBLANK(x)((x) << 0) 69#define S3C2410_LCDCON3_LINEBLANK(x)((x) << 0)
64 70
71#define S3C2410_LCDCON3_GET_HBPD(x) ( ((x) >> 19) & 0x7F)
72#define S3C2410_LCDCON3_GET_HFPD(x) ( ((x) >> 0) & 0xFF)
73
65#define S3C2410_LCDCON4_MVAL(x) ((x) << 8) 74#define S3C2410_LCDCON4_MVAL(x) ((x) << 8)
66#define S3C2410_LCDCON4_HSPW(x) ((x) << 0) 75#define S3C2410_LCDCON4_HSPW(x) ((x) << 0)
67#define S3C2410_LCDCON4_WLH(x) ((x) << 0) 76#define S3C2410_LCDCON4_WLH(x) ((x) << 0)
68 77
78#define S3C2410_LCDCON4_GET_HSPW(x) ( ((x) >> 0) & 0xFF)
79
69#define S3C2410_LCDCON5_BPP24BL (1<<12) 80#define S3C2410_LCDCON5_BPP24BL (1<<12)
70#define S3C2410_LCDCON5_FRM565 (1<<11) 81#define S3C2410_LCDCON5_FRM565 (1<<11)
71#define S3C2410_LCDCON5_INVVCLK (1<<10) 82#define S3C2410_LCDCON5_INVVCLK (1<<10)
@@ -100,10 +111,16 @@
100#define S3C2410_DITHMODE S3C2410_LCDREG(0x4C) 111#define S3C2410_DITHMODE S3C2410_LCDREG(0x4C)
101#define S3C2410_TPAL S3C2410_LCDREG(0x50) 112#define S3C2410_TPAL S3C2410_LCDREG(0x50)
102 113
114#define S3C2410_TPAL_EN (1<<24)
115
103/* interrupt info */ 116/* interrupt info */
104#define S3C2410_LCDINTPND S3C2410_LCDREG(0x54) 117#define S3C2410_LCDINTPND S3C2410_LCDREG(0x54)
105#define S3C2410_LCDSRCPND S3C2410_LCDREG(0x58) 118#define S3C2410_LCDSRCPND S3C2410_LCDREG(0x58)
106#define S3C2410_LCDINTMSK S3C2410_LCDREG(0x5C) 119#define S3C2410_LCDINTMSK S3C2410_LCDREG(0x5C)
120#define S3C2410_LCDINT_FIWSEL (1<<2)
121#define S3C2410_LCDINT_FRSYNC (1<<1)
122#define S3C2410_LCDINT_FICNT (1<<0)
123
107#define S3C2410_LPCSEL S3C2410_LCDREG(0x60) 124#define S3C2410_LPCSEL S3C2410_LCDREG(0x60)
108 125
109#define S3C2410_TFTPAL(x) S3C2410_LCDREG((0x400 + (x)*4)) 126#define S3C2410_TFTPAL(x) S3C2410_LCDREG((0x400 + (x)*4))
diff --git a/include/asm-arm/arch-sa1100/hardware.h b/include/asm-arm/arch-sa1100/hardware.h
index 10c62db34362..19c3b1e186bb 100644
--- a/include/asm-arm/arch-sa1100/hardware.h
+++ b/include/asm-arm/arch-sa1100/hardware.h
@@ -49,23 +49,9 @@
49 ( (((x)&0x00ffffff) | (((x)&(0x30000000>>VIO_SHIFT))<<VIO_SHIFT)) + PIO_START ) 49 ( (((x)&0x00ffffff) | (((x)&(0x30000000>>VIO_SHIFT))<<VIO_SHIFT)) + PIO_START )
50 50
51#ifndef __ASSEMBLY__ 51#ifndef __ASSEMBLY__
52#include <asm/types.h>
53 52
54#if 0 53# define __REG(x) (*((volatile unsigned long *)io_p2v(x)))
55# define __REG(x) (*((volatile u32 *)io_p2v(x))) 54# define __PREG(x) (io_v2p((unsigned long)&(x)))
56#else
57/*
58 * This __REG() version gives the same results as the one above, except
59 * that we are fooling gcc somehow so it generates far better and smaller
60 * assembly code for access to contigous registers. It's a shame that gcc
61 * doesn't guess this by itself.
62 */
63typedef struct { volatile u32 offset[4096]; } __regbase;
64# define __REGP(x) ((__regbase *)((x)&~4095))->offset[((x)&4095)>>2]
65# define __REG(x) __REGP(io_p2v(x))
66#endif
67
68# define __PREG(x) (io_v2p((u32)&(x)))
69 55
70#else 56#else
71 57
diff --git a/include/asm-arm/auxvec.h b/include/asm-arm/auxvec.h
new file mode 100644
index 000000000000..c0536f6b29a7
--- /dev/null
+++ b/include/asm-arm/auxvec.h
@@ -0,0 +1,4 @@
1#ifndef __ASMARM_AUXVEC_H
2#define __ASMARM_AUXVEC_H
3
4#endif
diff --git a/include/asm-arm/cacheflush.h b/include/asm-arm/cacheflush.h
index 035cdcff43d2..e81baff4f54b 100644
--- a/include/asm-arm/cacheflush.h
+++ b/include/asm-arm/cacheflush.h
@@ -256,7 +256,7 @@ extern void dmac_flush_range(unsigned long, unsigned long);
256 * Convert calls to our calling convention. 256 * Convert calls to our calling convention.
257 */ 257 */
258#define flush_cache_all() __cpuc_flush_kern_all() 258#define flush_cache_all() __cpuc_flush_kern_all()
259 259#ifndef CONFIG_CPU_CACHE_VIPT
260static inline void flush_cache_mm(struct mm_struct *mm) 260static inline void flush_cache_mm(struct mm_struct *mm)
261{ 261{
262 if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask)) 262 if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask))
@@ -279,6 +279,11 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned l
279 __cpuc_flush_user_range(addr, addr + PAGE_SIZE, vma->vm_flags); 279 __cpuc_flush_user_range(addr, addr + PAGE_SIZE, vma->vm_flags);
280 } 280 }
281} 281}
282#else
283extern void flush_cache_mm(struct mm_struct *mm);
284extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end);
285extern void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn);
286#endif
282 287
283/* 288/*
284 * flush_cache_user_range is used when we want to ensure that the 289 * flush_cache_user_range is used when we want to ensure that the
diff --git a/include/asm-arm/fcntl.h b/include/asm-arm/fcntl.h
index 485b6bdf4d7a..a80b6607b2ef 100644
--- a/include/asm-arm/fcntl.h
+++ b/include/asm-arm/fcntl.h
@@ -1,87 +1,11 @@
1#ifndef _ARM_FCNTL_H 1#ifndef _ARM_FCNTL_H
2#define _ARM_FCNTL_H 2#define _ARM_FCNTL_H
3 3
4/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
5 located on an ext2 file system */
6#define O_ACCMODE 0003
7#define O_RDONLY 00
8#define O_WRONLY 01
9#define O_RDWR 02
10#define O_CREAT 0100 /* not fcntl */
11#define O_EXCL 0200 /* not fcntl */
12#define O_NOCTTY 0400 /* not fcntl */
13#define O_TRUNC 01000 /* not fcntl */
14#define O_APPEND 02000
15#define O_NONBLOCK 04000
16#define O_NDELAY O_NONBLOCK
17#define O_SYNC 010000
18#define FASYNC 020000 /* fcntl, for BSD compatibility */
19#define O_DIRECTORY 040000 /* must be a directory */ 4#define O_DIRECTORY 040000 /* must be a directory */
20#define O_NOFOLLOW 0100000 /* don't follow links */ 5#define O_NOFOLLOW 0100000 /* don't follow links */
21#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */ 6#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
22#define O_LARGEFILE 0400000 7#define O_LARGEFILE 0400000
23#define O_NOATIME 01000000
24 8
25#define F_DUPFD 0 /* dup */ 9#include <asm-generic/fcntl.h>
26#define F_GETFD 1 /* get close_on_exec */
27#define F_SETFD 2 /* set/clear close_on_exec */
28#define F_GETFL 3 /* get file->f_flags */
29#define F_SETFL 4 /* set file->f_flags */
30#define F_GETLK 5
31#define F_SETLK 6
32#define F_SETLKW 7
33 10
34#define F_SETOWN 8 /* for sockets. */
35#define F_GETOWN 9 /* for sockets. */
36#define F_SETSIG 10 /* for sockets. */
37#define F_GETSIG 11 /* for sockets. */
38
39#define F_GETLK64 12 /* using 'struct flock64' */
40#define F_SETLK64 13
41#define F_SETLKW64 14
42
43/* for F_[GET|SET]FL */
44#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
45
46/* for posix fcntl() and lockf() */
47#define F_RDLCK 0
48#define F_WRLCK 1
49#define F_UNLCK 2
50
51/* for old implementation of bsd flock () */
52#define F_EXLCK 4 /* or 3 */
53#define F_SHLCK 8 /* or 4 */
54
55/* for leases */
56#define F_INPROGRESS 16
57
58/* operations for bsd flock(), also used by the kernel implementation */
59#define LOCK_SH 1 /* shared lock */
60#define LOCK_EX 2 /* exclusive lock */
61#define LOCK_NB 4 /* or'd with one of the above to prevent
62 blocking */
63#define LOCK_UN 8 /* remove lock */
64
65#define LOCK_MAND 32 /* This is a mandatory flock */
66#define LOCK_READ 64 /* ... Which allows concurrent read operations */
67#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
68#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
69
70struct flock {
71 short l_type;
72 short l_whence;
73 off_t l_start;
74 off_t l_len;
75 pid_t l_pid;
76};
77
78struct flock64 {
79 short l_type;
80 short l_whence;
81 loff_t l_start;
82 loff_t l_len;
83 pid_t l_pid;
84};
85
86#define F_LINUX_SPECIFIC_BASE 1024
87#endif 11#endif
diff --git a/include/asm-arm/futex.h b/include/asm-arm/futex.h
new file mode 100644
index 000000000000..2cac5ecd9d00
--- /dev/null
+++ b/include/asm-arm/futex.h
@@ -0,0 +1,53 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/uaccess.h>
9
10static inline int
11futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
12{
13 int op = (encoded_op >> 28) & 7;
14 int cmp = (encoded_op >> 24) & 15;
15 int oparg = (encoded_op << 8) >> 20;
16 int cmparg = (encoded_op << 20) >> 20;
17 int oldval = 0, ret, tem;
18 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
19 oparg = 1 << oparg;
20
21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
22 return -EFAULT;
23
24 inc_preempt_count();
25
26 switch (op) {
27 case FUTEX_OP_SET:
28 case FUTEX_OP_ADD:
29 case FUTEX_OP_OR:
30 case FUTEX_OP_ANDN:
31 case FUTEX_OP_XOR:
32 default:
33 ret = -ENOSYS;
34 }
35
36 dec_preempt_count();
37
38 if (!ret) {
39 switch (cmp) {
40 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
41 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
42 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
43 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
44 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
45 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
46 default: ret = -ENOSYS;
47 }
48 }
49 return ret;
50}
51
52#endif
53#endif
diff --git a/include/asm-arm/hardware/scoop.h b/include/asm-arm/hardware/scoop.h
index 7ea771ff6144..527404b5a8df 100644
--- a/include/asm-arm/hardware/scoop.h
+++ b/include/asm-arm/hardware/scoop.h
@@ -40,6 +40,19 @@ struct scoop_config {
40 unsigned short io_dir; 40 unsigned short io_dir;
41}; 41};
42 42
43/* Structure for linking scoop devices to PCMCIA sockets */
44struct scoop_pcmcia_dev {
45 struct device *dev; /* Pointer to this socket's scoop device */
46 int irq; /* irq for socket */
47 int cd_irq;
48 const char *cd_irq_str;
49 unsigned char keep_vs;
50 unsigned char keep_rd;
51};
52
53extern int scoop_num;
54extern struct scoop_pcmcia_dev *scoop_devs;
55
43void reset_scoop(struct device *dev); 56void reset_scoop(struct device *dev);
44unsigned short set_scoop_gpio(struct device *dev, unsigned short bit); 57unsigned short set_scoop_gpio(struct device *dev, unsigned short bit);
45unsigned short reset_scoop_gpio(struct device *dev, unsigned short bit); 58unsigned short reset_scoop_gpio(struct device *dev, unsigned short bit);
diff --git a/include/asm-arm/hdreg.h b/include/asm-arm/hdreg.h
deleted file mode 100644
index 7f7fd1af0af3..000000000000
--- a/include/asm-arm/hdreg.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/hdreg.h>
diff --git a/include/asm-arm/mach/irq.h b/include/asm-arm/mach/irq.h
index a43a353f6c7b..0ce6ca588d8c 100644
--- a/include/asm-arm/mach/irq.h
+++ b/include/asm-arm/mach/irq.h
@@ -42,11 +42,11 @@ struct irqchip {
42 /* 42 /*
43 * Set the type of the IRQ. 43 * Set the type of the IRQ.
44 */ 44 */
45 int (*type)(unsigned int, unsigned int); 45 int (*set_type)(unsigned int, unsigned int);
46 /* 46 /*
47 * Set wakeup-enable on the selected IRQ 47 * Set wakeup-enable on the selected IRQ
48 */ 48 */
49 int (*wake)(unsigned int, unsigned int); 49 int (*set_wake)(unsigned int, unsigned int);
50 50
51#ifdef CONFIG_SMP 51#ifdef CONFIG_SMP
52 /* 52 /*
@@ -92,6 +92,14 @@ struct irqdesc {
92extern struct irqdesc irq_desc[]; 92extern struct irqdesc irq_desc[];
93 93
94/* 94/*
95 * Helpful inline function for calling irq descriptor handlers.
96 */
97static inline void desc_handle_irq(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
98{
99 desc->handle(irq, desc, regs);
100}
101
102/*
95 * This is internal. Do not use it. 103 * This is internal. Do not use it.
96 */ 104 */
97extern void (*init_arch_irq)(void); 105extern void (*init_arch_irq)(void);
diff --git a/include/asm-arm/mach/time.h b/include/asm-arm/mach/time.h
index 2cf279a44017..96c6db7dd0e1 100644
--- a/include/asm-arm/mach/time.h
+++ b/include/asm-arm/mach/time.h
@@ -47,9 +47,7 @@ struct sys_timer {
47 47
48#ifdef CONFIG_NO_IDLE_HZ 48#ifdef CONFIG_NO_IDLE_HZ
49 49
50#define DYN_TICK_SKIPPING (1 << 2)
51#define DYN_TICK_ENABLED (1 << 1) 50#define DYN_TICK_ENABLED (1 << 1)
52#define DYN_TICK_SUITABLE (1 << 0)
53 51
54struct dyn_tick_timer { 52struct dyn_tick_timer {
55 unsigned int state; /* Current state */ 53 unsigned int state; /* Current state */
diff --git a/include/asm-arm/page.h b/include/asm-arm/page.h
index 019c45d75730..4da1d532cbeb 100644
--- a/include/asm-arm/page.h
+++ b/include/asm-arm/page.h
@@ -163,20 +163,6 @@ typedef unsigned long pgprot_t;
163/* the upper-most page table pointer */ 163/* the upper-most page table pointer */
164extern pmd_t *top_pmd; 164extern pmd_t *top_pmd;
165 165
166/* Pure 2^n version of get_order */
167static inline int get_order(unsigned long size)
168{
169 int order;
170
171 size = (size-1) >> (PAGE_SHIFT-1);
172 order = -1;
173 do {
174 size >>= 1;
175 order++;
176 } while (size);
177 return order;
178}
179
180#include <asm/memory.h> 166#include <asm/memory.h>
181 167
182#endif /* !__ASSEMBLY__ */ 168#endif /* !__ASSEMBLY__ */
@@ -186,4 +172,6 @@ static inline int get_order(unsigned long size)
186 172
187#endif /* __KERNEL__ */ 173#endif /* __KERNEL__ */
188 174
175#include <asm-generic/page.h>
176
189#endif 177#endif
diff --git a/include/asm-arm/pci.h b/include/asm-arm/pci.h
index 38ea5899a580..ead3ced38cb8 100644
--- a/include/asm-arm/pci.h
+++ b/include/asm-arm/pci.h
@@ -64,6 +64,19 @@ extern void
64pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, 64pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
65 struct pci_bus_region *region); 65 struct pci_bus_region *region);
66 66
67static inline struct resource *
68pcibios_select_root(struct pci_dev *pdev, struct resource *res)
69{
70 struct resource *root = NULL;
71
72 if (res->flags & IORESOURCE_IO)
73 root = &ioport_resource;
74 if (res->flags & IORESOURCE_MEM)
75 root = &iomem_resource;
76
77 return root;
78}
79
67static inline void pcibios_add_platform_entries(struct pci_dev *dev) 80static inline void pcibios_add_platform_entries(struct pci_dev *dev)
68{ 81{
69} 82}
diff --git a/include/asm-arm/types.h b/include/asm-arm/types.h
index f4c92e4c8c02..22992ee0627a 100644
--- a/include/asm-arm/types.h
+++ b/include/asm-arm/types.h
@@ -52,8 +52,6 @@ typedef unsigned long long u64;
52typedef u32 dma_addr_t; 52typedef u32 dma_addr_t;
53typedef u32 dma64_addr_t; 53typedef u32 dma64_addr_t;
54 54
55typedef unsigned int kmem_bufctl_t;
56
57#endif /* __ASSEMBLY__ */ 55#endif /* __ASSEMBLY__ */
58 56
59#endif /* __KERNEL__ */ 57#endif /* __KERNEL__ */
diff --git a/include/asm-arm/uaccess.h b/include/asm-arm/uaccess.h
index a7c018b8a0d4..a2fdad0138b3 100644
--- a/include/asm-arm/uaccess.h
+++ b/include/asm-arm/uaccess.h
@@ -77,12 +77,6 @@ static inline void set_fs (mm_segment_t fs)
77 77
78#define access_ok(type,addr,size) (__range_ok(addr,size) == 0) 78#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
79 79
80/* this function will go away soon - use access_ok() instead */
81static inline int __deprecated verify_area(int type, const void __user *addr, unsigned long size)
82{
83 return access_ok(type, addr, size) ? 0 : -EFAULT;
84}
85
86/* 80/*
87 * Single-value transfer routines. They automatically use the right 81 * Single-value transfer routines. They automatically use the right
88 * size if we just have the right pointer type. Note that the functions 82 * size if we just have the right pointer type. Note that the functions
diff --git a/include/asm-arm26/auxvec.h b/include/asm-arm26/auxvec.h
new file mode 100644
index 000000000000..c0536f6b29a7
--- /dev/null
+++ b/include/asm-arm26/auxvec.h
@@ -0,0 +1,4 @@
1#ifndef __ASMARM_AUXVEC_H
2#define __ASMARM_AUXVEC_H
3
4#endif
diff --git a/include/asm-arm26/fcntl.h b/include/asm-arm26/fcntl.h
index 485b6bdf4d7a..d85995e7459e 100644
--- a/include/asm-arm26/fcntl.h
+++ b/include/asm-arm26/fcntl.h
@@ -3,85 +3,11 @@
3 3
4/* open/fcntl - O_SYNC is only implemented on blocks devices and on files 4/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
5 located on an ext2 file system */ 5 located on an ext2 file system */
6#define O_ACCMODE 0003
7#define O_RDONLY 00
8#define O_WRONLY 01
9#define O_RDWR 02
10#define O_CREAT 0100 /* not fcntl */
11#define O_EXCL 0200 /* not fcntl */
12#define O_NOCTTY 0400 /* not fcntl */
13#define O_TRUNC 01000 /* not fcntl */
14#define O_APPEND 02000
15#define O_NONBLOCK 04000
16#define O_NDELAY O_NONBLOCK
17#define O_SYNC 010000
18#define FASYNC 020000 /* fcntl, for BSD compatibility */
19#define O_DIRECTORY 040000 /* must be a directory */ 6#define O_DIRECTORY 040000 /* must be a directory */
20#define O_NOFOLLOW 0100000 /* don't follow links */ 7#define O_NOFOLLOW 0100000 /* don't follow links */
21#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */ 8#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
22#define O_LARGEFILE 0400000 9#define O_LARGEFILE 0400000
23#define O_NOATIME 01000000
24 10
25#define F_DUPFD 0 /* dup */ 11#include <asm-generic/fcntl.h>
26#define F_GETFD 1 /* get close_on_exec */
27#define F_SETFD 2 /* set/clear close_on_exec */
28#define F_GETFL 3 /* get file->f_flags */
29#define F_SETFL 4 /* set file->f_flags */
30#define F_GETLK 5
31#define F_SETLK 6
32#define F_SETLKW 7
33 12
34#define F_SETOWN 8 /* for sockets. */
35#define F_GETOWN 9 /* for sockets. */
36#define F_SETSIG 10 /* for sockets. */
37#define F_GETSIG 11 /* for sockets. */
38
39#define F_GETLK64 12 /* using 'struct flock64' */
40#define F_SETLK64 13
41#define F_SETLKW64 14
42
43/* for F_[GET|SET]FL */
44#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
45
46/* for posix fcntl() and lockf() */
47#define F_RDLCK 0
48#define F_WRLCK 1
49#define F_UNLCK 2
50
51/* for old implementation of bsd flock () */
52#define F_EXLCK 4 /* or 3 */
53#define F_SHLCK 8 /* or 4 */
54
55/* for leases */
56#define F_INPROGRESS 16
57
58/* operations for bsd flock(), also used by the kernel implementation */
59#define LOCK_SH 1 /* shared lock */
60#define LOCK_EX 2 /* exclusive lock */
61#define LOCK_NB 4 /* or'd with one of the above to prevent
62 blocking */
63#define LOCK_UN 8 /* remove lock */
64
65#define LOCK_MAND 32 /* This is a mandatory flock */
66#define LOCK_READ 64 /* ... Which allows concurrent read operations */
67#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
68#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
69
70struct flock {
71 short l_type;
72 short l_whence;
73 off_t l_start;
74 off_t l_len;
75 pid_t l_pid;
76};
77
78struct flock64 {
79 short l_type;
80 short l_whence;
81 loff_t l_start;
82 loff_t l_len;
83 pid_t l_pid;
84};
85
86#define F_LINUX_SPECIFIC_BASE 1024
87#endif 13#endif
diff --git a/include/asm-arm26/futex.h b/include/asm-arm26/futex.h
new file mode 100644
index 000000000000..2cac5ecd9d00
--- /dev/null
+++ b/include/asm-arm26/futex.h
@@ -0,0 +1,53 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/uaccess.h>
9
10static inline int
11futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
12{
13 int op = (encoded_op >> 28) & 7;
14 int cmp = (encoded_op >> 24) & 15;
15 int oparg = (encoded_op << 8) >> 20;
16 int cmparg = (encoded_op << 20) >> 20;
17 int oldval = 0, ret, tem;
18 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
19 oparg = 1 << oparg;
20
21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
22 return -EFAULT;
23
24 inc_preempt_count();
25
26 switch (op) {
27 case FUTEX_OP_SET:
28 case FUTEX_OP_ADD:
29 case FUTEX_OP_OR:
30 case FUTEX_OP_ANDN:
31 case FUTEX_OP_XOR:
32 default:
33 ret = -ENOSYS;
34 }
35
36 dec_preempt_count();
37
38 if (!ret) {
39 switch (cmp) {
40 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
41 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
42 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
43 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
44 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
45 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
46 default: ret = -ENOSYS;
47 }
48 }
49 return ret;
50}
51
52#endif
53#endif
diff --git a/include/asm-arm26/hdreg.h b/include/asm-arm26/hdreg.h
deleted file mode 100644
index 7f7fd1af0af3..000000000000
--- a/include/asm-arm26/hdreg.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/hdreg.h>
diff --git a/include/asm-arm26/page.h b/include/asm-arm26/page.h
index c334079b082b..d3f23ac4d468 100644
--- a/include/asm-arm26/page.h
+++ b/include/asm-arm26/page.h
@@ -89,20 +89,6 @@ typedef unsigned long pgprot_t;
89#ifdef __KERNEL__ 89#ifdef __KERNEL__
90#ifndef __ASSEMBLY__ 90#ifndef __ASSEMBLY__
91 91
92/* Pure 2^n version of get_order */
93static inline int get_order(unsigned long size)
94{
95 int order;
96
97 size = (size-1) >> (PAGE_SHIFT-1);
98 order = -1;
99 do {
100 size >>= 1;
101 order++;
102 } while (size);
103 return order;
104}
105
106#include <asm/memory.h> 92#include <asm/memory.h>
107 93
108#endif /* !__ASSEMBLY__ */ 94#endif /* !__ASSEMBLY__ */
@@ -112,4 +98,6 @@ static inline int get_order(unsigned long size)
112 98
113#endif /* __KERNEL__ */ 99#endif /* __KERNEL__ */
114 100
101#include <asm-generic/page.h>
102
115#endif 103#endif
diff --git a/include/asm-arm26/types.h b/include/asm-arm26/types.h
index 56cbe573a234..81bd357ada02 100644
--- a/include/asm-arm26/types.h
+++ b/include/asm-arm26/types.h
@@ -52,8 +52,6 @@ typedef unsigned long long u64;
52typedef u32 dma_addr_t; 52typedef u32 dma_addr_t;
53typedef u32 dma64_addr_t; 53typedef u32 dma64_addr_t;
54 54
55typedef unsigned int kmem_bufctl_t;
56
57#endif /* __ASSEMBLY__ */ 55#endif /* __ASSEMBLY__ */
58 56
59#endif /* __KERNEL__ */ 57#endif /* __KERNEL__ */
diff --git a/include/asm-arm26/uaccess.h b/include/asm-arm26/uaccess.h
index ab9ce38c6aec..3f2dd1093e58 100644
--- a/include/asm-arm26/uaccess.h
+++ b/include/asm-arm26/uaccess.h
@@ -40,12 +40,6 @@ extern int fixup_exception(struct pt_regs *regs);
40 40
41#define access_ok(type,addr,size) (__range_ok(addr,size) == 0) 41#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
42 42
43/* this function will go away soon - use access_ok() instead */
44static inline int __deprecated verify_area(int type, const void * addr, unsigned long size)
45{
46 return access_ok(type, addr, size) ? 0 : -EFAULT;
47}
48
49/* 43/*
50 * Single-value transfer routines. They automatically use the right 44 * Single-value transfer routines. They automatically use the right
51 * size if we just have the right pointer type. Note that the functions 45 * size if we just have the right pointer type. Note that the functions
diff --git a/include/asm-cris/auxvec.h b/include/asm-cris/auxvec.h
new file mode 100644
index 000000000000..cb30b01bf19f
--- /dev/null
+++ b/include/asm-cris/auxvec.h
@@ -0,0 +1,4 @@
1#ifndef __ASMCRIS_AUXVEC_H
2#define __ASMCRIS_AUXVEC_H
3
4#endif
diff --git a/include/asm-cris/fcntl.h b/include/asm-cris/fcntl.h
index 61c563242b51..46ab12db5739 100644
--- a/include/asm-cris/fcntl.h
+++ b/include/asm-cris/fcntl.h
@@ -1,90 +1 @@
1#ifndef _CRIS_FCNTL_H #include <asm-generic/fcntl.h>
2#define _CRIS_FCNTL_H
3
4/* verbatim copy of i386 version */
5
6/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
7 located on an ext2 file system */
8#define O_ACCMODE 0003
9#define O_RDONLY 00
10#define O_WRONLY 01
11#define O_RDWR 02
12#define O_CREAT 0100 /* not fcntl */
13#define O_EXCL 0200 /* not fcntl */
14#define O_NOCTTY 0400 /* not fcntl */
15#define O_TRUNC 01000 /* not fcntl */
16#define O_APPEND 02000
17#define O_NONBLOCK 04000
18#define O_NDELAY O_NONBLOCK
19#define O_SYNC 010000
20#define FASYNC 020000 /* fcntl, for BSD compatibility */
21#define O_DIRECT 040000 /* direct disk access hint - currently ignored */
22#define O_LARGEFILE 0100000
23#define O_DIRECTORY 0200000 /* must be a directory */
24#define O_NOFOLLOW 0400000 /* don't follow links */
25#define O_NOATIME 01000000
26
27#define F_DUPFD 0 /* dup */
28#define F_GETFD 1 /* get f_flags */
29#define F_SETFD 2 /* set f_flags */
30#define F_GETFL 3 /* more flags (cloexec) */
31#define F_SETFL 4
32#define F_GETLK 5
33#define F_SETLK 6
34#define F_SETLKW 7
35
36#define F_SETOWN 8 /* for sockets. */
37#define F_GETOWN 9 /* for sockets. */
38#define F_SETSIG 10 /* for sockets. */
39#define F_GETSIG 11 /* for sockets. */
40
41#define F_GETLK64 12 /* using 'struct flock64' */
42#define F_SETLK64 13
43#define F_SETLKW64 14
44
45/* for F_[GET|SET]FL */
46#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
47
48/* for posix fcntl() and lockf() */
49#define F_RDLCK 0
50#define F_WRLCK 1
51#define F_UNLCK 2
52
53/* for old implementation of bsd flock () */
54#define F_EXLCK 4 /* or 3 */
55#define F_SHLCK 8 /* or 4 */
56
57/* for leases */
58#define F_INPROGRESS 16
59
60/* operations for bsd flock(), also used by the kernel implementation */
61#define LOCK_SH 1 /* shared lock */
62#define LOCK_EX 2 /* exclusive lock */
63#define LOCK_NB 4 /* or'd with one of the above to prevent
64 blocking */
65#define LOCK_UN 8 /* remove lock */
66
67#define LOCK_MAND 32 /* This is a mandatory flock */
68#define LOCK_READ 64 /* ... Which allows concurrent read operations */
69#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
70#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
71
72struct flock {
73 short l_type;
74 short l_whence;
75 off_t l_start;
76 off_t l_len;
77 pid_t l_pid;
78};
79
80struct flock64 {
81 short l_type;
82 short l_whence;
83 loff_t l_start;
84 loff_t l_len;
85 pid_t l_pid;
86};
87
88#define F_LINUX_SPECIFIC_BASE 1024
89
90#endif
diff --git a/include/asm-cris/futex.h b/include/asm-cris/futex.h
new file mode 100644
index 000000000000..2cac5ecd9d00
--- /dev/null
+++ b/include/asm-cris/futex.h
@@ -0,0 +1,53 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/uaccess.h>
9
10static inline int
11futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
12{
13 int op = (encoded_op >> 28) & 7;
14 int cmp = (encoded_op >> 24) & 15;
15 int oparg = (encoded_op << 8) >> 20;
16 int cmparg = (encoded_op << 20) >> 20;
17 int oldval = 0, ret, tem;
18 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
19 oparg = 1 << oparg;
20
21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
22 return -EFAULT;
23
24 inc_preempt_count();
25
26 switch (op) {
27 case FUTEX_OP_SET:
28 case FUTEX_OP_ADD:
29 case FUTEX_OP_OR:
30 case FUTEX_OP_ANDN:
31 case FUTEX_OP_XOR:
32 default:
33 ret = -ENOSYS;
34 }
35
36 dec_preempt_count();
37
38 if (!ret) {
39 switch (cmp) {
40 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
41 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
42 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
43 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
44 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
45 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
46 default: ret = -ENOSYS;
47 }
48 }
49 return ret;
50}
51
52#endif
53#endif
diff --git a/include/asm-cris/irq.h b/include/asm-cris/irq.h
index 8e787fdaedd4..4fab5c3b2e15 100644
--- a/include/asm-cris/irq.h
+++ b/include/asm-cris/irq.h
@@ -1,6 +1,11 @@
1#ifndef _ASM_IRQ_H 1#ifndef _ASM_IRQ_H
2#define _ASM_IRQ_H 2#define _ASM_IRQ_H
3 3
4/*
5 * IRQ line status macro IRQ_PER_CPU is used
6 */
7#define ARCH_HAS_IRQ_PER_CPU
8
4#include <asm/arch/irq.h> 9#include <asm/arch/irq.h>
5 10
6extern __inline__ int irq_canonicalize(int irq) 11extern __inline__ int irq_canonicalize(int irq)
diff --git a/include/asm-cris/page.h b/include/asm-cris/page.h
index bbf17bd39385..c99c478c482f 100644
--- a/include/asm-cris/page.h
+++ b/include/asm-cris/page.h
@@ -70,19 +70,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
70 70
71#ifndef __ASSEMBLY__ 71#ifndef __ASSEMBLY__
72 72
73/* Pure 2^n version of get_order */
74static inline int get_order(unsigned long size)
75{
76 int order;
77
78 size = (size-1) >> (PAGE_SHIFT-1);
79 order = -1;
80 do {
81 size >>= 1;
82 order++;
83 } while (size);
84 return order;
85}
86#endif /* __ASSEMBLY__ */ 73#endif /* __ASSEMBLY__ */
87 74
88#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ 75#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
@@ -90,5 +77,7 @@ static inline int get_order(unsigned long size)
90 77
91#endif /* __KERNEL__ */ 78#endif /* __KERNEL__ */
92 79
80#include <asm-generic/page.h>
81
93#endif /* _CRIS_PAGE_H */ 82#endif /* _CRIS_PAGE_H */
94 83
diff --git a/include/asm-cris/types.h b/include/asm-cris/types.h
index 8fa6d6c7afce..84557c9bac93 100644
--- a/include/asm-cris/types.h
+++ b/include/asm-cris/types.h
@@ -52,8 +52,6 @@ typedef unsigned long long u64;
52typedef u32 dma_addr_t; 52typedef u32 dma_addr_t;
53typedef u32 dma64_addr_t; 53typedef u32 dma64_addr_t;
54 54
55typedef unsigned short kmem_bufctl_t;
56
57#endif /* __ASSEMBLY__ */ 55#endif /* __ASSEMBLY__ */
58 56
59#endif /* __KERNEL__ */ 57#endif /* __KERNEL__ */
diff --git a/include/asm-cris/uaccess.h b/include/asm-cris/uaccess.h
index 6db17221fd9e..7d50086eb5ea 100644
--- a/include/asm-cris/uaccess.h
+++ b/include/asm-cris/uaccess.h
@@ -91,13 +91,6 @@
91#define __access_ok(addr,size) (__kernel_ok || __user_ok((addr),(size))) 91#define __access_ok(addr,size) (__kernel_ok || __user_ok((addr),(size)))
92#define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size)) 92#define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size))
93 93
94/* this function will go away soon - use access_ok() instead */
95extern inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size)
96{
97 return access_ok(type,addr,size) ? 0 : -EFAULT;
98}
99
100
101#include <asm/arch/uaccess.h> 94#include <asm/arch/uaccess.h>
102 95
103/* 96/*
diff --git a/include/asm-frv/auxvec.h b/include/asm-frv/auxvec.h
new file mode 100644
index 000000000000..07710778fa10
--- /dev/null
+++ b/include/asm-frv/auxvec.h
@@ -0,0 +1,4 @@
1#ifndef __FRV_AUXVEC_H
2#define __FRV_AUXVEC_H
3
4#endif
diff --git a/include/asm-frv/fcntl.h b/include/asm-frv/fcntl.h
index d61b999f9973..46ab12db5739 100644
--- a/include/asm-frv/fcntl.h
+++ b/include/asm-frv/fcntl.h
@@ -1,88 +1 @@
1#ifndef _ASM_FCNTL_H #include <asm-generic/fcntl.h>
2#define _ASM_FCNTL_H
3
4/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
5 located on an ext2 file system */
6#define O_ACCMODE 0003
7#define O_RDONLY 00
8#define O_WRONLY 01
9#define O_RDWR 02
10#define O_CREAT 0100 /* not fcntl */
11#define O_EXCL 0200 /* not fcntl */
12#define O_NOCTTY 0400 /* not fcntl */
13#define O_TRUNC 01000 /* not fcntl */
14#define O_APPEND 02000
15#define O_NONBLOCK 04000
16#define O_NDELAY O_NONBLOCK
17#define O_SYNC 010000
18#define FASYNC 020000 /* fcntl, for BSD compatibility */
19#define O_DIRECT 040000 /* direct disk access hint */
20#define O_LARGEFILE 0100000
21#define O_DIRECTORY 0200000 /* must be a directory */
22#define O_NOFOLLOW 0400000 /* don't follow links */
23#define O_NOATIME 01000000
24
25#define F_DUPFD 0 /* dup */
26#define F_GETFD 1 /* get close_on_exec */
27#define F_SETFD 2 /* set/clear close_on_exec */
28#define F_GETFL 3 /* get file->f_flags */
29#define F_SETFL 4 /* set file->f_flags */
30#define F_GETLK 5
31#define F_SETLK 6
32#define F_SETLKW 7
33
34#define F_SETOWN 8 /* for sockets. */
35#define F_GETOWN 9 /* for sockets. */
36#define F_SETSIG 10 /* for sockets. */
37#define F_GETSIG 11 /* for sockets. */
38
39#define F_GETLK64 12 /* using 'struct flock64' */
40#define F_SETLK64 13
41#define F_SETLKW64 14
42
43/* for F_[GET|SET]FL */
44#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
45
46/* for posix fcntl() and lockf() */
47#define F_RDLCK 0
48#define F_WRLCK 1
49#define F_UNLCK 2
50
51/* for old implementation of bsd flock () */
52#define F_EXLCK 4 /* or 3 */
53#define F_SHLCK 8 /* or 4 */
54
55/* for leases */
56#define F_INPROGRESS 16
57
58/* operations for bsd flock(), also used by the kernel implementation */
59#define LOCK_SH 1 /* shared lock */
60#define LOCK_EX 2 /* exclusive lock */
61#define LOCK_NB 4 /* or'd with one of the above to prevent
62 blocking */
63#define LOCK_UN 8 /* remove lock */
64
65#define LOCK_MAND 32 /* This is a mandatory flock */
66#define LOCK_READ 64 /* ... Which allows concurrent read operations */
67#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
68#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
69
70struct flock {
71 short l_type;
72 short l_whence;
73 off_t l_start;
74 off_t l_len;
75 pid_t l_pid;
76};
77
78struct flock64 {
79 short l_type;
80 short l_whence;
81 loff_t l_start;
82 loff_t l_len;
83 pid_t l_pid;
84};
85
86#define F_LINUX_SPECIFIC_BASE 1024
87#endif /* _ASM_FCNTL_H */
88
diff --git a/include/asm-frv/futex.h b/include/asm-frv/futex.h
new file mode 100644
index 000000000000..2cac5ecd9d00
--- /dev/null
+++ b/include/asm-frv/futex.h
@@ -0,0 +1,53 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/uaccess.h>
9
10static inline int
11futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
12{
13 int op = (encoded_op >> 28) & 7;
14 int cmp = (encoded_op >> 24) & 15;
15 int oparg = (encoded_op << 8) >> 20;
16 int cmparg = (encoded_op << 20) >> 20;
17 int oldval = 0, ret, tem;
18 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
19 oparg = 1 << oparg;
20
21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
22 return -EFAULT;
23
24 inc_preempt_count();
25
26 switch (op) {
27 case FUTEX_OP_SET:
28 case FUTEX_OP_ADD:
29 case FUTEX_OP_OR:
30 case FUTEX_OP_ANDN:
31 case FUTEX_OP_XOR:
32 default:
33 ret = -ENOSYS;
34 }
35
36 dec_preempt_count();
37
38 if (!ret) {
39 switch (cmp) {
40 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
41 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
42 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
43 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
44 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
45 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
46 default: ret = -ENOSYS;
47 }
48 }
49 return ret;
50}
51
52#endif
53#endif
diff --git a/include/asm-frv/page.h b/include/asm-frv/page.h
index f7914f1782b0..4feba567e7fd 100644
--- a/include/asm-frv/page.h
+++ b/include/asm-frv/page.h
@@ -45,21 +45,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
45/* to align the pointer to the (next) page boundary */ 45/* to align the pointer to the (next) page boundary */
46#define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) 46#define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK)
47 47
48/* Pure 2^n version of get_order */
49static inline int get_order(unsigned long size) __attribute_const__;
50static inline int get_order(unsigned long size)
51{
52 int order;
53
54 size = (size - 1) >> (PAGE_SHIFT - 1);
55 order = -1;
56 do {
57 size >>= 1;
58 order++;
59 } while (size);
60 return order;
61}
62
63#define devmem_is_allowed(pfn) 1 48#define devmem_is_allowed(pfn) 1
64 49
65#define __pa(vaddr) virt_to_phys((void *) vaddr) 50#define __pa(vaddr) virt_to_phys((void *) vaddr)
@@ -102,4 +87,6 @@ extern unsigned long max_pfn;
102#define WANT_PAGE_VIRTUAL 1 87#define WANT_PAGE_VIRTUAL 1
103#endif 88#endif
104 89
90#include <asm-generic/page.h>
91
105#endif /* _ASM_PAGE_H */ 92#endif /* _ASM_PAGE_H */
diff --git a/include/asm-frv/types.h b/include/asm-frv/types.h
index 1a5b6546bb41..50605df6d8ac 100644
--- a/include/asm-frv/types.h
+++ b/include/asm-frv/types.h
@@ -65,8 +65,6 @@ typedef u64 u_quad_t;
65 65
66typedef u32 dma_addr_t; 66typedef u32 dma_addr_t;
67 67
68typedef unsigned short kmem_bufctl_t;
69
70#endif /* __ASSEMBLY__ */ 68#endif /* __ASSEMBLY__ */
71 69
72#endif /* __KERNEL__ */ 70#endif /* __KERNEL__ */
diff --git a/include/asm-frv/uaccess.h b/include/asm-frv/uaccess.h
index 32dc52e883e5..991b50fbba24 100644
--- a/include/asm-frv/uaccess.h
+++ b/include/asm-frv/uaccess.h
@@ -67,12 +67,6 @@ static inline int ___range_ok(unsigned long addr, unsigned long size)
67#define access_ok(type,addr,size) (__range_ok((addr), (size)) == 0) 67#define access_ok(type,addr,size) (__range_ok((addr), (size)) == 0)
68#define __access_ok(addr,size) (__range_ok((addr), (size)) == 0) 68#define __access_ok(addr,size) (__range_ok((addr), (size)) == 0)
69 69
70/* this function will go away soon - use access_ok() / __range_ok() instead */
71static inline int __deprecated verify_area(int type, const void * addr, unsigned long size)
72{
73 return __range_ok(addr, size);
74}
75
76/* 70/*
77 * The exception table consists of pairs of addresses: the first is the 71 * The exception table consists of pairs of addresses: the first is the
78 * address of an instruction that is allowed to fault, and the second is 72 * address of an instruction that is allowed to fault, and the second is
diff --git a/include/asm-generic/fcntl.h b/include/asm-generic/fcntl.h
new file mode 100644
index 000000000000..b663520dcdc4
--- /dev/null
+++ b/include/asm-generic/fcntl.h
@@ -0,0 +1,149 @@
1#ifndef _ASM_GENERIC_FCNTL_H
2#define _ASM_GENERIC_FCNTL_H
3
4#include <linux/config.h>
5#include <linux/types.h>
6
7/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
8 located on an ext2 file system */
9#define O_ACCMODE 00000003
10#define O_RDONLY 00000000
11#define O_WRONLY 00000001
12#define O_RDWR 00000002
13#ifndef O_CREAT
14#define O_CREAT 00000100 /* not fcntl */
15#endif
16#ifndef O_EXCL
17#define O_EXCL 00000200 /* not fcntl */
18#endif
19#ifndef O_NOCTTY
20#define O_NOCTTY 00000400 /* not fcntl */
21#endif
22#ifndef O_TRUNC
23#define O_TRUNC 00001000 /* not fcntl */
24#endif
25#ifndef O_APPEND
26#define O_APPEND 00002000
27#endif
28#ifndef O_NONBLOCK
29#define O_NONBLOCK 00004000
30#endif
31#ifndef O_SYNC
32#define O_SYNC 00010000
33#endif
34#ifndef FASYNC
35#define FASYNC 00020000 /* fcntl, for BSD compatibility */
36#endif
37#ifndef O_DIRECT
38#define O_DIRECT 00040000 /* direct disk access hint */
39#endif
40#ifndef O_LARGEFILE
41#define O_LARGEFILE 00100000
42#endif
43#ifndef O_DIRECTORY
44#define O_DIRECTORY 00200000 /* must be a directory */
45#endif
46#ifndef O_NOFOLLOW
47#define O_NOFOLLOW 00400000 /* don't follow links */
48#endif
49#ifndef O_NOATIME
50#define O_NOATIME 01000000
51#endif
52#ifndef O_NDELAY
53#define O_NDELAY O_NONBLOCK
54#endif
55
56#define F_DUPFD 0 /* dup */
57#define F_GETFD 1 /* get close_on_exec */
58#define F_SETFD 2 /* set/clear close_on_exec */
59#define F_GETFL 3 /* get file->f_flags */
60#define F_SETFL 4 /* set file->f_flags */
61#ifndef F_GETLK
62#define F_GETLK 5
63#define F_SETLK 6
64#define F_SETLKW 7
65#endif
66#ifndef F_SETOWN
67#define F_SETOWN 8 /* for sockets. */
68#define F_GETOWN 9 /* for sockets. */
69#endif
70#ifndef F_SETSIG
71#define F_SETSIG 10 /* for sockets. */
72#define F_GETSIG 11 /* for sockets. */
73#endif
74
75/* for F_[GET|SET]FL */
76#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
77
78/* for posix fcntl() and lockf() */
79#ifndef F_RDLCK
80#define F_RDLCK 0
81#define F_WRLCK 1
82#define F_UNLCK 2
83#endif
84
85/* for old implementation of bsd flock () */
86#ifndef F_EXLCK
87#define F_EXLCK 4 /* or 3 */
88#define F_SHLCK 8 /* or 4 */
89#endif
90
91/* for leases */
92#ifndef F_INPROGRESS
93#define F_INPROGRESS 16
94#endif
95
96/* operations for bsd flock(), also used by the kernel implementation */
97#define LOCK_SH 1 /* shared lock */
98#define LOCK_EX 2 /* exclusive lock */
99#define LOCK_NB 4 /* or'd with one of the above to prevent
100 blocking */
101#define LOCK_UN 8 /* remove lock */
102
103#define LOCK_MAND 32 /* This is a mandatory flock ... */
104#define LOCK_READ 64 /* which allows concurrent read operations */
105#define LOCK_WRITE 128 /* which allows concurrent write operations */
106#define LOCK_RW 192 /* which allows concurrent read & write ops */
107
108#define F_LINUX_SPECIFIC_BASE 1024
109
110#ifndef HAVE_ARCH_STRUCT_FLOCK
111#ifndef __ARCH_FLOCK_PAD
112#define __ARCH_FLOCK_PAD
113#endif
114
115struct flock {
116 short l_type;
117 short l_whence;
118 off_t l_start;
119 off_t l_len;
120 pid_t l_pid;
121 __ARCH_FLOCK_PAD
122};
123#endif
124
125#ifndef CONFIG_64BIT
126
127#ifndef F_GETLK64
128#define F_GETLK64 12 /* using 'struct flock64' */
129#define F_SETLK64 13
130#define F_SETLKW64 14
131#endif
132
133#ifndef HAVE_ARCH_STRUCT_FLOCK64
134#ifndef __ARCH_FLOCK64_PAD
135#define __ARCH_FLOCK64_PAD
136#endif
137
138struct flock64 {
139 short l_type;
140 short l_whence;
141 loff_t l_start;
142 loff_t l_len;
143 pid_t l_pid;
144 __ARCH_FLOCK64_PAD
145};
146#endif
147#endif /* !CONFIG_64BIT */
148
149#endif /* _ASM_GENERIC_FCNTL_H */
diff --git a/include/asm-generic/hdreg.h b/include/asm-generic/hdreg.h
deleted file mode 100644
index 7051fba8bcf9..000000000000
--- a/include/asm-generic/hdreg.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#warning <asm/hdreg.h> is obsolete, please do not use it
2
3#ifndef __ASM_GENERIC_HDREG_H
4#define __ASM_GENERIC_HDREG_H
5
6typedef unsigned long ide_ioreg_t;
7
8#endif /* __ASM_GENERIC_HDREG_H */
diff --git a/include/asm-generic/page.h b/include/asm-generic/page.h
new file mode 100644
index 000000000000..a96b5d986b6e
--- /dev/null
+++ b/include/asm-generic/page.h
@@ -0,0 +1,26 @@
1#ifndef _ASM_GENERIC_PAGE_H
2#define _ASM_GENERIC_PAGE_H
3
4#ifdef __KERNEL__
5#ifndef __ASSEMBLY__
6
7#include <linux/compiler.h>
8
9/* Pure 2^n version of get_order */
10static __inline__ __attribute_const__ int get_order(unsigned long size)
11{
12 int order;
13
14 size = (size - 1) >> (PAGE_SHIFT - 1);
15 order = -1;
16 do {
17 size >>= 1;
18 order++;
19 } while (size);
20 return order;
21}
22
23#endif /* __ASSEMBLY__ */
24#endif /* __KERNEL__ */
25
26#endif /* _ASM_GENERIC_PAGE_H */
diff --git a/include/asm-generic/pci.h b/include/asm-generic/pci.h
index ee1d8b5d8168..c36a77d3bf44 100644
--- a/include/asm-generic/pci.h
+++ b/include/asm-generic/pci.h
@@ -30,6 +30,19 @@ pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
30 res->end = region->end; 30 res->end = region->end;
31} 31}
32 32
33static inline struct resource *
34pcibios_select_root(struct pci_dev *pdev, struct resource *res)
35{
36 struct resource *root = NULL;
37
38 if (res->flags & IORESOURCE_IO)
39 root = &ioport_resource;
40 if (res->flags & IORESOURCE_MEM)
41 root = &iomem_resource;
42
43 return root;
44}
45
33#define pcibios_scan_all_fns(a, b) 0 46#define pcibios_scan_all_fns(a, b) 0
34 47
35#ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ 48#ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index f40593565173..f86c1e549466 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -101,6 +101,22 @@ do { \
101}) 101})
102#endif 102#endif
103 103
104#ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL
105#define ptep_get_and_clear_full(__mm, __address, __ptep, __full) \
106({ \
107 pte_t __pte; \
108 __pte = ptep_get_and_clear((__mm), (__address), (__ptep)); \
109 __pte; \
110})
111#endif
112
113#ifndef __HAVE_ARCH_PTE_CLEAR_FULL
114#define pte_clear_full(__mm, __address, __ptep, __full) \
115do { \
116 pte_clear((__mm), (__address), (__ptep)); \
117} while (0)
118#endif
119
104#ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH 120#ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH
105#define ptep_clear_flush(__vma, __address, __ptep) \ 121#define ptep_clear_flush(__vma, __address, __ptep) \
106({ \ 122({ \
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index 450eae22c39a..886dbd116899 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -12,5 +12,6 @@ extern char _sextratext[] __attribute__((weak));
12extern char _eextratext[] __attribute__((weak)); 12extern char _eextratext[] __attribute__((weak));
13extern char _end[]; 13extern char _end[];
14extern char __per_cpu_start[], __per_cpu_end[]; 14extern char __per_cpu_start[], __per_cpu_end[];
15extern char __kprobes_text_start[], __kprobes_text_end[];
15 16
16#endif /* _ASM_GENERIC_SECTIONS_H_ */ 17#endif /* _ASM_GENERIC_SECTIONS_H_ */
diff --git a/include/asm-generic/unaligned.h b/include/asm-generic/unaligned.h
index 6c90f0f36eec..4dc8ddb401c1 100644
--- a/include/asm-generic/unaligned.h
+++ b/include/asm-generic/unaligned.h
@@ -16,9 +16,9 @@
16 * The main single-value unaligned transfer routines. 16 * The main single-value unaligned transfer routines.
17 */ 17 */
18#define get_unaligned(ptr) \ 18#define get_unaligned(ptr) \
19 ((__typeof__(*(ptr)))__get_unaligned((ptr), sizeof(*(ptr)))) 19 __get_unaligned((ptr), sizeof(*(ptr)))
20#define put_unaligned(x,ptr) \ 20#define put_unaligned(x,ptr) \
21 __put_unaligned((unsigned long)(x), (ptr), sizeof(*(ptr))) 21 __put_unaligned((__u64)(x), (ptr), sizeof(*(ptr)))
22 22
23/* 23/*
24 * This function doesn't actually exist. The idea is that when 24 * This function doesn't actually exist. The idea is that when
@@ -36,19 +36,19 @@ struct __una_u16 { __u16 x __attribute__((packed)); };
36 * Elemental unaligned loads 36 * Elemental unaligned loads
37 */ 37 */
38 38
39static inline unsigned long __uldq(const __u64 *addr) 39static inline __u64 __uldq(const __u64 *addr)
40{ 40{
41 const struct __una_u64 *ptr = (const struct __una_u64 *) addr; 41 const struct __una_u64 *ptr = (const struct __una_u64 *) addr;
42 return ptr->x; 42 return ptr->x;
43} 43}
44 44
45static inline unsigned long __uldl(const __u32 *addr) 45static inline __u32 __uldl(const __u32 *addr)
46{ 46{
47 const struct __una_u32 *ptr = (const struct __una_u32 *) addr; 47 const struct __una_u32 *ptr = (const struct __una_u32 *) addr;
48 return ptr->x; 48 return ptr->x;
49} 49}
50 50
51static inline unsigned long __uldw(const __u16 *addr) 51static inline __u16 __uldw(const __u16 *addr)
52{ 52{
53 const struct __una_u16 *ptr = (const struct __una_u16 *) addr; 53 const struct __una_u16 *ptr = (const struct __una_u16 *) addr;
54 return ptr->x; 54 return ptr->x;
@@ -78,7 +78,7 @@ static inline void __ustw(__u16 val, __u16 *addr)
78 78
79#define __get_unaligned(ptr, size) ({ \ 79#define __get_unaligned(ptr, size) ({ \
80 const void *__gu_p = ptr; \ 80 const void *__gu_p = ptr; \
81 unsigned long val; \ 81 __typeof__(*(ptr)) val; \
82 switch (size) { \ 82 switch (size) { \
83 case 1: \ 83 case 1: \
84 val = *(const __u8 *)__gu_p; \ 84 val = *(const __u8 *)__gu_p; \
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index b3bb326ae5b6..6f857be2b644 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -6,6 +6,9 @@
6#define VMLINUX_SYMBOL(_sym_) _sym_ 6#define VMLINUX_SYMBOL(_sym_) _sym_
7#endif 7#endif
8 8
9/* Align . to a 8 byte boundary equals to maximum function alignment. */
10#define ALIGN_FUNCTION() . = ALIGN(8)
11
9#define RODATA \ 12#define RODATA \
10 .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ 13 .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
11 *(.rodata) *(.rodata.*) \ 14 *(.rodata) *(.rodata.*) \
@@ -79,12 +82,24 @@
79 VMLINUX_SYMBOL(__security_initcall_end) = .; \ 82 VMLINUX_SYMBOL(__security_initcall_end) = .; \
80 } 83 }
81 84
85/* sched.text is aling to function alignment to secure we have same
86 * address even at second ld pass when generating System.map */
82#define SCHED_TEXT \ 87#define SCHED_TEXT \
88 ALIGN_FUNCTION(); \
83 VMLINUX_SYMBOL(__sched_text_start) = .; \ 89 VMLINUX_SYMBOL(__sched_text_start) = .; \
84 *(.sched.text) \ 90 *(.sched.text) \
85 VMLINUX_SYMBOL(__sched_text_end) = .; 91 VMLINUX_SYMBOL(__sched_text_end) = .;
86 92
93/* spinlock.text is aling to function alignment to secure we have same
94 * address even at second ld pass when generating System.map */
87#define LOCK_TEXT \ 95#define LOCK_TEXT \
96 ALIGN_FUNCTION(); \
88 VMLINUX_SYMBOL(__lock_text_start) = .; \ 97 VMLINUX_SYMBOL(__lock_text_start) = .; \
89 *(.spinlock.text) \ 98 *(.spinlock.text) \
90 VMLINUX_SYMBOL(__lock_text_end) = .; 99 VMLINUX_SYMBOL(__lock_text_end) = .;
100
101#define KPROBES_TEXT \
102 ALIGN_FUNCTION(); \
103 VMLINUX_SYMBOL(__kprobes_text_start) = .; \
104 *(.kprobes.text) \
105 VMLINUX_SYMBOL(__kprobes_text_end) = .;
diff --git a/include/asm-h8300/auxvec.h b/include/asm-h8300/auxvec.h
new file mode 100644
index 000000000000..1d36fe38b088
--- /dev/null
+++ b/include/asm-h8300/auxvec.h
@@ -0,0 +1,4 @@
1#ifndef __ASMH8300_AUXVEC_H
2#define __ASMH8300_AUXVEC_H
3
4#endif
diff --git a/include/asm-h8300/fcntl.h b/include/asm-h8300/fcntl.h
index 355350a57bf9..1952cb2e3b06 100644
--- a/include/asm-h8300/fcntl.h
+++ b/include/asm-h8300/fcntl.h
@@ -1,87 +1,11 @@
1#ifndef _H8300_FCNTL_H 1#ifndef _H8300_FCNTL_H
2#define _H8300_FCNTL_H 2#define _H8300_FCNTL_H
3 3
4/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
5 located on an ext2 file system */
6#define O_ACCMODE 0003
7#define O_RDONLY 00
8#define O_WRONLY 01
9#define O_RDWR 02
10#define O_CREAT 0100 /* not fcntl */
11#define O_EXCL 0200 /* not fcntl */
12#define O_NOCTTY 0400 /* not fcntl */
13#define O_TRUNC 01000 /* not fcntl */
14#define O_APPEND 02000
15#define O_NONBLOCK 04000
16#define O_NDELAY O_NONBLOCK
17#define O_SYNC 010000
18#define FASYNC 020000 /* fcntl, for BSD compatibility */
19#define O_DIRECTORY 040000 /* must be a directory */ 4#define O_DIRECTORY 040000 /* must be a directory */
20#define O_NOFOLLOW 0100000 /* don't follow links */ 5#define O_NOFOLLOW 0100000 /* don't follow links */
21#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */ 6#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
22#define O_LARGEFILE 0400000 7#define O_LARGEFILE 0400000
23#define O_NOATIME 01000000
24 8
25#define F_DUPFD 0 /* dup */ 9#include <asm-generic/fcntl.h>
26#define F_GETFD 1 /* get close_on_exec */
27#define F_SETFD 2 /* set/clear close_on_exec */
28#define F_GETFL 3 /* get file->f_flags */
29#define F_SETFL 4 /* set file->f_flags */
30#define F_GETLK 5
31#define F_SETLK 6
32#define F_SETLKW 7
33 10
34#define F_SETOWN 8 /* for sockets. */
35#define F_GETOWN 9 /* for sockets. */
36#define F_SETSIG 10 /* for sockets. */
37#define F_GETSIG 11 /* for sockets. */
38
39#define F_GETLK64 12 /* using 'struct flock64' */
40#define F_SETLK64 13
41#define F_SETLKW64 14
42
43/* for F_[GET|SET]FL */
44#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
45
46/* for posix fcntl() and lockf() */
47#define F_RDLCK 0
48#define F_WRLCK 1
49#define F_UNLCK 2
50
51/* for old implementation of bsd flock () */
52#define F_EXLCK 4 /* or 3 */
53#define F_SHLCK 8 /* or 4 */
54
55/* for leases */
56#define F_INPROGRESS 16
57
58/* operations for bsd flock(), also used by the kernel implementation */
59#define LOCK_SH 1 /* shared lock */
60#define LOCK_EX 2 /* exclusive lock */
61#define LOCK_NB 4 /* or'd with one of the above to prevent
62 blocking */
63#define LOCK_UN 8 /* remove lock */
64
65#define LOCK_MAND 32 /* This is a mandatory flock */
66#define LOCK_READ 64 /* ... Which allows concurrent read operations */
67#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
68#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
69
70struct flock {
71 short l_type;
72 short l_whence;
73 off_t l_start;
74 off_t l_len;
75 pid_t l_pid;
76};
77
78struct flock64 {
79 short l_type;
80 short l_whence;
81 loff_t l_start;
82 loff_t l_len;
83 pid_t l_pid;
84};
85
86#define F_LINUX_SPECIFIC_BASE 1024
87#endif /* _H8300_FCNTL_H */ 11#endif /* _H8300_FCNTL_H */
diff --git a/include/asm-h8300/futex.h b/include/asm-h8300/futex.h
new file mode 100644
index 000000000000..2cac5ecd9d00
--- /dev/null
+++ b/include/asm-h8300/futex.h
@@ -0,0 +1,53 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/uaccess.h>
9
10static inline int
11futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
12{
13 int op = (encoded_op >> 28) & 7;
14 int cmp = (encoded_op >> 24) & 15;
15 int oparg = (encoded_op << 8) >> 20;
16 int cmparg = (encoded_op << 20) >> 20;
17 int oldval = 0, ret, tem;
18 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
19 oparg = 1 << oparg;
20
21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
22 return -EFAULT;
23
24 inc_preempt_count();
25
26 switch (op) {
27 case FUTEX_OP_SET:
28 case FUTEX_OP_ADD:
29 case FUTEX_OP_OR:
30 case FUTEX_OP_ANDN:
31 case FUTEX_OP_XOR:
32 default:
33 ret = -ENOSYS;
34 }
35
36 dec_preempt_count();
37
38 if (!ret) {
39 switch (cmp) {
40 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
41 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
42 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
43 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
44 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
45 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
46 default: ret = -ENOSYS;
47 }
48 }
49 return ret;
50}
51
52#endif
53#endif
diff --git a/include/asm-h8300/hdreg.h b/include/asm-h8300/hdreg.h
deleted file mode 100644
index 36d0c06687d8..000000000000
--- a/include/asm-h8300/hdreg.h
+++ /dev/null
@@ -1,15 +0,0 @@
1/*
2 * linux/include/asm-h8300/hdreg.h
3 *
4 * Copyright (C) 1994-1996 Linus Torvalds & authors
5 */
6
7#warning this file is obsolete, please do not use it
8
9#ifndef _H8300_HDREG_H
10#define _H8300_HDREG_H
11
12typedef unsigned int q40ide_ioreg_t;
13typedef unsigned char * ide_ioreg_t;
14
15#endif /* _H8300_HDREG_H */
diff --git a/include/asm-h8300/page.h b/include/asm-h8300/page.h
index e3b7960d445b..e8c02b8c2d99 100644
--- a/include/asm-h8300/page.h
+++ b/include/asm-h8300/page.h
@@ -54,20 +54,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
54/* to align the pointer to the (next) page boundary */ 54/* to align the pointer to the (next) page boundary */
55#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) 55#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
56 56
57/* Pure 2^n version of get_order */
58extern __inline__ int get_order(unsigned long size)
59{
60 int order;
61
62 size = (size-1) >> (PAGE_SHIFT-1);
63 order = -1;
64 do {
65 size >>= 1;
66 order++;
67 } while (size);
68 return order;
69}
70
71extern unsigned long memory_start; 57extern unsigned long memory_start;
72extern unsigned long memory_end; 58extern unsigned long memory_end;
73 59
@@ -101,4 +87,6 @@ extern unsigned long memory_end;
101 87
102#endif /* __KERNEL__ */ 88#endif /* __KERNEL__ */
103 89
90#include <asm-generic/page.h>
91
104#endif /* _H8300_PAGE_H */ 92#endif /* _H8300_PAGE_H */
diff --git a/include/asm-h8300/types.h b/include/asm-h8300/types.h
index 21f4fc07ac0e..bf91e0d4dde7 100644
--- a/include/asm-h8300/types.h
+++ b/include/asm-h8300/types.h
@@ -58,8 +58,6 @@ typedef u32 dma_addr_t;
58#define HAVE_SECTOR_T 58#define HAVE_SECTOR_T
59typedef u64 sector_t; 59typedef u64 sector_t;
60 60
61typedef unsigned int kmem_bufctl_t;
62
63#endif /* __KERNEL__ */ 61#endif /* __KERNEL__ */
64 62
65#endif /* __ASSEMBLY__ */ 63#endif /* __ASSEMBLY__ */
diff --git a/include/asm-h8300/uaccess.h b/include/asm-h8300/uaccess.h
index 1480f307a474..ebe58c6c8387 100644
--- a/include/asm-h8300/uaccess.h
+++ b/include/asm-h8300/uaccess.h
@@ -24,12 +24,6 @@ static inline int __access_ok(unsigned long addr, unsigned long size)
24 return(RANGE_CHECK_OK(addr, size, 0L, (unsigned long)&_ramend)); 24 return(RANGE_CHECK_OK(addr, size, 0L, (unsigned long)&_ramend));
25} 25}
26 26
27/* this function will go away soon - use access_ok() instead */
28static inline int __deprecated verify_area(int type, const void *addr, unsigned long size)
29{
30 return access_ok(type,addr,size)?0:-EFAULT;
31}
32
33/* 27/*
34 * The exception table consists of pairs of addresses: the first is the 28 * The exception table consists of pairs of addresses: the first is the
35 * address of an instruction that is allowed to fault, and the second is 29 * address of an instruction that is allowed to fault, and the second is
diff --git a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h
index cf828ace13f9..df4ed323aa4d 100644
--- a/include/asm-i386/acpi.h
+++ b/include/asm-i386/acpi.h
@@ -103,7 +103,7 @@ __acpi_release_global_lock (unsigned int *lock)
103 :"=r"(n_hi), "=r"(n_lo) \ 103 :"=r"(n_hi), "=r"(n_lo) \
104 :"0"(n_hi), "1"(n_lo)) 104 :"0"(n_hi), "1"(n_lo))
105 105
106#ifdef CONFIG_ACPI_BOOT 106#ifdef CONFIG_ACPI
107extern int acpi_lapic; 107extern int acpi_lapic;
108extern int acpi_ioapic; 108extern int acpi_ioapic;
109extern int acpi_noirq; 109extern int acpi_noirq;
@@ -146,13 +146,6 @@ static inline void check_acpi_pci(void) { }
146 146
147#endif 147#endif
148 148
149#else /* CONFIG_ACPI_BOOT */
150# define acpi_lapic 0
151# define acpi_ioapic 0
152
153#endif
154
155#ifdef CONFIG_ACPI_PCI
156static inline void acpi_noirq_set(void) { acpi_noirq = 1; } 149static inline void acpi_noirq_set(void) { acpi_noirq = 1; }
157static inline void acpi_disable_pci(void) 150static inline void acpi_disable_pci(void)
158{ 151{
@@ -160,11 +153,16 @@ static inline void acpi_disable_pci(void)
160 acpi_noirq_set(); 153 acpi_noirq_set();
161} 154}
162extern int acpi_irq_balance_set(char *str); 155extern int acpi_irq_balance_set(char *str);
163#else 156
157#else /* !CONFIG_ACPI */
158
159#define acpi_lapic 0
160#define acpi_ioapic 0
164static inline void acpi_noirq_set(void) { } 161static inline void acpi_noirq_set(void) { }
165static inline void acpi_disable_pci(void) { } 162static inline void acpi_disable_pci(void) { }
166static inline int acpi_irq_balance_set(char *str) { return 0; } 163
167#endif 164#endif /* !CONFIG_ACPI */
165
168 166
169#ifdef CONFIG_ACPI_SLEEP 167#ifdef CONFIG_ACPI_SLEEP
170 168
diff --git a/include/asm-i386/agp.h b/include/asm-i386/agp.h
index b82f5f3ab887..9075083bab76 100644
--- a/include/asm-i386/agp.h
+++ b/include/asm-i386/agp.h
@@ -19,7 +19,7 @@ int unmap_page_from_agp(struct page *page);
19/* Could use CLFLUSH here if the cpu supports it. But then it would 19/* Could use CLFLUSH here if the cpu supports it. But then it would
20 need to be called for each cacheline of the whole page so it may not be 20 need to be called for each cacheline of the whole page so it may not be
21 worth it. Would need a page for it. */ 21 worth it. Would need a page for it. */
22#define flush_agp_cache() asm volatile("wbinvd":::"memory") 22#define flush_agp_cache() wbinvd()
23 23
24/* Convert a physical address to an address suitable for the GART. */ 24/* Convert a physical address to an address suitable for the GART. */
25#define phys_to_gart(x) (x) 25#define phys_to_gart(x) (x)
diff --git a/include/asm-i386/apicdef.h b/include/asm-i386/apicdef.h
index a96a8f48fbfc..03185cef8e0a 100644
--- a/include/asm-i386/apicdef.h
+++ b/include/asm-i386/apicdef.h
@@ -16,6 +16,7 @@
16#define GET_APIC_VERSION(x) ((x)&0xFF) 16#define GET_APIC_VERSION(x) ((x)&0xFF)
17#define GET_APIC_MAXLVT(x) (((x)>>16)&0xFF) 17#define GET_APIC_MAXLVT(x) (((x)>>16)&0xFF)
18#define APIC_INTEGRATED(x) ((x)&0xF0) 18#define APIC_INTEGRATED(x) ((x)&0xF0)
19#define APIC_XAPIC(x) ((x) >= 0x14)
19#define APIC_TASKPRI 0x80 20#define APIC_TASKPRI 0x80
20#define APIC_TPRI_MASK 0xFF 21#define APIC_TPRI_MASK 0xFF
21#define APIC_ARBPRI 0x90 22#define APIC_ARBPRI 0x90
diff --git a/include/asm-i386/auxvec.h b/include/asm-i386/auxvec.h
new file mode 100644
index 000000000000..395e13016bfb
--- /dev/null
+++ b/include/asm-i386/auxvec.h
@@ -0,0 +1,11 @@
1#ifndef __ASMi386_AUXVEC_H
2#define __ASMi386_AUXVEC_H
3
4/*
5 * Architecture-neutral AT_ values in 0-17, leave some room
6 * for more of them, start the x86-specific ones at 32.
7 */
8#define AT_SYSINFO 32
9#define AT_SYSINFO_EHDR 33
10
11#endif
diff --git a/include/asm-i386/bugs.h b/include/asm-i386/bugs.h
index 6789fc275da3..ea54540638d2 100644
--- a/include/asm-i386/bugs.h
+++ b/include/asm-i386/bugs.h
@@ -118,7 +118,10 @@ static void __init check_hlt(void)
118 printk("disabled\n"); 118 printk("disabled\n");
119 return; 119 return;
120 } 120 }
121 __asm__ __volatile__("hlt ; hlt ; hlt ; hlt"); 121 halt();
122 halt();
123 halt();
124 halt();
122 printk("OK.\n"); 125 printk("OK.\n");
123} 126}
124 127
diff --git a/include/asm-i386/desc.h b/include/asm-i386/desc.h
index 11e67811a990..6df1a53c190e 100644
--- a/include/asm-i386/desc.h
+++ b/include/asm-i386/desc.h
@@ -27,8 +27,18 @@ struct Xgt_desc_struct {
27 27
28extern struct Xgt_desc_struct idt_descr, cpu_gdt_descr[NR_CPUS]; 28extern struct Xgt_desc_struct idt_descr, cpu_gdt_descr[NR_CPUS];
29 29
30#define load_TR_desc() __asm__ __volatile__("ltr %%ax"::"a" (GDT_ENTRY_TSS*8)) 30#define load_TR_desc() __asm__ __volatile__("ltr %w0"::"q" (GDT_ENTRY_TSS*8))
31#define load_LDT_desc() __asm__ __volatile__("lldt %%ax"::"a" (GDT_ENTRY_LDT*8)) 31#define load_LDT_desc() __asm__ __volatile__("lldt %w0"::"q" (GDT_ENTRY_LDT*8))
32
33#define load_gdt(dtr) __asm__ __volatile("lgdt %0"::"m" (*dtr))
34#define load_idt(dtr) __asm__ __volatile("lidt %0"::"m" (*dtr))
35#define load_tr(tr) __asm__ __volatile("ltr %0"::"mr" (tr))
36#define load_ldt(ldt) __asm__ __volatile("lldt %0"::"mr" (ldt))
37
38#define store_gdt(dtr) __asm__ ("sgdt %0":"=m" (*dtr))
39#define store_idt(dtr) __asm__ ("sidt %0":"=m" (*dtr))
40#define store_tr(tr) __asm__ ("str %0":"=mr" (tr))
41#define store_ldt(ldt) __asm__ ("sldt %0":"=mr" (ldt))
32 42
33/* 43/*
34 * This is the ldt that every process will get unless we need 44 * This is the ldt that every process will get unless we need
@@ -39,14 +49,14 @@ extern void set_intr_gate(unsigned int irq, void * addr);
39 49
40#define _set_tssldt_desc(n,addr,limit,type) \ 50#define _set_tssldt_desc(n,addr,limit,type) \
41__asm__ __volatile__ ("movw %w3,0(%2)\n\t" \ 51__asm__ __volatile__ ("movw %w3,0(%2)\n\t" \
42 "movw %%ax,2(%2)\n\t" \ 52 "movw %w1,2(%2)\n\t" \
43 "rorl $16,%%eax\n\t" \ 53 "rorl $16,%1\n\t" \
44 "movb %%al,4(%2)\n\t" \ 54 "movb %b1,4(%2)\n\t" \
45 "movb %4,5(%2)\n\t" \ 55 "movb %4,5(%2)\n\t" \
46 "movb $0,6(%2)\n\t" \ 56 "movb $0,6(%2)\n\t" \
47 "movb %%ah,7(%2)\n\t" \ 57 "movb %h1,7(%2)\n\t" \
48 "rorl $16,%%eax" \ 58 "rorl $16,%1" \
49 : "=m"(*(n)) : "a" (addr), "r"(n), "ir"(limit), "i"(type)) 59 : "=m"(*(n)) : "q" (addr), "r"(n), "ir"(limit), "i"(type))
50 60
51static inline void __set_tss_desc(unsigned int cpu, unsigned int entry, void *addr) 61static inline void __set_tss_desc(unsigned int cpu, unsigned int entry, void *addr)
52{ 62{
@@ -86,6 +96,13 @@ static inline void set_ldt_desc(unsigned int cpu, void *addr, unsigned int size)
86 (info)->seg_not_present == 1 && \ 96 (info)->seg_not_present == 1 && \
87 (info)->useable == 0 ) 97 (info)->useable == 0 )
88 98
99static inline void write_ldt_entry(void *ldt, int entry, __u32 entry_a, __u32 entry_b)
100{
101 __u32 *lp = (__u32 *)((char *)ldt + entry*8);
102 *lp = entry_a;
103 *(lp+1) = entry_b;
104}
105
89#if TLS_SIZE != 24 106#if TLS_SIZE != 24
90# error update this code. 107# error update this code.
91#endif 108#endif
diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h
index 130bdc8c68cf..fa11117d3cfa 100644
--- a/include/asm-i386/elf.h
+++ b/include/asm-i386/elf.h
@@ -9,6 +9,7 @@
9#include <asm/user.h> 9#include <asm/user.h>
10#include <asm/processor.h> 10#include <asm/processor.h>
11#include <asm/system.h> /* for savesegment */ 11#include <asm/system.h> /* for savesegment */
12#include <asm/auxvec.h>
12 13
13#include <linux/utsname.h> 14#include <linux/utsname.h>
14 15
@@ -109,13 +110,6 @@ typedef struct user_fxsr_struct elf_fpxregset_t;
109 110
110#define ELF_PLATFORM (system_utsname.machine) 111#define ELF_PLATFORM (system_utsname.machine)
111 112
112/*
113 * Architecture-neutral AT_ values in 0-17, leave some room
114 * for more of them, start the x86-specific ones at 32.
115 */
116#define AT_SYSINFO 32
117#define AT_SYSINFO_EHDR 33
118
119#ifdef __KERNEL__ 113#ifdef __KERNEL__
120#define SET_PERSONALITY(ex, ibcs2) do { } while (0) 114#define SET_PERSONALITY(ex, ibcs2) do { } while (0)
121 115
diff --git a/include/asm-i386/fcntl.h b/include/asm-i386/fcntl.h
index 511cde94a3ed..46ab12db5739 100644
--- a/include/asm-i386/fcntl.h
+++ b/include/asm-i386/fcntl.h
@@ -1,88 +1 @@
1#ifndef _I386_FCNTL_H #include <asm-generic/fcntl.h>
2#define _I386_FCNTL_H
3
4/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
5 located on an ext2 file system */
6#define O_ACCMODE 0003
7#define O_RDONLY 00
8#define O_WRONLY 01
9#define O_RDWR 02
10#define O_CREAT 0100 /* not fcntl */
11#define O_EXCL 0200 /* not fcntl */
12#define O_NOCTTY 0400 /* not fcntl */
13#define O_TRUNC 01000 /* not fcntl */
14#define O_APPEND 02000
15#define O_NONBLOCK 04000
16#define O_NDELAY O_NONBLOCK
17#define O_SYNC 010000
18#define FASYNC 020000 /* fcntl, for BSD compatibility */
19#define O_DIRECT 040000 /* direct disk access hint */
20#define O_LARGEFILE 0100000
21#define O_DIRECTORY 0200000 /* must be a directory */
22#define O_NOFOLLOW 0400000 /* don't follow links */
23#define O_NOATIME 01000000
24
25#define F_DUPFD 0 /* dup */
26#define F_GETFD 1 /* get close_on_exec */
27#define F_SETFD 2 /* set/clear close_on_exec */
28#define F_GETFL 3 /* get file->f_flags */
29#define F_SETFL 4 /* set file->f_flags */
30#define F_GETLK 5
31#define F_SETLK 6
32#define F_SETLKW 7
33
34#define F_SETOWN 8 /* for sockets. */
35#define F_GETOWN 9 /* for sockets. */
36#define F_SETSIG 10 /* for sockets. */
37#define F_GETSIG 11 /* for sockets. */
38
39#define F_GETLK64 12 /* using 'struct flock64' */
40#define F_SETLK64 13
41#define F_SETLKW64 14
42
43/* for F_[GET|SET]FL */
44#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
45
46/* for posix fcntl() and lockf() */
47#define F_RDLCK 0
48#define F_WRLCK 1
49#define F_UNLCK 2
50
51/* for old implementation of bsd flock () */
52#define F_EXLCK 4 /* or 3 */
53#define F_SHLCK 8 /* or 4 */
54
55/* for leases */
56#define F_INPROGRESS 16
57
58/* operations for bsd flock(), also used by the kernel implementation */
59#define LOCK_SH 1 /* shared lock */
60#define LOCK_EX 2 /* exclusive lock */
61#define LOCK_NB 4 /* or'd with one of the above to prevent
62 blocking */
63#define LOCK_UN 8 /* remove lock */
64
65#define LOCK_MAND 32 /* This is a mandatory flock */
66#define LOCK_READ 64 /* ... Which allows concurrent read operations */
67#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
68#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
69
70struct flock {
71 short l_type;
72 short l_whence;
73 off_t l_start;
74 off_t l_len;
75 pid_t l_pid;
76};
77
78struct flock64 {
79 short l_type;
80 short l_whence;
81 loff_t l_start;
82 loff_t l_len;
83 pid_t l_pid;
84};
85
86#define F_LINUX_SPECIFIC_BASE 1024
87
88#endif
diff --git a/include/asm-i386/fixmap.h b/include/asm-i386/fixmap.h
index c94cac958389..cfb1c61d3b9c 100644
--- a/include/asm-i386/fixmap.h
+++ b/include/asm-i386/fixmap.h
@@ -76,7 +76,7 @@ enum fixed_addresses {
76 FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */ 76 FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
77 FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, 77 FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
78#endif 78#endif
79#ifdef CONFIG_ACPI_BOOT 79#ifdef CONFIG_ACPI
80 FIX_ACPI_BEGIN, 80 FIX_ACPI_BEGIN,
81 FIX_ACPI_END = FIX_ACPI_BEGIN + FIX_ACPI_PAGES - 1, 81 FIX_ACPI_END = FIX_ACPI_BEGIN + FIX_ACPI_PAGES - 1,
82#endif 82#endif
diff --git a/include/asm-i386/futex.h b/include/asm-i386/futex.h
new file mode 100644
index 000000000000..44b9db806474
--- /dev/null
+++ b/include/asm-i386/futex.h
@@ -0,0 +1,108 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/system.h>
9#include <asm/processor.h>
10#include <asm/uaccess.h>
11
12#define __futex_atomic_op1(insn, ret, oldval, uaddr, oparg) \
13 __asm__ __volatile ( \
14"1: " insn "\n" \
15"2: .section .fixup,\"ax\"\n\
163: mov %3, %1\n\
17 jmp 2b\n\
18 .previous\n\
19 .section __ex_table,\"a\"\n\
20 .align 8\n\
21 .long 1b,3b\n\
22 .previous" \
23 : "=r" (oldval), "=r" (ret), "=m" (*uaddr) \
24 : "i" (-EFAULT), "m" (*uaddr), "0" (oparg), "1" (0))
25
26#define __futex_atomic_op2(insn, ret, oldval, uaddr, oparg) \
27 __asm__ __volatile ( \
28"1: movl %2, %0\n\
29 movl %0, %3\n" \
30 insn "\n" \
31"2: " LOCK_PREFIX "cmpxchgl %3, %2\n\
32 jnz 1b\n\
333: .section .fixup,\"ax\"\n\
344: mov %5, %1\n\
35 jmp 3b\n\
36 .previous\n\
37 .section __ex_table,\"a\"\n\
38 .align 8\n\
39 .long 1b,4b,2b,4b\n\
40 .previous" \
41 : "=&a" (oldval), "=&r" (ret), "=m" (*uaddr), \
42 "=&r" (tem) \
43 : "r" (oparg), "i" (-EFAULT), "m" (*uaddr), "1" (0))
44
45static inline int
46futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
47{
48 int op = (encoded_op >> 28) & 7;
49 int cmp = (encoded_op >> 24) & 15;
50 int oparg = (encoded_op << 8) >> 20;
51 int cmparg = (encoded_op << 20) >> 20;
52 int oldval = 0, ret, tem;
53 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
54 oparg = 1 << oparg;
55
56 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
57 return -EFAULT;
58
59 inc_preempt_count();
60
61 if (op == FUTEX_OP_SET)
62 __futex_atomic_op1("xchgl %0, %2", ret, oldval, uaddr, oparg);
63 else {
64#ifndef CONFIG_X86_BSWAP
65 if (boot_cpu_data.x86 == 3)
66 ret = -ENOSYS;
67 else
68#endif
69 switch (op) {
70 case FUTEX_OP_ADD:
71 __futex_atomic_op1(LOCK_PREFIX "xaddl %0, %2", ret,
72 oldval, uaddr, oparg);
73 break;
74 case FUTEX_OP_OR:
75 __futex_atomic_op2("orl %4, %3", ret, oldval, uaddr,
76 oparg);
77 break;
78 case FUTEX_OP_ANDN:
79 __futex_atomic_op2("andl %4, %3", ret, oldval, uaddr,
80 ~oparg);
81 break;
82 case FUTEX_OP_XOR:
83 __futex_atomic_op2("xorl %4, %3", ret, oldval, uaddr,
84 oparg);
85 break;
86 default:
87 ret = -ENOSYS;
88 }
89 }
90
91 dec_preempt_count();
92
93 if (!ret) {
94 switch (cmp) {
95 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
96 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
97 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
98 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
99 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
100 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
101 default: ret = -ENOSYS;
102 }
103 }
104 return ret;
105}
106
107#endif
108#endif
diff --git a/include/asm-i386/hdreg.h b/include/asm-i386/hdreg.h
deleted file mode 100644
index 5989bbc97cbf..000000000000
--- a/include/asm-i386/hdreg.h
+++ /dev/null
@@ -1 +0,0 @@
1#warning this file is obsolete, please do not use it
diff --git a/include/asm-i386/io_apic.h b/include/asm-i386/io_apic.h
index 002c203ccd6a..51c4e5fe6062 100644
--- a/include/asm-i386/io_apic.h
+++ b/include/asm-i386/io_apic.h
@@ -195,12 +195,12 @@ extern int skip_ioapic_setup;
195 */ 195 */
196#define io_apic_assign_pci_irqs (mp_irq_entries && !skip_ioapic_setup && io_apic_irqs) 196#define io_apic_assign_pci_irqs (mp_irq_entries && !skip_ioapic_setup && io_apic_irqs)
197 197
198#ifdef CONFIG_ACPI_BOOT 198#ifdef CONFIG_ACPI
199extern int io_apic_get_unique_id (int ioapic, int apic_id); 199extern int io_apic_get_unique_id (int ioapic, int apic_id);
200extern int io_apic_get_version (int ioapic); 200extern int io_apic_get_version (int ioapic);
201extern int io_apic_get_redir_entries (int ioapic); 201extern int io_apic_get_redir_entries (int ioapic);
202extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int active_high_low); 202extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int active_high_low);
203#endif /*CONFIG_ACPI_BOOT*/ 203#endif /* CONFIG_ACPI */
204 204
205extern int (*ioapic_renumber_irq)(int ioapic, int irq); 205extern int (*ioapic_renumber_irq)(int ioapic, int irq);
206 206
diff --git a/include/asm-i386/kdebug.h b/include/asm-i386/kdebug.h
index b3f8d5f59d5d..316138e89910 100644
--- a/include/asm-i386/kdebug.h
+++ b/include/asm-i386/kdebug.h
@@ -41,9 +41,16 @@ enum die_val {
41 DIE_PAGE_FAULT, 41 DIE_PAGE_FAULT,
42}; 42};
43 43
44static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig) 44static inline int notify_die(enum die_val val, const char *str,
45 struct pt_regs *regs, long err, int trap, int sig)
45{ 46{
46 struct die_args args = { .regs=regs, .str=str, .err=err, .trapnr=trap,.signr=sig }; 47 struct die_args args = {
48 .regs = regs,
49 .str = str,
50 .err = err,
51 .trapnr = trap,
52 .signr = sig
53 };
47 return notifier_call_chain(&i386die_chain, val, &args); 54 return notifier_call_chain(&i386die_chain, val, &args);
48} 55}
49 56
diff --git a/include/asm-i386/mach-default/mach_reboot.h b/include/asm-i386/mach-default/mach_reboot.h
index 521e227db679..06ae4d81ba6a 100644
--- a/include/asm-i386/mach-default/mach_reboot.h
+++ b/include/asm-i386/mach-default/mach_reboot.h
@@ -22,7 +22,15 @@ static inline void mach_reboot(void)
22 for (i = 0; i < 100; i++) { 22 for (i = 0; i < 100; i++) {
23 kb_wait(); 23 kb_wait();
24 udelay(50); 24 udelay(50);
25 outb(0xfe, 0x64); /* pulse reset low */ 25 outb(0x60, 0x64); /* write Controller Command Byte */
26 udelay(50);
27 kb_wait();
28 udelay(50);
29 outb(0x14, 0x60); /* set "System flag" */
30 udelay(50);
31 kb_wait();
32 udelay(50);
33 outb(0xfe, 0x64); /* pulse reset low */
26 udelay(50); 34 udelay(50);
27 } 35 }
28} 36}
diff --git a/include/asm-i386/mach-es7000/mach_mpparse.h b/include/asm-i386/mach-es7000/mach_mpparse.h
index 85809e0898d7..28a84f6185a7 100644
--- a/include/asm-i386/mach-es7000/mach_mpparse.h
+++ b/include/asm-i386/mach-es7000/mach_mpparse.h
@@ -1,6 +1,8 @@
1#ifndef __ASM_MACH_MPPARSE_H 1#ifndef __ASM_MACH_MPPARSE_H
2#define __ASM_MACH_MPPARSE_H 2#define __ASM_MACH_MPPARSE_H
3 3
4#include <linux/acpi.h>
5
4static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name, 6static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name,
5 struct mpc_config_translation *translation) 7 struct mpc_config_translation *translation)
6{ 8{
@@ -12,8 +14,9 @@ static inline void mpc_oem_pci_bus(struct mpc_config_bus *m,
12{ 14{
13} 15}
14 16
15extern int parse_unisys_oem (char *oemptr, int oem_entries); 17extern int parse_unisys_oem (char *oemptr);
16extern int find_unisys_acpi_oem_table(unsigned long *oem_addr, int *length); 18extern int find_unisys_acpi_oem_table(unsigned long *oem_addr);
19extern void setup_unisys();
17 20
18static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, 21static inline int mps_oem_check(struct mp_config_table *mpc, char *oem,
19 char *productid) 22 char *productid)
@@ -22,18 +25,33 @@ static inline int mps_oem_check(struct mp_config_table *mpc, char *oem,
22 struct mp_config_oemtable *oem_table = 25 struct mp_config_oemtable *oem_table =
23 (struct mp_config_oemtable *)mpc->mpc_oemptr; 26 (struct mp_config_oemtable *)mpc->mpc_oemptr;
24 if (!strncmp(oem, "UNISYS", 6)) 27 if (!strncmp(oem, "UNISYS", 6))
25 return parse_unisys_oem((char *)oem_table, oem_table->oem_length); 28 return parse_unisys_oem((char *)oem_table);
26 } 29 }
27 return 0; 30 return 0;
28} 31}
29 32
33static inline int es7000_check_dsdt()
34{
35 struct acpi_table_header *header = NULL;
36 if(!acpi_get_table_header_early(ACPI_DSDT, &header))
37 acpi_table_print(header, 0);
38 if (!strncmp(header->oem_id, "UNISYS", 6))
39 return 1;
40 return 0;
41}
42
30/* Hook from generic ACPI tables.c */ 43/* Hook from generic ACPI tables.c */
31static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) 44static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id)
32{ 45{
33 unsigned long oem_addr; 46 unsigned long oem_addr;
34 int oem_entries; 47 if (!find_unisys_acpi_oem_table(&oem_addr)) {
35 if (!find_unisys_acpi_oem_table(&oem_addr, &oem_entries)) 48 if (es7000_check_dsdt())
36 return parse_unisys_oem((char *)oem_addr, oem_entries); 49 return parse_unisys_oem((char *)oem_addr);
50 else {
51 setup_unisys();
52 return 1;
53 }
54 }
37 return 0; 55 return 0;
38} 56}
39 57
diff --git a/include/asm-i386/mach-generic/mach_apic.h b/include/asm-i386/mach-generic/mach_apic.h
index b13767a4e934..d9dc039da94a 100644
--- a/include/asm-i386/mach-generic/mach_apic.h
+++ b/include/asm-i386/mach-generic/mach_apic.h
@@ -28,4 +28,6 @@
28#define enable_apic_mode (genapic->enable_apic_mode) 28#define enable_apic_mode (genapic->enable_apic_mode)
29#define phys_pkg_id (genapic->phys_pkg_id) 29#define phys_pkg_id (genapic->phys_pkg_id)
30 30
31extern void generic_bigsmp_probe(void);
32
31#endif /* __ASM_MACH_APIC_H */ 33#endif /* __ASM_MACH_APIC_H */
diff --git a/include/asm-i386/mmzone.h b/include/asm-i386/mmzone.h
index 516421300ea2..348fe3a4879d 100644
--- a/include/asm-i386/mmzone.h
+++ b/include/asm-i386/mmzone.h
@@ -29,7 +29,7 @@ static inline void get_memcfg_numa(void)
29#ifdef CONFIG_X86_NUMAQ 29#ifdef CONFIG_X86_NUMAQ
30 if (get_memcfg_numaq()) 30 if (get_memcfg_numaq())
31 return; 31 return;
32#elif CONFIG_ACPI_SRAT 32#elif defined(CONFIG_ACPI_SRAT)
33 if (get_memcfg_from_srat()) 33 if (get_memcfg_from_srat())
34 return; 34 return;
35#endif 35#endif
diff --git a/include/asm-i386/mpspec.h b/include/asm-i386/mpspec.h
index d9fafba075bc..64a0b8e6afeb 100644
--- a/include/asm-i386/mpspec.h
+++ b/include/asm-i386/mpspec.h
@@ -11,6 +11,7 @@ extern int mp_bus_id_to_local [MAX_MP_BUSSES];
11extern int quad_local_to_mp_bus_id [NR_CPUS/4][4]; 11extern int quad_local_to_mp_bus_id [NR_CPUS/4][4];
12extern int mp_bus_id_to_pci_bus [MAX_MP_BUSSES]; 12extern int mp_bus_id_to_pci_bus [MAX_MP_BUSSES];
13 13
14extern unsigned int def_to_bigsmp;
14extern unsigned int boot_cpu_physical_apicid; 15extern unsigned int boot_cpu_physical_apicid;
15extern int smp_found_config; 16extern int smp_found_config;
16extern void find_smp_config (void); 17extern void find_smp_config (void);
@@ -26,14 +27,14 @@ extern unsigned long mp_lapic_addr;
26extern int pic_mode; 27extern int pic_mode;
27extern int using_apic_timer; 28extern int using_apic_timer;
28 29
29#ifdef CONFIG_ACPI_BOOT 30#ifdef CONFIG_ACPI
30extern void mp_register_lapic (u8 id, u8 enabled); 31extern void mp_register_lapic (u8 id, u8 enabled);
31extern void mp_register_lapic_address (u64 address); 32extern void mp_register_lapic_address (u64 address);
32extern void mp_register_ioapic (u8 id, u32 address, u32 gsi_base); 33extern void mp_register_ioapic (u8 id, u32 address, u32 gsi_base);
33extern void mp_override_legacy_irq (u8 bus_irq, u8 polarity, u8 trigger, u32 gsi); 34extern void mp_override_legacy_irq (u8 bus_irq, u8 polarity, u8 trigger, u32 gsi);
34extern void mp_config_acpi_legacy_irqs (void); 35extern void mp_config_acpi_legacy_irqs (void);
35extern int mp_register_gsi (u32 gsi, int edge_level, int active_high_low); 36extern int mp_register_gsi (u32 gsi, int edge_level, int active_high_low);
36#endif /*CONFIG_ACPI_BOOT*/ 37#endif /* CONFIG_ACPI */
37 38
38#define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_APICS) 39#define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_APICS)
39 40
diff --git a/include/asm-i386/msr.h b/include/asm-i386/msr.h
index c76fce8badbb..62b76cd96957 100644
--- a/include/asm-i386/msr.h
+++ b/include/asm-i386/msr.h
@@ -47,6 +47,21 @@ static inline void wrmsrl (unsigned long msr, unsigned long long val)
47 : "c" (msr), "0" (a), "d" (b), "i" (-EFAULT));\ 47 : "c" (msr), "0" (a), "d" (b), "i" (-EFAULT));\
48 ret__; }) 48 ret__; })
49 49
50/* rdmsr with exception handling */
51#define rdmsr_safe(msr,a,b) ({ int ret__; \
52 asm volatile("2: rdmsr ; xorl %0,%0\n" \
53 "1:\n\t" \
54 ".section .fixup,\"ax\"\n\t" \
55 "3: movl %4,%0 ; jmp 1b\n\t" \
56 ".previous\n\t" \
57 ".section __ex_table,\"a\"\n" \
58 " .align 4\n\t" \
59 " .long 2b,3b\n\t" \
60 ".previous" \
61 : "=r" (ret__), "=a" (*(a)), "=d" (*(b)) \
62 : "c" (msr), "i" (-EFAULT));\
63 ret__; })
64
50#define rdtsc(low,high) \ 65#define rdtsc(low,high) \
51 __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high)) 66 __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high))
52 67
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h
index 8d93f732d72d..73296d9924fb 100644
--- a/include/asm-i386/page.h
+++ b/include/asm-i386/page.h
@@ -68,7 +68,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
68#define HPAGE_MASK (~(HPAGE_SIZE - 1)) 68#define HPAGE_MASK (~(HPAGE_SIZE - 1))
69#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) 69#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
70#define HAVE_ARCH_HUGETLB_UNMAPPED_AREA 70#define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
71#define ARCH_HAS_HUGETLB_CLEAN_STALE_PGTABLE
72#endif 71#endif
73 72
74#define pgd_val(x) ((x).pgd) 73#define pgd_val(x) ((x).pgd)
@@ -104,20 +103,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
104 */ 103 */
105extern unsigned int __VMALLOC_RESERVE; 104extern unsigned int __VMALLOC_RESERVE;
106 105
107/* Pure 2^n version of get_order */
108static __inline__ int get_order(unsigned long size)
109{
110 int order;
111
112 size = (size-1) >> (PAGE_SHIFT-1);
113 order = -1;
114 do {
115 size >>= 1;
116 order++;
117 } while (size);
118 return order;
119}
120
121extern int sysctl_legacy_va_layout; 106extern int sysctl_legacy_va_layout;
122 107
123extern int page_is_ram(unsigned long pagenr); 108extern int page_is_ram(unsigned long pagenr);
@@ -156,4 +141,6 @@ extern int page_is_ram(unsigned long pagenr);
156 141
157#endif /* __KERNEL__ */ 142#endif /* __KERNEL__ */
158 143
144#include <asm-generic/page.h>
145
159#endif /* _I386_PAGE_H */ 146#endif /* _I386_PAGE_H */
diff --git a/include/asm-i386/pgtable-3level.h b/include/asm-i386/pgtable-3level.h
index d609f9c2c1f0..2e3f4a344a2d 100644
--- a/include/asm-i386/pgtable-3level.h
+++ b/include/asm-i386/pgtable-3level.h
@@ -64,7 +64,7 @@ static inline void set_pte(pte_t *ptep, pte_t pte)
64#define set_pmd(pmdptr,pmdval) \ 64#define set_pmd(pmdptr,pmdval) \
65 set_64bit((unsigned long long *)(pmdptr),pmd_val(pmdval)) 65 set_64bit((unsigned long long *)(pmdptr),pmd_val(pmdval))
66#define set_pud(pudptr,pudval) \ 66#define set_pud(pudptr,pudval) \
67 set_64bit((unsigned long long *)(pudptr),pud_val(pudval)) 67 (*(pudptr) = (pudval))
68 68
69/* 69/*
70 * Pentium-II erratum A13: in PAE mode we explicitly have to flush 70 * Pentium-II erratum A13: in PAE mode we explicitly have to flush
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
index 77c6497f416e..47bc1ffa3d4c 100644
--- a/include/asm-i386/pgtable.h
+++ b/include/asm-i386/pgtable.h
@@ -86,9 +86,7 @@ void paging_init(void);
86#endif 86#endif
87 87
88/* 88/*
89 * The 4MB page is guessing.. Detailed in the infamous "Chapter H" 89 * _PAGE_PSE set in the page directory entry just means that
90 * of the Pentium details, but assuming intel did the straightforward
91 * thing, this bit set in the page directory entry just means that
92 * the page directory entry points directly to a 4MB-aligned block of 90 * the page directory entry points directly to a 4MB-aligned block of
93 * memory. 91 * memory.
94 */ 92 */
@@ -119,8 +117,10 @@ void paging_init(void);
119#define _PAGE_UNUSED2 0x400 117#define _PAGE_UNUSED2 0x400
120#define _PAGE_UNUSED3 0x800 118#define _PAGE_UNUSED3 0x800
121 119
122#define _PAGE_FILE 0x040 /* set:pagecache unset:swap */ 120/* If _PAGE_PRESENT is clear, we use these: */
123#define _PAGE_PROTNONE 0x080 /* If not present */ 121#define _PAGE_FILE 0x040 /* nonlinear file mapping, saved PTE; unset:swap */
122#define _PAGE_PROTNONE 0x080 /* if the user mapped it with PROT_NONE;
123 pte_present gives true */
124#ifdef CONFIG_X86_PAE 124#ifdef CONFIG_X86_PAE
125#define _PAGE_NX (1ULL<<_PAGE_BIT_NX) 125#define _PAGE_NX (1ULL<<_PAGE_BIT_NX)
126#else 126#else
@@ -215,11 +215,13 @@ extern unsigned long pg0[];
215 * The following only work if pte_present() is true. 215 * The following only work if pte_present() is true.
216 * Undefined behaviour if not.. 216 * Undefined behaviour if not..
217 */ 217 */
218#define __LARGE_PTE (_PAGE_PSE | _PAGE_PRESENT)
218static inline int pte_user(pte_t pte) { return (pte).pte_low & _PAGE_USER; } 219static inline int pte_user(pte_t pte) { return (pte).pte_low & _PAGE_USER; }
219static inline int pte_read(pte_t pte) { return (pte).pte_low & _PAGE_USER; } 220static inline int pte_read(pte_t pte) { return (pte).pte_low & _PAGE_USER; }
220static inline int pte_dirty(pte_t pte) { return (pte).pte_low & _PAGE_DIRTY; } 221static inline int pte_dirty(pte_t pte) { return (pte).pte_low & _PAGE_DIRTY; }
221static inline int pte_young(pte_t pte) { return (pte).pte_low & _PAGE_ACCESSED; } 222static inline int pte_young(pte_t pte) { return (pte).pte_low & _PAGE_ACCESSED; }
222static inline int pte_write(pte_t pte) { return (pte).pte_low & _PAGE_RW; } 223static inline int pte_write(pte_t pte) { return (pte).pte_low & _PAGE_RW; }
224static inline int pte_huge(pte_t pte) { return ((pte).pte_low & __LARGE_PTE) == __LARGE_PTE; }
223 225
224/* 226/*
225 * The following only works if pte_present() is not true. 227 * The following only works if pte_present() is not true.
@@ -236,7 +238,7 @@ static inline pte_t pte_mkexec(pte_t pte) { (pte).pte_low |= _PAGE_USER; return
236static inline pte_t pte_mkdirty(pte_t pte) { (pte).pte_low |= _PAGE_DIRTY; return pte; } 238static inline pte_t pte_mkdirty(pte_t pte) { (pte).pte_low |= _PAGE_DIRTY; return pte; }
237static inline pte_t pte_mkyoung(pte_t pte) { (pte).pte_low |= _PAGE_ACCESSED; return pte; } 239static inline pte_t pte_mkyoung(pte_t pte) { (pte).pte_low |= _PAGE_ACCESSED; return pte; }
238static inline pte_t pte_mkwrite(pte_t pte) { (pte).pte_low |= _PAGE_RW; return pte; } 240static inline pte_t pte_mkwrite(pte_t pte) { (pte).pte_low |= _PAGE_RW; return pte; }
239static inline pte_t pte_mkhuge(pte_t pte) { (pte).pte_low |= _PAGE_PRESENT | _PAGE_PSE; return pte; } 241static inline pte_t pte_mkhuge(pte_t pte) { (pte).pte_low |= __LARGE_PTE; return pte; }
240 242
241#ifdef CONFIG_X86_PAE 243#ifdef CONFIG_X86_PAE
242# include <asm/pgtable-3level.h> 244# include <asm/pgtable-3level.h>
@@ -258,12 +260,39 @@ static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned
258 return test_and_clear_bit(_PAGE_BIT_ACCESSED, &ptep->pte_low); 260 return test_and_clear_bit(_PAGE_BIT_ACCESSED, &ptep->pte_low);
259} 261}
260 262
263static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long addr, pte_t *ptep, int full)
264{
265 pte_t pte;
266 if (full) {
267 pte = *ptep;
268 *ptep = __pte(0);
269 } else {
270 pte = ptep_get_and_clear(mm, addr, ptep);
271 }
272 return pte;
273}
274
261static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep) 275static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
262{ 276{
263 clear_bit(_PAGE_BIT_RW, &ptep->pte_low); 277 clear_bit(_PAGE_BIT_RW, &ptep->pte_low);
264} 278}
265 279
266/* 280/*
281 * clone_pgd_range(pgd_t *dst, pgd_t *src, int count);
282 *
283 * dst - pointer to pgd range anwhere on a pgd page
284 * src - ""
285 * count - the number of pgds to copy.
286 *
287 * dst and src can be on the same page, but the range must not overlap,
288 * and must not cross a page boundary.
289 */
290static inline void clone_pgd_range(pgd_t *dst, pgd_t *src, int count)
291{
292 memcpy(dst, src, count * sizeof(pgd_t));
293}
294
295/*
267 * Macro to mark a page protection value as "uncacheable". On processors which do not support 296 * Macro to mark a page protection value as "uncacheable". On processors which do not support
268 * it, this is a no-op. 297 * it, this is a no-op.
269 */ 298 */
@@ -415,6 +444,7 @@ extern void noexec_setup(const char *str);
415#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 444#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
416#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY 445#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
417#define __HAVE_ARCH_PTEP_GET_AND_CLEAR 446#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
447#define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL
418#define __HAVE_ARCH_PTEP_SET_WRPROTECT 448#define __HAVE_ARCH_PTEP_SET_WRPROTECT
419#define __HAVE_ARCH_PTE_SAME 449#define __HAVE_ARCH_PTE_SAME
420#include <asm-generic/pgtable.h> 450#include <asm-generic/pgtable.h>
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h
index d0d8b0160090..37bef8ed7bed 100644
--- a/include/asm-i386/processor.h
+++ b/include/asm-i386/processor.h
@@ -203,9 +203,7 @@ static inline unsigned int cpuid_edx(unsigned int op)
203 return edx; 203 return edx;
204} 204}
205 205
206#define load_cr3(pgdir) \ 206#define load_cr3(pgdir) write_cr3(__pa(pgdir))
207 asm volatile("movl %0,%%cr3": :"r" (__pa(pgdir)))
208
209 207
210/* 208/*
211 * Intel CPU features in CR4 209 * Intel CPU features in CR4
@@ -232,22 +230,20 @@ extern unsigned long mmu_cr4_features;
232 230
233static inline void set_in_cr4 (unsigned long mask) 231static inline void set_in_cr4 (unsigned long mask)
234{ 232{
233 unsigned cr4;
235 mmu_cr4_features |= mask; 234 mmu_cr4_features |= mask;
236 __asm__("movl %%cr4,%%eax\n\t" 235 cr4 = read_cr4();
237 "orl %0,%%eax\n\t" 236 cr4 |= mask;
238 "movl %%eax,%%cr4\n" 237 write_cr4(cr4);
239 : : "irg" (mask)
240 :"ax");
241} 238}
242 239
243static inline void clear_in_cr4 (unsigned long mask) 240static inline void clear_in_cr4 (unsigned long mask)
244{ 241{
242 unsigned cr4;
245 mmu_cr4_features &= ~mask; 243 mmu_cr4_features &= ~mask;
246 __asm__("movl %%cr4,%%eax\n\t" 244 cr4 = read_cr4();
247 "andl %0,%%eax\n\t" 245 cr4 &= ~mask;
248 "movl %%eax,%%cr4\n" 246 write_cr4(cr4);
249 : : "irg" (~mask)
250 :"ax");
251} 247}
252 248
253/* 249/*
@@ -281,6 +277,11 @@ static inline void clear_in_cr4 (unsigned long mask)
281 outb((data), 0x23); \ 277 outb((data), 0x23); \
282} while (0) 278} while (0)
283 279
280static inline void serialize_cpu(void)
281{
282 __asm__ __volatile__ ("cpuid" : : : "ax", "bx", "cx", "dx");
283}
284
284static inline void __monitor(const void *eax, unsigned long ecx, 285static inline void __monitor(const void *eax, unsigned long ecx,
285 unsigned long edx) 286 unsigned long edx)
286{ 287{
@@ -454,6 +455,7 @@ struct thread_struct {
454 unsigned int saved_fs, saved_gs; 455 unsigned int saved_fs, saved_gs;
455/* IO permissions */ 456/* IO permissions */
456 unsigned long *io_bitmap_ptr; 457 unsigned long *io_bitmap_ptr;
458 unsigned long iopl;
457/* max allowed port in the bitmap, in bytes: */ 459/* max allowed port in the bitmap, in bytes: */
458 unsigned long io_bitmap_max; 460 unsigned long io_bitmap_max;
459}; 461};
@@ -474,7 +476,6 @@ struct thread_struct {
474 .esp0 = sizeof(init_stack) + (long)&init_stack, \ 476 .esp0 = sizeof(init_stack) + (long)&init_stack, \
475 .ss0 = __KERNEL_DS, \ 477 .ss0 = __KERNEL_DS, \
476 .ss1 = __KERNEL_CS, \ 478 .ss1 = __KERNEL_CS, \
477 .ldt = GDT_ENTRY_LDT, \
478 .io_bitmap_base = INVALID_IO_BITMAP_OFFSET, \ 479 .io_bitmap_base = INVALID_IO_BITMAP_OFFSET, \
479 .io_bitmap = { [ 0 ... IO_BITMAP_LONGS] = ~0 }, \ 480 .io_bitmap = { [ 0 ... IO_BITMAP_LONGS] = ~0 }, \
480} 481}
@@ -511,6 +512,21 @@ static inline void load_esp0(struct tss_struct *tss, struct thread_struct *threa
511 : /* no output */ \ 512 : /* no output */ \
512 :"r" (value)) 513 :"r" (value))
513 514
515/*
516 * Set IOPL bits in EFLAGS from given mask
517 */
518static inline void set_iopl_mask(unsigned mask)
519{
520 unsigned int reg;
521 __asm__ __volatile__ ("pushfl;"
522 "popl %0;"
523 "andl %1, %0;"
524 "orl %2, %0;"
525 "pushl %0;"
526 "popfl"
527 : "=&r" (reg)
528 : "i" (~X86_EFLAGS_IOPL), "r" (mask));
529}
514 530
515/* Forward declaration, a strange C thing */ 531/* Forward declaration, a strange C thing */
516struct task_struct; 532struct task_struct;
diff --git a/include/asm-i386/ptrace.h b/include/asm-i386/ptrace.h
index 05532875e39e..7e0f2945d17d 100644
--- a/include/asm-i386/ptrace.h
+++ b/include/asm-i386/ptrace.h
@@ -61,6 +61,13 @@ struct pt_regs {
61struct task_struct; 61struct task_struct;
62extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code); 62extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code);
63 63
64/*
65 * user_mode_vm(regs) determines whether a register set came from user mode.
66 * This is true if V8086 mode was enabled OR if the register set was from
67 * protected mode with RPL-3 CS value. This tricky test checks that with
68 * one comparison. Many places in the kernel can bypass this full check
69 * if they have already ruled out V8086 mode, so user_mode(regs) can be used.
70 */
64static inline int user_mode(struct pt_regs *regs) 71static inline int user_mode(struct pt_regs *regs)
65{ 72{
66 return (regs->xcs & 3) != 0; 73 return (regs->xcs & 3) != 0;
diff --git a/include/asm-i386/setup.h b/include/asm-i386/setup.h
index 7a32184d54bf..826a8ca50ac8 100644
--- a/include/asm-i386/setup.h
+++ b/include/asm-i386/setup.h
@@ -44,7 +44,7 @@ extern unsigned char boot_params[PARAM_SIZE];
44#define EFI_SYSTAB ((efi_system_table_t *) *((unsigned long *)(PARAM+0x1c4))) 44#define EFI_SYSTAB ((efi_system_table_t *) *((unsigned long *)(PARAM+0x1c4)))
45#define EFI_MEMDESC_SIZE (*((unsigned long *) (PARAM+0x1c8))) 45#define EFI_MEMDESC_SIZE (*((unsigned long *) (PARAM+0x1c8)))
46#define EFI_MEMDESC_VERSION (*((unsigned long *) (PARAM+0x1cc))) 46#define EFI_MEMDESC_VERSION (*((unsigned long *) (PARAM+0x1cc)))
47#define EFI_MEMMAP ((efi_memory_desc_t *) *((unsigned long *)(PARAM+0x1d0))) 47#define EFI_MEMMAP ((void *) *((unsigned long *)(PARAM+0x1d0)))
48#define EFI_MEMMAP_SIZE (*((unsigned long *) (PARAM+0x1d4))) 48#define EFI_MEMMAP_SIZE (*((unsigned long *) (PARAM+0x1d4)))
49#define MOUNT_ROOT_RDONLY (*(unsigned short *) (PARAM+0x1F2)) 49#define MOUNT_ROOT_RDONLY (*(unsigned short *) (PARAM+0x1F2))
50#define RAMDISK_FLAGS (*(unsigned short *) (PARAM+0x1F8)) 50#define RAMDISK_FLAGS (*(unsigned short *) (PARAM+0x1F8))
diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h
index a283738b80b3..13250199976d 100644
--- a/include/asm-i386/smp.h
+++ b/include/asm-i386/smp.h
@@ -59,7 +59,7 @@ extern void cpu_uninit(void);
59 59
60extern cpumask_t cpu_callout_map; 60extern cpumask_t cpu_callout_map;
61extern cpumask_t cpu_callin_map; 61extern cpumask_t cpu_callin_map;
62#define cpu_possible_map cpu_callout_map 62extern cpumask_t cpu_possible_map;
63 63
64/* We don't mark CPUs online until __cpu_up(), so we need another measure */ 64/* We don't mark CPUs online until __cpu_up(), so we need another measure */
65static inline int num_booting_cpus(void) 65static inline int num_booting_cpus(void)
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h
index 3db717a244f0..acd5c26b69ba 100644
--- a/include/asm-i386/system.h
+++ b/include/asm-i386/system.h
@@ -14,8 +14,7 @@ extern struct task_struct * FASTCALL(__switch_to(struct task_struct *prev, struc
14 14
15#define switch_to(prev,next,last) do { \ 15#define switch_to(prev,next,last) do { \
16 unsigned long esi,edi; \ 16 unsigned long esi,edi; \
17 asm volatile("pushfl\n\t" \ 17 asm volatile("pushl %%ebp\n\t" \
18 "pushl %%ebp\n\t" \
19 "movl %%esp,%0\n\t" /* save ESP */ \ 18 "movl %%esp,%0\n\t" /* save ESP */ \
20 "movl %5,%%esp\n\t" /* restore ESP */ \ 19 "movl %5,%%esp\n\t" /* restore ESP */ \
21 "movl $1f,%1\n\t" /* save EIP */ \ 20 "movl $1f,%1\n\t" /* save EIP */ \
@@ -23,7 +22,6 @@ extern struct task_struct * FASTCALL(__switch_to(struct task_struct *prev, struc
23 "jmp __switch_to\n" \ 22 "jmp __switch_to\n" \
24 "1:\t" \ 23 "1:\t" \
25 "popl %%ebp\n\t" \ 24 "popl %%ebp\n\t" \
26 "popfl" \
27 :"=m" (prev->thread.esp),"=m" (prev->thread.eip), \ 25 :"=m" (prev->thread.esp),"=m" (prev->thread.eip), \
28 "=a" (last),"=S" (esi),"=D" (edi) \ 26 "=a" (last),"=S" (esi),"=D" (edi) \
29 :"m" (next->thread.esp),"m" (next->thread.eip), \ 27 :"m" (next->thread.esp),"m" (next->thread.eip), \
@@ -93,13 +91,13 @@ static inline unsigned long _get_base(char * addr)
93 ".align 4\n\t" \ 91 ".align 4\n\t" \
94 ".long 1b,3b\n" \ 92 ".long 1b,3b\n" \
95 ".previous" \ 93 ".previous" \
96 : :"m" (value)) 94 : :"rm" (value))
97 95
98/* 96/*
99 * Save a segment register away 97 * Save a segment register away
100 */ 98 */
101#define savesegment(seg, value) \ 99#define savesegment(seg, value) \
102 asm volatile("mov %%" #seg ",%0":"=m" (value)) 100 asm volatile("mov %%" #seg ",%0":"=rm" (value))
103 101
104/* 102/*
105 * Clear and set 'TS' bit respectively 103 * Clear and set 'TS' bit respectively
@@ -107,13 +105,33 @@ static inline unsigned long _get_base(char * addr)
107#define clts() __asm__ __volatile__ ("clts") 105#define clts() __asm__ __volatile__ ("clts")
108#define read_cr0() ({ \ 106#define read_cr0() ({ \
109 unsigned int __dummy; \ 107 unsigned int __dummy; \
110 __asm__( \ 108 __asm__ __volatile__( \
111 "movl %%cr0,%0\n\t" \ 109 "movl %%cr0,%0\n\t" \
112 :"=r" (__dummy)); \ 110 :"=r" (__dummy)); \
113 __dummy; \ 111 __dummy; \
114}) 112})
115#define write_cr0(x) \ 113#define write_cr0(x) \
116 __asm__("movl %0,%%cr0": :"r" (x)); 114 __asm__ __volatile__("movl %0,%%cr0": :"r" (x));
115
116#define read_cr2() ({ \
117 unsigned int __dummy; \
118 __asm__ __volatile__( \
119 "movl %%cr2,%0\n\t" \
120 :"=r" (__dummy)); \
121 __dummy; \
122})
123#define write_cr2(x) \
124 __asm__ __volatile__("movl %0,%%cr2": :"r" (x));
125
126#define read_cr3() ({ \
127 unsigned int __dummy; \
128 __asm__ ( \
129 "movl %%cr3,%0\n\t" \
130 :"=r" (__dummy)); \
131 __dummy; \
132})
133#define write_cr3(x) \
134 __asm__ __volatile__("movl %0,%%cr3": :"r" (x));
117 135
118#define read_cr4() ({ \ 136#define read_cr4() ({ \
119 unsigned int __dummy; \ 137 unsigned int __dummy; \
@@ -123,7 +141,7 @@ static inline unsigned long _get_base(char * addr)
123 __dummy; \ 141 __dummy; \
124}) 142})
125#define write_cr4(x) \ 143#define write_cr4(x) \
126 __asm__("movl %0,%%cr4": :"r" (x)); 144 __asm__ __volatile__("movl %0,%%cr4": :"r" (x));
127#define stts() write_cr0(8 | read_cr0()) 145#define stts() write_cr0(8 | read_cr0())
128 146
129#endif /* __KERNEL__ */ 147#endif /* __KERNEL__ */
@@ -447,6 +465,8 @@ struct alt_instr {
447#define local_irq_enable() __asm__ __volatile__("sti": : :"memory") 465#define local_irq_enable() __asm__ __volatile__("sti": : :"memory")
448/* used in the idle loop; sti takes one instruction cycle to complete */ 466/* used in the idle loop; sti takes one instruction cycle to complete */
449#define safe_halt() __asm__ __volatile__("sti; hlt": : :"memory") 467#define safe_halt() __asm__ __volatile__("sti; hlt": : :"memory")
468/* used when interrupts are already enabled or to shutdown the processor */
469#define halt() __asm__ __volatile__("hlt": : :"memory")
450 470
451#define irqs_disabled() \ 471#define irqs_disabled() \
452({ \ 472({ \
diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h
index 95add81237ea..8fbf791651bf 100644
--- a/include/asm-i386/thread_info.h
+++ b/include/asm-i386/thread_info.h
@@ -48,7 +48,7 @@ struct thread_info {
48 48
49#else /* !__ASSEMBLY__ */ 49#else /* !__ASSEMBLY__ */
50 50
51#include <asm/asm_offsets.h> 51#include <asm/asm-offsets.h>
52 52
53#endif 53#endif
54 54
@@ -139,6 +139,7 @@ register unsigned long current_stack_pointer asm("esp") __attribute_used__;
139#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 139#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
140#define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */ 140#define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */
141#define TIF_IRET 5 /* return with iret */ 141#define TIF_IRET 5 /* return with iret */
142#define TIF_SYSCALL_EMU 6 /* syscall emulation active */
142#define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ 143#define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */
143#define TIF_SECCOMP 8 /* secure computing */ 144#define TIF_SECCOMP 8 /* secure computing */
144#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 145#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
@@ -150,13 +151,15 @@ register unsigned long current_stack_pointer asm("esp") __attribute_used__;
150#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 151#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
151#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) 152#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)
152#define _TIF_IRET (1<<TIF_IRET) 153#define _TIF_IRET (1<<TIF_IRET)
154#define _TIF_SYSCALL_EMU (1<<TIF_SYSCALL_EMU)
153#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) 155#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
154#define _TIF_SECCOMP (1<<TIF_SECCOMP) 156#define _TIF_SECCOMP (1<<TIF_SECCOMP)
155#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 157#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
156 158
157/* work to do on interrupt/exception return */ 159/* work to do on interrupt/exception return */
158#define _TIF_WORK_MASK \ 160#define _TIF_WORK_MASK \
159 (0x0000FFFF & ~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP|_TIF_SECCOMP)) 161 (0x0000FFFF & ~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP|\
162 _TIF_SECCOMP|_TIF_SYSCALL_EMU))
160/* work to do on any return to u-space */ 163/* work to do on any return to u-space */
161#define _TIF_ALLWORK_MASK (0x0000FFFF & ~_TIF_SECCOMP) 164#define _TIF_ALLWORK_MASK (0x0000FFFF & ~_TIF_SECCOMP)
162 165
diff --git a/include/asm-i386/timer.h b/include/asm-i386/timer.h
index dcf1e07db08a..aed16437479d 100644
--- a/include/asm-i386/timer.h
+++ b/include/asm-i386/timer.h
@@ -1,6 +1,7 @@
1#ifndef _ASMi386_TIMER_H 1#ifndef _ASMi386_TIMER_H
2#define _ASMi386_TIMER_H 2#define _ASMi386_TIMER_H
3#include <linux/init.h> 3#include <linux/init.h>
4#include <linux/pm.h>
4 5
5/** 6/**
6 * struct timer_ops - used to define a timer source 7 * struct timer_ops - used to define a timer source
@@ -23,6 +24,8 @@ struct timer_opts {
23 unsigned long long (*monotonic_clock)(void); 24 unsigned long long (*monotonic_clock)(void);
24 void (*delay)(unsigned long); 25 void (*delay)(unsigned long);
25 unsigned long (*read_timer)(void); 26 unsigned long (*read_timer)(void);
27 int (*suspend)(pm_message_t state);
28 int (*resume)(void);
26}; 29};
27 30
28struct init_timer_opts { 31struct init_timer_opts {
diff --git a/include/asm-i386/types.h b/include/asm-i386/types.h
index 901b77c42b8a..ced00fe8fe61 100644
--- a/include/asm-i386/types.h
+++ b/include/asm-i386/types.h
@@ -63,8 +63,6 @@ typedef u64 sector_t;
63#define HAVE_SECTOR_T 63#define HAVE_SECTOR_T
64#endif 64#endif
65 65
66typedef unsigned short kmem_bufctl_t;
67
68#endif /* __ASSEMBLY__ */ 66#endif /* __ASSEMBLY__ */
69 67
70#endif /* __KERNEL__ */ 68#endif /* __KERNEL__ */
diff --git a/include/asm-i386/uaccess.h b/include/asm-i386/uaccess.h
index 886867aea947..89ab7e2bc5aa 100644
--- a/include/asm-i386/uaccess.h
+++ b/include/asm-i386/uaccess.h
@@ -83,30 +83,6 @@ extern struct movsl_mask {
83 */ 83 */
84#define access_ok(type,addr,size) (likely(__range_ok(addr,size) == 0)) 84#define access_ok(type,addr,size) (likely(__range_ok(addr,size) == 0))
85 85
86/**
87 * verify_area: - Obsolete/deprecated and will go away soon,
88 * use access_ok() instead.
89 * @type: Type of access: %VERIFY_READ or %VERIFY_WRITE
90 * @addr: User space pointer to start of block to check
91 * @size: Size of block to check
92 *
93 * Context: User context only. This function may sleep.
94 *
95 * This function has been replaced by access_ok().
96 *
97 * Checks if a pointer to a block of memory in user space is valid.
98 *
99 * Returns zero if the memory block may be valid, -EFAULT
100 * if it is definitely invalid.
101 *
102 * See access_ok() for more details.
103 */
104static inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size)
105{
106 return access_ok(type,addr,size) ? 0 : -EFAULT;
107}
108
109
110/* 86/*
111 * The exception table consists of pairs of addresses: the first is the 87 * The exception table consists of pairs of addresses: the first is the
112 * address of an instruction that is allowed to fault, and the second is 88 * address of an instruction that is allowed to fault, and the second is
diff --git a/include/asm-i386/xor.h b/include/asm-i386/xor.h
index f80e2dbe1b56..23c86cef3b25 100644
--- a/include/asm-i386/xor.h
+++ b/include/asm-i386/xor.h
@@ -535,14 +535,14 @@ static struct xor_block_template xor_block_p5_mmx = {
535 535
536#define XMMS_SAVE do { \ 536#define XMMS_SAVE do { \
537 preempt_disable(); \ 537 preempt_disable(); \
538 cr0 = read_cr0(); \
539 clts(); \
538 __asm__ __volatile__ ( \ 540 __asm__ __volatile__ ( \
539 "movl %%cr0,%0 ;\n\t" \ 541 "movups %%xmm0,(%0) ;\n\t" \
540 "clts ;\n\t" \ 542 "movups %%xmm1,0x10(%0) ;\n\t" \
541 "movups %%xmm0,(%1) ;\n\t" \ 543 "movups %%xmm2,0x20(%0) ;\n\t" \
542 "movups %%xmm1,0x10(%1) ;\n\t" \ 544 "movups %%xmm3,0x30(%0) ;\n\t" \
543 "movups %%xmm2,0x20(%1) ;\n\t" \ 545 : \
544 "movups %%xmm3,0x30(%1) ;\n\t" \
545 : "=&r" (cr0) \
546 : "r" (xmm_save) \ 546 : "r" (xmm_save) \
547 : "memory"); \ 547 : "memory"); \
548} while(0) 548} while(0)
@@ -550,14 +550,14 @@ static struct xor_block_template xor_block_p5_mmx = {
550#define XMMS_RESTORE do { \ 550#define XMMS_RESTORE do { \
551 __asm__ __volatile__ ( \ 551 __asm__ __volatile__ ( \
552 "sfence ;\n\t" \ 552 "sfence ;\n\t" \
553 "movups (%1),%%xmm0 ;\n\t" \ 553 "movups (%0),%%xmm0 ;\n\t" \
554 "movups 0x10(%1),%%xmm1 ;\n\t" \ 554 "movups 0x10(%0),%%xmm1 ;\n\t" \
555 "movups 0x20(%1),%%xmm2 ;\n\t" \ 555 "movups 0x20(%0),%%xmm2 ;\n\t" \
556 "movups 0x30(%1),%%xmm3 ;\n\t" \ 556 "movups 0x30(%0),%%xmm3 ;\n\t" \
557 "movl %0,%%cr0 ;\n\t" \
558 : \ 557 : \
559 : "r" (cr0), "r" (xmm_save) \ 558 : "r" (xmm_save) \
560 : "memory"); \ 559 : "memory"); \
560 write_cr0(cr0); \
561 preempt_enable(); \ 561 preempt_enable(); \
562} while(0) 562} while(0)
563 563
diff --git a/include/asm-ia64/acpi-ext.h b/include/asm-ia64/acpi-ext.h
index 9271d74c64cc..56d2ddc97b30 100644
--- a/include/asm-ia64/acpi-ext.h
+++ b/include/asm-ia64/acpi-ext.h
@@ -11,6 +11,7 @@
11#define _ASM_IA64_ACPI_EXT_H 11#define _ASM_IA64_ACPI_EXT_H
12 12
13#include <linux/types.h> 13#include <linux/types.h>
14#include <acpi/actypes.h>
14 15
15extern acpi_status hp_acpi_csr_space (acpi_handle, u64 *base, u64 *length); 16extern acpi_status hp_acpi_csr_space (acpi_handle, u64 *base, u64 *length);
16 17
diff --git a/include/asm-ia64/auxvec.h b/include/asm-ia64/auxvec.h
new file mode 100644
index 000000000000..23cebe5685b9
--- /dev/null
+++ b/include/asm-ia64/auxvec.h
@@ -0,0 +1,11 @@
1#ifndef _ASM_IA64_AUXVEC_H
2#define _ASM_IA64_AUXVEC_H
3
4/*
5 * Architecture-neutral AT_ values are in the range 0-17. Leave some room for more of
6 * them, start the architecture-specific ones at 32.
7 */
8#define AT_SYSINFO 32
9#define AT_SYSINFO_EHDR 33
10
11#endif /* _ASM_IA64_AUXVEC_H */
diff --git a/include/asm-ia64/compat.h b/include/asm-ia64/compat.h
index 0c05e5bad8a0..aaf11f4e9169 100644
--- a/include/asm-ia64/compat.h
+++ b/include/asm-ia64/compat.h
@@ -13,10 +13,10 @@ typedef s32 compat_time_t;
13typedef s32 compat_clock_t; 13typedef s32 compat_clock_t;
14typedef s32 compat_key_t; 14typedef s32 compat_key_t;
15typedef s32 compat_pid_t; 15typedef s32 compat_pid_t;
16typedef u16 compat_uid_t; 16typedef u16 __compat_uid_t;
17typedef u16 compat_gid_t; 17typedef u16 __compat_gid_t;
18typedef u32 compat_uid32_t; 18typedef u32 __compat_uid32_t;
19typedef u32 compat_gid32_t; 19typedef u32 __compat_gid32_t;
20typedef u16 compat_mode_t; 20typedef u16 compat_mode_t;
21typedef u32 compat_ino_t; 21typedef u32 compat_ino_t;
22typedef u16 compat_dev_t; 22typedef u16 compat_dev_t;
@@ -50,8 +50,8 @@ struct compat_stat {
50 compat_ino_t st_ino; 50 compat_ino_t st_ino;
51 compat_mode_t st_mode; 51 compat_mode_t st_mode;
52 compat_nlink_t st_nlink; 52 compat_nlink_t st_nlink;
53 compat_uid_t st_uid; 53 __compat_uid_t st_uid;
54 compat_gid_t st_gid; 54 __compat_gid_t st_gid;
55 compat_dev_t st_rdev; 55 compat_dev_t st_rdev;
56 u16 __pad2; 56 u16 __pad2;
57 u32 st_size; 57 u32 st_size;
@@ -120,10 +120,10 @@ typedef u32 compat_sigset_word;
120 120
121struct compat_ipc64_perm { 121struct compat_ipc64_perm {
122 compat_key_t key; 122 compat_key_t key;
123 compat_uid32_t uid; 123 __compat_uid32_t uid;
124 compat_gid32_t gid; 124 __compat_gid32_t gid;
125 compat_uid32_t cuid; 125 __compat_uid32_t cuid;
126 compat_gid32_t cgid; 126 __compat_gid32_t cgid;
127 unsigned short mode; 127 unsigned short mode;
128 unsigned short __pad1; 128 unsigned short __pad1;
129 unsigned short seq; 129 unsigned short seq;
diff --git a/include/asm-ia64/elf.h b/include/asm-ia64/elf.h
index 7d4ccc4b976e..446fce036fd9 100644
--- a/include/asm-ia64/elf.h
+++ b/include/asm-ia64/elf.h
@@ -12,6 +12,7 @@
12 12
13#include <asm/fpu.h> 13#include <asm/fpu.h>
14#include <asm/page.h> 14#include <asm/page.h>
15#include <asm/auxvec.h>
15 16
16/* 17/*
17 * This is used to ensure we don't load something for the wrong architecture. 18 * This is used to ensure we don't load something for the wrong architecture.
@@ -177,13 +178,6 @@ extern void ia64_elf_core_copy_regs (struct pt_regs *src, elf_gregset_t dst);
177 relevant until we have real hardware to play with... */ 178 relevant until we have real hardware to play with... */
178#define ELF_PLATFORM NULL 179#define ELF_PLATFORM NULL
179 180
180/*
181 * Architecture-neutral AT_ values are in the range 0-17. Leave some room for more of
182 * them, start the architecture-specific ones at 32.
183 */
184#define AT_SYSINFO 32
185#define AT_SYSINFO_EHDR 33
186
187#ifdef __KERNEL__ 181#ifdef __KERNEL__
188#define SET_PERSONALITY(ex, ibcs2) set_personality(PER_LINUX) 182#define SET_PERSONALITY(ex, ibcs2) set_personality(PER_LINUX)
189#define elf_read_implies_exec(ex, executable_stack) \ 183#define elf_read_implies_exec(ex, executable_stack) \
diff --git a/include/asm-ia64/fcntl.h b/include/asm-ia64/fcntl.h
index cee16ea1780a..1dd275dc8f65 100644
--- a/include/asm-ia64/fcntl.h
+++ b/include/asm-ia64/fcntl.h
@@ -1,87 +1,13 @@
1#ifndef _ASM_IA64_FCNTL_H 1#ifndef _ASM_IA64_FCNTL_H
2#define _ASM_IA64_FCNTL_H 2#define _ASM_IA64_FCNTL_H
3/* 3/*
4 * Based on <asm-i386/fcntl.h>.
5 *
6 * Modified 1998-2000 4 * Modified 1998-2000
7 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co. 5 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co.
8 */ 6 */
9 7
10/*
11 * open/fcntl - O_SYNC is only implemented on blocks devices and on
12 * files located on an ext2 file system
13 */
14#define O_ACCMODE 0003
15#define O_RDONLY 00
16#define O_WRONLY 01
17#define O_RDWR 02
18#define O_CREAT 0100 /* not fcntl */
19#define O_EXCL 0200 /* not fcntl */
20#define O_NOCTTY 0400 /* not fcntl */
21#define O_TRUNC 01000 /* not fcntl */
22#define O_APPEND 02000
23#define O_NONBLOCK 04000
24#define O_NDELAY O_NONBLOCK
25#define O_SYNC 010000
26#define FASYNC 020000 /* fcntl, for BSD compatibility */
27#define O_DIRECT 040000 /* direct disk access hint - currently ignored */
28#define O_LARGEFILE 0100000
29#define O_DIRECTORY 0200000 /* must be a directory */
30#define O_NOFOLLOW 0400000 /* don't follow links */
31#define O_NOATIME 01000000
32
33#define F_DUPFD 0 /* dup */
34#define F_GETFD 1 /* get close_on_exec */
35#define F_SETFD 2 /* set/clear close_on_exec */
36#define F_GETFL 3 /* get file->f_flags */
37#define F_SETFL 4 /* set file->f_flags */
38#define F_GETLK 5
39#define F_SETLK 6
40#define F_SETLKW 7
41
42#define F_SETOWN 8 /* for sockets. */
43#define F_GETOWN 9 /* for sockets. */
44#define F_SETSIG 10 /* for sockets. */
45#define F_GETSIG 11 /* for sockets. */
46
47/* for F_[GET|SET]FL */
48#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
49
50/* for posix fcntl() and lockf() */
51#define F_RDLCK 0
52#define F_WRLCK 1
53#define F_UNLCK 2
54
55/* for old implementation of bsd flock () */
56#define F_EXLCK 4 /* or 3 */
57#define F_SHLCK 8 /* or 4 */
58
59/* for leases */
60#define F_INPROGRESS 16
61
62/* operations for bsd flock(), also used by the kernel implementation */
63#define LOCK_SH 1 /* shared lock */
64#define LOCK_EX 2 /* exclusive lock */
65#define LOCK_NB 4 /* or'd with one of the above to prevent
66 blocking */
67#define LOCK_UN 8 /* remove lock */
68
69#define LOCK_MAND 32 /* This is a mandatory flock */
70#define LOCK_READ 64 /* ... Which allows concurrent read operations */
71#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
72#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
73
74struct flock {
75 short l_type;
76 short l_whence;
77 off_t l_start;
78 off_t l_len;
79 pid_t l_pid;
80};
81
82#define F_LINUX_SPECIFIC_BASE 1024
83
84#define force_o_largefile() \ 8#define force_o_largefile() \
85 (personality(current->personality) != PER_LINUX32) 9 (personality(current->personality) != PER_LINUX32)
86 10
11#include <asm-generic/fcntl.h>
12
87#endif /* _ASM_IA64_FCNTL_H */ 13#endif /* _ASM_IA64_FCNTL_H */
diff --git a/include/asm-ia64/futex.h b/include/asm-ia64/futex.h
new file mode 100644
index 000000000000..2cac5ecd9d00
--- /dev/null
+++ b/include/asm-ia64/futex.h
@@ -0,0 +1,53 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/uaccess.h>
9
10static inline int
11futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
12{
13 int op = (encoded_op >> 28) & 7;
14 int cmp = (encoded_op >> 24) & 15;
15 int oparg = (encoded_op << 8) >> 20;
16 int cmparg = (encoded_op << 20) >> 20;
17 int oldval = 0, ret, tem;
18 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
19 oparg = 1 << oparg;
20
21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
22 return -EFAULT;
23
24 inc_preempt_count();
25
26 switch (op) {
27 case FUTEX_OP_SET:
28 case FUTEX_OP_ADD:
29 case FUTEX_OP_OR:
30 case FUTEX_OP_ANDN:
31 case FUTEX_OP_XOR:
32 default:
33 ret = -ENOSYS;
34 }
35
36 dec_preempt_count();
37
38 if (!ret) {
39 switch (cmp) {
40 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
41 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
42 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
43 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
44 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
45 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
46 default: ret = -ENOSYS;
47 }
48 }
49 return ret;
50}
51
52#endif
53#endif
diff --git a/include/asm-ia64/hdreg.h b/include/asm-ia64/hdreg.h
deleted file mode 100644
index 83b5161d2678..000000000000
--- a/include/asm-ia64/hdreg.h
+++ /dev/null
@@ -1,14 +0,0 @@
1/*
2 * linux/include/asm-ia64/hdreg.h
3 *
4 * Copyright (C) 1994-1996 Linus Torvalds & authors
5 */
6
7#warning this file is obsolete, please do not use it
8
9#ifndef __ASM_IA64_HDREG_H
10#define __ASM_IA64_HDREG_H
11
12typedef unsigned short ide_ioreg_t;
13
14#endif /* __ASM_IA64_HDREG_H */
diff --git a/include/asm-ia64/hw_irq.h b/include/asm-ia64/hw_irq.h
index 041ab8c51a64..0cf119b42f7d 100644
--- a/include/asm-ia64/hw_irq.h
+++ b/include/asm-ia64/hw_irq.h
@@ -116,13 +116,6 @@ __ia64_local_vector_to_irq (ia64_vector vec)
116 * and to obtain the irq descriptor for a given irq number. 116 * and to obtain the irq descriptor for a given irq number.
117 */ 117 */
118 118
119/* Return a pointer to the irq descriptor for IRQ. */
120static inline irq_desc_t *
121irq_descp (int irq)
122{
123 return irq_desc + irq;
124}
125
126/* Extract the IA-64 vector that corresponds to IRQ. */ 119/* Extract the IA-64 vector that corresponds to IRQ. */
127static inline ia64_vector 120static inline ia64_vector
128irq_to_vector (int irq) 121irq_to_vector (int irq)
diff --git a/include/asm-ia64/iosapic.h b/include/asm-ia64/iosapic.h
index a429fe225b07..20f98f1751a1 100644
--- a/include/asm-ia64/iosapic.h
+++ b/include/asm-ia64/iosapic.h
@@ -80,12 +80,9 @@ extern int iosapic_remove (unsigned int gsi_base);
80#endif /* CONFIG_HOTPLUG */ 80#endif /* CONFIG_HOTPLUG */
81extern int gsi_to_vector (unsigned int gsi); 81extern int gsi_to_vector (unsigned int gsi);
82extern int gsi_to_irq (unsigned int gsi); 82extern int gsi_to_irq (unsigned int gsi);
83extern void iosapic_enable_intr (unsigned int vector);
84extern int iosapic_register_intr (unsigned int gsi, unsigned long polarity, 83extern int iosapic_register_intr (unsigned int gsi, unsigned long polarity,
85 unsigned long trigger); 84 unsigned long trigger);
86#ifdef CONFIG_ACPI_DEALLOCATE_IRQ
87extern void iosapic_unregister_intr (unsigned int irq); 85extern void iosapic_unregister_intr (unsigned int irq);
88#endif
89extern void __init iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi, 86extern void __init iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi,
90 unsigned long polarity, 87 unsigned long polarity,
91 unsigned long trigger); 88 unsigned long trigger);
@@ -97,7 +94,6 @@ extern int __init iosapic_register_platform_intr (u32 int_type,
97 unsigned long trigger); 94 unsigned long trigger);
98extern unsigned int iosapic_version (char __iomem *addr); 95extern unsigned int iosapic_version (char __iomem *addr);
99 96
100extern void iosapic_pci_fixup (int);
101#ifdef CONFIG_NUMA 97#ifdef CONFIG_NUMA
102extern void __devinit map_iosapic_to_node (unsigned int, int); 98extern void __devinit map_iosapic_to_node (unsigned int, int);
103#endif 99#endif
diff --git a/include/asm-ia64/irq.h b/include/asm-ia64/irq.h
index bd07d11d9f37..dbe86c0bbce5 100644
--- a/include/asm-ia64/irq.h
+++ b/include/asm-ia64/irq.h
@@ -14,6 +14,11 @@
14#define NR_IRQS 256 14#define NR_IRQS 256
15#define NR_IRQ_VECTORS NR_IRQS 15#define NR_IRQ_VECTORS NR_IRQS
16 16
17/*
18 * IRQ line status macro IRQ_PER_CPU is used
19 */
20#define ARCH_HAS_IRQ_PER_CPU
21
17static __inline__ int 22static __inline__ int
18irq_canonicalize (int irq) 23irq_canonicalize (int irq)
19{ 24{
@@ -30,14 +35,4 @@ extern void disable_irq_nosync (unsigned int);
30extern void enable_irq (unsigned int); 35extern void enable_irq (unsigned int);
31extern void set_irq_affinity_info (unsigned int irq, int dest, int redir); 36extern void set_irq_affinity_info (unsigned int irq, int dest, int redir);
32 37
33#ifdef CONFIG_SMP
34extern void move_irq(int irq);
35#else
36#define move_irq(irq)
37#endif
38
39struct irqaction;
40struct pt_regs;
41int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
42
43#endif /* _ASM_IA64_IRQ_H */ 38#endif /* _ASM_IA64_IRQ_H */
diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h
index bf36a32e37e4..573a3574a24f 100644
--- a/include/asm-ia64/kprobes.h
+++ b/include/asm-ia64/kprobes.h
@@ -92,6 +92,7 @@ struct arch_specific_insn {
92 kprobe_opcode_t insn; 92 kprobe_opcode_t insn;
93 #define INST_FLAG_FIX_RELATIVE_IP_ADDR 1 93 #define INST_FLAG_FIX_RELATIVE_IP_ADDR 1
94 #define INST_FLAG_FIX_BRANCH_REG 2 94 #define INST_FLAG_FIX_BRANCH_REG 2
95 #define INST_FLAG_BREAK_INST 4
95 unsigned long inst_flag; 96 unsigned long inst_flag;
96 unsigned short target_br_reg; 97 unsigned short target_br_reg;
97}; 98};
diff --git a/include/asm-ia64/pci.h b/include/asm-ia64/pci.h
index dba9f220be71..ef616fd4cb1b 100644
--- a/include/asm-ia64/pci.h
+++ b/include/asm-ia64/pci.h
@@ -156,6 +156,19 @@ extern void pcibios_resource_to_bus(struct pci_dev *dev,
156extern void pcibios_bus_to_resource(struct pci_dev *dev, 156extern void pcibios_bus_to_resource(struct pci_dev *dev,
157 struct resource *res, struct pci_bus_region *region); 157 struct resource *res, struct pci_bus_region *region);
158 158
159static inline struct resource *
160pcibios_select_root(struct pci_dev *pdev, struct resource *res)
161{
162 struct resource *root = NULL;
163
164 if (res->flags & IORESOURCE_IO)
165 root = &ioport_resource;
166 if (res->flags & IORESOURCE_MEM)
167 root = &iomem_resource;
168
169 return root;
170}
171
159#define pcibios_scan_all_fns(a, b) 0 172#define pcibios_scan_all_fns(a, b) 0
160 173
161#endif /* _ASM_IA64_PCI_H */ 174#endif /* _ASM_IA64_PCI_H */
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h
index 91bbd1f22461..94e07e727395 100644
--- a/include/asm-ia64/processor.h
+++ b/include/asm-ia64/processor.h
@@ -20,9 +20,6 @@
20#include <asm/ptrace.h> 20#include <asm/ptrace.h>
21#include <asm/ustack.h> 21#include <asm/ustack.h>
22 22
23/* Our arch specific arch_init_sched_domain is in arch/ia64/kernel/domain.c */
24#define ARCH_HAS_SCHED_DOMAIN
25
26#define IA64_NUM_DBG_REGS 8 23#define IA64_NUM_DBG_REGS 8
27/* 24/*
28 * Limits for PMC and PMD are set to less than maximum architected values 25 * Limits for PMC and PMD are set to less than maximum architected values
diff --git a/include/asm-ia64/ptrace.h b/include/asm-ia64/ptrace.h
index 0bef19538406..c8766def9ee6 100644
--- a/include/asm-ia64/ptrace.h
+++ b/include/asm-ia64/ptrace.h
@@ -57,7 +57,7 @@
57#include <linux/config.h> 57#include <linux/config.h>
58 58
59#include <asm/fpu.h> 59#include <asm/fpu.h>
60#include <asm/offsets.h> 60#include <asm/asm-offsets.h>
61 61
62/* 62/*
63 * Base-2 logarithm of number of pages to allocate per task structure 63 * Base-2 logarithm of number of pages to allocate per task structure
diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h
index 33256db4a7cf..635235fa1e32 100644
--- a/include/asm-ia64/system.h
+++ b/include/asm-ia64/system.h
@@ -275,6 +275,7 @@ extern void ia64_load_extra (struct task_struct *task);
275 */ 275 */
276#define __ARCH_WANT_UNLOCKED_CTXSW 276#define __ARCH_WANT_UNLOCKED_CTXSW
277 277
278#define ARCH_HAS_PREFETCH_SWITCH_STACK
278#define ia64_platform_is(x) (strcmp(x, platform_name) == 0) 279#define ia64_platform_is(x) (strcmp(x, platform_name) == 0)
279 280
280void cpu_idle_wait(void); 281void cpu_idle_wait(void);
diff --git a/include/asm-ia64/thread_info.h b/include/asm-ia64/thread_info.h
index 7dc8951708a3..b2c79f0694f8 100644
--- a/include/asm-ia64/thread_info.h
+++ b/include/asm-ia64/thread_info.h
@@ -5,7 +5,7 @@
5#ifndef _ASM_IA64_THREAD_INFO_H 5#ifndef _ASM_IA64_THREAD_INFO_H
6#define _ASM_IA64_THREAD_INFO_H 6#define _ASM_IA64_THREAD_INFO_H
7 7
8#include <asm/offsets.h> 8#include <asm/asm-offsets.h>
9#include <asm/processor.h> 9#include <asm/processor.h>
10#include <asm/ptrace.h> 10#include <asm/ptrace.h>
11 11
diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h
index 399bc29729fd..a9f738bf18a7 100644
--- a/include/asm-ia64/topology.h
+++ b/include/asm-ia64/topology.h
@@ -98,29 +98,6 @@ void build_cpu_to_node_map(void);
98 .nr_balance_failed = 0, \ 98 .nr_balance_failed = 0, \
99} 99}
100 100
101/* sched_domains SD_ALLNODES_INIT for IA64 NUMA machines */
102#define SD_ALLNODES_INIT (struct sched_domain) { \
103 .span = CPU_MASK_NONE, \
104 .parent = NULL, \
105 .groups = NULL, \
106 .min_interval = 64, \
107 .max_interval = 64*num_online_cpus(), \
108 .busy_factor = 128, \
109 .imbalance_pct = 133, \
110 .cache_hot_time = (10*1000000), \
111 .cache_nice_tries = 1, \
112 .busy_idx = 3, \
113 .idle_idx = 3, \
114 .newidle_idx = 0, /* unused */ \
115 .wake_idx = 0, /* unused */ \
116 .forkexec_idx = 0, /* unused */ \
117 .per_cpu_gain = 100, \
118 .flags = SD_LOAD_BALANCE, \
119 .last_balance = jiffies, \
120 .balance_interval = 64, \
121 .nr_balance_failed = 0, \
122}
123
124#endif /* CONFIG_NUMA */ 101#endif /* CONFIG_NUMA */
125 102
126#include <asm-generic/topology.h> 103#include <asm-generic/topology.h>
diff --git a/include/asm-ia64/types.h b/include/asm-ia64/types.h
index a677565aa954..902850d12424 100644
--- a/include/asm-ia64/types.h
+++ b/include/asm-ia64/types.h
@@ -67,8 +67,6 @@ typedef __u64 u64;
67 67
68typedef u64 dma_addr_t; 68typedef u64 dma_addr_t;
69 69
70typedef unsigned short kmem_bufctl_t;
71
72# endif /* __KERNEL__ */ 70# endif /* __KERNEL__ */
73#endif /* !__ASSEMBLY__ */ 71#endif /* !__ASSEMBLY__ */
74 72
diff --git a/include/asm-ia64/uaccess.h b/include/asm-ia64/uaccess.h
index 8edd9a90949c..3a7829bb5954 100644
--- a/include/asm-ia64/uaccess.h
+++ b/include/asm-ia64/uaccess.h
@@ -72,13 +72,6 @@
72}) 72})
73#define access_ok(type, addr, size) __access_ok((addr), (size), get_fs()) 73#define access_ok(type, addr, size) __access_ok((addr), (size), get_fs())
74 74
75/* this function will go away soon - use access_ok() instead */
76static inline int __deprecated
77verify_area (int type, const void __user *addr, unsigned long size)
78{
79 return access_ok(type, addr, size) ? 0 : -EFAULT;
80}
81
82/* 75/*
83 * These are the main single-value transfer routines. They automatically 76 * These are the main single-value transfer routines. They automatically
84 * use the right size if we just have the right pointer type. 77 * use the right size if we just have the right pointer type.
diff --git a/include/asm-m32r/auxvec.h b/include/asm-m32r/auxvec.h
new file mode 100644
index 000000000000..f76dcc860fae
--- /dev/null
+++ b/include/asm-m32r/auxvec.h
@@ -0,0 +1,4 @@
1#ifndef _ASM_M32R__AUXVEC_H
2#define _ASM_M32R__AUXVEC_H
3
4#endif /* _ASM_M32R__AUXVEC_H */
diff --git a/include/asm-m32r/fcntl.h b/include/asm-m32r/fcntl.h
index 3e3089572028..46ab12db5739 100644
--- a/include/asm-m32r/fcntl.h
+++ b/include/asm-m32r/fcntl.h
@@ -1,92 +1 @@
1#ifndef _ASM_M32R_FCNTL_H #include <asm-generic/fcntl.h>
2#define _ASM_M32R_FCNTL_H
3
4/* $Id$ */
5
6/* orig : i386 2.4.18 */
7
8/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
9 located on an ext2 file system */
10#define O_ACCMODE 0003
11#define O_RDONLY 00
12#define O_WRONLY 01
13#define O_RDWR 02
14#define O_CREAT 0100 /* not fcntl */
15#define O_EXCL 0200 /* not fcntl */
16#define O_NOCTTY 0400 /* not fcntl */
17#define O_TRUNC 01000 /* not fcntl */
18#define O_APPEND 02000
19#define O_NONBLOCK 04000
20#define O_NDELAY O_NONBLOCK
21#define O_SYNC 010000
22#define FASYNC 020000 /* fcntl, for BSD compatibility */
23#define O_DIRECT 040000 /* direct disk access hint */
24#define O_LARGEFILE 0100000
25#define O_DIRECTORY 0200000 /* must be a directory */
26#define O_NOFOLLOW 0400000 /* don't follow links */
27#define O_NOATIME 01000000
28
29#define F_DUPFD 0 /* dup */
30#define F_GETFD 1 /* get close_on_exec */
31#define F_SETFD 2 /* set/clear close_on_exec */
32#define F_GETFL 3 /* get file->f_flags */
33#define F_SETFL 4 /* set file->f_flags */
34#define F_GETLK 5
35#define F_SETLK 6
36#define F_SETLKW 7
37
38#define F_SETOWN 8 /* for sockets. */
39#define F_GETOWN 9 /* for sockets. */
40#define F_SETSIG 10 /* for sockets. */
41#define F_GETSIG 11 /* for sockets. */
42
43#define F_GETLK64 12 /* using 'struct flock64' */
44#define F_SETLK64 13
45#define F_SETLKW64 14
46
47/* for F_[GET|SET]FL */
48#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
49
50/* for posix fcntl() and lockf() */
51#define F_RDLCK 0
52#define F_WRLCK 1
53#define F_UNLCK 2
54
55/* for old implementation of bsd flock () */
56#define F_EXLCK 4 /* or 3 */
57#define F_SHLCK 8 /* or 4 */
58
59/* for leases */
60#define F_INPROGRESS 16
61
62/* operations for bsd flock(), also used by the kernel implementation */
63#define LOCK_SH 1 /* shared lock */
64#define LOCK_EX 2 /* exclusive lock */
65#define LOCK_NB 4 /* or'd with one of the above to prevent
66 blocking */
67#define LOCK_UN 8 /* remove lock */
68
69#define LOCK_MAND 32 /* This is a mandatory flock */
70#define LOCK_READ 64 /* ... Which allows concurrent read operations */
71#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
72#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
73
74struct flock {
75 short l_type;
76 short l_whence;
77 off_t l_start;
78 off_t l_len;
79 pid_t l_pid;
80};
81
82struct flock64 {
83 short l_type;
84 short l_whence;
85 loff_t l_start;
86 loff_t l_len;
87 pid_t l_pid;
88};
89
90#define F_LINUX_SPECIFIC_BASE 1024
91
92#endif /* _ASM_M32R_FCNTL_H */
diff --git a/include/asm-m32r/futex.h b/include/asm-m32r/futex.h
new file mode 100644
index 000000000000..2cac5ecd9d00
--- /dev/null
+++ b/include/asm-m32r/futex.h
@@ -0,0 +1,53 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/uaccess.h>
9
10static inline int
11futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
12{
13 int op = (encoded_op >> 28) & 7;
14 int cmp = (encoded_op >> 24) & 15;
15 int oparg = (encoded_op << 8) >> 20;
16 int cmparg = (encoded_op << 20) >> 20;
17 int oldval = 0, ret, tem;
18 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
19 oparg = 1 << oparg;
20
21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
22 return -EFAULT;
23
24 inc_preempt_count();
25
26 switch (op) {
27 case FUTEX_OP_SET:
28 case FUTEX_OP_ADD:
29 case FUTEX_OP_OR:
30 case FUTEX_OP_ANDN:
31 case FUTEX_OP_XOR:
32 default:
33 ret = -ENOSYS;
34 }
35
36 dec_preempt_count();
37
38 if (!ret) {
39 switch (cmp) {
40 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
41 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
42 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
43 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
44 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
45 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
46 default: ret = -ENOSYS;
47 }
48 }
49 return ret;
50}
51
52#endif
53#endif
diff --git a/include/asm-m32r/hdreg.h b/include/asm-m32r/hdreg.h
deleted file mode 100644
index 7f7fd1af0af3..000000000000
--- a/include/asm-m32r/hdreg.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/hdreg.h>
diff --git a/include/asm-m32r/page.h b/include/asm-m32r/page.h
index 1c6abb9f3f1f..4ab578876361 100644
--- a/include/asm-m32r/page.h
+++ b/include/asm-m32r/page.h
@@ -61,25 +61,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
61 61
62/* This handles the memory map.. */ 62/* This handles the memory map.. */
63 63
64#ifndef __ASSEMBLY__
65
66/* Pure 2^n version of get_order */
67static __inline__ int get_order(unsigned long size)
68{
69 int order;
70
71 size = (size - 1) >> (PAGE_SHIFT - 1);
72 order = -1;
73 do {
74 size >>= 1;
75 order++;
76 } while (size);
77
78 return order;
79}
80
81#endif /* __ASSEMBLY__ */
82
83#define __MEMORY_START CONFIG_MEMORY_START 64#define __MEMORY_START CONFIG_MEMORY_START
84#define __MEMORY_SIZE CONFIG_MEMORY_SIZE 65#define __MEMORY_SIZE CONFIG_MEMORY_SIZE
85 66
@@ -111,5 +92,7 @@ static __inline__ int get_order(unsigned long size)
111 92
112#endif /* __KERNEL__ */ 93#endif /* __KERNEL__ */
113 94
95#include <asm-generic/page.h>
96
114#endif /* _ASM_M32R_PAGE_H */ 97#endif /* _ASM_M32R_PAGE_H */
115 98
diff --git a/include/asm-m32r/types.h b/include/asm-m32r/types.h
index ca0a887d2237..fcf24c64c3ba 100644
--- a/include/asm-m32r/types.h
+++ b/include/asm-m32r/types.h
@@ -55,8 +55,6 @@ typedef unsigned long long u64;
55typedef u32 dma_addr_t; 55typedef u32 dma_addr_t;
56typedef u64 dma64_addr_t; 56typedef u64 dma64_addr_t;
57 57
58typedef unsigned short kmem_bufctl_t;
59
60#endif /* __ASSEMBLY__ */ 58#endif /* __ASSEMBLY__ */
61 59
62#endif /* __KERNEL__ */ 60#endif /* __KERNEL__ */
diff --git a/include/asm-m32r/uaccess.h b/include/asm-m32r/uaccess.h
index bbb8ac4018a0..93d863c455a1 100644
--- a/include/asm-m32r/uaccess.h
+++ b/include/asm-m32r/uaccess.h
@@ -120,31 +120,6 @@ static inline int access_ok(int type, const void *addr, unsigned long size)
120} 120}
121#endif /* CONFIG_MMU */ 121#endif /* CONFIG_MMU */
122 122
123/**
124 * verify_area: - Obsolete/deprecated and will go away soon,
125 * use access_ok() instead.
126 * @type: Type of access: %VERIFY_READ or %VERIFY_WRITE
127 * @addr: User space pointer to start of block to check
128 * @size: Size of block to check
129 *
130 * Context: User context only. This function may sleep.
131 *
132 * This function has been replaced by access_ok().
133 *
134 * Checks if a pointer to a block of memory in user space is valid.
135 *
136 * Returns zero if the memory block may be valid, -EFAULT
137 * if it is definitely invalid.
138 *
139 * See access_ok() for more details.
140 */
141static inline int __deprecated verify_area(int type, const void __user *addr,
142 unsigned long size)
143{
144 return access_ok(type, addr, size) ? 0 : -EFAULT;
145}
146
147
148/* 123/*
149 * The exception table consists of pairs of addresses: the first is the 124 * The exception table consists of pairs of addresses: the first is the
150 * address of an instruction that is allowed to fault, and the second is 125 * address of an instruction that is allowed to fault, and the second is
diff --git a/include/asm-m68k/auxvec.h b/include/asm-m68k/auxvec.h
new file mode 100644
index 000000000000..844d6d52204b
--- /dev/null
+++ b/include/asm-m68k/auxvec.h
@@ -0,0 +1,4 @@
1#ifndef __ASMm68k_AUXVEC_H
2#define __ASMm68k_AUXVEC_H
3
4#endif
diff --git a/include/asm-m68k/cacheflush.h b/include/asm-m68k/cacheflush.h
index e4773946f10d..8aba971b1368 100644
--- a/include/asm-m68k/cacheflush.h
+++ b/include/asm-m68k/cacheflush.h
@@ -130,20 +130,25 @@ static inline void __flush_page_to_ram(void *vaddr)
130#define flush_dcache_mmap_lock(mapping) do { } while (0) 130#define flush_dcache_mmap_lock(mapping) do { } while (0)
131#define flush_dcache_mmap_unlock(mapping) do { } while (0) 131#define flush_dcache_mmap_unlock(mapping) do { } while (0)
132#define flush_icache_page(vma, page) __flush_page_to_ram(page_address(page)) 132#define flush_icache_page(vma, page) __flush_page_to_ram(page_address(page))
133#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
134
135#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
136 do { \
137 flush_cache_page(vma, vaddr, page_to_pfn(page));\
138 memcpy(dst, src, len); \
139 } while (0)
140
141#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
142 do { \
143 flush_cache_page(vma, vaddr, page_to_pfn(page));\
144 memcpy(dst, src, len); \
145 } while (0)
146 133
134extern void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
135 unsigned long addr, int len);
147extern void flush_icache_range(unsigned long address, unsigned long endaddr); 136extern void flush_icache_range(unsigned long address, unsigned long endaddr);
148 137
138static inline void copy_to_user_page(struct vm_area_struct *vma,
139 struct page *page, unsigned long vaddr,
140 void *dst, void *src, int len)
141{
142 flush_cache_page(vma, vaddr, page_to_pfn(page));
143 memcpy(dst, src, len);
144 flush_icache_user_range(vma, page, vaddr, len);
145}
146static inline void copy_from_user_page(struct vm_area_struct *vma,
147 struct page *page, unsigned long vaddr,
148 void *dst, void *src, int len)
149{
150 flush_cache_page(vma, vaddr, page_to_pfn(page));
151 memcpy(dst, src, len);
152}
153
149#endif /* _M68K_CACHEFLUSH_H */ 154#endif /* _M68K_CACHEFLUSH_H */
diff --git a/include/asm-m68k/fcntl.h b/include/asm-m68k/fcntl.h
index 0d4212983a33..1c369b20dc45 100644
--- a/include/asm-m68k/fcntl.h
+++ b/include/asm-m68k/fcntl.h
@@ -1,87 +1,11 @@
1#ifndef _M68K_FCNTL_H 1#ifndef _M68K_FCNTL_H
2#define _M68K_FCNTL_H 2#define _M68K_FCNTL_H
3 3
4/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
5 located on an ext2 file system */
6#define O_ACCMODE 0003
7#define O_RDONLY 00
8#define O_WRONLY 01
9#define O_RDWR 02
10#define O_CREAT 0100 /* not fcntl */
11#define O_EXCL 0200 /* not fcntl */
12#define O_NOCTTY 0400 /* not fcntl */
13#define O_TRUNC 01000 /* not fcntl */
14#define O_APPEND 02000
15#define O_NONBLOCK 04000
16#define O_NDELAY O_NONBLOCK
17#define O_SYNC 010000
18#define FASYNC 020000 /* fcntl, for BSD compatibility */
19#define O_DIRECTORY 040000 /* must be a directory */ 4#define O_DIRECTORY 040000 /* must be a directory */
20#define O_NOFOLLOW 0100000 /* don't follow links */ 5#define O_NOFOLLOW 0100000 /* don't follow links */
21#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */ 6#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
22#define O_LARGEFILE 0400000 7#define O_LARGEFILE 0400000
23#define O_NOATIME 01000000
24 8
25#define F_DUPFD 0 /* dup */ 9#include <asm-generic/fcntl.h>
26#define F_GETFD 1 /* get close_on_exec */
27#define F_SETFD 2 /* set/clear close_on_exec */
28#define F_GETFL 3 /* get file->f_flags */
29#define F_SETFL 4 /* set file->f_flags */
30#define F_GETLK 5
31#define F_SETLK 6
32#define F_SETLKW 7
33 10
34#define F_SETOWN 8 /* for sockets. */
35#define F_GETOWN 9 /* for sockets. */
36#define F_SETSIG 10 /* for sockets. */
37#define F_GETSIG 11 /* for sockets. */
38
39#define F_GETLK64 12 /* using 'struct flock64' */
40#define F_SETLK64 13
41#define F_SETLKW64 14
42
43/* for F_[GET|SET]FL */
44#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
45
46/* for posix fcntl() and lockf() */
47#define F_RDLCK 0
48#define F_WRLCK 1
49#define F_UNLCK 2
50
51/* for old implementation of bsd flock () */
52#define F_EXLCK 4 /* or 3 */
53#define F_SHLCK 8 /* or 4 */
54
55/* for leases */
56#define F_INPROGRESS 16
57
58/* operations for bsd flock(), also used by the kernel implementation */
59#define LOCK_SH 1 /* shared lock */
60#define LOCK_EX 2 /* exclusive lock */
61#define LOCK_NB 4 /* or'd with one of the above to prevent
62 blocking */
63#define LOCK_UN 8 /* remove lock */
64
65#define LOCK_MAND 32 /* This is a mandatory flock */
66#define LOCK_READ 64 /* ... Which allows concurrent read operations */
67#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
68#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
69
70struct flock {
71 short l_type;
72 short l_whence;
73 off_t l_start;
74 off_t l_len;
75 pid_t l_pid;
76};
77
78struct flock64 {
79 short l_type;
80 short l_whence;
81 loff_t l_start;
82 loff_t l_len;
83 pid_t l_pid;
84};
85
86#define F_LINUX_SPECIFIC_BASE 1024
87#endif /* _M68K_FCNTL_H */ 11#endif /* _M68K_FCNTL_H */
diff --git a/include/asm-m68k/futex.h b/include/asm-m68k/futex.h
new file mode 100644
index 000000000000..2cac5ecd9d00
--- /dev/null
+++ b/include/asm-m68k/futex.h
@@ -0,0 +1,53 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/uaccess.h>
9
10static inline int
11futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
12{
13 int op = (encoded_op >> 28) & 7;
14 int cmp = (encoded_op >> 24) & 15;
15 int oparg = (encoded_op << 8) >> 20;
16 int cmparg = (encoded_op << 20) >> 20;
17 int oldval = 0, ret, tem;
18 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
19 oparg = 1 << oparg;
20
21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
22 return -EFAULT;
23
24 inc_preempt_count();
25
26 switch (op) {
27 case FUTEX_OP_SET:
28 case FUTEX_OP_ADD:
29 case FUTEX_OP_OR:
30 case FUTEX_OP_ANDN:
31 case FUTEX_OP_XOR:
32 default:
33 ret = -ENOSYS;
34 }
35
36 dec_preempt_count();
37
38 if (!ret) {
39 switch (cmp) {
40 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
41 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
42 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
43 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
44 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
45 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
46 default: ret = -ENOSYS;
47 }
48 }
49 return ret;
50}
51
52#endif
53#endif
diff --git a/include/asm-m68k/hdreg.h b/include/asm-m68k/hdreg.h
deleted file mode 100644
index 5989bbc97cbf..000000000000
--- a/include/asm-m68k/hdreg.h
+++ /dev/null
@@ -1 +0,0 @@
1#warning this file is obsolete, please do not use it
diff --git a/include/asm-m68k/page.h b/include/asm-m68k/page.h
index 206313e2a817..f206dfbc1d48 100644
--- a/include/asm-m68k/page.h
+++ b/include/asm-m68k/page.h
@@ -107,20 +107,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
107/* to align the pointer to the (next) page boundary */ 107/* to align the pointer to the (next) page boundary */
108#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) 108#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
109 109
110/* Pure 2^n version of get_order */
111static inline int get_order(unsigned long size)
112{
113 int order;
114
115 size = (size-1) >> (PAGE_SHIFT-1);
116 order = -1;
117 do {
118 size >>= 1;
119 order++;
120 } while (size);
121 return order;
122}
123
124#endif /* !__ASSEMBLY__ */ 110#endif /* !__ASSEMBLY__ */
125 111
126#include <asm/page_offset.h> 112#include <asm/page_offset.h>
@@ -192,4 +178,6 @@ static inline void *__va(unsigned long x)
192 178
193#endif /* __KERNEL__ */ 179#endif /* __KERNEL__ */
194 180
181#include <asm-generic/page.h>
182
195#endif /* _M68K_PAGE_H */ 183#endif /* _M68K_PAGE_H */
diff --git a/include/asm-m68k/string.h b/include/asm-m68k/string.h
index 44def078132a..6c59215b285e 100644
--- a/include/asm-m68k/string.h
+++ b/include/asm-m68k/string.h
@@ -80,43 +80,6 @@ static inline char * strchr(const char * s, int c)
80 return( (char *) s); 80 return( (char *) s);
81} 81}
82 82
83#if 0
84#define __HAVE_ARCH_STRPBRK
85static inline char *strpbrk(const char *cs,const char *ct)
86{
87 const char *sc1,*sc2;
88
89 for( sc1 = cs; *sc1 != '\0'; ++sc1)
90 for( sc2 = ct; *sc2 != '\0'; ++sc2)
91 if (*sc1 == *sc2)
92 return((char *) sc1);
93 return( NULL );
94}
95#endif
96
97#if 0
98#define __HAVE_ARCH_STRSPN
99static inline size_t strspn(const char *s, const char *accept)
100{
101 const char *p;
102 const char *a;
103 size_t count = 0;
104
105 for (p = s; *p != '\0'; ++p)
106 {
107 for (a = accept; *a != '\0'; ++a)
108 if (*p == *a)
109 break;
110 if (*a == '\0')
111 return count;
112 else
113 ++count;
114 }
115
116 return count;
117}
118#endif
119
120/* strstr !! */ 83/* strstr !! */
121 84
122#define __HAVE_ARCH_STRLEN 85#define __HAVE_ARCH_STRLEN
@@ -173,370 +136,18 @@ static inline int strncmp(const char * cs,const char * ct,size_t count)
173} 136}
174 137
175#define __HAVE_ARCH_MEMSET 138#define __HAVE_ARCH_MEMSET
176/* 139extern void *memset(void *, int, __kernel_size_t);
177 * This is really ugly, but its highly optimizatiable by the 140#define memset(d, c, n) __builtin_memset(d, c, n)
178 * compiler and is meant as compensation for gcc's missing
179 * __builtin_memset(). For the 680[23]0 it might be worth considering
180 * the optimal number of misaligned writes compared to the number of
181 * tests'n'branches needed to align the destination address. The
182 * 680[46]0 doesn't really care due to their copy-back caches.
183 * 10/09/96 - Jes Sorensen
184 */
185static inline void * __memset_g(void * s, int c, size_t count)
186{
187 void *xs = s;
188 size_t temp;
189
190 if (!count)
191 return xs;
192
193 c &= 0xff;
194 c |= c << 8;
195 c |= c << 16;
196
197 if (count < 36){
198 long *ls = s;
199
200 switch(count){
201 case 32: case 33: case 34: case 35:
202 *ls++ = c;
203 case 28: case 29: case 30: case 31:
204 *ls++ = c;
205 case 24: case 25: case 26: case 27:
206 *ls++ = c;
207 case 20: case 21: case 22: case 23:
208 *ls++ = c;
209 case 16: case 17: case 18: case 19:
210 *ls++ = c;
211 case 12: case 13: case 14: case 15:
212 *ls++ = c;
213 case 8: case 9: case 10: case 11:
214 *ls++ = c;
215 case 4: case 5: case 6: case 7:
216 *ls++ = c;
217 break;
218 default:
219 break;
220 }
221 s = ls;
222 if (count & 0x02){
223 short *ss = s;
224 *ss++ = c;
225 s = ss;
226 }
227 if (count & 0x01){
228 char *cs = s;
229 *cs++ = c;
230 s = cs;
231 }
232 return xs;
233 }
234
235 if ((long) s & 1)
236 {
237 char *cs = s;
238 *cs++ = c;
239 s = cs;
240 count--;
241 }
242 if (count > 2 && (long) s & 2)
243 {
244 short *ss = s;
245 *ss++ = c;
246 s = ss;
247 count -= 2;
248 }
249 temp = count >> 2;
250 if (temp)
251 {
252 long *ls = s;
253 temp--;
254 do
255 *ls++ = c;
256 while (temp--);
257 s = ls;
258 }
259 if (count & 2)
260 {
261 short *ss = s;
262 *ss++ = c;
263 s = ss;
264 }
265 if (count & 1)
266 {
267 char *cs = s;
268 *cs = c;
269 }
270 return xs;
271}
272
273/*
274 * __memset_page assumes that data is longword aligned. Most, if not
275 * all, of these page sized memsets are performed on page aligned
276 * areas, thus we do not need to check if the destination is longword
277 * aligned. Of course we suffer a serious performance loss if this is
278 * not the case but I think the risk of this ever happening is
279 * extremely small. We spend a lot of time clearing pages in
280 * get_empty_page() so I think it is worth it anyway. Besides, the
281 * 680[46]0 do not really care about misaligned writes due to their
282 * copy-back cache.
283 *
284 * The optimized case for the 680[46]0 is implemented using the move16
285 * instruction. My tests showed that this implementation is 35-45%
286 * faster than the original implementation using movel, the only
287 * caveat is that the destination address must be 16-byte aligned.
288 * 01/09/96 - Jes Sorensen
289 */
290static inline void * __memset_page(void * s,int c,size_t count)
291{
292 unsigned long data, tmp;
293 void *xs = s;
294
295 c = c & 255;
296 data = c | (c << 8);
297 data |= data << 16;
298
299#ifdef CPU_M68040_OR_M68060_ONLY
300
301 if (((unsigned long) s) & 0x0f)
302 __memset_g(s, c, count);
303 else{
304 unsigned long *sp = s;
305 *sp++ = data;
306 *sp++ = data;
307 *sp++ = data;
308 *sp++ = data;
309
310 __asm__ __volatile__("1:\t"
311 ".chip 68040\n\t"
312 "move16 %2@+,%0@+\n\t"
313 ".chip 68k\n\t"
314 "subqw #8,%2\n\t"
315 "subqw #8,%2\n\t"
316 "dbra %1,1b\n\t"
317 : "=a" (sp), "=d" (tmp)
318 : "a" (s), "0" (sp), "1" ((count - 16) / 16 - 1)
319 );
320 }
321
322#else
323 __asm__ __volatile__("1:\t"
324 "movel %2,%0@+\n\t"
325 "movel %2,%0@+\n\t"
326 "movel %2,%0@+\n\t"
327 "movel %2,%0@+\n\t"
328 "movel %2,%0@+\n\t"
329 "movel %2,%0@+\n\t"
330 "movel %2,%0@+\n\t"
331 "movel %2,%0@+\n\t"
332 "dbra %1,1b\n\t"
333 : "=a" (s), "=d" (tmp)
334 : "d" (data), "0" (s), "1" (count / 32 - 1)
335 );
336#endif
337
338 return xs;
339}
340
341extern void *memset(void *,int,__kernel_size_t);
342
343#define __memset_const(s,c,count) \
344((count==PAGE_SIZE) ? \
345 __memset_page((s),(c),(count)) : \
346 __memset_g((s),(c),(count)))
347
348#define memset(s, c, count) \
349(__builtin_constant_p(count) ? \
350 __memset_const((s),(c),(count)) : \
351 __memset_g((s),(c),(count)))
352 141
353#define __HAVE_ARCH_MEMCPY 142#define __HAVE_ARCH_MEMCPY
354extern void * memcpy(void *, const void *, size_t ); 143extern void *memcpy(void *, const void *, __kernel_size_t);
355/* 144#define memcpy(d, s, n) __builtin_memcpy(d, s, n)
356 * __builtin_memcpy() does not handle page-sized memcpys very well,
357 * thus following the same assumptions as for page-sized memsets, this
358 * function copies page-sized areas using an unrolled loop, without
359 * considering alignment.
360 *
361 * For the 680[46]0 only kernels we use the move16 instruction instead
362 * as it writes through the data-cache, invalidating the cache-lines
363 * touched. In this way we do not use up the entire data-cache (well,
364 * half of it on the 68060) by copying a page. An unrolled loop of two
365 * move16 instructions seem to the fastest. The only caveat is that
366 * both source and destination must be 16-byte aligned, if not we fall
367 * back to the generic memcpy function. - Jes
368 */
369static inline void * __memcpy_page(void * to, const void * from, size_t count)
370{
371 unsigned long tmp;
372 void *xto = to;
373
374#ifdef CPU_M68040_OR_M68060_ONLY
375
376 if (((unsigned long) to | (unsigned long) from) & 0x0f)
377 return memcpy(to, from, count);
378
379 __asm__ __volatile__("1:\t"
380 ".chip 68040\n\t"
381 "move16 %1@+,%0@+\n\t"
382 "move16 %1@+,%0@+\n\t"
383 ".chip 68k\n\t"
384 "dbra %2,1b\n\t"
385 : "=a" (to), "=a" (from), "=d" (tmp)
386 : "0" (to), "1" (from) , "2" (count / 32 - 1)
387 );
388#else
389 __asm__ __volatile__("1:\t"
390 "movel %1@+,%0@+\n\t"
391 "movel %1@+,%0@+\n\t"
392 "movel %1@+,%0@+\n\t"
393 "movel %1@+,%0@+\n\t"
394 "movel %1@+,%0@+\n\t"
395 "movel %1@+,%0@+\n\t"
396 "movel %1@+,%0@+\n\t"
397 "movel %1@+,%0@+\n\t"
398 "dbra %2,1b\n\t"
399 : "=a" (to), "=a" (from), "=d" (tmp)
400 : "0" (to), "1" (from) , "2" (count / 32 - 1)
401 );
402#endif
403 return xto;
404}
405
406#define __memcpy_const(to, from, n) \
407((n==PAGE_SIZE) ? \
408 __memcpy_page((to),(from),(n)) : \
409 __builtin_memcpy((to),(from),(n)))
410
411#define memcpy(to, from, n) \
412(__builtin_constant_p(n) ? \
413 __memcpy_const((to),(from),(n)) : \
414 memcpy((to),(from),(n)))
415 145
416#define __HAVE_ARCH_MEMMOVE 146#define __HAVE_ARCH_MEMMOVE
417static inline void * memmove(void * dest,const void * src, size_t n) 147extern void *memmove(void *, const void *, __kernel_size_t);
418{
419 void *xdest = dest;
420 size_t temp;
421
422 if (!n)
423 return xdest;
424
425 if (dest < src)
426 {
427 if ((long) dest & 1)
428 {
429 char *cdest = dest;
430 const char *csrc = src;
431 *cdest++ = *csrc++;
432 dest = cdest;
433 src = csrc;
434 n--;
435 }
436 if (n > 2 && (long) dest & 2)
437 {
438 short *sdest = dest;
439 const short *ssrc = src;
440 *sdest++ = *ssrc++;
441 dest = sdest;
442 src = ssrc;
443 n -= 2;
444 }
445 temp = n >> 2;
446 if (temp)
447 {
448 long *ldest = dest;
449 const long *lsrc = src;
450 temp--;
451 do
452 *ldest++ = *lsrc++;
453 while (temp--);
454 dest = ldest;
455 src = lsrc;
456 }
457 if (n & 2)
458 {
459 short *sdest = dest;
460 const short *ssrc = src;
461 *sdest++ = *ssrc++;
462 dest = sdest;
463 src = ssrc;
464 }
465 if (n & 1)
466 {
467 char *cdest = dest;
468 const char *csrc = src;
469 *cdest = *csrc;
470 }
471 }
472 else
473 {
474 dest = (char *) dest + n;
475 src = (const char *) src + n;
476 if ((long) dest & 1)
477 {
478 char *cdest = dest;
479 const char *csrc = src;
480 *--cdest = *--csrc;
481 dest = cdest;
482 src = csrc;
483 n--;
484 }
485 if (n > 2 && (long) dest & 2)
486 {
487 short *sdest = dest;
488 const short *ssrc = src;
489 *--sdest = *--ssrc;
490 dest = sdest;
491 src = ssrc;
492 n -= 2;
493 }
494 temp = n >> 2;
495 if (temp)
496 {
497 long *ldest = dest;
498 const long *lsrc = src;
499 temp--;
500 do
501 *--ldest = *--lsrc;
502 while (temp--);
503 dest = ldest;
504 src = lsrc;
505 }
506 if (n & 2)
507 {
508 short *sdest = dest;
509 const short *ssrc = src;
510 *--sdest = *--ssrc;
511 dest = sdest;
512 src = ssrc;
513 }
514 if (n & 1)
515 {
516 char *cdest = dest;
517 const char *csrc = src;
518 *--cdest = *--csrc;
519 }
520 }
521 return xdest;
522}
523 148
524#define __HAVE_ARCH_MEMCMP 149#define __HAVE_ARCH_MEMCMP
525extern int memcmp(const void * ,const void * ,size_t ); 150extern int memcmp(const void *, const void *, __kernel_size_t);
526#define memcmp(cs, ct, n) \ 151#define memcmp(d, s, n) __builtin_memcmp(d, s, n)
527(__builtin_constant_p(n) ? \
528 __builtin_memcmp((cs),(ct),(n)) : \
529 memcmp((cs),(ct),(n)))
530
531#define __HAVE_ARCH_MEMCHR
532static inline void *memchr(const void *cs, int c, size_t count)
533{
534 /* Someone else can optimize this, I don't care - tonym@mac.linux-m68k.org */
535 unsigned char *ret = (unsigned char *)cs;
536 for(;count>0;count--,ret++)
537 if(*ret == c) return ret;
538
539 return NULL;
540}
541 152
542#endif /* _M68K_STRING_H_ */ 153#endif /* _M68K_STRING_H_ */
diff --git a/include/asm-m68k/types.h b/include/asm-m68k/types.h
index f391cbe39b96..b5a1febc97d4 100644
--- a/include/asm-m68k/types.h
+++ b/include/asm-m68k/types.h
@@ -60,8 +60,6 @@ typedef unsigned long long u64;
60typedef u32 dma_addr_t; 60typedef u32 dma_addr_t;
61typedef u32 dma64_addr_t; 61typedef u32 dma64_addr_t;
62 62
63typedef unsigned short kmem_bufctl_t;
64
65#endif /* __ASSEMBLY__ */ 63#endif /* __ASSEMBLY__ */
66 64
67#endif /* __KERNEL__ */ 65#endif /* __KERNEL__ */
diff --git a/include/asm-m68k/uaccess.h b/include/asm-m68k/uaccess.h
index 605e6cb811f8..f5cedf19cf68 100644
--- a/include/asm-m68k/uaccess.h
+++ b/include/asm-m68k/uaccess.h
@@ -14,12 +14,6 @@
14/* We let the MMU do all checking */ 14/* We let the MMU do all checking */
15#define access_ok(type,addr,size) 1 15#define access_ok(type,addr,size) 1
16 16
17/* this function will go away soon - use access_ok() instead */
18static inline int __deprecated verify_area(int type, const void *addr, unsigned long size)
19{
20 return access_ok(type,addr,size) ? 0 : -EFAULT;
21}
22
23/* 17/*
24 * The exception table consists of pairs of addresses: the first is the 18 * The exception table consists of pairs of addresses: the first is the
25 * address of an instruction that is allowed to fault, and the second is 19 * address of an instruction that is allowed to fault, and the second is
diff --git a/include/asm-m68knommu/auxvec.h b/include/asm-m68knommu/auxvec.h
new file mode 100644
index 000000000000..844d6d52204b
--- /dev/null
+++ b/include/asm-m68knommu/auxvec.h
@@ -0,0 +1,4 @@
1#ifndef __ASMm68k_AUXVEC_H
2#define __ASMm68k_AUXVEC_H
3
4#endif
diff --git a/include/asm-m68knommu/coldfire.h b/include/asm-m68knommu/coldfire.h
index 16f32cc80c40..1df3f666a28e 100644
--- a/include/asm-m68knommu/coldfire.h
+++ b/include/asm-m68knommu/coldfire.h
@@ -22,7 +22,7 @@
22#define MCF_MBAR2 0x80000000 22#define MCF_MBAR2 0x80000000
23#define MCF_IPSBAR 0x40000000 23#define MCF_IPSBAR 0x40000000
24 24
25#if defined(CONFIG_M527x) || defined(CONFIG_M528x) 25#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x)
26#undef MCF_MBAR 26#undef MCF_MBAR
27#define MCF_MBAR MCF_IPSBAR 27#define MCF_MBAR MCF_IPSBAR
28#endif 28#endif
@@ -54,6 +54,8 @@
54#define MCF_CLK 54000000 54#define MCF_CLK 54000000
55#elif defined(CONFIG_CLOCK_60MHz) 55#elif defined(CONFIG_CLOCK_60MHz)
56#define MCF_CLK 60000000 56#define MCF_CLK 60000000
57#elif defined(CONFIG_CLOCK_62_5MHz)
58#define MCF_CLK 62500000
57#elif defined(CONFIG_CLOCK_64MHz) 59#elif defined(CONFIG_CLOCK_64MHz)
58#define MCF_CLK 64000000 60#define MCF_CLK 64000000
59#elif defined(CONFIG_CLOCK_66MHz) 61#elif defined(CONFIG_CLOCK_66MHz)
@@ -76,7 +78,7 @@
76 * One some ColdFire family members the bus clock (used by internal 78 * One some ColdFire family members the bus clock (used by internal
77 * peripherals) is not the same as the CPU clock. 79 * peripherals) is not the same as the CPU clock.
78 */ 80 */
79#if defined(CONFIG_M5249) || defined(CONFIG_M527x) 81#if defined(CONFIG_M523x) || defined(CONFIG_M5249) || defined(CONFIG_M527x)
80#define MCF_BUSCLK (MCF_CLK / 2) 82#define MCF_BUSCLK (MCF_CLK / 2)
81#else 83#else
82#define MCF_BUSCLK MCF_CLK 84#define MCF_BUSCLK MCF_CLK
diff --git a/include/asm-m68knommu/futex.h b/include/asm-m68knommu/futex.h
new file mode 100644
index 000000000000..2cac5ecd9d00
--- /dev/null
+++ b/include/asm-m68knommu/futex.h
@@ -0,0 +1,53 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/uaccess.h>
9
10static inline int
11futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
12{
13 int op = (encoded_op >> 28) & 7;
14 int cmp = (encoded_op >> 24) & 15;
15 int oparg = (encoded_op << 8) >> 20;
16 int cmparg = (encoded_op << 20) >> 20;
17 int oldval = 0, ret, tem;
18 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
19 oparg = 1 << oparg;
20
21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
22 return -EFAULT;
23
24 inc_preempt_count();
25
26 switch (op) {
27 case FUTEX_OP_SET:
28 case FUTEX_OP_ADD:
29 case FUTEX_OP_OR:
30 case FUTEX_OP_ANDN:
31 case FUTEX_OP_XOR:
32 default:
33 ret = -ENOSYS;
34 }
35
36 dec_preempt_count();
37
38 if (!ret) {
39 switch (cmp) {
40 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
41 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
42 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
43 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
44 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
45 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
46 default: ret = -ENOSYS;
47 }
48 }
49 return ret;
50}
51
52#endif
53#endif
diff --git a/include/asm-m68knommu/hdreg.h b/include/asm-m68knommu/hdreg.h
deleted file mode 100644
index 5cdd9b084d37..000000000000
--- a/include/asm-m68knommu/hdreg.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-m68k/hdreg.h>
diff --git a/include/asm-m68knommu/m523xsim.h b/include/asm-m68knommu/m523xsim.h
new file mode 100644
index 000000000000..926cfb805df7
--- /dev/null
+++ b/include/asm-m68knommu/m523xsim.h
@@ -0,0 +1,46 @@
1/****************************************************************************/
2
3/*
4 * m523xsim.h -- ColdFire 523x System Integration Module support.
5 *
6 * (C) Copyright 2003-2005, Greg Ungerer <gerg@snapgear.com>
7 */
8
9/****************************************************************************/
10#ifndef m523xsim_h
11#define m523xsim_h
12/****************************************************************************/
13
14#include <linux/config.h>
15
16/*
17 * Define the 523x SIM register set addresses.
18 */
19#define MCFICM_INTC0 0x0c00 /* Base for Interrupt Ctrl 0 */
20#define MCFICM_INTC1 0x0d00 /* Base for Interrupt Ctrl 0 */
21#define MCFINTC_IPRH 0x00 /* Interrupt pending 32-63 */
22#define MCFINTC_IPRL 0x04 /* Interrupt pending 1-31 */
23#define MCFINTC_IMRH 0x08 /* Interrupt mask 32-63 */
24#define MCFINTC_IMRL 0x0c /* Interrupt mask 1-31 */
25#define MCFINTC_INTFRCH 0x10 /* Interrupt force 32-63 */
26#define MCFINTC_INTFRCL 0x14 /* Interrupt force 1-31 */
27#define MCFINTC_IRLR 0x18 /* */
28#define MCFINTC_IACKL 0x19 /* */
29#define MCFINTC_ICR0 0x40 /* Base ICR register */
30
31#define MCFINT_VECBASE 64 /* Vector base number */
32#define MCFINT_UART0 13 /* Interrupt number for UART0 */
33#define MCFINT_PIT1 36 /* Interrupt number for PIT1 */
34#define MCFINT_QSPI 18 /* Interrupt number for QSPI */
35
36/*
37 * SDRAM configuration registers.
38 */
39#define MCFSIM_DCR 0x44 /* SDRAM control */
40#define MCFSIM_DACR0 0x48 /* SDRAM base address 0 */
41#define MCFSIM_DMR0 0x4c /* SDRAM address mask 0 */
42#define MCFSIM_DACR1 0x50 /* SDRAM base address 1 */
43#define MCFSIM_DMR1 0x54 /* SDRAM address mask 1 */
44
45/****************************************************************************/
46#endif /* m523xsim_h */
diff --git a/include/asm-m68knommu/mcfsim.h b/include/asm-m68knommu/mcfsim.h
index 522e513c2bc6..b0c7736f7a99 100644
--- a/include/asm-m68knommu/mcfsim.h
+++ b/include/asm-m68knommu/mcfsim.h
@@ -15,13 +15,15 @@
15#include <linux/config.h> 15#include <linux/config.h>
16 16
17/* 17/*
18 * Include 5204, 5206/e, 5249, 5270/5271, 5272, 5280/5282, 5307 or 18 * Include 5204, 5206/e, 5235, 5249, 5270/5271, 5272, 5280/5282,
19 * 5407 specific addresses. 19 * 5307 or 5407 specific addresses.
20 */ 20 */
21#if defined(CONFIG_M5204) 21#if defined(CONFIG_M5204)
22#include <asm/m5204sim.h> 22#include <asm/m5204sim.h>
23#elif defined(CONFIG_M5206) || defined(CONFIG_M5206e) 23#elif defined(CONFIG_M5206) || defined(CONFIG_M5206e)
24#include <asm/m5206sim.h> 24#include <asm/m5206sim.h>
25#elif defined(CONFIG_M523x)
26#include <asm/m523xsim.h>
25#elif defined(CONFIG_M5249) 27#elif defined(CONFIG_M5249)
26#include <asm/m5249sim.h> 28#include <asm/m5249sim.h>
27#elif defined(CONFIG_M527x) 29#elif defined(CONFIG_M527x)
diff --git a/include/asm-m68knommu/mcfuart.h b/include/asm-m68knommu/mcfuart.h
index 54d4a85f4fdf..9c1210613bc7 100644
--- a/include/asm-m68knommu/mcfuart.h
+++ b/include/asm-m68knommu/mcfuart.h
@@ -29,7 +29,7 @@
29#define MCFUART_BASE1 0x140 /* Base address of UART1 */ 29#define MCFUART_BASE1 0x140 /* Base address of UART1 */
30#define MCFUART_BASE2 0x180 /* Base address of UART2 */ 30#define MCFUART_BASE2 0x180 /* Base address of UART2 */
31#endif 31#endif
32#elif defined(CONFIG_M527x) || defined(CONFIG_M528x) 32#elif defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x)
33#define MCFUART_BASE1 0x200 /* Base address of UART1 */ 33#define MCFUART_BASE1 0x200 /* Base address of UART1 */
34#define MCFUART_BASE2 0x240 /* Base address of UART2 */ 34#define MCFUART_BASE2 0x240 /* Base address of UART2 */
35#define MCFUART_BASE3 0x280 /* Base address of UART3 */ 35#define MCFUART_BASE3 0x280 /* Base address of UART3 */
diff --git a/include/asm-m68knommu/page.h b/include/asm-m68knommu/page.h
index ff6a9265ed1c..942dfbead27f 100644
--- a/include/asm-m68knommu/page.h
+++ b/include/asm-m68knommu/page.h
@@ -48,20 +48,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
48/* to align the pointer to the (next) page boundary */ 48/* to align the pointer to the (next) page boundary */
49#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) 49#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
50 50
51/* Pure 2^n version of get_order */
52extern __inline__ int get_order(unsigned long size)
53{
54 int order;
55
56 size = (size-1) >> (PAGE_SHIFT-1);
57 order = -1;
58 do {
59 size >>= 1;
60 order++;
61 } while (size);
62 return order;
63}
64
65extern unsigned long memory_start; 51extern unsigned long memory_start;
66extern unsigned long memory_end; 52extern unsigned long memory_end;
67 53
@@ -93,4 +79,6 @@ extern unsigned long memory_end;
93 79
94#endif /* __KERNEL__ */ 80#endif /* __KERNEL__ */
95 81
82#include <asm-generic/page.h>
83
96#endif /* _M68KNOMMU_PAGE_H */ 84#endif /* _M68KNOMMU_PAGE_H */
diff --git a/include/asm-m68knommu/uaccess.h b/include/asm-m68knommu/uaccess.h
index f0be74bb353c..05be9515a2d2 100644
--- a/include/asm-m68knommu/uaccess.h
+++ b/include/asm-m68knommu/uaccess.h
@@ -23,12 +23,6 @@ static inline int _access_ok(unsigned long addr, unsigned long size)
23 (is_in_rom(addr) && is_in_rom(addr+size))); 23 (is_in_rom(addr) && is_in_rom(addr+size)));
24} 24}
25 25
26/* this function will go away soon - use access_ok() instead */
27extern inline int __deprecated verify_area(int type, const void * addr, unsigned long size)
28{
29 return access_ok(type,addr,size)?0:-EFAULT;
30}
31
32/* 26/*
33 * The exception table consists of pairs of addresses: the first is the 27 * The exception table consists of pairs of addresses: the first is the
34 * address of an instruction that is allowed to fault, and the second is 28 * address of an instruction that is allowed to fault, and the second is
diff --git a/include/asm-mips/a.out.h b/include/asm-mips/a.out.h
index e42b3093e903..2b3dc3bed4da 100644
--- a/include/asm-mips/a.out.h
+++ b/include/asm-mips/a.out.h
@@ -35,10 +35,10 @@ struct exec
35 35
36#ifdef __KERNEL__ 36#ifdef __KERNEL__
37 37
38#ifdef CONFIG_MIPS32 38#ifdef CONFIG_32BIT
39#define STACK_TOP TASK_SIZE 39#define STACK_TOP TASK_SIZE
40#endif 40#endif
41#ifdef CONFIG_MIPS64 41#ifdef CONFIG_64BIT
42#define STACK_TOP (current->thread.mflags & MF_32BIT_ADDR ? TASK_SIZE32 : TASK_SIZE) 42#define STACK_TOP (current->thread.mflags & MF_32BIT_ADDR ? TASK_SIZE32 : TASK_SIZE)
43#endif 43#endif
44 44
diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h
index 2caa8c427204..7dc2619f5006 100644
--- a/include/asm-mips/addrspace.h
+++ b/include/asm-mips/addrspace.h
@@ -48,7 +48,7 @@
48#define CPHYSADDR(a) ((_ACAST32_ (a)) & 0x1fffffff) 48#define CPHYSADDR(a) ((_ACAST32_ (a)) & 0x1fffffff)
49#define XPHYSADDR(a) ((_ACAST64_ (a)) & 0x000000ffffffffff) 49#define XPHYSADDR(a) ((_ACAST64_ (a)) & 0x000000ffffffffff)
50 50
51#ifdef CONFIG_MIPS64 51#ifdef CONFIG_64BIT
52 52
53/* 53/*
54 * Memory segments (64bit kernel mode addresses) 54 * Memory segments (64bit kernel mode addresses)
diff --git a/include/asm-mips/asmmacro-32.h b/include/asm-mips/asmmacro-32.h
index ac8823df2554..11daf5ceb7b4 100644
--- a/include/asm-mips/asmmacro-32.h
+++ b/include/asm-mips/asmmacro-32.h
@@ -7,7 +7,7 @@
7#ifndef _ASM_ASMMACRO_32_H 7#ifndef _ASM_ASMMACRO_32_H
8#define _ASM_ASMMACRO_32_H 8#define _ASM_ASMMACRO_32_H
9 9
10#include <asm/offset.h> 10#include <asm/asm-offsets.h>
11#include <asm/regdef.h> 11#include <asm/regdef.h>
12#include <asm/fpregdef.h> 12#include <asm/fpregdef.h>
13#include <asm/mipsregs.h> 13#include <asm/mipsregs.h>
diff --git a/include/asm-mips/asmmacro-64.h b/include/asm-mips/asmmacro-64.h
index bbed35511f5a..559c355b9b86 100644
--- a/include/asm-mips/asmmacro-64.h
+++ b/include/asm-mips/asmmacro-64.h
@@ -8,7 +8,7 @@
8#ifndef _ASM_ASMMACRO_64_H 8#ifndef _ASM_ASMMACRO_64_H
9#define _ASM_ASMMACRO_64_H 9#define _ASM_ASMMACRO_64_H
10 10
11#include <asm/offset.h> 11#include <asm/asm-offsets.h>
12#include <asm/regdef.h> 12#include <asm/regdef.h>
13#include <asm/fpregdef.h> 13#include <asm/fpregdef.h>
14#include <asm/mipsregs.h> 14#include <asm/mipsregs.h>
diff --git a/include/asm-mips/asmmacro.h b/include/asm-mips/asmmacro.h
index 37a460aa0378..30b18ea6cb11 100644
--- a/include/asm-mips/asmmacro.h
+++ b/include/asm-mips/asmmacro.h
@@ -7,14 +7,14 @@
7 */ 7 */
8#ifndef _ASM_ASMMACRO_H 8#ifndef _ASM_ASMMACRO_H
9#define _ASM_ASMMACRO_H 9#define _ASM_ASMMACRO_H
10 10
11#include <linux/config.h> 11#include <linux/config.h>
12#include <asm/hazards.h> 12#include <asm/hazards.h>
13 13
14#ifdef CONFIG_MIPS32 14#ifdef CONFIG_32BIT
15#include <asm/asmmacro-32.h> 15#include <asm/asmmacro-32.h>
16#endif 16#endif
17#ifdef CONFIG_MIPS64 17#ifdef CONFIG_64BIT
18#include <asm/asmmacro-64.h> 18#include <asm/asmmacro-64.h>
19#endif 19#endif
20 20
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h
index 7d89e87bc8c6..c0bd8d014e14 100644
--- a/include/asm-mips/atomic.h
+++ b/include/asm-mips/atomic.h
@@ -334,7 +334,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
334 */ 334 */
335#define atomic_add_negative(i,v) (atomic_add_return(i, (v)) < 0) 335#define atomic_add_negative(i,v) (atomic_add_return(i, (v)) < 0)
336 336
337#ifdef CONFIG_MIPS64 337#ifdef CONFIG_64BIT
338 338
339typedef struct { volatile __s64 counter; } atomic64_t; 339typedef struct { volatile __s64 counter; } atomic64_t;
340 340
@@ -639,7 +639,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
639 */ 639 */
640#define atomic64_add_negative(i,v) (atomic64_add_return(i, (v)) < 0) 640#define atomic64_add_negative(i,v) (atomic64_add_return(i, (v)) < 0)
641 641
642#endif /* CONFIG_MIPS64 */ 642#endif /* CONFIG_64BIT */
643 643
644/* 644/*
645 * atomic*_return operations are serializing but not the non-*_return 645 * atomic*_return operations are serializing but not the non-*_return
diff --git a/include/asm-mips/auxvec.h b/include/asm-mips/auxvec.h
new file mode 100644
index 000000000000..7cf7f2d21943
--- /dev/null
+++ b/include/asm-mips/auxvec.h
@@ -0,0 +1,4 @@
1#ifndef _ASM_AUXVEC_H
2#define _ASM_AUXVEC_H
3
4#endif /* _ASM_AUXVEC_H */
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h
index 779d2187a6a4..eb8d79dba11c 100644
--- a/include/asm-mips/bitops.h
+++ b/include/asm-mips/bitops.h
@@ -20,13 +20,13 @@
20#define SZLONG_MASK 31UL 20#define SZLONG_MASK 31UL
21#define __LL "ll " 21#define __LL "ll "
22#define __SC "sc " 22#define __SC "sc "
23#define cpu_to_lelongp(x) cpu_to_le32p((__u32 *) (x)) 23#define cpu_to_lelongp(x) cpu_to_le32p((__u32 *) (x))
24#elif (_MIPS_SZLONG == 64) 24#elif (_MIPS_SZLONG == 64)
25#define SZLONG_LOG 6 25#define SZLONG_LOG 6
26#define SZLONG_MASK 63UL 26#define SZLONG_MASK 63UL
27#define __LL "lld " 27#define __LL "lld "
28#define __SC "scd " 28#define __SC "scd "
29#define cpu_to_lelongp(x) cpu_to_le64p((__u64 *) (x)) 29#define cpu_to_lelongp(x) cpu_to_le64p((__u64 *) (x))
30#endif 30#endif
31 31
32#ifdef __KERNEL__ 32#ifdef __KERNEL__
@@ -533,14 +533,14 @@ static inline unsigned long ffz(unsigned long word)
533 int b = 0, s; 533 int b = 0, s;
534 534
535 word = ~word; 535 word = ~word;
536#ifdef CONFIG_MIPS32 536#ifdef CONFIG_32BIT
537 s = 16; if (word << 16 != 0) s = 0; b += s; word >>= s; 537 s = 16; if (word << 16 != 0) s = 0; b += s; word >>= s;
538 s = 8; if (word << 24 != 0) s = 0; b += s; word >>= s; 538 s = 8; if (word << 24 != 0) s = 0; b += s; word >>= s;
539 s = 4; if (word << 28 != 0) s = 0; b += s; word >>= s; 539 s = 4; if (word << 28 != 0) s = 0; b += s; word >>= s;
540 s = 2; if (word << 30 != 0) s = 0; b += s; word >>= s; 540 s = 2; if (word << 30 != 0) s = 0; b += s; word >>= s;
541 s = 1; if (word << 31 != 0) s = 0; b += s; 541 s = 1; if (word << 31 != 0) s = 0; b += s;
542#endif 542#endif
543#ifdef CONFIG_MIPS64 543#ifdef CONFIG_64BIT
544 s = 32; if (word << 32 != 0) s = 0; b += s; word >>= s; 544 s = 32; if (word << 32 != 0) s = 0; b += s; word >>= s;
545 s = 16; if (word << 48 != 0) s = 0; b += s; word >>= s; 545 s = 16; if (word << 48 != 0) s = 0; b += s; word >>= s;
546 s = 8; if (word << 56 != 0) s = 0; b += s; word >>= s; 546 s = 8; if (word << 56 != 0) s = 0; b += s; word >>= s;
@@ -683,7 +683,7 @@ found_middle:
683 */ 683 */
684static inline int sched_find_first_bit(const unsigned long *b) 684static inline int sched_find_first_bit(const unsigned long *b)
685{ 685{
686#ifdef CONFIG_MIPS32 686#ifdef CONFIG_32BIT
687 if (unlikely(b[0])) 687 if (unlikely(b[0]))
688 return __ffs(b[0]); 688 return __ffs(b[0]);
689 if (unlikely(b[1])) 689 if (unlikely(b[1]))
@@ -694,7 +694,7 @@ static inline int sched_find_first_bit(const unsigned long *b)
694 return __ffs(b[3]) + 96; 694 return __ffs(b[3]) + 96;
695 return __ffs(b[4]) + 128; 695 return __ffs(b[4]) + 128;
696#endif 696#endif
697#ifdef CONFIG_MIPS64 697#ifdef CONFIG_64BIT
698 if (unlikely(b[0])) 698 if (unlikely(b[0]))
699 return __ffs(b[0]); 699 return __ffs(b[0]);
700 if (unlikely(b[1])) 700 if (unlikely(b[1]))
diff --git a/include/asm-mips/bugs.h b/include/asm-mips/bugs.h
index 18cced19cca4..b14b961c2100 100644
--- a/include/asm-mips/bugs.h
+++ b/include/asm-mips/bugs.h
@@ -15,7 +15,7 @@ extern void check_bugs64(void);
15static inline void check_bugs(void) 15static inline void check_bugs(void)
16{ 16{
17 check_bugs32(); 17 check_bugs32();
18#ifdef CONFIG_MIPS64 18#ifdef CONFIG_64BIT
19 check_bugs64(); 19 check_bugs64();
20#endif 20#endif
21} 21}
diff --git a/include/asm-mips/checksum.h b/include/asm-mips/checksum.h
index c25cc92b9950..c1ea5a8714f3 100644
--- a/include/asm-mips/checksum.h
+++ b/include/asm-mips/checksum.h
@@ -128,7 +128,7 @@ static inline unsigned int csum_tcpudp_nofold(unsigned long saddr,
128{ 128{
129 __asm__( 129 __asm__(
130 ".set\tnoat\t\t\t# csum_tcpudp_nofold\n\t" 130 ".set\tnoat\t\t\t# csum_tcpudp_nofold\n\t"
131#ifdef CONFIG_MIPS32 131#ifdef CONFIG_32BIT
132 "addu\t%0, %2\n\t" 132 "addu\t%0, %2\n\t"
133 "sltu\t$1, %0, %2\n\t" 133 "sltu\t$1, %0, %2\n\t"
134 "addu\t%0, $1\n\t" 134 "addu\t%0, $1\n\t"
@@ -141,7 +141,7 @@ static inline unsigned int csum_tcpudp_nofold(unsigned long saddr,
141 "sltu\t$1, %0, %4\n\t" 141 "sltu\t$1, %0, %4\n\t"
142 "addu\t%0, $1\n\t" 142 "addu\t%0, $1\n\t"
143#endif 143#endif
144#ifdef CONFIG_MIPS64 144#ifdef CONFIG_64BIT
145 "daddu\t%0, %2\n\t" 145 "daddu\t%0, %2\n\t"
146 "daddu\t%0, %3\n\t" 146 "daddu\t%0, %3\n\t"
147 "daddu\t%0, %4\n\t" 147 "daddu\t%0, %4\n\t"
diff --git a/include/asm-mips/compat.h b/include/asm-mips/compat.h
index d78002afb1e1..2c084cd4bc0a 100644
--- a/include/asm-mips/compat.h
+++ b/include/asm-mips/compat.h
@@ -15,8 +15,10 @@ typedef s32 compat_clock_t;
15typedef s32 compat_suseconds_t; 15typedef s32 compat_suseconds_t;
16 16
17typedef s32 compat_pid_t; 17typedef s32 compat_pid_t;
18typedef s32 compat_uid_t; 18typedef u32 __compat_uid_t;
19typedef s32 compat_gid_t; 19typedef u32 __compat_gid_t;
20typedef u32 __compat_uid32_t;
21typedef u32 __compat_gid32_t;
20typedef u32 compat_mode_t; 22typedef u32 compat_mode_t;
21typedef u32 compat_ino_t; 23typedef u32 compat_ino_t;
22typedef u32 compat_dev_t; 24typedef u32 compat_dev_t;
@@ -52,8 +54,8 @@ struct compat_stat {
52 compat_ino_t st_ino; 54 compat_ino_t st_ino;
53 compat_mode_t st_mode; 55 compat_mode_t st_mode;
54 compat_nlink_t st_nlink; 56 compat_nlink_t st_nlink;
55 compat_uid_t st_uid; 57 __compat_uid32_t st_uid;
56 compat_gid_t st_gid; 58 __compat_gid32_t st_gid;
57 compat_dev_t st_rdev; 59 compat_dev_t st_rdev;
58 s32 st_pad2[2]; 60 s32 st_pad2[2];
59 compat_off_t st_size; 61 compat_off_t st_size;
diff --git a/include/asm-mips/cpu-features.h b/include/asm-mips/cpu-features.h
index 1df2c299de82..9a2de642eee6 100644
--- a/include/asm-mips/cpu-features.h
+++ b/include/asm-mips/cpu-features.h
@@ -106,7 +106,7 @@
106#define PLAT_TRAMPOLINE_STUFF_LINE 0UL 106#define PLAT_TRAMPOLINE_STUFF_LINE 0UL
107#endif 107#endif
108 108
109#ifdef CONFIG_MIPS32 109#ifdef CONFIG_32BIT
110# ifndef cpu_has_nofpuex 110# ifndef cpu_has_nofpuex
111# define cpu_has_nofpuex (cpu_data[0].options & MIPS_CPU_NOFPUEX) 111# define cpu_has_nofpuex (cpu_data[0].options & MIPS_CPU_NOFPUEX)
112# endif 112# endif
@@ -124,7 +124,7 @@
124# endif 124# endif
125#endif 125#endif
126 126
127#ifdef CONFIG_MIPS64 127#ifdef CONFIG_64BIT
128# ifndef cpu_has_nofpuex 128# ifndef cpu_has_nofpuex
129# define cpu_has_nofpuex 0 129# define cpu_has_nofpuex 0
130# endif 130# endif
diff --git a/include/asm-mips/ddb5xxx/ddb5477.h b/include/asm-mips/ddb5xxx/ddb5477.h
index ae3e2a38fd5f..a438548e6ef3 100644
--- a/include/asm-mips/ddb5xxx/ddb5477.h
+++ b/include/asm-mips/ddb5xxx/ddb5477.h
@@ -247,7 +247,7 @@ extern void ll_vrc5477_irq_disable(int vrc5477_irq);
247 * All PCI irq but INTC are active low. 247 * All PCI irq but INTC are active low.
248 */ 248 */
249 249
250/* 250/*
251 * irq number block assignment 251 * irq number block assignment
252 */ 252 */
253 253
@@ -285,7 +285,7 @@ extern void ll_vrc5477_irq_disable(int vrc5477_irq);
285#define VRC5477_IRQ_IOPCI_INTB (17 + VRC5477_IRQ_BASE) /* USB-P */ 285#define VRC5477_IRQ_IOPCI_INTB (17 + VRC5477_IRQ_BASE) /* USB-P */
286#define VRC5477_IRQ_IOPCI_INTC (18 + VRC5477_IRQ_BASE) /* AC97 */ 286#define VRC5477_IRQ_IOPCI_INTC (18 + VRC5477_IRQ_BASE) /* AC97 */
287#define VRC5477_IRQ_IOPCI_INTD (19 + VRC5477_IRQ_BASE) /* Reserved */ 287#define VRC5477_IRQ_IOPCI_INTD (19 + VRC5477_IRQ_BASE) /* Reserved */
288#define VRC5477_IRQ_UART1 (20 + VRC5477_IRQ_BASE) 288#define VRC5477_IRQ_UART1 (20 + VRC5477_IRQ_BASE)
289#define VRC5477_IRQ_SPT0 (21 + VRC5477_IRQ_BASE) /* special purpose timer 0 */ 289#define VRC5477_IRQ_SPT0 (21 + VRC5477_IRQ_BASE) /* special purpose timer 0 */
290#define VRC5477_IRQ_GPT0 (22 + VRC5477_IRQ_BASE) /* general purpose timer 0 */ 290#define VRC5477_IRQ_GPT0 (22 + VRC5477_IRQ_BASE) /* general purpose timer 0 */
291#define VRC5477_IRQ_GPT1 (23 + VRC5477_IRQ_BASE) /* general purpose timer 1 */ 291#define VRC5477_IRQ_GPT1 (23 + VRC5477_IRQ_BASE) /* general purpose timer 1 */
@@ -301,7 +301,7 @@ extern void ll_vrc5477_irq_disable(int vrc5477_irq);
301/* 301/*
302 * i2859 irq assignment 302 * i2859 irq assignment
303 */ 303 */
304#define I8259_IRQ_RESERVED_0 (0 + I8259_IRQ_BASE) 304#define I8259_IRQ_RESERVED_0 (0 + I8259_IRQ_BASE)
305#define I8259_IRQ_KEYBOARD (1 + I8259_IRQ_BASE) /* M1543 default */ 305#define I8259_IRQ_KEYBOARD (1 + I8259_IRQ_BASE) /* M1543 default */
306#define I8259_IRQ_CASCADE (2 + I8259_IRQ_BASE) 306#define I8259_IRQ_CASCADE (2 + I8259_IRQ_BASE)
307#define I8259_IRQ_UART_B (3 + I8259_IRQ_BASE) /* M1543 default, may conflict with RTC according to schematic diagram */ 307#define I8259_IRQ_UART_B (3 + I8259_IRQ_BASE) /* M1543 default, may conflict with RTC according to schematic diagram */
diff --git a/include/asm-mips/dec/prom.h b/include/asm-mips/dec/prom.h
index b63e2f2317d1..a05d6d3395fe 100644
--- a/include/asm-mips/dec/prom.h
+++ b/include/asm-mips/dec/prom.h
@@ -48,15 +48,15 @@
48 */ 48 */
49#define REX_PROM_MAGIC 0x30464354 49#define REX_PROM_MAGIC 0x30464354
50 50
51#ifdef CONFIG_MIPS64 51#ifdef CONFIG_64BIT
52 52
53#define prom_is_rex(magic) 1 /* KN04 and KN05 are REX PROMs. */ 53#define prom_is_rex(magic) 1 /* KN04 and KN05 are REX PROMs. */
54 54
55#else /* !CONFIG_MIPS64 */ 55#else /* !CONFIG_64BIT */
56 56
57#define prom_is_rex(magic) ((magic) == REX_PROM_MAGIC) 57#define prom_is_rex(magic) ((magic) == REX_PROM_MAGIC)
58 58
59#endif /* !CONFIG_MIPS64 */ 59#endif /* !CONFIG_64BIT */
60 60
61 61
62/* 62/*
@@ -105,7 +105,7 @@ extern int (*__pmax_read)(int, void *, int);
105extern int (*__pmax_close)(int); 105extern int (*__pmax_close)(int);
106 106
107 107
108#ifdef CONFIG_MIPS64 108#ifdef CONFIG_64BIT
109 109
110/* 110/*
111 * On MIPS64 we have to call PROM functions via a helper 111 * On MIPS64 we have to call PROM functions via a helper
@@ -138,7 +138,7 @@ int _prom_printf(int (*)(char *, ...), char *, ...) __DEC_PROM_O32;
138#define prom_getenv(x) _prom_getenv(__prom_getenv, x) 138#define prom_getenv(x) _prom_getenv(__prom_getenv, x)
139#define prom_printf(x...) _prom_printf(__prom_printf, x) 139#define prom_printf(x...) _prom_printf(__prom_printf, x)
140 140
141#else /* !CONFIG_MIPS64 */ 141#else /* !CONFIG_64BIT */
142 142
143/* 143/*
144 * On plain MIPS we just call PROM functions directly. 144 * On plain MIPS we just call PROM functions directly.
@@ -160,7 +160,7 @@ int _prom_printf(int (*)(char *, ...), char *, ...) __DEC_PROM_O32;
160#define pmax_read __pmax_read 160#define pmax_read __pmax_read
161#define pmax_close __pmax_close 161#define pmax_close __pmax_close
162 162
163#endif /* !CONFIG_MIPS64 */ 163#endif /* !CONFIG_64BIT */
164 164
165 165
166extern void prom_meminit(u32); 166extern void prom_meminit(u32);
diff --git a/include/asm-mips/delay.h b/include/asm-mips/delay.h
index d0f68447e5a7..a606dbee0412 100644
--- a/include/asm-mips/delay.h
+++ b/include/asm-mips/delay.h
@@ -57,11 +57,11 @@ static inline void __udelay(unsigned long usecs, unsigned long lpj)
57 * The common rates of 1000 and 128 are rounded wrongly by the 57 * The common rates of 1000 and 128 are rounded wrongly by the
58 * catchall case for 64-bit. Excessive precission? Probably ... 58 * catchall case for 64-bit. Excessive precission? Probably ...
59 */ 59 */
60#if defined(CONFIG_MIPS64) && (HZ == 128) 60#if defined(CONFIG_64BIT) && (HZ == 128)
61 usecs *= 0x0008637bd05af6c7UL; /* 2**64 / (1000000 / HZ) */ 61 usecs *= 0x0008637bd05af6c7UL; /* 2**64 / (1000000 / HZ) */
62#elif defined(CONFIG_MIPS64) && (HZ == 1000) 62#elif defined(CONFIG_64BIT) && (HZ == 1000)
63 usecs *= 0x004189374BC6A7f0UL; /* 2**64 / (1000000 / HZ) */ 63 usecs *= 0x004189374BC6A7f0UL; /* 2**64 / (1000000 / HZ) */
64#elif defined(CONFIG_MIPS64) 64#elif defined(CONFIG_64BIT)
65 usecs *= (0x8000000000000000UL / (500000 / HZ)); 65 usecs *= (0x8000000000000000UL / (500000 / HZ));
66#else /* 32-bit junk follows here */ 66#else /* 32-bit junk follows here */
67 usecs *= (unsigned long) (((0x8000000000000000ULL / (500000 / HZ)) + 67 usecs *= (unsigned long) (((0x8000000000000000ULL / (500000 / HZ)) +
diff --git a/include/asm-mips/elf.h b/include/asm-mips/elf.h
index 7b92c8045cc2..e48811440015 100644
--- a/include/asm-mips/elf.h
+++ b/include/asm-mips/elf.h
@@ -125,7 +125,7 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG];
125typedef double elf_fpreg_t; 125typedef double elf_fpreg_t;
126typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; 126typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
127 127
128#ifdef CONFIG_MIPS32 128#ifdef CONFIG_32BIT
129 129
130/* 130/*
131 * This is used to ensure we don't load something for the wrong architecture. 131 * This is used to ensure we don't load something for the wrong architecture.
@@ -153,9 +153,9 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
153 */ 153 */
154#define ELF_CLASS ELFCLASS32 154#define ELF_CLASS ELFCLASS32
155 155
156#endif /* CONFIG_MIPS32 */ 156#endif /* CONFIG_32BIT */
157 157
158#ifdef CONFIG_MIPS64 158#ifdef CONFIG_64BIT
159/* 159/*
160 * This is used to ensure we don't load something for the wrong architecture. 160 * This is used to ensure we don't load something for the wrong architecture.
161 */ 161 */
@@ -177,7 +177,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
177 */ 177 */
178#define ELF_CLASS ELFCLASS64 178#define ELF_CLASS ELFCLASS64
179 179
180#endif /* CONFIG_MIPS64 */ 180#endif /* CONFIG_64BIT */
181 181
182/* 182/*
183 * These are used to set parameters in the core dumps. 183 * These are used to set parameters in the core dumps.
@@ -193,7 +193,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
193 193
194#ifdef __KERNEL__ 194#ifdef __KERNEL__
195 195
196#ifdef CONFIG_MIPS32 196#ifdef CONFIG_32BIT
197 197
198#define SET_PERSONALITY(ex, ibcs2) \ 198#define SET_PERSONALITY(ex, ibcs2) \
199do { \ 199do { \
@@ -202,9 +202,9 @@ do { \
202 set_personality(PER_LINUX); \ 202 set_personality(PER_LINUX); \
203} while (0) 203} while (0)
204 204
205#endif /* CONFIG_MIPS32 */ 205#endif /* CONFIG_32BIT */
206 206
207#ifdef CONFIG_MIPS64 207#ifdef CONFIG_64BIT
208 208
209#define SET_PERSONALITY(ex, ibcs2) \ 209#define SET_PERSONALITY(ex, ibcs2) \
210do { current->thread.mflags &= ~MF_ABI_MASK; \ 210do { current->thread.mflags &= ~MF_ABI_MASK; \
@@ -222,7 +222,7 @@ do { current->thread.mflags &= ~MF_ABI_MASK; \
222 set_personality(PER_LINUX); \ 222 set_personality(PER_LINUX); \
223} while (0) 223} while (0)
224 224
225#endif /* CONFIG_MIPS64 */ 225#endif /* CONFIG_64BIT */
226 226
227extern void dump_regs(elf_greg_t *, struct pt_regs *regs); 227extern void dump_regs(elf_greg_t *, struct pt_regs *regs);
228extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); 228extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *);
diff --git a/include/asm-mips/fcntl.h b/include/asm-mips/fcntl.h
index 2436392e7990..06c5d13faf66 100644
--- a/include/asm-mips/fcntl.h
+++ b/include/asm-mips/fcntl.h
@@ -8,33 +8,16 @@
8#ifndef _ASM_FCNTL_H 8#ifndef _ASM_FCNTL_H
9#define _ASM_FCNTL_H 9#define _ASM_FCNTL_H
10 10
11/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
12 located on an ext2 file system */
13#define O_ACCMODE 0x0003
14#define O_RDONLY 0x0000
15#define O_WRONLY 0x0001
16#define O_RDWR 0x0002
17#define O_APPEND 0x0008 11#define O_APPEND 0x0008
18#define O_SYNC 0x0010 12#define O_SYNC 0x0010
19#define O_NONBLOCK 0x0080 13#define O_NONBLOCK 0x0080
20#define O_CREAT 0x0100 /* not fcntl */ 14#define O_CREAT 0x0100 /* not fcntl */
21#define O_TRUNC 0x0200 /* not fcntl */
22#define O_EXCL 0x0400 /* not fcntl */ 15#define O_EXCL 0x0400 /* not fcntl */
23#define O_NOCTTY 0x0800 /* not fcntl */ 16#define O_NOCTTY 0x0800 /* not fcntl */
24#define FASYNC 0x1000 /* fcntl, for BSD compatibility */ 17#define FASYNC 0x1000 /* fcntl, for BSD compatibility */
25#define O_LARGEFILE 0x2000 /* allow large file opens */ 18#define O_LARGEFILE 0x2000 /* allow large file opens */
26#define O_DIRECT 0x8000 /* direct disk access hint */ 19#define O_DIRECT 0x8000 /* direct disk access hint */
27#define O_DIRECTORY 0x10000 /* must be a directory */
28#define O_NOFOLLOW 0x20000 /* don't follow links */
29#define O_NOATIME 0x40000
30 20
31#define O_NDELAY O_NONBLOCK
32
33#define F_DUPFD 0 /* dup */
34#define F_GETFD 1 /* get close_on_exec */
35#define F_SETFD 2 /* set/clear close_on_exec */
36#define F_GETFL 3 /* get file->f_flags */
37#define F_SETFL 4 /* set file->f_flags */
38#define F_GETLK 14 21#define F_GETLK 14
39#define F_SETLK 6 22#define F_SETLK 6
40#define F_SETLKW 7 23#define F_SETLKW 7
@@ -50,33 +33,6 @@
50#define F_SETLKW64 35 33#define F_SETLKW64 35
51#endif 34#endif
52 35
53/* for F_[GET|SET]FL */
54#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
55
56/* for posix fcntl() and lockf() */
57#define F_RDLCK 0
58#define F_WRLCK 1
59#define F_UNLCK 2
60
61/* for old implementation of bsd flock () */
62#define F_EXLCK 4 /* or 3 */
63#define F_SHLCK 8 /* or 4 */
64
65/* for leases */
66#define F_INPROGRESS 16
67
68/* operations for bsd flock(), also used by the kernel implementation */
69#define LOCK_SH 1 /* shared lock */
70#define LOCK_EX 2 /* exclusive lock */
71#define LOCK_NB 4 /* or'd with one of the above to prevent
72 blocking */
73#define LOCK_UN 8 /* remove lock */
74
75#define LOCK_MAND 32 /* This is a mandatory flock */
76#define LOCK_READ 64 /* ... Which allows concurrent read operations */
77#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
78#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
79
80/* 36/*
81 * The flavours of struct flock. "struct flock" is the ABI compliant 37 * The flavours of struct flock. "struct flock" is the ABI compliant
82 * variant. Finally struct flock64 is the LFS variant of struct flock. As 38 * variant. Finally struct flock64 is the LFS variant of struct flock. As
@@ -86,7 +42,7 @@
86 42
87#ifndef __mips64 43#ifndef __mips64
88 44
89typedef struct flock { 45struct flock {
90 short l_type; 46 short l_type;
91 short l_whence; 47 short l_whence;
92 __kernel_off_t l_start; 48 __kernel_off_t l_start;
@@ -94,32 +50,17 @@ typedef struct flock {
94 long l_sysid; 50 long l_sysid;
95 __kernel_pid_t l_pid; 51 __kernel_pid_t l_pid;
96 long pad[4]; 52 long pad[4];
97} flock_t; 53};
98
99typedef struct flock64 {
100 short l_type;
101 short l_whence;
102 loff_t l_start;
103 loff_t l_len;
104 pid_t l_pid;
105} flock64_t;
106 54
107#else /* 64-bit definitions */ 55#define HAVE_ARCH_STRUCT_FLOCK
108 56
109typedef struct flock {
110 short l_type;
111 short l_whence;
112 __kernel_off_t l_start;
113 __kernel_off_t l_len;
114 __kernel_pid_t l_pid;
115} flock_t;
116
117#ifdef __KERNEL__
118#define flock64 flock
119#endif 57#endif
120 58
121#endif 59#include <asm-generic/fcntl.h>
122 60
123#define F_LINUX_SPECIFIC_BASE 1024 61typedef struct flock flock_t;
62#ifndef __mips64
63typedef struct flock64 flock64_t;
64#endif
124 65
125#endif /* _ASM_FCNTL_H */ 66#endif /* _ASM_FCNTL_H */
diff --git a/include/asm-mips/fpregdef.h b/include/asm-mips/fpregdef.h
index 1d9aa0979181..2b5fddc8f487 100644
--- a/include/asm-mips/fpregdef.h
+++ b/include/asm-mips/fpregdef.h
@@ -13,7 +13,7 @@
13#define _ASM_FPREGDEF_H 13#define _ASM_FPREGDEF_H
14 14
15#include <asm/sgidefs.h> 15#include <asm/sgidefs.h>
16 16
17#if _MIPS_SIM == _MIPS_SIM_ABI32 17#if _MIPS_SIM == _MIPS_SIM_ABI32
18 18
19/* 19/*
@@ -56,7 +56,7 @@
56#define fcr31 $31 /* FPU status register */ 56#define fcr31 $31 /* FPU status register */
57 57
58#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 58#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
59 59
60#if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 60#if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32
61 61
62#define fv0 $f0 /* return value */ 62#define fv0 $f0 /* return value */
diff --git a/include/asm-mips/fpu.h b/include/asm-mips/fpu.h
index 6cb38d5c0407..ea24e733b1bc 100644
--- a/include/asm-mips/fpu.h
+++ b/include/asm-mips/fpu.h
@@ -82,7 +82,7 @@ do { \
82 82
83static inline int is_fpu_owner(void) 83static inline int is_fpu_owner(void)
84{ 84{
85 return cpu_has_fpu && test_thread_flag(TIF_USEDFPU); 85 return cpu_has_fpu && test_thread_flag(TIF_USEDFPU);
86} 86}
87 87
88static inline void own_fpu(void) 88static inline void own_fpu(void)
@@ -90,7 +90,7 @@ static inline void own_fpu(void)
90 if (cpu_has_fpu) { 90 if (cpu_has_fpu) {
91 __enable_fpu(); 91 __enable_fpu();
92 KSTK_STATUS(current) |= ST0_CU1; 92 KSTK_STATUS(current) |= ST0_CU1;
93 set_thread_flag(TIF_USEDFPU); 93 set_thread_flag(TIF_USEDFPU);
94 } 94 }
95} 95}
96 96
@@ -98,7 +98,7 @@ static inline void lose_fpu(void)
98{ 98{
99 if (cpu_has_fpu) { 99 if (cpu_has_fpu) {
100 KSTK_STATUS(current) &= ~ST0_CU1; 100 KSTK_STATUS(current) &= ~ST0_CU1;
101 clear_thread_flag(TIF_USEDFPU); 101 clear_thread_flag(TIF_USEDFPU);
102 __disable_fpu(); 102 __disable_fpu();
103 } 103 }
104} 104}
@@ -127,7 +127,7 @@ static inline void restore_fp(struct task_struct *tsk)
127static inline fpureg_t *get_fpu_regs(struct task_struct *tsk) 127static inline fpureg_t *get_fpu_regs(struct task_struct *tsk)
128{ 128{
129 if (cpu_has_fpu) { 129 if (cpu_has_fpu) {
130 if ((tsk == current) && is_fpu_owner()) 130 if ((tsk == current) && is_fpu_owner())
131 _save_fp(current); 131 _save_fp(current);
132 return tsk->thread.fpu.hard.fpr; 132 return tsk->thread.fpu.hard.fpr;
133 } 133 }
diff --git a/include/asm-mips/futex.h b/include/asm-mips/futex.h
new file mode 100644
index 000000000000..9feff4ce1424
--- /dev/null
+++ b/include/asm-mips/futex.h
@@ -0,0 +1,53 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/uaccess.h>
9
10static inline int
11futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
12{
13 int op = (encoded_op >> 28) & 7;
14 int cmp = (encoded_op >> 24) & 15;
15 int oparg = (encoded_op << 8) >> 20;
16 int cmparg = (encoded_op << 20) >> 20;
17 int oldval = 0, ret;
18 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
19 oparg = 1 << oparg;
20
21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
22 return -EFAULT;
23
24 inc_preempt_count();
25
26 switch (op) {
27 case FUTEX_OP_SET:
28 case FUTEX_OP_ADD:
29 case FUTEX_OP_OR:
30 case FUTEX_OP_ANDN:
31 case FUTEX_OP_XOR:
32 default:
33 ret = -ENOSYS;
34 }
35
36 dec_preempt_count();
37
38 if (!ret) {
39 switch (cmp) {
40 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
41 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
42 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
43 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
44 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
45 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
46 default: ret = -ENOSYS;
47 }
48 }
49 return ret;
50}
51
52#endif
53#endif
diff --git a/include/asm-mips/hdreg.h b/include/asm-mips/hdreg.h
deleted file mode 100644
index 5989bbc97cbf..000000000000
--- a/include/asm-mips/hdreg.h
+++ /dev/null
@@ -1 +0,0 @@
1#warning this file is obsolete, please do not use it
diff --git a/include/asm-mips/hp-lj/asic.h b/include/asm-mips/hp-lj/asic.h
deleted file mode 100644
index fc2ca656da00..000000000000
--- a/include/asm-mips/hp-lj/asic.h
+++ /dev/null
@@ -1,7 +0,0 @@
1
2typedef enum { IllegalAsic, UnknownAsic, AndrosAsic, HarmonyAsic } AsicId;
3
4AsicId GetAsicId(void);
5
6const char* const GetAsicName(void);
7
diff --git a/include/asm-mips/ip32/mace.h b/include/asm-mips/ip32/mace.h
index 2b7b0fdeac19..432011b16c26 100644
--- a/include/asm-mips/ip32/mace.h
+++ b/include/asm-mips/ip32/mace.h
@@ -94,7 +94,7 @@ struct mace_video {
94 unsigned long xxx; /* later... */ 94 unsigned long xxx; /* later... */
95}; 95};
96 96
97/* 97/*
98 * Ethernet interface 98 * Ethernet interface
99 */ 99 */
100struct mace_ethernet { 100struct mace_ethernet {
@@ -129,7 +129,7 @@ struct mace_ethernet {
129 volatile unsigned long rx_fifo; 129 volatile unsigned long rx_fifo;
130}; 130};
131 131
132/* 132/*
133 * Peripherals 133 * Peripherals
134 */ 134 */
135 135
@@ -251,7 +251,7 @@ struct mace_timers {
251 timer_reg audio_out2; 251 timer_reg audio_out2;
252 timer_reg video_in1; 252 timer_reg video_in1;
253 timer_reg video_in2; 253 timer_reg video_in2;
254 timer_reg video_out; 254 timer_reg video_out;
255}; 255};
256 256
257struct mace_perif { 257struct mace_perif {
@@ -272,7 +272,7 @@ struct mace_perif {
272}; 272};
273 273
274 274
275/* 275/*
276 * ISA peripherals 276 * ISA peripherals
277 */ 277 */
278 278
diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h
index b90b11d0b886..3f2470e9e678 100644
--- a/include/asm-mips/irq.h
+++ b/include/asm-mips/irq.h
@@ -49,7 +49,4 @@ do { \
49 49
50extern void arch_init_irq(void); 50extern void arch_init_irq(void);
51 51
52struct irqaction;
53int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
54
55#endif /* _ASM_IRQ_H */ 52#endif /* _ASM_IRQ_H */
diff --git a/include/asm-mips/lasat/serial.h b/include/asm-mips/lasat/serial.h
index 21d0fb7cee64..9e88c7669c7a 100644
--- a/include/asm-mips/lasat/serial.h
+++ b/include/asm-mips/lasat/serial.h
@@ -1,13 +1,13 @@
1#include <asm/lasat/lasat.h> 1#include <asm/lasat/lasat.h>
2 2
3/* Lasat 100 boards serial configuration */ 3/* Lasat 100 boards serial configuration */
4#define LASAT_BASE_BAUD_100 ( 7372800 / 16 ) 4#define LASAT_BASE_BAUD_100 ( 7372800 / 16 )
5#define LASAT_UART_REGS_BASE_100 0x1c8b0000 5#define LASAT_UART_REGS_BASE_100 0x1c8b0000
6#define LASAT_UART_REGS_SHIFT_100 2 6#define LASAT_UART_REGS_SHIFT_100 2
7#define LASATINT_UART_100 8 7#define LASATINT_UART_100 8
8 8
9/* * LASAT 200 boards serial configuration */ 9/* * LASAT 200 boards serial configuration */
10#define LASAT_BASE_BAUD_200 (100000000 / 16 / 12) 10#define LASAT_BASE_BAUD_200 (100000000 / 16 / 12)
11#define LASAT_UART_REGS_BASE_200 (Vrc5074_PHYS_BASE + 0x0300) 11#define LASAT_UART_REGS_BASE_200 (Vrc5074_PHYS_BASE + 0x0300)
12#define LASAT_UART_REGS_SHIFT_200 3 12#define LASAT_UART_REGS_SHIFT_200 3
13#define LASATINT_UART_200 13 13#define LASATINT_UART_200 13
diff --git a/include/asm-mips/local.h b/include/asm-mips/local.h
index 7eb6bf661b80..c38844f615fc 100644
--- a/include/asm-mips/local.h
+++ b/include/asm-mips/local.h
@@ -5,7 +5,7 @@
5#include <linux/percpu.h> 5#include <linux/percpu.h>
6#include <asm/atomic.h> 6#include <asm/atomic.h>
7 7
8#ifdef CONFIG_MIPS32 8#ifdef CONFIG_32BIT
9 9
10typedef atomic_t local_t; 10typedef atomic_t local_t;
11 11
@@ -20,7 +20,7 @@ typedef atomic_t local_t;
20 20
21#endif 21#endif
22 22
23#ifdef CONFIG_MIPS64 23#ifdef CONFIG_64BIT
24 24
25typedef atomic64_t local_t; 25typedef atomic64_t local_t;
26 26
diff --git a/include/asm-mips/mach-au1x00/au1000.h b/include/asm-mips/mach-au1x00/au1000.h
index 2b36ea346910..148bae2fa7d3 100644
--- a/include/asm-mips/mach-au1x00/au1000.h
+++ b/include/asm-mips/mach-au1x00/au1000.h
@@ -1383,7 +1383,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[];
1383#define PCI_IO_START 0 1383#define PCI_IO_START 0
1384#define PCI_IO_END 0 1384#define PCI_IO_END 0
1385#define PCI_MEM_START 0 1385#define PCI_MEM_START 0
1386#define PCI_MEM_END 0 1386#define PCI_MEM_END 0
1387#define PCI_FIRST_DEVFN 0 1387#define PCI_FIRST_DEVFN 0
1388#define PCI_LAST_DEVFN 0 1388#define PCI_LAST_DEVFN 0
1389#endif 1389#endif
diff --git a/include/asm-mips/mach-db1x00/db1x00.h b/include/asm-mips/mach-db1x00/db1x00.h
index 4691398a414f..efafe65258b6 100644
--- a/include/asm-mips/mach-db1x00/db1x00.h
+++ b/include/asm-mips/mach-db1x00/db1x00.h
@@ -23,7 +23,7 @@
23 * 23 *
24 * ######################################################################## 24 * ########################################################################
25 * 25 *
26 * 26 *
27 */ 27 */
28#ifndef __ASM_DB1X00_H 28#ifndef __ASM_DB1X00_H
29#define __ASM_DB1X00_H 29#define __ASM_DB1X00_H
diff --git a/include/asm-mips/mach-generic/spaces.h b/include/asm-mips/mach-generic/spaces.h
index 63c0a81c7832..5a2c1efb4eb7 100644
--- a/include/asm-mips/mach-generic/spaces.h
+++ b/include/asm-mips/mach-generic/spaces.h
@@ -12,7 +12,7 @@
12 12
13#include <linux/config.h> 13#include <linux/config.h>
14 14
15#ifdef CONFIG_MIPS32 15#ifdef CONFIG_32BIT
16 16
17#define CAC_BASE 0x80000000 17#define CAC_BASE 0x80000000
18#define IO_BASE 0xa0000000 18#define IO_BASE 0xa0000000
@@ -32,9 +32,9 @@
32#define HIGHMEM_START 0x20000000UL 32#define HIGHMEM_START 0x20000000UL
33#endif 33#endif
34 34
35#endif /* CONFIG_MIPS32 */ 35#endif /* CONFIG_32BIT */
36 36
37#ifdef CONFIG_MIPS64 37#ifdef CONFIG_64BIT
38 38
39/* 39/*
40 * This handles the memory map. 40 * This handles the memory map.
@@ -67,6 +67,6 @@
67#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) 67#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
68#define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK)) 68#define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK))
69 69
70#endif /* CONFIG_MIPS64 */ 70#endif /* CONFIG_64BIT */
71 71
72#endif /* __ASM_MACH_GENERIC_SPACES_H */ 72#endif /* __ASM_MACH_GENERIC_SPACES_H */
diff --git a/include/asm-mips/mach-ip22/spaces.h b/include/asm-mips/mach-ip22/spaces.h
index 30d42fcafe3d..e96166f27c49 100644
--- a/include/asm-mips/mach-ip22/spaces.h
+++ b/include/asm-mips/mach-ip22/spaces.h
@@ -12,7 +12,7 @@
12 12
13#include <linux/config.h> 13#include <linux/config.h>
14 14
15#ifdef CONFIG_MIPS32 15#ifdef CONFIG_32BIT
16 16
17#define CAC_BASE 0x80000000 17#define CAC_BASE 0x80000000
18#define IO_BASE 0xa0000000 18#define IO_BASE 0xa0000000
@@ -32,9 +32,9 @@
32#define HIGHMEM_START 0x20000000UL 32#define HIGHMEM_START 0x20000000UL
33#endif 33#endif
34 34
35#endif /* CONFIG_MIPS32 */ 35#endif /* CONFIG_32BIT */
36 36
37#ifdef CONFIG_MIPS64 37#ifdef CONFIG_64BIT
38#define PAGE_OFFSET 0xffffffff80000000UL 38#define PAGE_OFFSET 0xffffffff80000000UL
39 39
40#ifndef HIGHMEM_START 40#ifndef HIGHMEM_START
@@ -50,6 +50,6 @@
50#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) 50#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
51#define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK)) 51#define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK))
52 52
53#endif /* CONFIG_MIPS64 */ 53#endif /* CONFIG_64BIT */
54 54
55#endif /* __ASM_MACH_IP22_SPACES_H */ 55#endif /* __ASM_MACH_IP22_SPACES_H */
diff --git a/include/asm-mips/mach-ip32/cpu-feature-overrides.h b/include/asm-mips/mach-ip32/cpu-feature-overrides.h
index b932237f2193..04713973c6c3 100644
--- a/include/asm-mips/mach-ip32/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ip32/cpu-feature-overrides.h
@@ -18,7 +18,7 @@
18 * so, for 64bit IP32 kernel we just don't use ll/sc. 18 * so, for 64bit IP32 kernel we just don't use ll/sc.
19 * This does not affect luserland. 19 * This does not affect luserland.
20 */ 20 */
21#if defined(CONFIG_CPU_R5000) && defined(CONFIG_MIPS64) 21#if defined(CONFIG_CPU_R5000) && defined(CONFIG_64BIT)
22#define cpu_has_llsc 0 22#define cpu_has_llsc 0
23#else 23#else
24#define cpu_has_llsc 1 24#define cpu_has_llsc 1
diff --git a/include/asm-mips/mach-jazz/floppy.h b/include/asm-mips/mach-jazz/floppy.h
index 8cf0d042c864..c9dad99b1232 100644
--- a/include/asm-mips/mach-jazz/floppy.h
+++ b/include/asm-mips/mach-jazz/floppy.h
@@ -92,7 +92,7 @@ static inline int fd_request_irq(void)
92 return request_irq(FLOPPY_IRQ, floppy_interrupt, 92 return request_irq(FLOPPY_IRQ, floppy_interrupt,
93 SA_INTERRUPT | SA_SAMPLE_RANDOM, "floppy", NULL); 93 SA_INTERRUPT | SA_SAMPLE_RANDOM, "floppy", NULL);
94} 94}
95 95
96static inline void fd_free_irq(void) 96static inline void fd_free_irq(void)
97{ 97{
98 free_irq(FLOPPY_IRQ, NULL); 98 free_irq(FLOPPY_IRQ, NULL);
diff --git a/include/asm-mips/mach-pb1x00/pb1500.h b/include/asm-mips/mach-pb1x00/pb1500.h
index d6c779747b3c..ff6d40c87a25 100644
--- a/include/asm-mips/mach-pb1x00/pb1500.h
+++ b/include/asm-mips/mach-pb1x00/pb1500.h
@@ -33,11 +33,11 @@
33#define PCI_BOARD_REG 0xAE000010 33#define PCI_BOARD_REG 0xAE000010
34#define PCMCIA_BOARD_REG 0xAE000010 34#define PCMCIA_BOARD_REG 0xAE000010
35 #define PC_DEASSERT_RST 0x80 35 #define PC_DEASSERT_RST 0x80
36 #define PC_DRV_EN 0x10 36 #define PC_DRV_EN 0x10
37#define PB1500_G_CONTROL 0xAE000014 37#define PB1500_G_CONTROL 0xAE000014
38#define PB1500_RST_VDDI 0xAE00001C 38#define PB1500_RST_VDDI 0xAE00001C
39#define PB1500_LEDS 0xAE000018 39#define PB1500_LEDS 0xAE000018
40 40
41#define PB1500_HEX_LED 0xAF000004 41#define PB1500_HEX_LED 0xAF000004
42#define PB1500_HEX_LED_BLANK 0xAF000008 42#define PB1500_HEX_LED_BLANK 0xAF000008
43 43
diff --git a/include/asm-mips/mach-qemu/cpu-feature-overrides.h b/include/asm-mips/mach-qemu/cpu-feature-overrides.h
new file mode 100644
index 000000000000..f4e370e27168
--- /dev/null
+++ b/include/asm-mips/mach-qemu/cpu-feature-overrides.h
@@ -0,0 +1,31 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2003 Ralf Baechle
7 */
8#ifndef __ASM_MACH_QEMU_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_QEMU_CPU_FEATURE_OVERRIDES_H
10
11/*
12 * QEMU only comes with a hazard-free MIPS32 processor, so things are easy.
13 */
14#define cpu_has_mips16 0
15#define cpu_has_divec 0
16#define cpu_has_cache_cdex_p 0
17#define cpu_has_prefetch 0
18#define cpu_has_mcheck 0
19#define cpu_has_ejtag 0
20
21#define cpu_has_llsc 1
22#define cpu_has_vtag_icache 0
23#define cpu_has_dc_aliases (PAGE_SIZE < 0x4000)
24#define cpu_has_ic_fills_f_dc 0
25
26#define cpu_has_dsp 0
27
28#define cpu_has_nofpuex 0
29#define cpu_has_64bits 0
30
31#endif /* __ASM_MACH_QEMU_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-qemu/param.h b/include/asm-mips/mach-qemu/param.h
new file mode 100644
index 000000000000..cb30ee490ae6
--- /dev/null
+++ b/include/asm-mips/mach-qemu/param.h
@@ -0,0 +1,13 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2005 by Ralf Baechle
7 */
8#ifndef __ASM_MACH_QEMU_PARAM_H
9#define __ASM_MACH_QEMU_PARAM_H
10
11#define HZ 100 /* Internal kernel timer frequency */
12
13#endif /* __ASM_MACH_QEMU_PARAM_H */
diff --git a/include/asm-mips/mach-vr41xx/timex.h b/include/asm-mips/mach-vr41xx/timex.h
deleted file mode 100644
index 8d71485d003a..000000000000
--- a/include/asm-mips/mach-vr41xx/timex.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2003 by Ralf Baechle
7 */
8/*
9 * Changes:
10 * Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
11 * - CLOCK_TICK_RATE is changed into 32768 from 6144000.
12 */
13#ifndef __ASM_MACH_VR41XX_TIMEX_H
14#define __ASM_MACH_VR41XX_TIMEX_H
15
16#define CLOCK_TICK_RATE 32768
17
18#endif /* __ASM_MACH_VR41XX_TIMEX_H */
diff --git a/include/asm-mips/mmu_context.h b/include/asm-mips/mmu_context.h
index 48b77c9fb4f2..45cd72d172e8 100644
--- a/include/asm-mips/mmu_context.h
+++ b/include/asm-mips/mmu_context.h
@@ -28,17 +28,17 @@ extern unsigned long pgd_current[];
28#define TLBMISS_HANDLER_SETUP_PGD(pgd) \ 28#define TLBMISS_HANDLER_SETUP_PGD(pgd) \
29 pgd_current[smp_processor_id()] = (unsigned long)(pgd) 29 pgd_current[smp_processor_id()] = (unsigned long)(pgd)
30 30
31#ifdef CONFIG_MIPS32 31#ifdef CONFIG_32BIT
32#define TLBMISS_HANDLER_SETUP() \ 32#define TLBMISS_HANDLER_SETUP() \
33 write_c0_context((unsigned long) smp_processor_id() << 23); \ 33 write_c0_context((unsigned long) smp_processor_id() << 23); \
34 TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir) 34 TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir)
35#endif 35#endif
36#if defined(CONFIG_MIPS64) && !defined(CONFIG_BUILD_ELF64) 36#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64)
37#define TLBMISS_HANDLER_SETUP() \ 37#define TLBMISS_HANDLER_SETUP() \
38 write_c0_context((unsigned long) &pgd_current[smp_processor_id()] << 23); \ 38 write_c0_context((unsigned long) &pgd_current[smp_processor_id()] << 23); \
39 TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir) 39 TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir)
40#endif 40#endif
41#if defined(CONFIG_MIPS64) && defined(CONFIG_BUILD_ELF64) 41#if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64)
42#define TLBMISS_HANDLER_SETUP() \ 42#define TLBMISS_HANDLER_SETUP() \
43 write_c0_context((unsigned long) smp_processor_id() << 23); \ 43 write_c0_context((unsigned long) smp_processor_id() << 23); \
44 TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir) 44 TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir)
diff --git a/include/asm-mips/module.h b/include/asm-mips/module.h
index 90ee24aad955..0be58b2aeb9f 100644
--- a/include/asm-mips/module.h
+++ b/include/asm-mips/module.h
@@ -25,7 +25,7 @@ typedef struct
25 Elf64_Sxword r_addend; /* Addend. */ 25 Elf64_Sxword r_addend; /* Addend. */
26} Elf64_Mips_Rela; 26} Elf64_Mips_Rela;
27 27
28#ifdef CONFIG_MIPS32 28#ifdef CONFIG_32BIT
29 29
30#define Elf_Shdr Elf32_Shdr 30#define Elf_Shdr Elf32_Shdr
31#define Elf_Sym Elf32_Sym 31#define Elf_Sym Elf32_Sym
@@ -33,7 +33,7 @@ typedef struct
33 33
34#endif 34#endif
35 35
36#ifdef CONFIG_MIPS64 36#ifdef CONFIG_64BIT
37 37
38#define Elf_Shdr Elf64_Shdr 38#define Elf_Shdr Elf64_Shdr
39#define Elf_Sym Elf64_Sym 39#define Elf_Sym Elf64_Sym
diff --git a/include/asm-mips/msgbuf.h b/include/asm-mips/msgbuf.h
index 513b2824838b..a1533959742e 100644
--- a/include/asm-mips/msgbuf.h
+++ b/include/asm-mips/msgbuf.h
@@ -15,25 +15,25 @@
15 15
16struct msqid64_ds { 16struct msqid64_ds {
17 struct ipc64_perm msg_perm; 17 struct ipc64_perm msg_perm;
18#if defined(CONFIG_MIPS32) && !defined(CONFIG_CPU_LITTLE_ENDIAN) 18#if defined(CONFIG_32BIT) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
19 unsigned long __unused1; 19 unsigned long __unused1;
20#endif 20#endif
21 __kernel_time_t msg_stime; /* last msgsnd time */ 21 __kernel_time_t msg_stime; /* last msgsnd time */
22#if defined(CONFIG_MIPS32) && defined(CONFIG_CPU_LITTLE_ENDIAN) 22#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_LITTLE_ENDIAN)
23 unsigned long __unused1; 23 unsigned long __unused1;
24#endif 24#endif
25#if defined(CONFIG_MIPS32) && !defined(CONFIG_CPU_LITTLE_ENDIAN) 25#if defined(CONFIG_32BIT) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
26 unsigned long __unused2; 26 unsigned long __unused2;
27#endif 27#endif
28 __kernel_time_t msg_rtime; /* last msgrcv time */ 28 __kernel_time_t msg_rtime; /* last msgrcv time */
29#if defined(CONFIG_MIPS32) && defined(CONFIG_CPU_LITTLE_ENDIAN) 29#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_LITTLE_ENDIAN)
30 unsigned long __unused2; 30 unsigned long __unused2;
31#endif 31#endif
32#if defined(CONFIG_MIPS32) && !defined(CONFIG_CPU_LITTLE_ENDIAN) 32#if defined(CONFIG_32BIT) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
33 unsigned long __unused3; 33 unsigned long __unused3;
34#endif 34#endif
35 __kernel_time_t msg_ctime; /* last change time */ 35 __kernel_time_t msg_ctime; /* last change time */
36#if defined(CONFIG_MIPS32) && defined(CONFIG_CPU_LITTLE_ENDIAN) 36#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_LITTLE_ENDIAN)
37 unsigned long __unused3; 37 unsigned long __unused3;
38#endif 38#endif
39 unsigned long msg_cbytes; /* current number of bytes on queue */ 39 unsigned long msg_cbytes; /* current number of bytes on queue */
diff --git a/include/asm-mips/paccess.h b/include/asm-mips/paccess.h
index 36cec9e31696..309bc3099f68 100644
--- a/include/asm-mips/paccess.h
+++ b/include/asm-mips/paccess.h
@@ -16,10 +16,10 @@
16#include <linux/config.h> 16#include <linux/config.h>
17#include <linux/errno.h> 17#include <linux/errno.h>
18 18
19#ifdef CONFIG_MIPS32 19#ifdef CONFIG_32BIT
20#define __PA_ADDR ".word" 20#define __PA_ADDR ".word"
21#endif 21#endif
22#ifdef CONFIG_MIPS64 22#ifdef CONFIG_64BIT
23#define __PA_ADDR ".dword" 23#define __PA_ADDR ".dword"
24#endif 24#endif
25 25
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index 5cae35cd9ba9..652b6d67a571 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -103,20 +103,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
103#define __pgd(x) ((pgd_t) { (x) } ) 103#define __pgd(x) ((pgd_t) { (x) } )
104#define __pgprot(x) ((pgprot_t) { (x) } ) 104#define __pgprot(x) ((pgprot_t) { (x) } )
105 105
106/* Pure 2^n version of get_order */
107static __inline__ int get_order(unsigned long size)
108{
109 int order;
110
111 size = (size-1) >> (PAGE_SHIFT-1);
112 order = -1;
113 do {
114 size >>= 1;
115 order++;
116 } while (size);
117 return order;
118}
119
120#endif /* !__ASSEMBLY__ */ 106#endif /* !__ASSEMBLY__ */
121 107
122/* to align the pointer to the (next) page boundary */ 108/* to align the pointer to the (next) page boundary */
@@ -148,4 +134,6 @@ static __inline__ int get_order(unsigned long size)
148#define WANT_PAGE_VIRTUAL 134#define WANT_PAGE_VIRTUAL
149#endif 135#endif
150 136
137#include <asm-generic/page.h>
138
151#endif /* _ASM_PAGE_H */ 139#endif /* _ASM_PAGE_H */
diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h
index d70dc355c1f3..c9a00ca1c012 100644
--- a/include/asm-mips/pci.h
+++ b/include/asm-mips/pci.h
@@ -94,7 +94,7 @@ struct pci_dev;
94 */ 94 */
95extern unsigned int PCI_DMA_BUS_IS_PHYS; 95extern unsigned int PCI_DMA_BUS_IS_PHYS;
96 96
97#ifdef CONFIG_MAPPED_DMA_IO 97#ifdef CONFIG_DMA_NEED_PCI_MAP_STATE
98 98
99/* pci_unmap_{single,page} is not a nop, thus... */ 99/* pci_unmap_{single,page} is not a nop, thus... */
100#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME; 100#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME;
@@ -104,7 +104,7 @@ extern unsigned int PCI_DMA_BUS_IS_PHYS;
104#define pci_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME) 104#define pci_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME)
105#define pci_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL)) 105#define pci_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL))
106 106
107#else /* CONFIG_MAPPED_DMA_IO */ 107#else /* CONFIG_DMA_NEED_PCI_MAP_STATE */
108 108
109/* pci_unmap_{page,single} is a nop so... */ 109/* pci_unmap_{page,single} is a nop so... */
110#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) 110#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
@@ -114,7 +114,7 @@ extern unsigned int PCI_DMA_BUS_IS_PHYS;
114#define pci_unmap_len(PTR, LEN_NAME) (0) 114#define pci_unmap_len(PTR, LEN_NAME) (0)
115#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) 115#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
116 116
117#endif /* CONFIG_MAPPED_DMA_IO */ 117#endif /* CONFIG_DMA_NEED_PCI_MAP_STATE */
118 118
119/* This is always fine. */ 119/* This is always fine. */
120#define pci_dac_dma_supported(pci_dev, mask) (1) 120#define pci_dac_dma_supported(pci_dev, mask) (1)
@@ -142,6 +142,8 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
142 142
143extern void pcibios_resource_to_bus(struct pci_dev *dev, 143extern void pcibios_resource_to_bus(struct pci_dev *dev,
144 struct pci_bus_region *region, struct resource *res); 144 struct pci_bus_region *region, struct resource *res);
145extern void pcibios_bus_to_resource(struct pci_dev *dev,
146 struct resource *res, struct pci_bus_region *region);
145 147
146#ifdef CONFIG_PCI_DOMAINS 148#ifdef CONFIG_PCI_DOMAINS
147 149
@@ -167,4 +169,17 @@ static inline void pcibios_add_platform_entries(struct pci_dev *dev)
167/* Do platform specific device initialization at pci_enable_device() time */ 169/* Do platform specific device initialization at pci_enable_device() time */
168extern int pcibios_plat_dev_init(struct pci_dev *dev); 170extern int pcibios_plat_dev_init(struct pci_dev *dev);
169 171
172static inline struct resource *
173pcibios_select_root(struct pci_dev *pdev, struct resource *res)
174{
175 struct resource *root = NULL;
176
177 if (res->flags & IORESOURCE_IO)
178 root = &ioport_resource;
179 if (res->flags & IORESOURCE_MEM)
180 root = &iomem_resource;
181
182 return root;
183}
184
170#endif /* _ASM_PCI_H */ 185#endif /* _ASM_PCI_H */
diff --git a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h
index 2d63f5ba403f..ce57288d43bd 100644
--- a/include/asm-mips/pgalloc.h
+++ b/include/asm-mips/pgalloc.h
@@ -85,7 +85,7 @@ static inline void pte_free(struct page *pte)
85 85
86#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) 86#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
87 87
88#ifdef CONFIG_MIPS32 88#ifdef CONFIG_32BIT
89#define pgd_populate(mm, pmd, pte) BUG() 89#define pgd_populate(mm, pmd, pte) BUG()
90 90
91/* 91/*
@@ -97,7 +97,7 @@ static inline void pte_free(struct page *pte)
97#define __pmd_free_tlb(tlb,x) do { } while (0) 97#define __pmd_free_tlb(tlb,x) do { } while (0)
98#endif 98#endif
99 99
100#ifdef CONFIG_MIPS64 100#ifdef CONFIG_64BIT
101 101
102#define pgd_populate(mm, pgd, pmd) set_pgd(pgd, __pgd(pmd)) 102#define pgd_populate(mm, pgd, pmd) set_pgd(pgd, __pgd(pmd))
103 103
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h
index e76ccd6e3a5d..dbe13da0bdad 100644
--- a/include/asm-mips/pgtable.h
+++ b/include/asm-mips/pgtable.h
@@ -11,10 +11,10 @@
11#include <asm-generic/4level-fixup.h> 11#include <asm-generic/4level-fixup.h>
12 12
13#include <linux/config.h> 13#include <linux/config.h>
14#ifdef CONFIG_MIPS32 14#ifdef CONFIG_32BIT
15#include <asm/pgtable-32.h> 15#include <asm/pgtable-32.h>
16#endif 16#endif
17#ifdef CONFIG_MIPS64 17#ifdef CONFIG_64BIT
18#include <asm/pgtable-64.h> 18#include <asm/pgtable-64.h>
19#endif 19#endif
20 20
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h
index 13c54d5b3b48..d6466aa09fb7 100644
--- a/include/asm-mips/processor.h
+++ b/include/asm-mips/processor.h
@@ -33,7 +33,7 @@ extern void (*cpu_wait)(void);
33 33
34extern unsigned int vced_count, vcei_count; 34extern unsigned int vced_count, vcei_count;
35 35
36#ifdef CONFIG_MIPS32 36#ifdef CONFIG_32BIT
37/* 37/*
38 * User space process size: 2GB. This is hardcoded into a few places, 38 * User space process size: 2GB. This is hardcoded into a few places,
39 * so don't change it unless you know what you are doing. 39 * so don't change it unless you know what you are doing.
@@ -47,7 +47,7 @@ extern unsigned int vced_count, vcei_count;
47#define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3)) 47#define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3))
48#endif 48#endif
49 49
50#ifdef CONFIG_MIPS64 50#ifdef CONFIG_64BIT
51/* 51/*
52 * User space process size: 1TB. This is hardcoded into a few places, 52 * User space process size: 1TB. This is hardcoded into a few places,
53 * so don't change it unless you know what you are doing. TASK_SIZE 53 * so don't change it unless you know what you are doing. TASK_SIZE
diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h
index d3c46d633826..2b5c624c3d4f 100644
--- a/include/asm-mips/ptrace.h
+++ b/include/asm-mips/ptrace.h
@@ -28,7 +28,7 @@
28 * system call/exception. As usual the registers k0/k1 aren't being saved. 28 * system call/exception. As usual the registers k0/k1 aren't being saved.
29 */ 29 */
30struct pt_regs { 30struct pt_regs {
31#ifdef CONFIG_MIPS32 31#ifdef CONFIG_32BIT
32 /* Pad bytes for argument save space on the stack. */ 32 /* Pad bytes for argument save space on the stack. */
33 unsigned long pad0[6]; 33 unsigned long pad0[6];
34#endif 34#endif
diff --git a/include/asm-mips/qemu.h b/include/asm-mips/qemu.h
new file mode 100644
index 000000000000..905c39585903
--- /dev/null
+++ b/include/asm-mips/qemu.h
@@ -0,0 +1,24 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2005 by Ralf Baechle (ralf@linux-mips.org)
7 */
8#ifndef __ASM_QEMU_H
9#define __ASM_QEMU_H
10
11/*
12 * Interrupt numbers
13 */
14#define Q_PIC_IRQ_BASE 0
15#define Q_COUNT_COMPARE_IRQ 16
16
17/*
18 * Qemu clock rate. Unlike on real MIPS this has no relation to the
19 * instruction issue rate, so the choosen value is pure fiction, just needs
20 * to match the value in Qemu itself.
21 */
22#define QEMU_C0_COUNTER_CLOCK 100000000
23
24#endif /* __ASM_QEMU_H */
diff --git a/include/asm-mips/r4kcache.h b/include/asm-mips/r4kcache.h
index da03a32c1ca7..5bea49feec66 100644
--- a/include/asm-mips/r4kcache.h
+++ b/include/asm-mips/r4kcache.h
@@ -171,11 +171,11 @@ static inline void blast_dcache16(void)
171 unsigned long start = INDEX_BASE; 171 unsigned long start = INDEX_BASE;
172 unsigned long end = start + current_cpu_data.dcache.waysize; 172 unsigned long end = start + current_cpu_data.dcache.waysize;
173 unsigned long ws_inc = 1UL << current_cpu_data.dcache.waybit; 173 unsigned long ws_inc = 1UL << current_cpu_data.dcache.waybit;
174 unsigned long ws_end = current_cpu_data.dcache.ways << 174 unsigned long ws_end = current_cpu_data.dcache.ways <<
175 current_cpu_data.dcache.waybit; 175 current_cpu_data.dcache.waybit;
176 unsigned long ws, addr; 176 unsigned long ws, addr;
177 177
178 for (ws = 0; ws < ws_end; ws += ws_inc) 178 for (ws = 0; ws < ws_end; ws += ws_inc)
179 for (addr = start; addr < end; addr += 0x200) 179 for (addr = start; addr < end; addr += 0x200)
180 cache16_unroll32(addr|ws,Index_Writeback_Inv_D); 180 cache16_unroll32(addr|ws,Index_Writeback_Inv_D);
181} 181}
@@ -200,8 +200,8 @@ static inline void blast_dcache16_page_indexed(unsigned long page)
200 current_cpu_data.dcache.waybit; 200 current_cpu_data.dcache.waybit;
201 unsigned long ws, addr; 201 unsigned long ws, addr;
202 202
203 for (ws = 0; ws < ws_end; ws += ws_inc) 203 for (ws = 0; ws < ws_end; ws += ws_inc)
204 for (addr = start; addr < end; addr += 0x200) 204 for (addr = start; addr < end; addr += 0x200)
205 cache16_unroll32(addr|ws,Index_Writeback_Inv_D); 205 cache16_unroll32(addr|ws,Index_Writeback_Inv_D);
206} 206}
207 207
@@ -214,8 +214,8 @@ static inline void blast_icache16(void)
214 current_cpu_data.icache.waybit; 214 current_cpu_data.icache.waybit;
215 unsigned long ws, addr; 215 unsigned long ws, addr;
216 216
217 for (ws = 0; ws < ws_end; ws += ws_inc) 217 for (ws = 0; ws < ws_end; ws += ws_inc)
218 for (addr = start; addr < end; addr += 0x200) 218 for (addr = start; addr < end; addr += 0x200)
219 cache16_unroll32(addr|ws,Index_Invalidate_I); 219 cache16_unroll32(addr|ws,Index_Invalidate_I);
220} 220}
221 221
@@ -239,8 +239,8 @@ static inline void blast_icache16_page_indexed(unsigned long page)
239 current_cpu_data.icache.waybit; 239 current_cpu_data.icache.waybit;
240 unsigned long ws, addr; 240 unsigned long ws, addr;
241 241
242 for (ws = 0; ws < ws_end; ws += ws_inc) 242 for (ws = 0; ws < ws_end; ws += ws_inc)
243 for (addr = start; addr < end; addr += 0x200) 243 for (addr = start; addr < end; addr += 0x200)
244 cache16_unroll32(addr|ws,Index_Invalidate_I); 244 cache16_unroll32(addr|ws,Index_Invalidate_I);
245} 245}
246 246
@@ -249,11 +249,11 @@ static inline void blast_scache16(void)
249 unsigned long start = INDEX_BASE; 249 unsigned long start = INDEX_BASE;
250 unsigned long end = start + current_cpu_data.scache.waysize; 250 unsigned long end = start + current_cpu_data.scache.waysize;
251 unsigned long ws_inc = 1UL << current_cpu_data.scache.waybit; 251 unsigned long ws_inc = 1UL << current_cpu_data.scache.waybit;
252 unsigned long ws_end = current_cpu_data.scache.ways << 252 unsigned long ws_end = current_cpu_data.scache.ways <<
253 current_cpu_data.scache.waybit; 253 current_cpu_data.scache.waybit;
254 unsigned long ws, addr; 254 unsigned long ws, addr;
255 255
256 for (ws = 0; ws < ws_end; ws += ws_inc) 256 for (ws = 0; ws < ws_end; ws += ws_inc)
257 for (addr = start; addr < end; addr += 0x200) 257 for (addr = start; addr < end; addr += 0x200)
258 cache16_unroll32(addr|ws,Index_Writeback_Inv_SD); 258 cache16_unroll32(addr|ws,Index_Writeback_Inv_SD);
259} 259}
@@ -278,8 +278,8 @@ static inline void blast_scache16_page_indexed(unsigned long page)
278 current_cpu_data.scache.waybit; 278 current_cpu_data.scache.waybit;
279 unsigned long ws, addr; 279 unsigned long ws, addr;
280 280
281 for (ws = 0; ws < ws_end; ws += ws_inc) 281 for (ws = 0; ws < ws_end; ws += ws_inc)
282 for (addr = start; addr < end; addr += 0x200) 282 for (addr = start; addr < end; addr += 0x200)
283 cache16_unroll32(addr|ws,Index_Writeback_Inv_SD); 283 cache16_unroll32(addr|ws,Index_Writeback_Inv_SD);
284} 284}
285 285
@@ -318,8 +318,8 @@ static inline void blast_dcache32(void)
318 current_cpu_data.dcache.waybit; 318 current_cpu_data.dcache.waybit;
319 unsigned long ws, addr; 319 unsigned long ws, addr;
320 320
321 for (ws = 0; ws < ws_end; ws += ws_inc) 321 for (ws = 0; ws < ws_end; ws += ws_inc)
322 for (addr = start; addr < end; addr += 0x400) 322 for (addr = start; addr < end; addr += 0x400)
323 cache32_unroll32(addr|ws,Index_Writeback_Inv_D); 323 cache32_unroll32(addr|ws,Index_Writeback_Inv_D);
324} 324}
325 325
@@ -343,8 +343,8 @@ static inline void blast_dcache32_page_indexed(unsigned long page)
343 current_cpu_data.dcache.waybit; 343 current_cpu_data.dcache.waybit;
344 unsigned long ws, addr; 344 unsigned long ws, addr;
345 345
346 for (ws = 0; ws < ws_end; ws += ws_inc) 346 for (ws = 0; ws < ws_end; ws += ws_inc)
347 for (addr = start; addr < end; addr += 0x400) 347 for (addr = start; addr < end; addr += 0x400)
348 cache32_unroll32(addr|ws,Index_Writeback_Inv_D); 348 cache32_unroll32(addr|ws,Index_Writeback_Inv_D);
349} 349}
350 350
@@ -357,8 +357,8 @@ static inline void blast_icache32(void)
357 current_cpu_data.icache.waybit; 357 current_cpu_data.icache.waybit;
358 unsigned long ws, addr; 358 unsigned long ws, addr;
359 359
360 for (ws = 0; ws < ws_end; ws += ws_inc) 360 for (ws = 0; ws < ws_end; ws += ws_inc)
361 for (addr = start; addr < end; addr += 0x400) 361 for (addr = start; addr < end; addr += 0x400)
362 cache32_unroll32(addr|ws,Index_Invalidate_I); 362 cache32_unroll32(addr|ws,Index_Invalidate_I);
363} 363}
364 364
@@ -383,7 +383,7 @@ static inline void blast_icache32_page_indexed(unsigned long page)
383 unsigned long ws, addr; 383 unsigned long ws, addr;
384 384
385 for (ws = 0; ws < ws_end; ws += ws_inc) 385 for (ws = 0; ws < ws_end; ws += ws_inc)
386 for (addr = start; addr < end; addr += 0x400) 386 for (addr = start; addr < end; addr += 0x400)
387 cache32_unroll32(addr|ws,Index_Invalidate_I); 387 cache32_unroll32(addr|ws,Index_Invalidate_I);
388} 388}
389 389
@@ -392,11 +392,11 @@ static inline void blast_scache32(void)
392 unsigned long start = INDEX_BASE; 392 unsigned long start = INDEX_BASE;
393 unsigned long end = start + current_cpu_data.scache.waysize; 393 unsigned long end = start + current_cpu_data.scache.waysize;
394 unsigned long ws_inc = 1UL << current_cpu_data.scache.waybit; 394 unsigned long ws_inc = 1UL << current_cpu_data.scache.waybit;
395 unsigned long ws_end = current_cpu_data.scache.ways << 395 unsigned long ws_end = current_cpu_data.scache.ways <<
396 current_cpu_data.scache.waybit; 396 current_cpu_data.scache.waybit;
397 unsigned long ws, addr; 397 unsigned long ws, addr;
398 398
399 for (ws = 0; ws < ws_end; ws += ws_inc) 399 for (ws = 0; ws < ws_end; ws += ws_inc)
400 for (addr = start; addr < end; addr += 0x400) 400 for (addr = start; addr < end; addr += 0x400)
401 cache32_unroll32(addr|ws,Index_Writeback_Inv_SD); 401 cache32_unroll32(addr|ws,Index_Writeback_Inv_SD);
402} 402}
@@ -421,8 +421,8 @@ static inline void blast_scache32_page_indexed(unsigned long page)
421 current_cpu_data.scache.waybit; 421 current_cpu_data.scache.waybit;
422 unsigned long ws, addr; 422 unsigned long ws, addr;
423 423
424 for (ws = 0; ws < ws_end; ws += ws_inc) 424 for (ws = 0; ws < ws_end; ws += ws_inc)
425 for (addr = start; addr < end; addr += 0x400) 425 for (addr = start; addr < end; addr += 0x400)
426 cache32_unroll32(addr|ws,Index_Writeback_Inv_SD); 426 cache32_unroll32(addr|ws,Index_Writeback_Inv_SD);
427} 427}
428 428
@@ -461,8 +461,8 @@ static inline void blast_icache64(void)
461 current_cpu_data.icache.waybit; 461 current_cpu_data.icache.waybit;
462 unsigned long ws, addr; 462 unsigned long ws, addr;
463 463
464 for (ws = 0; ws < ws_end; ws += ws_inc) 464 for (ws = 0; ws < ws_end; ws += ws_inc)
465 for (addr = start; addr < end; addr += 0x800) 465 for (addr = start; addr < end; addr += 0x800)
466 cache64_unroll32(addr|ws,Index_Invalidate_I); 466 cache64_unroll32(addr|ws,Index_Invalidate_I);
467} 467}
468 468
@@ -487,7 +487,7 @@ static inline void blast_icache64_page_indexed(unsigned long page)
487 unsigned long ws, addr; 487 unsigned long ws, addr;
488 488
489 for (ws = 0; ws < ws_end; ws += ws_inc) 489 for (ws = 0; ws < ws_end; ws += ws_inc)
490 for (addr = start; addr < end; addr += 0x800) 490 for (addr = start; addr < end; addr += 0x800)
491 cache64_unroll32(addr|ws,Index_Invalidate_I); 491 cache64_unroll32(addr|ws,Index_Invalidate_I);
492} 492}
493 493
@@ -496,11 +496,11 @@ static inline void blast_scache64(void)
496 unsigned long start = INDEX_BASE; 496 unsigned long start = INDEX_BASE;
497 unsigned long end = start + current_cpu_data.scache.waysize; 497 unsigned long end = start + current_cpu_data.scache.waysize;
498 unsigned long ws_inc = 1UL << current_cpu_data.scache.waybit; 498 unsigned long ws_inc = 1UL << current_cpu_data.scache.waybit;
499 unsigned long ws_end = current_cpu_data.scache.ways << 499 unsigned long ws_end = current_cpu_data.scache.ways <<
500 current_cpu_data.scache.waybit; 500 current_cpu_data.scache.waybit;
501 unsigned long ws, addr; 501 unsigned long ws, addr;
502 502
503 for (ws = 0; ws < ws_end; ws += ws_inc) 503 for (ws = 0; ws < ws_end; ws += ws_inc)
504 for (addr = start; addr < end; addr += 0x800) 504 for (addr = start; addr < end; addr += 0x800)
505 cache64_unroll32(addr|ws,Index_Writeback_Inv_SD); 505 cache64_unroll32(addr|ws,Index_Writeback_Inv_SD);
506} 506}
@@ -525,8 +525,8 @@ static inline void blast_scache64_page_indexed(unsigned long page)
525 current_cpu_data.scache.waybit; 525 current_cpu_data.scache.waybit;
526 unsigned long ws, addr; 526 unsigned long ws, addr;
527 527
528 for (ws = 0; ws < ws_end; ws += ws_inc) 528 for (ws = 0; ws < ws_end; ws += ws_inc)
529 for (addr = start; addr < end; addr += 0x800) 529 for (addr = start; addr < end; addr += 0x800)
530 cache64_unroll32(addr|ws,Index_Writeback_Inv_SD); 530 cache64_unroll32(addr|ws,Index_Writeback_Inv_SD);
531} 531}
532 532
@@ -561,11 +561,11 @@ static inline void blast_scache128(void)
561 unsigned long start = INDEX_BASE; 561 unsigned long start = INDEX_BASE;
562 unsigned long end = start + current_cpu_data.scache.waysize; 562 unsigned long end = start + current_cpu_data.scache.waysize;
563 unsigned long ws_inc = 1UL << current_cpu_data.scache.waybit; 563 unsigned long ws_inc = 1UL << current_cpu_data.scache.waybit;
564 unsigned long ws_end = current_cpu_data.scache.ways << 564 unsigned long ws_end = current_cpu_data.scache.ways <<
565 current_cpu_data.scache.waybit; 565 current_cpu_data.scache.waybit;
566 unsigned long ws, addr; 566 unsigned long ws, addr;
567 567
568 for (ws = 0; ws < ws_end; ws += ws_inc) 568 for (ws = 0; ws < ws_end; ws += ws_inc)
569 for (addr = start; addr < end; addr += 0x1000) 569 for (addr = start; addr < end; addr += 0x1000)
570 cache128_unroll32(addr|ws,Index_Writeback_Inv_SD); 570 cache128_unroll32(addr|ws,Index_Writeback_Inv_SD);
571} 571}
@@ -590,8 +590,8 @@ static inline void blast_scache128_page_indexed(unsigned long page)
590 current_cpu_data.scache.waybit; 590 current_cpu_data.scache.waybit;
591 unsigned long ws, addr; 591 unsigned long ws, addr;
592 592
593 for (ws = 0; ws < ws_end; ws += ws_inc) 593 for (ws = 0; ws < ws_end; ws += ws_inc)
594 for (addr = start; addr < end; addr += 0x1000) 594 for (addr = start; addr < end; addr += 0x1000)
595 cache128_unroll32(addr|ws,Index_Writeback_Inv_SD); 595 cache128_unroll32(addr|ws,Index_Writeback_Inv_SD);
596} 596}
597 597
diff --git a/include/asm-mips/reg.h b/include/asm-mips/reg.h
index 7b33bbca9585..6173004cc88e 100644
--- a/include/asm-mips/reg.h
+++ b/include/asm-mips/reg.h
@@ -14,7 +14,7 @@
14 14
15#include <linux/config.h> 15#include <linux/config.h>
16 16
17#if defined(CONFIG_MIPS32) || defined(WANT_COMPAT_REG_H) 17#if defined(CONFIG_32BIT) || defined(WANT_COMPAT_REG_H)
18 18
19#define EF_R0 6 19#define EF_R0 6
20#define EF_R1 7 20#define EF_R1 7
@@ -70,7 +70,7 @@
70 70
71#endif 71#endif
72 72
73#if CONFIG_MIPS64 73#ifdef CONFIG_64BIT
74 74
75#define EF_R0 0 75#define EF_R0 0
76#define EF_R1 1 76#define EF_R1 1
@@ -124,6 +124,6 @@
124 124
125#define EF_SIZE 304 /* size in bytes */ 125#define EF_SIZE 304 /* size in bytes */
126 126
127#endif /* CONFIG_MIPS64 */ 127#endif /* CONFIG_64BIT */
128 128
129#endif /* __ASM_MIPS_REG_H */ 129#endif /* __ASM_MIPS_REG_H */
diff --git a/include/asm-mips/resource.h b/include/asm-mips/resource.h
index fd3c6d17a5f6..1fba00c22077 100644
--- a/include/asm-mips/resource.h
+++ b/include/asm-mips/resource.h
@@ -27,7 +27,7 @@
27 * but we keep the old value on MIPS32, 27 * but we keep the old value on MIPS32,
28 * for compatibility: 28 * for compatibility:
29 */ 29 */
30#ifdef CONFIG_MIPS32 30#ifdef CONFIG_32BIT
31# define RLIM_INFINITY 0x7fffffffUL 31# define RLIM_INFINITY 0x7fffffffUL
32#endif 32#endif
33 33
diff --git a/include/asm-mips/rtc.h b/include/asm-mips/rtc.h
index 31c0c2347f4f..3c4b637fd925 100644
--- a/include/asm-mips/rtc.h
+++ b/include/asm-mips/rtc.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-mips/rtc.h 2 * include/asm-mips/rtc.h
3 * 3 *
4 * (Really an interface for drivers/char/genrtc.c) 4 * (Really an interface for drivers/char/genrtc.c)
5 * 5 *
diff --git a/include/asm-mips/sgi/gio.h b/include/asm-mips/sgi/gio.h
index a38d66f99872..889cf028c95d 100644
--- a/include/asm-mips/sgi/gio.h
+++ b/include/asm-mips/sgi/gio.h
@@ -16,7 +16,7 @@
16 * 16 *
17 * The Indigo and Indy have two GIO bus connectors. Indigo2 (all models) have 17 * The Indigo and Indy have two GIO bus connectors. Indigo2 (all models) have
18 * three physical connectors, but only two slots, GFX and EXP0. 18 * three physical connectors, but only two slots, GFX and EXP0.
19 * 19 *
20 * There is 10MB of GIO address space for GIO64 slot devices 20 * There is 10MB of GIO address space for GIO64 slot devices
21 * slot# slot type address range size 21 * slot# slot type address range size
22 * ----- --------- ----------------------- ----- 22 * ----- --------- ----------------------- -----
diff --git a/include/asm-mips/sgi/hpc3.h b/include/asm-mips/sgi/hpc3.h
index a5b988d7327a..ac3dfc7af5b0 100644
--- a/include/asm-mips/sgi/hpc3.h
+++ b/include/asm-mips/sgi/hpc3.h
@@ -221,7 +221,7 @@ struct hpc3_regs {
221#define HPC3_BESTAT_PIDMASK 0x3f700 /* DMA channel parity identifier */ 221#define HPC3_BESTAT_PIDMASK 0x3f700 /* DMA channel parity identifier */
222 222
223 u32 _unused1[0x14000/4 - 5]; /* padding */ 223 u32 _unused1[0x14000/4 - 5]; /* padding */
224 224
225 /* Now direct PIO per-HPC3 peripheral access to external regs. */ 225 /* Now direct PIO per-HPC3 peripheral access to external regs. */
226 volatile u32 scsi0_ext[256]; /* SCSI channel 0 external regs */ 226 volatile u32 scsi0_ext[256]; /* SCSI channel 0 external regs */
227 u32 _unused2[0x7c00/4]; 227 u32 _unused2[0x7c00/4];
@@ -304,7 +304,7 @@ struct hpc3_regs {
304 volatile u32 bbram[8192-50-14]; /* Battery backed ram */ 304 volatile u32 bbram[8192-50-14]; /* Battery backed ram */
305}; 305};
306 306
307/* 307/*
308 * It is possible to have two HPC3's within the address space on 308 * It is possible to have two HPC3's within the address space on
309 * one machine, though only having one is more likely on an Indy. 309 * one machine, though only having one is more likely on an Indy.
310 */ 310 */
diff --git a/include/asm-mips/sgi/ioc.h b/include/asm-mips/sgi/ioc.h
index 169187f53fbc..f3e3dc9bb732 100644
--- a/include/asm-mips/sgi/ioc.h
+++ b/include/asm-mips/sgi/ioc.h
@@ -16,7 +16,7 @@
16#include <linux/types.h> 16#include <linux/types.h>
17#include <asm/sgi/pi1.h> 17#include <asm/sgi/pi1.h>
18 18
19/* 19/*
20 * All registers are 8-bit wide alligned on 32-bit boundary. Bad things 20 * All registers are 8-bit wide alligned on 32-bit boundary. Bad things
21 * happen if you try word access them. You have been warned. 21 * happen if you try word access them. You have been warned.
22 */ 22 */
@@ -138,7 +138,7 @@ struct sgioc_regs {
138 u8 _sysid[3]; 138 u8 _sysid[3];
139 volatile u8 sysid; 139 volatile u8 sysid;
140#define SGIOC_SYSID_FULLHOUSE 0x01 140#define SGIOC_SYSID_FULLHOUSE 0x01
141#define SGIOC_SYSID_BOARDREV(x) ((x & 0xe0) > 5) 141#define SGIOC_SYSID_BOARDREV(x) ((x & 0xe0) > 5)
142#define SGIOC_SYSID_CHIPREV(x) ((x & 0x1e) > 1) 142#define SGIOC_SYSID_CHIPREV(x) ((x & 0x1e) > 1)
143 u32 _unused2; 143 u32 _unused2;
144 u8 _read[3]; 144 u8 _read[3];
diff --git a/include/asm-mips/sgi/ip22.h b/include/asm-mips/sgi/ip22.h
index 97d73adb4e40..bbfc05c3cab9 100644
--- a/include/asm-mips/sgi/ip22.h
+++ b/include/asm-mips/sgi/ip22.h
@@ -12,7 +12,7 @@
12#ifndef _SGI_IP22_H 12#ifndef _SGI_IP22_H
13#define _SGI_IP22_H 13#define _SGI_IP22_H
14 14
15/* 15/*
16 * These are the virtual IRQ numbers, we divide all IRQ's into 16 * These are the virtual IRQ numbers, we divide all IRQ's into
17 * 'spaces', the 'space' determines where and how to enable/disable 17 * 'spaces', the 'space' determines where and how to enable/disable
18 * that particular IRQ on an SGI machine. HPC DMA and MC DMA interrups 18 * that particular IRQ on an SGI machine. HPC DMA and MC DMA interrups
diff --git a/include/asm-mips/sgi/mc.h b/include/asm-mips/sgi/mc.h
index fd98f930607c..c52f7834c7c8 100644
--- a/include/asm-mips/sgi/mc.h
+++ b/include/asm-mips/sgi/mc.h
@@ -182,14 +182,14 @@ struct sgimc_regs {
182 volatile u32 dtlb_hi3; 182 volatile u32 dtlb_hi3;
183 u32 _unused33; 183 u32 _unused33;
184 volatile u32 dtlb_lo3; 184 volatile u32 dtlb_lo3;
185 185
186 u32 _unused34[0x0392]; 186 u32 _unused34[0x0392];
187 187
188 u32 _unused35; 188 u32 _unused35;
189 volatile u32 rpsscounter; /* Chirps at 100ns */ 189 volatile u32 rpsscounter; /* Chirps at 100ns */
190 190
191 u32 _unused36[0x1000/4-2*4]; 191 u32 _unused36[0x1000/4-2*4];
192 192
193 u32 _unused37; 193 u32 _unused37;
194 volatile u32 maddronly; /* Address DMA goes at */ 194 volatile u32 maddronly; /* Address DMA goes at */
195 u32 _unused38; 195 u32 _unused38;
diff --git a/include/asm-mips/sgiarcs.h b/include/asm-mips/sgiarcs.h
index 59450335f049..722b77a8c5e5 100644
--- a/include/asm-mips/sgiarcs.h
+++ b/include/asm-mips/sgiarcs.h
@@ -367,7 +367,7 @@ struct linux_smonblock {
367 * Macros for calling a 32-bit ARC implementation from 64-bit code 367 * Macros for calling a 32-bit ARC implementation from 64-bit code
368 */ 368 */
369 369
370#if defined(CONFIG_MIPS64) && defined(CONFIG_ARC32) 370#if defined(CONFIG_64BIT) && defined(CONFIG_ARC32)
371 371
372#define __arc_clobbers \ 372#define __arc_clobbers \
373 "$2","$3" /* ... */, "$8","$9","$10","$11", \ 373 "$2","$3" /* ... */, "$8","$9","$10","$11", \
@@ -476,10 +476,10 @@ struct linux_smonblock {
476 __res; \ 476 __res; \
477}) 477})
478 478
479#endif /* defined(CONFIG_MIPS64) && defined(CONFIG_ARC32) */ 479#endif /* defined(CONFIG_64BIT) && defined(CONFIG_ARC32) */
480 480
481#if (defined(CONFIG_MIPS32) && defined(CONFIG_ARC32)) || \ 481#if (defined(CONFIG_32BIT) && defined(CONFIG_ARC32)) || \
482 (defined(CONFIG_MIPS64) && defined(CONFIG_ARC64)) 482 (defined(CONFIG_64BIT) && defined(CONFIG_ARC64))
483 483
484#define ARC_CALL0(dest) \ 484#define ARC_CALL0(dest) \
485({ long __res; \ 485({ long __res; \
diff --git a/include/asm-mips/sibyte/carmel.h b/include/asm-mips/sibyte/carmel.h
index 7ac5da13ce8a..b5e7dae19f0f 100644
--- a/include/asm-mips/sibyte/carmel.h
+++ b/include/asm-mips/sibyte/carmel.h
@@ -25,12 +25,12 @@
25 25
26#define SIBYTE_BOARD_NAME "Carmel" 26#define SIBYTE_BOARD_NAME "Carmel"
27 27
28#define GPIO_PHY_INTERRUPT 2 28#define GPIO_PHY_INTERRUPT 2
29#define GPIO_NONMASKABLE_INT 3 29#define GPIO_NONMASKABLE_INT 3
30#define GPIO_CF_INSERTED 6 30#define GPIO_CF_INSERTED 6
31#define GPIO_MONTEREY_RESET 7 31#define GPIO_MONTEREY_RESET 7
32#define GPIO_QUADUART_INT 8 32#define GPIO_QUADUART_INT 8
33#define GPIO_CF_INT 9 33#define GPIO_CF_INT 9
34#define GPIO_FPGA_CCLK 10 34#define GPIO_FPGA_CCLK 10
35#define GPIO_FPGA_DOUT 11 35#define GPIO_FPGA_DOUT 11
36#define GPIO_FPGA_DIN 12 36#define GPIO_FPGA_DIN 12
diff --git a/include/asm-mips/sibyte/sb1250_defs.h b/include/asm-mips/sibyte/sb1250_defs.h
index 96088fb074a4..40ef97c76c8b 100644
--- a/include/asm-mips/sibyte/sb1250_defs.h
+++ b/include/asm-mips/sibyte/sb1250_defs.h
@@ -1,23 +1,23 @@
1/* ********************************************************************* 1/* *********************************************************************
2 * SB1250 Board Support Package 2 * SB1250 Board Support Package
3 * 3 *
4 * Global constants and macros File: sb1250_defs.h 4 * Global constants and macros File: sb1250_defs.h
5 * 5 *
6 * This file contains macros and definitions used by the other 6 * This file contains macros and definitions used by the other
7 * include files. 7 * include files.
8 * 8 *
9 * SB1250 specification level: User's manual 1/02/02 9 * SB1250 specification level: User's manual 1/02/02
10 * 10 *
11 * Author: Mitch Lichtenberg 11 * Author: Mitch Lichtenberg
12 * 12 *
13 ********************************************************************* 13 *********************************************************************
14 * 14 *
15 * Copyright 2000,2001,2002,2003 15 * Copyright 2000,2001,2002,2003
16 * Broadcom Corporation. All rights reserved. 16 * Broadcom Corporation. All rights reserved.
17 * 17 *
18 * This program is free software; you can redistribute it and/or 18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License as 19 * modify it under the terms of the GNU General Public License as
20 * published by the Free Software Foundation; either version 2 of 20 * published by the Free Software Foundation; either version 2 of
21 * the License, or (at your option) any later version. 21 * the License, or (at your option) any later version.
22 * 22 *
23 * This program is distributed in the hope that it will be useful, 23 * This program is distributed in the hope that it will be useful,
@@ -27,7 +27,7 @@
27 * 27 *
28 * You should have received a copy of the GNU General Public License 28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software 29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 * MA 02111-1307 USA 31 * MA 02111-1307 USA
32 ********************************************************************* */ 32 ********************************************************************* */
33 33
@@ -105,7 +105,7 @@
105#define SIBYTE_HDR_FMASK_112x_ALL 0x0000f00 105#define SIBYTE_HDR_FMASK_112x_ALL 0x0000f00
106#define SIBYTE_HDR_FMASK_112x_PASS1 0x0000100 106#define SIBYTE_HDR_FMASK_112x_PASS1 0x0000100
107 107
108/* Bit mask for chip/revision. (use _ALL for all revisions of a chip). */ 108/* Bit mask for chip/revision. (use _ALL for all revisions of a chip). */
109#define SIBYTE_HDR_FMASK(chip, pass) \ 109#define SIBYTE_HDR_FMASK(chip, pass) \
110 (SIBYTE_HDR_FMASK_ ## chip ## _ ## pass) 110 (SIBYTE_HDR_FMASK_ ## chip ## _ ## pass)
111#define SIBYTE_HDR_FMASK_ALLREVS(chip) \ 111#define SIBYTE_HDR_FMASK_ALLREVS(chip) \
@@ -150,31 +150,31 @@
150 150
151/* ********************************************************************* 151/* *********************************************************************
152 * Naming schemes for constants in these files: 152 * Naming schemes for constants in these files:
153 * 153 *
154 * M_xxx MASK constant (identifies bits in a register). 154 * M_xxx MASK constant (identifies bits in a register).
155 * For multi-bit fields, all bits in the field will 155 * For multi-bit fields, all bits in the field will
156 * be set. 156 * be set.
157 * 157 *
158 * K_xxx "Code" constant (value for data in a multi-bit 158 * K_xxx "Code" constant (value for data in a multi-bit
159 * field). The value is right justified. 159 * field). The value is right justified.
160 * 160 *
161 * V_xxx "Value" constant. This is the same as the 161 * V_xxx "Value" constant. This is the same as the
162 * corresponding "K_xxx" constant, except it is 162 * corresponding "K_xxx" constant, except it is
163 * shifted to the correct position in the register. 163 * shifted to the correct position in the register.
164 * 164 *
165 * S_xxx SHIFT constant. This is the number of bits that 165 * S_xxx SHIFT constant. This is the number of bits that
166 * a field value (code) needs to be shifted 166 * a field value (code) needs to be shifted
167 * (towards the left) to put the value in the right 167 * (towards the left) to put the value in the right
168 * position for the register. 168 * position for the register.
169 * 169 *
170 * A_xxx ADDRESS constant. This will be a physical 170 * A_xxx ADDRESS constant. This will be a physical
171 * address. Use the PHYS_TO_K1 macro to generate 171 * address. Use the PHYS_TO_K1 macro to generate
172 * a K1SEG address. 172 * a K1SEG address.
173 * 173 *
174 * R_xxx RELATIVE offset constant. This is an offset from 174 * R_xxx RELATIVE offset constant. This is an offset from
175 * an A_xxx constant (usually the first register in 175 * an A_xxx constant (usually the first register in
176 * a group). 176 * a group).
177 * 177 *
178 * G_xxx(X) GET value. This macro obtains a multi-bit field 178 * G_xxx(X) GET value. This macro obtains a multi-bit field
179 * from a register, masks it, and shifts it to 179 * from a register, masks it, and shifts it to
180 * the bottom of the register (retrieving a K_xxx 180 * the bottom of the register (retrieving a K_xxx
@@ -189,7 +189,7 @@
189 189
190 190
191/* 191/*
192 * Cast to 64-bit number. Presumably the syntax is different in 192 * Cast to 64-bit number. Presumably the syntax is different in
193 * assembly language. 193 * assembly language.
194 * 194 *
195 * Note: you'll need to define uint32_t and uint64_t in your headers. 195 * Note: you'll need to define uint32_t and uint64_t in your headers.
diff --git a/include/asm-mips/sibyte/sb1250_dma.h b/include/asm-mips/sibyte/sb1250_dma.h
index f1b08d32338d..3cdb48f50ed0 100644
--- a/include/asm-mips/sibyte/sb1250_dma.h
+++ b/include/asm-mips/sibyte/sb1250_dma.h
@@ -1,24 +1,24 @@
1/* ********************************************************************* 1/* *********************************************************************
2 * SB1250 Board Support Package 2 * SB1250 Board Support Package
3 * 3 *
4 * DMA definitions File: sb1250_dma.h 4 * DMA definitions File: sb1250_dma.h
5 * 5 *
6 * This module contains constants and macros useful for 6 * This module contains constants and macros useful for
7 * programming the SB1250's DMA controllers, both the data mover 7 * programming the SB1250's DMA controllers, both the data mover
8 * and the Ethernet DMA. 8 * and the Ethernet DMA.
9 * 9 *
10 * SB1250 specification level: User's manual 1/02/02 10 * SB1250 specification level: User's manual 1/02/02
11 * 11 *
12 * Author: Mitch Lichtenberg 12 * Author: Mitch Lichtenberg
13 * 13 *
14 ********************************************************************* 14 *********************************************************************
15 * 15 *
16 * Copyright 2000,2001,2002,2003 16 * Copyright 2000,2001,2002,2003
17 * Broadcom Corporation. All rights reserved. 17 * Broadcom Corporation. All rights reserved.
18 * 18 *
19 * This program is free software; you can redistribute it and/or 19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License as 20 * modify it under the terms of the GNU General Public License as
21 * published by the Free Software Foundation; either version 2 of 21 * published by the Free Software Foundation; either version 2 of
22 * the License, or (at your option) any later version. 22 * the License, or (at your option) any later version.
23 * 23 *
24 * This program is distributed in the hope that it will be useful, 24 * This program is distributed in the hope that it will be useful,
@@ -28,7 +28,7 @@
28 * 28 *
29 * You should have received a copy of the GNU General Public License 29 * You should have received a copy of the GNU General Public License
30 * along with this program; if not, write to the Free Software 30 * along with this program; if not, write to the Free Software
31 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 31 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32 * MA 02111-1307 USA 32 * MA 02111-1307 USA
33 ********************************************************************* */ 33 ********************************************************************* */
34 34
@@ -43,9 +43,9 @@
43 * DMA Registers 43 * DMA Registers
44 ********************************************************************* */ 44 ********************************************************************* */
45 45
46/* 46/*
47 * Ethernet and Serial DMA Configuration Register 0 (Table 7-4) 47 * Ethernet and Serial DMA Configuration Register 0 (Table 7-4)
48 * Registers: DMA_CONFIG0_MAC_x_RX_CH_0 48 * Registers: DMA_CONFIG0_MAC_x_RX_CH_0
49 * Registers: DMA_CONFIG0_MAC_x_TX_CH_0 49 * Registers: DMA_CONFIG0_MAC_x_TX_CH_0
50 * Registers: DMA_CONFIG0_SER_x_RX 50 * Registers: DMA_CONFIG0_SER_x_RX
51 * Registers: DMA_CONFIG0_SER_x_TX 51 * Registers: DMA_CONFIG0_SER_x_TX
@@ -98,7 +98,7 @@
98 98
99/* 99/*
100 * Ethernet and Serial DMA Configuration Register 1 (Table 7-5) 100 * Ethernet and Serial DMA Configuration Register 1 (Table 7-5)
101 * Registers: DMA_CONFIG1_MAC_x_RX_CH_0 101 * Registers: DMA_CONFIG1_MAC_x_RX_CH_0
102 * Registers: DMA_CONFIG1_DMA_x_TX_CH_0 102 * Registers: DMA_CONFIG1_DMA_x_TX_CH_0
103 * Registers: DMA_CONFIG1_SER_x_RX 103 * Registers: DMA_CONFIG1_SER_x_RX
104 * Registers: DMA_CONFIG1_SER_x_TX 104 * Registers: DMA_CONFIG1_SER_x_TX
@@ -152,11 +152,11 @@
152/* 152/*
153 * DMA Descriptor Count Registers (Table 7-8) 153 * DMA Descriptor Count Registers (Table 7-8)
154 */ 154 */
155 155
156/* No bitfields */ 156/* No bitfields */
157 157
158 158
159/* 159/*
160 * Current Descriptor Address Register (Table 7-11) 160 * Current Descriptor Address Register (Table 7-11)
161 */ 161 */
162 162
@@ -275,14 +275,14 @@
275#define V_DMA_DSCRB_STATUS(x) _SB_MAKEVALUE(x,S_DMA_DSCRB_STATUS) 275#define V_DMA_DSCRB_STATUS(x) _SB_MAKEVALUE(x,S_DMA_DSCRB_STATUS)
276#define G_DMA_DSCRB_STATUS(x) _SB_GETVALUE(x,S_DMA_DSCRB_STATUS,M_DMA_DSCRB_STATUS) 276#define G_DMA_DSCRB_STATUS(x) _SB_GETVALUE(x,S_DMA_DSCRB_STATUS,M_DMA_DSCRB_STATUS)
277 277
278/* 278/*
279 * Ethernet Descriptor Status Bits (Table 7-15) 279 * Ethernet Descriptor Status Bits (Table 7-15)
280 */ 280 */
281 281
282#define M_DMA_ETHRX_BADIP4CS _SB_MAKEMASK1(51) 282#define M_DMA_ETHRX_BADIP4CS _SB_MAKEMASK1(51)
283#define M_DMA_ETHRX_DSCRERR _SB_MAKEMASK1(52) 283#define M_DMA_ETHRX_DSCRERR _SB_MAKEMASK1(52)
284 284
285#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) 285#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1)
286/* Note: BADTCPCS is actually in DSCR_B options field */ 286/* Note: BADTCPCS is actually in DSCR_B options field */
287#define M_DMA_ETHRX_BADTCPCS _SB_MAKEMASK1(0) 287#define M_DMA_ETHRX_BADTCPCS _SB_MAKEMASK1(0)
288#endif /* 1250 PASS2 || 112x PASS1 */ 288#endif /* 1250 PASS2 || 112x PASS1 */
@@ -324,7 +324,7 @@
324 324
325#define M_DMA_ETHTX_SOP _SB_MAKEMASK1(63) 325#define M_DMA_ETHTX_SOP _SB_MAKEMASK1(63)
326 326
327/* 327/*
328 * Ethernet Transmit Options (Table 7-17) 328 * Ethernet Transmit Options (Table 7-17)
329 */ 329 */
330 330
@@ -377,7 +377,7 @@
377 * Data Mover Registers 377 * Data Mover Registers
378 ********************************************************************* */ 378 ********************************************************************* */
379 379
380/* 380/*
381 * Data Mover Descriptor Base Address Register (Table 7-22) 381 * Data Mover Descriptor Base Address Register (Table 7-22)
382 * Register: DM_DSCR_BASE_0 382 * Register: DM_DSCR_BASE_0
383 * Register: DM_DSCR_BASE_1 383 * Register: DM_DSCR_BASE_1
@@ -414,7 +414,7 @@
414#define M_DM_DSCR_BASE_ABORT _SB_MAKEMASK1(62) 414#define M_DM_DSCR_BASE_ABORT _SB_MAKEMASK1(62)
415#define M_DM_DSCR_BASE_ENABL _SB_MAKEMASK1(63) 415#define M_DM_DSCR_BASE_ENABL _SB_MAKEMASK1(63)
416 416
417/* 417/*
418 * Data Mover Descriptor Count Register (Table 7-25) 418 * Data Mover Descriptor Count Register (Table 7-25)
419 */ 419 */
420 420
diff --git a/include/asm-mips/sibyte/sb1250_genbus.h b/include/asm-mips/sibyte/sb1250_genbus.h
index 0d9dfac3d7db..f1f509f295c4 100644
--- a/include/asm-mips/sibyte/sb1250_genbus.h
+++ b/include/asm-mips/sibyte/sb1250_genbus.h
@@ -1,23 +1,23 @@
1/* ********************************************************************* 1/* *********************************************************************
2 * SB1250 Board Support Package 2 * SB1250 Board Support Package
3 * 3 *
4 * Generic Bus Constants File: sb1250_genbus.h 4 * Generic Bus Constants File: sb1250_genbus.h
5 * 5 *
6 * This module contains constants and macros useful for 6 * This module contains constants and macros useful for
7 * manipulating the SB1250's Generic Bus interface 7 * manipulating the SB1250's Generic Bus interface
8 * 8 *
9 * SB1250 specification level: User's manual 1/02/02 9 * SB1250 specification level: User's manual 1/02/02
10 * 10 *
11 * Author: Mitch Lichtenberg 11 * Author: Mitch Lichtenberg
12 * 12 *
13 ********************************************************************* 13 *********************************************************************
14 * 14 *
15 * Copyright 2000,2001,2002,2003 15 * Copyright 2000,2001,2002,2003
16 * Broadcom Corporation. All rights reserved. 16 * Broadcom Corporation. All rights reserved.
17 * 17 *
18 * This program is free software; you can redistribute it and/or 18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License as 19 * modify it under the terms of the GNU General Public License as
20 * published by the Free Software Foundation; either version 2 of 20 * published by the Free Software Foundation; either version 2 of
21 * the License, or (at your option) any later version. 21 * the License, or (at your option) any later version.
22 * 22 *
23 * This program is distributed in the hope that it will be useful, 23 * This program is distributed in the hope that it will be useful,
@@ -27,7 +27,7 @@
27 * 27 *
28 * You should have received a copy of the GNU General Public License 28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software 29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 * MA 02111-1307 USA 31 * MA 02111-1307 USA
32 ********************************************************************* */ 32 ********************************************************************* */
33 33
diff --git a/include/asm-mips/sibyte/sb1250_int.h b/include/asm-mips/sibyte/sb1250_int.h
index c3f74df211f4..e173e2ea4c98 100644
--- a/include/asm-mips/sibyte/sb1250_int.h
+++ b/include/asm-mips/sibyte/sb1250_int.h
@@ -1,23 +1,23 @@
1/* ********************************************************************* 1/* *********************************************************************
2 * SB1250 Board Support Package 2 * SB1250 Board Support Package
3 * 3 *
4 * Interrupt Mapper definitions File: sb1250_int.h 4 * Interrupt Mapper definitions File: sb1250_int.h
5 * 5 *
6 * This module contains constants for manipulating the SB1250's 6 * This module contains constants for manipulating the SB1250's
7 * interrupt mapper and definitions for the interrupt sources. 7 * interrupt mapper and definitions for the interrupt sources.
8 * 8 *
9 * SB1250 specification level: User's manual 1/02/02 9 * SB1250 specification level: User's manual 1/02/02
10 * 10 *
11 * Author: Mitch Lichtenberg 11 * Author: Mitch Lichtenberg
12 * 12 *
13 ********************************************************************* 13 *********************************************************************
14 * 14 *
15 * Copyright 2000,2001,2002,2003 15 * Copyright 2000,2001,2002,2003
16 * Broadcom Corporation. All rights reserved. 16 * Broadcom Corporation. All rights reserved.
17 * 17 *
18 * This program is free software; you can redistribute it and/or 18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License as 19 * modify it under the terms of the GNU General Public License as
20 * published by the Free Software Foundation; either version 2 of 20 * published by the Free Software Foundation; either version 2 of
21 * the License, or (at your option) any later version. 21 * the License, or (at your option) any later version.
22 * 22 *
23 * This program is distributed in the hope that it will be useful, 23 * This program is distributed in the hope that it will be useful,
@@ -27,7 +27,7 @@
27 * 27 *
28 * You should have received a copy of the GNU General Public License 28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software 29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 * MA 02111-1307 USA 31 * MA 02111-1307 USA
32 ********************************************************************* */ 32 ********************************************************************* */
33 33
@@ -43,7 +43,7 @@
43 43
44/* 44/*
45 * Interrupt sources (Table 4-8, UM 0.2) 45 * Interrupt sources (Table 4-8, UM 0.2)
46 * 46 *
47 * First, the interrupt numbers. 47 * First, the interrupt numbers.
48 */ 48 */
49 49
diff --git a/include/asm-mips/sibyte/sb1250_l2c.h b/include/asm-mips/sibyte/sb1250_l2c.h
index 799db828d963..8afe8e01581b 100644
--- a/include/asm-mips/sibyte/sb1250_l2c.h
+++ b/include/asm-mips/sibyte/sb1250_l2c.h
@@ -1,23 +1,23 @@
1/* ********************************************************************* 1/* *********************************************************************
2 * SB1250 Board Support Package 2 * SB1250 Board Support Package
3 * 3 *
4 * L2 Cache constants and macros File: sb1250_l2c.h 4 * L2 Cache constants and macros File: sb1250_l2c.h
5 * 5 *
6 * This module contains constants useful for manipulating the 6 * This module contains constants useful for manipulating the
7 * level 2 cache. 7 * level 2 cache.
8 * 8 *
9 * SB1250 specification level: User's manual 1/02/02 9 * SB1250 specification level: User's manual 1/02/02
10 * 10 *
11 * Author: Mitch Lichtenberg 11 * Author: Mitch Lichtenberg
12 * 12 *
13 ********************************************************************* 13 *********************************************************************
14 * 14 *
15 * Copyright 2000,2001,2002,2003 15 * Copyright 2000,2001,2002,2003
16 * Broadcom Corporation. All rights reserved. 16 * Broadcom Corporation. All rights reserved.
17 * 17 *
18 * This program is free software; you can redistribute it and/or 18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License as 19 * modify it under the terms of the GNU General Public License as
20 * published by the Free Software Foundation; either version 2 of 20 * published by the Free Software Foundation; either version 2 of
21 * the License, or (at your option) any later version. 21 * the License, or (at your option) any later version.
22 * 22 *
23 * This program is distributed in the hope that it will be useful, 23 * This program is distributed in the hope that it will be useful,
@@ -27,7 +27,7 @@
27 * 27 *
28 * You should have received a copy of the GNU General Public License 28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software 29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 * MA 02111-1307 USA 31 * MA 02111-1307 USA
32 ********************************************************************* */ 32 ********************************************************************* */
33 33
diff --git a/include/asm-mips/sibyte/sb1250_ldt.h b/include/asm-mips/sibyte/sb1250_ldt.h
index d8753885df17..f2617ded0a8f 100644
--- a/include/asm-mips/sibyte/sb1250_ldt.h
+++ b/include/asm-mips/sibyte/sb1250_ldt.h
@@ -1,23 +1,23 @@
1/* ********************************************************************* 1/* *********************************************************************
2 * SB1250 Board Support Package 2 * SB1250 Board Support Package
3 * 3 *
4 * LDT constants File: sb1250_ldt.h 4 * LDT constants File: sb1250_ldt.h
5 * 5 *
6 * This module contains constants and macros to describe 6 * This module contains constants and macros to describe
7 * the LDT interface on the SB1250. 7 * the LDT interface on the SB1250.
8 * 8 *
9 * SB1250 specification level: User's manual 1/02/02 9 * SB1250 specification level: User's manual 1/02/02
10 * 10 *
11 * Author: Mitch Lichtenberg 11 * Author: Mitch Lichtenberg
12 * 12 *
13 ********************************************************************* 13 *********************************************************************
14 * 14 *
15 * Copyright 2000,2001,2002,2003 15 * Copyright 2000,2001,2002,2003
16 * Broadcom Corporation. All rights reserved. 16 * Broadcom Corporation. All rights reserved.
17 * 17 *
18 * This program is free software; you can redistribute it and/or 18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License as 19 * modify it under the terms of the GNU General Public License as
20 * published by the Free Software Foundation; either version 2 of 20 * published by the Free Software Foundation; either version 2 of
21 * the License, or (at your option) any later version. 21 * the License, or (at your option) any later version.
22 * 22 *
23 * This program is distributed in the hope that it will be useful, 23 * This program is distributed in the hope that it will be useful,
@@ -27,7 +27,7 @@
27 * 27 *
28 * You should have received a copy of the GNU General Public License 28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software 29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 * MA 02111-1307 USA 31 * MA 02111-1307 USA
32 ********************************************************************* */ 32 ********************************************************************* */
33 33
@@ -155,7 +155,7 @@
155 155
156/* 156/*
157 * LDT Status Register (Table 8-14). Note that these constants 157 * LDT Status Register (Table 8-14). Note that these constants
158 * assume you've read the command and status register 158 * assume you've read the command and status register
159 * together (32-bit read at offset 0x04) 159 * together (32-bit read at offset 0x04)
160 * 160 *
161 * These bits also apply to the secondary status 161 * These bits also apply to the secondary status
@@ -183,8 +183,8 @@
183#define M_LDT_STATUS_DETPARERR _SB_MAKEMASK1_32(31) 183#define M_LDT_STATUS_DETPARERR _SB_MAKEMASK1_32(31)
184 184
185/* 185/*
186 * Bridge Control Register (Table 8-16). Note that these 186 * Bridge Control Register (Table 8-16). Note that these
187 * constants assume you've read the register as a 32-bit 187 * constants assume you've read the register as a 32-bit
188 * read (offset 0x3C) 188 * read (offset 0x3C)
189 */ 189 */
190 190
diff --git a/include/asm-mips/sibyte/sb1250_mac.h b/include/asm-mips/sibyte/sb1250_mac.h
index 81f603f03a98..18e74e43f4a2 100644
--- a/include/asm-mips/sibyte/sb1250_mac.h
+++ b/include/asm-mips/sibyte/sb1250_mac.h
@@ -1,23 +1,23 @@
1/* ********************************************************************* 1/* *********************************************************************
2 * SB1250 Board Support Package 2 * SB1250 Board Support Package
3 * 3 *
4 * MAC constants and macros File: sb1250_mac.h 4 * MAC constants and macros File: sb1250_mac.h
5 * 5 *
6 * This module contains constants and macros for the SB1250's 6 * This module contains constants and macros for the SB1250's
7 * ethernet controllers. 7 * ethernet controllers.
8 * 8 *
9 * SB1250 specification level: User's manual 1/02/02 9 * SB1250 specification level: User's manual 1/02/02
10 * 10 *
11 * Author: Mitch Lichtenberg 11 * Author: Mitch Lichtenberg
12 * 12 *
13 ********************************************************************* 13 *********************************************************************
14 * 14 *
15 * Copyright 2000,2001,2002,2003 15 * Copyright 2000,2001,2002,2003
16 * Broadcom Corporation. All rights reserved. 16 * Broadcom Corporation. All rights reserved.
17 * 17 *
18 * This program is free software; you can redistribute it and/or 18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License as 19 * modify it under the terms of the GNU General Public License as
20 * published by the Free Software Foundation; either version 2 of 20 * published by the Free Software Foundation; either version 2 of
21 * the License, or (at your option) any later version. 21 * the License, or (at your option) any later version.
22 * 22 *
23 * This program is distributed in the hope that it will be useful, 23 * This program is distributed in the hope that it will be useful,
@@ -27,7 +27,7 @@
27 * 27 *
28 * You should have received a copy of the GNU General Public License 28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software 29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 * MA 02111-1307 USA 31 * MA 02111-1307 USA
32 ********************************************************************* */ 32 ********************************************************************* */
33 33
@@ -311,7 +311,7 @@
311 311
312/* 312/*
313 * These constants are used to configure the fields within the Frame 313 * These constants are used to configure the fields within the Frame
314 * Configuration Register. 314 * Configuration Register.
315 */ 315 */
316 316
317#define K_MAC_IFG_RX_10 _SB_MAKE64(0) /* See table 176, not used */ 317#define K_MAC_IFG_RX_10 _SB_MAKE64(0) /* See table 176, not used */
@@ -393,7 +393,7 @@
393 * Register: MAC_INT_MASK_2 393 * Register: MAC_INT_MASK_2
394 */ 394 */
395 395
396/* 396/*
397 * Use these constants to shift the appropriate channel 397 * Use these constants to shift the appropriate channel
398 * into the CH0 position so the same tests can be used 398 * into the CH0 position so the same tests can be used
399 * on each channel. 399 * on each channel.
diff --git a/include/asm-mips/sibyte/sb1250_mc.h b/include/asm-mips/sibyte/sb1250_mc.h
index 93a48334b874..1dd41c927996 100644
--- a/include/asm-mips/sibyte/sb1250_mc.h
+++ b/include/asm-mips/sibyte/sb1250_mc.h
@@ -1,23 +1,23 @@
1/* ********************************************************************* 1/* *********************************************************************
2 * SB1250 Board Support Package 2 * SB1250 Board Support Package
3 * 3 *
4 * Memory Controller constants File: sb1250_mc.h 4 * Memory Controller constants File: sb1250_mc.h
5 * 5 *
6 * This module contains constants and macros useful for 6 * This module contains constants and macros useful for
7 * programming the memory controller. 7 * programming the memory controller.
8 * 8 *
9 * SB1250 specification level: User's manual 1/02/02 9 * SB1250 specification level: User's manual 1/02/02
10 * 10 *
11 * Author: Mitch Lichtenberg 11 * Author: Mitch Lichtenberg
12 * 12 *
13 ********************************************************************* 13 *********************************************************************
14 * 14 *
15 * Copyright 2000,2001,2002,2003 15 * Copyright 2000,2001,2002,2003
16 * Broadcom Corporation. All rights reserved. 16 * Broadcom Corporation. All rights reserved.
17 * 17 *
18 * This program is free software; you can redistribute it and/or 18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License as 19 * modify it under the terms of the GNU General Public License as
20 * published by the Free Software Foundation; either version 2 of 20 * published by the Free Software Foundation; either version 2 of
21 * the License, or (at your option) any later version. 21 * the License, or (at your option) any later version.
22 * 22 *
23 * This program is distributed in the hope that it will be useful, 23 * This program is distributed in the hope that it will be useful,
@@ -27,7 +27,7 @@
27 * 27 *
28 * You should have received a copy of the GNU General Public License 28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software 29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 * MA 02111-1307 USA 31 * MA 02111-1307 USA
32 ********************************************************************* */ 32 ********************************************************************* */
33 33
@@ -166,7 +166,7 @@
166 166
167#define K_MC_REF_RATE_100MHz 0x62 167#define K_MC_REF_RATE_100MHz 0x62
168#define K_MC_REF_RATE_133MHz 0x81 168#define K_MC_REF_RATE_133MHz 0x81
169#define K_MC_REF_RATE_200MHz 0xC4 169#define K_MC_REF_RATE_200MHz 0xC4
170 170
171#define V_MC_REF_RATE_100MHz V_MC_REF_RATE(K_MC_REF_RATE_100MHz) 171#define V_MC_REF_RATE_100MHz V_MC_REF_RATE(K_MC_REF_RATE_100MHz)
172#define V_MC_REF_RATE_133MHz V_MC_REF_RATE(K_MC_REF_RATE_133MHz) 172#define V_MC_REF_RATE_133MHz V_MC_REF_RATE(K_MC_REF_RATE_133MHz)
@@ -228,7 +228,7 @@
228 V_MC_ADDR_DRIVE_DEFAULT | \ 228 V_MC_ADDR_DRIVE_DEFAULT | \
229 V_MC_DATA_DRIVE_DEFAULT | \ 229 V_MC_DATA_DRIVE_DEFAULT | \
230 V_MC_CLOCK_DRIVE_DEFAULT | \ 230 V_MC_CLOCK_DRIVE_DEFAULT | \
231 V_MC_REF_RATE_DEFAULT 231 V_MC_REF_RATE_DEFAULT
232 232
233 233
234 234
diff --git a/include/asm-mips/sibyte/sb1250_regs.h b/include/asm-mips/sibyte/sb1250_regs.h
index 5d496c6faba6..9db80cd13a79 100644
--- a/include/asm-mips/sibyte/sb1250_regs.h
+++ b/include/asm-mips/sibyte/sb1250_regs.h
@@ -1,23 +1,23 @@
1/* ********************************************************************* 1/* *********************************************************************
2 * SB1250 Board Support Package 2 * SB1250 Board Support Package
3 * 3 *
4 * Register Definitions File: sb1250_regs.h 4 * Register Definitions File: sb1250_regs.h
5 * 5 *
6 * This module contains the addresses of the on-chip peripherals 6 * This module contains the addresses of the on-chip peripherals
7 * on the SB1250. 7 * on the SB1250.
8 * 8 *
9 * SB1250 specification level: 01/02/2002 9 * SB1250 specification level: 01/02/2002
10 * 10 *
11 * Author: Mitch Lichtenberg 11 * Author: Mitch Lichtenberg
12 * 12 *
13 ********************************************************************* 13 *********************************************************************
14 * 14 *
15 * Copyright 2000,2001,2002,2003 15 * Copyright 2000,2001,2002,2003
16 * Broadcom Corporation. All rights reserved. 16 * Broadcom Corporation. All rights reserved.
17 * 17 *
18 * This program is free software; you can redistribute it and/or 18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License as 19 * modify it under the terms of the GNU General Public License as
20 * published by the Free Software Foundation; either version 2 of 20 * published by the Free Software Foundation; either version 2 of
21 * the License, or (at your option) any later version. 21 * the License, or (at your option) any later version.
22 * 22 *
23 * This program is distributed in the hope that it will be useful, 23 * This program is distributed in the hope that it will be useful,
@@ -27,7 +27,7 @@
27 * 27 *
28 * You should have received a copy of the GNU General Public License 28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software 29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 * MA 02111-1307 USA 31 * MA 02111-1307 USA
32 ********************************************************************* */ 32 ********************************************************************* */
33 33
@@ -40,20 +40,20 @@
40 40
41/* ********************************************************************* 41/* *********************************************************************
42 * Some general notes: 42 * Some general notes:
43 * 43 *
44 * For the most part, when there is more than one peripheral 44 * For the most part, when there is more than one peripheral
45 * of the same type on the SOC, the constants below will be 45 * of the same type on the SOC, the constants below will be
46 * offsets from the base of each peripheral. For example, 46 * offsets from the base of each peripheral. For example,
47 * the MAC registers are described as offsets from the first 47 * the MAC registers are described as offsets from the first
48 * MAC register, and there will be a MAC_REGISTER() macro 48 * MAC register, and there will be a MAC_REGISTER() macro
49 * to calculate the base address of a given MAC. 49 * to calculate the base address of a given MAC.
50 * 50 *
51 * The information in this file is based on the SB1250 SOC 51 * The information in this file is based on the SB1250 SOC
52 * manual version 0.2, July 2000. 52 * manual version 0.2, July 2000.
53 ********************************************************************* */ 53 ********************************************************************* */
54 54
55 55
56/* ********************************************************************* 56/* *********************************************************************
57 * Memory Controller Registers 57 * Memory Controller Registers
58 ********************************************************************* */ 58 ********************************************************************* */
59 59
@@ -101,7 +101,7 @@
101#define R_MC_TEST_ECC 0x0000000420 101#define R_MC_TEST_ECC 0x0000000420
102#define R_MC_MCLK_CFG 0x0000000500 102#define R_MC_MCLK_CFG 0x0000000500
103 103
104/* ********************************************************************* 104/* *********************************************************************
105 * L2 Cache Control Registers 105 * L2 Cache Control Registers
106 ********************************************************************* */ 106 ********************************************************************* */
107 107
@@ -126,7 +126,7 @@
126#define A_L2_EEC_ADDRESS A_L2_ECC_TAG 126#define A_L2_EEC_ADDRESS A_L2_ECC_TAG
127 127
128 128
129/* ********************************************************************* 129/* *********************************************************************
130 * PCI Interface Registers 130 * PCI Interface Registers
131 ********************************************************************* */ 131 ********************************************************************* */
132 132
@@ -134,7 +134,7 @@
134#define A_PCI_TYPE01_HEADER 0x00DE000800 134#define A_PCI_TYPE01_HEADER 0x00DE000800
135 135
136 136
137/* ********************************************************************* 137/* *********************************************************************
138 * Ethernet DMA and MACs 138 * Ethernet DMA and MACs
139 ********************************************************************* */ 139 ********************************************************************* */
140 140
@@ -184,7 +184,7 @@
184 (R_MAC_DMA_CHANNEL_BASE(txrx,chan) + \ 184 (R_MAC_DMA_CHANNEL_BASE(txrx,chan) + \
185 (reg)) 185 (reg))
186 186
187/* 187/*
188 * DMA channel registers, relative to A_MAC_DMA_CHANNEL_BASE 188 * DMA channel registers, relative to A_MAC_DMA_CHANNEL_BASE
189 */ 189 */
190 190
@@ -259,7 +259,7 @@
259#define MAC_CHMAP_COUNT 4 259#define MAC_CHMAP_COUNT 4
260 260
261 261
262/* ********************************************************************* 262/* *********************************************************************
263 * DUART Registers 263 * DUART Registers
264 ********************************************************************* */ 264 ********************************************************************* */
265 265
@@ -363,7 +363,7 @@
363#endif /* 1250 PASS2 || 112x PASS1 */ 363#endif /* 1250 PASS2 || 112x PASS1 */
364 364
365 365
366/* ********************************************************************* 366/* *********************************************************************
367 * Synchronous Serial Registers 367 * Synchronous Serial Registers
368 ********************************************************************* */ 368 ********************************************************************* */
369 369
@@ -397,7 +397,7 @@
397 (reg)) 397 (reg))
398 398
399 399
400/* 400/*
401 * DMA channel registers, relative to A_SER_DMA_CHANNEL_BASE 401 * DMA channel registers, relative to A_SER_DMA_CHANNEL_BASE
402 */ 402 */
403 403
@@ -457,7 +457,7 @@
457#define R_SER_RMON_RX_ERRORS 0x000001F0 457#define R_SER_RMON_RX_ERRORS 0x000001F0
458#define R_SER_RMON_RX_BADADDR 0x000001F8 458#define R_SER_RMON_RX_BADADDR 0x000001F8
459 459
460/* ********************************************************************* 460/* *********************************************************************
461 * Generic Bus Registers 461 * Generic Bus Registers
462 ********************************************************************* */ 462 ********************************************************************* */
463 463
@@ -513,7 +513,7 @@
513#define R_IO_PCMCIA_CFG 0x0A60 513#define R_IO_PCMCIA_CFG 0x0A60
514#define R_IO_PCMCIA_STATUS 0x0A70 514#define R_IO_PCMCIA_STATUS 0x0A70
515 515
516/* ********************************************************************* 516/* *********************************************************************
517 * GPIO Registers 517 * GPIO Registers
518 ********************************************************************* */ 518 ********************************************************************* */
519 519
@@ -537,7 +537,7 @@
537#define R_GPIO_PIN_CLR 0x30 537#define R_GPIO_PIN_CLR 0x30
538#define R_GPIO_PIN_SET 0x38 538#define R_GPIO_PIN_SET 0x38
539 539
540/* ********************************************************************* 540/* *********************************************************************
541 * SMBus Registers 541 * SMBus Registers
542 ********************************************************************* */ 542 ********************************************************************* */
543 543
@@ -573,7 +573,7 @@
573#define R_SMB_CONTROL 0x0000000060 573#define R_SMB_CONTROL 0x0000000060
574#define R_SMB_PEC 0x0000000070 574#define R_SMB_PEC 0x0000000070
575 575
576/* ********************************************************************* 576/* *********************************************************************
577 * Timer Registers 577 * Timer Registers
578 ********************************************************************* */ 578 ********************************************************************* */
579 579
@@ -641,7 +641,7 @@
641#endif /* 1250 PASS2 || 112x PASS1 */ 641#endif /* 1250 PASS2 || 112x PASS1 */
642 642
643 643
644/* ********************************************************************* 644/* *********************************************************************
645 * System Control Registers 645 * System Control Registers
646 ********************************************************************* */ 646 ********************************************************************* */
647 647
@@ -649,7 +649,7 @@
649#define A_SCD_SYSTEM_CFG 0x0010020008 649#define A_SCD_SYSTEM_CFG 0x0010020008
650#define A_SCD_SYSTEM_MANUF 0x0010038000 650#define A_SCD_SYSTEM_MANUF 0x0010038000
651 651
652/* ********************************************************************* 652/* *********************************************************************
653 * System Address Trap Registers 653 * System Address Trap Registers
654 ********************************************************************* */ 654 ********************************************************************* */
655 655
@@ -672,7 +672,7 @@
672#endif /* 1250 PASS2 || 112x PASS1 */ 672#endif /* 1250 PASS2 || 112x PASS1 */
673 673
674 674
675/* ********************************************************************* 675/* *********************************************************************
676 * System Interrupt Mapper Registers 676 * System Interrupt Mapper Registers
677 ********************************************************************* */ 677 ********************************************************************* */
678 678
@@ -701,7 +701,7 @@
701#define R_IMR_INTERRUPT_MAP_BASE 0x0200 701#define R_IMR_INTERRUPT_MAP_BASE 0x0200
702#define R_IMR_INTERRUPT_MAP_COUNT 64 702#define R_IMR_INTERRUPT_MAP_COUNT 64
703 703
704/* ********************************************************************* 704/* *********************************************************************
705 * System Performance Counter Registers 705 * System Performance Counter Registers
706 ********************************************************************* */ 706 ********************************************************************* */
707 707
@@ -711,7 +711,7 @@
711#define A_SCD_PERF_CNT_2 0x00100204E0 711#define A_SCD_PERF_CNT_2 0x00100204E0
712#define A_SCD_PERF_CNT_3 0x00100204E8 712#define A_SCD_PERF_CNT_3 0x00100204E8
713 713
714/* ********************************************************************* 714/* *********************************************************************
715 * System Bus Watcher Registers 715 * System Bus Watcher Registers
716 ********************************************************************* */ 716 ********************************************************************* */
717 717
@@ -726,13 +726,13 @@
726#define A_BUS_L2_ERRORS 0x00100208C0 726#define A_BUS_L2_ERRORS 0x00100208C0
727#define A_BUS_MEM_IO_ERRORS 0x00100208C8 727#define A_BUS_MEM_IO_ERRORS 0x00100208C8
728 728
729/* ********************************************************************* 729/* *********************************************************************
730 * System Debug Controller Registers 730 * System Debug Controller Registers
731 ********************************************************************* */ 731 ********************************************************************* */
732 732
733#define A_SCD_JTAG_BASE 0x0010000000 733#define A_SCD_JTAG_BASE 0x0010000000
734 734
735/* ********************************************************************* 735/* *********************************************************************
736 * System Trace Buffer Registers 736 * System Trace Buffer Registers
737 ********************************************************************* */ 737 ********************************************************************* */
738 738
@@ -755,7 +755,7 @@
755#define A_SCD_TRACE_SEQUENCE_6 0x0010020A90 755#define A_SCD_TRACE_SEQUENCE_6 0x0010020A90
756#define A_SCD_TRACE_SEQUENCE_7 0x0010020A98 756#define A_SCD_TRACE_SEQUENCE_7 0x0010020A98
757 757
758/* ********************************************************************* 758/* *********************************************************************
759 * System Generic DMA Registers 759 * System Generic DMA Registers
760 ********************************************************************* */ 760 ********************************************************************* */
761 761
diff --git a/include/asm-mips/sibyte/sb1250_scd.h b/include/asm-mips/sibyte/sb1250_scd.h
index 22e8041959e2..dbbd682fb47e 100644
--- a/include/asm-mips/sibyte/sb1250_scd.h
+++ b/include/asm-mips/sibyte/sb1250_scd.h
@@ -1,23 +1,23 @@
1/* ********************************************************************* 1/* *********************************************************************
2 * SB1250 Board Support Package 2 * SB1250 Board Support Package
3 * 3 *
4 * SCD Constants and Macros File: sb1250_scd.h 4 * SCD Constants and Macros File: sb1250_scd.h
5 * 5 *
6 * This module contains constants and macros useful for 6 * This module contains constants and macros useful for
7 * manipulating the System Control and Debug module on the 1250. 7 * manipulating the System Control and Debug module on the 1250.
8 * 8 *
9 * SB1250 specification level: User's manual 1/02/02 9 * SB1250 specification level: User's manual 1/02/02
10 * 10 *
11 * Author: Mitch Lichtenberg 11 * Author: Mitch Lichtenberg
12 * 12 *
13 ********************************************************************* 13 *********************************************************************
14 * 14 *
15 * Copyright 2000,2001,2002,2003 15 * Copyright 2000,2001,2002,2003
16 * Broadcom Corporation. All rights reserved. 16 * Broadcom Corporation. All rights reserved.
17 * 17 *
18 * This program is free software; you can redistribute it and/or 18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License as 19 * modify it under the terms of the GNU General Public License as
20 * published by the Free Software Foundation; either version 2 of 20 * published by the Free Software Foundation; either version 2 of
21 * the License, or (at your option) any later version. 21 * the License, or (at your option) any later version.
22 * 22 *
23 * This program is distributed in the hope that it will be useful, 23 * This program is distributed in the hope that it will be useful,
@@ -27,7 +27,7 @@
27 * 27 *
28 * You should have received a copy of the GNU General Public License 28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software 29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 * MA 02111-1307 USA 31 * MA 02111-1307 USA
32 ********************************************************************* */ 32 ********************************************************************* */
33 33
@@ -130,40 +130,40 @@
130/* System Manufacturing Register 130/* System Manufacturing Register
131* Register: SCD_SYSTEM_MANUF 131* Register: SCD_SYSTEM_MANUF
132*/ 132*/
133 133
134/* Wafer ID: bits 31:0 */ 134/* Wafer ID: bits 31:0 */
135#define S_SYS_WAFERID1_200 _SB_MAKE64(0) 135#define S_SYS_WAFERID1_200 _SB_MAKE64(0)
136#define M_SYS_WAFERID1_200 _SB_MAKEMASK(32,S_SYS_WAFERID1_200) 136#define M_SYS_WAFERID1_200 _SB_MAKEMASK(32,S_SYS_WAFERID1_200)
137#define V_SYS_WAFERID1_200(x) _SB_MAKEVALUE(x,S_SYS_WAFERID1_200) 137#define V_SYS_WAFERID1_200(x) _SB_MAKEVALUE(x,S_SYS_WAFERID1_200)
138#define G_SYS_WAFERID1_200(x) _SB_GETVALUE(x,S_SYS_WAFERID1_200,M_SYS_WAFERID1_200) 138#define G_SYS_WAFERID1_200(x) _SB_GETVALUE(x,S_SYS_WAFERID1_200,M_SYS_WAFERID1_200)
139 139
140#define S_SYS_BIN _SB_MAKE64(32) 140#define S_SYS_BIN _SB_MAKE64(32)
141#define M_SYS_BIN _SB_MAKEMASK(4,S_SYS_BIN) 141#define M_SYS_BIN _SB_MAKEMASK(4,S_SYS_BIN)
142#define V_SYS_BIN _SB_MAKEVALUE(x,S_SYS_BIN) 142#define V_SYS_BIN _SB_MAKEVALUE(x,S_SYS_BIN)
143#define G_SYS_BIN _SB_GETVALUE(x,S_SYS_BIN,M_SYS_BIN) 143#define G_SYS_BIN _SB_GETVALUE(x,S_SYS_BIN,M_SYS_BIN)
144 144
145/* Wafer ID: bits 39:36 */ 145/* Wafer ID: bits 39:36 */
146#define S_SYS_WAFERID2_200 _SB_MAKE64(36) 146#define S_SYS_WAFERID2_200 _SB_MAKE64(36)
147#define M_SYS_WAFERID2_200 _SB_MAKEMASK(4,S_SYS_WAFERID2_200) 147#define M_SYS_WAFERID2_200 _SB_MAKEMASK(4,S_SYS_WAFERID2_200)
148#define V_SYS_WAFERID2_200(x) _SB_MAKEVALUE(x,S_SYS_WAFERID2_200) 148#define V_SYS_WAFERID2_200(x) _SB_MAKEVALUE(x,S_SYS_WAFERID2_200)
149#define G_SYS_WAFERID2_200(x) _SB_GETVALUE(x,S_SYS_WAFERID2_200,M_SYS_WAFERID2_200) 149#define G_SYS_WAFERID2_200(x) _SB_GETVALUE(x,S_SYS_WAFERID2_200,M_SYS_WAFERID2_200)
150 150
151/* Wafer ID: bits 39:0 */ 151/* Wafer ID: bits 39:0 */
152#define S_SYS_WAFERID_300 _SB_MAKE64(0) 152#define S_SYS_WAFERID_300 _SB_MAKE64(0)
153#define M_SYS_WAFERID_300 _SB_MAKEMASK(40,S_SYS_WAFERID_300) 153#define M_SYS_WAFERID_300 _SB_MAKEMASK(40,S_SYS_WAFERID_300)
154#define V_SYS_WAFERID_300(x) _SB_MAKEVALUE(x,S_SYS_WAFERID_300) 154#define V_SYS_WAFERID_300(x) _SB_MAKEVALUE(x,S_SYS_WAFERID_300)
155#define G_SYS_WAFERID_300(x) _SB_GETVALUE(x,S_SYS_WAFERID_300,M_SYS_WAFERID_300) 155#define G_SYS_WAFERID_300(x) _SB_GETVALUE(x,S_SYS_WAFERID_300,M_SYS_WAFERID_300)
156 156
157#define S_SYS_XPOS _SB_MAKE64(40) 157#define S_SYS_XPOS _SB_MAKE64(40)
158#define M_SYS_XPOS _SB_MAKEMASK(6,S_SYS_XPOS) 158#define M_SYS_XPOS _SB_MAKEMASK(6,S_SYS_XPOS)
159#define V_SYS_XPOS(x) _SB_MAKEVALUE(x,S_SYS_XPOS) 159#define V_SYS_XPOS(x) _SB_MAKEVALUE(x,S_SYS_XPOS)
160#define G_SYS_XPOS(x) _SB_GETVALUE(x,S_SYS_XPOS,M_SYS_XPOS) 160#define G_SYS_XPOS(x) _SB_GETVALUE(x,S_SYS_XPOS,M_SYS_XPOS)
161 161
162#define S_SYS_YPOS _SB_MAKE64(46) 162#define S_SYS_YPOS _SB_MAKE64(46)
163#define M_SYS_YPOS _SB_MAKEMASK(6,S_SYS_YPOS) 163#define M_SYS_YPOS _SB_MAKEMASK(6,S_SYS_YPOS)
164#define V_SYS_YPOS(x) _SB_MAKEVALUE(x,S_SYS_YPOS) 164#define V_SYS_YPOS(x) _SB_MAKEVALUE(x,S_SYS_YPOS)
165#define G_SYS_YPOS(x) _SB_GETVALUE(x,S_SYS_YPOS,M_SYS_YPOS) 165#define G_SYS_YPOS(x) _SB_GETVALUE(x,S_SYS_YPOS,M_SYS_YPOS)
166 166
167/* 167/*
168 * System Config Register (Table 4-2) 168 * System Config Register (Table 4-2)
169 * Register: SCD_SYSTEM_CFG 169 * Register: SCD_SYSTEM_CFG
diff --git a/include/asm-mips/sibyte/sb1250_smbus.h b/include/asm-mips/sibyte/sb1250_smbus.h
index 287cbfe9efa2..335c53e92936 100644
--- a/include/asm-mips/sibyte/sb1250_smbus.h
+++ b/include/asm-mips/sibyte/sb1250_smbus.h
@@ -1,23 +1,23 @@
1/* ********************************************************************* 1/* *********************************************************************
2 * SB1250 Board Support Package 2 * SB1250 Board Support Package
3 * 3 *
4 * SMBUS Constants File: sb1250_smbus.h 4 * SMBUS Constants File: sb1250_smbus.h
5 * 5 *
6 * This module contains constants and macros useful for 6 * This module contains constants and macros useful for
7 * manipulating the SB1250's SMbus devices. 7 * manipulating the SB1250's SMbus devices.
8 * 8 *
9 * SB1250 specification level: 01/02/2002 9 * SB1250 specification level: 01/02/2002
10 * 10 *
11 * Author: Mitch Lichtenberg 11 * Author: Mitch Lichtenberg
12 * 12 *
13 ********************************************************************* 13 *********************************************************************
14 * 14 *
15 * Copyright 2000,2001,2002,2003 15 * Copyright 2000,2001,2002,2003
16 * Broadcom Corporation. All rights reserved. 16 * Broadcom Corporation. All rights reserved.
17 * 17 *
18 * This program is free software; you can redistribute it and/or 18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License as 19 * modify it under the terms of the GNU General Public License as
20 * published by the Free Software Foundation; either version 2 of 20 * published by the Free Software Foundation; either version 2 of
21 * the License, or (at your option) any later version. 21 * the License, or (at your option) any later version.
22 * 22 *
23 * This program is distributed in the hope that it will be useful, 23 * This program is distributed in the hope that it will be useful,
@@ -27,7 +27,7 @@
27 * 27 *
28 * You should have received a copy of the GNU General Public License 28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software 29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 * MA 02111-1307 USA 31 * MA 02111-1307 USA
32 ********************************************************************* */ 32 ********************************************************************* */
33 33
diff --git a/include/asm-mips/sibyte/sb1250_syncser.h b/include/asm-mips/sibyte/sb1250_syncser.h
index 8d5e8edd3c4b..fa2760d38b8b 100644
--- a/include/asm-mips/sibyte/sb1250_syncser.h
+++ b/include/asm-mips/sibyte/sb1250_syncser.h
@@ -7,17 +7,17 @@
7 * manipulating the SB1250's Synchronous Serial 7 * manipulating the SB1250's Synchronous Serial
8 * 8 *
9 * SB1250 specification level: User's manual 1/02/02 9 * SB1250 specification level: User's manual 1/02/02
10 * 10 *
11 * Author: Mitch Lichtenberg 11 * Author: Mitch Lichtenberg
12 * 12 *
13 ********************************************************************* 13 *********************************************************************
14 * 14 *
15 * Copyright 2000,2001,2002,2003 15 * Copyright 2000,2001,2002,2003
16 * Broadcom Corporation. All rights reserved. 16 * Broadcom Corporation. All rights reserved.
17 * 17 *
18 * This program is free software; you can redistribute it and/or 18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License as 19 * modify it under the terms of the GNU General Public License as
20 * published by the Free Software Foundation; either version 2 of 20 * published by the Free Software Foundation; either version 2 of
21 * the License, or (at your option) any later version. 21 * the License, or (at your option) any later version.
22 * 22 *
23 * This program is distributed in the hope that it will be useful, 23 * This program is distributed in the hope that it will be useful,
@@ -27,7 +27,7 @@
27 * 27 *
28 * You should have received a copy of the GNU General Public License 28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software 29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 * MA 02111-1307 USA 31 * MA 02111-1307 USA
32 ********************************************************************* */ 32 ********************************************************************* */
33 33
diff --git a/include/asm-mips/sibyte/sb1250_uart.h b/include/asm-mips/sibyte/sb1250_uart.h
index 7655d6945cca..923ea4f44e0f 100644
--- a/include/asm-mips/sibyte/sb1250_uart.h
+++ b/include/asm-mips/sibyte/sb1250_uart.h
@@ -1,23 +1,23 @@
1/* ********************************************************************* 1/* *********************************************************************
2 * SB1250 Board Support Package 2 * SB1250 Board Support Package
3 * 3 *
4 * UART Constants File: sb1250_uart.h 4 * UART Constants File: sb1250_uart.h
5 * 5 *
6 * This module contains constants and macros useful for 6 * This module contains constants and macros useful for
7 * manipulating the SB1250's UARTs 7 * manipulating the SB1250's UARTs
8 * 8 *
9 * SB1250 specification level: User's manual 1/02/02 9 * SB1250 specification level: User's manual 1/02/02
10 * 10 *
11 * Author: Mitch Lichtenberg 11 * Author: Mitch Lichtenberg
12 * 12 *
13 ********************************************************************* 13 *********************************************************************
14 * 14 *
15 * Copyright 2000,2001,2002,2003 15 * Copyright 2000,2001,2002,2003
16 * Broadcom Corporation. All rights reserved. 16 * Broadcom Corporation. All rights reserved.
17 * 17 *
18 * This program is free software; you can redistribute it and/or 18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License as 19 * modify it under the terms of the GNU General Public License as
20 * published by the Free Software Foundation; either version 2 of 20 * published by the Free Software Foundation; either version 2 of
21 * the License, or (at your option) any later version. 21 * the License, or (at your option) any later version.
22 * 22 *
23 * This program is distributed in the hope that it will be useful, 23 * This program is distributed in the hope that it will be useful,
@@ -27,7 +27,7 @@
27 * 27 *
28 * You should have received a copy of the GNU General Public License 28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software 29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 * MA 02111-1307 USA 31 * MA 02111-1307 USA
32 ********************************************************************* */ 32 ********************************************************************* */
33 33
@@ -37,7 +37,7 @@
37 37
38#include "sb1250_defs.h" 38#include "sb1250_defs.h"
39 39
40/* ********************************************************************** 40/* **********************************************************************
41 * DUART Registers 41 * DUART Registers
42 ********************************************************************** */ 42 ********************************************************************** */
43 43
@@ -145,7 +145,7 @@
145#define V_DUART_MISC_CMD_START_BREAK V_DUART_MISC_CMD(K_DUART_MISC_CMD_START_BREAK) 145#define V_DUART_MISC_CMD_START_BREAK V_DUART_MISC_CMD(K_DUART_MISC_CMD_START_BREAK)
146#define V_DUART_MISC_CMD_STOP_BREAK V_DUART_MISC_CMD(K_DUART_MISC_CMD_STOP_BREAK) 146#define V_DUART_MISC_CMD_STOP_BREAK V_DUART_MISC_CMD(K_DUART_MISC_CMD_STOP_BREAK)
147 147
148#define M_DUART_CMD_RESERVED _SB_MAKEMASK1(7) 148#define M_DUART_CMD_RESERVED _SB_MAKEMASK1(7)
149 149
150/* 150/*
151 * DUART Status Register (Table 10-6) 151 * DUART Status Register (Table 10-6)
@@ -165,7 +165,7 @@
165 165
166/* 166/*
167 * DUART Baud Rate Register (Table 10-7) 167 * DUART Baud Rate Register (Table 10-7)
168 * Register: DUART_CLK_SEL_A 168 * Register: DUART_CLK_SEL_A
169 * Register: DUART_CLK_SEL_B 169 * Register: DUART_CLK_SEL_B
170 */ 170 */
171 171
@@ -332,7 +332,7 @@
332 (chan == 0 ? M_DUART_OUT_PIN_CLR0 : M_DUART_OUT_PIN_CLR1) 332 (chan == 0 ? M_DUART_OUT_PIN_CLR0 : M_DUART_OUT_PIN_CLR1)
333 333
334#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) 334#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1)
335/* 335/*
336 * Full Interrupt Control Register 336 * Full Interrupt Control Register
337 */ 337 */
338 338
diff --git a/include/asm-mips/sigcontext.h b/include/asm-mips/sigcontext.h
index 18939e84b6f2..f7fbebaa0744 100644
--- a/include/asm-mips/sigcontext.h
+++ b/include/asm-mips/sigcontext.h
@@ -10,7 +10,7 @@
10#define _ASM_SIGCONTEXT_H 10#define _ASM_SIGCONTEXT_H
11 11
12#include <asm/sgidefs.h> 12#include <asm/sgidefs.h>
13 13
14#if _MIPS_SIM == _MIPS_SIM_ABI32 14#if _MIPS_SIM == _MIPS_SIM_ABI32
15 15
16/* 16/*
@@ -38,7 +38,7 @@ struct sigcontext {
38}; 38};
39 39
40#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 40#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
41 41
42#if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 42#if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32
43 43
44/* 44/*
diff --git a/include/asm-mips/siginfo.h b/include/asm-mips/siginfo.h
index a0e26e6c994d..698becab5a9e 100644
--- a/include/asm-mips/siginfo.h
+++ b/include/asm-mips/siginfo.h
@@ -25,10 +25,10 @@ struct siginfo;
25/* 25/*
26 * Careful to keep union _sifields from shifting ... 26 * Careful to keep union _sifields from shifting ...
27 */ 27 */
28#ifdef CONFIG_MIPS32 28#ifdef CONFIG_32BIT
29#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int)) 29#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
30#endif 30#endif
31#ifdef CONFIG_MIPS64 31#ifdef CONFIG_64BIT
32#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) 32#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
33#endif 33#endif
34 34
diff --git a/include/asm-mips/sim.h b/include/asm-mips/sim.h
index 6333169be329..9c2af1b00e19 100644
--- a/include/asm-mips/sim.h
+++ b/include/asm-mips/sim.h
@@ -11,12 +11,12 @@
11 11
12#include <linux/config.h> 12#include <linux/config.h>
13 13
14#include <asm/offset.h> 14#include <asm/asm-offsets.h>
15 15
16#define __str2(x) #x 16#define __str2(x) #x
17#define __str(x) __str2(x) 17#define __str(x) __str2(x)
18 18
19#ifdef CONFIG_MIPS32 19#ifdef CONFIG_32BIT
20 20
21#define save_static_function(symbol) \ 21#define save_static_function(symbol) \
22__asm__ ( \ 22__asm__ ( \
@@ -42,9 +42,9 @@ __asm__ ( \
42 42
43#define nabi_no_regargs 43#define nabi_no_regargs
44 44
45#endif /* CONFIG_MIPS32 */ 45#endif /* CONFIG_32BIT */
46 46
47#ifdef CONFIG_MIPS64 47#ifdef CONFIG_64BIT
48 48
49#define save_static_function(symbol) \ 49#define save_static_function(symbol) \
50__asm__ ( \ 50__asm__ ( \
@@ -78,6 +78,6 @@ __asm__ ( \
78 unsigned long __dummy6, \ 78 unsigned long __dummy6, \
79 unsigned long __dummy7, 79 unsigned long __dummy7,
80 80
81#endif /* CONFIG_MIPS64 */ 81#endif /* CONFIG_64BIT */
82 82
83#endif /* _ASM_SIM_H */ 83#endif /* _ASM_SIM_H */
diff --git a/include/asm-mips/socket.h b/include/asm-mips/socket.h
index d478a86294ee..753b6620e6fa 100644
--- a/include/asm-mips/socket.h
+++ b/include/asm-mips/socket.h
@@ -82,7 +82,7 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
82 * @SOCK_STREAM - stream (connection) socket 82 * @SOCK_STREAM - stream (connection) socket
83 * @SOCK_RAW - raw socket 83 * @SOCK_RAW - raw socket
84 * @SOCK_RDM - reliably-delivered message 84 * @SOCK_RDM - reliably-delivered message
85 * @SOCK_SEQPACKET - sequential packet socket 85 * @SOCK_SEQPACKET - sequential packet socket
86 * @SOCK_PACKET - linux specific way of getting packets at the dev level. 86 * @SOCK_PACKET - linux specific way of getting packets at the dev level.
87 * For writing rarp and other similar things on the user level. 87 * For writing rarp and other similar things on the user level.
88 */ 88 */
diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h
index 86283c25fd5b..7b5e64600bc8 100644
--- a/include/asm-mips/stackframe.h
+++ b/include/asm-mips/stackframe.h
@@ -15,7 +15,7 @@
15 15
16#include <asm/asm.h> 16#include <asm/asm.h>
17#include <asm/mipsregs.h> 17#include <asm/mipsregs.h>
18#include <asm/offset.h> 18#include <asm/asm-offsets.h>
19 19
20 .macro SAVE_AT 20 .macro SAVE_AT
21 .set push 21 .set push
@@ -26,7 +26,7 @@
26 26
27 .macro SAVE_TEMP 27 .macro SAVE_TEMP
28 mfhi v1 28 mfhi v1
29#ifdef CONFIG_MIPS32 29#ifdef CONFIG_32BIT
30 LONG_S $8, PT_R8(sp) 30 LONG_S $8, PT_R8(sp)
31 LONG_S $9, PT_R9(sp) 31 LONG_S $9, PT_R9(sp)
32#endif 32#endif
@@ -56,7 +56,7 @@
56 56
57#ifdef CONFIG_SMP 57#ifdef CONFIG_SMP
58 .macro get_saved_sp /* SMP variation */ 58 .macro get_saved_sp /* SMP variation */
59#ifdef CONFIG_MIPS32 59#ifdef CONFIG_32BIT
60 mfc0 k0, CP0_CONTEXT 60 mfc0 k0, CP0_CONTEXT
61 lui k1, %hi(kernelsp) 61 lui k1, %hi(kernelsp)
62 srl k0, k0, 23 62 srl k0, k0, 23
@@ -64,7 +64,7 @@
64 addu k1, k0 64 addu k1, k0
65 LONG_L k1, %lo(kernelsp)(k1) 65 LONG_L k1, %lo(kernelsp)(k1)
66#endif 66#endif
67#if defined(CONFIG_MIPS64) && !defined(CONFIG_BUILD_ELF64) 67#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64)
68 MFC0 k1, CP0_CONTEXT 68 MFC0 k1, CP0_CONTEXT
69 dsra k1, 23 69 dsra k1, 23
70 lui k0, %hi(pgd_current) 70 lui k0, %hi(pgd_current)
@@ -74,7 +74,7 @@
74 daddu k1, k0 74 daddu k1, k0
75 LONG_L k1, %lo(kernelsp)(k1) 75 LONG_L k1, %lo(kernelsp)(k1)
76#endif 76#endif
77#if defined(CONFIG_MIPS64) && defined(CONFIG_BUILD_ELF64) 77#if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64)
78 MFC0 k1, CP0_CONTEXT 78 MFC0 k1, CP0_CONTEXT
79 dsrl k1, 23 79 dsrl k1, 23
80 dsll k1, k1, 3 80 dsll k1, k1, 3
@@ -83,20 +83,20 @@
83 .endm 83 .endm
84 84
85 .macro set_saved_sp stackp temp temp2 85 .macro set_saved_sp stackp temp temp2
86#ifdef CONFIG_MIPS32 86#ifdef CONFIG_32BIT
87 mfc0 \temp, CP0_CONTEXT 87 mfc0 \temp, CP0_CONTEXT
88 srl \temp, 23 88 srl \temp, 23
89 sll \temp, 2 89 sll \temp, 2
90 LONG_S \stackp, kernelsp(\temp) 90 LONG_S \stackp, kernelsp(\temp)
91#endif 91#endif
92#if defined(CONFIG_MIPS64) && !defined(CONFIG_BUILD_ELF64) 92#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64)
93 lw \temp, TI_CPU(gp) 93 lw \temp, TI_CPU(gp)
94 dsll \temp, 3 94 dsll \temp, 3
95 lui \temp2, %hi(kernelsp) 95 lui \temp2, %hi(kernelsp)
96 daddu \temp, \temp2 96 daddu \temp, \temp2
97 LONG_S \stackp, %lo(kernelsp)(\temp) 97 LONG_S \stackp, %lo(kernelsp)(\temp)
98#endif 98#endif
99#if defined(CONFIG_MIPS64) && defined(CONFIG_BUILD_ELF64) 99#if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64)
100 lw \temp, TI_CPU(gp) 100 lw \temp, TI_CPU(gp)
101 dsll \temp, 3 101 dsll \temp, 3
102 LONG_S \stackp, kernelsp(\temp) 102 LONG_S \stackp, kernelsp(\temp)
@@ -140,7 +140,7 @@
140 LONG_S $6, PT_R6(sp) 140 LONG_S $6, PT_R6(sp)
141 MFC0 v1, CP0_EPC 141 MFC0 v1, CP0_EPC
142 LONG_S $7, PT_R7(sp) 142 LONG_S $7, PT_R7(sp)
143#ifdef CONFIG_MIPS64 143#ifdef CONFIG_64BIT
144 LONG_S $8, PT_R8(sp) 144 LONG_S $8, PT_R8(sp)
145 LONG_S $9, PT_R9(sp) 145 LONG_S $9, PT_R9(sp)
146#endif 146#endif
@@ -169,7 +169,7 @@
169 169
170 .macro RESTORE_TEMP 170 .macro RESTORE_TEMP
171 LONG_L $24, PT_LO(sp) 171 LONG_L $24, PT_LO(sp)
172#ifdef CONFIG_MIPS32 172#ifdef CONFIG_32BIT
173 LONG_L $8, PT_R8(sp) 173 LONG_L $8, PT_R8(sp)
174 LONG_L $9, PT_R9(sp) 174 LONG_L $9, PT_R9(sp)
175#endif 175#endif
@@ -217,7 +217,7 @@
217 LONG_L $31, PT_R31(sp) 217 LONG_L $31, PT_R31(sp)
218 LONG_L $28, PT_R28(sp) 218 LONG_L $28, PT_R28(sp)
219 LONG_L $25, PT_R25(sp) 219 LONG_L $25, PT_R25(sp)
220#ifdef CONFIG_MIPS64 220#ifdef CONFIG_64BIT
221 LONG_L $8, PT_R8(sp) 221 LONG_L $8, PT_R8(sp)
222 LONG_L $9, PT_R9(sp) 222 LONG_L $9, PT_R9(sp)
223#endif 223#endif
@@ -262,7 +262,7 @@
262 LONG_L $31, PT_R31(sp) 262 LONG_L $31, PT_R31(sp)
263 LONG_L $28, PT_R28(sp) 263 LONG_L $28, PT_R28(sp)
264 LONG_L $25, PT_R25(sp) 264 LONG_L $25, PT_R25(sp)
265#ifdef CONFIG_MIPS64 265#ifdef CONFIG_64BIT
266 LONG_L $8, PT_R8(sp) 266 LONG_L $8, PT_R8(sp)
267 LONG_L $9, PT_R9(sp) 267 LONG_L $9, PT_R9(sp)
268#endif 268#endif
diff --git a/include/asm-mips/statfs.h b/include/asm-mips/statfs.h
index 5076fec65780..c3ddf973c1c0 100644
--- a/include/asm-mips/statfs.h
+++ b/include/asm-mips/statfs.h
@@ -57,7 +57,7 @@ struct statfs64 {
57}; 57};
58 58
59#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 59#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
60 60
61#if _MIPS_SIM == _MIPS_SIM_ABI64 61#if _MIPS_SIM == _MIPS_SIM_ABI64
62 62
63struct statfs64 { /* Same as struct statfs */ 63struct statfs64 { /* Same as struct statfs */
diff --git a/include/asm-mips/string.h b/include/asm-mips/string.h
index b18345504f8a..5a06f6d13899 100644
--- a/include/asm-mips/string.h
+++ b/include/asm-mips/string.h
@@ -16,7 +16,7 @@
16 * Most of the inline functions are rather naive implementations so I just 16 * Most of the inline functions are rather naive implementations so I just
17 * didn't bother updating them for 64-bit ... 17 * didn't bother updating them for 64-bit ...
18 */ 18 */
19#ifdef CONFIG_MIPS32 19#ifdef CONFIG_32BIT
20 20
21#ifndef IN_STRING_C 21#ifndef IN_STRING_C
22 22
@@ -130,7 +130,7 @@ strncmp(__const__ char *__cs, __const__ char *__ct, size_t __count)
130 130
131 return __res; 131 return __res;
132} 132}
133#endif /* CONFIG_MIPS32 */ 133#endif /* CONFIG_32BIT */
134 134
135#define __HAVE_ARCH_MEMSET 135#define __HAVE_ARCH_MEMSET
136extern void *memset(void *__s, int __c, size_t __count); 136extern void *memset(void *__s, int __c, size_t __count);
@@ -141,7 +141,7 @@ extern void *memcpy(void *__to, __const__ void *__from, size_t __n);
141#define __HAVE_ARCH_MEMMOVE 141#define __HAVE_ARCH_MEMMOVE
142extern void *memmove(void *__dest, __const__ void *__src, size_t __n); 142extern void *memmove(void *__dest, __const__ void *__src, size_t __n);
143 143
144#ifdef CONFIG_MIPS32 144#ifdef CONFIG_32BIT
145#define __HAVE_ARCH_MEMSCAN 145#define __HAVE_ARCH_MEMSCAN
146static __inline__ void *memscan(void *__addr, int __c, size_t __size) 146static __inline__ void *memscan(void *__addr, int __c, size_t __size)
147{ 147{
@@ -161,6 +161,6 @@ static __inline__ void *memscan(void *__addr, int __c, size_t __size)
161 161
162 return __addr; 162 return __addr;
163} 163}
164#endif /* CONFIG_MIPS32 */ 164#endif /* CONFIG_32BIT */
165 165
166#endif /* _ASM_STRING_H */ 166#endif /* _ASM_STRING_H */
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index 169f3d4265b1..6663efd49b27 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -208,7 +208,7 @@ static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
208 return retval; 208 return retval;
209} 209}
210 210
211#ifdef CONFIG_MIPS64 211#ifdef CONFIG_64BIT
212static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val) 212static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val)
213{ 213{
214 __u64 retval; 214 __u64 retval;
@@ -330,7 +330,7 @@ static inline unsigned long __cmpxchg_u32(volatile int * m, unsigned long old,
330 return retval; 330 return retval;
331} 331}
332 332
333#ifdef CONFIG_MIPS64 333#ifdef CONFIG_64BIT
334static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old, 334static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old,
335 unsigned long new) 335 unsigned long new)
336{ 336{
diff --git a/include/asm-mips/thread_info.h b/include/asm-mips/thread_info.h
index 42fcd6f2c206..a70cb0854c8a 100644
--- a/include/asm-mips/thread_info.h
+++ b/include/asm-mips/thread_info.h
@@ -62,10 +62,10 @@ register struct thread_info *__current_thread_info __asm__("$28");
62#define current_thread_info() __current_thread_info 62#define current_thread_info() __current_thread_info
63 63
64/* thread information allocation */ 64/* thread information allocation */
65#if defined(CONFIG_PAGE_SIZE_4KB) && defined(CONFIG_MIPS32) 65#if defined(CONFIG_PAGE_SIZE_4KB) && defined(CONFIG_32BIT)
66#define THREAD_SIZE_ORDER (1) 66#define THREAD_SIZE_ORDER (1)
67#endif 67#endif
68#if defined(CONFIG_PAGE_SIZE_4KB) && defined(CONFIG_MIPS64) 68#if defined(CONFIG_PAGE_SIZE_4KB) && defined(CONFIG_64BIT)
69#define THREAD_SIZE_ORDER (2) 69#define THREAD_SIZE_ORDER (2)
70#endif 70#endif
71#ifdef CONFIG_PAGE_SIZE_8KB 71#ifdef CONFIG_PAGE_SIZE_8KB
diff --git a/include/asm-mips/titan_dep.h b/include/asm-mips/titan_dep.h
index fd9599e40a0a..fee1908c65d2 100644
--- a/include/asm-mips/titan_dep.h
+++ b/include/asm-mips/titan_dep.h
@@ -228,4 +228,4 @@ extern unsigned long ocd_base;
228#define RM9K_READ_8(ofs, val) *(val) = *(volatile u8 *)(RM9000x2_BASE_ADDR+ofs) 228#define RM9K_READ_8(ofs, val) *(val) = *(volatile u8 *)(RM9000x2_BASE_ADDR+ofs)
229#define RM9K_READ_16(ofs, val) *(val) = *(volatile u16 *)(RM9000x2_BASE_ADDR+ofs) 229#define RM9K_READ_16(ofs, val) *(val) = *(volatile u16 *)(RM9000x2_BASE_ADDR+ofs)
230 230
231#endif 231#endif
diff --git a/include/asm-mips/tx4927/tx4927.h b/include/asm-mips/tx4927/tx4927.h
index 5d939db6e220..3bb7f0087d68 100644
--- a/include/asm-mips/tx4927/tx4927.h
+++ b/include/asm-mips/tx4927/tx4927.h
@@ -45,14 +45,14 @@
45 45
46 46
47/* TX4927 SDRAM controller (64-bit registers) */ 47/* TX4927 SDRAM controller (64-bit registers) */
48#define TX4927_SDRAMC_BASE 0x8000 48#define TX4927_SDRAMC_BASE 0x8000
49#define TX4927_SDRAMC_SDCCR0 0x8000 49#define TX4927_SDRAMC_SDCCR0 0x8000
50#define TX4927_SDRAMC_SDCCR1 0x8008 50#define TX4927_SDRAMC_SDCCR1 0x8008
51#define TX4927_SDRAMC_SDCCR2 0x8010 51#define TX4927_SDRAMC_SDCCR2 0x8010
52#define TX4927_SDRAMC_SDCCR3 0x8018 52#define TX4927_SDRAMC_SDCCR3 0x8018
53#define TX4927_SDRAMC_SDCTR 0x8040 53#define TX4927_SDRAMC_SDCTR 0x8040
54#define TX4927_SDRAMC_SDCMD 0x8058 54#define TX4927_SDRAMC_SDCMD 0x8058
55#define TX4927_SDRAMC_LIMIT 0x8fff 55#define TX4927_SDRAMC_LIMIT 0x8fff
56 56
57 57
58/* TX4927 external bus controller (64-bit registers) */ 58/* TX4927 external bus controller (64-bit registers) */
@@ -289,8 +289,8 @@
289 289
290 290
291/* TX4927 serial port 0 (32-bit registers) */ 291/* TX4927 serial port 0 (32-bit registers) */
292#define TX4927_SIO0_BASE 0xf300 292#define TX4927_SIO0_BASE 0xf300
293#define TX4927_SIO0_SILCR0 0xf300 293#define TX4927_SIO0_SILCR0 0xf300
294#define TX4927_SIO0_SILCR0_RESERVED_16_31 BM_16_31 294#define TX4927_SIO0_SILCR0_RESERVED_16_31 BM_16_31
295#define TX4927_SIO0_SILCR0_RWUB BM_15_15 295#define TX4927_SIO0_SILCR0_RWUB BM_15_15
296#define TX4927_SIO0_SILCR0_TWUB BM_14_14 296#define TX4927_SIO0_SILCR0_TWUB BM_14_14
@@ -309,7 +309,7 @@
309#define TX4927_SIO0_SILCR0_UMODE_DATA_7_BIT (~BM_00_01) 309#define TX4927_SIO0_SILCR0_UMODE_DATA_7_BIT (~BM_00_01)
310#define TX4927_SIO0_SILCR0_UMODE_DATA_8_BIT_MC BM_01_01 310#define TX4927_SIO0_SILCR0_UMODE_DATA_8_BIT_MC BM_01_01
311#define TX4927_SIO0_SILCR0_UMODE_DATA_7_BIT_MC BM_00_01 311#define TX4927_SIO0_SILCR0_UMODE_DATA_7_BIT_MC BM_00_01
312#define TX4927_SIO0_SIDICR0 0xf304 312#define TX4927_SIO0_SIDICR0 0xf304
313#define TX4927_SIO0_SIDICR0_RESERVED_16_31 BM_16_31 313#define TX4927_SIO0_SIDICR0_RESERVED_16_31 BM_16_31
314#define TX4927_SIO0_SIDICR0_TDE BM_15_15 314#define TX4927_SIO0_SIDICR0_TDE BM_15_15
315#define TX4927_SIO0_SIDICR0_RDE BM_14_14 315#define TX4927_SIO0_SIDICR0_RDE BM_14_14
@@ -330,7 +330,7 @@
330#define TX4927_SIO0_SIDICR0_STIE_TRDY BM_02_02 330#define TX4927_SIO0_SIDICR0_STIE_TRDY BM_02_02
331#define TX4927_SIO0_SIDICR0_STIE_TXALS BM_01_01 331#define TX4927_SIO0_SIDICR0_STIE_TXALS BM_01_01
332#define TX4927_SIO0_SIDICR0_STIE_UBRKD BM_00_00 332#define TX4927_SIO0_SIDICR0_STIE_UBRKD BM_00_00
333#define TX4927_SIO0_SIDISR0 0xf308 333#define TX4927_SIO0_SIDISR0 0xf308
334#define TX4927_SIO0_SIDISR0_RESERVED_16_31 BM_16_31 334#define TX4927_SIO0_SIDISR0_RESERVED_16_31 BM_16_31
335#define TX4927_SIO0_SIDISR0_UBRK BM_15_15 335#define TX4927_SIO0_SIDISR0_UBRK BM_15_15
336#define TX4927_SIO0_SIDISR0_UVALID BM_14_14 336#define TX4927_SIO0_SIDISR0_UVALID BM_14_14
@@ -344,7 +344,7 @@
344#define TX4927_SIO0_SIDISR0_STIS BM_06_06 344#define TX4927_SIO0_SIDISR0_STIS BM_06_06
345#define TX4927_SIO0_SIDISR0_RESERVED_05_05 BM_05_05 345#define TX4927_SIO0_SIDISR0_RESERVED_05_05 BM_05_05
346#define TX4927_SIO0_SIDISR0_RFDN BM_00_04 346#define TX4927_SIO0_SIDISR0_RFDN BM_00_04
347#define TX4927_SIO0_SISCISR0 0xf30c 347#define TX4927_SIO0_SISCISR0 0xf30c
348#define TX4927_SIO0_SISCISR0_RESERVED_06_31 BM_06_31 348#define TX4927_SIO0_SISCISR0_RESERVED_06_31 BM_06_31
349#define TX4927_SIO0_SISCISR0_OERS BM_05_05 349#define TX4927_SIO0_SISCISR0_OERS BM_05_05
350#define TX4927_SIO0_SISCISR0_CTSS BM_04_04 350#define TX4927_SIO0_SISCISR0_CTSS BM_04_04
@@ -352,7 +352,7 @@
352#define TX4927_SIO0_SISCISR0_TRDY BM_02_02 352#define TX4927_SIO0_SISCISR0_TRDY BM_02_02
353#define TX4927_SIO0_SISCISR0_TXALS BM_01_01 353#define TX4927_SIO0_SISCISR0_TXALS BM_01_01
354#define TX4927_SIO0_SISCISR0_UBRKD BM_00_00 354#define TX4927_SIO0_SISCISR0_UBRKD BM_00_00
355#define TX4927_SIO0_SIFCR0 0xf310 355#define TX4927_SIO0_SIFCR0 0xf310
356#define TX4927_SIO0_SIFCR0_RESERVED_16_31 BM_16_31 356#define TX4927_SIO0_SIFCR0_RESERVED_16_31 BM_16_31
357#define TX4927_SIO0_SIFCR0_SWRST BM_16_31 357#define TX4927_SIO0_SIFCR0_SWRST BM_16_31
358#define TX4927_SIO0_SIFCR0_RESERVED_09_14 BM_09_14 358#define TX4927_SIO0_SIFCR0_RESERVED_09_14 BM_09_14
@@ -370,7 +370,7 @@
370#define TX4927_SIO0_SIFCR0_TFRST BM_02_02 370#define TX4927_SIO0_SIFCR0_TFRST BM_02_02
371#define TX4927_SIO0_SIFCR0_RFRST BM_01_01 371#define TX4927_SIO0_SIFCR0_RFRST BM_01_01
372#define TX4927_SIO0_SIFCR0_FRSTE BM_00_00 372#define TX4927_SIO0_SIFCR0_FRSTE BM_00_00
373#define TX4927_SIO0_SIFLCR0 0xf314 373#define TX4927_SIO0_SIFLCR0 0xf314
374#define TX4927_SIO0_SIFLCR0_RESERVED_13_31 BM_13_31 374#define TX4927_SIO0_SIFLCR0_RESERVED_13_31 BM_13_31
375#define TX4927_SIO0_SIFLCR0_RCS BM_12_12 375#define TX4927_SIO0_SIFLCR0_RCS BM_12_12
376#define TX4927_SIO0_SIFLCR0_TES BM_11_11 376#define TX4927_SIO0_SIFLCR0_TES BM_11_11
@@ -381,7 +381,7 @@
381#define TX4927_SIO0_SIFLCR0_RESERVED_05_06 BM_05_06 381#define TX4927_SIO0_SIFLCR0_RESERVED_05_06 BM_05_06
382#define TX4927_SIO0_SIFLCR0_RTSTL BM_01_04 382#define TX4927_SIO0_SIFLCR0_RTSTL BM_01_04
383#define TX4927_SIO0_SIFLCR0_TBRK BM_00_00 383#define TX4927_SIO0_SIFLCR0_TBRK BM_00_00
384#define TX4927_SIO0_SIBGR0 0xf318 384#define TX4927_SIO0_SIBGR0 0xf318
385#define TX4927_SIO0_SIBGR0_RESERVED_10_31 BM_10_31 385#define TX4927_SIO0_SIBGR0_RESERVED_10_31 BM_10_31
386#define TX4927_SIO0_SIBGR0_BCLK BM_08_09 386#define TX4927_SIO0_SIBGR0_BCLK BM_08_09
387#define TX4927_SIO0_SIBGR0_BCLK_T0 (~BM_08_09) 387#define TX4927_SIO0_SIBGR0_BCLK_T0 (~BM_08_09)
@@ -389,28 +389,28 @@
389#define TX4927_SIO0_SIBGR0_BCLK_T4 BM_09_09 389#define TX4927_SIO0_SIBGR0_BCLK_T4 BM_09_09
390#define TX4927_SIO0_SIBGR0_BCLK_T6 BM_08_09 390#define TX4927_SIO0_SIBGR0_BCLK_T6 BM_08_09
391#define TX4927_SIO0_SIBGR0_BRD BM_00_07 391#define TX4927_SIO0_SIBGR0_BRD BM_00_07
392#define TX4927_SIO0_SITFIF00 0xf31c 392#define TX4927_SIO0_SITFIF00 0xf31c
393#define TX4927_SIO0_SITFIF00_RESERVED_08_31 BM_08_31 393#define TX4927_SIO0_SITFIF00_RESERVED_08_31 BM_08_31
394#define TX4927_SIO0_SITFIF00_TXD BM_00_07 394#define TX4927_SIO0_SITFIF00_TXD BM_00_07
395#define TX4927_SIO0_SIRFIFO0 0xf320 395#define TX4927_SIO0_SIRFIFO0 0xf320
396#define TX4927_SIO0_SIRFIFO0_RESERVED_08_31 BM_08_31 396#define TX4927_SIO0_SIRFIFO0_RESERVED_08_31 BM_08_31
397#define TX4927_SIO0_SIRFIFO0_RXD BM_00_07 397#define TX4927_SIO0_SIRFIFO0_RXD BM_00_07
398#define TX4927_SIO0_SIRFIFO0 0xf320 398#define TX4927_SIO0_SIRFIFO0 0xf320
399#define TX4927_SIO0_LIMIT 0xf3ff 399#define TX4927_SIO0_LIMIT 0xf3ff
400 400
401 401
402/* TX4927 serial port 1 (32-bit registers) */ 402/* TX4927 serial port 1 (32-bit registers) */
403#define TX4927_SIO1_BASE 0xf400 403#define TX4927_SIO1_BASE 0xf400
404#define TX4927_SIO1_SILCR1 0xf400 404#define TX4927_SIO1_SILCR1 0xf400
405#define TX4927_SIO1_SIDICR1 0xf404 405#define TX4927_SIO1_SIDICR1 0xf404
406#define TX4927_SIO1_SIDISR1 0xf408 406#define TX4927_SIO1_SIDISR1 0xf408
407#define TX4927_SIO1_SISCISR1 0xf40c 407#define TX4927_SIO1_SISCISR1 0xf40c
408#define TX4927_SIO1_SIFCR1 0xf410 408#define TX4927_SIO1_SIFCR1 0xf410
409#define TX4927_SIO1_SIFLCR1 0xf414 409#define TX4927_SIO1_SIFLCR1 0xf414
410#define TX4927_SIO1_SIBGR1 0xf418 410#define TX4927_SIO1_SIBGR1 0xf418
411#define TX4927_SIO1_SITFIF01 0xf41c 411#define TX4927_SIO1_SITFIF01 0xf41c
412#define TX4927_SIO1_SIRFIFO1 0xf420 412#define TX4927_SIO1_SIRFIFO1 0xf420
413#define TX4927_SIO1_LIMIT 0xf4ff 413#define TX4927_SIO1_LIMIT 0xf4ff
414 414
415 415
416/* TX4927 parallel port (32-bit registers) */ 416/* TX4927 parallel port (32-bit registers) */
diff --git a/include/asm-mips/tx4927/tx4927_pci.h b/include/asm-mips/tx4927/tx4927_pci.h
index 170433492246..165f6b8b217f 100644
--- a/include/asm-mips/tx4927/tx4927_pci.h
+++ b/include/asm-mips/tx4927/tx4927_pci.h
@@ -5,8 +5,8 @@
5 * 5 *
6 * Copyright (C) 2000-2001 Toshiba Corporation 6 * Copyright (C) 2000-2001 Toshiba Corporation
7 */ 7 */
8#ifndef __ASM_TX4927_TX4927_PCI_H 8#ifndef __ASM_TX4927_TX4927_PCI_H
9#define __ASM_TX4927_TX4927_PCI_H 9#define __ASM_TX4927_TX4927_PCI_H
10 10
11#define TX4927_CCFG_TOE 0x00004000 11#define TX4927_CCFG_TOE 0x00004000
12 12
diff --git a/include/asm-mips/types.h b/include/asm-mips/types.h
index d2f0c76b00a9..421b3aea14cc 100644
--- a/include/asm-mips/types.h
+++ b/include/asm-mips/types.h
@@ -78,7 +78,7 @@ typedef unsigned long long u64;
78#endif 78#endif
79 79
80#if (defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) \ 80#if (defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) \
81 || defined(CONFIG_MIPS64) 81 || defined(CONFIG_64BIT)
82typedef u64 dma_addr_t; 82typedef u64 dma_addr_t;
83#else 83#else
84typedef u32 dma_addr_t; 84typedef u32 dma_addr_t;
@@ -99,8 +99,6 @@ typedef u64 sector_t;
99#define HAVE_SECTOR_T 99#define HAVE_SECTOR_T
100#endif 100#endif
101 101
102typedef unsigned short kmem_bufctl_t;
103
104#endif /* __ASSEMBLY__ */ 102#endif /* __ASSEMBLY__ */
105 103
106#endif /* __KERNEL__ */ 104#endif /* __KERNEL__ */
diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h
index 07114898e065..5c2c98329012 100644
--- a/include/asm-mips/uaccess.h
+++ b/include/asm-mips/uaccess.h
@@ -22,7 +22,7 @@
22 * 22 *
23 * For historical reasons, these macros are grossly misnamed. 23 * For historical reasons, these macros are grossly misnamed.
24 */ 24 */
25#ifdef CONFIG_MIPS32 25#ifdef CONFIG_32BIT
26 26
27#define __UA_LIMIT 0x80000000UL 27#define __UA_LIMIT 0x80000000UL
28 28
@@ -32,9 +32,9 @@
32#define __UA_t0 "$8" 32#define __UA_t0 "$8"
33#define __UA_t1 "$9" 33#define __UA_t1 "$9"
34 34
35#endif /* CONFIG_MIPS32 */ 35#endif /* CONFIG_32BIT */
36 36
37#ifdef CONFIG_MIPS64 37#ifdef CONFIG_64BIT
38 38
39#define __UA_LIMIT (- TASK_SIZE) 39#define __UA_LIMIT (- TASK_SIZE)
40 40
@@ -44,7 +44,7 @@
44#define __UA_t0 "$12" 44#define __UA_t0 "$12"
45#define __UA_t1 "$13" 45#define __UA_t1 "$13"
46 46
47#endif /* CONFIG_MIPS64 */ 47#endif /* CONFIG_64BIT */
48 48
49/* 49/*
50 * USER_DS is a bitmask that has the bits set that may not be set in a valid 50 * USER_DS is a bitmask that has the bits set that may not be set in a valid
@@ -112,29 +112,6 @@
112 likely(__access_ok((unsigned long)(addr), (size),__access_mask)) 112 likely(__access_ok((unsigned long)(addr), (size),__access_mask))
113 113
114/* 114/*
115 * verify_area: - Obsolete/deprecated and will go away soon,
116 * use access_ok() instead.
117 * @type: Type of access: %VERIFY_READ or %VERIFY_WRITE
118 * @addr: User space pointer to start of block to check
119 * @size: Size of block to check
120 *
121 * Context: User context only. This function may sleep.
122 *
123 * This function has been replaced by access_ok().
124 *
125 * Checks if a pointer to a block of memory in user space is valid.
126 *
127 * Returns zero if the memory block may be valid, -EFAULT
128 * if it is definitely invalid.
129 *
130 * See access_ok() for more details.
131 */
132static inline int __deprecated verify_area(int type, const void * addr, unsigned long size)
133{
134 return access_ok(type, addr, size) ? 0 : -EFAULT;
135}
136
137/*
138 * put_user: - Write a simple value into user space. 115 * put_user: - Write a simple value into user space.
139 * @x: Value to copy to user space. 116 * @x: Value to copy to user space.
140 * @ptr: Destination address, in user space. 117 * @ptr: Destination address, in user space.
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h
index 6d21cc964f76..ad4d48056307 100644
--- a/include/asm-mips/unistd.h
+++ b/include/asm-mips/unistd.h
@@ -1124,7 +1124,7 @@ type name (atype a,btype b,ctype c,dtype d,etype e,ftype f) \
1124# ifndef __mips64 1124# ifndef __mips64
1125# define __ARCH_WANT_STAT64 1125# define __ARCH_WANT_STAT64
1126# endif 1126# endif
1127# ifdef CONFIG_MIPS32 1127# ifdef CONFIG_32BIT
1128# define __ARCH_WANT_SYS_TIME 1128# define __ARCH_WANT_SYS_TIME
1129# endif 1129# endif
1130# ifdef CONFIG_MIPS32_O32 1130# ifdef CONFIG_MIPS32_O32
diff --git a/include/asm-mips/vr4181/irq.h b/include/asm-mips/vr4181/irq.h
deleted file mode 100644
index 4bf0ea970ed0..000000000000
--- a/include/asm-mips/vr4181/irq.h
+++ /dev/null
@@ -1,122 +0,0 @@
1/*
2 * Macros for vr4181 IRQ numbers.
3 *
4 * Copyright (C) 2001 MontaVista Software Inc.
5 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 */
13
14/*
15 * Strategy:
16 *
17 * Vr4181 has conceptually three levels of interrupt controllers:
18 * 1. the CPU itself with 8 intr level.
19 * 2. system interrupt controller, cascaded from int0 pin in CPU, 32 intrs
20 * 3. GPIO interrupts : forwarding external interrupts to sys intr controller
21 */
22
23/* decide the irq block assignment */
24#define VR4181_NUM_CPU_IRQ 8
25#define VR4181_NUM_SYS_IRQ 32
26#define VR4181_NUM_GPIO_IRQ 16
27
28#define VR4181_IRQ_BASE 0
29
30#define VR4181_CPU_IRQ_BASE VR4181_IRQ_BASE
31#define VR4181_SYS_IRQ_BASE (VR4181_CPU_IRQ_BASE + VR4181_NUM_CPU_IRQ)
32#define VR4181_GPIO_IRQ_BASE (VR4181_SYS_IRQ_BASE + VR4181_NUM_SYS_IRQ)
33
34/* CPU interrupts */
35
36/*
37 IP0 - Software interrupt
38 IP1 - Software interrupt
39 IP2 - All but battery, high speed modem, and real time clock
40 IP3 - RTC Long1 (system timer)
41 IP4 - RTC Long2
42 IP5 - High Speed Modem (unused on VR4181)
43 IP6 - Unused
44 IP7 - Timer interrupt from CPO_COMPARE
45*/
46
47#define VR4181_IRQ_SW1 (VR4181_CPU_IRQ_BASE + 0)
48#define VR4181_IRQ_SW2 (VR4181_CPU_IRQ_BASE + 1)
49#define VR4181_IRQ_INT0 (VR4181_CPU_IRQ_BASE + 2)
50#define VR4181_IRQ_INT1 (VR4181_CPU_IRQ_BASE + 3)
51#define VR4181_IRQ_INT2 (VR4181_CPU_IRQ_BASE + 4)
52#define VR4181_IRQ_INT3 (VR4181_CPU_IRQ_BASE + 5)
53#define VR4181_IRQ_INT4 (VR4181_CPU_IRQ_BASE + 6)
54#define VR4181_IRQ_TIMER (VR4181_CPU_IRQ_BASE + 7)
55
56
57/* Cascaded from VR4181_IRQ_INT0 (ICU mapped interrupts) */
58
59/*
60 IP2 - same as VR4181_IRQ_INT1
61 IP8 - This is a cascade to GPIO IRQ's. Do not use.
62 IP16 - same as VR4181_IRQ_INT2
63 IP18 - CompactFlash
64*/
65
66#define VR4181_IRQ_BATTERY (VR4181_SYS_IRQ_BASE + 0)
67#define VR4181_IRQ_POWER (VR4181_SYS_IRQ_BASE + 1)
68#define VR4181_IRQ_RTCL1 (VR4181_SYS_IRQ_BASE + 2)
69#define VR4181_IRQ_ETIMER (VR4181_SYS_IRQ_BASE + 3)
70#define VR4181_IRQ_RFU12 (VR4181_SYS_IRQ_BASE + 4)
71#define VR4181_IRQ_PIU (VR4181_SYS_IRQ_BASE + 5)
72#define VR4181_IRQ_AIU (VR4181_SYS_IRQ_BASE + 6)
73#define VR4181_IRQ_KIU (VR4181_SYS_IRQ_BASE + 7)
74#define VR4181_IRQ_GIU (VR4181_SYS_IRQ_BASE + 8)
75#define VR4181_IRQ_SIU (VR4181_SYS_IRQ_BASE + 9)
76#define VR4181_IRQ_RFU18 (VR4181_SYS_IRQ_BASE + 10)
77#define VR4181_IRQ_SOFT (VR4181_SYS_IRQ_BASE + 11)
78#define VR4181_IRQ_RFU20 (VR4181_SYS_IRQ_BASE + 12)
79#define VR4181_IRQ_DOZEPIU (VR4181_SYS_IRQ_BASE + 13)
80#define VR4181_IRQ_RFU22 (VR4181_SYS_IRQ_BASE + 14)
81#define VR4181_IRQ_RFU23 (VR4181_SYS_IRQ_BASE + 15)
82#define VR4181_IRQ_RTCL2 (VR4181_SYS_IRQ_BASE + 16)
83#define VR4181_IRQ_LED (VR4181_SYS_IRQ_BASE + 17)
84#define VR4181_IRQ_ECU (VR4181_SYS_IRQ_BASE + 18)
85#define VR4181_IRQ_CSU (VR4181_SYS_IRQ_BASE + 19)
86#define VR4181_IRQ_USB (VR4181_SYS_IRQ_BASE + 20)
87#define VR4181_IRQ_DMA (VR4181_SYS_IRQ_BASE + 21)
88#define VR4181_IRQ_LCD (VR4181_SYS_IRQ_BASE + 22)
89#define VR4181_IRQ_RFU31 (VR4181_SYS_IRQ_BASE + 23)
90#define VR4181_IRQ_RFU32 (VR4181_SYS_IRQ_BASE + 24)
91#define VR4181_IRQ_RFU33 (VR4181_SYS_IRQ_BASE + 25)
92#define VR4181_IRQ_RFU34 (VR4181_SYS_IRQ_BASE + 26)
93#define VR4181_IRQ_RFU35 (VR4181_SYS_IRQ_BASE + 27)
94#define VR4181_IRQ_RFU36 (VR4181_SYS_IRQ_BASE + 28)
95#define VR4181_IRQ_RFU37 (VR4181_SYS_IRQ_BASE + 29)
96#define VR4181_IRQ_RFU38 (VR4181_SYS_IRQ_BASE + 30)
97#define VR4181_IRQ_RFU39 (VR4181_SYS_IRQ_BASE + 31)
98
99/* Cascaded from VR4181_IRQ_GIU */
100#define VR4181_IRQ_GPIO0 (VR4181_GPIO_IRQ_BASE + 0)
101#define VR4181_IRQ_GPIO1 (VR4181_GPIO_IRQ_BASE + 1)
102#define VR4181_IRQ_GPIO2 (VR4181_GPIO_IRQ_BASE + 2)
103#define VR4181_IRQ_GPIO3 (VR4181_GPIO_IRQ_BASE + 3)
104#define VR4181_IRQ_GPIO4 (VR4181_GPIO_IRQ_BASE + 4)
105#define VR4181_IRQ_GPIO5 (VR4181_GPIO_IRQ_BASE + 5)
106#define VR4181_IRQ_GPIO6 (VR4181_GPIO_IRQ_BASE + 6)
107#define VR4181_IRQ_GPIO7 (VR4181_GPIO_IRQ_BASE + 7)
108#define VR4181_IRQ_GPIO8 (VR4181_GPIO_IRQ_BASE + 8)
109#define VR4181_IRQ_GPIO9 (VR4181_GPIO_IRQ_BASE + 9)
110#define VR4181_IRQ_GPIO10 (VR4181_GPIO_IRQ_BASE + 10)
111#define VR4181_IRQ_GPIO11 (VR4181_GPIO_IRQ_BASE + 11)
112#define VR4181_IRQ_GPIO12 (VR4181_GPIO_IRQ_BASE + 12)
113#define VR4181_IRQ_GPIO13 (VR4181_GPIO_IRQ_BASE + 13)
114#define VR4181_IRQ_GPIO14 (VR4181_GPIO_IRQ_BASE + 14)
115#define VR4181_IRQ_GPIO15 (VR4181_GPIO_IRQ_BASE + 15)
116
117
118// Alternative to above GPIO IRQ defines
119#define VR4181_IRQ_GPIO(pin) ((VR4181_IRQ_GPIO0) + (pin))
120
121#define VR4181_IRQ_MAX (VR4181_IRQ_BASE + VR4181_NUM_CPU_IRQ + \
122 VR4181_NUM_SYS_IRQ + VR4181_NUM_GPIO_IRQ)
diff --git a/include/asm-mips/vr4181/vr4181.h b/include/asm-mips/vr4181/vr4181.h
deleted file mode 100644
index 5c5d60741515..000000000000
--- a/include/asm-mips/vr4181/vr4181.h
+++ /dev/null
@@ -1,413 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1999 by Michael Klar
7 *
8 * Copyright 2001 MontaVista Software Inc.
9 * Author: jsun@mvista.com or jsun@junsun.net
10 *
11 */
12#ifndef __ASM_VR4181_VR4181_H
13#define __ASM_VR4181_VR4181_H
14
15#include <asm/addrspace.h>
16
17#include <asm/vr4181/irq.h>
18
19#ifndef __ASSEMBLY__
20#define __preg8 (volatile unsigned char*)
21#define __preg16 (volatile unsigned short*)
22#define __preg32 (volatile unsigned int*)
23#else
24#define __preg8
25#define __preg16
26#define __preg32
27#endif
28
29// Embedded CPU peripheral registers
30// Note that many of the registers have different physical address for VR4181
31
32// Bus Control Unit (BCU)
33#define VR4181_BCUCNTREG1 __preg16(KSEG1 + 0x0A000000) /* BCU control register 1 (R/W) */
34#define VR4181_CMUCLKMSK __preg16(KSEG1 + 0x0A000004) /* Clock mask register (R/W) */
35#define VR4181_CMUCLKMSK_MSKCSUPCLK 0x0040
36#define VR4181_CMUCLKMSK_MSKAIUPCLK 0x0020
37#define VR4181_CMUCLKMSK_MSKPIUPCLK 0x0010
38#define VR4181_CMUCLKMSK_MSKADUPCLK 0x0008
39#define VR4181_CMUCLKMSK_MSKSIU18M 0x0004
40#define VR4181_CMUCLKMSK_MSKADU18M 0x0002
41#define VR4181_CMUCLKMSK_MSKUSB 0x0001
42#define VR4181_CMUCLKMSK_MSKSIU VR4181_CMUCLKMSK_MSKSIU18M
43#define VR4181_BCUSPEEDREG __preg16(KSEG1 + 0x0A00000C) /* BCU access time parameter (R/W) */
44#define VR4181_BCURFCNTREG __preg16(KSEG1 + 0x0A000010) /* BCU refresh control register (R/W) */
45#define VR4181_REVIDREG __preg16(KSEG1 + 0x0A000014) /* Revision ID register (R) */
46#define VR4181_CLKSPEEDREG __preg16(KSEG1 + 0x0A000018) /* Clock speed register (R) */
47#define VR4181_EDOMCYTREG __preg16(KSEG1 + 0x0A000300) /* Memory cycle timing register (R/W) */
48#define VR4181_MEMCFG_REG __preg16(KSEG1 + 0x0A000304) /* Memory configuration register (R/W) */
49#define VR4181_MODE_REG __preg16(KSEG1 + 0x0A000308) /* SDRAM mode register (R/W) */
50#define VR4181_SDTIMINGREG __preg16(KSEG1 + 0x0A00030C) /* SDRAM timing register (R/W) */
51
52// DMA Control Unit (DCU)
53#define VR4181_MICDEST1REG1 __preg16(KSEG1 + 0x0A000020) /* Microphone destination 1 address register 1 (R/W) */
54#define VR4181_MICDEST1REG2 __preg16(KSEG1 + 0x0A000022) /* Microphone destination 1 address register 2 (R/W) */
55#define VR4181_MICDEST2REG1 __preg16(KSEG1 + 0x0A000024) /* Microphone destination 2 address register 1 (R/W) */
56#define VR4181_MICDEST2REG2 __preg16(KSEG1 + 0x0A000026) /* Microphone destination 2 address register 2 (R/W) */
57#define VR4181_SPKRRC1REG1 __preg16(KSEG1 + 0x0A000028) /* Speaker Source 1 address register 1 (R/W) */
58#define VR4181_SPKRRC1REG2 __preg16(KSEG1 + 0x0A00002A) /* Speaker Source 1 address register 2 (R/W) */
59#define VR4181_SPKRRC2REG1 __preg16(KSEG1 + 0x0A00002C) /* Speaker Source 2 address register 1 (R/W) */
60#define VR4181_SPKRRC2REG2 __preg16(KSEG1 + 0x0A00002E) /* Speaker Source 2 address register 2 (R/W) */
61#define VR4181_DMARSTREG __preg16(KSEG1 + 0x0A000040) /* DMA Reset register (R/W) */
62#define VR4181_AIUDMAMSKREG __preg16(KSEG1 + 0x0A000046) /* Audio DMA mask register (R/W) */
63#define VR4181_USBDMAMSKREG __preg16(KSEG1 + 0x0A000600) /* USB DMA Mask register (R/W) */
64#define VR4181_USBRXS1AREG1 __preg16(KSEG1 + 0x0A000602) /* USB Rx source 1 address register 1 (R/W) */
65#define VR4181_USBRXS1AREG2 __preg16(KSEG1 + 0x0A000604) /* USB Rx source 1 address register 2 (R/W) */
66#define VR4181_USBRXS2AREG1 __preg16(KSEG1 + 0x0A000606) /* USB Rx source 2 address register 1 (R/W) */
67#define VR4181_USBRXS2AREG2 __preg16(KSEG1 + 0x0A000608) /* USB Rx source 2 address register 2 (R/W) */
68#define VR4181_USBTXS1AREG1 __preg16(KSEG1 + 0x0A00060A) /* USB Tx source 1 address register 1 (R/W) */
69#define VR4181_USBTXS1AREG2 __preg16(KSEG1 + 0x0A00060C) /* USB Tx source 1 address register 2 (R/W) */
70#define VR4181_USBTXS2AREG1 __preg16(KSEG1 + 0x0A00060E) /* USB Tx source 2 address register 1 (R/W) */
71#define VR4181_USBTXS2AREG2 __preg16(KSEG1 + 0x0A000610) /* USB Tx source 2 address register 2 (R/W) */
72#define VR4181_USBRXD1AREG1 __preg16(KSEG1 + 0x0A00062A) /* USB Rx destination 1 address register 1 (R/W) */
73#define VR4181_USBRXD1AREG2 __preg16(KSEG1 + 0x0A00062C) /* USB Rx destination 1 address register 2 (R/W) */
74#define VR4181_USBRXD2AREG1 __preg16(KSEG1 + 0x0A00062E) /* USB Rx destination 2 address register 1 (R/W) */
75#define VR4181_USBRXD2AREG2 __preg16(KSEG1 + 0x0A000630) /* USB Rx destination 2 address register 2 (R/W) */
76#define VR4181_USBTXD1AREG1 __preg16(KSEG1 + 0x0A000632) /* USB Tx destination 1 address register 1 (R/W) */
77#define VR4181_USBTXD1AREG2 __preg16(KSEG1 + 0x0A000634) /* USB Tx destination 1 address register 2 (R/W) */
78#define VR4181_USBTXD2AREG1 __preg16(KSEG1 + 0x0A000636) /* USB Tx destination 2 address register 1 (R/W) */
79#define VR4181_USBTXD2AREG2 __preg16(KSEG1 + 0x0A000638) /* USB Tx destination 2 address register 2 (R/W) */
80#define VR4181_RxRCLENREG __preg16(KSEG1 + 0x0A000652) /* USB Rx record length register (R/W) */
81#define VR4181_TxRCLENREG __preg16(KSEG1 + 0x0A000654) /* USB Tx record length register (R/W) */
82#define VR4181_MICRCLENREG __preg16(KSEG1 + 0x0A000658) /* Microphone record length register (R/W) */
83#define VR4181_SPKRCLENREG __preg16(KSEG1 + 0x0A00065A) /* Speaker record length register (R/W) */
84#define VR4181_USBCFGREG __preg16(KSEG1 + 0x0A00065C) /* USB configuration register (R/W) */
85#define VR4181_MICDMACFGREG __preg16(KSEG1 + 0x0A00065E) /* Microphone DMA configuration register (R/W) */
86#define VR4181_SPKDMACFGREG __preg16(KSEG1 + 0x0A000660) /* Speaker DMA configuration register (R/W) */
87#define VR4181_DMAITRQREG __preg16(KSEG1 + 0x0A000662) /* DMA interrupt request register (R/W) */
88#define VR4181_DMACLTREG __preg16(KSEG1 + 0x0A000664) /* DMA control register (R/W) */
89#define VR4181_DMAITMKREG __preg16(KSEG1 + 0x0A000666) /* DMA interrupt mask register (R/W) */
90
91// ISA Bridge
92#define VR4181_ISABRGCTL __preg16(KSEG1 + 0x0B0002C0) /* ISA Bridge Control Register (R/W) */
93#define VR4181_ISABRGSTS __preg16(KSEG1 + 0x0B0002C2) /* ISA Bridge Status Register (R/W) */
94#define VR4181_XISACTL __preg16(KSEG1 + 0x0B0002C4) /* External ISA Control Register (R/W) */
95
96// Clocked Serial Interface (CSI)
97#define VR4181_CSIMODE __preg16(KSEG1 + 0x0B000900) /* CSI Mode Register (R/W) */
98#define VR4181_CSIRXDATA __preg16(KSEG1 + 0x0B000902) /* CSI Receive Data Register (R) */
99#define VR4181_CSITXDATA __preg16(KSEG1 + 0x0B000904) /* CSI Transmit Data Register (R/W) */
100#define VR4181_CSILSTAT __preg16(KSEG1 + 0x0B000906) /* CSI Line Status Register (R/W) */
101#define VR4181_CSIINTMSK __preg16(KSEG1 + 0x0B000908) /* CSI Interrupt Mask Register (R/W) */
102#define VR4181_CSIINTSTAT __preg16(KSEG1 + 0x0B00090a) /* CSI Interrupt Status Register (R/W) */
103#define VR4181_CSITXBLEN __preg16(KSEG1 + 0x0B00090c) /* CSI Transmit Burst Length Register (R/W) */
104#define VR4181_CSIRXBLEN __preg16(KSEG1 + 0x0B00090e) /* CSI Receive Burst Length Register (R/W) */
105
106// Interrupt Control Unit (ICU)
107#define VR4181_SYSINT1REG __preg16(KSEG1 + 0x0A000080) /* Level 1 System interrupt register 1 (R) */
108#define VR4181_MSYSINT1REG __preg16(KSEG1 + 0x0A00008C) /* Level 1 mask system interrupt register 1 (R/W) */
109#define VR4181_NMIREG __preg16(KSEG1 + 0x0A000098) /* NMI register (R/W) */
110#define VR4181_SOFTINTREG __preg16(KSEG1 + 0x0A00009A) /* Software interrupt register (R/W) */
111#define VR4181_SYSINT2REG __preg16(KSEG1 + 0x0A000200) /* Level 1 System interrupt register 2 (R) */
112#define VR4181_MSYSINT2REG __preg16(KSEG1 + 0x0A000206) /* Level 1 mask system interrupt register 2 (R/W) */
113#define VR4181_PIUINTREGro __preg16(KSEG1 + 0x0B000082) /* Level 2 PIU interrupt register (R) */
114#define VR4181_AIUINTREG __preg16(KSEG1 + 0x0B000084) /* Level 2 AIU interrupt register (R) */
115#define VR4181_MPIUINTREG __preg16(KSEG1 + 0x0B00008E) /* Level 2 mask PIU interrupt register (R/W) */
116#define VR4181_MAIUINTREG __preg16(KSEG1 + 0x0B000090) /* Level 2 mask AIU interrupt register (R/W) */
117#define VR4181_MKIUINTREG __preg16(KSEG1 + 0x0B000092) /* Level 2 mask KIU interrupt register (R/W) */
118#define VR4181_KIUINTREG __preg16(KSEG1 + 0x0B000198) /* Level 2 KIU interrupt register (R) */
119
120// Power Management Unit (PMU)
121#define VR4181_PMUINTREG __preg16(KSEG1 + 0x0B0000A0) /* PMU Status Register (R/W) */
122#define VR4181_PMUINT_POWERSW 0x1 /* Power switch */
123#define VR4181_PMUINT_BATT 0x2 /* Low batt during normal operation */
124#define VR4181_PMUINT_DEADMAN 0x4 /* Deadman's switch */
125#define VR4181_PMUINT_RESET 0x8 /* Reset switch */
126#define VR4181_PMUINT_RTCRESET 0x10 /* RTC Reset */
127#define VR4181_PMUINT_TIMEOUT 0x20 /* HAL Timer Reset */
128#define VR4181_PMUINT_BATTLOW 0x100 /* Battery low */
129#define VR4181_PMUINT_RTC 0x200 /* RTC Alarm */
130#define VR4181_PMUINT_DCD 0x400 /* DCD# */
131#define VR4181_PMUINT_GPIO0 0x1000 /* GPIO0 */
132#define VR4181_PMUINT_GPIO1 0x2000 /* GPIO1 */
133#define VR4181_PMUINT_GPIO2 0x4000 /* GPIO2 */
134#define VR4181_PMUINT_GPIO3 0x8000 /* GPIO3 */
135
136#define VR4181_PMUCNTREG __preg16(KSEG1 + 0x0B0000A2) /* PMU Control Register (R/W) */
137#define VR4181_PMUWAITREG __preg16(KSEG1 + 0x0B0000A8) /* PMU Wait Counter Register (R/W) */
138#define VR4181_PMUDIVREG __preg16(KSEG1 + 0x0B0000AC) /* PMU Divide Mode Register (R/W) */
139#define VR4181_DRAMHIBCTL __preg16(KSEG1 + 0x0B0000B2) /* DRAM Hibernate Control Register (R/W) */
140
141// Real Time Clock Unit (RTC)
142#define VR4181_ETIMELREG __preg16(KSEG1 + 0x0B0000C0) /* Elapsed Time L Register (R/W) */
143#define VR4181_ETIMEMREG __preg16(KSEG1 + 0x0B0000C2) /* Elapsed Time M Register (R/W) */
144#define VR4181_ETIMEHREG __preg16(KSEG1 + 0x0B0000C4) /* Elapsed Time H Register (R/W) */
145#define VR4181_ECMPLREG __preg16(KSEG1 + 0x0B0000C8) /* Elapsed Compare L Register (R/W) */
146#define VR4181_ECMPMREG __preg16(KSEG1 + 0x0B0000CA) /* Elapsed Compare M Register (R/W) */
147#define VR4181_ECMPHREG __preg16(KSEG1 + 0x0B0000CC) /* Elapsed Compare H Register (R/W) */
148#define VR4181_RTCL1LREG __preg16(KSEG1 + 0x0B0000D0) /* RTC Long 1 L Register (R/W) */
149#define VR4181_RTCL1HREG __preg16(KSEG1 + 0x0B0000D2) /* RTC Long 1 H Register (R/W) */
150#define VR4181_RTCL1CNTLREG __preg16(KSEG1 + 0x0B0000D4) /* RTC Long 1 Count L Register (R) */
151#define VR4181_RTCL1CNTHREG __preg16(KSEG1 + 0x0B0000D6) /* RTC Long 1 Count H Register (R) */
152#define VR4181_RTCL2LREG __preg16(KSEG1 + 0x0B0000D8) /* RTC Long 2 L Register (R/W) */
153#define VR4181_RTCL2HREG __preg16(KSEG1 + 0x0B0000DA) /* RTC Long 2 H Register (R/W) */
154#define VR4181_RTCL2CNTLREG __preg16(KSEG1 + 0x0B0000DC) /* RTC Long 2 Count L Register (R) */
155#define VR4181_RTCL2CNTHREG __preg16(KSEG1 + 0x0B0000DE) /* RTC Long 2 Count H Register (R) */
156#define VR4181_RTCINTREG __preg16(KSEG1 + 0x0B0001DE) /* RTC Interrupt Register (R/W) */
157
158// Deadman's Switch Unit (DSU)
159#define VR4181_DSUCNTREG __preg16(KSEG1 + 0x0B0000E0) /* DSU Control Register (R/W) */
160#define VR4181_DSUSETREG __preg16(KSEG1 + 0x0B0000E2) /* DSU Dead Time Set Register (R/W) */
161#define VR4181_DSUCLRREG __preg16(KSEG1 + 0x0B0000E4) /* DSU Clear Register (W) */
162#define VR4181_DSUTIMREG __preg16(KSEG1 + 0x0B0000E6) /* DSU Elapsed Time Register (R/W) */
163
164// General Purpose I/O Unit (GIU)
165#define VR4181_GPMD0REG __preg16(KSEG1 + 0x0B000300) /* GPIO Mode 0 Register (R/W) */
166#define VR4181_GPMD1REG __preg16(KSEG1 + 0x0B000302) /* GPIO Mode 1 Register (R/W) */
167#define VR4181_GPMD2REG __preg16(KSEG1 + 0x0B000304) /* GPIO Mode 2 Register (R/W) */
168#define VR4181_GPMD3REG __preg16(KSEG1 + 0x0B000306) /* GPIO Mode 3 Register (R/W) */
169#define VR4181_GPDATHREG __preg16(KSEG1 + 0x0B000308) /* GPIO Data High Register (R/W) */
170#define VR4181_GPDATHREG_GPIO16 0x0001
171#define VR4181_GPDATHREG_GPIO17 0x0002
172#define VR4181_GPDATHREG_GPIO18 0x0004
173#define VR4181_GPDATHREG_GPIO19 0x0008
174#define VR4181_GPDATHREG_GPIO20 0x0010
175#define VR4181_GPDATHREG_GPIO21 0x0020
176#define VR4181_GPDATHREG_GPIO22 0x0040
177#define VR4181_GPDATHREG_GPIO23 0x0080
178#define VR4181_GPDATHREG_GPIO24 0x0100
179#define VR4181_GPDATHREG_GPIO25 0x0200
180#define VR4181_GPDATHREG_GPIO26 0x0400
181#define VR4181_GPDATHREG_GPIO27 0x0800
182#define VR4181_GPDATHREG_GPIO28 0x1000
183#define VR4181_GPDATHREG_GPIO29 0x2000
184#define VR4181_GPDATHREG_GPIO30 0x4000
185#define VR4181_GPDATHREG_GPIO31 0x8000
186#define VR4181_GPDATLREG __preg16(KSEG1 + 0x0B00030A) /* GPIO Data Low Register (R/W) */
187#define VR4181_GPDATLREG_GPIO0 0x0001
188#define VR4181_GPDATLREG_GPIO1 0x0002
189#define VR4181_GPDATLREG_GPIO2 0x0004
190#define VR4181_GPDATLREG_GPIO3 0x0008
191#define VR4181_GPDATLREG_GPIO4 0x0010
192#define VR4181_GPDATLREG_GPIO5 0x0020
193#define VR4181_GPDATLREG_GPIO6 0x0040
194#define VR4181_GPDATLREG_GPIO7 0x0080
195#define VR4181_GPDATLREG_GPIO8 0x0100
196#define VR4181_GPDATLREG_GPIO9 0x0200
197#define VR4181_GPDATLREG_GPIO10 0x0400
198#define VR4181_GPDATLREG_GPIO11 0x0800
199#define VR4181_GPDATLREG_GPIO12 0x1000
200#define VR4181_GPDATLREG_GPIO13 0x2000
201#define VR4181_GPDATLREG_GPIO14 0x4000
202#define VR4181_GPDATLREG_GPIO15 0x8000
203#define VR4181_GPINTEN __preg16(KSEG1 + 0x0B00030C) /* GPIO Interrupt Enable Register (R/W) */
204#define VR4181_GPINTMSK __preg16(KSEG1 + 0x0B00030E) /* GPIO Interrupt Mask Register (R/W) */
205#define VR4181_GPINTTYPH __preg16(KSEG1 + 0x0B000310) /* GPIO Interrupt Type High Register (R/W) */
206#define VR4181_GPINTTYPL __preg16(KSEG1 + 0x0B000312) /* GPIO Interrupt Type Low Register (R/W) */
207#define VR4181_GPINTSTAT __preg16(KSEG1 + 0x0B000314) /* GPIO Interrupt Status Register (R/W) */
208#define VR4181_GPHIBSTH __preg16(KSEG1 + 0x0B000316) /* GPIO Hibernate Pin State High Register (R/W) */
209#define VR4181_GPHIBSTL __preg16(KSEG1 + 0x0B000318) /* GPIO Hibernate Pin State Low Register (R/W) */
210#define VR4181_GPSICTL __preg16(KSEG1 + 0x0B00031A) /* GPIO Serial Interface Control Register (R/W) */
211#define VR4181_KEYEN __preg16(KSEG1 + 0x0B00031C) /* Keyboard Scan Pin Enable Register (R/W) */
212#define VR4181_PCS0STRA __preg16(KSEG1 + 0x0B000320) /* Programmable Chip Select [0] Start Address Register (R/W) */
213#define VR4181_PCS0STPA __preg16(KSEG1 + 0x0B000322) /* Programmable Chip Select [0] Stop Address Register (R/W) */
214#define VR4181_PCS0HIA __preg16(KSEG1 + 0x0B000324) /* Programmable Chip Select [0] High Address Register (R/W) */
215#define VR4181_PCS1STRA __preg16(KSEG1 + 0x0B000326) /* Programmable Chip Select [1] Start Address Register (R/W) */
216#define VR4181_PCS1STPA __preg16(KSEG1 + 0x0B000328) /* Programmable Chip Select [1] Stop Address Register (R/W) */
217#define VR4181_PCS1HIA __preg16(KSEG1 + 0x0B00032A) /* Programmable Chip Select [1] High Address Register (R/W) */
218#define VR4181_PCSMODE __preg16(KSEG1 + 0x0B00032C) /* Programmable Chip Select Mode Register (R/W) */
219#define VR4181_LCDGPMODE __preg16(KSEG1 + 0x0B00032E) /* LCD General Purpose Mode Register (R/W) */
220#define VR4181_MISCREG0 __preg16(KSEG1 + 0x0B000330) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */
221#define VR4181_MISCREG1 __preg16(KSEG1 + 0x0B000332) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */
222#define VR4181_MISCREG2 __preg16(KSEG1 + 0x0B000334) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */
223#define VR4181_MISCREG3 __preg16(KSEG1 + 0x0B000336) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */
224#define VR4181_MISCREG4 __preg16(KSEG1 + 0x0B000338) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */
225#define VR4181_MISCREG5 __preg16(KSEG1 + 0x0B00033A) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */
226#define VR4181_MISCREG6 __preg16(KSEG1 + 0x0B00033C) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */
227#define VR4181_MISCREG7 __preg16(KSEG1 + 0x0B00033D) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */
228#define VR4181_MISCREG8 __preg16(KSEG1 + 0x0B000340) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */
229#define VR4181_MISCREG9 __preg16(KSEG1 + 0x0B000342) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */
230#define VR4181_MISCREG10 __preg16(KSEG1 + 0x0B000344) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */
231#define VR4181_MISCREG11 __preg16(KSEG1 + 0x0B000346) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */
232#define VR4181_MISCREG12 __preg16(KSEG1 + 0x0B000348) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */
233#define VR4181_MISCREG13 __preg16(KSEG1 + 0x0B00034A) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */
234#define VR4181_MISCREG14 __preg16(KSEG1 + 0x0B00034C) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */
235#define VR4181_MISCREG15 __preg16(KSEG1 + 0x0B00034E) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */
236#define VR4181_SECIRQMASKL VR4181_GPINTEN
237// No SECIRQMASKH for VR4181
238
239// Touch Panel Interface Unit (PIU)
240#define VR4181_PIUCNTREG __preg16(KSEG1 + 0x0B000122) /* PIU Control register (R/W) */
241#define VR4181_PIUCNTREG_PIUSEQEN 0x0004
242#define VR4181_PIUCNTREG_PIUPWR 0x0002
243#define VR4181_PIUCNTREG_PADRST 0x0001
244
245#define VR4181_PIUINTREG __preg16(KSEG1 + 0x0B000124) /* PIU Interrupt cause register (R/W) */
246#define VR4181_PIUINTREG_OVP 0x8000
247#define VR4181_PIUINTREG_PADCMD 0x0040
248#define VR4181_PIUINTREG_PADADP 0x0020
249#define VR4181_PIUINTREG_PADPAGE1 0x0010
250#define VR4181_PIUINTREG_PADPAGE0 0x0008
251#define VR4181_PIUINTREG_PADDLOST 0x0004
252#define VR4181_PIUINTREG_PENCHG 0x0001
253
254#define VR4181_PIUSIVLREG __preg16(KSEG1 + 0x0B000126) /* PIU Data sampling interval register (R/W) */
255#define VR4181_PIUSTBLREG __preg16(KSEG1 + 0x0B000128) /* PIU A/D converter start delay register (R/W) */
256#define VR4181_PIUCMDREG __preg16(KSEG1 + 0x0B00012A) /* PIU A/D command register (R/W) */
257#define VR4181_PIUASCNREG __preg16(KSEG1 + 0x0B000130) /* PIU A/D port scan register (R/W) */
258#define VR4181_PIUAMSKREG __preg16(KSEG1 + 0x0B000132) /* PIU A/D scan mask register (R/W) */
259#define VR4181_PIUCIVLREG __preg16(KSEG1 + 0x0B00013E) /* PIU Check interval register (R) */
260#define VR4181_PIUPB00REG __preg16(KSEG1 + 0x0B0002A0) /* PIU Page 0 Buffer 0 register (R/W) */
261#define VR4181_PIUPB01REG __preg16(KSEG1 + 0x0B0002A2) /* PIU Page 0 Buffer 1 register (R/W) */
262#define VR4181_PIUPB02REG __preg16(KSEG1 + 0x0B0002A4) /* PIU Page 0 Buffer 2 register (R/W) */
263#define VR4181_PIUPB03REG __preg16(KSEG1 + 0x0B0002A6) /* PIU Page 0 Buffer 3 register (R/W) */
264#define VR4181_PIUPB10REG __preg16(KSEG1 + 0x0B0002A8) /* PIU Page 1 Buffer 0 register (R/W) */
265#define VR4181_PIUPB11REG __preg16(KSEG1 + 0x0B0002AA) /* PIU Page 1 Buffer 1 register (R/W) */
266#define VR4181_PIUPB12REG __preg16(KSEG1 + 0x0B0002AC) /* PIU Page 1 Buffer 2 register (R/W) */
267#define VR4181_PIUPB13REG __preg16(KSEG1 + 0x0B0002AE) /* PIU Page 1 Buffer 3 register (R/W) */
268#define VR4181_PIUAB0REG __preg16(KSEG1 + 0x0B0002B0) /* PIU A/D scan Buffer 0 register (R/W) */
269#define VR4181_PIUAB1REG __preg16(KSEG1 + 0x0B0002B2) /* PIU A/D scan Buffer 1 register (R/W) */
270#define VR4181_PIUAB2REG __preg16(KSEG1 + 0x0B0002B4) /* PIU A/D scan Buffer 2 register (R/W) */
271#define VR4181_PIUAB3REG __preg16(KSEG1 + 0x0B0002B6) /* PIU A/D scan Buffer 3 register (R/W) */
272#define VR4181_PIUPB04REG __preg16(KSEG1 + 0x0B0002BC) /* PIU Page 0 Buffer 4 register (R/W) */
273#define VR4181_PIUPB14REG __preg16(KSEG1 + 0x0B0002BE) /* PIU Page 1 Buffer 4 register (R/W) */
274
275// Audio Interface Unit (AIU)
276#define VR4181_SODATREG __preg16(KSEG1 + 0x0B000166) /* Speaker Output Data Register (R/W) */
277#define VR4181_SCNTREG __preg16(KSEG1 + 0x0B000168) /* Speaker Output Control Register (R/W) */
278#define VR4181_MIDATREG __preg16(KSEG1 + 0x0B000170) /* Mike Input Data Register (R/W) */
279#define VR4181_MCNTREG __preg16(KSEG1 + 0x0B000172) /* Mike Input Control Register (R/W) */
280#define VR4181_DVALIDREG __preg16(KSEG1 + 0x0B000178) /* Data Valid Register (R/W) */
281#define VR4181_SEQREG __preg16(KSEG1 + 0x0B00017A) /* Sequential Register (R/W) */
282#define VR4181_INTREG __preg16(KSEG1 + 0x0B00017C) /* Interrupt Register (R/W) */
283#define VR4181_SDMADATREG __preg16(KSEG1 + 0x0B000160) /* Speaker DMA Data Register (R/W) */
284#define VR4181_MDMADATREG __preg16(KSEG1 + 0x0B000162) /* Microphone DMA Data Register (R/W) */
285#define VR4181_DAVREF_SETUP __preg16(KSEG1 + 0x0B000164) /* DAC Vref setup register (R/W) */
286#define VR4181_SCNVC_END __preg16(KSEG1 + 0x0B00016E) /* Speaker sample rate control (R/W) */
287#define VR4181_MIDATREG __preg16(KSEG1 + 0x0B000170) /* Microphone Input Data Register (R/W) */
288#define VR4181_MCNTREG __preg16(KSEG1 + 0x0B000172) /* Microphone Input Control Register (R/W) */
289#define VR4181_MCNVC_END __preg16(KSEG1 + 0x0B00017E) /* Microphone sample rate control (R/W) */
290
291// Keyboard Interface Unit (KIU)
292#define VR4181_KIUDAT0 __preg16(KSEG1 + 0x0B000180) /* KIU Data0 Register (R/W) */
293#define VR4181_KIUDAT1 __preg16(KSEG1 + 0x0B000182) /* KIU Data1 Register (R/W) */
294#define VR4181_KIUDAT2 __preg16(KSEG1 + 0x0B000184) /* KIU Data2 Register (R/W) */
295#define VR4181_KIUDAT3 __preg16(KSEG1 + 0x0B000186) /* KIU Data3 Register (R/W) */
296#define VR4181_KIUDAT4 __preg16(KSEG1 + 0x0B000188) /* KIU Data4 Register (R/W) */
297#define VR4181_KIUDAT5 __preg16(KSEG1 + 0x0B00018A) /* KIU Data5 Register (R/W) */
298#define VR4181_KIUSCANREP __preg16(KSEG1 + 0x0B000190) /* KIU Scan/Repeat Register (R/W) */
299#define VR4181_KIUSCANREP_KEYEN 0x8000
300#define VR4181_KIUSCANREP_SCANSTP 0x0008
301#define VR4181_KIUSCANREP_SCANSTART 0x0004
302#define VR4181_KIUSCANREP_ATSTP 0x0002
303#define VR4181_KIUSCANREP_ATSCAN 0x0001
304#define VR4181_KIUSCANS __preg16(KSEG1 + 0x0B000192) /* KIU Scan Status Register (R) */
305#define VR4181_KIUWKS __preg16(KSEG1 + 0x0B000194) /* KIU Wait Keyscan Stable Register (R/W) */
306#define VR4181_KIUWKI __preg16(KSEG1 + 0x0B000196) /* KIU Wait Keyscan Interval Register (R/W) */
307#define VR4181_KIUINT __preg16(KSEG1 + 0x0B000198) /* KIU Interrupt Register (R/W) */
308#define VR4181_KIUINT_KDATLOST 0x0004
309#define VR4181_KIUINT_KDATRDY 0x0002
310#define VR4181_KIUINT_SCANINT 0x0001
311#define VR4181_KIUDAT6 __preg16(KSEG1 + 0x0B00018C) /* Scan Line 6 Key Data Register (R) */
312#define VR4181_KIUDAT7 __preg16(KSEG1 + 0x0B00018E) /* Scan Line 7 Key Data Register (R) */
313
314// CompactFlash Controller
315#define VR4181_PCCARDINDEX __preg8(KSEG1 + 0x0B0008E0) /* PC Card Controller Index Register */
316#define VR4181_PCCARDDATA __preg8(KSEG1 + 0x0B0008E1) /* PC Card Controller Data Register */
317#define VR4181_INTSTATREG __preg16(KSEG1 + 0x0B0008F8) /* Interrupt Status Register (R/W) */
318#define VR4181_INTMSKREG __preg16(KSEG1 + 0x0B0008FA) /* Interrupt Mask Register (R/W) */
319#define VR4181_CFG_REG_1 __preg16(KSEG1 + 0x0B0008FE) /* Configuration Register 1 */
320
321// LED Control Unit (LED)
322#define VR4181_LEDHTSREG __preg16(KSEG1 + 0x0B000240) /* LED H Time Set register (R/W) */
323#define VR4181_LEDLTSREG __preg16(KSEG1 + 0x0B000242) /* LED L Time Set register (R/W) */
324#define VR4181_LEDCNTREG __preg16(KSEG1 + 0x0B000248) /* LED Control register (R/W) */
325#define VR4181_LEDASTCREG __preg16(KSEG1 + 0x0B00024A) /* LED Auto Stop Time Count register (R/W) */
326#define VR4181_LEDINTREG __preg16(KSEG1 + 0x0B00024C) /* LED Interrupt register (R/W) */
327
328// Serial Interface Unit (SIU / SIU1 and SIU2)
329#define VR4181_SIURB __preg8(KSEG1 + 0x0C000010) /* Receiver Buffer Register (Read) DLAB = 0 (R) */
330#define VR4181_SIUTH __preg8(KSEG1 + 0x0C000010) /* Transmitter Holding Register (Write) DLAB = 0 (W) */
331#define VR4181_SIUDLL __preg8(KSEG1 + 0x0C000010) /* Divisor Latch (Least Significant Byte) DLAB = 1 (R/W) */
332#define VR4181_SIUIE __preg8(KSEG1 + 0x0C000011) /* Interrupt Enable DLAB = 0 (R/W) */
333#define VR4181_SIUDLM __preg8(KSEG1 + 0x0C000011) /* Divisor Latch (Most Significant Byte) DLAB = 1 (R/W) */
334#define VR4181_SIUIID __preg8(KSEG1 + 0x0C000012) /* Interrupt Identification Register (Read) (R) */
335#define VR4181_SIUFC __preg8(KSEG1 + 0x0C000012) /* FIFO Control Register (Write) (W) */
336#define VR4181_SIULC __preg8(KSEG1 + 0x0C000013) /* Line Control Register (R/W) */
337#define VR4181_SIUMC __preg8(KSEG1 + 0x0C000014) /* MODEM Control Register (R/W) */
338#define VR4181_SIULS __preg8(KSEG1 + 0x0C000015) /* Line Status Register (R/W) */
339#define VR4181_SIUMS __preg8(KSEG1 + 0x0C000016) /* MODEM Status Register (R/W) */
340#define VR4181_SIUSC __preg8(KSEG1 + 0x0C000017) /* Scratch Register (R/W) */
341#define VR4181_SIURESET __preg8(KSEG1 + 0x0C000019) /* SIU Reset Register (R/W) */
342#define VR4181_SIUACTMSK __preg8(KSEG1 + 0x0C00001C) /* SIU Activity Mask (R/W) */
343#define VR4181_SIUACTTMR __preg8(KSEG1 + 0x0C00001E) /* SIU Activity Timer (R/W) */
344#define VR4181_SIURB_2 __preg8(KSEG1 + 0x0C000000) /* Receive Buffer Register (Read) (R) */
345#define VR4181_SIUTH_2 __preg8(KSEG1 + 0x0C000000) /* Transmitter Holding Register (Write) (W) */
346#define VR4181_SIUDLL_2 __preg8(KSEG1 + 0x0C000000) /* Divisor Latch (Least Significant Byte) (R/W) */
347#define VR4181_SIUIE_2 __preg8(KSEG1 + 0x0C000001) /* Interrupt Enable (DLAB = 0) (R/W) */
348#define VR4181_SIUDLM_2 __preg8(KSEG1 + 0x0C000001) /* Divisor Latch (Most Significant Byte) (DLAB = 1) (R/W) */
349#define VR4181_SIUIID_2 __preg8(KSEG1 + 0x0C000002) /* Interrupt Identification Register (Read) (R) */
350#define VR4181_SIUFC_2 __preg8(KSEG1 + 0x0C000002) /* FIFO Control Register (Write) (W) */
351#define VR4181_SIULC_2 __preg8(KSEG1 + 0x0C000003) /* Line Control Register (R/W) */
352#define VR4181_SIUMC_2 __preg8(KSEG1 + 0x0C000004) /* Modem Control Register (R/W) */
353#define VR4181_SIULS_2 __preg8(KSEG1 + 0x0C000005) /* Line Status Register (R/W) */
354#define VR4181_SIUMS_2 __preg8(KSEG1 + 0x0C000006) /* Modem Status Register (R/W) */
355#define VR4181_SIUSC_2 __preg8(KSEG1 + 0x0C000007) /* Scratch Register (R/W) */
356#define VR4181_SIUIRSEL_2 __preg8(KSEG1 + 0x0C000008) /* SIU IrDA Selectot (R/W) */
357#define VR4181_SIURESET_2 __preg8(KSEG1 + 0x0C000009) /* SIU Reset Register (R/W) */
358#define VR4181_SIUCSEL_2 __preg8(KSEG1 + 0x0C00000A) /* IrDA Echo-back Control (R/W) */
359#define VR4181_SIUACTMSK_2 __preg8(KSEG1 + 0x0C00000C) /* SIU Activity Mask Register (R/W) */
360#define VR4181_SIUACTTMR_2 __preg8(KSEG1 + 0x0C00000E) /* SIU Activity Timer Register (R/W) */
361
362
363// USB Module
364#define VR4181_USBINFIFO __preg16(KSEG1 + 0x0B000780) /* USB Bulk Input FIFO (Bulk In End Point) (W) */
365#define VR4181_USBOUTFIFO __preg16(KSEG1 + 0x0B000782) /* USB Bulk Output FIFO (Bulk Out End Point) (R) */
366#define VR4181_USBCTLFIFO __preg16(KSEG1 + 0x0B000784) /* USB Control FIFO (Control End Point) (W) */
367#define VR4181_USBSTAT __preg16(KSEG1 + 0x0B000786) /* Interrupt Status Register (R/W) */
368#define VR4181_USBINTMSK __preg16(KSEG1 + 0x0B000788) /* Interrupt Mask Register (R/W) */
369#define VR4181_USBCTLREG __preg16(KSEG1 + 0x0B00078A) /* Control Register (R/W) */
370#define VR4181_USBSTPREG __preg16(KSEG1 + 0x0B00078C) /* USB Transfer Stop Register (R/W) */
371
372// LCD Controller
373#define VR4181_HRTOTALREG __preg16(KSEG1 + 0x0A000400) /* Horizontal total Register (R/W) */
374#define VR4181_HRVISIBREG __preg16(KSEG1 + 0x0A000402) /* Horizontal Visible Register (R/W) */
375#define VR4181_LDCLKSTREG __preg16(KSEG1 + 0x0A000404) /* Load clock start Register (R/W) */
376#define VR4181_LDCLKNDREG __preg16(KSEG1 + 0x0A000406) /* Load clock end Register (R/W) */
377#define VR4181_VRTOTALREG __preg16(KSEG1 + 0x0A000408) /* Vertical Total Register (R/W) */
378#define VR4181_VRVISIBREG __preg16(KSEG1 + 0x0A00040A) /* Vertical Visible Register (R/W) */
379#define VR4181_FVSTARTREG __preg16(KSEG1 + 0x0A00040C) /* FLM vertical start Register (R/W) */
380#define VR4181_FVENDREG __preg16(KSEG1 + 0x0A00040E) /* FLM vertical end Register (R/W) */
381#define VR4181_LCDCTRLREG __preg16(KSEG1 + 0x0A000410) /* LCD control Register (R/W) */
382#define VR4181_LCDINRQREG __preg16(KSEG1 + 0x0A000412) /* LCD Interrupt request Register (R/W) */
383#define VR4181_LCDCFGREG0 __preg16(KSEG1 + 0x0A000414) /* LCD Configuration Register 0 (R/W) */
384#define VR4181_LCDCFGREG1 __preg16(KSEG1 + 0x0A000416) /* LCD Configuration Register 1 (R/W) */
385#define VR4181_FBSTAD1REG __preg16(KSEG1 + 0x0A000418) /* Frame Buffer Start Address 1 Register (R/W) */
386#define VR4181_FBSTAD2REG __preg16(KSEG1 + 0x0A00041A) /* Frame Buffer Start Address 2 Register (R/W) */
387#define VR4181_FBNDAD1REG __preg16(KSEG1 + 0x0A000420) /* Frame Buffer End Address 1 Register (R/W) */
388#define VR4181_FBNDAD2REG __preg16(KSEG1 + 0x0A000422) /* Frame Buffer End Address 2 register (R/W) */
389#define VR4181_FHSTARTREG __preg16(KSEG1 + 0x0A000424) /* FLM horizontal Start Register (R/W) */
390#define VR4181_FHENDREG __preg16(KSEG1 + 0x0A000426) /* FLM horizontal End Register (R/W) */
391#define VR4181_PWRCONREG1 __preg16(KSEG1 + 0x0A000430) /* Power Control register 1 (R/W) */
392#define VR4181_PWRCONREG2 __preg16(KSEG1 + 0x0A000432) /* Power Control register 2 (R/W) */
393#define VR4181_LCDIMSKREG __preg16(KSEG1 + 0x0A000434) /* LCD Interrupt Mask register (R/W) */
394#define VR4181_CPINDCTREG __preg16(KSEG1 + 0x0A00047E) /* Color palette Index and control Register (R/W) */
395#define VR4181_CPALDATREG __preg32(KSEG1 + 0x0A000480) /* Color palette data register (32bits Register) (R/W) */
396
397// physical address spaces
398#define VR4181_LCD 0x0a000000
399#define VR4181_INTERNAL_IO_2 0x0b000000
400#define VR4181_INTERNAL_IO_1 0x0c000000
401#define VR4181_ISA_MEM 0x10000000
402#define VR4181_ISA_IO 0x14000000
403#define VR4181_ROM 0x18000000
404
405// This is the base address for IO port decoding to which the 16 bit IO port address
406// is added. Defining it to 0 will usually cause a kernel oops any time port IO is
407// attempted, which can be handy for turning up parts of the kernel that make
408// incorrect architecture assumptions (by assuming that everything acts like a PC),
409// but we need it correctly defined to use the PCMCIA/CF controller:
410#define VR4181_PORT_BASE (KSEG1 + VR4181_ISA_IO)
411#define VR4181_ISAMEM_BASE (KSEG1 + VR4181_ISA_MEM)
412
413#endif /* __ASM_VR4181_VR4181_H */
diff --git a/include/asm-mips/vr41xx/tb0287.h b/include/asm-mips/vr41xx/tb0287.h
new file mode 100644
index 000000000000..dd9832313afe
--- /dev/null
+++ b/include/asm-mips/vr41xx/tb0287.h
@@ -0,0 +1,43 @@
1/*
2 * tb0287.h, Include file for TANBAC TB0287 mini-ITX board.
3 *
4 * Copyright (C) 2005 Media Lab Inc. <ito@mlb.co.jp>
5 *
6 * This code is largely based on tb0219.h.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22#ifndef __TANBAC_TB0287_H
23#define __TANBAC_TB0287_H
24
25#include <asm/vr41xx/vr41xx.h>
26
27/*
28 * General-Purpose I/O Pin Number
29 */
30#define TB0287_PCI_SLOT_PIN 2
31#define TB0287_SM501_PIN 3
32#define TB0287_SIL680A_PIN 8
33#define TB0287_RTL8110_PIN 13
34
35/*
36 * Interrupt Number
37 */
38#define TB0287_PCI_SLOT_IRQ GIU_IRQ(TB0287_PCI_SLOT_PIN)
39#define TB0287_SM501_IRQ GIU_IRQ(TB0287_SM501_PIN)
40#define TB0287_SIL680A_IRQ GIU_IRQ(TB0287_SIL680A_PIN)
41#define TB0287_RTL8110_IRQ GIU_IRQ(TB0287_RTL8110_PIN)
42
43#endif /* __TANBAC_TB0287_H */
diff --git a/include/asm-mips/vr41xx/vr41xx.h b/include/asm-mips/vr41xx/vr41xx.h
index 7d41e44463f9..bd2723c30901 100644
--- a/include/asm-mips/vr41xx/vr41xx.h
+++ b/include/asm-mips/vr41xx/vr41xx.h
@@ -7,7 +7,7 @@
7 * Copyright (C) 2001, 2002 Paul Mundt 7 * Copyright (C) 2001, 2002 Paul Mundt
8 * Copyright (C) 2002 MontaVista Software, Inc. 8 * Copyright (C) 2002 MontaVista Software, Inc.
9 * Copyright (C) 2002 TimeSys Corp. 9 * Copyright (C) 2002 TimeSys Corp.
10 * Copyright (C) 2003-2004 Yoichi Yuasa <yuasa@hh.iij4u.or.jp> 10 * Copyright (C) 2003-2005 Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
11 * 11 *
12 * This program is free software; you can redistribute it and/or modify it 12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the 13 * under the terms of the GNU General Public License as published by the
@@ -79,11 +79,11 @@ extern void vr41xx_mask_clock(vr41xx_clock_t clock);
79#define MIPS_CPU_IRQ(x) (MIPS_CPU_IRQ_BASE + (x)) 79#define MIPS_CPU_IRQ(x) (MIPS_CPU_IRQ_BASE + (x))
80#define MIPS_SOFTINT0_IRQ MIPS_CPU_IRQ(0) 80#define MIPS_SOFTINT0_IRQ MIPS_CPU_IRQ(0)
81#define MIPS_SOFTINT1_IRQ MIPS_CPU_IRQ(1) 81#define MIPS_SOFTINT1_IRQ MIPS_CPU_IRQ(1)
82#define INT0_CASCADE_IRQ MIPS_CPU_IRQ(2) 82#define INT0_IRQ MIPS_CPU_IRQ(2)
83#define INT1_CASCADE_IRQ MIPS_CPU_IRQ(3) 83#define INT1_IRQ MIPS_CPU_IRQ(3)
84#define INT2_CASCADE_IRQ MIPS_CPU_IRQ(4) 84#define INT2_IRQ MIPS_CPU_IRQ(4)
85#define INT3_CASCADE_IRQ MIPS_CPU_IRQ(5) 85#define INT3_IRQ MIPS_CPU_IRQ(5)
86#define INT4_CASCADE_IRQ MIPS_CPU_IRQ(6) 86#define INT4_IRQ MIPS_CPU_IRQ(6)
87#define TIMER_IRQ MIPS_CPU_IRQ(7) 87#define TIMER_IRQ MIPS_CPU_IRQ(7)
88 88
89/* SYINT1 Interrupt Numbers */ 89/* SYINT1 Interrupt Numbers */
@@ -97,7 +97,7 @@ extern void vr41xx_mask_clock(vr41xx_clock_t clock);
97#define PIU_IRQ SYSINT1_IRQ(5) 97#define PIU_IRQ SYSINT1_IRQ(5)
98#define AIU_IRQ SYSINT1_IRQ(6) 98#define AIU_IRQ SYSINT1_IRQ(6)
99#define KIU_IRQ SYSINT1_IRQ(7) 99#define KIU_IRQ SYSINT1_IRQ(7)
100#define GIUINT_CASCADE_IRQ SYSINT1_IRQ(8) 100#define GIUINT_IRQ SYSINT1_IRQ(8)
101#define SIU_IRQ SYSINT1_IRQ(9) 101#define SIU_IRQ SYSINT1_IRQ(9)
102#define BUSERR_IRQ SYSINT1_IRQ(10) 102#define BUSERR_IRQ SYSINT1_IRQ(10)
103#define SOFTINT_IRQ SYSINT1_IRQ(11) 103#define SOFTINT_IRQ SYSINT1_IRQ(11)
@@ -128,7 +128,7 @@ extern void vr41xx_mask_clock(vr41xx_clock_t clock);
128#define GIU_IRQ_LAST GIU_IRQ(31) 128#define GIU_IRQ_LAST GIU_IRQ(31)
129 129
130extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign); 130extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign);
131extern int vr41xx_cascade_irq(unsigned int irq, int (*get_irq_number)(int irq)); 131extern int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int, struct pt_regs *));
132 132
133#define PIUINT_COMMAND 0x0040 133#define PIUINT_COMMAND 0x0040
134#define PIUINT_DATA 0x0020 134#define PIUINT_DATA 0x0020
diff --git a/include/asm-mips/vr41xx/vrc4173.h b/include/asm-mips/vr41xx/vrc4173.h
index 58e193c51b45..bb7a85c186e4 100644
--- a/include/asm-mips/vr41xx/vrc4173.h
+++ b/include/asm-mips/vr41xx/vrc4173.h
@@ -21,8 +21,8 @@
21 * along with this program; if not, write to the Free Software 21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */ 23 */
24#ifndef __NEC_VRC4173_H 24#ifndef __NEC_VRC4173_H
25#define __NEC_VRC4173_H 25#define __NEC_VRC4173_H
26 26
27#include <linux/config.h> 27#include <linux/config.h>
28#include <asm/io.h> 28#include <asm/io.h>
diff --git a/include/asm-mips/war.h b/include/asm-mips/war.h
index c4a704121343..04ee53b34c2e 100644
--- a/include/asm-mips/war.h
+++ b/include/asm-mips/war.h
@@ -113,7 +113,7 @@
113 */ 113 */
114#define BCM1250_M3_WAR 1 114#define BCM1250_M3_WAR 1
115 115
116/* 116/*
117 * This is a DUART workaround related to glitches around register accesses 117 * This is a DUART workaround related to glitches around register accesses
118 */ 118 */
119#define SIBYTE_1956_WAR 1 119#define SIBYTE_1956_WAR 1
@@ -122,7 +122,7 @@
122 122
123/* 123/*
124 * Fill buffers not flushed on CACHE instructions 124 * Fill buffers not flushed on CACHE instructions
125 * 125 *
126 * Hit_Invalidate_I cacheops invalidate an icache line but the refill 126 * Hit_Invalidate_I cacheops invalidate an icache line but the refill
127 * for that line can get stale data from the fill buffer instead of 127 * for that line can get stale data from the fill buffer instead of
128 * accessing memory if the previous icache miss was also to that line. 128 * accessing memory if the previous icache miss was also to that line.
diff --git a/include/asm-mips/xxs1500.h b/include/asm-mips/xxs1500.h
index 75c0ddfeca13..4d84a90b0f20 100644
--- a/include/asm-mips/xxs1500.h
+++ b/include/asm-mips/xxs1500.h
@@ -22,7 +22,7 @@
22 * 22 *
23 * ######################################################################## 23 * ########################################################################
24 * 24 *
25 * 25 *
26 */ 26 */
27#ifndef __ASM_XXS1500_H 27#ifndef __ASM_XXS1500_H
28#define __ASM_XXS1500_H 28#define __ASM_XXS1500_H
diff --git a/include/asm-parisc/assembly.h b/include/asm-parisc/assembly.h
index cbc286f49b36..30b023411fef 100644
--- a/include/asm-parisc/assembly.h
+++ b/include/asm-parisc/assembly.h
@@ -63,7 +63,7 @@
63 .level 2.0w 63 .level 2.0w
64#endif 64#endif
65 65
66#include <asm/offsets.h> 66#include <asm/asm-offsets.h>
67#include <asm/page.h> 67#include <asm/page.h>
68 68
69#include <asm/asmregs.h> 69#include <asm/asmregs.h>
diff --git a/include/asm-parisc/auxvec.h b/include/asm-parisc/auxvec.h
new file mode 100644
index 000000000000..9c3ac4b89dc9
--- /dev/null
+++ b/include/asm-parisc/auxvec.h
@@ -0,0 +1,4 @@
1#ifndef __ASMPARISC_AUXVEC_H
2#define __ASMPARISC_AUXVEC_H
3
4#endif
diff --git a/include/asm-parisc/compat.h b/include/asm-parisc/compat.h
index 7630d1ad2391..38b918feead9 100644
--- a/include/asm-parisc/compat.h
+++ b/include/asm-parisc/compat.h
@@ -13,8 +13,10 @@ typedef s32 compat_ssize_t;
13typedef s32 compat_time_t; 13typedef s32 compat_time_t;
14typedef s32 compat_clock_t; 14typedef s32 compat_clock_t;
15typedef s32 compat_pid_t; 15typedef s32 compat_pid_t;
16typedef u32 compat_uid_t; 16typedef u32 __compat_uid_t;
17typedef u32 compat_gid_t; 17typedef u32 __compat_gid_t;
18typedef u32 __compat_uid32_t;
19typedef u32 __compat_gid32_t;
18typedef u16 compat_mode_t; 20typedef u16 compat_mode_t;
19typedef u32 compat_ino_t; 21typedef u32 compat_ino_t;
20typedef u32 compat_dev_t; 22typedef u32 compat_dev_t;
@@ -67,8 +69,8 @@ struct compat_stat {
67 compat_dev_t st_realdev; 69 compat_dev_t st_realdev;
68 u16 st_basemode; 70 u16 st_basemode;
69 u16 st_spareshort; 71 u16 st_spareshort;
70 compat_uid_t st_uid; 72 __compat_uid32_t st_uid;
71 compat_gid_t st_gid; 73 __compat_gid32_t st_gid;
72 u32 st_spare4[3]; 74 u32 st_spare4[3];
73}; 75};
74 76
diff --git a/include/asm-parisc/fcntl.h b/include/asm-parisc/fcntl.h
index def35230716a..317851fa78f3 100644
--- a/include/asm-parisc/fcntl.h
+++ b/include/asm-parisc/fcntl.h
@@ -3,38 +3,22 @@
3 3
4/* open/fcntl - O_SYNC is only implemented on blocks devices and on files 4/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
5 located on an ext2 file system */ 5 located on an ext2 file system */
6#define O_ACCMODE 00000003
7#define O_RDONLY 00000000
8#define O_WRONLY 00000001
9#define O_RDWR 00000002
10#define O_APPEND 00000010 6#define O_APPEND 00000010
11#define O_BLKSEEK 00000100 /* HPUX only */ 7#define O_BLKSEEK 00000100 /* HPUX only */
12#define O_CREAT 00000400 /* not fcntl */ 8#define O_CREAT 00000400 /* not fcntl */
13#define O_TRUNC 00001000 /* not fcntl */
14#define O_EXCL 00002000 /* not fcntl */ 9#define O_EXCL 00002000 /* not fcntl */
15#define O_LARGEFILE 00004000 10#define O_LARGEFILE 00004000
16#define O_SYNC 00100000 11#define O_SYNC 00100000
17#define O_NONBLOCK 00200004 /* HPUX has separate NDELAY & NONBLOCK */ 12#define O_NONBLOCK 00200004 /* HPUX has separate NDELAY & NONBLOCK */
18#define O_NDELAY O_NONBLOCK
19#define O_NOCTTY 00400000 /* not fcntl */ 13#define O_NOCTTY 00400000 /* not fcntl */
20#define O_DSYNC 01000000 /* HPUX only */ 14#define O_DSYNC 01000000 /* HPUX only */
21#define O_RSYNC 02000000 /* HPUX only */ 15#define O_RSYNC 02000000 /* HPUX only */
22#define O_NOATIME 04000000 16#define O_NOATIME 04000000
23 17
24#define FASYNC 00020000 /* fcntl, for BSD compatibility */
25#define O_DIRECT 00040000 /* direct disk access hint - currently ignored */
26#define O_DIRECTORY 00010000 /* must be a directory */ 18#define O_DIRECTORY 00010000 /* must be a directory */
27#define O_NOFOLLOW 00000200 /* don't follow links */ 19#define O_NOFOLLOW 00000200 /* don't follow links */
28#define O_INVISIBLE 04000000 /* invisible I/O, for DMAPI/XDSM */ 20#define O_INVISIBLE 04000000 /* invisible I/O, for DMAPI/XDSM */
29 21
30#define F_DUPFD 0 /* dup */
31#define F_GETFD 1 /* get f_flags */
32#define F_SETFD 2 /* set f_flags */
33#define F_GETFL 3 /* more flags (cloexec) */
34#define F_SETFL 4
35#define F_GETLK 5
36#define F_SETLK 6
37#define F_SETLKW 7
38#define F_GETLK64 8 22#define F_GETLK64 8
39#define F_SETLK64 9 23#define F_SETLK64 9
40#define F_SETLKW64 10 24#define F_SETLKW64 10
@@ -44,49 +28,11 @@
44#define F_SETSIG 13 /* for sockets. */ 28#define F_SETSIG 13 /* for sockets. */
45#define F_GETSIG 14 /* for sockets. */ 29#define F_GETSIG 14 /* for sockets. */
46 30
47/* for F_[GET|SET]FL */
48#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
49
50/* for posix fcntl() and lockf() */ 31/* for posix fcntl() and lockf() */
51#define F_RDLCK 01 32#define F_RDLCK 01
52#define F_WRLCK 02 33#define F_WRLCK 02
53#define F_UNLCK 03 34#define F_UNLCK 03
54 35
55/* for old implementation of bsd flock () */ 36#include <asm-generic/fcntl.h>
56#define F_EXLCK 4 /* or 3 */
57#define F_SHLCK 8 /* or 4 */
58
59/* for leases */
60#define F_INPROGRESS 16
61
62/* operations for bsd flock(), also used by the kernel implementation */
63#define LOCK_SH 1 /* shared lock */
64#define LOCK_EX 2 /* exclusive lock */
65#define LOCK_NB 4 /* or'd with one of the above to prevent
66 blocking */
67#define LOCK_UN 8 /* remove lock */
68
69#define LOCK_MAND 32 /* This is a mandatory flock */
70#define LOCK_READ 64 /* ... Which allows concurrent read operations */
71#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
72#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
73
74struct flock {
75 short l_type;
76 short l_whence;
77 off_t l_start;
78 off_t l_len;
79 pid_t l_pid;
80};
81
82struct flock64 {
83 short l_type;
84 short l_whence;
85 loff_t l_start;
86 loff_t l_len;
87 pid_t l_pid;
88};
89
90#define F_LINUX_SPECIFIC_BASE 1024
91 37
92#endif 38#endif
diff --git a/include/asm-parisc/futex.h b/include/asm-parisc/futex.h
new file mode 100644
index 000000000000..2cac5ecd9d00
--- /dev/null
+++ b/include/asm-parisc/futex.h
@@ -0,0 +1,53 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/uaccess.h>
9
10static inline int
11futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
12{
13 int op = (encoded_op >> 28) & 7;
14 int cmp = (encoded_op >> 24) & 15;
15 int oparg = (encoded_op << 8) >> 20;
16 int cmparg = (encoded_op << 20) >> 20;
17 int oldval = 0, ret, tem;
18 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
19 oparg = 1 << oparg;
20
21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
22 return -EFAULT;
23
24 inc_preempt_count();
25
26 switch (op) {
27 case FUTEX_OP_SET:
28 case FUTEX_OP_ADD:
29 case FUTEX_OP_OR:
30 case FUTEX_OP_ANDN:
31 case FUTEX_OP_XOR:
32 default:
33 ret = -ENOSYS;
34 }
35
36 dec_preempt_count();
37
38 if (!ret) {
39 switch (cmp) {
40 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
41 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
42 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
43 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
44 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
45 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
46 default: ret = -ENOSYS;
47 }
48 }
49 return ret;
50}
51
52#endif
53#endif
diff --git a/include/asm-parisc/hdreg.h b/include/asm-parisc/hdreg.h
deleted file mode 100644
index 7f7fd1af0af3..000000000000
--- a/include/asm-parisc/hdreg.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/hdreg.h>
diff --git a/include/asm-parisc/irq.h b/include/asm-parisc/irq.h
index 75654ba93353..f876bdf22056 100644
--- a/include/asm-parisc/irq.h
+++ b/include/asm-parisc/irq.h
@@ -26,6 +26,11 @@
26 26
27#define NR_IRQS (CPU_IRQ_MAX + 1) 27#define NR_IRQS (CPU_IRQ_MAX + 1)
28 28
29/*
30 * IRQ line status macro IRQ_PER_CPU is used
31 */
32#define ARCH_HAS_IRQ_PER_CPU
33
29static __inline__ int irq_canonicalize(int irq) 34static __inline__ int irq_canonicalize(int irq)
30{ 35{
31 return (irq == 2) ? 9 : irq; 36 return (irq == 2) ? 9 : irq;
diff --git a/include/asm-parisc/page.h b/include/asm-parisc/page.h
index 4a12692f94b4..44eae9f8274d 100644
--- a/include/asm-parisc/page.h
+++ b/include/asm-parisc/page.h
@@ -74,20 +74,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
74#define __pgd(x) ((pgd_t) { (x) } ) 74#define __pgd(x) ((pgd_t) { (x) } )
75#define __pgprot(x) ((pgprot_t) { (x) } ) 75#define __pgprot(x) ((pgprot_t) { (x) } )
76 76
77/* Pure 2^n version of get_order */
78extern __inline__ int get_order(unsigned long size)
79{
80 int order;
81
82 size = (size-1) >> (PAGE_SHIFT-1);
83 order = -1;
84 do {
85 size >>= 1;
86 order++;
87 } while (size);
88 return order;
89}
90
91typedef struct __physmem_range { 77typedef struct __physmem_range {
92 unsigned long start_pfn; 78 unsigned long start_pfn;
93 unsigned long pages; /* PAGE_SIZE pages */ 79 unsigned long pages; /* PAGE_SIZE pages */
@@ -159,4 +145,6 @@ extern int npmem_ranges;
159 145
160#endif /* __KERNEL__ */ 146#endif /* __KERNEL__ */
161 147
148#include <asm-generic/page.h>
149
162#endif /* _PARISC_PAGE_H */ 150#endif /* _PARISC_PAGE_H */
diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h
index 98d79a3d54fa..d0b761f690b5 100644
--- a/include/asm-parisc/pci.h
+++ b/include/asm-parisc/pci.h
@@ -257,6 +257,19 @@ extern void
257pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, 257pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
258 struct pci_bus_region *region); 258 struct pci_bus_region *region);
259 259
260static inline struct resource *
261pcibios_select_root(struct pci_dev *pdev, struct resource *res)
262{
263 struct resource *root = NULL;
264
265 if (res->flags & IORESOURCE_IO)
266 root = &ioport_resource;
267 if (res->flags & IORESOURCE_MEM)
268 root = &iomem_resource;
269
270 return root;
271}
272
260static inline void pcibios_add_platform_entries(struct pci_dev *dev) 273static inline void pcibios_add_platform_entries(struct pci_dev *dev)
261{ 274{
262} 275}
diff --git a/include/asm-parisc/types.h b/include/asm-parisc/types.h
index 8fe7a44ea205..d21b9d0d63ea 100644
--- a/include/asm-parisc/types.h
+++ b/include/asm-parisc/types.h
@@ -56,8 +56,6 @@ typedef unsigned long long u64;
56typedef u32 dma_addr_t; 56typedef u32 dma_addr_t;
57typedef u64 dma64_addr_t; 57typedef u64 dma64_addr_t;
58 58
59typedef unsigned int kmem_bufctl_t;
60
61#endif /* __ASSEMBLY__ */ 59#endif /* __ASSEMBLY__ */
62 60
63#endif /* __KERNEL__ */ 61#endif /* __KERNEL__ */
diff --git a/include/asm-parisc/uaccess.h b/include/asm-parisc/uaccess.h
index c1b5bdea53ee..f6c417c8c484 100644
--- a/include/asm-parisc/uaccess.h
+++ b/include/asm-parisc/uaccess.h
@@ -40,10 +40,6 @@ static inline long access_ok(int type, const void __user * addr,
40 return 1; 40 return 1;
41} 41}
42 42
43#define verify_area(type,addr,size) (0) /* FIXME: all users should go away soon,
44 * and use access_ok instead, then this
45 * should be removed. */
46
47#define put_user __put_user 43#define put_user __put_user
48#define get_user __get_user 44#define get_user __get_user
49 45
diff --git a/include/asm-powerpc/8253pit.h b/include/asm-powerpc/8253pit.h
index 862708a749b0..b70d6e53b303 100644
--- a/include/asm-powerpc/8253pit.h
+++ b/include/asm-powerpc/8253pit.h
@@ -1,10 +1,10 @@
1#ifndef _ASM_POWERPC_8253PIT_H
2#define _ASM_POWERPC_8253PIT_H
3
1/* 4/*
2 * 8253/8254 Programmable Interval Timer 5 * 8253/8254 Programmable Interval Timer
3 */ 6 */
4 7
5#ifndef _8253PIT_H
6#define _8253PIT_H
7
8#define PIT_TICK_RATE 1193182UL 8#define PIT_TICK_RATE 1193182UL
9 9
10#endif 10#endif /* _ASM_POWERPC_8253PIT_H */
diff --git a/include/asm-powerpc/agp.h b/include/asm-powerpc/agp.h
index ca9e423307f4..885b4631a6cf 100644
--- a/include/asm-powerpc/agp.h
+++ b/include/asm-powerpc/agp.h
@@ -1,10 +1,8 @@
1#ifndef AGP_H 1#ifndef _ASM_POWERPC_AGP_H
2#define AGP_H 1 2#define _ASM_POWERPC_AGP_H
3 3
4#include <asm/io.h> 4#include <asm/io.h>
5 5
6/* nothing much needed here */
7
8#define map_page_into_agp(page) 6#define map_page_into_agp(page)
9#define unmap_page_from_agp(page) 7#define unmap_page_from_agp(page)
10#define flush_agp_mappings() 8#define flush_agp_mappings()
@@ -20,4 +18,4 @@
20#define free_gatt_pages(table, order) \ 18#define free_gatt_pages(table, order) \
21 free_pages((unsigned long)(table), (order)) 19 free_pages((unsigned long)(table), (order))
22 20
23#endif 21#endif /* _ASM_POWERPC_AGP_H */
diff --git a/include/asm-powerpc/bugs.h b/include/asm-powerpc/bugs.h
new file mode 100644
index 000000000000..42fdb73e3068
--- /dev/null
+++ b/include/asm-powerpc/bugs.h
@@ -0,0 +1,18 @@
1#ifndef _ASM_POWERPC_BUGS_H
2#define _ASM_POWERPC_BUGS_H
3
4/*
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11/*
12 * This file is included by 'init/main.c' to check for
13 * architecture-dependent bugs.
14 */
15
16static inline void check_bugs(void) { }
17
18#endif /* _ASM_POWERPC_BUGS_H */
diff --git a/include/asm-powerpc/errno.h b/include/asm-powerpc/errno.h
index 19f20bd41ae6..8c145fd17d86 100644
--- a/include/asm-powerpc/errno.h
+++ b/include/asm-powerpc/errno.h
@@ -1,5 +1,5 @@
1#ifndef _PPC_ERRNO_H 1#ifndef _ASM_POWERPC_ERRNO_H
2#define _PPC_ERRNO_H 2#define _ASM_POWERPC_ERRNO_H
3 3
4#include <asm-generic/errno.h> 4#include <asm-generic/errno.h>
5 5
@@ -8,4 +8,4 @@
8 8
9#define _LAST_ERRNO 516 9#define _LAST_ERRNO 516
10 10
11#endif 11#endif /* _ASM_POWERPC_ERRNO_H */
diff --git a/include/asm-powerpc/fcntl.h b/include/asm-powerpc/fcntl.h
new file mode 100644
index 000000000000..ce5c4516d404
--- /dev/null
+++ b/include/asm-powerpc/fcntl.h
@@ -0,0 +1,11 @@
1#ifndef _ASM_FCNTL_H
2#define _ASM_FCNTL_H
3
4#define O_DIRECTORY 040000 /* must be a directory */
5#define O_NOFOLLOW 0100000 /* don't follow links */
6#define O_LARGEFILE 0200000
7#define O_DIRECT 0400000 /* direct disk access hint */
8
9#include <asm-generic/fcntl.h>
10
11#endif /* _ASM_FCNTL_H */
diff --git a/include/asm-powerpc/ioctl.h b/include/asm-powerpc/ioctl.h
index 93c6acfdd0fd..8eb99848c402 100644
--- a/include/asm-powerpc/ioctl.h
+++ b/include/asm-powerpc/ioctl.h
@@ -1,5 +1,5 @@
1#ifndef _PPC_IOCTL_H 1#ifndef _ASM_POWERPC_IOCTL_H
2#define _PPC_IOCTL_H 2#define _ASM_POWERPC_IOCTL_H
3 3
4 4
5/* 5/*
@@ -66,4 +66,4 @@ extern unsigned int __invalid_size_argument_for_IOC;
66#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) 66#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
67#define IOCSIZE_SHIFT (_IOC_SIZESHIFT) 67#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
68 68
69#endif 69#endif /* _ASM_POWERPC_IOCTL_H */
diff --git a/include/asm-powerpc/ioctls.h b/include/asm-powerpc/ioctls.h
index f5b7f2b055e7..5b94ff489b8b 100644
--- a/include/asm-powerpc/ioctls.h
+++ b/include/asm-powerpc/ioctls.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_PPC_IOCTLS_H 1#ifndef _ASM_POWERPC_IOCTLS_H
2#define _ASM_PPC_IOCTLS_H 2#define _ASM_POWERPC_IOCTLS_H
3 3
4#include <asm/ioctl.h> 4#include <asm/ioctl.h>
5 5
@@ -104,4 +104,4 @@
104#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */ 104#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
105#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ 105#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
106 106
107#endif /* _ASM_PPC_IOCTLS_H */ 107#endif /* _ASM_POWERPC_IOCTLS_H */
diff --git a/include/asm-powerpc/linkage.h b/include/asm-powerpc/linkage.h
index 291c2d01c44f..e1c4ac1cc4ba 100644
--- a/include/asm-powerpc/linkage.h
+++ b/include/asm-powerpc/linkage.h
@@ -1,6 +1,6 @@
1#ifndef __ASM_LINKAGE_H 1#ifndef _ASM_POWERPC_LINKAGE_H
2#define __ASM_LINKAGE_H 2#define _ASM_POWERPC_LINKAGE_H
3 3
4/* Nothing to see here... */ 4/* Nothing to see here... */
5 5
6#endif 6#endif /* _ASM_POWERPC_LINKAGE_H */
diff --git a/include/asm-ppc64/mc146818rtc.h b/include/asm-powerpc/mc146818rtc.h
index f713e1bbb533..f2741c8b59a1 100644
--- a/include/asm-ppc64/mc146818rtc.h
+++ b/include/asm-powerpc/mc146818rtc.h
@@ -1,3 +1,6 @@
1#ifndef _ASM_POWERPC_MC146818RTC_H
2#define _ASM_POWERPC_MC146818RTC_H
3
1/* 4/*
2 * Machine dependent access functions for RTC registers. 5 * Machine dependent access functions for RTC registers.
3 * 6 *
@@ -6,8 +9,8 @@
6 * as published by the Free Software Foundation; either version 9 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
8 */ 11 */
9#ifndef __ASM_PPC64_MC146818RTC_H 12
10#define __ASM_PPC64_MC146818RTC_H 13#ifdef __KERNEL__
11 14
12#include <asm/io.h> 15#include <asm/io.h>
13 16
@@ -29,4 +32,5 @@ outb_p((addr),RTC_PORT(0)); \
29outb_p((val),RTC_PORT(1)); \ 32outb_p((val),RTC_PORT(1)); \
30}) 33})
31 34
32#endif /* __ASM_PPC64_MC146818RTC_H */ 35#endif /* __KERNEL__ */
36#endif /* _ASM_POWERPC_MC146818RTC_H */
diff --git a/include/asm-ppc64/mman.h b/include/asm-powerpc/mman.h
index d4f93446a52c..f5e5342fcac5 100644
--- a/include/asm-ppc64/mman.h
+++ b/include/asm-powerpc/mman.h
@@ -1,5 +1,5 @@
1#ifndef __PPC64_MMAN_H__ 1#ifndef _ASM_POWERPC_MMAN_H
2#define __PPC64_MMAN_H__ 2#define _ASM_POWERPC_MMAN_H
3 3
4/* 4/*
5 * This program is free software; you can redistribute it and/or 5 * This program is free software; you can redistribute it and/or
@@ -49,4 +49,4 @@
49#define MAP_ANON MAP_ANONYMOUS 49#define MAP_ANON MAP_ANONYMOUS
50#define MAP_FILE 0 50#define MAP_FILE 0
51 51
52#endif /* __PPC64_MMAN_H__ */ 52#endif /* _ASM_POWERPC_MMAN_H */
diff --git a/include/asm-powerpc/module.h b/include/asm-powerpc/module.h
new file mode 100644
index 000000000000..7ecd05e03051
--- /dev/null
+++ b/include/asm-powerpc/module.h
@@ -0,0 +1,77 @@
1#ifndef _ASM_POWERPC_MODULE_H
2#define _ASM_POWERPC_MODULE_H
3
4/*
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#include <linux/list.h>
12#include <asm/bug.h>
13
14
15#ifndef __powerpc64__
16/*
17 * Thanks to Paul M for explaining this.
18 *
19 * PPC can only do rel jumps += 32MB, and often the kernel and other
20 * modules are furthur away than this. So, we jump to a table of
21 * trampolines attached to the module (the Procedure Linkage Table)
22 * whenever that happens.
23 */
24
25struct ppc_plt_entry {
26 /* 16 byte jump instruction sequence (4 instructions) */
27 unsigned int jump[4];
28};
29#endif /* __powerpc64__ */
30
31
32struct mod_arch_specific {
33#ifdef __powerpc64__
34 unsigned int stubs_section; /* Index of stubs section in module */
35 unsigned int toc_section; /* What section is the TOC? */
36#else
37 /* Indices of PLT sections within module. */
38 unsigned int core_plt_section;
39 unsigned int init_plt_section;
40#endif
41
42 /* List of BUG addresses, source line numbers and filenames */
43 struct list_head bug_list;
44 struct bug_entry *bug_table;
45 unsigned int num_bugs;
46};
47
48extern struct bug_entry *module_find_bug(unsigned long bugaddr);
49
50/*
51 * Select ELF headers.
52 * Make empty section for module_frob_arch_sections to expand.
53 */
54
55#ifdef __powerpc64__
56# define Elf_Shdr Elf64_Shdr
57# define Elf_Sym Elf64_Sym
58# define Elf_Ehdr Elf64_Ehdr
59# ifdef MODULE
60 asm(".section .stubs,\"ax\",@nobits; .align 3; .previous");
61# endif
62#else
63# define Elf_Shdr Elf32_Shdr
64# define Elf_Sym Elf32_Sym
65# define Elf_Ehdr Elf32_Ehdr
66# ifdef MODULE
67 asm(".section .plt,\"ax\",@nobits; .align 3; .previous");
68 asm(".section .init.plt,\"ax\",@nobits; .align 3; .previous");
69# endif /* MODULE */
70#endif
71
72
73struct exception_table_entry;
74void sort_ex_table(struct exception_table_entry *start,
75 struct exception_table_entry *finish);
76
77#endif /* _ASM_POWERPC_MODULE_H */
diff --git a/include/asm-ppc/msgbuf.h b/include/asm-powerpc/msgbuf.h
index 1053452a9376..dd76743c7537 100644
--- a/include/asm-ppc/msgbuf.h
+++ b/include/asm-powerpc/msgbuf.h
@@ -1,17 +1,25 @@
1#ifndef _PPC_MSGBUF_H 1#ifndef _ASM_POWERPC_MSGBUF_H
2#define _PPC_MSGBUF_H 2#define _ASM_POWERPC_MSGBUF_H
3 3
4/* 4/*
5 * The msqid64_ds structure for the PPC architecture. 5 * The msqid64_ds structure for the PowerPC architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
6 */ 8 */
7 9
8struct msqid64_ds { 10struct msqid64_ds {
9 struct ipc64_perm msg_perm; 11 struct ipc64_perm msg_perm;
12#ifndef __powerpc64__
10 unsigned int __unused1; 13 unsigned int __unused1;
14#endif
11 __kernel_time_t msg_stime; /* last msgsnd time */ 15 __kernel_time_t msg_stime; /* last msgsnd time */
16#ifndef __powerpc64__
12 unsigned int __unused2; 17 unsigned int __unused2;
18#endif
13 __kernel_time_t msg_rtime; /* last msgrcv time */ 19 __kernel_time_t msg_rtime; /* last msgrcv time */
20#ifndef __powerpc64__
14 unsigned int __unused3; 21 unsigned int __unused3;
22#endif
15 __kernel_time_t msg_ctime; /* last change time */ 23 __kernel_time_t msg_ctime; /* last change time */
16 unsigned long msg_cbytes; /* current number of bytes on queue */ 24 unsigned long msg_cbytes; /* current number of bytes on queue */
17 unsigned long msg_qnum; /* number of messages in queue */ 25 unsigned long msg_qnum; /* number of messages in queue */
@@ -22,4 +30,4 @@ struct msqid64_ds {
22 unsigned long __unused5; 30 unsigned long __unused5;
23}; 31};
24 32
25#endif /* _PPC_MSGBUF_H */ 33#endif /* _ASM_POWERPC_MSGBUF_H */
diff --git a/include/asm-powerpc/namei.h b/include/asm-powerpc/namei.h
index 29c9ec832133..657443474a6a 100644
--- a/include/asm-powerpc/namei.h
+++ b/include/asm-powerpc/namei.h
@@ -1,14 +1,14 @@
1#ifndef _ASM_POWERPC_NAMEI_H
2#define _ASM_POWERPC_NAMEI_H
3
4#ifdef __KERNEL__
5
1/* 6/*
2 * include/asm-ppc/namei.h
3 * Adapted from include/asm-alpha/namei.h 7 * Adapted from include/asm-alpha/namei.h
4 * 8 *
5 * Included from fs/namei.c 9 * Included from fs/namei.c
6 */ 10 */
7 11
8#ifdef __KERNEL__
9#ifndef __PPC_NAMEI_H
10#define __PPC_NAMEI_H
11
12/* This dummy routine maybe changed to something useful 12/* This dummy routine maybe changed to something useful
13 * for /usr/gnemul/ emulation stuff. 13 * for /usr/gnemul/ emulation stuff.
14 * Look at asm-sparc/namei.h for details. 14 * Look at asm-sparc/namei.h for details.
@@ -16,5 +16,5 @@
16 16
17#define __emul_prefix() NULL 17#define __emul_prefix() NULL
18 18
19#endif /* __PPC_NAMEI_H */ 19#endif /* __KERNEL__ */
20#endif /* __KERNEL__ */ 20#endif /* _ASM_POWERPC_NAMEI_H */
diff --git a/include/asm-ppc/param.h b/include/asm-powerpc/param.h
index b24a4e37196a..bdc724f70884 100644
--- a/include/asm-ppc/param.h
+++ b/include/asm-powerpc/param.h
@@ -1,8 +1,10 @@
1#ifndef _ASM_PPC_PARAM_H 1#ifndef _ASM_POWERPC_PARAM_H
2#define _ASM_PPC_PARAM_H 2#define _ASM_POWERPC_PARAM_H
3
4#include <linux/config.h>
3 5
4#ifdef __KERNEL__ 6#ifdef __KERNEL__
5#define HZ 1000 /* internal timer frequency */ 7#define HZ CONFIG_HZ /* internal kernel timer frequency */
6#define USER_HZ 100 /* for user interfaces in "ticks" */ 8#define USER_HZ 100 /* for user interfaces in "ticks" */
7#define CLOCKS_PER_SEC (USER_HZ) /* frequency at which times() counts */ 9#define CLOCKS_PER_SEC (USER_HZ) /* frequency at which times() counts */
8#endif /* __KERNEL__ */ 10#endif /* __KERNEL__ */
@@ -19,4 +21,4 @@
19 21
20#define MAXHOSTNAMELEN 64 /* max length of hostname */ 22#define MAXHOSTNAMELEN 64 /* max length of hostname */
21 23
22#endif 24#endif /* _ASM_POWERPC_PARAM_H */
diff --git a/include/asm-powerpc/poll.h b/include/asm-powerpc/poll.h
index be5024913c62..edd2054da86b 100644
--- a/include/asm-powerpc/poll.h
+++ b/include/asm-powerpc/poll.h
@@ -1,5 +1,5 @@
1#ifndef __PPC_POLL_H 1#ifndef _ASM_POWERPC_POLL_H
2#define __PPC_POLL_H 2#define _ASM_POWERPC_POLL_H
3 3
4#define POLLIN 0x0001 4#define POLLIN 0x0001
5#define POLLPRI 0x0002 5#define POLLPRI 0x0002
@@ -20,4 +20,4 @@ struct pollfd {
20 short revents; 20 short revents;
21}; 21};
22 22
23#endif 23#endif /* _ASM_POWERPC_POLL_H */
diff --git a/include/asm-ppc64/sembuf.h b/include/asm-powerpc/sembuf.h
index 172e59000767..99a41938ae3d 100644
--- a/include/asm-ppc64/sembuf.h
+++ b/include/asm-powerpc/sembuf.h
@@ -1,27 +1,36 @@
1#ifndef _PPC64_SEMBUF_H 1#ifndef _ASM_POWERPC_SEMBUF_H
2#define _PPC64_SEMBUF_H 2#define _ASM_POWERPC_SEMBUF_H
3 3
4/* 4/*
5 * The semid64_ds structure for PPC architecture.
6 *
7 *
8 * This program is free software; you can redistribute it and/or 5 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License 6 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 7 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version. 8 * 2 of the License, or (at your option) any later version.
9 */
10
11/*
12 * The semid64_ds structure for PPC architecture.
13 * Note extra padding because this structure is passed back and forth
14 * between kernel and user space.
12 * 15 *
13 * Pad space is left for: 16 * Pad space is left for:
14 * - 2 miscellaneous 64-bit values 17 * - 64-bit time_t to solve y2038 problem
18 * - 2 miscellaneous 32-bit values
15 */ 19 */
16 20
17struct semid64_ds { 21struct semid64_ds {
18 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ 22 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
23#ifndef __powerpc64__
24 unsigned long __unused1;
25#endif
19 __kernel_time_t sem_otime; /* last semop time */ 26 __kernel_time_t sem_otime; /* last semop time */
27#ifndef __powerpc64__
28 unsigned long __unused2;
29#endif
20 __kernel_time_t sem_ctime; /* last change time */ 30 __kernel_time_t sem_ctime; /* last change time */
21 unsigned long sem_nsems; /* no. of semaphores in array */ 31 unsigned long sem_nsems; /* no. of semaphores in array */
22 32 unsigned long __unused3;
23 unsigned long __unused1; 33 unsigned long __unused4;
24 unsigned long __unused2;
25}; 34};
26 35
27#endif /* _PPC64_SEMBUF_H */ 36#endif /* _ASM_POWERPC_SEMBUF_H */
diff --git a/include/asm-powerpc/setup.h b/include/asm-powerpc/setup.h
new file mode 100644
index 000000000000..3d9740aae018
--- /dev/null
+++ b/include/asm-powerpc/setup.h
@@ -0,0 +1,9 @@
1#ifndef _ASM_POWERPC_SETUP_H
2#define _ASM_POWERPC_SETUP_H
3
4#ifdef __KERNEL__
5
6#define COMMAND_LINE_SIZE 512
7
8#endif /* __KERNEL__ */
9#endif /* _ASM_POWERPC_SETUP_H */
diff --git a/include/asm-ppc64/shmbuf.h b/include/asm-powerpc/shmbuf.h
index 02e99d6ec925..8efa39698b6c 100644
--- a/include/asm-ppc64/shmbuf.h
+++ b/include/asm-powerpc/shmbuf.h
@@ -1,31 +1,47 @@
1#ifndef _PPC64_SHMBUF_H 1#ifndef _ASM_POWERPC_SHMBUF_H
2#define _PPC64_SHMBUF_H 2#define _ASM_POWERPC_SHMBUF_H
3 3
4/* 4/*
5 * The shmid64_ds structure for PPC64 architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 2 miscellaneous 64-bit values
11 *
12 * This program is free software; you can redistribute it and/or 5 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License 6 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 7 * as published by the Free Software Foundation; either version
15 * 2 of the License, or (at your option) any later version. 8 * 2 of the License, or (at your option) any later version.
16 */ 9 */
17 10
11/*
12 * The shmid64_ds structure for PPC architecture.
13 *
14 * Note extra padding because this structure is passed back and forth
15 * between kernel and user space.
16 *
17 * Pad space is left for:
18 * - 64-bit time_t to solve y2038 problem
19 * - 2 miscellaneous 32-bit values
20 */
21
18struct shmid64_ds { 22struct shmid64_ds {
19 struct ipc64_perm shm_perm; /* operation perms */ 23 struct ipc64_perm shm_perm; /* operation perms */
24#ifndef __powerpc64__
25 unsigned long __unused1;
26#endif
20 __kernel_time_t shm_atime; /* last attach time */ 27 __kernel_time_t shm_atime; /* last attach time */
28#ifndef __powerpc64__
29 unsigned long __unused2;
30#endif
21 __kernel_time_t shm_dtime; /* last detach time */ 31 __kernel_time_t shm_dtime; /* last detach time */
32#ifndef __powerpc64__
33 unsigned long __unused3;
34#endif
22 __kernel_time_t shm_ctime; /* last change time */ 35 __kernel_time_t shm_ctime; /* last change time */
36#ifndef __powerpc64__
37 unsigned long __unused4;
38#endif
23 size_t shm_segsz; /* size of segment (bytes) */ 39 size_t shm_segsz; /* size of segment (bytes) */
24 __kernel_pid_t shm_cpid; /* pid of creator */ 40 __kernel_pid_t shm_cpid; /* pid of creator */
25 __kernel_pid_t shm_lpid; /* pid of last operator */ 41 __kernel_pid_t shm_lpid; /* pid of last operator */
26 unsigned long shm_nattch; /* no. of current attaches */ 42 unsigned long shm_nattch; /* no. of current attaches */
27 unsigned long __unused1; 43 unsigned long __unused5;
28 unsigned long __unused2; 44 unsigned long __unused6;
29}; 45};
30 46
31struct shminfo64 { 47struct shminfo64 {
@@ -40,4 +56,4 @@ struct shminfo64 {
40 unsigned long __unused4; 56 unsigned long __unused4;
41}; 57};
42 58
43#endif /* _PPC64_SHMBUF_H */ 59#endif /* _ASM_POWERPC_SHMBUF_H */
diff --git a/include/asm-powerpc/shmparam.h b/include/asm-powerpc/shmparam.h
index d6250602ae64..5cda42a6d39e 100644
--- a/include/asm-powerpc/shmparam.h
+++ b/include/asm-powerpc/shmparam.h
@@ -1,6 +1,6 @@
1#ifndef _PPC_SHMPARAM_H 1#ifndef _ASM_POWERPC_SHMPARAM_H
2#define _PPC_SHMPARAM_H 2#define _ASM_POWERPC_SHMPARAM_H
3 3
4#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */ 4#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */
5 5
6#endif /* _PPC_SHMPARAM_H */ 6#endif /* _ASM_POWERPC_SHMPARAM_H */
diff --git a/include/asm-ppc64/siginfo.h b/include/asm-powerpc/siginfo.h
index 3a7c23dcb5aa..538ea8ef509b 100644
--- a/include/asm-ppc64/siginfo.h
+++ b/include/asm-powerpc/siginfo.h
@@ -1,5 +1,5 @@
1#ifndef _PPC64_SIGINFO_H 1#ifndef _ASM_POWERPC_SIGINFO_H
2#define _PPC64_SIGINFO_H 2#define _ASM_POWERPC_SIGINFO_H
3 3
4/* 4/*
5 * This program is free software; you can redistribute it and/or 5 * This program is free software; you can redistribute it and/or
@@ -8,9 +8,11 @@
8 * 2 of the License, or (at your option) any later version. 8 * 2 of the License, or (at your option) any later version.
9 */ 9 */
10 10
11#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) 11#ifdef __powerpc64__
12#define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3) 12# define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
13# define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3)
14#endif
13 15
14#include <asm-generic/siginfo.h> 16#include <asm-generic/siginfo.h>
15 17
16#endif /* _PPC64_SIGINFO_H */ 18#endif /* _ASM_POWERPC_SIGINFO_H */
diff --git a/include/asm-ppc64/socket.h b/include/asm-powerpc/socket.h
index 9e1af8eb2d96..e4b8177d4acc 100644
--- a/include/asm-ppc64/socket.h
+++ b/include/asm-powerpc/socket.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_SOCKET_H 1#ifndef _ASM_POWERPC_SOCKET_H
2#define _ASM_SOCKET_H 2#define _ASM_POWERPC_SOCKET_H
3 3
4/* 4/*
5 * This program is free software; you can redistribute it and/or 5 * This program is free software; you can redistribute it and/or
@@ -10,7 +10,7 @@
10 10
11#include <asm/sockios.h> 11#include <asm/sockios.h>
12 12
13/* For setsockoptions(2) */ 13/* For setsockopt(2) */
14#define SOL_SOCKET 1 14#define SOL_SOCKET 1
15 15
16#define SO_DEBUG 1 16#define SO_DEBUG 1
@@ -52,8 +52,8 @@
52#define SO_TIMESTAMP 29 52#define SO_TIMESTAMP 29
53#define SCM_TIMESTAMP SO_TIMESTAMP 53#define SCM_TIMESTAMP SO_TIMESTAMP
54 54
55#define SO_ACCEPTCONN 30 55#define SO_ACCEPTCONN 30
56 56
57#define SO_PEERSEC 31 57#define SO_PEERSEC 31
58 58
59#endif /* _ASM_SOCKET_H */ 59#endif /* _ASM_POWERPC_SOCKET_H */
diff --git a/include/asm-ppc64/sockios.h b/include/asm-powerpc/sockios.h
index 6bd1a22af4f6..590078d8ed28 100644
--- a/include/asm-ppc64/sockios.h
+++ b/include/asm-powerpc/sockios.h
@@ -1,5 +1,5 @@
1#ifndef _ASM_PPC64_SOCKIOS_H 1#ifndef _ASM_POWERPC_SOCKIOS_H
2#define _ASM_PPC64_SOCKIOS_H 2#define _ASM_POWERPC_SOCKIOS_H
3 3
4/* 4/*
5 * This program is free software; you can redistribute it and/or 5 * This program is free software; you can redistribute it and/or
@@ -16,4 +16,4 @@
16#define SIOCATMARK 0x8905 16#define SIOCATMARK 0x8905
17#define SIOCGSTAMP 0x8906 /* Get stamp */ 17#define SIOCGSTAMP 0x8906 /* Get stamp */
18 18
19#endif /* _ASM_PPC64_SOCKIOS_H */ 19#endif /* _ASM_POWERPC_SOCKIOS_H */
diff --git a/include/asm-powerpc/string.h b/include/asm-powerpc/string.h
index 225575997392..8606a696c088 100644
--- a/include/asm-powerpc/string.h
+++ b/include/asm-powerpc/string.h
@@ -1,5 +1,5 @@
1#ifndef _PPC_STRING_H_ 1#ifndef _ASM_POWERPC_STRING_H
2#define _PPC_STRING_H_ 2#define _ASM_POWERPC_STRING_H
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
@@ -29,4 +29,4 @@ extern void * memchr(const void *,int,__kernel_size_t);
29 29
30#endif /* __KERNEL__ */ 30#endif /* __KERNEL__ */
31 31
32#endif 32#endif /* _ASM_POWERPC_STRING_H */
diff --git a/include/asm-ppc64/termbits.h b/include/asm-powerpc/termbits.h
index d1a2bee10cef..ebf6055481dc 100644
--- a/include/asm-ppc64/termbits.h
+++ b/include/asm-powerpc/termbits.h
@@ -1,5 +1,5 @@
1#ifndef _PPC64_TERMBITS_H 1#ifndef _ASM_POWERPC_TERMBITS_H
2#define _PPC64_TERMBITS_H 2#define _ASM_POWERPC_TERMBITS_H
3 3
4/* 4/*
5 * This program is free software; you can redistribute it and/or 5 * This program is free software; you can redistribute it and/or
@@ -8,8 +8,6 @@
8 * 2 of the License, or (at your option) any later version. 8 * 2 of the License, or (at your option) any later version.
9 */ 9 */
10 10
11#include <linux/posix_types.h>
12
13typedef unsigned char cc_t; 11typedef unsigned char cc_t;
14typedef unsigned int speed_t; 12typedef unsigned int speed_t;
15typedef unsigned int tcflag_t; 13typedef unsigned int tcflag_t;
@@ -190,4 +188,4 @@ struct termios {
190#define TCSADRAIN 1 188#define TCSADRAIN 1
191#define TCSAFLUSH 2 189#define TCSAFLUSH 2
192 190
193#endif /* _PPC64_TERMBITS_H */ 191#endif /* _ASM_POWERPC_TERMBITS_H */
diff --git a/include/asm-ppc64/termios.h b/include/asm-powerpc/termios.h
index 02c3d283aa62..c5b8e5358f83 100644
--- a/include/asm-ppc64/termios.h
+++ b/include/asm-powerpc/termios.h
@@ -1,5 +1,5 @@
1#ifndef _PPC64_TERMIOS_H 1#ifndef _ASM_POWERPC_TERMIOS_H
2#define _PPC64_TERMIOS_H 2#define _ASM_POWERPC_TERMIOS_H
3 3
4/* 4/*
5 * Liberally adapted from alpha/termios.h. In particular, the c_cc[] 5 * Liberally adapted from alpha/termios.h. In particular, the c_cc[]
@@ -87,6 +87,7 @@ struct termio {
87#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */ 87#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
88#define N_HDLC 13 /* synchronous HDLC */ 88#define N_HDLC 13 /* synchronous HDLC */
89#define N_SYNC_PPP 14 89#define N_SYNC_PPP 14
90#define N_HCI 15 /* Bluetooth HCI UART */
90 91
91#ifdef __KERNEL__ 92#ifdef __KERNEL__
92/* ^C ^\ del ^U ^D 1 0 0 0 0 ^W ^R ^Z ^Q ^S ^V ^U */ 93/* ^C ^\ del ^U ^D 1 0 0 0 0 ^W ^R ^Z ^Q ^S ^V ^U */
@@ -232,4 +233,4 @@ struct termio {
232 233
233#endif /* __KERNEL__ */ 234#endif /* __KERNEL__ */
234 235
235#endif /* _PPC64_TERMIOS_H */ 236#endif /* _ASM_POWERPC_TERMIOS_H */
diff --git a/include/asm-ppc/timex.h b/include/asm-powerpc/timex.h
index cffc8712077c..51c5b316be55 100644
--- a/include/asm-ppc/timex.h
+++ b/include/asm-powerpc/timex.h
@@ -1,11 +1,11 @@
1#ifndef _ASM_POWERPC_TIMEX_H
2#define _ASM_POWERPC_TIMEX_H
3
4#ifdef __KERNEL__
5
1/* 6/*
2 * include/asm-ppc/timex.h 7 * PowerPC architecture timex specifications
3 *
4 * ppc architecture timex specifications
5 */ 8 */
6#ifdef __KERNEL__
7#ifndef _ASMppc_TIMEX_H
8#define _ASMppc_TIMEX_H
9 9
10#include <linux/config.h> 10#include <linux/config.h>
11#include <asm/cputable.h> 11#include <asm/cputable.h>
@@ -14,14 +14,21 @@
14 14
15typedef unsigned long cycles_t; 15typedef unsigned long cycles_t;
16 16
17/*
18 * For the "cycle" counter we use the timebase lower half.
19 * Currently only used on SMP.
20 */
21
22static inline cycles_t get_cycles(void) 17static inline cycles_t get_cycles(void)
23{ 18{
24 cycles_t ret = 0; 19 cycles_t ret;
20
21#ifdef __powerpc64__
22
23 __asm__ __volatile__("mftb %0" : "=r" (ret) : );
24
25#else
26 /*
27 * For the "cycle" counter we use the timebase lower half.
28 * Currently only used on SMP.
29 */
30
31 ret = 0;
25 32
26 __asm__ __volatile__( 33 __asm__ __volatile__(
27 "98: mftb %0\n" 34 "98: mftb %0\n"
@@ -33,8 +40,10 @@ static inline cycles_t get_cycles(void)
33 " .long 99b\n" 40 " .long 99b\n"
34 ".previous" 41 ".previous"
35 : "=r" (ret) : "i" (CPU_FTR_601)); 42 : "=r" (ret) : "i" (CPU_FTR_601));
43#endif
44
36 return ret; 45 return ret;
37} 46}
38 47
39#endif 48#endif /* __KERNEL__ */
40#endif /* __KERNEL__ */ 49#endif /* _ASM_POWERPC_TIMEX_H */
diff --git a/include/asm-ppc64/topology.h b/include/asm-powerpc/topology.h
index 1e9b19073230..2512e3836bf4 100644
--- a/include/asm-ppc64/topology.h
+++ b/include/asm-powerpc/topology.h
@@ -1,11 +1,12 @@
1#ifndef _ASM_PPC64_TOPOLOGY_H 1#ifndef _ASM_POWERPC_TOPOLOGY_H
2#define _ASM_PPC64_TOPOLOGY_H 2#define _ASM_POWERPC_TOPOLOGY_H
3 3
4#include <linux/config.h> 4#include <linux/config.h>
5#include <asm/mmzone.h>
6 5
7#ifdef CONFIG_NUMA 6#ifdef CONFIG_NUMA
8 7
8#include <asm/mmzone.h>
9
9static inline int cpu_to_node(int cpu) 10static inline int cpu_to_node(int cpu)
10{ 11{
11 int node; 12 int node;
@@ -66,4 +67,4 @@ static inline int node_to_first_cpu(int node)
66 67
67#endif /* CONFIG_NUMA */ 68#endif /* CONFIG_NUMA */
68 69
69#endif /* _ASM_PPC64_TOPOLOGY_H */ 70#endif /* _ASM_POWERPC_TOPOLOGY_H */
diff --git a/include/asm-powerpc/unaligned.h b/include/asm-powerpc/unaligned.h
index 45520d9b85d1..6c95dfa2652f 100644
--- a/include/asm-powerpc/unaligned.h
+++ b/include/asm-powerpc/unaligned.h
@@ -1,6 +1,7 @@
1#ifndef _ASM_POWERPC_UNALIGNED_H
2#define _ASM_POWERPC_UNALIGNED_H
3
1#ifdef __KERNEL__ 4#ifdef __KERNEL__
2#ifndef __PPC_UNALIGNED_H
3#define __PPC_UNALIGNED_H
4 5
5/* 6/*
6 * The PowerPC can do unaligned accesses itself in big endian mode. 7 * The PowerPC can do unaligned accesses itself in big endian mode.
@@ -14,5 +15,5 @@
14 15
15#define put_unaligned(val, ptr) ((void)( *(ptr) = (val) )) 16#define put_unaligned(val, ptr) ((void)( *(ptr) = (val) ))
16 17
17#endif 18#endif /* __KERNEL__ */
18#endif /* __KERNEL__ */ 19#endif /* _ASM_POWERPC_UNALIGNED_H */
diff --git a/include/asm-ppc/user.h b/include/asm-powerpc/user.h
index d662b2151370..e59ade4b3dfb 100644
--- a/include/asm-ppc/user.h
+++ b/include/asm-powerpc/user.h
@@ -1,13 +1,14 @@
1#ifdef __KERNEL__ 1#ifndef _ASM_POWERPC_USER_H
2#ifndef _PPC_USER_H 2#define _ASM_POWERPC_USER_H
3#define _PPC_USER_H
4 3
5/* Adapted from <asm-alpha/user.h> */ 4#ifdef __KERNEL__
6 5
7#include <linux/ptrace.h> 6#include <asm/ptrace.h>
8#include <asm/page.h> 7#include <asm/page.h>
9 8
10/* 9/*
10 * Adapted from <asm-alpha/user.h>
11 *
11 * Core file format: The core file is written in such a way that gdb 12 * Core file format: The core file is written in such a way that gdb
12 * can understand it and provide useful information to the user (under 13 * can understand it and provide useful information to the user (under
13 * linux we use the `trad-core' bfd, NOT the osf-core). The file contents 14 * linux we use the `trad-core' bfd, NOT the osf-core). The file contents
@@ -50,5 +51,5 @@ struct user {
50#define HOST_DATA_START_ADDR (u.start_data) 51#define HOST_DATA_START_ADDR (u.start_data)
51#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) 52#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
52 53
53#endif /* _PPC_USER_H */ 54#endif /* __KERNEL__ */
54#endif /* __KERNEL__ */ 55#endif /* _ASM_POWERPC_USER_H */
diff --git a/include/asm-ppc/auxvec.h b/include/asm-ppc/auxvec.h
new file mode 100644
index 000000000000..172358df29c8
--- /dev/null
+++ b/include/asm-ppc/auxvec.h
@@ -0,0 +1,14 @@
1#ifndef __PPC_AUXVEC_H
2#define __PPC_AUXVEC_H
3
4/*
5 * We need to put in some extra aux table entries to tell glibc what
6 * the cache block size is, so it can use the dcbz instruction safely.
7 */
8#define AT_DCACHEBSIZE 19
9#define AT_ICACHEBSIZE 20
10#define AT_UCACHEBSIZE 21
11/* A special ignored type value for PPC, for glibc compatibility. */
12#define AT_IGNOREPPC 22
13
14#endif
diff --git a/include/asm-ppc/bugs.h b/include/asm-ppc/bugs.h
deleted file mode 100644
index 8dce1e290fd0..000000000000
--- a/include/asm-ppc/bugs.h
+++ /dev/null
@@ -1,6 +0,0 @@
1/*
2 * This file is included by 'init/main.c'
3 */
4
5extern void
6check_bugs(void);
diff --git a/include/asm-ppc/dma-mapping.h b/include/asm-ppc/dma-mapping.h
index 6f74f59938d4..92b8ee78dcc2 100644
--- a/include/asm-ppc/dma-mapping.h
+++ b/include/asm-ppc/dma-mapping.h
@@ -60,7 +60,8 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask)
60} 60}
61 61
62static inline void *dma_alloc_coherent(struct device *dev, size_t size, 62static inline void *dma_alloc_coherent(struct device *dev, size_t size,
63 dma_addr_t * dma_handle, int gfp) 63 dma_addr_t * dma_handle,
64 unsigned int __nocast gfp)
64{ 65{
65#ifdef CONFIG_NOT_COHERENT_CACHE 66#ifdef CONFIG_NOT_COHERENT_CACHE
66 return __dma_alloc_coherent(size, dma_handle, gfp); 67 return __dma_alloc_coherent(size, dma_handle, gfp);
diff --git a/include/asm-ppc/elf.h b/include/asm-ppc/elf.h
index 2c056966efd3..c25cc35e6ab5 100644
--- a/include/asm-ppc/elf.h
+++ b/include/asm-ppc/elf.h
@@ -7,6 +7,7 @@
7#include <asm/types.h> 7#include <asm/types.h>
8#include <asm/ptrace.h> 8#include <asm/ptrace.h>
9#include <asm/cputable.h> 9#include <asm/cputable.h>
10#include <asm/auxvec.h>
10 11
11/* PowerPC relocations defined by the ABIs */ 12/* PowerPC relocations defined by the ABIs */
12#define R_PPC_NONE 0 13#define R_PPC_NONE 0
@@ -122,16 +123,6 @@ extern int dump_task_fpu(struct task_struct *t, elf_fpregset_t *fpu);
122 123
123#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) 124#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
124 125
125/*
126 * We need to put in some extra aux table entries to tell glibc what
127 * the cache block size is, so it can use the dcbz instruction safely.
128 */
129#define AT_DCACHEBSIZE 19
130#define AT_ICACHEBSIZE 20
131#define AT_UCACHEBSIZE 21
132/* A special ignored type value for PPC, for glibc compatibility. */
133#define AT_IGNOREPPC 22
134
135extern int dcache_bsize; 126extern int dcache_bsize;
136extern int icache_bsize; 127extern int icache_bsize;
137extern int ucache_bsize; 128extern int ucache_bsize;
diff --git a/include/asm-ppc/fcntl.h b/include/asm-ppc/fcntl.h
deleted file mode 100644
index 5e28e41fb29f..000000000000
--- a/include/asm-ppc/fcntl.h
+++ /dev/null
@@ -1,93 +0,0 @@
1#ifndef _PPC_FCNTL_H
2#define _PPC_FCNTL_H
3
4/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
5 located on an ext2 file system */
6#define O_ACCMODE 0003
7#define O_RDONLY 00
8#define O_WRONLY 01
9#define O_RDWR 02
10#define O_CREAT 0100 /* not fcntl */
11#define O_EXCL 0200 /* not fcntl */
12#define O_NOCTTY 0400 /* not fcntl */
13#define O_TRUNC 01000 /* not fcntl */
14#define O_APPEND 02000
15#define O_NONBLOCK 04000
16#define O_NDELAY O_NONBLOCK
17#define O_SYNC 010000
18#define FASYNC 020000 /* fcntl, for BSD compatibility */
19#define O_DIRECTORY 040000 /* must be a directory */
20#define O_NOFOLLOW 0100000 /* don't follow links */
21#define O_LARGEFILE 0200000
22#define O_DIRECT 0400000 /* direct disk access hint */
23#define O_NOATIME 01000000
24
25#define F_DUPFD 0 /* dup */
26#define F_GETFD 1 /* get close_on_exec */
27#define F_SETFD 2 /* set/clear close_on_exec */
28#define F_GETFL 3 /* get file->f_flags */
29#define F_SETFL 4 /* set file->f_flags */
30#define F_GETLK 5
31#define F_SETLK 6
32#define F_SETLKW 7
33
34#define F_SETOWN 8 /* for sockets. */
35#define F_GETOWN 9 /* for sockets. */
36#define F_SETSIG 10 /* for sockets. */
37#define F_GETSIG 11 /* for sockets. */
38
39#define F_GETLK64 12 /* using 'struct flock64' */
40#define F_SETLK64 13
41#define F_SETLKW64 14
42
43/* for F_[GET|SET]FL */
44#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
45
46/* for posix fcntl() and lockf() */
47#define F_RDLCK 0
48#define F_WRLCK 1
49#define F_UNLCK 2
50
51/* for old implementation of bsd flock () */
52#define F_EXLCK 4 /* or 3 */
53#define F_SHLCK 8 /* or 4 */
54
55/* for leases */
56#define F_INPROGRESS 16
57
58/* operations for bsd flock(), also used by the kernel implementation */
59#define LOCK_SH 1 /* shared lock */
60#define LOCK_EX 2 /* exclusive lock */
61#define LOCK_NB 4 /* or'd with one of the above to prevent
62 blocking */
63#define LOCK_UN 8 /* remove lock */
64
65#define LOCK_MAND 32 /* This is a mandatory flock */
66#define LOCK_READ 64 /* ... Which allows concurrent read operations */
67#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
68#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
69
70#ifdef __KERNEL__
71#define F_POSIX 1
72#define F_FLOCK 2
73#define F_BROKEN 4 /* broken flock() emulation */
74#endif /* __KERNEL__ */
75
76struct flock {
77 short l_type;
78 short l_whence;
79 off_t l_start;
80 off_t l_len;
81 pid_t l_pid;
82};
83
84struct flock64 {
85 short l_type;
86 short l_whence;
87 loff_t l_start;
88 loff_t l_len;
89 pid_t l_pid;
90};
91
92#define F_LINUX_SPECIFIC_BASE 1024
93#endif
diff --git a/include/asm-ppc/futex.h b/include/asm-ppc/futex.h
new file mode 100644
index 000000000000..2cac5ecd9d00
--- /dev/null
+++ b/include/asm-ppc/futex.h
@@ -0,0 +1,53 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/uaccess.h>
9
10static inline int
11futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
12{
13 int op = (encoded_op >> 28) & 7;
14 int cmp = (encoded_op >> 24) & 15;
15 int oparg = (encoded_op << 8) >> 20;
16 int cmparg = (encoded_op << 20) >> 20;
17 int oldval = 0, ret, tem;
18 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
19 oparg = 1 << oparg;
20
21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
22 return -EFAULT;
23
24 inc_preempt_count();
25
26 switch (op) {
27 case FUTEX_OP_SET:
28 case FUTEX_OP_ADD:
29 case FUTEX_OP_OR:
30 case FUTEX_OP_ANDN:
31 case FUTEX_OP_XOR:
32 default:
33 ret = -ENOSYS;
34 }
35
36 dec_preempt_count();
37
38 if (!ret) {
39 switch (cmp) {
40 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
41 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
42 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
43 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
44 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
45 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
46 default: ret = -ENOSYS;
47 }
48 }
49 return ret;
50}
51
52#endif
53#endif
diff --git a/include/asm-ppc/ibm4xx.h b/include/asm-ppc/ibm4xx.h
index e807be96e981..e992369cb8e9 100644
--- a/include/asm-ppc/ibm4xx.h
+++ b/include/asm-ppc/ibm4xx.h
@@ -19,10 +19,6 @@
19 19
20#ifdef CONFIG_40x 20#ifdef CONFIG_40x
21 21
22#if defined(CONFIG_ASH)
23#include <platforms/4xx/ash.h>
24#endif
25
26#if defined(CONFIG_BUBINGA) 22#if defined(CONFIG_BUBINGA)
27#include <platforms/4xx/bubinga.h> 23#include <platforms/4xx/bubinga.h>
28#endif 24#endif
@@ -35,14 +31,6 @@
35#include <platforms/4xx/ep405.h> 31#include <platforms/4xx/ep405.h>
36#endif 32#endif
37 33
38#if defined(CONFIG_OAK)
39#include <platforms/4xx/oak.h>
40#endif
41
42#if defined(CONFIG_REDWOOD_4)
43#include <platforms/4xx/redwood.h>
44#endif
45
46#if defined(CONFIG_REDWOOD_5) 34#if defined(CONFIG_REDWOOD_5)
47#include <platforms/4xx/redwood5.h> 35#include <platforms/4xx/redwood5.h>
48#endif 36#endif
diff --git a/include/asm-ppc/ibm_ocp.h b/include/asm-ppc/ibm_ocp.h
index 3f7b5669e6d5..6f10a25bd628 100644
--- a/include/asm-ppc/ibm_ocp.h
+++ b/include/asm-ppc/ibm_ocp.h
@@ -67,6 +67,7 @@ struct ocp_func_emac_data {
67 int phy_mode; /* PHY type or configurable mode */ 67 int phy_mode; /* PHY type or configurable mode */
68 u8 mac_addr[6]; /* EMAC mac address */ 68 u8 mac_addr[6]; /* EMAC mac address */
69 u32 phy_map; /* EMAC phy map */ 69 u32 phy_map; /* EMAC phy map */
70 u32 phy_feat_exc; /* Excluded PHY features */
70}; 71};
71 72
72/* Sysfs support */ 73/* Sysfs support */
@@ -83,6 +84,7 @@ OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, mdio_idx) \
83OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, tah_idx) \ 84OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, tah_idx) \
84OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, phy_mode) \ 85OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, phy_mode) \
85OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "0x%08x\n", emac, phy_map) \ 86OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "0x%08x\n", emac, phy_map) \
87OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "0x%08x\n", emac, phy_feat_exc)\
86 \ 88 \
87void ocp_show_emac_data(struct device *dev) \ 89void ocp_show_emac_data(struct device *dev) \
88{ \ 90{ \
@@ -98,8 +100,22 @@ void ocp_show_emac_data(struct device *dev) \
98 device_create_file(dev, &dev_attr_emac_tah_idx); \ 100 device_create_file(dev, &dev_attr_emac_tah_idx); \
99 device_create_file(dev, &dev_attr_emac_phy_mode); \ 101 device_create_file(dev, &dev_attr_emac_phy_mode); \
100 device_create_file(dev, &dev_attr_emac_phy_map); \ 102 device_create_file(dev, &dev_attr_emac_phy_map); \
103 device_create_file(dev, &dev_attr_emac_phy_feat_exc); \
101} 104}
102 105
106/*
107 * PHY mode settings (EMAC <-> ZMII/RGMII bridge <-> PHY)
108 */
109#define PHY_MODE_NA 0
110#define PHY_MODE_MII 1
111#define PHY_MODE_RMII 2
112#define PHY_MODE_SMII 3
113#define PHY_MODE_RGMII 4
114#define PHY_MODE_TBI 5
115#define PHY_MODE_GMII 6
116#define PHY_MODE_RTBI 7
117#define PHY_MODE_SGMII 8
118
103#ifdef CONFIG_40x 119#ifdef CONFIG_40x
104/* 120/*
105 * Helper function to copy MAC addresses from the bd_t to OCP EMAC 121 * Helper function to copy MAC addresses from the bd_t to OCP EMAC
@@ -133,6 +149,7 @@ struct ocp_func_mal_data {
133 int txde_irq; /* TX Descriptor Error IRQ */ 149 int txde_irq; /* TX Descriptor Error IRQ */
134 int rxde_irq; /* RX Descriptor Error IRQ */ 150 int rxde_irq; /* RX Descriptor Error IRQ */
135 int serr_irq; /* MAL System Error IRQ */ 151 int serr_irq; /* MAL System Error IRQ */
152 int dcr_base; /* MALx_CFG DCR number */
136}; 153};
137 154
138#define OCP_SYSFS_MAL_DATA() \ 155#define OCP_SYSFS_MAL_DATA() \
@@ -143,6 +160,7 @@ OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, rxeob_irq) \
143OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, txde_irq) \ 160OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, txde_irq) \
144OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, rxde_irq) \ 161OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, rxde_irq) \
145OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, serr_irq) \ 162OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, serr_irq) \
163OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, dcr_base) \
146 \ 164 \
147void ocp_show_mal_data(struct device *dev) \ 165void ocp_show_mal_data(struct device *dev) \
148{ \ 166{ \
@@ -153,6 +171,7 @@ void ocp_show_mal_data(struct device *dev) \
153 device_create_file(dev, &dev_attr_mal_txde_irq); \ 171 device_create_file(dev, &dev_attr_mal_txde_irq); \
154 device_create_file(dev, &dev_attr_mal_rxde_irq); \ 172 device_create_file(dev, &dev_attr_mal_rxde_irq); \
155 device_create_file(dev, &dev_attr_mal_serr_irq); \ 173 device_create_file(dev, &dev_attr_mal_serr_irq); \
174 device_create_file(dev, &dev_attr_mal_dcr_base); \
156} 175}
157 176
158/* 177/*
diff --git a/include/asm-ppc/irq.h b/include/asm-ppc/irq.h
index a9b33324f562..55752474d0d9 100644
--- a/include/asm-ppc/irq.h
+++ b/include/asm-ppc/irq.h
@@ -19,6 +19,11 @@
19#define IRQ_POLARITY_POSITIVE 0x2 /* high level or low->high edge */ 19#define IRQ_POLARITY_POSITIVE 0x2 /* high level or low->high edge */
20#define IRQ_POLARITY_NEGATIVE 0x0 /* low level or high->low edge */ 20#define IRQ_POLARITY_NEGATIVE 0x0 /* low level or high->low edge */
21 21
22/*
23 * IRQ line status macro IRQ_PER_CPU is used
24 */
25#define ARCH_HAS_IRQ_PER_CPU
26
22#if defined(CONFIG_40x) 27#if defined(CONFIG_40x)
23#include <asm/ibm4xx.h> 28#include <asm/ibm4xx.h>
24 29
@@ -337,6 +342,7 @@ static __inline__ int irq_canonicalize(int irq)
337#define SIU_INT_IDMA3 ((uint)0x08 + CPM_IRQ_OFFSET) 342#define SIU_INT_IDMA3 ((uint)0x08 + CPM_IRQ_OFFSET)
338#define SIU_INT_IDMA4 ((uint)0x09 + CPM_IRQ_OFFSET) 343#define SIU_INT_IDMA4 ((uint)0x09 + CPM_IRQ_OFFSET)
339#define SIU_INT_SDMA ((uint)0x0a + CPM_IRQ_OFFSET) 344#define SIU_INT_SDMA ((uint)0x0a + CPM_IRQ_OFFSET)
345#define SIU_INT_USB ((uint)0x0b + CPM_IRQ_OFFSET)
340#define SIU_INT_TIMER1 ((uint)0x0c + CPM_IRQ_OFFSET) 346#define SIU_INT_TIMER1 ((uint)0x0c + CPM_IRQ_OFFSET)
341#define SIU_INT_TIMER2 ((uint)0x0d + CPM_IRQ_OFFSET) 347#define SIU_INT_TIMER2 ((uint)0x0d + CPM_IRQ_OFFSET)
342#define SIU_INT_TIMER3 ((uint)0x0e + CPM_IRQ_OFFSET) 348#define SIU_INT_TIMER3 ((uint)0x0e + CPM_IRQ_OFFSET)
@@ -398,9 +404,5 @@ extern unsigned long ppc_cached_irq_mask[NR_MASK_WORDS];
398extern unsigned long ppc_lost_interrupts[NR_MASK_WORDS]; 404extern unsigned long ppc_lost_interrupts[NR_MASK_WORDS];
399extern atomic_t ppc_n_lost_interrupts; 405extern atomic_t ppc_n_lost_interrupts;
400 406
401struct irqaction;
402struct pt_regs;
403int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
404
405#endif /* _ASM_IRQ_H */ 407#endif /* _ASM_IRQ_H */
406#endif /* __KERNEL__ */ 408#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/kmap_types.h b/include/asm-ppc/kmap_types.h
index 2589f182a6ad..6d6fc78731e5 100644
--- a/include/asm-ppc/kmap_types.h
+++ b/include/asm-ppc/kmap_types.h
@@ -17,6 +17,7 @@ enum km_type {
17 KM_SOFTIRQ0, 17 KM_SOFTIRQ0,
18 KM_SOFTIRQ1, 18 KM_SOFTIRQ1,
19 KM_PPC_SYNC_PAGE, 19 KM_PPC_SYNC_PAGE,
20 KM_PPC_SYNC_ICACHE,
20 KM_TYPE_NR 21 KM_TYPE_NR
21}; 22};
22 23
diff --git a/include/asm-ppc/mc146818rtc.h b/include/asm-ppc/mc146818rtc.h
deleted file mode 100644
index 227018b2fef8..000000000000
--- a/include/asm-ppc/mc146818rtc.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * Machine dependent access functions for RTC registers.
3 */
4#ifdef __KERNEL__
5#ifndef __ASM_PPC_MC146818RTC_H
6#define __ASM_PPC_MC146818RTC_H
7
8#include <asm/io.h>
9
10#ifndef RTC_PORT
11#define RTC_PORT(x) (0x70 + (x))
12#define RTC_ALWAYS_BCD 1 /* RTC operates in binary mode */
13#endif
14
15/*
16 * The yet supported machines all access the RTC index register via
17 * an ISA port access but the way to access the date register differs ...
18 */
19#define CMOS_READ(addr) ({ \
20outb_p((addr),RTC_PORT(0)); \
21inb_p(RTC_PORT(1)); \
22})
23#define CMOS_WRITE(val, addr) ({ \
24outb_p((addr),RTC_PORT(0)); \
25outb_p((val),RTC_PORT(1)); \
26})
27
28#define RTC_IRQ 8
29
30#endif /* __ASM_PPC_MC146818RTC_H */
31#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/mman.h b/include/asm-ppc/mman.h
deleted file mode 100644
index 5fd19fd4936c..000000000000
--- a/include/asm-ppc/mman.h
+++ /dev/null
@@ -1,44 +0,0 @@
1#ifndef __PPC_MMAN_H__
2#define __PPC_MMAN_H__
3
4#define PROT_READ 0x1 /* page can be read */
5#define PROT_WRITE 0x2 /* page can be written */
6#define PROT_EXEC 0x4 /* page can be executed */
7#define PROT_SEM 0x8 /* page may be used for atomic ops */
8#define PROT_NONE 0x0 /* page can not be accessed */
9#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
10#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */
11
12#define MAP_SHARED 0x01 /* Share changes */
13#define MAP_PRIVATE 0x02 /* Changes are private */
14#define MAP_TYPE 0x0f /* Mask for type of mapping */
15#define MAP_FIXED 0x10 /* Interpret addr exactly */
16#define MAP_ANONYMOUS 0x20 /* don't use a file */
17#define MAP_RENAME MAP_ANONYMOUS /* In SunOS terminology */
18#define MAP_NORESERVE 0x40 /* don't reserve swap pages */
19#define MAP_LOCKED 0x80
20
21#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
22#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
23#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
24#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
25#define MAP_NONBLOCK 0x10000 /* do not block on IO */
26
27#define MS_ASYNC 1 /* sync memory asynchronously */
28#define MS_INVALIDATE 2 /* invalidate the caches */
29#define MS_SYNC 4 /* synchronous memory sync */
30
31#define MCL_CURRENT 0x2000 /* lock all currently mapped pages */
32#define MCL_FUTURE 0x4000 /* lock all additions to address space */
33
34#define MADV_NORMAL 0x0 /* default page-in behavior */
35#define MADV_RANDOM 0x1 /* page-in minimum required */
36#define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */
37#define MADV_WILLNEED 0x3 /* pre-fault pages */
38#define MADV_DONTNEED 0x4 /* discard these pages */
39
40/* compatibility flags */
41#define MAP_ANON MAP_ANONYMOUS
42#define MAP_FILE 0
43
44#endif /* __PPC_MMAN_H__ */
diff --git a/include/asm-ppc/module.h b/include/asm-ppc/module.h
deleted file mode 100644
index fb63492562b0..000000000000
--- a/include/asm-ppc/module.h
+++ /dev/null
@@ -1,44 +0,0 @@
1#ifndef _ASM_PPC_MODULE_H
2#define _ASM_PPC_MODULE_H
3/* Module stuff for PPC. (C) 2001 Rusty Russell */
4
5#include <linux/list.h>
6#include <asm/bug.h>
7
8/* Thanks to Paul M for explaining this.
9
10 PPC can only do rel jumps += 32MB, and often the kernel and other
11 modules are furthur away than this. So, we jump to a table of
12 trampolines attached to the module (the Procedure Linkage Table)
13 whenever that happens.
14*/
15
16struct ppc_plt_entry
17{
18 /* 16 byte jump instruction sequence (4 instructions) */
19 unsigned int jump[4];
20};
21
22struct mod_arch_specific
23{
24 /* Indices of PLT sections within module. */
25 unsigned int core_plt_section, init_plt_section;
26
27 /* List of BUG addresses, source line numbers and filenames */
28 struct list_head bug_list;
29 struct bug_entry *bug_table;
30 unsigned int num_bugs;
31};
32
33extern struct bug_entry *module_find_bug(unsigned long bugaddr);
34
35#define Elf_Shdr Elf32_Shdr
36#define Elf_Sym Elf32_Sym
37#define Elf_Ehdr Elf32_Ehdr
38
39/* Make empty sections for module_frob_arch_sections to expand. */
40#ifdef MODULE
41asm(".section .plt,\"ax\",@nobits; .align 3; .previous");
42asm(".section .init.plt,\"ax\",@nobits; .align 3; .previous");
43#endif
44#endif /* _ASM_PPC_MODULE_H */
diff --git a/include/asm-ppc/mpc8260.h b/include/asm-ppc/mpc8260.h
index 89eb8a2ac693..9694eca16e92 100644
--- a/include/asm-ppc/mpc8260.h
+++ b/include/asm-ppc/mpc8260.h
@@ -67,6 +67,24 @@
67#define IO_VIRT_ADDR IO_PHYS_ADDR 67#define IO_VIRT_ADDR IO_PHYS_ADDR
68#endif 68#endif
69 69
70enum ppc_sys_devices {
71 MPC82xx_CPM_FCC1,
72 MPC82xx_CPM_FCC2,
73 MPC82xx_CPM_FCC3,
74 MPC82xx_CPM_I2C,
75 MPC82xx_CPM_SCC1,
76 MPC82xx_CPM_SCC2,
77 MPC82xx_CPM_SCC3,
78 MPC82xx_CPM_SCC4,
79 MPC82xx_CPM_SPI,
80 MPC82xx_CPM_MCC1,
81 MPC82xx_CPM_MCC2,
82 MPC82xx_CPM_SMC1,
83 MPC82xx_CPM_SMC2,
84 MPC82xx_CPM_USB,
85 MPC82xx_SEC1,
86};
87
70#ifndef __ASSEMBLY__ 88#ifndef __ASSEMBLY__
71/* The "residual" data board information structure the boot loader 89/* The "residual" data board information structure the boot loader
72 * hands to us. 90 * hands to us.
diff --git a/include/asm-ppc/mpc8xx.h b/include/asm-ppc/mpc8xx.h
index 7c31f2d564a1..dc8e59896050 100644
--- a/include/asm-ppc/mpc8xx.h
+++ b/include/asm-ppc/mpc8xx.h
@@ -36,10 +36,6 @@
36#include <platforms/tqm8xx.h> 36#include <platforms/tqm8xx.h>
37#endif 37#endif
38 38
39#if defined(CONFIG_SPD823TS)
40#include <platforms/spd8xx.h>
41#endif
42
43#if defined(CONFIG_IVMS8) || defined(CONFIG_IVML24) 39#if defined(CONFIG_IVMS8) || defined(CONFIG_IVML24)
44#include <platforms/ivms8.h> 40#include <platforms/ivms8.h>
45#endif 41#endif
diff --git a/include/asm-ppc/mv64x60.h b/include/asm-ppc/mv64x60.h
index cc25b921ad4f..835930d6faa1 100644
--- a/include/asm-ppc/mv64x60.h
+++ b/include/asm-ppc/mv64x60.h
@@ -278,6 +278,13 @@ mv64x60_modify(struct mv64x60_handle *bh, u32 offs, u32 data, u32 mask)
278#define mv64x60_set_bits(bh, offs, bits) mv64x60_modify(bh, offs, ~0, bits) 278#define mv64x60_set_bits(bh, offs, bits) mv64x60_modify(bh, offs, ~0, bits)
279#define mv64x60_clr_bits(bh, offs, bits) mv64x60_modify(bh, offs, 0, bits) 279#define mv64x60_clr_bits(bh, offs, bits) mv64x60_modify(bh, offs, 0, bits)
280 280
281#if defined(CONFIG_SYSFS) && !defined(CONFIG_GT64260)
282#define MV64XXX_DEV_NAME "mv64xxx"
283
284struct mv64xxx_pdata {
285 u32 hs_reg_valid;
286};
287#endif
281 288
282/* Externally visible function prototypes */ 289/* Externally visible function prototypes */
283int mv64x60_init(struct mv64x60_handle *bh, struct mv64x60_setup_info *si); 290int mv64x60_init(struct mv64x60_handle *bh, struct mv64x60_setup_info *si);
diff --git a/include/asm-ppc/mv64x60_defs.h b/include/asm-ppc/mv64x60_defs.h
index 2f428746c02b..f8f7f16b9b53 100644
--- a/include/asm-ppc/mv64x60_defs.h
+++ b/include/asm-ppc/mv64x60_defs.h
@@ -333,7 +333,7 @@
333/* 333/*
334 ***************************************************************************** 334 *****************************************************************************
335 * 335 *
336 * SRAM Cotnroller Registers 336 * SRAM Controller Registers
337 * 337 *
338 ***************************************************************************** 338 *****************************************************************************
339 */ 339 */
@@ -352,7 +352,7 @@
352/* 352/*
353 ***************************************************************************** 353 *****************************************************************************
354 * 354 *
355 * SDRAM/MEM Cotnroller Registers 355 * SDRAM/MEM Controller Registers
356 * 356 *
357 ***************************************************************************** 357 *****************************************************************************
358 */ 358 */
@@ -375,6 +375,7 @@
375/* SDRAM Control Registers */ 375/* SDRAM Control Registers */
376#define MV64360_D_UNIT_CONTROL_LOW 0x1404 376#define MV64360_D_UNIT_CONTROL_LOW 0x1404
377#define MV64360_D_UNIT_CONTROL_HIGH 0x1424 377#define MV64360_D_UNIT_CONTROL_HIGH 0x1424
378#define MV64460_D_UNIT_MMASK 0x14b0
378 379
379/* SDRAM Error Report Registers (64360) */ 380/* SDRAM Error Report Registers (64360) */
380#define MV64360_SDRAM_ERR_DATA_LO 0x1444 381#define MV64360_SDRAM_ERR_DATA_LO 0x1444
@@ -388,7 +389,7 @@
388/* 389/*
389 ***************************************************************************** 390 *****************************************************************************
390 * 391 *
391 * Device/BOOT Cotnroller Registers 392 * Device/BOOT Controller Registers
392 * 393 *
393 ***************************************************************************** 394 *****************************************************************************
394 */ 395 */
@@ -680,6 +681,8 @@
680#define MV64x60_PCI1_SLAVE_P2P_IO_REMAP 0x0dec 681#define MV64x60_PCI1_SLAVE_P2P_IO_REMAP 0x0dec
681#define MV64x60_PCI1_SLAVE_CPU_REMAP 0x0df0 682#define MV64x60_PCI1_SLAVE_CPU_REMAP 0x0df0
682 683
684#define MV64360_PCICFG_CPCI_HOTSWAP 0x68
685
683/* 686/*
684 ***************************************************************************** 687 *****************************************************************************
685 * 688 *
diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h
index a811e440c978..9dd06cd40096 100644
--- a/include/asm-ppc/pci.h
+++ b/include/asm-ppc/pci.h
@@ -109,6 +109,19 @@ extern void
109pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, 109pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
110 struct pci_bus_region *region); 110 struct pci_bus_region *region);
111 111
112static inline struct resource *
113pcibios_select_root(struct pci_dev *pdev, struct resource *res)
114{
115 struct resource *root = NULL;
116
117 if (res->flags & IORESOURCE_IO)
118 root = &ioport_resource;
119 if (res->flags & IORESOURCE_MEM)
120 root = &iomem_resource;
121
122 return root;
123}
124
112extern void pcibios_add_platform_entries(struct pci_dev *dev); 125extern void pcibios_add_platform_entries(struct pci_dev *dev);
113 126
114struct file; 127struct file;
diff --git a/include/asm-ppc/pmac_feature.h b/include/asm-ppc/pmac_feature.h
index 8beb162873f4..e9683bcff19b 100644
--- a/include/asm-ppc/pmac_feature.h
+++ b/include/asm-ppc/pmac_feature.h
@@ -32,6 +32,7 @@
32#define __PPC_ASM_PMAC_FEATURE_H 32#define __PPC_ASM_PMAC_FEATURE_H
33 33
34#include <asm/macio.h> 34#include <asm/macio.h>
35#include <asm/machdep.h>
35 36
36/* 37/*
37 * Known Mac motherboard models 38 * Known Mac motherboard models
diff --git a/include/asm-ppc/ppc_sys.h b/include/asm-ppc/ppc_sys.h
index 8ea624566231..048f7c8596ee 100644
--- a/include/asm-ppc/ppc_sys.h
+++ b/include/asm-ppc/ppc_sys.h
@@ -21,7 +21,9 @@
21#include <linux/device.h> 21#include <linux/device.h>
22#include <linux/types.h> 22#include <linux/types.h>
23 23
24#if defined(CONFIG_83xx) 24#if defined(CONFIG_8260)
25#include <asm/mpc8260.h>
26#elif defined(CONFIG_83xx)
25#include <asm/mpc83xx.h> 27#include <asm/mpc83xx.h>
26#elif defined(CONFIG_85xx) 28#elif defined(CONFIG_85xx)
27#include <asm/mpc85xx.h> 29#include <asm/mpc85xx.h>
@@ -50,6 +52,7 @@ extern struct ppc_sys_spec *cur_ppc_sys_spec;
50/* determine which specific SOC we are */ 52/* determine which specific SOC we are */
51extern void identify_ppc_sys_by_id(u32 id) __init; 53extern void identify_ppc_sys_by_id(u32 id) __init;
52extern void identify_ppc_sys_by_name(char *name) __init; 54extern void identify_ppc_sys_by_name(char *name) __init;
55extern void identify_ppc_sys_by_name_and_id(char *name, u32 id) __init;
53 56
54/* describes all devices that may exist in a given family of processors */ 57/* describes all devices that may exist in a given family of processors */
55extern struct platform_device ppc_sys_platform_devices[]; 58extern struct platform_device ppc_sys_platform_devices[];
diff --git a/include/asm-ppc/reg.h b/include/asm-ppc/reg.h
index 88b4222154d4..73c33e3ef9c6 100644
--- a/include/asm-ppc/reg.h
+++ b/include/asm-ppc/reg.h
@@ -366,12 +366,6 @@
366#define PVR_STB03XXX 0x40310000 366#define PVR_STB03XXX 0x40310000
367#define PVR_NP405H 0x41410000 367#define PVR_NP405H 0x41410000
368#define PVR_NP405L 0x41610000 368#define PVR_NP405L 0x41610000
369#define PVR_440GP_RB 0x40120440
370#define PVR_440GP_RC1 0x40120481
371#define PVR_440GP_RC2 0x40200481
372#define PVR_440GX_RA 0x51b21850
373#define PVR_440GX_RB 0x51b21851
374#define PVR_440GX_RC 0x51b21892
375#define PVR_601 0x00010000 369#define PVR_601 0x00010000
376#define PVR_602 0x00050000 370#define PVR_602 0x00050000
377#define PVR_603 0x00030000 371#define PVR_603 0x00030000
diff --git a/include/asm-ppc/sembuf.h b/include/asm-ppc/sembuf.h
deleted file mode 100644
index 883f682f85b8..000000000000
--- a/include/asm-ppc/sembuf.h
+++ /dev/null
@@ -1,19 +0,0 @@
1#ifndef _PPC_SEMBUF_H
2#define _PPC_SEMBUF_H
3
4/*
5 * The semid64_ds structure for PPC architecture.
6 */
7
8struct semid64_ds {
9 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
10 unsigned int __unused1;
11 __kernel_time_t sem_otime; /* last semop time */
12 unsigned int __unused2;
13 __kernel_time_t sem_ctime; /* last change time */
14 unsigned long sem_nsems; /* no. of semaphores in array */
15 unsigned long __unused3;
16 unsigned long __unused4;
17};
18
19#endif /* _PPC_SEMBUF_H */
diff --git a/include/asm-ppc/serial.h b/include/asm-ppc/serial.h
index 6d47438be58c..485a924e4d06 100644
--- a/include/asm-ppc/serial.h
+++ b/include/asm-ppc/serial.h
@@ -18,8 +18,6 @@
18#include <platforms/powerpmc250.h> 18#include <platforms/powerpmc250.h>
19#elif defined(CONFIG_LOPEC) 19#elif defined(CONFIG_LOPEC)
20#include <platforms/lopec.h> 20#include <platforms/lopec.h>
21#elif defined(CONFIG_MCPN765)
22#include <platforms/mcpn765.h>
23#elif defined(CONFIG_MVME5100) 21#elif defined(CONFIG_MVME5100)
24#include <platforms/mvme5100.h> 22#include <platforms/mvme5100.h>
25#elif defined(CONFIG_PAL4) 23#elif defined(CONFIG_PAL4)
diff --git a/include/asm-ppc/setup.h b/include/asm-ppc/setup.h
deleted file mode 100644
index d2d19ee103df..000000000000
--- a/include/asm-ppc/setup.h
+++ /dev/null
@@ -1,14 +0,0 @@
1#ifdef __KERNEL__
2#ifndef _PPC_SETUP_H
3#define _PPC_SETUP_H
4
5#define m68k_num_memory num_memory
6#define m68k_memory memory
7
8#include <asm-m68k/setup.h>
9/* We have a bigger command line buffer. */
10#undef COMMAND_LINE_SIZE
11#define COMMAND_LINE_SIZE 512
12
13#endif /* _PPC_SETUP_H */
14#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/shmbuf.h b/include/asm-ppc/shmbuf.h
deleted file mode 100644
index 7ac0bd38cbd8..000000000000
--- a/include/asm-ppc/shmbuf.h
+++ /dev/null
@@ -1,37 +0,0 @@
1#ifndef _PPC_SHMBUF_H
2#define _PPC_SHMBUF_H
3
4/*
5 * The shmid64_ds structure for PPC architecture.
6 */
7
8struct shmid64_ds {
9 struct ipc64_perm shm_perm; /* operation perms */
10 unsigned int __unused1;
11 __kernel_time_t shm_atime; /* last attach time */
12 unsigned int __unused2;
13 __kernel_time_t shm_dtime; /* last detach time */
14 unsigned int __unused3;
15 __kernel_time_t shm_ctime; /* last change time */
16 unsigned int __unused4;
17 size_t shm_segsz; /* size of segment (bytes) */
18 __kernel_pid_t shm_cpid; /* pid of creator */
19 __kernel_pid_t shm_lpid; /* pid of last operator */
20 unsigned long shm_nattch; /* no. of current attaches */
21 unsigned long __unused5;
22 unsigned long __unused6;
23};
24
25struct shminfo64 {
26 unsigned long shmmax;
27 unsigned long shmmin;
28 unsigned long shmmni;
29 unsigned long shmseg;
30 unsigned long shmall;
31 unsigned long __unused1;
32 unsigned long __unused2;
33 unsigned long __unused3;
34 unsigned long __unused4;
35};
36
37#endif /* _PPC_SHMBUF_H */
diff --git a/include/asm-ppc/siginfo.h b/include/asm-ppc/siginfo.h
deleted file mode 100644
index 4b9435bb9049..000000000000
--- a/include/asm-ppc/siginfo.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef _PPC_SIGINFO_H
2#define _PPC_SIGINFO_H
3
4#include <asm-generic/siginfo.h>
5
6#endif
diff --git a/include/asm-ppc/socket.h b/include/asm-ppc/socket.h
deleted file mode 100644
index 296e1a3469d0..000000000000
--- a/include/asm-ppc/socket.h
+++ /dev/null
@@ -1,58 +0,0 @@
1#ifndef _ASM_SOCKET_H
2#define _ASM_SOCKET_H
3
4/* Socket-level I/O control calls. */
5#define FIOSETOWN 0x8901
6#define SIOCSPGRP 0x8902
7#define FIOGETOWN 0x8903
8#define SIOCGPGRP 0x8904
9#define SIOCATMARK 0x8905
10#define SIOCGSTAMP 0x8906 /* Get stamp */
11
12/* For setsockopt(2) */
13#define SOL_SOCKET 1
14
15#define SO_DEBUG 1
16#define SO_REUSEADDR 2
17#define SO_TYPE 3
18#define SO_ERROR 4
19#define SO_DONTROUTE 5
20#define SO_BROADCAST 6
21#define SO_SNDBUF 7
22#define SO_RCVBUF 8
23#define SO_SNDBUFFORCE 32
24#define SO_RCVBUFFORCE 33
25#define SO_KEEPALIVE 9
26#define SO_OOBINLINE 10
27#define SO_NO_CHECK 11
28#define SO_PRIORITY 12
29#define SO_LINGER 13
30#define SO_BSDCOMPAT 14
31/* To add :#define SO_REUSEPORT 15 */
32#define SO_RCVLOWAT 16
33#define SO_SNDLOWAT 17
34#define SO_RCVTIMEO 18
35#define SO_SNDTIMEO 19
36#define SO_PASSCRED 20
37#define SO_PEERCRED 21
38
39/* Security levels - as per NRL IPv6 - don't actually do anything */
40#define SO_SECURITY_AUTHENTICATION 22
41#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
42#define SO_SECURITY_ENCRYPTION_NETWORK 24
43
44#define SO_BINDTODEVICE 25
45
46/* Socket filtering */
47#define SO_ATTACH_FILTER 26
48#define SO_DETACH_FILTER 27
49
50#define SO_PEERNAME 28
51#define SO_TIMESTAMP 29
52#define SCM_TIMESTAMP SO_TIMESTAMP
53
54#define SO_ACCEPTCONN 30
55
56#define SO_PEERSEC 31
57
58#endif /* _ASM_SOCKET_H */
diff --git a/include/asm-ppc/sockios.h b/include/asm-ppc/sockios.h
deleted file mode 100644
index 385aedc55ceb..000000000000
--- a/include/asm-ppc/sockios.h
+++ /dev/null
@@ -1,17 +0,0 @@
1#ifndef _ASM_PPC_SOCKIOS_H
2#define _ASM_PPC_SOCKIOS_H
3
4#if 0 /* These are defined this way on Alpha - maybe later. */
5/* Socket-level I/O control calls. */
6
7#define FIOGETOWN _IOR('f', 123, int)
8#define FIOSETOWN _IOW('f', 124, int)
9
10#define SIOCATMARK _IOR('s', 7, int)
11#define SIOCSPGRP _IOW('s', 8, pid_t)
12#define SIOCGPGRP _IOR('s', 9, pid_t)
13
14#define SIOCGSTAMP 0x8906 /* Get stamp - linux-specific */
15#endif
16
17#endif /* _ASM_PPC_SOCKIOS_H */
diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h
index 82395f30004b..513a334c5810 100644
--- a/include/asm-ppc/system.h
+++ b/include/asm-ppc/system.h
@@ -84,9 +84,14 @@ extern void cvt_fd(float *from, double *to, unsigned long *fpscr);
84extern void cvt_df(double *from, float *to, unsigned long *fpscr); 84extern void cvt_df(double *from, float *to, unsigned long *fpscr);
85extern int call_rtas(const char *, int, int, unsigned long *, ...); 85extern int call_rtas(const char *, int, int, unsigned long *, ...);
86extern void cacheable_memzero(void *p, unsigned int nb); 86extern void cacheable_memzero(void *p, unsigned int nb);
87extern void *cacheable_memcpy(void *, const void *, unsigned int);
87extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long); 88extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long);
88extern void bad_page_fault(struct pt_regs *, unsigned long, int); 89extern void bad_page_fault(struct pt_regs *, unsigned long, int);
89extern void die(const char *, struct pt_regs *, long); 90extern void die(const char *, struct pt_regs *, long);
91#ifdef CONFIG_BOOKE_WDT
92extern u32 booke_wdt_enabled;
93extern u32 booke_wdt_period;
94#endif /* CONFIG_BOOKE_WDT */
90 95
91struct device_node; 96struct device_node;
92extern void note_scsi_host(struct device_node *, void *); 97extern void note_scsi_host(struct device_node *, void *);
diff --git a/include/asm-ppc/termbits.h b/include/asm-ppc/termbits.h
deleted file mode 100644
index c343fb7bdfed..000000000000
--- a/include/asm-ppc/termbits.h
+++ /dev/null
@@ -1,185 +0,0 @@
1#ifndef _PPC_TERMBITS_H
2#define _PPC_TERMBITS_H
3
4typedef unsigned char cc_t;
5typedef unsigned int speed_t;
6typedef unsigned int tcflag_t;
7
8/*
9 * termios type and macro definitions. Be careful about adding stuff
10 * to this file since it's used in GNU libc and there are strict rules
11 * concerning namespace pollution.
12 */
13
14#define NCCS 19
15struct termios {
16 tcflag_t c_iflag; /* input mode flags */
17 tcflag_t c_oflag; /* output mode flags */
18 tcflag_t c_cflag; /* control mode flags */
19 tcflag_t c_lflag; /* local mode flags */
20 cc_t c_cc[NCCS]; /* control characters */
21 cc_t c_line; /* line discipline (== c_cc[19]) */
22 speed_t c_ispeed; /* input speed */
23 speed_t c_ospeed; /* output speed */
24};
25
26/* c_cc characters */
27#define VINTR 0
28#define VQUIT 1
29#define VERASE 2
30#define VKILL 3
31#define VEOF 4
32#define VMIN 5
33#define VEOL 6
34#define VTIME 7
35#define VEOL2 8
36#define VSWTC 9
37
38#define VWERASE 10
39#define VREPRINT 11
40#define VSUSP 12
41#define VSTART 13
42#define VSTOP 14
43#define VLNEXT 15
44#define VDISCARD 16
45
46/* c_iflag bits */
47#define IGNBRK 0000001
48#define BRKINT 0000002
49#define IGNPAR 0000004
50#define PARMRK 0000010
51#define INPCK 0000020
52#define ISTRIP 0000040
53#define INLCR 0000100
54#define IGNCR 0000200
55#define ICRNL 0000400
56#define IXON 0001000
57#define IXOFF 0002000
58#define IXANY 0004000
59#define IUCLC 0010000
60#define IMAXBEL 0020000
61#define IUTF8 0040000
62
63/* c_oflag bits */
64#define OPOST 0000001
65#define ONLCR 0000002
66#define OLCUC 0000004
67
68#define OCRNL 0000010
69#define ONOCR 0000020
70#define ONLRET 0000040
71
72#define OFILL 00000100
73#define OFDEL 00000200
74#define NLDLY 00001400
75#define NL0 00000000
76#define NL1 00000400
77#define NL2 00001000
78#define NL3 00001400
79#define TABDLY 00006000
80#define TAB0 00000000
81#define TAB1 00002000
82#define TAB2 00004000
83#define TAB3 00006000
84#define XTABS 00006000 /* required by POSIX to == TAB3 */
85#define CRDLY 00030000
86#define CR0 00000000
87#define CR1 00010000
88#define CR2 00020000
89#define CR3 00030000
90#define FFDLY 00040000
91#define FF0 00000000
92#define FF1 00040000
93#define BSDLY 00100000
94#define BS0 00000000
95#define BS1 00100000
96#define VTDLY 00200000
97#define VT0 00000000
98#define VT1 00200000
99
100/* c_cflag bit meaning */
101#define CBAUD 0000377
102#define B0 0000000 /* hang up */
103#define B50 0000001
104#define B75 0000002
105#define B110 0000003
106#define B134 0000004
107#define B150 0000005
108#define B200 0000006
109#define B300 0000007
110#define B600 0000010
111#define B1200 0000011
112#define B1800 0000012
113#define B2400 0000013
114#define B4800 0000014
115#define B9600 0000015
116#define B19200 0000016
117#define B38400 0000017
118#define EXTA B19200
119#define EXTB B38400
120#define CBAUDEX 0000000
121#define B57600 00020
122#define B115200 00021
123#define B230400 00022
124#define B460800 00023
125#define B500000 00024
126#define B576000 00025
127#define B921600 00026
128#define B1000000 00027
129#define B1152000 00030
130#define B1500000 00031
131#define B2000000 00032
132#define B2500000 00033
133#define B3000000 00034
134#define B3500000 00035
135#define B4000000 00036
136
137#define CSIZE 00001400
138#define CS5 00000000
139#define CS6 00000400
140#define CS7 00001000
141#define CS8 00001400
142
143#define CSTOPB 00002000
144#define CREAD 00004000
145#define PARENB 00010000
146#define PARODD 00020000
147#define HUPCL 00040000
148
149#define CLOCAL 00100000
150#define CRTSCTS 020000000000 /* flow control */
151
152/* c_lflag bits */
153#define ISIG 0x00000080
154#define ICANON 0x00000100
155#define XCASE 0x00004000
156#define ECHO 0x00000008
157#define ECHOE 0x00000002
158#define ECHOK 0x00000004
159#define ECHONL 0x00000010
160#define NOFLSH 0x80000000
161#define TOSTOP 0x00400000
162#define ECHOCTL 0x00000040
163#define ECHOPRT 0x00000020
164#define ECHOKE 0x00000001
165#define FLUSHO 0x00800000
166#define PENDIN 0x20000000
167#define IEXTEN 0x00000400
168
169/* Values for the ACTION argument to `tcflow'. */
170#define TCOOFF 0
171#define TCOON 1
172#define TCIOFF 2
173#define TCION 3
174
175/* Values for the QUEUE_SELECTOR argument to `tcflush'. */
176#define TCIFLUSH 0
177#define TCOFLUSH 1
178#define TCIOFLUSH 2
179
180/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */
181#define TCSANOW 0
182#define TCSADRAIN 1
183#define TCSAFLUSH 2
184
185#endif /* _PPC_TERMBITS_H */
diff --git a/include/asm-ppc/termios.h b/include/asm-ppc/termios.h
deleted file mode 100644
index 97c6287a6cba..000000000000
--- a/include/asm-ppc/termios.h
+++ /dev/null
@@ -1,232 +0,0 @@
1#ifndef _PPC_TERMIOS_H
2#define _PPC_TERMIOS_H
3
4/*
5 * Liberally adapted from alpha/termios.h. In particular, the c_cc[]
6 * fields have been reordered so that termio & termios share the
7 * common subset in the same order (for brain dead programs that don't
8 * know or care about the differences).
9 */
10
11#include <asm/ioctls.h>
12#include <asm/termbits.h>
13
14struct sgttyb {
15 char sg_ispeed;
16 char sg_ospeed;
17 char sg_erase;
18 char sg_kill;
19 short sg_flags;
20};
21
22struct tchars {
23 char t_intrc;
24 char t_quitc;
25 char t_startc;
26 char t_stopc;
27 char t_eofc;
28 char t_brkc;
29};
30
31struct ltchars {
32 char t_suspc;
33 char t_dsuspc;
34 char t_rprntc;
35 char t_flushc;
36 char t_werasc;
37 char t_lnextc;
38};
39
40#define FIOCLEX _IO('f', 1)
41#define FIONCLEX _IO('f', 2)
42#define FIOASYNC _IOW('f', 125, int)
43#define FIONBIO _IOW('f', 126, int)
44#define FIONREAD _IOR('f', 127, int)
45#define TIOCINQ FIONREAD
46#define FIOQSIZE _IOR('f', 128, loff_t)
47
48#define TIOCGETP _IOR('t', 8, struct sgttyb)
49#define TIOCSETP _IOW('t', 9, struct sgttyb)
50#define TIOCSETN _IOW('t', 10, struct sgttyb) /* TIOCSETP wo flush */
51
52#define TIOCSETC _IOW('t', 17, struct tchars)
53#define TIOCGETC _IOR('t', 18, struct tchars)
54#define TCGETS _IOR('t', 19, struct termios)
55#define TCSETS _IOW('t', 20, struct termios)
56#define TCSETSW _IOW('t', 21, struct termios)
57#define TCSETSF _IOW('t', 22, struct termios)
58
59#define TCGETA _IOR('t', 23, struct termio)
60#define TCSETA _IOW('t', 24, struct termio)
61#define TCSETAW _IOW('t', 25, struct termio)
62#define TCSETAF _IOW('t', 28, struct termio)
63
64#define TCSBRK _IO('t', 29)
65#define TCXONC _IO('t', 30)
66#define TCFLSH _IO('t', 31)
67
68#define TIOCSWINSZ _IOW('t', 103, struct winsize)
69#define TIOCGWINSZ _IOR('t', 104, struct winsize)
70#define TIOCSTART _IO('t', 110) /* start output, like ^Q */
71#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */
72#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */
73
74#define TIOCGLTC _IOR('t', 116, struct ltchars)
75#define TIOCSLTC _IOW('t', 117, struct ltchars)
76#define TIOCSPGRP _IOW('t', 118, int)
77#define TIOCGPGRP _IOR('t', 119, int)
78
79#define TIOCEXCL 0x540C
80#define TIOCNXCL 0x540D
81#define TIOCSCTTY 0x540E
82
83#define TIOCSTI 0x5412
84#define TIOCMGET 0x5415
85#define TIOCMBIS 0x5416
86#define TIOCMBIC 0x5417
87#define TIOCMSET 0x5418
88#define TIOCGSOFTCAR 0x5419
89#define TIOCSSOFTCAR 0x541A
90#define TIOCLINUX 0x541C
91#define TIOCCONS 0x541D
92#define TIOCGSERIAL 0x541E
93#define TIOCSSERIAL 0x541F
94#define TIOCPKT 0x5420
95
96#define TIOCNOTTY 0x5422
97#define TIOCSETD 0x5423
98#define TIOCGETD 0x5424
99#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
100
101#define TIOCSERCONFIG 0x5453
102#define TIOCSERGWILD 0x5454
103#define TIOCSERSWILD 0x5455
104#define TIOCGLCKTRMIOS 0x5456
105#define TIOCSLCKTRMIOS 0x5457
106#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
107#define TIOCSERGETLSR 0x5459 /* Get line status register */
108#define TIOCSERGETMULTI 0x545A /* Get multiport config */
109#define TIOCSERSETMULTI 0x545B /* Set multiport config */
110
111#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
112#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
113
114/* Used for packet mode */
115#define TIOCPKT_DATA 0
116#define TIOCPKT_FLUSHREAD 1
117#define TIOCPKT_FLUSHWRITE 2
118#define TIOCPKT_STOP 4
119#define TIOCPKT_START 8
120#define TIOCPKT_NOSTOP 16
121#define TIOCPKT_DOSTOP 32
122
123struct winsize {
124 unsigned short ws_row;
125 unsigned short ws_col;
126 unsigned short ws_xpixel;
127 unsigned short ws_ypixel;
128};
129
130#define NCC 10
131struct termio {
132 unsigned short c_iflag; /* input mode flags */
133 unsigned short c_oflag; /* output mode flags */
134 unsigned short c_cflag; /* control mode flags */
135 unsigned short c_lflag; /* local mode flags */
136 unsigned char c_line; /* line discipline */
137 unsigned char c_cc[NCC]; /* control characters */
138};
139
140/* c_cc characters */
141#define _VINTR 0
142#define _VQUIT 1
143#define _VERASE 2
144#define _VKILL 3
145#define _VEOF 4
146#define _VMIN 5
147#define _VEOL 6
148#define _VTIME 7
149#define _VEOL2 8
150#define _VSWTC 9
151
152#ifdef __KERNEL__
153/* ^C ^\ del ^U ^D 1 0 0 0 0 ^W ^R ^Z ^Q ^S ^V ^U */
154#define INIT_C_CC "\003\034\177\025\004\001\000\000\000\000\027\022\032\021\023\026\025"
155#endif /* __KERNEL__ */
156
157/* modem lines */
158#define TIOCM_LE 0x001
159#define TIOCM_DTR 0x002
160#define TIOCM_RTS 0x004
161#define TIOCM_ST 0x008
162#define TIOCM_SR 0x010
163#define TIOCM_CTS 0x020
164#define TIOCM_CAR 0x040
165#define TIOCM_RNG 0x080
166#define TIOCM_DSR 0x100
167#define TIOCM_CD TIOCM_CAR
168#define TIOCM_RI TIOCM_RNG
169#define TIOCM_OUT1 0x2000
170#define TIOCM_OUT2 0x4000
171#define TIOCM_LOOP 0x8000
172
173/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
174#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
175
176/* line disciplines */
177#define N_TTY 0
178#define N_SLIP 1
179#define N_MOUSE 2
180#define N_PPP 3
181#define N_STRIP 4
182#define N_AX25 5
183#define N_X25 6 /* X.25 async */
184#define N_6PACK 7
185#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
186#define N_R3964 9 /* Reserved for Simatic R3964 module */
187#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
188#define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */
189#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
190#define N_HDLC 13 /* synchronous HDLC */
191#define N_SYNC_PPP 14
192#define N_HCI 15 /* Bluetooth HCI UART */
193
194#ifdef __KERNEL__
195
196/*
197 * Translate a "termio" structure into a "termios". Ugh.
198 */
199#define SET_LOW_TERMIOS_BITS(termios, termio, x) { \
200 unsigned short __tmp; \
201 get_user(__tmp,&(termio)->x); \
202 (termios)->x = (0xffff0000 & (termios)->x) | __tmp; \
203}
204
205#define user_termio_to_kernel_termios(termios, termio) \
206({ \
207 SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \
208 SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \
209 SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \
210 SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \
211 copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
212})
213
214/*
215 * Translate a "termios" structure into a "termio". Ugh.
216 */
217#define kernel_termios_to_user_termio(termio, termios) \
218({ \
219 put_user((termios)->c_iflag, &(termio)->c_iflag); \
220 put_user((termios)->c_oflag, &(termio)->c_oflag); \
221 put_user((termios)->c_cflag, &(termio)->c_cflag); \
222 put_user((termios)->c_lflag, &(termio)->c_lflag); \
223 put_user((termios)->c_line, &(termio)->c_line); \
224 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
225})
226
227#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios))
228#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios))
229
230#endif /* __KERNEL__ */
231
232#endif /* _PPC_TERMIOS_H */
diff --git a/include/asm-ppc/topology.h b/include/asm-ppc/topology.h
deleted file mode 100644
index 6a029bbba6e1..000000000000
--- a/include/asm-ppc/topology.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef _ASM_PPC_TOPOLOGY_H
2#define _ASM_PPC_TOPOLOGY_H
3
4#include <asm-generic/topology.h>
5
6#endif /* _ASM_PPC_TOPOLOGY_H */
diff --git a/include/asm-ppc/types.h b/include/asm-ppc/types.h
index a787bc032587..77dc24d7d2ad 100644
--- a/include/asm-ppc/types.h
+++ b/include/asm-ppc/types.h
@@ -62,8 +62,6 @@ typedef u64 sector_t;
62#define HAVE_SECTOR_T 62#define HAVE_SECTOR_T
63#endif 63#endif
64 64
65typedef unsigned int kmem_bufctl_t;
66
67#endif /* __ASSEMBLY__ */ 65#endif /* __ASSEMBLY__ */
68 66
69#endif /* __KERNEL__ */ 67#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/uaccess.h b/include/asm-ppc/uaccess.h
index b044ae03ac56..63f56224da8c 100644
--- a/include/asm-ppc/uaccess.h
+++ b/include/asm-ppc/uaccess.h
@@ -37,13 +37,6 @@
37#define access_ok(type, addr, size) \ 37#define access_ok(type, addr, size) \
38 (__chk_user_ptr(addr),__access_ok((unsigned long)(addr),(size))) 38 (__chk_user_ptr(addr),__access_ok((unsigned long)(addr),(size)))
39 39
40/* this function will go away soon - use access_ok() instead */
41extern inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size)
42{
43 return access_ok(type, addr, size) ? 0 : -EFAULT;
44}
45
46
47/* 40/*
48 * The exception table consists of pairs of addresses: the first is the 41 * The exception table consists of pairs of addresses: the first is the
49 * address of an instruction that is allowed to fault, and the second is 42 * address of an instruction that is allowed to fault, and the second is
diff --git a/include/asm-ppc64/auxvec.h b/include/asm-ppc64/auxvec.h
new file mode 100644
index 000000000000..ac6381a106e1
--- /dev/null
+++ b/include/asm-ppc64/auxvec.h
@@ -0,0 +1,19 @@
1#ifndef __PPC64_AUXVEC_H
2#define __PPC64_AUXVEC_H
3
4/*
5 * We need to put in some extra aux table entries to tell glibc what
6 * the cache block size is, so it can use the dcbz instruction safely.
7 */
8#define AT_DCACHEBSIZE 19
9#define AT_ICACHEBSIZE 20
10#define AT_UCACHEBSIZE 21
11/* A special ignored type value for PPC, for glibc compatibility. */
12#define AT_IGNOREPPC 22
13
14/* The vDSO location. We have to use the same value as x86 for glibc's
15 * sake :-)
16 */
17#define AT_SYSINFO_EHDR 33
18
19#endif /* __PPC64_AUXVEC_H */
diff --git a/include/asm-ppc64/bugs.h b/include/asm-ppc64/bugs.h
deleted file mode 100644
index 861074b3cf71..000000000000
--- a/include/asm-ppc64/bugs.h
+++ /dev/null
@@ -1,12 +0,0 @@
1/*
2 * This file is included by 'init/main.c' to check for architecture-dependent
3 * bugs.
4 *
5 */
6#ifndef _ASM_PPC64_BUGS_H
7#define _ASM_PPC64_BUGS_H
8
9static void check_bugs(void) {
10}
11
12#endif /* _ASM_PPC64_BUGS_H */
diff --git a/include/asm-ppc64/compat.h b/include/asm-ppc64/compat.h
index 12414f5fc666..6ec62cd2d1d1 100644
--- a/include/asm-ppc64/compat.h
+++ b/include/asm-ppc64/compat.h
@@ -13,8 +13,10 @@ typedef s32 compat_ssize_t;
13typedef s32 compat_time_t; 13typedef s32 compat_time_t;
14typedef s32 compat_clock_t; 14typedef s32 compat_clock_t;
15typedef s32 compat_pid_t; 15typedef s32 compat_pid_t;
16typedef u32 compat_uid_t; 16typedef u32 __compat_uid_t;
17typedef u32 compat_gid_t; 17typedef u32 __compat_gid_t;
18typedef u32 __compat_uid32_t;
19typedef u32 __compat_gid32_t;
18typedef u32 compat_mode_t; 20typedef u32 compat_mode_t;
19typedef u32 compat_ino_t; 21typedef u32 compat_ino_t;
20typedef u32 compat_dev_t; 22typedef u32 compat_dev_t;
@@ -48,8 +50,8 @@ struct compat_stat {
48 compat_ino_t st_ino; 50 compat_ino_t st_ino;
49 compat_mode_t st_mode; 51 compat_mode_t st_mode;
50 compat_nlink_t st_nlink; 52 compat_nlink_t st_nlink;
51 compat_uid_t st_uid; 53 __compat_uid32_t st_uid;
52 compat_gid_t st_gid; 54 __compat_gid32_t st_gid;
53 compat_dev_t st_rdev; 55 compat_dev_t st_rdev;
54 compat_off_t st_size; 56 compat_off_t st_size;
55 compat_off_t st_blksize; 57 compat_off_t st_blksize;
@@ -144,10 +146,10 @@ static inline void __user *compat_alloc_user_space(long len)
144 */ 146 */
145struct compat_ipc64_perm { 147struct compat_ipc64_perm {
146 compat_key_t key; 148 compat_key_t key;
147 compat_uid_t uid; 149 __compat_uid_t uid;
148 compat_gid_t gid; 150 __compat_gid_t gid;
149 compat_uid_t cuid; 151 __compat_uid_t cuid;
150 compat_gid_t cgid; 152 __compat_gid_t cgid;
151 compat_mode_t mode; 153 compat_mode_t mode;
152 unsigned int seq; 154 unsigned int seq;
153 unsigned int __pad2; 155 unsigned int __pad2;
diff --git a/include/asm-ppc64/cputable.h b/include/asm-ppc64/cputable.h
index ae6cf3830108..acc9b4d6c168 100644
--- a/include/asm-ppc64/cputable.h
+++ b/include/asm-ppc64/cputable.h
@@ -36,6 +36,7 @@
36 * via the mkdefs mechanism. 36 * via the mkdefs mechanism.
37 */ 37 */
38struct cpu_spec; 38struct cpu_spec;
39struct op_ppc64_model;
39 40
40typedef void (*cpu_setup_t)(unsigned long offset, struct cpu_spec* spec); 41typedef void (*cpu_setup_t)(unsigned long offset, struct cpu_spec* spec);
41 42
@@ -52,10 +53,19 @@ struct cpu_spec {
52 unsigned int icache_bsize; 53 unsigned int icache_bsize;
53 unsigned int dcache_bsize; 54 unsigned int dcache_bsize;
54 55
56 /* number of performance monitor counters */
57 unsigned int num_pmcs;
58
55 /* this is called to initialize various CPU bits like L1 cache, 59 /* this is called to initialize various CPU bits like L1 cache,
56 * BHT, SPD, etc... from head.S before branching to identify_machine 60 * BHT, SPD, etc... from head.S before branching to identify_machine
57 */ 61 */
58 cpu_setup_t cpu_setup; 62 cpu_setup_t cpu_setup;
63
64 /* Used by oprofile userspace to select the right counters */
65 char *oprofile_cpu_type;
66
67 /* Processor specific oprofile operations */
68 struct op_ppc64_model *oprofile_model;
59}; 69};
60 70
61extern struct cpu_spec cpu_specs[]; 71extern struct cpu_spec cpu_specs[];
@@ -95,7 +105,7 @@ static inline unsigned long cpu_has_feature(unsigned long feature)
95#define CPU_FTR_NODSISRALIGN ASM_CONST(0x0000001000000000) 105#define CPU_FTR_NODSISRALIGN ASM_CONST(0x0000001000000000)
96#define CPU_FTR_IABR ASM_CONST(0x0000002000000000) 106#define CPU_FTR_IABR ASM_CONST(0x0000002000000000)
97#define CPU_FTR_MMCRA ASM_CONST(0x0000004000000000) 107#define CPU_FTR_MMCRA ASM_CONST(0x0000004000000000)
98#define CPU_FTR_PMC8 ASM_CONST(0x0000008000000000) 108/* unused ASM_CONST(0x0000008000000000) */
99#define CPU_FTR_SMT ASM_CONST(0x0000010000000000) 109#define CPU_FTR_SMT ASM_CONST(0x0000010000000000)
100#define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0000020000000000) 110#define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0000020000000000)
101#define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0000040000000000) 111#define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0000040000000000)
diff --git a/include/asm-ppc64/eeh.h b/include/asm-ppc64/eeh.h
index 94298b106a4b..40c8eb57493e 100644
--- a/include/asm-ppc64/eeh.h
+++ b/include/asm-ppc64/eeh.h
@@ -219,23 +219,24 @@ static inline void eeh_raw_writeq(u64 val, volatile void __iomem *addr)
219static inline void eeh_memset_io(volatile void __iomem *addr, int c, 219static inline void eeh_memset_io(volatile void __iomem *addr, int c,
220 unsigned long n) 220 unsigned long n)
221{ 221{
222 void *p = (void __force *)addr;
222 u32 lc = c; 223 u32 lc = c;
223 lc |= lc << 8; 224 lc |= lc << 8;
224 lc |= lc << 16; 225 lc |= lc << 16;
225 226
226 while(n && !EEH_CHECK_ALIGN(addr, 4)) { 227 while(n && !EEH_CHECK_ALIGN(p, 4)) {
227 *((volatile u8 *)addr) = c; 228 *((volatile u8 *)p) = c;
228 addr = (void *)((unsigned long)addr + 1); 229 p++;
229 n--; 230 n--;
230 } 231 }
231 while(n >= 4) { 232 while(n >= 4) {
232 *((volatile u32 *)addr) = lc; 233 *((volatile u32 *)p) = lc;
233 addr = (void *)((unsigned long)addr + 4); 234 p += 4;
234 n -= 4; 235 n -= 4;
235 } 236 }
236 while(n) { 237 while(n) {
237 *((volatile u8 *)addr) = c; 238 *((volatile u8 *)p) = c;
238 addr = (void *)((unsigned long)addr + 1); 239 p++;
239 n--; 240 n--;
240 } 241 }
241 __asm__ __volatile__ ("sync" : : : "memory"); 242 __asm__ __volatile__ ("sync" : : : "memory");
@@ -250,22 +251,22 @@ static inline void eeh_memcpy_fromio(void *dest, const volatile void __iomem *sr
250 while(n && (!EEH_CHECK_ALIGN(vsrc, 4) || !EEH_CHECK_ALIGN(dest, 4))) { 251 while(n && (!EEH_CHECK_ALIGN(vsrc, 4) || !EEH_CHECK_ALIGN(dest, 4))) {
251 *((u8 *)dest) = *((volatile u8 *)vsrc); 252 *((u8 *)dest) = *((volatile u8 *)vsrc);
252 __asm__ __volatile__ ("eieio" : : : "memory"); 253 __asm__ __volatile__ ("eieio" : : : "memory");
253 vsrc = (void *)((unsigned long)vsrc + 1); 254 vsrc++;
254 dest = (void *)((unsigned long)dest + 1); 255 dest++;
255 n--; 256 n--;
256 } 257 }
257 while(n > 4) { 258 while(n > 4) {
258 *((u32 *)dest) = *((volatile u32 *)vsrc); 259 *((u32 *)dest) = *((volatile u32 *)vsrc);
259 __asm__ __volatile__ ("eieio" : : : "memory"); 260 __asm__ __volatile__ ("eieio" : : : "memory");
260 vsrc = (void *)((unsigned long)vsrc + 4); 261 vsrc += 4;
261 dest = (void *)((unsigned long)dest + 4); 262 dest += 4;
262 n -= 4; 263 n -= 4;
263 } 264 }
264 while(n) { 265 while(n) {
265 *((u8 *)dest) = *((volatile u8 *)vsrc); 266 *((u8 *)dest) = *((volatile u8 *)vsrc);
266 __asm__ __volatile__ ("eieio" : : : "memory"); 267 __asm__ __volatile__ ("eieio" : : : "memory");
267 vsrc = (void *)((unsigned long)vsrc + 1); 268 vsrc++;
268 dest = (void *)((unsigned long)dest + 1); 269 dest++;
269 n--; 270 n--;
270 } 271 }
271 __asm__ __volatile__ ("sync" : : : "memory"); 272 __asm__ __volatile__ ("sync" : : : "memory");
@@ -286,20 +287,20 @@ static inline void eeh_memcpy_toio(volatile void __iomem *dest, const void *src,
286 287
287 while(n && (!EEH_CHECK_ALIGN(vdest, 4) || !EEH_CHECK_ALIGN(src, 4))) { 288 while(n && (!EEH_CHECK_ALIGN(vdest, 4) || !EEH_CHECK_ALIGN(src, 4))) {
288 *((volatile u8 *)vdest) = *((u8 *)src); 289 *((volatile u8 *)vdest) = *((u8 *)src);
289 src = (void *)((unsigned long)src + 1); 290 src++;
290 vdest = (void *)((unsigned long)vdest + 1); 291 vdest++;
291 n--; 292 n--;
292 } 293 }
293 while(n > 4) { 294 while(n > 4) {
294 *((volatile u32 *)vdest) = *((volatile u32 *)src); 295 *((volatile u32 *)vdest) = *((volatile u32 *)src);
295 src = (void *)((unsigned long)src + 4); 296 src += 4;
296 vdest = (void *)((unsigned long)vdest + 4); 297 vdest += 4;
297 n-=4; 298 n-=4;
298 } 299 }
299 while(n) { 300 while(n) {
300 *((volatile u8 *)vdest) = *((u8 *)src); 301 *((volatile u8 *)vdest) = *((u8 *)src);
301 src = (void *)((unsigned long)src + 1); 302 src++;
302 vdest = (void *)((unsigned long)vdest + 1); 303 vdest++;
303 n--; 304 n--;
304 } 305 }
305 __asm__ __volatile__ ("sync" : : : "memory"); 306 __asm__ __volatile__ ("sync" : : : "memory");
diff --git a/include/asm-ppc64/elf.h b/include/asm-ppc64/elf.h
index 085eedb956fe..c919a89343db 100644
--- a/include/asm-ppc64/elf.h
+++ b/include/asm-ppc64/elf.h
@@ -4,6 +4,7 @@
4#include <asm/types.h> 4#include <asm/types.h>
5#include <asm/ptrace.h> 5#include <asm/ptrace.h>
6#include <asm/cputable.h> 6#include <asm/cputable.h>
7#include <asm/auxvec.h>
7 8
8/* PowerPC relocations defined by the ABIs */ 9/* PowerPC relocations defined by the ABIs */
9#define R_PPC_NONE 0 10#define R_PPC_NONE 0
@@ -237,21 +238,6 @@ do { \
237 238
238#endif 239#endif
239 240
240/*
241 * We need to put in some extra aux table entries to tell glibc what
242 * the cache block size is, so it can use the dcbz instruction safely.
243 */
244#define AT_DCACHEBSIZE 19
245#define AT_ICACHEBSIZE 20
246#define AT_UCACHEBSIZE 21
247/* A special ignored type value for PPC, for glibc compatibility. */
248#define AT_IGNOREPPC 22
249
250/* The vDSO location. We have to use the same value as x86 for glibc's
251 * sake :-)
252 */
253#define AT_SYSINFO_EHDR 33
254
255extern int dcache_bsize; 241extern int dcache_bsize;
256extern int icache_bsize; 242extern int icache_bsize;
257extern int ucache_bsize; 243extern int ucache_bsize;
diff --git a/include/asm-ppc64/fcntl.h b/include/asm-ppc64/fcntl.h
deleted file mode 100644
index 842560d50656..000000000000
--- a/include/asm-ppc64/fcntl.h
+++ /dev/null
@@ -1,89 +0,0 @@
1#ifndef _PPC64_FCNTL_H
2#define _PPC64_FCNTL_H
3
4/*
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
12 located on an ext2 file system */
13#define O_ACCMODE 0003
14#define O_RDONLY 00
15#define O_WRONLY 01
16#define O_RDWR 02
17#define O_CREAT 0100 /* not fcntl */
18#define O_EXCL 0200 /* not fcntl */
19#define O_NOCTTY 0400 /* not fcntl */
20#define O_TRUNC 01000 /* not fcntl */
21#define O_APPEND 02000
22#define O_NONBLOCK 04000
23#define O_NDELAY O_NONBLOCK
24#define O_SYNC 010000
25#define FASYNC 020000 /* fcntl, for BSD compatibility */
26#define O_DIRECTORY 040000 /* must be a directory */
27#define O_NOFOLLOW 0100000 /* don't follow links */
28#define O_LARGEFILE 0200000
29#define O_DIRECT 0400000 /* direct disk access hint */
30#define O_NOATIME 01000000
31
32#define F_DUPFD 0 /* dup */
33#define F_GETFD 1 /* get close_on_exec */
34#define F_SETFD 2 /* set/clear close_on_exec */
35#define F_GETFL 3 /* get file->f_flags */
36#define F_SETFL 4 /* set file->f_flags */
37#define F_GETLK 5
38#define F_SETLK 6
39#define F_SETLKW 7
40
41#define F_SETOWN 8 /* for sockets. */
42#define F_GETOWN 9 /* for sockets. */
43#define F_SETSIG 10 /* for sockets. */
44#define F_GETSIG 11 /* for sockets. */
45
46/* for F_[GET|SET]FL */
47#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
48
49/* for posix fcntl() and lockf() */
50#define F_RDLCK 0
51#define F_WRLCK 1
52#define F_UNLCK 2
53
54/* for old implementation of bsd flock () */
55#define F_EXLCK 4 /* or 3 */
56#define F_SHLCK 8 /* or 4 */
57
58/* for leases */
59#define F_INPROGRESS 16
60
61/* operations for bsd flock(), also used by the kernel implementation */
62#define LOCK_SH 1 /* shared lock */
63#define LOCK_EX 2 /* exclusive lock */
64#define LOCK_NB 4 /* or'd with one of the above to prevent
65 blocking */
66#define LOCK_UN 8 /* remove lock */
67
68#define LOCK_MAND 32 /* This is a mandatory flock */
69#define LOCK_READ 64 /* ... Which allows concurrent read operations */
70#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
71#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
72
73#ifdef __KERNEL__
74#define F_POSIX 1
75#define F_FLOCK 2
76#define F_BROKEN 4 /* broken flock() emulation */
77#endif /* __KERNEL__ */
78
79struct flock {
80 short l_type;
81 short l_whence;
82 off_t l_start;
83 off_t l_len;
84 pid_t l_pid;
85};
86
87#define F_LINUX_SPECIFIC_BASE 1024
88
89#endif /* _PPC64_FCNTL_H */
diff --git a/include/asm-ppc64/futex.h b/include/asm-ppc64/futex.h
new file mode 100644
index 000000000000..cb2640b3a408
--- /dev/null
+++ b/include/asm-ppc64/futex.h
@@ -0,0 +1,83 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/memory.h>
9#include <asm/uaccess.h>
10
11#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \
12 __asm__ __volatile (SYNC_ON_SMP \
13"1: lwarx %0,0,%2\n" \
14 insn \
15"2: stwcx. %1,0,%2\n\
16 bne- 1b\n\
17 li %1,0\n\
183: .section .fixup,\"ax\"\n\
194: li %1,%3\n\
20 b 3b\n\
21 .previous\n\
22 .section __ex_table,\"a\"\n\
23 .align 3\n\
24 .llong 1b,4b,2b,4b\n\
25 .previous" \
26 : "=&r" (oldval), "=&r" (ret) \
27 : "b" (uaddr), "i" (-EFAULT), "1" (oparg) \
28 : "cr0", "memory")
29
30static inline int
31futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
32{
33 int op = (encoded_op >> 28) & 7;
34 int cmp = (encoded_op >> 24) & 15;
35 int oparg = (encoded_op << 8) >> 20;
36 int cmparg = (encoded_op << 20) >> 20;
37 int oldval = 0, ret;
38 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
39 oparg = 1 << oparg;
40
41 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
42 return -EFAULT;
43
44 inc_preempt_count();
45
46 switch (op) {
47 case FUTEX_OP_SET:
48 __futex_atomic_op("", ret, oldval, uaddr, oparg);
49 break;
50 case FUTEX_OP_ADD:
51 __futex_atomic_op("add %1,%0,%1\n", ret, oldval, uaddr, oparg);
52 break;
53 case FUTEX_OP_OR:
54 __futex_atomic_op("or %1,%0,%1\n", ret, oldval, uaddr, oparg);
55 break;
56 case FUTEX_OP_ANDN:
57 __futex_atomic_op("andc %1,%0,%1\n", ret, oldval, uaddr, oparg);
58 break;
59 case FUTEX_OP_XOR:
60 __futex_atomic_op("xor %1,%0,%1\n", ret, oldval, uaddr, oparg);
61 break;
62 default:
63 ret = -ENOSYS;
64 }
65
66 dec_preempt_count();
67
68 if (!ret) {
69 switch (cmp) {
70 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
71 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
72 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
73 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
74 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
75 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
76 default: ret = -ENOSYS;
77 }
78 }
79 return ret;
80}
81
82#endif
83#endif
diff --git a/include/asm-ppc64/io.h b/include/asm-ppc64/io.h
index aba1dfa388ba..59c958aea4db 100644
--- a/include/asm-ppc64/io.h
+++ b/include/asm-ppc64/io.h
@@ -20,10 +20,10 @@
20 20
21#include <asm-generic/iomap.h> 21#include <asm-generic/iomap.h>
22 22
23#define __ide_mm_insw(p, a, c) _insw_ns((volatile u16 *)(p), (a), (c)) 23#define __ide_mm_insw(p, a, c) _insw_ns((volatile u16 __iomem *)(p), (a), (c))
24#define __ide_mm_insl(p, a, c) _insl_ns((volatile u32 *)(p), (a), (c)) 24#define __ide_mm_insl(p, a, c) _insl_ns((volatile u32 __iomem *)(p), (a), (c))
25#define __ide_mm_outsw(p, a, c) _outsw_ns((volatile u16 *)(p), (a), (c)) 25#define __ide_mm_outsw(p, a, c) _outsw_ns((volatile u16 __iomem *)(p), (a), (c))
26#define __ide_mm_outsl(p, a, c) _outsl_ns((volatile u32 *)(p), (a), (c)) 26#define __ide_mm_outsl(p, a, c) _outsl_ns((volatile u32 __iomem *)(p), (a), (c))
27 27
28 28
29#define SIO_CONFIG_RA 0x398 29#define SIO_CONFIG_RA 0x398
@@ -71,8 +71,8 @@ extern unsigned long io_page_mask;
71 * Neither do the standard versions now, these are just here 71 * Neither do the standard versions now, these are just here
72 * for older code. 72 * for older code.
73 */ 73 */
74#define insw_ns(port, buf, ns) _insw_ns((u16 *)((port)+pci_io_base), (buf), (ns)) 74#define insw_ns(port, buf, ns) _insw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns))
75#define insl_ns(port, buf, nl) _insl_ns((u32 *)((port)+pci_io_base), (buf), (nl)) 75#define insl_ns(port, buf, nl) _insl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl))
76#else 76#else
77 77
78static inline unsigned char __raw_readb(const volatile void __iomem *addr) 78static inline unsigned char __raw_readb(const volatile void __iomem *addr)
@@ -136,9 +136,9 @@ static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr)
136#define insw_ns(port, buf, ns) eeh_insw_ns((port), (buf), (ns)) 136#define insw_ns(port, buf, ns) eeh_insw_ns((port), (buf), (ns))
137#define insl_ns(port, buf, nl) eeh_insl_ns((port), (buf), (nl)) 137#define insl_ns(port, buf, nl) eeh_insl_ns((port), (buf), (nl))
138 138
139#define outsb(port, buf, ns) _outsb((u8 *)((port)+pci_io_base), (buf), (ns)) 139#define outsb(port, buf, ns) _outsb((u8 __iomem *)((port)+pci_io_base), (buf), (ns))
140#define outsw(port, buf, ns) _outsw_ns((u16 *)((port)+pci_io_base), (buf), (ns)) 140#define outsw(port, buf, ns) _outsw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns))
141#define outsl(port, buf, nl) _outsl_ns((u32 *)((port)+pci_io_base), (buf), (nl)) 141#define outsl(port, buf, nl) _outsl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl))
142 142
143#endif 143#endif
144 144
@@ -147,16 +147,16 @@ static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr)
147#define readl_relaxed(addr) readl(addr) 147#define readl_relaxed(addr) readl(addr)
148#define readq_relaxed(addr) readq(addr) 148#define readq_relaxed(addr) readq(addr)
149 149
150extern void _insb(volatile u8 *port, void *buf, int ns); 150extern void _insb(volatile u8 __iomem *port, void *buf, int ns);
151extern void _outsb(volatile u8 *port, const void *buf, int ns); 151extern void _outsb(volatile u8 __iomem *port, const void *buf, int ns);
152extern void _insw(volatile u16 *port, void *buf, int ns); 152extern void _insw(volatile u16 __iomem *port, void *buf, int ns);
153extern void _outsw(volatile u16 *port, const void *buf, int ns); 153extern void _outsw(volatile u16 __iomem *port, const void *buf, int ns);
154extern void _insl(volatile u32 *port, void *buf, int nl); 154extern void _insl(volatile u32 __iomem *port, void *buf, int nl);
155extern void _outsl(volatile u32 *port, const void *buf, int nl); 155extern void _outsl(volatile u32 __iomem *port, const void *buf, int nl);
156extern void _insw_ns(volatile u16 *port, void *buf, int ns); 156extern void _insw_ns(volatile u16 __iomem *port, void *buf, int ns);
157extern void _outsw_ns(volatile u16 *port, const void *buf, int ns); 157extern void _outsw_ns(volatile u16 __iomem *port, const void *buf, int ns);
158extern void _insl_ns(volatile u32 *port, void *buf, int nl); 158extern void _insl_ns(volatile u32 __iomem *port, void *buf, int nl);
159extern void _outsl_ns(volatile u32 *port, const void *buf, int nl); 159extern void _outsl_ns(volatile u32 __iomem *port, const void *buf, int nl);
160 160
161#define mmiowb() 161#define mmiowb()
162 162
@@ -176,8 +176,8 @@ extern void _outsl_ns(volatile u32 *port, const void *buf, int nl);
176 * Neither do the standard versions now, these are just here 176 * Neither do the standard versions now, these are just here
177 * for older code. 177 * for older code.
178 */ 178 */
179#define outsw_ns(port, buf, ns) _outsw_ns((u16 *)((port)+pci_io_base), (buf), (ns)) 179#define outsw_ns(port, buf, ns) _outsw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns))
180#define outsl_ns(port, buf, nl) _outsl_ns((u32 *)((port)+pci_io_base), (buf), (nl)) 180#define outsl_ns(port, buf, nl) _outsl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl))
181 181
182 182
183#define IO_SPACE_LIMIT ~(0UL) 183#define IO_SPACE_LIMIT ~(0UL)
diff --git a/include/asm-ppc64/irq.h b/include/asm-ppc64/irq.h
index 570678b1da95..99782afb4cde 100644
--- a/include/asm-ppc64/irq.h
+++ b/include/asm-ppc64/irq.h
@@ -33,6 +33,11 @@
33#define IRQ_POLARITY_POSITIVE 0x2 /* high level or low->high edge */ 33#define IRQ_POLARITY_POSITIVE 0x2 /* high level or low->high edge */
34#define IRQ_POLARITY_NEGATIVE 0x0 /* low level or high->low edge */ 34#define IRQ_POLARITY_NEGATIVE 0x0 /* low level or high->low edge */
35 35
36/*
37 * IRQ line status macro IRQ_PER_CPU is used
38 */
39#define ARCH_HAS_IRQ_PER_CPU
40
36#define get_irq_desc(irq) (&irq_desc[(irq)]) 41#define get_irq_desc(irq) (&irq_desc[(irq)])
37 42
38/* Define a way to iterate across irqs. */ 43/* Define a way to iterate across irqs. */
diff --git a/include/asm-ppc64/kprobes.h b/include/asm-ppc64/kprobes.h
index 0802919c3235..d9129d2b038e 100644
--- a/include/asm-ppc64/kprobes.h
+++ b/include/asm-ppc64/kprobes.h
@@ -42,6 +42,9 @@ typedef unsigned int kprobe_opcode_t;
42 42
43#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry) 43#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry)
44 44
45#define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \
46 IS_TWI(instr) || IS_TDI(instr))
47
45#define ARCH_SUPPORTS_KRETPROBES 48#define ARCH_SUPPORTS_KRETPROBES
46void kretprobe_trampoline(void); 49void kretprobe_trampoline(void);
47 50
diff --git a/include/asm-ppc64/lmb.h b/include/asm-ppc64/lmb.h
index cb368bf0f264..de91e034bd98 100644
--- a/include/asm-ppc64/lmb.h
+++ b/include/asm-ppc64/lmb.h
@@ -56,4 +56,26 @@ extern void lmb_dump_all(void);
56 56
57extern unsigned long io_hole_start; 57extern unsigned long io_hole_start;
58 58
59static inline unsigned long
60lmb_size_bytes(struct lmb_region *type, unsigned long region_nr)
61{
62 return type->region[region_nr].size;
63}
64static inline unsigned long
65lmb_size_pages(struct lmb_region *type, unsigned long region_nr)
66{
67 return lmb_size_bytes(type, region_nr) >> PAGE_SHIFT;
68}
69static inline unsigned long
70lmb_start_pfn(struct lmb_region *type, unsigned long region_nr)
71{
72 return type->region[region_nr].base >> PAGE_SHIFT;
73}
74static inline unsigned long
75lmb_end_pfn(struct lmb_region *type, unsigned long region_nr)
76{
77 return lmb_start_pfn(type, region_nr) +
78 lmb_size_pages(type, region_nr);
79}
80
59#endif /* _PPC64_LMB_H */ 81#endif /* _PPC64_LMB_H */
diff --git a/include/asm-ppc64/lppaca.h b/include/asm-ppc64/lppaca.h
index 70766b5f26c1..9e2a6c0649a0 100644
--- a/include/asm-ppc64/lppaca.h
+++ b/include/asm-ppc64/lppaca.h
@@ -108,7 +108,7 @@ struct lppaca
108 volatile u32 virtual_decr; // Virtual DECR for shared procsx78-x7B 108 volatile u32 virtual_decr; // Virtual DECR for shared procsx78-x7B
109 u16 slb_count; // # of SLBs to maintain x7C-x7D 109 u16 slb_count; // # of SLBs to maintain x7C-x7D
110 u8 idle; // Indicate OS is idle x7E 110 u8 idle; // Indicate OS is idle x7E
111 u8 reserved5; // Reserved x7F 111 u8 vmxregs_in_use; // VMX registers in use x7F
112 112
113 113
114//============================================================================= 114//=============================================================================
diff --git a/include/asm-ppc64/machdep.h b/include/asm-ppc64/machdep.h
index ff2c9287d3b6..9a1ef4427ed2 100644
--- a/include/asm-ppc64/machdep.h
+++ b/include/asm-ppc64/machdep.h
@@ -103,11 +103,6 @@ struct machdep_calls {
103 103
104 void (*progress)(char *, unsigned short); 104 void (*progress)(char *, unsigned short);
105 105
106 /* Debug interface. Low level I/O to some terminal device */
107 void (*udbg_putc)(unsigned char c);
108 unsigned char (*udbg_getc)(void);
109 int (*udbg_getc_poll)(void);
110
111 /* Interface for platform error logging */ 106 /* Interface for platform error logging */
112 void (*log_error)(char *buf, unsigned int err_type, int fatal); 107 void (*log_error)(char *buf, unsigned int err_type, int fatal);
113 108
diff --git a/include/asm-ppc64/memory.h b/include/asm-ppc64/memory.h
index 56e09face9a8..af53ffb55726 100644
--- a/include/asm-ppc64/memory.h
+++ b/include/asm-ppc64/memory.h
@@ -18,9 +18,11 @@
18#ifdef CONFIG_SMP 18#ifdef CONFIG_SMP
19#define EIEIO_ON_SMP "eieio\n" 19#define EIEIO_ON_SMP "eieio\n"
20#define ISYNC_ON_SMP "\n\tisync" 20#define ISYNC_ON_SMP "\n\tisync"
21#define SYNC_ON_SMP "lwsync\n\t"
21#else 22#else
22#define EIEIO_ON_SMP 23#define EIEIO_ON_SMP
23#define ISYNC_ON_SMP 24#define ISYNC_ON_SMP
25#define SYNC_ON_SMP
24#endif 26#endif
25 27
26static inline void eieio(void) 28static inline void eieio(void)
diff --git a/include/asm-ppc64/mmu.h b/include/asm-ppc64/mmu.h
index ad36bb28de29..7bc42eb087ad 100644
--- a/include/asm-ppc64/mmu.h
+++ b/include/asm-ppc64/mmu.h
@@ -54,8 +54,10 @@ extern char initial_stab[];
54#define SLB_VSID_C ASM_CONST(0x0000000000000080) /* class */ 54#define SLB_VSID_C ASM_CONST(0x0000000000000080) /* class */
55#define SLB_VSID_LS ASM_CONST(0x0000000000000070) /* size of largepage */ 55#define SLB_VSID_LS ASM_CONST(0x0000000000000070) /* size of largepage */
56 56
57#define SLB_VSID_KERNEL (SLB_VSID_KP|SLB_VSID_C) 57#define SLB_VSID_KERNEL (SLB_VSID_KP)
58#define SLB_VSID_USER (SLB_VSID_KP|SLB_VSID_KS) 58#define SLB_VSID_USER (SLB_VSID_KP|SLB_VSID_KS|SLB_VSID_C)
59
60#define SLBIE_C (0x08000000)
59 61
60/* 62/*
61 * Hash table 63 * Hash table
diff --git a/include/asm-ppc64/module.h b/include/asm-ppc64/module.h
deleted file mode 100644
index 0581607826e8..000000000000
--- a/include/asm-ppc64/module.h
+++ /dev/null
@@ -1,36 +0,0 @@
1#ifndef _ASM_PPC64_MODULE_H
2#define _ASM_PPC64_MODULE_H
3
4#include <linux/list.h>
5#include <asm/bug.h>
6
7struct mod_arch_specific
8{
9 /* Index of stubs section within module. */
10 unsigned int stubs_section;
11
12 /* What section is the TOC? */
13 unsigned int toc_section;
14
15 /* List of BUG addresses, source line numbers and filenames */
16 struct list_head bug_list;
17 struct bug_entry *bug_table;
18 unsigned int num_bugs;
19};
20
21extern struct bug_entry *module_find_bug(unsigned long bugaddr);
22
23#define Elf_Shdr Elf64_Shdr
24#define Elf_Sym Elf64_Sym
25#define Elf_Ehdr Elf64_Ehdr
26
27/* Make empty section for module_frob_arch_sections to expand. */
28#ifdef MODULE
29asm(".section .stubs,\"ax\",@nobits; .align 3; .previous");
30#endif
31
32struct exception_table_entry;
33void sort_ex_table(struct exception_table_entry *start,
34 struct exception_table_entry *finish);
35
36#endif /* _ASM_PPC64_MODULE_H */
diff --git a/include/asm-ppc64/msgbuf.h b/include/asm-ppc64/msgbuf.h
deleted file mode 100644
index 31c1cbf133cc..000000000000
--- a/include/asm-ppc64/msgbuf.h
+++ /dev/null
@@ -1,27 +0,0 @@
1#ifndef _PPC64_MSGBUF_H
2#define _PPC64_MSGBUF_H
3
4/*
5 * The msqid64_ds structure for the PPC architecture.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 */
12
13struct msqid64_ds {
14 struct ipc64_perm msg_perm;
15 __kernel_time_t msg_stime; /* last msgsnd time */
16 __kernel_time_t msg_rtime; /* last msgrcv time */
17 __kernel_time_t msg_ctime; /* last change time */
18 unsigned long msg_cbytes; /* current number of bytes on queue */
19 unsigned long msg_qnum; /* number of messages in queue */
20 unsigned long msg_qbytes; /* max number of bytes on queue */
21 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
22 __kernel_pid_t msg_lrpid; /* last receive pid */
23 unsigned long __unused1;
24 unsigned long __unused2;
25};
26
27#endif /* _PPC64_MSGBUF_H */
diff --git a/include/asm-ppc64/oprofile_impl.h b/include/asm-ppc64/oprofile_impl.h
new file mode 100644
index 000000000000..b04f1dfb1421
--- /dev/null
+++ b/include/asm-ppc64/oprofile_impl.h
@@ -0,0 +1,111 @@
1/*
2 * Copyright (C) 2004 Anton Blanchard <anton@au.ibm.com>, IBM
3 *
4 * Based on alpha version.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#ifndef OP_IMPL_H
13#define OP_IMPL_H 1
14
15#define OP_MAX_COUNTER 8
16
17/* Per-counter configuration as set via oprofilefs. */
18struct op_counter_config {
19 unsigned long valid;
20 unsigned long enabled;
21 unsigned long event;
22 unsigned long count;
23 unsigned long kernel;
24 /* We dont support per counter user/kernel selection */
25 unsigned long user;
26 unsigned long unit_mask;
27};
28
29/* System-wide configuration as set via oprofilefs. */
30struct op_system_config {
31 unsigned long mmcr0;
32 unsigned long mmcr1;
33 unsigned long mmcra;
34 unsigned long enable_kernel;
35 unsigned long enable_user;
36 unsigned long backtrace_spinlocks;
37};
38
39/* Per-arch configuration */
40struct op_ppc64_model {
41 void (*reg_setup) (struct op_counter_config *,
42 struct op_system_config *,
43 int num_counters);
44 void (*cpu_setup) (void *);
45 void (*start) (struct op_counter_config *);
46 void (*stop) (void);
47 void (*handle_interrupt) (struct pt_regs *,
48 struct op_counter_config *);
49 int num_counters;
50};
51
52extern struct op_ppc64_model op_model_rs64;
53extern struct op_ppc64_model op_model_power4;
54
55static inline unsigned int ctr_read(unsigned int i)
56{
57 switch(i) {
58 case 0:
59 return mfspr(SPRN_PMC1);
60 case 1:
61 return mfspr(SPRN_PMC2);
62 case 2:
63 return mfspr(SPRN_PMC3);
64 case 3:
65 return mfspr(SPRN_PMC4);
66 case 4:
67 return mfspr(SPRN_PMC5);
68 case 5:
69 return mfspr(SPRN_PMC6);
70 case 6:
71 return mfspr(SPRN_PMC7);
72 case 7:
73 return mfspr(SPRN_PMC8);
74 default:
75 return 0;
76 }
77}
78
79static inline void ctr_write(unsigned int i, unsigned int val)
80{
81 switch(i) {
82 case 0:
83 mtspr(SPRN_PMC1, val);
84 break;
85 case 1:
86 mtspr(SPRN_PMC2, val);
87 break;
88 case 2:
89 mtspr(SPRN_PMC3, val);
90 break;
91 case 3:
92 mtspr(SPRN_PMC4, val);
93 break;
94 case 4:
95 mtspr(SPRN_PMC5, val);
96 break;
97 case 5:
98 mtspr(SPRN_PMC6, val);
99 break;
100 case 6:
101 mtspr(SPRN_PMC7, val);
102 break;
103 case 7:
104 mtspr(SPRN_PMC8, val);
105 break;
106 default:
107 break;
108 }
109}
110
111#endif
diff --git a/include/asm-ppc64/page.h b/include/asm-ppc64/page.h
index a79a08df62bd..a15422bcf30d 100644
--- a/include/asm-ppc64/page.h
+++ b/include/asm-ppc64/page.h
@@ -172,20 +172,6 @@ typedef unsigned long pgprot_t;
172 172
173#endif 173#endif
174 174
175/* Pure 2^n version of get_order */
176static inline int get_order(unsigned long size)
177{
178 int order;
179
180 size = (size-1) >> (PAGE_SHIFT-1);
181 order = -1;
182 do {
183 size >>= 1;
184 order++;
185 } while (size);
186 return order;
187}
188
189#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET) 175#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET)
190 176
191extern int page_is_ram(unsigned long pfn); 177extern int page_is_ram(unsigned long pfn);
@@ -270,4 +256,7 @@ extern u64 ppc64_pft_size; /* Log 2 of page table size */
270 VM_STACK_DEFAULT_FLAGS32 : VM_STACK_DEFAULT_FLAGS64) 256 VM_STACK_DEFAULT_FLAGS32 : VM_STACK_DEFAULT_FLAGS64)
271 257
272#endif /* __KERNEL__ */ 258#endif /* __KERNEL__ */
259
260#include <asm-generic/page.h>
261
273#endif /* _PPC64_PAGE_H */ 262#endif /* _PPC64_PAGE_H */
diff --git a/include/asm-ppc64/param.h b/include/asm-ppc64/param.h
deleted file mode 100644
index 76c212d475b3..000000000000
--- a/include/asm-ppc64/param.h
+++ /dev/null
@@ -1,31 +0,0 @@
1#ifndef _ASM_PPC64_PARAM_H
2#define _ASM_PPC64_PARAM_H
3
4#include <linux/config.h>
5
6/*
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 */
12
13#ifdef __KERNEL__
14# define HZ CONFIG_HZ /* Internal kernel timer frequency */
15# define USER_HZ 100 /* .. some user interfaces are in "ticks" */
16# define CLOCKS_PER_SEC (USER_HZ) /* like times() */
17#endif
18
19#ifndef HZ
20#define HZ 100
21#endif
22
23#define EXEC_PAGESIZE 4096
24
25#ifndef NOGROUP
26#define NOGROUP (-1)
27#endif
28
29#define MAXHOSTNAMELEN 64 /* max length of hostname */
30
31#endif /* _ASM_PPC64_PARAM_H */
diff --git a/include/asm-ppc64/pci-bridge.h b/include/asm-ppc64/pci-bridge.h
index c4f9023ea5ed..6b4a5b1f695e 100644
--- a/include/asm-ppc64/pci-bridge.h
+++ b/include/asm-ppc64/pci-bridge.h
@@ -48,19 +48,52 @@ struct pci_controller {
48 unsigned long dma_window_size; 48 unsigned long dma_window_size;
49}; 49};
50 50
51/*
52 * PCI stuff, for nodes representing PCI devices, pointed to
53 * by device_node->data.
54 */
55struct pci_controller;
56struct iommu_table;
57
58struct pci_dn {
59 int busno; /* for pci devices */
60 int bussubno; /* for pci devices */
61 int devfn; /* for pci devices */
62 int eeh_mode; /* See eeh.h for possible EEH_MODEs */
63 int eeh_config_addr;
64 int eeh_capable; /* from firmware */
65 int eeh_check_count; /* # times driver ignored error */
66 int eeh_freeze_count; /* # times this device froze up. */
67 int eeh_is_bridge; /* device is pci-to-pci bridge */
68
69 int pci_ext_config_space; /* for pci devices */
70 struct pci_controller *phb; /* for pci devices */
71 struct iommu_table *iommu_table; /* for phb's or bridges */
72 struct pci_dev *pcidev; /* back-pointer to the pci device */
73 struct device_node *node; /* back-pointer to the device_node */
74 u32 config_space[16]; /* saved PCI config space */
75};
76
77/* Get the pointer to a device_node's pci_dn */
78#define PCI_DN(dn) ((struct pci_dn *) (dn)->data)
79
51struct device_node *fetch_dev_dn(struct pci_dev *dev); 80struct device_node *fetch_dev_dn(struct pci_dev *dev);
52 81
53/* Get a device_node from a pci_dev. This code must be fast except in the case 82/* Get a device_node from a pci_dev. This code must be fast except
54 * where the sysdata is incorrect and needs to be fixed up (hopefully just once) 83 * in the case where the sysdata is incorrect and needs to be fixed
84 * up (this will only happen once).
85 * In this case the sysdata will have been inherited from a PCI host
86 * bridge or a PCI-PCI bridge further up the tree, so it will point
87 * to a valid struct pci_dn, just not the one we want.
55 */ 88 */
56static inline struct device_node *pci_device_to_OF_node(struct pci_dev *dev) 89static inline struct device_node *pci_device_to_OF_node(struct pci_dev *dev)
57{ 90{
58 struct device_node *dn = dev->sysdata; 91 struct device_node *dn = dev->sysdata;
92 struct pci_dn *pdn = dn->data;
59 93
60 if (dn->devfn == dev->devfn && dn->busno == dev->bus->number) 94 if (pdn && pdn->devfn == dev->devfn && pdn->busno == dev->bus->number)
61 return dn; /* fast path. sysdata is good */ 95 return dn; /* fast path. sysdata is good */
62 else 96 return fetch_dev_dn(dev);
63 return fetch_dev_dn(dev);
64} 97}
65 98
66static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) 99static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
@@ -83,7 +116,7 @@ static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
83 struct device_node *busdn = bus->sysdata; 116 struct device_node *busdn = bus->sysdata;
84 117
85 BUG_ON(busdn == NULL); 118 BUG_ON(busdn == NULL);
86 return busdn->phb; 119 return PCI_DN(busdn)->phb;
87} 120}
88 121
89#endif 122#endif
diff --git a/include/asm-ppc64/pci.h b/include/asm-ppc64/pci.h
index 4d057452f59b..a88bbfc26967 100644
--- a/include/asm-ppc64/pci.h
+++ b/include/asm-ppc64/pci.h
@@ -138,6 +138,19 @@ extern void
138pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, 138pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
139 struct pci_bus_region *region); 139 struct pci_bus_region *region);
140 140
141static inline struct resource *
142pcibios_select_root(struct pci_dev *pdev, struct resource *res)
143{
144 struct resource *root = NULL;
145
146 if (res->flags & IORESOURCE_IO)
147 root = &ioport_resource;
148 if (res->flags & IORESOURCE_MEM)
149 root = &iomem_resource;
150
151 return root;
152}
153
141extern int 154extern int
142unmap_bus_range(struct pci_bus *bus); 155unmap_bus_range(struct pci_bus *bus);
143 156
diff --git a/include/asm-ppc64/processor.h b/include/asm-ppc64/processor.h
index 7bd4796f1236..8bd7aa959385 100644
--- a/include/asm-ppc64/processor.h
+++ b/include/asm-ppc64/processor.h
@@ -311,6 +311,20 @@ name: \
311 .type GLUE(.,name),@function; \ 311 .type GLUE(.,name),@function; \
312GLUE(.,name): 312GLUE(.,name):
313 313
314#define _KPROBE(name) \
315 .section ".kprobes.text","a"; \
316 .align 2 ; \
317 .globl name; \
318 .globl GLUE(.,name); \
319 .section ".opd","aw"; \
320name: \
321 .quad GLUE(.,name); \
322 .quad .TOC.@tocbase; \
323 .quad 0; \
324 .previous; \
325 .type GLUE(.,name),@function; \
326GLUE(.,name):
327
314#define _STATIC(name) \ 328#define _STATIC(name) \
315 .section ".text"; \ 329 .section ".text"; \
316 .align 2 ; \ 330 .align 2 ; \
diff --git a/include/asm-ppc64/prom.h b/include/asm-ppc64/prom.h
index dc5330b39509..c02ec1d6b909 100644
--- a/include/asm-ppc64/prom.h
+++ b/include/asm-ppc64/prom.h
@@ -116,14 +116,6 @@ struct property {
116 struct property *next; 116 struct property *next;
117}; 117};
118 118
119/* NOTE: the device_node contains PCI specific info for pci devices.
120 * This perhaps could be hung off the device_node with another struct,
121 * but for now it is directly in the node. The phb ptr is a good
122 * indication of a real PCI node. Other nodes leave these fields zeroed.
123 */
124struct pci_controller;
125struct iommu_table;
126
127struct device_node { 119struct device_node {
128 char *name; 120 char *name;
129 char *type; 121 char *type;
@@ -135,16 +127,6 @@ struct device_node {
135 struct interrupt_info *intrs; 127 struct interrupt_info *intrs;
136 char *full_name; 128 char *full_name;
137 129
138 /* PCI stuff probably doesn't belong here */
139 int busno; /* for pci devices */
140 int bussubno; /* for pci devices */
141 int devfn; /* for pci devices */
142 int eeh_mode; /* See eeh.h for possible EEH_MODEs */
143 int eeh_config_addr;
144 int pci_ext_config_space; /* for pci devices */
145 struct pci_controller *phb; /* for pci devices */
146 struct iommu_table *iommu_table; /* for phb's or bridges */
147
148 struct property *properties; 130 struct property *properties;
149 struct device_node *parent; 131 struct device_node *parent;
150 struct device_node *child; 132 struct device_node *child;
@@ -154,6 +136,7 @@ struct device_node {
154 struct proc_dir_entry *pde; /* this node's proc directory */ 136 struct proc_dir_entry *pde; /* this node's proc directory */
155 struct kref kref; 137 struct kref kref;
156 unsigned long _flags; 138 unsigned long _flags;
139 void *data;
157}; 140};
158 141
159extern struct device_node *of_chosen; 142extern struct device_node *of_chosen;
diff --git a/include/asm-ppc64/segment.h b/include/asm-ppc64/segment.h
deleted file mode 100644
index d80fb68cc79e..000000000000
--- a/include/asm-ppc64/segment.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __PPC64_SEGMENT_H
2#define __PPC64_SEGMENT_H
3
4/* Only here because we have some old header files that expect it.. */
5
6#endif /* __PPC64_SEGMENT_H */
diff --git a/include/asm-ppc64/setup.h b/include/asm-ppc64/setup.h
deleted file mode 100644
index b257b8348c73..000000000000
--- a/include/asm-ppc64/setup.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef _PPC_SETUP_H
2#define _PPC_SETUP_H
3
4#define COMMAND_LINE_SIZE 512
5
6#endif /* _PPC_SETUP_H */
diff --git a/include/asm-ppc64/system.h b/include/asm-ppc64/system.h
index b9e1835351e9..c0396428cc3c 100644
--- a/include/asm-ppc64/system.h
+++ b/include/asm-ppc64/system.h
@@ -158,7 +158,7 @@ static inline int __is_processor(unsigned long pv)
158 * is more like most of the other architectures. 158 * is more like most of the other architectures.
159 */ 159 */
160static __inline__ unsigned long 160static __inline__ unsigned long
161__xchg_u32(volatile int *m, unsigned long val) 161__xchg_u32(volatile unsigned int *m, unsigned long val)
162{ 162{
163 unsigned long dummy; 163 unsigned long dummy;
164 164
@@ -200,7 +200,7 @@ __xchg_u64(volatile long *m, unsigned long val)
200extern void __xchg_called_with_bad_pointer(void); 200extern void __xchg_called_with_bad_pointer(void);
201 201
202static __inline__ unsigned long 202static __inline__ unsigned long
203__xchg(volatile void *ptr, unsigned long x, int size) 203__xchg(volatile void *ptr, unsigned long x, unsigned int size)
204{ 204{
205 switch (size) { 205 switch (size) {
206 case 4: 206 case 4:
@@ -223,7 +223,7 @@ __xchg(volatile void *ptr, unsigned long x, int size)
223#define __HAVE_ARCH_CMPXCHG 1 223#define __HAVE_ARCH_CMPXCHG 1
224 224
225static __inline__ unsigned long 225static __inline__ unsigned long
226__cmpxchg_u32(volatile int *p, int old, int new) 226__cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new)
227{ 227{
228 unsigned int prev; 228 unsigned int prev;
229 229
@@ -271,7 +271,8 @@ __cmpxchg_u64(volatile long *p, unsigned long old, unsigned long new)
271extern void __cmpxchg_called_with_bad_pointer(void); 271extern void __cmpxchg_called_with_bad_pointer(void);
272 272
273static __inline__ unsigned long 273static __inline__ unsigned long
274__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) 274__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new,
275 unsigned int size)
275{ 276{
276 switch (size) { 277 switch (size) {
277 case 4: 278 case 4:
@@ -283,13 +284,9 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
283 return old; 284 return old;
284} 285}
285 286
286#define cmpxchg(ptr,o,n) \ 287#define cmpxchg(ptr,o,n)\
287 ({ \ 288 ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\
288 __typeof__(*(ptr)) _o_ = (o); \ 289 (unsigned long)(n),sizeof(*(ptr))))
289 __typeof__(*(ptr)) _n_ = (n); \
290 (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
291 (unsigned long)_n_, sizeof(*(ptr))); \
292 })
293 290
294/* 291/*
295 * We handle most unaligned accesses in hardware. On the other hand 292 * We handle most unaligned accesses in hardware. On the other hand
diff --git a/include/asm-ppc64/timex.h b/include/asm-ppc64/timex.h
deleted file mode 100644
index 8db4da4064cd..000000000000
--- a/include/asm-ppc64/timex.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * linux/include/asm-ppc/timex.h
3 *
4 * PPC64 architecture timex specifications
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11#ifndef _ASMPPC64_TIMEX_H
12#define _ASMPPC64_TIMEX_H
13
14#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
15
16typedef unsigned long cycles_t;
17
18static inline cycles_t get_cycles(void)
19{
20 cycles_t ret;
21
22 __asm__ __volatile__("mftb %0" : "=r" (ret) : );
23 return ret;
24}
25
26#endif
diff --git a/include/asm-ppc64/types.h b/include/asm-ppc64/types.h
index 5b8c2cfa1138..bf294c1761b2 100644
--- a/include/asm-ppc64/types.h
+++ b/include/asm-ppc64/types.h
@@ -72,7 +72,6 @@ typedef struct {
72 unsigned long env; 72 unsigned long env;
73} func_descr_t; 73} func_descr_t;
74 74
75typedef unsigned int kmem_bufctl_t;
76#endif /* __ASSEMBLY__ */ 75#endif /* __ASSEMBLY__ */
77 76
78#endif /* __KERNEL__ */ 77#endif /* __KERNEL__ */
diff --git a/include/asm-ppc64/uaccess.h b/include/asm-ppc64/uaccess.h
index 05b5943ab1ee..c181a60d868c 100644
--- a/include/asm-ppc64/uaccess.h
+++ b/include/asm-ppc64/uaccess.h
@@ -56,13 +56,6 @@
56#define access_ok(type,addr,size) \ 56#define access_ok(type,addr,size) \
57 __access_ok(((__force unsigned long)(addr)),(size),get_fs()) 57 __access_ok(((__force unsigned long)(addr)),(size),get_fs())
58 58
59/* this function will go away soon - use access_ok() instead */
60static inline int __deprecated verify_area(int type, const void __user *addr, unsigned long size)
61{
62 return access_ok(type,addr,size) ? 0 : -EFAULT;
63}
64
65
66/* 59/*
67 * The exception table consists of pairs of addresses: the first is the 60 * The exception table consists of pairs of addresses: the first is the
68 * address of an instruction that is allowed to fault, and the second is 61 * address of an instruction that is allowed to fault, and the second is
diff --git a/include/asm-ppc64/udbg.h b/include/asm-ppc64/udbg.h
index a6e04d014b2b..c786604aef02 100644
--- a/include/asm-ppc64/udbg.h
+++ b/include/asm-ppc64/udbg.h
@@ -2,6 +2,7 @@
2#define __UDBG_HDR 2#define __UDBG_HDR
3 3
4#include <linux/compiler.h> 4#include <linux/compiler.h>
5#include <linux/init.h>
5 6
6/* 7/*
7 * c 2001 PPC 64 Team, IBM Corp 8 * c 2001 PPC 64 Team, IBM Corp
@@ -12,17 +13,19 @@
12 * 2 of the License, or (at your option) any later version. 13 * 2 of the License, or (at your option) any later version.
13 */ 14 */
14 15
15void udbg_init_uart(void __iomem *comport, unsigned int speed); 16extern void (*udbg_putc)(unsigned char c);
16void udbg_putc(unsigned char c); 17extern unsigned char (*udbg_getc)(void);
17unsigned char udbg_getc(void); 18extern int (*udbg_getc_poll)(void);
18int udbg_getc_poll(void);
19void udbg_puts(const char *s);
20int udbg_write(const char *s, int n);
21int udbg_read(char *buf, int buflen);
22struct console;
23void udbg_console_write(struct console *con, const char *s, unsigned int n);
24void udbg_printf(const char *fmt, ...);
25void udbg_ppcdbg(unsigned long flags, const char *fmt, ...);
26unsigned long udbg_ifdebug(unsigned long flags);
27 19
20extern void udbg_puts(const char *s);
21extern int udbg_write(const char *s, int n);
22extern int udbg_read(char *buf, int buflen);
23
24extern void register_early_udbg_console(void);
25extern void udbg_printf(const char *fmt, ...);
26extern void udbg_ppcdbg(unsigned long flags, const char *fmt, ...);
27extern unsigned long udbg_ifdebug(unsigned long flags);
28extern void __init ppcdbg_initialize(void);
29
30extern void udbg_init_uart(void __iomem *comport, unsigned int speed);
28#endif 31#endif
diff --git a/include/asm-ppc64/user.h b/include/asm-ppc64/user.h
deleted file mode 100644
index d7d6554a421f..000000000000
--- a/include/asm-ppc64/user.h
+++ /dev/null
@@ -1,58 +0,0 @@
1#ifndef _PPC_USER_H
2#define _PPC_USER_H
3
4/* Adapted from <asm-alpha/user.h>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#include <asm/ptrace.h>
13#include <asm/page.h>
14
15/*
16 * Core file format: The core file is written in such a way that gdb
17 * can understand it and provide useful information to the user (under
18 * linux we use the `trad-core' bfd, NOT the osf-core). The file contents
19 * are as follows:
20 *
21 * upage: 1 page consisting of a user struct that tells gdb
22 * what is present in the file. Directly after this is a
23 * copy of the task_struct, which is currently not used by gdb,
24 * but it may come in handy at some point. All of the registers
25 * are stored as part of the upage. The upage should always be
26 * only one page long.
27 * data: The data segment follows next. We use current->end_text to
28 * current->brk to pick up all of the user variables, plus any memory
29 * that may have been sbrk'ed. No attempt is made to determine if a
30 * page is demand-zero or if a page is totally unused, we just cover
31 * the entire range. All of the addresses are rounded in such a way
32 * that an integral number of pages is written.
33 * stack: We need the stack information in order to get a meaningful
34 * backtrace. We need to write the data from usp to
35 * current->start_stack, so we round each of these in order to be able
36 * to write an integer number of pages.
37 */
38struct user {
39 struct pt_regs regs; /* entire machine state */
40 size_t u_tsize; /* text size (pages) */
41 size_t u_dsize; /* data size (pages) */
42 size_t u_ssize; /* stack size (pages) */
43 unsigned long start_code; /* text starting address */
44 unsigned long start_data; /* data starting address */
45 unsigned long start_stack; /* stack starting address */
46 long int signal; /* signal causing core dump */
47 struct regs * u_ar0; /* help gdb find registers */
48 unsigned long magic; /* identifies a core file */
49 char u_comm[32]; /* user command name */
50};
51
52#define NBPG PAGE_SIZE
53#define UPAGES 1
54#define HOST_TEXT_START_ADDR (u.start_code)
55#define HOST_DATA_START_ADDR (u.start_data)
56#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
57
58#endif /* _PPC_USER_H */
diff --git a/include/asm-s390/auxvec.h b/include/asm-s390/auxvec.h
new file mode 100644
index 000000000000..0d340720fd99
--- /dev/null
+++ b/include/asm-s390/auxvec.h
@@ -0,0 +1,4 @@
1#ifndef __ASMS390_AUXVEC_H
2#define __ASMS390_AUXVEC_H
3
4#endif
diff --git a/include/asm-s390/compat.h b/include/asm-s390/compat.h
index 7f8f544eb262..a007715f4aea 100644
--- a/include/asm-s390/compat.h
+++ b/include/asm-s390/compat.h
@@ -13,10 +13,10 @@ typedef s32 compat_ssize_t;
13typedef s32 compat_time_t; 13typedef s32 compat_time_t;
14typedef s32 compat_clock_t; 14typedef s32 compat_clock_t;
15typedef s32 compat_pid_t; 15typedef s32 compat_pid_t;
16typedef u16 compat_uid_t; 16typedef u16 __compat_uid_t;
17typedef u16 compat_gid_t; 17typedef u16 __compat_gid_t;
18typedef u32 compat_uid32_t; 18typedef u32 __compat_uid32_t;
19typedef u32 compat_gid32_t; 19typedef u32 __compat_gid32_t;
20typedef u16 compat_mode_t; 20typedef u16 compat_mode_t;
21typedef u32 compat_ino_t; 21typedef u32 compat_ino_t;
22typedef u16 compat_dev_t; 22typedef u16 compat_dev_t;
@@ -51,8 +51,8 @@ struct compat_stat {
51 compat_ino_t st_ino; 51 compat_ino_t st_ino;
52 compat_mode_t st_mode; 52 compat_mode_t st_mode;
53 compat_nlink_t st_nlink; 53 compat_nlink_t st_nlink;
54 compat_uid_t st_uid; 54 __compat_uid_t st_uid;
55 compat_gid_t st_gid; 55 __compat_gid_t st_gid;
56 compat_dev_t st_rdev; 56 compat_dev_t st_rdev;
57 u16 __pad2; 57 u16 __pad2;
58 u32 st_size; 58 u32 st_size;
@@ -140,10 +140,10 @@ static inline void __user *compat_alloc_user_space(long len)
140 140
141struct compat_ipc64_perm { 141struct compat_ipc64_perm {
142 compat_key_t key; 142 compat_key_t key;
143 compat_uid32_t uid; 143 __compat_uid32_t uid;
144 compat_gid32_t gid; 144 __compat_gid32_t gid;
145 compat_uid32_t cuid; 145 __compat_uid32_t cuid;
146 compat_gid32_t cgid; 146 __compat_gid32_t cgid;
147 compat_mode_t mode; 147 compat_mode_t mode;
148 unsigned short __pad1; 148 unsigned short __pad1;
149 unsigned short seq; 149 unsigned short seq;
diff --git a/include/asm-s390/debug.h b/include/asm-s390/debug.h
index 92360d90144b..7127030ae162 100644
--- a/include/asm-s390/debug.h
+++ b/include/asm-s390/debug.h
@@ -52,8 +52,6 @@ struct __debug_entry{
52#define DEBUG_DATA(entry) (char*)(entry + 1) /* data is stored behind */ 52#define DEBUG_DATA(entry) (char*)(entry + 1) /* data is stored behind */
53 /* the entry information */ 53 /* the entry information */
54 54
55#define STCK(x) asm volatile ("STCK 0(%1)" : "=m" (x) : "a" (&(x)) : "cc")
56
57typedef struct __debug_entry debug_entry_t; 55typedef struct __debug_entry debug_entry_t;
58 56
59struct debug_view; 57struct debug_view;
diff --git a/include/asm-s390/fcntl.h b/include/asm-s390/fcntl.h
index 48f692b45732..46ab12db5739 100644
--- a/include/asm-s390/fcntl.h
+++ b/include/asm-s390/fcntl.h
@@ -1,97 +1 @@
1/* #include <asm-generic/fcntl.h>
2 * include/asm-s390/fcntl.h
3 *
4 * S390 version
5 *
6 * Derived from "include/asm-i386/fcntl.h"
7 */
8#ifndef _S390_FCNTL_H
9#define _S390_FCNTL_H
10
11/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
12 located on an ext2 file system */
13#define O_ACCMODE 0003
14#define O_RDONLY 00
15#define O_WRONLY 01
16#define O_RDWR 02
17#define O_CREAT 0100 /* not fcntl */
18#define O_EXCL 0200 /* not fcntl */
19#define O_NOCTTY 0400 /* not fcntl */
20#define O_TRUNC 01000 /* not fcntl */
21#define O_APPEND 02000
22#define O_NONBLOCK 04000
23#define O_NDELAY O_NONBLOCK
24#define O_SYNC 010000
25#define FASYNC 020000 /* fcntl, for BSD compatibility */
26#define O_DIRECT 040000 /* direct disk access hint */
27#define O_LARGEFILE 0100000
28#define O_DIRECTORY 0200000 /* must be a directory */
29#define O_NOFOLLOW 0400000 /* don't follow links */
30#define O_NOATIME 01000000
31
32#define F_DUPFD 0 /* dup */
33#define F_GETFD 1 /* get close_on_exec */
34#define F_SETFD 2 /* set/clear close_on_exec */
35#define F_GETFL 3 /* get file->f_flags */
36#define F_SETFL 4 /* set file->f_flags */
37#define F_GETLK 5
38#define F_SETLK 6
39#define F_SETLKW 7
40
41#define F_SETOWN 8 /* for sockets. */
42#define F_GETOWN 9 /* for sockets. */
43#define F_SETSIG 10 /* for sockets. */
44#define F_GETSIG 11 /* for sockets. */
45
46#ifndef __s390x__
47#define F_GETLK64 12 /* using 'struct flock64' */
48#define F_SETLK64 13
49#define F_SETLKW64 14
50#endif /* ! __s390x__ */
51
52/* for F_[GET|SET]FL */
53#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
54
55/* for posix fcntl() and lockf() */
56#define F_RDLCK 0
57#define F_WRLCK 1
58#define F_UNLCK 2
59
60/* for old implementation of bsd flock () */
61#define F_EXLCK 4 /* or 3 */
62#define F_SHLCK 8 /* or 4 */
63
64/* for leases */
65#define F_INPROGRESS 16
66
67/* operations for bsd flock(), also used by the kernel implementation */
68#define LOCK_SH 1 /* shared lock */
69#define LOCK_EX 2 /* exclusive lock */
70#define LOCK_NB 4 /* or'd with one of the above to prevent
71 blocking */
72#define LOCK_UN 8 /* remove lock */
73
74#define LOCK_MAND 32 /* This is a mandatory flock */
75#define LOCK_READ 64 /* ... Which allows concurrent read operations */
76#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
77#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
78
79struct flock {
80 short l_type;
81 short l_whence;
82 off_t l_start;
83 off_t l_len;
84 pid_t l_pid;
85};
86
87#ifndef __s390x__
88struct flock64 {
89 short l_type;
90 short l_whence;
91 loff_t l_start;
92 loff_t l_len;
93 pid_t l_pid;
94};
95#endif
96#define F_LINUX_SPECIFIC_BASE 1024
97#endif
diff --git a/include/asm-s390/futex.h b/include/asm-s390/futex.h
new file mode 100644
index 000000000000..2cac5ecd9d00
--- /dev/null
+++ b/include/asm-s390/futex.h
@@ -0,0 +1,53 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/uaccess.h>
9
10static inline int
11futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
12{
13 int op = (encoded_op >> 28) & 7;
14 int cmp = (encoded_op >> 24) & 15;
15 int oparg = (encoded_op << 8) >> 20;
16 int cmparg = (encoded_op << 20) >> 20;
17 int oldval = 0, ret, tem;
18 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
19 oparg = 1 << oparg;
20
21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
22 return -EFAULT;
23
24 inc_preempt_count();
25
26 switch (op) {
27 case FUTEX_OP_SET:
28 case FUTEX_OP_ADD:
29 case FUTEX_OP_OR:
30 case FUTEX_OP_ANDN:
31 case FUTEX_OP_XOR:
32 default:
33 ret = -ENOSYS;
34 }
35
36 dec_preempt_count();
37
38 if (!ret) {
39 switch (cmp) {
40 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
41 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
42 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
43 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
44 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
45 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
46 default: ret = -ENOSYS;
47 }
48 }
49 return ret;
50}
51
52#endif
53#endif
diff --git a/include/asm-s390/lowcore.h b/include/asm-s390/lowcore.h
index afe6a9f9b0ae..c6f51c9ce3ff 100644
--- a/include/asm-s390/lowcore.h
+++ b/include/asm-s390/lowcore.h
@@ -68,6 +68,7 @@
68#define __LC_SYSTEM_TIMER 0x270 68#define __LC_SYSTEM_TIMER 0x270
69#define __LC_LAST_UPDATE_CLOCK 0x278 69#define __LC_LAST_UPDATE_CLOCK 0x278
70#define __LC_STEAL_CLOCK 0x280 70#define __LC_STEAL_CLOCK 0x280
71#define __LC_RETURN_MCCK_PSW 0x288
71#define __LC_KERNEL_STACK 0xC40 72#define __LC_KERNEL_STACK 0xC40
72#define __LC_THREAD_INFO 0xC44 73#define __LC_THREAD_INFO 0xC44
73#define __LC_ASYNC_STACK 0xC48 74#define __LC_ASYNC_STACK 0xC48
@@ -90,6 +91,7 @@
90#define __LC_SYSTEM_TIMER 0x278 91#define __LC_SYSTEM_TIMER 0x278
91#define __LC_LAST_UPDATE_CLOCK 0x280 92#define __LC_LAST_UPDATE_CLOCK 0x280
92#define __LC_STEAL_CLOCK 0x288 93#define __LC_STEAL_CLOCK 0x288
94#define __LC_RETURN_MCCK_PSW 0x290
93#define __LC_KERNEL_STACK 0xD40 95#define __LC_KERNEL_STACK 0xD40
94#define __LC_THREAD_INFO 0xD48 96#define __LC_THREAD_INFO 0xD48
95#define __LC_ASYNC_STACK 0xD50 97#define __LC_ASYNC_STACK 0xD50
@@ -196,7 +198,8 @@ struct _lowcore
196 __u64 system_timer; /* 0x270 */ 198 __u64 system_timer; /* 0x270 */
197 __u64 last_update_clock; /* 0x278 */ 199 __u64 last_update_clock; /* 0x278 */
198 __u64 steal_clock; /* 0x280 */ 200 __u64 steal_clock; /* 0x280 */
199 __u8 pad8[0xc00-0x288]; /* 0x288 */ 201 psw_t return_mcck_psw; /* 0x288 */
202 __u8 pad8[0xc00-0x290]; /* 0x290 */
200 203
201 /* System info area */ 204 /* System info area */
202 __u32 save_area[16]; /* 0xc00 */ 205 __u32 save_area[16]; /* 0xc00 */
@@ -285,7 +288,8 @@ struct _lowcore
285 __u64 system_timer; /* 0x278 */ 288 __u64 system_timer; /* 0x278 */
286 __u64 last_update_clock; /* 0x280 */ 289 __u64 last_update_clock; /* 0x280 */
287 __u64 steal_clock; /* 0x288 */ 290 __u64 steal_clock; /* 0x288 */
288 __u8 pad8[0xc00-0x290]; /* 0x290 */ 291 psw_t return_mcck_psw; /* 0x290 */
292 __u8 pad8[0xc00-0x2a0]; /* 0x2a0 */
289 /* System info area */ 293 /* System info area */
290 __u64 save_area[16]; /* 0xc00 */ 294 __u64 save_area[16]; /* 0xc00 */
291 __u8 pad9[0xd40-0xc80]; /* 0xc80 */ 295 __u8 pad9[0xd40-0xc80]; /* 0xc80 */
diff --git a/include/asm-s390/page.h b/include/asm-s390/page.h
index 2be287b9df88..2430c561e021 100644
--- a/include/asm-s390/page.h
+++ b/include/asm-s390/page.h
@@ -111,20 +111,6 @@ static inline void copy_page(void *to, void *from)
111#define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr) 111#define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr)
112#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE 112#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
113 113
114/* Pure 2^n version of get_order */
115extern __inline__ int get_order(unsigned long size)
116{
117 int order;
118
119 size = (size-1) >> (PAGE_SHIFT-1);
120 order = -1;
121 do {
122 size >>= 1;
123 order++;
124 } while (size);
125 return order;
126}
127
128/* 114/*
129 * These are used to make use of C type-checking.. 115 * These are used to make use of C type-checking..
130 */ 116 */
@@ -207,4 +193,6 @@ page_get_storage_key(unsigned long addr)
207 193
208#endif /* __KERNEL__ */ 194#endif /* __KERNEL__ */
209 195
196#include <asm-generic/page.h>
197
210#endif /* _S390_PAGE_H */ 198#endif /* _S390_PAGE_H */
diff --git a/include/asm-s390/spinlock.h b/include/asm-s390/spinlock.h
index 8ff10300f7ee..321b23bba1ec 100644
--- a/include/asm-s390/spinlock.h
+++ b/include/asm-s390/spinlock.h
@@ -47,7 +47,7 @@ extern int _raw_spin_trylock_retry(spinlock_t *lp, unsigned int pc);
47 47
48static inline void _raw_spin_lock(spinlock_t *lp) 48static inline void _raw_spin_lock(spinlock_t *lp)
49{ 49{
50 unsigned long pc = (unsigned long) __builtin_return_address(0); 50 unsigned long pc = 1 | (unsigned long) __builtin_return_address(0);
51 51
52 if (unlikely(_raw_compare_and_swap(&lp->lock, 0, pc) != 0)) 52 if (unlikely(_raw_compare_and_swap(&lp->lock, 0, pc) != 0))
53 _raw_spin_lock_wait(lp, pc); 53 _raw_spin_lock_wait(lp, pc);
@@ -55,7 +55,7 @@ static inline void _raw_spin_lock(spinlock_t *lp)
55 55
56static inline int _raw_spin_trylock(spinlock_t *lp) 56static inline int _raw_spin_trylock(spinlock_t *lp)
57{ 57{
58 unsigned long pc = (unsigned long) __builtin_return_address(0); 58 unsigned long pc = 1 | (unsigned long) __builtin_return_address(0);
59 59
60 if (likely(_raw_compare_and_swap(&lp->lock, 0, pc) == 0)) 60 if (likely(_raw_compare_and_swap(&lp->lock, 0, pc) == 0))
61 return 1; 61 return 1;
diff --git a/include/asm-s390/types.h b/include/asm-s390/types.h
index 3fefd61416a5..d0be3e477013 100644
--- a/include/asm-s390/types.h
+++ b/include/asm-s390/types.h
@@ -79,8 +79,6 @@ typedef unsigned long u64;
79 79
80typedef u32 dma_addr_t; 80typedef u32 dma_addr_t;
81 81
82typedef unsigned int kmem_bufctl_t;
83
84#ifndef __s390x__ 82#ifndef __s390x__
85typedef union { 83typedef union {
86 unsigned long long pair; 84 unsigned long long pair;
diff --git a/include/asm-s390/uaccess.h b/include/asm-s390/uaccess.h
index 3e3bfe6a8fa8..38a5cf8ab9e3 100644
--- a/include/asm-s390/uaccess.h
+++ b/include/asm-s390/uaccess.h
@@ -65,13 +65,6 @@
65 65
66#define access_ok(type,addr,size) __access_ok(addr,size) 66#define access_ok(type,addr,size) __access_ok(addr,size)
67 67
68/* this function will go away soon - use access_ok() instead */
69extern inline int __deprecated verify_area(int type, const void __user *addr,
70 unsigned long size)
71{
72 return access_ok(type, addr, size) ? 0 : -EFAULT;
73}
74
75/* 68/*
76 * The exception table consists of pairs of addresses: the first is the 69 * The exception table consists of pairs of addresses: the first is the
77 * address of an instruction that is allowed to fault, and the second is 70 * address of an instruction that is allowed to fault, and the second is
diff --git a/include/asm-sh/auxvec.h b/include/asm-sh/auxvec.h
new file mode 100644
index 000000000000..fc21e4db5881
--- /dev/null
+++ b/include/asm-sh/auxvec.h
@@ -0,0 +1,4 @@
1#ifndef __ASM_SH_AUXVEC_H
2#define __ASM_SH_AUXVEC_H
3
4#endif /* __ASM_SH_AUXVEC_H */
diff --git a/include/asm-sh/fcntl.h b/include/asm-sh/fcntl.h
index 0b3ae524e34c..46ab12db5739 100644
--- a/include/asm-sh/fcntl.h
+++ b/include/asm-sh/fcntl.h
@@ -1,88 +1 @@
1#ifndef __ASM_SH_FCNTL_H #include <asm-generic/fcntl.h>
2#define __ASM_SH_FCNTL_H
3
4/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
5 located on an ext2 file system */
6#define O_ACCMODE 0003
7#define O_RDONLY 00
8#define O_WRONLY 01
9#define O_RDWR 02
10#define O_CREAT 0100 /* not fcntl */
11#define O_EXCL 0200 /* not fcntl */
12#define O_NOCTTY 0400 /* not fcntl */
13#define O_TRUNC 01000 /* not fcntl */
14#define O_APPEND 02000
15#define O_NONBLOCK 04000
16#define O_NDELAY O_NONBLOCK
17#define O_SYNC 010000
18#define FASYNC 020000 /* fcntl, for BSD compatibility */
19#define O_DIRECT 040000 /* direct disk access hint - currently ignored */
20#define O_LARGEFILE 0100000
21#define O_DIRECTORY 0200000 /* must be a directory */
22#define O_NOFOLLOW 0400000 /* don't follow links */
23#define O_NOATIME 01000000
24
25#define F_DUPFD 0 /* dup */
26#define F_GETFD 1 /* get close_on_exec */
27#define F_SETFD 2 /* set/clear close_on_exec */
28#define F_GETFL 3 /* get file->f_flags */
29#define F_SETFL 4 /* set file->f_flags */
30#define F_GETLK 5
31#define F_SETLK 6
32#define F_SETLKW 7
33
34#define F_SETOWN 8 /* for sockets. */
35#define F_GETOWN 9 /* for sockets. */
36#define F_SETSIG 10 /* for sockets. */
37#define F_GETSIG 11 /* for sockets. */
38
39#define F_GETLK64 12 /* using 'struct flock64' */
40#define F_SETLK64 13
41#define F_SETLKW64 14
42
43/* for F_[GET|SET]FL */
44#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
45
46/* for posix fcntl() and lockf() */
47#define F_RDLCK 0
48#define F_WRLCK 1
49#define F_UNLCK 2
50
51/* for old implementation of bsd flock () */
52#define F_EXLCK 4 /* or 3 */
53#define F_SHLCK 8 /* or 4 */
54
55/* for leases */
56#define F_INPROGRESS 16
57
58/* operations for bsd flock(), also used by the kernel implementation */
59#define LOCK_SH 1 /* shared lock */
60#define LOCK_EX 2 /* exclusive lock */
61#define LOCK_NB 4 /* or'd with one of the above to prevent
62 blocking */
63#define LOCK_UN 8 /* remove lock */
64
65#define LOCK_MAND 32 /* This is a mandatory flock */
66#define LOCK_READ 64 /* ... Which allows concurrent read operations */
67#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
68#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
69
70struct flock {
71 short l_type;
72 short l_whence;
73 off_t l_start;
74 off_t l_len;
75 pid_t l_pid;
76};
77
78struct flock64 {
79 short l_type;
80 short l_whence;
81 loff_t l_start;
82 loff_t l_len;
83 pid_t l_pid;
84};
85
86#define F_LINUX_SPECIFIC_BASE 1024
87#endif /* __ASM_SH_FCNTL_H */
88
diff --git a/include/asm-sh/futex.h b/include/asm-sh/futex.h
new file mode 100644
index 000000000000..2cac5ecd9d00
--- /dev/null
+++ b/include/asm-sh/futex.h
@@ -0,0 +1,53 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/uaccess.h>
9
10static inline int
11futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
12{
13 int op = (encoded_op >> 28) & 7;
14 int cmp = (encoded_op >> 24) & 15;
15 int oparg = (encoded_op << 8) >> 20;
16 int cmparg = (encoded_op << 20) >> 20;
17 int oldval = 0, ret, tem;
18 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
19 oparg = 1 << oparg;
20
21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
22 return -EFAULT;
23
24 inc_preempt_count();
25
26 switch (op) {
27 case FUTEX_OP_SET:
28 case FUTEX_OP_ADD:
29 case FUTEX_OP_OR:
30 case FUTEX_OP_ANDN:
31 case FUTEX_OP_XOR:
32 default:
33 ret = -ENOSYS;
34 }
35
36 dec_preempt_count();
37
38 if (!ret) {
39 switch (cmp) {
40 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
41 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
42 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
43 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
44 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
45 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
46 default: ret = -ENOSYS;
47 }
48 }
49 return ret;
50}
51
52#endif
53#endif
diff --git a/include/asm-sh/hdreg.h b/include/asm-sh/hdreg.h
deleted file mode 100644
index 7f7fd1af0af3..000000000000
--- a/include/asm-sh/hdreg.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/hdreg.h>
diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h
index 831e52ee45b5..614a8c13b721 100644
--- a/include/asm-sh/irq.h
+++ b/include/asm-sh/irq.h
@@ -587,10 +587,6 @@ static inline int generic_irq_demux(int irq)
587#define irq_canonicalize(irq) (irq) 587#define irq_canonicalize(irq) (irq)
588#define irq_demux(irq) __irq_demux(sh_mv.mv_irq_demux(irq)) 588#define irq_demux(irq) __irq_demux(sh_mv.mv_irq_demux(irq))
589 589
590struct irqaction;
591struct pt_regs;
592int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
593
594#if defined(CONFIG_CPU_SUBTYPE_SH73180) 590#if defined(CONFIG_CPU_SUBTYPE_SH73180)
595#include <asm/irq-sh73180.h> 591#include <asm/irq-sh73180.h>
596#endif 592#endif
diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h
index 180467be8e7b..324e6cc5ecf7 100644
--- a/include/asm-sh/page.h
+++ b/include/asm-sh/page.h
@@ -122,24 +122,8 @@ typedef struct { unsigned long pgprot; } pgprot_t;
122#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ 122#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
123 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 123 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
124 124
125#ifndef __ASSEMBLY__
126
127/* Pure 2^n version of get_order */
128static __inline__ int get_order(unsigned long size)
129{
130 int order;
131
132 size = (size-1) >> (PAGE_SHIFT-1);
133 order = -1;
134 do {
135 size >>= 1;
136 order++;
137 } while (size);
138 return order;
139}
140
141#endif
142
143#endif /* __KERNEL__ */ 125#endif /* __KERNEL__ */
144 126
127#include <asm-generic/page.h>
128
145#endif /* __ASM_SH_PAGE_H */ 129#endif /* __ASM_SH_PAGE_H */
diff --git a/include/asm-sh/types.h b/include/asm-sh/types.h
index c4dc126c5621..cb7e183a0a6b 100644
--- a/include/asm-sh/types.h
+++ b/include/asm-sh/types.h
@@ -58,8 +58,6 @@ typedef u64 sector_t;
58#define HAVE_SECTOR_T 58#define HAVE_SECTOR_T
59#endif 59#endif
60 60
61typedef unsigned int kmem_bufctl_t;
62
63#endif /* __ASSEMBLY__ */ 61#endif /* __ASSEMBLY__ */
64 62
65#endif /* __KERNEL__ */ 63#endif /* __KERNEL__ */
diff --git a/include/asm-sh/uaccess.h b/include/asm-sh/uaccess.h
index fb9e334afa2b..2cb01861e7c5 100644
--- a/include/asm-sh/uaccess.h
+++ b/include/asm-sh/uaccess.h
@@ -146,12 +146,6 @@ static inline int access_ok(int type, const void __user *p, unsigned long size)
146 return __access_ok(addr, size); 146 return __access_ok(addr, size);
147} 147}
148 148
149/* this function will go away soon - use access_ok() instead */
150static inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size)
151{
152 return access_ok(type,addr,size) ? 0 : -EFAULT;
153}
154
155/* 149/*
156 * Uh, these should become the main single-value transfer routines ... 150 * Uh, these should become the main single-value transfer routines ...
157 * They automatically use the right size if we just have the right 151 * They automatically use the right size if we just have the right
diff --git a/include/asm-sh64/auxvec.h b/include/asm-sh64/auxvec.h
new file mode 100644
index 000000000000..1ad5a44bdc76
--- /dev/null
+++ b/include/asm-sh64/auxvec.h
@@ -0,0 +1,4 @@
1#ifndef __ASM_SH64_AUXVEC_H
2#define __ASM_SH64_AUXVEC_H
3
4#endif /* __ASM_SH64_AUXVEC_H */
diff --git a/include/asm-sh64/fcntl.h b/include/asm-sh64/fcntl.h
index ffcc36c64fa5..744dd79b9d5d 100644
--- a/include/asm-sh64/fcntl.h
+++ b/include/asm-sh64/fcntl.h
@@ -1,7 +1 @@
1#ifndef __ASM_SH64_FCNTL_H
2#define __ASM_SH64_FCNTL_H
3
4#include <asm-sh/fcntl.h> #include <asm-sh/fcntl.h>
5
6#endif /* __ASM_SH64_FCNTL_H */
7
diff --git a/include/asm-sh64/futex.h b/include/asm-sh64/futex.h
new file mode 100644
index 000000000000..2cac5ecd9d00
--- /dev/null
+++ b/include/asm-sh64/futex.h
@@ -0,0 +1,53 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/uaccess.h>
9
10static inline int
11futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
12{
13 int op = (encoded_op >> 28) & 7;
14 int cmp = (encoded_op >> 24) & 15;
15 int oparg = (encoded_op << 8) >> 20;
16 int cmparg = (encoded_op << 20) >> 20;
17 int oldval = 0, ret, tem;
18 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
19 oparg = 1 << oparg;
20
21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
22 return -EFAULT;
23
24 inc_preempt_count();
25
26 switch (op) {
27 case FUTEX_OP_SET:
28 case FUTEX_OP_ADD:
29 case FUTEX_OP_OR:
30 case FUTEX_OP_ANDN:
31 case FUTEX_OP_XOR:
32 default:
33 ret = -ENOSYS;
34 }
35
36 dec_preempt_count();
37
38 if (!ret) {
39 switch (cmp) {
40 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
41 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
42 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
43 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
44 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
45 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
46 default: ret = -ENOSYS;
47 }
48 }
49 return ret;
50}
51
52#endif
53#endif
diff --git a/include/asm-sh64/hdreg.h b/include/asm-sh64/hdreg.h
deleted file mode 100644
index 52d983635a27..000000000000
--- a/include/asm-sh64/hdreg.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ASM_SH64_HDREG_H
2#define __ASM_SH64_HDREG_H
3
4#include <asm-generic/hdreg.h>
5
6#endif /* __ASM_SH64_HDREG_H */
diff --git a/include/asm-sh64/page.h b/include/asm-sh64/page.h
index d6167f1c0e99..c86df90f7cbd 100644
--- a/include/asm-sh64/page.h
+++ b/include/asm-sh64/page.h
@@ -115,24 +115,8 @@ typedef struct { unsigned long pgprot; } pgprot_t;
115#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ 115#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
116 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 116 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
117 117
118#ifndef __ASSEMBLY__
119
120/* Pure 2^n version of get_order */
121extern __inline__ int get_order(unsigned long size)
122{
123 int order;
124
125 size = (size-1) >> (PAGE_SHIFT-1);
126 order = -1;
127 do {
128 size >>= 1;
129 order++;
130 } while (size);
131 return order;
132}
133
134#endif
135
136#endif /* __KERNEL__ */ 118#endif /* __KERNEL__ */
137 119
120#include <asm-generic/page.h>
121
138#endif /* __ASM_SH64_PAGE_H */ 122#endif /* __ASM_SH64_PAGE_H */
diff --git a/include/asm-sh64/types.h b/include/asm-sh64/types.h
index 41d4d2f82aa9..8d41db2153b5 100644
--- a/include/asm-sh64/types.h
+++ b/include/asm-sh64/types.h
@@ -65,8 +65,6 @@ typedef u32 dma_addr_t;
65#endif 65#endif
66typedef u64 dma64_addr_t; 66typedef u64 dma64_addr_t;
67 67
68typedef unsigned int kmem_bufctl_t;
69
70#endif /* __ASSEMBLY__ */ 68#endif /* __ASSEMBLY__ */
71 69
72#define BITS_PER_LONG 32 70#define BITS_PER_LONG 32
diff --git a/include/asm-sh64/uaccess.h b/include/asm-sh64/uaccess.h
index a33654d576a1..56aa3cf0f273 100644
--- a/include/asm-sh64/uaccess.h
+++ b/include/asm-sh64/uaccess.h
@@ -60,12 +60,6 @@
60#define access_ok(type,addr,size) (__range_ok(addr,size) == 0) 60#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
61#define __access_ok(addr,size) (__range_ok(addr,size) == 0) 61#define __access_ok(addr,size) (__range_ok(addr,size) == 0)
62 62
63/* this function will go away soon - use access_ok() instead */
64extern inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size)
65{
66 return access_ok(type,addr,size) ? 0 : -EFAULT;
67}
68
69/* 63/*
70 * Uh, these should become the main single-value transfer routines ... 64 * Uh, these should become the main single-value transfer routines ...
71 * They automatically use the right size if we just have the right 65 * They automatically use the right size if we just have the right
diff --git a/include/asm-sparc/auxvec.h b/include/asm-sparc/auxvec.h
new file mode 100644
index 000000000000..ad6f360261f6
--- /dev/null
+++ b/include/asm-sparc/auxvec.h
@@ -0,0 +1,4 @@
1#ifndef __ASMSPARC_AUXVEC_H
2#define __ASMSPARC_AUXVEC_H
3
4#endif /* !(__ASMSPARC_AUXVEC_H) */
diff --git a/include/asm-sparc/fcntl.h b/include/asm-sparc/fcntl.h
index df9c75d41d68..5db60b5ae7b0 100644
--- a/include/asm-sparc/fcntl.h
+++ b/include/asm-sparc/fcntl.h
@@ -4,10 +4,6 @@
4 4
5/* open/fcntl - O_SYNC is only implemented on blocks devices and on files 5/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
6 located on an ext2 file system */ 6 located on an ext2 file system */
7#define O_RDONLY 0x0000
8#define O_WRONLY 0x0001
9#define O_RDWR 0x0002
10#define O_ACCMODE 0x0003
11#define O_APPEND 0x0008 7#define O_APPEND 0x0008
12#define FASYNC 0x0040 /* fcntl, for BSD compatibility */ 8#define FASYNC 0x0040 /* fcntl, for BSD compatibility */
13#define O_CREAT 0x0200 /* not fcntl */ 9#define O_CREAT 0x0200 /* not fcntl */
@@ -17,73 +13,24 @@
17#define O_NONBLOCK 0x4000 13#define O_NONBLOCK 0x4000
18#define O_NDELAY (0x0004 | O_NONBLOCK) 14#define O_NDELAY (0x0004 | O_NONBLOCK)
19#define O_NOCTTY 0x8000 /* not fcntl */ 15#define O_NOCTTY 0x8000 /* not fcntl */
20#define O_DIRECTORY 0x10000 /* must be a directory */
21#define O_NOFOLLOW 0x20000 /* don't follow links */
22#define O_LARGEFILE 0x40000 16#define O_LARGEFILE 0x40000
23#define O_DIRECT 0x100000 /* direct disk access hint */ 17#define O_DIRECT 0x100000 /* direct disk access hint */
24#define O_NOATIME 0x200000 18#define O_NOATIME 0x200000
25 19
26#define F_DUPFD 0 /* dup */
27#define F_GETFD 1 /* get close_on_exec */
28#define F_SETFD 2 /* set/clear close_on_exec */
29#define F_GETFL 3 /* get file->f_flags */
30#define F_SETFL 4 /* set file->f_flags */
31#define F_GETOWN 5 /* for sockets. */ 20#define F_GETOWN 5 /* for sockets. */
32#define F_SETOWN 6 /* for sockets. */ 21#define F_SETOWN 6 /* for sockets. */
33#define F_GETLK 7 22#define F_GETLK 7
34#define F_SETLK 8 23#define F_SETLK 8
35#define F_SETLKW 9 24#define F_SETLKW 9
36#define F_SETSIG 10 /* for sockets. */
37#define F_GETSIG 11 /* for sockets. */
38
39#define F_GETLK64 12 /* using 'struct flock64' */
40#define F_SETLK64 13
41#define F_SETLKW64 14
42
43/* for F_[GET|SET]FL */
44#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
45 25
46/* for posix fcntl() and lockf() */ 26/* for posix fcntl() and lockf() */
47#define F_RDLCK 1 27#define F_RDLCK 1
48#define F_WRLCK 2 28#define F_WRLCK 2
49#define F_UNLCK 3 29#define F_UNLCK 3
50 30
51/* for old implementation of bsd flock () */ 31#define __ARCH_FLOCK_PAD short __unused;
52#define F_EXLCK 4 /* or 3 */ 32#define __ARCH_FLOCK64_PAD short __unused;
53#define F_SHLCK 8 /* or 4 */
54
55/* for leases */
56#define F_INPROGRESS 16
57
58/* operations for bsd flock(), also used by the kernel implementation */
59#define LOCK_SH 1 /* shared lock */
60#define LOCK_EX 2 /* exclusive lock */
61#define LOCK_NB 4 /* or'd with one of the above to prevent
62 blocking */
63#define LOCK_UN 8 /* remove lock */
64
65#define LOCK_MAND 32 /* This is a mandatory flock */
66#define LOCK_READ 64 /* ... Which allows concurrent read operations */
67#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
68#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
69
70struct flock {
71 short l_type;
72 short l_whence;
73 off_t l_start;
74 off_t l_len;
75 pid_t l_pid;
76 short __unused;
77};
78 33
79struct flock64 { 34#include <asm-generic/fcntl.h>
80 short l_type;
81 short l_whence;
82 loff_t l_start;
83 loff_t l_len;
84 pid_t l_pid;
85 short __unused;
86};
87 35
88#define F_LINUX_SPECIFIC_BASE 1024
89#endif 36#endif
diff --git a/include/asm-sparc/futex.h b/include/asm-sparc/futex.h
new file mode 100644
index 000000000000..2cac5ecd9d00
--- /dev/null
+++ b/include/asm-sparc/futex.h
@@ -0,0 +1,53 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/uaccess.h>
9
10static inline int
11futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
12{
13 int op = (encoded_op >> 28) & 7;
14 int cmp = (encoded_op >> 24) & 15;
15 int oparg = (encoded_op << 8) >> 20;
16 int cmparg = (encoded_op << 20) >> 20;
17 int oldval = 0, ret, tem;
18 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
19 oparg = 1 << oparg;
20
21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
22 return -EFAULT;
23
24 inc_preempt_count();
25
26 switch (op) {
27 case FUTEX_OP_SET:
28 case FUTEX_OP_ADD:
29 case FUTEX_OP_OR:
30 case FUTEX_OP_ANDN:
31 case FUTEX_OP_XOR:
32 default:
33 ret = -ENOSYS;
34 }
35
36 dec_preempt_count();
37
38 if (!ret) {
39 switch (cmp) {
40 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
41 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
42 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
43 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
44 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
45 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
46 default: ret = -ENOSYS;
47 }
48 }
49 return ret;
50}
51
52#endif
53#endif
diff --git a/include/asm-sparc/hdreg.h b/include/asm-sparc/hdreg.h
deleted file mode 100644
index 7f7fd1af0af3..000000000000
--- a/include/asm-sparc/hdreg.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/hdreg.h>
diff --git a/include/asm-sparc/page.h b/include/asm-sparc/page.h
index 383060e90d94..9122684f6c1e 100644
--- a/include/asm-sparc/page.h
+++ b/include/asm-sparc/page.h
@@ -132,20 +132,6 @@ BTFIXUPDEF_SETHI(sparc_unmapped_base)
132 132
133#define TASK_UNMAPPED_BASE BTFIXUP_SETHI(sparc_unmapped_base) 133#define TASK_UNMAPPED_BASE BTFIXUP_SETHI(sparc_unmapped_base)
134 134
135/* Pure 2^n version of get_order */
136extern __inline__ int get_order(unsigned long size)
137{
138 int order;
139
140 size = (size-1) >> (PAGE_SHIFT-1);
141 order = -1;
142 do {
143 size >>= 1;
144 order++;
145 } while (size);
146 return order;
147}
148
149#else /* !(__ASSEMBLY__) */ 135#else /* !(__ASSEMBLY__) */
150 136
151#define __pgprot(x) (x) 137#define __pgprot(x) (x)
@@ -178,4 +164,6 @@ extern unsigned long pfn_base;
178 164
179#endif /* __KERNEL__ */ 165#endif /* __KERNEL__ */
180 166
167#include <asm-generic/page.h>
168
181#endif /* _SPARC_PAGE_H */ 169#endif /* _SPARC_PAGE_H */
diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h
index 40ed30a2b7c6..8f4f6a959651 100644
--- a/include/asm-sparc/pgtable.h
+++ b/include/asm-sparc/pgtable.h
@@ -435,9 +435,6 @@ extern unsigned long *sparc_valid_addr_bitmap;
435#define kern_addr_valid(addr) \ 435#define kern_addr_valid(addr) \
436 (test_bit(__pa((unsigned long)(addr))>>20, sparc_valid_addr_bitmap)) 436 (test_bit(__pa((unsigned long)(addr))>>20, sparc_valid_addr_bitmap))
437 437
438extern int io_remap_page_range(struct vm_area_struct *vma,
439 unsigned long from, unsigned long to,
440 unsigned long size, pgprot_t prot, int space);
441extern int io_remap_pfn_range(struct vm_area_struct *vma, 438extern int io_remap_pfn_range(struct vm_area_struct *vma,
442 unsigned long from, unsigned long pfn, 439 unsigned long from, unsigned long pfn,
443 unsigned long size, pgprot_t prot); 440 unsigned long size, pgprot_t prot);
diff --git a/include/asm-sparc/ptrace.h b/include/asm-sparc/ptrace.h
index dd9d94d7e0ae..a8ecb2d6977a 100644
--- a/include/asm-sparc/ptrace.h
+++ b/include/asm-sparc/ptrace.h
@@ -73,11 +73,11 @@ extern void show_regs(struct pt_regs *);
73#endif 73#endif
74 74
75/* 75/*
76 * The asm_offsets.h is a generated file, so we cannot include it. 76 * The asm-offsets.h is a generated file, so we cannot include it.
77 * It may be OK for glibc headers, but it's utterly pointless for C code. 77 * It may be OK for glibc headers, but it's utterly pointless for C code.
78 * The assembly code using those offsets has to include it explicitly. 78 * The assembly code using those offsets has to include it explicitly.
79 */ 79 */
80/* #include <asm/asm_offsets.h> */ 80/* #include <asm/asm-offsets.h> */
81 81
82/* These are for pt_regs. */ 82/* These are for pt_regs. */
83#define PT_PSR 0x0 83#define PT_PSR 0x0
diff --git a/include/asm-sparc/types.h b/include/asm-sparc/types.h
index 9eabf6e61ccc..42fc6ed98156 100644
--- a/include/asm-sparc/types.h
+++ b/include/asm-sparc/types.h
@@ -54,8 +54,6 @@ typedef unsigned long long u64;
54typedef u32 dma_addr_t; 54typedef u32 dma_addr_t;
55typedef u32 dma64_addr_t; 55typedef u32 dma64_addr_t;
56 56
57typedef unsigned short kmem_bufctl_t;
58
59#endif /* __ASSEMBLY__ */ 57#endif /* __ASSEMBLY__ */
60 58
61#endif /* __KERNEL__ */ 59#endif /* __KERNEL__ */
diff --git a/include/asm-sparc/uaccess.h b/include/asm-sparc/uaccess.h
index 0a780e84a12b..f8f1ec1f06e6 100644
--- a/include/asm-sparc/uaccess.h
+++ b/include/asm-sparc/uaccess.h
@@ -47,12 +47,6 @@
47#define access_ok(type, addr, size) \ 47#define access_ok(type, addr, size) \
48 ({ (void)(type); __access_ok((unsigned long)(addr), size); }) 48 ({ (void)(type); __access_ok((unsigned long)(addr), size); })
49 49
50/* this function will go away soon - use access_ok() instead */
51static inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size)
52{
53 return access_ok(type,addr,size) ? 0 : -EFAULT;
54}
55
56/* 50/*
57 * The exception table consists of pairs of addresses: the first is the 51 * The exception table consists of pairs of addresses: the first is the
58 * address of an instruction that is allowed to fault, and the second is 52 * address of an instruction that is allowed to fault, and the second is
diff --git a/include/asm-sparc64/auxvec.h b/include/asm-sparc64/auxvec.h
new file mode 100644
index 000000000000..436a29129828
--- /dev/null
+++ b/include/asm-sparc64/auxvec.h
@@ -0,0 +1,4 @@
1#ifndef __ASM_SPARC64_AUXVEC_H
2#define __ASM_SPARC64_AUXVEC_H
3
4#endif /* !(__ASM_SPARC64_AUXVEC_H) */
diff --git a/include/asm-sparc64/compat.h b/include/asm-sparc64/compat.h
index b59122dd176d..c73935dc7ba1 100644
--- a/include/asm-sparc64/compat.h
+++ b/include/asm-sparc64/compat.h
@@ -12,8 +12,10 @@ typedef s32 compat_ssize_t;
12typedef s32 compat_time_t; 12typedef s32 compat_time_t;
13typedef s32 compat_clock_t; 13typedef s32 compat_clock_t;
14typedef s32 compat_pid_t; 14typedef s32 compat_pid_t;
15typedef u16 compat_uid_t; 15typedef u16 __compat_uid_t;
16typedef u16 compat_gid_t; 16typedef u16 __compat_gid_t;
17typedef u32 __compat_uid32_t;
18typedef u32 __compat_gid32_t;
17typedef u16 compat_mode_t; 19typedef u16 compat_mode_t;
18typedef u32 compat_ino_t; 20typedef u32 compat_ino_t;
19typedef u16 compat_dev_t; 21typedef u16 compat_dev_t;
@@ -47,8 +49,8 @@ struct compat_stat {
47 compat_ino_t st_ino; 49 compat_ino_t st_ino;
48 compat_mode_t st_mode; 50 compat_mode_t st_mode;
49 compat_nlink_t st_nlink; 51 compat_nlink_t st_nlink;
50 compat_uid_t st_uid; 52 __compat_uid_t st_uid;
51 compat_gid_t st_gid; 53 __compat_gid_t st_gid;
52 compat_dev_t st_rdev; 54 compat_dev_t st_rdev;
53 compat_off_t st_size; 55 compat_off_t st_size;
54 compat_time_t st_atime; 56 compat_time_t st_atime;
@@ -177,10 +179,10 @@ static __inline__ void __user *compat_alloc_user_space(long len)
177 179
178struct compat_ipc64_perm { 180struct compat_ipc64_perm {
179 compat_key_t key; 181 compat_key_t key;
180 __kernel_uid_t uid; 182 __compat_uid32_t uid;
181 __kernel_gid_t gid; 183 __compat_gid32_t gid;
182 __kernel_uid_t cuid; 184 __compat_uid32_t cuid;
183 __kernel_gid_t cgid; 185 __compat_gid32_t cgid;
184 unsigned short __pad1; 186 unsigned short __pad1;
185 compat_mode_t mode; 187 compat_mode_t mode;
186 unsigned short __pad2; 188 unsigned short __pad2;
diff --git a/include/asm-sparc64/cpudata.h b/include/asm-sparc64/cpudata.h
index cc7198aaac50..9a3a81f1cc58 100644
--- a/include/asm-sparc64/cpudata.h
+++ b/include/asm-sparc64/cpudata.h
@@ -1,6 +1,6 @@
1/* cpudata.h: Per-cpu parameters. 1/* cpudata.h: Per-cpu parameters.
2 * 2 *
3 * Copyright (C) 2003 David S. Miller (davem@redhat.com) 3 * Copyright (C) 2003, 2005 David S. Miller (davem@redhat.com)
4 */ 4 */
5 5
6#ifndef _SPARC64_CPUDATA_H 6#ifndef _SPARC64_CPUDATA_H
@@ -10,7 +10,7 @@
10 10
11typedef struct { 11typedef struct {
12 /* Dcache line 1 */ 12 /* Dcache line 1 */
13 unsigned int __pad0; /* bh_count moved to irq_stat for consistency. KAO */ 13 unsigned int __softirq_pending; /* must be 1st, see rtrap.S */
14 unsigned int multiplier; 14 unsigned int multiplier;
15 unsigned int counter; 15 unsigned int counter;
16 unsigned int idle_volume; 16 unsigned int idle_volume;
diff --git a/include/asm-sparc64/fcntl.h b/include/asm-sparc64/fcntl.h
index e36def0d0d80..b2aecf0054bd 100644
--- a/include/asm-sparc64/fcntl.h
+++ b/include/asm-sparc64/fcntl.h
@@ -4,10 +4,6 @@
4 4
5/* open/fcntl - O_SYNC is only implemented on blocks devices and on files 5/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
6 located on an ext2 file system */ 6 located on an ext2 file system */
7#define O_RDONLY 0x0000
8#define O_WRONLY 0x0001
9#define O_RDWR 0x0002
10#define O_ACCMODE 0x0003
11#define O_NDELAY 0x0004 7#define O_NDELAY 0x0004
12#define O_APPEND 0x0008 8#define O_APPEND 0x0008
13#define FASYNC 0x0040 /* fcntl, for BSD compatibility */ 9#define FASYNC 0x0040 /* fcntl, for BSD compatibility */
@@ -17,62 +13,24 @@
17#define O_SYNC 0x2000 13#define O_SYNC 0x2000
18#define O_NONBLOCK 0x4000 14#define O_NONBLOCK 0x4000
19#define O_NOCTTY 0x8000 /* not fcntl */ 15#define O_NOCTTY 0x8000 /* not fcntl */
20#define O_DIRECTORY 0x10000 /* must be a directory */
21#define O_NOFOLLOW 0x20000 /* don't follow links */
22#define O_LARGEFILE 0x40000 16#define O_LARGEFILE 0x40000
23#define O_DIRECT 0x100000 /* direct disk access hint */ 17#define O_DIRECT 0x100000 /* direct disk access hint */
24#define O_NOATIME 0x200000 18#define O_NOATIME 0x200000
25 19
26 20
27#define F_DUPFD 0 /* dup */
28#define F_GETFD 1 /* get close_on_exec */
29#define F_SETFD 2 /* set/clear close_on_exec */
30#define F_GETFL 3 /* get file->f_flags */
31#define F_SETFL 4 /* set file->f_flags */
32#define F_GETOWN 5 /* for sockets. */ 21#define F_GETOWN 5 /* for sockets. */
33#define F_SETOWN 6 /* for sockets. */ 22#define F_SETOWN 6 /* for sockets. */
34#define F_GETLK 7 23#define F_GETLK 7
35#define F_SETLK 8 24#define F_SETLK 8
36#define F_SETLKW 9 25#define F_SETLKW 9
37#define F_SETSIG 10 /* for sockets. */
38#define F_GETSIG 11 /* for sockets. */
39
40/* for F_[GET|SET]FL */
41#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
42 26
43/* for posix fcntl() and lockf() */ 27/* for posix fcntl() and lockf() */
44#define F_RDLCK 1 28#define F_RDLCK 1
45#define F_WRLCK 2 29#define F_WRLCK 2
46#define F_UNLCK 3 30#define F_UNLCK 3
47 31
48/* for old implementation of bsd flock () */ 32#define __ARCH_FLOCK_PAD short __unused;
49#define F_EXLCK 4 /* or 3 */
50#define F_SHLCK 8 /* or 4 */
51
52/* for leases */
53#define F_INPROGRESS 16
54
55/* operations for bsd flock(), also used by the kernel implementation */
56#define LOCK_SH 1 /* shared lock */
57#define LOCK_EX 2 /* exclusive lock */
58#define LOCK_NB 4 /* or'd with one of the above to prevent
59 blocking */
60#define LOCK_UN 8 /* remove lock */
61
62#define LOCK_MAND 32 /* This is a mandatory flock */
63#define LOCK_READ 64 /* ... Which allows concurrent read operations */
64#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
65#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
66
67struct flock {
68 short l_type;
69 short l_whence;
70 off_t l_start;
71 off_t l_len;
72 pid_t l_pid;
73 short __unused;
74};
75 33
76#define F_LINUX_SPECIFIC_BASE 1024 34#include <asm-generic/fcntl.h>
77 35
78#endif /* !(_SPARC64_FCNTL_H) */ 36#endif /* !(_SPARC64_FCNTL_H) */
diff --git a/include/asm-sparc64/futex.h b/include/asm-sparc64/futex.h
new file mode 100644
index 000000000000..2cac5ecd9d00
--- /dev/null
+++ b/include/asm-sparc64/futex.h
@@ -0,0 +1,53 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/uaccess.h>
9
10static inline int
11futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
12{
13 int op = (encoded_op >> 28) & 7;
14 int cmp = (encoded_op >> 24) & 15;
15 int oparg = (encoded_op << 8) >> 20;
16 int cmparg = (encoded_op << 20) >> 20;
17 int oldval = 0, ret, tem;
18 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
19 oparg = 1 << oparg;
20
21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
22 return -EFAULT;
23
24 inc_preempt_count();
25
26 switch (op) {
27 case FUTEX_OP_SET:
28 case FUTEX_OP_ADD:
29 case FUTEX_OP_OR:
30 case FUTEX_OP_ANDN:
31 case FUTEX_OP_XOR:
32 default:
33 ret = -ENOSYS;
34 }
35
36 dec_preempt_count();
37
38 if (!ret) {
39 switch (cmp) {
40 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
41 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
42 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
43 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
44 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
45 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
46 default: ret = -ENOSYS;
47 }
48 }
49 return ret;
50}
51
52#endif
53#endif
diff --git a/include/asm-sparc64/hardirq.h b/include/asm-sparc64/hardirq.h
index d6db1aed7645..f0cf71376ec5 100644
--- a/include/asm-sparc64/hardirq.h
+++ b/include/asm-sparc64/hardirq.h
@@ -1,22 +1,16 @@
1/* hardirq.h: 64-bit Sparc hard IRQ support. 1/* hardirq.h: 64-bit Sparc hard IRQ support.
2 * 2 *
3 * Copyright (C) 1997, 1998 David S. Miller (davem@caip.rutgers.edu) 3 * Copyright (C) 1997, 1998, 2005 David S. Miller (davem@davemloft.net)
4 */ 4 */
5 5
6#ifndef __SPARC64_HARDIRQ_H 6#ifndef __SPARC64_HARDIRQ_H
7#define __SPARC64_HARDIRQ_H 7#define __SPARC64_HARDIRQ_H
8 8
9#include <linux/config.h> 9#include <asm/cpudata.h>
10#include <linux/threads.h>
11#include <linux/spinlock.h>
12#include <linux/cache.h>
13 10
14/* rtrap.S is sensitive to the offsets of these fields */ 11#define __ARCH_IRQ_STAT
15typedef struct { 12#define local_softirq_pending() \
16 unsigned int __softirq_pending; 13 (local_cpu_data().__softirq_pending)
17} ____cacheline_aligned irq_cpustat_t;
18
19#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
20 14
21#define HARDIRQ_BITS 8 15#define HARDIRQ_BITS 8
22 16
diff --git a/include/asm-sparc64/hdreg.h b/include/asm-sparc64/hdreg.h
deleted file mode 100644
index 7f7fd1af0af3..000000000000
--- a/include/asm-sparc64/hdreg.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/hdreg.h>
diff --git a/include/asm-sparc64/io.h b/include/asm-sparc64/io.h
index afdcea90707a..0056770e83ad 100644
--- a/include/asm-sparc64/io.h
+++ b/include/asm-sparc64/io.h
@@ -100,18 +100,41 @@ static __inline__ void _outl(u32 l, unsigned long addr)
100#define inl_p(__addr) inl(__addr) 100#define inl_p(__addr) inl(__addr)
101#define outl_p(__l, __addr) outl(__l, __addr) 101#define outl_p(__l, __addr) outl(__l, __addr)
102 102
103extern void outsb(void __iomem *addr, const void *src, unsigned long count); 103extern void outsb(unsigned long, const void *, unsigned long);
104extern void outsw(void __iomem *addr, const void *src, unsigned long count); 104extern void outsw(unsigned long, const void *, unsigned long);
105extern void outsl(void __iomem *addr, const void *src, unsigned long count); 105extern void outsl(unsigned long, const void *, unsigned long);
106extern void insb(void __iomem *addr, void *dst, unsigned long count); 106extern void insb(unsigned long, void *, unsigned long);
107extern void insw(void __iomem *addr, void *dst, unsigned long count); 107extern void insw(unsigned long, void *, unsigned long);
108extern void insl(void __iomem *addr, void *dst, unsigned long count); 108extern void insl(unsigned long, void *, unsigned long);
109#define ioread8_rep(a,d,c) insb(a,d,c) 109
110#define ioread16_rep(a,d,c) insw(a,d,c) 110static inline void ioread8_rep(void __iomem *port, void *buf, unsigned long count)
111#define ioread32_rep(a,d,c) insl(a,d,c) 111{
112#define iowrite8_rep(a,s,c) outsb(a,s,c) 112 insb((unsigned long __force)port, buf, count);
113#define iowrite16_rep(a,s,c) outsw(a,s,c) 113}
114#define iowrite32_rep(a,s,c) outsl(a,s,c) 114static inline void ioread16_rep(void __iomem *port, void *buf, unsigned long count)
115{
116 insw((unsigned long __force)port, buf, count);
117}
118
119static inline void ioread32_rep(void __iomem *port, void *buf, unsigned long count)
120{
121 insl((unsigned long __force)port, buf, count);
122}
123
124static inline void iowrite8_rep(void __iomem *port, const void *buf, unsigned long count)
125{
126 outsb((unsigned long __force)port, buf, count);
127}
128
129static inline void iowrite16_rep(void __iomem *port, const void *buf, unsigned long count)
130{
131 outsw((unsigned long __force)port, buf, count);
132}
133
134static inline void iowrite32_rep(void __iomem *port, const void *buf, unsigned long count)
135{
136 outsl((unsigned long __force)port, buf, count);
137}
115 138
116/* Memory functions, same as I/O accesses on Ultra. */ 139/* Memory functions, same as I/O accesses on Ultra. */
117static inline u8 _readb(const volatile void __iomem *addr) 140static inline u8 _readb(const volatile void __iomem *addr)
diff --git a/include/asm-sparc64/page.h b/include/asm-sparc64/page.h
index b87dbbd64bc9..c9f8ef208ea5 100644
--- a/include/asm-sparc64/page.h
+++ b/include/asm-sparc64/page.h
@@ -150,20 +150,6 @@ struct sparc_phys_banks {
150 150
151extern struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS]; 151extern struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS];
152 152
153/* Pure 2^n version of get_order */
154static __inline__ int get_order(unsigned long size)
155{
156 int order;
157
158 size = (size-1) >> (PAGE_SHIFT-1);
159 order = -1;
160 do {
161 size >>= 1;
162 order++;
163 } while (size);
164 return order;
165}
166
167#endif /* !(__ASSEMBLY__) */ 153#endif /* !(__ASSEMBLY__) */
168 154
169#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ 155#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
@@ -171,4 +157,6 @@ static __inline__ int get_order(unsigned long size)
171 157
172#endif /* !(__KERNEL__) */ 158#endif /* !(__KERNEL__) */
173 159
160#include <asm-generic/page.h>
161
174#endif /* !(_SPARC64_PAGE_H) */ 162#endif /* !(_SPARC64_PAGE_H) */
diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h
index a4ab0ec7143a..89bd71b1c0d8 100644
--- a/include/asm-sparc64/pci.h
+++ b/include/asm-sparc64/pci.h
@@ -269,6 +269,8 @@ extern void
269pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, 269pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
270 struct pci_bus_region *region); 270 struct pci_bus_region *region);
271 271
272extern struct resource *pcibios_select_root(struct pci_dev *, struct resource *);
273
272static inline void pcibios_add_platform_entries(struct pci_dev *dev) 274static inline void pcibios_add_platform_entries(struct pci_dev *dev)
273{ 275{
274} 276}
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h
index 1ae00c5087f1..a2b4f5ed4625 100644
--- a/include/asm-sparc64/pgtable.h
+++ b/include/asm-sparc64/pgtable.h
@@ -410,9 +410,6 @@ extern unsigned long *sparc64_valid_addr_bitmap;
410#define kern_addr_valid(addr) \ 410#define kern_addr_valid(addr) \
411 (test_bit(__pa((unsigned long)(addr))>>22, sparc64_valid_addr_bitmap)) 411 (test_bit(__pa((unsigned long)(addr))>>22, sparc64_valid_addr_bitmap))
412 412
413extern int io_remap_page_range(struct vm_area_struct *vma, unsigned long from,
414 unsigned long offset,
415 unsigned long size, pgprot_t prot, int space);
416extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, 413extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
417 unsigned long pfn, 414 unsigned long pfn,
418 unsigned long size, pgprot_t prot); 415 unsigned long size, pgprot_t prot);
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h
index 5e94c05dc2fc..b5417529f6f1 100644
--- a/include/asm-sparc64/system.h
+++ b/include/asm-sparc64/system.h
@@ -28,13 +28,48 @@ enum sparc_cpu {
28#define ARCH_SUN4C_SUN4 0 28#define ARCH_SUN4C_SUN4 0
29#define ARCH_SUN4 0 29#define ARCH_SUN4 0
30 30
31extern void mb(void); 31/* These are here in an effort to more fully work around Spitfire Errata
32extern void rmb(void); 32 * #51. Essentially, if a memory barrier occurs soon after a mispredicted
33extern void wmb(void); 33 * branch, the chip can stop executing instructions until a trap occurs.
34extern void membar_storeload(void); 34 * Therefore, if interrupts are disabled, the chip can hang forever.
35extern void membar_storeload_storestore(void); 35 *
36extern void membar_storeload_loadload(void); 36 * It used to be believed that the memory barrier had to be right in the
37extern void membar_storestore_loadstore(void); 37 * delay slot, but a case has been traced recently wherein the memory barrier
38 * was one instruction after the branch delay slot and the chip still hung.
39 * The offending sequence was the following in sym_wakeup_done() of the
40 * sym53c8xx_2 driver:
41 *
42 * call sym_ccb_from_dsa, 0
43 * movge %icc, 0, %l0
44 * brz,pn %o0, .LL1303
45 * mov %o0, %l2
46 * membar #LoadLoad
47 *
48 * The branch has to be mispredicted for the bug to occur. Therefore, we put
49 * the memory barrier explicitly into a "branch always, predicted taken"
50 * delay slot to avoid the problem case.
51 */
52#define membar_safe(type) \
53do { __asm__ __volatile__("ba,pt %%xcc, 1f\n\t" \
54 " membar " type "\n" \
55 "1:\n" \
56 : : : "memory"); \
57} while (0)
58
59#define mb() \
60 membar_safe("#LoadLoad | #LoadStore | #StoreStore | #StoreLoad")
61#define rmb() \
62 membar_safe("#LoadLoad")
63#define wmb() \
64 membar_safe("#StoreStore")
65#define membar_storeload() \
66 membar_safe("#StoreLoad")
67#define membar_storeload_storestore() \
68 membar_safe("#StoreLoad | #StoreStore")
69#define membar_storeload_loadload() \
70 membar_safe("#StoreLoad | #LoadLoad")
71#define membar_storestore_loadstore() \
72 membar_safe("#StoreStore | #LoadStore")
38 73
39#endif 74#endif
40 75
diff --git a/include/asm-sparc64/types.h b/include/asm-sparc64/types.h
index 6248ed1a9a7a..d0ee7f105838 100644
--- a/include/asm-sparc64/types.h
+++ b/include/asm-sparc64/types.h
@@ -56,8 +56,6 @@ typedef unsigned long u64;
56typedef u32 dma_addr_t; 56typedef u32 dma_addr_t;
57typedef u64 dma64_addr_t; 57typedef u64 dma64_addr_t;
58 58
59typedef unsigned short kmem_bufctl_t;
60
61#endif /* __ASSEMBLY__ */ 59#endif /* __ASSEMBLY__ */
62 60
63#endif /* __KERNEL__ */ 61#endif /* __KERNEL__ */
diff --git a/include/asm-sparc64/uaccess.h b/include/asm-sparc64/uaccess.h
index 5690142f82de..80a65d7e3dbf 100644
--- a/include/asm-sparc64/uaccess.h
+++ b/include/asm-sparc64/uaccess.h
@@ -59,12 +59,6 @@ static inline int access_ok(int type, const void __user * addr, unsigned long si
59 return 1; 59 return 1;
60} 60}
61 61
62/* this function will go away soon - use access_ok() instead */
63static inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size)
64{
65 return 0;
66}
67
68/* 62/*
69 * The exception table consists of pairs of addresses: the first is the 63 * The exception table consists of pairs of addresses: the first is the
70 * address of an instruction that is allowed to fault, and the second is 64 * address of an instruction that is allowed to fault, and the second is
diff --git a/include/asm-um/auxvec.h b/include/asm-um/auxvec.h
new file mode 100644
index 000000000000..1e5e1c2fc9b1
--- /dev/null
+++ b/include/asm-um/auxvec.h
@@ -0,0 +1,4 @@
1#ifndef __UM_AUXVEC_H
2#define __UM_AUXVEC_H
3
4#endif
diff --git a/include/asm-um/futex.h b/include/asm-um/futex.h
new file mode 100644
index 000000000000..2cac5ecd9d00
--- /dev/null
+++ b/include/asm-um/futex.h
@@ -0,0 +1,53 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/uaccess.h>
9
10static inline int
11futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
12{
13 int op = (encoded_op >> 28) & 7;
14 int cmp = (encoded_op >> 24) & 15;
15 int oparg = (encoded_op << 8) >> 20;
16 int cmparg = (encoded_op << 20) >> 20;
17 int oldval = 0, ret, tem;
18 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
19 oparg = 1 << oparg;
20
21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
22 return -EFAULT;
23
24 inc_preempt_count();
25
26 switch (op) {
27 case FUTEX_OP_SET:
28 case FUTEX_OP_ADD:
29 case FUTEX_OP_OR:
30 case FUTEX_OP_ANDN:
31 case FUTEX_OP_XOR:
32 default:
33 ret = -ENOSYS;
34 }
35
36 dec_preempt_count();
37
38 if (!ret) {
39 switch (cmp) {
40 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
41 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
42 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
43 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
44 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
45 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
46 default: ret = -ENOSYS;
47 }
48 }
49 return ret;
50}
51
52#endif
53#endif
diff --git a/include/asm-um/hdreg.h b/include/asm-um/hdreg.h
deleted file mode 100644
index cf6363abcab9..000000000000
--- a/include/asm-um/hdreg.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __UM_HDREG_H
2#define __UM_HDREG_H
3
4#include "asm/arch/hdreg.h"
5
6#endif
diff --git a/include/asm-um/mmu_context.h b/include/asm-um/mmu_context.h
index 095bb627b96a..2edb4f1f789c 100644
--- a/include/asm-um/mmu_context.h
+++ b/include/asm-um/mmu_context.h
@@ -20,7 +20,15 @@ extern void force_flush_all(void);
20 20
21static inline void activate_mm(struct mm_struct *old, struct mm_struct *new) 21static inline void activate_mm(struct mm_struct *old, struct mm_struct *new)
22{ 22{
23 if (old != new) 23 /*
24 * This is called by fs/exec.c and fs/aio.c. In the first case, for an
25 * exec, we don't need to do anything as we're called from userspace
26 * and thus going to use a new host PID. In the second, we're called
27 * from a kernel thread, and thus need to go doing the mmap's on the
28 * host. Since they're very expensive, we want to avoid that as far as
29 * possible.
30 */
31 if (old != new && (current->flags & PF_BORROWED_MM))
24 force_flush_all(); 32 force_flush_all();
25} 33}
26 34
diff --git a/include/asm-um/page.h b/include/asm-um/page.h
index f58aedadeb4e..bd850a249183 100644
--- a/include/asm-um/page.h
+++ b/include/asm-um/page.h
@@ -116,24 +116,12 @@ extern void *to_virt(unsigned long phys);
116#define pfn_valid(pfn) ((pfn) < max_mapnr) 116#define pfn_valid(pfn) ((pfn) < max_mapnr)
117#define virt_addr_valid(v) pfn_valid(phys_to_pfn(__pa(v))) 117#define virt_addr_valid(v) pfn_valid(phys_to_pfn(__pa(v)))
118 118
119/* Pure 2^n version of get_order */
120static __inline__ int get_order(unsigned long size)
121{
122 int order;
123
124 size = (size-1) >> (PAGE_SHIFT-1);
125 order = -1;
126 do {
127 size >>= 1;
128 order++;
129 } while (size);
130 return order;
131}
132
133extern struct page *arch_validate(struct page *page, int mask, int order); 119extern struct page *arch_validate(struct page *page, int mask, int order);
134#define HAVE_ARCH_VALIDATE 120#define HAVE_ARCH_VALIDATE
135 121
136extern void arch_free_page(struct page *page, int order); 122extern void arch_free_page(struct page *page, int order);
137#define HAVE_ARCH_FREE_PAGE 123#define HAVE_ARCH_FREE_PAGE
138 124
125#include <asm-generic/page.h>
126
139#endif 127#endif
diff --git a/include/asm-um/pgalloc.h b/include/asm-um/pgalloc.h
index 8fcb2fc0a892..ea49411236dc 100644
--- a/include/asm-um/pgalloc.h
+++ b/include/asm-um/pgalloc.h
@@ -42,11 +42,13 @@ static inline void pte_free(struct page *pte)
42#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) 42#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
43 43
44#ifdef CONFIG_3_LEVEL_PGTABLES 44#ifdef CONFIG_3_LEVEL_PGTABLES
45/* 45
46 * In the 3-level case we free the pmds as part of the pgd. 46extern __inline__ void pmd_free(pmd_t *pmd)
47 */ 47{
48#define pmd_free(x) do { } while (0) 48 free_page((unsigned long)pmd);
49#define __pmd_free_tlb(tlb,x) do { } while (0) 49}
50
51#define __pmd_free_tlb(tlb,x) tlb_remove_page((tlb),virt_to_page(x))
50#endif 52#endif
51 53
52#define check_pgt_cache() do { } while (0) 54#define check_pgt_cache() do { } while (0)
diff --git a/include/asm-um/pgtable-2level.h b/include/asm-um/pgtable-2level.h
index 9b3abc01d60e..ffe017f6b64b 100644
--- a/include/asm-um/pgtable-2level.h
+++ b/include/asm-um/pgtable-2level.h
@@ -35,35 +35,8 @@
35static inline int pgd_newpage(pgd_t pgd) { return 0; } 35static inline int pgd_newpage(pgd_t pgd) { return 0; }
36static inline void pgd_mkuptodate(pgd_t pgd) { } 36static inline void pgd_mkuptodate(pgd_t pgd) { }
37 37
38#define pte_present(x) (pte_val(x) & (_PAGE_PRESENT | _PAGE_PROTNONE))
39
40static inline pte_t pte_mknewprot(pte_t pte)
41{
42 pte_val(pte) |= _PAGE_NEWPROT;
43 return(pte);
44}
45
46static inline pte_t pte_mknewpage(pte_t pte)
47{
48 pte_val(pte) |= _PAGE_NEWPAGE;
49 return(pte);
50}
51
52static inline void set_pte(pte_t *pteptr, pte_t pteval)
53{
54 /* If it's a swap entry, it needs to be marked _PAGE_NEWPAGE so
55 * fix_range knows to unmap it. _PAGE_NEWPROT is specific to
56 * mapped pages.
57 */
58 *pteptr = pte_mknewpage(pteval);
59 if(pte_present(*pteptr)) *pteptr = pte_mknewprot(*pteptr);
60}
61#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
62
63#define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval)) 38#define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval))
64 39
65#define pte_page(x) pfn_to_page(pte_pfn(x))
66#define pte_none(x) !(pte_val(x) & ~_PAGE_NEWPAGE)
67#define pte_pfn(x) phys_to_pfn(pte_val(x)) 40#define pte_pfn(x) phys_to_pfn(pte_val(x))
68#define pfn_pte(pfn, prot) __pte(pfn_to_phys(pfn) | pgprot_val(prot)) 41#define pfn_pte(pfn, prot) __pte(pfn_to_phys(pfn) | pgprot_val(prot))
69#define pfn_pmd(pfn, prot) __pmd(pfn_to_phys(pfn) | pgprot_val(prot)) 42#define pfn_pmd(pfn, prot) __pmd(pfn_to_phys(pfn) | pgprot_val(prot))
diff --git a/include/asm-um/pgtable-3level.h b/include/asm-um/pgtable-3level.h
index 65e8bfc55fc4..786c25727289 100644
--- a/include/asm-um/pgtable-3level.h
+++ b/include/asm-um/pgtable-3level.h
@@ -57,35 +57,6 @@ static inline int pgd_newpage(pgd_t pgd)
57 57
58static inline void pgd_mkuptodate(pgd_t pgd) { pgd_val(pgd) &= ~_PAGE_NEWPAGE; } 58static inline void pgd_mkuptodate(pgd_t pgd) { pgd_val(pgd) &= ~_PAGE_NEWPAGE; }
59 59
60
61#define pte_present(x) pte_get_bits(x, (_PAGE_PRESENT | _PAGE_PROTNONE))
62
63static inline pte_t pte_mknewprot(pte_t pte)
64{
65 pte_set_bits(pte, _PAGE_NEWPROT);
66 return(pte);
67}
68
69static inline pte_t pte_mknewpage(pte_t pte)
70{
71 pte_set_bits(pte, _PAGE_NEWPAGE);
72 return(pte);
73}
74
75static inline void set_pte(pte_t *pteptr, pte_t pteval)
76{
77 pte_copy(*pteptr, pteval);
78
79 /* If it's a swap entry, it needs to be marked _PAGE_NEWPAGE so
80 * fix_range knows to unmap it. _PAGE_NEWPROT is specific to
81 * mapped pages.
82 */
83
84 *pteptr = pte_mknewpage(*pteptr);
85 if(pte_present(*pteptr)) *pteptr = pte_mknewprot(*pteptr);
86}
87#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
88
89#define set_pmd(pmdptr, pmdval) set_64bit((phys_t *) (pmdptr), pmd_val(pmdval)) 60#define set_pmd(pmdptr, pmdval) set_64bit((phys_t *) (pmdptr), pmd_val(pmdval))
90 61
91static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) 62static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
@@ -98,14 +69,11 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
98 return pmd; 69 return pmd;
99} 70}
100 71
101static inline void pmd_free(pmd_t *pmd){ 72extern inline void pud_clear (pud_t *pud)
102 free_page((unsigned long) pmd); 73{
74 set_pud(pud, __pud(0));
103} 75}
104 76
105#define __pmd_free_tlb(tlb,x) do { } while (0)
106
107static inline void pud_clear (pud_t * pud) { }
108
109#define pud_page(pud) \ 77#define pud_page(pud) \
110 ((struct page *) __va(pud_val(pud) & PAGE_MASK)) 78 ((struct page *) __va(pud_val(pud) & PAGE_MASK))
111 79
@@ -113,13 +81,6 @@ static inline void pud_clear (pud_t * pud) { }
113#define pmd_offset(pud, address) ((pmd_t *) pud_page(*(pud)) + \ 81#define pmd_offset(pud, address) ((pmd_t *) pud_page(*(pud)) + \
114 pmd_index(address)) 82 pmd_index(address))
115 83
116#define pte_page(x) pfn_to_page(pte_pfn(x))
117
118static inline int pte_none(pte_t pte)
119{
120 return pte_is_zero(pte);
121}
122
123static inline unsigned long pte_pfn(pte_t pte) 84static inline unsigned long pte_pfn(pte_t pte)
124{ 85{
125 return phys_to_pfn(pte_val(pte)); 86 return phys_to_pfn(pte_val(pte));
diff --git a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h
index a88040920311..b48e0966ecd7 100644
--- a/include/asm-um/pgtable.h
+++ b/include/asm-um/pgtable.h
@@ -16,13 +16,15 @@
16 16
17#define _PAGE_PRESENT 0x001 17#define _PAGE_PRESENT 0x001
18#define _PAGE_NEWPAGE 0x002 18#define _PAGE_NEWPAGE 0x002
19#define _PAGE_NEWPROT 0x004 19#define _PAGE_NEWPROT 0x004
20#define _PAGE_FILE 0x008 /* set:pagecache unset:swap */
21#define _PAGE_PROTNONE 0x010 /* If not present */
22#define _PAGE_RW 0x020 20#define _PAGE_RW 0x020
23#define _PAGE_USER 0x040 21#define _PAGE_USER 0x040
24#define _PAGE_ACCESSED 0x080 22#define _PAGE_ACCESSED 0x080
25#define _PAGE_DIRTY 0x100 23#define _PAGE_DIRTY 0x100
24/* If _PAGE_PRESENT is clear, we use these: */
25#define _PAGE_FILE 0x008 /* nonlinear file mapping, saved PTE; unset:swap */
26#define _PAGE_PROTNONE 0x010 /* if the user mapped it with PROT_NONE;
27 pte_present gives true */
26 28
27#ifdef CONFIG_3_LEVEL_PGTABLES 29#ifdef CONFIG_3_LEVEL_PGTABLES
28#include "asm/pgtable-3level.h" 30#include "asm/pgtable-3level.h"
@@ -151,10 +153,24 @@ extern unsigned long pg0[1024];
151 153
152#define pmd_page(pmd) phys_to_page(pmd_val(pmd) & PAGE_MASK) 154#define pmd_page(pmd) phys_to_page(pmd_val(pmd) & PAGE_MASK)
153 155
156#define pte_page(x) pfn_to_page(pte_pfn(x))
154#define pte_address(x) (__va(pte_val(x) & PAGE_MASK)) 157#define pte_address(x) (__va(pte_val(x) & PAGE_MASK))
155#define mk_phys(a, r) ((a) + (((unsigned long) r) << REGION_SHIFT)) 158#define mk_phys(a, r) ((a) + (((unsigned long) r) << REGION_SHIFT))
156#define phys_addr(p) ((p) & ~REGION_MASK) 159#define phys_addr(p) ((p) & ~REGION_MASK)
157 160
161#define pte_present(x) pte_get_bits(x, (_PAGE_PRESENT | _PAGE_PROTNONE))
162
163/*
164 * =================================
165 * Flags checking section.
166 * =================================
167 */
168
169static inline int pte_none(pte_t pte)
170{
171 return pte_is_zero(pte);
172}
173
158/* 174/*
159 * The following only work if pte_present() is true. 175 * The following only work if pte_present() is true.
160 * Undefined behaviour if not.. 176 * Undefined behaviour if not..
@@ -210,6 +226,18 @@ static inline int pte_newprot(pte_t pte)
210 return(pte_present(pte) && (pte_get_bits(pte, _PAGE_NEWPROT))); 226 return(pte_present(pte) && (pte_get_bits(pte, _PAGE_NEWPROT)));
211} 227}
212 228
229/*
230 * =================================
231 * Flags setting section.
232 * =================================
233 */
234
235static inline pte_t pte_mknewprot(pte_t pte)
236{
237 pte_set_bits(pte, _PAGE_NEWPROT);
238 return(pte);
239}
240
213static inline pte_t pte_rdprotect(pte_t pte) 241static inline pte_t pte_rdprotect(pte_t pte)
214{ 242{
215 pte_clear_bits(pte, _PAGE_USER); 243 pte_clear_bits(pte, _PAGE_USER);
@@ -278,6 +306,26 @@ static inline pte_t pte_mkuptodate(pte_t pte)
278 return(pte); 306 return(pte);
279} 307}
280 308
309static inline pte_t pte_mknewpage(pte_t pte)
310{
311 pte_set_bits(pte, _PAGE_NEWPAGE);
312 return(pte);
313}
314
315static inline void set_pte(pte_t *pteptr, pte_t pteval)
316{
317 pte_copy(*pteptr, pteval);
318
319 /* If it's a swap entry, it needs to be marked _PAGE_NEWPAGE so
320 * fix_range knows to unmap it. _PAGE_NEWPROT is specific to
321 * mapped pages.
322 */
323
324 *pteptr = pte_mknewpage(*pteptr);
325 if(pte_present(*pteptr)) *pteptr = pte_mknewprot(*pteptr);
326}
327#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
328
281extern phys_t page_to_phys(struct page *page); 329extern phys_t page_to_phys(struct page *page);
282 330
283/* 331/*
diff --git a/include/asm-v850/auxvec.h b/include/asm-v850/auxvec.h
new file mode 100644
index 000000000000..f493232d0224
--- /dev/null
+++ b/include/asm-v850/auxvec.h
@@ -0,0 +1,4 @@
1#ifndef __V850_AUXVEC_H__
2#define __V850_AUXVEC_H__
3
4#endif /* __V850_AUXVEC_H__ */
diff --git a/include/asm-v850/fcntl.h b/include/asm-v850/fcntl.h
index 31d4b5961221..3af4d56776dd 100644
--- a/include/asm-v850/fcntl.h
+++ b/include/asm-v850/fcntl.h
@@ -1,87 +1,11 @@
1#ifndef __V850_FCNTL_H__ 1#ifndef __V850_FCNTL_H__
2#define __V850_FCNTL_H__ 2#define __V850_FCNTL_H__
3 3
4/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
5 located on an ext2 file system */
6#define O_ACCMODE 0003
7#define O_RDONLY 00
8#define O_WRONLY 01
9#define O_RDWR 02
10#define O_CREAT 0100 /* not fcntl */
11#define O_EXCL 0200 /* not fcntl */
12#define O_NOCTTY 0400 /* not fcntl */
13#define O_TRUNC 01000 /* not fcntl */
14#define O_APPEND 02000
15#define O_NONBLOCK 04000
16#define O_NDELAY O_NONBLOCK
17#define O_SYNC 010000
18#define FASYNC 020000 /* fcntl, for BSD compatibility */
19#define O_DIRECTORY 040000 /* must be a directory */ 4#define O_DIRECTORY 040000 /* must be a directory */
20#define O_NOFOLLOW 0100000 /* don't follow links */ 5#define O_NOFOLLOW 0100000 /* don't follow links */
21#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */ 6#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
22#define O_LARGEFILE 0400000 7#define O_LARGEFILE 0400000
23#define O_NOATIME 01000000
24 8
25#define F_DUPFD 0 /* dup */ 9#include <asm-generic/fcntl.h>
26#define F_GETFD 1 /* get close_on_exec */
27#define F_SETFD 2 /* set/clear close_on_exec */
28#define F_GETFL 3 /* get file->f_flags */
29#define F_SETFL 4 /* set file->f_flags */
30#define F_GETLK 5
31#define F_SETLK 6
32#define F_SETLKW 7
33 10
34#define F_SETOWN 8 /* for sockets. */
35#define F_GETOWN 9 /* for sockets. */
36#define F_SETSIG 10 /* for sockets. */
37#define F_GETSIG 11 /* for sockets. */
38
39#define F_GETLK64 12 /* using 'struct flock64' */
40#define F_SETLK64 13
41#define F_SETLKW64 14
42
43/* for F_[GET|SET]FL */
44#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
45
46/* for posix fcntl() and lockf() */
47#define F_RDLCK 0
48#define F_WRLCK 1
49#define F_UNLCK 2
50
51/* for old implementation of bsd flock () */
52#define F_EXLCK 4 /* or 3 */
53#define F_SHLCK 8 /* or 4 */
54
55/* for leases */
56#define F_INPROGRESS 16
57
58/* operations for bsd flock(), also used by the kernel implementation */
59#define LOCK_SH 1 /* shared lock */
60#define LOCK_EX 2 /* exclusive lock */
61#define LOCK_NB 4 /* or'd with one of the above to prevent
62 blocking */
63#define LOCK_UN 8 /* remove lock */
64
65#define LOCK_MAND 32 /* This is a mandatory flock */
66#define LOCK_READ 64 /* ... Which allows concurrent read operations */
67#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
68#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
69
70struct flock {
71 short l_type;
72 short l_whence;
73 off_t l_start;
74 off_t l_len;
75 pid_t l_pid;
76};
77
78struct flock64 {
79 short l_type;
80 short l_whence;
81 loff_t l_start;
82 loff_t l_len;
83 pid_t l_pid;
84};
85
86#define F_LINUX_SPECIFIC_BASE 1024
87#endif /* __V850_FCNTL_H__ */ 11#endif /* __V850_FCNTL_H__ */
diff --git a/include/asm-v850/futex.h b/include/asm-v850/futex.h
new file mode 100644
index 000000000000..2cac5ecd9d00
--- /dev/null
+++ b/include/asm-v850/futex.h
@@ -0,0 +1,53 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/uaccess.h>
9
10static inline int
11futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
12{
13 int op = (encoded_op >> 28) & 7;
14 int cmp = (encoded_op >> 24) & 15;
15 int oparg = (encoded_op << 8) >> 20;
16 int cmparg = (encoded_op << 20) >> 20;
17 int oldval = 0, ret, tem;
18 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
19 oparg = 1 << oparg;
20
21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
22 return -EFAULT;
23
24 inc_preempt_count();
25
26 switch (op) {
27 case FUTEX_OP_SET:
28 case FUTEX_OP_ADD:
29 case FUTEX_OP_OR:
30 case FUTEX_OP_ANDN:
31 case FUTEX_OP_XOR:
32 default:
33 ret = -ENOSYS;
34 }
35
36 dec_preempt_count();
37
38 if (!ret) {
39 switch (cmp) {
40 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
41 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
42 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
43 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
44 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
45 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
46 default: ret = -ENOSYS;
47 }
48 }
49 return ret;
50}
51
52#endif
53#endif
diff --git a/include/asm-v850/page.h b/include/asm-v850/page.h
index d6091622935d..b4bc85e7b91a 100644
--- a/include/asm-v850/page.h
+++ b/include/asm-v850/page.h
@@ -98,25 +98,6 @@ typedef unsigned long pgprot_t;
98#define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) 98#define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK)
99 99
100 100
101#ifndef __ASSEMBLY__
102
103/* Pure 2^n version of get_order */
104extern __inline__ int get_order (unsigned long size)
105{
106 int order;
107
108 size = (size-1) >> (PAGE_SHIFT-1);
109 order = -1;
110 do {
111 size >>= 1;
112 order++;
113 } while (size);
114 return order;
115}
116
117#endif /* !__ASSEMBLY__ */
118
119
120/* No current v850 processor has virtual memory. */ 101/* No current v850 processor has virtual memory. */
121#define __virt_to_phys(addr) (addr) 102#define __virt_to_phys(addr) (addr)
122#define __phys_to_virt(addr) (addr) 103#define __phys_to_virt(addr) (addr)
@@ -144,4 +125,6 @@ extern __inline__ int get_order (unsigned long size)
144 125
145#endif /* KERNEL */ 126#endif /* KERNEL */
146 127
128#include <asm-generic/page.h>
129
147#endif /* __V850_PAGE_H__ */ 130#endif /* __V850_PAGE_H__ */
diff --git a/include/asm-v850/types.h b/include/asm-v850/types.h
index e7cfe5b33a10..dcef57196875 100644
--- a/include/asm-v850/types.h
+++ b/include/asm-v850/types.h
@@ -59,8 +59,6 @@ typedef unsigned long long u64;
59 59
60typedef u32 dma_addr_t; 60typedef u32 dma_addr_t;
61 61
62typedef unsigned int kmem_bufctl_t;
63
64#endif /* !__ASSEMBLY__ */ 62#endif /* !__ASSEMBLY__ */
65 63
66#endif /* __KERNEL__ */ 64#endif /* __KERNEL__ */
diff --git a/include/asm-v850/uaccess.h b/include/asm-v850/uaccess.h
index 4386cfc6a8dd..188b28597cf1 100644
--- a/include/asm-v850/uaccess.h
+++ b/include/asm-v850/uaccess.h
@@ -27,12 +27,6 @@ extern inline int access_ok (int type, const void *addr, unsigned long size)
27 return val >= (0x80 + NUM_CPU_IRQS*16) && val < 0xFFFFF000; 27 return val >= (0x80 + NUM_CPU_IRQS*16) && val < 0xFFFFF000;
28} 28}
29 29
30/* this function will go away soon - use access_ok() instead */
31extern inline int __deprecated verify_area (int type, const void *addr, unsigned long size)
32{
33 return access_ok (type, addr, size) ? 0 : -EFAULT;
34}
35
36/* 30/*
37 * The exception table consists of pairs of addresses: the first is the 31 * The exception table consists of pairs of addresses: the first is the
38 * address of an instruction that is allowed to fault, and the second is 32 * address of an instruction that is allowed to fault, and the second is
diff --git a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h
index dc8c981af27f..aa1c7b2e438c 100644
--- a/include/asm-x86_64/acpi.h
+++ b/include/asm-x86_64/acpi.h
@@ -101,7 +101,7 @@ __acpi_release_global_lock (unsigned int *lock)
101 :"=r"(n_hi), "=r"(n_lo) \ 101 :"=r"(n_hi), "=r"(n_lo) \
102 :"0"(n_hi), "1"(n_lo)) 102 :"0"(n_hi), "1"(n_lo))
103 103
104#ifdef CONFIG_ACPI_BOOT 104#ifdef CONFIG_ACPI
105extern int acpi_lapic; 105extern int acpi_lapic;
106extern int acpi_ioapic; 106extern int acpi_ioapic;
107extern int acpi_noirq; 107extern int acpi_noirq;
@@ -121,17 +121,6 @@ static inline void disable_acpi(void)
121#define FIX_ACPI_PAGES 4 121#define FIX_ACPI_PAGES 4
122 122
123extern int acpi_gsi_to_irq(u32 gsi, unsigned int *irq); 123extern int acpi_gsi_to_irq(u32 gsi, unsigned int *irq);
124
125#else /* !CONFIG_ACPI_BOOT */
126#define acpi_lapic 0
127#define acpi_ioapic 0
128#endif /* !CONFIG_ACPI_BOOT */
129
130extern int acpi_numa;
131extern int acpi_scan_nodes(unsigned long start, unsigned long end);
132#define NR_NODE_MEMBLKS (MAX_NUMNODES*2)
133
134#ifdef CONFIG_ACPI_PCI
135static inline void acpi_noirq_set(void) { acpi_noirq = 1; } 124static inline void acpi_noirq_set(void) { acpi_noirq = 1; }
136static inline void acpi_disable_pci(void) 125static inline void acpi_disable_pci(void)
137{ 126{
@@ -139,11 +128,19 @@ static inline void acpi_disable_pci(void)
139 acpi_noirq_set(); 128 acpi_noirq_set();
140} 129}
141extern int acpi_irq_balance_set(char *str); 130extern int acpi_irq_balance_set(char *str);
142#else 131
132#else /* !CONFIG_ACPI */
133
134#define acpi_lapic 0
135#define acpi_ioapic 0
143static inline void acpi_noirq_set(void) { } 136static inline void acpi_noirq_set(void) { }
144static inline void acpi_disable_pci(void) { } 137static inline void acpi_disable_pci(void) { }
145static inline int acpi_irq_balance_set(char *str) { return 0; } 138
146#endif 139#endif /* !CONFIG_ACPI */
140
141extern int acpi_numa;
142extern int acpi_scan_nodes(unsigned long start, unsigned long end);
143#define NR_NODE_MEMBLKS (MAX_NUMNODES*2)
147 144
148#ifdef CONFIG_ACPI_SLEEP 145#ifdef CONFIG_ACPI_SLEEP
149 146
diff --git a/include/asm-x86_64/auxvec.h b/include/asm-x86_64/auxvec.h
new file mode 100644
index 000000000000..2403c4cfced2
--- /dev/null
+++ b/include/asm-x86_64/auxvec.h
@@ -0,0 +1,4 @@
1#ifndef __ASM_X86_64_AUXVEC_H
2#define __ASM_X86_64_AUXVEC_H
3
4#endif
diff --git a/include/asm-x86_64/compat.h b/include/asm-x86_64/compat.h
index d0f453c5adfc..f0155c38f639 100644
--- a/include/asm-x86_64/compat.h
+++ b/include/asm-x86_64/compat.h
@@ -14,10 +14,10 @@ typedef s32 compat_ssize_t;
14typedef s32 compat_time_t; 14typedef s32 compat_time_t;
15typedef s32 compat_clock_t; 15typedef s32 compat_clock_t;
16typedef s32 compat_pid_t; 16typedef s32 compat_pid_t;
17typedef u16 compat_uid_t; 17typedef u16 __compat_uid_t;
18typedef u16 compat_gid_t; 18typedef u16 __compat_gid_t;
19typedef u32 compat_uid32_t; 19typedef u32 __compat_uid32_t;
20typedef u32 compat_gid32_t; 20typedef u32 __compat_gid32_t;
21typedef u16 compat_mode_t; 21typedef u16 compat_mode_t;
22typedef u32 compat_ino_t; 22typedef u32 compat_ino_t;
23typedef u16 compat_dev_t; 23typedef u16 compat_dev_t;
@@ -52,8 +52,8 @@ struct compat_stat {
52 compat_ino_t st_ino; 52 compat_ino_t st_ino;
53 compat_mode_t st_mode; 53 compat_mode_t st_mode;
54 compat_nlink_t st_nlink; 54 compat_nlink_t st_nlink;
55 compat_uid_t st_uid; 55 __compat_uid_t st_uid;
56 compat_gid_t st_gid; 56 __compat_gid_t st_gid;
57 compat_dev_t st_rdev; 57 compat_dev_t st_rdev;
58 u16 __pad2; 58 u16 __pad2;
59 u32 st_size; 59 u32 st_size;
@@ -122,10 +122,10 @@ typedef u32 compat_sigset_word;
122 122
123struct compat_ipc64_perm { 123struct compat_ipc64_perm {
124 compat_key_t key; 124 compat_key_t key;
125 compat_uid32_t uid; 125 __compat_uid32_t uid;
126 compat_gid32_t gid; 126 __compat_gid32_t gid;
127 compat_uid32_t cuid; 127 __compat_uid32_t cuid;
128 compat_gid32_t cgid; 128 __compat_gid32_t cgid;
129 unsigned short mode; 129 unsigned short mode;
130 unsigned short __pad1; 130 unsigned short __pad1;
131 unsigned short seq; 131 unsigned short seq;
diff --git a/include/asm-x86_64/current.h b/include/asm-x86_64/current.h
index 7db560ee6f70..bc8adecee66d 100644
--- a/include/asm-x86_64/current.h
+++ b/include/asm-x86_64/current.h
@@ -17,7 +17,7 @@ static inline struct task_struct *get_current(void)
17#else 17#else
18 18
19#ifndef ASM_OFFSET_H 19#ifndef ASM_OFFSET_H
20#include <asm/offset.h> 20#include <asm/asm-offsets.h>
21#endif 21#endif
22 22
23#define GET_CURRENT(reg) movq %gs:(pda_pcurrent),reg 23#define GET_CURRENT(reg) movq %gs:(pda_pcurrent),reg
diff --git a/include/asm-x86_64/fcntl.h b/include/asm-x86_64/fcntl.h
index 4411f221c037..46ab12db5739 100644
--- a/include/asm-x86_64/fcntl.h
+++ b/include/asm-x86_64/fcntl.h
@@ -1,76 +1 @@
1#ifndef _X86_64_FCNTL_H #include <asm-generic/fcntl.h>
2#define _X86_64_FCNTL_H
3
4/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
5 located on an ext2 file system */
6#define O_ACCMODE 0003
7#define O_RDONLY 00
8#define O_WRONLY 01
9#define O_RDWR 02
10#define O_CREAT 0100 /* not fcntl */
11#define O_EXCL 0200 /* not fcntl */
12#define O_NOCTTY 0400 /* not fcntl */
13#define O_TRUNC 01000 /* not fcntl */
14#define O_APPEND 02000
15#define O_NONBLOCK 04000
16#define O_NDELAY O_NONBLOCK
17#define O_SYNC 010000
18#define FASYNC 020000 /* fcntl, for BSD compatibility */
19#define O_DIRECT 040000 /* direct disk access hint */
20#define O_LARGEFILE 0100000
21#define O_DIRECTORY 0200000 /* must be a directory */
22#define O_NOFOLLOW 0400000 /* don't follow links */
23#define O_NOATIME 01000000
24
25#define F_DUPFD 0 /* dup */
26#define F_GETFD 1 /* get close_on_exec */
27#define F_SETFD 2 /* set/clear close_on_exec */
28#define F_GETFL 3 /* get file->f_flags */
29#define F_SETFL 4 /* set file->f_flags */
30#define F_GETLK 5
31#define F_SETLK 6
32#define F_SETLKW 7
33
34#define F_SETOWN 8 /* for sockets. */
35#define F_GETOWN 9 /* for sockets. */
36#define F_SETSIG 10 /* for sockets. */
37#define F_GETSIG 11 /* for sockets. */
38
39/* for F_[GET|SET]FL */
40#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
41
42/* for posix fcntl() and lockf() */
43#define F_RDLCK 0
44#define F_WRLCK 1
45#define F_UNLCK 2
46
47/* for old implementation of bsd flock () */
48#define F_EXLCK 4 /* or 3 */
49#define F_SHLCK 8 /* or 4 */
50
51/* for leases */
52#define F_INPROGRESS 16
53
54/* operations for bsd flock(), also used by the kernel implementation */
55#define LOCK_SH 1 /* shared lock */
56#define LOCK_EX 2 /* exclusive lock */
57#define LOCK_NB 4 /* or'd with one of the above to prevent
58 blocking */
59#define LOCK_UN 8 /* remove lock */
60
61#define LOCK_MAND 32 /* This is a mandatory flock */
62#define LOCK_READ 64 /* ... Which allows concurrent read operations */
63#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
64#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
65
66struct flock {
67 short l_type;
68 short l_whence;
69 off_t l_start;
70 off_t l_len;
71 pid_t l_pid;
72};
73
74#define F_LINUX_SPECIFIC_BASE 1024
75
76#endif /* !_X86_64_FCNTL_H */
diff --git a/include/asm-x86_64/futex.h b/include/asm-x86_64/futex.h
new file mode 100644
index 000000000000..8602c09bf89e
--- /dev/null
+++ b/include/asm-x86_64/futex.h
@@ -0,0 +1,98 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/system.h>
9#include <asm/uaccess.h>
10
11#define __futex_atomic_op1(insn, ret, oldval, uaddr, oparg) \
12 __asm__ __volatile ( \
13"1: " insn "\n" \
14"2: .section .fixup,\"ax\"\n\
153: mov %3, %1\n\
16 jmp 2b\n\
17 .previous\n\
18 .section __ex_table,\"a\"\n\
19 .align 8\n\
20 .quad 1b,3b\n\
21 .previous" \
22 : "=r" (oldval), "=r" (ret), "=m" (*uaddr) \
23 : "i" (-EFAULT), "m" (*uaddr), "0" (oparg), "1" (0))
24
25#define __futex_atomic_op2(insn, ret, oldval, uaddr, oparg) \
26 __asm__ __volatile ( \
27"1: movl %2, %0\n\
28 movl %0, %3\n" \
29 insn "\n" \
30"2: " LOCK_PREFIX "cmpxchgl %3, %2\n\
31 jnz 1b\n\
323: .section .fixup,\"ax\"\n\
334: mov %5, %1\n\
34 jmp 3b\n\
35 .previous\n\
36 .section __ex_table,\"a\"\n\
37 .align 8\n\
38 .quad 1b,4b,2b,4b\n\
39 .previous" \
40 : "=&a" (oldval), "=&r" (ret), "=m" (*uaddr), \
41 "=&r" (tem) \
42 : "r" (oparg), "i" (-EFAULT), "m" (*uaddr), "1" (0))
43
44static inline int
45futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
46{
47 int op = (encoded_op >> 28) & 7;
48 int cmp = (encoded_op >> 24) & 15;
49 int oparg = (encoded_op << 8) >> 20;
50 int cmparg = (encoded_op << 20) >> 20;
51 int oldval = 0, ret, tem;
52 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
53 oparg = 1 << oparg;
54
55 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
56 return -EFAULT;
57
58 inc_preempt_count();
59
60 switch (op) {
61 case FUTEX_OP_SET:
62 __futex_atomic_op1("xchgl %0, %2", ret, oldval, uaddr, oparg);
63 break;
64 case FUTEX_OP_ADD:
65 __futex_atomic_op1(LOCK_PREFIX "xaddl %0, %2", ret, oldval,
66 uaddr, oparg);
67 break;
68 case FUTEX_OP_OR:
69 __futex_atomic_op2("orl %4, %3", ret, oldval, uaddr, oparg);
70 break;
71 case FUTEX_OP_ANDN:
72 __futex_atomic_op2("andl %4, %3", ret, oldval, uaddr, ~oparg);
73 break;
74 case FUTEX_OP_XOR:
75 __futex_atomic_op2("xorl %4, %3", ret, oldval, uaddr, oparg);
76 break;
77 default:
78 ret = -ENOSYS;
79 }
80
81 dec_preempt_count();
82
83 if (!ret) {
84 switch (cmp) {
85 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
86 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
87 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
88 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
89 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
90 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
91 default: ret = -ENOSYS;
92 }
93 }
94 return ret;
95}
96
97#endif
98#endif
diff --git a/include/asm-x86_64/hdreg.h b/include/asm-x86_64/hdreg.h
deleted file mode 100644
index 5989bbc97cbf..000000000000
--- a/include/asm-x86_64/hdreg.h
+++ /dev/null
@@ -1 +0,0 @@
1#warning this file is obsolete, please do not use it
diff --git a/include/asm-x86_64/io_apic.h b/include/asm-x86_64/io_apic.h
index a8babd2bbe84..ee1bc69aec9c 100644
--- a/include/asm-x86_64/io_apic.h
+++ b/include/asm-x86_64/io_apic.h
@@ -201,7 +201,7 @@ extern int skip_ioapic_setup;
201 */ 201 */
202#define io_apic_assign_pci_irqs (mp_irq_entries && !skip_ioapic_setup && io_apic_irqs) 202#define io_apic_assign_pci_irqs (mp_irq_entries && !skip_ioapic_setup && io_apic_irqs)
203 203
204#ifdef CONFIG_ACPI_BOOT 204#ifdef CONFIG_ACPI
205extern int io_apic_get_version (int ioapic); 205extern int io_apic_get_version (int ioapic);
206extern int io_apic_get_redir_entries (int ioapic); 206extern int io_apic_get_redir_entries (int ioapic);
207extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int, int); 207extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int, int);
diff --git a/include/asm-x86_64/irq.h b/include/asm-x86_64/irq.h
index 4482657777bb..fb724ba37ae6 100644
--- a/include/asm-x86_64/irq.h
+++ b/include/asm-x86_64/irq.h
@@ -48,10 +48,6 @@ static __inline__ int irq_canonicalize(int irq)
48#define ARCH_HAS_NMI_WATCHDOG /* See include/linux/nmi.h */ 48#define ARCH_HAS_NMI_WATCHDOG /* See include/linux/nmi.h */
49#endif 49#endif
50 50
51struct irqaction;
52struct pt_regs;
53int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
54
55#ifdef CONFIG_HOTPLUG_CPU 51#ifdef CONFIG_HOTPLUG_CPU
56#include <linux/cpumask.h> 52#include <linux/cpumask.h>
57extern void fixup_irqs(cpumask_t map); 53extern void fixup_irqs(cpumask_t map);
diff --git a/include/asm-x86_64/mpspec.h b/include/asm-x86_64/mpspec.h
index 331f6a3c72a2..f267e10c023d 100644
--- a/include/asm-x86_64/mpspec.h
+++ b/include/asm-x86_64/mpspec.h
@@ -179,7 +179,7 @@ extern int mpc_default_type;
179extern unsigned long mp_lapic_addr; 179extern unsigned long mp_lapic_addr;
180extern int pic_mode; 180extern int pic_mode;
181 181
182#ifdef CONFIG_ACPI_BOOT 182#ifdef CONFIG_ACPI
183extern void mp_register_lapic (u8 id, u8 enabled); 183extern void mp_register_lapic (u8 id, u8 enabled);
184extern void mp_register_lapic_address (u64 address); 184extern void mp_register_lapic_address (u64 address);
185 185
diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h
index 431318764af6..135ffaa0393b 100644
--- a/include/asm-x86_64/page.h
+++ b/include/asm-x86_64/page.h
@@ -28,7 +28,6 @@
28#define HPAGE_SIZE ((1UL) << HPAGE_SHIFT) 28#define HPAGE_SIZE ((1UL) << HPAGE_SHIFT)
29#define HPAGE_MASK (~(HPAGE_SIZE - 1)) 29#define HPAGE_MASK (~(HPAGE_SIZE - 1))
30#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) 30#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
31#define ARCH_HAS_HUGETLB_CLEAN_STALE_PGTABLE
32 31
33#ifdef __KERNEL__ 32#ifdef __KERNEL__
34#ifndef __ASSEMBLY__ 33#ifndef __ASSEMBLY__
@@ -92,20 +91,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
92 91
93#include <asm/bug.h> 92#include <asm/bug.h>
94 93
95/* Pure 2^n version of get_order */
96extern __inline__ int get_order(unsigned long size)
97{
98 int order;
99
100 size = (size-1) >> (PAGE_SHIFT-1);
101 order = -1;
102 do {
103 size >>= 1;
104 order++;
105 } while (size);
106 return order;
107}
108
109#endif /* __ASSEMBLY__ */ 94#endif /* __ASSEMBLY__ */
110 95
111#define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET) 96#define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET)
@@ -141,4 +126,6 @@ extern __inline__ int get_order(unsigned long size)
141 126
142#endif /* __KERNEL__ */ 127#endif /* __KERNEL__ */
143 128
129#include <asm-generic/page.h>
130
144#endif /* _X86_64_PAGE_H */ 131#endif /* _X86_64_PAGE_H */
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h
index 4e167b5ea8f3..5e0f2fdab0d3 100644
--- a/include/asm-x86_64/pgtable.h
+++ b/include/asm-x86_64/pgtable.h
@@ -104,6 +104,19 @@ extern inline void pgd_clear (pgd_t * pgd)
104((unsigned long) __va(pud_val(pud) & PHYSICAL_PAGE_MASK)) 104((unsigned long) __va(pud_val(pud) & PHYSICAL_PAGE_MASK))
105 105
106#define ptep_get_and_clear(mm,addr,xp) __pte(xchg(&(xp)->pte, 0)) 106#define ptep_get_and_clear(mm,addr,xp) __pte(xchg(&(xp)->pte, 0))
107
108static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long addr, pte_t *ptep, int full)
109{
110 pte_t pte;
111 if (full) {
112 pte = *ptep;
113 *ptep = __pte(0);
114 } else {
115 pte = ptep_get_and_clear(mm, addr, ptep);
116 }
117 return pte;
118}
119
107#define pte_same(a, b) ((a).pte == (b).pte) 120#define pte_same(a, b) ((a).pte == (b).pte)
108 121
109#define PMD_SIZE (1UL << PMD_SHIFT) 122#define PMD_SIZE (1UL << PMD_SHIFT)
@@ -143,7 +156,7 @@ extern inline void pgd_clear (pgd_t * pgd)
143#define _PAGE_ACCESSED 0x020 156#define _PAGE_ACCESSED 0x020
144#define _PAGE_DIRTY 0x040 157#define _PAGE_DIRTY 0x040
145#define _PAGE_PSE 0x080 /* 2MB page */ 158#define _PAGE_PSE 0x080 /* 2MB page */
146#define _PAGE_FILE 0x040 /* set:pagecache, unset:swap */ 159#define _PAGE_FILE 0x040 /* nonlinear file mapping, saved PTE; unset:swap */
147#define _PAGE_GLOBAL 0x100 /* Global TLB entry */ 160#define _PAGE_GLOBAL 0x100 /* Global TLB entry */
148 161
149#define _PAGE_PROTNONE 0x080 /* If not present */ 162#define _PAGE_PROTNONE 0x080 /* If not present */
@@ -247,6 +260,7 @@ static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot)
247 * The following only work if pte_present() is true. 260 * The following only work if pte_present() is true.
248 * Undefined behaviour if not.. 261 * Undefined behaviour if not..
249 */ 262 */
263#define __LARGE_PTE (_PAGE_PSE|_PAGE_PRESENT)
250static inline int pte_user(pte_t pte) { return pte_val(pte) & _PAGE_USER; } 264static inline int pte_user(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
251extern inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; } 265extern inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
252extern inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_USER; } 266extern inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
@@ -254,8 +268,8 @@ extern inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
254extern inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } 268extern inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
255extern inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } 269extern inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; }
256static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } 270static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
271static inline int pte_huge(pte_t pte) { return (pte_val(pte) & __LARGE_PTE) == __LARGE_PTE; }
257 272
258#define __LARGE_PTE (_PAGE_PSE|_PAGE_PRESENT)
259extern inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; } 273extern inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; }
260extern inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; } 274extern inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; }
261extern inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; } 275extern inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; }
@@ -433,6 +447,7 @@ extern int kern_addr_valid(unsigned long addr);
433#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG 447#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
434#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY 448#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
435#define __HAVE_ARCH_PTEP_GET_AND_CLEAR 449#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
450#define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL
436#define __HAVE_ARCH_PTEP_SET_WRPROTECT 451#define __HAVE_ARCH_PTEP_SET_WRPROTECT
437#define __HAVE_ARCH_PTE_SAME 452#define __HAVE_ARCH_PTE_SAME
438#include <asm-generic/pgtable.h> 453#include <asm-generic/pgtable.h>
diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h
index 85549e656eeb..a8321999448f 100644
--- a/include/asm-x86_64/processor.h
+++ b/include/asm-x86_64/processor.h
@@ -398,7 +398,7 @@ static inline void prefetch(void *x)
398#define ARCH_HAS_PREFETCHW 1 398#define ARCH_HAS_PREFETCHW 1
399static inline void prefetchw(void *x) 399static inline void prefetchw(void *x)
400{ 400{
401 alternative_input(ASM_NOP5, 401 alternative_input("prefetcht0 (%1)",
402 "prefetchw (%1)", 402 "prefetchw (%1)",
403 X86_FEATURE_3DNOW, 403 X86_FEATURE_3DNOW,
404 "r" (x)); 404 "r" (x));
@@ -437,6 +437,11 @@ static inline void prefetchw(void *x)
437 outb((data), 0x23); \ 437 outb((data), 0x23); \
438} while (0) 438} while (0)
439 439
440static inline void serialize_cpu(void)
441{
442 __asm__ __volatile__ ("cpuid" : : : "ax", "bx", "cx", "dx");
443}
444
440static inline void __monitor(const void *eax, unsigned long ecx, 445static inline void __monitor(const void *eax, unsigned long ecx,
441 unsigned long edx) 446 unsigned long edx)
442{ 447{
diff --git a/include/asm-x86_64/types.h b/include/asm-x86_64/types.h
index 32bd1426b523..c86c2e6793e2 100644
--- a/include/asm-x86_64/types.h
+++ b/include/asm-x86_64/types.h
@@ -51,8 +51,6 @@ typedef u64 dma_addr_t;
51typedef u64 sector_t; 51typedef u64 sector_t;
52#define HAVE_SECTOR_T 52#define HAVE_SECTOR_T
53 53
54typedef unsigned short kmem_bufctl_t;
55
56#endif /* __ASSEMBLY__ */ 54#endif /* __ASSEMBLY__ */
57 55
58#endif /* __KERNEL__ */ 56#endif /* __KERNEL__ */
diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h
index 48f292752c96..1bb8b8a24436 100644
--- a/include/asm-x86_64/uaccess.h
+++ b/include/asm-x86_64/uaccess.h
@@ -49,13 +49,6 @@
49 49
50#define access_ok(type, addr, size) (__range_not_ok(addr,size) == 0) 50#define access_ok(type, addr, size) (__range_not_ok(addr,size) == 0)
51 51
52/* this function will go away soon - use access_ok() instead */
53extern inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size)
54{
55 return access_ok(type,addr,size) ? 0 : -EFAULT;
56}
57
58
59/* 52/*
60 * The exception table consists of pairs of addresses: the first is the 53 * The exception table consists of pairs of addresses: the first is the
61 * address of an instruction that is allowed to fault, and the second is 54 * address of an instruction that is allowed to fault, and the second is
diff --git a/include/asm-xtensa/atomic.h b/include/asm-xtensa/atomic.h
index d72bcb32ba4f..24f86f0e43cf 100644
--- a/include/asm-xtensa/atomic.h
+++ b/include/asm-xtensa/atomic.h
@@ -66,7 +66,7 @@ typedef struct { volatile int counter; } atomic_t;
66 * 66 *
67 * Atomically adds @i to @v. 67 * Atomically adds @i to @v.
68 */ 68 */
69extern __inline__ void atomic_add(int i, atomic_t * v) 69static inline void atomic_add(int i, atomic_t * v)
70{ 70{
71 unsigned int vval; 71 unsigned int vval;
72 72
@@ -90,7 +90,7 @@ extern __inline__ void atomic_add(int i, atomic_t * v)
90 * 90 *
91 * Atomically subtracts @i from @v. 91 * Atomically subtracts @i from @v.
92 */ 92 */
93extern __inline__ void atomic_sub(int i, atomic_t *v) 93static inline void atomic_sub(int i, atomic_t *v)
94{ 94{
95 unsigned int vval; 95 unsigned int vval;
96 96
@@ -111,7 +111,7 @@ extern __inline__ void atomic_sub(int i, atomic_t *v)
111 * We use atomic_{add|sub}_return to define other functions. 111 * We use atomic_{add|sub}_return to define other functions.
112 */ 112 */
113 113
114extern __inline__ int atomic_add_return(int i, atomic_t * v) 114static inline int atomic_add_return(int i, atomic_t * v)
115{ 115{
116 unsigned int vval; 116 unsigned int vval;
117 117
@@ -130,7 +130,7 @@ extern __inline__ int atomic_add_return(int i, atomic_t * v)
130 return vval; 130 return vval;
131} 131}
132 132
133extern __inline__ int atomic_sub_return(int i, atomic_t * v) 133static inline int atomic_sub_return(int i, atomic_t * v)
134{ 134{
135 unsigned int vval; 135 unsigned int vval;
136 136
@@ -224,7 +224,7 @@ extern __inline__ int atomic_sub_return(int i, atomic_t * v)
224#define atomic_add_negative(i,v) (atomic_add_return((i),(v)) < 0) 224#define atomic_add_negative(i,v) (atomic_add_return((i),(v)) < 0)
225 225
226 226
227extern __inline__ void atomic_clear_mask(unsigned int mask, atomic_t *v) 227static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
228{ 228{
229 unsigned int all_f = -1; 229 unsigned int all_f = -1;
230 unsigned int vval; 230 unsigned int vval;
@@ -243,7 +243,7 @@ extern __inline__ void atomic_clear_mask(unsigned int mask, atomic_t *v)
243 ); 243 );
244} 244}
245 245
246extern __inline__ void atomic_set_mask(unsigned int mask, atomic_t *v) 246static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
247{ 247{
248 unsigned int vval; 248 unsigned int vval;
249 249
diff --git a/include/asm-xtensa/auxvec.h b/include/asm-xtensa/auxvec.h
new file mode 100644
index 000000000000..257dec75c5af
--- /dev/null
+++ b/include/asm-xtensa/auxvec.h
@@ -0,0 +1,4 @@
1#ifndef __XTENSA_AUXVEC_H
2#define __XTENSA_AUXVEC_H
3
4#endif
diff --git a/include/asm-xtensa/checksum.h b/include/asm-xtensa/checksum.h
index 1a00fad19929..81a797ae3abe 100644
--- a/include/asm-xtensa/checksum.h
+++ b/include/asm-xtensa/checksum.h
@@ -47,14 +47,14 @@ asmlinkage unsigned int csum_partial_copy_generic( const char *src, char *dst, i
47 * If you use these functions directly please don't forget the 47 * If you use these functions directly please don't forget the
48 * verify_area(). 48 * verify_area().
49 */ 49 */
50extern __inline__ 50static inline
51unsigned int csum_partial_copy_nocheck ( const char *src, char *dst, 51unsigned int csum_partial_copy_nocheck ( const char *src, char *dst,
52 int len, int sum) 52 int len, int sum)
53{ 53{
54 return csum_partial_copy_generic ( src, dst, len, sum, NULL, NULL); 54 return csum_partial_copy_generic ( src, dst, len, sum, NULL, NULL);
55} 55}
56 56
57extern __inline__ 57static inline
58unsigned int csum_partial_copy_from_user ( const char *src, char *dst, 58unsigned int csum_partial_copy_from_user ( const char *src, char *dst,
59 int len, int sum, int *err_ptr) 59 int len, int sum, int *err_ptr)
60{ 60{
diff --git a/include/asm-xtensa/delay.h b/include/asm-xtensa/delay.h
index 0a123d53a636..1bc601ec3621 100644
--- a/include/asm-xtensa/delay.h
+++ b/include/asm-xtensa/delay.h
@@ -18,7 +18,7 @@
18 18
19extern unsigned long loops_per_jiffy; 19extern unsigned long loops_per_jiffy;
20 20
21extern __inline__ void __delay(unsigned long loops) 21static inline void __delay(unsigned long loops)
22{ 22{
23 /* 2 cycles per loop. */ 23 /* 2 cycles per loop. */
24 __asm__ __volatile__ ("1: addi %0, %0, -2; bgeui %0, 2, 1b" 24 __asm__ __volatile__ ("1: addi %0, %0, -2; bgeui %0, 2, 1b"
diff --git a/include/asm-xtensa/fcntl.h b/include/asm-xtensa/fcntl.h
index 48876bb727d2..ec066ae96caf 100644
--- a/include/asm-xtensa/fcntl.h
+++ b/include/asm-xtensa/fcntl.h
@@ -14,31 +14,17 @@
14 14
15/* open/fcntl - O_SYNC is only implemented on blocks devices and on files 15/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
16 located on an ext2 file system */ 16 located on an ext2 file system */
17#define O_ACCMODE 0x0003
18#define O_RDONLY 0x0000
19#define O_WRONLY 0x0001
20#define O_RDWR 0x0002
21#define O_APPEND 0x0008 17#define O_APPEND 0x0008
22#define O_SYNC 0x0010 18#define O_SYNC 0x0010
23#define O_NONBLOCK 0x0080 19#define O_NONBLOCK 0x0080
24#define O_CREAT 0x0100 /* not fcntl */ 20#define O_CREAT 0x0100 /* not fcntl */
25#define O_TRUNC 0x0200 /* not fcntl */
26#define O_EXCL 0x0400 /* not fcntl */ 21#define O_EXCL 0x0400 /* not fcntl */
27#define O_NOCTTY 0x0800 /* not fcntl */ 22#define O_NOCTTY 0x0800 /* not fcntl */
28#define FASYNC 0x1000 /* fcntl, for BSD compatibility */ 23#define FASYNC 0x1000 /* fcntl, for BSD compatibility */
29#define O_LARGEFILE 0x2000 /* allow large file opens - currently ignored */ 24#define O_LARGEFILE 0x2000 /* allow large file opens - currently ignored */
30#define O_DIRECT 0x8000 /* direct disk access hint - currently ignored*/ 25#define O_DIRECT 0x8000 /* direct disk access hint - currently ignored*/
31#define O_DIRECTORY 0x10000 /* must be a directory */
32#define O_NOFOLLOW 0x20000 /* don't follow links */
33#define O_NOATIME 0x100000 26#define O_NOATIME 0x100000
34 27
35#define O_NDELAY O_NONBLOCK
36
37#define F_DUPFD 0 /* dup */
38#define F_GETFD 1 /* get close_on_exec */
39#define F_SETFD 2 /* set/clear close_on_exec */
40#define F_GETFL 3 /* get file->f_flags */
41#define F_SETFL 4 /* set file->f_flags */
42#define F_GETLK 14 28#define F_GETLK 14
43#define F_GETLK64 15 29#define F_GETLK64 15
44#define F_SETLK 6 30#define F_SETLK 6
@@ -48,35 +34,6 @@
48 34
49#define F_SETOWN 24 /* for sockets. */ 35#define F_SETOWN 24 /* for sockets. */
50#define F_GETOWN 23 /* for sockets. */ 36#define F_GETOWN 23 /* for sockets. */
51#define F_SETSIG 10 /* for sockets. */
52#define F_GETSIG 11 /* for sockets. */
53
54/* for F_[GET|SET]FL */
55#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
56
57/* for posix fcntl() and lockf() */
58#define F_RDLCK 0
59#define F_WRLCK 1
60#define F_UNLCK 2
61
62/* for old implementation of bsd flock () */
63#define F_EXLCK 4 /* or 3 */
64#define F_SHLCK 8 /* or 4 */
65
66/* for leases */
67#define F_INPROGRESS 16
68
69/* operations for bsd flock(), also used by the kernel implementation */
70#define LOCK_SH 1 /* shared lock */
71#define LOCK_EX 2 /* exclusive lock */
72#define LOCK_NB 4 /* or'd with one of the above to prevent
73 blocking */
74#define LOCK_UN 8 /* remove lock */
75
76#define LOCK_MAND 32 /* This is a mandatory flock ... */
77#define LOCK_READ 64 /* which allows concurrent read operations */
78#define LOCK_WRITE 128 /* which allows concurrent write operations */
79#define LOCK_RW 192 /* which allows concurrent read & write ops */
80 37
81typedef struct flock { 38typedef struct flock {
82 short l_type; 39 short l_type;
@@ -96,6 +53,9 @@ struct flock64 {
96 pid_t l_pid; 53 pid_t l_pid;
97}; 54};
98 55
99#define F_LINUX_SPECIFIC_BASE 1024 56#define HAVE_ARCH_STRUCT_FLOCK
57#define HAVE_ARCH_STRUCT_FLOCK64
58
59#include <asm-generic/fcntl.h>
100 60
101#endif /* _XTENSA_FCNTL_H */ 61#endif /* _XTENSA_FCNTL_H */
diff --git a/include/asm-xtensa/hdreg.h b/include/asm-xtensa/hdreg.h
deleted file mode 100644
index 64b80607b80d..000000000000
--- a/include/asm-xtensa/hdreg.h
+++ /dev/null
@@ -1,17 +0,0 @@
1/*
2 * include/asm-xtensa/hdreg.h
3 *
4 * This file is subject to the terms and conditions of the GNU General
5 * Public License. See the file "COPYING" in the main directory of
6 * this archive for more details.
7 *
8 * Copyright (C) 2002 - 2005 Tensilica Inc.
9 * Copyright (C) 1994-1996 Linus Torvalds & authors
10 */
11
12#ifndef _XTENSA_HDREG_H
13#define _XTENSA_HDREG_H
14
15typedef unsigned int ide_ioreg_t;
16
17#endif
diff --git a/include/asm-xtensa/io.h b/include/asm-xtensa/io.h
index 2c471c42ecfc..c5c13985bbe1 100644
--- a/include/asm-xtensa/io.h
+++ b/include/asm-xtensa/io.h
@@ -41,12 +41,12 @@ static inline unsigned int _swapl (unsigned int v)
41 * These are trivial on the 1:1 Linux/Xtensa mapping 41 * These are trivial on the 1:1 Linux/Xtensa mapping
42 */ 42 */
43 43
44extern inline unsigned long virt_to_phys(volatile void * address) 44static inline unsigned long virt_to_phys(volatile void * address)
45{ 45{
46 return PHYSADDR((unsigned long)address); 46 return PHYSADDR((unsigned long)address);
47} 47}
48 48
49extern inline void * phys_to_virt(unsigned long address) 49static inline void * phys_to_virt(unsigned long address)
50{ 50{
51 return (void*) CACHED_ADDR(address); 51 return (void*) CACHED_ADDR(address);
52} 52}
@@ -55,12 +55,12 @@ extern inline void * phys_to_virt(unsigned long address)
55 * IO bus memory addresses are also 1:1 with the physical address 55 * IO bus memory addresses are also 1:1 with the physical address
56 */ 56 */
57 57
58extern inline unsigned long virt_to_bus(volatile void * address) 58static inline unsigned long virt_to_bus(volatile void * address)
59{ 59{
60 return PHYSADDR((unsigned long)address); 60 return PHYSADDR((unsigned long)address);
61} 61}
62 62
63extern inline void * bus_to_virt (unsigned long address) 63static inline void * bus_to_virt (unsigned long address)
64{ 64{
65 return (void *) CACHED_ADDR(address); 65 return (void *) CACHED_ADDR(address);
66} 66}
@@ -69,17 +69,17 @@ extern inline void * bus_to_virt (unsigned long address)
69 * Change "struct page" to physical address. 69 * Change "struct page" to physical address.
70 */ 70 */
71 71
72extern inline void *ioremap(unsigned long offset, unsigned long size) 72static inline void *ioremap(unsigned long offset, unsigned long size)
73{ 73{
74 return (void *) CACHED_ADDR_IO(offset); 74 return (void *) CACHED_ADDR_IO(offset);
75} 75}
76 76
77extern inline void *ioremap_nocache(unsigned long offset, unsigned long size) 77static inline void *ioremap_nocache(unsigned long offset, unsigned long size)
78{ 78{
79 return (void *) BYPASS_ADDR_IO(offset); 79 return (void *) BYPASS_ADDR_IO(offset);
80} 80}
81 81
82extern inline void iounmap(void *addr) 82static inline void iounmap(void *addr)
83{ 83{
84} 84}
85 85
diff --git a/include/asm-xtensa/mmu_context.h b/include/asm-xtensa/mmu_context.h
index 1b0801548cd9..364a7b057bfa 100644
--- a/include/asm-xtensa/mmu_context.h
+++ b/include/asm-xtensa/mmu_context.h
@@ -199,13 +199,13 @@ extern pgd_t *current_pgd;
199#define ASID_FIRST_VERSION \ 199#define ASID_FIRST_VERSION \
200 ((unsigned long)(~ASID_VERSION_MASK) + 1 + ASID_FIRST_NONRESERVED) 200 ((unsigned long)(~ASID_VERSION_MASK) + 1 + ASID_FIRST_NONRESERVED)
201 201
202extern inline void set_rasid_register (unsigned long val) 202static inline void set_rasid_register (unsigned long val)
203{ 203{
204 __asm__ __volatile__ (" wsr %0, "__stringify(RASID)"\n\t" 204 __asm__ __volatile__ (" wsr %0, "__stringify(RASID)"\n\t"
205 " isync\n" : : "a" (val)); 205 " isync\n" : : "a" (val));
206} 206}
207 207
208extern inline unsigned long get_rasid_register (void) 208static inline unsigned long get_rasid_register (void)
209{ 209{
210 unsigned long tmp; 210 unsigned long tmp;
211 __asm__ __volatile__ (" rsr %0, "__stringify(RASID)"\n\t" : "=a" (tmp)); 211 __asm__ __volatile__ (" rsr %0, "__stringify(RASID)"\n\t" : "=a" (tmp));
@@ -215,7 +215,7 @@ extern inline unsigned long get_rasid_register (void)
215 215
216#if ((XCHAL_MMU_ASID_INVALID == 0) && (XCHAL_MMU_ASID_KERNEL == 1)) 216#if ((XCHAL_MMU_ASID_INVALID == 0) && (XCHAL_MMU_ASID_KERNEL == 1))
217 217
218extern inline void 218static inline void
219get_new_mmu_context(struct mm_struct *mm, unsigned long asid) 219get_new_mmu_context(struct mm_struct *mm, unsigned long asid)
220{ 220{
221 extern void flush_tlb_all(void); 221 extern void flush_tlb_all(void);
@@ -234,7 +234,7 @@ get_new_mmu_context(struct mm_struct *mm, unsigned long asid)
234/* XCHAL_MMU_ASID_INVALID == 0 and XCHAL_MMU_ASID_KERNEL ==1 are 234/* XCHAL_MMU_ASID_INVALID == 0 and XCHAL_MMU_ASID_KERNEL ==1 are
235 really the best, but if you insist... */ 235 really the best, but if you insist... */
236 236
237extern inline int validate_asid (unsigned long asid) 237static inline int validate_asid (unsigned long asid)
238{ 238{
239 switch (asid) { 239 switch (asid) {
240 case XCHAL_MMU_ASID_INVALID: 240 case XCHAL_MMU_ASID_INVALID:
@@ -247,7 +247,7 @@ extern inline int validate_asid (unsigned long asid)
247 return 1; /* valid */ 247 return 1; /* valid */
248} 248}
249 249
250extern inline void 250static inline void
251get_new_mmu_context(struct mm_struct *mm, unsigned long asid) 251get_new_mmu_context(struct mm_struct *mm, unsigned long asid)
252{ 252{
253 extern void flush_tlb_all(void); 253 extern void flush_tlb_all(void);
@@ -274,14 +274,14 @@ get_new_mmu_context(struct mm_struct *mm, unsigned long asid)
274 * instance. 274 * instance.
275 */ 275 */
276 276
277extern inline int 277static inline int
278init_new_context(struct task_struct *tsk, struct mm_struct *mm) 278init_new_context(struct task_struct *tsk, struct mm_struct *mm)
279{ 279{
280 mm->context = NO_CONTEXT; 280 mm->context = NO_CONTEXT;
281 return 0; 281 return 0;
282} 282}
283 283
284extern inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, 284static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
285 struct task_struct *tsk) 285 struct task_struct *tsk)
286{ 286{
287 unsigned long asid = asid_cache; 287 unsigned long asid = asid_cache;
@@ -301,7 +301,7 @@ extern inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
301 * Destroy context related info for an mm_struct that is about 301 * Destroy context related info for an mm_struct that is about
302 * to be put to rest. 302 * to be put to rest.
303 */ 303 */
304extern inline void destroy_context(struct mm_struct *mm) 304static inline void destroy_context(struct mm_struct *mm)
305{ 305{
306 /* Nothing to do. */ 306 /* Nothing to do. */
307} 307}
@@ -310,7 +310,7 @@ extern inline void destroy_context(struct mm_struct *mm)
310 * After we have set current->mm to a new value, this activates 310 * After we have set current->mm to a new value, this activates
311 * the context for the new mm so we see the new mappings. 311 * the context for the new mm so we see the new mappings.
312 */ 312 */
313extern inline void 313static inline void
314activate_mm(struct mm_struct *prev, struct mm_struct *next) 314activate_mm(struct mm_struct *prev, struct mm_struct *next)
315{ 315{
316 /* Unconditionally get a new ASID. */ 316 /* Unconditionally get a new ASID. */
diff --git a/include/asm-xtensa/page.h b/include/asm-xtensa/page.h
index b495e5b5a942..8ded36f255a2 100644
--- a/include/asm-xtensa/page.h
+++ b/include/asm-xtensa/page.h
@@ -55,7 +55,7 @@ typedef struct { unsigned long pgprot; } pgprot_t;
55 * Pure 2^n version of get_order 55 * Pure 2^n version of get_order
56 */ 56 */
57 57
58extern __inline__ int get_order(unsigned long size) 58static inline int get_order(unsigned long size)
59{ 59{
60 int order; 60 int order;
61#ifndef XCHAL_HAVE_NSU 61#ifndef XCHAL_HAVE_NSU
diff --git a/include/asm-xtensa/page.h.n b/include/asm-xtensa/page.h.n
deleted file mode 100644
index 546cc6624f24..000000000000
--- a/include/asm-xtensa/page.h.n
+++ /dev/null
@@ -1,135 +0,0 @@
1/*
2 * linux/include/asm-xtensa/page.h
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version2 as
6 * published by the Free Software Foundation.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_PAGE_H
12#define _XTENSA_PAGE_H
13
14#ifdef __KERNEL__
15
16#include <asm/processor.h>
17#include <linux/config.h>
18
19/*
20 * PAGE_SHIFT determines the page size
21 * PAGE_ALIGN(x) aligns the pointer to the (next) page boundary
22 */
23#define PAGE_SHIFT XCHAL_MMU_MIN_PTE_PAGE_SIZE
24#define PAGE_SIZE (1 << PAGE_SHIFT)
25#define PAGE_MASK (~(PAGE_SIZE-1))
26#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE - 1) & PAGE_MASK)
27
28#define DCACHE_WAY_SIZE (XCHAL_DCACHE_SIZE / XCHAL_DCACHE_WAYS)
29#define PAGE_OFFSET XCHAL_KSEG_CACHED_VADDR
30
31#ifdef __ASSEMBLY__
32
33#define __pgprot(x) (x)
34
35#else
36
37
38/*
39 * These are used to make use of C type-checking..
40 */
41typedef struct { unsigned long pte; } pte_t; /* page table entry */
42typedef struct { unsigned long pmd; } pmd_t; /* PMD table entry */
43typedef struct { unsigned long pgd; } pgd_t; /* PGD table entry */
44typedef struct { unsigned long pgprot; } pgprot_t;
45
46#define pte_val(x) ((x).pte)
47#define pmd_val(x) ((x).pmd)
48#define pgd_val(x) ((x).pgd)
49#define pgprot_val(x) ((x).pgprot)
50
51#define __pte(x) ((pte_t) { (x) } )
52#define __pmd(x) ((pmd_t) { (x) } )
53#define __pgd(x) ((pgd_t) { (x) } )
54#define __pgprot(x) ((pgprot_t) { (x) } )
55
56/*
57 * Pure 2^n version of get_order
58 */
59extern __inline__ int get_order(unsigned long size)
60{
61 int order;
62#ifndef XCHAL_HAVE_NSU
63 unsigned long x1, x2, x4, x8, x16;
64
65 size = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
66 x1 = size & 0xAAAAAAAA;
67 x2 = size & 0xCCCCCCCC;
68 x4 = size & 0xF0F0F0F0;
69 x8 = size & 0xFF00FF00;
70 x16 = size & 0xFFFF0000;
71 order = x2 ? 2 : 0;
72 order += (x16 != 0) * 16;
73 order += (x8 != 0) * 8;
74 order += (x4 != 0) * 4;
75 order += (x1 != 0);
76
77 return order;
78#else
79 size = (size - 1) >> PAGE_SHIFT;
80 asm ("nsau %0, %1" : "=r" (order) : "r" (size));
81 return 32 - order;
82#endif
83}
84
85
86struct page;
87extern void clear_page(void *page);
88extern void copy_page(void *to, void *from);
89
90/*
91 * If we have cache aliasing and writeback caches, we might have to do
92 * some extra work
93 */
94
95#if (DCACHE_WAY_SIZE > PAGE_SIZE) && XCHAL_DCACHE_IS_WRITEBACK
96void clear_user_page(void *addr, unsigned long vaddr, struct page* page);
97void copy_user_page(void *to, void* from, unsigned long vaddr, struct page* page);
98#else
99# define clear_user_page(page,vaddr,pg) clear_page(page)
100# define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
101#endif
102
103
104/*
105 * This handles the memory map. We handle pages at
106 * XCHAL_KSEG_CACHED_VADDR for kernels with 32 bit address space.
107 * These macros are for conversion of kernel address, not user
108 * addresses.
109 */
110
111#define __pa(x) ((unsigned long) (x) - PAGE_OFFSET)
112#define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET))
113#define pfn_valid(pfn) ((unsigned long)pfn < max_mapnr)
114#ifndef CONFIG_DISCONTIGMEM
115# define pfn_to_page(pfn) (mem_map + (pfn))
116# define page_to_pfn(page) ((unsigned long)((page) - mem_map))
117#else
118# error CONFIG_DISCONTIGMEM not supported
119#endif
120
121#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
122#define page_to_virt(page) __va(page_to_pfn(page) << PAGE_SHIFT)
123#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
124#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
125
126#define WANT_PAGE_VIRTUAL
127
128
129#endif /* __ASSEMBLY__ */
130
131#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
132 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
133
134#endif /* __KERNEL__ */
135#endif /* _XTENSA_PAGE_H */
diff --git a/include/asm-xtensa/pci.h b/include/asm-xtensa/pci.h
index 6817742301c2..24eb7fc25da8 100644
--- a/include/asm-xtensa/pci.h
+++ b/include/asm-xtensa/pci.h
@@ -22,12 +22,12 @@
22 22
23extern struct pci_controller* pcibios_alloc_controller(void); 23extern struct pci_controller* pcibios_alloc_controller(void);
24 24
25extern inline void pcibios_set_master(struct pci_dev *dev) 25static inline void pcibios_set_master(struct pci_dev *dev)
26{ 26{
27 /* No special bus mastering setup handling */ 27 /* No special bus mastering setup handling */
28} 28}
29 29
30extern inline void pcibios_penalize_isa_irq(int irq) 30static inline void pcibios_penalize_isa_irq(int irq)
31{ 31{
32 /* We don't do dynamic PCI IRQ allocation */ 32 /* We don't do dynamic PCI IRQ allocation */
33} 33}
diff --git a/include/asm-xtensa/pgtable.h b/include/asm-xtensa/pgtable.h
index 0bb6416ae266..883ebc2d75d6 100644
--- a/include/asm-xtensa/pgtable.h
+++ b/include/asm-xtensa/pgtable.h
@@ -260,7 +260,7 @@ static inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= _PAGE_RW; return pt
260#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) 260#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
261#define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot) 261#define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot)
262 262
263extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) 263static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
264{ 264{
265 return __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot)); 265 return __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot));
266} 266}
@@ -278,14 +278,14 @@ static inline void update_pte(pte_t *ptep, pte_t pteval)
278#endif 278#endif
279} 279}
280 280
281extern inline void 281static inline void
282set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pteval) 282set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pteval)
283{ 283{
284 update_pte(ptep, pteval); 284 update_pte(ptep, pteval);
285} 285}
286 286
287 287
288extern inline void 288static inline void
289set_pmd(pmd_t *pmdp, pmd_t pmdval) 289set_pmd(pmd_t *pmdp, pmd_t pmdval)
290{ 290{
291 *pmdp = pmdval; 291 *pmdp = pmdval;
diff --git a/include/asm-xtensa/ptrace.h b/include/asm-xtensa/ptrace.h
index 2848a5ff8349..aa4fd7fb3ce7 100644
--- a/include/asm-xtensa/ptrace.h
+++ b/include/asm-xtensa/ptrace.h
@@ -127,7 +127,7 @@ extern void show_regs(struct pt_regs *);
127#else /* __ASSEMBLY__ */ 127#else /* __ASSEMBLY__ */
128 128
129#ifdef __KERNEL__ 129#ifdef __KERNEL__
130# include <asm/offsets.h> 130# include <asm/asm-offsets.h>
131#define PT_REGS_OFFSET (KERNEL_STACK_SIZE - PT_USER_SIZE) 131#define PT_REGS_OFFSET (KERNEL_STACK_SIZE - PT_USER_SIZE)
132#endif 132#endif
133 133
diff --git a/include/asm-xtensa/semaphore.h b/include/asm-xtensa/semaphore.h
index c8a7574a9a57..db740b8bc6f0 100644
--- a/include/asm-xtensa/semaphore.h
+++ b/include/asm-xtensa/semaphore.h
@@ -47,7 +47,7 @@ struct semaphore {
47#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) 47#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
48#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) 48#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
49 49
50extern inline void sema_init (struct semaphore *sem, int val) 50static inline void sema_init (struct semaphore *sem, int val)
51{ 51{
52/* 52/*
53 * *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val); 53 * *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val);
@@ -79,7 +79,7 @@ asmlinkage void __up(struct semaphore * sem);
79 79
80extern spinlock_t semaphore_wake_lock; 80extern spinlock_t semaphore_wake_lock;
81 81
82extern __inline__ void down(struct semaphore * sem) 82static inline void down(struct semaphore * sem)
83{ 83{
84#if WAITQUEUE_DEBUG 84#if WAITQUEUE_DEBUG
85 CHECK_MAGIC(sem->__magic); 85 CHECK_MAGIC(sem->__magic);
@@ -89,7 +89,7 @@ extern __inline__ void down(struct semaphore * sem)
89 __down(sem); 89 __down(sem);
90} 90}
91 91
92extern __inline__ int down_interruptible(struct semaphore * sem) 92static inline int down_interruptible(struct semaphore * sem)
93{ 93{
94 int ret = 0; 94 int ret = 0;
95#if WAITQUEUE_DEBUG 95#if WAITQUEUE_DEBUG
@@ -101,7 +101,7 @@ extern __inline__ int down_interruptible(struct semaphore * sem)
101 return ret; 101 return ret;
102} 102}
103 103
104extern __inline__ int down_trylock(struct semaphore * sem) 104static inline int down_trylock(struct semaphore * sem)
105{ 105{
106 int ret = 0; 106 int ret = 0;
107#if WAITQUEUE_DEBUG 107#if WAITQUEUE_DEBUG
@@ -117,7 +117,7 @@ extern __inline__ int down_trylock(struct semaphore * sem)
117 * Note! This is subtle. We jump to wake people up only if 117 * Note! This is subtle. We jump to wake people up only if
118 * the semaphore was negative (== somebody was waiting on it). 118 * the semaphore was negative (== somebody was waiting on it).
119 */ 119 */
120extern __inline__ void up(struct semaphore * sem) 120static inline void up(struct semaphore * sem)
121{ 121{
122#if WAITQUEUE_DEBUG 122#if WAITQUEUE_DEBUG
123 CHECK_MAGIC(sem->__magic); 123 CHECK_MAGIC(sem->__magic);
diff --git a/include/asm-xtensa/string.h b/include/asm-xtensa/string.h
index 3f81b27d9809..5fb8c27cbef5 100644
--- a/include/asm-xtensa/string.h
+++ b/include/asm-xtensa/string.h
@@ -16,7 +16,7 @@
16#define _XTENSA_STRING_H 16#define _XTENSA_STRING_H
17 17
18#define __HAVE_ARCH_STRCPY 18#define __HAVE_ARCH_STRCPY
19extern __inline__ char *strcpy(char *__dest, const char *__src) 19static inline char *strcpy(char *__dest, const char *__src)
20{ 20{
21 register char *__xdest = __dest; 21 register char *__xdest = __dest;
22 unsigned long __dummy; 22 unsigned long __dummy;
@@ -35,7 +35,7 @@ extern __inline__ char *strcpy(char *__dest, const char *__src)
35} 35}
36 36
37#define __HAVE_ARCH_STRNCPY 37#define __HAVE_ARCH_STRNCPY
38extern __inline__ char *strncpy(char *__dest, const char *__src, size_t __n) 38static inline char *strncpy(char *__dest, const char *__src, size_t __n)
39{ 39{
40 register char *__xdest = __dest; 40 register char *__xdest = __dest;
41 unsigned long __dummy; 41 unsigned long __dummy;
@@ -60,7 +60,7 @@ extern __inline__ char *strncpy(char *__dest, const char *__src, size_t __n)
60} 60}
61 61
62#define __HAVE_ARCH_STRCMP 62#define __HAVE_ARCH_STRCMP
63extern __inline__ int strcmp(const char *__cs, const char *__ct) 63static inline int strcmp(const char *__cs, const char *__ct)
64{ 64{
65 register int __res; 65 register int __res;
66 unsigned long __dummy; 66 unsigned long __dummy;
@@ -82,7 +82,7 @@ extern __inline__ int strcmp(const char *__cs, const char *__ct)
82} 82}
83 83
84#define __HAVE_ARCH_STRNCMP 84#define __HAVE_ARCH_STRNCMP
85extern __inline__ int strncmp(const char *__cs, const char *__ct, size_t __n) 85static inline int strncmp(const char *__cs, const char *__ct, size_t __n)
86{ 86{
87 register int __res; 87 register int __res;
88 unsigned long __dummy; 88 unsigned long __dummy;
diff --git a/include/asm-xtensa/system.h b/include/asm-xtensa/system.h
index 690fe325e671..f09393232e5e 100644
--- a/include/asm-xtensa/system.h
+++ b/include/asm-xtensa/system.h
@@ -56,7 +56,7 @@ static inline int irqs_disabled(void)
56 56
57#define clear_cpenable() __clear_cpenable() 57#define clear_cpenable() __clear_cpenable()
58 58
59extern __inline__ void __clear_cpenable(void) 59static inline void __clear_cpenable(void)
60{ 60{
61#if XCHAL_HAVE_CP 61#if XCHAL_HAVE_CP
62 unsigned long i = 0; 62 unsigned long i = 0;
@@ -64,7 +64,7 @@ extern __inline__ void __clear_cpenable(void)
64#endif 64#endif
65} 65}
66 66
67extern __inline__ void enable_coprocessor(int i) 67static inline void enable_coprocessor(int i)
68{ 68{
69#if XCHAL_HAVE_CP 69#if XCHAL_HAVE_CP
70 int cp; 70 int cp;
@@ -74,7 +74,7 @@ extern __inline__ void enable_coprocessor(int i)
74#endif 74#endif
75} 75}
76 76
77extern __inline__ void disable_coprocessor(int i) 77static inline void disable_coprocessor(int i)
78{ 78{
79#if XCHAL_HAVE_CP 79#if XCHAL_HAVE_CP
80 int cp; 80 int cp;
@@ -123,7 +123,7 @@ do { \
123 * cmpxchg 123 * cmpxchg
124 */ 124 */
125 125
126extern __inline__ unsigned long 126static inline unsigned long
127__cmpxchg_u32(volatile int *p, int old, int new) 127__cmpxchg_u32(volatile int *p, int old, int new)
128{ 128{
129 __asm__ __volatile__("rsil a15, "__stringify(LOCKLEVEL)"\n\t" 129 __asm__ __volatile__("rsil a15, "__stringify(LOCKLEVEL)"\n\t"
@@ -173,7 +173,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
173 * where no register reference will cause an overflow. 173 * where no register reference will cause an overflow.
174 */ 174 */
175 175
176extern __inline__ unsigned long xchg_u32(volatile int * m, unsigned long val) 176static inline unsigned long xchg_u32(volatile int * m, unsigned long val)
177{ 177{
178 unsigned long tmp; 178 unsigned long tmp;
179 __asm__ __volatile__("rsil a15, "__stringify(LOCKLEVEL)"\n\t" 179 __asm__ __volatile__("rsil a15, "__stringify(LOCKLEVEL)"\n\t"
diff --git a/include/asm-xtensa/tlbflush.h b/include/asm-xtensa/tlbflush.h
index 23bfe9db45f5..43f6ec859af9 100644
--- a/include/asm-xtensa/tlbflush.h
+++ b/include/asm-xtensa/tlbflush.h
@@ -39,7 +39,7 @@ extern void flush_tlb_range(struct vm_area_struct*,unsigned long,unsigned long);
39 * page-table pages. 39 * page-table pages.
40 */ 40 */
41 41
42extern inline void flush_tlb_pgtables(struct mm_struct *mm, 42static inline void flush_tlb_pgtables(struct mm_struct *mm,
43 unsigned long start, unsigned long end) 43 unsigned long start, unsigned long end)
44{ 44{
45} 45}
@@ -51,26 +51,26 @@ extern inline void flush_tlb_pgtables(struct mm_struct *mm,
51#define ITLB_PROBE_SUCCESS (1 << ITLB_WAYS_LOG2) 51#define ITLB_PROBE_SUCCESS (1 << ITLB_WAYS_LOG2)
52#define DTLB_PROBE_SUCCESS (1 << DTLB_WAYS_LOG2) 52#define DTLB_PROBE_SUCCESS (1 << DTLB_WAYS_LOG2)
53 53
54extern inline unsigned long itlb_probe(unsigned long addr) 54static inline unsigned long itlb_probe(unsigned long addr)
55{ 55{
56 unsigned long tmp; 56 unsigned long tmp;
57 __asm__ __volatile__("pitlb %0, %1\n\t" : "=a" (tmp) : "a" (addr)); 57 __asm__ __volatile__("pitlb %0, %1\n\t" : "=a" (tmp) : "a" (addr));
58 return tmp; 58 return tmp;
59} 59}
60 60
61extern inline unsigned long dtlb_probe(unsigned long addr) 61static inline unsigned long dtlb_probe(unsigned long addr)
62{ 62{
63 unsigned long tmp; 63 unsigned long tmp;
64 __asm__ __volatile__("pdtlb %0, %1\n\t" : "=a" (tmp) : "a" (addr)); 64 __asm__ __volatile__("pdtlb %0, %1\n\t" : "=a" (tmp) : "a" (addr));
65 return tmp; 65 return tmp;
66} 66}
67 67
68extern inline void invalidate_itlb_entry (unsigned long probe) 68static inline void invalidate_itlb_entry (unsigned long probe)
69{ 69{
70 __asm__ __volatile__("iitlb %0; isync\n\t" : : "a" (probe)); 70 __asm__ __volatile__("iitlb %0; isync\n\t" : : "a" (probe));
71} 71}
72 72
73extern inline void invalidate_dtlb_entry (unsigned long probe) 73static inline void invalidate_dtlb_entry (unsigned long probe)
74{ 74{
75 __asm__ __volatile__("idtlb %0; dsync\n\t" : : "a" (probe)); 75 __asm__ __volatile__("idtlb %0; dsync\n\t" : : "a" (probe));
76} 76}
@@ -80,68 +80,68 @@ extern inline void invalidate_dtlb_entry (unsigned long probe)
80 * caller must follow up with an 'isync', which can be relatively 80 * caller must follow up with an 'isync', which can be relatively
81 * expensive on some Xtensa implementations. 81 * expensive on some Xtensa implementations.
82 */ 82 */
83extern inline void invalidate_itlb_entry_no_isync (unsigned entry) 83static inline void invalidate_itlb_entry_no_isync (unsigned entry)
84{ 84{
85 /* Caller must follow up with 'isync'. */ 85 /* Caller must follow up with 'isync'. */
86 __asm__ __volatile__ ("iitlb %0\n" : : "a" (entry) ); 86 __asm__ __volatile__ ("iitlb %0\n" : : "a" (entry) );
87} 87}
88 88
89extern inline void invalidate_dtlb_entry_no_isync (unsigned entry) 89static inline void invalidate_dtlb_entry_no_isync (unsigned entry)
90{ 90{
91 /* Caller must follow up with 'isync'. */ 91 /* Caller must follow up with 'isync'. */
92 __asm__ __volatile__ ("idtlb %0\n" : : "a" (entry) ); 92 __asm__ __volatile__ ("idtlb %0\n" : : "a" (entry) );
93} 93}
94 94
95extern inline void set_itlbcfg_register (unsigned long val) 95static inline void set_itlbcfg_register (unsigned long val)
96{ 96{
97 __asm__ __volatile__("wsr %0, "__stringify(ITLBCFG)"\n\t" "isync\n\t" 97 __asm__ __volatile__("wsr %0, "__stringify(ITLBCFG)"\n\t" "isync\n\t"
98 : : "a" (val)); 98 : : "a" (val));
99} 99}
100 100
101extern inline void set_dtlbcfg_register (unsigned long val) 101static inline void set_dtlbcfg_register (unsigned long val)
102{ 102{
103 __asm__ __volatile__("wsr %0, "__stringify(DTLBCFG)"; dsync\n\t" 103 __asm__ __volatile__("wsr %0, "__stringify(DTLBCFG)"; dsync\n\t"
104 : : "a" (val)); 104 : : "a" (val));
105} 105}
106 106
107extern inline void set_ptevaddr_register (unsigned long val) 107static inline void set_ptevaddr_register (unsigned long val)
108{ 108{
109 __asm__ __volatile__(" wsr %0, "__stringify(PTEVADDR)"; isync\n" 109 __asm__ __volatile__(" wsr %0, "__stringify(PTEVADDR)"; isync\n"
110 : : "a" (val)); 110 : : "a" (val));
111} 111}
112 112
113extern inline unsigned long read_ptevaddr_register (void) 113static inline unsigned long read_ptevaddr_register (void)
114{ 114{
115 unsigned long tmp; 115 unsigned long tmp;
116 __asm__ __volatile__("rsr %0, "__stringify(PTEVADDR)"\n\t" : "=a" (tmp)); 116 __asm__ __volatile__("rsr %0, "__stringify(PTEVADDR)"\n\t" : "=a" (tmp));
117 return tmp; 117 return tmp;
118} 118}
119 119
120extern inline void write_dtlb_entry (pte_t entry, int way) 120static inline void write_dtlb_entry (pte_t entry, int way)
121{ 121{
122 __asm__ __volatile__("wdtlb %1, %0; dsync\n\t" 122 __asm__ __volatile__("wdtlb %1, %0; dsync\n\t"
123 : : "r" (way), "r" (entry) ); 123 : : "r" (way), "r" (entry) );
124} 124}
125 125
126extern inline void write_itlb_entry (pte_t entry, int way) 126static inline void write_itlb_entry (pte_t entry, int way)
127{ 127{
128 __asm__ __volatile__("witlb %1, %0; isync\n\t" 128 __asm__ __volatile__("witlb %1, %0; isync\n\t"
129 : : "r" (way), "r" (entry) ); 129 : : "r" (way), "r" (entry) );
130} 130}
131 131
132extern inline void invalidate_page_directory (void) 132static inline void invalidate_page_directory (void)
133{ 133{
134 invalidate_dtlb_entry (DTLB_WAY_PGTABLE); 134 invalidate_dtlb_entry (DTLB_WAY_PGTABLE);
135} 135}
136 136
137extern inline void invalidate_itlb_mapping (unsigned address) 137static inline void invalidate_itlb_mapping (unsigned address)
138{ 138{
139 unsigned long tlb_entry; 139 unsigned long tlb_entry;
140 while ((tlb_entry = itlb_probe (address)) & ITLB_PROBE_SUCCESS) 140 while ((tlb_entry = itlb_probe (address)) & ITLB_PROBE_SUCCESS)
141 invalidate_itlb_entry (tlb_entry); 141 invalidate_itlb_entry (tlb_entry);
142} 142}
143 143
144extern inline void invalidate_dtlb_mapping (unsigned address) 144static inline void invalidate_dtlb_mapping (unsigned address)
145{ 145{
146 unsigned long tlb_entry; 146 unsigned long tlb_entry;
147 while ((tlb_entry = dtlb_probe (address)) & DTLB_PROBE_SUCCESS) 147 while ((tlb_entry = dtlb_probe (address)) & DTLB_PROBE_SUCCESS)
@@ -165,28 +165,28 @@ extern inline void invalidate_dtlb_mapping (unsigned address)
165 * as[07..00] contain the asid 165 * as[07..00] contain the asid
166 */ 166 */
167 167
168extern inline unsigned long read_dtlb_virtual (int way) 168static inline unsigned long read_dtlb_virtual (int way)
169{ 169{
170 unsigned long tmp; 170 unsigned long tmp;
171 __asm__ __volatile__("rdtlb0 %0, %1\n\t" : "=a" (tmp), "+a" (way)); 171 __asm__ __volatile__("rdtlb0 %0, %1\n\t" : "=a" (tmp), "+a" (way));
172 return tmp; 172 return tmp;
173} 173}
174 174
175extern inline unsigned long read_dtlb_translation (int way) 175static inline unsigned long read_dtlb_translation (int way)
176{ 176{
177 unsigned long tmp; 177 unsigned long tmp;
178 __asm__ __volatile__("rdtlb1 %0, %1\n\t" : "=a" (tmp), "+a" (way)); 178 __asm__ __volatile__("rdtlb1 %0, %1\n\t" : "=a" (tmp), "+a" (way));
179 return tmp; 179 return tmp;
180} 180}
181 181
182extern inline unsigned long read_itlb_virtual (int way) 182static inline unsigned long read_itlb_virtual (int way)
183{ 183{
184 unsigned long tmp; 184 unsigned long tmp;
185 __asm__ __volatile__("ritlb0 %0, %1\n\t" : "=a" (tmp), "+a" (way)); 185 __asm__ __volatile__("ritlb0 %0, %1\n\t" : "=a" (tmp), "+a" (way));
186 return tmp; 186 return tmp;
187} 187}
188 188
189extern inline unsigned long read_itlb_translation (int way) 189static inline unsigned long read_itlb_translation (int way)
190{ 190{
191 unsigned long tmp; 191 unsigned long tmp;
192 __asm__ __volatile__("ritlb1 %0, %1\n\t" : "=a" (tmp), "+a" (way)); 192 __asm__ __volatile__("ritlb1 %0, %1\n\t" : "=a" (tmp), "+a" (way));
diff --git a/include/asm-xtensa/types.h b/include/asm-xtensa/types.h
index ebac00469852..9d99a8e9e337 100644
--- a/include/asm-xtensa/types.h
+++ b/include/asm-xtensa/types.h
@@ -58,8 +58,6 @@ typedef unsigned long long u64;
58 58
59typedef u32 dma_addr_t; 59typedef u32 dma_addr_t;
60 60
61typedef unsigned int kmem_bufctl_t;
62
63#endif /* __KERNEL__ */ 61#endif /* __KERNEL__ */
64#endif 62#endif
65 63
diff --git a/include/asm-xtensa/uaccess.h b/include/asm-xtensa/uaccess.h
index 35576b25c7b2..06a22b83ba17 100644
--- a/include/asm-xtensa/uaccess.h
+++ b/include/asm-xtensa/uaccess.h
@@ -25,7 +25,7 @@
25 25
26#define _ASMLANGUAGE 26#define _ASMLANGUAGE
27#include <asm/current.h> 27#include <asm/current.h>
28#include <asm/offsets.h> 28#include <asm/asm-offsets.h>
29#include <asm/processor.h> 29#include <asm/processor.h>
30 30
31/* 31/*
@@ -211,7 +211,7 @@
211#define __access_ok(addr,size) (__kernel_ok || __user_ok((addr),(size))) 211#define __access_ok(addr,size) (__kernel_ok || __user_ok((addr),(size)))
212#define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size)) 212#define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size))
213 213
214extern inline int verify_area(int type, const void * addr, unsigned long size) 214static inline int verify_area(int type, const void * addr, unsigned long size)
215{ 215{
216 return access_ok(type,addr,size) ? 0 : -EFAULT; 216 return access_ok(type,addr,size) ? 0 : -EFAULT;
217} 217}
@@ -464,7 +464,7 @@ __generic_copy_from_user(void *to, const void *from, unsigned long n)
464 * success. 464 * success.
465 */ 465 */
466 466
467extern inline unsigned long 467static inline unsigned long
468__xtensa_clear_user(void *addr, unsigned long size) 468__xtensa_clear_user(void *addr, unsigned long size)
469{ 469{
470 if ( ! memset(addr, 0, size) ) 470 if ( ! memset(addr, 0, size) )
@@ -472,7 +472,7 @@ __xtensa_clear_user(void *addr, unsigned long size)
472 return 0; 472 return 0;
473} 473}
474 474
475extern inline unsigned long 475static inline unsigned long
476clear_user(void *addr, unsigned long size) 476clear_user(void *addr, unsigned long size)
477{ 477{
478 if (access_ok(VERIFY_WRITE, addr, size)) 478 if (access_ok(VERIFY_WRITE, addr, size))
@@ -486,7 +486,7 @@ clear_user(void *addr, unsigned long size)
486extern long __strncpy_user(char *, const char *, long); 486extern long __strncpy_user(char *, const char *, long);
487#define __strncpy_from_user __strncpy_user 487#define __strncpy_from_user __strncpy_user
488 488
489extern inline long 489static inline long
490strncpy_from_user(char *dst, const char *src, long count) 490strncpy_from_user(char *dst, const char *src, long count)
491{ 491{
492 if (access_ok(VERIFY_READ, src, 1)) 492 if (access_ok(VERIFY_READ, src, 1))
@@ -502,7 +502,7 @@ strncpy_from_user(char *dst, const char *src, long count)
502 */ 502 */
503extern long __strnlen_user(const char *, long); 503extern long __strnlen_user(const char *, long);
504 504
505extern inline long strnlen_user(const char *str, long len) 505static inline long strnlen_user(const char *str, long len)
506{ 506{
507 unsigned long top = __kernel_ok ? ~0UL : TASK_SIZE - 1; 507 unsigned long top = __kernel_ok ? ~0UL : TASK_SIZE - 1;
508 508
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index b46a5205ee7b..026c3c011dc0 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -41,7 +41,7 @@
41#include <asm/acpi.h> 41#include <asm/acpi.h>
42 42
43 43
44#ifdef CONFIG_ACPI_BOOT 44#ifdef CONFIG_ACPI
45 45
46enum acpi_irq_model_id { 46enum acpi_irq_model_id {
47 ACPI_IRQ_MODEL_PIC = 0, 47 ACPI_IRQ_MODEL_PIC = 0,
@@ -429,23 +429,13 @@ extern int pci_mmcfg_config_num;
429 429
430extern int sbf_port ; 430extern int sbf_port ;
431 431
432#else /*!CONFIG_ACPI_BOOT*/ 432#else /* !CONFIG_ACPI */
433 433
434#define acpi_mp_config 0 434#define acpi_mp_config 0
435 435
436static inline int acpi_boot_init(void) 436#endif /* !CONFIG_ACPI */
437{
438 return 0;
439}
440
441static inline int acpi_boot_table_init(void)
442{
443 return 0;
444}
445 437
446#endif /*!CONFIG_ACPI_BOOT*/ 438int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low);
447
448unsigned int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low);
449int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); 439int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
450 440
451/* 441/*
@@ -455,7 +445,7 @@ int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
455 */ 445 */
456void acpi_unregister_gsi (u32 gsi); 446void acpi_unregister_gsi (u32 gsi);
457 447
458#ifdef CONFIG_ACPI_PCI 448#ifdef CONFIG_ACPI
459 449
460struct acpi_prt_entry { 450struct acpi_prt_entry {
461 struct list_head node; 451 struct list_head node;
@@ -489,7 +479,7 @@ struct acpi_pci_driver {
489int acpi_pci_register_driver(struct acpi_pci_driver *driver); 479int acpi_pci_register_driver(struct acpi_pci_driver *driver);
490void acpi_pci_unregister_driver(struct acpi_pci_driver *driver); 480void acpi_pci_unregister_driver(struct acpi_pci_driver *driver);
491 481
492#endif /*CONFIG_ACPI_PCI*/ 482#endif /* CONFIG_ACPI */
493 483
494#ifdef CONFIG_ACPI_EC 484#ifdef CONFIG_ACPI_EC
495 485
@@ -498,20 +488,9 @@ extern int ec_write(u8 addr, u8 val);
498 488
499#endif /*CONFIG_ACPI_EC*/ 489#endif /*CONFIG_ACPI_EC*/
500 490
501#ifdef CONFIG_ACPI_INTERPRETER
502
503extern int acpi_blacklisted(void); 491extern int acpi_blacklisted(void);
504extern void acpi_bios_year(char *s); 492extern void acpi_bios_year(char *s);
505 493
506#else /*!CONFIG_ACPI_INTERPRETER*/
507
508static inline int acpi_blacklisted(void)
509{
510 return 0;
511}
512
513#endif /*!CONFIG_ACPI_INTERPRETER*/
514
515#define ACPI_CSTATE_LIMIT_DEFINED /* for driver builds */ 494#define ACPI_CSTATE_LIMIT_DEFINED /* for driver builds */
516#ifdef CONFIG_ACPI 495#ifdef CONFIG_ACPI
517 496
@@ -549,5 +528,17 @@ static inline int acpi_get_pxm(acpi_handle handle)
549 528
550extern int pnpacpi_disabled; 529extern int pnpacpi_disabled;
551 530
531#else /* CONFIG_ACPI */
532
533static inline int acpi_boot_init(void)
534{
535 return 0;
536}
537
538static inline int acpi_boot_table_init(void)
539{
540 return 0;
541}
542
552#endif /* CONFIG_ACPI */ 543#endif /* CONFIG_ACPI */
553#endif /*_LINUX_ACPI_H*/ 544#endif /*_LINUX_ACPI_H*/
diff --git a/include/linux/attribute_container.h b/include/linux/attribute_container.h
index af1010b6dab7..93bfb0beb62a 100644
--- a/include/linux/attribute_container.h
+++ b/include/linux/attribute_container.h
@@ -11,10 +11,12 @@
11 11
12#include <linux/device.h> 12#include <linux/device.h>
13#include <linux/list.h> 13#include <linux/list.h>
14#include <linux/klist.h>
15#include <linux/spinlock.h>
14 16
15struct attribute_container { 17struct attribute_container {
16 struct list_head node; 18 struct list_head node;
17 struct list_head containers; 19 struct klist containers;
18 struct class *class; 20 struct class *class;
19 struct class_device_attribute **attrs; 21 struct class_device_attribute **attrs;
20 int (*match)(struct attribute_container *, struct device *); 22 int (*match)(struct attribute_container *, struct device *);
@@ -62,12 +64,8 @@ int attribute_container_add_class_device_adapter(struct attribute_container *con
62 struct class_device *classdev); 64 struct class_device *classdev);
63void attribute_container_remove_attrs(struct class_device *classdev); 65void attribute_container_remove_attrs(struct class_device *classdev);
64void attribute_container_class_device_del(struct class_device *classdev); 66void attribute_container_class_device_del(struct class_device *classdev);
65 67struct attribute_container *attribute_container_classdev_to_container(struct class_device *);
66 68struct class_device *attribute_container_find_class_device(struct attribute_container *, struct device *);
67
68
69
70
71struct class_device_attribute **attribute_container_classdev_to_attrs(const struct class_device *classdev); 69struct class_device_attribute **attribute_container_classdev_to_attrs(const struct class_device *classdev);
72 70
73#endif 71#endif
diff --git a/include/linux/auxvec.h b/include/linux/auxvec.h
new file mode 100644
index 000000000000..9a7b374c9fb4
--- /dev/null
+++ b/include/linux/auxvec.h
@@ -0,0 +1,31 @@
1#ifndef _LINUX_AUXVEC_H
2#define _LINUX_AUXVEC_H
3
4#include <asm/auxvec.h>
5
6/* Symbolic values for the entries in the auxiliary table
7 put on the initial stack */
8#define AT_NULL 0 /* end of vector */
9#define AT_IGNORE 1 /* entry should be ignored */
10#define AT_EXECFD 2 /* file descriptor of program */
11#define AT_PHDR 3 /* program headers for program */
12#define AT_PHENT 4 /* size of program header entry */
13#define AT_PHNUM 5 /* number of program headers */
14#define AT_PAGESZ 6 /* system page size */
15#define AT_BASE 7 /* base address of interpreter */
16#define AT_FLAGS 8 /* flags */
17#define AT_ENTRY 9 /* entry point of program */
18#define AT_NOTELF 10 /* program is not ELF */
19#define AT_UID 11 /* real uid */
20#define AT_EUID 12 /* effective uid */
21#define AT_GID 13 /* real gid */
22#define AT_EGID 14 /* effective gid */
23#define AT_PLATFORM 15 /* string identifying CPU for optimizations */
24#define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */
25#define AT_CLKTCK 17 /* frequency at which times() increments */
26
27#define AT_SECURE 23 /* secure mode boolean */
28
29#define AT_VECTOR_SIZE 42 /* Size of auxiliary table. */
30
31#endif /* _LINUX_AUXVEC_H */
diff --git a/include/linux/bfs_fs.h b/include/linux/bfs_fs.h
index f7f0913cd110..c1237aa92e38 100644
--- a/include/linux/bfs_fs.h
+++ b/include/linux/bfs_fs.h
@@ -14,8 +14,9 @@
14#define BFS_INODES_PER_BLOCK 8 14#define BFS_INODES_PER_BLOCK 8
15 15
16/* SVR4 vnode type values (bfs_inode->i_vtype) */ 16/* SVR4 vnode type values (bfs_inode->i_vtype) */
17#define BFS_VDIR 2 17#define BFS_VDIR 2L
18#define BFS_VREG 1 18#define BFS_VREG 1L
19
19 20
20/* BFS inode layout on disk */ 21/* BFS inode layout on disk */
21struct bfs_inode { 22struct bfs_inode {
@@ -58,22 +59,22 @@ struct bfs_super_block {
58 __u32 s_padding[118]; 59 __u32 s_padding[118];
59}; 60};
60 61
61#define BFS_NZFILESIZE(ip) \
62 (((ip)->i_eoffset + 1) - (ip)->i_sblock * BFS_BSIZE)
63
64#define BFS_FILESIZE(ip) \
65 ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip))
66
67#define BFS_FILEBLOCKS(ip) \
68 ((ip)->i_sblock == 0 ? 0 : ((ip)->i_eblock + 1) - (ip)->i_sblock)
69 62
70#define BFS_OFF2INO(offset) \ 63#define BFS_OFF2INO(offset) \
71 ((((offset) - BFS_BSIZE) / sizeof(struct bfs_inode)) + BFS_ROOT_INO) 64 ((((offset) - BFS_BSIZE) / sizeof(struct bfs_inode)) + BFS_ROOT_INO)
72 65
73#define BFS_INO2OFF(ino) \ 66#define BFS_INO2OFF(ino) \
74 ((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE) 67 ((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE)
68#define BFS_NZFILESIZE(ip) \
69 ((cpu_to_le32((ip)->i_eoffset) + 1) - cpu_to_le32((ip)->i_sblock) * BFS_BSIZE)
70
71#define BFS_FILESIZE(ip) \
72 ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip))
75 73
74#define BFS_FILEBLOCKS(ip) \
75 ((ip)->i_sblock == 0 ? 0 : (cpu_to_le32((ip)->i_eblock) + 1) - cpu_to_le32((ip)->i_sblock))
76#define BFS_UNCLEAN(bfs_sb, sb) \ 76#define BFS_UNCLEAN(bfs_sb, sb) \
77 ((bfs_sb->s_from != -1) && (bfs_sb->s_to != -1) && !(sb->s_flags & MS_RDONLY)) 77 ((cpu_to_le32(bfs_sb->s_from) != -1) && (cpu_to_le32(bfs_sb->s_to) != -1) && !(sb->s_flags & MS_RDONLY))
78
78 79
79#endif /* _LINUX_BFS_FS_H */ 80#endif /* _LINUX_BFS_FS_H */
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 36ef29fa0d8b..cdaf03a14a51 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -111,7 +111,6 @@ struct bio {
111 void *bi_private; 111 void *bi_private;
112 112
113 bio_destructor_t *bi_destructor; /* destructor */ 113 bio_destructor_t *bi_destructor; /* destructor */
114 struct bio_set *bi_set; /* memory pools set */
115}; 114};
116 115
117/* 116/*
@@ -280,6 +279,7 @@ extern void bioset_free(struct bio_set *);
280extern struct bio *bio_alloc(unsigned int __nocast, int); 279extern struct bio *bio_alloc(unsigned int __nocast, int);
281extern struct bio *bio_alloc_bioset(unsigned int __nocast, int, struct bio_set *); 280extern struct bio *bio_alloc_bioset(unsigned int __nocast, int, struct bio_set *);
282extern void bio_put(struct bio *); 281extern void bio_put(struct bio *);
282extern void bio_free(struct bio *, struct bio_set *);
283 283
284extern void bio_endio(struct bio *, unsigned int, int); 284extern void bio_endio(struct bio *, unsigned int, int);
285struct request_queue; 285struct request_queue;
@@ -295,7 +295,13 @@ extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int);
295extern int bio_get_nr_vecs(struct block_device *); 295extern int bio_get_nr_vecs(struct block_device *);
296extern struct bio *bio_map_user(struct request_queue *, struct block_device *, 296extern struct bio *bio_map_user(struct request_queue *, struct block_device *,
297 unsigned long, unsigned int, int); 297 unsigned long, unsigned int, int);
298struct sg_iovec;
299extern struct bio *bio_map_user_iov(struct request_queue *,
300 struct block_device *,
301 struct sg_iovec *, int, int);
298extern void bio_unmap_user(struct bio *); 302extern void bio_unmap_user(struct bio *);
303extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int,
304 unsigned int);
299extern void bio_set_pages_dirty(struct bio *bio); 305extern void bio_set_pages_dirty(struct bio *bio);
300extern void bio_check_pages_dirty(struct bio *bio); 306extern void bio_check_pages_dirty(struct bio *bio);
301extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int); 307extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 19bd8e7e11bf..aefa26fbae8a 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -563,10 +563,12 @@ extern void blk_sync_queue(struct request_queue *q);
563extern void __blk_stop_queue(request_queue_t *q); 563extern void __blk_stop_queue(request_queue_t *q);
564extern void blk_run_queue(request_queue_t *); 564extern void blk_run_queue(request_queue_t *);
565extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); 565extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *);
566extern struct request *blk_rq_map_user(request_queue_t *, int, void __user *, unsigned int); 566extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int);
567extern int blk_rq_unmap_user(struct request *, struct bio *, unsigned int); 567extern int blk_rq_unmap_user(struct bio *, unsigned int);
568extern int blk_execute_rq(request_queue_t *, struct gendisk *, struct request *); 568extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, unsigned int);
569 569extern int blk_rq_map_user_iov(request_queue_t *, struct request *, struct sg_iovec *, int);
570extern int blk_execute_rq(request_queue_t *, struct gendisk *,
571 struct request *, int);
570static inline request_queue_t *bdev_get_queue(struct block_device *bdev) 572static inline request_queue_t *bdev_get_queue(struct block_device *bdev)
571{ 573{
572 return bdev->bd_disk->queue; 574 return bdev->bd_disk->queue;
diff --git a/include/linux/capability.h b/include/linux/capability.h
index 8d139f4acf23..6b4618902d3d 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -233,6 +233,7 @@ typedef __u32 kernel_cap_t;
233/* Allow enabling/disabling tagged queuing on SCSI controllers and sending 233/* Allow enabling/disabling tagged queuing on SCSI controllers and sending
234 arbitrary SCSI commands */ 234 arbitrary SCSI commands */
235/* Allow setting encryption key on loopback filesystem */ 235/* Allow setting encryption key on loopback filesystem */
236/* Allow setting zone reclaim policy */
236 237
237#define CAP_SYS_ADMIN 21 238#define CAP_SYS_ADMIN 21
238 239
diff --git a/include/linux/compat.h b/include/linux/compat.h
index b58b7d6f2fdb..f9ca534787e2 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -18,6 +18,9 @@
18#define compat_jiffies_to_clock_t(x) \ 18#define compat_jiffies_to_clock_t(x) \
19 (((unsigned long)(x) * COMPAT_USER_HZ) / HZ) 19 (((unsigned long)(x) * COMPAT_USER_HZ) / HZ)
20 20
21typedef __compat_uid32_t compat_uid_t;
22typedef __compat_gid32_t compat_gid_t;
23
21struct rusage; 24struct rusage;
22 25
23struct compat_itimerspec { 26struct compat_itimerspec {
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index 3438233305a3..24062a1dbf61 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -23,7 +23,8 @@ void cpuset_init_current_mems_allowed(void);
23void cpuset_update_current_mems_allowed(void); 23void cpuset_update_current_mems_allowed(void);
24void cpuset_restrict_to_mems_allowed(unsigned long *nodes); 24void cpuset_restrict_to_mems_allowed(unsigned long *nodes);
25int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl); 25int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl);
26int cpuset_zone_allowed(struct zone *z); 26extern int cpuset_zone_allowed(struct zone *z, unsigned int __nocast gfp_mask);
27extern int cpuset_excl_nodes_overlap(const struct task_struct *p);
27extern struct file_operations proc_cpuset_operations; 28extern struct file_operations proc_cpuset_operations;
28extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); 29extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer);
29 30
@@ -48,7 +49,13 @@ static inline int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl)
48 return 1; 49 return 1;
49} 50}
50 51
51static inline int cpuset_zone_allowed(struct zone *z) 52static inline int cpuset_zone_allowed(struct zone *z,
53 unsigned int __nocast gfp_mask)
54{
55 return 1;
56}
57
58static inline int cpuset_excl_nodes_overlap(const struct task_struct *p)
52{ 59{
53 return 1; 60 return 1;
54} 61}
diff --git a/include/linux/crc16.h b/include/linux/crc16.h
new file mode 100644
index 000000000000..bdedf825b04a
--- /dev/null
+++ b/include/linux/crc16.h
@@ -0,0 +1,44 @@
1/*
2 * crc16.h - CRC-16 routine
3 *
4 * Implements the standard CRC-16, as used with 1-wire devices:
5 * Width 16
6 * Poly 0x8005 (x^16 + x^15 + x^2 + 1)
7 * Init 0
8 *
9 * For 1-wire devices, the CRC is stored inverted, LSB-first
10 *
11 * Example buffer with the CRC attached:
12 * 31 32 33 34 35 36 37 38 39 C2 44
13 *
14 * The CRC over a buffer with the CRC attached is 0xB001.
15 * So, if (crc16(0, buf, size) == 0xB001) then the buffer is valid.
16 *
17 * Refer to "Application Note 937: Book of iButton Standards" for details.
18 * http://www.maxim-ic.com/appnotes.cfm/appnote_number/937
19 *
20 * Copyright (c) 2005 Ben Gardner <bgardner@wabtec.com>
21 *
22 * This source code is licensed under the GNU General Public License,
23 * Version 2. See the file COPYING for more details.
24 */
25
26#ifndef __CRC16_H
27#define __CRC16_H
28
29#include <linux/types.h>
30
31#define CRC16_INIT 0
32#define CRC16_VALID 0xb001
33
34extern u16 const crc16_table[256];
35
36extern u16 crc16(u16 crc, const u8 *buffer, size_t len);
37
38static inline u16 crc16_byte(u16 crc, const u8 data)
39{
40 return (crc >> 8) ^ crc16_table[(crc ^ data) & 0xff];
41}
42
43#endif /* __CRC16_H */
44
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 5e2bcc636a02..3c89df6e7768 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -45,6 +45,7 @@
45#define CRYPTO_TFM_MODE_CTR 0x00000008 45#define CRYPTO_TFM_MODE_CTR 0x00000008
46 46
47#define CRYPTO_TFM_REQ_WEAK_KEY 0x00000100 47#define CRYPTO_TFM_REQ_WEAK_KEY 0x00000100
48#define CRYPTO_TFM_REQ_MAY_SLEEP 0x00000200
48#define CRYPTO_TFM_RES_WEAK_KEY 0x00100000 49#define CRYPTO_TFM_RES_WEAK_KEY 0x00100000
49#define CRYPTO_TFM_RES_BAD_KEY_LEN 0x00200000 50#define CRYPTO_TFM_RES_BAD_KEY_LEN 0x00200000
50#define CRYPTO_TFM_RES_BAD_KEY_SCHED 0x00400000 51#define CRYPTO_TFM_RES_BAD_KEY_SCHED 0x00400000
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 50be290d24d2..ab04b4f9b0db 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -88,8 +88,9 @@ struct dentry {
88 * negative */ 88 * negative */
89 /* 89 /*
90 * The next three fields are touched by __d_lookup. Place them here 90 * The next three fields are touched by __d_lookup. Place them here
91 * so they all fit in a 16-byte range, with 16-byte alignment. 91 * so they all fit in a cache line.
92 */ 92 */
93 struct hlist_node d_hash; /* lookup hash list */
93 struct dentry *d_parent; /* parent directory */ 94 struct dentry *d_parent; /* parent directory */
94 struct qstr d_name; 95 struct qstr d_name;
95 96
@@ -103,7 +104,6 @@ struct dentry {
103 void *d_fsdata; /* fs-specific data */ 104 void *d_fsdata; /* fs-specific data */
104 struct rcu_head d_rcu; 105 struct rcu_head d_rcu;
105 struct dcookie_struct *d_cookie; /* cookie, if any */ 106 struct dcookie_struct *d_cookie; /* cookie, if any */
106 struct hlist_node d_hash; /* lookup hash list */
107 int d_mounted; 107 int d_mounted;
108 unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */ 108 unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */
109}; 109};
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index 007c290f74d4..8bf4bacb5051 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -432,7 +432,10 @@ struct dccp_sock {
432 struct ccid *dccps_hc_rx_ccid; 432 struct ccid *dccps_hc_rx_ccid;
433 struct ccid *dccps_hc_tx_ccid; 433 struct ccid *dccps_hc_tx_ccid;
434 struct dccp_options_received dccps_options_received; 434 struct dccp_options_received dccps_options_received;
435 struct timeval dccps_epoch;
435 enum dccp_role dccps_role:2; 436 enum dccp_role dccps_role:2;
437 __u8 dccps_hc_rx_insert_options:1;
438 __u8 dccps_hc_tx_insert_options:1;
436}; 439};
437 440
438static inline struct dccp_sock *dccp_sk(const struct sock *sk) 441static inline struct dccp_sock *dccp_sk(const struct sock *sk)
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index 5e93e6dce9a4..c30175e8dec6 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -1,6 +1,8 @@
1#ifndef __DMI_H__ 1#ifndef __DMI_H__
2#define __DMI_H__ 2#define __DMI_H__
3 3
4#include <linux/list.h>
5
4enum dmi_field { 6enum dmi_field {
5 DMI_NONE, 7 DMI_NONE,
6 DMI_BIOS_VENDOR, 8 DMI_BIOS_VENDOR,
@@ -16,6 +18,24 @@ enum dmi_field {
16 DMI_STRING_MAX, 18 DMI_STRING_MAX,
17}; 19};
18 20
21enum dmi_device_type {
22 DMI_DEV_TYPE_ANY = 0,
23 DMI_DEV_TYPE_OTHER,
24 DMI_DEV_TYPE_UNKNOWN,
25 DMI_DEV_TYPE_VIDEO,
26 DMI_DEV_TYPE_SCSI,
27 DMI_DEV_TYPE_ETHERNET,
28 DMI_DEV_TYPE_TOKENRING,
29 DMI_DEV_TYPE_SOUND,
30 DMI_DEV_TYPE_IPMI = -1
31};
32
33struct dmi_header {
34 u8 type;
35 u8 length;
36 u16 handle;
37};
38
19/* 39/*
20 * DMI callbacks for problem boards 40 * DMI callbacks for problem boards
21 */ 41 */
@@ -26,22 +46,32 @@ struct dmi_strmatch {
26 46
27struct dmi_system_id { 47struct dmi_system_id {
28 int (*callback)(struct dmi_system_id *); 48 int (*callback)(struct dmi_system_id *);
29 char *ident; 49 const char *ident;
30 struct dmi_strmatch matches[4]; 50 struct dmi_strmatch matches[4];
31 void *driver_data; 51 void *driver_data;
32}; 52};
33 53
34#define DMI_MATCH(a,b) { a, b } 54#define DMI_MATCH(a, b) { a, b }
55
56struct dmi_device {
57 struct list_head list;
58 int type;
59 const char *name;
60 void *device_data; /* Type specific data */
61};
35 62
36#if defined(CONFIG_X86) && !defined(CONFIG_X86_64) 63#if defined(CONFIG_X86) && !defined(CONFIG_X86_64)
37 64
38extern int dmi_check_system(struct dmi_system_id *list); 65extern int dmi_check_system(struct dmi_system_id *list);
39extern char * dmi_get_system_info(int field); 66extern char * dmi_get_system_info(int field);
40 67extern struct dmi_device * dmi_find_device(int type, const char *name,
68 struct dmi_device *from);
41#else 69#else
42 70
43static inline int dmi_check_system(struct dmi_system_id *list) { return 0; } 71static inline int dmi_check_system(struct dmi_system_id *list) { return 0; }
44static inline char * dmi_get_system_info(int field) { return NULL; } 72static inline char * dmi_get_system_info(int field) { return NULL; }
73static struct dmi_device * dmi_find_device(int type, const char *name,
74 struct dmi_device *from) { return NULL; }
45 75
46#endif 76#endif
47 77
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 73781ec165b4..c7c5dd316182 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -91,11 +91,6 @@ typedef struct {
91 91
92#define EFI_PAGE_SHIFT 12 92#define EFI_PAGE_SHIFT 12
93 93
94/*
95 * For current x86 implementations of EFI, there is
96 * additional padding in the mem descriptors. This is not
97 * the case in ia64. Need to have this fixed in the f/w.
98 */
99typedef struct { 94typedef struct {
100 u32 type; 95 u32 type;
101 u32 pad; 96 u32 pad;
@@ -103,9 +98,6 @@ typedef struct {
103 u64 virt_addr; 98 u64 virt_addr;
104 u64 num_pages; 99 u64 num_pages;
105 u64 attribute; 100 u64 attribute;
106#if defined (__i386__)
107 u64 pad1;
108#endif
109} efi_memory_desc_t; 101} efi_memory_desc_t;
110 102
111typedef int (*efi_freemem_callback_t) (unsigned long start, unsigned long end, void *arg); 103typedef int (*efi_freemem_callback_t) (unsigned long start, unsigned long end, void *arg);
@@ -240,10 +232,12 @@ typedef struct {
240} efi_system_table_t; 232} efi_system_table_t;
241 233
242struct efi_memory_map { 234struct efi_memory_map {
243 efi_memory_desc_t *phys_map; 235 void *phys_map;
244 efi_memory_desc_t *map; 236 void *map;
237 void *map_end;
245 int nr_map; 238 int nr_map;
246 unsigned long desc_version; 239 unsigned long desc_version;
240 unsigned long desc_size;
247}; 241};
248 242
249/* 243/*
diff --git a/include/linux/elf.h b/include/linux/elf.h
index f5b3ba5a317d..ff955dbf510d 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -2,6 +2,7 @@
2#define _LINUX_ELF_H 2#define _LINUX_ELF_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/auxvec.h>
5#include <asm/elf.h> 6#include <asm/elf.h>
6 7
7#ifndef elf_read_implies_exec 8#ifndef elf_read_implies_exec
@@ -158,29 +159,6 @@ typedef __s64 Elf64_Sxword;
158#define ELF64_ST_BIND(x) ELF_ST_BIND(x) 159#define ELF64_ST_BIND(x) ELF_ST_BIND(x)
159#define ELF64_ST_TYPE(x) ELF_ST_TYPE(x) 160#define ELF64_ST_TYPE(x) ELF_ST_TYPE(x)
160 161
161/* Symbolic values for the entries in the auxiliary table
162 put on the initial stack */
163#define AT_NULL 0 /* end of vector */
164#define AT_IGNORE 1 /* entry should be ignored */
165#define AT_EXECFD 2 /* file descriptor of program */
166#define AT_PHDR 3 /* program headers for program */
167#define AT_PHENT 4 /* size of program header entry */
168#define AT_PHNUM 5 /* number of program headers */
169#define AT_PAGESZ 6 /* system page size */
170#define AT_BASE 7 /* base address of interpreter */
171#define AT_FLAGS 8 /* flags */
172#define AT_ENTRY 9 /* entry point of program */
173#define AT_NOTELF 10 /* program is not ELF */
174#define AT_UID 11 /* real uid */
175#define AT_EUID 12 /* effective uid */
176#define AT_GID 13 /* real gid */
177#define AT_EGID 14 /* effective gid */
178#define AT_PLATFORM 15 /* string identifying CPU for optimizations */
179#define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */
180#define AT_CLKTCK 17 /* frequency at which times() increments */
181
182#define AT_SECURE 23 /* secure mode boolean */
183
184typedef struct dynamic{ 162typedef struct dynamic{
185 Elf32_Sword d_tag; 163 Elf32_Sword d_tag;
186 union{ 164 union{
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index a657130ba03a..f7bd1c7ebefb 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -313,6 +313,9 @@ struct ext2_inode {
313#define EXT2_MOUNT_XATTR_USER 0x004000 /* Extended user attributes */ 313#define EXT2_MOUNT_XATTR_USER 0x004000 /* Extended user attributes */
314#define EXT2_MOUNT_POSIX_ACL 0x008000 /* POSIX Access Control Lists */ 314#define EXT2_MOUNT_POSIX_ACL 0x008000 /* POSIX Access Control Lists */
315#define EXT2_MOUNT_XIP 0x010000 /* Execute in place */ 315#define EXT2_MOUNT_XIP 0x010000 /* Execute in place */
316#define EXT2_MOUNT_USRQUOTA 0x020000 /* user quota */
317#define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */
318
316 319
317#define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt 320#define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt
318#define set_opt(o, opt) o |= EXT2_MOUNT_##opt 321#define set_opt(o, opt) o |= EXT2_MOUNT_##opt
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index c16662836c58..c0272d73ab20 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -373,6 +373,8 @@ struct ext3_inode {
373#define EXT3_MOUNT_BARRIER 0x20000 /* Use block barriers */ 373#define EXT3_MOUNT_BARRIER 0x20000 /* Use block barriers */
374#define EXT3_MOUNT_NOBH 0x40000 /* No bufferheads */ 374#define EXT3_MOUNT_NOBH 0x40000 /* No bufferheads */
375#define EXT3_MOUNT_QUOTA 0x80000 /* Some quota option set */ 375#define EXT3_MOUNT_QUOTA 0x80000 /* Some quota option set */
376#define EXT3_MOUNT_USRQUOTA 0x100000 /* "old" user quota */
377#define EXT3_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */
376 378
377/* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */ 379/* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
378#ifndef _LINUX_EXT2_FS_H 380#ifndef _LINUX_EXT2_FS_H
diff --git a/include/linux/fb.h b/include/linux/fb.h
index bc24beeed971..82e39cd0c4fb 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -107,6 +107,8 @@
107#define FB_ACCEL_NV_20 44 /* nVidia Arch 20 */ 107#define FB_ACCEL_NV_20 44 /* nVidia Arch 20 */
108#define FB_ACCEL_NV_30 45 /* nVidia Arch 30 */ 108#define FB_ACCEL_NV_30 45 /* nVidia Arch 30 */
109#define FB_ACCEL_NV_40 46 /* nVidia Arch 40 */ 109#define FB_ACCEL_NV_40 46 /* nVidia Arch 40 */
110#define FB_ACCEL_XGI_VOLARI_V 47 /* XGI Volari V3XT, V5, V8 */
111#define FB_ACCEL_XGI_VOLARI_Z 48 /* XGI Volari Z7 */
110#define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */ 112#define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */
111#define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */ 113#define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */
112#define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */ 114#define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */
@@ -495,6 +497,9 @@ struct fb_cursor_user {
495#define FB_EVENT_BLANK 0x08 497#define FB_EVENT_BLANK 0x08
496/* Private modelist is to be replaced */ 498/* Private modelist is to be replaced */
497#define FB_EVENT_NEW_MODELIST 0x09 499#define FB_EVENT_NEW_MODELIST 0x09
500/* The resolution of the passed in fb_info about to change and
501 all vc's should be changed */
502#define FB_EVENT_MODE_CHANGE_ALL 0x0A
498 503
499struct fb_event { 504struct fb_event {
500 struct fb_info *info; 505 struct fb_info *info;
@@ -820,13 +825,29 @@ extern void fb_pad_unaligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 idx,
820 u32 height, u32 shift_high, u32 shift_low, u32 mod); 825 u32 height, u32 shift_high, u32 shift_low, u32 mod);
821extern void fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, u32 height); 826extern void fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, u32 height);
822extern void fb_set_suspend(struct fb_info *info, int state); 827extern void fb_set_suspend(struct fb_info *info, int state);
823extern int fb_get_color_depth(struct fb_var_screeninfo *var); 828extern int fb_get_color_depth(struct fb_var_screeninfo *var,
829 struct fb_fix_screeninfo *fix);
824extern int fb_get_options(char *name, char **option); 830extern int fb_get_options(char *name, char **option);
825extern int fb_new_modelist(struct fb_info *info); 831extern int fb_new_modelist(struct fb_info *info);
826 832
827extern struct fb_info *registered_fb[FB_MAX]; 833extern struct fb_info *registered_fb[FB_MAX];
828extern int num_registered_fb; 834extern int num_registered_fb;
829 835
836static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch,
837 u8 *src, u32 s_pitch, u32 height)
838{
839 int i, j;
840
841 d_pitch -= s_pitch;
842
843 for (i = height; i--; ) {
844 /* s_pitch is a few bytes at the most, memcpy is suboptimal */
845 for (j = 0; j < s_pitch; j++)
846 *dst++ = *src++;
847 dst += d_pitch;
848 }
849}
850
830/* drivers/video/fbsysfs.c */ 851/* drivers/video/fbsysfs.c */
831extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev); 852extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev);
832extern void framebuffer_release(struct fb_info *info); 853extern void framebuffer_release(struct fb_info *info);
@@ -856,8 +877,11 @@ extern int fb_get_mode(int flags, u32 val, struct fb_var_screeninfo *var,
856extern int fb_validate_mode(const struct fb_var_screeninfo *var, 877extern int fb_validate_mode(const struct fb_var_screeninfo *var,
857 struct fb_info *info); 878 struct fb_info *info);
858extern int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var); 879extern int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var);
859extern void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs); 880extern const unsigned char *fb_firmware_edid(struct device *device);
881extern void fb_edid_to_monspecs(unsigned char *edid,
882 struct fb_monspecs *specs);
860extern void fb_destroy_modedb(struct fb_videomode *modedb); 883extern void fb_destroy_modedb(struct fb_videomode *modedb);
884extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb);
861 885
862/* drivers/video/modedb.c */ 886/* drivers/video/modedb.c */
863#define VESA_MODEDB_SIZE 34 887#define VESA_MODEDB_SIZE 34
diff --git a/include/linux/file.h b/include/linux/file.h
index 5206beb9a80e..f5bbd4c508b3 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -9,6 +9,7 @@
9#include <linux/posix_types.h> 9#include <linux/posix_types.h>
10#include <linux/compiler.h> 10#include <linux/compiler.h>
11#include <linux/spinlock.h> 11#include <linux/spinlock.h>
12#include <linux/rcupdate.h>
12 13
13/* 14/*
14 * The default fd array needs to be at least BITS_PER_LONG, 15 * The default fd array needs to be at least BITS_PER_LONG,
@@ -16,23 +17,33 @@
16 */ 17 */
17#define NR_OPEN_DEFAULT BITS_PER_LONG 18#define NR_OPEN_DEFAULT BITS_PER_LONG
18 19
20struct fdtable {
21 unsigned int max_fds;
22 int max_fdset;
23 int next_fd;
24 struct file ** fd; /* current fd array */
25 fd_set *close_on_exec;
26 fd_set *open_fds;
27 struct rcu_head rcu;
28 struct files_struct *free_files;
29 struct fdtable *next;
30};
31
19/* 32/*
20 * Open file table structure 33 * Open file table structure
21 */ 34 */
22struct files_struct { 35struct files_struct {
23 atomic_t count; 36 atomic_t count;
24 spinlock_t file_lock; /* Protects all the below members. Nests inside tsk->alloc_lock */ 37 spinlock_t file_lock; /* Protects all the below members. Nests inside tsk->alloc_lock */
25 int max_fds; 38 struct fdtable *fdt;
26 int max_fdset; 39 struct fdtable fdtab;
27 int next_fd;
28 struct file ** fd; /* current fd array */
29 fd_set *close_on_exec;
30 fd_set *open_fds;
31 fd_set close_on_exec_init; 40 fd_set close_on_exec_init;
32 fd_set open_fds_init; 41 fd_set open_fds_init;
33 struct file * fd_array[NR_OPEN_DEFAULT]; 42 struct file * fd_array[NR_OPEN_DEFAULT];
34}; 43};
35 44
45#define files_fdtable(files) (rcu_dereference((files)->fdt))
46
36extern void FASTCALL(__fput(struct file *)); 47extern void FASTCALL(__fput(struct file *));
37extern void FASTCALL(fput(struct file *)); 48extern void FASTCALL(fput(struct file *));
38 49
@@ -59,13 +70,16 @@ extern fd_set *alloc_fdset(int);
59extern void free_fdset(fd_set *, int); 70extern void free_fdset(fd_set *, int);
60 71
61extern int expand_files(struct files_struct *, int nr); 72extern int expand_files(struct files_struct *, int nr);
73extern void free_fdtable(struct fdtable *fdt);
74extern void __init files_defer_init(void);
62 75
63static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd) 76static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd)
64{ 77{
65 struct file * file = NULL; 78 struct file * file = NULL;
79 struct fdtable *fdt = files_fdtable(files);
66 80
67 if (fd < files->max_fds) 81 if (fd < fdt->max_fds)
68 file = files->fd[fd]; 82 file = rcu_dereference(fdt->fd[fd]);
69 return file; 83 return file;
70} 84}
71 85
diff --git a/include/linux/firmware.h b/include/linux/firmware.h
index 886255b69bb9..2063c0839d4f 100644
--- a/include/linux/firmware.h
+++ b/include/linux/firmware.h
@@ -3,6 +3,9 @@
3#include <linux/module.h> 3#include <linux/module.h>
4#include <linux/types.h> 4#include <linux/types.h>
5#define FIRMWARE_NAME_MAX 30 5#define FIRMWARE_NAME_MAX 30
6#define FW_ACTION_NOHOTPLUG 0
7#define FW_ACTION_HOTPLUG 1
8
6struct firmware { 9struct firmware {
7 size_t size; 10 size_t size;
8 u8 *data; 11 u8 *data;
@@ -11,7 +14,7 @@ struct device;
11int request_firmware(const struct firmware **fw, const char *name, 14int request_firmware(const struct firmware **fw, const char *name,
12 struct device *device); 15 struct device *device);
13int request_firmware_nowait( 16int request_firmware_nowait(
14 struct module *module, 17 struct module *module, int hotplug,
15 const char *name, struct device *device, void *context, 18 const char *name, struct device *device, void *context,
16 void (*cont)(const struct firmware *fw, void *context)); 19 void (*cont)(const struct firmware *fw, void *context));
17 20
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 67e6732d4fdc..7f61227827d7 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -9,6 +9,7 @@
9#include <linux/config.h> 9#include <linux/config.h>
10#include <linux/limits.h> 10#include <linux/limits.h>
11#include <linux/ioctl.h> 11#include <linux/ioctl.h>
12#include <linux/rcuref.h>
12 13
13/* 14/*
14 * It's silly to have NR_OPEN bigger than NR_FILE, but you can change 15 * It's silly to have NR_OPEN bigger than NR_FILE, but you can change
@@ -69,6 +70,7 @@ extern int dir_notify_enable;
69#define READ 0 70#define READ 0
70#define WRITE 1 71#define WRITE 1
71#define READA 2 /* read-ahead - don't block if no resources */ 72#define READA 2 /* read-ahead - don't block if no resources */
73#define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */
72#define SPECIAL 4 /* For non-blockdevice requests in request queue */ 74#define SPECIAL 4 /* For non-blockdevice requests in request queue */
73#define READ_SYNC (READ | (1 << BIO_RW_SYNC)) 75#define READ_SYNC (READ | (1 << BIO_RW_SYNC))
74#define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) 76#define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC))
@@ -281,19 +283,9 @@ struct iattr {
281 struct timespec ia_atime; 283 struct timespec ia_atime;
282 struct timespec ia_mtime; 284 struct timespec ia_mtime;
283 struct timespec ia_ctime; 285 struct timespec ia_ctime;
284 unsigned int ia_attr_flags;
285}; 286};
286 287
287/* 288/*
288 * This is the inode attributes flag definitions
289 */
290#define ATTR_FLAG_SYNCRONOUS 1 /* Syncronous write */
291#define ATTR_FLAG_NOATIME 2 /* Don't update atime */
292#define ATTR_FLAG_APPEND 4 /* Append-only file */
293#define ATTR_FLAG_IMMUTABLE 8 /* Immutable file */
294#define ATTR_FLAG_NODIRATIME 16 /* Don't update atime for directory */
295
296/*
297 * Includes for diskquotas. 289 * Includes for diskquotas.
298 */ 290 */
299#include <linux/quota.h> 291#include <linux/quota.h>
@@ -594,7 +586,6 @@ struct file {
594 unsigned int f_uid, f_gid; 586 unsigned int f_uid, f_gid;
595 struct file_ra_state f_ra; 587 struct file_ra_state f_ra;
596 588
597 size_t f_maxcount;
598 unsigned long f_version; 589 unsigned long f_version;
599 void *f_security; 590 void *f_security;
600 591
@@ -607,12 +598,13 @@ struct file {
607 spinlock_t f_ep_lock; 598 spinlock_t f_ep_lock;
608#endif /* #ifdef CONFIG_EPOLL */ 599#endif /* #ifdef CONFIG_EPOLL */
609 struct address_space *f_mapping; 600 struct address_space *f_mapping;
601 struct rcu_head f_rcuhead;
610}; 602};
611extern spinlock_t files_lock; 603extern spinlock_t files_lock;
612#define file_list_lock() spin_lock(&files_lock); 604#define file_list_lock() spin_lock(&files_lock);
613#define file_list_unlock() spin_unlock(&files_lock); 605#define file_list_unlock() spin_unlock(&files_lock);
614 606
615#define get_file(x) atomic_inc(&(x)->f_count) 607#define get_file(x) rcuref_inc(&(x)->f_count)
616#define file_count(x) atomic_read(&(x)->f_count) 608#define file_count(x) atomic_read(&(x)->f_count)
617 609
618#define MAX_NON_LFS ((1UL<<31) - 1) 610#define MAX_NON_LFS ((1UL<<31) - 1)
@@ -1291,6 +1283,7 @@ static inline int break_lease(struct inode *inode, unsigned int mode)
1291/* fs/open.c */ 1283/* fs/open.c */
1292 1284
1293extern int do_truncate(struct dentry *, loff_t start); 1285extern int do_truncate(struct dentry *, loff_t start);
1286extern long do_sys_open(const char __user *filename, int flags, int mode);
1294extern struct file *filp_open(const char *, int, int); 1287extern struct file *filp_open(const char *, int, int);
1295extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); 1288extern struct file * dentry_open(struct dentry *, struct vfsmount *, int);
1296extern int filp_close(struct file *, fl_owner_t id); 1289extern int filp_close(struct file *, fl_owner_t id);
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
new file mode 100644
index 000000000000..acbeb96a3353
--- /dev/null
+++ b/include/linux/fuse.h
@@ -0,0 +1,259 @@
1/*
2 FUSE: Filesystem in Userspace
3 Copyright (C) 2001-2005 Miklos Szeredi <miklos@szeredi.hu>
4
5 This program can be distributed under the terms of the GNU GPL.
6 See the file COPYING.
7*/
8
9/* This file defines the kernel interface of FUSE */
10
11#include <asm/types.h>
12
13/** Version number of this interface */
14#define FUSE_KERNEL_VERSION 7
15
16/** Minor version number of this interface */
17#define FUSE_KERNEL_MINOR_VERSION 2
18
19/** The node ID of the root inode */
20#define FUSE_ROOT_ID 1
21
22/** The major number of the fuse character device */
23#define FUSE_MAJOR 10
24
25/** The minor number of the fuse character device */
26#define FUSE_MINOR 229
27
28/* Make sure all structures are padded to 64bit boundary, so 32bit
29 userspace works under 64bit kernels */
30
31struct fuse_attr {
32 __u64 ino;
33 __u64 size;
34 __u64 blocks;
35 __u64 atime;
36 __u64 mtime;
37 __u64 ctime;
38 __u32 atimensec;
39 __u32 mtimensec;
40 __u32 ctimensec;
41 __u32 mode;
42 __u32 nlink;
43 __u32 uid;
44 __u32 gid;
45 __u32 rdev;
46};
47
48struct fuse_kstatfs {
49 __u64 blocks;
50 __u64 bfree;
51 __u64 bavail;
52 __u64 files;
53 __u64 ffree;
54 __u32 bsize;
55 __u32 namelen;
56};
57
58#define FATTR_MODE (1 << 0)
59#define FATTR_UID (1 << 1)
60#define FATTR_GID (1 << 2)
61#define FATTR_SIZE (1 << 3)
62#define FATTR_ATIME (1 << 4)
63#define FATTR_MTIME (1 << 5)
64#define FATTR_CTIME (1 << 6)
65
66/**
67 * Flags returned by the OPEN request
68 *
69 * FOPEN_DIRECT_IO: bypass page cache for this open file
70 * FOPEN_KEEP_CACHE: don't invalidate the data cache on open
71 */
72#define FOPEN_DIRECT_IO (1 << 0)
73#define FOPEN_KEEP_CACHE (1 << 1)
74
75enum fuse_opcode {
76 FUSE_LOOKUP = 1,
77 FUSE_FORGET = 2, /* no reply */
78 FUSE_GETATTR = 3,
79 FUSE_SETATTR = 4,
80 FUSE_READLINK = 5,
81 FUSE_SYMLINK = 6,
82 FUSE_MKNOD = 8,
83 FUSE_MKDIR = 9,
84 FUSE_UNLINK = 10,
85 FUSE_RMDIR = 11,
86 FUSE_RENAME = 12,
87 FUSE_LINK = 13,
88 FUSE_OPEN = 14,
89 FUSE_READ = 15,
90 FUSE_WRITE = 16,
91 FUSE_STATFS = 17,
92 FUSE_RELEASE = 18,
93 FUSE_FSYNC = 20,
94 FUSE_SETXATTR = 21,
95 FUSE_GETXATTR = 22,
96 FUSE_LISTXATTR = 23,
97 FUSE_REMOVEXATTR = 24,
98 FUSE_FLUSH = 25,
99 FUSE_INIT = 26,
100 FUSE_OPENDIR = 27,
101 FUSE_READDIR = 28,
102 FUSE_RELEASEDIR = 29,
103 FUSE_FSYNCDIR = 30
104};
105
106/* Conservative buffer size for the client */
107#define FUSE_MAX_IN 8192
108
109#define FUSE_NAME_MAX 1024
110#define FUSE_SYMLINK_MAX 4096
111#define FUSE_XATTR_SIZE_MAX 4096
112
113struct fuse_entry_out {
114 __u64 nodeid; /* Inode ID */
115 __u64 generation; /* Inode generation: nodeid:gen must
116 be unique for the fs's lifetime */
117 __u64 entry_valid; /* Cache timeout for the name */
118 __u64 attr_valid; /* Cache timeout for the attributes */
119 __u32 entry_valid_nsec;
120 __u32 attr_valid_nsec;
121 struct fuse_attr attr;
122};
123
124struct fuse_forget_in {
125 __u64 nlookup;
126};
127
128struct fuse_attr_out {
129 __u64 attr_valid; /* Cache timeout for the attributes */
130 __u32 attr_valid_nsec;
131 __u32 dummy;
132 struct fuse_attr attr;
133};
134
135struct fuse_mknod_in {
136 __u32 mode;
137 __u32 rdev;
138};
139
140struct fuse_mkdir_in {
141 __u32 mode;
142 __u32 padding;
143};
144
145struct fuse_rename_in {
146 __u64 newdir;
147};
148
149struct fuse_link_in {
150 __u64 oldnodeid;
151};
152
153struct fuse_setattr_in {
154 __u32 valid;
155 __u32 padding;
156 struct fuse_attr attr;
157};
158
159struct fuse_open_in {
160 __u32 flags;
161 __u32 padding;
162};
163
164struct fuse_open_out {
165 __u64 fh;
166 __u32 open_flags;
167 __u32 padding;
168};
169
170struct fuse_release_in {
171 __u64 fh;
172 __u32 flags;
173 __u32 padding;
174};
175
176struct fuse_flush_in {
177 __u64 fh;
178 __u32 flush_flags;
179 __u32 padding;
180};
181
182struct fuse_read_in {
183 __u64 fh;
184 __u64 offset;
185 __u32 size;
186 __u32 padding;
187};
188
189struct fuse_write_in {
190 __u64 fh;
191 __u64 offset;
192 __u32 size;
193 __u32 write_flags;
194};
195
196struct fuse_write_out {
197 __u32 size;
198 __u32 padding;
199};
200
201struct fuse_statfs_out {
202 struct fuse_kstatfs st;
203};
204
205struct fuse_fsync_in {
206 __u64 fh;
207 __u32 fsync_flags;
208 __u32 padding;
209};
210
211struct fuse_setxattr_in {
212 __u32 size;
213 __u32 flags;
214};
215
216struct fuse_getxattr_in {
217 __u32 size;
218 __u32 padding;
219};
220
221struct fuse_getxattr_out {
222 __u32 size;
223 __u32 padding;
224};
225
226struct fuse_init_in_out {
227 __u32 major;
228 __u32 minor;
229};
230
231struct fuse_in_header {
232 __u32 len;
233 __u32 opcode;
234 __u64 unique;
235 __u64 nodeid;
236 __u32 uid;
237 __u32 gid;
238 __u32 pid;
239 __u32 padding;
240};
241
242struct fuse_out_header {
243 __u32 len;
244 __s32 error;
245 __u64 unique;
246};
247
248struct fuse_dirent {
249 __u64 ino;
250 __u64 off;
251 __u32 namelen;
252 __u32 type;
253 char name[0];
254};
255
256#define FUSE_NAME_OFFSET ((unsigned) ((struct fuse_dirent *) 0)->name)
257#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1))
258#define FUSE_DIRENT_SIZE(d) \
259 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
diff --git a/include/linux/futex.h b/include/linux/futex.h
index 65d6cfdb6d39..10f96c31971e 100644
--- a/include/linux/futex.h
+++ b/include/linux/futex.h
@@ -4,14 +4,40 @@
4/* Second argument to futex syscall */ 4/* Second argument to futex syscall */
5 5
6 6
7#define FUTEX_WAIT (0) 7#define FUTEX_WAIT 0
8#define FUTEX_WAKE (1) 8#define FUTEX_WAKE 1
9#define FUTEX_FD (2) 9#define FUTEX_FD 2
10#define FUTEX_REQUEUE (3) 10#define FUTEX_REQUEUE 3
11#define FUTEX_CMP_REQUEUE (4) 11#define FUTEX_CMP_REQUEUE 4
12#define FUTEX_WAKE_OP 5
12 13
13long do_futex(unsigned long uaddr, int op, int val, 14long do_futex(unsigned long uaddr, int op, int val,
14 unsigned long timeout, unsigned long uaddr2, int val2, 15 unsigned long timeout, unsigned long uaddr2, int val2,
15 int val3); 16 int val3);
16 17
18#define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */
19#define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */
20#define FUTEX_OP_OR 2 /* *(int *)UADDR2 |= OPARG; */
21#define FUTEX_OP_ANDN 3 /* *(int *)UADDR2 &= ~OPARG; */
22#define FUTEX_OP_XOR 4 /* *(int *)UADDR2 ^= OPARG; */
23
24#define FUTEX_OP_OPARG_SHIFT 8 /* Use (1 << OPARG) instead of OPARG. */
25
26#define FUTEX_OP_CMP_EQ 0 /* if (oldval == CMPARG) wake */
27#define FUTEX_OP_CMP_NE 1 /* if (oldval != CMPARG) wake */
28#define FUTEX_OP_CMP_LT 2 /* if (oldval < CMPARG) wake */
29#define FUTEX_OP_CMP_LE 3 /* if (oldval <= CMPARG) wake */
30#define FUTEX_OP_CMP_GT 4 /* if (oldval > CMPARG) wake */
31#define FUTEX_OP_CMP_GE 5 /* if (oldval >= CMPARG) wake */
32
33/* FUTEX_WAKE_OP will perform atomically
34 int oldval = *(int *)UADDR2;
35 *(int *)UADDR2 = oldval OP OPARG;
36 if (oldval CMP CMPARG)
37 wake UADDR2; */
38
39#define FUTEX_OP(op, oparg, cmp, cmparg) \
40 (((op & 0xf) << 28) | ((cmp & 0xf) << 24) \
41 | ((oparg & 0xfff) << 12) | (cmparg & 0xfff))
42
17#endif 43#endif
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 7c7400137e97..4dc990f3b5cc 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -40,6 +40,7 @@ struct vm_area_struct;
40#define __GFP_ZERO 0x8000u /* Return zeroed page on success */ 40#define __GFP_ZERO 0x8000u /* Return zeroed page on success */
41#define __GFP_NOMEMALLOC 0x10000u /* Don't use emergency reserves */ 41#define __GFP_NOMEMALLOC 0x10000u /* Don't use emergency reserves */
42#define __GFP_NORECLAIM 0x20000u /* No realy zone reclaim during allocation */ 42#define __GFP_NORECLAIM 0x20000u /* No realy zone reclaim during allocation */
43#define __GFP_HARDWALL 0x40000u /* Enforce hardwall cpuset memory allocs */
43 44
44#define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ 45#define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */
45#define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1) 46#define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1)
@@ -48,14 +49,15 @@ struct vm_area_struct;
48#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ 49#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \
49 __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ 50 __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \
50 __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ 51 __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \
51 __GFP_NOMEMALLOC|__GFP_NORECLAIM) 52 __GFP_NOMEMALLOC|__GFP_NORECLAIM|__GFP_HARDWALL)
52 53
53#define GFP_ATOMIC (__GFP_HIGH) 54#define GFP_ATOMIC (__GFP_HIGH)
54#define GFP_NOIO (__GFP_WAIT) 55#define GFP_NOIO (__GFP_WAIT)
55#define GFP_NOFS (__GFP_WAIT | __GFP_IO) 56#define GFP_NOFS (__GFP_WAIT | __GFP_IO)
56#define GFP_KERNEL (__GFP_WAIT | __GFP_IO | __GFP_FS) 57#define GFP_KERNEL (__GFP_WAIT | __GFP_IO | __GFP_FS)
57#define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS) 58#define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL)
58#define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HIGHMEM) 59#define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \
60 __GFP_HIGHMEM)
59 61
60/* Flag - indicates that the buffer will be suitable for DMA. Ignored on some 62/* Flag - indicates that the buffer will be suitable for DMA. Ignored on some
61 platforms, used as appropriate on others */ 63 platforms, used as appropriate on others */
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index f529d1442815..e670b0d13fe0 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -70,12 +70,6 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
70void hugetlb_prefault_arch_hook(struct mm_struct *mm); 70void hugetlb_prefault_arch_hook(struct mm_struct *mm);
71#endif 71#endif
72 72
73#ifndef ARCH_HAS_HUGETLB_CLEAN_STALE_PGTABLE
74#define hugetlb_clean_stale_pgtable(pte) BUG()
75#else
76void hugetlb_clean_stale_pgtable(pte_t *pte);
77#endif
78
79#else /* !CONFIG_HUGETLB_PAGE */ 73#else /* !CONFIG_HUGETLB_PAGE */
80 74
81static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) 75static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
diff --git a/include/linux/hwmon-sysfs.h b/include/linux/hwmon-sysfs.h
index 1b5018a965f5..7eb4004b3601 100644
--- a/include/linux/hwmon-sysfs.h
+++ b/include/linux/hwmon-sysfs.h
@@ -33,4 +33,19 @@ struct sensor_device_attribute sensor_dev_attr_##_name = { \
33 .index = _index, \ 33 .index = _index, \
34} 34}
35 35
36struct sensor_device_attribute_2 {
37 struct device_attribute dev_attr;
38 u8 index;
39 u8 nr;
40};
41#define to_sensor_dev_attr_2(_dev_attr) \
42 container_of(_dev_attr, struct sensor_device_attribute_2, dev_attr)
43
44#define SENSOR_DEVICE_ATTR_2(_name,_mode,_show,_store,_nr,_index) \
45struct sensor_device_attribute_2 sensor_dev_attr_##_name = { \
46 .dev_attr = __ATTR(_name,_mode,_show,_store), \
47 .index = _index, \
48 .nr = _nr, \
49}
50
36#endif /* _LINUX_HWMON_SYSFS_H */ 51#endif /* _LINUX_HWMON_SYSFS_H */
diff --git a/include/linux/hwmon-vid.h b/include/linux/hwmon-vid.h
new file mode 100644
index 000000000000..cd4b7a042b86
--- /dev/null
+++ b/include/linux/hwmon-vid.h
@@ -0,0 +1,45 @@
1/*
2 hwmon-vid.h - VID/VRM/VRD voltage conversions
3
4 Originally part of lm_sensors
5 Copyright (c) 2002 Mark D. Studebaker <mdsxyz123@yahoo.com>
6 With assistance from Trent Piepho <xyzzy@speakeasy.org>
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21*/
22
23#ifndef _LINUX_HWMON_VID_H
24#define _LINUX_HWMON_VID_H
25
26int vid_from_reg(int val, int vrm);
27int vid_which_vrm(void);
28
29/* vrm is the VRM/VRD document version multiplied by 10.
30 val is in mV to avoid floating point in the kernel.
31 Returned value is the 4-, 5- or 6-bit VID code.
32 Note that only VRM 9.x is supported for now. */
33static inline int vid_to_reg(int val, int vrm)
34{
35 switch (vrm) {
36 case 91: /* VRM 9.1 */
37 case 90: /* VRM 9.0 */
38 return ((val >= 1100) && (val <= 1850) ?
39 ((18499 - val * 10) / 25 + 5) / 10 : -1);
40 default:
41 return -1;
42 }
43}
44
45#endif /* _LINUX_HWMON_VID_H */
diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h
new file mode 100644
index 000000000000..0efd994c37f1
--- /dev/null
+++ b/include/linux/hwmon.h
@@ -0,0 +1,35 @@
1/*
2 hwmon.h - part of lm_sensors, Linux kernel modules for hardware monitoring
3
4 This file declares helper functions for the sysfs class "hwmon",
5 for use by sensors drivers.
6
7 Copyright (C) 2005 Mark M. Hoffman <mhoffman@lightlink.com>
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; version 2 of the License.
12*/
13
14#ifndef _HWMON_H_
15#define _HWMON_H_
16
17#include <linux/device.h>
18
19struct class_device *hwmon_device_register(struct device *dev);
20
21void hwmon_device_unregister(struct class_device *cdev);
22
23/* Scale user input to sensible values */
24static inline int SENSORS_LIMIT(long value, long low, long high)
25{
26 if (value < low)
27 return low;
28 else if (value > high)
29 return high;
30 else
31 return value;
32}
33
34#endif
35
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index 33f08258f22b..44f30876a1c9 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -1,6 +1,6 @@
1/* ------------------------------------------------------------------------- */ 1/* ------------------------------------------------------------------------- */
2/* */ 2/* */
3/* i2c.h - definitions for the i2c-bus interface */ 3/* i2c-id.h - identifier values for i2c drivers and adapters */
4/* */ 4/* */
5/* ------------------------------------------------------------------------- */ 5/* ------------------------------------------------------------------------- */
6/* Copyright (C) 1995-1999 Simon G. Vogl 6/* Copyright (C) 1995-1999 Simon G. Vogl
@@ -24,16 +24,6 @@
24#define LINUX_I2C_ID_H 24#define LINUX_I2C_ID_H
25 25
26/* 26/*
27 * This file is part of the i2c-bus package and contains the identifier
28 * values for drivers, adapters and other folk populating these serial
29 * worlds.
30 *
31 * These will change often (i.e. additions) , therefore this has been
32 * separated from the functional interface definitions of the i2c api.
33 *
34 */
35
36/*
37 * ---- Driver types ----------------------------------------------------- 27 * ---- Driver types -----------------------------------------------------
38 * device id name + number function description, i2c address(es) 28 * device id name + number function description, i2c address(es)
39 * 29 *
@@ -170,151 +160,113 @@
170 160
171/* 161/*
172 * ---- Adapter types ---------------------------------------------------- 162 * ---- Adapter types ----------------------------------------------------
173 *
174 * First, we distinguish between several algorithms to access the hardware
175 * interface types, as a PCF 8584 needs other care than a bit adapter.
176 */
177
178#define I2C_ALGO_NONE 0x000000
179#define I2C_ALGO_BIT 0x010000 /* bit style adapters */
180#define I2C_ALGO_PCF 0x020000 /* PCF 8584 style adapters */
181#define I2C_ALGO_ATI 0x030000 /* ATI video card */
182#define I2C_ALGO_SMBUS 0x040000
183#define I2C_ALGO_ISA 0x050000 /* lm_sensors ISA pseudo-adapter */
184#define I2C_ALGO_SAA7146 0x060000 /* SAA 7146 video decoder bus */
185#define I2C_ALGO_ACB 0x070000 /* ACCESS.bus algorithm */
186#define I2C_ALGO_IIC 0x080000 /* ITE IIC bus */
187#define I2C_ALGO_SAA7134 0x090000
188#define I2C_ALGO_MPC824X 0x0a0000 /* Motorola 8240 / 8245 */
189#define I2C_ALGO_IPMI 0x0b0000 /* IPMI dummy adapter */
190#define I2C_ALGO_IPMB 0x0c0000 /* IPMB adapter */
191#define I2C_ALGO_MPC107 0x0d0000
192#define I2C_ALGO_EC 0x100000 /* ACPI embedded controller */
193
194#define I2C_ALGO_MPC8XX 0x110000 /* MPC8xx PowerPC I2C algorithm */
195#define I2C_ALGO_OCP 0x120000 /* IBM or otherwise On-chip I2C algorithm */
196#define I2C_ALGO_BITHS 0x130000 /* enhanced bit style adapters */
197#define I2C_ALGO_IOP3XX 0x140000 /* XSCALE IOP3XX On-chip I2C alg */
198#define I2C_ALGO_SIBYTE 0x150000 /* Broadcom SiByte SOCs */
199#define I2C_ALGO_SGI 0x160000 /* SGI algorithm */
200
201#define I2C_ALGO_USB 0x170000 /* USB algorithm */
202#define I2C_ALGO_VIRT 0x180000 /* Virtual bus adapter */
203
204#define I2C_ALGO_MV64XXX 0x190000 /* Marvell mv64xxx i2c ctlr */
205#define I2C_ALGO_PCA 0x1a0000 /* PCA 9564 style adapters */
206#define I2C_ALGO_AU1550 0x1b0000 /* Au1550 PSC algorithm */
207
208#define I2C_ALGO_EXP 0x800000 /* experimental */
209
210#define I2C_ALGO_MASK 0xff0000 /* Mask for algorithms */
211#define I2C_ALGO_SHIFT 0x10 /* right shift to get index values */
212
213#define I2C_HW_ADAPS 0x10000 /* # adapter types */
214#define I2C_HW_MASK 0xffff
215
216
217/* hw specific modules that are defined per algorithm layer
218 */ 163 */
219 164
220/* --- Bit algorithm adapters */ 165/* --- Bit algorithm adapters */
221#define I2C_HW_B_LP 0x00 /* Parallel port Philips style adapter */ 166#define I2C_HW_B_LP 0x010000 /* Parallel port Philips style */
222#define I2C_HW_B_LPC 0x01 /* Parallel port, over control reg. */ 167#define I2C_HW_B_LPC 0x010001 /* Parallel port control reg. */
223#define I2C_HW_B_SER 0x02 /* Serial line interface */ 168#define I2C_HW_B_SER 0x010002 /* Serial line interface */
224#define I2C_HW_B_ELV 0x03 /* ELV Card */ 169#define I2C_HW_B_ELV 0x010003 /* ELV Card */
225#define I2C_HW_B_VELLE 0x04 /* Vellemann K8000 */ 170#define I2C_HW_B_VELLE 0x010004 /* Vellemann K8000 */
226#define I2C_HW_B_BT848 0x05 /* BT848 video boards */ 171#define I2C_HW_B_BT848 0x010005 /* BT848 video boards */
227#define I2C_HW_B_WNV 0x06 /* Winnov Videums */ 172#define I2C_HW_B_WNV 0x010006 /* Winnov Videums */
228#define I2C_HW_B_VIA 0x07 /* Via vt82c586b */ 173#define I2C_HW_B_VIA 0x010007 /* Via vt82c586b */
229#define I2C_HW_B_HYDRA 0x08 /* Apple Hydra Mac I/O */ 174#define I2C_HW_B_HYDRA 0x010008 /* Apple Hydra Mac I/O */
230#define I2C_HW_B_G400 0x09 /* Matrox G400 */ 175#define I2C_HW_B_G400 0x010009 /* Matrox G400 */
231#define I2C_HW_B_I810 0x0a /* Intel I810 */ 176#define I2C_HW_B_I810 0x01000a /* Intel I810 */
232#define I2C_HW_B_VOO 0x0b /* 3dfx Voodoo 3 / Banshee */ 177#define I2C_HW_B_VOO 0x01000b /* 3dfx Voodoo 3 / Banshee */
233#define I2C_HW_B_PPORT 0x0c /* Primitive parallel port adapter */ 178#define I2C_HW_B_PPORT 0x01000c /* Primitive parallel port adapter */
234#define I2C_HW_B_SAVG 0x0d /* Savage 4 */ 179#define I2C_HW_B_SAVG 0x01000d /* Savage 4 */
235#define I2C_HW_B_SCX200 0x0e /* Nat'l Semi SCx200 I2C */ 180#define I2C_HW_B_SCX200 0x01000e /* Nat'l Semi SCx200 I2C */
236#define I2C_HW_B_RIVA 0x10 /* Riva based graphics cards */ 181#define I2C_HW_B_RIVA 0x010010 /* Riva based graphics cards */
237#define I2C_HW_B_IOC 0x11 /* IOC bit-wiggling */ 182#define I2C_HW_B_IOC 0x010011 /* IOC bit-wiggling */
238#define I2C_HW_B_TSUNA 0x12 /* DEC Tsunami chipset */ 183#define I2C_HW_B_TSUNA 0x010012 /* DEC Tsunami chipset */
239#define I2C_HW_B_FRODO 0x13 /* 2d3D, Inc. SA-1110 Development Board */ 184#define I2C_HW_B_FRODO 0x010013 /* 2d3D SA-1110 Development Board */
240#define I2C_HW_B_OMAHA 0x14 /* Omaha I2C interface (ARM) */ 185#define I2C_HW_B_OMAHA 0x010014 /* Omaha I2C interface (ARM) */
241#define I2C_HW_B_GUIDE 0x15 /* Guide bit-basher */ 186#define I2C_HW_B_GUIDE 0x010015 /* Guide bit-basher */
242#define I2C_HW_B_IXP2000 0x16 /* GPIO on IXP2000 systems */ 187#define I2C_HW_B_IXP2000 0x010016 /* GPIO on IXP2000 systems */
243#define I2C_HW_B_IXP4XX 0x17 /* GPIO on IXP4XX systems */ 188#define I2C_HW_B_IXP4XX 0x010017 /* GPIO on IXP4XX systems */
244#define I2C_HW_B_S3VIA 0x18 /* S3Via ProSavage adapter */ 189#define I2C_HW_B_S3VIA 0x010018 /* S3Via ProSavage adapter */
245#define I2C_HW_B_ZR36067 0x19 /* Zoran-36057/36067 based boards */ 190#define I2C_HW_B_ZR36067 0x010019 /* Zoran-36057/36067 based boards */
246#define I2C_HW_B_PCILYNX 0x1a /* TI PCILynx I2C adapter */ 191#define I2C_HW_B_PCILYNX 0x01001a /* TI PCILynx I2C adapter */
247#define I2C_HW_B_CX2388x 0x1b /* connexant 2388x based tv cards */ 192#define I2C_HW_B_CX2388x 0x01001b /* connexant 2388x based tv cards */
193#define I2C_HW_B_NVIDIA 0x01001c /* nvidia framebuffer driver */
194#define I2C_HW_B_SAVAGE 0x01001d /* savage framebuffer driver */
195#define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */
248 196
249/* --- PCF 8584 based algorithms */ 197/* --- PCF 8584 based algorithms */
250#define I2C_HW_P_LP 0x00 /* Parallel port interface */ 198#define I2C_HW_P_LP 0x020000 /* Parallel port interface */
251#define I2C_HW_P_ISA 0x01 /* generic ISA Bus inteface card */ 199#define I2C_HW_P_ISA 0x020001 /* generic ISA Bus inteface card */
252#define I2C_HW_P_ELEK 0x02 /* Elektor ISA Bus inteface card */ 200#define I2C_HW_P_ELEK 0x020002 /* Elektor ISA Bus inteface card */
253 201
254/* --- PCA 9564 based algorithms */ 202/* --- PCA 9564 based algorithms */
255#define I2C_HW_A_ISA 0x00 /* generic ISA Bus interface card */ 203#define I2C_HW_A_ISA 0x1a0000 /* generic ISA Bus interface card */
256 204
257/* --- ACPI Embedded controller algorithms */ 205/* --- ACPI Embedded controller algorithms */
258#define I2C_HW_ACPI_EC 0x00 206#define I2C_HW_ACPI_EC 0x1f0000
259 207
260/* --- MPC824x PowerPC adapters */ 208/* --- MPC824x PowerPC adapters */
261#define I2C_HW_MPC824X 0x00 /* Motorola 8240 / 8245 */ 209#define I2C_HW_MPC824X 0x100001 /* Motorola 8240 / 8245 */
262 210
263/* --- MPC8xx PowerPC adapters */ 211/* --- MPC8xx PowerPC adapters */
264#define I2C_HW_MPC8XX_EPON 0x00 /* Eponymous MPC8xx I2C adapter */ 212#define I2C_HW_MPC8XX_EPON 0x110000 /* Eponymous MPC8xx I2C adapter */
265 213
266/* --- ITE based algorithms */ 214/* --- ITE based algorithms */
267#define I2C_HW_I_IIC 0x00 /* controller on the ITE */ 215#define I2C_HW_I_IIC 0x080000 /* controller on the ITE */
268 216
269/* --- PowerPC on-chip adapters */ 217/* --- PowerPC on-chip adapters */
270#define I2C_HW_OCP 0x00 /* IBM on-chip I2C adapter */ 218#define I2C_HW_OCP 0x120000 /* IBM on-chip I2C adapter */
271 219
272/* --- Broadcom SiByte adapters */ 220/* --- Broadcom SiByte adapters */
273#define I2C_HW_SIBYTE 0x00 221#define I2C_HW_SIBYTE 0x150000
274 222
275/* --- SGI adapters */ 223/* --- SGI adapters */
276#define I2C_HW_SGI_VINO 0x00 224#define I2C_HW_SGI_VINO 0x160000
277#define I2C_HW_SGI_MACE 0x01 225#define I2C_HW_SGI_MACE 0x160001
278 226
279/* --- XSCALE on-chip adapters */ 227/* --- XSCALE on-chip adapters */
280#define I2C_HW_IOP3XX 0x00 228#define I2C_HW_IOP3XX 0x140000
281 229
282/* --- Au1550 PSC adapters adapters */ 230/* --- Au1550 PSC adapters adapters */
283#define I2C_HW_AU1550_PSC 0x00 231#define I2C_HW_AU1550_PSC 0x1b0000
284 232
285/* --- SMBus only adapters */ 233/* --- SMBus only adapters */
286#define I2C_HW_SMBUS_PIIX4 0x00 234#define I2C_HW_SMBUS_PIIX4 0x040000
287#define I2C_HW_SMBUS_ALI15X3 0x01 235#define I2C_HW_SMBUS_ALI15X3 0x040001
288#define I2C_HW_SMBUS_VIA2 0x02 236#define I2C_HW_SMBUS_VIA2 0x040002
289#define I2C_HW_SMBUS_VOODOO3 0x03 237#define I2C_HW_SMBUS_VOODOO3 0x040003
290#define I2C_HW_SMBUS_I801 0x04 238#define I2C_HW_SMBUS_I801 0x040004
291#define I2C_HW_SMBUS_AMD756 0x05 239#define I2C_HW_SMBUS_AMD756 0x040005
292#define I2C_HW_SMBUS_SIS5595 0x06 240#define I2C_HW_SMBUS_SIS5595 0x040006
293#define I2C_HW_SMBUS_ALI1535 0x07 241#define I2C_HW_SMBUS_ALI1535 0x040007
294#define I2C_HW_SMBUS_SIS630 0x08 242#define I2C_HW_SMBUS_SIS630 0x040008
295#define I2C_HW_SMBUS_SIS96X 0x09 243#define I2C_HW_SMBUS_SIS96X 0x040009
296#define I2C_HW_SMBUS_AMD8111 0x0a 244#define I2C_HW_SMBUS_AMD8111 0x04000a
297#define I2C_HW_SMBUS_SCX200 0x0b 245#define I2C_HW_SMBUS_SCX200 0x04000b
298#define I2C_HW_SMBUS_NFORCE2 0x0c 246#define I2C_HW_SMBUS_NFORCE2 0x04000c
299#define I2C_HW_SMBUS_W9968CF 0x0d 247#define I2C_HW_SMBUS_W9968CF 0x04000d
300#define I2C_HW_SMBUS_OV511 0x0e /* OV511(+) USB 1.1 webcam ICs */ 248#define I2C_HW_SMBUS_OV511 0x04000e /* OV511(+) USB 1.1 webcam ICs */
301#define I2C_HW_SMBUS_OV518 0x0f /* OV518(+) USB 1.1 webcam ICs */ 249#define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */
302#define I2C_HW_SMBUS_OV519 0x10 /* OV519 USB 1.1 webcam IC */ 250#define I2C_HW_SMBUS_OV519 0x040010 /* OV519 USB 1.1 webcam IC */
303#define I2C_HW_SMBUS_OVFX2 0x11 /* Cypress/OmniVision FX2 webcam */ 251#define I2C_HW_SMBUS_OVFX2 0x040011 /* Cypress/OmniVision FX2 webcam */
304 252
305/* --- ISA pseudo-adapter */ 253/* --- ISA pseudo-adapter */
306#define I2C_HW_ISA 0x00 254#define I2C_HW_ISA 0x050000
307 255
308/* --- IPMI pseudo-adapter */ 256/* --- IPMI pseudo-adapter */
309#define I2C_HW_IPMI 0x00 257#define I2C_HW_IPMI 0x0b0000
310 258
311/* --- IPMB adapter */ 259/* --- IPMB adapter */
312#define I2C_HW_IPMB 0x00 260#define I2C_HW_IPMB 0x0c0000
313 261
314/* --- MCP107 adapter */ 262/* --- MCP107 adapter */
315#define I2C_HW_MPC107 0x00 263#define I2C_HW_MPC107 0x0d0000
316 264
317/* --- Marvell mv64xxx i2c adapter */ 265/* --- Marvell mv64xxx i2c adapter */
318#define I2C_HW_MV64XXX 0x00 266#define I2C_HW_MV64XXX 0x190000
267
268/* --- Miscellaneous adapters */
269#define I2C_HW_SAA7146 0x060000 /* SAA7146 video decoder bus */
270#define I2C_HW_SAA7134 0x090000 /* SAA7134 video decoder bus */
319 271
320#endif /* LINUX_I2C_ID_H */ 272#endif /* LINUX_I2C_ID_H */
diff --git a/include/linux/i2c-isa.h b/include/linux/i2c-isa.h
new file mode 100644
index 000000000000..67e3598c4cec
--- /dev/null
+++ b/include/linux/i2c-isa.h
@@ -0,0 +1,36 @@
1/*
2 * i2c-isa.h - definitions for the i2c-isa pseudo-i2c-adapter interface
3 *
4 * Copyright (C) 2005 Jean Delvare <khali@linux-fr.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21#ifndef _LINUX_I2C_ISA_H
22#define _LINUX_I2C_ISA_H
23
24#include <linux/i2c.h>
25
26extern int i2c_isa_add_driver(struct i2c_driver *driver);
27extern int i2c_isa_del_driver(struct i2c_driver *driver);
28
29/* Detect whether we are on the isa bus. This is only useful to hybrid
30 (i2c+isa) drivers. */
31#define i2c_is_isa_adapter(adapptr) \
32 ((adapptr)->id == I2C_HW_ISA)
33#define i2c_is_isa_client(clientptr) \
34 i2c_is_isa_adapter((clientptr)->adapter)
35
36#endif /* _LINUX_I2C_ISA_H */
diff --git a/include/linux/i2c-pxa.h b/include/linux/i2c-pxa.h
new file mode 100644
index 000000000000..5f3eaf802223
--- /dev/null
+++ b/include/linux/i2c-pxa.h
@@ -0,0 +1,48 @@
1#ifndef _LINUX_I2C_ALGO_PXA_H
2#define _LINUX_I2C_ALGO_PXA_H
3
4struct i2c_eeprom_emu_watcher {
5 void (*write)(void *, unsigned int addr, unsigned char newval);
6};
7
8struct i2c_eeprom_emu_watch {
9 struct list_head node;
10 unsigned int start;
11 unsigned int end;
12 struct i2c_eeprom_emu_watcher *ops;
13 void *data;
14};
15
16#define I2C_EEPROM_EMU_SIZE (256)
17
18struct i2c_eeprom_emu {
19 unsigned int size;
20 unsigned int ptr;
21 unsigned int seen_start;
22 struct list_head watch;
23
24 unsigned char bytes[I2C_EEPROM_EMU_SIZE];
25};
26
27typedef enum i2c_slave_event_e {
28 I2C_SLAVE_EVENT_START_READ,
29 I2C_SLAVE_EVENT_START_WRITE,
30 I2C_SLAVE_EVENT_STOP
31} i2c_slave_event_t;
32
33struct i2c_slave_client {
34 void *data;
35 void (*event)(void *ptr, i2c_slave_event_t event);
36 int (*read) (void *ptr);
37 void (*write)(void *ptr, unsigned int val);
38};
39
40extern int i2c_eeprom_emu_addwatcher(struct i2c_eeprom_emu *, void *data,
41 unsigned int addr, unsigned int size,
42 struct i2c_eeprom_emu_watcher *);
43
44extern void i2c_eeprom_emu_delwatcher(struct i2c_eeprom_emu *, void *data, struct i2c_eeprom_emu_watcher *watcher);
45
46extern struct i2c_eeprom_emu *i2c_pxa_get_eeprom(void);
47
48#endif /* _LINUX_I2C_ALGO_PXA_H */
diff --git a/include/linux/i2c-sensor.h b/include/linux/i2c-sensor.h
deleted file mode 100644
index 21b625204956..000000000000
--- a/include/linux/i2c-sensor.h
+++ /dev/null
@@ -1,263 +0,0 @@
1/*
2 i2c-sensor.h - Part of the i2c package
3 was originally sensors.h - Part of lm_sensors, Linux kernel modules
4 for hardware monitoring
5 Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20*/
21
22#ifndef _LINUX_I2C_SENSOR_H
23#define _LINUX_I2C_SENSOR_H
24
25/* A structure containing detect information.
26 Force variables overrule all other variables; they force a detection on
27 that place. If a specific chip is given, the module blindly assumes this
28 chip type is present; if a general force (kind == 0) is given, the module
29 will still try to figure out what type of chip is present. This is useful
30 if for some reasons the detect for SMBus or ISA address space filled
31 fails.
32 probe: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END values.
33 A list of pairs. The first value is a bus number (ANY_I2C_ISA_BUS for
34 the ISA bus, -1 for any I2C bus), the second is the address.
35 kind: The kind of chip. 0 equals any chip.
36*/
37struct i2c_force_data {
38 unsigned short *force;
39 unsigned short kind;
40};
41
42/* A structure containing the detect information.
43 normal_i2c: filled in by the module writer. Terminated by I2C_CLIENT_ISA_END.
44 A list of I2C addresses which should normally be examined.
45 normal_isa: filled in by the module writer. Terminated by SENSORS_ISA_END.
46 A list of ISA addresses which should normally be examined.
47 probe: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END values.
48 A list of pairs. The first value is a bus number (ANY_I2C_ISA_BUS for
49 the ISA bus, -1 for any I2C bus), the second is the address. These
50 addresses are also probed, as if they were in the 'normal' list.
51 ignore: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END values.
52 A list of pairs. The first value is a bus number (ANY_I2C_ISA_BUS for
53 the ISA bus, -1 for any I2C bus), the second is the I2C address. These
54 addresses are never probed. This parameter overrules 'normal' and
55 'probe', but not the 'force' lists.
56 force_data: insmod parameters. A list, ending with an element of which
57 the force field is NULL.
58*/
59struct i2c_address_data {
60 unsigned short *normal_i2c;
61 unsigned int *normal_isa;
62 unsigned short *probe;
63 unsigned short *ignore;
64 struct i2c_force_data *forces;
65};
66
67#define SENSORS_MODULE_PARM_FORCE(name) \
68 I2C_CLIENT_MODULE_PARM(force_ ## name, \
69 "List of adapter,address pairs which are unquestionably" \
70 " assumed to contain a `" # name "' chip")
71
72
73/* This defines several insmod variables, and the addr_data structure */
74#define SENSORS_INSMOD \
75 I2C_CLIENT_MODULE_PARM(probe, \
76 "List of adapter,address pairs to scan additionally"); \
77 I2C_CLIENT_MODULE_PARM(ignore, \
78 "List of adapter,address pairs not to scan"); \
79 static struct i2c_address_data addr_data = { \
80 .normal_i2c = normal_i2c, \
81 .normal_isa = normal_isa, \
82 .probe = probe, \
83 .ignore = ignore, \
84 .forces = forces, \
85 }
86
87/* The following functions create an enum with the chip names as elements.
88 The first element of the enum is any_chip. These are the only macros
89 a module will want to use. */
90
91#define SENSORS_INSMOD_0 \
92 enum chips { any_chip }; \
93 I2C_CLIENT_MODULE_PARM(force, \
94 "List of adapter,address pairs to boldly assume " \
95 "to be present"); \
96 static struct i2c_force_data forces[] = {{force,any_chip},{NULL}}; \
97 SENSORS_INSMOD
98
99#define SENSORS_INSMOD_1(chip1) \
100 enum chips { any_chip, chip1 }; \
101 I2C_CLIENT_MODULE_PARM(force, \
102 "List of adapter,address pairs to boldly assume " \
103 "to be present"); \
104 SENSORS_MODULE_PARM_FORCE(chip1); \
105 static struct i2c_force_data forces[] = {{force,any_chip},\
106 {force_ ## chip1,chip1}, \
107 {NULL}}; \
108 SENSORS_INSMOD
109
110#define SENSORS_INSMOD_2(chip1,chip2) \
111 enum chips { any_chip, chip1, chip2 }; \
112 I2C_CLIENT_MODULE_PARM(force, \
113 "List of adapter,address pairs to boldly assume " \
114 "to be present"); \
115 SENSORS_MODULE_PARM_FORCE(chip1); \
116 SENSORS_MODULE_PARM_FORCE(chip2); \
117 static struct i2c_force_data forces[] = {{force,any_chip}, \
118 {force_ ## chip1,chip1}, \
119 {force_ ## chip2,chip2}, \
120 {NULL}}; \
121 SENSORS_INSMOD
122
123#define SENSORS_INSMOD_3(chip1,chip2,chip3) \
124 enum chips { any_chip, chip1, chip2, chip3 }; \
125 I2C_CLIENT_MODULE_PARM(force, \
126 "List of adapter,address pairs to boldly assume " \
127 "to be present"); \
128 SENSORS_MODULE_PARM_FORCE(chip1); \
129 SENSORS_MODULE_PARM_FORCE(chip2); \
130 SENSORS_MODULE_PARM_FORCE(chip3); \
131 static struct i2c_force_data forces[] = {{force,any_chip}, \
132 {force_ ## chip1,chip1}, \
133 {force_ ## chip2,chip2}, \
134 {force_ ## chip3,chip3}, \
135 {NULL}}; \
136 SENSORS_INSMOD
137
138#define SENSORS_INSMOD_4(chip1,chip2,chip3,chip4) \
139 enum chips { any_chip, chip1, chip2, chip3, chip4 }; \
140 I2C_CLIENT_MODULE_PARM(force, \
141 "List of adapter,address pairs to boldly assume " \
142 "to be present"); \
143 SENSORS_MODULE_PARM_FORCE(chip1); \
144 SENSORS_MODULE_PARM_FORCE(chip2); \
145 SENSORS_MODULE_PARM_FORCE(chip3); \
146 SENSORS_MODULE_PARM_FORCE(chip4); \
147 static struct i2c_force_data forces[] = {{force,any_chip}, \
148 {force_ ## chip1,chip1}, \
149 {force_ ## chip2,chip2}, \
150 {force_ ## chip3,chip3}, \
151 {force_ ## chip4,chip4}, \
152 {NULL}}; \
153 SENSORS_INSMOD
154
155#define SENSORS_INSMOD_5(chip1,chip2,chip3,chip4,chip5) \
156 enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \
157 I2C_CLIENT_MODULE_PARM(force, \
158 "List of adapter,address pairs to boldly assume " \
159 "to be present"); \
160 SENSORS_MODULE_PARM_FORCE(chip1); \
161 SENSORS_MODULE_PARM_FORCE(chip2); \
162 SENSORS_MODULE_PARM_FORCE(chip3); \
163 SENSORS_MODULE_PARM_FORCE(chip4); \
164 SENSORS_MODULE_PARM_FORCE(chip5); \
165 static struct i2c_force_data forces[] = {{force,any_chip}, \
166 {force_ ## chip1,chip1}, \
167 {force_ ## chip2,chip2}, \
168 {force_ ## chip3,chip3}, \
169 {force_ ## chip4,chip4}, \
170 {force_ ## chip5,chip5}, \
171 {NULL}}; \
172 SENSORS_INSMOD
173
174#define SENSORS_INSMOD_6(chip1,chip2,chip3,chip4,chip5,chip6) \
175 enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \
176 I2C_CLIENT_MODULE_PARM(force, \
177 "List of adapter,address pairs to boldly assume " \
178 "to be present"); \
179 SENSORS_MODULE_PARM_FORCE(chip1); \
180 SENSORS_MODULE_PARM_FORCE(chip2); \
181 SENSORS_MODULE_PARM_FORCE(chip3); \
182 SENSORS_MODULE_PARM_FORCE(chip4); \
183 SENSORS_MODULE_PARM_FORCE(chip5); \
184 SENSORS_MODULE_PARM_FORCE(chip6); \
185 static struct i2c_force_data forces[] = {{force,any_chip}, \
186 {force_ ## chip1,chip1}, \
187 {force_ ## chip2,chip2}, \
188 {force_ ## chip3,chip3}, \
189 {force_ ## chip4,chip4}, \
190 {force_ ## chip5,chip5}, \
191 {force_ ## chip6,chip6}, \
192 {NULL}}; \
193 SENSORS_INSMOD
194
195#define SENSORS_INSMOD_7(chip1,chip2,chip3,chip4,chip5,chip6,chip7) \
196 enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, chip7 }; \
197 I2C_CLIENT_MODULE_PARM(force, \
198 "List of adapter,address pairs to boldly assume " \
199 "to be present"); \
200 SENSORS_MODULE_PARM_FORCE(chip1); \
201 SENSORS_MODULE_PARM_FORCE(chip2); \
202 SENSORS_MODULE_PARM_FORCE(chip3); \
203 SENSORS_MODULE_PARM_FORCE(chip4); \
204 SENSORS_MODULE_PARM_FORCE(chip5); \
205 SENSORS_MODULE_PARM_FORCE(chip6); \
206 SENSORS_MODULE_PARM_FORCE(chip7); \
207 static struct i2c_force_data forces[] = {{force,any_chip}, \
208 {force_ ## chip1,chip1}, \
209 {force_ ## chip2,chip2}, \
210 {force_ ## chip3,chip3}, \
211 {force_ ## chip4,chip4}, \
212 {force_ ## chip5,chip5}, \
213 {force_ ## chip6,chip6}, \
214 {force_ ## chip7,chip7}, \
215 {NULL}}; \
216 SENSORS_INSMOD
217
218#define SENSORS_INSMOD_8(chip1,chip2,chip3,chip4,chip5,chip6,chip7,chip8) \
219 enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8 }; \
220 I2C_CLIENT_MODULE_PARM(force, \
221 "List of adapter,address pairs to boldly assume " \
222 "to be present"); \
223 SENSORS_MODULE_PARM_FORCE(chip1); \
224 SENSORS_MODULE_PARM_FORCE(chip2); \
225 SENSORS_MODULE_PARM_FORCE(chip3); \
226 SENSORS_MODULE_PARM_FORCE(chip4); \
227 SENSORS_MODULE_PARM_FORCE(chip5); \
228 SENSORS_MODULE_PARM_FORCE(chip6); \
229 SENSORS_MODULE_PARM_FORCE(chip7); \
230 SENSORS_MODULE_PARM_FORCE(chip8); \
231 static struct i2c_force_data forces[] = {{force,any_chip}, \
232 {force_ ## chip1,chip1}, \
233 {force_ ## chip2,chip2}, \
234 {force_ ## chip3,chip3}, \
235 {force_ ## chip4,chip4}, \
236 {force_ ## chip5,chip5}, \
237 {force_ ## chip6,chip6}, \
238 {force_ ## chip7,chip7}, \
239 {force_ ## chip8,chip8}, \
240 {NULL}}; \
241 SENSORS_INSMOD
242
243/* Detect function. It iterates over all possible addresses itself. For
244 SMBus addresses, it will only call found_proc if some client is connected
245 to the SMBus (unless a 'force' matched); for ISA detections, this is not
246 done. */
247extern int i2c_detect(struct i2c_adapter *adapter,
248 struct i2c_address_data *address_data,
249 int (*found_proc) (struct i2c_adapter *, int, int));
250
251
252/* This macro is used to scale user-input to sensible values in almost all
253 chip drivers. */
254static inline int SENSORS_LIMIT(long value, long low, long high)
255{
256 if (value < low)
257 return low;
258 else if (value > high)
259 return high;
260 else
261 return value;
262}
263#endif /* def _LINUX_I2C_SENSOR_H */
diff --git a/include/linux/i2c-vid.h b/include/linux/i2c-vid.h
deleted file mode 100644
index 41d0635e0ba9..000000000000
--- a/include/linux/i2c-vid.h
+++ /dev/null
@@ -1,111 +0,0 @@
1/*
2 i2c-vid.h - Part of lm_sensors, Linux kernel modules for hardware
3 monitoring
4 Copyright (c) 2002 Mark D. Studebaker <mdsxyz123@yahoo.com>
5 With assistance from Trent Piepho <xyzzy@speakeasy.org>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20*/
21
22/*
23 This file contains common code for decoding VID pins.
24 This file is #included in various chip drivers in this directory.
25 As the user is unlikely to load more than one driver which
26 includes this code we don't worry about the wasted space.
27 Reference: VRM x.y DC-DC Converter Design Guidelines,
28 available at http://developer.intel.com
29*/
30
31/*
32 AMD Opteron processors don't follow the Intel VRM spec.
33 I'm going to "make up" 2.4 as the VRM spec for the Opterons.
34 No good reason just a mnemonic for the 24x Opteron processor
35 series
36
37 Opteron VID encoding is:
38
39 00000 = 1.550 V
40 00001 = 1.525 V
41 . . . .
42 11110 = 0.800 V
43 11111 = 0.000 V (off)
44 */
45
46/*
47 Legal val values 0x00 - 0x1f; except for VRD 10.0, 0x00 - 0x3f.
48 vrm is the Intel VRM document version.
49 Note: vrm version is scaled by 10 and the return value is scaled by 1000
50 to avoid floating point in the kernel.
51*/
52
53int i2c_which_vrm(void);
54
55#define DEFAULT_VRM 82
56
57static inline int vid_from_reg(int val, int vrm)
58{
59 int vid;
60
61 switch(vrm) {
62
63 case 0:
64 return 0;
65
66 case 100: /* VRD 10.0 */
67 if((val & 0x1f) == 0x1f)
68 return 0;
69 if((val & 0x1f) <= 0x09 || val == 0x0a)
70 vid = 10875 - (val & 0x1f) * 250;
71 else
72 vid = 18625 - (val & 0x1f) * 250;
73 if(val & 0x20)
74 vid -= 125;
75 vid /= 10; /* only return 3 dec. places for now */
76 return vid;
77
78 case 24: /* Opteron processor */
79 return(val == 0x1f ? 0 : 1550 - val * 25);
80
81 case 91: /* VRM 9.1 */
82 case 90: /* VRM 9.0 */
83 return(val == 0x1f ? 0 :
84 1850 - val * 25);
85
86 case 85: /* VRM 8.5 */
87 return((val & 0x10 ? 25 : 0) +
88 ((val & 0x0f) > 0x04 ? 2050 : 1250) -
89 ((val & 0x0f) * 50));
90
91 case 84: /* VRM 8.4 */
92 val &= 0x0f;
93 /* fall through */
94 default: /* VRM 8.2 */
95 return(val == 0x1f ? 0 :
96 val & 0x10 ? 5100 - (val) * 100 :
97 2050 - (val) * 50);
98 }
99}
100
101static inline int vid_to_reg(int val, int vrm)
102{
103 switch (vrm) {
104 case 91: /* VRM 9.1 */
105 case 90: /* VRM 9.0 */
106 return ((val >= 1100) && (val <= 1850) ?
107 ((18499 - val * 10) / 25 + 5) / 10 : -1);
108 default:
109 return -1;
110 }
111}
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index be837b13f297..be35332b67e6 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -34,6 +34,13 @@
34#include <linux/device.h> /* for struct device */ 34#include <linux/device.h> /* for struct device */
35#include <asm/semaphore.h> 35#include <asm/semaphore.h>
36 36
37/* --- For i2c-isa ---------------------------------------------------- */
38
39extern void i2c_adapter_dev_release(struct device *dev);
40extern struct device_driver i2c_adapter_driver;
41extern struct class i2c_adapter_class;
42extern struct bus_type i2c_bus_type;
43
37/* --- General options ------------------------------------------------ */ 44/* --- General options ------------------------------------------------ */
38 45
39struct i2c_msg; 46struct i2c_msg;
@@ -41,7 +48,6 @@ struct i2c_algorithm;
41struct i2c_adapter; 48struct i2c_adapter;
42struct i2c_client; 49struct i2c_client;
43struct i2c_driver; 50struct i2c_driver;
44struct i2c_client_address_data;
45union i2c_smbus_data; 51union i2c_smbus_data;
46 52
47/* 53/*
@@ -143,12 +149,9 @@ struct i2c_driver {
143 */ 149 */
144struct i2c_client { 150struct i2c_client {
145 unsigned int flags; /* div., see below */ 151 unsigned int flags; /* div., see below */
146 unsigned int addr; /* chip address - NOTE: 7bit */ 152 unsigned short addr; /* chip address - NOTE: 7bit */
147 /* addresses are stored in the */ 153 /* addresses are stored in the */
148 /* _LOWER_ 7 bits of this char */ 154 /* _LOWER_ 7 bits */
149 /* addr: unsigned int to make lm_sensors i2c-isa adapter work
150 more cleanly. It does not take any more memory space, due to
151 alignment considerations */
152 struct i2c_adapter *adapter; /* the adapter we sit on */ 155 struct i2c_adapter *adapter; /* the adapter we sit on */
153 struct i2c_driver *driver; /* and our access routines */ 156 struct i2c_driver *driver; /* and our access routines */
154 int usage_count; /* How many accesses currently */ 157 int usage_count; /* How many accesses currently */
@@ -160,6 +163,11 @@ struct i2c_client {
160}; 163};
161#define to_i2c_client(d) container_of(d, struct i2c_client, dev) 164#define to_i2c_client(d) container_of(d, struct i2c_client, dev)
162 165
166static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj)
167{
168 return to_i2c_client(container_of(kobj, struct device, kobj));
169}
170
163static inline void *i2c_get_clientdata (struct i2c_client *dev) 171static inline void *i2c_get_clientdata (struct i2c_client *dev)
164{ 172{
165 return dev_get_drvdata (&dev->dev); 173 return dev_get_drvdata (&dev->dev);
@@ -170,13 +178,6 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data)
170 dev_set_drvdata (&dev->dev, data); 178 dev_set_drvdata (&dev->dev, data);
171} 179}
172 180
173#define I2C_DEVNAME(str) .name = str
174
175static inline char *i2c_clientname(struct i2c_client *c)
176{
177 return &c->name[0];
178}
179
180/* 181/*
181 * The following structs are for those who like to implement new bus drivers: 182 * The following structs are for those who like to implement new bus drivers:
182 * i2c_algorithm is the interface to a class of hardware solutions which can 183 * i2c_algorithm is the interface to a class of hardware solutions which can
@@ -184,9 +185,6 @@ static inline char *i2c_clientname(struct i2c_client *c)
184 * to name two of the most common. 185 * to name two of the most common.
185 */ 186 */
186struct i2c_algorithm { 187struct i2c_algorithm {
187 char name[32]; /* textual description */
188 unsigned int id;
189
190 /* If an adapter algorithm can't do I2C-level access, set master_xfer 188 /* If an adapter algorithm can't do I2C-level access, set master_xfer
191 to NULL. If an adapter algorithm can do SMBus access, set 189 to NULL. If an adapter algorithm can do SMBus access, set
192 smbus_xfer. If set to NULL, the SMBus protocol is simulated 190 smbus_xfer. If set to NULL, the SMBus protocol is simulated
@@ -214,8 +212,7 @@ struct i2c_algorithm {
214 */ 212 */
215struct i2c_adapter { 213struct i2c_adapter {
216 struct module *owner; 214 struct module *owner;
217 unsigned int id;/* == is algo->id | hwdep.struct->id, */ 215 unsigned int id;
218 /* for registered values see below */
219 unsigned int class; 216 unsigned int class;
220 struct i2c_algorithm *algo;/* the algorithm to access the bus */ 217 struct i2c_algorithm *algo;/* the algorithm to access the bus */
221 void *algo_data; 218 void *algo_data;
@@ -292,12 +289,11 @@ struct i2c_client_address_data {
292 unsigned short *normal_i2c; 289 unsigned short *normal_i2c;
293 unsigned short *probe; 290 unsigned short *probe;
294 unsigned short *ignore; 291 unsigned short *ignore;
295 unsigned short *force; 292 unsigned short **forces;
296}; 293};
297 294
298/* Internal numbers to terminate lists */ 295/* Internal numbers to terminate lists */
299#define I2C_CLIENT_END 0xfffeU 296#define I2C_CLIENT_END 0xfffeU
300#define I2C_CLIENT_ISA_END 0xfffefffeU
301 297
302/* The numbers to use to set I2C bus address */ 298/* The numbers to use to set I2C bus address */
303#define ANY_I2C_BUS 0xffff 299#define ANY_I2C_BUS 0xffff
@@ -356,10 +352,6 @@ extern int i2c_probe(struct i2c_adapter *adapter,
356 */ 352 */
357extern int i2c_control(struct i2c_client *,unsigned int, unsigned long); 353extern int i2c_control(struct i2c_client *,unsigned int, unsigned long);
358 354
359/* This call returns a unique low identifier for each registered adapter,
360 * or -1 if the adapter was not registered.
361 */
362extern int i2c_adapter_id(struct i2c_adapter *adap);
363extern struct i2c_adapter* i2c_get_adapter(int id); 355extern struct i2c_adapter* i2c_get_adapter(int id);
364extern void i2c_put_adapter(struct i2c_adapter *adap); 356extern void i2c_put_adapter(struct i2c_adapter *adap);
365 357
@@ -376,6 +368,12 @@ static inline int i2c_check_functionality(struct i2c_adapter *adap, u32 func)
376 return (func & i2c_get_functionality(adap)) == func; 368 return (func & i2c_get_functionality(adap)) == func;
377} 369}
378 370
371/* Return id number for a specific adapter */
372static inline int i2c_adapter_id(struct i2c_adapter *adap)
373{
374 return adap->nr;
375}
376
379/* 377/*
380 * I2C Message - used for pure i2c transaction, also from /dev interface 378 * I2C Message - used for pure i2c transaction, also from /dev interface
381 */ 379 */
@@ -510,9 +508,6 @@ union i2c_smbus_data {
510#define I2C_FUNCS 0x0705 /* Get the adapter functionality */ 508#define I2C_FUNCS 0x0705 /* Get the adapter functionality */
511#define I2C_RDWR 0x0707 /* Combined R/W transfer (one stop only)*/ 509#define I2C_RDWR 0x0707 /* Combined R/W transfer (one stop only)*/
512#define I2C_PEC 0x0708 /* != 0 for SMBus PEC */ 510#define I2C_PEC 0x0708 /* != 0 for SMBus PEC */
513#if 0
514#define I2C_ACK_TEST 0x0710 /* See if a slave is at a specific address */
515#endif
516 511
517#define I2C_SMBUS 0x0720 /* SMBus-level access */ 512#define I2C_SMBUS 0x0720 /* SMBus-level access */
518 513
@@ -556,27 +551,148 @@ union i2c_smbus_data {
556 module_param_array(var, short, &var##_num, 0); \ 551 module_param_array(var, short, &var##_num, 0); \
557 MODULE_PARM_DESC(var,desc) 552 MODULE_PARM_DESC(var,desc)
558 553
559/* This is the one you want to use in your own modules */ 554#define I2C_CLIENT_MODULE_PARM_FORCE(name) \
555I2C_CLIENT_MODULE_PARM(force_##name, \
556 "List of adapter,address pairs which are " \
557 "unquestionably assumed to contain a `" \
558 # name "' chip")
559
560
561#define I2C_CLIENT_INSMOD_COMMON \
562I2C_CLIENT_MODULE_PARM(probe, "List of adapter,address pairs to scan " \
563 "additionally"); \
564I2C_CLIENT_MODULE_PARM(ignore, "List of adapter,address pairs not to " \
565 "scan"); \
566static struct i2c_client_address_data addr_data = { \
567 .normal_i2c = normal_i2c, \
568 .probe = probe, \
569 .ignore = ignore, \
570 .forces = forces, \
571}
572
573/* These are the ones you want to use in your own drivers. Pick the one
574 which matches the number of devices the driver differenciates between. */
560#define I2C_CLIENT_INSMOD \ 575#define I2C_CLIENT_INSMOD \
561 I2C_CLIENT_MODULE_PARM(probe, \
562 "List of adapter,address pairs to scan additionally"); \
563 I2C_CLIENT_MODULE_PARM(ignore, \
564 "List of adapter,address pairs not to scan"); \
565 I2C_CLIENT_MODULE_PARM(force, \ 576 I2C_CLIENT_MODULE_PARM(force, \
566 "List of adapter,address pairs to boldly assume " \ 577 "List of adapter,address pairs to boldly assume " \
567 "to be present"); \ 578 "to be present"); \
568 static struct i2c_client_address_data addr_data = { \ 579 static unsigned short *forces[] = { \
569 .normal_i2c = normal_i2c, \ 580 force, \
570 .probe = probe, \ 581 NULL \
571 .ignore = ignore, \ 582 }; \
572 .force = force, \ 583I2C_CLIENT_INSMOD_COMMON
573 } 584
574 585#define I2C_CLIENT_INSMOD_1(chip1) \
575/* Detect whether we are on the isa bus. If this returns true, all i2c 586enum chips { any_chip, chip1 }; \
576 access will fail! */ 587I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \
577#define i2c_is_isa_client(clientptr) \ 588 "boldly assume to be present"); \
578 ((clientptr)->adapter->algo->id == I2C_ALGO_ISA) 589I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
579#define i2c_is_isa_adapter(adapptr) \ 590static unsigned short *forces[] = { force, force_##chip1, NULL }; \
580 ((adapptr)->algo->id == I2C_ALGO_ISA) 591I2C_CLIENT_INSMOD_COMMON
592
593#define I2C_CLIENT_INSMOD_2(chip1, chip2) \
594enum chips { any_chip, chip1, chip2 }; \
595I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \
596 "boldly assume to be present"); \
597I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
598I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
599static unsigned short *forces[] = { force, force_##chip1, \
600 force_##chip2, NULL }; \
601I2C_CLIENT_INSMOD_COMMON
602
603#define I2C_CLIENT_INSMOD_3(chip1, chip2, chip3) \
604enum chips { any_chip, chip1, chip2, chip3 }; \
605I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \
606 "boldly assume to be present"); \
607I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
608I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
609I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
610static unsigned short *forces[] = { force, force_##chip1, \
611 force_##chip2, force_##chip3, \
612 NULL }; \
613I2C_CLIENT_INSMOD_COMMON
614
615#define I2C_CLIENT_INSMOD_4(chip1, chip2, chip3, chip4) \
616enum chips { any_chip, chip1, chip2, chip3, chip4 }; \
617I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \
618 "boldly assume to be present"); \
619I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
620I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
621I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
622I2C_CLIENT_MODULE_PARM_FORCE(chip4); \
623static unsigned short *forces[] = { force, force_##chip1, \
624 force_##chip2, force_##chip3, \
625 force_##chip4, NULL}; \
626I2C_CLIENT_INSMOD_COMMON
627
628#define I2C_CLIENT_INSMOD_5(chip1, chip2, chip3, chip4, chip5) \
629enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \
630I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \
631 "boldly assume to be present"); \
632I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
633I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
634I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
635I2C_CLIENT_MODULE_PARM_FORCE(chip4); \
636I2C_CLIENT_MODULE_PARM_FORCE(chip5); \
637static unsigned short *forces[] = { force, force_##chip1, \
638 force_##chip2, force_##chip3, \
639 force_##chip4, force_##chip5, \
640 NULL }; \
641I2C_CLIENT_INSMOD_COMMON
642
643#define I2C_CLIENT_INSMOD_6(chip1, chip2, chip3, chip4, chip5, chip6) \
644enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \
645I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \
646 "boldly assume to be present"); \
647I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
648I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
649I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
650I2C_CLIENT_MODULE_PARM_FORCE(chip4); \
651I2C_CLIENT_MODULE_PARM_FORCE(chip5); \
652I2C_CLIENT_MODULE_PARM_FORCE(chip6); \
653static unsigned short *forces[] = { force, force_##chip1, \
654 force_##chip2, force_##chip3, \
655 force_##chip4, force_##chip5, \
656 force_##chip6, NULL }; \
657I2C_CLIENT_INSMOD_COMMON
658
659#define I2C_CLIENT_INSMOD_7(chip1, chip2, chip3, chip4, chip5, chip6, chip7) \
660enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \
661 chip7 }; \
662I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \
663 "boldly assume to be present"); \
664I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
665I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
666I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
667I2C_CLIENT_MODULE_PARM_FORCE(chip4); \
668I2C_CLIENT_MODULE_PARM_FORCE(chip5); \
669I2C_CLIENT_MODULE_PARM_FORCE(chip6); \
670I2C_CLIENT_MODULE_PARM_FORCE(chip7); \
671static unsigned short *forces[] = { force, force_##chip1, \
672 force_##chip2, force_##chip3, \
673 force_##chip4, force_##chip5, \
674 force_##chip6, force_##chip7, \
675 NULL }; \
676I2C_CLIENT_INSMOD_COMMON
677
678#define I2C_CLIENT_INSMOD_8(chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8) \
679enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \
680 chip7, chip8 }; \
681I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \
682 "boldly assume to be present"); \
683I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
684I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
685I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
686I2C_CLIENT_MODULE_PARM_FORCE(chip4); \
687I2C_CLIENT_MODULE_PARM_FORCE(chip5); \
688I2C_CLIENT_MODULE_PARM_FORCE(chip6); \
689I2C_CLIENT_MODULE_PARM_FORCE(chip7); \
690I2C_CLIENT_MODULE_PARM_FORCE(chip8); \
691static unsigned short *forces[] = { force, force_##chip1, \
692 force_##chip2, force_##chip3, \
693 force_##chip4, force_##chip5, \
694 force_##chip6, force_##chip7, \
695 force_##chip8, NULL }; \
696I2C_CLIENT_INSMOD_COMMON
581 697
582#endif /* _LINUX_I2C_H */ 698#endif /* _LINUX_I2C_H */
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h
index 096a85a58ae5..88aef7b86ef4 100644
--- a/include/linux/if_tun.h
+++ b/include/linux/if_tun.h
@@ -77,6 +77,7 @@ struct tun_struct {
77#define TUNSETIFF _IOW('T', 202, int) 77#define TUNSETIFF _IOW('T', 202, int)
78#define TUNSETPERSIST _IOW('T', 203, int) 78#define TUNSETPERSIST _IOW('T', 203, int)
79#define TUNSETOWNER _IOW('T', 204, int) 79#define TUNSETOWNER _IOW('T', 204, int)
80#define TUNSETLINK _IOW('T', 205, int)
80 81
81/* TUNSETIFF ifr flags */ 82/* TUNSETIFF ifr flags */
82#define IFF_TUN 0x0001 83#define IFF_TUN 0x0001
diff --git a/include/linux/in6.h b/include/linux/in6.h
index dcf5720ffcbb..bd32b79d6295 100644
--- a/include/linux/in6.h
+++ b/include/linux/in6.h
@@ -148,13 +148,13 @@ struct in6_flowlabel_req
148 */ 148 */
149 149
150#define IPV6_ADDRFORM 1 150#define IPV6_ADDRFORM 1
151#define IPV6_PKTINFO 2 151#define IPV6_2292PKTINFO 2
152#define IPV6_HOPOPTS 3 152#define IPV6_2292HOPOPTS 3
153#define IPV6_DSTOPTS 4 153#define IPV6_2292DSTOPTS 4
154#define IPV6_RTHDR 5 154#define IPV6_2292RTHDR 5
155#define IPV6_PKTOPTIONS 6 155#define IPV6_2292PKTOPTIONS 6
156#define IPV6_CHECKSUM 7 156#define IPV6_CHECKSUM 7
157#define IPV6_HOPLIMIT 8 157#define IPV6_2292HOPLIMIT 8
158#define IPV6_NEXTHOP 9 158#define IPV6_NEXTHOP 9
159#define IPV6_AUTHHDR 10 /* obsolete */ 159#define IPV6_AUTHHDR 10 /* obsolete */
160#define IPV6_FLOWINFO 11 160#define IPV6_FLOWINFO 11
@@ -198,4 +198,28 @@ struct in6_flowlabel_req
198 * MCAST_MSFILTER 48 198 * MCAST_MSFILTER 48
199 */ 199 */
200 200
201/* RFC3542 advanced socket options (50-67) */
202#define IPV6_RECVPKTINFO 50
203#define IPV6_PKTINFO 51
204#if 0
205#define IPV6_RECVPATHMTU 52
206#define IPV6_PATHMTU 53
207#define IPV6_DONTFRAG 54
208#define IPV6_USE_MIN_MTU 55
209#endif
210#define IPV6_RECVHOPOPTS 56
211#define IPV6_HOPOPTS 57
212#if 0
213#define IPV6_RECVRTHDRDSTOPTS 58 /* Unused, see net/ipv6/datagram.c */
214#endif
215#define IPV6_RTHDRDSTOPTS 59
216#define IPV6_RECVRTHDR 60
217#define IPV6_RTHDR 61
218#define IPV6_RECVDSTOPTS 62
219#define IPV6_DSTOPTS 63
220#define IPV6_RECVHOPLIMIT 64
221#define IPV6_HOPLIMIT 65
222#define IPV6_RECVTCLASS 66
223#define IPV6_TCLASS 67
224
201#endif 225#endif
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index c727c195a91a..68ab5f2ab9cd 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -2,17 +2,27 @@
2#define _LINUX__INIT_TASK_H 2#define _LINUX__INIT_TASK_H
3 3
4#include <linux/file.h> 4#include <linux/file.h>
5#include <linux/rcupdate.h>
5 6
6#define INIT_FILES \ 7#define INIT_FDTABLE \
7{ \ 8{ \
8 .count = ATOMIC_INIT(1), \
9 .file_lock = SPIN_LOCK_UNLOCKED, \
10 .max_fds = NR_OPEN_DEFAULT, \ 9 .max_fds = NR_OPEN_DEFAULT, \
11 .max_fdset = __FD_SETSIZE, \ 10 .max_fdset = __FD_SETSIZE, \
12 .next_fd = 0, \ 11 .next_fd = 0, \
13 .fd = &init_files.fd_array[0], \ 12 .fd = &init_files.fd_array[0], \
14 .close_on_exec = &init_files.close_on_exec_init, \ 13 .close_on_exec = &init_files.close_on_exec_init, \
15 .open_fds = &init_files.open_fds_init, \ 14 .open_fds = &init_files.open_fds_init, \
15 .rcu = RCU_HEAD_INIT, \
16 .free_files = NULL, \
17 .next = NULL, \
18}
19
20#define INIT_FILES \
21{ \
22 .count = ATOMIC_INIT(1), \
23 .file_lock = SPIN_LOCK_UNLOCKED, \
24 .fdt = &init_files.fdtab, \
25 .fdtab = INIT_FDTABLE, \
16 .close_on_exec_init = { { 0, } }, \ 26 .close_on_exec_init = { { 0, } }, \
17 .open_fds_init = { { 0, } }, \ 27 .open_fds_init = { { 0, } }, \
18 .fd_array = { NULL, } \ 28 .fd_array = { NULL, } \
diff --git a/include/linux/inotify.h b/include/linux/inotify.h
index 93bb3afe646b..ee5b239092ed 100644
--- a/include/linux/inotify.h
+++ b/include/linux/inotify.h
@@ -47,6 +47,7 @@ struct inotify_event {
47#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */ 47#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */
48 48
49/* special flags */ 49/* special flags */
50#define IN_MASK_ADD 0x20000000 /* add to the mask of an already existing watch */
50#define IN_ISDIR 0x40000000 /* event occurred against dir */ 51#define IN_ISDIR 0x40000000 /* event occurred against dir */
51#define IN_ONESHOT 0x80000000 /* only send event once */ 52#define IN_ONESHOT 0x80000000 /* only send event once */
52 53
diff --git a/include/linux/input.h b/include/linux/input.h
index 227a497c0678..e8c296ff6257 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -66,6 +66,7 @@ struct input_absinfo {
66#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global keystate */ 66#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global keystate */
67#define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */ 67#define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */
68#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */ 68#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */
69#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */
69 70
70#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */ 71#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */
71#define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */ 72#define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */
@@ -86,6 +87,7 @@ struct input_absinfo {
86#define EV_REL 0x02 87#define EV_REL 0x02
87#define EV_ABS 0x03 88#define EV_ABS 0x03
88#define EV_MSC 0x04 89#define EV_MSC 0x04
90#define EV_SW 0x05
89#define EV_LED 0x11 91#define EV_LED 0x11
90#define EV_SND 0x12 92#define EV_SND 0x12
91#define EV_REP 0x14 93#define EV_REP 0x14
@@ -559,6 +561,20 @@ struct input_absinfo {
559#define ABS_MAX 0x3f 561#define ABS_MAX 0x3f
560 562
561/* 563/*
564 * Switch events
565 */
566
567#define SW_0 0x00
568#define SW_1 0x01
569#define SW_2 0x02
570#define SW_3 0x03
571#define SW_4 0x04
572#define SW_5 0x05
573#define SW_6 0x06
574#define SW_7 0x07
575#define SW_MAX 0x0f
576
577/*
562 * Misc events 578 * Misc events
563 */ 579 */
564 580
@@ -832,6 +848,7 @@ struct input_dev {
832 unsigned long ledbit[NBITS(LED_MAX)]; 848 unsigned long ledbit[NBITS(LED_MAX)];
833 unsigned long sndbit[NBITS(SND_MAX)]; 849 unsigned long sndbit[NBITS(SND_MAX)];
834 unsigned long ffbit[NBITS(FF_MAX)]; 850 unsigned long ffbit[NBITS(FF_MAX)];
851 unsigned long swbit[NBITS(SW_MAX)];
835 int ff_effects_max; 852 int ff_effects_max;
836 853
837 unsigned int keycodemax; 854 unsigned int keycodemax;
@@ -852,6 +869,7 @@ struct input_dev {
852 unsigned long key[NBITS(KEY_MAX)]; 869 unsigned long key[NBITS(KEY_MAX)];
853 unsigned long led[NBITS(LED_MAX)]; 870 unsigned long led[NBITS(LED_MAX)];
854 unsigned long snd[NBITS(SND_MAX)]; 871 unsigned long snd[NBITS(SND_MAX)];
872 unsigned long sw[NBITS(SW_MAX)];
855 873
856 int absmax[ABS_MAX + 1]; 874 int absmax[ABS_MAX + 1];
857 int absmin[ABS_MAX + 1]; 875 int absmin[ABS_MAX + 1];
@@ -894,6 +912,7 @@ struct input_dev {
894#define INPUT_DEVICE_ID_MATCH_LEDBIT 0x200 912#define INPUT_DEVICE_ID_MATCH_LEDBIT 0x200
895#define INPUT_DEVICE_ID_MATCH_SNDBIT 0x400 913#define INPUT_DEVICE_ID_MATCH_SNDBIT 0x400
896#define INPUT_DEVICE_ID_MATCH_FFBIT 0x800 914#define INPUT_DEVICE_ID_MATCH_FFBIT 0x800
915#define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000
897 916
898#define INPUT_DEVICE_ID_MATCH_DEVICE\ 917#define INPUT_DEVICE_ID_MATCH_DEVICE\
899 (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT) 918 (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT)
@@ -914,6 +933,7 @@ struct input_device_id {
914 unsigned long ledbit[NBITS(LED_MAX)]; 933 unsigned long ledbit[NBITS(LED_MAX)];
915 unsigned long sndbit[NBITS(SND_MAX)]; 934 unsigned long sndbit[NBITS(SND_MAX)];
916 unsigned long ffbit[NBITS(FF_MAX)]; 935 unsigned long ffbit[NBITS(FF_MAX)];
936 unsigned long swbit[NBITS(SW_MAX)];
917 937
918 unsigned long driver_info; 938 unsigned long driver_info;
919}; 939};
@@ -1006,6 +1026,11 @@ static inline void input_report_ff_status(struct input_dev *dev, unsigned int co
1006 input_event(dev, EV_FF_STATUS, code, value); 1026 input_event(dev, EV_FF_STATUS, code, value);
1007} 1027}
1008 1028
1029static inline void input_report_switch(struct input_dev *dev, unsigned int code, int value)
1030{
1031 input_event(dev, EV_SW, code, !!value);
1032}
1033
1009static inline void input_regs(struct input_dev *dev, struct pt_regs *regs) 1034static inline void input_regs(struct input_dev *dev, struct pt_regs *regs)
1010{ 1035{
1011 dev->regs = regs; 1036 dev->regs = regs;
diff --git a/include/linux/ioctl32.h b/include/linux/ioctl32.h
index e8c4af32b3bb..948809d99917 100644
--- a/include/linux/ioctl32.h
+++ b/include/linux/ioctl32.h
@@ -14,26 +14,4 @@ struct ioctl_trans {
14 struct ioctl_trans *next; 14 struct ioctl_trans *next;
15}; 15};
16 16
17/*
18 * Register an 32bit ioctl translation handler for ioctl cmd.
19 *
20 * handler == NULL: use 64bit ioctl handler.
21 * arguments to handler: fd: file descriptor
22 * cmd: ioctl command.
23 * arg: ioctl argument
24 * struct file *file: file descriptor pointer.
25 */
26
27#ifdef CONFIG_COMPAT
28extern int __deprecated register_ioctl32_conversion(unsigned int cmd,
29 ioctl_trans_handler_t handler);
30extern int __deprecated unregister_ioctl32_conversion(unsigned int cmd);
31
32#else
33
34#define register_ioctl32_conversion(cmd, handler) ({ 0; })
35#define unregister_ioctl32_conversion(cmd) ({ 0; })
36
37#endif
38
39#endif 17#endif
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h
index 596ca6130159..938d55b813a5 100644
--- a/include/linux/ipmi.h
+++ b/include/linux/ipmi.h
@@ -35,6 +35,7 @@
35#define __LINUX_IPMI_H 35#define __LINUX_IPMI_H
36 36
37#include <linux/ipmi_msgdefs.h> 37#include <linux/ipmi_msgdefs.h>
38#include <linux/compiler.h>
38 39
39/* 40/*
40 * This file describes an interface to an IPMI driver. You have to 41 * This file describes an interface to an IPMI driver. You have to
@@ -241,7 +242,8 @@ struct ipmi_recv_msg
241 /* The user_msg_data is the data supplied when a message was 242 /* The user_msg_data is the data supplied when a message was
242 sent, if this is a response to a sent message. If this is 243 sent, if this is a response to a sent message. If this is
243 not a response to a sent message, then user_msg_data will 244 not a response to a sent message, then user_msg_data will
244 be NULL. */ 245 be NULL. If the user above is NULL, then this will be the
246 intf. */
245 void *user_msg_data; 247 void *user_msg_data;
246 248
247 /* Call this when done with the message. It will presumably free 249 /* Call this when done with the message. It will presumably free
@@ -298,13 +300,19 @@ void ipmi_get_version(ipmi_user_t user,
298 this user, so it will affect all users of this interface. This is 300 this user, so it will affect all users of this interface. This is
299 so some initialization code can come in and do the OEM-specific 301 so some initialization code can come in and do the OEM-specific
300 things it takes to determine your address (if not the BMC) and set 302 things it takes to determine your address (if not the BMC) and set
301 it for everyone else. */ 303 it for everyone else. Note that each channel can have its own address. */
302void ipmi_set_my_address(ipmi_user_t user, 304int ipmi_set_my_address(ipmi_user_t user,
303 unsigned char address); 305 unsigned int channel,
304unsigned char ipmi_get_my_address(ipmi_user_t user); 306 unsigned char address);
305void ipmi_set_my_LUN(ipmi_user_t user, 307int ipmi_get_my_address(ipmi_user_t user,
306 unsigned char LUN); 308 unsigned int channel,
307unsigned char ipmi_get_my_LUN(ipmi_user_t user); 309 unsigned char *address);
310int ipmi_set_my_LUN(ipmi_user_t user,
311 unsigned int channel,
312 unsigned char LUN);
313int ipmi_get_my_LUN(ipmi_user_t user,
314 unsigned int channel,
315 unsigned char *LUN);
308 316
309/* 317/*
310 * Like ipmi_request, but lets you specify the number of retries and 318 * Like ipmi_request, but lets you specify the number of retries and
@@ -585,6 +593,16 @@ struct ipmi_cmdspec
585 * things it takes to determine your address (if not the BMC) and set 593 * things it takes to determine your address (if not the BMC) and set
586 * it for everyone else. You should probably leave the LUN alone. 594 * it for everyone else. You should probably leave the LUN alone.
587 */ 595 */
596struct ipmi_channel_lun_address_set
597{
598 unsigned short channel;
599 unsigned char value;
600};
601#define IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 24, struct ipmi_channel_lun_address_set)
602#define IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 25, struct ipmi_channel_lun_address_set)
603#define IPMICTL_SET_MY_CHANNEL_LUN_CMD _IOR(IPMI_IOC_MAGIC, 26, struct ipmi_channel_lun_address_set)
604#define IPMICTL_GET_MY_CHANNEL_LUN_CMD _IOR(IPMI_IOC_MAGIC, 27, struct ipmi_channel_lun_address_set)
605/* Legacy interfaces, these only set IPMB 0. */
588#define IPMICTL_SET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 17, unsigned int) 606#define IPMICTL_SET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 17, unsigned int)
589#define IPMICTL_GET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 18, unsigned int) 607#define IPMICTL_GET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 18, unsigned int)
590#define IPMICTL_SET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 19, unsigned int) 608#define IPMICTL_SET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 19, unsigned int)
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 3c7dbc6a0a70..6c5f7b39a4b0 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -189,6 +189,7 @@ struct inet6_skb_parm {
189 __u16 dst0; 189 __u16 dst0;
190 __u16 srcrt; 190 __u16 srcrt;
191 __u16 dst1; 191 __u16 dst1;
192 __u16 lastopt;
192}; 193};
193 194
194#define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb)) 195#define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb))
@@ -234,14 +235,20 @@ struct ipv6_pinfo {
234 /* pktoption flags */ 235 /* pktoption flags */
235 union { 236 union {
236 struct { 237 struct {
237 __u8 srcrt:2, 238 __u16 srcrt:2,
239 osrcrt:2,
238 rxinfo:1, 240 rxinfo:1,
241 rxoinfo:1,
239 rxhlim:1, 242 rxhlim:1,
243 rxohlim:1,
240 hopopts:1, 244 hopopts:1,
245 ohopopts:1,
241 dstopts:1, 246 dstopts:1,
242 rxflow:1; 247 odstopts:1,
248 rxflow:1,
249 rxtclass:1;
243 } bits; 250 } bits;
244 __u8 all; 251 __u16 all;
245 } rxopt; 252 } rxopt;
246 253
247 /* sockopt flags */ 254 /* sockopt flags */
@@ -250,6 +257,7 @@ struct ipv6_pinfo {
250 sndflow:1, 257 sndflow:1,
251 pmtudisc:2, 258 pmtudisc:2,
252 ipv6only:1; 259 ipv6only:1;
260 __u8 tclass;
253 261
254 __u32 dst_cookie; 262 __u32 dst_cookie;
255 263
@@ -263,6 +271,7 @@ struct ipv6_pinfo {
263 struct ipv6_txoptions *opt; 271 struct ipv6_txoptions *opt;
264 struct rt6_info *rt; 272 struct rt6_info *rt;
265 int hop_limit; 273 int hop_limit;
274 int tclass;
266 } cork; 275 } cork;
267}; 276};
268 277
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 069d3b84d311..69681c3b1f05 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -32,7 +32,12 @@
32#define IRQ_WAITING 32 /* IRQ not yet seen - for autodetection */ 32#define IRQ_WAITING 32 /* IRQ not yet seen - for autodetection */
33#define IRQ_LEVEL 64 /* IRQ level triggered */ 33#define IRQ_LEVEL 64 /* IRQ level triggered */
34#define IRQ_MASKED 128 /* IRQ masked - shouldn't be seen again */ 34#define IRQ_MASKED 128 /* IRQ masked - shouldn't be seen again */
35#define IRQ_PER_CPU 256 /* IRQ is per CPU */ 35#if defined(ARCH_HAS_IRQ_PER_CPU)
36# define IRQ_PER_CPU 256 /* IRQ is per CPU */
37# define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU)
38#else
39# define CHECK_IRQ_PER_CPU(var) 0
40#endif
36 41
37/* 42/*
38 * Interrupt controller descriptor. This is all we need 43 * Interrupt controller descriptor. This is all we need
@@ -71,16 +76,139 @@ typedef struct irq_desc {
71 unsigned int irq_count; /* For detecting broken interrupts */ 76 unsigned int irq_count; /* For detecting broken interrupts */
72 unsigned int irqs_unhandled; 77 unsigned int irqs_unhandled;
73 spinlock_t lock; 78 spinlock_t lock;
79#if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE)
80 unsigned int move_irq; /* Flag need to re-target intr dest*/
81#endif
74} ____cacheline_aligned irq_desc_t; 82} ____cacheline_aligned irq_desc_t;
75 83
76extern irq_desc_t irq_desc [NR_IRQS]; 84extern irq_desc_t irq_desc [NR_IRQS];
77 85
86/* Return a pointer to the irq descriptor for IRQ. */
87static inline irq_desc_t *
88irq_descp (int irq)
89{
90 return irq_desc + irq;
91}
92
78#include <asm/hw_irq.h> /* the arch dependent stuff */ 93#include <asm/hw_irq.h> /* the arch dependent stuff */
79 94
80extern int setup_irq(unsigned int irq, struct irqaction * new); 95extern int setup_irq(unsigned int irq, struct irqaction * new);
81 96
82#ifdef CONFIG_GENERIC_HARDIRQS 97#ifdef CONFIG_GENERIC_HARDIRQS
83extern cpumask_t irq_affinity[NR_IRQS]; 98extern cpumask_t irq_affinity[NR_IRQS];
99
100#ifdef CONFIG_SMP
101static inline void set_native_irq_info(int irq, cpumask_t mask)
102{
103 irq_affinity[irq] = mask;
104}
105#else
106static inline void set_native_irq_info(int irq, cpumask_t mask)
107{
108}
109#endif
110
111#ifdef CONFIG_SMP
112
113#if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE)
114extern cpumask_t pending_irq_cpumask[NR_IRQS];
115
116static inline void set_pending_irq(unsigned int irq, cpumask_t mask)
117{
118 irq_desc_t *desc = irq_desc + irq;
119 unsigned long flags;
120
121 spin_lock_irqsave(&desc->lock, flags);
122 desc->move_irq = 1;
123 pending_irq_cpumask[irq] = mask;
124 spin_unlock_irqrestore(&desc->lock, flags);
125}
126
127static inline void
128move_native_irq(int irq)
129{
130 cpumask_t tmp;
131 irq_desc_t *desc = irq_descp(irq);
132
133 if (likely (!desc->move_irq))
134 return;
135
136 desc->move_irq = 0;
137
138 if (likely(cpus_empty(pending_irq_cpumask[irq])))
139 return;
140
141 if (!desc->handler->set_affinity)
142 return;
143
144 /* note - we hold the desc->lock */
145 cpus_and(tmp, pending_irq_cpumask[irq], cpu_online_map);
146
147 /*
148 * If there was a valid mask to work with, please
149 * do the disable, re-program, enable sequence.
150 * This is *not* particularly important for level triggered
151 * but in a edge trigger case, we might be setting rte
152 * when an active trigger is comming in. This could
153 * cause some ioapics to mal-function.
154 * Being paranoid i guess!
155 */
156 if (unlikely(!cpus_empty(tmp))) {
157 desc->handler->disable(irq);
158 desc->handler->set_affinity(irq,tmp);
159 desc->handler->enable(irq);
160 }
161 cpus_clear(pending_irq_cpumask[irq]);
162}
163
164#ifdef CONFIG_PCI_MSI
165/*
166 * Wonder why these are dummies?
167 * For e.g the set_ioapic_affinity_vector() calls the set_ioapic_affinity_irq()
168 * counter part after translating the vector to irq info. We need to perform
169 * this operation on the real irq, when we dont use vector, i.e when
170 * pci_use_vector() is false.
171 */
172static inline void move_irq(int irq)
173{
174}
175
176static inline void set_irq_info(int irq, cpumask_t mask)
177{
178}
179
180#else // CONFIG_PCI_MSI
181
182static inline void move_irq(int irq)
183{
184 move_native_irq(irq);
185}
186
187static inline void set_irq_info(int irq, cpumask_t mask)
188{
189 set_native_irq_info(irq, mask);
190}
191#endif // CONFIG_PCI_MSI
192
193#else // CONFIG_GENERIC_PENDING_IRQ || CONFIG_IRQBALANCE
194
195#define move_irq(x)
196#define move_native_irq(x)
197#define set_pending_irq(x,y)
198static inline void set_irq_info(int irq, cpumask_t mask)
199{
200 set_native_irq_info(irq, mask);
201}
202
203#endif // CONFIG_GENERIC_PENDING_IRQ
204
205#else // CONFIG_SMP
206
207#define move_irq(x)
208#define move_native_irq(x)
209
210#endif // CONFIG_SMP
211
84extern int no_irq_affinity; 212extern int no_irq_affinity;
85extern int noirqdebug_setup(char *str); 213extern int noirqdebug_setup(char *str);
86 214
diff --git a/include/linux/isdn.h b/include/linux/isdn.h
index 862083eb58ab..53eaee96065b 100644
--- a/include/linux/isdn.h
+++ b/include/linux/isdn.h
@@ -150,7 +150,6 @@ typedef struct {
150#include <linux/errno.h> 150#include <linux/errno.h>
151#include <linux/fs.h> 151#include <linux/fs.h>
152#include <linux/major.h> 152#include <linux/major.h>
153#include <asm/segment.h>
154#include <asm/io.h> 153#include <asm/io.h>
155#include <linux/kernel.h> 154#include <linux/kernel.h>
156#include <linux/signal.h> 155#include <linux/signal.h>
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index 593407e865b1..84321a4cac93 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -914,7 +914,6 @@ extern int journal_wipe (journal_t *, int);
914extern int journal_skip_recovery (journal_t *); 914extern int journal_skip_recovery (journal_t *);
915extern void journal_update_superblock (journal_t *, int); 915extern void journal_update_superblock (journal_t *, int);
916extern void __journal_abort_hard (journal_t *); 916extern void __journal_abort_hard (journal_t *);
917extern void __journal_abort_soft (journal_t *, int);
918extern void journal_abort (journal_t *, int); 917extern void journal_abort (journal_t *, int);
919extern int journal_errno (journal_t *); 918extern int journal_errno (journal_t *);
920extern void journal_ack_err (journal_t *); 919extern void journal_ack_err (journal_t *);
diff --git a/include/linux/klist.h b/include/linux/klist.h
index eebf5e5696ec..74071254c9d3 100644
--- a/include/linux/klist.h
+++ b/include/linux/klist.h
@@ -9,20 +9,25 @@
9 * This file is rleased under the GPL v2. 9 * This file is rleased under the GPL v2.
10 */ 10 */
11 11
12#ifndef _LINUX_KLIST_H
13#define _LINUX_KLIST_H
14
12#include <linux/spinlock.h> 15#include <linux/spinlock.h>
13#include <linux/completion.h> 16#include <linux/completion.h>
14#include <linux/kref.h> 17#include <linux/kref.h>
15#include <linux/list.h> 18#include <linux/list.h>
16 19
17 20struct klist_node;
18struct klist { 21struct klist {
19 spinlock_t k_lock; 22 spinlock_t k_lock;
20 struct list_head k_list; 23 struct list_head k_list;
24 void (*get)(struct klist_node *);
25 void (*put)(struct klist_node *);
21}; 26};
22 27
23 28
24extern void klist_init(struct klist * k); 29extern void klist_init(struct klist * k, void (*get)(struct klist_node *),
25 30 void (*put)(struct klist_node *));
26 31
27struct klist_node { 32struct klist_node {
28 struct klist * n_klist; 33 struct klist * n_klist;
@@ -31,8 +36,8 @@ struct klist_node {
31 struct completion n_removed; 36 struct completion n_removed;
32}; 37};
33 38
34extern void klist_add_tail(struct klist * k, struct klist_node * n); 39extern void klist_add_tail(struct klist_node * n, struct klist * k);
35extern void klist_add_head(struct klist * k, struct klist_node * n); 40extern void klist_add_head(struct klist_node * n, struct klist * k);
36 41
37extern void klist_del(struct klist_node * n); 42extern void klist_del(struct klist_node * n);
38extern void klist_remove(struct klist_node * n); 43extern void klist_remove(struct klist_node * n);
@@ -53,3 +58,4 @@ extern void klist_iter_init_node(struct klist * k, struct klist_iter * i,
53extern void klist_iter_exit(struct klist_iter * i); 58extern void klist_iter_exit(struct klist_iter * i);
54extern struct klist_node * klist_next(struct klist_iter * i); 59extern struct klist_node * klist_next(struct klist_iter * i);
55 60
61#endif
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index e050fc2d4c26..e30afdca7917 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -42,6 +42,9 @@
42#define KPROBE_REENTER 0x00000004 42#define KPROBE_REENTER 0x00000004
43#define KPROBE_HIT_SSDONE 0x00000008 43#define KPROBE_HIT_SSDONE 0x00000008
44 44
45/* Attach to insert probes on any functions which should be ignored*/
46#define __kprobes __attribute__((__section__(".kprobes.text")))
47
45struct kprobe; 48struct kprobe;
46struct pt_regs; 49struct pt_regs;
47struct kretprobe; 50struct kretprobe;
diff --git a/include/linux/libata.h b/include/linux/libata.h
index fc05a9899288..022105c745fc 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -40,7 +40,6 @@
40#undef ATA_VERBOSE_DEBUG /* yet more debugging output */ 40#undef ATA_VERBOSE_DEBUG /* yet more debugging output */
41#undef ATA_IRQ_TRAP /* define to ack screaming irqs */ 41#undef ATA_IRQ_TRAP /* define to ack screaming irqs */
42#undef ATA_NDEBUG /* define to disable quick runtime checks */ 42#undef ATA_NDEBUG /* define to disable quick runtime checks */
43#undef ATA_ENABLE_ATAPI /* define to enable ATAPI support */
44#undef ATA_ENABLE_PATA /* define to enable PATA support in some 43#undef ATA_ENABLE_PATA /* define to enable PATA support in some
45 * low-level drivers */ 44 * low-level drivers */
46#undef ATAPI_ENABLE_DMADIR /* enables ATAPI DMADIR bridge support */ 45#undef ATAPI_ENABLE_DMADIR /* enables ATAPI DMADIR bridge support */
@@ -450,6 +449,7 @@ struct pci_bits {
450 unsigned long val; 449 unsigned long val;
451}; 450};
452 451
452extern void ata_pci_host_stop (struct ata_host_set *host_set);
453extern struct ata_probe_ent * 453extern struct ata_probe_ent *
454ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port); 454ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port);
455extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits); 455extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits);
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index 338f7795d8a0..147eb01e0d4b 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -33,6 +33,13 @@
33 ALIGN; \ 33 ALIGN; \
34 name: 34 name:
35 35
36#define KPROBE_ENTRY(name) \
37 .section .kprobes.text, "ax"; \
38 .globl name; \
39 ALIGN; \
40 name:
41
42
36#endif 43#endif
37 44
38#define NORET_TYPE /**/ 45#define NORET_TYPE /**/
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 8480aef10e62..58385ee1c0ac 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -150,8 +150,12 @@ void mpol_free_shared_policy(struct shared_policy *p);
150struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp, 150struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp,
151 unsigned long idx); 151 unsigned long idx);
152 152
153struct mempolicy *get_vma_policy(struct task_struct *task,
154 struct vm_area_struct *vma, unsigned long addr);
155
153extern void numa_default_policy(void); 156extern void numa_default_policy(void);
154extern void numa_policy_init(void); 157extern void numa_policy_init(void);
158extern struct mempolicy default_policy;
155 159
156#else 160#else
157 161
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index aefedf04b9bb..18fc77f682de 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -33,6 +33,13 @@ struct mmc_csd {
33 unsigned int capacity; 33 unsigned int capacity;
34}; 34};
35 35
36struct sd_scr {
37 unsigned char sda_vsn;
38 unsigned char bus_widths;
39#define SD_SCR_BUS_WIDTH_1 (1<<0)
40#define SD_SCR_BUS_WIDTH_4 (1<<2)
41};
42
36struct mmc_host; 43struct mmc_host;
37 44
38/* 45/*
@@ -47,19 +54,27 @@ struct mmc_card {
47#define MMC_STATE_PRESENT (1<<0) /* present in sysfs */ 54#define MMC_STATE_PRESENT (1<<0) /* present in sysfs */
48#define MMC_STATE_DEAD (1<<1) /* device no longer in stack */ 55#define MMC_STATE_DEAD (1<<1) /* device no longer in stack */
49#define MMC_STATE_BAD (1<<2) /* unrecognised device */ 56#define MMC_STATE_BAD (1<<2) /* unrecognised device */
57#define MMC_STATE_SDCARD (1<<3) /* is an SD card */
58#define MMC_STATE_READONLY (1<<4) /* card is read-only */
50 u32 raw_cid[4]; /* raw card CID */ 59 u32 raw_cid[4]; /* raw card CID */
51 u32 raw_csd[4]; /* raw card CSD */ 60 u32 raw_csd[4]; /* raw card CSD */
61 u32 raw_scr[2]; /* raw card SCR */
52 struct mmc_cid cid; /* card identification */ 62 struct mmc_cid cid; /* card identification */
53 struct mmc_csd csd; /* card specific */ 63 struct mmc_csd csd; /* card specific */
64 struct sd_scr scr; /* extra SD information */
54}; 65};
55 66
56#define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT) 67#define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT)
57#define mmc_card_dead(c) ((c)->state & MMC_STATE_DEAD) 68#define mmc_card_dead(c) ((c)->state & MMC_STATE_DEAD)
58#define mmc_card_bad(c) ((c)->state & MMC_STATE_BAD) 69#define mmc_card_bad(c) ((c)->state & MMC_STATE_BAD)
70#define mmc_card_sd(c) ((c)->state & MMC_STATE_SDCARD)
71#define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY)
59 72
60#define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) 73#define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT)
61#define mmc_card_set_dead(c) ((c)->state |= MMC_STATE_DEAD) 74#define mmc_card_set_dead(c) ((c)->state |= MMC_STATE_DEAD)
62#define mmc_card_set_bad(c) ((c)->state |= MMC_STATE_BAD) 75#define mmc_card_set_bad(c) ((c)->state |= MMC_STATE_BAD)
76#define mmc_card_set_sd(c) ((c)->state |= MMC_STATE_SDCARD)
77#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
63 78
64#define mmc_card_name(c) ((c)->cid.prod_name) 79#define mmc_card_name(c) ((c)->cid.prod_name)
65#define mmc_card_id(c) ((c)->dev.bus_id) 80#define mmc_card_id(c) ((c)->dev.bus_id)
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 9a0893f3249e..c1f021eddffa 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -46,16 +46,28 @@ struct mmc_ios {
46#define MMC_BUSMODE_OPENDRAIN 1 46#define MMC_BUSMODE_OPENDRAIN 1
47#define MMC_BUSMODE_PUSHPULL 2 47#define MMC_BUSMODE_PUSHPULL 2
48 48
49 unsigned char chip_select; /* SPI chip select */
50
51#define MMC_CS_DONTCARE 0
52#define MMC_CS_HIGH 1
53#define MMC_CS_LOW 2
54
49 unsigned char power_mode; /* power supply mode */ 55 unsigned char power_mode; /* power supply mode */
50 56
51#define MMC_POWER_OFF 0 57#define MMC_POWER_OFF 0
52#define MMC_POWER_UP 1 58#define MMC_POWER_UP 1
53#define MMC_POWER_ON 2 59#define MMC_POWER_ON 2
60
61 unsigned char bus_width; /* data bus width */
62
63#define MMC_BUS_WIDTH_1 0
64#define MMC_BUS_WIDTH_4 2
54}; 65};
55 66
56struct mmc_host_ops { 67struct mmc_host_ops {
57 void (*request)(struct mmc_host *host, struct mmc_request *req); 68 void (*request)(struct mmc_host *host, struct mmc_request *req);
58 void (*set_ios)(struct mmc_host *host, struct mmc_ios *ios); 69 void (*set_ios)(struct mmc_host *host, struct mmc_ios *ios);
70 int (*get_ro)(struct mmc_host *host);
59}; 71};
60 72
61struct mmc_card; 73struct mmc_card;
@@ -70,6 +82,10 @@ struct mmc_host {
70 unsigned int f_max; 82 unsigned int f_max;
71 u32 ocr_avail; 83 u32 ocr_avail;
72 84
85 unsigned long caps; /* Host capabilities */
86
87#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */
88
73 /* host specific block data */ 89 /* host specific block data */
74 unsigned int max_seg_size; /* see blk_queue_max_segment_size */ 90 unsigned int max_seg_size; /* see blk_queue_max_segment_size */
75 unsigned short max_hw_segs; /* see blk_queue_max_hw_segments */ 91 unsigned short max_hw_segs; /* see blk_queue_max_hw_segments */
@@ -81,6 +97,10 @@ struct mmc_host {
81 struct mmc_ios ios; /* current io bus settings */ 97 struct mmc_ios ios; /* current io bus settings */
82 u32 ocr; /* the current OCR setting */ 98 u32 ocr; /* the current OCR setting */
83 99
100 unsigned int mode; /* current card mode of host */
101#define MMC_MODE_MMC 0
102#define MMC_MODE_SD 1
103
84 struct list_head cards; /* devices attached to this host */ 104 struct list_head cards; /* devices attached to this host */
85 105
86 wait_queue_head_t wq; 106 wait_queue_head_t wq;
@@ -89,6 +109,8 @@ struct mmc_host {
89 struct mmc_card *card_selected; /* the selected MMC card */ 109 struct mmc_card *card_selected; /* the selected MMC card */
90 110
91 struct work_struct detect; 111 struct work_struct detect;
112
113 unsigned long private[0] ____cacheline_aligned;
92}; 114};
93 115
94extern struct mmc_host *mmc_alloc_host(int extra, struct device *); 116extern struct mmc_host *mmc_alloc_host(int extra, struct device *);
@@ -96,14 +118,18 @@ extern int mmc_add_host(struct mmc_host *);
96extern void mmc_remove_host(struct mmc_host *); 118extern void mmc_remove_host(struct mmc_host *);
97extern void mmc_free_host(struct mmc_host *); 119extern void mmc_free_host(struct mmc_host *);
98 120
99#define mmc_priv(x) ((void *)((x) + 1)) 121static inline void *mmc_priv(struct mmc_host *host)
122{
123 return (void *)host->private;
124}
125
100#define mmc_dev(x) ((x)->dev) 126#define mmc_dev(x) ((x)->dev)
101#define mmc_hostname(x) ((x)->class_dev.class_id) 127#define mmc_hostname(x) ((x)->class_dev.class_id)
102 128
103extern int mmc_suspend_host(struct mmc_host *, pm_message_t); 129extern int mmc_suspend_host(struct mmc_host *, pm_message_t);
104extern int mmc_resume_host(struct mmc_host *); 130extern int mmc_resume_host(struct mmc_host *);
105 131
106extern void mmc_detect_change(struct mmc_host *); 132extern void mmc_detect_change(struct mmc_host *, unsigned long delay);
107extern void mmc_request_done(struct mmc_host *, struct mmc_request *); 133extern void mmc_request_done(struct mmc_host *, struct mmc_request *);
108 134
109#endif 135#endif
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index 0d35d4ffb360..1ab78e8d6c53 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -88,6 +88,8 @@ struct mmc_card;
88 88
89extern int mmc_wait_for_req(struct mmc_host *, struct mmc_request *); 89extern int mmc_wait_for_req(struct mmc_host *, struct mmc_request *);
90extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); 90extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
91extern int mmc_wait_for_app_cmd(struct mmc_host *, unsigned int,
92 struct mmc_command *, int);
91 93
92extern int __mmc_claim_host(struct mmc_host *host, struct mmc_card *card); 94extern int __mmc_claim_host(struct mmc_host *host, struct mmc_card *card);
93 95
diff --git a/include/linux/mmc/protocol.h b/include/linux/mmc/protocol.h
index 896342817b97..f819cae92266 100644
--- a/include/linux/mmc/protocol.h
+++ b/include/linux/mmc/protocol.h
@@ -236,5 +236,12 @@ struct _mmc_csd {
236#define CSD_SPEC_VER_2 2 /* Implements system specification 2.0 - 2.2 */ 236#define CSD_SPEC_VER_2 2 /* Implements system specification 2.0 - 2.2 */
237#define CSD_SPEC_VER_3 3 /* Implements system specification 3.1 */ 237#define CSD_SPEC_VER_3 3 /* Implements system specification 3.1 */
238 238
239
240/*
241 * SD bus widths
242 */
243#define SD_BUS_WIDTH_1 0
244#define SD_BUS_WIDTH_4 2
245
239#endif /* MMC_MMC_PROTOCOL_H */ 246#endif /* MMC_MMC_PROTOCOL_H */
240 247
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 6c90461ed99f..5ed471b58f4f 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -487,11 +487,27 @@ struct mem_section {
487 unsigned long section_mem_map; 487 unsigned long section_mem_map;
488}; 488};
489 489
490extern struct mem_section mem_section[NR_MEM_SECTIONS]; 490#ifdef CONFIG_SPARSEMEM_EXTREME
491#define SECTIONS_PER_ROOT (PAGE_SIZE / sizeof (struct mem_section))
492#else
493#define SECTIONS_PER_ROOT 1
494#endif
495
496#define SECTION_NR_TO_ROOT(sec) ((sec) / SECTIONS_PER_ROOT)
497#define NR_SECTION_ROOTS (NR_MEM_SECTIONS / SECTIONS_PER_ROOT)
498#define SECTION_ROOT_MASK (SECTIONS_PER_ROOT - 1)
499
500#ifdef CONFIG_SPARSEMEM_EXTREME
501extern struct mem_section *mem_section[NR_SECTION_ROOTS];
502#else
503extern struct mem_section mem_section[NR_SECTION_ROOTS][SECTIONS_PER_ROOT];
504#endif
491 505
492static inline struct mem_section *__nr_to_section(unsigned long nr) 506static inline struct mem_section *__nr_to_section(unsigned long nr)
493{ 507{
494 return &mem_section[nr]; 508 if (!mem_section[SECTION_NR_TO_ROOT(nr)])
509 return NULL;
510 return &mem_section[SECTION_NR_TO_ROOT(nr)][nr & SECTION_ROOT_MASK];
495} 511}
496 512
497/* 513/*
@@ -513,12 +529,12 @@ static inline struct page *__section_mem_map_addr(struct mem_section *section)
513 529
514static inline int valid_section(struct mem_section *section) 530static inline int valid_section(struct mem_section *section)
515{ 531{
516 return (section->section_mem_map & SECTION_MARKED_PRESENT); 532 return (section && (section->section_mem_map & SECTION_MARKED_PRESENT));
517} 533}
518 534
519static inline int section_has_mem_map(struct mem_section *section) 535static inline int section_has_mem_map(struct mem_section *section)
520{ 536{
521 return (section->section_mem_map & SECTION_HAS_MEM_MAP); 537 return (section && (section->section_mem_map & SECTION_HAS_MEM_MAP));
522} 538}
523 539
524static inline int valid_section_nr(unsigned long nr) 540static inline int valid_section_nr(unsigned long nr)
@@ -572,6 +588,7 @@ static inline int pfn_valid(unsigned long pfn)
572void sparse_init(void); 588void sparse_init(void);
573#else 589#else
574#define sparse_init() do {} while (0) 590#define sparse_init() do {} while (0)
591#define sparse_index_init(_sec, _nid) do {} while (0)
575#endif /* CONFIG_SPARSEMEM */ 592#endif /* CONFIG_SPARSEMEM */
576 593
577#ifdef CONFIG_NODES_SPAN_OTHER_NODES 594#ifdef CONFIG_NODES_SPAN_OTHER_NODES
diff --git a/include/linux/msg.h b/include/linux/msg.h
index 2c4c6aa643ff..903e0ab8101f 100644
--- a/include/linux/msg.h
+++ b/include/linux/msg.h
@@ -77,6 +77,7 @@ struct msg_msg {
77/* one msq_queue structure for each present queue on the system */ 77/* one msq_queue structure for each present queue on the system */
78struct msg_queue { 78struct msg_queue {
79 struct kern_ipc_perm q_perm; 79 struct kern_ipc_perm q_perm;
80 int q_id;
80 time_t q_stime; /* last msgsnd time */ 81 time_t q_stime; /* last msgsnd time */
81 time_t q_rtime; /* last msgrcv time */ 82 time_t q_rtime; /* last msgrcv time */
82 time_t q_ctime; /* last change time */ 83 time_t q_ctime; /* last change time */
diff --git a/include/linux/mv643xx.h b/include/linux/mv643xx.h
index 5773ea42f6e4..0b08cd692201 100644
--- a/include/linux/mv643xx.h
+++ b/include/linux/mv643xx.h
@@ -980,7 +980,7 @@
980/* I2C Registers */ 980/* I2C Registers */
981/****************************************/ 981/****************************************/
982 982
983#define MV64XXX_I2C_CTLR_NAME "mv64xxx i2c" 983#define MV64XXX_I2C_CTLR_NAME "mv64xxx_i2c"
984#define MV64XXX_I2C_OFFSET 0xc000 984#define MV64XXX_I2C_OFFSET 0xc000
985#define MV64XXX_I2C_REG_BLOCK_SIZE 0x0020 985#define MV64XXX_I2C_REG_BLOCK_SIZE 0x0020
986 986
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h
index 088742befe49..7e033e9271a8 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack.h
@@ -263,6 +263,9 @@ struct ip_conntrack_expect
263 /* Unique ID */ 263 /* Unique ID */
264 unsigned int id; 264 unsigned int id;
265 265
266 /* Flags */
267 unsigned int flags;
268
266#ifdef CONFIG_IP_NF_NAT_NEEDED 269#ifdef CONFIG_IP_NF_NAT_NEEDED
267 /* This is the original per-proto part, used to map the 270 /* This is the original per-proto part, used to map the
268 * expected connection the way the recipient expects. */ 271 * expected connection the way the recipient expects. */
@@ -272,6 +275,8 @@ struct ip_conntrack_expect
272#endif 275#endif
273}; 276};
274 277
278#define IP_CT_EXPECT_PERMANENT 0x1
279
275static inline struct ip_conntrack * 280static inline struct ip_conntrack *
276tuplehash_to_ctrack(const struct ip_conntrack_tuple_hash *hash) 281tuplehash_to_ctrack(const struct ip_conntrack_tuple_hash *hash)
277{ 282{
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_core.h b/include/linux/netfilter_ipv4/ip_conntrack_core.h
index dc4d2a0575de..907d4f5ca5dc 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_core.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_core.h
@@ -52,7 +52,7 @@ static inline int ip_conntrack_confirm(struct sk_buff **pskb)
52 return ret; 52 return ret;
53} 53}
54 54
55extern void __ip_ct_expect_unlink_destroy(struct ip_conntrack_expect *exp); 55extern void ip_ct_unlink_expect(struct ip_conntrack_expect *exp);
56 56
57extern struct list_head *ip_conntrack_hash; 57extern struct list_head *ip_conntrack_hash;
58extern struct list_head ip_conntrack_expect_list; 58extern struct list_head ip_conntrack_expect_list;
diff --git a/include/linux/netfilter_ipv4/ip_nat_rule.h b/include/linux/netfilter_ipv4/ip_nat_rule.h
index fecd2a06dcd8..73b9552e6a89 100644
--- a/include/linux/netfilter_ipv4/ip_nat_rule.h
+++ b/include/linux/netfilter_ipv4/ip_nat_rule.h
@@ -19,5 +19,10 @@ extern unsigned int
19alloc_null_binding(struct ip_conntrack *conntrack, 19alloc_null_binding(struct ip_conntrack *conntrack,
20 struct ip_nat_info *info, 20 struct ip_nat_info *info,
21 unsigned int hooknum); 21 unsigned int hooknum);
22
23extern unsigned int
24alloc_null_binding_confirmed(struct ip_conntrack *conntrack,
25 struct ip_nat_info *info,
26 unsigned int hooknum);
22#endif 27#endif
23#endif /* _IP_NAT_RULE_H */ 28#endif /* _IP_NAT_RULE_H */
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index f5a6695d4d21..f34767c5fc79 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -134,6 +134,7 @@ struct page_state {
134}; 134};
135 135
136extern void get_page_state(struct page_state *ret); 136extern void get_page_state(struct page_state *ret);
137extern void get_page_state_node(struct page_state *ret, int node);
137extern void get_full_page_state(struct page_state *ret); 138extern void get_full_page_state(struct page_state *ret);
138extern unsigned long __read_page_state(unsigned long offset); 139extern unsigned long __read_page_state(unsigned long offset);
139extern void __mod_page_state(unsigned long offset, unsigned long delta); 140extern void __mod_page_state(unsigned long offset, unsigned long delta);
@@ -194,6 +195,7 @@ extern void __mod_page_state(unsigned long offset, unsigned long delta);
194#define SetPageDirty(page) set_bit(PG_dirty, &(page)->flags) 195#define SetPageDirty(page) set_bit(PG_dirty, &(page)->flags)
195#define TestSetPageDirty(page) test_and_set_bit(PG_dirty, &(page)->flags) 196#define TestSetPageDirty(page) test_and_set_bit(PG_dirty, &(page)->flags)
196#define ClearPageDirty(page) clear_bit(PG_dirty, &(page)->flags) 197#define ClearPageDirty(page) clear_bit(PG_dirty, &(page)->flags)
198#define __ClearPageDirty(page) __clear_bit(PG_dirty, &(page)->flags)
197#define TestClearPageDirty(page) test_and_clear_bit(PG_dirty, &(page)->flags) 199#define TestClearPageDirty(page) test_and_clear_bit(PG_dirty, &(page)->flags)
198 200
199#define SetPageLRU(page) set_bit(PG_lru, &(page)->flags) 201#define SetPageLRU(page) set_bit(PG_lru, &(page)->flags)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index bc4c40000c0d..7349058ed778 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -19,436 +19,10 @@
19 19
20#include <linux/mod_devicetable.h> 20#include <linux/mod_devicetable.h>
21 21
22/* 22/* Include the pci register defines */
23 * Under PCI, each device has 256 bytes of configuration address space, 23#include <linux/pci_regs.h>
24 * of which the first 64 bytes are standardized as follows:
25 */
26#define PCI_VENDOR_ID 0x00 /* 16 bits */
27#define PCI_DEVICE_ID 0x02 /* 16 bits */
28#define PCI_COMMAND 0x04 /* 16 bits */
29#define PCI_COMMAND_IO 0x1 /* Enable response in I/O space */
30#define PCI_COMMAND_MEMORY 0x2 /* Enable response in Memory space */
31#define PCI_COMMAND_MASTER 0x4 /* Enable bus mastering */
32#define PCI_COMMAND_SPECIAL 0x8 /* Enable response to special cycles */
33#define PCI_COMMAND_INVALIDATE 0x10 /* Use memory write and invalidate */
34#define PCI_COMMAND_VGA_PALETTE 0x20 /* Enable palette snooping */
35#define PCI_COMMAND_PARITY 0x40 /* Enable parity checking */
36#define PCI_COMMAND_WAIT 0x80 /* Enable address/data stepping */
37#define PCI_COMMAND_SERR 0x100 /* Enable SERR */
38#define PCI_COMMAND_FAST_BACK 0x200 /* Enable back-to-back writes */
39#define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */
40
41#define PCI_STATUS 0x06 /* 16 bits */
42#define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */
43#define PCI_STATUS_66MHZ 0x20 /* Support 66 Mhz PCI 2.1 bus */
44#define PCI_STATUS_UDF 0x40 /* Support User Definable Features [obsolete] */
45#define PCI_STATUS_FAST_BACK 0x80 /* Accept fast-back to back */
46#define PCI_STATUS_PARITY 0x100 /* Detected parity error */
47#define PCI_STATUS_DEVSEL_MASK 0x600 /* DEVSEL timing */
48#define PCI_STATUS_DEVSEL_FAST 0x000
49#define PCI_STATUS_DEVSEL_MEDIUM 0x200
50#define PCI_STATUS_DEVSEL_SLOW 0x400
51#define PCI_STATUS_SIG_TARGET_ABORT 0x800 /* Set on target abort */
52#define PCI_STATUS_REC_TARGET_ABORT 0x1000 /* Master ack of " */
53#define PCI_STATUS_REC_MASTER_ABORT 0x2000 /* Set on master abort */
54#define PCI_STATUS_SIG_SYSTEM_ERROR 0x4000 /* Set when we drive SERR */
55#define PCI_STATUS_DETECTED_PARITY 0x8000 /* Set on parity error */
56
57#define PCI_CLASS_REVISION 0x08 /* High 24 bits are class, low 8
58 revision */
59#define PCI_REVISION_ID 0x08 /* Revision ID */
60#define PCI_CLASS_PROG 0x09 /* Reg. Level Programming Interface */
61#define PCI_CLASS_DEVICE 0x0a /* Device class */
62
63#define PCI_CACHE_LINE_SIZE 0x0c /* 8 bits */
64#define PCI_LATENCY_TIMER 0x0d /* 8 bits */
65#define PCI_HEADER_TYPE 0x0e /* 8 bits */
66#define PCI_HEADER_TYPE_NORMAL 0
67#define PCI_HEADER_TYPE_BRIDGE 1
68#define PCI_HEADER_TYPE_CARDBUS 2
69
70#define PCI_BIST 0x0f /* 8 bits */
71#define PCI_BIST_CODE_MASK 0x0f /* Return result */
72#define PCI_BIST_START 0x40 /* 1 to start BIST, 2 secs or less */
73#define PCI_BIST_CAPABLE 0x80 /* 1 if BIST capable */
74
75/*
76 * Base addresses specify locations in memory or I/O space.
77 * Decoded size can be determined by writing a value of
78 * 0xffffffff to the register, and reading it back. Only
79 * 1 bits are decoded.
80 */
81#define PCI_BASE_ADDRESS_0 0x10 /* 32 bits */
82#define PCI_BASE_ADDRESS_1 0x14 /* 32 bits [htype 0,1 only] */
83#define PCI_BASE_ADDRESS_2 0x18 /* 32 bits [htype 0 only] */
84#define PCI_BASE_ADDRESS_3 0x1c /* 32 bits */
85#define PCI_BASE_ADDRESS_4 0x20 /* 32 bits */
86#define PCI_BASE_ADDRESS_5 0x24 /* 32 bits */
87#define PCI_BASE_ADDRESS_SPACE 0x01 /* 0 = memory, 1 = I/O */
88#define PCI_BASE_ADDRESS_SPACE_IO 0x01
89#define PCI_BASE_ADDRESS_SPACE_MEMORY 0x00
90#define PCI_BASE_ADDRESS_MEM_TYPE_MASK 0x06
91#define PCI_BASE_ADDRESS_MEM_TYPE_32 0x00 /* 32 bit address */
92#define PCI_BASE_ADDRESS_MEM_TYPE_1M 0x02 /* Below 1M [obsolete] */
93#define PCI_BASE_ADDRESS_MEM_TYPE_64 0x04 /* 64 bit address */
94#define PCI_BASE_ADDRESS_MEM_PREFETCH 0x08 /* prefetchable? */
95#define PCI_BASE_ADDRESS_MEM_MASK (~0x0fUL)
96#define PCI_BASE_ADDRESS_IO_MASK (~0x03UL)
97/* bit 1 is reserved if address_space = 1 */
98
99/* Header type 0 (normal devices) */
100#define PCI_CARDBUS_CIS 0x28
101#define PCI_SUBSYSTEM_VENDOR_ID 0x2c
102#define PCI_SUBSYSTEM_ID 0x2e
103#define PCI_ROM_ADDRESS 0x30 /* Bits 31..11 are address, 10..1 reserved */
104#define PCI_ROM_ADDRESS_ENABLE 0x01
105#define PCI_ROM_ADDRESS_MASK (~0x7ffUL)
106
107#define PCI_CAPABILITY_LIST 0x34 /* Offset of first capability list entry */
108
109/* 0x35-0x3b are reserved */
110#define PCI_INTERRUPT_LINE 0x3c /* 8 bits */
111#define PCI_INTERRUPT_PIN 0x3d /* 8 bits */
112#define PCI_MIN_GNT 0x3e /* 8 bits */
113#define PCI_MAX_LAT 0x3f /* 8 bits */
114
115/* Header type 1 (PCI-to-PCI bridges) */
116#define PCI_PRIMARY_BUS 0x18 /* Primary bus number */
117#define PCI_SECONDARY_BUS 0x19 /* Secondary bus number */
118#define PCI_SUBORDINATE_BUS 0x1a /* Highest bus number behind the bridge */
119#define PCI_SEC_LATENCY_TIMER 0x1b /* Latency timer for secondary interface */
120#define PCI_IO_BASE 0x1c /* I/O range behind the bridge */
121#define PCI_IO_LIMIT 0x1d
122#define PCI_IO_RANGE_TYPE_MASK 0x0fUL /* I/O bridging type */
123#define PCI_IO_RANGE_TYPE_16 0x00
124#define PCI_IO_RANGE_TYPE_32 0x01
125#define PCI_IO_RANGE_MASK (~0x0fUL)
126#define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */
127#define PCI_MEMORY_BASE 0x20 /* Memory range behind */
128#define PCI_MEMORY_LIMIT 0x22
129#define PCI_MEMORY_RANGE_TYPE_MASK 0x0fUL
130#define PCI_MEMORY_RANGE_MASK (~0x0fUL)
131#define PCI_PREF_MEMORY_BASE 0x24 /* Prefetchable memory range behind */
132#define PCI_PREF_MEMORY_LIMIT 0x26
133#define PCI_PREF_RANGE_TYPE_MASK 0x0fUL
134#define PCI_PREF_RANGE_TYPE_32 0x00
135#define PCI_PREF_RANGE_TYPE_64 0x01
136#define PCI_PREF_RANGE_MASK (~0x0fUL)
137#define PCI_PREF_BASE_UPPER32 0x28 /* Upper half of prefetchable memory range */
138#define PCI_PREF_LIMIT_UPPER32 0x2c
139#define PCI_IO_BASE_UPPER16 0x30 /* Upper half of I/O addresses */
140#define PCI_IO_LIMIT_UPPER16 0x32
141/* 0x34 same as for htype 0 */
142/* 0x35-0x3b is reserved */
143#define PCI_ROM_ADDRESS1 0x38 /* Same as PCI_ROM_ADDRESS, but for htype 1 */
144/* 0x3c-0x3d are same as for htype 0 */
145#define PCI_BRIDGE_CONTROL 0x3e
146#define PCI_BRIDGE_CTL_PARITY 0x01 /* Enable parity detection on secondary interface */
147#define PCI_BRIDGE_CTL_SERR 0x02 /* The same for SERR forwarding */
148#define PCI_BRIDGE_CTL_NO_ISA 0x04 /* Disable bridging of ISA ports */
149#define PCI_BRIDGE_CTL_VGA 0x08 /* Forward VGA addresses */
150#define PCI_BRIDGE_CTL_MASTER_ABORT 0x20 /* Report master aborts */
151#define PCI_BRIDGE_CTL_BUS_RESET 0x40 /* Secondary bus reset */
152#define PCI_BRIDGE_CTL_FAST_BACK 0x80 /* Fast Back2Back enabled on secondary interface */
153
154/* Header type 2 (CardBus bridges) */
155#define PCI_CB_CAPABILITY_LIST 0x14
156/* 0x15 reserved */
157#define PCI_CB_SEC_STATUS 0x16 /* Secondary status */
158#define PCI_CB_PRIMARY_BUS 0x18 /* PCI bus number */
159#define PCI_CB_CARD_BUS 0x19 /* CardBus bus number */
160#define PCI_CB_SUBORDINATE_BUS 0x1a /* Subordinate bus number */
161#define PCI_CB_LATENCY_TIMER 0x1b /* CardBus latency timer */
162#define PCI_CB_MEMORY_BASE_0 0x1c
163#define PCI_CB_MEMORY_LIMIT_0 0x20
164#define PCI_CB_MEMORY_BASE_1 0x24
165#define PCI_CB_MEMORY_LIMIT_1 0x28
166#define PCI_CB_IO_BASE_0 0x2c
167#define PCI_CB_IO_BASE_0_HI 0x2e
168#define PCI_CB_IO_LIMIT_0 0x30
169#define PCI_CB_IO_LIMIT_0_HI 0x32
170#define PCI_CB_IO_BASE_1 0x34
171#define PCI_CB_IO_BASE_1_HI 0x36
172#define PCI_CB_IO_LIMIT_1 0x38
173#define PCI_CB_IO_LIMIT_1_HI 0x3a
174#define PCI_CB_IO_RANGE_MASK (~0x03UL)
175/* 0x3c-0x3d are same as for htype 0 */
176#define PCI_CB_BRIDGE_CONTROL 0x3e
177#define PCI_CB_BRIDGE_CTL_PARITY 0x01 /* Similar to standard bridge control register */
178#define PCI_CB_BRIDGE_CTL_SERR 0x02
179#define PCI_CB_BRIDGE_CTL_ISA 0x04
180#define PCI_CB_BRIDGE_CTL_VGA 0x08
181#define PCI_CB_BRIDGE_CTL_MASTER_ABORT 0x20
182#define PCI_CB_BRIDGE_CTL_CB_RESET 0x40 /* CardBus reset */
183#define PCI_CB_BRIDGE_CTL_16BIT_INT 0x80 /* Enable interrupt for 16-bit cards */
184#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM0 0x100 /* Prefetch enable for both memory regions */
185#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM1 0x200
186#define PCI_CB_BRIDGE_CTL_POST_WRITES 0x400
187#define PCI_CB_SUBSYSTEM_VENDOR_ID 0x40
188#define PCI_CB_SUBSYSTEM_ID 0x42
189#define PCI_CB_LEGACY_MODE_BASE 0x44 /* 16-bit PC Card legacy mode base address (ExCa) */
190/* 0x48-0x7f reserved */
191
192/* Capability lists */
193
194#define PCI_CAP_LIST_ID 0 /* Capability ID */
195#define PCI_CAP_ID_PM 0x01 /* Power Management */
196#define PCI_CAP_ID_AGP 0x02 /* Accelerated Graphics Port */
197#define PCI_CAP_ID_VPD 0x03 /* Vital Product Data */
198#define PCI_CAP_ID_SLOTID 0x04 /* Slot Identification */
199#define PCI_CAP_ID_MSI 0x05 /* Message Signalled Interrupts */
200#define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */
201#define PCI_CAP_ID_PCIX 0x07 /* PCI-X */
202#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */
203#define PCI_CAP_ID_EXP 0x10 /* PCI Express */
204#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */
205#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */
206#define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */
207#define PCI_CAP_SIZEOF 4
208
209/* Power Management Registers */
210
211#define PCI_PM_PMC 2 /* PM Capabilities Register */
212#define PCI_PM_CAP_VER_MASK 0x0007 /* Version */
213#define PCI_PM_CAP_PME_CLOCK 0x0008 /* PME clock required */
214#define PCI_PM_CAP_RESERVED 0x0010 /* Reserved field */
215#define PCI_PM_CAP_DSI 0x0020 /* Device specific initialization */
216#define PCI_PM_CAP_AUX_POWER 0x01C0 /* Auxilliary power support mask */
217#define PCI_PM_CAP_D1 0x0200 /* D1 power state support */
218#define PCI_PM_CAP_D2 0x0400 /* D2 power state support */
219#define PCI_PM_CAP_PME 0x0800 /* PME pin supported */
220#define PCI_PM_CAP_PME_MASK 0xF800 /* PME Mask of all supported states */
221#define PCI_PM_CAP_PME_D0 0x0800 /* PME# from D0 */
222#define PCI_PM_CAP_PME_D1 0x1000 /* PME# from D1 */
223#define PCI_PM_CAP_PME_D2 0x2000 /* PME# from D2 */
224#define PCI_PM_CAP_PME_D3 0x4000 /* PME# from D3 (hot) */
225#define PCI_PM_CAP_PME_D3cold 0x8000 /* PME# from D3 (cold) */
226#define PCI_PM_CTRL 4 /* PM control and status register */
227#define PCI_PM_CTRL_STATE_MASK 0x0003 /* Current power state (D0 to D3) */
228#define PCI_PM_CTRL_PME_ENABLE 0x0100 /* PME pin enable */
229#define PCI_PM_CTRL_DATA_SEL_MASK 0x1e00 /* Data select (??) */
230#define PCI_PM_CTRL_DATA_SCALE_MASK 0x6000 /* Data scale (??) */
231#define PCI_PM_CTRL_PME_STATUS 0x8000 /* PME pin status */
232#define PCI_PM_PPB_EXTENSIONS 6 /* PPB support extensions (??) */
233#define PCI_PM_PPB_B2_B3 0x40 /* Stop clock when in D3hot (??) */
234#define PCI_PM_BPCC_ENABLE 0x80 /* Bus power/clock control enable (??) */
235#define PCI_PM_DATA_REGISTER 7 /* (??) */
236#define PCI_PM_SIZEOF 8
237
238/* AGP registers */
239
240#define PCI_AGP_VERSION 2 /* BCD version number */
241#define PCI_AGP_RFU 3 /* Rest of capability flags */
242#define PCI_AGP_STATUS 4 /* Status register */
243#define PCI_AGP_STATUS_RQ_MASK 0xff000000 /* Maximum number of requests - 1 */
244#define PCI_AGP_STATUS_SBA 0x0200 /* Sideband addressing supported */
245#define PCI_AGP_STATUS_64BIT 0x0020 /* 64-bit addressing supported */
246#define PCI_AGP_STATUS_FW 0x0010 /* FW transfers supported */
247#define PCI_AGP_STATUS_RATE4 0x0004 /* 4x transfer rate supported */
248#define PCI_AGP_STATUS_RATE2 0x0002 /* 2x transfer rate supported */
249#define PCI_AGP_STATUS_RATE1 0x0001 /* 1x transfer rate supported */
250#define PCI_AGP_COMMAND 8 /* Control register */
251#define PCI_AGP_COMMAND_RQ_MASK 0xff000000 /* Master: Maximum number of requests */
252#define PCI_AGP_COMMAND_SBA 0x0200 /* Sideband addressing enabled */
253#define PCI_AGP_COMMAND_AGP 0x0100 /* Allow processing of AGP transactions */
254#define PCI_AGP_COMMAND_64BIT 0x0020 /* Allow processing of 64-bit addresses */
255#define PCI_AGP_COMMAND_FW 0x0010 /* Force FW transfers */
256#define PCI_AGP_COMMAND_RATE4 0x0004 /* Use 4x rate */
257#define PCI_AGP_COMMAND_RATE2 0x0002 /* Use 2x rate */
258#define PCI_AGP_COMMAND_RATE1 0x0001 /* Use 1x rate */
259#define PCI_AGP_SIZEOF 12
260
261/* Vital Product Data */
262
263#define PCI_VPD_ADDR 2 /* Address to access (15 bits!) */
264#define PCI_VPD_ADDR_MASK 0x7fff /* Address mask */
265#define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */
266#define PCI_VPD_DATA 4 /* 32-bits of data returned here */
267
268/* Slot Identification */
269
270#define PCI_SID_ESR 2 /* Expansion Slot Register */
271#define PCI_SID_ESR_NSLOTS 0x1f /* Number of expansion slots available */
272#define PCI_SID_ESR_FIC 0x20 /* First In Chassis Flag */
273#define PCI_SID_CHASSIS_NR 3 /* Chassis Number */
274
275/* Message Signalled Interrupts registers */
276
277#define PCI_MSI_FLAGS 2 /* Various flags */
278#define PCI_MSI_FLAGS_64BIT 0x80 /* 64-bit addresses allowed */
279#define PCI_MSI_FLAGS_QSIZE 0x70 /* Message queue size configured */
280#define PCI_MSI_FLAGS_QMASK 0x0e /* Maximum queue size available */
281#define PCI_MSI_FLAGS_ENABLE 0x01 /* MSI feature enabled */
282#define PCI_MSI_FLAGS_MASKBIT 0x100 /* 64-bit mask bits allowed */
283#define PCI_MSI_RFU 3 /* Rest of capability flags */
284#define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */
285#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */
286#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */
287#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */
288#define PCI_MSI_MASK_BIT 16 /* Mask bits register */
289
290/* CompactPCI Hotswap Register */
291
292#define PCI_CHSWP_CSR 2 /* Control and Status Register */
293#define PCI_CHSWP_DHA 0x01 /* Device Hiding Arm */
294#define PCI_CHSWP_EIM 0x02 /* ENUM# Signal Mask */
295#define PCI_CHSWP_PIE 0x04 /* Pending Insert or Extract */
296#define PCI_CHSWP_LOO 0x08 /* LED On / Off */
297#define PCI_CHSWP_PI 0x30 /* Programming Interface */
298#define PCI_CHSWP_EXT 0x40 /* ENUM# status - extraction */
299#define PCI_CHSWP_INS 0x80 /* ENUM# status - insertion */
300
301/* PCI-X registers */
302
303#define PCI_X_CMD 2 /* Modes & Features */
304#define PCI_X_CMD_DPERR_E 0x0001 /* Data Parity Error Recovery Enable */
305#define PCI_X_CMD_ERO 0x0002 /* Enable Relaxed Ordering */
306#define PCI_X_CMD_MAX_READ 0x000c /* Max Memory Read Byte Count */
307#define PCI_X_CMD_MAX_SPLIT 0x0070 /* Max Outstanding Split Transactions */
308#define PCI_X_CMD_VERSION(x) (((x) >> 12) & 3) /* Version */
309#define PCI_X_STATUS 4 /* PCI-X capabilities */
310#define PCI_X_STATUS_DEVFN 0x000000ff /* A copy of devfn */
311#define PCI_X_STATUS_BUS 0x0000ff00 /* A copy of bus nr */
312#define PCI_X_STATUS_64BIT 0x00010000 /* 64-bit device */
313#define PCI_X_STATUS_133MHZ 0x00020000 /* 133 MHz capable */
314#define PCI_X_STATUS_SPL_DISC 0x00040000 /* Split Completion Discarded */
315#define PCI_X_STATUS_UNX_SPL 0x00080000 /* Unexpected Split Completion */
316#define PCI_X_STATUS_COMPLEX 0x00100000 /* Device Complexity */
317#define PCI_X_STATUS_MAX_READ 0x00600000 /* Designed Max Memory Read Count */
318#define PCI_X_STATUS_MAX_SPLIT 0x03800000 /* Designed Max Outstanding Split Transactions */
319#define PCI_X_STATUS_MAX_CUM 0x1c000000 /* Designed Max Cumulative Read Size */
320#define PCI_X_STATUS_SPL_ERR 0x20000000 /* Rcvd Split Completion Error Msg */
321#define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */
322#define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */
323
324/* PCI Express capability registers */
325
326#define PCI_EXP_FLAGS 2 /* Capabilities register */
327#define PCI_EXP_FLAGS_VERS 0x000f /* Capability version */
328#define PCI_EXP_FLAGS_TYPE 0x00f0 /* Device/Port type */
329#define PCI_EXP_TYPE_ENDPOINT 0x0 /* Express Endpoint */
330#define PCI_EXP_TYPE_LEG_END 0x1 /* Legacy Endpoint */
331#define PCI_EXP_TYPE_ROOT_PORT 0x4 /* Root Port */
332#define PCI_EXP_TYPE_UPSTREAM 0x5 /* Upstream Port */
333#define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */
334#define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCI/PCI-X Bridge */
335#define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */
336#define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */
337#define PCI_EXP_DEVCAP 4 /* Device capabilities */
338#define PCI_EXP_DEVCAP_PAYLOAD 0x07 /* Max_Payload_Size */
339#define PCI_EXP_DEVCAP_PHANTOM 0x18 /* Phantom functions */
340#define PCI_EXP_DEVCAP_EXT_TAG 0x20 /* Extended tags */
341#define PCI_EXP_DEVCAP_L0S 0x1c0 /* L0s Acceptable Latency */
342#define PCI_EXP_DEVCAP_L1 0xe00 /* L1 Acceptable Latency */
343#define PCI_EXP_DEVCAP_ATN_BUT 0x1000 /* Attention Button Present */
344#define PCI_EXP_DEVCAP_ATN_IND 0x2000 /* Attention Indicator Present */
345#define PCI_EXP_DEVCAP_PWR_IND 0x4000 /* Power Indicator Present */
346#define PCI_EXP_DEVCAP_PWR_VAL 0x3fc0000 /* Slot Power Limit Value */
347#define PCI_EXP_DEVCAP_PWR_SCL 0xc000000 /* Slot Power Limit Scale */
348#define PCI_EXP_DEVCTL 8 /* Device Control */
349#define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */
350#define PCI_EXP_DEVCTL_NFERE 0x0002 /* Non-Fatal Error Reporting Enable */
351#define PCI_EXP_DEVCTL_FERE 0x0004 /* Fatal Error Reporting Enable */
352#define PCI_EXP_DEVCTL_URRE 0x0008 /* Unsupported Request Reporting En. */
353#define PCI_EXP_DEVCTL_RELAX_EN 0x0010 /* Enable relaxed ordering */
354#define PCI_EXP_DEVCTL_PAYLOAD 0x00e0 /* Max_Payload_Size */
355#define PCI_EXP_DEVCTL_EXT_TAG 0x0100 /* Extended Tag Field Enable */
356#define PCI_EXP_DEVCTL_PHANTOM 0x0200 /* Phantom Functions Enable */
357#define PCI_EXP_DEVCTL_AUX_PME 0x0400 /* Auxiliary Power PM Enable */
358#define PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800 /* Enable No Snoop */
359#define PCI_EXP_DEVCTL_READRQ 0x7000 /* Max_Read_Request_Size */
360#define PCI_EXP_DEVSTA 10 /* Device Status */
361#define PCI_EXP_DEVSTA_CED 0x01 /* Correctable Error Detected */
362#define PCI_EXP_DEVSTA_NFED 0x02 /* Non-Fatal Error Detected */
363#define PCI_EXP_DEVSTA_FED 0x04 /* Fatal Error Detected */
364#define PCI_EXP_DEVSTA_URD 0x08 /* Unsupported Request Detected */
365#define PCI_EXP_DEVSTA_AUXPD 0x10 /* AUX Power Detected */
366#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */
367#define PCI_EXP_LNKCAP 12 /* Link Capabilities */
368#define PCI_EXP_LNKCTL 16 /* Link Control */
369#define PCI_EXP_LNKSTA 18 /* Link Status */
370#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */
371#define PCI_EXP_SLTCTL 24 /* Slot Control */
372#define PCI_EXP_SLTSTA 26 /* Slot Status */
373#define PCI_EXP_RTCTL 28 /* Root Control */
374#define PCI_EXP_RTCTL_SECEE 0x01 /* System Error on Correctable Error */
375#define PCI_EXP_RTCTL_SENFEE 0x02 /* System Error on Non-Fatal Error */
376#define PCI_EXP_RTCTL_SEFEE 0x04 /* System Error on Fatal Error */
377#define PCI_EXP_RTCTL_PMEIE 0x08 /* PME Interrupt Enable */
378#define PCI_EXP_RTCTL_CRSSVE 0x10 /* CRS Software Visibility Enable */
379#define PCI_EXP_RTCAP 30 /* Root Capabilities */
380#define PCI_EXP_RTSTA 32 /* Root Status */
381
382/* Extended Capabilities (PCI-X 2.0 and Express) */
383#define PCI_EXT_CAP_ID(header) (header & 0x0000ffff)
384#define PCI_EXT_CAP_VER(header) ((header >> 16) & 0xf)
385#define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc)
386
387#define PCI_EXT_CAP_ID_ERR 1
388#define PCI_EXT_CAP_ID_VC 2
389#define PCI_EXT_CAP_ID_DSN 3
390#define PCI_EXT_CAP_ID_PWR 4
391
392/* Advanced Error Reporting */
393#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */
394#define PCI_ERR_UNC_TRAIN 0x00000001 /* Training */
395#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */
396#define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */
397#define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */
398#define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */
399#define PCI_ERR_UNC_COMP_ABORT 0x00008000 /* Completer Abort */
400#define PCI_ERR_UNC_UNX_COMP 0x00010000 /* Unexpected Completion */
401#define PCI_ERR_UNC_RX_OVER 0x00020000 /* Receiver Overflow */
402#define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */
403#define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */
404#define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */
405#define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */
406 /* Same bits as above */
407#define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */
408 /* Same bits as above */
409#define PCI_ERR_COR_STATUS 16 /* Correctable Error Status */
410#define PCI_ERR_COR_RCVR 0x00000001 /* Receiver Error Status */
411#define PCI_ERR_COR_BAD_TLP 0x00000040 /* Bad TLP Status */
412#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */
413#define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */
414#define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */
415#define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */
416 /* Same bits as above */
417#define PCI_ERR_CAP 24 /* Advanced Error Capabilities */
418#define PCI_ERR_CAP_FEP(x) ((x) & 31) /* First Error Pointer */
419#define PCI_ERR_CAP_ECRC_GENC 0x00000020 /* ECRC Generation Capable */
420#define PCI_ERR_CAP_ECRC_GENE 0x00000040 /* ECRC Generation Enable */
421#define PCI_ERR_CAP_ECRC_CHKC 0x00000080 /* ECRC Check Capable */
422#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */
423#define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */
424#define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */
425#define PCI_ERR_ROOT_STATUS 48
426#define PCI_ERR_ROOT_COR_SRC 52
427#define PCI_ERR_ROOT_SRC 54
428
429/* Virtual Channel */
430#define PCI_VC_PORT_REG1 4
431#define PCI_VC_PORT_REG2 8
432#define PCI_VC_PORT_CTRL 12
433#define PCI_VC_PORT_STATUS 14
434#define PCI_VC_RES_CAP 16
435#define PCI_VC_RES_CTRL 20
436#define PCI_VC_RES_STATUS 26
437
438/* Power Budgeting */
439#define PCI_PWR_DSR 4 /* Data Select Register */
440#define PCI_PWR_DATA 8 /* Data Register */
441#define PCI_PWR_DATA_BASE(x) ((x) & 0xff) /* Base Power */
442#define PCI_PWR_DATA_SCALE(x) (((x) >> 8) & 3) /* Data Scale */
443#define PCI_PWR_DATA_PM_SUB(x) (((x) >> 10) & 7) /* PM Sub State */
444#define PCI_PWR_DATA_PM_STATE(x) (((x) >> 13) & 3) /* PM State */
445#define PCI_PWR_DATA_TYPE(x) (((x) >> 15) & 7) /* Type */
446#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */
447#define PCI_PWR_CAP 12 /* Capability */
448#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */
449 24
450/* Include the ID list */ 25/* Include the ID list */
451
452#include <linux/pci_ids.h> 26#include <linux/pci_ids.h>
453 27
454/* 28/*
@@ -496,11 +70,12 @@ enum pci_mmap_state {
496 70
497typedef int __bitwise pci_power_t; 71typedef int __bitwise pci_power_t;
498 72
499#define PCI_D0 ((pci_power_t __force) 0) 73#define PCI_D0 ((pci_power_t __force) 0)
500#define PCI_D1 ((pci_power_t __force) 1) 74#define PCI_D1 ((pci_power_t __force) 1)
501#define PCI_D2 ((pci_power_t __force) 2) 75#define PCI_D2 ((pci_power_t __force) 2)
502#define PCI_D3hot ((pci_power_t __force) 3) 76#define PCI_D3hot ((pci_power_t __force) 3)
503#define PCI_D3cold ((pci_power_t __force) 4) 77#define PCI_D3cold ((pci_power_t __force) 4)
78#define PCI_UNKNOWN ((pci_power_t __force) 5)
504#define PCI_POWER_ERROR ((pci_power_t __force) -1) 79#define PCI_POWER_ERROR ((pci_power_t __force) -1)
505 80
506/* 81/*
@@ -562,11 +137,6 @@ struct pci_dev {
562 struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ 137 struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */
563 int rom_attr_enabled; /* has display of the rom attribute been enabled? */ 138 int rom_attr_enabled; /* has display of the rom attribute been enabled? */
564 struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */ 139 struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */
565#ifdef CONFIG_PCI_NAMES
566#define PCI_NAME_SIZE 255
567#define PCI_NAME_HALF __stringify(43) /* less than half to handle slop */
568 char pretty_name[PCI_NAME_SIZE]; /* pretty name for users to see */
569#endif
570}; 140};
571 141
572#define pci_dev_g(n) list_entry(n, struct pci_dev, global_list) 142#define pci_dev_g(n) list_entry(n, struct pci_dev, global_list)
@@ -582,15 +152,15 @@ struct pci_dev {
582 * 7-10 bridges: address space assigned to buses behind the bridge 152 * 7-10 bridges: address space assigned to buses behind the bridge
583 */ 153 */
584 154
585#define PCI_ROM_RESOURCE 6 155#define PCI_ROM_RESOURCE 6
586#define PCI_BRIDGE_RESOURCES 7 156#define PCI_BRIDGE_RESOURCES 7
587#define PCI_NUM_RESOURCES 11 157#define PCI_NUM_RESOURCES 11
588 158
589#ifndef PCI_BUS_NUM_RESOURCES 159#ifndef PCI_BUS_NUM_RESOURCES
590#define PCI_BUS_NUM_RESOURCES 8 160#define PCI_BUS_NUM_RESOURCES 8
591#endif 161#endif
592 162
593#define PCI_REGION_FLAG_MASK 0x0fU /* These bits of resource flags tell us the PCI region flags */ 163#define PCI_REGION_FLAG_MASK 0x0fU /* These bits of resource flags tell us the PCI region flags */
594 164
595struct pci_bus { 165struct pci_bus {
596 struct list_head node; /* node in list of buses */ 166 struct list_head node; /* node in list of buses */
@@ -699,7 +269,7 @@ struct pci_driver {
699 * @dev_class_mask: the class mask for this device 269 * @dev_class_mask: the class mask for this device
700 * 270 *
701 * This macro is used to create a struct pci_device_id that matches a 271 * This macro is used to create a struct pci_device_id that matches a
702 * specific PCI class. The vendor, device, subvendor, and subdevice 272 * specific PCI class. The vendor, device, subvendor, and subdevice
703 * fields will be set to PCI_ANY_ID. 273 * fields will be set to PCI_ANY_ID.
704 */ 274 */
705#define PCI_DEVICE_CLASS(dev_class,dev_class_mask) \ 275#define PCI_DEVICE_CLASS(dev_class,dev_class_mask) \
@@ -707,7 +277,7 @@ struct pci_driver {
707 .vendor = PCI_ANY_ID, .device = PCI_ANY_ID, \ 277 .vendor = PCI_ANY_ID, .device = PCI_ANY_ID, \
708 .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID 278 .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID
709 279
710/* 280/*
711 * pci_module_init is obsolete, this stays here till we fix up all usages of it 281 * pci_module_init is obsolete, this stays here till we fix up all usages of it
712 * in the tree. 282 * in the tree.
713 */ 283 */
@@ -745,12 +315,13 @@ static inline struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *s
745 pci_bus_add_devices(root_bus); 315 pci_bus_add_devices(root_bus);
746 return root_bus; 316 return root_bus;
747} 317}
318struct pci_bus *pci_create_bus(struct device *parent, int bus, struct pci_ops *ops, void *sysdata);
319struct pci_bus * pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr);
748int pci_scan_slot(struct pci_bus *bus, int devfn); 320int pci_scan_slot(struct pci_bus *bus, int devfn);
749struct pci_dev * pci_scan_single_device(struct pci_bus *bus, int devfn); 321struct pci_dev * pci_scan_single_device(struct pci_bus *bus, int devfn);
322void pci_device_add(struct pci_dev *dev, struct pci_bus *bus);
750unsigned int pci_scan_child_bus(struct pci_bus *bus); 323unsigned int pci_scan_child_bus(struct pci_bus *bus);
751void pci_bus_add_device(struct pci_dev *dev); 324void pci_bus_add_device(struct pci_dev *dev);
752void pci_name_device(struct pci_dev *dev);
753char *pci_class_name(u32 class);
754void pci_read_bridge_bases(struct pci_bus *child); 325void pci_read_bridge_bases(struct pci_bus *child);
755struct resource *pci_find_parent_resource(const struct pci_dev *dev, struct resource *res); 326struct resource *pci_find_parent_resource(const struct pci_dev *dev, struct resource *res);
756int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge); 327int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge);
@@ -758,6 +329,7 @@ extern struct pci_dev *pci_dev_get(struct pci_dev *dev);
758extern void pci_dev_put(struct pci_dev *dev); 329extern void pci_dev_put(struct pci_dev *dev);
759extern void pci_remove_bus(struct pci_bus *b); 330extern void pci_remove_bus(struct pci_bus *b);
760extern void pci_remove_bus_device(struct pci_dev *dev); 331extern void pci_remove_bus_device(struct pci_dev *dev);
332void pci_setup_cardbus(struct pci_bus *bus);
761 333
762/* Generic PCI functions exported to card drivers */ 334/* Generic PCI functions exported to card drivers */
763 335
@@ -815,13 +387,16 @@ void pci_set_master(struct pci_dev *dev);
815#define HAVE_PCI_SET_MWI 387#define HAVE_PCI_SET_MWI
816int pci_set_mwi(struct pci_dev *dev); 388int pci_set_mwi(struct pci_dev *dev);
817void pci_clear_mwi(struct pci_dev *dev); 389void pci_clear_mwi(struct pci_dev *dev);
390void pci_intx(struct pci_dev *dev, int enable);
818int pci_set_dma_mask(struct pci_dev *dev, u64 mask); 391int pci_set_dma_mask(struct pci_dev *dev, u64 mask);
819int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); 392int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask);
393void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno);
820int pci_assign_resource(struct pci_dev *dev, int i); 394int pci_assign_resource(struct pci_dev *dev, int i);
395void pci_restore_bars(struct pci_dev *dev);
821 396
822/* ROM control related routines */ 397/* ROM control related routines */
823void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size); 398void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size);
824void __iomem *pci_map_rom_copy(struct pci_dev *pdev, size_t *size); 399void __iomem __must_check *pci_map_rom_copy(struct pci_dev *pdev, size_t *size);
825void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom); 400void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom);
826void pci_remove_rom(struct pci_dev *pdev); 401void pci_remove_rom(struct pci_dev *pdev);
827 402
@@ -865,6 +440,9 @@ const struct pci_device_id *pci_match_device(struct pci_driver *drv, struct pci_
865const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, struct pci_dev *dev); 440const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, struct pci_dev *dev);
866int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass); 441int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass);
867 442
443void pci_walk_bus(struct pci_bus *top, void (*cb)(struct pci_dev *, void *),
444 void *userdata);
445
868/* kmem_cache style wrapper around pci_alloc_consistent() */ 446/* kmem_cache style wrapper around pci_alloc_consistent() */
869 447
870#include <linux/dmapool.h> 448#include <linux/dmapool.h>
@@ -912,18 +490,26 @@ extern void pci_disable_msix(struct pci_dev *dev);
912extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); 490extern void msi_remove_pci_irq_vectors(struct pci_dev *dev);
913#endif 491#endif
914 492
915#endif /* CONFIG_PCI */ 493/*
916 494 * PCI domain support. Sometimes called PCI segment (eg by ACPI),
917/* Include architecture-dependent settings and functions */ 495 * a PCI domain is defined to be a set of PCI busses which share
496 * configuration space.
497 */
498#ifndef CONFIG_PCI_DOMAINS
499static inline int pci_domain_nr(struct pci_bus *bus) { return 0; }
500static inline int pci_proc_domain(struct pci_bus *bus)
501{
502 return 0;
503}
504#endif
918 505
919#include <asm/pci.h> 506#else /* CONFIG_PCI is not enabled */
920 507
921/* 508/*
922 * If the system does not have PCI, clearly these return errors. Define 509 * If the system does not have PCI, clearly these return errors. Define
923 * these as simple inline functions to avoid hair in drivers. 510 * these as simple inline functions to avoid hair in drivers.
924 */ 511 */
925 512
926#ifndef CONFIG_PCI
927#define _PCI_NOP(o,s,t) \ 513#define _PCI_NOP(o,s,t) \
928 static inline int pci_##o##_config_##s (struct pci_dev *dev, int where, t val) \ 514 static inline int pci_##o##_config_##s (struct pci_dev *dev, int where, t val) \
929 { return PCIBIOS_FUNC_NOT_SUPPORTED; } 515 { return PCIBIOS_FUNC_NOT_SUPPORTED; }
@@ -974,21 +560,11 @@ static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int en
974 560
975#define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) 561#define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0)
976 562
977#else 563#endif /* CONFIG_PCI */
978 564
979/* 565/* Include architecture-dependent settings and functions */
980 * PCI domain support. Sometimes called PCI segment (eg by ACPI), 566
981 * a PCI domain is defined to be a set of PCI busses which share 567#include <asm/pci.h>
982 * configuration space.
983 */
984#ifndef CONFIG_PCI_DOMAINS
985static inline int pci_domain_nr(struct pci_bus *bus) { return 0; }
986static inline int pci_proc_domain(struct pci_bus *bus)
987{
988 return 0;
989}
990#endif
991#endif /* !CONFIG_PCI */
992 568
993/* these helpers provide future and backwards compatibility 569/* these helpers provide future and backwards compatibility
994 * for accessing popular PCI BAR info */ 570 * for accessing popular PCI BAR info */
@@ -1025,13 +601,6 @@ static inline char *pci_name(struct pci_dev *pdev)
1025 return pdev->dev.bus_id; 601 return pdev->dev.bus_id;
1026} 602}
1027 603
1028/* Some archs want to see the pretty pci name, so use this macro */
1029#ifdef CONFIG_PCI_NAMES
1030#define pci_pretty_name(dev) ((dev)->pretty_name)
1031#else
1032#define pci_pretty_name(dev) ""
1033#endif
1034
1035 604
1036/* Some archs don't want to expose struct resource to userland as-is 605/* Some archs don't want to expose struct resource to userland as-is
1037 * in sysfs and /proc 606 * in sysfs and /proc
@@ -1067,7 +636,7 @@ enum pci_fixup_pass {
1067 636
1068/* Anonymous variables would be nice... */ 637/* Anonymous variables would be nice... */
1069#define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, hook) \ 638#define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, hook) \
1070 static struct pci_fixup __pci_fixup_##name __attribute_used__ \ 639 static const struct pci_fixup __pci_fixup_##name __attribute_used__ \
1071 __attribute__((__section__(#section))) = { vendor, device, hook }; 640 __attribute__((__section__(#section))) = { vendor, device, hook };
1072#define DECLARE_PCI_FIXUP_EARLY(vendor, device, hook) \ 641#define DECLARE_PCI_FIXUP_EARLY(vendor, device, hook) \
1073 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ 642 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index d513c1634006..ee0ab7a5f91b 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1612,6 +1612,7 @@
1612#define PCI_DEVICE_ID_TOSHIBA_TC35815CF 0x0030 1612#define PCI_DEVICE_ID_TOSHIBA_TC35815CF 0x0030
1613#define PCI_DEVICE_ID_TOSHIBA_TX4927 0x0180 1613#define PCI_DEVICE_ID_TOSHIBA_TX4927 0x0180
1614#define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108 1614#define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108
1615#define PCI_DEVICE_ID_TOSHIBA_SPIDER_NET 0x01b3
1615 1616
1616#define PCI_VENDOR_ID_RICOH 0x1180 1617#define PCI_VENDOR_ID_RICOH 0x1180
1617#define PCI_DEVICE_ID_RICOH_RL5C465 0x0465 1618#define PCI_DEVICE_ID_RICOH_RL5C465 0x0465
@@ -2147,6 +2148,9 @@
2147#define PCI_DEVICE_ID_ENE_1420 0x1420 2148#define PCI_DEVICE_ID_ENE_1420 0x1420
2148#define PCI_VENDOR_ID_CHELSIO 0x1425 2149#define PCI_VENDOR_ID_CHELSIO 0x1425
2149 2150
2151#define PCI_VENDOR_ID_MIPS 0x153f
2152#define PCI_DEVICE_ID_SOC_IT 0x0001
2153
2150#define PCI_VENDOR_ID_SYBA 0x1592 2154#define PCI_VENDOR_ID_SYBA 0x1592
2151#define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782 2155#define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782
2152#define PCI_DEVICE_ID_SYBA_1P_ECP 0x0783 2156#define PCI_DEVICE_ID_SYBA_1P_ECP 0x0783
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
new file mode 100644
index 000000000000..e2a089b051ed
--- /dev/null
+++ b/include/linux/pci_regs.h
@@ -0,0 +1,448 @@
1/*
2 * pci_regs.h
3 *
4 * PCI standard defines
5 * Copyright 1994, Drew Eckhardt
6 * Copyright 1997--1999 Martin Mares <mj@ucw.cz>
7 *
8 * For more information, please consult the following manuals (look at
9 * http://www.pcisig.com/ for how to get them):
10 *
11 * PCI BIOS Specification
12 * PCI Local Bus Specification
13 * PCI to PCI Bridge Specification
14 * PCI System Design Guide
15 */
16
17#ifndef LINUX_PCI_REGS_H
18#define LINUX_PCI_REGS_H
19
20/*
21 * Under PCI, each device has 256 bytes of configuration address space,
22 * of which the first 64 bytes are standardized as follows:
23 */
24#define PCI_VENDOR_ID 0x00 /* 16 bits */
25#define PCI_DEVICE_ID 0x02 /* 16 bits */
26#define PCI_COMMAND 0x04 /* 16 bits */
27#define PCI_COMMAND_IO 0x1 /* Enable response in I/O space */
28#define PCI_COMMAND_MEMORY 0x2 /* Enable response in Memory space */
29#define PCI_COMMAND_MASTER 0x4 /* Enable bus mastering */
30#define PCI_COMMAND_SPECIAL 0x8 /* Enable response to special cycles */
31#define PCI_COMMAND_INVALIDATE 0x10 /* Use memory write and invalidate */
32#define PCI_COMMAND_VGA_PALETTE 0x20 /* Enable palette snooping */
33#define PCI_COMMAND_PARITY 0x40 /* Enable parity checking */
34#define PCI_COMMAND_WAIT 0x80 /* Enable address/data stepping */
35#define PCI_COMMAND_SERR 0x100 /* Enable SERR */
36#define PCI_COMMAND_FAST_BACK 0x200 /* Enable back-to-back writes */
37#define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */
38
39#define PCI_STATUS 0x06 /* 16 bits */
40#define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */
41#define PCI_STATUS_66MHZ 0x20 /* Support 66 Mhz PCI 2.1 bus */
42#define PCI_STATUS_UDF 0x40 /* Support User Definable Features [obsolete] */
43#define PCI_STATUS_FAST_BACK 0x80 /* Accept fast-back to back */
44#define PCI_STATUS_PARITY 0x100 /* Detected parity error */
45#define PCI_STATUS_DEVSEL_MASK 0x600 /* DEVSEL timing */
46#define PCI_STATUS_DEVSEL_FAST 0x000
47#define PCI_STATUS_DEVSEL_MEDIUM 0x200
48#define PCI_STATUS_DEVSEL_SLOW 0x400
49#define PCI_STATUS_SIG_TARGET_ABORT 0x800 /* Set on target abort */
50#define PCI_STATUS_REC_TARGET_ABORT 0x1000 /* Master ack of " */
51#define PCI_STATUS_REC_MASTER_ABORT 0x2000 /* Set on master abort */
52#define PCI_STATUS_SIG_SYSTEM_ERROR 0x4000 /* Set when we drive SERR */
53#define PCI_STATUS_DETECTED_PARITY 0x8000 /* Set on parity error */
54
55#define PCI_CLASS_REVISION 0x08 /* High 24 bits are class, low 8 revision */
56#define PCI_REVISION_ID 0x08 /* Revision ID */
57#define PCI_CLASS_PROG 0x09 /* Reg. Level Programming Interface */
58#define PCI_CLASS_DEVICE 0x0a /* Device class */
59
60#define PCI_CACHE_LINE_SIZE 0x0c /* 8 bits */
61#define PCI_LATENCY_TIMER 0x0d /* 8 bits */
62#define PCI_HEADER_TYPE 0x0e /* 8 bits */
63#define PCI_HEADER_TYPE_NORMAL 0
64#define PCI_HEADER_TYPE_BRIDGE 1
65#define PCI_HEADER_TYPE_CARDBUS 2
66
67#define PCI_BIST 0x0f /* 8 bits */
68#define PCI_BIST_CODE_MASK 0x0f /* Return result */
69#define PCI_BIST_START 0x40 /* 1 to start BIST, 2 secs or less */
70#define PCI_BIST_CAPABLE 0x80 /* 1 if BIST capable */
71
72/*
73 * Base addresses specify locations in memory or I/O space.
74 * Decoded size can be determined by writing a value of
75 * 0xffffffff to the register, and reading it back. Only
76 * 1 bits are decoded.
77 */
78#define PCI_BASE_ADDRESS_0 0x10 /* 32 bits */
79#define PCI_BASE_ADDRESS_1 0x14 /* 32 bits [htype 0,1 only] */
80#define PCI_BASE_ADDRESS_2 0x18 /* 32 bits [htype 0 only] */
81#define PCI_BASE_ADDRESS_3 0x1c /* 32 bits */
82#define PCI_BASE_ADDRESS_4 0x20 /* 32 bits */
83#define PCI_BASE_ADDRESS_5 0x24 /* 32 bits */
84#define PCI_BASE_ADDRESS_SPACE 0x01 /* 0 = memory, 1 = I/O */
85#define PCI_BASE_ADDRESS_SPACE_IO 0x01
86#define PCI_BASE_ADDRESS_SPACE_MEMORY 0x00
87#define PCI_BASE_ADDRESS_MEM_TYPE_MASK 0x06
88#define PCI_BASE_ADDRESS_MEM_TYPE_32 0x00 /* 32 bit address */
89#define PCI_BASE_ADDRESS_MEM_TYPE_1M 0x02 /* Below 1M [obsolete] */
90#define PCI_BASE_ADDRESS_MEM_TYPE_64 0x04 /* 64 bit address */
91#define PCI_BASE_ADDRESS_MEM_PREFETCH 0x08 /* prefetchable? */
92#define PCI_BASE_ADDRESS_MEM_MASK (~0x0fUL)
93#define PCI_BASE_ADDRESS_IO_MASK (~0x03UL)
94/* bit 1 is reserved if address_space = 1 */
95
96/* Header type 0 (normal devices) */
97#define PCI_CARDBUS_CIS 0x28
98#define PCI_SUBSYSTEM_VENDOR_ID 0x2c
99#define PCI_SUBSYSTEM_ID 0x2e
100#define PCI_ROM_ADDRESS 0x30 /* Bits 31..11 are address, 10..1 reserved */
101#define PCI_ROM_ADDRESS_ENABLE 0x01
102#define PCI_ROM_ADDRESS_MASK (~0x7ffUL)
103
104#define PCI_CAPABILITY_LIST 0x34 /* Offset of first capability list entry */
105
106/* 0x35-0x3b are reserved */
107#define PCI_INTERRUPT_LINE 0x3c /* 8 bits */
108#define PCI_INTERRUPT_PIN 0x3d /* 8 bits */
109#define PCI_MIN_GNT 0x3e /* 8 bits */
110#define PCI_MAX_LAT 0x3f /* 8 bits */
111
112/* Header type 1 (PCI-to-PCI bridges) */
113#define PCI_PRIMARY_BUS 0x18 /* Primary bus number */
114#define PCI_SECONDARY_BUS 0x19 /* Secondary bus number */
115#define PCI_SUBORDINATE_BUS 0x1a /* Highest bus number behind the bridge */
116#define PCI_SEC_LATENCY_TIMER 0x1b /* Latency timer for secondary interface */
117#define PCI_IO_BASE 0x1c /* I/O range behind the bridge */
118#define PCI_IO_LIMIT 0x1d
119#define PCI_IO_RANGE_TYPE_MASK 0x0fUL /* I/O bridging type */
120#define PCI_IO_RANGE_TYPE_16 0x00
121#define PCI_IO_RANGE_TYPE_32 0x01
122#define PCI_IO_RANGE_MASK (~0x0fUL)
123#define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */
124#define PCI_MEMORY_BASE 0x20 /* Memory range behind */
125#define PCI_MEMORY_LIMIT 0x22
126#define PCI_MEMORY_RANGE_TYPE_MASK 0x0fUL
127#define PCI_MEMORY_RANGE_MASK (~0x0fUL)
128#define PCI_PREF_MEMORY_BASE 0x24 /* Prefetchable memory range behind */
129#define PCI_PREF_MEMORY_LIMIT 0x26
130#define PCI_PREF_RANGE_TYPE_MASK 0x0fUL
131#define PCI_PREF_RANGE_TYPE_32 0x00
132#define PCI_PREF_RANGE_TYPE_64 0x01
133#define PCI_PREF_RANGE_MASK (~0x0fUL)
134#define PCI_PREF_BASE_UPPER32 0x28 /* Upper half of prefetchable memory range */
135#define PCI_PREF_LIMIT_UPPER32 0x2c
136#define PCI_IO_BASE_UPPER16 0x30 /* Upper half of I/O addresses */
137#define PCI_IO_LIMIT_UPPER16 0x32
138/* 0x34 same as for htype 0 */
139/* 0x35-0x3b is reserved */
140#define PCI_ROM_ADDRESS1 0x38 /* Same as PCI_ROM_ADDRESS, but for htype 1 */
141/* 0x3c-0x3d are same as for htype 0 */
142#define PCI_BRIDGE_CONTROL 0x3e
143#define PCI_BRIDGE_CTL_PARITY 0x01 /* Enable parity detection on secondary interface */
144#define PCI_BRIDGE_CTL_SERR 0x02 /* The same for SERR forwarding */
145#define PCI_BRIDGE_CTL_NO_ISA 0x04 /* Disable bridging of ISA ports */
146#define PCI_BRIDGE_CTL_VGA 0x08 /* Forward VGA addresses */
147#define PCI_BRIDGE_CTL_MASTER_ABORT 0x20 /* Report master aborts */
148#define PCI_BRIDGE_CTL_BUS_RESET 0x40 /* Secondary bus reset */
149#define PCI_BRIDGE_CTL_FAST_BACK 0x80 /* Fast Back2Back enabled on secondary interface */
150
151/* Header type 2 (CardBus bridges) */
152#define PCI_CB_CAPABILITY_LIST 0x14
153/* 0x15 reserved */
154#define PCI_CB_SEC_STATUS 0x16 /* Secondary status */
155#define PCI_CB_PRIMARY_BUS 0x18 /* PCI bus number */
156#define PCI_CB_CARD_BUS 0x19 /* CardBus bus number */
157#define PCI_CB_SUBORDINATE_BUS 0x1a /* Subordinate bus number */
158#define PCI_CB_LATENCY_TIMER 0x1b /* CardBus latency timer */
159#define PCI_CB_MEMORY_BASE_0 0x1c
160#define PCI_CB_MEMORY_LIMIT_0 0x20
161#define PCI_CB_MEMORY_BASE_1 0x24
162#define PCI_CB_MEMORY_LIMIT_1 0x28
163#define PCI_CB_IO_BASE_0 0x2c
164#define PCI_CB_IO_BASE_0_HI 0x2e
165#define PCI_CB_IO_LIMIT_0 0x30
166#define PCI_CB_IO_LIMIT_0_HI 0x32
167#define PCI_CB_IO_BASE_1 0x34
168#define PCI_CB_IO_BASE_1_HI 0x36
169#define PCI_CB_IO_LIMIT_1 0x38
170#define PCI_CB_IO_LIMIT_1_HI 0x3a
171#define PCI_CB_IO_RANGE_MASK (~0x03UL)
172/* 0x3c-0x3d are same as for htype 0 */
173#define PCI_CB_BRIDGE_CONTROL 0x3e
174#define PCI_CB_BRIDGE_CTL_PARITY 0x01 /* Similar to standard bridge control register */
175#define PCI_CB_BRIDGE_CTL_SERR 0x02
176#define PCI_CB_BRIDGE_CTL_ISA 0x04
177#define PCI_CB_BRIDGE_CTL_VGA 0x08
178#define PCI_CB_BRIDGE_CTL_MASTER_ABORT 0x20
179#define PCI_CB_BRIDGE_CTL_CB_RESET 0x40 /* CardBus reset */
180#define PCI_CB_BRIDGE_CTL_16BIT_INT 0x80 /* Enable interrupt for 16-bit cards */
181#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM0 0x100 /* Prefetch enable for both memory regions */
182#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM1 0x200
183#define PCI_CB_BRIDGE_CTL_POST_WRITES 0x400
184#define PCI_CB_SUBSYSTEM_VENDOR_ID 0x40
185#define PCI_CB_SUBSYSTEM_ID 0x42
186#define PCI_CB_LEGACY_MODE_BASE 0x44 /* 16-bit PC Card legacy mode base address (ExCa) */
187/* 0x48-0x7f reserved */
188
189/* Capability lists */
190
191#define PCI_CAP_LIST_ID 0 /* Capability ID */
192#define PCI_CAP_ID_PM 0x01 /* Power Management */
193#define PCI_CAP_ID_AGP 0x02 /* Accelerated Graphics Port */
194#define PCI_CAP_ID_VPD 0x03 /* Vital Product Data */
195#define PCI_CAP_ID_SLOTID 0x04 /* Slot Identification */
196#define PCI_CAP_ID_MSI 0x05 /* Message Signalled Interrupts */
197#define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */
198#define PCI_CAP_ID_PCIX 0x07 /* PCI-X */
199#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */
200#define PCI_CAP_ID_EXP 0x10 /* PCI Express */
201#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */
202#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */
203#define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */
204#define PCI_CAP_SIZEOF 4
205
206/* Power Management Registers */
207
208#define PCI_PM_PMC 2 /* PM Capabilities Register */
209#define PCI_PM_CAP_VER_MASK 0x0007 /* Version */
210#define PCI_PM_CAP_PME_CLOCK 0x0008 /* PME clock required */
211#define PCI_PM_CAP_RESERVED 0x0010 /* Reserved field */
212#define PCI_PM_CAP_DSI 0x0020 /* Device specific initialization */
213#define PCI_PM_CAP_AUX_POWER 0x01C0 /* Auxilliary power support mask */
214#define PCI_PM_CAP_D1 0x0200 /* D1 power state support */
215#define PCI_PM_CAP_D2 0x0400 /* D2 power state support */
216#define PCI_PM_CAP_PME 0x0800 /* PME pin supported */
217#define PCI_PM_CAP_PME_MASK 0xF800 /* PME Mask of all supported states */
218#define PCI_PM_CAP_PME_D0 0x0800 /* PME# from D0 */
219#define PCI_PM_CAP_PME_D1 0x1000 /* PME# from D1 */
220#define PCI_PM_CAP_PME_D2 0x2000 /* PME# from D2 */
221#define PCI_PM_CAP_PME_D3 0x4000 /* PME# from D3 (hot) */
222#define PCI_PM_CAP_PME_D3cold 0x8000 /* PME# from D3 (cold) */
223#define PCI_PM_CTRL 4 /* PM control and status register */
224#define PCI_PM_CTRL_STATE_MASK 0x0003 /* Current power state (D0 to D3) */
225#define PCI_PM_CTRL_NO_SOFT_RESET 0x0004 /* No reset for D3hot->D0 */
226#define PCI_PM_CTRL_PME_ENABLE 0x0100 /* PME pin enable */
227#define PCI_PM_CTRL_DATA_SEL_MASK 0x1e00 /* Data select (??) */
228#define PCI_PM_CTRL_DATA_SCALE_MASK 0x6000 /* Data scale (??) */
229#define PCI_PM_CTRL_PME_STATUS 0x8000 /* PME pin status */
230#define PCI_PM_PPB_EXTENSIONS 6 /* PPB support extensions (??) */
231#define PCI_PM_PPB_B2_B3 0x40 /* Stop clock when in D3hot (??) */
232#define PCI_PM_BPCC_ENABLE 0x80 /* Bus power/clock control enable (??) */
233#define PCI_PM_DATA_REGISTER 7 /* (??) */
234#define PCI_PM_SIZEOF 8
235
236/* AGP registers */
237
238#define PCI_AGP_VERSION 2 /* BCD version number */
239#define PCI_AGP_RFU 3 /* Rest of capability flags */
240#define PCI_AGP_STATUS 4 /* Status register */
241#define PCI_AGP_STATUS_RQ_MASK 0xff000000 /* Maximum number of requests - 1 */
242#define PCI_AGP_STATUS_SBA 0x0200 /* Sideband addressing supported */
243#define PCI_AGP_STATUS_64BIT 0x0020 /* 64-bit addressing supported */
244#define PCI_AGP_STATUS_FW 0x0010 /* FW transfers supported */
245#define PCI_AGP_STATUS_RATE4 0x0004 /* 4x transfer rate supported */
246#define PCI_AGP_STATUS_RATE2 0x0002 /* 2x transfer rate supported */
247#define PCI_AGP_STATUS_RATE1 0x0001 /* 1x transfer rate supported */
248#define PCI_AGP_COMMAND 8 /* Control register */
249#define PCI_AGP_COMMAND_RQ_MASK 0xff000000 /* Master: Maximum number of requests */
250#define PCI_AGP_COMMAND_SBA 0x0200 /* Sideband addressing enabled */
251#define PCI_AGP_COMMAND_AGP 0x0100 /* Allow processing of AGP transactions */
252#define PCI_AGP_COMMAND_64BIT 0x0020 /* Allow processing of 64-bit addresses */
253#define PCI_AGP_COMMAND_FW 0x0010 /* Force FW transfers */
254#define PCI_AGP_COMMAND_RATE4 0x0004 /* Use 4x rate */
255#define PCI_AGP_COMMAND_RATE2 0x0002 /* Use 2x rate */
256#define PCI_AGP_COMMAND_RATE1 0x0001 /* Use 1x rate */
257#define PCI_AGP_SIZEOF 12
258
259/* Vital Product Data */
260
261#define PCI_VPD_ADDR 2 /* Address to access (15 bits!) */
262#define PCI_VPD_ADDR_MASK 0x7fff /* Address mask */
263#define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */
264#define PCI_VPD_DATA 4 /* 32-bits of data returned here */
265
266/* Slot Identification */
267
268#define PCI_SID_ESR 2 /* Expansion Slot Register */
269#define PCI_SID_ESR_NSLOTS 0x1f /* Number of expansion slots available */
270#define PCI_SID_ESR_FIC 0x20 /* First In Chassis Flag */
271#define PCI_SID_CHASSIS_NR 3 /* Chassis Number */
272
273/* Message Signalled Interrupts registers */
274
275#define PCI_MSI_FLAGS 2 /* Various flags */
276#define PCI_MSI_FLAGS_64BIT 0x80 /* 64-bit addresses allowed */
277#define PCI_MSI_FLAGS_QSIZE 0x70 /* Message queue size configured */
278#define PCI_MSI_FLAGS_QMASK 0x0e /* Maximum queue size available */
279#define PCI_MSI_FLAGS_ENABLE 0x01 /* MSI feature enabled */
280#define PCI_MSI_FLAGS_MASKBIT 0x100 /* 64-bit mask bits allowed */
281#define PCI_MSI_RFU 3 /* Rest of capability flags */
282#define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */
283#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */
284#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */
285#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */
286#define PCI_MSI_MASK_BIT 16 /* Mask bits register */
287
288/* CompactPCI Hotswap Register */
289
290#define PCI_CHSWP_CSR 2 /* Control and Status Register */
291#define PCI_CHSWP_DHA 0x01 /* Device Hiding Arm */
292#define PCI_CHSWP_EIM 0x02 /* ENUM# Signal Mask */
293#define PCI_CHSWP_PIE 0x04 /* Pending Insert or Extract */
294#define PCI_CHSWP_LOO 0x08 /* LED On / Off */
295#define PCI_CHSWP_PI 0x30 /* Programming Interface */
296#define PCI_CHSWP_EXT 0x40 /* ENUM# status - extraction */
297#define PCI_CHSWP_INS 0x80 /* ENUM# status - insertion */
298
299/* PCI-X registers */
300
301#define PCI_X_CMD 2 /* Modes & Features */
302#define PCI_X_CMD_DPERR_E 0x0001 /* Data Parity Error Recovery Enable */
303#define PCI_X_CMD_ERO 0x0002 /* Enable Relaxed Ordering */
304#define PCI_X_CMD_MAX_READ 0x000c /* Max Memory Read Byte Count */
305#define PCI_X_CMD_MAX_SPLIT 0x0070 /* Max Outstanding Split Transactions */
306#define PCI_X_CMD_VERSION(x) (((x) >> 12) & 3) /* Version */
307#define PCI_X_STATUS 4 /* PCI-X capabilities */
308#define PCI_X_STATUS_DEVFN 0x000000ff /* A copy of devfn */
309#define PCI_X_STATUS_BUS 0x0000ff00 /* A copy of bus nr */
310#define PCI_X_STATUS_64BIT 0x00010000 /* 64-bit device */
311#define PCI_X_STATUS_133MHZ 0x00020000 /* 133 MHz capable */
312#define PCI_X_STATUS_SPL_DISC 0x00040000 /* Split Completion Discarded */
313#define PCI_X_STATUS_UNX_SPL 0x00080000 /* Unexpected Split Completion */
314#define PCI_X_STATUS_COMPLEX 0x00100000 /* Device Complexity */
315#define PCI_X_STATUS_MAX_READ 0x00600000 /* Designed Max Memory Read Count */
316#define PCI_X_STATUS_MAX_SPLIT 0x03800000 /* Designed Max Outstanding Split Transactions */
317#define PCI_X_STATUS_MAX_CUM 0x1c000000 /* Designed Max Cumulative Read Size */
318#define PCI_X_STATUS_SPL_ERR 0x20000000 /* Rcvd Split Completion Error Msg */
319#define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */
320#define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */
321
322/* PCI Express capability registers */
323
324#define PCI_EXP_FLAGS 2 /* Capabilities register */
325#define PCI_EXP_FLAGS_VERS 0x000f /* Capability version */
326#define PCI_EXP_FLAGS_TYPE 0x00f0 /* Device/Port type */
327#define PCI_EXP_TYPE_ENDPOINT 0x0 /* Express Endpoint */
328#define PCI_EXP_TYPE_LEG_END 0x1 /* Legacy Endpoint */
329#define PCI_EXP_TYPE_ROOT_PORT 0x4 /* Root Port */
330#define PCI_EXP_TYPE_UPSTREAM 0x5 /* Upstream Port */
331#define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */
332#define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCI/PCI-X Bridge */
333#define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */
334#define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */
335#define PCI_EXP_DEVCAP 4 /* Device capabilities */
336#define PCI_EXP_DEVCAP_PAYLOAD 0x07 /* Max_Payload_Size */
337#define PCI_EXP_DEVCAP_PHANTOM 0x18 /* Phantom functions */
338#define PCI_EXP_DEVCAP_EXT_TAG 0x20 /* Extended tags */
339#define PCI_EXP_DEVCAP_L0S 0x1c0 /* L0s Acceptable Latency */
340#define PCI_EXP_DEVCAP_L1 0xe00 /* L1 Acceptable Latency */
341#define PCI_EXP_DEVCAP_ATN_BUT 0x1000 /* Attention Button Present */
342#define PCI_EXP_DEVCAP_ATN_IND 0x2000 /* Attention Indicator Present */
343#define PCI_EXP_DEVCAP_PWR_IND 0x4000 /* Power Indicator Present */
344#define PCI_EXP_DEVCAP_PWR_VAL 0x3fc0000 /* Slot Power Limit Value */
345#define PCI_EXP_DEVCAP_PWR_SCL 0xc000000 /* Slot Power Limit Scale */
346#define PCI_EXP_DEVCTL 8 /* Device Control */
347#define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */
348#define PCI_EXP_DEVCTL_NFERE 0x0002 /* Non-Fatal Error Reporting Enable */
349#define PCI_EXP_DEVCTL_FERE 0x0004 /* Fatal Error Reporting Enable */
350#define PCI_EXP_DEVCTL_URRE 0x0008 /* Unsupported Request Reporting En. */
351#define PCI_EXP_DEVCTL_RELAX_EN 0x0010 /* Enable relaxed ordering */
352#define PCI_EXP_DEVCTL_PAYLOAD 0x00e0 /* Max_Payload_Size */
353#define PCI_EXP_DEVCTL_EXT_TAG 0x0100 /* Extended Tag Field Enable */
354#define PCI_EXP_DEVCTL_PHANTOM 0x0200 /* Phantom Functions Enable */
355#define PCI_EXP_DEVCTL_AUX_PME 0x0400 /* Auxiliary Power PM Enable */
356#define PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800 /* Enable No Snoop */
357#define PCI_EXP_DEVCTL_READRQ 0x7000 /* Max_Read_Request_Size */
358#define PCI_EXP_DEVSTA 10 /* Device Status */
359#define PCI_EXP_DEVSTA_CED 0x01 /* Correctable Error Detected */
360#define PCI_EXP_DEVSTA_NFED 0x02 /* Non-Fatal Error Detected */
361#define PCI_EXP_DEVSTA_FED 0x04 /* Fatal Error Detected */
362#define PCI_EXP_DEVSTA_URD 0x08 /* Unsupported Request Detected */
363#define PCI_EXP_DEVSTA_AUXPD 0x10 /* AUX Power Detected */
364#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */
365#define PCI_EXP_LNKCAP 12 /* Link Capabilities */
366#define PCI_EXP_LNKCTL 16 /* Link Control */
367#define PCI_EXP_LNKSTA 18 /* Link Status */
368#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */
369#define PCI_EXP_SLTCTL 24 /* Slot Control */
370#define PCI_EXP_SLTSTA 26 /* Slot Status */
371#define PCI_EXP_RTCTL 28 /* Root Control */
372#define PCI_EXP_RTCTL_SECEE 0x01 /* System Error on Correctable Error */
373#define PCI_EXP_RTCTL_SENFEE 0x02 /* System Error on Non-Fatal Error */
374#define PCI_EXP_RTCTL_SEFEE 0x04 /* System Error on Fatal Error */
375#define PCI_EXP_RTCTL_PMEIE 0x08 /* PME Interrupt Enable */
376#define PCI_EXP_RTCTL_CRSSVE 0x10 /* CRS Software Visibility Enable */
377#define PCI_EXP_RTCAP 30 /* Root Capabilities */
378#define PCI_EXP_RTSTA 32 /* Root Status */
379
380/* Extended Capabilities (PCI-X 2.0 and Express) */
381#define PCI_EXT_CAP_ID(header) (header & 0x0000ffff)
382#define PCI_EXT_CAP_VER(header) ((header >> 16) & 0xf)
383#define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc)
384
385#define PCI_EXT_CAP_ID_ERR 1
386#define PCI_EXT_CAP_ID_VC 2
387#define PCI_EXT_CAP_ID_DSN 3
388#define PCI_EXT_CAP_ID_PWR 4
389
390/* Advanced Error Reporting */
391#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */
392#define PCI_ERR_UNC_TRAIN 0x00000001 /* Training */
393#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */
394#define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */
395#define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */
396#define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */
397#define PCI_ERR_UNC_COMP_ABORT 0x00008000 /* Completer Abort */
398#define PCI_ERR_UNC_UNX_COMP 0x00010000 /* Unexpected Completion */
399#define PCI_ERR_UNC_RX_OVER 0x00020000 /* Receiver Overflow */
400#define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */
401#define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */
402#define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */
403#define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */
404 /* Same bits as above */
405#define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */
406 /* Same bits as above */
407#define PCI_ERR_COR_STATUS 16 /* Correctable Error Status */
408#define PCI_ERR_COR_RCVR 0x00000001 /* Receiver Error Status */
409#define PCI_ERR_COR_BAD_TLP 0x00000040 /* Bad TLP Status */
410#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */
411#define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */
412#define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */
413#define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */
414 /* Same bits as above */
415#define PCI_ERR_CAP 24 /* Advanced Error Capabilities */
416#define PCI_ERR_CAP_FEP(x) ((x) & 31) /* First Error Pointer */
417#define PCI_ERR_CAP_ECRC_GENC 0x00000020 /* ECRC Generation Capable */
418#define PCI_ERR_CAP_ECRC_GENE 0x00000040 /* ECRC Generation Enable */
419#define PCI_ERR_CAP_ECRC_CHKC 0x00000080 /* ECRC Check Capable */
420#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */
421#define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */
422#define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */
423#define PCI_ERR_ROOT_STATUS 48
424#define PCI_ERR_ROOT_COR_SRC 52
425#define PCI_ERR_ROOT_SRC 54
426
427/* Virtual Channel */
428#define PCI_VC_PORT_REG1 4
429#define PCI_VC_PORT_REG2 8
430#define PCI_VC_PORT_CTRL 12
431#define PCI_VC_PORT_STATUS 14
432#define PCI_VC_RES_CAP 16
433#define PCI_VC_RES_CTRL 20
434#define PCI_VC_RES_STATUS 26
435
436/* Power Budgeting */
437#define PCI_PWR_DSR 4 /* Data Select Register */
438#define PCI_PWR_DATA 8 /* Data Register */
439#define PCI_PWR_DATA_BASE(x) ((x) & 0xff) /* Base Power */
440#define PCI_PWR_DATA_SCALE(x) (((x) >> 8) & 3) /* Data Scale */
441#define PCI_PWR_DATA_PM_SUB(x) (((x) >> 10) & 7) /* PM Sub State */
442#define PCI_PWR_DATA_PM_STATE(x) (((x) >> 13) & 3) /* PM State */
443#define PCI_PWR_DATA_TYPE(x) (((x) >> 15) & 7) /* Type */
444#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */
445#define PCI_PWR_CAP 12 /* Capability */
446#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */
447
448#endif /* LINUX_PCI_REGS_H */
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index 36725e7c02c6..1767073df26f 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -39,9 +39,6 @@ struct pipe_inode_info {
39 39
40#define PIPE_SEM(inode) (&(inode).i_sem) 40#define PIPE_SEM(inode) (&(inode).i_sem)
41#define PIPE_WAIT(inode) (&(inode).i_pipe->wait) 41#define PIPE_WAIT(inode) (&(inode).i_pipe->wait)
42#define PIPE_BASE(inode) ((inode).i_pipe->base)
43#define PIPE_START(inode) ((inode).i_pipe->start)
44#define PIPE_LEN(inode) ((inode).i_pipe->len)
45#define PIPE_READERS(inode) ((inode).i_pipe->readers) 42#define PIPE_READERS(inode) ((inode).i_pipe->readers)
46#define PIPE_WRITERS(inode) ((inode).i_pipe->writers) 43#define PIPE_WRITERS(inode) ((inode).i_pipe->writers)
47#define PIPE_WAITING_WRITERS(inode) ((inode).i_pipe->waiting_writers) 44#define PIPE_WAITING_WRITERS(inode) ((inode).i_pipe->waiting_writers)
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 7aeb208ed713..5cfb07648eca 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -186,7 +186,9 @@ extern int pm_suspend(suspend_state_t state);
186 186
187struct device; 187struct device;
188 188
189typedef u32 __bitwise pm_message_t; 189typedef struct pm_message {
190 int event;
191} pm_message_t;
190 192
191/* 193/*
192 * There are 4 important states driver can be in: 194 * There are 4 important states driver can be in:
@@ -207,9 +209,13 @@ typedef u32 __bitwise pm_message_t;
207 * or something similar soon. 209 * or something similar soon.
208 */ 210 */
209 211
210#define PMSG_FREEZE ((__force pm_message_t) 3) 212#define PM_EVENT_ON 0
211#define PMSG_SUSPEND ((__force pm_message_t) 3) 213#define PM_EVENT_FREEZE 1
212#define PMSG_ON ((__force pm_message_t) 0) 214#define PM_EVENT_SUSPEND 2
215
216#define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, })
217#define PMSG_SUSPEND ((struct pm_message){ .event = PM_EVENT_SUSPEND, })
218#define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, })
213 219
214struct dev_pm_info { 220struct dev_pm_info {
215 pm_message_t power_state; 221 pm_message_t power_state;
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index 5ec2bd0c2848..aadbac29103c 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -443,7 +443,7 @@ static inline void pnp_unregister_driver(struct pnp_driver *drv) { ; }
443#define pnp_info(format, arg...) printk(KERN_INFO "pnp: " format "\n" , ## arg) 443#define pnp_info(format, arg...) printk(KERN_INFO "pnp: " format "\n" , ## arg)
444#define pnp_warn(format, arg...) printk(KERN_WARNING "pnp: " format "\n" , ## arg) 444#define pnp_warn(format, arg...) printk(KERN_WARNING "pnp: " format "\n" , ## arg)
445 445
446#ifdef DEBUG 446#ifdef CONFIG_PNP_DEBUG
447#define pnp_dbg(format, arg...) printk(KERN_DEBUG "pnp: " format "\n" , ## arg) 447#define pnp_dbg(format, arg...) printk(KERN_DEBUG "pnp: " format "\n" , ## arg)
448#else 448#else
449#define pnp_dbg(format, arg...) do {} while (0) 449#define pnp_dbg(format, arg...) do {} while (0)
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index a373fc254df2..dc6f3647bfbc 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -20,6 +20,8 @@
20#define PTRACE_DETACH 0x11 20#define PTRACE_DETACH 0x11
21 21
22#define PTRACE_SYSCALL 24 22#define PTRACE_SYSCALL 24
23#define PTRACE_SYSEMU 31
24#define PTRACE_SYSEMU_SINGLESTEP 32
23 25
24/* 0x4200-0x4300 are reserved for architecture-independent additions. */ 26/* 0x4200-0x4300 are reserved for architecture-independent additions. */
25#define PTRACE_SETOPTIONS 0x4200 27#define PTRACE_SETOPTIONS 0x4200
@@ -88,6 +90,7 @@ extern void __ptrace_link(struct task_struct *child,
88 struct task_struct *new_parent); 90 struct task_struct *new_parent);
89extern void __ptrace_unlink(struct task_struct *child); 91extern void __ptrace_unlink(struct task_struct *child);
90extern void ptrace_untrace(struct task_struct *child); 92extern void ptrace_untrace(struct task_struct *child);
93extern int ptrace_may_attach(struct task_struct *task);
91 94
92static inline void ptrace_link(struct task_struct *child, 95static inline void ptrace_link(struct task_struct *child,
93 struct task_struct *new_parent) 96 struct task_struct *new_parent)
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h
index 4bf1659f8aa8..9de99198caf1 100644
--- a/include/linux/raid/bitmap.h
+++ b/include/linux/raid/bitmap.h
@@ -7,7 +7,7 @@
7#define BITMAP_H 1 7#define BITMAP_H 1
8 8
9#define BITMAP_MAJOR 3 9#define BITMAP_MAJOR 3
10#define BITMAP_MINOR 38 10#define BITMAP_MINOR 39
11 11
12/* 12/*
13 * in-memory bitmap: 13 * in-memory bitmap:
@@ -147,8 +147,9 @@ typedef struct bitmap_super_s {
147 __u32 state; /* 48 bitmap state information */ 147 __u32 state; /* 48 bitmap state information */
148 __u32 chunksize; /* 52 the bitmap chunk size in bytes */ 148 __u32 chunksize; /* 52 the bitmap chunk size in bytes */
149 __u32 daemon_sleep; /* 56 seconds between disk flushes */ 149 __u32 daemon_sleep; /* 56 seconds between disk flushes */
150 __u32 write_behind; /* 60 number of outstanding write-behind writes */
150 151
151 __u8 pad[256 - 60]; /* set to zero */ 152 __u8 pad[256 - 64]; /* set to zero */
152} bitmap_super_t; 153} bitmap_super_t;
153 154
154/* notes: 155/* notes:
@@ -226,6 +227,9 @@ struct bitmap {
226 227
227 unsigned long flags; 228 unsigned long flags;
228 229
230 unsigned long max_write_behind; /* write-behind mode */
231 atomic_t behind_writes;
232
229 /* 233 /*
230 * the bitmap daemon - periodically wakes up and sweeps the bitmap 234 * the bitmap daemon - periodically wakes up and sweeps the bitmap
231 * file, cleaning up bits and flushing out pages to disk as necessary 235 * file, cleaning up bits and flushing out pages to disk as necessary
@@ -260,9 +264,10 @@ int bitmap_setallbits(struct bitmap *bitmap);
260void bitmap_write_all(struct bitmap *bitmap); 264void bitmap_write_all(struct bitmap *bitmap);
261 265
262/* these are exported */ 266/* these are exported */
263int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors); 267int bitmap_startwrite(struct bitmap *bitmap, sector_t offset,
264void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors, 268 unsigned long sectors, int behind);
265 int success); 269void bitmap_endwrite(struct bitmap *bitmap, sector_t offset,
270 unsigned long sectors, int success, int behind);
266int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int degraded); 271int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int degraded);
267void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); 272void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted);
268void bitmap_close_sync(struct bitmap *bitmap); 273void bitmap_close_sync(struct bitmap *bitmap);
diff --git a/include/linux/raid/linear.h b/include/linux/raid/linear.h
index e04c4fe45b53..7eaf290e10e7 100644
--- a/include/linux/raid/linear.h
+++ b/include/linux/raid/linear.h
@@ -14,8 +14,8 @@ typedef struct dev_info dev_info_t;
14struct linear_private_data 14struct linear_private_data
15{ 15{
16 dev_info_t **hash_table; 16 dev_info_t **hash_table;
17 dev_info_t *smallest; 17 sector_t hash_spacing;
18 int nr_zones; 18 int preshift; /* shift before dividing by hash_spacing */
19 dev_info_t disks[0]; 19 dev_info_t disks[0];
20}; 20};
21 21
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index 8c14ba565a45..ebce949b1443 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -86,70 +86,6 @@ typedef struct mdk_rdev_s mdk_rdev_t;
86#define MAX_CHUNK_SIZE (4096*1024) 86#define MAX_CHUNK_SIZE (4096*1024)
87 87
88/* 88/*
89 * default readahead
90 */
91
92static inline int disk_faulty(mdp_disk_t * d)
93{
94 return d->state & (1 << MD_DISK_FAULTY);
95}
96
97static inline int disk_active(mdp_disk_t * d)
98{
99 return d->state & (1 << MD_DISK_ACTIVE);
100}
101
102static inline int disk_sync(mdp_disk_t * d)
103{
104 return d->state & (1 << MD_DISK_SYNC);
105}
106
107static inline int disk_spare(mdp_disk_t * d)
108{
109 return !disk_sync(d) && !disk_active(d) && !disk_faulty(d);
110}
111
112static inline int disk_removed(mdp_disk_t * d)
113{
114 return d->state & (1 << MD_DISK_REMOVED);
115}
116
117static inline void mark_disk_faulty(mdp_disk_t * d)
118{
119 d->state |= (1 << MD_DISK_FAULTY);
120}
121
122static inline void mark_disk_active(mdp_disk_t * d)
123{
124 d->state |= (1 << MD_DISK_ACTIVE);
125}
126
127static inline void mark_disk_sync(mdp_disk_t * d)
128{
129 d->state |= (1 << MD_DISK_SYNC);
130}
131
132static inline void mark_disk_spare(mdp_disk_t * d)
133{
134 d->state = 0;
135}
136
137static inline void mark_disk_removed(mdp_disk_t * d)
138{
139 d->state = (1 << MD_DISK_FAULTY) | (1 << MD_DISK_REMOVED);
140}
141
142static inline void mark_disk_inactive(mdp_disk_t * d)
143{
144 d->state &= ~(1 << MD_DISK_ACTIVE);
145}
146
147static inline void mark_disk_nonsync(mdp_disk_t * d)
148{
149 d->state &= ~(1 << MD_DISK_SYNC);
150}
151
152/*
153 * MD's 'extended' device 89 * MD's 'extended' device
154 */ 90 */
155struct mdk_rdev_s 91struct mdk_rdev_s
@@ -166,6 +102,7 @@ struct mdk_rdev_s
166 int sb_loaded; 102 int sb_loaded;
167 sector_t data_offset; /* start of data in array */ 103 sector_t data_offset; /* start of data in array */
168 sector_t sb_offset; 104 sector_t sb_offset;
105 int sb_size; /* bytes in the superblock */
169 int preferred_minor; /* autorun support */ 106 int preferred_minor; /* autorun support */
170 107
171 /* A device can be in one of three states based on two flags: 108 /* A device can be in one of three states based on two flags:
@@ -181,6 +118,9 @@ struct mdk_rdev_s
181 int faulty; /* if faulty do not issue IO requests */ 118 int faulty; /* if faulty do not issue IO requests */
182 int in_sync; /* device is a full member of the array */ 119 int in_sync; /* device is a full member of the array */
183 120
121 unsigned long flags; /* Should include faulty and in_sync here. */
122#define WriteMostly 4 /* Avoid reading if at all possible */
123
184 int desc_nr; /* descriptor index in the superblock */ 124 int desc_nr; /* descriptor index in the superblock */
185 int raid_disk; /* role of device in array */ 125 int raid_disk; /* role of device in array */
186 int saved_raid_disk; /* role that device used to have in the 126 int saved_raid_disk; /* role that device used to have in the
@@ -272,12 +212,19 @@ struct mddev_s
272 atomic_t writes_pending; 212 atomic_t writes_pending;
273 request_queue_t *queue; /* for plugging ... */ 213 request_queue_t *queue; /* for plugging ... */
274 214
215 atomic_t write_behind; /* outstanding async IO */
216 unsigned int max_write_behind; /* 0 = sync */
217
275 struct bitmap *bitmap; /* the bitmap for the device */ 218 struct bitmap *bitmap; /* the bitmap for the device */
276 struct file *bitmap_file; /* the bitmap file */ 219 struct file *bitmap_file; /* the bitmap file */
277 long bitmap_offset; /* offset from superblock of 220 long bitmap_offset; /* offset from superblock of
278 * start of bitmap. May be 221 * start of bitmap. May be
279 * negative, but not '0' 222 * negative, but not '0'
280 */ 223 */
224 long default_bitmap_offset; /* this is the offset to use when
225 * hot-adding a bitmap. It should
226 * eventually be settable by sysfs.
227 */
281 228
282 struct list_head all_mddevs; 229 struct list_head all_mddevs;
283}; 230};
@@ -314,6 +261,12 @@ struct mdk_personality_s
314 int (*resize) (mddev_t *mddev, sector_t sectors); 261 int (*resize) (mddev_t *mddev, sector_t sectors);
315 int (*reshape) (mddev_t *mddev, int raid_disks); 262 int (*reshape) (mddev_t *mddev, int raid_disks);
316 int (*reconfig) (mddev_t *mddev, int layout, int chunk_size); 263 int (*reconfig) (mddev_t *mddev, int layout, int chunk_size);
264 /* quiesce moves between quiescence states
265 * 0 - fully active
266 * 1 - no new requests allowed
267 * others - reserved
268 */
269 void (*quiesce) (mddev_t *mddev, int state);
317}; 270};
318 271
319 272
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h
index dc65cd435494..c100fa5d4bfa 100644
--- a/include/linux/raid/md_p.h
+++ b/include/linux/raid/md_p.h
@@ -79,6 +79,11 @@
79#define MD_DISK_SYNC 2 /* disk is in sync with the raid set */ 79#define MD_DISK_SYNC 2 /* disk is in sync with the raid set */
80#define MD_DISK_REMOVED 3 /* disk is in sync with the raid set */ 80#define MD_DISK_REMOVED 3 /* disk is in sync with the raid set */
81 81
82#define MD_DISK_WRITEMOSTLY 9 /* disk is "write-mostly" is RAID1 config.
83 * read requests will only be sent here in
84 * dire need
85 */
86
82typedef struct mdp_device_descriptor_s { 87typedef struct mdp_device_descriptor_s {
83 __u32 number; /* 0 Device number in the entire set */ 88 __u32 number; /* 0 Device number in the entire set */
84 __u32 major; /* 1 Device major number */ 89 __u32 major; /* 1 Device major number */
@@ -193,7 +198,7 @@ struct mdp_superblock_1 {
193 198
194 __u64 ctime; /* lo 40 bits are seconds, top 24 are microseconds or 0*/ 199 __u64 ctime; /* lo 40 bits are seconds, top 24 are microseconds or 0*/
195 __u32 level; /* -4 (multipath), -1 (linear), 0,1,4,5 */ 200 __u32 level; /* -4 (multipath), -1 (linear), 0,1,4,5 */
196 __u32 layout; /* only for raid5 currently */ 201 __u32 layout; /* only for raid5 and raid10 currently */
197 __u64 size; /* used size of component devices, in 512byte sectors */ 202 __u64 size; /* used size of component devices, in 512byte sectors */
198 203
199 __u32 chunksize; /* in 512byte sectors */ 204 __u32 chunksize; /* in 512byte sectors */
@@ -212,7 +217,9 @@ struct mdp_superblock_1 {
212 __u32 dev_number; /* permanent identifier of this device - not role in raid */ 217 __u32 dev_number; /* permanent identifier of this device - not role in raid */
213 __u32 cnt_corrected_read; /* number of read errors that were corrected by re-writing */ 218 __u32 cnt_corrected_read; /* number of read errors that were corrected by re-writing */
214 __u8 device_uuid[16]; /* user-space setable, ignored by kernel */ 219 __u8 device_uuid[16]; /* user-space setable, ignored by kernel */
215 __u8 pad2[64-56]; /* set to 0 when writing */ 220 __u8 devflags; /* per-device flags. Only one defined...*/
221#define WriteMostly1 1 /* mask for writemostly flag in above */
222 __u8 pad2[64-57]; /* set to 0 when writing */
216 223
217 /* array state information - 64 bytes */ 224 /* array state information - 64 bytes */
218 __u64 utime; /* 40 bits second, 24 btes microseconds */ 225 __u64 utime; /* 40 bits second, 24 btes microseconds */
@@ -231,5 +238,10 @@ struct mdp_superblock_1 {
231 __u16 dev_roles[0]; /* role in array, or 0xffff for a spare, or 0xfffe for faulty */ 238 __u16 dev_roles[0]; /* role in array, or 0xffff for a spare, or 0xfffe for faulty */
232}; 239};
233 240
241/* feature_map bits */
242#define MD_FEATURE_BITMAP_OFFSET 1
243
244#define MD_FEATURE_ALL 1
245
234#endif 246#endif
235 247
diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h
index 9d93cf12e890..60e19b667548 100644
--- a/include/linux/raid/raid1.h
+++ b/include/linux/raid/raid1.h
@@ -80,6 +80,9 @@ struct r1bio_s {
80 atomic_t remaining; /* 'have we finished' count, 80 atomic_t remaining; /* 'have we finished' count,
81 * used from IRQ handlers 81 * used from IRQ handlers
82 */ 82 */
83 atomic_t behind_remaining; /* number of write-behind ios remaining
84 * in this BehindIO request
85 */
83 sector_t sector; 86 sector_t sector;
84 int sectors; 87 int sectors;
85 unsigned long state; 88 unsigned long state;
@@ -107,4 +110,14 @@ struct r1bio_s {
107#define R1BIO_Uptodate 0 110#define R1BIO_Uptodate 0
108#define R1BIO_IsSync 1 111#define R1BIO_IsSync 1
109#define R1BIO_Degraded 2 112#define R1BIO_Degraded 2
113#define R1BIO_BehindIO 3
114/* For write-behind requests, we call bi_end_io when
115 * the last non-write-behind device completes, providing
116 * any write was successful. Otherwise we call when
117 * any write-behind write succeeds, otherwise we call
118 * with failure when last write completes (and all failed).
119 * Record that bi_end_io was called with this flag...
120 */
121#define R1BIO_Returned 4
122
110#endif 123#endif
diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h
index d63ddcb4afad..176fc653c284 100644
--- a/include/linux/raid/raid5.h
+++ b/include/linux/raid/raid5.h
@@ -134,6 +134,7 @@ struct stripe_head {
134 unsigned long state; /* state flags */ 134 unsigned long state; /* state flags */
135 atomic_t count; /* nr of active thread/requests */ 135 atomic_t count; /* nr of active thread/requests */
136 spinlock_t lock; 136 spinlock_t lock;
137 int bm_seq; /* sequence number for bitmap flushes */
137 struct r5dev { 138 struct r5dev {
138 struct bio req; 139 struct bio req;
139 struct bio_vec vec; 140 struct bio_vec vec;
@@ -165,12 +166,13 @@ struct stripe_head {
165/* 166/*
166 * Stripe state 167 * Stripe state
167 */ 168 */
168#define STRIPE_ERROR 1
169#define STRIPE_HANDLE 2 169#define STRIPE_HANDLE 2
170#define STRIPE_SYNCING 3 170#define STRIPE_SYNCING 3
171#define STRIPE_INSYNC 4 171#define STRIPE_INSYNC 4
172#define STRIPE_PREREAD_ACTIVE 5 172#define STRIPE_PREREAD_ACTIVE 5
173#define STRIPE_DELAYED 6 173#define STRIPE_DELAYED 6
174#define STRIPE_DEGRADED 7
175#define STRIPE_BIT_DELAY 8
174 176
175/* 177/*
176 * Plugging: 178 * Plugging:
@@ -210,10 +212,20 @@ struct raid5_private_data {
210 212
211 struct list_head handle_list; /* stripes needing handling */ 213 struct list_head handle_list; /* stripes needing handling */
212 struct list_head delayed_list; /* stripes that have plugged requests */ 214 struct list_head delayed_list; /* stripes that have plugged requests */
215 struct list_head bitmap_list; /* stripes delaying awaiting bitmap update */
213 atomic_t preread_active_stripes; /* stripes with scheduled io */ 216 atomic_t preread_active_stripes; /* stripes with scheduled io */
214 217
215 char cache_name[20]; 218 char cache_name[20];
216 kmem_cache_t *slab_cache; /* for allocating stripes */ 219 kmem_cache_t *slab_cache; /* for allocating stripes */
220
221 int seq_flush, seq_write;
222 int quiesce;
223
224 int fullsync; /* set to 1 if a full sync is needed,
225 * (fresh device added).
226 * Cleared when a sync completes.
227 */
228
217 /* 229 /*
218 * Free stripes pool 230 * Free stripes pool
219 */ 231 */
diff --git a/include/linux/raid_class.h b/include/linux/raid_class.h
new file mode 100644
index 000000000000..a71123c28272
--- /dev/null
+++ b/include/linux/raid_class.h
@@ -0,0 +1,59 @@
1/*
2 */
3#include <linux/transport_class.h>
4
5struct raid_template {
6 struct transport_container raid_attrs;
7};
8
9struct raid_function_template {
10 void *cookie;
11 int (*is_raid)(struct device *);
12 void (*get_resync)(struct device *);
13 void (*get_state)(struct device *);
14};
15
16enum raid_state {
17 RAID_ACTIVE = 1,
18 RAID_DEGRADED,
19 RAID_RESYNCING,
20 RAID_OFFLINE,
21};
22
23struct raid_data {
24 struct list_head component_list;
25 int component_count;
26 int level;
27 enum raid_state state;
28 int resync;
29};
30
31#define DEFINE_RAID_ATTRIBUTE(type, attr) \
32static inline void \
33raid_set_##attr(struct raid_template *r, struct device *dev, type value) { \
34 struct class_device *cdev = \
35 attribute_container_find_class_device(&r->raid_attrs.ac, dev);\
36 struct raid_data *rd; \
37 BUG_ON(!cdev); \
38 rd = class_get_devdata(cdev); \
39 rd->attr = value; \
40} \
41static inline type \
42raid_get_##attr(struct raid_template *r, struct device *dev) { \
43 struct class_device *cdev = \
44 attribute_container_find_class_device(&r->raid_attrs.ac, dev);\
45 struct raid_data *rd; \
46 BUG_ON(!cdev); \
47 rd = class_get_devdata(cdev); \
48 return rd->attr; \
49}
50
51DEFINE_RAID_ATTRIBUTE(int, level)
52DEFINE_RAID_ATTRIBUTE(int, resync)
53DEFINE_RAID_ATTRIBUTE(enum raid_state, state)
54
55struct raid_template *raid_class_attach(struct raid_function_template *);
56void raid_class_release(struct raid_template *);
57
58void raid_component_add(struct raid_template *, struct device *,
59 struct device *);
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index fd276adf0fd5..4e65eb44adfd 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -52,8 +52,8 @@ struct rcu_head {
52 void (*func)(struct rcu_head *head); 52 void (*func)(struct rcu_head *head);
53}; 53};
54 54
55#define RCU_HEAD_INIT(head) { .next = NULL, .func = NULL } 55#define RCU_HEAD_INIT { .next = NULL, .func = NULL }
56#define RCU_HEAD(head) struct rcu_head head = RCU_HEAD_INIT(head) 56#define RCU_HEAD(head) struct rcu_head head = RCU_HEAD_INIT
57#define INIT_RCU_HEAD(ptr) do { \ 57#define INIT_RCU_HEAD(ptr) do { \
58 (ptr)->next = NULL; (ptr)->func = NULL; \ 58 (ptr)->next = NULL; (ptr)->func = NULL; \
59} while (0) 59} while (0)
diff --git a/include/linux/rcuref.h b/include/linux/rcuref.h
new file mode 100644
index 000000000000..e1adbba14b67
--- /dev/null
+++ b/include/linux/rcuref.h
@@ -0,0 +1,220 @@
1/*
2 * rcuref.h
3 *
4 * Reference counting for elements of lists/arrays protected by
5 * RCU.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 *
21 * Copyright (C) IBM Corporation, 2005
22 *
23 * Author: Dipankar Sarma <dipankar@in.ibm.com>
24 * Ravikiran Thirumalai <kiran_th@gmail.com>
25 *
26 * See Documentation/RCU/rcuref.txt for detailed user guide.
27 *
28 */
29
30#ifndef _RCUREF_H_
31#define _RCUREF_H_
32
33#ifdef __KERNEL__
34
35#include <linux/types.h>
36#include <linux/interrupt.h>
37#include <linux/spinlock.h>
38#include <asm/atomic.h>
39
40/*
41 * These APIs work on traditional atomic_t counters used in the
42 * kernel for reference counting. Under special circumstances
43 * where a lock-free get() operation races with a put() operation
44 * these APIs can be used. See Documentation/RCU/rcuref.txt.
45 */
46
47#ifdef __HAVE_ARCH_CMPXCHG
48
49/**
50 * rcuref_inc - increment refcount for object.
51 * @rcuref: reference counter in the object in question.
52 *
53 * This should be used only for objects where we use RCU and
54 * use the rcuref_inc_lf() api to acquire a reference
55 * in a lock-free reader-side critical section.
56 */
57static inline void rcuref_inc(atomic_t *rcuref)
58{
59 atomic_inc(rcuref);
60}
61
62/**
63 * rcuref_dec - decrement refcount for object.
64 * @rcuref: reference counter in the object in question.
65 *
66 * This should be used only for objects where we use RCU and
67 * use the rcuref_inc_lf() api to acquire a reference
68 * in a lock-free reader-side critical section.
69 */
70static inline void rcuref_dec(atomic_t *rcuref)
71{
72 atomic_dec(rcuref);
73}
74
75/**
76 * rcuref_dec_and_test - decrement refcount for object and test
77 * @rcuref: reference counter in the object.
78 * @release: pointer to the function that will clean up the object
79 * when the last reference to the object is released.
80 * This pointer is required.
81 *
82 * Decrement the refcount, and if 0, return 1. Else return 0.
83 *
84 * This should be used only for objects where we use RCU and
85 * use the rcuref_inc_lf() api to acquire a reference
86 * in a lock-free reader-side critical section.
87 */
88static inline int rcuref_dec_and_test(atomic_t *rcuref)
89{
90 return atomic_dec_and_test(rcuref);
91}
92
93/*
94 * cmpxchg is needed on UP too, if deletions to the list/array can happen
95 * in interrupt context.
96 */
97
98/**
99 * rcuref_inc_lf - Take reference to an object in a read-side
100 * critical section protected by RCU.
101 * @rcuref: reference counter in the object in question.
102 *
103 * Try and increment the refcount by 1. The increment might fail if
104 * the reference counter has been through a 1 to 0 transition and
105 * is no longer part of the lock-free list.
106 * Returns non-zero on successful increment and zero otherwise.
107 */
108static inline int rcuref_inc_lf(atomic_t *rcuref)
109{
110 int c, old;
111 c = atomic_read(rcuref);
112 while (c && (old = cmpxchg(&rcuref->counter, c, c + 1)) != c)
113 c = old;
114 return c;
115}
116
117#else /* !__HAVE_ARCH_CMPXCHG */
118
119extern spinlock_t __rcuref_hash[];
120
121/*
122 * Use a hash table of locks to protect the reference count
123 * since cmpxchg is not available in this arch.
124 */
125#ifdef CONFIG_SMP
126#define RCUREF_HASH_SIZE 4
127#define RCUREF_HASH(k) \
128 (&__rcuref_hash[(((unsigned long)k)>>8) & (RCUREF_HASH_SIZE-1)])
129#else
130#define RCUREF_HASH_SIZE 1
131#define RCUREF_HASH(k) &__rcuref_hash[0]
132#endif /* CONFIG_SMP */
133
134/**
135 * rcuref_inc - increment refcount for object.
136 * @rcuref: reference counter in the object in question.
137 *
138 * This should be used only for objects where we use RCU and
139 * use the rcuref_inc_lf() api to acquire a reference in a lock-free
140 * reader-side critical section.
141 */
142static inline void rcuref_inc(atomic_t *rcuref)
143{
144 unsigned long flags;
145 spin_lock_irqsave(RCUREF_HASH(rcuref), flags);
146 rcuref->counter += 1;
147 spin_unlock_irqrestore(RCUREF_HASH(rcuref), flags);
148}
149
150/**
151 * rcuref_dec - decrement refcount for object.
152 * @rcuref: reference counter in the object in question.
153 *
154 * This should be used only for objects where we use RCU and
155 * use the rcuref_inc_lf() api to acquire a reference in a lock-free
156 * reader-side critical section.
157 */
158static inline void rcuref_dec(atomic_t *rcuref)
159{
160 unsigned long flags;
161 spin_lock_irqsave(RCUREF_HASH(rcuref), flags);
162 rcuref->counter -= 1;
163 spin_unlock_irqrestore(RCUREF_HASH(rcuref), flags);
164}
165
166/**
167 * rcuref_dec_and_test - decrement refcount for object and test
168 * @rcuref: reference counter in the object.
169 * @release: pointer to the function that will clean up the object
170 * when the last reference to the object is released.
171 * This pointer is required.
172 *
173 * Decrement the refcount, and if 0, return 1. Else return 0.
174 *
175 * This should be used only for objects where we use RCU and
176 * use the rcuref_inc_lf() api to acquire a reference in a lock-free
177 * reader-side critical section.
178 */
179static inline int rcuref_dec_and_test(atomic_t *rcuref)
180{
181 unsigned long flags;
182 spin_lock_irqsave(RCUREF_HASH(rcuref), flags);
183 rcuref->counter--;
184 if (!rcuref->counter) {
185 spin_unlock_irqrestore(RCUREF_HASH(rcuref), flags);
186 return 1;
187 } else {
188 spin_unlock_irqrestore(RCUREF_HASH(rcuref), flags);
189 return 0;
190 }
191}
192
193/**
194 * rcuref_inc_lf - Take reference to an object of a lock-free collection
195 * by traversing a lock-free list/array.
196 * @rcuref: reference counter in the object in question.
197 *
198 * Try and increment the refcount by 1. The increment might fail if
199 * the reference counter has been through a 1 to 0 transition and
200 * object is no longer part of the lock-free list.
201 * Returns non-zero on successful increment and zero otherwise.
202 */
203static inline int rcuref_inc_lf(atomic_t *rcuref)
204{
205 int ret;
206 unsigned long flags;
207 spin_lock_irqsave(RCUREF_HASH(rcuref), flags);
208 if (rcuref->counter)
209 ret = rcuref->counter++;
210 else
211 ret = 0;
212 spin_unlock_irqrestore(RCUREF_HASH(rcuref), flags);
213 return ret;
214}
215
216
217#endif /* !__HAVE_ARCH_CMPXCHG */
218
219#endif /* __KERNEL__ */
220#endif /* _RCUREF_H_ */
diff --git a/include/linux/relayfs_fs.h b/include/linux/relayfs_fs.h
new file mode 100644
index 000000000000..cfafc3e76bc2
--- /dev/null
+++ b/include/linux/relayfs_fs.h
@@ -0,0 +1,255 @@
1/*
2 * linux/include/linux/relayfs_fs.h
3 *
4 * Copyright (C) 2002, 2003 - Tom Zanussi (zanussi@us.ibm.com), IBM Corp
5 * Copyright (C) 1999, 2000, 2001, 2002 - Karim Yaghmour (karim@opersys.com)
6 *
7 * RelayFS definitions and declarations
8 */
9
10#ifndef _LINUX_RELAYFS_FS_H
11#define _LINUX_RELAYFS_FS_H
12
13#include <linux/config.h>
14#include <linux/types.h>
15#include <linux/sched.h>
16#include <linux/wait.h>
17#include <linux/list.h>
18#include <linux/fs.h>
19#include <linux/poll.h>
20#include <linux/kref.h>
21
22/*
23 * Tracks changes to rchan_buf struct
24 */
25#define RELAYFS_CHANNEL_VERSION 5
26
27/*
28 * Per-cpu relay channel buffer
29 */
30struct rchan_buf
31{
32 void *start; /* start of channel buffer */
33 void *data; /* start of current sub-buffer */
34 size_t offset; /* current offset into sub-buffer */
35 size_t subbufs_produced; /* count of sub-buffers produced */
36 size_t subbufs_consumed; /* count of sub-buffers consumed */
37 struct rchan *chan; /* associated channel */
38 wait_queue_head_t read_wait; /* reader wait queue */
39 struct work_struct wake_readers; /* reader wake-up work struct */
40 struct dentry *dentry; /* channel file dentry */
41 struct kref kref; /* channel buffer refcount */
42 struct page **page_array; /* array of current buffer pages */
43 unsigned int page_count; /* number of current buffer pages */
44 unsigned int finalized; /* buffer has been finalized */
45 size_t *padding; /* padding counts per sub-buffer */
46 size_t prev_padding; /* temporary variable */
47 size_t bytes_consumed; /* bytes consumed in cur read subbuf */
48 unsigned int cpu; /* this buf's cpu */
49} ____cacheline_aligned;
50
51/*
52 * Relay channel data structure
53 */
54struct rchan
55{
56 u32 version; /* the version of this struct */
57 size_t subbuf_size; /* sub-buffer size */
58 size_t n_subbufs; /* number of sub-buffers per buffer */
59 size_t alloc_size; /* total buffer size allocated */
60 struct rchan_callbacks *cb; /* client callbacks */
61 struct kref kref; /* channel refcount */
62 void *private_data; /* for user-defined data */
63 struct rchan_buf *buf[NR_CPUS]; /* per-cpu channel buffers */
64};
65
66/*
67 * Relayfs inode
68 */
69struct relayfs_inode_info
70{
71 struct inode vfs_inode;
72 struct rchan_buf *buf;
73};
74
75static inline struct relayfs_inode_info *RELAYFS_I(struct inode *inode)
76{
77 return container_of(inode, struct relayfs_inode_info, vfs_inode);
78}
79
80/*
81 * Relay channel client callbacks
82 */
83struct rchan_callbacks
84{
85 /*
86 * subbuf_start - called on buffer-switch to a new sub-buffer
87 * @buf: the channel buffer containing the new sub-buffer
88 * @subbuf: the start of the new sub-buffer
89 * @prev_subbuf: the start of the previous sub-buffer
90 * @prev_padding: unused space at the end of previous sub-buffer
91 *
92 * The client should return 1 to continue logging, 0 to stop
93 * logging.
94 *
95 * NOTE: subbuf_start will also be invoked when the buffer is
96 * created, so that the first sub-buffer can be initialized
97 * if necessary. In this case, prev_subbuf will be NULL.
98 *
99 * NOTE: the client can reserve bytes at the beginning of the new
100 * sub-buffer by calling subbuf_start_reserve() in this callback.
101 */
102 int (*subbuf_start) (struct rchan_buf *buf,
103 void *subbuf,
104 void *prev_subbuf,
105 size_t prev_padding);
106
107 /*
108 * buf_mapped - relayfs buffer mmap notification
109 * @buf: the channel buffer
110 * @filp: relayfs file pointer
111 *
112 * Called when a relayfs file is successfully mmapped
113 */
114 void (*buf_mapped)(struct rchan_buf *buf,
115 struct file *filp);
116
117 /*
118 * buf_unmapped - relayfs buffer unmap notification
119 * @buf: the channel buffer
120 * @filp: relayfs file pointer
121 *
122 * Called when a relayfs file is successfully unmapped
123 */
124 void (*buf_unmapped)(struct rchan_buf *buf,
125 struct file *filp);
126};
127
128/*
129 * relayfs kernel API, fs/relayfs/relay.c
130 */
131
132struct rchan *relay_open(const char *base_filename,
133 struct dentry *parent,
134 size_t subbuf_size,
135 size_t n_subbufs,
136 struct rchan_callbacks *cb);
137extern void relay_close(struct rchan *chan);
138extern void relay_flush(struct rchan *chan);
139extern void relay_subbufs_consumed(struct rchan *chan,
140 unsigned int cpu,
141 size_t consumed);
142extern void relay_reset(struct rchan *chan);
143extern int relay_buf_full(struct rchan_buf *buf);
144
145extern size_t relay_switch_subbuf(struct rchan_buf *buf,
146 size_t length);
147extern struct dentry *relayfs_create_dir(const char *name,
148 struct dentry *parent);
149extern int relayfs_remove_dir(struct dentry *dentry);
150
151/**
152 * relay_write - write data into the channel
153 * @chan: relay channel
154 * @data: data to be written
155 * @length: number of bytes to write
156 *
157 * Writes data into the current cpu's channel buffer.
158 *
159 * Protects the buffer by disabling interrupts. Use this
160 * if you might be logging from interrupt context. Try
161 * __relay_write() if you know you won't be logging from
162 * interrupt context.
163 */
164static inline void relay_write(struct rchan *chan,
165 const void *data,
166 size_t length)
167{
168 unsigned long flags;
169 struct rchan_buf *buf;
170
171 local_irq_save(flags);
172 buf = chan->buf[smp_processor_id()];
173 if (unlikely(buf->offset + length > chan->subbuf_size))
174 length = relay_switch_subbuf(buf, length);
175 memcpy(buf->data + buf->offset, data, length);
176 buf->offset += length;
177 local_irq_restore(flags);
178}
179
180/**
181 * __relay_write - write data into the channel
182 * @chan: relay channel
183 * @data: data to be written
184 * @length: number of bytes to write
185 *
186 * Writes data into the current cpu's channel buffer.
187 *
188 * Protects the buffer by disabling preemption. Use
189 * relay_write() if you might be logging from interrupt
190 * context.
191 */
192static inline void __relay_write(struct rchan *chan,
193 const void *data,
194 size_t length)
195{
196 struct rchan_buf *buf;
197
198 buf = chan->buf[get_cpu()];
199 if (unlikely(buf->offset + length > buf->chan->subbuf_size))
200 length = relay_switch_subbuf(buf, length);
201 memcpy(buf->data + buf->offset, data, length);
202 buf->offset += length;
203 put_cpu();
204}
205
206/**
207 * relay_reserve - reserve slot in channel buffer
208 * @chan: relay channel
209 * @length: number of bytes to reserve
210 *
211 * Returns pointer to reserved slot, NULL if full.
212 *
213 * Reserves a slot in the current cpu's channel buffer.
214 * Does not protect the buffer at all - caller must provide
215 * appropriate synchronization.
216 */
217static inline void *relay_reserve(struct rchan *chan, size_t length)
218{
219 void *reserved;
220 struct rchan_buf *buf = chan->buf[smp_processor_id()];
221
222 if (unlikely(buf->offset + length > buf->chan->subbuf_size)) {
223 length = relay_switch_subbuf(buf, length);
224 if (!length)
225 return NULL;
226 }
227 reserved = buf->data + buf->offset;
228 buf->offset += length;
229
230 return reserved;
231}
232
233/**
234 * subbuf_start_reserve - reserve bytes at the start of a sub-buffer
235 * @buf: relay channel buffer
236 * @length: number of bytes to reserve
237 *
238 * Helper function used to reserve bytes at the beginning of
239 * a sub-buffer in the subbuf_start() callback.
240 */
241static inline void subbuf_start_reserve(struct rchan_buf *buf,
242 size_t length)
243{
244 BUG_ON(length >= buf->chan->subbuf_size - 1);
245 buf->offset = length;
246}
247
248/*
249 * exported relayfs file operations, fs/relayfs/inode.c
250 */
251
252extern struct file_operations relayfs_file_operations;
253
254#endif /* _LINUX_RELAYFS_FS_H */
255
diff --git a/include/linux/sched.h b/include/linux/sched.h
index dec5827c7742..c551e6a1447e 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -35,6 +35,8 @@
35#include <linux/topology.h> 35#include <linux/topology.h>
36#include <linux/seccomp.h> 36#include <linux/seccomp.h>
37 37
38#include <linux/auxvec.h> /* For AT_VECTOR_SIZE */
39
38struct exec_domain; 40struct exec_domain;
39 41
40/* 42/*
@@ -176,6 +178,23 @@ extern void trap_init(void);
176extern void update_process_times(int user); 178extern void update_process_times(int user);
177extern void scheduler_tick(void); 179extern void scheduler_tick(void);
178 180
181#ifdef CONFIG_DETECT_SOFTLOCKUP
182extern void softlockup_tick(struct pt_regs *regs);
183extern void spawn_softlockup_task(void);
184extern void touch_softlockup_watchdog(void);
185#else
186static inline void softlockup_tick(struct pt_regs *regs)
187{
188}
189static inline void spawn_softlockup_task(void)
190{
191}
192static inline void touch_softlockup_watchdog(void)
193{
194}
195#endif
196
197
179/* Attach to any functions which should be ignored in wchan output. */ 198/* Attach to any functions which should be ignored in wchan output. */
180#define __sched __attribute__((__section__(".sched.text"))) 199#define __sched __attribute__((__section__(".sched.text")))
181/* Is this address in the __sched functions? */ 200/* Is this address in the __sched functions? */
@@ -244,7 +263,7 @@ struct mm_struct {
244 mm_counter_t _rss; 263 mm_counter_t _rss;
245 mm_counter_t _anon_rss; 264 mm_counter_t _anon_rss;
246 265
247 unsigned long saved_auxv[42]; /* for /proc/PID/auxv */ 266 unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */
248 267
249 unsigned dumpable:2; 268 unsigned dumpable:2;
250 cpumask_t cpu_vm_mask; 269 cpumask_t cpu_vm_mask;
@@ -545,13 +564,6 @@ struct sched_domain {
545 564
546extern void partition_sched_domains(cpumask_t *partition1, 565extern void partition_sched_domains(cpumask_t *partition1,
547 cpumask_t *partition2); 566 cpumask_t *partition2);
548#ifdef ARCH_HAS_SCHED_DOMAIN
549/* Useful helpers that arch setup code may use. Defined in kernel/sched.c */
550extern cpumask_t cpu_isolated_map;
551extern void init_sched_build_groups(struct sched_group groups[],
552 cpumask_t span, int (*group_fn)(int cpu));
553extern void cpu_attach_domain(struct sched_domain *sd, int cpu);
554#endif /* ARCH_HAS_SCHED_DOMAIN */
555#endif /* CONFIG_SMP */ 567#endif /* CONFIG_SMP */
556 568
557 569
@@ -592,6 +604,11 @@ extern int groups_search(struct group_info *group_info, gid_t grp);
592#define GROUP_AT(gi, i) \ 604#define GROUP_AT(gi, i) \
593 ((gi)->blocks[(i)/NGROUPS_PER_BLOCK][(i)%NGROUPS_PER_BLOCK]) 605 ((gi)->blocks[(i)/NGROUPS_PER_BLOCK][(i)%NGROUPS_PER_BLOCK])
594 606
607#ifdef ARCH_HAS_PREFETCH_SWITCH_STACK
608extern void prefetch_stack(struct task_struct*);
609#else
610static inline void prefetch_stack(struct task_struct *t) { }
611#endif
595 612
596struct audit_context; /* See audit.c */ 613struct audit_context; /* See audit.c */
597struct mempolicy; 614struct mempolicy;
diff --git a/include/linux/security.h b/include/linux/security.h
index 7aab6ab7c57f..55b02e1c73f4 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -250,29 +250,37 @@ struct swap_info_struct;
250 * @inode contains the inode structure. 250 * @inode contains the inode structure.
251 * Deallocate the inode security structure and set @inode->i_security to 251 * Deallocate the inode security structure and set @inode->i_security to
252 * NULL. 252 * NULL.
253 * @inode_init_security:
254 * Obtain the security attribute name suffix and value to set on a newly
255 * created inode and set up the incore security field for the new inode.
256 * This hook is called by the fs code as part of the inode creation
257 * transaction and provides for atomic labeling of the inode, unlike
258 * the post_create/mkdir/... hooks called by the VFS. The hook function
259 * is expected to allocate the name and value via kmalloc, with the caller
260 * being responsible for calling kfree after using them.
261 * If the security module does not use security attributes or does
262 * not wish to put a security attribute on this particular inode,
263 * then it should return -EOPNOTSUPP to skip this processing.
264 * @inode contains the inode structure of the newly created inode.
265 * @dir contains the inode structure of the parent directory.
266 * @name will be set to the allocated name suffix (e.g. selinux).
267 * @value will be set to the allocated attribute value.
268 * @len will be set to the length of the value.
269 * Returns 0 if @name and @value have been successfully set,
270 * -EOPNOTSUPP if no security attribute is needed, or
271 * -ENOMEM on memory allocation failure.
253 * @inode_create: 272 * @inode_create:
254 * Check permission to create a regular file. 273 * Check permission to create a regular file.
255 * @dir contains inode structure of the parent of the new file. 274 * @dir contains inode structure of the parent of the new file.
256 * @dentry contains the dentry structure for the file to be created. 275 * @dentry contains the dentry structure for the file to be created.
257 * @mode contains the file mode of the file to be created. 276 * @mode contains the file mode of the file to be created.
258 * Return 0 if permission is granted. 277 * Return 0 if permission is granted.
259 * @inode_post_create:
260 * Set the security attributes on a newly created regular file. This hook
261 * is called after a file has been successfully created.
262 * @dir contains the inode structure of the parent directory of the new file.
263 * @dentry contains the the dentry structure for the newly created file.
264 * @mode contains the file mode.
265 * @inode_link: 278 * @inode_link:
266 * Check permission before creating a new hard link to a file. 279 * Check permission before creating a new hard link to a file.
267 * @old_dentry contains the dentry structure for an existing link to the file. 280 * @old_dentry contains the dentry structure for an existing link to the file.
268 * @dir contains the inode structure of the parent directory of the new link. 281 * @dir contains the inode structure of the parent directory of the new link.
269 * @new_dentry contains the dentry structure for the new link. 282 * @new_dentry contains the dentry structure for the new link.
270 * Return 0 if permission is granted. 283 * Return 0 if permission is granted.
271 * @inode_post_link:
272 * Set security attributes for a new hard link to a file.
273 * @old_dentry contains the dentry structure for the existing link.
274 * @dir contains the inode structure of the parent directory of the new file.
275 * @new_dentry contains the dentry structure for the new file link.
276 * @inode_unlink: 284 * @inode_unlink:
277 * Check the permission to remove a hard link to a file. 285 * Check the permission to remove a hard link to a file.
278 * @dir contains the inode structure of parent directory of the file. 286 * @dir contains the inode structure of parent directory of the file.
@@ -284,13 +292,6 @@ struct swap_info_struct;
284 * @dentry contains the dentry structure of the symbolic link. 292 * @dentry contains the dentry structure of the symbolic link.
285 * @old_name contains the pathname of file. 293 * @old_name contains the pathname of file.
286 * Return 0 if permission is granted. 294 * Return 0 if permission is granted.
287 * @inode_post_symlink:
288 * @dir contains the inode structure of the parent directory of the new link.
289 * @dentry contains the dentry structure of new symbolic link.
290 * @old_name contains the pathname of file.
291 * Set security attributes for a newly created symbolic link. Note that
292 * @dentry->d_inode may be NULL, since the filesystem might not
293 * instantiate the dentry (e.g. NFS).
294 * @inode_mkdir: 295 * @inode_mkdir:
295 * Check permissions to create a new directory in the existing directory 296 * Check permissions to create a new directory in the existing directory
296 * associated with inode strcture @dir. 297 * associated with inode strcture @dir.
@@ -298,11 +299,6 @@ struct swap_info_struct;
298 * @dentry contains the dentry structure of new directory. 299 * @dentry contains the dentry structure of new directory.
299 * @mode contains the mode of new directory. 300 * @mode contains the mode of new directory.
300 * Return 0 if permission is granted. 301 * Return 0 if permission is granted.
301 * @inode_post_mkdir:
302 * Set security attributes on a newly created directory.
303 * @dir contains the inode structure of parent of the directory to be created.
304 * @dentry contains the dentry structure of new directory.
305 * @mode contains the mode of new directory.
306 * @inode_rmdir: 302 * @inode_rmdir:
307 * Check the permission to remove a directory. 303 * Check the permission to remove a directory.
308 * @dir contains the inode structure of parent of the directory to be removed. 304 * @dir contains the inode structure of parent of the directory to be removed.
@@ -318,13 +314,6 @@ struct swap_info_struct;
318 * @mode contains the mode of the new file. 314 * @mode contains the mode of the new file.
319 * @dev contains the the device number. 315 * @dev contains the the device number.
320 * Return 0 if permission is granted. 316 * Return 0 if permission is granted.
321 * @inode_post_mknod:
322 * Set security attributes on a newly created special file (or socket or
323 * fifo file created via the mknod system call).
324 * @dir contains the inode structure of parent of the new node.
325 * @dentry contains the dentry structure of the new node.
326 * @mode contains the mode of the new node.
327 * @dev contains the the device number.
328 * @inode_rename: 317 * @inode_rename:
329 * Check for permission to rename a file or directory. 318 * Check for permission to rename a file or directory.
330 * @old_dir contains the inode structure for parent of the old link. 319 * @old_dir contains the inode structure for parent of the old link.
@@ -332,12 +321,6 @@ struct swap_info_struct;
332 * @new_dir contains the inode structure for parent of the new link. 321 * @new_dir contains the inode structure for parent of the new link.
333 * @new_dentry contains the dentry structure of the new link. 322 * @new_dentry contains the dentry structure of the new link.
334 * Return 0 if permission is granted. 323 * Return 0 if permission is granted.
335 * @inode_post_rename:
336 * Set security attributes on a renamed file or directory.
337 * @old_dir contains the inode structure for parent of the old link.
338 * @old_dentry contains the dentry structure of the old link.
339 * @new_dir contains the inode structure for parent of the new link.
340 * @new_dentry contains the dentry structure of the new link.
341 * @inode_readlink: 324 * @inode_readlink:
342 * Check the permission to read the symbolic link. 325 * Check the permission to read the symbolic link.
343 * @dentry contains the dentry structure for the file link. 326 * @dentry contains the dentry structure for the file link.
@@ -1080,34 +1063,21 @@ struct security_operations {
1080 1063
1081 int (*inode_alloc_security) (struct inode *inode); 1064 int (*inode_alloc_security) (struct inode *inode);
1082 void (*inode_free_security) (struct inode *inode); 1065 void (*inode_free_security) (struct inode *inode);
1066 int (*inode_init_security) (struct inode *inode, struct inode *dir,
1067 char **name, void **value, size_t *len);
1083 int (*inode_create) (struct inode *dir, 1068 int (*inode_create) (struct inode *dir,
1084 struct dentry *dentry, int mode); 1069 struct dentry *dentry, int mode);
1085 void (*inode_post_create) (struct inode *dir,
1086 struct dentry *dentry, int mode);
1087 int (*inode_link) (struct dentry *old_dentry, 1070 int (*inode_link) (struct dentry *old_dentry,
1088 struct inode *dir, struct dentry *new_dentry); 1071 struct inode *dir, struct dentry *new_dentry);
1089 void (*inode_post_link) (struct dentry *old_dentry,
1090 struct inode *dir, struct dentry *new_dentry);
1091 int (*inode_unlink) (struct inode *dir, struct dentry *dentry); 1072 int (*inode_unlink) (struct inode *dir, struct dentry *dentry);
1092 int (*inode_symlink) (struct inode *dir, 1073 int (*inode_symlink) (struct inode *dir,
1093 struct dentry *dentry, const char *old_name); 1074 struct dentry *dentry, const char *old_name);
1094 void (*inode_post_symlink) (struct inode *dir,
1095 struct dentry *dentry,
1096 const char *old_name);
1097 int (*inode_mkdir) (struct inode *dir, struct dentry *dentry, int mode); 1075 int (*inode_mkdir) (struct inode *dir, struct dentry *dentry, int mode);
1098 void (*inode_post_mkdir) (struct inode *dir, struct dentry *dentry,
1099 int mode);
1100 int (*inode_rmdir) (struct inode *dir, struct dentry *dentry); 1076 int (*inode_rmdir) (struct inode *dir, struct dentry *dentry);
1101 int (*inode_mknod) (struct inode *dir, struct dentry *dentry, 1077 int (*inode_mknod) (struct inode *dir, struct dentry *dentry,
1102 int mode, dev_t dev); 1078 int mode, dev_t dev);
1103 void (*inode_post_mknod) (struct inode *dir, struct dentry *dentry,
1104 int mode, dev_t dev);
1105 int (*inode_rename) (struct inode *old_dir, struct dentry *old_dentry, 1079 int (*inode_rename) (struct inode *old_dir, struct dentry *old_dentry,
1106 struct inode *new_dir, struct dentry *new_dentry); 1080 struct inode *new_dir, struct dentry *new_dentry);
1107 void (*inode_post_rename) (struct inode *old_dir,
1108 struct dentry *old_dentry,
1109 struct inode *new_dir,
1110 struct dentry *new_dentry);
1111 int (*inode_readlink) (struct dentry *dentry); 1081 int (*inode_readlink) (struct dentry *dentry);
1112 int (*inode_follow_link) (struct dentry *dentry, struct nameidata *nd); 1082 int (*inode_follow_link) (struct dentry *dentry, struct nameidata *nd);
1113 int (*inode_permission) (struct inode *inode, int mask, struct nameidata *nd); 1083 int (*inode_permission) (struct inode *inode, int mask, struct nameidata *nd);
@@ -1442,6 +1412,17 @@ static inline void security_inode_free (struct inode *inode)
1442 return; 1412 return;
1443 security_ops->inode_free_security (inode); 1413 security_ops->inode_free_security (inode);
1444} 1414}
1415
1416static inline int security_inode_init_security (struct inode *inode,
1417 struct inode *dir,
1418 char **name,
1419 void **value,
1420 size_t *len)
1421{
1422 if (unlikely (IS_PRIVATE (inode)))
1423 return -EOPNOTSUPP;
1424 return security_ops->inode_init_security (inode, dir, name, value, len);
1425}
1445 1426
1446static inline int security_inode_create (struct inode *dir, 1427static inline int security_inode_create (struct inode *dir,
1447 struct dentry *dentry, 1428 struct dentry *dentry,
@@ -1452,15 +1433,6 @@ static inline int security_inode_create (struct inode *dir,
1452 return security_ops->inode_create (dir, dentry, mode); 1433 return security_ops->inode_create (dir, dentry, mode);
1453} 1434}
1454 1435
1455static inline void security_inode_post_create (struct inode *dir,
1456 struct dentry *dentry,
1457 int mode)
1458{
1459 if (dentry->d_inode && unlikely (IS_PRIVATE (dentry->d_inode)))
1460 return;
1461 security_ops->inode_post_create (dir, dentry, mode);
1462}
1463
1464static inline int security_inode_link (struct dentry *old_dentry, 1436static inline int security_inode_link (struct dentry *old_dentry,
1465 struct inode *dir, 1437 struct inode *dir,
1466 struct dentry *new_dentry) 1438 struct dentry *new_dentry)
@@ -1470,15 +1442,6 @@ static inline int security_inode_link (struct dentry *old_dentry,
1470 return security_ops->inode_link (old_dentry, dir, new_dentry); 1442 return security_ops->inode_link (old_dentry, dir, new_dentry);
1471} 1443}
1472 1444
1473static inline void security_inode_post_link (struct dentry *old_dentry,
1474 struct inode *dir,
1475 struct dentry *new_dentry)
1476{
1477 if (new_dentry->d_inode && unlikely (IS_PRIVATE (new_dentry->d_inode)))
1478 return;
1479 security_ops->inode_post_link (old_dentry, dir, new_dentry);
1480}
1481
1482static inline int security_inode_unlink (struct inode *dir, 1445static inline int security_inode_unlink (struct inode *dir,
1483 struct dentry *dentry) 1446 struct dentry *dentry)
1484{ 1447{
@@ -1496,15 +1459,6 @@ static inline int security_inode_symlink (struct inode *dir,
1496 return security_ops->inode_symlink (dir, dentry, old_name); 1459 return security_ops->inode_symlink (dir, dentry, old_name);
1497} 1460}
1498 1461
1499static inline void security_inode_post_symlink (struct inode *dir,
1500 struct dentry *dentry,
1501 const char *old_name)
1502{
1503 if (dentry->d_inode && unlikely (IS_PRIVATE (dentry->d_inode)))
1504 return;
1505 security_ops->inode_post_symlink (dir, dentry, old_name);
1506}
1507
1508static inline int security_inode_mkdir (struct inode *dir, 1462static inline int security_inode_mkdir (struct inode *dir,
1509 struct dentry *dentry, 1463 struct dentry *dentry,
1510 int mode) 1464 int mode)
@@ -1514,15 +1468,6 @@ static inline int security_inode_mkdir (struct inode *dir,
1514 return security_ops->inode_mkdir (dir, dentry, mode); 1468 return security_ops->inode_mkdir (dir, dentry, mode);
1515} 1469}
1516 1470
1517static inline void security_inode_post_mkdir (struct inode *dir,
1518 struct dentry *dentry,
1519 int mode)
1520{
1521 if (dentry->d_inode && unlikely (IS_PRIVATE (dentry->d_inode)))
1522 return;
1523 security_ops->inode_post_mkdir (dir, dentry, mode);
1524}
1525
1526static inline int security_inode_rmdir (struct inode *dir, 1471static inline int security_inode_rmdir (struct inode *dir,
1527 struct dentry *dentry) 1472 struct dentry *dentry)
1528{ 1473{
@@ -1540,15 +1485,6 @@ static inline int security_inode_mknod (struct inode *dir,
1540 return security_ops->inode_mknod (dir, dentry, mode, dev); 1485 return security_ops->inode_mknod (dir, dentry, mode, dev);
1541} 1486}
1542 1487
1543static inline void security_inode_post_mknod (struct inode *dir,
1544 struct dentry *dentry,
1545 int mode, dev_t dev)
1546{
1547 if (dentry->d_inode && unlikely (IS_PRIVATE (dentry->d_inode)))
1548 return;
1549 security_ops->inode_post_mknod (dir, dentry, mode, dev);
1550}
1551
1552static inline int security_inode_rename (struct inode *old_dir, 1488static inline int security_inode_rename (struct inode *old_dir,
1553 struct dentry *old_dentry, 1489 struct dentry *old_dentry,
1554 struct inode *new_dir, 1490 struct inode *new_dir,
@@ -1561,18 +1497,6 @@ static inline int security_inode_rename (struct inode *old_dir,
1561 new_dir, new_dentry); 1497 new_dir, new_dentry);
1562} 1498}
1563 1499
1564static inline void security_inode_post_rename (struct inode *old_dir,
1565 struct dentry *old_dentry,
1566 struct inode *new_dir,
1567 struct dentry *new_dentry)
1568{
1569 if (unlikely (IS_PRIVATE (old_dentry->d_inode) ||
1570 (new_dentry->d_inode && IS_PRIVATE (new_dentry->d_inode))))
1571 return;
1572 security_ops->inode_post_rename (old_dir, old_dentry,
1573 new_dir, new_dentry);
1574}
1575
1576static inline int security_inode_readlink (struct dentry *dentry) 1500static inline int security_inode_readlink (struct dentry *dentry)
1577{ 1501{
1578 if (unlikely (IS_PRIVATE (dentry->d_inode))) 1502 if (unlikely (IS_PRIVATE (dentry->d_inode)))
@@ -2171,6 +2095,15 @@ static inline int security_inode_alloc (struct inode *inode)
2171 2095
2172static inline void security_inode_free (struct inode *inode) 2096static inline void security_inode_free (struct inode *inode)
2173{ } 2097{ }
2098
2099static inline int security_inode_init_security (struct inode *inode,
2100 struct inode *dir,
2101 char **name,
2102 void **value,
2103 size_t *len)
2104{
2105 return -EOPNOTSUPP;
2106}
2174 2107
2175static inline int security_inode_create (struct inode *dir, 2108static inline int security_inode_create (struct inode *dir,
2176 struct dentry *dentry, 2109 struct dentry *dentry,
@@ -2179,11 +2112,6 @@ static inline int security_inode_create (struct inode *dir,
2179 return 0; 2112 return 0;
2180} 2113}
2181 2114
2182static inline void security_inode_post_create (struct inode *dir,
2183 struct dentry *dentry,
2184 int mode)
2185{ }
2186
2187static inline int security_inode_link (struct dentry *old_dentry, 2115static inline int security_inode_link (struct dentry *old_dentry,
2188 struct inode *dir, 2116 struct inode *dir,
2189 struct dentry *new_dentry) 2117 struct dentry *new_dentry)
@@ -2191,11 +2119,6 @@ static inline int security_inode_link (struct dentry *old_dentry,
2191 return 0; 2119 return 0;
2192} 2120}
2193 2121
2194static inline void security_inode_post_link (struct dentry *old_dentry,
2195 struct inode *dir,
2196 struct dentry *new_dentry)
2197{ }
2198
2199static inline int security_inode_unlink (struct inode *dir, 2122static inline int security_inode_unlink (struct inode *dir,
2200 struct dentry *dentry) 2123 struct dentry *dentry)
2201{ 2124{
@@ -2209,11 +2132,6 @@ static inline int security_inode_symlink (struct inode *dir,
2209 return 0; 2132 return 0;
2210} 2133}
2211 2134
2212static inline void security_inode_post_symlink (struct inode *dir,
2213 struct dentry *dentry,
2214 const char *old_name)
2215{ }
2216
2217static inline int security_inode_mkdir (struct inode *dir, 2135static inline int security_inode_mkdir (struct inode *dir,
2218 struct dentry *dentry, 2136 struct dentry *dentry,
2219 int mode) 2137 int mode)
@@ -2221,11 +2139,6 @@ static inline int security_inode_mkdir (struct inode *dir,
2221 return 0; 2139 return 0;
2222} 2140}
2223 2141
2224static inline void security_inode_post_mkdir (struct inode *dir,
2225 struct dentry *dentry,
2226 int mode)
2227{ }
2228
2229static inline int security_inode_rmdir (struct inode *dir, 2142static inline int security_inode_rmdir (struct inode *dir,
2230 struct dentry *dentry) 2143 struct dentry *dentry)
2231{ 2144{
@@ -2239,11 +2152,6 @@ static inline int security_inode_mknod (struct inode *dir,
2239 return 0; 2152 return 0;
2240} 2153}
2241 2154
2242static inline void security_inode_post_mknod (struct inode *dir,
2243 struct dentry *dentry,
2244 int mode, dev_t dev)
2245{ }
2246
2247static inline int security_inode_rename (struct inode *old_dir, 2155static inline int security_inode_rename (struct inode *old_dir,
2248 struct dentry *old_dentry, 2156 struct dentry *old_dentry,
2249 struct inode *new_dir, 2157 struct inode *new_dir,
@@ -2252,12 +2160,6 @@ static inline int security_inode_rename (struct inode *old_dir,
2252 return 0; 2160 return 0;
2253} 2161}
2254 2162
2255static inline void security_inode_post_rename (struct inode *old_dir,
2256 struct dentry *old_dentry,
2257 struct inode *new_dir,
2258 struct dentry *new_dentry)
2259{ }
2260
2261static inline int security_inode_readlink (struct dentry *dentry) 2163static inline int security_inode_readlink (struct dentry *dentry)
2262{ 2164{
2263 return 0; 2165 return 0;
diff --git a/include/linux/sem.h b/include/linux/sem.h
index 2d8516be9fd7..106f9757339a 100644
--- a/include/linux/sem.h
+++ b/include/linux/sem.h
@@ -88,6 +88,7 @@ struct sem {
88/* One sem_array data structure for each set of semaphores in the system. */ 88/* One sem_array data structure for each set of semaphores in the system. */
89struct sem_array { 89struct sem_array {
90 struct kern_ipc_perm sem_perm; /* permissions .. see ipc.h */ 90 struct kern_ipc_perm sem_perm; /* permissions .. see ipc.h */
91 int sem_id;
91 time_t sem_otime; /* last semop time */ 92 time_t sem_otime; /* last semop time */
92 time_t sem_ctime; /* last change time */ 93 time_t sem_ctime; /* last change time */
93 struct sem *sem_base; /* ptr to first semaphore in array */ 94 struct sem *sem_base; /* ptr to first semaphore in array */
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index d8a023d804d4..317a979b24de 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -30,6 +30,21 @@ struct plat_serial8250_port {
30}; 30};
31 31
32/* 32/*
33 * Allocate 8250 platform device IDs. Nothing is implied by
34 * the numbering here, except for the legacy entry being -1.
35 */
36enum {
37 PLAT8250_DEV_LEGACY = -1,
38 PLAT8250_DEV_PLATFORM,
39 PLAT8250_DEV_PLATFORM1,
40 PLAT8250_DEV_FOURPORT,
41 PLAT8250_DEV_ACCENT,
42 PLAT8250_DEV_BOCA,
43 PLAT8250_DEV_HUB6,
44 PLAT8250_DEV_MCA,
45};
46
47/*
33 * This should be used by drivers which want to register 48 * This should be used by drivers which want to register
34 * their own 8250 ports without registering their own 49 * their own 8250 ports without registering their own
35 * platform device. Using these will make your driver 50 * platform device. Using these will make your driver
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index cf0f64ea2bc0..27db8da43aa4 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -385,11 +385,11 @@ int uart_resume_port(struct uart_driver *reg, struct uart_port *port);
385/* 385/*
386 * The following are helper functions for the low level drivers. 386 * The following are helper functions for the low level drivers.
387 */ 387 */
388#ifdef SUPPORT_SYSRQ
389static inline int 388static inline int
390uart_handle_sysrq_char(struct uart_port *port, unsigned int ch, 389uart_handle_sysrq_char(struct uart_port *port, unsigned int ch,
391 struct pt_regs *regs) 390 struct pt_regs *regs)
392{ 391{
392#ifdef SUPPORT_SYSRQ
393 if (port->sysrq) { 393 if (port->sysrq) {
394 if (ch && time_before(jiffies, port->sysrq)) { 394 if (ch && time_before(jiffies, port->sysrq)) {
395 handle_sysrq(ch, regs, NULL); 395 handle_sysrq(ch, regs, NULL);
@@ -398,10 +398,11 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch,
398 } 398 }
399 port->sysrq = 0; 399 port->sysrq = 0;
400 } 400 }
401#endif
401 return 0; 402 return 0;
402} 403}
403#else 404#ifndef SUPPORT_SYSRQ
404#define uart_handle_sysrq_char(port,ch,regs) (0) 405#define uart_handle_sysrq_char(port,ch,regs) uart_handle_sysrq_char(port, 0, NULL)
405#endif 406#endif
406 407
407/* 408/*
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 42edce6abe23..2741c0c55e83 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1167,7 +1167,7 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb,
1167 1167
1168static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) 1168static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len)
1169{ 1169{
1170 if (len >= skb->len) 1170 if (likely(len >= skb->len))
1171 return 0; 1171 return 0;
1172 if (skb->ip_summed == CHECKSUM_HW) 1172 if (skb->ip_summed == CHECKSUM_HW)
1173 skb->ip_summed = CHECKSUM_NONE; 1173 skb->ip_summed = CHECKSUM_NONE;
@@ -1251,7 +1251,7 @@ extern void skb_add_mtu(int mtu);
1251 * This function converts the offset back to a struct timeval and stores 1251 * This function converts the offset back to a struct timeval and stores
1252 * it in stamp. 1252 * it in stamp.
1253 */ 1253 */
1254static inline void skb_get_timestamp(struct sk_buff *skb, struct timeval *stamp) 1254static inline void skb_get_timestamp(const struct sk_buff *skb, struct timeval *stamp)
1255{ 1255{
1256 stamp->tv_sec = skb->tstamp.off_sec; 1256 stamp->tv_sec = skb->tstamp.off_sec;
1257 stamp->tv_usec = skb->tstamp.off_usec; 1257 stamp->tv_usec = skb->tstamp.off_usec;
@@ -1270,7 +1270,7 @@ static inline void skb_get_timestamp(struct sk_buff *skb, struct timeval *stamp)
1270 * This function converts a struct timeval to an offset and stores 1270 * This function converts a struct timeval to an offset and stores
1271 * it in the skb. 1271 * it in the skb.
1272 */ 1272 */
1273static inline void skb_set_timestamp(struct sk_buff *skb, struct timeval *stamp) 1273static inline void skb_set_timestamp(struct sk_buff *skb, const struct timeval *stamp)
1274{ 1274{
1275 skb->tstamp.off_sec = stamp->tv_sec - skb_tv_base.tv_sec; 1275 skb->tstamp.off_sec = stamp->tv_sec - skb_tv_base.tv_sec;
1276 skb->tstamp.off_usec = stamp->tv_usec - skb_tv_base.tv_usec; 1276 skb->tstamp.off_usec = stamp->tv_usec - skb_tv_base.tv_usec;
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 80b2dfde2e80..42a6bea58af3 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -99,7 +99,21 @@ found:
99 return __kmalloc(size, flags); 99 return __kmalloc(size, flags);
100} 100}
101 101
102extern void *kcalloc(size_t, size_t, unsigned int __nocast); 102extern void *kzalloc(size_t, unsigned int __nocast);
103
104/**
105 * kcalloc - allocate memory for an array. The memory is set to zero.
106 * @n: number of elements.
107 * @size: element size.
108 * @flags: the type of memory to allocate.
109 */
110static inline void *kcalloc(size_t n, size_t size, unsigned int __nocast flags)
111{
112 if (n != 0 && size > INT_MAX / n)
113 return NULL;
114 return kzalloc(n * size, flags);
115}
116
103extern void kfree(const void *); 117extern void kfree(const void *);
104extern unsigned int ksize(const void *); 118extern unsigned int ksize(const void *);
105 119
diff --git a/include/linux/sonypi.h b/include/linux/sonypi.h
index 768cbba617d0..f56d24734950 100644
--- a/include/linux/sonypi.h
+++ b/include/linux/sonypi.h
@@ -99,6 +99,8 @@
99#define SONYPI_EVENT_BATTERY_INSERT 57 99#define SONYPI_EVENT_BATTERY_INSERT 57
100#define SONYPI_EVENT_BATTERY_REMOVE 58 100#define SONYPI_EVENT_BATTERY_REMOVE 58
101#define SONYPI_EVENT_FNKEY_RELEASED 59 101#define SONYPI_EVENT_FNKEY_RELEASED 59
102#define SONYPI_EVENT_WIRELESS_ON 60
103#define SONYPI_EVENT_WIRELESS_OFF 61
102 104
103/* get/set brightness */ 105/* get/set brightness */
104#define SONYPI_IOCGBRT _IOR('v', 0, __u8) 106#define SONYPI_IOCGBRT _IOR('v', 0, __u8)
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index 6864063d1b9f..c4e3ea7cf154 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -60,6 +60,7 @@ struct cache_head {
60#define CACHE_NEW_EXPIRY 120 /* keep new things pending confirmation for 120 seconds */ 60#define CACHE_NEW_EXPIRY 120 /* keep new things pending confirmation for 120 seconds */
61 61
62struct cache_detail { 62struct cache_detail {
63 struct module * owner;
63 int hash_size; 64 int hash_size;
64 struct cache_head ** hash_table; 65 struct cache_head ** hash_table;
65 rwlock_t hash_lock; 66 rwlock_t hash_lock;
diff --git a/include/linux/swap.h b/include/linux/swap.h
index bfe3e763ccf2..3c9ff0048153 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -107,6 +107,8 @@ enum {
107 SWP_USED = (1 << 0), /* is slot in swap_info[] used? */ 107 SWP_USED = (1 << 0), /* is slot in swap_info[] used? */
108 SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */ 108 SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */
109 SWP_ACTIVE = (SWP_USED | SWP_WRITEOK), 109 SWP_ACTIVE = (SWP_USED | SWP_WRITEOK),
110 /* add others here before... */
111 SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */
110}; 112};
111 113
112#define SWAP_CLUSTER_MAX 32 114#define SWAP_CLUSTER_MAX 32
@@ -116,16 +118,13 @@ enum {
116 118
117/* 119/*
118 * The in-memory structure used to track swap areas. 120 * The in-memory structure used to track swap areas.
119 * extent_list.prev points at the lowest-index extent. That list is
120 * sorted.
121 */ 121 */
122struct swap_info_struct { 122struct swap_info_struct {
123 unsigned int flags; 123 unsigned int flags;
124 spinlock_t sdev_lock; 124 int prio; /* swap priority */
125 struct file *swap_file; 125 struct file *swap_file;
126 struct block_device *bdev; 126 struct block_device *bdev;
127 struct list_head extent_list; 127 struct list_head extent_list;
128 int nr_extents;
129 struct swap_extent *curr_swap_extent; 128 struct swap_extent *curr_swap_extent;
130 unsigned old_block_size; 129 unsigned old_block_size;
131 unsigned short * swap_map; 130 unsigned short * swap_map;
@@ -133,10 +132,9 @@ struct swap_info_struct {
133 unsigned int highest_bit; 132 unsigned int highest_bit;
134 unsigned int cluster_next; 133 unsigned int cluster_next;
135 unsigned int cluster_nr; 134 unsigned int cluster_nr;
136 int prio; /* swap priority */ 135 unsigned int pages;
137 int pages; 136 unsigned int max;
138 unsigned long max; 137 unsigned int inuse_pages;
139 unsigned long inuse_pages;
140 int next; /* next entry on swap list */ 138 int next; /* next entry on swap list */
141}; 139};
142 140
@@ -222,13 +220,7 @@ extern int can_share_swap_page(struct page *);
222extern int remove_exclusive_swap_page(struct page *); 220extern int remove_exclusive_swap_page(struct page *);
223struct backing_dev_info; 221struct backing_dev_info;
224 222
225extern struct swap_list_t swap_list; 223extern spinlock_t swap_lock;
226extern spinlock_t swaplock;
227
228#define swap_list_lock() spin_lock(&swaplock)
229#define swap_list_unlock() spin_unlock(&swaplock)
230#define swap_device_lock(p) spin_lock(&p->sdev_lock)
231#define swap_device_unlock(p) spin_unlock(&p->sdev_lock)
232 224
233/* linux/mm/thrash.c */ 225/* linux/mm/thrash.c */
234extern struct mm_struct * swap_token_mm; 226extern struct mm_struct * swap_token_mm;
diff --git a/include/linux/swapops.h b/include/linux/swapops.h
index d4c7db35e708..87b9d14c710d 100644
--- a/include/linux/swapops.h
+++ b/include/linux/swapops.h
@@ -4,7 +4,7 @@
4 * the low-order bits. 4 * the low-order bits.
5 * 5 *
6 * We arrange the `type' and `offset' fields so that `type' is at the five 6 * We arrange the `type' and `offset' fields so that `type' is at the five
7 * high-order bits of the smp_entry_t and `offset' is right-aligned in the 7 * high-order bits of the swp_entry_t and `offset' is right-aligned in the
8 * remaining bits. 8 * remaining bits.
9 * 9 *
10 * swp_entry_t's are *never* stored anywhere in their arch-dependent format. 10 * swp_entry_t's are *never* stored anywhere in their arch-dependent format.
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index e82be96d4906..532a6c5c24e9 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -711,6 +711,7 @@ enum {
711 DEV_RAID=4, 711 DEV_RAID=4,
712 DEV_MAC_HID=5, 712 DEV_MAC_HID=5,
713 DEV_SCSI=6, 713 DEV_SCSI=6,
714 DEV_IPMI=7,
714}; 715};
715 716
716/* /proc/sys/dev/cdrom */ 717/* /proc/sys/dev/cdrom */
@@ -776,6 +777,11 @@ enum {
776 DEV_SCSI_LOGGING_LEVEL=1, 777 DEV_SCSI_LOGGING_LEVEL=1,
777}; 778};
778 779
780/* /proc/sys/dev/ipmi */
781enum {
782 DEV_IPMI_POWEROFF_POWERCYCLE=1,
783};
784
779/* /proc/sys/abi */ 785/* /proc/sys/abi */
780enum 786enum
781{ 787{
diff --git a/include/linux/time.h b/include/linux/time.h
index 5634497ff5df..c10d4c21c183 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -97,7 +97,6 @@ extern int do_settimeofday(struct timespec *tv);
97extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz); 97extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz);
98extern void clock_was_set(void); // call when ever the clock is set 98extern void clock_was_set(void); // call when ever the clock is set
99extern int do_posix_clock_monotonic_gettime(struct timespec *tp); 99extern int do_posix_clock_monotonic_gettime(struct timespec *tp);
100extern long do_nanosleep(struct timespec *t);
101extern long do_utimes(char __user * filename, struct timeval * times); 100extern long do_utimes(char __user * filename, struct timeval * times);
102struct itimerval; 101struct itimerval;
103extern int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue); 102extern int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue);
diff --git a/include/linux/timer.h b/include/linux/timer.h
index 221f81ac2002..3340f3bd135d 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -32,6 +32,10 @@ extern struct timer_base_s __init_timer_base;
32 .magic = TIMER_MAGIC, \ 32 .magic = TIMER_MAGIC, \
33 } 33 }
34 34
35#define DEFINE_TIMER(_name, _function, _expires, _data) \
36 struct timer_list _name = \
37 TIMER_INITIALIZER(_function, _expires, _data)
38
35void fastcall init_timer(struct timer_list * timer); 39void fastcall init_timer(struct timer_list * timer);
36 40
37/*** 41/***
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 74fdd07d3792..7e050a2cc35b 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -260,6 +260,29 @@ extern long pps_calcnt; /* calibration intervals */
260extern long pps_errcnt; /* calibration errors */ 260extern long pps_errcnt; /* calibration errors */
261extern long pps_stbcnt; /* stability limit exceeded */ 261extern long pps_stbcnt; /* stability limit exceeded */
262 262
263/**
264 * ntp_clear - Clears the NTP state variables
265 *
266 * Must be called while holding a write on the xtime_lock
267 */
268static inline void ntp_clear(void)
269{
270 time_adjust = 0; /* stop active adjtime() */
271 time_status |= STA_UNSYNC;
272 time_maxerror = NTP_PHASE_LIMIT;
273 time_esterror = NTP_PHASE_LIMIT;
274}
275
276/**
277 * ntp_synced - Returns 1 if the NTP status is not UNSYNC
278 *
279 */
280static inline int ntp_synced(void)
281{
282 return !(time_status & STA_UNSYNC);
283}
284
285
263#ifdef CONFIG_TIME_INTERPOLATION 286#ifdef CONFIG_TIME_INTERPOLATION
264 287
265#define TIME_SOURCE_CPU 0 288#define TIME_SOURCE_CPU 0
diff --git a/include/linux/topology.h b/include/linux/topology.h
index 0320225e96da..3df1d474e5c5 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -135,6 +135,29 @@
135} 135}
136#endif 136#endif
137 137
138/* sched_domains SD_ALLNODES_INIT for NUMA machines */
139#define SD_ALLNODES_INIT (struct sched_domain) { \
140 .span = CPU_MASK_NONE, \
141 .parent = NULL, \
142 .groups = NULL, \
143 .min_interval = 64, \
144 .max_interval = 64*num_online_cpus(), \
145 .busy_factor = 128, \
146 .imbalance_pct = 133, \
147 .cache_hot_time = (10*1000000), \
148 .cache_nice_tries = 1, \
149 .busy_idx = 3, \
150 .idle_idx = 3, \
151 .newidle_idx = 0, /* unused */ \
152 .wake_idx = 0, /* unused */ \
153 .forkexec_idx = 0, /* unused */ \
154 .per_cpu_gain = 100, \
155 .flags = SD_LOAD_BALANCE, \
156 .last_balance = jiffies, \
157 .balance_interval = 64, \
158 .nr_balance_failed = 0, \
159}
160
138#ifdef CONFIG_NUMA 161#ifdef CONFIG_NUMA
139#ifndef SD_NODE_INIT 162#ifndef SD_NODE_INIT
140#error Please define an appropriate SD_NODE_INIT in include/asm/topology.h!!! 163#error Please define an appropriate SD_NODE_INIT in include/asm/topology.h!!!
diff --git a/include/linux/transport_class.h b/include/linux/transport_class.h
index 87d98d1faefb..1d6cc22e5f42 100644
--- a/include/linux/transport_class.h
+++ b/include/linux/transport_class.h
@@ -12,11 +12,16 @@
12#include <linux/device.h> 12#include <linux/device.h>
13#include <linux/attribute_container.h> 13#include <linux/attribute_container.h>
14 14
15struct transport_container;
16
15struct transport_class { 17struct transport_class {
16 struct class class; 18 struct class class;
17 int (*setup)(struct device *); 19 int (*setup)(struct transport_container *, struct device *,
18 int (*configure)(struct device *); 20 struct class_device *);
19 int (*remove)(struct device *); 21 int (*configure)(struct transport_container *, struct device *,
22 struct class_device *);
23 int (*remove)(struct transport_container *, struct device *,
24 struct class_device *);
20}; 25};
21 26
22#define DECLARE_TRANSPORT_CLASS(cls, nm, su, rm, cfg) \ 27#define DECLARE_TRANSPORT_CLASS(cls, nm, su, rm, cfg) \
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 59ff42c629ec..1267f88ece6e 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -74,7 +74,8 @@ struct screen_info {
74 u16 vesapm_off; /* 0x30 */ 74 u16 vesapm_off; /* 0x30 */
75 u16 pages; /* 0x32 */ 75 u16 pages; /* 0x32 */
76 u16 vesa_attributes; /* 0x34 */ 76 u16 vesa_attributes; /* 0x34 */
77 /* 0x36 -- 0x3f reserved for future expansion */ 77 u32 capabilities; /* 0x36 */
78 /* 0x3a -- 0x3f reserved for future expansion */
78}; 79};
79 80
80extern struct screen_info screen_info; 81extern struct screen_info screen_info;
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 724637792996..4dbe580f9335 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -5,6 +5,7 @@
5#include <linux/usb_ch9.h> 5#include <linux/usb_ch9.h>
6 6
7#define USB_MAJOR 180 7#define USB_MAJOR 180
8#define USB_DEVICE_MAJOR 189
8 9
9 10
10#ifdef __KERNEL__ 11#ifdef __KERNEL__
@@ -349,6 +350,7 @@ struct usb_device {
349 char *manufacturer; 350 char *manufacturer;
350 char *serial; /* static strings from the device */ 351 char *serial; /* static strings from the device */
351 struct list_head filelist; 352 struct list_head filelist;
353 struct class_device *class_dev;
352 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ 354 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */
353 355
354 /* 356 /*
@@ -614,7 +616,6 @@ extern int usb_disabled(void);
614#define URB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame ignored */ 616#define URB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame ignored */
615#define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */ 617#define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */
616#define URB_NO_SETUP_DMA_MAP 0x0008 /* urb->setup_dma valid on submit */ 618#define URB_NO_SETUP_DMA_MAP 0x0008 /* urb->setup_dma valid on submit */
617#define URB_ASYNC_UNLINK 0x0010 /* usb_unlink_urb() returns asap */
618#define URB_NO_FSBR 0x0020 /* UHCI-specific */ 619#define URB_NO_FSBR 0x0020 /* UHCI-specific */
619#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUTs with short packet */ 620#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUTs with short packet */
620#define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt needed */ 621#define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt needed */
@@ -722,13 +723,7 @@ typedef void (*usb_complete_t)(struct urb *, struct pt_regs *);
722 * Initialization: 723 * Initialization:
723 * 724 *
724 * All URBs submitted must initialize the dev, pipe, transfer_flags (may be 725 * All URBs submitted must initialize the dev, pipe, transfer_flags (may be
725 * zero), and complete fields. 726 * zero), and complete fields. All URBs must also initialize
726 * The URB_ASYNC_UNLINK transfer flag affects later invocations of
727 * the usb_unlink_urb() routine. Note: Failure to set URB_ASYNC_UNLINK
728 * with usb_unlink_urb() is deprecated. For synchronous unlinks use
729 * usb_kill_urb() instead.
730 *
731 * All URBs must also initialize
732 * transfer_buffer and transfer_buffer_length. They may provide the 727 * transfer_buffer and transfer_buffer_length. They may provide the
733 * URB_SHORT_NOT_OK transfer flag, indicating that short reads are 728 * URB_SHORT_NOT_OK transfer flag, indicating that short reads are
734 * to be treated as errors; that flag is invalid for write requests. 729 * to be treated as errors; that flag is invalid for write requests.
diff --git a/include/linux/usb_isp116x.h b/include/linux/usb_isp116x.h
index 5f5a9d9bd6c2..436dd8a2b64a 100644
--- a/include/linux/usb_isp116x.h
+++ b/include/linux/usb_isp116x.h
@@ -7,36 +7,18 @@
7struct isp116x_platform_data { 7struct isp116x_platform_data {
8 /* Enable internal resistors on downstream ports */ 8 /* Enable internal resistors on downstream ports */
9 unsigned sel15Kres:1; 9 unsigned sel15Kres:1;
10 /* Chip's internal clock won't be stopped in suspended state. 10 /* On-chip overcurrent detection */
11 Setting/unsetting this bit takes effect only if
12 'remote_wakeup_enable' below is not set. */
13 unsigned clknotstop:1;
14 /* On-chip overcurrent protection */
15 unsigned oc_enable:1; 11 unsigned oc_enable:1;
16 /* INT output polarity */ 12 /* INT output polarity */
17 unsigned int_act_high:1; 13 unsigned int_act_high:1;
18 /* INT edge or level triggered */ 14 /* INT edge or level triggered */
19 unsigned int_edge_triggered:1; 15 unsigned int_edge_triggered:1;
20 /* WAKEUP pin connected - NOT SUPPORTED */ 16 /* Enable wakeup by devices on usb bus (e.g. wakeup
21 /* unsigned remote_wakeup_connected:1; */ 17 by attachment/detachment or by device activity
22 /* Wakeup by devices on usb bus enabled */ 18 such as moving a mouse). When chosen, this option
19 prevents stopping internal clock, increasing
20 thereby power consumption in suspended state. */
23 unsigned remote_wakeup_enable:1; 21 unsigned remote_wakeup_enable:1;
24 /* Switch or not to switch (keep always powered) */
25 unsigned no_power_switching:1;
26 /* Ganged port power switching (0) or individual port
27 power switching (1) */
28 unsigned power_switching_mode:1;
29 /* Given port_power, msec/2 after power on till power good */
30 u8 potpg;
31 /* Hardware reset set/clear. If implemented, this function must:
32 if set == 0, deassert chip's HW reset pin
33 otherwise, assert chip's HW reset pin */
34 void (*reset) (struct device * dev, int set);
35 /* Hardware clock start/stop. If implemented, this function must:
36 if start == 0, stop the external clock
37 otherwise, start the external clock
38 */
39 void (*clock) (struct device * dev, int start);
40 /* Inter-io delay (ns). The chip is picky about access timings; it 22 /* Inter-io delay (ns). The chip is picky about access timings; it
41 expects at least: 23 expects at least:
42 150ns delay between consecutive accesses to DATA_REG, 24 150ns delay between consecutive accesses to DATA_REG,
diff --git a/include/linux/videodev.h b/include/linux/videodev.h
index 9d6fbde3d29c..1cc8c31b7988 100644
--- a/include/linux/videodev.h
+++ b/include/linux/videodev.h
@@ -3,7 +3,6 @@
3 3
4#include <linux/compiler.h> 4#include <linux/compiler.h>
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/version.h>
7 6
8#define HAVE_V4L2 1 7#define HAVE_V4L2 1
9#include <linux/videodev2.h> 8#include <linux/videodev2.h>
@@ -29,7 +28,6 @@ struct video_device
29 void (*release)(struct video_device *vfd); 28 void (*release)(struct video_device *vfd);
30 29
31 30
32#if 1 /* to be removed in 2.7.x */
33 /* obsolete -- fops->owner is used instead */ 31 /* obsolete -- fops->owner is used instead */
34 struct module *owner; 32 struct module *owner;
35 /* dev->driver_data will be used instead some day. 33 /* dev->driver_data will be used instead some day.
@@ -37,7 +35,6 @@ struct video_device
37 * so the switch over will be transparent for you. 35 * so the switch over will be transparent for you.
38 * Or use {pci|usb}_{get|set}_drvdata() directly. */ 36 * Or use {pci|usb}_{get|set}_drvdata() directly. */
39 void *priv; 37 void *priv;
40#endif
41 38
42 /* for videodev.c intenal usage -- please don't touch */ 39 /* for videodev.c intenal usage -- please don't touch */
43 int users; /* video_exclusive_{open|close} ... */ 40 int users; /* video_exclusive_{open|close} ... */
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index acbfc525576d..f623a33b9abe 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -270,7 +270,6 @@ struct v4l2_timecode
270/* The above is based on SMPTE timecodes */ 270/* The above is based on SMPTE timecodes */
271 271
272 272
273#if 1
274/* 273/*
275 * M P E G C O M P R E S S I O N P A R A M E T E R S 274 * M P E G C O M P R E S S I O N P A R A M E T E R S
276 * 275 *
@@ -357,7 +356,6 @@ struct v4l2_mpeg_compression {
357 /* I don't expect the above being perfect yet ;) */ 356 /* I don't expect the above being perfect yet ;) */
358 __u32 reserved_5[8]; 357 __u32 reserved_5[8];
359}; 358};
360#endif
361 359
362struct v4l2_jpegcompression 360struct v4l2_jpegcompression
363{ 361{
@@ -871,10 +869,8 @@ struct v4l2_streamparm
871#define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc) 869#define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc)
872#define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format) 870#define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format)
873#define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format) 871#define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format)
874#if 1 /* experimental */
875#define VIDIOC_G_MPEGCOMP _IOR ('V', 6, struct v4l2_mpeg_compression) 872#define VIDIOC_G_MPEGCOMP _IOR ('V', 6, struct v4l2_mpeg_compression)
876#define VIDIOC_S_MPEGCOMP _IOW ('V', 7, struct v4l2_mpeg_compression) 873#define VIDIOC_S_MPEGCOMP _IOW ('V', 7, struct v4l2_mpeg_compression)
877#endif
878#define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers) 874#define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers)
879#define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer) 875#define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer)
880#define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer) 876#define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer)
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 6409d9cf5965..b244f69ef682 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -10,6 +10,14 @@
10#define VM_MAP 0x00000004 /* vmap()ed pages */ 10#define VM_MAP 0x00000004 /* vmap()ed pages */
11/* bits [20..32] reserved for arch specific ioremap internals */ 11/* bits [20..32] reserved for arch specific ioremap internals */
12 12
13/*
14 * Maximum alignment for ioremap() regions.
15 * Can be overriden by arch-specific value.
16 */
17#ifndef IOREMAP_MAX_ORDER
18#define IOREMAP_MAX_ORDER (7 + PAGE_SHIFT) /* 128 pages */
19#endif
20
13struct vm_struct { 21struct vm_struct {
14 void *addr; 22 void *addr;
15 unsigned long size; 23 unsigned long size;
diff --git a/include/linux/wireless.h b/include/linux/wireless.h
index ae485f9c916e..a555a0f7a7b4 100644
--- a/include/linux/wireless.h
+++ b/include/linux/wireless.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * This file define a set of standard wireless extensions 2 * This file define a set of standard wireless extensions
3 * 3 *
4 * Version : 18 12.3.05 4 * Version : 19 18.3.05
5 * 5 *
6 * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> 6 * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com>
7 * Copyright (c) 1997-2005 Jean Tourrilhes, All Rights Reserved. 7 * Copyright (c) 1997-2005 Jean Tourrilhes, All Rights Reserved.
@@ -69,8 +69,6 @@
69 69
70/***************************** INCLUDES *****************************/ 70/***************************** INCLUDES *****************************/
71 71
72/* To minimise problems in user space, I might remove those headers
73 * at some point. Jean II */
74#include <linux/types.h> /* for "caddr_t" et al */ 72#include <linux/types.h> /* for "caddr_t" et al */
75#include <linux/socket.h> /* for "struct sockaddr" et al */ 73#include <linux/socket.h> /* for "struct sockaddr" et al */
76#include <linux/if.h> /* for IFNAMSIZ and co... */ 74#include <linux/if.h> /* for IFNAMSIZ and co... */
@@ -82,7 +80,7 @@
82 * (there is some stuff that will be added in the future...) 80 * (there is some stuff that will be added in the future...)
83 * I just plan to increment with each new version. 81 * I just plan to increment with each new version.
84 */ 82 */
85#define WIRELESS_EXT 18 83#define WIRELESS_EXT 19
86 84
87/* 85/*
88 * Changes : 86 * Changes :
@@ -197,6 +195,15 @@
197 * related parameters (extensible up to 4096 parameter values) 195 * related parameters (extensible up to 4096 parameter values)
198 * - Add wireless events: IWEVGENIE, IWEVMICHAELMICFAILURE, 196 * - Add wireless events: IWEVGENIE, IWEVMICHAELMICFAILURE,
199 * IWEVASSOCREQIE, IWEVASSOCRESPIE, IWEVPMKIDCAND 197 * IWEVASSOCREQIE, IWEVASSOCRESPIE, IWEVPMKIDCAND
198 *
199 * V18 to V19
200 * ----------
201 * - Remove (struct iw_point *)->pointer from events and streams
202 * - Remove header includes to help user space
203 * - Increase IW_ENCODING_TOKEN_MAX from 32 to 64
204 * - Add IW_QUAL_ALL_UPDATED and IW_QUAL_ALL_INVALID macros
205 * - Add explicit flag to tell stats are in dBm : IW_QUAL_DBM
206 * - Add IW_IOCTL_IDX() and IW_EVENT_IDX() macros
200 */ 207 */
201 208
202/**************************** CONSTANTS ****************************/ 209/**************************** CONSTANTS ****************************/
@@ -322,6 +329,7 @@
322/* The first and the last (range) */ 329/* The first and the last (range) */
323#define SIOCIWFIRST 0x8B00 330#define SIOCIWFIRST 0x8B00
324#define SIOCIWLAST SIOCIWLASTPRIV /* 0x8BFF */ 331#define SIOCIWLAST SIOCIWLASTPRIV /* 0x8BFF */
332#define IW_IOCTL_IDX(cmd) ((cmd) - SIOCIWFIRST)
325 333
326/* Even : get (world access), odd : set (root access) */ 334/* Even : get (world access), odd : set (root access) */
327#define IW_IS_SET(cmd) (!((cmd) & 0x1)) 335#define IW_IS_SET(cmd) (!((cmd) & 0x1))
@@ -366,6 +374,7 @@
366 * (struct iw_pmkid_cand) */ 374 * (struct iw_pmkid_cand) */
367 375
368#define IWEVFIRST 0x8C00 376#define IWEVFIRST 0x8C00
377#define IW_EVENT_IDX(cmd) ((cmd) - IWEVFIRST)
369 378
370/* ------------------------- PRIVATE INFO ------------------------- */ 379/* ------------------------- PRIVATE INFO ------------------------- */
371/* 380/*
@@ -427,12 +436,15 @@
427#define IW_MODE_MONITOR 6 /* Passive monitor (listen only) */ 436#define IW_MODE_MONITOR 6 /* Passive monitor (listen only) */
428 437
429/* Statistics flags (bitmask in updated) */ 438/* Statistics flags (bitmask in updated) */
430#define IW_QUAL_QUAL_UPDATED 0x1 /* Value was updated since last read */ 439#define IW_QUAL_QUAL_UPDATED 0x01 /* Value was updated since last read */
431#define IW_QUAL_LEVEL_UPDATED 0x2 440#define IW_QUAL_LEVEL_UPDATED 0x02
432#define IW_QUAL_NOISE_UPDATED 0x4 441#define IW_QUAL_NOISE_UPDATED 0x04
442#define IW_QUAL_ALL_UPDATED 0x07
443#define IW_QUAL_DBM 0x08 /* Level + Noise are dBm */
433#define IW_QUAL_QUAL_INVALID 0x10 /* Driver doesn't provide value */ 444#define IW_QUAL_QUAL_INVALID 0x10 /* Driver doesn't provide value */
434#define IW_QUAL_LEVEL_INVALID 0x20 445#define IW_QUAL_LEVEL_INVALID 0x20
435#define IW_QUAL_NOISE_INVALID 0x40 446#define IW_QUAL_NOISE_INVALID 0x40
447#define IW_QUAL_ALL_INVALID 0x70
436 448
437/* Frequency flags */ 449/* Frequency flags */
438#define IW_FREQ_AUTO 0x00 /* Let the driver decides */ 450#define IW_FREQ_AUTO 0x00 /* Let the driver decides */
@@ -443,7 +455,7 @@
443#define IW_MAX_ENCODING_SIZES 8 455#define IW_MAX_ENCODING_SIZES 8
444 456
445/* Maximum size of the encoding token in bytes */ 457/* Maximum size of the encoding token in bytes */
446#define IW_ENCODING_TOKEN_MAX 32 /* 256 bits (for now) */ 458#define IW_ENCODING_TOKEN_MAX 64 /* 512 bits (for now) */
447 459
448/* Flags for encoding (along with the token) */ 460/* Flags for encoding (along with the token) */
449#define IW_ENCODE_INDEX 0x00FF /* Token index (if needed) */ 461#define IW_ENCODE_INDEX 0x00FF /* Token index (if needed) */
@@ -1039,12 +1051,16 @@ struct iw_event
1039#define IW_EV_CHAR_LEN (IW_EV_LCP_LEN + IFNAMSIZ) 1051#define IW_EV_CHAR_LEN (IW_EV_LCP_LEN + IFNAMSIZ)
1040#define IW_EV_UINT_LEN (IW_EV_LCP_LEN + sizeof(__u32)) 1052#define IW_EV_UINT_LEN (IW_EV_LCP_LEN + sizeof(__u32))
1041#define IW_EV_FREQ_LEN (IW_EV_LCP_LEN + sizeof(struct iw_freq)) 1053#define IW_EV_FREQ_LEN (IW_EV_LCP_LEN + sizeof(struct iw_freq))
1042#define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point))
1043#define IW_EV_PARAM_LEN (IW_EV_LCP_LEN + sizeof(struct iw_param)) 1054#define IW_EV_PARAM_LEN (IW_EV_LCP_LEN + sizeof(struct iw_param))
1044#define IW_EV_ADDR_LEN (IW_EV_LCP_LEN + sizeof(struct sockaddr)) 1055#define IW_EV_ADDR_LEN (IW_EV_LCP_LEN + sizeof(struct sockaddr))
1045#define IW_EV_QUAL_LEN (IW_EV_LCP_LEN + sizeof(struct iw_quality)) 1056#define IW_EV_QUAL_LEN (IW_EV_LCP_LEN + sizeof(struct iw_quality))
1046 1057
1047/* Note : in the case of iw_point, the extra data will come at the 1058/* iw_point events are special. First, the payload (extra data) come at
1048 * end of the event */ 1059 * the end of the event, so they are bigger than IW_EV_POINT_LEN. Second,
1060 * we omit the pointer, so start at an offset. */
1061#define IW_EV_POINT_OFF (((char *) &(((struct iw_point *) NULL)->length)) - \
1062 (char *) NULL)
1063#define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \
1064 IW_EV_POINT_OFF)
1049 1065
1050#endif /* _LINUX_WIRELESS_H */ 1066#endif /* _LINUX_WIRELESS_H */
diff --git a/include/media/audiochip.h b/include/media/audiochip.h
index cd831168fdc1..a7ceee9fc5e9 100644
--- a/include/media/audiochip.h
+++ b/include/media/audiochip.h
@@ -1,5 +1,4 @@
1/* 1/*
2 * $Id: audiochip.h,v 1.5 2005/06/16 22:59:16 hhackmann Exp $
3 */ 2 */
4 3
5#ifndef AUDIOCHIP_H 4#ifndef AUDIOCHIP_H
diff --git a/include/media/id.h b/include/media/id.h
index a39a6423914b..6d02c94cdc0d 100644
--- a/include/media/id.h
+++ b/include/media/id.h
@@ -1,5 +1,4 @@
1/* 1/*
2 * $Id: id.h,v 1.4 2005/06/12 04:19:19 mchehab Exp $
3 */ 2 */
4 3
5/* FIXME: this temporarely, until these are included in linux/i2c-id.h */ 4/* FIXME: this temporarely, until these are included in linux/i2c-id.h */
@@ -34,8 +33,3 @@
34#ifndef I2C_DRIVERID_SAA6752HS 33#ifndef I2C_DRIVERID_SAA6752HS
35# define I2C_DRIVERID_SAA6752HS I2C_DRIVERID_EXP0+8 34# define I2C_DRIVERID_SAA6752HS I2C_DRIVERID_EXP0+8
36#endif 35#endif
37
38/* algorithms */
39#ifndef I2C_ALGO_SAA7134
40# define I2C_ALGO_SAA7134 0x090000
41#endif
diff --git a/include/media/ir-common.h b/include/media/ir-common.h
index 698670547f16..01b56822df4d 100644
--- a/include/media/ir-common.h
+++ b/include/media/ir-common.h
@@ -1,5 +1,4 @@
1/* 1/*
2 * $Id: ir-common.h,v 1.9 2005/05/15 19:01:26 mchehab Exp $
3 * 2 *
4 * some common structs and functions to handle infrared remotes via 3 * some common structs and functions to handle infrared remotes via
5 * input layer ... 4 * input layer ...
@@ -21,11 +20,11 @@
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */ 21 */
23 22
24#include <linux/version.h>
25#include <linux/input.h> 23#include <linux/input.h>
26 24
27 25
28#define IR_TYPE_RC5 1 26#define IR_TYPE_RC5 1
27#define IR_TYPE_PD 2 /* Pulse distance encoded IR */
29#define IR_TYPE_OTHER 99 28#define IR_TYPE_OTHER 99
30 29
31#define IR_KEYTAB_TYPE u32 30#define IR_KEYTAB_TYPE u32
@@ -60,6 +59,7 @@ void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir,
60u32 ir_extract_bits(u32 data, u32 mask); 59u32 ir_extract_bits(u32 data, u32 mask);
61int ir_dump_samples(u32 *samples, int count); 60int ir_dump_samples(u32 *samples, int count);
62int ir_decode_biphase(u32 *samples, int count, int low, int high); 61int ir_decode_biphase(u32 *samples, int count, int low, int high);
62int ir_decode_pulsedistance(u32 *samples, int count, int low, int high);
63 63
64/* 64/*
65 * Local variables: 65 * Local variables:
diff --git a/include/media/saa7146.h b/include/media/saa7146.h
index 3dfb8d670eb7..2a897c3a6a9a 100644
--- a/include/media/saa7146.h
+++ b/include/media/saa7146.h
@@ -1,7 +1,6 @@
1#ifndef __SAA7146__ 1#ifndef __SAA7146__
2#define __SAA7146__ 2#define __SAA7146__
3 3
4#include <linux/version.h> /* for version macros */
5#include <linux/module.h> /* for module-version */ 4#include <linux/module.h> /* for module-version */
6#include <linux/delay.h> /* for delay-stuff */ 5#include <linux/delay.h> /* for delay-stuff */
7#include <linux/slab.h> /* for kmalloc/kfree */ 6#include <linux/slab.h> /* for kmalloc/kfree */
@@ -15,12 +14,7 @@
15#include <linux/vmalloc.h> /* for vmalloc() */ 14#include <linux/vmalloc.h> /* for vmalloc() */
16#include <linux/mm.h> /* for vmalloc_to_page() */ 15#include <linux/mm.h> /* for vmalloc_to_page() */
17 16
18/* ugly, but necessary to build the dvb stuff under 2.4. */ 17#define SAA7146_VERSION_CODE 0x000500 /* 0.5.0 */
19#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51)
20 #include "dvb_functions.h"
21#endif
22
23#define SAA7146_VERSION_CODE KERNEL_VERSION(0,5,0)
24 18
25#define saa7146_write(sxy,adr,dat) writel((dat),(sxy->mem+(adr))) 19#define saa7146_write(sxy,adr,dat) writel((dat),(sxy->mem+(adr)))
26#define saa7146_read(sxy,adr) readl(sxy->mem+(adr)) 20#define saa7146_read(sxy,adr) readl(sxy->mem+(adr))
@@ -33,13 +27,8 @@ extern unsigned int saa7146_debug;
33 #define DEBUG_VARIABLE saa7146_debug 27 #define DEBUG_VARIABLE saa7146_debug
34#endif 28#endif
35 29
36#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51)
37#define DEBUG_PROLOG printk("%s: %s(): ",__stringify(KBUILD_BASENAME),__FUNCTION__)
38#define INFO(x) { printk("%s: ",__stringify(KBUILD_BASENAME)); printk x; }
39#else
40#define DEBUG_PROLOG printk("%s: %s(): ",__stringify(KBUILD_MODNAME),__FUNCTION__) 30#define DEBUG_PROLOG printk("%s: %s(): ",__stringify(KBUILD_MODNAME),__FUNCTION__)
41#define INFO(x) { printk("%s: ",__stringify(KBUILD_MODNAME)); printk x; } 31#define INFO(x) { printk("%s: ",__stringify(KBUILD_MODNAME)); printk x; }
42#endif
43 32
44#define ERR(x) { DEBUG_PROLOG; printk x; } 33#define ERR(x) { DEBUG_PROLOG; printk x; }
45 34
diff --git a/include/media/tuner.h b/include/media/tuner.h
index eeaa15ddee85..4ad08e24a1aa 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -1,6 +1,4 @@
1 1/*
2/* $Id: tuner.h,v 1.45 2005/07/28 18:41:21 mchehab Exp $
3 *
4 tuner.h - definition for different tuners 2 tuner.h - definition for different tuners
5 3
6 Copyright (C) 1997 Markus Schroeder (schroedm@uni-duesseldorf.de) 4 Copyright (C) 1997 Markus Schroeder (schroedm@uni-duesseldorf.de)
@@ -28,88 +26,90 @@
28 26
29#define ADDR_UNSET (255) 27#define ADDR_UNSET (255)
30 28
31#define TUNER_TEMIC_PAL 0 /* 4002 FH5 (3X 7756, 9483) */ 29#define TUNER_TEMIC_PAL 0 /* 4002 FH5 (3X 7756, 9483) */
32#define TUNER_PHILIPS_PAL_I 1 30#define TUNER_PHILIPS_PAL_I 1
33#define TUNER_PHILIPS_NTSC 2 31#define TUNER_PHILIPS_NTSC 2
34#define TUNER_PHILIPS_SECAM 3 /* you must actively select B/G, L, L` */ 32#define TUNER_PHILIPS_SECAM 3 /* you must actively select B/G, L, L` */
35 33
36#define TUNER_ABSENT 4 34#define TUNER_ABSENT 4
37#define TUNER_PHILIPS_PAL 5 35#define TUNER_PHILIPS_PAL 5
38#define TUNER_TEMIC_NTSC 6 /* 4032 FY5 (3X 7004, 9498, 9789) */ 36#define TUNER_TEMIC_NTSC 6 /* 4032 FY5 (3X 7004, 9498, 9789) */
39#define TUNER_TEMIC_PAL_I 7 /* 4062 FY5 (3X 8501, 9957) */ 37#define TUNER_TEMIC_PAL_I 7 /* 4062 FY5 (3X 8501, 9957) */
40 38
41#define TUNER_TEMIC_4036FY5_NTSC 8 /* 4036 FY5 (3X 1223, 1981, 7686) */ 39#define TUNER_TEMIC_4036FY5_NTSC 8 /* 4036 FY5 (3X 1223, 1981, 7686) */
42#define TUNER_ALPS_TSBH1_NTSC 9 40#define TUNER_ALPS_TSBH1_NTSC 9
43#define TUNER_ALPS_TSBE1_PAL 10 41#define TUNER_ALPS_TSBE1_PAL 10
44#define TUNER_ALPS_TSBB5_PAL_I 11 42#define TUNER_ALPS_TSBB5_PAL_I 11
45 43
46#define TUNER_ALPS_TSBE5_PAL 12 44#define TUNER_ALPS_TSBE5_PAL 12
47#define TUNER_ALPS_TSBC5_PAL 13 45#define TUNER_ALPS_TSBC5_PAL 13
48#define TUNER_TEMIC_4006FH5_PAL 14 /* 4006 FH5 (3X 9500, 9501, 7291) */ 46#define TUNER_TEMIC_4006FH5_PAL 14 /* 4006 FH5 (3X 9500, 9501, 7291) */
49#define TUNER_ALPS_TSHC6_NTSC 15 47#define TUNER_ALPS_TSHC6_NTSC 15
50 48
51#define TUNER_TEMIC_PAL_DK 16 /* 4016 FY5 (3X 1392, 1393) */ 49#define TUNER_TEMIC_PAL_DK 16 /* 4016 FY5 (3X 1392, 1393) */
52#define TUNER_PHILIPS_NTSC_M 17 50#define TUNER_PHILIPS_NTSC_M 17
53#define TUNER_TEMIC_4066FY5_PAL_I 18 /* 4066 FY5 (3X 7032, 7035) */ 51#define TUNER_TEMIC_4066FY5_PAL_I 18 /* 4066 FY5 (3X 7032, 7035) */
54#define TUNER_TEMIC_4006FN5_MULTI_PAL 19 /* B/G, I and D/K autodetected (3X 7595, 7606, 7657)*/ 52#define TUNER_TEMIC_4006FN5_MULTI_PAL 19 /* B/G, I and D/K autodetected (3X 7595, 7606, 7657) */
55 53
56#define TUNER_TEMIC_4009FR5_PAL 20 /* incl. FM radio (3X 7607, 7488, 7711)*/ 54#define TUNER_TEMIC_4009FR5_PAL 20 /* incl. FM radio (3X 7607, 7488, 7711) */
57#define TUNER_TEMIC_4039FR5_NTSC 21 /* incl. FM radio (3X 7246, 7578, 7732)*/ 55#define TUNER_TEMIC_4039FR5_NTSC 21 /* incl. FM radio (3X 7246, 7578, 7732) */
58#define TUNER_TEMIC_4046FM5 22 /* you must actively select B/G, D/K, I, L, L` ! (3X 7804, 7806, 8103, 8104)*/ 56#define TUNER_TEMIC_4046FM5 22 /* you must actively select B/G, D/K, I, L, L` ! (3X 7804, 7806, 8103, 8104) */
59#define TUNER_PHILIPS_PAL_DK 23 57#define TUNER_PHILIPS_PAL_DK 23
60 58
61#define TUNER_PHILIPS_FQ1216ME 24 /* you must actively select B/G/D/K, I, L, L` */ 59#define TUNER_PHILIPS_FQ1216ME 24 /* you must actively select B/G/D/K, I, L, L` */
62#define TUNER_LG_PAL_I_FM 25 60#define TUNER_LG_PAL_I_FM 25
63#define TUNER_LG_PAL_I 26 61#define TUNER_LG_PAL_I 26
64#define TUNER_LG_NTSC_FM 27 62#define TUNER_LG_NTSC_FM 27
65 63
66#define TUNER_LG_PAL_FM 28 64#define TUNER_LG_PAL_FM 28
67#define TUNER_LG_PAL 29 65#define TUNER_LG_PAL 29
68#define TUNER_TEMIC_4009FN5_MULTI_PAL_FM 30 /* B/G, I and D/K autodetected (3X 8155, 8160, 8163)*/ 66#define TUNER_TEMIC_4009FN5_MULTI_PAL_FM 30 /* B/G, I and D/K autodetected (3X 8155, 8160, 8163) */
69#define TUNER_SHARP_2U5JF5540_NTSC 31 67#define TUNER_SHARP_2U5JF5540_NTSC 31
70 68
71#define TUNER_Samsung_PAL_TCPM9091PD27 32 69#define TUNER_Samsung_PAL_TCPM9091PD27 32
72#define TUNER_MT2032 33 70#define TUNER_MT2032 33
73#define TUNER_TEMIC_4106FH5 34 /* 4106 FH5 (3X 7808, 7865)*/ 71#define TUNER_TEMIC_4106FH5 34 /* 4106 FH5 (3X 7808, 7865) */
74#define TUNER_TEMIC_4012FY5 35 /* 4012 FY5 (3X 0971, 1099)*/ 72#define TUNER_TEMIC_4012FY5 35 /* 4012 FY5 (3X 0971, 1099) */
75 73
76#define TUNER_TEMIC_4136FY5 36 /* 4136 FY5 (3X 7708, 7746)*/ 74#define TUNER_TEMIC_4136FY5 36 /* 4136 FY5 (3X 7708, 7746) */
77#define TUNER_LG_PAL_NEW_TAPC 37 75#define TUNER_LG_PAL_NEW_TAPC 37
78#define TUNER_PHILIPS_FM1216ME_MK3 38 76#define TUNER_PHILIPS_FM1216ME_MK3 38
79#define TUNER_LG_NTSC_NEW_TAPC 39 77#define TUNER_LG_NTSC_NEW_TAPC 39
80 78
81#define TUNER_HITACHI_NTSC 40 79#define TUNER_HITACHI_NTSC 40
82#define TUNER_PHILIPS_PAL_MK 41 80#define TUNER_PHILIPS_PAL_MK 41
83#define TUNER_PHILIPS_ATSC 42 81#define TUNER_PHILIPS_ATSC 42
84#define TUNER_PHILIPS_FM1236_MK3 43 82#define TUNER_PHILIPS_FM1236_MK3 43
85 83
86#define TUNER_PHILIPS_4IN1 44 /* ATI TV Wonder Pro - Conexant */ 84#define TUNER_PHILIPS_4IN1 44 /* ATI TV Wonder Pro - Conexant */
87/* Microtune mergeged with Temic 12/31/1999 partially financed by Alps - these may be similar to Temic */ 85/* Microtune mergeged with Temic 12/31/1999 partially financed by Alps - these may be similar to Temic */
88#define TUNER_MICROTUNE_4049FM5 45 86#define TUNER_MICROTUNE_4049FM5 45
89#define TUNER_LG_NTSC_TAPE 47 87#define TUNER_MICROTUNE_4042_FI5 46
90 88#define TUNER_LG_NTSC_TAPE 47
91#define TUNER_TNF_8831BGFF 48 89
92#define TUNER_MICROTUNE_4042FI5 49 /* DViCO FusionHDTV 3 Gold-Q - 4042 FI5 (3X 8147) */ 90#define TUNER_TNF_8831BGFF 48
93#define TUNER_TCL_2002N 50 91#define TUNER_MICROTUNE_4042FI5 49 /* DViCO FusionHDTV 3 Gold-Q - 4042 FI5 (3X 8147) */
94#define TUNER_PHILIPS_FM1256_IH3 51 92#define TUNER_TCL_2002N 50
95 93#define TUNER_PHILIPS_FM1256_IH3 51
96#define TUNER_THOMSON_DTT7610 52 94
97#define TUNER_PHILIPS_FQ1286 53 95#define TUNER_THOMSON_DTT7610 52
98#define TUNER_PHILIPS_TDA8290 54 96#define TUNER_PHILIPS_FQ1286 53
99#define TUNER_LG_PAL_TAPE 55 /* Hauppauge PVR-150 PAL */ 97#define TUNER_PHILIPS_TDA8290 54
100 98#define TUNER_LG_PAL_TAPE 55 /* Hauppauge PVR-150 PAL */
101#define TUNER_PHILIPS_FQ1216AME_MK4 56 /* Hauppauge PVR-150 PAL */ 99
102#define TUNER_PHILIPS_FQ1236A_MK4 57 /* Hauppauge PVR-500MCE NTSC */ 100#define TUNER_PHILIPS_FQ1216AME_MK4 56 /* Hauppauge PVR-150 PAL */
103 101#define TUNER_PHILIPS_FQ1236A_MK4 57 /* Hauppauge PVR-500MCE NTSC */
104#define TUNER_YMEC_TVF_8531MF 58 102#define TUNER_YMEC_TVF_8531MF 58
105#define TUNER_YMEC_TVF_5533MF 59 /* Pixelview Pro Ultra NTSC */ 103#define TUNER_YMEC_TVF_5533MF 59 /* Pixelview Pro Ultra NTSC */
106#define TUNER_THOMSON_DTT7611 60 /* DViCO FusionHDTV 3 Gold-T */ 104
107#define TUNER_TENA_9533_DI 61 105#define TUNER_THOMSON_DTT7611 60 /* DViCO FusionHDTV 3 Gold-T */
108 106#define TUNER_TENA_9533_DI 61
109#define TUNER_TEA5767 62 /* Only FM Radio Tuner */ 107#define TUNER_TEA5767 62 /* Only FM Radio Tuner */
110#define TUNER_PHILIPS_FMD1216ME_MK3 63 108#define TUNER_PHILIPS_FMD1216ME_MK3 63
111#define TUNER_LG_TDVS_H062F 64 /* DViCO FusionHDTV 5 */ 109
112#define TUNER_YMEC_TVF66T5_B_DFF 65 /* Acorp Y878F */ 110#define TUNER_LG_TDVS_H062F 64 /* DViCO FusionHDTV 5 */
111#define TUNER_YMEC_TVF66T5_B_DFF 65 /* Acorp Y878F */
112#define TUNER_LG_NTSC_TALN_MINI 66
113 113
114#define NOTUNER 0 114#define NOTUNER 0
115#define PAL 1 /* PAL_BG */ 115#define PAL 1 /* PAL_BG */
@@ -117,7 +117,7 @@
117#define NTSC 3 117#define NTSC 3
118#define SECAM 4 118#define SECAM 4
119#define ATSC 5 119#define ATSC 5
120#define RADIO 6 120#define RADIO 6
121 121
122#define NoTuner 0 122#define NoTuner 0
123#define Philips 1 123#define Philips 1
@@ -134,6 +134,7 @@
134#define THOMSON 12 134#define THOMSON 12
135 135
136#define TUNER_SET_TYPE_ADDR _IOW('T',3,int) 136#define TUNER_SET_TYPE_ADDR _IOW('T',3,int)
137#define TUNER_SET_STANDBY _IOW('T',4,int)
137#define TDA9887_SET_CONFIG _IOW('t',5,int) 138#define TDA9887_SET_CONFIG _IOW('t',5,int)
138 139
139/* tv card specific */ 140/* tv card specific */
@@ -153,9 +154,6 @@
153 154
154#ifdef __KERNEL__ 155#ifdef __KERNEL__
155 156
156#define I2C_ADDR_TDA8290 0x4b
157#define I2C_ADDR_TDA8275 0x61
158
159enum tuner_mode { 157enum tuner_mode {
160 T_UNINITIALIZED = 0, 158 T_UNINITIALIZED = 0,
161 T_RADIO = 1 << V4L2_TUNER_RADIO, 159 T_RADIO = 1 << V4L2_TUNER_RADIO,
@@ -165,21 +163,21 @@ enum tuner_mode {
165}; 163};
166 164
167struct tuner_setup { 165struct tuner_setup {
168 unsigned short addr; 166 unsigned short addr;
169 unsigned int type; 167 unsigned int type;
170 unsigned int mode_mask; 168 unsigned int mode_mask;
171}; 169};
172 170
173struct tuner { 171struct tuner {
174 /* device */ 172 /* device */
175 struct i2c_client i2c; 173 struct i2c_client i2c;
176 174
177 unsigned int type; /* chip type */ 175 unsigned int type; /* chip type */
178 176
179 unsigned int mode; 177 unsigned int mode;
180 unsigned int mode_mask; /* Combination of allowable modes */ 178 unsigned int mode_mask; /* Combination of allowable modes */
181 179
182 unsigned int freq; /* keep track of the current settings */ 180 unsigned int freq; /* keep track of the current settings */
183 unsigned int audmode; 181 unsigned int audmode;
184 v4l2_std_id std; 182 v4l2_std_id std;
185 183
@@ -198,6 +196,7 @@ struct tuner {
198 void (*radio_freq)(struct i2c_client *c, unsigned int freq); 196 void (*radio_freq)(struct i2c_client *c, unsigned int freq);
199 int (*has_signal)(struct i2c_client *c); 197 int (*has_signal)(struct i2c_client *c);
200 int (*is_stereo)(struct i2c_client *c); 198 int (*is_stereo)(struct i2c_client *c);
199 void (*standby)(struct i2c_client *c);
201}; 200};
202 201
203extern unsigned int tuner_debug; 202extern unsigned int tuner_debug;
@@ -209,16 +208,20 @@ extern int tea5767_tuner_init(struct i2c_client *c);
209extern int default_tuner_init(struct i2c_client *c); 208extern int default_tuner_init(struct i2c_client *c);
210extern int tea5767_autodetection(struct i2c_client *c); 209extern int tea5767_autodetection(struct i2c_client *c);
211 210
212#define tuner_warn(fmt, arg...) \ 211#define tuner_warn(fmt, arg...) do {\
213 dev_printk(KERN_WARNING , &t->i2c.dev , fmt , ## arg) 212 printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->name, \
214#define tuner_info(fmt, arg...) \ 213 t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0)
215 dev_printk(KERN_INFO , &t->i2c.dev , fmt , ## arg) 214#define tuner_info(fmt, arg...) do {\
216#define tuner_dbg(fmt, arg...) \ 215 printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->name, \
217 if (tuner_debug) dev_printk(KERN_DEBUG , &t->i2c.dev , fmt , ## arg) 216 t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0)
217#define tuner_dbg(fmt, arg...) do {\
218 if (tuner_debug) \
219 printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->name, \
220 t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0)
218 221
219#endif /* __KERNEL__ */ 222#endif /* __KERNEL__ */
220 223
221#endif 224#endif /* _TUNER_H */
222 225
223/* 226/*
224 * Overrides for Emacs so that we follow Linus's tabbing style. 227 * Overrides for Emacs so that we follow Linus's tabbing style.
diff --git a/include/media/tveeprom.h b/include/media/tveeprom.h
index 854a2c2f105b..e2035c7da094 100644
--- a/include/media/tveeprom.h
+++ b/include/media/tveeprom.h
@@ -1,18 +1,21 @@
1/* 1/*
2 * $Id: tveeprom.h,v 1.2 2005/06/12 04:19:19 mchehab Exp $
3 */ 2 */
4 3
5struct tveeprom { 4struct tveeprom {
6 u32 has_radio; 5 u32 has_radio;
6 u32 has_ir; /* 0: no IR, 1: IR present, 2: unknown */
7 7
8 u32 tuner_type; 8 u32 tuner_type;
9 u32 tuner_formats; 9 u32 tuner_formats;
10 10
11 u32 tuner2_type;
12 u32 tuner2_formats;
13
11 u32 digitizer; 14 u32 digitizer;
12 u32 digitizer_formats; 15 u32 digitizer_formats;
13 16
14 u32 audio_processor; 17 u32 audio_processor;
15 /* a_p_fmts? */ 18 u32 decoder_processor;
16 19
17 u32 model; 20 u32 model;
18 u32 revision; 21 u32 revision;
@@ -20,7 +23,7 @@ struct tveeprom {
20 char rev_str[5]; 23 char rev_str[5];
21}; 24};
22 25
23void tveeprom_hauppauge_analog(struct tveeprom *tvee, 26void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
24 unsigned char *eeprom_data); 27 unsigned char *eeprom_data);
25 28
26int tveeprom_read(struct i2c_client *c, unsigned char *eedata, int len); 29int tveeprom_read(struct i2c_client *c, unsigned char *eedata, int len);
diff --git a/include/media/video-buf.h b/include/media/video-buf.h
index ae6da6de98de..ae8d7a000440 100644
--- a/include/media/video-buf.h
+++ b/include/media/video-buf.h
@@ -1,5 +1,4 @@
1/* 1/*
2 * $Id: video-buf.h,v 1.9 2004/11/07 13:17:15 kraxel Exp $
3 * 2 *
4 * generic helper functions for video4linux capture buffers, to handle 3 * generic helper functions for video4linux capture buffers, to handle
5 * memory management and PCI DMA. Right now bttv + saa7134 use it. 4 * memory management and PCI DMA. Right now bttv + saa7134 use it.
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 926eed543023..227d3378decd 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -257,8 +257,8 @@ extern struct sock *ax25_make_new(struct sock *, struct ax25_dev *);
257 257
258/* ax25_addr.c */ 258/* ax25_addr.c */
259extern ax25_address null_ax25_address; 259extern ax25_address null_ax25_address;
260extern char *ax2asc(ax25_address *); 260extern char *ax2asc(char *buf, ax25_address *);
261extern ax25_address *asc2ax(char *); 261extern void asc2ax(ax25_address *addr, char *callsign);
262extern int ax25cmp(ax25_address *, ax25_address *); 262extern int ax25cmp(ax25_address *, ax25_address *);
263extern int ax25digicmp(ax25_digi *, ax25_digi *); 263extern int ax25digicmp(ax25_digi *, ax25_digi *);
264extern unsigned char *ax25_addr_parse(unsigned char *, int, ax25_address *, ax25_address *, ax25_digi *, int *, int *); 264extern unsigned char *ax25_addr_parse(unsigned char *, int, ax25_address *, ax25_address *, ax25_digi *, int *, int *);
diff --git a/include/net/compat.h b/include/net/compat.h
index 9983fd857804..290bab46d457 100644
--- a/include/net/compat.h
+++ b/include/net/compat.h
@@ -33,7 +33,8 @@ extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsi
33extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned); 33extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned);
34extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *); 34extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *);
35extern int put_cmsg_compat(struct msghdr*, int, int, int, void *); 35extern int put_cmsg_compat(struct msghdr*, int, int, int, void *);
36extern int cmsghdr_from_user_compat_to_kern(struct msghdr *, unsigned char *, 36
37 int); 37struct sock;
38extern int cmsghdr_from_user_compat_to_kern(struct msghdr *, struct sock *, unsigned char *, int);
38 39
39#endif /* NET_COMPAT_H */ 40#endif /* NET_COMPAT_H */
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 7a3c43711a17..e426641c519f 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -958,7 +958,7 @@ static __inline__ int ip_vs_todrop(void)
958 */ 958 */
959#define IP_VS_FWD_METHOD(cp) (cp->flags & IP_VS_CONN_F_FWD_MASK) 959#define IP_VS_FWD_METHOD(cp) (cp->flags & IP_VS_CONN_F_FWD_MASK)
960 960
961extern __inline__ char ip_vs_fwd_tag(struct ip_vs_conn *cp) 961static inline char ip_vs_fwd_tag(struct ip_vs_conn *cp)
962{ 962{
963 char fwd; 963 char fwd;
964 964
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 3203eaff4bd4..65ec86678a08 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -233,6 +233,10 @@ extern int ip6_ra_control(struct sock *sk, int sel,
233extern int ipv6_parse_hopopts(struct sk_buff *skb, int); 233extern int ipv6_parse_hopopts(struct sk_buff *skb, int);
234 234
235extern struct ipv6_txoptions * ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *opt); 235extern struct ipv6_txoptions * ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *opt);
236extern struct ipv6_txoptions * ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt,
237 int newtype,
238 struct ipv6_opt_hdr __user *newopt,
239 int newoptlen);
236 240
237extern int ip6_frag_nqueues; 241extern int ip6_frag_nqueues;
238extern atomic_t ip6_frag_mem; 242extern atomic_t ip6_frag_mem;
@@ -373,6 +377,7 @@ extern int ip6_append_data(struct sock *sk,
373 int length, 377 int length,
374 int transhdrlen, 378 int transhdrlen,
375 int hlimit, 379 int hlimit,
380 int tclass,
376 struct ipv6_txoptions *opt, 381 struct ipv6_txoptions *opt,
377 struct flowi *fl, 382 struct flowi *fl,
378 struct rt6_info *rt, 383 struct rt6_info *rt,
diff --git a/include/net/irda/irlan_filter.h b/include/net/irda/irlan_filter.h
index 3afeb6c94ea4..492dedaa8ac1 100644
--- a/include/net/irda/irlan_filter.h
+++ b/include/net/irda/irlan_filter.h
@@ -28,6 +28,6 @@
28void irlan_check_command_param(struct irlan_cb *self, char *param, 28void irlan_check_command_param(struct irlan_cb *self, char *param,
29 char *value); 29 char *value);
30void irlan_filter_request(struct irlan_cb *self, struct sk_buff *skb); 30void irlan_filter_request(struct irlan_cb *self, struct sk_buff *skb);
31int irlan_print_filter(struct seq_file *seq, int filter_type); 31void irlan_print_filter(struct seq_file *seq, int filter_type);
32 32
33#endif /* IRLAN_FILTER_H */ 33#endif /* IRLAN_FILTER_H */
diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h
index 44edd48f1234..d67c8393a343 100644
--- a/include/net/iw_handler.h
+++ b/include/net/iw_handler.h
@@ -1,10 +1,10 @@
1/* 1/*
2 * This file define the new driver API for Wireless Extensions 2 * This file define the new driver API for Wireless Extensions
3 * 3 *
4 * Version : 6 21.6.04 4 * Version : 7 18.3.05
5 * 5 *
6 * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> 6 * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com>
7 * Copyright (c) 2001-2004 Jean Tourrilhes, All Rights Reserved. 7 * Copyright (c) 2001-2005 Jean Tourrilhes, All Rights Reserved.
8 */ 8 */
9 9
10#ifndef _IW_HANDLER_H 10#ifndef _IW_HANDLER_H
@@ -207,7 +207,7 @@
207 * will be needed... 207 * will be needed...
208 * I just plan to increment with each new version. 208 * I just plan to increment with each new version.
209 */ 209 */
210#define IW_HANDLER_VERSION 6 210#define IW_HANDLER_VERSION 7
211 211
212/* 212/*
213 * Changes : 213 * Changes :
@@ -232,6 +232,13 @@
232 * - Remove spy #ifdef, they are always on -> cleaner code 232 * - Remove spy #ifdef, they are always on -> cleaner code
233 * - Add IW_DESCR_FLAG_NOMAX flag for very large requests 233 * - Add IW_DESCR_FLAG_NOMAX flag for very large requests
234 * - Start migrating get_wireless_stats to struct iw_handler_def 234 * - Start migrating get_wireless_stats to struct iw_handler_def
235 *
236 * V6 to V7
237 * --------
238 * - Add struct ieee80211_device pointer in struct iw_public_data
239 * - Remove (struct iw_point *)->pointer from events and streams
240 * - Remove spy_offset from struct iw_handler_def
241 * - Add "check" version of event macros for ieee802.11 stack
235 */ 242 */
236 243
237/**************************** CONSTANTS ****************************/ 244/**************************** CONSTANTS ****************************/
@@ -334,9 +341,6 @@ struct iw_handler_def
334 * We will automatically export that to user space... */ 341 * We will automatically export that to user space... */
335 const struct iw_priv_args * private_args; 342 const struct iw_priv_args * private_args;
336 343
337 /* This field will be *removed* in the next version of WE */
338 long spy_offset; /* DO NOT USE */
339
340 /* New location of get_wireless_stats, to de-bloat struct net_device. 344 /* New location of get_wireless_stats, to de-bloat struct net_device.
341 * The old pointer in struct net_device will be gradually phased 345 * The old pointer in struct net_device will be gradually phased
342 * out, and drivers are encouraged to use this one... */ 346 * out, and drivers are encouraged to use this one... */
@@ -400,16 +404,21 @@ struct iw_spy_data
400/* --------------------- DEVICE WIRELESS DATA --------------------- */ 404/* --------------------- DEVICE WIRELESS DATA --------------------- */
401/* 405/*
402 * This is all the wireless data specific to a device instance that 406 * This is all the wireless data specific to a device instance that
403 * is managed by the core of Wireless Extensions. 407 * is managed by the core of Wireless Extensions or the 802.11 layer.
404 * We only keep pointer to those structures, so that a driver is free 408 * We only keep pointer to those structures, so that a driver is free
405 * to share them between instances. 409 * to share them between instances.
406 * This structure should be initialised before registering the device. 410 * This structure should be initialised before registering the device.
407 * Access to this data follow the same rules as any other struct net_device 411 * Access to this data follow the same rules as any other struct net_device
408 * data (i.e. valid as long as struct net_device exist, same locking rules). 412 * data (i.e. valid as long as struct net_device exist, same locking rules).
409 */ 413 */
414/* Forward declaration */
415struct ieee80211_device;
416/* The struct */
410struct iw_public_data { 417struct iw_public_data {
411 /* Driver enhanced spy support */ 418 /* Driver enhanced spy support */
412 struct iw_spy_data * spy_data; 419 struct iw_spy_data * spy_data;
420 /* Structure managed by the in-kernel IEEE 802.11 layer */
421 struct ieee80211_device * ieee80211;
413}; 422};
414 423
415/**************************** PROTOTYPES ****************************/ 424/**************************** PROTOTYPES ****************************/
@@ -424,7 +433,7 @@ struct iw_public_data {
424extern int dev_get_wireless_info(char * buffer, char **start, off_t offset, 433extern int dev_get_wireless_info(char * buffer, char **start, off_t offset,
425 int length); 434 int length);
426 435
427/* Handle IOCTLs, called in net/code/dev.c */ 436/* Handle IOCTLs, called in net/core/dev.c */
428extern int wireless_process_ioctl(struct ifreq *ifr, unsigned int cmd); 437extern int wireless_process_ioctl(struct ifreq *ifr, unsigned int cmd);
429 438
430/* Second : functions that may be called by driver modules */ 439/* Second : functions that may be called by driver modules */
@@ -479,7 +488,7 @@ iwe_stream_add_event(char * stream, /* Stream of events */
479 int event_len) /* Real size of payload */ 488 int event_len) /* Real size of payload */
480{ 489{
481 /* Check if it's possible */ 490 /* Check if it's possible */
482 if((stream + event_len) < ends) { 491 if(likely((stream + event_len) < ends)) {
483 iwe->len = event_len; 492 iwe->len = event_len;
484 memcpy(stream, (char *) iwe, event_len); 493 memcpy(stream, (char *) iwe, event_len);
485 stream += event_len; 494 stream += event_len;
@@ -495,14 +504,17 @@ iwe_stream_add_event(char * stream, /* Stream of events */
495static inline char * 504static inline char *
496iwe_stream_add_point(char * stream, /* Stream of events */ 505iwe_stream_add_point(char * stream, /* Stream of events */
497 char * ends, /* End of stream */ 506 char * ends, /* End of stream */
498 struct iw_event *iwe, /* Payload */ 507 struct iw_event *iwe, /* Payload length + flags */
499 char * extra) 508 char * extra) /* More payload */
500{ 509{
501 int event_len = IW_EV_POINT_LEN + iwe->u.data.length; 510 int event_len = IW_EV_POINT_LEN + iwe->u.data.length;
502 /* Check if it's possible */ 511 /* Check if it's possible */
503 if((stream + event_len) < ends) { 512 if(likely((stream + event_len) < ends)) {
504 iwe->len = event_len; 513 iwe->len = event_len;
505 memcpy(stream, (char *) iwe, IW_EV_POINT_LEN); 514 memcpy(stream, (char *) iwe, IW_EV_LCP_LEN);
515 memcpy(stream + IW_EV_LCP_LEN,
516 ((char *) iwe) + IW_EV_LCP_LEN + IW_EV_POINT_OFF,
517 IW_EV_POINT_LEN - IW_EV_LCP_LEN);
506 memcpy(stream + IW_EV_POINT_LEN, extra, iwe->u.data.length); 518 memcpy(stream + IW_EV_POINT_LEN, extra, iwe->u.data.length);
507 stream += event_len; 519 stream += event_len;
508 } 520 }
@@ -526,7 +538,7 @@ iwe_stream_add_value(char * event, /* Event in the stream */
526 event_len -= IW_EV_LCP_LEN; 538 event_len -= IW_EV_LCP_LEN;
527 539
528 /* Check if it's possible */ 540 /* Check if it's possible */
529 if((value + event_len) < ends) { 541 if(likely((value + event_len) < ends)) {
530 /* Add new value */ 542 /* Add new value */
531 memcpy(value, (char *) iwe + IW_EV_LCP_LEN, event_len); 543 memcpy(value, (char *) iwe + IW_EV_LCP_LEN, event_len);
532 value += event_len; 544 value += event_len;
@@ -537,4 +549,85 @@ iwe_stream_add_value(char * event, /* Event in the stream */
537 return value; 549 return value;
538} 550}
539 551
552/*------------------------------------------------------------------*/
553/*
554 * Wrapper to add an Wireless Event to a stream of events.
555 * Same as above, with explicit error check...
556 */
557static inline char *
558iwe_stream_check_add_event(char * stream, /* Stream of events */
559 char * ends, /* End of stream */
560 struct iw_event *iwe, /* Payload */
561 int event_len, /* Size of payload */
562 int * perr) /* Error report */
563{
564 /* Check if it's possible, set error if not */
565 if(likely((stream + event_len) < ends)) {
566 iwe->len = event_len;
567 memcpy(stream, (char *) iwe, event_len);
568 stream += event_len;
569 } else
570 *perr = -E2BIG;
571 return stream;
572}
573
574/*------------------------------------------------------------------*/
575/*
576 * Wrapper to add an short Wireless Event containing a pointer to a
577 * stream of events.
578 * Same as above, with explicit error check...
579 */
580static inline char *
581iwe_stream_check_add_point(char * stream, /* Stream of events */
582 char * ends, /* End of stream */
583 struct iw_event *iwe, /* Payload length + flags */
584 char * extra, /* More payload */
585 int * perr) /* Error report */
586{
587 int event_len = IW_EV_POINT_LEN + iwe->u.data.length;
588 /* Check if it's possible */
589 if(likely((stream + event_len) < ends)) {
590 iwe->len = event_len;
591 memcpy(stream, (char *) iwe, IW_EV_LCP_LEN);
592 memcpy(stream + IW_EV_LCP_LEN,
593 ((char *) iwe) + IW_EV_LCP_LEN + IW_EV_POINT_OFF,
594 IW_EV_POINT_LEN - IW_EV_LCP_LEN);
595 memcpy(stream + IW_EV_POINT_LEN, extra, iwe->u.data.length);
596 stream += event_len;
597 } else
598 *perr = -E2BIG;
599 return stream;
600}
601
602/*------------------------------------------------------------------*/
603/*
604 * Wrapper to add a value to a Wireless Event in a stream of events.
605 * Be careful, this one is tricky to use properly :
606 * At the first run, you need to have (value = event + IW_EV_LCP_LEN).
607 * Same as above, with explicit error check...
608 */
609static inline char *
610iwe_stream_check_add_value(char * event, /* Event in the stream */
611 char * value, /* Value in event */
612 char * ends, /* End of stream */
613 struct iw_event *iwe, /* Payload */
614 int event_len, /* Size of payload */
615 int * perr) /* Error report */
616{
617 /* Don't duplicate LCP */
618 event_len -= IW_EV_LCP_LEN;
619
620 /* Check if it's possible */
621 if(likely((value + event_len) < ends)) {
622 /* Add new value */
623 memcpy(value, (char *) iwe + IW_EV_LCP_LEN, event_len);
624 value += event_len;
625 /* Patch LCP */
626 iwe->len = value - event;
627 memcpy(event, (char *) iwe, IW_EV_LCP_LEN);
628 } else
629 *perr = -E2BIG;
630 return value;
631}
632
540#endif /* _IW_HANDLER_H */ 633#endif /* _IW_HANDLER_H */
diff --git a/include/net/sock.h b/include/net/sock.h
index 312cb25cbd18..8c48fbecb7cf 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -709,6 +709,12 @@ static inline int sk_stream_rmem_schedule(struct sock *sk, struct sk_buff *skb)
709 sk_stream_mem_schedule(sk, skb->truesize, 1); 709 sk_stream_mem_schedule(sk, skb->truesize, 1);
710} 710}
711 711
712static inline int sk_stream_wmem_schedule(struct sock *sk, int size)
713{
714 return size <= sk->sk_forward_alloc ||
715 sk_stream_mem_schedule(sk, size, 0);
716}
717
712/* Used by processes to "lock" a socket state, so that 718/* Used by processes to "lock" a socket state, so that
713 * interrupts and bottom half handlers won't change it 719 * interrupts and bottom half handlers won't change it
714 * from under us. It essentially blocks any incoming 720 * from under us. It essentially blocks any incoming
@@ -1203,8 +1209,7 @@ static inline struct sk_buff *sk_stream_alloc_pskb(struct sock *sk,
1203 skb = alloc_skb_fclone(size + hdr_len, gfp); 1209 skb = alloc_skb_fclone(size + hdr_len, gfp);
1204 if (skb) { 1210 if (skb) {
1205 skb->truesize += mem; 1211 skb->truesize += mem;
1206 if (sk->sk_forward_alloc >= (int)skb->truesize || 1212 if (sk_stream_wmem_schedule(sk, skb->truesize)) {
1207 sk_stream_mem_schedule(sk, skb->truesize, 0)) {
1208 skb_reserve(skb, hdr_len); 1213 skb_reserve(skb, hdr_len);
1209 return skb; 1214 return skb;
1210 } 1215 }
@@ -1227,10 +1232,8 @@ static inline struct page *sk_stream_alloc_page(struct sock *sk)
1227{ 1232{
1228 struct page *page = NULL; 1233 struct page *page = NULL;
1229 1234
1230 if (sk->sk_forward_alloc >= (int)PAGE_SIZE || 1235 page = alloc_pages(sk->sk_allocation, 0);
1231 sk_stream_mem_schedule(sk, PAGE_SIZE, 0)) 1236 if (!page) {
1232 page = alloc_pages(sk->sk_allocation, 0);
1233 else {
1234 sk->sk_prot->enter_memory_pressure(); 1237 sk->sk_prot->enter_memory_pressure();
1235 sk_stream_moderate_sndbuf(sk); 1238 sk_stream_moderate_sndbuf(sk);
1236 } 1239 }
@@ -1374,9 +1377,10 @@ extern void sk_init(void);
1374 1377
1375#ifdef CONFIG_SYSCTL 1378#ifdef CONFIG_SYSCTL
1376extern struct ctl_table core_table[]; 1379extern struct ctl_table core_table[];
1377extern int sysctl_optmem_max;
1378#endif 1380#endif
1379 1381
1382extern int sysctl_optmem_max;
1383
1380extern __u32 sysctl_wmem_default; 1384extern __u32 sysctl_wmem_default;
1381extern __u32 sysctl_rmem_default; 1385extern __u32 sysctl_rmem_default;
1382 1386
diff --git a/include/net/tcp.h b/include/net/tcp.h
index d6bcf1317a6a..97af77c4d096 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -454,6 +454,7 @@ extern int tcp_retransmit_skb(struct sock *, struct sk_buff *);
454extern void tcp_xmit_retransmit_queue(struct sock *); 454extern void tcp_xmit_retransmit_queue(struct sock *);
455extern void tcp_simple_retransmit(struct sock *); 455extern void tcp_simple_retransmit(struct sock *);
456extern int tcp_trim_head(struct sock *, struct sk_buff *, u32); 456extern int tcp_trim_head(struct sock *, struct sk_buff *, u32);
457extern int tcp_fragment(struct sock *, struct sk_buff *, u32, unsigned int);
457 458
458extern void tcp_send_probe0(struct sock *); 459extern void tcp_send_probe0(struct sock *);
459extern void tcp_send_partial(struct sock *); 460extern void tcp_send_partial(struct sock *);
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h
index 8b075ab7a26c..4e86f2de6638 100644
--- a/include/net/transp_v6.h
+++ b/include/net/transp_v6.h
@@ -37,7 +37,7 @@ extern int datagram_recv_ctl(struct sock *sk,
37extern int datagram_send_ctl(struct msghdr *msg, 37extern int datagram_send_ctl(struct msghdr *msg,
38 struct flowi *fl, 38 struct flowi *fl,
39 struct ipv6_txoptions *opt, 39 struct ipv6_txoptions *opt,
40 int *hlimit); 40 int *hlimit, int *tclass);
41 41
42#define LOOPBACK4_IPV6 __constant_htonl(0x7f000006) 42#define LOOPBACK4_IPV6 __constant_htonl(0x7f000006)
43 43
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index b707a603351b..cb8b6e6ce66c 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -151,6 +151,8 @@ struct pcmcia_device {
151 uniquely define a pcmcia_device */ 151 uniquely define a pcmcia_device */
152 struct pcmcia_socket *socket; 152 struct pcmcia_socket *socket;
153 153
154 char *devname;
155
154 u8 device_no; 156 u8 device_no;
155 157
156 /* the hardware "function" device; certain subdevices can 158 /* the hardware "function" device; certain subdevices can
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index 9957f16dcc5d..bed4b7c9be99 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -51,12 +51,16 @@ struct scsi_cmnd {
51 * printk's to use ->pid, so that we can kill this field. 51 * printk's to use ->pid, so that we can kill this field.
52 */ 52 */
53 unsigned long serial_number; 53 unsigned long serial_number;
54 /*
55 * This is set to jiffies as it was when the command was first
56 * allocated. It is used to time how long the command has
57 * been outstanding
58 */
59 unsigned long jiffies_at_alloc;
54 60
55 int retries; 61 int retries;
56 int allowed; 62 int allowed;
57 int timeout_per_command; 63 int timeout_per_command;
58 int timeout_total;
59 int timeout;
60 64
61 unsigned char cmd_len; 65 unsigned char cmd_len;
62 unsigned char old_cmd_len; 66 unsigned char old_cmd_len;
diff --git a/include/scsi/scsi_dbg.h b/include/scsi/scsi_dbg.h
index 12e90934a7a8..b090a11d7e1c 100644
--- a/include/scsi/scsi_dbg.h
+++ b/include/scsi/scsi_dbg.h
@@ -3,8 +3,10 @@
3 3
4struct scsi_cmnd; 4struct scsi_cmnd;
5struct scsi_request; 5struct scsi_request;
6struct scsi_sense_hdr;
6 7
7extern void scsi_print_command(struct scsi_cmnd *); 8extern void scsi_print_command(struct scsi_cmnd *);
9extern void scsi_print_sense_hdr(const char *, struct scsi_sense_hdr *);
8extern void __scsi_print_command(unsigned char *); 10extern void __scsi_print_command(unsigned char *);
9extern void scsi_print_sense(const char *, struct scsi_cmnd *); 11extern void scsi_print_sense(const char *, struct scsi_cmnd *);
10extern void scsi_print_req_sense(const char *, struct scsi_request *); 12extern void scsi_print_req_sense(const char *, struct scsi_request *);
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 835af8ecbb7c..da63722c0123 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -8,8 +8,17 @@
8 8
9struct request_queue; 9struct request_queue;
10struct scsi_cmnd; 10struct scsi_cmnd;
11struct scsi_mode_data;
12struct scsi_lun; 11struct scsi_lun;
12struct scsi_sense_hdr;
13
14struct scsi_mode_data {
15 __u32 length;
16 __u16 block_descriptor_length;
17 __u8 medium_type;
18 __u8 device_specific;
19 __u8 header_length;
20 __u8 longlba:1;
21};
13 22
14/* 23/*
15 * sdev state: If you alter this, you also need to alter scsi_sysfs.c 24 * sdev state: If you alter this, you also need to alter scsi_sysfs.c
@@ -228,7 +237,8 @@ extern int scsi_set_medium_removal(struct scsi_device *, char);
228 237
229extern int scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, 238extern int scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage,
230 unsigned char *buffer, int len, int timeout, 239 unsigned char *buffer, int len, int timeout,
231 int retries, struct scsi_mode_data *data); 240 int retries, struct scsi_mode_data *data,
241 struct scsi_sense_hdr *);
232extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout, 242extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout,
233 int retries); 243 int retries);
234extern int scsi_device_set_state(struct scsi_device *sdev, 244extern int scsi_device_set_state(struct scsi_device *sdev,
@@ -247,6 +257,14 @@ extern void int_to_scsilun(unsigned int, struct scsi_lun *);
247extern const char *scsi_device_state_name(enum scsi_device_state); 257extern const char *scsi_device_state_name(enum scsi_device_state);
248extern int scsi_is_sdev_device(const struct device *); 258extern int scsi_is_sdev_device(const struct device *);
249extern int scsi_is_target_device(const struct device *); 259extern int scsi_is_target_device(const struct device *);
260extern int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
261 int data_direction, void *buffer, unsigned bufflen,
262 unsigned char *sense, int timeout, int retries,
263 int flag);
264extern int scsi_execute_req(struct scsi_device *sdev, const unsigned char *cmd,
265 int data_direction, void *buffer, unsigned bufflen,
266 struct scsi_sense_hdr *, int timeout, int retries);
267
250static inline int scsi_device_online(struct scsi_device *sdev) 268static inline int scsi_device_online(struct scsi_device *sdev)
251{ 269{
252 return sdev->sdev_state != SDEV_OFFLINE; 270 return sdev->sdev_state != SDEV_OFFLINE;
diff --git a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h
index 80557f879e3e..fabd879c2f2e 100644
--- a/include/scsi/scsi_eh.h
+++ b/include/scsi/scsi_eh.h
@@ -26,10 +26,15 @@ struct scsi_sense_hdr { /* See SPC-3 section 4.5 */
26 u8 additional_length; /* always 0 for fixed sense format */ 26 u8 additional_length; /* always 0 for fixed sense format */
27}; 27};
28 28
29static inline int scsi_sense_valid(struct scsi_sense_hdr *sshdr)
30{
31 if (!sshdr)
32 return 0;
33
34 return (sshdr->response_code & 0x70) == 0x70;
35}
36
29 37
30extern void scsi_add_timer(struct scsi_cmnd *, int,
31 void (*)(struct scsi_cmnd *));
32extern int scsi_delete_timer(struct scsi_cmnd *);
33extern void scsi_report_bus_reset(struct Scsi_Host *, int); 38extern void scsi_report_bus_reset(struct Scsi_Host *, int);
34extern void scsi_report_device_reset(struct Scsi_Host *, int, int); 39extern void scsi_report_device_reset(struct Scsi_Host *, int, int);
35extern int scsi_block_when_processing_errors(struct scsi_device *); 40extern int scsi_block_when_processing_errors(struct scsi_device *);
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 81d5234f6771..916144be208b 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -429,12 +429,15 @@ struct scsi_host_template {
429}; 429};
430 430
431/* 431/*
432 * shost states 432 * shost state: If you alter this, you also need to alter scsi_sysfs.c
433 * (for the ascii descriptions) and the state model enforcer:
434 * scsi_host_set_state()
433 */ 435 */
434enum { 436enum scsi_host_state {
435 SHOST_ADD, 437 SHOST_CREATED = 1,
436 SHOST_DEL, 438 SHOST_RUNNING,
437 SHOST_CANCEL, 439 SHOST_CANCEL,
440 SHOST_DEL,
438 SHOST_RECOVERY, 441 SHOST_RECOVERY,
439}; 442};
440 443
@@ -464,12 +467,10 @@ struct Scsi_Host {
464 struct task_struct * ehandler; /* Error recovery thread. */ 467 struct task_struct * ehandler; /* Error recovery thread. */
465 struct semaphore * eh_wait; /* The error recovery thread waits 468 struct semaphore * eh_wait; /* The error recovery thread waits
466 on this. */ 469 on this. */
467 struct completion * eh_notify; /* wait for eh to begin or end */
468 struct semaphore * eh_action; /* Wait for specific actions on the 470 struct semaphore * eh_action; /* Wait for specific actions on the
469 host. */ 471 host. */
470 unsigned int eh_active:1; /* Indicates the eh thread is awake and active if 472 unsigned int eh_active:1; /* Indicates the eh thread is awake and active if
471 this is true. */ 473 this is true. */
472 unsigned int eh_kill:1; /* set when killing the eh thread */
473 wait_queue_head_t host_wait; 474 wait_queue_head_t host_wait;
474 struct scsi_host_template *hostt; 475 struct scsi_host_template *hostt;
475 struct scsi_transport_template *transportt; 476 struct scsi_transport_template *transportt;
@@ -575,7 +576,7 @@ struct Scsi_Host {
575 unsigned int irq; 576 unsigned int irq;
576 577
577 578
578 unsigned long shost_state; 579 enum scsi_host_state shost_state;
579 580
580 /* ldm bits */ 581 /* ldm bits */
581 struct device shost_gendev; 582 struct device shost_gendev;
@@ -633,6 +634,7 @@ extern void scsi_remove_host(struct Scsi_Host *);
633extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *); 634extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *);
634extern void scsi_host_put(struct Scsi_Host *t); 635extern void scsi_host_put(struct Scsi_Host *t);
635extern struct Scsi_Host *scsi_host_lookup(unsigned short); 636extern struct Scsi_Host *scsi_host_lookup(unsigned short);
637extern const char *scsi_host_state_name(enum scsi_host_state);
636 638
637extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); 639extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *);
638 640
@@ -646,6 +648,15 @@ static inline struct device *scsi_get_device(struct Scsi_Host *shost)
646 return shost->shost_gendev.parent; 648 return shost->shost_gendev.parent;
647} 649}
648 650
651/**
652 * scsi_host_scan_allowed - Is scanning of this host allowed
653 * @shost: Pointer to Scsi_Host.
654 **/
655static inline int scsi_host_scan_allowed(struct Scsi_Host *shost)
656{
657 return shost->shost_state == SHOST_RUNNING;
658}
659
649extern void scsi_unblock_requests(struct Scsi_Host *); 660extern void scsi_unblock_requests(struct Scsi_Host *);
650extern void scsi_block_requests(struct Scsi_Host *); 661extern void scsi_block_requests(struct Scsi_Host *);
651 662
@@ -663,5 +674,6 @@ extern struct scsi_device *scsi_get_host_dev(struct Scsi_Host *);
663/* legacy interfaces */ 674/* legacy interfaces */
664extern struct Scsi_Host *scsi_register(struct scsi_host_template *, int); 675extern struct Scsi_Host *scsi_register(struct scsi_host_template *, int);
665extern void scsi_unregister(struct Scsi_Host *); 676extern void scsi_unregister(struct Scsi_Host *);
677extern int scsi_host_set_state(struct Scsi_Host *, enum scsi_host_state);
666 678
667#endif /* _SCSI_SCSI_HOST_H */ 679#endif /* _SCSI_SCSI_HOST_H */
diff --git a/include/scsi/scsi_request.h b/include/scsi/scsi_request.h
index 98719407d554..6a140020d7cb 100644
--- a/include/scsi/scsi_request.h
+++ b/include/scsi/scsi_request.h
@@ -54,20 +54,4 @@ extern void scsi_do_req(struct scsi_request *, const void *cmnd,
54 void *buffer, unsigned bufflen, 54 void *buffer, unsigned bufflen,
55 void (*done) (struct scsi_cmnd *), 55 void (*done) (struct scsi_cmnd *),
56 int timeout, int retries); 56 int timeout, int retries);
57
58struct scsi_mode_data {
59 __u32 length;
60 __u16 block_descriptor_length;
61 __u8 medium_type;
62 __u8 device_specific;
63 __u8 header_length;
64 __u8 longlba:1;
65};
66
67extern int __scsi_mode_sense(struct scsi_request *SRpnt, int dbd,
68 int modepage, unsigned char *buffer, int len,
69 int timeout, int retries,
70 struct scsi_mode_data *data);
71
72
73#endif /* _SCSI_SCSI_REQUEST_H */ 57#endif /* _SCSI_SCSI_REQUEST_H */
diff --git a/include/scsi/scsi_transport_spi.h b/include/scsi/scsi_transport_spi.h
index a30d6cd4c0e8..6bdc4afb2483 100644
--- a/include/scsi/scsi_transport_spi.h
+++ b/include/scsi/scsi_transport_spi.h
@@ -39,6 +39,7 @@ struct spi_transport_attrs {
39 unsigned int rd_strm:1; /* Read streaming enabled */ 39 unsigned int rd_strm:1; /* Read streaming enabled */
40 unsigned int rti:1; /* Retain Training Information */ 40 unsigned int rti:1; /* Retain Training Information */
41 unsigned int pcomp_en:1;/* Precompensation enabled */ 41 unsigned int pcomp_en:1;/* Precompensation enabled */
42 unsigned int hold_mcs:1;/* Hold Margin Control Settings */
42 unsigned int initial_dv:1; /* DV done to this target yet */ 43 unsigned int initial_dv:1; /* DV done to this target yet */
43 unsigned long flags; /* flags field for drivers to use */ 44 unsigned long flags; /* flags field for drivers to use */
44 /* Device Properties fields */ 45 /* Device Properties fields */
@@ -78,6 +79,7 @@ struct spi_host_attrs {
78#define spi_rd_strm(x) (((struct spi_transport_attrs *)&(x)->starget_data)->rd_strm) 79#define spi_rd_strm(x) (((struct spi_transport_attrs *)&(x)->starget_data)->rd_strm)
79#define spi_rti(x) (((struct spi_transport_attrs *)&(x)->starget_data)->rti) 80#define spi_rti(x) (((struct spi_transport_attrs *)&(x)->starget_data)->rti)
80#define spi_pcomp_en(x) (((struct spi_transport_attrs *)&(x)->starget_data)->pcomp_en) 81#define spi_pcomp_en(x) (((struct spi_transport_attrs *)&(x)->starget_data)->pcomp_en)
82#define spi_hold_mcs(x) (((struct spi_transport_attrs *)&(x)->starget_data)->hold_mcs)
81#define spi_initial_dv(x) (((struct spi_transport_attrs *)&(x)->starget_data)->initial_dv) 83#define spi_initial_dv(x) (((struct spi_transport_attrs *)&(x)->starget_data)->initial_dv)
82 84
83#define spi_support_sync(x) (((struct spi_transport_attrs *)&(x)->starget_data)->support_sync) 85#define spi_support_sync(x) (((struct spi_transport_attrs *)&(x)->starget_data)->support_sync)
@@ -114,8 +116,11 @@ struct spi_function_template {
114 void (*set_rti)(struct scsi_target *, int); 116 void (*set_rti)(struct scsi_target *, int);
115 void (*get_pcomp_en)(struct scsi_target *); 117 void (*get_pcomp_en)(struct scsi_target *);
116 void (*set_pcomp_en)(struct scsi_target *, int); 118 void (*set_pcomp_en)(struct scsi_target *, int);
119 void (*get_hold_mcs)(struct scsi_target *);
120 void (*set_hold_mcs)(struct scsi_target *, int);
117 void (*get_signalling)(struct Scsi_Host *); 121 void (*get_signalling)(struct Scsi_Host *);
118 void (*set_signalling)(struct Scsi_Host *, enum spi_signal_type); 122 void (*set_signalling)(struct Scsi_Host *, enum spi_signal_type);
123 int (*deny_binding)(struct scsi_target *);
119 /* The driver sets these to tell the transport class it 124 /* The driver sets these to tell the transport class it
120 * wants the attributes displayed in sysfs. If the show_ flag 125 * wants the attributes displayed in sysfs. If the show_ flag
121 * is not set, the attribute will be private to the transport 126 * is not set, the attribute will be private to the transport
@@ -130,6 +135,7 @@ struct spi_function_template {
130 unsigned long show_rd_strm:1; 135 unsigned long show_rd_strm:1;
131 unsigned long show_rti:1; 136 unsigned long show_rti:1;
132 unsigned long show_pcomp_en:1; 137 unsigned long show_pcomp_en:1;
138 unsigned long show_hold_mcs:1;
133}; 139};
134 140
135struct scsi_transport_template *spi_attach_transport(struct spi_function_template *); 141struct scsi_transport_template *spi_attach_transport(struct spi_function_template *);
diff --git a/include/sound/core.h b/include/sound/core.h
index f72b3ef515e2..3dc41fd5c54d 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -291,12 +291,14 @@ void snd_memory_done(void);
291int snd_memory_info_init(void); 291int snd_memory_info_init(void);
292int snd_memory_info_done(void); 292int snd_memory_info_done(void);
293void *snd_hidden_kmalloc(size_t size, unsigned int __nocast flags); 293void *snd_hidden_kmalloc(size_t size, unsigned int __nocast flags);
294void *snd_hidden_kzalloc(size_t size, unsigned int __nocast flags);
294void *snd_hidden_kcalloc(size_t n, size_t size, unsigned int __nocast flags); 295void *snd_hidden_kcalloc(size_t n, size_t size, unsigned int __nocast flags);
295void snd_hidden_kfree(const void *obj); 296void snd_hidden_kfree(const void *obj);
296void *snd_hidden_vmalloc(unsigned long size); 297void *snd_hidden_vmalloc(unsigned long size);
297void snd_hidden_vfree(void *obj); 298void snd_hidden_vfree(void *obj);
298char *snd_hidden_kstrdup(const char *s, unsigned int __nocast flags); 299char *snd_hidden_kstrdup(const char *s, unsigned int __nocast flags);
299#define kmalloc(size, flags) snd_hidden_kmalloc(size, flags) 300#define kmalloc(size, flags) snd_hidden_kmalloc(size, flags)
301#define kzalloc(size, flags) snd_hidden_kzalloc(size, flags)
300#define kcalloc(n, size, flags) snd_hidden_kcalloc(n, size, flags) 302#define kcalloc(n, size, flags) snd_hidden_kcalloc(n, size, flags)
301#define kfree(obj) snd_hidden_kfree(obj) 303#define kfree(obj) snd_hidden_kfree(obj)
302#define vmalloc(size) snd_hidden_vmalloc(size) 304#define vmalloc(size) snd_hidden_vmalloc(size)
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index fa23ebfb857a..d6361dab0370 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -903,18 +903,17 @@ int snd_pcm_format_unsigned(snd_pcm_format_t format);
903int snd_pcm_format_linear(snd_pcm_format_t format); 903int snd_pcm_format_linear(snd_pcm_format_t format);
904int snd_pcm_format_little_endian(snd_pcm_format_t format); 904int snd_pcm_format_little_endian(snd_pcm_format_t format);
905int snd_pcm_format_big_endian(snd_pcm_format_t format); 905int snd_pcm_format_big_endian(snd_pcm_format_t format);
906/** 906/*
907 * snd_pcm_format_cpu_endian - Check the PCM format is CPU-endian 907 * snd_pcm_format_cpu_endian - Check the PCM format is CPU-endian
908 * @format: the format to check 908 * @format: the format to check
909 * 909 *
910 * Returns 1 if the given PCM format is CPU-endian, 0 if 910 * Returns 1 if the given PCM format is CPU-endian, 0 if
911 * opposite, or a negative error code if endian not specified. 911 * opposite, or a negative error code if endian not specified.
912 */ 912 */
913/* int snd_pcm_format_cpu_endian(snd_pcm_format_t format); */
914#ifdef SNDRV_LITTLE_ENDIAN 913#ifdef SNDRV_LITTLE_ENDIAN
915#define snd_pcm_format_cpu_endian snd_pcm_format_little_endian 914#define snd_pcm_format_cpu_endian(format) snd_pcm_format_little_endian(format)
916#else 915#else
917#define snd_pcm_format_cpu_endian snd_pcm_format_big_endian 916#define snd_pcm_format_cpu_endian(format) snd_pcm_format_big_endian(format)
918#endif 917#endif
919int snd_pcm_format_width(snd_pcm_format_t format); /* in bits */ 918int snd_pcm_format_width(snd_pcm_format_t format); /* in bits */
920int snd_pcm_format_physical_width(snd_pcm_format_t format); /* in bits */ 919int snd_pcm_format_physical_width(snd_pcm_format_t format); /* in bits */
diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h
index ad3c3be33c03..b82e408e758f 100644
--- a/include/sound/tea575x-tuner.h
+++ b/include/sound/tea575x-tuner.h
@@ -34,9 +34,7 @@ struct snd_tea575x_ops {
34struct snd_tea575x { 34struct snd_tea575x {
35 snd_card_t *card; 35 snd_card_t *card;
36 struct video_device vd; /* video device */ 36 struct video_device vd; /* video device */
37#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0)
38 struct file_operations fops; 37 struct file_operations fops;
39#endif
40 int dev_nr; /* requested device number + 1 */ 38 int dev_nr; /* requested device number + 1 */
41 int vd_registered; /* video device is registered */ 39 int vd_registered; /* video device is registered */
42 int tea5759; /* 5759 chip is present */ 40 int tea5759; /* 5759 chip is present */
diff --git a/include/video/cyblafb.h b/include/video/cyblafb.h
new file mode 100644
index 000000000000..a9948232b131
--- /dev/null
+++ b/include/video/cyblafb.h
@@ -0,0 +1,171 @@
1
2#ifndef CYBLAFB_DEBUG
3#define CYBLAFB_DEBUG 0
4#endif
5
6#if CYBLAFB_DEBUG
7#define debug(f,a...) printk("%s:" f, __FUNCTION__ , ## a);
8#else
9#define debug(f,a...)
10#endif
11
12#define output(f, a...) printk("cyblafb: " f, ## a)
13
14#define Kb (1024)
15#define Mb (Kb*Kb)
16
17/* PCI IDS of supported cards temporarily here */
18
19#define CYBERBLADEi1 0x8500
20
21/* these defines are for 'lcd' variable */
22#define LCD_STRETCH 0
23#define LCD_CENTER 1
24#define LCD_BIOS 2
25
26/* display types */
27#define DISPLAY_CRT 0
28#define DISPLAY_FP 1
29
30#define ROP_S 0xCC
31
32#define point(x,y) ((y)<<16|(x))
33
34//
35// Attribute Regs, ARxx, 3c0/3c1
36//
37#define AR00 0x00
38#define AR01 0x01
39#define AR02 0x02
40#define AR03 0x03
41#define AR04 0x04
42#define AR05 0x05
43#define AR06 0x06
44#define AR07 0x07
45#define AR08 0x08
46#define AR09 0x09
47#define AR0A 0x0A
48#define AR0B 0x0B
49#define AR0C 0x0C
50#define AR0D 0x0D
51#define AR0E 0x0E
52#define AR0F 0x0F
53#define AR10 0x10
54#define AR12 0x12
55#define AR13 0x13
56
57//
58// Sequencer Regs, SRxx, 3c4/3c5
59//
60#define SR00 0x00
61#define SR01 0x01
62#define SR02 0x02
63#define SR03 0x03
64#define SR04 0x04
65#define SR0D 0x0D
66#define SR0E 0x0E
67#define SR11 0x11
68#define SR18 0x18
69#define SR19 0x19
70
71//
72//
73//
74#define CR00 0x00
75#define CR01 0x01
76#define CR02 0x02
77#define CR03 0x03
78#define CR04 0x04
79#define CR05 0x05
80#define CR06 0x06
81#define CR07 0x07
82#define CR08 0x08
83#define CR09 0x09
84#define CR0A 0x0A
85#define CR0B 0x0B
86#define CR0C 0x0C
87#define CR0D 0x0D
88#define CR0E 0x0E
89#define CR0F 0x0F
90#define CR10 0x10
91#define CR11 0x11
92#define CR12 0x12
93#define CR13 0x13
94#define CR14 0x14
95#define CR15 0x15
96#define CR16 0x16
97#define CR17 0x17
98#define CR18 0x18
99#define CR19 0x19
100#define CR1A 0x1A
101#define CR1B 0x1B
102#define CR1C 0x1C
103#define CR1D 0x1D
104#define CR1E 0x1E
105#define CR1F 0x1F
106#define CR20 0x20
107#define CR21 0x21
108#define CR27 0x27
109#define CR29 0x29
110#define CR2A 0x2A
111#define CR2B 0x2B
112#define CR2D 0x2D
113#define CR2F 0x2F
114#define CR36 0x36
115#define CR38 0x38
116#define CR39 0x39
117#define CR3A 0x3A
118#define CR55 0x55
119#define CR56 0x56
120#define CR57 0x57
121#define CR58 0x58
122
123//
124//
125//
126
127#define GR00 0x01
128#define GR01 0x01
129#define GR02 0x02
130#define GR03 0x03
131#define GR04 0x04
132#define GR05 0x05
133#define GR06 0x06
134#define GR07 0x07
135#define GR08 0x08
136#define GR0F 0x0F
137#define GR20 0x20
138#define GR23 0x23
139#define GR2F 0x2F
140#define GR30 0x30
141#define GR31 0x31
142#define GR33 0x33
143#define GR52 0x52
144#define GR53 0x53
145#define GR5D 0x5d
146
147
148//
149// Graphics Engine
150//
151#define GEBase 0x2100 // could be mapped elsewhere if we like it
152#define GE00 (GEBase+0x00) // source 1, p 111
153#define GE04 (GEBase+0x04) // source 2, p 111
154#define GE08 (GEBase+0x08) // destination 1, p 111
155#define GE0C (GEBase+0x0C) // destination 2, p 112
156#define GE20 (GEBase+0x20) // engine status, p 113
157#define GE24 (GEBase+0x24) // reset all GE pointers
158#define GE44 (GEBase+0x44) // command register, p 126
159#define GE48 (GEBase+0x48) // raster operation, p 127
160#define GE60 (GEBase+0x60) // foreground color, p 128
161#define GE64 (GEBase+0x64) // background color, p 128
162#define GE6C (GEBase+0x6C) // Pattern and Style, p 129, ok
163#define GE9C (GEBase+0x9C) // pixel engine data port, p 125
164#define GEB8 (GEBase+0xB8) // Destination Stride / Buffer Base 0, p 133
165#define GEBC (GEBase+0xBC) // Destination Stride / Buffer Base 1, p 133
166#define GEC0 (GEBase+0xC0) // Destination Stride / Buffer Base 2, p 133
167#define GEC4 (GEBase+0xC4) // Destination Stride / Buffer Base 3, p 133
168#define GEC8 (GEBase+0xC8) // Source Stride / Buffer Base 0, p 133
169#define GECC (GEBase+0xCC) // Source Stride / Buffer Base 1, p 133
170#define GED0 (GEBase+0xD0) // Source Stride / Buffer Base 2, p 133
171#define GED4 (GEBase+0xD4) // Source Stride / Buffer Base 3, p 133
diff --git a/include/video/pmag-ba-fb.h b/include/video/pmag-ba-fb.h
index cebef073b9a3..fceb6c0f6583 100644
--- a/include/video/pmag-ba-fb.h
+++ b/include/video/pmag-ba-fb.h
@@ -1,24 +1,27 @@
1/* 1/*
2 * linux/drivers/video/pmag-ba-fb.h 2 * linux/include/video/pmag-ba-fb.h
3 * 3 *
4 * TurboChannel PMAG-BA framebuffer card support, 4 * TURBOchannel PMAG-BA Color Frame Buffer (CFB) card support,
5 * Copyright (C) 1999,2000,2001 by 5 * Copyright (C) 1999, 2000, 2001 by
6 * Michael Engel <engel@unix-ag.org>, 6 * Michael Engel <engel@unix-ag.org>,
7 * Karsten Merker <merker@linuxtag.org> 7 * Karsten Merker <merker@linuxtag.org>
8 * This file is subject to the terms and conditions of the GNU General 8 * Copyright (c) 2005 Maciej W. Rozycki
9 * Public License. See the file COPYING in the main directory of this 9 *
10 * archive for more details. 10 * This file is subject to the terms and conditions of the GNU General
11 */ 11 * Public License. See the file COPYING in the main directory of this
12 12 * archive for more details.
13/*
14 * Bt459 RAM DAC register base offset (rel. to TC slot base address)
15 */ 13 */
16 14
17#define PMAG_BA_BT459_OFFSET 0x00200000 15/* IOmem resource offsets. */
18 16#define PMAG_BA_FBMEM 0x000000 /* frame buffer */
19/* 17#define PMAG_BA_BT459 0x200000 /* Bt459 RAMDAC */
20 * Begin of PMAG-BA framebuffer memory relative to TC slot address, 18#define PMAG_BA_IRQ 0x300000 /* IRQ acknowledge */
21 * resolution is 1024x864x8 19#define PMAG_BA_ROM 0x380000 /* REX option ROM */
22 */ 20#define PMAG_BA_BT438 0x380000 /* Bt438 clock chip reset */
21#define PMAG_BA_SIZE 0x400000 /* address space size */
23 22
24#define PMAG_BA_ONBOARD_FBMEM_OFFSET 0x00000000 23/* Bt459 register offsets, byte-wide registers. */
24#define BT459_ADDR_LO 0x0 /* address low */
25#define BT459_ADDR_HI 0x4 /* address high */
26#define BT459_DATA 0x8 /* data window register */
27#define BT459_CMAP 0xc /* color map window register */
diff --git a/include/video/pmagb-b-fb.h b/include/video/pmagb-b-fb.h
index 87b81a555139..7539b9087a80 100644
--- a/include/video/pmagb-b-fb.h
+++ b/include/video/pmagb-b-fb.h
@@ -1,32 +1,58 @@
1/* 1/*
2 * linux/drivers/video/pmagb-b-fb.h 2 * linux/include/video/pmagb-b-fb.h
3 * 3 *
4 * TurboChannel PMAGB-B framebuffer card support, 4 * TURBOchannel PMAGB-B Smart Frame Buffer (SFB) card support,
5 * Copyright (C) 1999, 2000, 2001 by 5 * Copyright (C) 1999, 2000, 2001 by
6 * Michael Engel <engel@unix-ag.org> and 6 * Michael Engel <engel@unix-ag.org> and
7 * Karsten Merker <merker@linuxtag.org> 7 * Karsten Merker <merker@linuxtag.org>
8 * This file is subject to the terms and conditions of the GNU General 8 * Copyright (c) 2005 Maciej W. Rozycki
9 * Public License. See the file COPYING in the main directory of this 9 *
10 * archive for more details. 10 * This file is subject to the terms and conditions of the GNU General
11 * Public License. See the file COPYING in the main directory of this
12 * archive for more details.
11 */ 13 */
12 14
15/* IOmem resource offsets. */
16#define PMAGB_B_ROM 0x000000 /* REX option ROM */
17#define PMAGB_B_SFB 0x100000 /* SFB ASIC */
18#define PMAGB_B_GP0 0x140000 /* general purpose output 0 */
19#define PMAGB_B_GP1 0x180000 /* general purpose output 1 */
20#define PMAGB_B_BT459 0x1c0000 /* Bt459 RAMDAC */
21#define PMAGB_B_FBMEM 0x200000 /* frame buffer */
22#define PMAGB_B_SIZE 0x400000 /* address space size */
13 23
14/* 24/* IOmem register offsets. */
15 * Bt459 RAM DAC register base offset (rel. to TC slot base address) 25#define SFB_REG_VID_HOR 0x64 /* video horizontal setup */
16 */ 26#define SFB_REG_VID_VER 0x68 /* video vertical setup */
17#define PMAGB_B_BT459_OFFSET 0x001C0000 27#define SFB_REG_VID_BASE 0x6c /* video base address */
28#define SFB_REG_TCCLK_COUNT 0x78 /* TURBOchannel clock count */
29#define SFB_REG_VIDCLK_COUNT 0x7c /* video clock count */
18 30
19/* 31/* Video horizontal setup register constants. All bits are r/w. */
20 * Begin of PMAGB-B framebuffer memory, resolution is configurable: 32#define SFB_VID_HOR_BP_SHIFT 0x15 /* back porch */
21 * 1024x864x8 or 1280x1024x8, settable by jumper on the card 33#define SFB_VID_HOR_BP_MASK 0x7f
22 */ 34#define SFB_VID_HOR_SYN_SHIFT 0x0e /* sync pulse */
23#define PMAGB_B_ONBOARD_FBMEM_OFFSET 0x00201000 35#define SFB_VID_HOR_SYN_MASK 0x7f
36#define SFB_VID_HOR_FP_SHIFT 0x09 /* front porch */
37#define SFB_VID_HOR_FP_MASK 0x1f
38#define SFB_VID_HOR_PIX_SHIFT 0x00 /* active video */
39#define SFB_VID_HOR_PIX_MASK 0x1ff
24 40
25/* 41/* Video vertical setup register constants. All bits are r/w. */
26 * Bt459 register offsets, byte-wide registers 42#define SFB_VID_VER_BP_SHIFT 0x16 /* back porch */
27 */ 43#define SFB_VID_VER_BP_MASK 0x3f
44#define SFB_VID_VER_SYN_SHIFT 0x10 /* sync pulse */
45#define SFB_VID_VER_SYN_MASK 0x3f
46#define SFB_VID_VER_FP_SHIFT 0x0b /* front porch */
47#define SFB_VID_VER_FP_MASK 0x1f
48#define SFB_VID_VER_SL_SHIFT 0x00 /* active scan lines */
49#define SFB_VID_VER_SL_MASK 0x7ff
50
51/* Video base address register constants. All bits are r/w. */
52#define SFB_VID_BASE_MASK 0x1ff /* video base row address */
28 53
29#define BT459_ADR_LOW BT459_OFFSET + 0x00 /* addr. low */ 54/* Bt459 register offsets, byte-wide registers. */
30#define BT459_ADR_HIGH BT459_OFFSET + 0x04 /* addr. high */ 55#define BT459_ADDR_LO 0x0 /* address low */
31#define BT459_DATA BT459_OFFSET + 0x08 /* r/w data */ 56#define BT459_ADDR_HI 0x4 /* address high */
32#define BT459_CMAP BT459_OFFSET + 0x0C /* color map */ 57#define BT459_DATA 0x8 /* data window register */
58#define BT459_CMAP 0xc /* color map window register */
diff --git a/include/video/sisfb.h b/include/video/sisfb.h
index 136bf791643d..e402eb5b3c7a 100644
--- a/include/video/sisfb.h
+++ b/include/video/sisfb.h
@@ -1,5 +1,7 @@
1/* 1/*
2 * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria. 2 * sisfb.h - definitions for the SiS framebuffer driver
3 *
4 * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria.
3 * 5 *
4 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -16,8 +18,8 @@
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
17 */ 19 */
18 20
19#ifndef _LINUX_SISFB 21#ifndef _LINUX_SISFB_H_
20#define _LINUX_SISFB 22#define _LINUX_SISFB_H_
21 23
22#include <asm/ioctl.h> 24#include <asm/ioctl.h>
23#include <asm/types.h> 25#include <asm/types.h>
@@ -26,47 +28,35 @@
26/* PUBLIC */ 28/* PUBLIC */
27/**********************************************/ 29/**********************************************/
28 30
29/* vbflags */ 31/* vbflags, public (others in sis.h) */
30#define CRT2_DEFAULT 0x00000001 32#define CRT2_DEFAULT 0x00000001
31#define CRT2_LCD 0x00000002 /* TW: Never change the order of the CRT2_XXX entries */ 33#define CRT2_LCD 0x00000002
32#define CRT2_TV 0x00000004 /* (see SISCycleCRT2Type()) */ 34#define CRT2_TV 0x00000004
33#define CRT2_VGA 0x00000008 35#define CRT2_VGA 0x00000008
34#define TV_NTSC 0x00000010 36#define TV_NTSC 0x00000010
35#define TV_PAL 0x00000020 37#define TV_PAL 0x00000020
36#define TV_HIVISION 0x00000040 38#define TV_HIVISION 0x00000040
37#define TV_YPBPR 0x00000080 39#define TV_YPBPR 0x00000080
38#define TV_AVIDEO 0x00000100 40#define TV_AVIDEO 0x00000100
39#define TV_SVIDEO 0x00000200 41#define TV_SVIDEO 0x00000200
40#define TV_SCART 0x00000400 42#define TV_SCART 0x00000400
41#define VB_CONEXANT 0x00000800 /* 661 series only */ 43#define TV_PALM 0x00001000
42#define VB_TRUMPION VB_CONEXANT /* 300 series only */ 44#define TV_PALN 0x00002000
43#define TV_PALM 0x00001000
44#define TV_PALN 0x00002000
45#define TV_NTSCJ 0x00001000 45#define TV_NTSCJ 0x00001000
46#define VB_302ELV 0x00004000 46#define TV_CHSCART 0x00008000
47#define TV_CHSCART 0x00008000 47#define TV_CHYPBPR525I 0x00010000
48#define TV_CHYPBPR525I 0x00010000
49#define CRT1_VGA 0x00000000 48#define CRT1_VGA 0x00000000
50#define CRT1_LCDA 0x00020000 49#define CRT1_LCDA 0x00020000
51#define VGA2_CONNECTED 0x00040000 50#define VGA2_CONNECTED 0x00040000
52#define VB_DISPTYPE_CRT1 0x00080000 /* CRT1 connected and used */ 51#define VB_DISPTYPE_CRT1 0x00080000 /* CRT1 connected and used */
53#define VB_301 0x00100000 /* Video bridge type */ 52#define VB_SINGLE_MODE 0x20000000 /* CRT1 or CRT2; determined by DISPTYPE_CRTx */
54#define VB_301B 0x00200000 53#define VB_MIRROR_MODE 0x40000000 /* CRT1 + CRT2 identical (mirror mode) */
55#define VB_302B 0x00400000 54#define VB_DUALVIEW_MODE 0x80000000 /* CRT1 + CRT2 independent (dual head mode) */
56#define VB_30xBDH 0x00800000 /* 30xB DH version (w/o LCD support) */
57#define VB_LVDS 0x01000000
58#define VB_CHRONTEL 0x02000000
59#define VB_301LV 0x04000000
60#define VB_302LV 0x08000000
61#define VB_301C 0x10000000
62#define VB_SINGLE_MODE 0x20000000 /* CRT1 or CRT2; determined by DISPTYPE_CRTx */
63#define VB_MIRROR_MODE 0x40000000 /* CRT1 + CRT2 identical (mirror mode) */
64#define VB_DUALVIEW_MODE 0x80000000 /* CRT1 + CRT2 independent (dual head mode) */
65 55
66/* Aliases: */ 56/* Aliases: */
67#define CRT2_ENABLE (CRT2_LCD | CRT2_TV | CRT2_VGA) 57#define CRT2_ENABLE (CRT2_LCD | CRT2_TV | CRT2_VGA)
68#define TV_STANDARD (TV_NTSC | TV_PAL | TV_PALM | TV_PALN | TV_NTSCJ) 58#define TV_STANDARD (TV_NTSC | TV_PAL | TV_PALM | TV_PALN | TV_NTSCJ)
69#define TV_INTERFACE (TV_AVIDEO|TV_SVIDEO|TV_SCART|TV_HIVISION|TV_YPBPR|TV_CHSCART|TV_CHYPBPR525I) 59#define TV_INTERFACE (TV_AVIDEO|TV_SVIDEO|TV_SCART|TV_HIVISION|TV_YPBPR|TV_CHSCART|TV_CHYPBPR525I)
70 60
71/* Only if TV_YPBPR is set: */ 61/* Only if TV_YPBPR is set: */
72#define TV_YPBPR525I TV_NTSC 62#define TV_YPBPR525I TV_NTSC
@@ -75,89 +65,118 @@
75#define TV_YPBPR1080I TV_PALN 65#define TV_YPBPR1080I TV_PALN
76#define TV_YPBPRALL (TV_YPBPR525I | TV_YPBPR525P | TV_YPBPR750P | TV_YPBPR1080I) 66#define TV_YPBPRALL (TV_YPBPR525I | TV_YPBPR525P | TV_YPBPR750P | TV_YPBPR1080I)
77 67
78#define VB_SISBRIDGE (VB_301|VB_301B|VB_301C|VB_302B|VB_301LV|VB_302LV|VB_302ELV)
79#define VB_SISTVBRIDGE (VB_301|VB_301B|VB_301C|VB_302B|VB_301LV|VB_302LV)
80#define VB_VIDEOBRIDGE (VB_SISBRIDGE | VB_LVDS | VB_CHRONTEL | VB_CONEXANT)
81
82#define VB_DISPTYPE_DISP2 CRT2_ENABLE 68#define VB_DISPTYPE_DISP2 CRT2_ENABLE
83#define VB_DISPTYPE_CRT2 CRT2_ENABLE 69#define VB_DISPTYPE_CRT2 CRT2_ENABLE
84#define VB_DISPTYPE_DISP1 VB_DISPTYPE_CRT1 70#define VB_DISPTYPE_DISP1 VB_DISPTYPE_CRT1
85#define VB_DISPMODE_SINGLE VB_SINGLE_MODE 71#define VB_DISPMODE_SINGLE VB_SINGLE_MODE
86#define VB_DISPMODE_MIRROR VB_MIRROR_MODE 72#define VB_DISPMODE_MIRROR VB_MIRROR_MODE
87#define VB_DISPMODE_DUAL VB_DUALVIEW_MODE 73#define VB_DISPMODE_DUAL VB_DUALVIEW_MODE
88#define VB_DISPLAY_MODE (SINGLE_MODE | MIRROR_MODE | DUALVIEW_MODE) 74#define VB_DISPLAY_MODE (SINGLE_MODE | MIRROR_MODE | DUALVIEW_MODE)
89 75
90/* Structure argument for SISFB_GET_INFO ioctl */ 76/* Structure argument for SISFB_GET_INFO ioctl */
91typedef struct _SISFB_INFO sisfb_info, *psisfb_info; 77struct sisfb_info {
92 78 __u32 sisfb_id; /* for identifying sisfb */
93struct _SISFB_INFO {
94 __u32 sisfb_id; /* for identifying sisfb */
95#ifndef SISFB_ID 79#ifndef SISFB_ID
96#define SISFB_ID 0x53495346 /* Identify myself with 'SISF' */ 80#define SISFB_ID 0x53495346 /* Identify myself with 'SISF' */
97#endif 81#endif
98 __u32 chip_id; /* PCI-ID of detected chip */ 82 __u32 chip_id; /* PCI-ID of detected chip */
99 __u32 memory; /* video memory in KB which sisfb manages */ 83 __u32 memory; /* total video memory in KB */
100 __u32 heapstart; /* heap start (= sisfb "mem" argument) in KB */ 84 __u32 heapstart; /* heap start offset in KB */
101 __u8 fbvidmode; /* current sisfb mode */ 85 __u8 fbvidmode; /* current sisfb mode */
102 86
103 __u8 sisfb_version; 87 __u8 sisfb_version;
104 __u8 sisfb_revision; 88 __u8 sisfb_revision;
105 __u8 sisfb_patchlevel; 89 __u8 sisfb_patchlevel;
106 90
107 __u8 sisfb_caps; /* sisfb capabilities */ 91 __u8 sisfb_caps; /* sisfb capabilities */
108 92
109 __u32 sisfb_tqlen; /* turbo queue length (in KB) */ 93 __u32 sisfb_tqlen; /* turbo queue length (in KB) */
110 94
111 __u32 sisfb_pcibus; /* The card's PCI ID */ 95 __u32 sisfb_pcibus; /* The card's PCI ID */
112 __u32 sisfb_pcislot; 96 __u32 sisfb_pcislot;
113 __u32 sisfb_pcifunc; 97 __u32 sisfb_pcifunc;
98
99 __u8 sisfb_lcdpdc; /* PanelDelayCompensation */
100
101 __u8 sisfb_lcda; /* Detected status of LCDA for low res/text modes */
102
103 __u32 sisfb_vbflags;
104 __u32 sisfb_currentvbflags;
105
106 __u32 sisfb_scalelcd;
107 __u32 sisfb_specialtiming;
108
109 __u8 sisfb_haveemi;
110 __u8 sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33;
111 __u8 sisfb_haveemilcd;
114 112
115 __u8 sisfb_lcdpdc; /* PanelDelayCompensation */ 113 __u8 sisfb_lcdpdca; /* PanelDelayCompensation for LCD-via-CRT1 */
116 114
117 __u8 sisfb_lcda; /* Detected status of LCDA for low res/text modes */ 115 __u16 sisfb_tvxpos, sisfb_tvypos; /* Warning: Values + 32 ! */
118 116
119 __u32 sisfb_vbflags; 117 __u32 sisfb_heapsize; /* heap size (in KB) */
120 __u32 sisfb_currentvbflags; 118 __u32 sisfb_videooffset; /* Offset of viewport in video memory (in bytes) */
121 119
122 __u32 sisfb_scalelcd; 120 __u32 sisfb_curfstn; /* currently running FSTN/DSTN mode */
123 __u32 sisfb_specialtiming; 121 __u32 sisfb_curdstn;
124 122
125 __u8 sisfb_haveemi; 123 __u16 sisfb_pci_vendor; /* PCI vendor (SiS or XGI) */
126 __u8 sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33;
127 __u8 sisfb_haveemilcd;
128 124
129 __u8 sisfb_lcdpdca; /* PanelDelayCompensation for LCD-via-CRT1 */ 125 __u32 sisfb_vbflags2; /* ivideo->vbflags2 */
130 126
131 __u16 sisfb_tvxpos, sisfb_tvypos; /* Warning: Values + 32 ! */ 127 __u8 sisfb_can_post; /* sisfb can POST this card */
128 __u8 sisfb_card_posted; /* card is POSTED */
129 __u8 sisfb_was_boot_device; /* This card was the boot video device (ie is primary) */
132 130
133 __u8 reserved[208]; /* for future use */ 131 __u8 reserved[183]; /* for future use */
132};
133
134#define SISFB_CMD_GETVBFLAGS 0x55AA0001 /* no arg; result[1] = vbflags */
135#define SISFB_CMD_SWITCHCRT1 0x55AA0010 /* arg[0]: 99 = query, 0 = off, 1 = on */
136/* more to come */
137
138#define SISFB_CMD_ERR_OK 0x80000000 /* command succeeded */
139#define SISFB_CMD_ERR_LOCKED 0x80000001 /* sisfb is locked */
140#define SISFB_CMD_ERR_EARLY 0x80000002 /* request before sisfb took over gfx system */
141#define SISFB_CMD_ERR_NOVB 0x80000003 /* No video bridge */
142#define SISFB_CMD_ERR_NOCRT2 0x80000004 /* can't change CRT1 status, CRT2 disabled */
143/* more to come */
144#define SISFB_CMD_ERR_UNKNOWN 0x8000ffff /* Unknown command */
145#define SISFB_CMD_ERR_OTHER 0x80010000 /* Other error */
146
147/* Argument for SISFB_CMD ioctl */
148struct sisfb_cmd {
149 __u32 sisfb_cmd;
150 __u32 sisfb_arg[16];
151 __u32 sisfb_result[4];
134}; 152};
135 153
136/* Addtional IOCTLs for communication sisfb <> X driver */ 154/* Addtional IOCTLs for communication sisfb <> X driver */
137/* If changing this, vgatypes.h must also be changed (for X driver) */ 155/* If changing this, vgatypes.h must also be changed (for X driver) */
138 156
139/* ioctl for identifying and giving some info (esp. memory heap start) */ 157/* ioctl for identifying and giving some info (esp. memory heap start) */
140#define SISFB_GET_INFO_SIZE _IOR(0xF3,0x00,__u32) 158#define SISFB_GET_INFO_SIZE _IOR(0xF3,0x00,__u32)
141#define SISFB_GET_INFO _IOR(0xF3,0x01,struct _SISFB_INFO) 159#define SISFB_GET_INFO _IOR(0xF3,0x01,struct sisfb_info)
142 160
143/* ioctrl to get current vertical retrace status */ 161/* ioctrl to get current vertical retrace status */
144#define SISFB_GET_VBRSTATUS _IOR(0xF3,0x02,__u32) 162#define SISFB_GET_VBRSTATUS _IOR(0xF3,0x02,__u32)
145 163
146/* ioctl to enable/disable panning auto-maximize (like nomax parameter) */ 164/* ioctl to enable/disable panning auto-maximize (like nomax parameter) */
147#define SISFB_GET_AUTOMAXIMIZE _IOR(0xF3,0x03,__u32) 165#define SISFB_GET_AUTOMAXIMIZE _IOR(0xF3,0x03,__u32)
148#define SISFB_SET_AUTOMAXIMIZE _IOW(0xF3,0x03,__u32) 166#define SISFB_SET_AUTOMAXIMIZE _IOW(0xF3,0x03,__u32)
149 167
150/* ioctls to relocate TV output (x=D[31:16], y=D[15:0], + 32)*/ 168/* ioctls to relocate TV output (x=D[31:16], y=D[15:0], + 32)*/
151#define SISFB_GET_TVPOSOFFSET _IOR(0xF3,0x04,__u32) 169#define SISFB_GET_TVPOSOFFSET _IOR(0xF3,0x04,__u32)
152#define SISFB_SET_TVPOSOFFSET _IOW(0xF3,0x04,__u32) 170#define SISFB_SET_TVPOSOFFSET _IOW(0xF3,0x04,__u32)
171
172/* ioctl for internal sisfb commands (sisfbctrl) */
173#define SISFB_COMMAND _IOWR(0xF3,0x05,struct sisfb_cmd)
153 174
154/* ioctl for locking sisfb (no register access during lock) */ 175/* ioctl for locking sisfb (no register access during lock) */
155/* As of now, only used to avoid register access during 176/* As of now, only used to avoid register access during
156 * the ioctls listed above. 177 * the ioctls listed above.
157 */ 178 */
158#define SISFB_SET_LOCK _IOW(0xF3,0x06,__u32) 179#define SISFB_SET_LOCK _IOW(0xF3,0x06,__u32)
159
160/* more to come soon */
161 180
162/* ioctls 0xF3 up to 0x3F reserved for sisfb */ 181/* ioctls 0xF3 up to 0x3F reserved for sisfb */
163 182
@@ -165,7 +184,7 @@ struct _SISFB_INFO {
165/* The following are deprecated and should not be used anymore: */ 184/* The following are deprecated and should not be used anymore: */
166/****************************************************************/ 185/****************************************************************/
167/* ioctl for identifying and giving some info (esp. memory heap start) */ 186/* ioctl for identifying and giving some info (esp. memory heap start) */
168#define SISFB_GET_INFO_OLD _IOR('n',0xF8,__u32) 187#define SISFB_GET_INFO_OLD _IOR('n',0xF8,__u32)
169/* ioctrl to get current vertical retrace status */ 188/* ioctrl to get current vertical retrace status */
170#define SISFB_GET_VBRSTATUS_OLD _IOR('n',0xF9,__u32) 189#define SISFB_GET_VBRSTATUS_OLD _IOR('n',0xF9,__u32)
171/* ioctl to enable/disable panning auto-maximize (like nomax parameter) */ 190/* ioctl to enable/disable panning auto-maximize (like nomax parameter) */
@@ -177,8 +196,8 @@ struct _SISFB_INFO {
177 196
178/* For fb memory manager (FBIO_ALLOC, FBIO_FREE) */ 197/* For fb memory manager (FBIO_ALLOC, FBIO_FREE) */
179struct sis_memreq { 198struct sis_memreq {
180 __u32 offset; 199 __u32 offset;
181 __u32 size; 200 __u32 size;
182}; 201};
183 202
184/**********************************************/ 203/**********************************************/
@@ -187,12 +206,19 @@ struct sis_memreq {
187/**********************************************/ 206/**********************************************/
188 207
189#ifdef __KERNEL__ 208#ifdef __KERNEL__
209
210#include <linux/pci.h>
211
190#define UNKNOWN_VGA 0 212#define UNKNOWN_VGA 0
191#define SIS_300_VGA 1 213#define SIS_300_VGA 1
192#define SIS_315_VGA 2 214#define SIS_315_VGA 2
193 215
216#define SISFB_HAVE_MALLOC_NEW
194extern void sis_malloc(struct sis_memreq *req); 217extern void sis_malloc(struct sis_memreq *req);
218extern void sis_malloc_new(struct pci_dev *pdev, struct sis_memreq *req);
219
195extern void sis_free(u32 base); 220extern void sis_free(u32 base);
221extern void sis_free_new(struct pci_dev *pdev, u32 base);
196#endif 222#endif
197 223
198#endif 224#endif
diff --git a/include/video/w100fb.h b/include/video/w100fb.h
index bd548c2b47c4..e6da2d7ded8c 100644
--- a/include/video/w100fb.h
+++ b/include/video/w100fb.h
@@ -1,21 +1,149 @@
1/* 1/*
2 * Support for the w100 frame buffer. 2 * Support for the w100 frame buffer.
3 * 3 *
4 * Copyright (c) 2004 Richard Purdie 4 * Copyright (c) 2004-2005 Richard Purdie
5 * Copyright (c) 2005 Ian Molton
5 * 6 *
6 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as 8 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
9 */ 10 */
10 11
12#define W100_GPIO_PORT_A 0
13#define W100_GPIO_PORT_B 1
14
15#define CLK_SRC_XTAL 0
16#define CLK_SRC_PLL 1
17
18struct w100fb_par;
19
20unsigned long w100fb_gpio_read(int port);
21void w100fb_gpio_write(int port, unsigned long value);
22
23/* LCD Specific Routines and Config */
24struct w100_tg_info {
25 void (*change)(struct w100fb_par*);
26 void (*suspend)(struct w100fb_par*);
27 void (*resume)(struct w100fb_par*);
28};
29
30/* General Platform Specific w100 Register Values */
31struct w100_gen_regs {
32 unsigned long lcd_format;
33 unsigned long lcdd_cntl1;
34 unsigned long lcdd_cntl2;
35 unsigned long genlcd_cntl1;
36 unsigned long genlcd_cntl2;
37 unsigned long genlcd_cntl3;
38};
39
40struct w100_gpio_regs {
41 unsigned long init_data1;
42 unsigned long init_data2;
43 unsigned long gpio_dir1;
44 unsigned long gpio_oe1;
45 unsigned long gpio_dir2;
46 unsigned long gpio_oe2;
47};
48
49/* Optional External Memory Configuration */
50struct w100_mem_info {
51 unsigned long ext_cntl;
52 unsigned long sdram_mode_reg;
53 unsigned long ext_timing_cntl;
54 unsigned long io_cntl;
55 unsigned int size;
56};
57
58struct w100_bm_mem_info {
59 unsigned long ext_mem_bw;
60 unsigned long offset;
61 unsigned long ext_timing_ctl;
62 unsigned long ext_cntl;
63 unsigned long mode_reg;
64 unsigned long io_cntl;
65 unsigned long config;
66};
67
68/* LCD Mode definition */
69struct w100_mode {
70 unsigned int xres;
71 unsigned int yres;
72 unsigned short left_margin;
73 unsigned short right_margin;
74 unsigned short upper_margin;
75 unsigned short lower_margin;
76 unsigned long crtc_ss;
77 unsigned long crtc_ls;
78 unsigned long crtc_gs;
79 unsigned long crtc_vpos_gs;
80 unsigned long crtc_rev;
81 unsigned long crtc_dclk;
82 unsigned long crtc_gclk;
83 unsigned long crtc_goe;
84 unsigned long crtc_ps1_active;
85 char pll_freq;
86 char fast_pll_freq;
87 int sysclk_src;
88 int sysclk_divider;
89 int pixclk_src;
90 int pixclk_divider;
91 int pixclk_divider_rotated;
92};
93
94struct w100_pll_info {
95 uint16_t freq; /* desired Fout for PLL (Mhz) */
96 uint8_t M; /* input divider */
97 uint8_t N_int; /* VCO multiplier */
98 uint8_t N_fac; /* VCO multiplier fractional part */
99 uint8_t tfgoal;
100 uint8_t lock_time;
101};
102
103/* Initial Video mode orientation flags */
104#define INIT_MODE_ROTATED 0x1
105#define INIT_MODE_FLIPPED 0x2
106
11/* 107/*
12 * This structure describes the machine which we are running on. 108 * This structure describes the machine which we are running on.
13 * It is set by machine specific code and used in the probe routine 109 * It is set by machine specific code and used in the probe routine
14 * of drivers/video/w100fb.c 110 * of drivers/video/w100fb.c
15 */ 111 */
16
17struct w100fb_mach_info { 112struct w100fb_mach_info {
18 void (*w100fb_ssp_send)(u8 adrs, u8 data); 113 /* General Platform Specific Registers */
19 int comadj; 114 struct w100_gen_regs *regs;
20 int phadadj; 115 /* Table of modes the LCD is capable of */
116 struct w100_mode *modelist;
117 unsigned int num_modes;
118 /* Hooks for any platform specific tg/lcd code (optional) */
119 struct w100_tg_info *tg;
120 /* External memory definition (if present) */
121 struct w100_mem_info *mem;
122 /* Additional External memory definition (if present) */
123 struct w100_bm_mem_info *bm_mem;
124 /* GPIO definitions (optional) */
125 struct w100_gpio_regs *gpio;
126 /* Initial Mode flags */
127 unsigned int init_mode;
128 /* Xtal Frequency */
129 unsigned int xtal_freq;
130 /* Enable Xtal input doubler (1 == enable) */
131 unsigned int xtal_dbl;
132};
133
134/* General frame buffer data structure */
135struct w100fb_par {
136 unsigned int chip_id;
137 unsigned int xres;
138 unsigned int yres;
139 unsigned int extmem_active;
140 unsigned int flip;
141 unsigned int blanked;
142 unsigned int fastpll_mode;
143 unsigned long hsync_len;
144 struct w100_mode *mode;
145 struct w100_pll_info *pll_table;
146 struct w100fb_mach_info *mach;
147 uint32_t *saved_intmem;
148 uint32_t *saved_extmem;
21}; 149};