]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
Merge branch 'next-i2c' of git://git.fluff.org/bjdooks/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Jul 2011 23:55:45 +0000 (16:55 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Jul 2011 23:55:45 +0000 (16:55 -0700)
* 'next-i2c' of git://git.fluff.org/bjdooks/linux:
  i2c-eg20t : Fix the issue of Combined R/W transfer mode
  i2c-eg20t : Support Combined R/W transfer mode
  i2c: Tegra: Add DeviceTree support

575 files changed:
Documentation/DMA-API-HOWTO.txt
Documentation/cgroups/memory.txt
Documentation/feature-removal-schedule.txt
Documentation/kernel-parameters.txt
Documentation/sysctl/kernel.txt
MAINTAINERS
arch/alpha/include/asm/atomic.h
arch/alpha/include/asm/bitops.h
arch/alpha/include/asm/local.h
arch/alpha/include/asm/ptrace.h
arch/alpha/kernel/perf_event.c
arch/alpha/kernel/smp.c
arch/alpha/lib/dec_and_lock.c
arch/arm/include/asm/atomic.h
arch/arm/include/asm/bitops.h
arch/arm/kernel/smp.c
arch/arm/kernel/traps.c
arch/arm/mach-at91/pm.c
arch/arm/mach-bcmring/dma.c
arch/arm/mach-cns3xxx/include/mach/pm.h
arch/arm/mach-cns3xxx/pm.c
arch/arm/mach-omap1/pm.c
arch/arm/mach-s3c2440/clock.c
arch/arm/mach-s3c2440/s3c2442.c
arch/arm/mach-s3c2440/s3c244x-clock.c
arch/avr32/include/asm/atomic.h
arch/avr32/include/asm/ptrace.h
arch/blackfin/include/asm/atomic.h
arch/blackfin/include/asm/dma.h
arch/blackfin/include/asm/ipipe.h
arch/blackfin/include/asm/ptrace.h
arch/blackfin/include/asm/spinlock.h
arch/blackfin/kernel/ftrace.c
arch/blackfin/kernel/ipipe.c
arch/blackfin/kernel/nmi.c
arch/blackfin/mach-common/smp.c
arch/cris/arch-v32/drivers/cryptocop.c
arch/cris/arch-v32/kernel/smp.c
arch/cris/include/arch-v10/arch/ptrace.h
arch/cris/include/arch-v32/arch/ptrace.h
arch/cris/include/asm/atomic.h
arch/cris/include/asm/bitops.h
arch/cris/kernel/process.c
arch/frv/include/asm/atomic.h
arch/frv/include/asm/bitops.h
arch/frv/include/asm/hardirq.h
arch/frv/include/asm/processor.h
arch/frv/include/asm/ptrace.h
arch/frv/kernel/irq.c
arch/frv/kernel/process.c
arch/h8300/include/asm/atomic.h
arch/h8300/include/asm/posix_types.h
arch/h8300/include/asm/ptrace.h
arch/ia64/include/asm/atomic.h
arch/ia64/include/asm/bitops.h
arch/ia64/include/asm/processor.h
arch/ia64/include/asm/ptrace.h
arch/ia64/include/asm/spinlock.h
arch/ia64/kernel/smp.c
arch/ia64/kernel/smpboot.c
arch/ia64/kernel/uncached.c
arch/m32r/include/asm/atomic.h
arch/m32r/include/asm/mmu_context.h
arch/m32r/include/asm/ptrace.h
arch/m32r/include/asm/spinlock.h
arch/m32r/kernel/smp.c
arch/m32r/kernel/traps.c
arch/m68k/include/asm/atomic.h
arch/m68k/include/asm/posix_types.h
arch/m68k/include/asm/ptrace.h
arch/microblaze/include/asm/mmu_context_mm.h
arch/microblaze/include/asm/prom.h
arch/microblaze/include/asm/ptrace.h
arch/mips/Kbuild.platforms
arch/mips/Makefile
arch/mips/ar7/clock.c
arch/mips/ar7/platform.c
arch/mips/ar7/prom.c
arch/mips/include/asm/atomic.h
arch/mips/include/asm/fixmap.h
arch/mips/include/asm/gt64120.h
arch/mips/include/asm/hw_irq.h
arch/mips/include/asm/irq.h
arch/mips/include/asm/local.h
arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
arch/mips/include/asm/mach-bcm63xx/spaces.h [new file with mode: 0644]
arch/mips/include/asm/mach-generic/dma-coherence.h
arch/mips/include/asm/mach-generic/spaces.h
arch/mips/include/asm/mach-ip27/dma-coherence.h
arch/mips/include/asm/mach-jazz/dma-coherence.h
arch/mips/include/asm/mach-loongson/dma-coherence.h
arch/mips/include/asm/mach-malta/cpu-feature-overrides.h
arch/mips/include/asm/mach-mipssim/cpu-feature-overrides.h
arch/mips/include/asm/mach-powertv/cpu-feature-overrides.h [new file with mode: 0644]
arch/mips/include/asm/mach-powertv/dma-coherence.h
arch/mips/include/asm/mach-tx39xx/spaces.h [new file with mode: 0644]
arch/mips/include/asm/mach-tx49xx/spaces.h [new file with mode: 0644]
arch/mips/include/asm/pgtable.h
arch/mips/include/asm/smp-ops.h
arch/mips/include/asm/smp.h
arch/mips/include/asm/smtc.h
arch/mips/include/asm/uasm.h
arch/mips/include/asm/unistd.h
arch/mips/kernel/cpu-probe.c
arch/mips/kernel/irq.c
arch/mips/kernel/irq_cpu.c
arch/mips/kernel/mips-mt.c
arch/mips/kernel/perf_event.c
arch/mips/kernel/process.c
arch/mips/kernel/rtlx.c
arch/mips/kernel/scall32-o32.S
arch/mips/kernel/scall64-64.S
arch/mips/kernel/scall64-n32.S
arch/mips/kernel/scall64-o32.S
arch/mips/kernel/smp-cmp.c
arch/mips/kernel/smp-mt.c
arch/mips/kernel/smp.c
arch/mips/kernel/smtc-proc.c
arch/mips/kernel/smtc.c
arch/mips/kernel/sync-r4k.c
arch/mips/kernel/vpe.c
arch/mips/lantiq/clk.c
arch/mips/loongson/lemote-2f/ec_kb3310b.c
arch/mips/mipssim/sim_setup.c
arch/mips/mipssim/sim_smtc.c
arch/mips/mm/c-r4k.c
arch/mips/mm/dma-default.c
arch/mips/mm/init.c
arch/mips/mm/mmap.c
arch/mips/mm/pgtable-32.c
arch/mips/mm/pgtable-64.c
arch/mips/mm/tlbex.c
arch/mips/mti-malta/malta-init.c
arch/mips/mti-malta/malta-smtc.c
arch/mips/netlogic/Platform [new file with mode: 0644]
arch/mips/netlogic/xlr/irq.c
arch/mips/netlogic/xlr/smp.c
arch/mips/nxp/pnx8550/common/setup.c
arch/mips/pci/ops-nile4.c
arch/mips/pmc-sierra/msp71xx/msp_setup.c
arch/mips/pnx8550/common/setup.c
arch/mips/rb532/devices.c
arch/mips/sgi-ip27/ip27-nmi.c
arch/mips/sibyte/sb1250/irq.c
arch/mn10300/include/asm/atomic.h
arch/mn10300/include/asm/bitops.h
arch/mn10300/include/asm/mmu_context.h
arch/mn10300/include/asm/processor.h
arch/mn10300/include/asm/ptrace.h
arch/mn10300/include/asm/spinlock.h
arch/mn10300/include/asm/system.h
arch/mn10300/kernel/mn10300-watchdog.c
arch/mn10300/kernel/traps.c
arch/mn10300/mm/misalignment.c
arch/mn10300/proc-mn2ws0050/proc-init.c
arch/parisc/include/asm/atomic.h
arch/parisc/include/asm/bitops.h
arch/parisc/include/asm/mmu_context.h
arch/parisc/include/asm/ptrace.h
arch/parisc/kernel/parisc_ksyms.c
arch/parisc/kernel/smp.c
arch/parisc/kernel/traps.c
arch/parisc/lib/bitops.c
arch/powerpc/include/asm/atomic.h
arch/powerpc/include/asm/bitops.h
arch/powerpc/include/asm/emulated_ops.h
arch/powerpc/include/asm/irq.h
arch/powerpc/include/asm/local.h
arch/powerpc/include/asm/prom.h
arch/powerpc/include/asm/system.h
arch/powerpc/kernel/of_platform.c
arch/powerpc/kernel/ppc_ksyms.c
arch/powerpc/kernel/rtas.c
arch/powerpc/kernel/rtasd.c
arch/powerpc/kernel/smp-tbsync.c
arch/powerpc/kernel/smp.c
arch/powerpc/platforms/83xx/km83xx.c
arch/powerpc/platforms/83xx/mpc832x_mds.c
arch/powerpc/platforms/83xx/mpc834x_itx.c
arch/powerpc/platforms/83xx/mpc834x_mds.c
arch/powerpc/platforms/83xx/mpc836x_mds.c
arch/powerpc/platforms/83xx/sbc834x.c
arch/powerpc/platforms/85xx/mpc85xx_cds.c
arch/powerpc/platforms/85xx/mpc85xx_mds.c
arch/powerpc/platforms/85xx/sbc8548.c
arch/powerpc/platforms/cell/cpufreq_spudemand.c
arch/powerpc/platforms/cell/smp.c
arch/powerpc/platforms/cell/spufs/context.c
arch/powerpc/platforms/chrp/smp.c
arch/powerpc/platforms/iseries/smp.c
arch/powerpc/platforms/powermac/backlight.c
arch/powerpc/platforms/powermac/smp.c
arch/powerpc/platforms/pseries/eeh.c
arch/powerpc/platforms/pseries/eeh_cache.c
arch/powerpc/platforms/pseries/smp.c
arch/powerpc/sysdev/fsl_soc.c
arch/powerpc/sysdev/tsi108_dev.c
arch/s390/include/asm/atomic.h
arch/s390/include/asm/bitops.h
arch/s390/include/asm/ptrace.h
arch/s390/kernel/dis.c
arch/s390/kernel/traps.c
arch/sh/include/asm/atomic.h
arch/sh/include/asm/hw_irq.h
arch/sh/include/asm/ptrace.h
arch/sh/include/asm/smp.h
arch/sh/kernel/idle.c
arch/sh/kernel/smp.c
arch/sh/kernel/traps_64.c
arch/sh/kernel/unwinder.c
arch/sparc/include/asm/atomic_32.h
arch/sparc/include/asm/atomic_64.h
arch/sparc/include/asm/bitops_64.h
arch/sparc/include/asm/prom.h
arch/sparc/include/asm/ptrace.h
arch/sparc/include/asm/smp_32.h
arch/sparc/include/asm/smp_64.h
arch/sparc/kernel/irq_64.c
arch/sparc/kernel/leon_smp.c
arch/sparc/kernel/perf_event.c
arch/sparc/kernel/smp_32.c
arch/sparc/kernel/smp_64.c
arch/sparc/lib/atomic32.c
arch/tile/include/asm/atomic.h
arch/tile/include/asm/atomic_32.h
arch/tile/include/asm/atomic_64.h
arch/tile/include/asm/bitops_32.h
arch/tile/include/asm/bitops_64.h
arch/tile/include/asm/ptrace.h
arch/tile/include/asm/spinlock_32.h
arch/tile/kernel/intvec_32.S
arch/tile/lib/atomic_32.c
arch/tile/lib/atomic_asm_32.S
arch/um/include/asm/ptrace-generic.h
arch/x86/ia32/sys_ia32.c
arch/x86/include/asm/apic.h
arch/x86/include/asm/atomic.h
arch/x86/include/asm/atomic64_32.h
arch/x86/include/asm/atomic64_64.h
arch/x86/include/asm/bitops.h
arch/x86/include/asm/hw_irq.h
arch/x86/include/asm/kdebug.h
arch/x86/include/asm/local.h
arch/x86/include/asm/mce.h
arch/x86/include/asm/mmu_context.h
arch/x86/include/asm/prom.h
arch/x86/include/asm/spinlock.h
arch/x86/include/asm/thread_info.h
arch/x86/kernel/amd_gart_64.c
arch/x86/kernel/apic/apic.c
arch/x86/kernel/apic/es7000_32.c
arch/x86/kernel/cpu/common.c
arch/x86/kernel/i8259.c
arch/x86/kernel/irqinit.c
arch/x86/kernel/traps.c
arch/x86/kvm/lapic.c
arch/x86/kvm/timer.c
arch/x86/lib/atomic64_32.c
arch/x86/mm/mmio-mod.c
arch/xtensa/include/asm/atomic.h
arch/xtensa/include/asm/bitops.h
arch/xtensa/include/asm/posix_types.h
arch/xtensa/include/asm/ptrace.h
arch/xtensa/kernel/process.c
block/blk-core.c
crypto/af_alg.c
crypto/proc.c
crypto/rng.c
drivers/atm/ambassador.c
drivers/atm/atmtcp.c
drivers/atm/eni.c
drivers/atm/eni.h
drivers/atm/firestream.c
drivers/atm/fore200e.c
drivers/atm/horizon.c
drivers/atm/idt77252.c
drivers/atm/iphase.c
drivers/atm/nicstar.c
drivers/atm/suni.c
drivers/atm/uPD98402.c
drivers/atm/zatm.c
drivers/base/memory.c
drivers/base/power/opp.c
drivers/base/power/sysfs.c
drivers/block/cciss_scsi.c
drivers/char/ipmi/ipmi_watchdog.c
drivers/char/mspec.c
drivers/char/ramoops.c
drivers/connector/cn_proc.c
drivers/edac/edac_stub.c
drivers/edac/mpc85xx_edac.c
drivers/firewire/core-card.c
drivers/firewire/core-device.c
drivers/firewire/core-topology.c
drivers/firewire/core.h
drivers/firewire/nosy.c
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_fence.c
drivers/gpu/drm/ttm/ttm_bo.c
drivers/gpu/drm/ttm/ttm_lock.c
drivers/gpu/drm/ttm/ttm_object.c
drivers/gpu/drm/ttm/ttm_page_alloc.c
drivers/hwmon/sht15.c
drivers/infiniband/hw/cxgb4/mem.c
drivers/infiniband/hw/ehca/ehca_tools.h
drivers/infiniband/hw/nes/nes_cm.c
drivers/infiniband/ulp/ipoib/ipoib.h
drivers/infiniband/ulp/srp/ib_srp.c
drivers/isdn/gigaset/gigaset.h
drivers/md/dm-crypt.c
drivers/md/dm-kcopyd.c
drivers/md/dm-mpath.c
drivers/md/dm-queue-length.c
drivers/md/dm-table.c
drivers/media/video/hdpvr/hdpvr-core.c
drivers/media/video/tlg2300/pd-dvb.c
drivers/media/video/uvc/uvc_ctrl.c
drivers/media/video/uvc/uvc_queue.c
drivers/media/video/uvc/uvc_v4l2.c
drivers/media/video/uvc/uvc_video.c
drivers/message/i2o/i2o_scsi.c
drivers/misc/phantom.c
drivers/misc/vmw_balloon.c
drivers/net/atlx/atl1.c
drivers/net/atlx/atl2.c
drivers/net/atlx/atl2.h
drivers/net/cassini.c
drivers/net/cpmac.c
drivers/net/cxgb3/cxgb3_offload.c
drivers/net/cxgb3/l2t.h
drivers/net/cxgb3/t3cdev.h
drivers/net/cxgb4/cxgb4_uld.h
drivers/net/cxgb4/l2t.h
drivers/net/hamradio/6pack.c
drivers/net/hamradio/dmascc.c
drivers/net/ibmveth.c
drivers/net/phy/phy.c
drivers/net/ppp_generic.c
drivers/net/wimax/i2400m/i2400m.h
drivers/net/wireless/b43legacy/b43legacy.h
drivers/net/wireless/b43legacy/dma.h
drivers/oprofile/oprofile_stats.h
drivers/pci/hotplug/cpci_hotplug_core.c
drivers/pci/xen-pcifront.c
drivers/rtc/interface.c
drivers/s390/block/dasd_eer.c
drivers/s390/char/sclp_quiesce.c
drivers/s390/char/vmlogrdr.c
drivers/s390/cio/device.h
drivers/s390/cio/qdio_main.c
drivers/s390/cio/qdio_thinint.c
drivers/s390/crypto/ap_bus.c
drivers/s390/crypto/zcrypt_api.c
drivers/s390/crypto/zcrypt_cex2a.c
drivers/s390/crypto/zcrypt_mono.c
drivers/s390/crypto/zcrypt_pcica.c
drivers/s390/crypto/zcrypt_pcicc.c
drivers/s390/crypto/zcrypt_pcixcc.c
drivers/s390/net/fsm.h
drivers/s390/scsi/zfcp_scsi.c
drivers/sbus/char/display7seg.c
drivers/scsi/dpt/dpti_i2o.h
drivers/scsi/hpsa.c
drivers/scsi/pm8001/pm8001_sas.h
drivers/staging/octeon/ethernet-rx.c
drivers/staging/octeon/ethernet-tx.c
drivers/staging/solo6x10/solo6x10.h
drivers/staging/tidspbridge/include/dspbridge/host_os.h
drivers/staging/winbond/mds_s.h
drivers/staging/winbond/wb35reg_s.h
drivers/tty/bfin_jtag_comm.c
drivers/tty/rocket.c
drivers/tty/serial/dz.c
drivers/tty/serial/sb1250-duart.c
drivers/tty/serial/zs.c
drivers/usb/gadget/f_audio.c
drivers/usb/gadget/f_rndis.c
drivers/usb/gadget/uvc_queue.c
drivers/usb/image/microtek.c
drivers/usb/misc/appledisplay.c
drivers/usb/serial/garmin_gps.c
drivers/usb/wusbcore/wa-rpipe.c
drivers/vhost/vhost.h
drivers/video/sh_mobile_lcdcfb.c
drivers/video/vermilion/vermilion.h
drivers/w1/masters/matrox_w1.c
drivers/w1/slaves/w1_therm.c
drivers/w1/w1.c
drivers/w1/w1_family.h
drivers/watchdog/intel_scu_watchdog.c
drivers/watchdog/sbc7240_wdt.c
fs/btrfs/delayed-inode.h
fs/direct-io.c
fs/eventpoll.c
fs/exec.c
fs/file_table.c
fs/gfs2/main.c
fs/nfs/cache_lib.h
fs/nfs/direct.c
fs/notify/group.c
fs/notify/inode_mark.c
fs/notify/mark.c
fs/notify/notification.c
fs/notify/vfsmount_mark.c
fs/ntfs/inode.h
fs/posix_acl.c
fs/proc/base.c
fs/proc/inode.c
fs/proc/meminfo.c
include/acpi/platform/aclinux.h
include/asm-generic/atomic.h
include/asm-generic/bitops/ext2-atomic-setbit.h [new file with mode: 0644]
include/asm-generic/bitops/ext2-atomic.h
include/asm-generic/local.h
include/asm-generic/local64.h
include/drm/ttm/ttm_lock.h
include/linux/aio.h
include/linux/atmdev.h
include/linux/atomic.h
include/linux/backing-dev.h
include/linux/bit_spinlock.h
include/linux/bitmap.h
include/linux/buffer_head.h
include/linux/configfs.h
include/linux/connector.h
include/linux/cpumask.h
include/linux/cred.h
include/linux/crypto.h
include/linux/dcache.h
include/linux/debug_locks.h
include/linux/device.h
include/linux/dma-mapping.h
include/linux/edac.h
include/linux/fault-inject.h
include/linux/fdtable.h
include/linux/filter.h
include/linux/firewire.h
include/linux/fsnotify_backend.h
include/linux/interrupt.h
include/linux/ipc_namespace.h
include/linux/jump_label.h
include/linux/kdb.h
include/linux/key.h
include/linux/kgdb.h
include/linux/kobject.h
include/linux/memcontrol.h
include/linux/mlx4/device.h
include/linux/mman.h
include/linux/mmzone.h
include/linux/mount.h
include/linux/mutex.h
include/linux/netdevice.h
include/linux/nfs_fs_sb.h
include/linux/nodemask.h
include/linux/oprofile.h
include/linux/pci.h
include/linux/perf_event.h
include/linux/phy.h
include/linux/proc_fs.h
include/linux/quota.h
include/linux/ramoops.h
include/linux/rwsem.h
include/linux/sem.h
include/linux/shm.h
include/linux/skbuff.h
include/linux/sonet.h
include/linux/spinlock.h
include/linux/sunrpc/auth.h
include/linux/sunrpc/cache.h
include/linux/sunrpc/timer.h
include/linux/swap.h
include/linux/sysfs.h
include/linux/vmstat.h
include/linux/vt_kern.h
include/linux/workqueue.h
include/net/ax25.h
include/net/cipso_ipv4.h
include/net/flow.h
include/net/inet_hashtables.h
include/net/inet_timewait_sock.h
include/net/inetpeer.h
include/net/ip_vs.h
include/net/lib80211.h
include/net/llc.h
include/net/neighbour.h
include/net/net_namespace.h
include/net/netfilter/nf_conntrack.h
include/net/netlabel.h
include/net/netns/conntrack.h
include/net/sctp/structs.h
include/pcmcia/ds.h
include/rdma/ib_sa.h
include/rdma/ib_verbs.h
include/rxrpc/types.h
include/scsi/scsi_device.h
ipc/ipc_sysctl.c
ipc/mqueue.c
ipc/shm.c
kernel/audit.c
kernel/auditsc.c
kernel/cgroup.c
kernel/cpuset.c
kernel/debug/debug_core.c
kernel/exit.c
kernel/fork.c
kernel/gcov/Kconfig
kernel/panic.c
kernel/rcupdate.c
kernel/rcutorture.c
kernel/rcutree_trace.c
kernel/rwsem.c
kernel/stop_machine.c
kernel/taskstats.c
kernel/trace/trace.h
kernel/trace/trace_mmiotrace.c
lib/atomic64.c
lib/atomic64_test.c
lib/bitmap.c
lib/cpumask.c
lib/crc32.c
lib/dec_and_lock.c
lib/fault-inject.c
mm/failslab.c
mm/init-mm.c
mm/kmemleak.c
mm/memcontrol.c
mm/mempolicy.c
mm/page_alloc.c
mm/slob.c
mm/vmalloc.c
mm/vmscan.c
net/atm/atm_misc.c
net/atm/clip.c
net/atm/common.c
net/atm/lec.c
net/atm/proc.c
net/bridge/br_fdb.c
net/core/flow.c
net/decnet/dn_fib.c
net/decnet/dn_neigh.c
net/decnet/dn_table.c
net/decnet/dn_timer.c
net/ipv4/cipso_ipv4.c
net/ipv4/raw.c
net/ipv6/ip6_tunnel.c
net/iucv/iucv.c
net/l2tp/l2tp_core.c
net/l2tp/l2tp_ppp.c
net/netfilter/nfnetlink_log.c
net/netfilter/nfnetlink_queue.c
net/netlabel/netlabel_cipso_v4.c
net/netlabel/netlabel_kapi.c
net/netlabel/netlabel_mgmt.c
net/netlabel/netlabel_mgmt.h
net/netlabel/netlabel_unlabeled.c
net/sunrpc/xprtrdma/xprt_rdma.h
net/tipc/core.h
security/selinux/hooks.c
security/selinux/xfrm.c
sound/pci/echoaudio/darla20.c
sound/pci/echoaudio/darla24.c
sound/pci/echoaudio/echo3g.c
sound/pci/echoaudio/gina20.c
sound/pci/echoaudio/gina24.c
sound/pci/echoaudio/indigo.c
sound/pci/echoaudio/indigodj.c
sound/pci/echoaudio/indigodjx.c
sound/pci/echoaudio/indigoio.c
sound/pci/echoaudio/indigoiox.c
sound/pci/echoaudio/layla20.c
sound/pci/echoaudio/layla24.c
sound/pci/echoaudio/mia.c
sound/pci/echoaudio/mona.c
sound/pci/lx6464es/lx6464es.h
sound/sparc/dbri.c

index d568bc235bc008a215b981bcf303352c54bbda3a..a0b6250add79c9c144fd1185fa91314febaa4241 100644 (file)
@@ -613,13 +613,13 @@ to use the dma_sync_*() interfaces.
                                pass_to_upper_layers(cp->rx_buf);
                                make_and_setup_new_rx_buf(cp);
                        } else {
-                               /* Just sync the buffer and give it back
-                                * to the card.
+                               /* CPU should not write to
+                                * DMA_FROM_DEVICE-mapped area,
+                                * so dma_sync_single_for_device() is
+                                * not needed here. It would be required
+                                * for DMA_BIDIRECTIONAL mapping if
+                                * the memory was modified.
                                 */
-                               dma_sync_single_for_device(&cp->dev,
-                                                          cp->rx_dma,
-                                                          cp->rx_len,
-                                                          DMA_FROM_DEVICE);
                                give_rx_buf_to_card(cp);
                        }
                }
index 06eb6d957c83097b85fd15e87e94b8ed7edfe1cf..6f3c598971fc3ef05d2ebfb0e6e8879b3047d839 100644 (file)
@@ -380,7 +380,7 @@ will be charged as a new owner of it.
 
 5.2 stat file
 
-memory.stat file includes following statistics
+5.2.1 memory.stat file includes following statistics
 
 # per-memory cgroup local status
 cache          - # of bytes of page cache memory.
@@ -438,6 +438,89 @@ Note:
         file_mapped is accounted only when the memory cgroup is owner of page
         cache.)
 
+5.2.2 memory.vmscan_stat
+
+memory.vmscan_stat includes statistics information for memory scanning and
+freeing, reclaiming. The statistics shows memory scanning information since
+memory cgroup creation and can be reset to 0 by writing 0 as
+
+ #echo 0 > ../memory.vmscan_stat
+
+This file contains following statistics.
+
+[param]_[file_or_anon]_pages_by_[reason]_[under_heararchy]
+[param]_elapsed_ns_by_[reason]_[under_hierarchy]
+
+For example,
+
+  scanned_file_pages_by_limit indicates the number of scanned
+  file pages at vmscan.
+
+Now, 3 parameters are supported
+
+  scanned - the number of pages scanned by vmscan
+  rotated - the number of pages activated at vmscan
+  freed   - the number of pages freed by vmscan
+
+If "rotated" is high against scanned/freed, the memcg seems busy.
+
+Now, 2 reason are supported
+
+  limit - the memory cgroup's limit
+  system - global memory pressure + softlimit
+           (global memory pressure not under softlimit is not handled now)
+
+When under_hierarchy is added in the tail, the number indicates the
+total memcg scan of its children and itself.
+
+elapsed_ns is a elapsed time in nanosecond. This may include sleep time
+and not indicates CPU usage. So, please take this as just showing
+latency.
+
+Here is an example.
+
+# cat /cgroup/memory/A/memory.vmscan_stat
+scanned_pages_by_limit 9471864
+scanned_anon_pages_by_limit 6640629
+scanned_file_pages_by_limit 2831235
+rotated_pages_by_limit 4243974
+rotated_anon_pages_by_limit 3971968
+rotated_file_pages_by_limit 272006
+freed_pages_by_limit 2318492
+freed_anon_pages_by_limit 962052
+freed_file_pages_by_limit 1356440
+elapsed_ns_by_limit 351386416101
+scanned_pages_by_system 0
+scanned_anon_pages_by_system 0
+scanned_file_pages_by_system 0
+rotated_pages_by_system 0
+rotated_anon_pages_by_system 0
+rotated_file_pages_by_system 0
+freed_pages_by_system 0
+freed_anon_pages_by_system 0
+freed_file_pages_by_system 0
+elapsed_ns_by_system 0
+scanned_pages_by_limit_under_hierarchy 9471864
+scanned_anon_pages_by_limit_under_hierarchy 6640629
+scanned_file_pages_by_limit_under_hierarchy 2831235
+rotated_pages_by_limit_under_hierarchy 4243974
+rotated_anon_pages_by_limit_under_hierarchy 3971968
+rotated_file_pages_by_limit_under_hierarchy 272006
+freed_pages_by_limit_under_hierarchy 2318492
+freed_anon_pages_by_limit_under_hierarchy 962052
+freed_file_pages_by_limit_under_hierarchy 1356440
+elapsed_ns_by_limit_under_hierarchy 351386416101
+scanned_pages_by_system_under_hierarchy 0
+scanned_anon_pages_by_system_under_hierarchy 0
+scanned_file_pages_by_system_under_hierarchy 0
+rotated_pages_by_system_under_hierarchy 0
+rotated_anon_pages_by_system_under_hierarchy 0
+rotated_file_pages_by_system_under_hierarchy 0
+freed_pages_by_system_under_hierarchy 0
+freed_anon_pages_by_system_under_hierarchy 0
+freed_file_pages_by_system_under_hierarchy 0
+elapsed_ns_by_system_under_hierarchy 0
+
 5.3 swappiness
 
 Similar to /proc/sys/vm/swappiness, but affecting a hierarchy of groups only.
index f10014fa1d14f21a08e712162fcbd86820f1d4be..dfd6a9f4a58338ea5cc5d42fede7b826382685dc 100644 (file)
@@ -460,13 +460,6 @@ Who:       FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
 
 ----------------------------
 
-What:  DMA_xxBIT_MASK macros
-When:  Jun 2011
-Why:   DMA_xxBIT_MASK macros were replaced with DMA_BIT_MASK() macros.
-Who:   FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-
-----------------------------
-
 What:  iwlwifi disable_hw_scan module parameters
 When:  3.0
 Why:   Hareware scan is the prefer method for iwlwifi devices for
index a70e43edcb65c9d732d3877499410b487911d213..4ca93898fbd3d984a3bccf550b5281d3f0a90e56 100644 (file)
@@ -1846,7 +1846,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
                        See Documentation/sound/oss/oss-parameters.txt
 
        panic=          [KNL] Kernel behaviour on panic: delay <timeout>
-                       seconds before rebooting
+                       timeout > 0: seconds before rebooting
+                       timeout = 0: wait forever
+                       timeout < 0: reboot immediately
                        Format: <timeout>
 
        parkbd.port=    [HW] Parallel port number the keyboard adapter is
index 1c7fb0a94e28a84cf6a8c2b56c82babe9fa34d64..704e474a93df8539e093aa3569bb889faa1adb70 100644 (file)
@@ -61,6 +61,7 @@ show up in /proc/sys/kernel:
 - rtsig-nr
 - sem
 - sg-big-buff                 [ generic SCSI device (sg) ]
+- shm_rmid_forced
 - shmall
 - shmmax                      [ sysv ipc ]
 - shmmni
@@ -518,6 +519,27 @@ kernel.  This value defaults to SHMMAX.
 
 ==============================================================
 
+shm_rmid_forced:
+
+Linux lets you set resource limits, including how much memory one
+process can consume, via setrlimit(2).  Unfortunately, shared memory
+segments are allowed to exist without association with any process, and
+thus might not be counted against any resource limits.  If enabled,
+shared memory segments are automatically destroyed when their attach
+count becomes zero after a detach or a process termination.  It will
+also destroy segments that were created, but never attached to, on exit
+from the process.  The only use left for IPC_RMID is to immediately
+destroy an unattached segment.  Of course, this breaks the way things are
+defined, so some applications might stop working.  Note that this
+feature will do you no good unless you also configure your resource
+limits (in particular, RLIMIT_AS and RLIMIT_NPROC).  Most systems don't
+need this.
+
+Note that if you change this from 0 to 1, already created segments
+without users and with a dead originative process will be destroyed.
+
+==============================================================
+
 softlockup_thresh:
 
 This value can be used to lower the softlockup tolerance threshold.  The
index 1288294247470a9fb625771d0aced0f20d928e9e..bf99d93c63662ddd639fb1bb222bc3f8f575609b 100644 (file)
@@ -4217,9 +4217,10 @@ F:       drivers/usb/image/microtek.*
 
 MIPS
 M:     Ralf Baechle <ralf@linux-mips.org>
-W:     http://www.linux-mips.org/
 L:     linux-mips@linux-mips.org
+W:     http://www.linux-mips.org/
 T:     git git://git.linux-mips.org/pub/scm/linux.git
+Q:     http://patchwork.linux-mips.org/project/linux-mips/list/
 S:     Supported
 F:     Documentation/mips/
 F:     arch/mips/
index e756d04b6cd5dcdf07b4f394b8be15f1814c4849..640f909ddd41a68ea1bf90c5cba66c6287187d5b 100644 (file)
@@ -176,15 +176,15 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
 #define atomic_xchg(v, new) (xchg(&((v)->counter), new))
 
 /**
- * atomic_add_unless - add unless the number is a given value
+ * __atomic_add_unless - add unless the number is a given value
  * @v: pointer of type atomic_t
  * @a: the amount to add to v...
  * @u: ...unless v is equal to u.
  *
  * Atomically adds @a to @v, so long as it was not @u.
- * Returns non-zero if @v was not @u, and zero otherwise.
+ * Returns the old value of @v.
  */
-static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
+static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
 {
        int c, old;
        c = atomic_read(v);
@@ -196,10 +196,9 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
                        break;
                c = old;
        }
-       return c != (u);
+       return c;
 }
 
-#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
 
 /**
  * atomic64_add_unless - add unless the number is a given value
@@ -208,7 +207,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
  * @u: ...unless v is equal to u.
  *
  * Atomically adds @a to @v, so long as it was not @u.
- * Returns non-zero if @v was not @u, and zero otherwise.
+ * Returns the old value of @v.
  */
 static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
 {
@@ -256,5 +255,4 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
 #define smp_mb__before_atomic_inc()    smp_mb()
 #define smp_mb__after_atomic_inc()     smp_mb()
 
-#include <asm-generic/atomic-long.h>
 #endif /* _ALPHA_ATOMIC_H */
index 85b815215776d5abce038aa70257351e88be363d..a19ba5efea4ca77f6685108e49f0430ed21663d0 100644 (file)
@@ -456,8 +456,7 @@ sched_find_first_bit(const unsigned long b[2])
 
 #include <asm-generic/bitops/le.h>
 
-#define ext2_set_bit_atomic(l,n,a)   test_and_set_bit(n,a)
-#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a)
+#include <asm-generic/bitops/ext2-atomic-setbit.h>
 
 #endif /* __KERNEL__ */
 
index b9e3e3318371e132d11437ce63a9e5456ac43fb8..9c94b8456043cdceda6e76c951fbbeb0921e5816 100644 (file)
@@ -2,7 +2,7 @@
 #define _ALPHA_LOCAL_H
 
 #include <linux/percpu.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 
 typedef struct
 {
index 65cf3e28e2f42df7a032f59e35744818df27d059..fd698a174f26a9358a2c8e63b663c68bc47a56c1 100644 (file)
@@ -72,7 +72,6 @@ struct switch_stack {
 #define user_mode(regs) (((regs)->ps & 8) != 0)
 #define instruction_pointer(regs) ((regs)->pc)
 #define profile_pc(regs) instruction_pointer(regs)
-extern void show_regs(struct pt_regs *);
 
 #define task_pt_regs(task) \
   ((struct pt_regs *) (task_stack_page(task) + 2*PAGE_SIZE) - 1)
index 8e47709160f84962bd6b2744ea6a1a5b9ae49b28..8143cd7cdbfbe62a7f6568f4fc1767f31d499997 100644 (file)
@@ -17,7 +17,7 @@
 #include <linux/init.h>
 
 #include <asm/hwrpb.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/irq.h>
 #include <asm/irq_regs.h>
 #include <asm/pal.h>
index d739703608fcc6c29c0adaa2b2e065ee22b77a85..4087a569b43b15f7f135241c88092395651a4a7a 100644 (file)
@@ -31,7 +31,7 @@
 
 #include <asm/hwrpb.h>
 #include <asm/ptrace.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
index 0f5520d2f45fc41d72d2d333fb291c50517bfa3c..f9f5fe830e9f9c8912daaf830c4a4b54454ea43c 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #include <linux/spinlock.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 
   asm (".text                                  \n\
        .global _atomic_dec_and_lock            \n\
index 7e79503ab89b5d395e634fda206e1e97d6262d04..86976d03438213975c0aae962012f15b89275de8 100644 (file)
@@ -208,16 +208,15 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
 
 #define atomic_xchg(v, new) (xchg(&((v)->counter), new))
 
-static inline int atomic_add_unless(atomic_t *v, int a, int u)
+static inline int __atomic_add_unless(atomic_t *v, int a, int u)
 {
        int c, old;
 
        c = atomic_read(v);
        while (c != u && (old = atomic_cmpxchg((v), c, c + a)) != c)
                c = old;
-       return c != u;
+       return c;
 }
-#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
 
 #define atomic_inc(v)          atomic_add(1, v)
 #define atomic_dec(v)          atomic_sub(1, v)
@@ -460,9 +459,6 @@ static inline int atomic64_add_unless(atomic64_t *v, u64 a, u64 u)
 #define atomic64_dec_and_test(v)       (atomic64_dec_return((v)) == 0)
 #define atomic64_inc_not_zero(v)       atomic64_add_unless((v), 1LL, 0LL)
 
-#else /* !CONFIG_GENERIC_ATOMIC64 */
-#include <asm-generic/atomic64.h>
-#endif
-#include <asm-generic/atomic-long.h>
+#endif /* !CONFIG_GENERIC_ATOMIC64 */
 #endif
 #endif
index f4280593dfa3a61b9675bfbb35fd2a2b61eb2ed2..f7419ef9c8f99f57a0495bf31453580c6ed43893 100644 (file)
@@ -310,10 +310,7 @@ static inline int find_next_bit_le(const void *p, int size, int offset)
 /*
  * Ext2 is defined to use little-endian byte ordering.
  */
-#define ext2_set_bit_atomic(lock, nr, p)       \
-               test_and_set_bit_le(nr, p)
-#define ext2_clear_bit_atomic(lock, nr, p)     \
-               test_and_clear_bit_le(nr, p)
+#include <asm-generic/bitops/ext2-atomic-setbit.h>
 
 #endif /* __KERNEL__ */
 
index 167e3cbe1f2fc815367c955c29d0a842b6059f62..d88ff0230e826f8ea15a60560668dcf81ef80373 100644 (file)
@@ -27,7 +27,7 @@
 #include <linux/clockchips.h>
 #include <linux/completion.h>
 
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/cacheflush.h>
 #include <asm/cpu.h>
 #include <asm/cputype.h>
index 2d3436e9f71f034ec3f8cb70e636fa07f5d15bc2..bc9f9da782cb85ff3eb0171b9c0d5b8630397c90 100644 (file)
@@ -25,7 +25,7 @@
 #include <linux/init.h>
 #include <linux/sched.h>
 
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/cacheflush.h>
 #include <asm/system.h>
 #include <asm/unistd.h>
index ea53f4d9b283069673ce3624d822abc1be8610f4..4159eca78945360b8b9a4fc5630ba5ddab7e07a8 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/io.h>
 
 #include <asm/irq.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/mach/time.h>
 #include <asm/mach/irq.h>
 
index 9f2a948e0e72a61083cf3038a03f4aa2bae4520c..0ca00050666aa56cc920bc1f81f0af3196bb234a 100644 (file)
@@ -34,7 +34,7 @@
 
 #include <linux/mm.h>
 #include <linux/pfn.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <mach/dma.h>
 
 /* I don't quite understand why dc4 fails when this is set to 1 and DMA is enabled */
index 6eae7f764d1df98ac8ed41e1c0fa84cb83900101..c2588cc991d1282ef3095884162de9b0d6035986 100644 (file)
@@ -11,7 +11,7 @@
 #ifndef __CNS3XXX_PM_H
 #define __CNS3XXX_PM_H
 
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 
 void cns3xxx_pwr_clk_en(unsigned int block);
 void cns3xxx_pwr_clk_dis(unsigned int block);
index 5e579552aa5444fb7189b8df54e09758fd912b56..0c04678615ceade16015442eeefada0ae1623c7d 100644 (file)
@@ -10,7 +10,7 @@
 #include <linux/module.h>
 #include <linux/io.h>
 #include <linux/delay.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <mach/system.h>
 #include <mach/cns3xxx.h>
 #include <mach/pm.h>
index 98ba9784aa1508bed004759158b6affa18c95580..495b3987d461f840434d547977c716ce1cc8149d 100644 (file)
@@ -44,7 +44,7 @@
 #include <linux/io.h>
 
 #include <asm/irq.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/mach/time.h>
 #include <asm/mach/irq.h>
 
index 554e0d3ec70b0f8979c857636a402790c98c49c5..f9e6bdaf41d289f1afe60e8cb952e8c5dc5fda44 100644 (file)
@@ -36,7 +36,7 @@
 #include <linux/io.h>
 
 #include <mach/hardware.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/irq.h>
 
 #include <mach/regs-clock.h>
index 6224bad4d604161c96676171b1ae3ea019b2c675..9ad99f8016a174b119c3ff46bf51e1191320146f 100644 (file)
@@ -38,7 +38,7 @@
 #include <linux/io.h>
 
 #include <mach/hardware.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/irq.h>
 
 #include <mach/regs-clock.h>
index f8d96130d1d1d99c9daa6e692b5df3a0ec4995d4..7f5ea0a169a5650195111bdec0b1dad2f5d0e100 100644 (file)
@@ -35,7 +35,7 @@
 #include <linux/io.h>
 
 #include <mach/hardware.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/irq.h>
 
 #include <mach/regs-clock.h>
index bbce6a1c6bb67b873918a32fc68e9a6ea1e5890b..e0ac2631c87e3166d52c13d879c622f0bab75c4e 100644 (file)
@@ -78,70 +78,63 @@ static inline int atomic_add_return(int i, atomic_t *v)
 /*
  * atomic_sub_unless - sub unless the number is a given value
  * @v: pointer of type atomic_t
- * @a: the amount to add to v...
+ * @a: the amount to subtract from v...
  * @u: ...unless v is equal to u.
  *
- * If the atomic value v is not equal to u, this function subtracts a
- * from v, and returns non zero. If v is equal to u then it returns
- * zero. This is done as an atomic operation.
+ * Atomically subtract @a from @v, so long as it was not @u.
+ * Returns the old value of @v.
 */
-static inline int atomic_sub_unless(atomic_t *v, int a, int u)
+static inline void atomic_sub_unless(atomic_t *v, int a, int u)
 {
-       int tmp, result = 0;
+       int tmp;
 
        asm volatile(
                "/* atomic_sub_unless */\n"
                "1:     ssrf    5\n"
-               "       ld.w    %0, %3\n"
-               "       cp.w    %0, %5\n"
+               "       ld.w    %0, %2\n"
+               "       cp.w    %0, %4\n"
                "       breq    1f\n"
-               "       sub     %0, %4\n"
-               "       stcond  %2, %0\n"
+               "       sub     %0, %3\n"
+               "       stcond  %1, %0\n"
                "       brne    1b\n"
-               "       mov     %1, 1\n"
                "1:"
-               : "=&r"(tmp), "=&r"(result), "=o"(v->counter)
-               : "m"(v->counter), "rKs21"(a), "rKs21"(u), "1"(result)
+               : "=&r"(tmp), "=o"(v->counter)
+               : "m"(v->counter), "rKs21"(a), "rKs21"(u)
                : "cc", "memory");
-
-       return result;
 }
 
 /*
- * atomic_add_unless - add unless the number is a given value
+ * __atomic_add_unless - add unless the number is a given value
  * @v: pointer of type atomic_t
  * @a: the amount to add to v...
  * @u: ...unless v is equal to u.
  *
- * If the atomic value v is not equal to u, this function adds a to v,
- * and returns non zero. If v is equal to u then it returns zero. This
- * is done as an atomic operation.
+ * Atomically adds @a to @v, so long as it was not @u.
+ * Returns the old value of @v.
 */
-static inline int atomic_add_unless(atomic_t *v, int a, int u)
+static inline int __atomic_add_unless(atomic_t *v, int a, int u)
 {
-       int tmp, result;
+       int tmp, old = atomic_read(v);
 
        if (__builtin_constant_p(a) && (a >= -1048575) && (a <= 1048576))
-               result = atomic_sub_unless(v, -a, u);
+               atomic_sub_unless(v, -a, u);
        else {
-               result = 0;
                asm volatile(
-                       "/* atomic_add_unless */\n"
+                       "/* __atomic_add_unless */\n"
                        "1:     ssrf    5\n"
-                       "       ld.w    %0, %3\n"
-                       "       cp.w    %0, %5\n"
+                       "       ld.w    %0, %2\n"
+                       "       cp.w    %0, %4\n"
                        "       breq    1f\n"
-                       "       add     %0, %4\n"
-                       "       stcond  %2, %0\n"
+                       "       add     %0, %3\n"
+                       "       stcond  %1, %0\n"
                        "       brne    1b\n"
-                       "       mov     %1, 1\n"
                        "1:"
-                       : "=&r"(tmp), "=&r"(result), "=o"(v->counter)
-                       : "m"(v->counter), "r"(a), "ir"(u), "1"(result)
+                       : "=&r"(tmp), "=o"(v->counter)
+                       : "m"(v->counter), "r"(a), "ir"(u)
                        : "cc", "memory");
        }
 
-       return result;
+       return old;
 }
 
 /*
@@ -188,7 +181,6 @@ static inline int atomic_sub_if_positive(int i, atomic_t *v)
 #define atomic_dec_and_test(v) (atomic_sub_return(1, v) == 0)
 #define atomic_add_negative(i, v) (atomic_add_return(i, v) < 0)
 
-#define atomic_inc_not_zero(v) atomic_add_unless(v, 1, 0)
 #define atomic_dec_if_positive(v) atomic_sub_if_positive(1, v)
 
 #define smp_mb__before_atomic_dec()    barrier()
@@ -196,6 +188,4 @@ static inline int atomic_sub_if_positive(int i, atomic_t *v)
 #define smp_mb__before_atomic_inc()    barrier()
 #define smp_mb__after_atomic_inc()     barrier()
 
-#include <asm-generic/atomic-long.h>
-
 #endif /*  __ASM_AVR32_ATOMIC_H */
index e53dd0d900f5eed01b4a61b704604260161f0620..c67a007f672acdda24bb2a1f1546fe041cca9587 100644 (file)
@@ -132,8 +132,6 @@ struct pt_regs {
 #define instruction_pointer(regs)       ((regs)->pc)
 #define profile_pc(regs)                instruction_pointer(regs)
 
-extern void show_regs (struct pt_regs *);
-
 static __inline__ int valid_user_regs(struct pt_regs *regs)
 {
        /*
index 4c707dbe1ff9f64643822094eb9d7f09a1b30885..135225696fd228a42c43318e3080c4d98d287cc8 100644 (file)
@@ -89,15 +89,14 @@ static inline void atomic_set_mask(int mask, atomic_t *v)
 #define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n)))
 #define atomic_xchg(v, new) (xchg(&((v)->counter), new))
 
-#define atomic_add_unless(v, a, u)                             \
+#define __atomic_add_unless(v, a, u)                           \
 ({                                                             \
        int c, old;                                             \
        c = atomic_read(v);                                     \
        while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \
                c = old;                                        \
-       c != (u);                                               \
+       c;                                                      \
 })
-#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
 
 /*
  * atomic_inc_and_test - increment and test
@@ -112,10 +111,7 @@ static inline void atomic_set_mask(int mask, atomic_t *v)
 #define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)
 #define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
 
-#include <asm-generic/atomic-long.h>
 
 #endif
 
-#include <asm-generic/atomic64.h>
-
 #endif
index d9dbc1a5353440bb6dc2e12e8fed21e25d034fb9..dac0c97242bbf6ef3e4a45bcc2914cad8522f046 100644 (file)
@@ -10,7 +10,7 @@
 
 #include <linux/interrupt.h>
 #include <mach/dma.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/blackfin.h>
 #include <asm/page.h>
 #include <asm-generic/dma.h>
index 9e0cc0e2534f67376769410059b6fe76bf00600e..17b5e92e3bc683e1382d926297484582725a0273 100644 (file)
@@ -32,7 +32,7 @@
 #include <asm/ptrace.h>
 #include <asm/irq.h>
 #include <asm/bitops.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/traps.h>
 #include <asm/bitsperlong.h>
 
index 7854d4367c15c2247c70ef0a07af9ee933df0887..10d8641180f2c24339c1abd7f81dd8008afebc7d 100644 (file)
@@ -102,7 +102,6 @@ struct pt_regs {
 /* user_mode returns true if only one bit is set in IPEND, other than the
    master interrupt enable.  */
 #define user_mode(regs) (!(((regs)->ipend & ~0x10) & (((regs)->ipend & ~0x10) - 1)))
-extern void show_regs(struct pt_regs *);
 
 #define arch_has_single_step() (1)
 /* common code demands this function */
index 2336093fca23bb5d649af26922b11a271d9e468e..490c7caa02d9337b7b91ae8db6934320e0e91715 100644 (file)
@@ -11,7 +11,7 @@
 # include <asm-generic/spinlock.h>
 #else
 
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 
 asmlinkage int __raw_spin_is_locked_asm(volatile int *ptr);
 asmlinkage void __raw_spin_lock_asm(volatile int *ptr);
index 48808a12b4279f909ddf2afa404f0778a776c309..9277905b82cf27efacef0cf5f83bc00af838d7db 100644 (file)
@@ -9,7 +9,7 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/uaccess.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/cacheflush.h>
 
 #ifdef CONFIG_DYNAMIC_FTRACE
index 486426f8a0d79c203d591569e298b33e7040bfdb..dbe11220cc53113f590a4642b26d7db3bbe200a0 100644 (file)
@@ -32,7 +32,7 @@
 #include <linux/unistd.h>
 #include <linux/io.h>
 #include <asm/system.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/irq_handler.h>
 
 DEFINE_PER_CPU(struct pt_regs, __ipipe_tick_regs);
index 679d0db352564584bc2a699adfee03c04c4a4d07..9919d29287dce98ed39daa2fa64e7b4f3fe42a1e 100644 (file)
@@ -18,7 +18,7 @@
 #include <linux/smp.h>
 #include <linux/timer.h>
 #include <asm/blackfin.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/cacheflush.h>
 #include <asm/bfin_watchdog.h>
 
index 1c143a4de5f50a9b012607049411b184cb794816..107622aacf6b62ac59acd07d61551aff42bf1660 100644 (file)
@@ -23,7 +23,7 @@
 #include <linux/seq_file.h>
 #include <linux/irq.h>
 #include <linux/slab.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/cacheflush.h>
 #include <asm/irq_handler.h>
 #include <asm/mmu_context.h>
index c03bc3bc30c2f581f1dce2a4783fcf570d81ab6c..642c6fed43d753b4375ff97ffa3f215eec849349 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 
 #include <linux/list.h>
 #include <linux/interrupt.h>
index a0843a71aaeed9eb47ed62b121f7e997bfc0c85d..0b99df72d2a460992978256eacf8b48c6f56d180 100644 (file)
@@ -7,7 +7,7 @@
 #include <asm/mmu_context.h>
 #include <hwregs/asm/mmu_defs_asm.h>
 #include <hwregs/supp_reg.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 
 #include <linux/err.h>
 #include <linux/init.h>
index 2f464eab3a51cf25764c74939e3736babfe9f844..1a232739565e59f77019dce77b06b6a439bbafcb 100644 (file)
@@ -112,7 +112,6 @@ struct switch_stack {
 #define user_mode(regs) (((regs)->dccr & 0x100) != 0)
 #define instruction_pointer(regs) ((regs)->irp)
 #define profile_pc(regs) instruction_pointer(regs)
-extern void show_regs(struct pt_regs *);
 
 #endif  /*  __KERNEL__  */
 
index ffca8d0f2e17bab6343ba61142ba3f9a4f0564ab..19773d3bd4c440bc315cf003cd04aebcc1dfd9d9 100644 (file)
@@ -111,7 +111,6 @@ struct switch_stack {
 #define arch_has_single_step() (1)
 #define user_mode(regs) (((regs)->ccs & (1 << (U_CCS_BITNR + CCS_SHIFT))) != 0)
 #define instruction_pointer(regs) ((regs)->erp)
-extern void show_regs(struct pt_regs *);
 #define profile_pc(regs) instruction_pointer(regs)
 
 #endif  /*  __KERNEL__  */
index 88dc9b9c4ba051f84988926c4ab304af8091bc27..bbf093814db2ac4054d1e165a12c06ab17e2f3a3 100644 (file)
@@ -138,7 +138,7 @@ static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
 
 #define atomic_xchg(v, new) (xchg(&((v)->counter), new))
 
-static inline int atomic_add_unless(atomic_t *v, int a, int u)
+static inline int __atomic_add_unless(atomic_t *v, int a, int u)
 {
        int ret;
        unsigned long flags;
@@ -148,9 +148,8 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
        if (ret != u)
                v->counter += a;
        cris_atomic_restore(v, flags);
-       return ret != u;
+       return ret;
 }
-#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
 
 /* Atomic operations are already serializing */
 #define smp_mb__before_atomic_dec()    barrier()
@@ -158,5 +157,4 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
 #define smp_mb__before_atomic_inc()    barrier()
 #define smp_mb__after_atomic_inc()     barrier()
 
-#include <asm-generic/atomic-long.h>
 #endif
index 310e0de67aa6c80911ad99fdaf91b522787ba8f0..a78a2d70cd8b2aa1acd2050a9006f88a9bfab163 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <arch/bitops.h>
 #include <asm/system.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <linux/compiler.h>
 
 /*
@@ -156,8 +156,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
 
 #include <asm-generic/bitops/le.h>
 
-#define ext2_set_bit_atomic(l,n,a)   test_and_set_bit(n,a)
-#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a)
+#include <asm-generic/bitops/ext2-atomic-setbit.h>
 
 #include <asm-generic/bitops/sched.h>
 
index c99aeab7cef727b0cf6ebf18f93216f715d49216..aa585e4e979eca9b7aacad7721f4116353790587 100644 (file)
@@ -12,7 +12,7 @@
  * This file handles the architecture-dependent parts of process handling..
  */
 
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/pgtable.h>
 #include <asm/uaccess.h>
 #include <asm/irq.h>
index fae32c7fdcb6619c487f3786993c70b6b0481788..0d8a7d66174000e3ebfbd5193bed1ace42d79c96 100644 (file)
@@ -241,7 +241,7 @@ extern uint32_t __xchg_32(uint32_t i, volatile void *v);
 #define atomic64_cmpxchg(v, old, new)  (__cmpxchg_64(old, new, &(v)->counter))
 #define atomic64_xchg(v, new)          (__xchg_64(new, &(v)->counter))
 
-static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
+static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
 {
        int c, old;
        c = atomic_read(v);
@@ -253,10 +253,8 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
                        break;
                c = old;
        }
-       return c != (u);
+       return c;
 }
 
-#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
 
-#include <asm-generic/atomic-long.h>
 #endif /* _ASM_ATOMIC_H */
index a1d00b0c6ed71135c0ce113fb70b4080940fd49f..57bf85db893f167b0cb3695c26f6e546d0b7dd04 100644 (file)
@@ -403,8 +403,7 @@ int __ilog2_u64(u64 n)
 
 #include <asm-generic/bitops/le.h>
 
-#define ext2_set_bit_atomic(lock,nr,addr)      test_and_set_bit  ((nr) ^ 0x18, (addr))
-#define ext2_clear_bit_atomic(lock,nr,addr)    test_and_clear_bit((nr) ^ 0x18, (addr))
+#include <asm-generic/bitops/ext2-atomic-setbit.h>
 
 #endif /* __KERNEL__ */
 
index 5fc8b6f5bc55ccdc3934acf5e416f1d84ce52a35..c62833d6ebbb8def0aa8829c890e4bf0be5bd384 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef __ASM_HARDIRQ_H
 #define __ASM_HARDIRQ_H
 
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 
 extern atomic_t irq_err_count;
 static inline void ack_bad_irq(int irq)
index 4b789ab182b0879e008cb4a8b63943e3390c3bb2..81c2e271d620d90af8f55b9199ac3f1de773f850 100644 (file)
@@ -97,7 +97,6 @@ extern struct task_struct *__kernel_current_task;
  */
 #define start_thread(_regs, _pc, _usp)                 \
 do {                                                   \
-       set_fs(USER_DS); /* reads from user space */    \
        __frame = __kernel_frame0_ptr;                  \
        __frame->pc     = (_pc);                        \
        __frame->psr    &= ~PSR_S;                      \
index 6bfad4cf1907aa3cc5e585d8ee36f38da67640ac..ef6635ca4ecb3f73a4d7bad1cd044d9b0a1e9750 100644 (file)
@@ -78,7 +78,6 @@ register struct pt_regs *__frame asm("gr28");
 #define user_stack_pointer(regs)       ((regs)->sp)
 
 extern unsigned long user_stack(const struct pt_regs *);
-extern void show_regs(struct pt_regs *);
 #define profile_pc(regs) ((regs)->pc)
 
 #define task_pt_regs(task) ((task)->thread.frame0)
index a5f624a9f5593de4221f8d038077fb56bce9e5f9..3facbc28cbbcf2be4f72d6f16ac1d6dd5fd9562f 100644 (file)
@@ -25,7 +25,7 @@
 #include <linux/module.h>
 #include <linux/bitops.h>
 
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/io.h>
 #include <asm/smp.h>
 #include <asm/system.h>
index 9d359752646741b426596f4fb43671e6000cf18d..3901df1213c0f24454f37a755ddb3e83cd9d978b 100644 (file)
@@ -143,10 +143,7 @@ void machine_power_off(void)
 
 void flush_thread(void)
 {
-#if 0 //ndef NO_FPU
-       unsigned long zero = 0;
-#endif
-       set_fs(USER_DS);
+       /* nothing */
 }
 
 inline unsigned long user_stack(const struct pt_regs *regs)
index 984221abb66d3d470483f0f14a7271ef944dce21..f5a38c1f5489f8d5dda4a1fb2b0be5613867b6bb 100644 (file)
@@ -104,7 +104,7 @@ static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
 
 #define atomic_xchg(v, new) (xchg(&((v)->counter), new))
 
-static inline int atomic_add_unless(atomic_t *v, int a, int u)
+static inline int __atomic_add_unless(atomic_t *v, int a, int u)
 {
        int ret;
        unsigned long flags;
@@ -114,9 +114,8 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
        if (ret != u)
                v->counter += a;
        local_irq_restore(flags);
-       return ret != u;
+       return ret;
 }
-#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
 
 static __inline__ void atomic_clear_mask(unsigned long mask, unsigned long *v)
 {
@@ -146,5 +145,4 @@ static __inline__ void atomic_set_mask(unsigned long mask, unsigned long *v)
 #define smp_mb__before_atomic_inc()    barrier()
 #define smp_mb__after_atomic_inc() barrier()
 
-#include <asm-generic/atomic-long.h>
 #endif /* __ARCH_H8300_ATOMIC __ */
index 5c553927fc538ae149426cb38f327a213d031141..6f833a16f694ca36383b5216b726966b35633766 100644 (file)
@@ -50,7 +50,7 @@ typedef struct {
 #define        __FD_CLR(d, set)        ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
 
 #undef __FD_ISSET
-#define        __FD_ISSET(d, set)      ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
+#define        __FD_ISSET(d, set)      (!!((set)->fds_bits[__FDELT(d)] & __FDMASK(d)))
 
 #undef __FD_ZERO
 #define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp)))
index d866c0efba875818819e19b2104e39247df4105b..d09c440bdba7a79eaf58bc17fc3537c273fd8b9d 100644 (file)
@@ -60,7 +60,6 @@ struct pt_regs {
 #define user_mode(regs) (!((regs)->ccr & PS_S))
 #define instruction_pointer(regs) ((regs)->pc)
 #define profile_pc(regs) instruction_pointer(regs)
-extern void show_regs(struct pt_regs *);
 #endif /* __KERNEL__ */
 #endif /* __ASSEMBLY__ */
 #endif /* _H8300_PTRACE_H */
index 446881439675934b295d39fcd0519fce19f6ffdd..3fad89ee01cb0e89c3b6872bd5d24d0b924ed791 100644 (file)
@@ -90,7 +90,7 @@ ia64_atomic64_sub (__s64 i, atomic64_t *v)
        (cmpxchg(&((v)->counter), old, new))
 #define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
 
-static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
+static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
 {
        int c, old;
        c = atomic_read(v);
@@ -102,10 +102,9 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
                        break;
                c = old;
        }
-       return c != (u);
+       return c;
 }
 
-#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
 
 static __inline__ long atomic64_add_unless(atomic64_t *v, long a, long u)
 {
@@ -216,5 +215,4 @@ atomic64_add_negative (__s64 i, atomic64_t *v)
 #define smp_mb__before_atomic_inc()    barrier()
 #define smp_mb__after_atomic_inc()     barrier()
 
-#include <asm-generic/atomic-long.h>
 #endif /* _ASM_IA64_ATOMIC_H */
index b76f7e009218bec2ed2327caa715f15ce7981aef..8e20bff39f79a9709ea4a16ce0692efcaffe86cb 100644 (file)
@@ -458,8 +458,7 @@ static __inline__ unsigned long __arch_hweight64(unsigned long x)
 
 #include <asm-generic/bitops/le.h>
 
-#define ext2_set_bit_atomic(l,n,a)     test_and_set_bit(n,a)
-#define ext2_clear_bit_atomic(l,n,a)   test_and_clear_bit(n,a)
+#include <asm-generic/bitops/ext2-atomic-setbit.h>
 
 #include <asm-generic/bitops/sched.h>
 
index 03afe7970748ce4dc5336ba0b9ff4169729965e9..d9f397fae03eb7e89712aa7cedef3b8d11082b4e 100644 (file)
@@ -75,7 +75,7 @@
 #include <asm/percpu.h>
 #include <asm/rse.h>
 #include <asm/unwind.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #ifdef CONFIG_NUMA
 #include <asm/nodedata.h>
 #endif
index 7ae9c3f15a1ca586b9ab27a39b27682afd0d5465..f5cb27614e35df7c4027094e7ac1d6626091021c 100644 (file)
@@ -286,7 +286,6 @@ static inline unsigned long user_stack_pointer(struct pt_regs *regs)
   struct task_struct;                  /* forward decl */
   struct unw_frame_info;               /* forward decl */
 
-  extern void show_regs (struct pt_regs *);
   extern void ia64_do_show_stack (struct unw_frame_info *, void *);
   extern unsigned long ia64_get_user_rbs_end (struct task_struct *, struct pt_regs *,
                                              unsigned long *);
index 1a91c9121d17b5f032b192905370a69d7d24bee8..b77768d35f93fbfe76d933770d97d68a579e4053 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/bitops.h>
 
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/intrinsics.h>
 #include <asm/system.h>
 
index be450a3e9871673e22d56445dbe69f80522baac4..0bd537b4ea6b82629fe598b2370e4a8d098c89de 100644 (file)
@@ -32,7 +32,7 @@
 #include <linux/bitops.h>
 #include <linux/kexec.h>
 
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/current.h>
 #include <asm/delay.h>
 #include <asm/machvec.h>
index 14ec641003daf268fe58c54b0e926afdf8a3ec69..559097986672f663cf1b612586a5646fc8aeb1d8 100644 (file)
@@ -40,7 +40,7 @@
 #include <linux/percpu.h>
 #include <linux/bitops.h>
 
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/cache.h>
 #include <asm/current.h>
 #include <asm/delay.h>
index c4696d217ce0bfe5216393cd4ad572194937175d..6a867dc45c05b75af1a06e8f7eaaffc04249b96d 100644 (file)
@@ -25,7 +25,7 @@
 #include <asm/pal.h>
 #include <asm/system.h>
 #include <asm/pgtable.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/tlbflush.h>
 #include <asm/sn/arch.h>
 
index d44a51e5271b7b5b10a5d8610ce1076f4e536be5..1e7f29fb21f2037c67145d13fc9e487adc62f5fd 100644 (file)
@@ -239,15 +239,15 @@ static __inline__ int atomic_dec_return(atomic_t *v)
 #define atomic_xchg(v, new) (xchg(&((v)->counter), new))
 
 /**
- * atomic_add_unless - add unless the number is a given value
+ * __atomic_add_unless - add unless the number is a given value
  * @v: pointer of type atomic_t
  * @a: the amount to add to v...
  * @u: ...unless v is equal to u.
  *
  * Atomically adds @a to @v, so long as it was not @u.
- * Returns non-zero if @v was not @u, and zero otherwise.
+ * Returns the old value of @v.
  */
-static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
+static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
 {
        int c, old;
        c = atomic_read(v);
@@ -259,10 +259,9 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
                        break;
                c = old;
        }
-       return c != (u);
+       return c;
 }
 
-#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
 
 static __inline__ void atomic_clear_mask(unsigned long  mask, atomic_t *addr)
 {
@@ -314,5 +313,4 @@ static __inline__ void atomic_set_mask(unsigned long  mask, atomic_t *addr)
 #define smp_mb__before_atomic_inc()    barrier()
 #define smp_mb__after_atomic_inc()     barrier()
 
-#include <asm-generic/atomic-long.h>
 #endif /* _ASM_M32R_ATOMIC_H */
index a70a3df33635f96844fe34c75721336d8cc2fbc0..a979a41981689a7321a7e758a3c5ec744d6f9202 100644 (file)
@@ -11,7 +11,7 @@
 
 #ifndef __ASSEMBLY__
 
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/pgalloc.h>
 #include <asm/mmu.h>
 #include <asm/tlbflush.h>
index 840a1231edeb82c65a487680b45e7abe22eaca42..527527584dd096dc2d7c2cc55bab64e83df0fee6 100644 (file)
@@ -138,8 +138,6 @@ extern void init_debug_traps(struct task_struct *);
 #define instruction_pointer(regs) ((regs)->bpc)
 #define profile_pc(regs) instruction_pointer(regs)
 
-extern void show_regs(struct pt_regs *);
-
 extern void withdraw_debug_trap(struct pt_regs *regs);
 
 #define task_pt_regs(task) \
index 179a06489b1086036cae78a0fadd59801f2da8f1..b0ea2f26da3bc57e93956e053c04ef59af9857cd 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #include <linux/compiler.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/page.h>
 
 /*
index 092d40a6708e4a35ffec5e6f4f966791551d50c6..ce7aea34fdf410857799d9e17e092ff1aa1936e8 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <asm/cacheflush.h>
 #include <asm/pgalloc.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/io.h>
 #include <asm/mmu_context.h>
 #include <asm/m32r.h>
index fbd109031df3aca4c83851494044492a0cc20965..ee6a9199561ca8b46b3e8c633966c61f44e2d824 100644 (file)
@@ -21,7 +21,7 @@
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 
 #include <asm/smp.h>
 
index 307a573881ad2ff3a98e123462d3dfe87f544670..65c6be6c81807aa38b90b092bf6bb83f0541b73f 100644 (file)
@@ -183,7 +183,7 @@ static inline void atomic_set_mask(unsigned long mask, unsigned long *v)
        __asm__ __volatile__("orl %1,%0" : "+m" (*v) : ASM_DI (mask));
 }
 
-static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
+static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
 {
        int c, old;
        c = atomic_read(v);
@@ -195,10 +195,9 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
                        break;
                c = old;
        }
-       return c != (u);
+       return c;
 }
 
-#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
 
 /* Atomic operations are already serializing */
 #define smp_mb__before_atomic_dec()    barrier()
@@ -206,6 +205,4 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
 #define smp_mb__before_atomic_inc()    barrier()
 #define smp_mb__after_atomic_inc()     barrier()
 
-#include <asm-generic/atomic-long.h>
-#include <asm-generic/atomic64.h>
 #endif /* __ARCH_M68K_ATOMIC __ */
index 63cdcc142d9357bc93c7210945d9080616176944..98d0970d9badf054e056820818ed7e0e29ba01b1 100644 (file)
@@ -51,7 +51,7 @@ typedef struct {
 #define        __FD_CLR(d, set)        ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
 
 #undef __FD_ISSET
-#define        __FD_ISSET(d, set)      ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
+#define        __FD_ISSET(d, set)      (!!((set)->fds_bits[__FDELT(d)] & __FDMASK(d)))
 
 #undef __FD_ZERO
 #define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp)))
index 6e6e3ac1d91338839106bdd9875cc4896a3bad2c..65322b17b6cfb96664763a74796871d1c321413b 100644 (file)
@@ -85,7 +85,6 @@ struct switch_stack {
 #define user_mode(regs) (!((regs)->sr & PS_S))
 #define instruction_pointer(regs) ((regs)->pc)
 #define profile_pc(regs) instruction_pointer(regs)
-extern void show_regs(struct pt_regs *);
 
 #define arch_has_single_step() (1)
 
index 3e5c254e8d1c33a2849b1e0141dcd1f4b5fa6e84..d6864774644874f14c4a28830bf6077dada09a4d 100644 (file)
@@ -11,7 +11,7 @@
 #ifndef _ASM_MICROBLAZE_MMU_CONTEXT_H
 #define _ASM_MICROBLAZE_MMU_CONTEXT_H
 
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/bitops.h>
 #include <asm/mmu.h>
 #include <asm-generic/mm_hooks.h>
index 9bd01ecb00d69e980e0568b75a3e8b882d090b71..9ad567e2d425eae6a2628774b27da824bb0b0bb4 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <linux/types.h>
 #include <asm/irq.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 
 #define HAVE_ARCH_DEVTREE_FIXUPS
 
index d9b66304d5ddd764f5d9e9db87d1eb4d9273ceb5..816bee64b1961d202f35a1aa9c4d2be0fc1d640e 100644 (file)
@@ -61,8 +61,6 @@ struct pt_regs {
 #define instruction_pointer(regs)      ((regs)->pc)
 #define profile_pc(regs)               instruction_pointer(regs)
 
-void show_regs(struct pt_regs *);
-
 #else /* __KERNEL__ */
 
 /* pt_regs offsets used by gdbserver etc in ptrace syscalls */
index aef6c917b45a4cde0de557566a2ba3b4345f445b..5ce8029f558b17a28107d602e7e3d59712262093 100644 (file)
@@ -16,6 +16,7 @@ platforms += lasat
 platforms += loongson
 platforms += mipssim
 platforms += mti-malta
+platforms += netlogic
 platforms += pmc-sierra
 platforms += pnx833x
 platforms += pnx8550
index 884819cd06077f8a9648adce10923bc8928fc596..53e3514ba10e93c249d837f460fb86fbe3879f52 100644 (file)
@@ -191,18 +191,6 @@ endif
 #
 include $(srctree)/arch/mips/Kbuild.platforms
 
-#
-# NETLOGIC SOC Common (common)
-#
-cflags-$(CONFIG_NLM_COMMON)            += -I$(srctree)/arch/mips/include/asm/mach-netlogic
-cflags-$(CONFIG_NLM_COMMON)            += -I$(srctree)/arch/mips/include/asm/netlogic
-
-#
-# NETLOGIC XLR/XLS SoC, Simulator and boards
-#
-core-$(CONFIG_NLM_XLR)                 += arch/mips/netlogic/xlr/
-load-$(CONFIG_NLM_XLR_BOARD)           += 0xffffffff84000000
-
 cflags-y                       += -I$(srctree)/arch/mips/include/asm/mach-generic
 drivers-$(CONFIG_PCI)          += arch/mips/pci/
 
index 2ca4ada1c291cf7cb13f0ac047d6b879e9e1b400..2460f9d23f1bee098a03efecfe2181abaeef1988 100644 (file)
@@ -443,7 +443,7 @@ struct clk *clk_get(struct device *dev, const char *id)
                return &vbus_clk;
        if (!strcmp(id, "cpu"))
                return &cpu_clk;
-       if (!strcmp(id, "dsp"));
+       if (!strcmp(id, "dsp"))
                return &dsp_clk;
        if (!strcmp(id, "vbus"))
                return &vbus_clk;
index 7d2fab392327003311ac282483e99f0a398d2e4f..33ffecf6a6d662403cc8cd3fb24de1737dc3e39b 100644 (file)
@@ -229,7 +229,7 @@ static struct resource cpmac_low_res[] = {
                .name   = "irq",
                .flags  = IORESOURCE_IRQ,
                .start  = 27,
-               .end    = 27,
+               .end    = 27,
        },
 };
 
index 23818d299127ce96434ba6c21c378ac8b35739af..8088c6fdb83ed7e0a2b1689373569dbd3a526988 100644 (file)
@@ -77,7 +77,7 @@ struct psp_env_chunk {
        u16     csum;
        u8      len;
        char    data[11];
-} __attribute__ ((packed));
+} __packed;
 
 struct psp_var_map_entry {
        u8      num;
index 4a02fe891ab6d5909b11997d738010844f710637..1d93f81d57e78ba208d0fb5ae8fea9c058ae4a54 100644 (file)
@@ -303,15 +303,15 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
 #define atomic_xchg(v, new) (xchg(&((v)->counter), (new)))
 
 /**
- * atomic_add_unless - add unless the number is a given value
+ * __atomic_add_unless - add unless the number is a given value
  * @v: pointer of type atomic_t
  * @a: the amount to add to v...
  * @u: ...unless v is equal to u.
  *
  * Atomically adds @a to @v, so long as it was not @u.
- * Returns non-zero if @v was not @u, and zero otherwise.
+ * Returns the old value of @v.
  */
-static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
+static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
 {
        int c, old;
        c = atomic_read(v);
@@ -323,9 +323,8 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
                        break;
                c = old;
        }
-       return c != (u);
+       return c;
 }
-#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
 
 #define atomic_dec_return(v) atomic_sub_return(1, (v))
 #define atomic_inc_return(v) atomic_add_return(1, (v))
@@ -680,7 +679,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
  * @u: ...unless v is equal to u.
  *
  * Atomically adds @a to @v, so long as it was not @u.
- * Returns non-zero if @v was not @u, and zero otherwise.
+ * Returns the old value of @v.
  */
 static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
 {
@@ -766,10 +765,6 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
  */
 #define atomic64_add_negative(i, v) (atomic64_add_return(i, (v)) < 0)
 
-#else /* !CONFIG_64BIT */
-
-#include <asm-generic/atomic64.h>
-
 #endif /* CONFIG_64BIT */
 
 /*
@@ -781,6 +776,4 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
 #define smp_mb__before_atomic_inc()    smp_mb__before_llsc()
 #define smp_mb__after_atomic_inc()     smp_llsc_mb()
 
-#include <asm-generic/atomic-long.h>
-
 #endif /* _ASM_ATOMIC_H */
index 0b89b83e20551cd05d072fd26a8b56c834c62efa..98bcc98cf29b49f3b097dca2aa87b758875bb6b0 100644 (file)
@@ -14,6 +14,7 @@
 #define _ASM_FIXMAP_H
 
 #include <asm/page.h>
+#include <spaces.h>
 #ifdef CONFIG_HIGHMEM
 #include <linux/threads.h>
 #include <asm/kmap_types.h>
@@ -67,15 +68,6 @@ enum fixed_addresses {
  * the start of the fixmap, and leave one page empty
  * at the top of mem..
  */
-#ifdef CONFIG_BCM63XX
-#define FIXADDR_TOP     ((unsigned long)(long)(int)0xff000000)
-#else
-#if defined(CONFIG_CPU_TX39XX) || defined(CONFIG_CPU_TX49XX)
-#define FIXADDR_TOP    ((unsigned long)(long)(int)(0xff000000 - 0x20000))
-#else
-#define FIXADDR_TOP    ((unsigned long)(long)(int)0xfffe0000)
-#endif
-#endif
 #define FIXADDR_SIZE   (__end_of_fixed_addresses << PAGE_SHIFT)
 #define FIXADDR_START  (FIXADDR_TOP - FIXADDR_SIZE)
 
index e64b41093c49006ef9e4752242675b9be0169c6b..0aa44abc77fe588835334d9c164701b20af4d626 100644 (file)
@@ -21,8 +21,6 @@
 #ifndef _ASM_GT64120_H
 #define _ASM_GT64120_H
 
-#include <linux/clocksource.h>
-
 #include <asm/addrspace.h>
 #include <asm/byteorder.h>
 
index 77adda297ad9811b20b71e22af13d11707100044..9e8ef5994c9cf15b20068376e8e06d7194b9bf3c 100644 (file)
@@ -8,7 +8,7 @@
 #ifndef __ASM_HW_IRQ_H
 #define __ASM_HW_IRQ_H
 
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 
 extern atomic_t irq_err_count;
 
index 0ec01294b063c0cc323e49d45e4d4a46b6fc2a86..2354c870a63a1f8eb06bcce96d7036b767bb0497 100644 (file)
@@ -18,7 +18,6 @@
 
 static inline void irq_dispose_mapping(unsigned int virq)
 {
-       return;
 }
 
 #ifdef CONFIG_I8259
index fffc8307a80a31e11424cc0996ec749ad5f1a0c4..94fde8d0fac1c60e1ee5999d14f8e4f0ec4c1226 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <linux/percpu.h>
 #include <linux/bitops.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/cmpxchg.h>
 #include <asm/war.h>
 
index 85fd27509aac5732687910e04ac305e354056550..0ed5230243c9efee9f010c1d12b0af620a0c2a5f 100644 (file)
@@ -89,7 +89,6 @@
 
 /* Interrupt Mask register */
 #define PERF_IRQMASK_REG               0xc
-#define PERF_IRQSTAT_REG               0x10
 
 /* Interrupt Status register */
 #define PERF_IRQSTAT_REG               0x10
diff --git a/arch/mips/include/asm/mach-bcm63xx/spaces.h b/arch/mips/include/asm/mach-bcm63xx/spaces.h
new file mode 100644 (file)
index 0000000..61e750f
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle
+ * Copyright (C) 2000, 2002  Maciej W. Rozycki
+ * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
+ */
+#ifndef _ASM_BCM63XX_SPACES_H
+#define _ASM_BCM63XX_SPACES_H
+
+#define FIXADDR_TOP            ((unsigned long)(long)(int)0xff000000)
+
+#include <asm/mach-generic/spaces.h>
+
+#endif /* __ASM_BCM63XX_SPACES_H */
index 8da98073e952154cf0e1107fff4060b9ad780ec6..9c95177f7a7e04bde7771cf5b7c8204753a57e9b 100644 (file)
@@ -49,7 +49,6 @@ static inline int plat_dma_supported(struct device *dev, u64 mask)
 
 static inline void plat_extra_sync_for_device(struct device *dev)
 {
-       return;
 }
 
 static inline int plat_dma_mapping_error(struct device *dev,
index c9fa4b14968d483ff6dd224c3a4daf23dc3b1143..d7a9efd3a5ce217973ecebb0e2ce4c09be083efa 100644 (file)
@@ -82,4 +82,8 @@
 #define PAGE_OFFSET            (CAC_BASE + PHYS_OFFSET)
 #endif
 
+#ifndef FIXADDR_TOP
+#define FIXADDR_TOP            ((unsigned long)(long)(int)0xfffe0000)
+#endif
+
 #endif /* __ASM_MACH_GENERIC_SPACES_H */
index 016d0989b141355e9205c55a18be9b573e5875df..06c441968e6ed4fcb31f6c71f506063d198bfb28 100644 (file)
@@ -60,7 +60,6 @@ static inline int plat_dma_supported(struct device *dev, u64 mask)
 
 static inline void plat_extra_sync_for_device(struct device *dev)
 {
-       return;
 }
 
 static inline int plat_dma_mapping_error(struct device *dev,
index 302101b54acb1e72d47ec080b71f126d44b7c9c0..9fc1e9ad7038879840d73fc142d7a88b4ebde218 100644 (file)
@@ -50,7 +50,6 @@ static inline int plat_dma_supported(struct device *dev, u64 mask)
 
 static inline void plat_extra_sync_for_device(struct device *dev)
 {
-       return;
 }
 
 static inline int plat_dma_mapping_error(struct device *dev,
index 981c75f91a7db42fb79c7ef8573668056ab811d5..e1433055fe98b5f6e876313bbdb98b23a2021e75 100644 (file)
@@ -55,7 +55,6 @@ static inline int plat_dma_supported(struct device *dev, u64 mask)
 
 static inline void plat_extra_sync_for_device(struct device *dev)
 {
-       return;
 }
 
 static inline int plat_dma_mapping_error(struct device *dev,
index 2848cea42bce8f5e441a63c2546e7c93d0b98da5..37e3583a9fdd0c8393c76a45251069751e4f6999 100644 (file)
@@ -32,6 +32,7 @@
 /* #define cpu_has_vtag_icache ? */
 /* #define cpu_has_dc_aliases  ? */
 /* #define cpu_has_ic_fills_f_dc ? */
+#define cpu_has_clo_clz                1
 #define cpu_has_nofpuex                0
 /* #define cpu_has_64bits      ? */
 /* #define cpu_has_64bit_zero_reg ? */
@@ -58,6 +59,7 @@
 /* #define cpu_has_vtag_icache ? */
 /* #define cpu_has_dc_aliases  ? */
 /* #define cpu_has_ic_fills_f_dc ? */
+#define cpu_has_clo_clz                1
 #define cpu_has_nofpuex                0
 /* #define cpu_has_64bits      ? */
 /* #define cpu_has_64bit_zero_reg ? */
index 779b02205737598c5230eea76cae0eaea42b66ed..27aaaa5d925e4d35ce8b8aee8c061d51fe0d40ef 100644 (file)
@@ -31,6 +31,7 @@
 /* #define cpu_has_vtag_icache ? */
 /* #define cpu_has_dc_aliases  ? */
 /* #define cpu_has_ic_fills_f_dc ? */
+#define cpu_has_clo_clz                1
 #define cpu_has_nofpuex                0
 /* #define cpu_has_64bits      ? */
 /* #define cpu_has_64bit_zero_reg ? */
@@ -56,6 +57,7 @@
 /* #define cpu_has_vtag_icache ? */
 /* #define cpu_has_dc_aliases  ? */
 /* #define cpu_has_ic_fills_f_dc ? */
+#define cpu_has_clo_clz                1
 #define cpu_has_nofpuex                0
 /* #define cpu_has_64bits      ? */
 /* #define cpu_has_64bit_zero_reg ? */
diff --git a/arch/mips/include/asm/mach-powertv/cpu-feature-overrides.h b/arch/mips/include/asm/mach-powertv/cpu-feature-overrides.h
new file mode 100644 (file)
index 0000000..f751e3e
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2010  Cisco Systems, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef _ASM_MACH_POWERTV_CPU_FEATURE_OVERRIDES_H_
+#define _ASM_MACH_POWERTV_CPU_FEATURE_OVERRIDES_H_
+#define cpu_has_tlb                    1
+#define cpu_has_4kex                   1
+#define cpu_has_3k_cache               0
+#define cpu_has_4k_cache               1
+#define cpu_has_tx39_cache             0
+#define cpu_has_fpu                    0
+#define cpu_has_counter                        1
+#define cpu_has_watch                  1
+#define cpu_has_divec                  1
+#define cpu_has_vce                    0
+#define cpu_has_cache_cdex_p           0
+#define cpu_has_cache_cdex_s           0
+#define cpu_has_mcheck                 1
+#define cpu_has_ejtag                  1
+#define cpu_has_llsc                   1
+#define cpu_has_mips16                 0
+#define cpu_has_mdmx                   0
+#define cpu_has_mips3d                 0
+#define cpu_has_smartmips              0
+#define cpu_has_vtag_icache            0
+#define cpu_has_dc_aliases             0
+#define cpu_has_ic_fills_f_dc          0
+#define cpu_has_mips32r1               0
+#define cpu_has_mips32r2               1
+#define cpu_has_mips64r1               0
+#define cpu_has_mips64r2               0
+#define cpu_has_dsp                    0
+#define cpu_has_mipsmt                 0
+#define cpu_has_userlocal              0
+#define cpu_has_nofpuex                        0
+#define cpu_has_64bits                 0
+#define cpu_has_64bit_zero_reg         0
+#define cpu_has_vint                   1
+#define cpu_has_veic                   1
+#define cpu_has_inclusive_pcaches      0
+
+#define cpu_dcache_line_size()         32
+#define cpu_icache_line_size()         32
+#endif
index a8e72cf1214202519971c31a7da0d17e374d0ab1..62c094085947db735ba4e2390094db048d1fee3b 100644 (file)
@@ -102,7 +102,6 @@ static inline int plat_dma_supported(struct device *dev, u64 mask)
 
 static inline void plat_extra_sync_for_device(struct device *dev)
 {
-       return;
 }
 
 static inline int plat_dma_mapping_error(struct device *dev,
diff --git a/arch/mips/include/asm/mach-tx39xx/spaces.h b/arch/mips/include/asm/mach-tx39xx/spaces.h
new file mode 100644 (file)
index 0000000..151fe7a
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle
+ * Copyright (C) 2000, 2002  Maciej W. Rozycki
+ * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
+ */
+#ifndef _ASM_TX39XX_SPACES_H
+#define _ASM_TX39XX_SPACES_H
+
+#define FIXADDR_TOP            ((unsigned long)(long)(int)0xfefe0000)
+
+#include <asm/mach-generic/spaces.h>
+
+#endif /* __ASM_TX39XX_SPACES_H */
diff --git a/arch/mips/include/asm/mach-tx49xx/spaces.h b/arch/mips/include/asm/mach-tx49xx/spaces.h
new file mode 100644 (file)
index 0000000..0cb10a6
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle
+ * Copyright (C) 2000, 2002  Maciej W. Rozycki
+ * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
+ */
+#ifndef _ASM_TX49XX_SPACES_H
+#define _ASM_TX49XX_SPACES_H
+
+#define FIXADDR_TOP            ((unsigned long)(long)(int)0xfefe0000)
+
+#include <asm/mach-generic/spaces.h>
+
+#endif /* __ASM_TX49XX_SPACES_H */
index 7e40f37781790206a1174830f295258d89ec648f..b2202a68cf0f377b7f881cfde45578f3be56c8f3 100644 (file)
@@ -414,6 +414,7 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
  * constraints placed on us by the cache architecture.
  */
 #define HAVE_ARCH_UNMAPPED_AREA
+#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
 
 /*
  * No page table caches to initialise
index 9e09af34c8a87cbfc03b65c429fc99844edcd69d..ef2a8041e78b02f7141e80b0a5440888520323f9 100644 (file)
@@ -11,6 +11,8 @@
 #ifndef __ASM_SMP_OPS_H
 #define __ASM_SMP_OPS_H
 
+#include <linux/errno.h>
+
 #ifdef CONFIG_SMP
 
 #include <linux/cpumask.h>
@@ -56,8 +58,43 @@ static inline void register_smp_ops(struct plat_smp_ops *ops)
 
 #endif /* !CONFIG_SMP */
 
-extern struct plat_smp_ops up_smp_ops;
-extern struct plat_smp_ops cmp_smp_ops;
-extern struct plat_smp_ops vsmp_smp_ops;
+static inline int register_up_smp_ops(void)
+{
+#ifdef CONFIG_SMP_UP
+       extern struct plat_smp_ops up_smp_ops;
+
+       register_smp_ops(&up_smp_ops);
+
+       return 0;
+#else
+       return -ENODEV;
+#endif
+}
+
+static inline int register_cmp_smp_ops(void)
+{
+#ifdef CONFIG_MIPS_CMP
+       extern struct plat_smp_ops cmp_smp_ops;
+
+       register_smp_ops(&cmp_smp_ops);
+
+       return 0;
+#else
+       return -ENODEV;
+#endif
+}
+
+static inline int register_vsmp_smp_ops(void)
+{
+#ifdef CONFIG_MIPS_MT_SMP
+       extern struct plat_smp_ops vsmp_smp_ops;
+
+       register_smp_ops(&vsmp_smp_ops);
+
+       return 0;
+#else
+       return -ENODEV;
+#endif
+}
 
 #endif /* __ASM_SMP_OPS_H */
index af42385245d5d44099289fafbf678e72d27a39c7..d4fb4d852a6db5e1778bbc6542807ca2c0919e56 100644 (file)
@@ -17,7 +17,7 @@
 #include <linux/threads.h>
 #include <linux/cpumask.h>
 
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/smp-ops.h>
 
 extern int smp_num_siblings;
index ea60bf08dcb0b9792e4433a7dd92117a3b1afd98..c9736fc0632542d11920ab141ae69d2f7205579c 100644 (file)
@@ -46,6 +46,7 @@ extern void smtc_prepare_cpus(int cpus);
 extern void smtc_smp_finish(void);
 extern void smtc_boot_secondary(int cpu, struct task_struct *t);
 extern void smtc_cpus_done(void);
+extern void smtc_init_secondary(void);
 
 
 /*
index dcbd4bb417ec094d931c8188b72daae1799779eb..504d40aedfae670aff49644f1964e6a932b63ac6 100644 (file)
@@ -150,6 +150,7 @@ static inline void __uasminit uasm_l##lb(struct uasm_label **lab, u32 *addr) \
 # define UASM_i_SLL(buf, rs, rt, sh) uasm_i_dsll(buf, rs, rt, sh)
 # define UASM_i_SRA(buf, rs, rt, sh) uasm_i_dsra(buf, rs, rt, sh)
 # define UASM_i_SRL(buf, rs, rt, sh) uasm_i_dsrl(buf, rs, rt, sh)
+# define UASM_i_SRL_SAFE(buf, rs, rt, sh) uasm_i_dsrl_safe(buf, rs, rt, sh)
 # define UASM_i_ROTR(buf, rs, rt, sh) uasm_i_drotr(buf, rs, rt, sh)
 # define UASM_i_MFC0(buf, rt, rd...) uasm_i_dmfc0(buf, rt, rd)
 # define UASM_i_MTC0(buf, rt, rd...) uasm_i_dmtc0(buf, rt, rd)
@@ -165,6 +166,7 @@ static inline void __uasminit uasm_l##lb(struct uasm_label **lab, u32 *addr) \
 # define UASM_i_SLL(buf, rs, rt, sh) uasm_i_sll(buf, rs, rt, sh)
 # define UASM_i_SRA(buf, rs, rt, sh) uasm_i_sra(buf, rs, rt, sh)
 # define UASM_i_SRL(buf, rs, rt, sh) uasm_i_srl(buf, rs, rt, sh)
+# define UASM_i_SRL_SAFE(buf, rs, rt, sh) uasm_i_srl(buf, rs, rt, sh)
 # define UASM_i_ROTR(buf, rs, rt, sh) uasm_i_rotr(buf, rs, rt, sh)
 # define UASM_i_MFC0(buf, rt, rd...) uasm_i_mfc0(buf, rt, rd)
 # define UASM_i_MTC0(buf, rt, rd...) uasm_i_mtc0(buf, rt, rd)
index 6fcfc480e9d017bdadafec7042819b0a607547bf..ecea7871dec28f6e4e44e1652a2d10b87e8a87b1 100644 (file)
 #define __NR_open_by_handle_at         (__NR_Linux + 340)
 #define __NR_clock_adjtime             (__NR_Linux + 341)
 #define __NR_syncfs                    (__NR_Linux + 342)
-#define __NR_setns                     (__NR_Linux + 343)
+#define __NR_sendmmsg                  (__NR_Linux + 343)
+#define __NR_setns                     (__NR_Linux + 344)
 
 /*
  * Offset of the last Linux o32 flavoured syscall
  */
-#define __NR_Linux_syscalls            343
+#define __NR_Linux_syscalls            344
 
 #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
 
 #define __NR_O32_Linux                 4000
-#define __NR_O32_Linux_syscalls                343
+#define __NR_O32_Linux_syscalls                344
 
 #if _MIPS_SIM == _MIPS_SIM_ABI64
 
 #define __NR_open_by_handle_at         (__NR_Linux + 299)
 #define __NR_clock_adjtime             (__NR_Linux + 300)
 #define __NR_syncfs                    (__NR_Linux + 301)
-#define __NR_setns                     (__NR_Linux + 302)
+#define __NR_sendmmsg                  (__NR_Linux + 302)
+#define __NR_setns                     (__NR_Linux + 303)
 
 /*
  * Offset of the last Linux 64-bit flavoured syscall
  */
-#define __NR_Linux_syscalls            302
+#define __NR_Linux_syscalls            303
 
 #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
 
 #define __NR_64_Linux                  5000
-#define __NR_64_Linux_syscalls         302
+#define __NR_64_Linux_syscalls         303
 
 #if _MIPS_SIM == _MIPS_SIM_NABI32
 
 #define __NR_open_by_handle_at         (__NR_Linux + 304)
 #define __NR_clock_adjtime             (__NR_Linux + 305)
 #define __NR_syncfs                    (__NR_Linux + 306)
-#define __NR_setns                     (__NR_Linux + 307)
+#define __NR_sendmmsg                  (__NR_Linux + 307)
+#define __NR_setns                     (__NR_Linux + 308)
 
 /*
  * Offset of the last N32 flavoured syscall
  */
-#define __NR_Linux_syscalls            307
+#define __NR_Linux_syscalls            308
 
 #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
 
 #define __NR_N32_Linux                 6000
-#define __NR_N32_Linux_syscalls                307
+#define __NR_N32_Linux_syscalls                308
 
 #ifdef __KERNEL__
 
index bb133d10b14566470ca8cd9bfb823126198076fc..ebc0cd20b35d612a1265a69cb1fb433d89bb41ae 100644 (file)
@@ -71,7 +71,6 @@ void r4k_wait_irqoff(void)
        local_irq_enable();
        __asm__("       .globl __pastwait       \n"
                "__pastwait:                    \n");
-       return;
 }
 
 /*
index 9b734d74ae8e0ee43922d34629ed1838d5c0e7c8..b53970d809916efafff50fde04b371c279efb8ac 100644 (file)
@@ -23,7 +23,7 @@
 #include <linux/kgdb.h>
 #include <linux/ftrace.h>
 
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
 
index 6e71b284f6c925b7b3f73bfd89e78bfd6816b7b6..191eb52228c415d1080c1ab7eca2fd9e9e7def7d 100644 (file)
@@ -103,14 +103,12 @@ void __init mips_cpu_irq_init(void)
        clear_c0_status(ST0_IM);
        clear_c0_cause(CAUSEF_IP);
 
-       /*
-        * Only MT is using the software interrupts currently, so we just
-        * leave them uninitialized for other processors.
-        */
-       if (cpu_has_mipsmt)
-               for (i = irq_base; i < irq_base + 2; i++)
-                       irq_set_chip_and_handler(i, &mips_mt_cpu_irq_controller,
-                                                handle_percpu_irq);
+       /* Software interrupts are used for MT/CMT IPI */
+       for (i = irq_base; i < irq_base + 2; i++)
+               irq_set_chip_and_handler(i, cpu_has_mipsmt ?
+                                        &mips_mt_cpu_irq_controller :
+                                        &mips_cpu_irq_controller,
+                                        handle_percpu_irq);
 
        for (i = irq_base + 2; i < irq_base + 8; i++)
                irq_set_chip_and_handler(i, &mips_cpu_irq_controller,
index b2259e7cd829161b958464fdc375bf68c182b34f..594ca69cb867aa67b91098fe1b262e90fc832b57 100644 (file)
@@ -12,7 +12,7 @@
 
 #include <asm/cpu.h>
 #include <asm/processor.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/system.h>
 #include <asm/hardirq.h>
 #include <asm/mmu_context.h>
index d0deaab9ace2e670db80844235de55ce157349d7..0aee944ac38089eafb3001754d43c5ac0f7a3ac6 100644 (file)
@@ -192,8 +192,6 @@ again:
 
        local64_add(delta, &event->count);
        local64_sub(delta, &hwc->period_left);
-
-       return;
 }
 
 static void mipspmu_start(struct perf_event *event, int flags)
index c28fbe6107bc3aae5fb590f19742f29520f7501e..b30cb2573aaf8cc8a3edae6d8b0a70a1a564a867 100644 (file)
@@ -103,7 +103,6 @@ void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp)
                __init_dsp();
        regs->cp0_epc = pc;
        regs->regs[29] = sp;
-       current_thread_info()->addr_limit = USER_DS;
 }
 
 void exit_thread(void)
index 557ef72472e08f082e19f068f7d131b93ab9856e..7a80b7cda7cc0219e1de607aebed7c316cf6b0ee 100644 (file)
@@ -36,7 +36,7 @@
 #include <asm/mipsmtregs.h>
 #include <asm/mips_mt.h>
 #include <asm/cacheflush.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/cpu.h>
 #include <asm/processor.h>
 #include <asm/system.h>
index 99e656e425f31c929ce448f15646837386090b09..e521420a45a54896f16c6caa0e73ebd39718fd4b 100644 (file)
@@ -589,6 +589,7 @@ einval:     li      v0, -ENOSYS
        sys     sys_open_by_handle_at   3       /* 4340 */
        sys     sys_clock_adjtime       2
        sys     sys_syncfs              1
+       sys     sys_sendmmsg            4
        sys     sys_setns               2
        .endm
 
index fb0575f47f3d1b8696873327c18676cb676a97a5..85874d6a8a709e31b8964a9ae65ee4326f4f6143 100644 (file)
@@ -428,5 +428,6 @@ sys_call_table:
        PTR     sys_open_by_handle_at
        PTR     sys_clock_adjtime               /* 5300 */
        PTR     sys_syncfs
+       PTR     sys_sendmmsg
        PTR     sys_setns
        .size   sys_call_table,.-sys_call_table
index 4de0c5534e73e04e9ca162c9de6844a773bbb0e6..b85842fc87ae60d65d9f1599a275de3d07c284d1 100644 (file)
@@ -428,5 +428,6 @@ EXPORT(sysn32_call_table)
        PTR     sys_open_by_handle_at
        PTR     compat_sys_clock_adjtime        /* 6305 */
        PTR     sys_syncfs
+       PTR     compat_sys_sendmmsg
        PTR     sys_setns
        .size   sysn32_call_table,.-sysn32_call_table
index 4a387de08bfa1d48954ea9296d72d22024dad448..46c4763edf211b7d3af7c630ad76dba949e33787 100644 (file)
@@ -546,5 +546,6 @@ sys_call_table:
        PTR     compat_sys_open_by_handle_at    /* 4340 */
        PTR     compat_sys_clock_adjtime
        PTR     sys_syncfs
+       PTR     compat_sys_sendmmsg
        PTR     sys_setns
        .size   sys_call_table,.-sys_call_table
index cc81771b882ca6bbf4240c4b3228165ffc9b2506..fe3095160655755f87fa7d0641d86b4916e3bc5a 100644 (file)
@@ -25,7 +25,7 @@
 #include <linux/interrupt.h>
 #include <linux/compiler.h>
 
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/cacheflush.h>
 #include <asm/cpu.h>
 #include <asm/processor.h>
index 1ec56e635d04a480905d1913cd89457eef2be607..ce9e286f0a74912560adaaa428efeaeac37d6c7d 100644 (file)
@@ -24,7 +24,7 @@
 #include <linux/compiler.h>
 #include <linux/smp.h>
 
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/cacheflush.h>
 #include <asm/cpu.h>
 #include <asm/processor.h>
index 32a2561010823253c24b9d9cffdc1801d380f9a9..32c1e954cd3761d4c0f6c7625440387cf011f149 100644 (file)
@@ -34,7 +34,7 @@
 #include <linux/err.h>
 #include <linux/ftrace.h>
 
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/cpu.h>
 #include <asm/processor.h>
 #include <asm/r4k-timer.h>
index fe256559c9978491ced2297b184c733b849050fa..928a5a61e1a61d58cd97df79330e732e2f7fc6c8 100644 (file)
@@ -10,7 +10,7 @@
 
 #include <asm/cpu.h>
 #include <asm/processor.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/system.h>
 #include <asm/hardirq.h>
 #include <asm/mmu_context.h>
index cedac4633741b24c14393da27cb6423c79ecac3f..f0895e70e283b3982c18a672ad8875a8b1e6ad55 100644 (file)
@@ -30,7 +30,7 @@
 
 #include <asm/cpu.h>
 #include <asm/processor.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/system.h>
 #include <asm/hardirq.h>
 #include <asm/hazards.h>
index 05dd170a83f7e379ec4e40fe37c454e2c7a4e61a..99f913c8d7a6eb3e4db9ac2f7b8def493a4e5e5e 100644 (file)
@@ -16,7 +16,7 @@
 #include <linux/cpumask.h>
 
 #include <asm/r4k-timer.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/barrier.h>
 #include <asm/mipsregs.h>
 
index dbb6b408f00151972605313c4bfbeaa42bf19bb6..2cd50ad0d5c66ec04d4034c6bf81b690dd5cb1a8 100644 (file)
@@ -46,7 +46,7 @@
 #include <asm/mipsregs.h>
 #include <asm/mipsmtregs.h>
 #include <asm/cacheflush.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/cpu.h>
 #include <asm/mips_mt.h>
 #include <asm/processor.h>
index 94560899d13e4b06c30580d1a438cf5db16dd579..7e9c0ffc11a51c42bd58b1f465d54481aab6023c 100644 (file)
@@ -100,6 +100,19 @@ void clk_put(struct clk *clk)
 }
 EXPORT_SYMBOL(clk_put);
 
+int clk_enable(struct clk *clk)
+{
+       /* not used */
+       return 0;
+}
+EXPORT_SYMBOL(clk_enable);
+
+void clk_disable(struct clk *clk)
+{
+       /* not used */
+}
+EXPORT_SYMBOL(clk_disable);
+
 static inline u32 ltq_get_counter_resolution(void)
 {
        u32 res;
index 64057244eec549b732fdc4e550e2388cf54c013a..2b666d3a3947d5baa81731ab4349a04c54b25023 100644 (file)
@@ -45,8 +45,6 @@ void ec_write(unsigned short addr, unsigned char val)
        /*  flush the write action */
        inb(EC_IO_PORT_DATA);
        spin_unlock_irqrestore(&index_access_lock, flags);
-
-       return;
 }
 EXPORT_SYMBOL_GPL(ec_write);
 
index 55f22a3afe6194bcea4f95f3ce510706a1725aa1..256e0cdaa499ff45fa730fb7dd080d72d6724966 100644 (file)
@@ -34,6 +34,7 @@
 #include <asm/time.h>
 #include <asm/mips-boards/sim.h>
 #include <asm/mips-boards/simint.h>
+#include <asm/smp-ops.h>
 
 
 static void __init serial_init(void);
@@ -59,18 +60,17 @@ void __init prom_init(void)
 
        prom_meminit();
 
-#ifdef CONFIG_MIPS_MT_SMP
-       if (cpu_has_mipsmt)
-               register_smp_ops(&vsmp_smp_ops);
-       else
-               register_smp_ops(&up_smp_ops);
-#endif
+       if (cpu_has_mipsmt) {
+               if (!register_vsmp_smp_ops())
+                       return;
+
 #ifdef CONFIG_MIPS_MT_SMTC
-       if (cpu_has_mipsmt)
                register_smp_ops(&ssmtc_smp_ops);
-       else
-               register_smp_ops(&up_smp_ops);
+                       return;
 #endif
+       }
+
+       register_up_smp_ops();
 }
 
 static void __init serial_init(void)
index 30df47258c2c4f0cd55cd79e52064798587834e1..915063991f6e0fd7605f1c48114502f25dd4a94a 100644 (file)
@@ -24,7 +24,7 @@
 #include <linux/interrupt.h>
 #include <linux/smp.h>
 
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/cpu.h>
 #include <asm/processor.h>
 #include <asm/smtc.h>
index eeb642e4066e714d2098f8b1b3f7b89bbed20024..b9aabb998a32ab5856fb53e910785063eea78613 100644 (file)
@@ -604,6 +604,7 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size)
                        r4k_blast_scache();
                else
                        blast_scache_range(addr, addr + size);
+               __sync();
                return;
        }
 
@@ -620,6 +621,7 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size)
        }
 
        bc_wback_inv(addr, size);
+       __sync();
 }
 
 static void r4k_dma_cache_inv(unsigned long addr, unsigned long size)
@@ -647,6 +649,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size)
                                 (addr + size - 1) & almask);
                        blast_inv_scache_range(addr, addr + size);
                }
+               __sync();
                return;
        }
 
@@ -663,6 +666,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size)
        }
 
        bc_inv(addr, size);
+       __sync();
 }
 #endif /* CONFIG_DMA_NONCOHERENT */
 
index 21ea14efb83747c5275858c6b64a18b6ea040131..46084912e58880ffe2eb13e6ac4a2c9a0993b893 100644 (file)
 #include <linux/scatterlist.h>
 #include <linux/string.h>
 #include <linux/gfp.h>
+#include <linux/highmem.h>
 
 #include <asm/cache.h>
 #include <asm/io.h>
 
 #include <dma-coherence.h>
 
-static inline unsigned long dma_addr_to_virt(struct device *dev,
+static inline struct page *dma_addr_to_page(struct device *dev,
        dma_addr_t dma_addr)
 {
-       unsigned long addr = plat_dma_addr_to_phys(dev, dma_addr);
-
-       return (unsigned long)phys_to_virt(addr);
+       return pfn_to_page(
+               plat_dma_addr_to_phys(dev, dma_addr) >> PAGE_SHIFT);
 }
 
 /*
@@ -148,20 +148,20 @@ static void mips_dma_free_coherent(struct device *dev, size_t size, void *vaddr,
        free_pages(addr, get_order(size));
 }
 
-static inline void __dma_sync(unsigned long addr, size_t size,
+static inline void __dma_sync_virtual(void *addr, size_t size,
        enum dma_data_direction direction)
 {
        switch (direction) {
        case DMA_TO_DEVICE:
-               dma_cache_wback(addr, size);
+               dma_cache_wback((unsigned long)addr, size);
                break;
 
        case DMA_FROM_DEVICE:
-               dma_cache_inv(addr, size);
+               dma_cache_inv((unsigned long)addr, size);
                break;
 
        case DMA_BIDIRECTIONAL:
-               dma_cache_wback_inv(addr, size);
+               dma_cache_wback_inv((unsigned long)addr, size);
                break;
 
        default:
@@ -169,12 +169,49 @@ static inline void __dma_sync(unsigned long addr, size_t size,
        }
 }
 
+/*
+ * A single sg entry may refer to multiple physically contiguous
+ * pages. But we still need to process highmem pages individually.
+ * If highmem is not configured then the bulk of this loop gets
+ * optimized out.
+ */
+static inline void __dma_sync(struct page *page,
+       unsigned long offset, size_t size, enum dma_data_direction direction)
+{
+       size_t left = size;
+
+       do {
+               size_t len = left;
+
+               if (PageHighMem(page)) {
+                       void *addr;
+
+                       if (offset + len > PAGE_SIZE) {
+                               if (offset >= PAGE_SIZE) {
+                                       page += offset >> PAGE_SHIFT;
+                                       offset &= ~PAGE_MASK;
+                               }
+                               len = PAGE_SIZE - offset;
+                       }
+
+                       addr = kmap_atomic(page);
+                       __dma_sync_virtual(addr + offset, len, direction);
+                       kunmap_atomic(addr);
+               } else
+                       __dma_sync_virtual(page_address(page) + offset,
+                                          size, direction);
+               offset = 0;
+               page++;
+               left -= len;
+       } while (left);
+}
+
 static void mips_dma_unmap_page(struct device *dev, dma_addr_t dma_addr,
        size_t size, enum dma_data_direction direction, struct dma_attrs *attrs)
 {
        if (cpu_is_noncoherent_r10000(dev))
-               __dma_sync(dma_addr_to_virt(dev, dma_addr), size,
-                          direction);
+               __dma_sync(dma_addr_to_page(dev, dma_addr),
+                          dma_addr & ~PAGE_MASK, size, direction);
 
        plat_unmap_dma_mem(dev, dma_addr, size, direction);
 }
@@ -185,13 +222,11 @@ static int mips_dma_map_sg(struct device *dev, struct scatterlist *sg,
        int i;
 
        for (i = 0; i < nents; i++, sg++) {
-               unsigned long addr;
-
-               addr = (unsigned long) sg_virt(sg);
-               if (!plat_device_is_coherent(dev) && addr)
-                       __dma_sync(addr, sg->length, direction);
-               sg->dma_address = plat_map_dma_mem(dev,
-                                                  (void *)addr, sg->length);
+               if (!plat_device_is_coherent(dev))
+                       __dma_sync(sg_page(sg), sg->offset, sg->length,
+                                  direction);
+               sg->dma_address = plat_map_dma_mem_page(dev, sg_page(sg)) +
+                                 sg->offset;
        }
 
        return nents;
@@ -201,30 +236,23 @@ static dma_addr_t mips_dma_map_page(struct device *dev, struct page *page,
        unsigned long offset, size_t size, enum dma_data_direction direction,
        struct dma_attrs *attrs)
 {
-       unsigned long addr;
-
-       addr = (unsigned long) page_address(page) + offset;
-
        if (!plat_device_is_coherent(dev))
-               __dma_sync(addr, size, direction);
+               __dma_sync(page, offset, size, direction);
 
-       return plat_map_dma_mem(dev, (void *)addr, size);
+       return plat_map_dma_mem_page(dev, page) + offset;
 }
 
 static void mips_dma_unmap_sg(struct device *dev, struct scatterlist *sg,
        int nhwentries, enum dma_data_direction direction,
        struct dma_attrs *attrs)
 {
-       unsigned long addr;
        int i;
 
        for (i = 0; i < nhwentries; i++, sg++) {
                if (!plat_device_is_coherent(dev) &&
-                   direction != DMA_TO_DEVICE) {
-                       addr = (unsigned long) sg_virt(sg);
-                       if (addr)
-                               __dma_sync(addr, sg->length, direction);
-               }
+                   direction != DMA_TO_DEVICE)
+                       __dma_sync(sg_page(sg), sg->offset, sg->length,
+                                  direction);
                plat_unmap_dma_mem(dev, sg->dma_address, sg->length, direction);
        }
 }
@@ -232,24 +260,18 @@ static void mips_dma_unmap_sg(struct device *dev, struct scatterlist *sg,
 static void mips_dma_sync_single_for_cpu(struct device *dev,
        dma_addr_t dma_handle, size_t size, enum dma_data_direction direction)
 {
-       if (cpu_is_noncoherent_r10000(dev)) {
-               unsigned long addr;
-
-               addr = dma_addr_to_virt(dev, dma_handle);
-               __dma_sync(addr, size, direction);
-       }
+       if (cpu_is_noncoherent_r10000(dev))
+               __dma_sync(dma_addr_to_page(dev, dma_handle),
+                          dma_handle & ~PAGE_MASK, size, direction);
 }
 
 static void mips_dma_sync_single_for_device(struct device *dev,
        dma_addr_t dma_handle, size_t size, enum dma_data_direction direction)
 {
        plat_extra_sync_for_device(dev);
-       if (!plat_device_is_coherent(dev)) {
-               unsigned long addr;
-
-               addr = dma_addr_to_virt(dev, dma_handle);
-               __dma_sync(addr, size, direction);
-       }
+       if (!plat_device_is_coherent(dev))
+               __dma_sync(dma_addr_to_page(dev, dma_handle),
+                          dma_handle & ~PAGE_MASK, size, direction);
 }
 
 static void mips_dma_sync_sg_for_cpu(struct device *dev,
@@ -260,8 +282,8 @@ static void mips_dma_sync_sg_for_cpu(struct device *dev,
        /* Make sure that gcc doesn't leave the empty loop body.  */
        for (i = 0; i < nelems; i++, sg++) {
                if (cpu_is_noncoherent_r10000(dev))
-                       __dma_sync((unsigned long)page_address(sg_page(sg)),
-                                  sg->length, direction);
+                       __dma_sync(sg_page(sg), sg->offset, sg->length,
+                                  direction);
        }
 }
 
@@ -273,8 +295,8 @@ static void mips_dma_sync_sg_for_device(struct device *dev,
        /* Make sure that gcc doesn't leave the empty loop body.  */
        for (i = 0; i < nelems; i++, sg++) {
                if (!plat_device_is_coherent(dev))
-                       __dma_sync((unsigned long)page_address(sg_page(sg)),
-                                  sg->length, direction);
+                       __dma_sync(sg_page(sg), sg->offset, sg->length,
+                                  direction);
        }
 }
 
@@ -295,7 +317,7 @@ void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
 
        plat_extra_sync_for_device(dev);
        if (!plat_device_is_coherent(dev))
-               __dma_sync((unsigned long)vaddr, size, direction);
+               __dma_sync_virtual(vaddr, size, direction);
 }
 
 EXPORT_SYMBOL(dma_cache_sync);
index 1aadeb42c5a59ebd3f696478f29252e77adeea42..b7ebc4fa89bcd5b4b77465ab60919317b513bf79 100644 (file)
@@ -277,11 +277,11 @@ void __init fixrange_init(unsigned long start, unsigned long end,
        k = __pmd_offset(vaddr);
        pgd = pgd_base + i;
 
-       for ( ; (i < PTRS_PER_PGD) && (vaddr != end); pgd++, i++) {
+       for ( ; (i < PTRS_PER_PGD) && (vaddr < end); pgd++, i++) {
                pud = (pud_t *)pgd;
-               for ( ; (j < PTRS_PER_PUD) && (vaddr != end); pud++, j++) {
+               for ( ; (j < PTRS_PER_PUD) && (vaddr < end); pud++, j++) {
                        pmd = (pmd_t *)pud;
-                       for (; (k < PTRS_PER_PMD) && (vaddr != end); pmd++, k++) {
+                       for (; (k < PTRS_PER_PMD) && (vaddr < end); pmd++, k++) {
                                if (pmd_none(*pmd)) {
                                        pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
                                        set_pmd(pmd, __pmd((unsigned long)pte));
@@ -368,7 +368,7 @@ void __init mem_init(void)
 #ifdef CONFIG_DISCONTIGMEM
 #error "CONFIG_HIGHMEM and CONFIG_DISCONTIGMEM dont work together yet"
 #endif
-       max_mapnr = highend_pfn;
+       max_mapnr = highend_pfn ? highend_pfn : max_low_pfn;
 #else
        max_mapnr = max_low_pfn;
 #endif
index ae3c20a9556e92e5e1ce6db4c9b4dd1e0095a303..9ff5d0fac556569eb53d6dc85e16925f1b04cb62 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/mm.h>
 #include <linux/mman.h>
 #include <linux/module.h>
+#include <linux/personality.h>
 #include <linux/random.h>
 #include <linux/sched.h>
 
@@ -17,21 +18,65 @@ unsigned long shm_align_mask = PAGE_SIZE - 1;       /* Sane caches */
 
 EXPORT_SYMBOL(shm_align_mask);
 
+/* gap between mmap and stack */
+#define MIN_GAP (128*1024*1024UL)
+#define MAX_GAP        ((TASK_SIZE)/6*5)
+
+static int mmap_is_legacy(void)
+{
+       if (current->personality & ADDR_COMPAT_LAYOUT)
+               return 1;
+
+       if (rlimit(RLIMIT_STACK) == RLIM_INFINITY)
+               return 1;
+
+       return sysctl_legacy_va_layout;
+}
+
+static unsigned long mmap_base(unsigned long rnd)
+{
+       unsigned long gap = rlimit(RLIMIT_STACK);
+
+       if (gap < MIN_GAP)
+               gap = MIN_GAP;
+       else if (gap > MAX_GAP)
+               gap = MAX_GAP;
+
+       return PAGE_ALIGN(TASK_SIZE - gap - rnd);
+}
+
+static inline unsigned long COLOUR_ALIGN_DOWN(unsigned long addr,
+                                             unsigned long pgoff)
+{
+       unsigned long base = addr & ~shm_align_mask;
+       unsigned long off = (pgoff << PAGE_SHIFT) & shm_align_mask;
+
+       if (base + off <= addr)
+               return base + off;
+
+       return base - off;
+}
+
 #define COLOUR_ALIGN(addr,pgoff)                               \
        ((((addr) + shm_align_mask) & ~shm_align_mask) +        \
         (((pgoff) << PAGE_SHIFT) & shm_align_mask))
 
-unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
-       unsigned long len, unsigned long pgoff, unsigned long flags)
+enum mmap_allocation_direction {UP, DOWN};
+
+static unsigned long arch_get_unmapped_area_foo(struct file *filp,
+       unsigned long addr0, unsigned long len, unsigned long pgoff,
+       unsigned long flags, enum mmap_allocation_direction dir)
 {
-       struct vm_area_struct * vmm;
+       struct mm_struct *mm = current->mm;
+       struct vm_area_struct *vma;
+       unsigned long addr = addr0;
        int do_color_align;
 
-       if (len > TASK_SIZE)
+       if (unlikely(len > TASK_SIZE))
                return -ENOMEM;
 
        if (flags & MAP_FIXED) {
-               /* Even MAP_FIXED mappings must reside within TASK_SIZE */
+               /* Even MAP_FIXED mappings must reside within TASK_SIZE */
                if (TASK_SIZE - len < addr)
                        return -EINVAL;
 
@@ -48,34 +93,130 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
        do_color_align = 0;
        if (filp || (flags & MAP_SHARED))
                do_color_align = 1;
+
+       /* requesting a specific address */
        if (addr) {
                if (do_color_align)
                        addr = COLOUR_ALIGN(addr, pgoff);
                else
                        addr = PAGE_ALIGN(addr);
-               vmm = find_vma(current->mm, addr);
+
+               vma = find_vma(mm, addr);
                if (TASK_SIZE - len >= addr &&
-                   (!vmm || addr + len <= vmm->vm_start))
+                  (!vma || addr + len <= vma->vm_start))
                        return addr;
        }
-       addr = current->mm->mmap_base;
-       if (do_color_align)
-               addr = COLOUR_ALIGN(addr, pgoff);
-       else
-               addr = PAGE_ALIGN(addr);
 
-       for (vmm = find_vma(current->mm, addr); ; vmm = vmm->vm_next) {
-               /* At this point:  (!vmm || addr < vmm->vm_end). */
-               if (TASK_SIZE - len < addr)
-                       return -ENOMEM;
-               if (!vmm || addr + len <= vmm->vm_start)
-                       return addr;
-               addr = vmm->vm_end;
+       if (dir == UP) {
+               addr = mm->mmap_base;
+                       if (do_color_align)
+                               addr = COLOUR_ALIGN(addr, pgoff);
+                       else
+                               addr = PAGE_ALIGN(addr);
+
+               for (vma = find_vma(current->mm, addr); ; vma = vma->vm_next) {
+                       /* At this point:  (!vma || addr < vma->vm_end). */
+                       if (TASK_SIZE - len < addr)
+                               return -ENOMEM;
+                       if (!vma || addr + len <= vma->vm_start)
+                               return addr;
+                       addr = vma->vm_end;
+                       if (do_color_align)
+                               addr = COLOUR_ALIGN(addr, pgoff);
+                }
+        } else {
+               /* check if free_area_cache is useful for us */
+               if (len <= mm->cached_hole_size) {
+                       mm->cached_hole_size = 0;
+                       mm->free_area_cache = mm->mmap_base;
+               }
+
+               /* either no address requested or can't fit in requested address hole */
+               addr = mm->free_area_cache;
+                       if (do_color_align) {
+                               unsigned long base =
+                                       COLOUR_ALIGN_DOWN(addr - len, pgoff);
+
+                       addr = base + len;
+                }
+
+               /* make sure it can fit in the remaining address space */
+               if (likely(addr > len)) {
+                       vma = find_vma(mm, addr - len);
+                       if (!vma || addr <= vma->vm_start) {
+                               /* remember the address as a hint for next time */
+                               return mm->free_area_cache = addr-len;
+                       }
+               }
+
+               if (unlikely(mm->mmap_base < len))
+                       goto bottomup;
+
+               addr = mm->mmap_base-len;
                if (do_color_align)
-                       addr = COLOUR_ALIGN(addr, pgoff);
+                       addr = COLOUR_ALIGN_DOWN(addr, pgoff);
+
+               do {
+                       /*
+                        * Lookup failure means no vma is above this address,
+                        * else if new region fits below vma->vm_start,
+                        * return with success:
+                        */
+                       vma = find_vma(mm, addr);
+                       if (likely(!vma || addr+len <= vma->vm_start)) {
+                               /* remember the address as a hint for next time */
+                               return mm->free_area_cache = addr;
+                       }
+
+                       /* remember the largest hole we saw so far */
+                       if (addr + mm->cached_hole_size < vma->vm_start)
+                               mm->cached_hole_size = vma->vm_start - addr;
+
+                       /* try just below the current vma->vm_start */
+                       addr = vma->vm_start-len;
+                       if (do_color_align)
+                               addr = COLOUR_ALIGN_DOWN(addr, pgoff);
+               } while (likely(len < vma->vm_start));
+
+bottomup:
+               /*
+                * A failed mmap() very likely causes application failure,
+                * so fall back to the bottom-up function here. This scenario
+                * can happen with large stack limits and large mmap()
+                * allocations.
+                */
+               mm->cached_hole_size = ~0UL;
+               mm->free_area_cache = TASK_UNMAPPED_BASE;
+               addr = arch_get_unmapped_area(filp, addr0, len, pgoff, flags);
+               /*
+                * Restore the topdown base:
+                */
+               mm->free_area_cache = mm->mmap_base;
+               mm->cached_hole_size = ~0UL;
+
+               return addr;
        }
 }
 
+unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr0,
+       unsigned long len, unsigned long pgoff, unsigned long flags)
+{
+       return arch_get_unmapped_area_foo(filp,
+                       addr0, len, pgoff, flags, UP);
+}
+
+/*
+ * There is no need to export this but sched.h declares the function as
+ * extern so making it static here results in an error.
+ */
+unsigned long arch_get_unmapped_area_topdown(struct file *filp,
+       unsigned long addr0, unsigned long len, unsigned long pgoff,
+       unsigned long flags)
+{
+       return arch_get_unmapped_area_foo(filp,
+                       addr0, len, pgoff, flags, DOWN);
+}
+
 void arch_pick_mmap_layout(struct mm_struct *mm)
 {
        unsigned long random_factor = 0UL;
@@ -89,9 +230,15 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
                        random_factor &= 0xffffffful;
        }
 
-       mm->mmap_base = TASK_UNMAPPED_BASE + random_factor;
-       mm->get_unmapped_area = arch_get_unmapped_area;
-       mm->unmap_area = arch_unmap_area;
+       if (mmap_is_legacy()) {
+               mm->mmap_base = TASK_UNMAPPED_BASE + random_factor;
+               mm->get_unmapped_area = arch_get_unmapped_area;
+               mm->unmap_area = arch_unmap_area;
+       } else {
+               mm->mmap_base = mmap_base(random_factor);
+               mm->get_unmapped_area = arch_get_unmapped_area_topdown;
+               mm->unmap_area = arch_unmap_area_topdown;
+       }
 }
 
 static inline unsigned long brk_rnd(void)
index 575e4019227b0916d649b108165f2d05812660a5..adc6911ba748915bda5b2575fc03b76891f1fb21 100644 (file)
@@ -52,7 +52,7 @@ void __init pagetable_init(void)
         * Fixed mappings:
         */
        vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
-       fixrange_init(vaddr, 0, pgd_base);
+       fixrange_init(vaddr, vaddr + FIXADDR_SIZE, pgd_base);
 
 #ifdef CONFIG_HIGHMEM
        /*
index 78eaa4f0b0eccd4980ad1fa692343e76e50e63e3..cda4e300eb0a8c2edb6eb205debd06810e4fff9d 100644 (file)
@@ -76,5 +76,5 @@ void __init pagetable_init(void)
         * Fixed mappings:
         */
        vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
-       fixrange_init(vaddr, 0, pgd_base);
+       fixrange_init(vaddr, vaddr + FIXADDR_SIZE, pgd_base);
 }
index 424ed4b92e6d9435107a96f260329b3a40ac2992..b6e1cff5066704de206ed92febcb6e8bb7da49b3 100644 (file)
 extern void tlb_do_page_fault_0(void);
 extern void tlb_do_page_fault_1(void);
 
+struct work_registers {
+       int r1;
+       int r2;
+       int r3;
+};
+
+struct tlb_reg_save {
+       unsigned long a;
+       unsigned long b;
+} ____cacheline_aligned_in_smp;
+
+static struct tlb_reg_save handler_reg_save[NR_CPUS];
 
 static inline int r45k_bvahwbug(void)
 {
@@ -248,6 +260,73 @@ static int scratch_reg __cpuinitdata;
 static int pgd_reg __cpuinitdata;
 enum vmalloc64_mode {not_refill, refill_scratch, refill_noscratch};
 
+static struct work_registers __cpuinit build_get_work_registers(u32 **p)
+{
+       struct work_registers r;
+
+       int smp_processor_id_reg;
+       int smp_processor_id_sel;
+       int smp_processor_id_shift;
+
+       if (scratch_reg > 0) {
+               /* Save in CPU local C0_KScratch? */
+               UASM_i_MTC0(p, 1, 31, scratch_reg);
+               r.r1 = K0;
+               r.r2 = K1;
+               r.r3 = 1;
+               return r;
+       }
+
+       if (num_possible_cpus() > 1) {
+#ifdef CONFIG_MIPS_PGD_C0_CONTEXT
+               smp_processor_id_shift = 51;
+               smp_processor_id_reg = 20; /* XContext */
+               smp_processor_id_sel = 0;
+#else
+# ifdef CONFIG_32BIT
+               smp_processor_id_shift = 25;
+               smp_processor_id_reg = 4; /* Context */
+               smp_processor_id_sel = 0;
+# endif
+# ifdef CONFIG_64BIT
+               smp_processor_id_shift = 26;
+               smp_processor_id_reg = 4; /* Context */
+               smp_processor_id_sel = 0;
+# endif
+#endif
+               /* Get smp_processor_id */
+               UASM_i_MFC0(p, K0, smp_processor_id_reg, smp_processor_id_sel);
+               UASM_i_SRL_SAFE(p, K0, K0, smp_processor_id_shift);
+
+               /* handler_reg_save index in K0 */
+               UASM_i_SLL(p, K0, K0, ilog2(sizeof(struct tlb_reg_save)));
+
+               UASM_i_LA(p, K1, (long)&handler_reg_save);
+               UASM_i_ADDU(p, K0, K0, K1);
+       } else {
+               UASM_i_LA(p, K0, (long)&handler_reg_save);
+       }
+       /* K0 now points to save area, save $1 and $2  */
+       UASM_i_SW(p, 1, offsetof(struct tlb_reg_save, a), K0);
+       UASM_i_SW(p, 2, offsetof(struct tlb_reg_save, b), K0);
+
+       r.r1 = K1;
+       r.r2 = 1;
+       r.r3 = 2;
+       return r;
+}
+
+static void __cpuinit build_restore_work_registers(u32 **p)
+{
+       if (scratch_reg > 0) {
+               UASM_i_MFC0(p, 1, 31, scratch_reg);
+               return;
+       }
+       /* K0 already points to save area, restore $1 and $2  */
+       UASM_i_LW(p, 1, offsetof(struct tlb_reg_save, a), K0);
+       UASM_i_LW(p, 2, offsetof(struct tlb_reg_save, b), K0);
+}
+
 #ifndef CONFIG_MIPS_PGD_C0_CONTEXT
 
 /*
@@ -1160,9 +1239,6 @@ static void __cpuinit build_r4000_tlb_refill_handler(void)
        memset(relocs, 0, sizeof(relocs));
        memset(final_handler, 0, sizeof(final_handler));
 
-       if (scratch_reg == 0)
-               scratch_reg = allocate_kscratch();
-
        if ((scratch_reg > 0 || scratchpad_available()) && use_bbit_insns()) {
                htlb_info = build_fast_tlb_refill_handler(&p, &l, &r, K0, K1,
                                                          scratch_reg);
@@ -1462,22 +1538,28 @@ iPTE_SW(u32 **p, struct uasm_reloc **r, unsigned int pte, unsigned int ptr,
  */
 static void __cpuinit
 build_pte_present(u32 **p, struct uasm_reloc **r,
-                 unsigned int pte, unsigned int ptr, enum label_id lid)
+                 int pte, int ptr, int scratch, enum label_id lid)
 {
+       int t = scratch >= 0 ? scratch : pte;
+
        if (kernel_uses_smartmips_rixi) {
                if (use_bbit_insns()) {
                        uasm_il_bbit0(p, r, pte, ilog2(_PAGE_PRESENT), lid);
                        uasm_i_nop(p);
                } else {
-                       uasm_i_andi(p, pte, pte, _PAGE_PRESENT);
-                       uasm_il_beqz(p, r, pte, lid);
-                       iPTE_LW(p, pte, ptr);
+                       uasm_i_andi(p, t, pte, _PAGE_PRESENT);
+                       uasm_il_beqz(p, r, t, lid);
+                       if (pte == t)
+                               /* You lose the SMP race :-(*/
+                               iPTE_LW(p, pte, ptr);
                }
        } else {
-               uasm_i_andi(p, pte, pte, _PAGE_PRESENT | _PAGE_READ);
-               uasm_i_xori(p, pte, pte, _PAGE_PRESENT | _PAGE_READ);
-               uasm_il_bnez(p, r, pte, lid);
-               iPTE_LW(p, pte, ptr);
+               uasm_i_andi(p, t, pte, _PAGE_PRESENT | _PAGE_READ);
+               uasm_i_xori(p, t, t, _PAGE_PRESENT | _PAGE_READ);
+               uasm_il_bnez(p, r, t, lid);
+               if (pte == t)
+                       /* You lose the SMP race :-(*/
+                       iPTE_LW(p, pte, ptr);
        }
 }
 
@@ -1497,19 +1579,19 @@ build_make_valid(u32 **p, struct uasm_reloc **r, unsigned int pte,
  */
 static void __cpuinit
 build_pte_writable(u32 **p, struct uasm_reloc **r,
-                  unsigned int pte, unsigned int ptr, enum label_id lid)
+                  unsigned int pte, unsigned int ptr, int scratch,
+                  enum label_id lid)
 {
-       if (use_bbit_insns()) {
-               uasm_il_bbit0(p, r, pte, ilog2(_PAGE_PRESENT), lid);
-               uasm_i_nop(p);
-               uasm_il_bbit0(p, r, pte, ilog2(_PAGE_WRITE), lid);
-               uasm_i_nop(p);
-       } else {
-               uasm_i_andi(p, pte, pte, _PAGE_PRESENT | _PAGE_WRITE);
-               uasm_i_xori(p, pte, pte, _PAGE_PRESENT | _PAGE_WRITE);
-               uasm_il_bnez(p, r, pte, lid);
+       int t = scratch >= 0 ? scratch : pte;
+
+       uasm_i_andi(p, t, pte, _PAGE_PRESENT | _PAGE_WRITE);
+       uasm_i_xori(p, t, t, _PAGE_PRESENT | _PAGE_WRITE);
+       uasm_il_bnez(p, r, t, lid);
+       if (pte == t)
+               /* You lose the SMP race :-(*/
                iPTE_LW(p, pte, ptr);
-       }
+       else
+               uasm_i_nop(p);
 }
 
 /* Make PTE writable, update software status bits as well, then store
@@ -1531,15 +1613,19 @@ build_make_write(u32 **p, struct uasm_reloc **r, unsigned int pte,
  */
 static void __cpuinit
 build_pte_modifiable(u32 **p, struct uasm_reloc **r,
-                    unsigned int pte, unsigned int ptr, enum label_id lid)
+                    unsigned int pte, unsigned int ptr, int scratch,
+                    enum label_id lid)
 {
        if (use_bbit_insns()) {
                uasm_il_bbit0(p, r, pte, ilog2(_PAGE_WRITE), lid);
                uasm_i_nop(p);
        } else {
-               uasm_i_andi(p, pte, pte, _PAGE_WRITE);
-               uasm_il_beqz(p, r, pte, lid);
-               iPTE_LW(p, pte, ptr);
+               int t = scratch >= 0 ? scratch : pte;
+               uasm_i_andi(p, t, pte, _PAGE_WRITE);
+               uasm_il_beqz(p, r, t, lid);
+               if (pte == t)
+                       /* You lose the SMP race :-(*/
+                       iPTE_LW(p, pte, ptr);
        }
 }
 
@@ -1619,7 +1705,7 @@ static void __cpuinit build_r3000_tlb_load_handler(void)
        memset(relocs, 0, sizeof(relocs));
 
        build_r3000_tlbchange_handler_head(&p, K0, K1);
-       build_pte_present(&p, &r, K0, K1, label_nopage_tlbl);
+       build_pte_present(&p, &r, K0, K1, -1, label_nopage_tlbl);
        uasm_i_nop(&p); /* load delay */
        build_make_valid(&p, &r, K0, K1);
        build_r3000_tlb_reload_write(&p, &l, &r, K0, K1);
@@ -1649,7 +1735,7 @@ static void __cpuinit build_r3000_tlb_store_handler(void)
        memset(relocs, 0, sizeof(relocs));
 
        build_r3000_tlbchange_handler_head(&p, K0, K1);
-       build_pte_writable(&p, &r, K0, K1, label_nopage_tlbs);
+       build_pte_writable(&p, &r, K0, K1, -1, label_nopage_tlbs);
        uasm_i_nop(&p); /* load delay */
        build_make_write(&p, &r, K0, K1);
        build_r3000_tlb_reload_write(&p, &l, &r, K0, K1);
@@ -1673,13 +1759,14 @@ static void __cpuinit build_r3000_tlb_modify_handler(void)
        u32 *p = handle_tlbm;
        struct uasm_label *l = labels;
        struct uasm_reloc *r = relocs;
+       struct work_registers wr;
 
        memset(handle_tlbm, 0, sizeof(handle_tlbm));
        memset(labels, 0, sizeof(labels));
        memset(relocs, 0, sizeof(relocs));
 
        build_r3000_tlbchange_handler_head(&p, K0, K1);
-       build_pte_modifiable(&p, &r, K0, K1, label_nopage_tlbm);
+       build_pte_modifiable(&p, &r, wr.r1, wr.r2,  wr.r3, label_nopage_tlbm);
        uasm_i_nop(&p); /* load delay */
        build_make_write(&p, &r, K0, K1);
        build_r3000_pte_reload_tlbwi(&p, K0, K1);
@@ -1702,15 +1789,16 @@ static void __cpuinit build_r3000_tlb_modify_handler(void)
 /*
  * R4000 style TLB load/store/modify handlers.
  */
-static void __cpuinit
+static struct work_registers __cpuinit
 build_r4000_tlbchange_handler_head(u32 **p, struct uasm_label **l,
-                                  struct uasm_reloc **r, unsigned int pte,
-                                  unsigned int ptr)
+                                  struct uasm_reloc **r)
 {
+       struct work_registers wr = build_get_work_registers(p);
+
 #ifdef CONFIG_64BIT
-       build_get_pmde64(p, l, r, pte, ptr); /* get pmd in ptr */
+       build_get_pmde64(p, l, r, wr.r1, wr.r2); /* get pmd in ptr */
 #else
-       build_get_pgde32(p, pte, ptr); /* get pgd in ptr */
+       build_get_pgde32(p, wr.r1, wr.r2); /* get pgd in ptr */
 #endif
 
 #ifdef CONFIG_HUGETLB_PAGE
@@ -1719,21 +1807,22 @@ build_r4000_tlbchange_handler_head(u32 **p, struct uasm_label **l,
         * instead contains the tlb pte. Check the PAGE_HUGE bit and
         * see if we need to jump to huge tlb processing.
         */
-       build_is_huge_pte(p, r, pte, ptr, label_tlb_huge_update);
+       build_is_huge_pte(p, r, wr.r1, wr.r2, label_tlb_huge_update);
 #endif
 
-       UASM_i_MFC0(p, pte, C0_BADVADDR);
-       UASM_i_LW(p, ptr, 0, ptr);
-       UASM_i_SRL(p, pte, pte, PAGE_SHIFT + PTE_ORDER - PTE_T_LOG2);
-       uasm_i_andi(p, pte, pte, (PTRS_PER_PTE - 1) << PTE_T_LOG2);
-       UASM_i_ADDU(p, ptr, ptr, pte);
+       UASM_i_MFC0(p, wr.r1, C0_BADVADDR);
+       UASM_i_LW(p, wr.r2, 0, wr.r2);
+       UASM_i_SRL(p, wr.r1, wr.r1, PAGE_SHIFT + PTE_ORDER - PTE_T_LOG2);
+       uasm_i_andi(p, wr.r1, wr.r1, (PTRS_PER_PTE - 1) << PTE_T_LOG2);
+       UASM_i_ADDU(p, wr.r2, wr.r2, wr.r1);
 
 #ifdef CONFIG_SMP
        uasm_l_smp_pgtable_change(l, *p);
 #endif
-       iPTE_LW(p, pte, ptr); /* get even pte */
+       iPTE_LW(p, wr.r1, wr.r2); /* get even pte */
        if (!m4kc_tlbp_war())
                build_tlb_probe_entry(p);
+       return wr;
 }
 
 static void __cpuinit
@@ -1746,6 +1835,7 @@ build_r4000_tlbchange_handler_tail(u32 **p, struct uasm_label **l,
        build_update_entries(p, tmp, ptr);
        build_tlb_write_entry(p, l, r, tlb_indexed);
        uasm_l_leave(l, *p);
+       build_restore_work_registers(p);
        uasm_i_eret(p); /* return from trap */
 
 #ifdef CONFIG_64BIT
@@ -1758,6 +1848,7 @@ static void __cpuinit build_r4000_tlb_load_handler(void)
        u32 *p = handle_tlbl;
        struct uasm_label *l = labels;
        struct uasm_reloc *r = relocs;
+       struct work_registers wr;
 
        memset(handle_tlbl, 0, sizeof(handle_tlbl));
        memset(labels, 0, sizeof(labels));
@@ -1777,8 +1868,8 @@ static void __cpuinit build_r4000_tlb_load_handler(void)
                /* No need for uasm_i_nop */
        }
 
-       build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1);
-       build_pte_present(&p, &r, K0, K1, label_nopage_tlbl);
+       wr = build_r4000_tlbchange_handler_head(&p, &l, &r);
+       build_pte_present(&p, &r, wr.r1, wr.r2, wr.r3, label_nopage_tlbl);
        if (m4kc_tlbp_war())
                build_tlb_probe_entry(&p);
 
@@ -1788,44 +1879,43 @@ static void __cpuinit build_r4000_tlb_load_handler(void)
                 * have triggered it.  Skip the expensive test..
                 */
                if (use_bbit_insns()) {
-                       uasm_il_bbit0(&p, &r, K0, ilog2(_PAGE_VALID),
+                       uasm_il_bbit0(&p, &r, wr.r1, ilog2(_PAGE_VALID),
                                      label_tlbl_goaround1);
                } else {
-                       uasm_i_andi(&p, K0, K0, _PAGE_VALID);
-                       uasm_il_beqz(&p, &r, K0, label_tlbl_goaround1);
+                       uasm_i_andi(&p, wr.r3, wr.r1, _PAGE_VALID);
+                       uasm_il_beqz(&p, &r, wr.r3, label_tlbl_goaround1);
                }
                uasm_i_nop(&p);
 
                uasm_i_tlbr(&p);
                /* Examine  entrylo 0 or 1 based on ptr. */
                if (use_bbit_insns()) {
-                       uasm_i_bbit0(&p, K1, ilog2(sizeof(pte_t)), 8);
+                       uasm_i_bbit0(&p, wr.r2, ilog2(sizeof(pte_t)), 8);
                } else {
-                       uasm_i_andi(&p, K0, K1, sizeof(pte_t));
-                       uasm_i_beqz(&p, K0, 8);
+                       uasm_i_andi(&p, wr.r3, wr.r2, sizeof(pte_t));
+                       uasm_i_beqz(&p, wr.r3, 8);
                }
-
-               UASM_i_MFC0(&p, K0, C0_ENTRYLO0); /* load it in the delay slot*/
-               UASM_i_MFC0(&p, K0, C0_ENTRYLO1); /* load it if ptr is odd */
+               /* load it in the delay slot*/
+               UASM_i_MFC0(&p, wr.r3, C0_ENTRYLO0);
+               /* load it if ptr is odd */
+               UASM_i_MFC0(&p, wr.r3, C0_ENTRYLO1);
                /*
-                * If the entryLo (now in K0) is valid (bit 1), RI or
+                * If the entryLo (now in wr.r3) is valid (bit 1), RI or
                 * XI must have triggered it.
                 */
                if (use_bbit_insns()) {
-                       uasm_il_bbit1(&p, &r, K0, 1, label_nopage_tlbl);
-                       /* Reload the PTE value */
-                       iPTE_LW(&p, K0, K1);
+                       uasm_il_bbit1(&p, &r, wr.r3, 1, label_nopage_tlbl);
+                       uasm_i_nop(&p);
                        uasm_l_tlbl_goaround1(&l, p);
                } else {
-                       uasm_i_andi(&p, K0, K0, 2);
-                       uasm_il_bnez(&p, &r, K0, label_nopage_tlbl);
-                       uasm_l_tlbl_goaround1(&l, p);
-                       /* Reload the PTE value */
-                       iPTE_LW(&p, K0, K1);
+                       uasm_i_andi(&p, wr.r3, wr.r3, 2);
+                       uasm_il_bnez(&p, &r, wr.r3, label_nopage_tlbl);
+                       uasm_i_nop(&p);
                }
+               uasm_l_tlbl_goaround1(&l, p);
        }
-       build_make_valid(&p, &r, K0, K1);
-       build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1);
+       build_make_valid(&p, &r, wr.r1, wr.r2);
+       build_r4000_tlbchange_handler_tail(&p, &l, &r, wr.r1, wr.r2);
 
 #ifdef CONFIG_HUGETLB_PAGE
        /*
@@ -1833,8 +1923,8 @@ static void __cpuinit build_r4000_tlb_load_handler(void)
         * spots a huge page.
         */
        uasm_l_tlb_huge_update(&l, p);
-       iPTE_LW(&p, K0, K1);
-       build_pte_present(&p, &r, K0, K1, label_nopage_tlbl);
+       iPTE_LW(&p, wr.r1, wr.r2);
+       build_pte_present(&p, &r, wr.r1, wr.r2, wr.r3, label_nopage_tlbl);
        build_tlb_probe_entry(&p);
 
        if (kernel_uses_smartmips_rixi) {
@@ -1843,50 +1933,51 @@ static void __cpuinit build_r4000_tlb_load_handler(void)
                 * have triggered it.  Skip the expensive test..
                 */
                if (use_bbit_insns()) {
-                       uasm_il_bbit0(&p, &r, K0, ilog2(_PAGE_VALID),
+                       uasm_il_bbit0(&p, &r, wr.r1, ilog2(_PAGE_VALID),
                                      label_tlbl_goaround2);
                } else {
-                       uasm_i_andi(&p, K0, K0, _PAGE_VALID);
-                       uasm_il_beqz(&p, &r, K0, label_tlbl_goaround2);
+                       uasm_i_andi(&p, wr.r3, wr.r1, _PAGE_VALID);
+                       uasm_il_beqz(&p, &r, wr.r3, label_tlbl_goaround2);
                }
                uasm_i_nop(&p);
 
                uasm_i_tlbr(&p);
                /* Examine  entrylo 0 or 1 based on ptr. */
                if (use_bbit_insns()) {
-                       uasm_i_bbit0(&p, K1, ilog2(sizeof(pte_t)), 8);
+                       uasm_i_bbit0(&p, wr.r2, ilog2(sizeof(pte_t)), 8);
                } else {
-                       uasm_i_andi(&p, K0, K1, sizeof(pte_t));
-                       uasm_i_beqz(&p, K0, 8);
+                       uasm_i_andi(&p, wr.r3, wr.r2, sizeof(pte_t));
+                       uasm_i_beqz(&p, wr.r3, 8);
                }
-               UASM_i_MFC0(&p, K0, C0_ENTRYLO0); /* load it in the delay slot*/
-               UASM_i_MFC0(&p, K0, C0_ENTRYLO1); /* load it if ptr is odd */
+               /* load it in the delay slot*/
+               UASM_i_MFC0(&p, wr.r3, C0_ENTRYLO0);
+               /* load it if ptr is odd */
+               UASM_i_MFC0(&p, wr.r3, C0_ENTRYLO1);
                /*
-                * If the entryLo (now in K0) is valid (bit 1), RI or
+                * If the entryLo (now in wr.r3) is valid (bit 1), RI or
                 * XI must have triggered it.
                 */
                if (use_bbit_insns()) {
-                       uasm_il_bbit0(&p, &r, K0, 1, label_tlbl_goaround2);
+                       uasm_il_bbit0(&p, &r, wr.r3, 1, label_tlbl_goaround2);
                } else {
-                       uasm_i_andi(&p, K0, K0, 2);
-                       uasm_il_beqz(&p, &r, K0, label_tlbl_goaround2);
+                       uasm_i_andi(&p, wr.r3, wr.r3, 2);
+                       uasm_il_beqz(&p, &r, wr.r3, label_tlbl_goaround2);
                }
-               /* Reload the PTE value */
-               iPTE_LW(&p, K0, K1);
 
                /*
                 * We clobbered C0_PAGEMASK, restore it.  On the other branch
                 * it is restored in build_huge_tlb_write_entry.
                 */
-               build_restore_pagemask(&p, &r, K0, label_nopage_tlbl, 0);
+               build_restore_pagemask(&p, &r, wr.r3, label_nopage_tlbl, 0);
 
                uasm_l_tlbl_goaround2(&l, p);
        }
-       uasm_i_ori(&p, K0, K0, (_PAGE_ACCESSED | _PAGE_VALID));
-       build_huge_handler_tail(&p, &r, &l, K0, K1);
+       uasm_i_ori(&p, wr.r1, wr.r1, (_PAGE_ACCESSED | _PAGE_VALID));
+       build_huge_handler_tail(&p, &r, &l, wr.r1, wr.r2);
 #endif
 
        uasm_l_nopage_tlbl(&l, p);
+       build_restore_work_registers(&p);
        uasm_i_j(&p, (unsigned long)tlb_do_page_fault_0 & 0x0fffffff);
        uasm_i_nop(&p);
 
@@ -1905,17 +1996,18 @@ static void __cpuinit build_r4000_tlb_store_handler(void)
        u32 *p = handle_tlbs;
        struct uasm_label *l = labels;
        struct uasm_reloc *r = relocs;
+       struct work_registers wr;
 
        memset(handle_tlbs, 0, sizeof(handle_tlbs));
        memset(labels, 0, sizeof(labels));
        memset(relocs, 0, sizeof(relocs));
 
-       build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1);
-       build_pte_writable(&p, &r, K0, K1, label_nopage_tlbs);
+       wr = build_r4000_tlbchange_handler_head(&p, &l, &r);
+       build_pte_writable(&p, &r, wr.r1, wr.r2, wr.r3, label_nopage_tlbs);
        if (m4kc_tlbp_war())
                build_tlb_probe_entry(&p);
-       build_make_write(&p, &r, K0, K1);
-       build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1);
+       build_make_write(&p, &r, wr.r1, wr.r2);
+       build_r4000_tlbchange_handler_tail(&p, &l, &r, wr.r1, wr.r2);
 
 #ifdef CONFIG_HUGETLB_PAGE
        /*
@@ -1923,15 +2015,16 @@ static void __cpuinit build_r4000_tlb_store_handler(void)
         * build_r4000_tlbchange_handler_head spots a huge page.
         */
        uasm_l_tlb_huge_update(&l, p);
-       iPTE_LW(&p, K0, K1);
-       build_pte_writable(&p, &r, K0, K1, label_nopage_tlbs);
+       iPTE_LW(&p, wr.r1, wr.r2);
+       build_pte_writable(&p, &r, wr.r1, wr.r2, wr.r3, label_nopage_tlbs);
        build_tlb_probe_entry(&p);
-       uasm_i_ori(&p, K0, K0,
+       uasm_i_ori(&p, wr.r1, wr.r1,
                   _PAGE_ACCESSED | _PAGE_MODIFIED | _PAGE_VALID | _PAGE_DIRTY);
-       build_huge_handler_tail(&p, &r, &l, K0, K1);
+       build_huge_handler_tail(&p, &r, &l, wr.r1, wr.r2);
 #endif
 
        uasm_l_nopage_tlbs(&l, p);
+       build_restore_work_registers(&p);
        uasm_i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff);
        uasm_i_nop(&p);
 
@@ -1950,18 +2043,19 @@ static void __cpuinit build_r4000_tlb_modify_handler(void)
        u32 *p = handle_tlbm;
        struct uasm_label *l = labels;
        struct uasm_reloc *r = relocs;
+       struct work_registers wr;
 
        memset(handle_tlbm, 0, sizeof(handle_tlbm));
        memset(labels, 0, sizeof(labels));
        memset(relocs, 0, sizeof(relocs));
 
-       build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1);
-       build_pte_modifiable(&p, &r, K0, K1, label_nopage_tlbm);
+       wr = build_r4000_tlbchange_handler_head(&p, &l, &r);
+       build_pte_modifiable(&p, &r, wr.r1, wr.r2, wr.r3, label_nopage_tlbm);
        if (m4kc_tlbp_war())
                build_tlb_probe_entry(&p);
        /* Present and writable bits set, set accessed and dirty bits. */
-       build_make_write(&p, &r, K0, K1);
-       build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1);
+       build_make_write(&p, &r, wr.r1, wr.r2);
+       build_r4000_tlbchange_handler_tail(&p, &l, &r, wr.r1, wr.r2);
 
 #ifdef CONFIG_HUGETLB_PAGE
        /*
@@ -1969,15 +2063,16 @@ static void __cpuinit build_r4000_tlb_modify_handler(void)
         * build_r4000_tlbchange_handler_head spots a huge page.
         */
        uasm_l_tlb_huge_update(&l, p);
-       iPTE_LW(&p, K0, K1);
-       build_pte_modifiable(&p, &r, K0, K1, label_nopage_tlbm);
+       iPTE_LW(&p, wr.r1, wr.r2);
+       build_pte_modifiable(&p, &r, wr.r1, wr.r2,  wr.r3, label_nopage_tlbm);
        build_tlb_probe_entry(&p);
-       uasm_i_ori(&p, K0, K0,
+       uasm_i_ori(&p, wr.r1, wr.r1,
                   _PAGE_ACCESSED | _PAGE_MODIFIED | _PAGE_VALID | _PAGE_DIRTY);
-       build_huge_handler_tail(&p, &r, &l, K0, K1);
+       build_huge_handler_tail(&p, &r, &l, wr.r1, wr.r2);
 #endif
 
        uasm_l_nopage_tlbm(&l, p);
+       build_restore_work_registers(&p);
        uasm_i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff);
        uasm_i_nop(&p);
 
@@ -2036,6 +2131,7 @@ void __cpuinit build_tlb_refill_handler(void)
 
        default:
                if (!run_once) {
+                       scratch_reg = allocate_kscratch();
 #ifdef CONFIG_MIPS_PGD_C0_CONTEXT
                        build_r4000_setup_pgd();
 #endif
index 31180c321a1a29b1f7c5d7a2c1b1a5f6188ee0ed..4b988b9a30d51bb373b7b34c8324a1409ec2cfe8 100644 (file)
@@ -28,6 +28,7 @@
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/cacheflush.h>
+#include <asm/smp-ops.h>
 #include <asm/traps.h>
 
 #include <asm/gcmpregs.h>
@@ -358,15 +359,14 @@ void __init prom_init(void)
 #ifdef CONFIG_SERIAL_8250_CONSOLE
        console_config();
 #endif
-#ifdef CONFIG_MIPS_CMP
        /* Early detection of CMP support */
        if (gcmp_probe(GCMP_BASE_ADDR, GCMP_ADDRSPACE_SZ))
-               register_smp_ops(&cmp_smp_ops);
-       else
-#endif
-#ifdef CONFIG_MIPS_MT_SMP
-               register_smp_ops(&vsmp_smp_ops);
-#endif
+               if (!register_cmp_smp_ops())
+                       return;
+
+       if (!register_vsmp_smp_ops())
+               return;
+
 #ifdef CONFIG_MIPS_MT_SMTC
        register_smp_ops(&msmtc_smp_ops);
 #endif
index 49a38b09a4883513a22c7a328488cd306ef7f1ad..1efc8c3944860d29a6861231ad5bcacd5e917a99 100644 (file)
@@ -152,7 +152,7 @@ int plat_set_irq_affinity(struct irq_data *d, const struct cpumask *affinity,
                 * runtime code can anyway deal with the null set
                 */
                printk(KERN_WARNING
-                       "IRQ affinity leaves no legal CPU for IRQ %d\n", irq);
+                      "IRQ affinity leaves no legal CPU for IRQ %d\n", d->irq);
 
        /* Do any generic SMTC IRQ affinity setup */
        smtc_set_irq_affinity(d->irq, tmask);
diff --git a/arch/mips/netlogic/Platform b/arch/mips/netlogic/Platform
new file mode 100644 (file)
index 0000000..f87c164
--- /dev/null
@@ -0,0 +1,11 @@
+#
+# NETLOGIC includes
+#
+cflags-$(CONFIG_NLM_COMMON)  += -I$(srctree)/arch/mips/include/asm/mach-netlogic
+cflags-$(CONFIG_NLM_COMMON)  += -I$(srctree)/arch/mips/include/asm/netlogic
+
+#
+# NETLOGIC XLR/XLS SoC, Simulator and boards
+#
+core-$(CONFIG_NLM_XLR)       += arch/mips/netlogic/xlr/
+load-$(CONFIG_NLM_XLR_BOARD)  += 0xffffffff84000000
index 1446d58e364cc11d3887cd14236a271b7cb02494..521bb7377eb0d4340d3c6f701c170399280eed86 100644 (file)
@@ -209,7 +209,7 @@ void __init init_xlr_irqs(void)
                        irq_set_chip_and_handler(i, &xlr_pic, handle_level_irq);
                else
                        irq_set_chip_and_handler(i, &nlm_cpu_intr,
-                                               handle_level_irq);
+                                               handle_percpu_irq);
        }
 #ifdef CONFIG_SMP
        irq_set_chip_and_handler(IRQ_IPI_SMP_FUNCTION, &nlm_cpu_intr,
index b495a7f1433b5f74054dd80e7b22f0d8dee7263f..d842bce5c9405a2f267bb7f3de5cfda97f8e835e 100644 (file)
@@ -87,17 +87,7 @@ void nlm_smp_function_ipi_handler(unsigned int irq, struct irq_desc *desc)
 /* IRQ_IPI_SMP_RESCHEDULE  handler */
 void nlm_smp_resched_ipi_handler(unsigned int irq, struct irq_desc *desc)
 {
-       set_need_resched();
-}
-
-void nlm_common_ipi_handler(int irq, struct pt_regs *regs)
-{
-       if (irq == IRQ_IPI_SMP_FUNCTION) {
-               smp_call_function_interrupt();
-       } else {
-               /* Announce that we are for reschduling */
-               set_need_resched();
-       }
+       scheduler_ipi();
 }
 
 /*
@@ -122,6 +112,7 @@ void nlm_smp_finish(void)
 #ifdef notyet
        nlm_common_msgring_cpu_init();
 #endif
+       local_irq_enable();
 }
 
 void nlm_cpus_done(void)
index 64246c9c875c51d09e5c3861ca0e6f1096d50ac5..71adac323323916efded6bad4489a7dcc327d102 100644 (file)
@@ -140,6 +140,4 @@ void __init plat_mem_setup(void)
                        PNX8XXX_UART_LCR_8BIT;
                ip3106_baud(UART_BASE, pnx8550_console_port) = 5;
        }
-
-       return;
 }
index b7f0fb0210f4ea691647e5e53494fcbef4a06c5b..99929cf88419a58183b0b39827f8cc10aad762c3 100644 (file)
@@ -4,7 +4,6 @@
 #include <asm/bootinfo.h>
 
 #include <asm/lasat/lasat.h>
-#include <asm/gt64120.h>
 #include <asm/nile4.h>
 
 #define PCI_ACCESS_READ  0
index 2413ea67877ede061a3874008e9604552e337c15..0abfbe04ffc9795213e4109b51c8bdffae252d9d 100644 (file)
@@ -228,13 +228,11 @@ void __init prom_init(void)
         */
        msp_serial_setup();
 
-#ifdef CONFIG_MIPS_MT_SMP
-       register_smp_ops(&vsmp_smp_ops);
-#endif
-
+       if (register_vsmp_smp_ops()) {
 #ifdef CONFIG_MIPS_MT_SMTC
-       register_smp_ops(&msp_smtc_smp_ops);
+               register_smp_ops(&msp_smtc_smp_ops);
 #endif
+       }
 
 #ifdef CONFIG_PMCTWILED
        /*
index 43cb3945fdbfffb8b355789e237a9b27df21abef..fccd6b0c6d3f8de7c61b3795b5e095e36d79bdf0 100644 (file)
@@ -139,6 +139,4 @@ void __init plat_mem_setup(void)
                        PNX8XXX_UART_LCR_8BIT;
                ip3106_baud(UART_BASE, pnx8550_console_port) = 5;
        }
-
-       return;
 }
index 041fc1afc3f4bf20e9ee7def1dd9de4310010f0b..a969eb8266340326c17509cfbba6522498f0d6cd 100644 (file)
@@ -251,28 +251,22 @@ static struct platform_device *rb532_devs[] = {
 
 static void __init parse_mac_addr(char *macstr)
 {
-       int i, j;
-       unsigned char result, value;
+       int i, h, l;
 
        for (i = 0; i < 6; i++) {
-               result = 0;
-
                if (i != 5 && *(macstr + 2) != ':')
                        return;
 
-               for (j = 0; j < 2; j++) {
-                       if (isxdigit(*macstr)
-                           && (value =
-                               isdigit(*macstr) ? *macstr -
-                               '0' : toupper(*macstr) - 'A' + 10) < 16) {
-                               result = result * 16 + value;
-                               macstr++;
-                       } else
-                               return;
-               }
+               h = hex_to_bin(*macstr++);
+               if (h == -1)
+                       return;
+
+               l = hex_to_bin(*macstr++);
+               if (l == -1)
+                       return;
 
                macstr++;
-               korina_dev0_data.mac[i] = result;
+               korina_dev0_data.mac[i] = (h << 4) + l;
        }
 }
 
index bc4fa8dd67f318b4f5f1881d7f353b6ab80b49f8..005c29ed419a2110820d3982824ba40eef4182b3 100644 (file)
@@ -3,7 +3,7 @@
 #include <linux/nodemask.h>
 #include <linux/spinlock.h>
 #include <linux/smp.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/sn/types.h>
 #include <asm/sn/addrs.h>
 #include <asm/sn/nmi.h>
index be4460a5f6a89634aeb589513c91059a773af13d..76ee045e2ce41f920b7e197e79c7edfb02ef3981 100644 (file)
@@ -123,6 +123,13 @@ static int sb1250_set_affinity(struct irq_data *d, const struct cpumask *mask,
 }
 #endif
 
+static void disable_sb1250_irq(struct irq_data *d)
+{
+       unsigned int irq = d->irq;
+
+       sb1250_mask_irq(sb1250_irq_owner[irq], irq);
+}
+
 static void enable_sb1250_irq(struct irq_data *d)
 {
        unsigned int irq = d->irq;
@@ -180,6 +187,7 @@ static struct irq_chip sb1250_irq_type = {
        .name = "SB1250-IMR",
        .irq_mask_ack = ack_sb1250_irq,
        .irq_unmask = enable_sb1250_irq,
+       .irq_mask = disable_sb1250_irq,
 #ifdef CONFIG_SMP
        .irq_set_affinity = sb1250_set_affinity
 #endif
index 9d773a639513abd3a35311a117a563912d52b236..b9a8f8461262b1ce045355ce811d5a9c500b27aa 100644 (file)
@@ -260,16 +260,15 @@ static inline void atomic_dec(atomic_t *v)
 #define atomic_dec_and_test(v)         (atomic_sub_return(1, (v)) == 0)
 #define atomic_inc_and_test(v)         (atomic_add_return(1, (v)) == 0)
 
-#define atomic_add_unless(v, a, u)                             \
+#define __atomic_add_unless(v, a, u)                           \
 ({                                                             \
        int c, old;                                             \
        c = atomic_read(v);                                     \
        while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \
                c = old;                                        \
-       c != (u);                                               \
+       c;                                                      \
 })
 
-#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
 
 /**
  * atomic_clear_mask - Atomically clear bits in memory
@@ -344,8 +343,6 @@ static inline void atomic_set_mask(unsigned long mask, unsigned long *addr)
 #define smp_mb__before_atomic_inc()    barrier()
 #define smp_mb__after_atomic_inc()     barrier()
 
-#include <asm-generic/atomic-long.h>
-
 #endif /* __KERNEL__ */
 #endif /* CONFIG_SMP */
 #endif /* _ASM_ATOMIC_H */
index 0939462967e35d37a33aaf6ab3f86cf5f3bb36e3..596bb2706d81af24c8ae6a59b61ce04096651c68 100644 (file)
@@ -227,12 +227,7 @@ int ffs(int x)
 #include <asm-generic/bitops/find.h>
 #include <asm-generic/bitops/sched.h>
 #include <asm-generic/bitops/hweight.h>
-
-#define ext2_set_bit_atomic(lock, nr, addr) \
-       test_and_set_bit((nr), (addr))
-#define ext2_clear_bit_atomic(lock, nr, addr) \
-       test_and_clear_bit((nr), (addr))
-
+#include <asm-generic/bitops/ext2-atomic-setbit.h>
 #include <asm-generic/bitops/le.h>
 
 #endif /* __KERNEL__ */
index c8f6c82672adb46ceefb31f719c72d80bb53d3f3..c67c2b5365a6dbef415d767a69db49f73ea2ad69 100644 (file)
@@ -22,7 +22,7 @@
 #ifndef _ASM_MMU_CONTEXT_H
 #define _ASM_MMU_CONTEXT_H
 
-#include <asm/atomic.h>
+#include <linux/atomic.h>
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 #include <asm-generic/mm_hooks.h>
index 4c1b5cc14c190edc529c05844360f9fd52b1bb96..f7b3c9ab2cb581fed5a838dfed13b916f9abbf4f 100644 (file)
@@ -127,7 +127,6 @@ static inline void start_thread(struct pt_regs *regs,
 {
        struct thread_info *ti = current_thread_info();
        struct pt_regs *frame0;
-       set_fs(USER_DS);
 
        frame0 = thread_info_to_uregs(ti);
        frame0->epsw = EPSW_nSL | EPSW_IE | EPSW_IM;
index b6961811d4458d05a689908ac90686f13420c270..55b79ef10028cbc3253685acbf0979edd6784d08 100644 (file)
@@ -89,7 +89,6 @@ struct pt_regs {
 #define user_mode(regs)                        (((regs)->epsw & EPSW_nSL) == EPSW_nSL)
 #define instruction_pointer(regs)      ((regs)->pc)
 #define user_stack_pointer(regs) &nbs